control-panel observability child spec: logs surface (P10) — one shared kit screen, streaming in place #836
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#836
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Program map: #7 — Wayfinder map: OurCloud v1 program scope (Phase 0).
Design ticket: #760 — control-panel observability: logs surface in the dashboard (wire the dropped open-logs intents) (the arc was filed from the 2026-08-24
matou-distributed-serverscomparison rather than charted on the map; the map's v1 scope is what it lands inside).Design tier this spec is written against (all present, all
accepted):docs/adr/0203-design-the-dashboard-logs-surface-streams-in-place.md— the ruling DDR: one kit logs screen with two mounts and an embeddable scoped-tail face, SSE ruled in scoped to logs, the--oc-term-*vocabulary, in-place mounting with no standing entry, the followable-targets catalogue, the operator-only door, the honest level-chip split.docs/ux/flows/p10-logs.mermaid(+ the one newp5-monitoring.mermaidedge S3 → P10-S1; the other emitters' flows already carry ADR 0027's standing affordance and are not re-drawn).docs/ux/wireframes/p10-logs/—p10-e1-entry-points,p10-s1-logs-streaming,p10-s1x-stream-lost,p10-s2-paused-still-watching,p10-s0x-nothing-followable. Theirdata-field/data-action/data-statusattributes are the stable element-ID contract every acceptance criterion below is written against. (E1 depicts existing emitting screens to show the edge —design-verifymatches those elements against their own wireframes, not E1.)CONTEXT.md— Log target, Log scope, Follow (Language) and Logs surface (P10) object-states (Design nouns), merged with the arc.Siblings in the same observability arc (each specs separately, then all fan in at one
/slice-map): #759 device telemetry (specced as #769 — its kit primitives are this spec's status-dot dependency), #761 network, #762 replication matrix, #763 activity feed (its P12-S5 consumes this spec's scoped-tail face), #764 topology map (deferred).Problem Statement
The panel has been promising logs it cannot show. ADR 0027 rules Open / Download logs onto every deploy, update, rescue and monitoring surface — and the dashboard's screens duly offer them: monitoring's service drill-in, provisioning's deploy and rescue screens, the updates rollout screens, the mail readiness pair all emit
open-logs/download-logs. ButDashboardCompositionbinds only@route, so every one of those emits is silently dropped (FleetSurfaceparks its own as aPendingRoutetranslation that nothing answers). An operator watching a deploy hang, or standing on "chat is down 4 min", clicks Open logs and nothing happens.The logs viewer that does exist (A5) lives only in the Electron operator app, over the bounded operation log. The served dashboard — the surface an operator actually has open when a service misbehaves — has no logs surface at all, and no way to watch a live line arrive. For the low-skill, low-time operator this product is built for, the honest workaround is "SSH in", which is exactly what they cannot do. Logs are the escalation path that makes every plain-language diagnosis recoverable (download and hand the evidence to a helper); a promise-shaped button that does nothing is worse than no button.
Solution
The shell answers every emitter, in place, with one shared screen. Three things land:
The dropped intents are wired.
DashboardCompositionbindsopen-logs/download-logsbeside@route; every emitter converges on one intent-with-scope shape.open-logsmounts the logs surface in place over whichever tab's screen emitted it (the SetupSurface-on-Fleet drill-in pattern) — no seventh tab (ADR 0094), no navigation the operator didn't ask for, and no standing entry anywhere (the rescue tabless posture): an operator is led to logs by an emitting surface, never left to find them.download-logsmounts nothing — it fetches the bounded log artifact for the same scope as a direct browser download.One kit logs screen, two mounts, one embeddable face (the codes-ledger precedent). The kit gains
LogsScreen: the screen owns the controls (scope, search, level chips, pause, download) and the terminal panel; the feed is a seam-injected source with two faces. The app mounts it over A5's bounded operation-log read (contract preserved — a static feed is always "complete", so the stream-lifecycle chrome never appears there); the dashboard mounts it over the live stream source, which alone renders the stream's object-states — streaming / stream lost / paused / nothing followable, each a rendered frame (P10-S1 / S1x / S2 / S0x). The same component also exposes a scoped-tail face — the terminal panel with its live/paused/lost states, without the controls chrome — which the activity feed's select-event pairing embeds (DDR 0206, P12-S5). No second log reader exists anywhere.SSE is ruled in, scoped to logs. The control plane gains a log-stream hub (the prototype's
logstreammechanics ported: ref-counted follows, tail 200 on subscribe, 200 lines/s per-target cap, 2000-line ring for instant backlog, drop-oldest; slow subscribers drop lines rather than block) behind one SSE endpoint —EventSource, one-directional plain HTTP through the front door's gate, auto-reconnecting, no WebSocket machinery. Client guards ride with it: 2000-line client ring, 120 ms batched flush, 400-line render cap, 5-minute idle auto-pause with the "Still watching?" resume, pause ondocument.hiddenwith auto-resume. Every other dashboard read keeps its re-read cadence; live logs are the one surface where polling is genuinely wrong.What is followable is a server-side truth: a log scope (an operation log, a service, a node, or a subject reference) resolves through the control plane's followable-targets catalogue to log targets — bounded, replayable operation logs (the
LogRefids today's emitters carry, unchanged) and live service units. The whole surface, stream endpoint included, sits behind the community door, operators only (DDR 0172); no public tier exists, so no redaction tier is needed, and A5's secrets-never-enter-logs-by-construction rule stands. Level filtering is honest: operation logs carry structured levels, so there the chips filter authoritatively; raw service lines carry none, so there the chips are a named text-match heuristic — never presented as monitoring's classification.User Stories
A — The shell answers every emitter (E1; the dropped intents wired)
As an operator, I want Open logs to actually open logs from every surface that offers it, so that ADR 0027's promise is kept instead of silently dropped.
data-action="open-logs"control, Then the logs surface mounts, scoped to the emitting subject's log targets — the emit is bound in the one composition and no emitter's intent is dropped or parked.data-action="download-logs", Then that intent is likewise bound (stories 19–20).As an operator, I want the logs surface to land in place, so that opening logs never costs me my place in the panel.
open-logsemitted from a screen on tab T, When the surface mounts, Then P10-S1 renders in place over T (the SetupSurface-on-Fleet drill-in pattern), the browser URL is unchanged, no seventh tab appears (ADR 0094), and no modal is used.As an operator, I want Back to return me exactly where I was, so that the logs surface reads as a look, not a move.
data-action="back-to-emitter", Then the emitting screen resumes with its place held — no tab change ever happened.As an operator, I want no standing Logs entry anywhere, so that I am led to logs by the thing that needs them, never left to browse them.
As a maintainer, I want every emitter converging on one intent-with-scope shape, so that a new surface gains logs by emitting, never by wiring.
open-logscarrying a log scope (an operation log reference, a service, a node, or a subject reference);FleetSurface'sopen-log-<id>PendingRoutetranslation converges on the same shape.As an operator, I want opening logs on a subject with nothing to follow to land somewhere honest, so that an empty scope is never a dead click.
open-logswhose scope resolves to at least one log target, Then P10-S1 mounts streaming; Given a scope that resolves to none (service not deployed yet, operation log gone), Then P10-S0x mounts (stories 30–32) — never a blank terminal and never a toast.B — One kit screen, two mounts, one face (DDR 0203 ruling 1)
As a maintainer, I want one shared logs screen in the kit, so that the panel has one idiom for its one cross-cutting promise.
LogsScreen, Then it owns the controls (scope, search, level chips, pause, download) and the terminal panel, and its feed is a seam-injected source — the screen renders what the source declares and computes no truth of its own.As an operator in the app, I want A5 unchanged in behaviour, so that the share is invisible to me.
As an operator in the dashboard, I want the live mount to tell me the stream's own truth, so that liveness is a stated fact, not an assumption.
As a sibling surface, I want an embeddable scoped tail, so that I can show live lines without leaving my own frame.
As a maintainer, I want the stream indicator to be the arc's own primitive, so that the observability surfaces stay one visual language.
OcStatusDot) — referenced, never re-minted here.C — Streaming (P10-S1)
As an operator, I want a standing line that states what I'm following and how live it is, so that the stream's truth is always one glance away.
data-field="stream-standing"(data-status="streaming") renders the live dot and the scope's name, anddata-field="stream-meta"states the honest bounds in plain terms — live, the follow count, how much tail is kept and how many newest lines are shown.As an operator, I want the log lines readable and graded, so that a scan finds the error without reading every word.
data-field="log-stream"(data-status="streaming") renders each line with its timestamp and source in the dim ink and its message in the terminal ink, success lines in the ok ink and error lines in the err ink — every colour an--oc-term-*token (story 39).As an operator, I want to see and change what is being followed, so that I can walk from the emitting subject to a neighbouring target without starting over.
data-field="log-scope"names the resolved scope (e.g. the service and its unit count); When the operator picks another log target from it (a service unit, a node, an operation log — the catalogue's rows, story 32), Then the surface re-follows in place (the S1 → S1 re-scope edge) with the standing line and meta updated.As an operator, I want search to narrow lines within my scope, so that filtering and following stay different ideas.
data-field="log-search", Then only matching lines render; the scope, the follow and the hub subscription are unchanged (a filter narrows lines within a scope — CONTEXT.md's distinction).As an operator, I want the level chips to be honest about what they can know, so that a chip never impersonates monitoring's judgement.
data-action="filter-info"/"filter-warn"/"filter-error") is active, Then it filters authoritatively on the entry's level.As an operator, I want to pause on purpose, so that I can freeze the tail to read it.
data-action="pause-stream", Then the surface rests on the P10-S2 frame with its copy reading that the operator paused the stream (story 28), and the follow is released.As a maintainer, I want the client to guard itself, so that a busy stream cannot degrade the browser.
D — Download logs (no screen)
As an operator, I want Download logs to hand me the evidence directly, so that escalating to a helper is one act.
data-action="download-logs", Then the bounded log artifact for the current scope downloads as a direct browser download — nothing mounts, no screen appears, and a running stream keeps running (the S1 self-edge).data-action="download-logs", Then the same fetch happens for the emitter's scope without the surface ever mounting.As an operator in the app, I want A5's bundle untouched, so that the remote-helper path I know keeps working.
E — Stream lost (P10-S1x)
As an operator, I want a lost stream to be named the moment it is lost, so that I am never reassured by a frozen scroll.
data-field="stream-standing"flips todata-status="stream-lost"withdata-field="stream-meta"stating that nothing shown below is current, and the tail freezes visibly dimmed and end-marked (data-field="log-stream"data-status="stale") — never a stale scroll under a live dot (DDR 0096).As an operator, I want the loss explained as a rendered state, so that failure is never a toast or a silent spinner.
data-field="stream-lost-banner"(data-status="reconnecting") names the wall-clock moment the stream was lost, states that the lines below stop there — they are what arrived, not what is happening now — and states that reconnection is automatic.As an operator, I want recovery to need nothing from me, so that a blip heals itself.
data-status="streaming") with no operator act required.As an operator, I want the loss boundaries kept straight, so that one failure never wears another's face.
data-action="back-to-emitter"remains offered — the operator can leave a lost stream for the emitting screen.F — Paused (P10-S2)
As a community, I want a forgotten logs tab to cost the fleet nothing, so that observability never becomes load.
data-field="stream-standing"readsdata-status="paused-idle"with the meta stating no lines are being followed,data-field="idle-prompt"(data-status="paused-idle") asks "Still watching?" and names why streaming paused, and the hub follow is released (the ref-count decrements; at zero the upstream follow ends).As an operator, I want resume to be one act, so that answering "still watching?" costs nothing.
data-action="resume-stream", Then the stream reconnects, backfills from the hub's ring, and the surface returns to P10-S1.As an operator, I want a hidden tab to pause and resume by itself, so that I never manage the stream's lifecycle for the browser.
As an operator, I want paused, lost and live kept as three different truths, so that a deliberate rest never reads as a failure.
data-field="log-stream"data-status="paused"with the tail end-marked as paused and an invitation to resume; the operator's own pause rests on the same frame with its copy naming that the operator paused it; and nothing on the frame is dressed as lost (nothing failed) or as live.As an operator, I want to be able to leave a paused surface, so that pausing is never a trap.
data-action="back-to-emitter"is activated, Then the emitting screen resumes, place held.G — Nothing followable (P10-S0x)
As an operator, I want an empty scope named, so that "nothing here" is designed, not defaulted.
open-logsscope that resolves to no log target, Then P10-S0x renders withdata-field="no-targets-reason"stating in plain language why this subject has nothing to follow (e.g. no running unit on any node yet; no deploy has run so no operation log exists) — never a blank terminal (the never-empty spirit).As an operator, I want to be offered what the fleet can follow, so that the empty state is a door, not a wall.
data-field="followable-targets"lists the control plane's real catalogue — each row naming the target and its class (a live service unit, a finished replayable operation log) withdata-action="follow-target"— and When the operator picks a row, Then P10-S1 opens streaming that target (the S0x → S1 edge).As a maintainer, I want one catalogue read behind both offers, so that two controls can never disagree about what is followable.
H — The hub, the catalogue and the stream transport (DDR 0203 rulings 2 and 5)
As a maintainer, I want the hub to protect the fleet from its watchers, so that a log stream can never become a load problem.
As a maintainer, I want one boring stream transport, so that live logs ride the front door like everything else.
EventSource— one-directional, plain HTTP through the front door's gate, auto-reconnecting — with no WebSocket upgrade machinery.As an operator, I want both kinds of logs under one contract, so that "follow it" means the same act everywhere.
LogRefids today's emitters carry, unchanged) is bounded and replayable start-to-now, live-tailing while the operation runs; and a service unit is a live tail plus the hub ring's backlog, with no history beyond the ring.As a maintainer, I want scope resolution server-side, so that no browser ever guesses what a service runs on.
As a maintainer, I want the contract in the spec, so that the transport stays generated, not hand-rolled.
EventSource, a declared exception, never a hand-rolled fetch elsewhere.As a community, I want the whole surface behind the community door, so that logs are the operator's evidence and nobody else's.
EventSourcerides the same community session cookie, the gate'sforward_authcovers the SSE route like any admin route, and an unauthenticated caller is refused with nothing streamed.I — The terminal vocabulary (DDR 0203 ruling 3)
As a maintainer, I want the terminal's colours to be kit tokens, so that every log line in the product is painted from one place.
:rootdeclares the six terminal tokens —--oc-term-bg,--oc-term-ink,--oc-term-dim,--oc-term-ok,--oc-term-warn,--oc-term-err— at DDR 0203's values, as product language on the ADR 0122 token split (the community palette seam is untouched).As an operator, I want the terminal deliberately dark in both themes, so that logs read as logs everywhere.
--oc-term-bg(only that token ever varies per theme; its dark-mode re-point rides the dark-mode slice — out of scope here), timestamps, sources and end-marks wear the dim ink, and success/warning/error lines wear their inks — one vocabulary across the dashboard mount, the app mount and the embedded face.Implementation Decisions
Seams — one new control-plane seam at its highest point; everything else grows existing ones
FollowFuncshape): the hub asks "give me this log target's line stream" through an injected function, and everything above it — ref-counting, tail, rate cap, ring, SSE framing — is testable without a fleet. This is the highest point the new machinery can be cut at, and it is the only new seam class the spec mints.EventSourcebehind a thin transport boundary so a fakeEventSourcecan drive every lifecycle state in tests. The client guards (ring, flush, render cap, idle timer, visibility pause) live in the stream source, never in the component. Rejected: a second bespoke dashboard viewer — two idioms for one cross-cutting promise, the drift ADR 0027 exists to prevent.open-logscarries a log scope (operation log reference | service | node | subject reference);DashboardCompositionbinds the emits and hosts the overlay at the current mount — one binding answers every emitter, present and future (#763 included), andFleetSurface'sopen-log-<id>PendingRoutetranslation converges on the same shape. Shell composes and computes nothing (ADR 0097): the surface is shell's on both sides, as A5 already is.EventSource— the one declared exception, scoped to logs.--oc-*tokens at the ADR 0122 type floor), containers as the target model (log targets are the domain word), Pinia, an unauthenticated stream, dropped-line counters (the meta line states the bounds instead), and hand-fed topology (the catalogue is the control plane's own truth).Surface
← backreturning place-held — the SetupSurface-on-Fleet / P8-S7-on-Backups drill-in pattern; the six-tab set stays closed (ADR 0094); the rescue tabless posture (DDR 0101 §3) carries over whole.data-field/data-action/data-statusattributes are the built contract, carried verbatim from the wireframes sodesign-verifycan check the shipped UI against them.LogsScreen(controls + terminal + lifecycle states + the scoped-tail face) and the six--oc-term-*tokens; the app's A5 becomes a mount of it (contract preserved — gate D4); the dashboard's mount is new. The streaming/paused/lost dot wears #759's status-dot primitive.Collection and streaming
logstreamport (ref-counted follows, tail 200, 200 lines/s cap, 2000-line ring, drop-oldest, slow-subscriber drop), the catalogue read, the SSE route and the bounded-artifact fetch.LogRefis unchanged. Operation logs remain the bounded, replayable class they are today; the hub adds live service units beside them, not instead of them.Testing Decisions
A good test states externally-observable behaviour at a seam and never reaches into implementation detail. One new seam class (the hub's follow seam); everything else rides existing patterns:
LogsScreendriven against hand-written fakes of both feed faces, asserting on the wireframes'data-field/data-action/data-statuscontract: the static face never shows lifecycle chrome; the stream face renders all four object-states; chips filter authoritatively vs by named heuristic per the source's declaration; search narrows without re-following; the scoped-tail face renders the terminal + states without controls. Prior art: the shared codes-ledger tests (enrollmentCodes.test.ts),calloutVocabulary.test.ts, the kit theming tests.EventSource: every emitter'sopen-logsmounts in place scoped to its subject (none dropped), back resumes the emitter place-held, no standing entry exists, S1 vs S0x on catalogue resolution, stream-lost freeze/end-mark/auto-backfill, idle pause releases the follow and resume reconnects, hidden-tab pause/resume, download fetches without mounting. Prior art:dashboardShell.test.ts,fleet.test.ts,monitoringDrillIn.test.ts,surfaceFaultFrame.test.ts.hub_test/demux_test/follow_testported as prior art: one upstream follow per target however many subscribers, release at zero, tail-200 on subscribe, the 200 lines/s cap, ring drop-oldest at 2000, a slow subscriber drops lines while its peers keep streaming.provisionLive.test.ts,membersLive.test.ts).Cross-cutting checks ride existing harnesses: the theming contract tests (the six new tokens exist at
:root, zero raw hex in components, ADR 0122) and the client-guard unit tests at the stream-source module (ring 2000, 120 ms flush batching, 400-line render cap, the idle timer, the visibility handlers — all against fakes and fake timers, no real stream).Out of Scope
--oc-term-bg's dark value rides the dark-mode slice (ADR 0122); this spec declares the tokens light-theme-complete with the terminal dark in both themes.Further Notes
Vertical slices (named for the fan-in
/slice-map)ui-kit:logs-screen—LogsScreen(controls + terminal + lifecycle states + the scoped-tail face) and the six--oc-term-*tokens. Depends cross-arc onui-kit:telemetry-primitives(#769 slice 1) for the status-dot; #763's P12-S5 depends on this slice's face.control-plane:logstream-hub— the hub at its follow seam: ref-counted follows, tail 200, rate cap, ring, drop-oldest. Depends on nothing new.transport:logs-catalogue-and-stream— the OpenAPI catalogue read, the SSE stream route behind the community door, and the bounded-artifact fetch. Depends on 2.shell:logs-mount— the composition binding (every emitter, one intent shape), the in-place overlay, the stream source with its client guards, and the four frames S1 / S1x / S2 / S0x. Depends on 1 and 3.app:a5-rewire— A5 becomes a mount of the kit screen, contract preserved (gate D4's subject). Depends on 1.Cross-arc note for the fan-in: slice 1 is a consumer of #759's primitives root and a provider to #763; slice 3's scope resolution is what #763's subject-kind pairing rides. Slice 5 is deliberately last and severable (see D4).
The DDR's open gates (ADR 0174 — async veto, proposed defaults applied)
DDR 0203 is
acceptedwith three decisions held open for Ben; per the #769 ruling-1 precedent this spec proceeds on the DDR's defaults, and each gate maps to exactly the stories its veto would retire. (This feature's placement is not D1-dependent — the surface has no standing entry anywhere, story 4, so the arc's placement question never touches it.)app:a5-rewire): A5 keeps its current implementation and the accepted cost is two idioms for one promise. Stories 7, 9–11 re-scope to the dashboard side only — the kitLogsScreenstill ships, because the dashboard mount and #763's embedded face need it regardless.Implementation-time notes
docs/ux/flows/p5-monitoring.mermaidalready carries its S3 → P10-S1 edge (landed with the DDR); the other emitters' flows are not re-drawn — their Open/Download affordances carry ADR 0027's standing rule.design-verifymust match those elements against their own canonical wireframes, not E1.matou-distributed-servers,LogsConsole.vue+ Gointernal/logstream/) is a reference for mechanics only — the hub/ring/guard engineering transfers; nothing visual does.CONTEXT.mdrules the copy: say follow, log target, log scope, streaming / stream lost / paused / nothing followable; never tail (jargon), console (say logs surface), disconnected (say stream lost), offline (that's nodes), or live view (say streaming). Paused is deliberate — its copy never apologises and never implies failure.Produced by
/to-specin an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #760.Withdrawn — race duplicate. The interactive session drafted this in parallel while asleep mid-claim; the session-runner overrode the stale claim (its 05:33Z comment on #760) and published the canonical spec #791, which the slice-map fan-in (#770, commit
44cd080,docs/slices/observability.yaml) and/to-ticketshave already consumed. This duplicate is closed in #791's favour. Any materially unique findings from this draft are being transferred to #791 as comments.