Repository navigation
Description
Goal
Audit the append-watch cursor, ask ancestry and settlement, and the overlay lifecycle for open, settling, held and closed views. Keep overlapping transitions and orthogonal indexes independent. Preserve present interaction and reply behavior.
Yolo: the user delegated every decision except the merge to the agent.
Mode: plan-and-implement
Research
Base: 2337d2a8fc6953c388b474541bb2ed9594b70aa4 after #271. docks-kit agent-docs verify-skill detect reported verify skill: present. Local versions: docks-kit 0.31.0, Bun 1.4.5, git 2.53.0, gh 2.103.3. The real terminal baseline passed all 15 talk-ui checks with pinned omp 19.2.1.
Audited all tracked cli/talk paths except transport/ and the binding implementation assigned to #271. Dispositions below apply on this base.
tool/delivery.ts: the append cursor keeps a list and offset independently, and a scheduled flush keeps a cancel function and due time independently. Both allow stale dependent data. The message outcome union, active watch map, independent holds, queue membership/byte total, and counts of running handlers already encode distinct facts. Do not combine them.tool/asks.ts: ended ancestry rows still have active-only missed sweeps. Only active rows can beat. Both active and retained-ended parents route descendant asks. A fresh note can revive or reparent a retained row. Waiter settlement already has an owner: delete the exact waiter from the ask map, then clear the agent index, timer and abort listener exactly once. PreserveWaitResult,FirstEnd, and the separate inbound expiry queue.ui/command.ts: factory-localopenandbuildingjointly decide whether finish can act and whether it can defer hostdone. The observed overlay handle and its action on host close change across mount stages. A held outgoing overlay can coexist with the incoming mount, and an agent-initiated waiting overlay can remain tracked while already settled. Maintain both independent ownership slots. A stale factory or promise must not clear a newer observation.ui/views.ts: tagged choices, resize listing's one-shot signal, text and caret are already explicit or independent.ui/handover.tsbuilds and validates drafts;ui/card.tsrenders entries;ui/host.tsreads capabilities.extension.tsforwards UI, timer and lifecycle events;tool/tool.tstranslates typed outcomes. No duplicate phase in those callers.tool/{attachments,format,host,protocol,targets}.tsformat, schedule, decode or select;index.tsexports,types/pi-tui{,/text/width}.d.tsdeclare types, andlicenses/pi-intercom.txtis third-party text.
Delegated decisions:
- Give the cursor and flush schedule each one optional payload. Prefer this to adding tags alongside the old fields. Reset them on their original paths. Reuse the cursor for repeated scans of the same list.
- Represent retained ancestry separately from active sweep data. Keep the common parent ID; preserve nearest-registration and release rules. A single global agent phase would conflate these rows with waiter or registration ownership.
- Represent factory construction, accepting input and settlement explicitly. Do not replace simultaneous held, tracked or incoming views with one global enum. Assert focus, sends and cancellation under overlap, not the identity of internal callbacks.
- Use private local fixtures for both real surfaces. No live host state or credentials are needed. A fake-only pass would not verify the actual overlay and focus behavior. All choices are local and reversible in this child. No public API or dependency changes.
Steps
| # | Id | Task | Files | Depends | Effect | Status | Done when |
|---|---|---|---|---|---|---|---|
| 1 | delivery | Bind list/offset and flush deadline/cancel to their lifetimes; preserve timers and overlapping watches. | cli/talk/tool/delivery.ts, cli/test/unit/talk/delivery.test.ts |
- | local | done | No offset without its list or deadline without its timer. A1 passes. |
| 2 | asks | Limit heartbeat data to active rows; preserve re-note, reparent, retained route, settlement and release. | cli/talk/tool/asks.ts, cli/test/unit/talk/asks.test.ts |
- | local | done | Ended rows retain only their parent. A1 passes. |
| 3 | views | Make per-mount input/finish and observation phases explicit; keep outgoing focus ownership independent. | cli/talk/ui/command.ts, cli/test/unit/talk/command.test.ts, cli/test/lib/talkFlowHost.ts |
- | local | done | Synchronous finish, deferred mount, replacement, retained focus and close after settlement pass their A1 cases. |
| 4 | verify | Extend the existing talk-ui cancellation proof with buffered confirm-transition and Escape input; retain the single Escape case. Update the verification guide. Rebuild the extension and payload, regenerate the affected snapshots, and format them. |
.agents/skills/verify/scripts/omp-smoke.ts, .agents/skills/verify/SKILL.md, SoT/.omp/plugin/extensions/talk.js, cli/src/generated/sotPayload.ts, cli/test/goldens/mutation.json |
1, 2, 3 | local | done | A1–A3 pass with the rebuilt extension. A4 gates merge after the candidate passes review. |
Acceptance
| ID | Command | Expected |
|---|---|---|
| A1 | bun run test:unit cli/test/unit/talk/{delivery,asks,command,extension,handover,card}.test.ts |
Pass. Check same/replaced/shortened lists, last-watch release and failures, earlier flush and detach, retained and revived ancestry, waiter settlement races, immediate factory settlement and late callbacks after cancellation or replacement. Add deterministic behavioral coverage where absent. |
| A2 | bun run check:types; scoped repository lint and format checks; bun run check:generated; bun run test:unit cli/test/unit/talk/build.test.ts. For snapshots use the three commands below. |
All exit zero. Compare the before and after snapshot bytes: nothing except the twelve digest replacements changes. Inspect the changed source to confirm the old independent flags and sentinels are gone. |
| A3 | From the mounted checkout root, run bun --no-env-file .agents/skills/verify/scripts/omp-smoke.ts "$mode" --repo "$PWD" --omp "$VERIFIED_OMP" for talk and talk-ui. |
Both exit zero, with all 21 talk and 15 terminal checks. Talk checks stale-instance rejection and new-session delivery; A1 verifies the separate queued-message detach/reattach outcome. Check one bare Escape and a separate buffered Ctrl+S with complete Escape encoding in handover review. Require cancellation in both cases, no peer draft, subsequent sentinel delivery, process exits and registry cleanup. |
| A4 | Request Full CI by marking the reviewed draft PR ready; check the required status, run jobs, head and tested merge parents. |
All jobs succeed on the merge of the current main and reviewed head. A missing, skipped, failed or stale result blocks merge. |
Snapshot regeneration, after rebuilding both generated outputs: (1) GOLDEN_FILTER='^fixture=[^ ]+ cmd=sync( |$)' bun run golden:mutation --update-goldens; (2) bun run format; (3) GOLDEN_FILTER='^fixture=[^ ]+ cmd=sync( |$)' bun run golden:mutation. That selector matches exactly twelve tracked cases on the base. On final reruns use only the read-only check; do not regenerate a broken expectation to make it pass.
A3 isolation: use the #271 A4 private namespace and verified binary; change the driver working directory to the read-only mounted checkout. The driver creates separate private omp working directories. Use a fresh temporary filesystem and home, clear inherited environment variables, enable terminal color and use only the local fixture provider. Do not inspect a live registry. For the paired input, write Ctrl+S followed by ESC [ 27 u (bytes 13 1b 5b 32 37 75 in hex) atomically. Unlike trailing bare Escape, the pinned decoder can recognize the complete sequence without its solitary-Escape timeout. Keep the original bare Escape test separate.
Do not touch
Keep commands, UX text, wire shapes, identity checks, waiting limits and ordering unchanged. No releases or production changes. Do not modify transport, registration, branch rules, or third-party files.
Open questions
Verification Results
Reviewed candidate d9ecc2fef9c891002e49e56a56509f2a41113387 on base 2337d2a8fc6953c388b474541bb2ed9594b70aa4. The final change only clarifies the guide and one source comment. Types, lint, formatting and generated files passed afterward; executable artifacts are unchanged.
- A1: 472 tests passed across all six focused files (464 on base). The new cases cover revived ancestry, queue rescheduling and replacement, two simultaneous watches failing on one read and a fresh delivery afterward, late factory arrival, and open versus settled review cancellation while a replacement factory waits.
- A2: type checking exited zero with two existing suggestions in unrelated commands. Scoped lint and formatting passed. Both generated outputs are current. All 97 build tests and all twelve affected sync snapshots passed. Byte comparison confirmed that only twelve bundle digests changed in the snapshots. The append cursor and flush timer own their dependent data, active ancestry counts sweeps while retained ancestry does not, and the overlay phase distinguishes construction, active input and settlement.
- A3: real pinned omp in a private namespace passed all 21 messaging and 15 terminal checks. A marker key reached the composer after open-review Escape but not after Ctrl+S and Escape in one input batch. Only the sentinel reached the peer. A separate private run omitted Ctrl+S but kept the same Escape and marker. That run exited 1 at
ui-tool-handover-cancelwith the focus-probe diagnostic and cleaned its registry. Only the negative fixture differed, not the shipped plugin. - A4: PR #278 passed all ten jobs in CI run 46573646851. The ready event, authorized actor, Actions app, required
Full CIjob 142392910792, and merge parents matched the reviewed head and currentmain. GitHub returnedCLEAN. The complete localbun run checkwas not run.
Activity
DocksDocks commentedon Nov 30, 2026
Delegation grant: yolo: next up is a yolo issue for "scan this codebase for any implicit state machines and make it explicit"
Parent event: 7294751276
DocksDocks commentedon Dec 1, 2026
Delegation grant: yolo: do all issues remaining following yolo skill without asking please.
Parent event: 7294751276
DocksDocks commentedon Dec 1, 2026
Plan review round 1
Plan-review: repair
viewsandverify, Acceptance A3 and A4 - The proof runs too late for both step dependencies.viewsrequires A3 beforeverifycan rebuild, butomp-smoke.ts:2152–2157copies the shipped plugin, so that run can pass against the old bundle.verifythen requires A4 before it is done, but the plan-manager skill places step completion before code review andAGENTS.md:81requires review of the exact candidate before marking the PR ready - Finishviewswith A1, run A3 after rebuilding inverify, and keep A4 as the separate landing gate - class: step completion depends on a later gateviews, Acceptance A3 - The documented focus guarantee applies between overlays: a second key in the same input batch must reach the settled talk view, not omp's composer (cli/docs/talk-ui.md:142–159). The realcomposeToPeerwaits for the next view after each Enter, and the cancellation case waits for the review before sending Escape (omp-smoke.ts:3456–3470,3709–3721). Inference: a regression that returns focus to the composer too early can pass those checks - Extend the existing PTY check to drive one buffered transition and assert the observable result, such as cancellation without a send or text leaking into the composer. Include the driver inFiles- class: terminal check skips the focus handoffomp-smoke.ts:2575–2630,2672–2696). Inference: a detach regression that carries old queued work into the new session can pass A3, despite the documented queue-drop behavior incli/docs/talk-tool.md:830–835- State that A3 checks stale-instance rejection and name A1's queued-message detach and reattach assertion as the release proof, or carry a queued message through replacement in A3 and assert that it never lands in the new transcript - class: release check clears the state before replacementomp-smoke.ts:225–227only reads--repoafter startup. From the temporary directory, Bun cannot find the script - Invoke the driver from the mounted checkout and keep the omp work directory private, or give Bun the script's mounted path as well as--repo- class: entry path does not resolve from the stated working directoryverify, Acceptance A2 - The snapshot writer rewrites the whole JSON file withstableStringify, which expands arrays such as the committed"command": ["sync"](cli/test/golden-mutation.ts:462–473,cli/test/lib/goldenSnapshot.ts:288–290,cli/test/goldens/mutation.json:5). A2 checks formatting only on changed TypeScript, so it can pass while the snapshot has unrelated formatting changes and fails the later format gate.AGENTS.md:71explicitly requiresbun run formatafter--update-goldens- Run the required formatter after the writer and before checking that the snapshot diff changes only the twelve bundle digests - class: generated snapshot misses required post-write formattingDocksDocks commentedon Dec 1, 2026
Plan review round 2, delta
Plan-review: repair
verifyand Acceptance A3, buffered Ctrl+S then Escape - A single PTY write does not make the driver's existing bare Escape byte dispatch with Ctrl+S (omp-smoke.ts:2798,2942,3717). The pinned omp tokenizer emits Ctrl+S immediately but holds a trailing bare Escape for a timer. Inference: confirm mounts first, then Escape returns to review rather than cancelling the tool (cli/talk/ui/views.ts:645–647,cli/talk/ui/command.ts:631). The cancellation result never arrives on the correct implementation - Specify a complete Escape encoding that the pinned decoder accepts, such as\x1b[27u, in the same write as Ctrl+S. Keep bare Escape for the separate single-key case - class: terminal encoding defers the key past the focus handoffbun run golden:mutationcommand does not select the twelve cases or write snapshots.cli/test/lib/goldenCli.ts:23–43readsGOLDEN_FILTERas a regex on case labels, not tree paths, andcli/test/golden-mutation.ts:446–478writes only with--update-goldens. With no filter, the command also checks the unrelated toolchain snapshot and channel invariants - Give the writer and subsequent read-only check the sameGOLDEN_FILTER='^fixture=[^ ]+ cmd=sync( |$)', add--update-goldensonly to the writer, and runbun run formatbetween them - class: acceptance command omits the required selector and write modedocs/PLAN.md:35–36. The smoke driver already starts omp in its private scratch work directory (omp-smoke.ts:1368,1400,3749–3753), so the driver does not need to start there to isolate the sessions - Invoke the driver by its repository-relative path from the read-only checkout root inside the same namespace. Keep the private home, temporary filesystem, and omp working directory - class: acceptance working directory contradicts repository rulesPrevious findings:
viewsandverify, Acceptance A3 and A4: resolved -viewsfinishes with A1,verifyruns A3 against the rebuilt bundle, and A4 gates merge after review.views, Acceptance A3: open - repeated above.cli/test/unit/talk/delivery.test.ts:812–826.verify, Acceptance A2: resolved - A2 now requires formatting after the writer and checking that only the twelve digest values changed.Manager response to round 1
Repaired: (1) The source steps finish with A1, the build step runs A3 after regeneration, and A4 is a separate landing gate. (2) A3 retains the original cancellation and adds buffered Ctrl+S plus Escape on the real terminal. (3) A3 now claims only the stale-instance outcome; A1 owns queue detach and reattach. (4) A3 uses the full mounted driver path from the private directory. (5) A2 requires formatting the snapshot and verifying all bytes other than the twelve digests remain unchanged.
Rejected: none.
Redesigned: none.
DocksDocks commentedon Dec 1, 2026
Plan review round 3, delta
Plan-review: pass
None.
Previous findings:
verifyand Acceptance A3, buffered Ctrl+S then Escape: resolved - A3 now sends Ctrl+S and the completeESC [ 27 usequence in one write. The pinned tokenizer can dispatch both in the same read without the bare Escape timeout. The bare Escape case stays separate.Manager response to round 2
Repaired: specified the writer, formatter and read-only mutation command, using the same anchored selector for twelve sync cases; the driver now starts from the mounted repository root, and omp still runs in private child directories.
Rejected: none.
Redesigned: use a complete extended Escape key after Ctrl+S in one write, because the tokenizer holds a trailing bare Escape until timeout. The isolated single Escape case remains unchanged.
DocksDocks commentedon Dec 1, 2026
Self-review
Correctness
cli/talk/ui/command.ts,mountsets localphasealongsideview.onClose. After an untracked choice the local phase isSettledbut the view object can still reportAccepting. Unobserving the object prevents an incorrect close today. Use a single per-view state for both settlement and the host-close action so those facts cannot diverge. Keepflow.heldindependent; it can overlap the next observation.Spec and tests
No findings. The replacement test exercises the late factory; the deterministic queue tests distinguish the old and new due times. The real terminal test also checks cancellation during the focus transition.
Text and safety
No findings. The guide matches both cancellation paths. The driver uses isolated sessions and requires actual peer history for the sentinel proof.
DocksDocks commentedon Dec 1, 2026
Code review round 1, lens correctness
Code-review: pass
Standards
None.
Spec
None.
Code review round 1, lens spec-and-tests
Code-review: pass
Standards
Spec
sendMessagebefore a watch starts. It does not check that a transcript read failure ends all active watches asunknown. - Use the fake clock to fail a transcript read with two watches active. Assert that both outcomes becomeunknownimmediately and that a later delivery can confirm. - class: missing active watch failure coverageCode review round 1, lens text-and-safety
Code-review: pass
Standards
/talk handoverexample starts the operator flow and never gets the expected tool result. The row also omits the sentinel text and the notice observation window. - Refer to theSMOKE-HANDOVERprompt, specifytoas the full peer session ID, and restore the sentinel text and 500 ms notice check. - class: incomplete verification procedureAcceptingholds the view until the next mount. Escape in the review choosesCancel, which aborts the flow and closes the view immediately. The comment gives the wrong lifecycle rule for cancellation. - Say that only a choice that continues the flow holds the view. - class: misleading lifecycle documentationSpec
None.
DocksDocks commentedon Dec 1, 2026
Code review round 2, delta
Code-review: pass
Previous findings
unknownand that a later delivery confirms.mountcomment still gives the wrong rule for held views. Repeated under Standards.Standards
zprefix in a separate composer prompt after each encoded Escape case, not in the cancellation result. - Tell the reader to type and submit a fresh prompt after each encoded Escape case, then check whether its submitted text starts withz. - class: incomplete verification procedureConfirmchoice, notendedas themountcomment says. The same comment says any non-ending choice keeps focus, but a choice during construction closes immediately. - Distinguish construction, cancellation before a choice, and release of a held view. - class: misleading lifecycle documentationSpec
None.
Manager response to round 1
Repaired:
Rejected: none.
Redesigned: the cancellation result alone could not prove which overlay received Escape. The real positive and negative cases now distinguish the actual composer input after the transition, without inspecting internal state.
DocksDocks commentedon Dec 1, 2026
Code review round 3, delta
Code-review: pass
Previous findings
z, matching the fixture check in .agents/skills/verify/scripts/omp-smoke.ts:3743-3768.mountcomment now distinguishes immediate completion during construction, cancellation before a choice, and release with the saved choice. That matches cli/talk/ui/command.ts:500-525 and the held-review assertion in cli/test/unit/talk/command.test.ts:1203-1225.Standards
None.
Spec
None.
Manager response to round 2
Repaired: the smoke instructions now require submitting the distinct follow-up prompt after each encoded Escape and specify the expected prefix.
Rejected: none.
Redesigned: replaced the generic mount lifetime paragraph with the three observable paths: a construction-time choice, cancellation before choosing, and release of an already held choice. The latter passes its original result.
DocksDocks commentedon Dec 1, 2026
Archived with landing pull request #278