Skip to content

The desk, DC6: the web app's session depth (transcript streaming, subagents, diff, info, the transcript slot) - #12

Merged
SSFSKIM merged 77 commits into
masterfrom
smns-erb-depth
Oct 16, 2026
Merged

SSFSKIM merged 77 commits into
masterfrom
smns-erb-depth

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 15, 2026

Copy link
Copy Markdown
Owner

The desk web app's session depth (child DC6 of the desk composite, docs/doperpowers/specs/2026-10-15-desk-design.md). The plan is docs/doperpowers/plans/2026-10-15-desk-dc6-depth.md, and its Decision Log carries every ruling made during the build.

Stacked PR. This is based on smns-erb-web (DC5, the web shell). Its diff also carries smns-erb merges, and those are DC3's hub and fake machine, reviewed on their own branch. DC6's own work is the first-parent, non-merge commits of 6ada9f12..HEAD on smns-erb-depth, under these paths:

  • apps/desk-web/src/depth/**
  • apps/desk-web/e2e/depth*.ts and e2e/fake-machine.ts
  • apps/desk-web/test/double/{session-stream,fake-plane}.ts
  • apps/desk-web/test/fixtures/depth/**
  • the connectDepth() line in src/main.tsx, the Tailwind @source lines in src/styles/app.css, the desk-web configs, and the window.maws rule in eslint.config.js

Per the composite's writer, the desk lands on master as DC3, then DC5, then DC6; this PR is retargeted to master once DC5's merges.

What it does

connectDepth() registers two DX8 slots.

  • depth, the right column, has four tabs:
    • Transcript: MAWS's transcript view fed by a TranscriptSource over DX8's SessionPlane.
      • Streamed text lives in the adapter's own layer and settles per content block: on the row its block-row named, at once for another agent's block, and at step-end for a block with no block-row.
      • Older rows page in by chronological rebuild, and the reader keeps their place.
      • A reset reads as reconnecting. After any other end the transcript is retried at once when the session becomes reachable again, and otherwise on a backoff from 1 s to 60 s while it stays reachable; it is never retried while unreachable.
      • <message> marks draw as MAWS's Presenter draws them.
    • Subagents: the tree from subagents, with each agent's transcript on its own subscription.
    • Diff: Subscription.diff() on open and on refresh, drawn through splitPatch and ReviewView.
    • Info: machine, cwd, and worktree from DeskSession; model from the transcript; context and cost from DX4 usage.
  • transcript, one fold of a direct channel's working record, drawn through the to-human Presenter over the exclusive range {from, to}. A bound is a <message> span or a question's toolUseId ?? request.

Transcript text is untrusted, and this page holds the org key. Text renders only through MAWS's Markdown and Presenter sanitization. Links open with no opener and pass a scheme allowlist. A lint rule forbids window.maws and globalThis.maws in apps/desk-web/src.

Validation Evidence

  • The whole gate is green on the Linux lane. scripts/ci-gate.sh --runner linux passes static, unit, and e2e:desk-web (67 browser tests): run https://github.com/SSFSKIM/MAWS/actions/runs/38818748087 on 82b812e4. Only plan-doc commits followed it.
  • The acceptance passes against DC3's fake machine. apps/desk-web/e2e/depth-acceptance.spec.ts replays the two-subagent recording through SessionDepth and DC5's DX3 double in Chromium, in the same run. It shows:
    • streamed text settles into the rows a reload draws, compared as data across the whole virtualized list;
    • the subagent tree matches the recording's metas;
    • the diff renders;
    • a reconnect mid-response, a hub restart, and a chunk during the snapshot each end with no gap and no duplicated text, in the main thread and in a subagent;
    • a fold bounded by the recorded question's toolUseId resolves.
  • The adapter's unit tests pass. pnpm --filter desk-web exec vitest run src/depth passes 94/94 across 13 files. They run MAWS's real store, reducer, and backfill, and cover per-block settling, step-end, late metadata, a reset during a rebuild, paging across a split tool call, and the resubscribe rule.
  • Hostile text draws inert. In apps/desk-web/e2e/depth.spec.ts, a row carrying a script, raw HTML, and a javascript: link, both streaming and settled, executes nothing, and links open with no opener.
  • MAWS's own suite is unchanged. No file under src/renderer is edited on this branch; the unit gate covers it.
  • Reviews are clean. Each milestone was task-reviewed clean after its fix waves. The final whole-branch high review (doperpowers:review-code, reviewer-high) found one P2, a resubscribe loop on terminal errors. The first fix (64481c89) stranded a transcript when the hub replaces a machine online-to-online. The fix that holds is 82b812e4: an immediate retry on reachability returning, a 1 s to 60 s backoff while the session stays reachable, and no retry while unreachable. It was re-checked.

Unresolved Review Findings

  • The lazy depth chunk is heavy. It carries xterm and mermaid: Vite warns of chunks over 500 kB, and mermaid alone is 1,634.88 kB (apps/desk-web/vite.config.ts). This is the accepted cost of importing MAWS's transcript view without cutting edges. DC5's M4 measures load on the phone, and the decision is left there.

Residue

  • The gate does not return desk-web browser traces. It uploads only the repo root's test-results/, so a failing desk-web trace never comes back from the Linux lane. This cost a blind re-run during M2 and M3. The fix is to add apps/desk-web/test-results/ to the gate's artifact upload (.github/workflows/gate.yml).
  • desk-hub's enrollment.test.ts flakes. It failed twice on the Linux lane, once with 502 vs 404 and once with 502 vs 400 on the 64 KiB case, and passed on rerun both times. This is DC3's to investigate; it has already been reported to the composite's writer.

…ows by chronological rebuild, M3 usage from DX4 (composite d349a87)
The depth column draws the selected direct channel's main transcript with
MAWS's transcript view over DX8's session plane: rows mapped by MAWS's
backfill under one ordered context, a streaming layer beside the store
(chunks per content block, dropped once the block-row's row is applied),
older rows rebuilt chronologically under a staged source, reset and end
handled as DX8 states. Fixture: one scrubbed throwaway session with two
subagents; the live part synthesized from its rows.
# Conflicts:
#	apps/desk-web/tsconfig.node.json
… a reset reaches the attached source mid-rebuild
…on, each agent's transcript on its own

The depth column gains its Subagents tab. The tree is MAWS's task graph
(tools/agents/model) fed from what a main-transcript subscription carries:
DX4's subagents metas as the sidecars and the held rows' backfill events
as the wire, so it grows as agents start and follows each to its end with
no seq or launch ids to stamp. It draws through a copy of MAWS's Subagents
lists; opening an agent mounts a copy of MAWS's drill-in (no Stop, no
relay: depth issues no writes) over the agent's own DeskTranscript
subscription, scoped by agentId, with its own reset and end. An Agent
call's row in the main transcript opens its agent. The transcript pane is
factored out of the column so both transcripts share it; the main pane
stays mounted beneath the Subagents tab so its place is kept.
…fences at EOF, unfolding after a reset, fold height

A question's from bound starts after its call and leaves out only its own answer (a parallel tool's call and result
between them are drawn). A fold says its end is unresolved once no older page can help (its start held), not only
when the transcript is exhausted. A fence closed on the text's last line is not reopened before a live span's closing
tag. A fold reopens its finished turns after a reset (MAWS forgets disclosure then), never those the reader folded.
The fold is as tall as what it draws, up to min(60vh, 480px).
…question's toolUseId; SessionDepth from the fake machine's index

DC3's fake now annotates the recorded ask question with its transcript call (toolUseId) and exports SessionDepth: the
deep import goes, and the acceptance raises the recorded question and logs the recorded message, then unfolds the folds
on either side of the question and finds both bounds in the transcript (no open-bound note, nothing drawn from the
start, the answer and the bounding span left out).
…king MAWS's virtualized list from top to end

Comparing only the rows rendered near the viewport depended on where the list sat: on the merged tip the first prompt
row fell just outside the window before the reload and inside it after.
…nly when its session becomes reachable again

After an end other than a discontinuity, depth subscribes again only once the session was unreachable since its last
snapshot and is reachable now; a terminal error while it stays reachable (an agent's transcript the machine cannot
serve) no longer resubscribes at once without end. A turn the reader folds and then opens again is reopened after the
next reset. The acceptance's row walk fails when it does not reach the transcript's end.
…with backoff while its session stays reachable

A machine replaced while its lease was fresh ends its old subscriptions machine-offline with no offline presence in
between, so waiting for a reachability transition stranded the transcript. After an end other than a discontinuity,
depth now retries while the session is reachable after 1 s, doubling to 60 s, reset by a snapshot; it still takes the
transcript up at once on an unreachable-to-reachable transition and never retries while unreachable. The ended note
says when it tries again.
SSFSKIM added a commit that referenced this pull request Oct 16, 2026
@SSFSKIM
SSFSKIM changed the base branch from smns-erb-web to master October 16, 2026 12:36
# Conflicts:
#	apps/desk-web/src/main.tsx
…g, folds cut by the export's grammar, results with their calls

Older rows are paged in until a page adds a drawn row or none remain (older-pages.ts): an empty list cannot scroll,
and a page of attachments while the reader is at the top asks for the next. A fold cuts a row by the spans
sminos record numbered, read with a port of doperpowers' sminos_marks.py (export-marks.ts: an unclosed mark is a span
to the end). A tool's result draws with its call, as MAWS's derivation draws the pair at the call's place: a fold
holding a call takes its result written after the fold's end, and a fold after the call leaves the result out.
…ll keeps its rows that hold no result

filterResults dropped any row whose content was not an array of blocks (a prompt, a string-content task
notification) once an earlier call existed, so a fold after a question or a message that followed a tool call lost
its prompts. A row holding no result now passes through a fold's own rows unchanged; only the late-result projection
takes results alone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant