Ticket #74 verification — streaming ghost settlement, honest activity verbs — 2026-11-03
Parent spec #66 (conversation surfaces and approval trust), child ticket #74 (fix the remaining $Name · checking the details… ghost after both turns finished/handed off). Worktree: /tmp/opencode/ensemble-worktrees/55-74-activity, branch feat/v55-74, base a15ff07 (= integration/ensemble-v5.5 tip; merged tip before reporting).
Environment
export PATH=$HOME/.nvm/versions/node/v26.12.1/bin:$HOME/.local/bin:$PATH($HOME is /home/tristan; the brief's literal /home/tristan/.nvm/versions/node/v26.12.1/bin does not exist — the real node lives under $HOME/.nvm/versions/node/v26.12.1/bin, v26.12.1. The worktree had no node_modules, so it symlinks the parent repo's node_modules for tsc; no repo files were touched by this.) node --version: v26.12.1. Observed host opencode --version: 2.2.5.
Command results
| Exact command | Result |
|---|---|
npm run check | Exit 0; strict no-emit TypeScript check. |
npm test | Exit 0; 365 passed, 0 failed, 0 skipped (9 new src/v2/tui/ticket-74.test.ts; +2 from the merged #72 bubble tests). |
npm run test:live:fake | Exit 0; fake live-check passed; ticket #74 pins green (live verb reads working…, no ghost checking line after completions). |
npm run test:live:fake:empty | Exit 0; fake empty-catalog live-check passed; no skips. |
npm run test:live | Exit 0; live-check passed; no skips. |
Unit and live checks ran separately (unit first, then live); live results reported here, not folded into the unit count.
Reproduction evidence (red → green)
src/v2/tui/ticket-74.test.ts was written first against the old code and failed as required (no settleStreamMessage / mergeStreamingActivity exports; stale-clock and verb assertions against the old behavior). After the fix it passes 9/9:
- Settling a stream always clears
streamingand records the final text, even on epoch mismatch (the ghost shape:streaming: truepersisted past finalize). - Settled streams carry a last-delta heartbeat (
updatedAt). - Fresh task-less streams merge as honest
working…, never the genericchecking the details…. - Stale orphaned streams merge to nothing (hidden, never wedged).
- Task-backed agents never gain a duplicate streaming line.
- Staleness follows the last delta (
updatedAt), not creation: an old row with a fresh heartbeat is live; a young row with no heartbeat for the full window is an orphan. - A live batch review reads as reviewing, never self-
Waiting for $Leader…. - Pending completion hops attribute to the leader (queued under the leader's key, nothing live for the finisher).
- Finisher absence: two replied turns plus two pending completion hops yield zero live lines for either finisher and zero
checkingverbs.
Behavior notes
finalizeStream(src/v2/service.ts) now settles through the exported puresettleStreamMessageon both epoch paths: stale content is still rejected (returnsundefined), but the row is cleared (streaming: false), text-stamped, heartbeat-stamped, and persisted — no more orphaned live rows aging out over 120 s.Messagegains optionalupdatedAt(last delta/finalize write), stamped on streaming-row creation, on every delta heartbeat save, and on settle.isActivityStaleruns onupdatedAt ?? createdAt, so long live streams stay visible while fresh and orphaned rows expire promptly.- The TUI merge (
src/v2/tui/app.tsx) delegates to the exported puremergeStreamingActivity(src/v2/tui/workrows.ts): task-less streaming rows show honestworking…(kindworking) only while fresh, otherwise hidden; task-backed agents are never duplicated. activityStateForTask:handoff.batchtasks readreviewing completions…,handoff.completiontasks readreviewing…(pending hops stay queued under the leader's key, so these verbs only display while live); the awaiting-children branch names only a different assignee and otherwise reads honestworking…— self-Waiting for $Leader…is gone.- Untouched: #70 truthful states (approval/native waits, retrying, Asking), #71 handoff/batch/loop-guard semantics and copy, bubbles, completions, approvals,
$Name/@rules. Two live-script anchors updated to the new honest verb (· working…while live in group and DM flows); allcheckingabsence assertions kept and extended with the post-batch finisher-absence pin.
Uncertainty
- No live macOS run; live runs recorded against host 2.2.5 while typechecking pinned types 2.2.1 — no new host APIs used (text anchors only), but declaration parity is not runtime proof.
/tmp/opencode/v55-transcript-notes.md(named in the brief) does not exist in this environment; diagnosis used/tmp/opencode/v56-activity-hang-notes.mdplus the merged code.- The epoch-mismatch settle path is unit-pinned through the exported
settleStreamMessagehelper plus the always-settlefinalizeStreamstructure; no deterministic service-level race test exists (epoch bumps only via reset/workspace lifecycle), with the live finisher-absence pin as end-to-end cover.
Merged-tip fix-ups (integration tip arrived red)
Merging integration/ensemble-v5.5 (ticket #72) broke test:live:fake in two places, both reproduced on the pristine tip in a control worktree (git worktree add /tmp/opencode/control-72 640dc7e, since removed) — pre-existing, not caused by this ticket:
- Bubble border assertion. #72 gave user bubbles a visible rounded border edge; the older text-capture assertion still assumed a borderless bubble (
{15,}fake-queue-alpha), failing deterministically. Updated to{15,}│ fake-queue-alpha, matching #72's stated design (right-aligned with a quiet but visible edge). - Provider fixture precedence.
scripts/fake-provider.mjsservedRICH_MARKDOWNwhenever the prompt contained the rich trigger, but the DM session history always contains it by the time the #72 bubble block runs — so the bubble markers could never render (deterministic 20 s timeout). Precedence is now latest-trigger-wins (bubbleAt > richAt ? BUBBLE : …), which changes behavior only when the bubble trigger is present and latest. - Input-delivery flake + composer-reset hazard. After a heavy reply mounts, follow-up
i/type bursts are silently dropped most runs (control tip included; tmux primitives verified healthy againstcat, so the drop is inside the TUI/host input path). Hardened the two DM sends after heavy renders with: an empty-composer gate (Message…placeholder proves the previous send cleared — the streaming-line absence alone does not coverinvoke→clearComposer), focus gated onCOMPOSER, send gated on the composer echo, and bounded retries. Sharp edge discovered the hard way: a bareEscapeon a closed composer falls through to opencode and navigates away from Ensemble (killing the session into the launcher) — resets are therefore applied only whileCOMPOSERis visible. A bareion an open composer types a literali; the echo gate catches that too.