Repository navigation
Description
Goal
Fix #279 in the local verification driver. Preserve observed exits across output drain, require confirmed exit for the closed-peer probe, and report an unconfirmed shutdown accurately in both modes. Cover both deadline orderings deterministically.
Yolo: the user delegated every decision except the merge to the agent.
Mode: plan-and-implement
Research
Base 49f308a17a13c116bf4bfa0adf0289fe280b7da8. In .agents/skills/verify/scripts/omp-smoke.ts, startRpcOmp resolves exited inside end, which waits for the pipes. The final 10 s SIGKILL wait therefore races an unrelated 250 ms drain. talkMode sends to the closed endpoint without inspecting that result. talkMode and talkUiMode both interpolate a timeout as an exit code. The process handle is already stored before readiness; the registry scan already precedes close. Keep those boundaries.
- Decision: separate process evidence from stream cleanup in the fixture only. Node documents that
exitcan precedeclose, including for shared pipes. Keep the existing stdin, SIGTERM and SIGKILL stages. Once exit is observed, send no more signals and allow at most the existing drain interval. A null exit code from a signal is confirmed exit, not a deadline. A failed spawn is not a confirmed exit. A late event cannot replace a returned timeout. Keep stderr for warning checks. Reject increasing the timeout: a descendant can keep a pipe indefinitely. Reject treating a dead socket as process evidence: an endpoint can close before exit. One change moves both modes and the probe; revert it as a unit if buffered replies, normal output, bounded waits or scan ordering regress. - Decision: exercise the production close path with a synthetic event source and Vitest's controlled clock. The alternate real stuck process is neither safe nor deterministic. Assert the observed code, deadline diagnostic, buffered output and whether the actual not-live probe runs. A regression could pass a helper test if a mode bypasses it: share the peer verdict and run both real V6 modes as a separate check. Keep the module private to checkout verification, with no CLI flag or dependency. These choices are locally reversible and do not change a shipped package.
For the real failure paths, use a checked-in test-only Bun preload. A local Bun 1.4.5 probe confirmed that the replacement is scoped to the driver process. Close the real peer normally first; then substitute the unconfirmed result only at the shutdown boundary. Do not replace the mode, report builder, probe, stdin, exit code of the driver, or its registry checks. Detect any sender send after that boundary independently. This separates proof that the real controller detects a timeout (virtual time) from proof that each whole mode handles it (driven output).
Tools: Bun 1.4.5, Node 26.13.0, Git 2.53.0, gh 2.103.3, docks-kit 0.31.0 and Bubblewrap 0.11.1 (local version output). package.json pins Vitest 5.1.2, Oxlint 1.95.0, TypeScript 7.0.2, and Effect tsgo 0.74.1. docks-kit agent-docs verify-skill detect reported verify skill: present. Use V6 with the verified omp 19.2.1 of SoT/toolchain.json, not the workstation's newer omp. On Linux the upstream v19.2.1 binary has SHA-256 e8b937f9bf023baa147bdd300ad5421af0a6ef8b1f350c47a9a93d5fca94feca. Use private PID, network and mount namespaces, fixture home and temporary registry, and a loopback model. Do not mount the host home, temporary directory, Git database or credentials.
Engineering standards
Step shutdown: fix-workflow, tdd-workflow, type-safety-discipline, code-clarity and commit-discipline. One focused green commit with a red baseline. Use distinct outcomes instead of optional flag combinations. Apply code-review in self-review.
Steps
| # | Id | Task | Files | Depends | Effect | Status | Done when |
|---|---|---|---|---|---|---|---|
| 1 | shutdown | Fix peer shutdown evidence and both verdict consumers; test deadlines with controlled events | .agents/skills/verify/scripts/omp-smoke.ts, .agents/skills/verify/scripts/smokePeerShutdown.ts, cli/test/unit/verifySmokePeerShutdown.test.ts, cli/test/fixtures/talk/unconfirmed-peer.ts, .agents/skills/verify/SKILL.md | - | local | done | A1–A4 pass; a confirmed exit stays confirmed, and a timeout cannot pass the probe or masquerade as an exit. |
Acceptance
| ID | Command | Expected |
|---|---|---|
| A1 | bun run test:unit cli/test/unit/verifySmokePeerShutdown.test.ts cli/test/unit/verifySmokeTalkTurns.test.ts cli/test/unit/verifySmokeScan.test.ts |
Use synthetic process events and virtual time. With a pipe open, observe exit 1 ms before the final deadline, deliver buffered output after that deadline, and report the original exit. In the no-exit case, advance to the final deadline and require a timeout. Emit exit 0 and pipe close 1 ms later, then repeat close and require the same timeout. Also cover ordinary exit, signal exit, bounded drain, and no signals after observing exit. No actual unkillable process. |
| A2 | bun .agents/skills/verify/scripts/omp-smoke.ts talk --repo . --omp "$verified_omp" and the same command with talk-ui, in the isolated V6 environment described above |
Both exit 0. Talk reports ok closed-peer-not-live, both report ok sessions, ok registry: talk registered only in the private folder and ok registry-removed. No normal output, close order, or protocol change. |
| A3 | bun run check:types; bun run lint .agents/skills/verify/scripts/omp-smoke.ts .agents/skills/verify/scripts/smokePeerShutdown.ts cli/test/unit/verifySmokePeerShutdown.test.ts; bun fmt --no-script --check cli/test/unit/verifySmokePeerShutdown.test.ts |
All succeed. The tests import the production helper, so the type check includes it. Run the full unfiltered gate in required protected CI. No shipped package changed. |
| A4 | bun --preload ./cli/test/fixtures/talk/unconfirmed-peer.ts .agents/skills/verify/scripts/omp-smoke.ts talk --repo . --omp "$verified_omp"; repeat with talk-ui under A2 isolation |
Both exit 1, not 0 or a harness timeout. Talk prints FAIL closed-peer-not-live with the unconfirmed-after-SIGKILL reason, and makes zero post-close sender sends. Both print FAIL sessions with that reason, never exited timeout. All unrelated checks must succeed, including registry and registry-removed. |
Do not touch
Do not change the kit CLI, talk extension, transport, sender/TUI shutdown policy, deadlines, dependencies, release version, CI or branch protection. Do not access live user sessions. No release, deployment or production work.
Open questions
Verification Results
Candidate 4f6e1c3608. Red baseline, step shutdown: bun run test:unit cli/test/unit/verifySmokePeerShutdown.test.ts failed on missing smokePeerShutdown.ts; no implementation or stub existed. The regression test bytes remained unchanged through implementation.
- A1: 45 tests passed in three suites. The controlled clock exercised the 29,999 ms exit, buffered output across 30,000 ms, 30,000 ms timeout, late clean exit, repeated close, signal exit and failed spawn.
- A2: private real
talkpassed 21 checks;talk-uipassed 15. Both outputs matched their base runs byte for byte. Both removed the registries. - A3:
check:types, scoped lint and test formatting passed. Type checking printed two pre-existing suggestions in unrelated CLI commands. The full local gate did not run. - A4: both complete modes exited 1 under the preload.
talkreported exactly two failures,closed-peer-not-liveandsessions;talk-uireported onlysessions. All gave the injected unconfirmed-after-SIGKILL reason. No sender probe ran after close. The other 19 and 14 checks passed, respectively, including private registry cleanup.
Review repair 9b145ef67e: 46 unit tests passed. Types (including the complete verifier), scoped lint and test formatting passed. Real talk and talk-ui matched their base output (21 and 15 passing checks). The failure controls exited 1 with only the expected failures, preserved stderr and issued no post-close sends. Both modes removed their registries. The original red assertions were strengthened to use the production event binding and the last millisecond of the allowed drain. A new case verified the signal termination message.
Final candidate 448d443ac1: A1–A4 passed again (46 unit tests, 4 real mode runs, types, lint and formatting). For the controlled peer with empty, blank, padded or ordinary stderr, the preload preserved every byte and supplied a visible excerpt under both mode policies.
Required Full CI passed for the reviewed head 448d443ac153e4ccb101c41400d35dea35d263a9 on PR #282. All 10 jobs succeeded for the current merge with main.
Activity
DocksDocks commentedon Dec 1, 2026
Delegation grant: yolo: ok go ahead and do issue://279 with the yolo skill
DocksDocks commentedon Dec 1, 2026
Plan review round 1
Plan-review: repair
startRpcOmphas separate event handlers, a timeout return, and a cachedclose()result (.agents/skills/verify/scripts/omp-smoke.ts:2154-2193). Inference: a regression that returns timeout on time but reports exit 0 on the next close after a late event could pass those checks independently - Make the second case advance to the final deadline, assert timeout, emit exit and close 1 ms later, then assert that repeat close still reports timeout - class: deadline ordering not proved by the acceptance assertionshutdown, and Acceptance A1–A2 - The actual send and the twosessionsreports are separate consumers (.agents/skills/verify/scripts/omp-smoke.ts:2762-2777,2796-2820,3919-3946). A1 names a shared verdict, while A2 only exercises successful shutdowns. Inference: a test of the shared verdict can pass while a mode bypasses it on timeout, leavingtalkable to send the probe or either mode able to printexited timeout- Make A1 feed the synthetic timeout through the production paths that issue the send and build each mode’s result. Assert no probe send, aFAIL closed-peer-not-livediagnostic intalk, and aFAIL sessionsdiagnostic in both modes that says exit was not confirmed after SIGKILL - class: failure assertion bypasses production consumersDocksDocks commentedon Dec 1, 2026
Plan review round 2
Plan-review: pass
None.
Manager response to round 1
Repaired:
Rejected: none.
Redesigned: none.
DocksDocks commentedon Dec 1, 2026
Self-review
Correctness
No findings.
Spec and tests
No findings.
Text and safety
LOW: The comment on
FixtureProcessstill describesclosedas “with its exit result.” An unconfirmed shutdown closes the handle without an exit result. Describe it as the shutdown result.DocksDocks commentedon Dec 1, 2026
Code review round 1, lens correctness
Code-review: pass
Standards
FAIL sessionsshowed before this change. The timeout fixture supplieslast diagnostic; inference: neither mode would print it becausepeerSessionFailurereturns only the reason andcountWarningsfilters out lines that are not plugin warnings. - Append the existing bounded stderr excerpt to the unconfirmed reason when the excerpt is nonempty. Keep the probe gate and exit wording unchanged. - class: dropped shutdown diagnosticsSpec
None.
Code review round 1, lens spec-and-tests
Code-review: pass
Standards
peer.exited()directly, bypassing the listener that decides which child event proves exit. Inference: moving exit evidence back to the child'scloseevent would leave the unit test green and could pass normal V6 runs when the pipes close promptly, while restoring the original failure when a pipe stays open past the final deadline. - Drive the race through the production listener registration with a synthetic child that emitsexitandcloseseparately. - class: regression test bypasses production event bindingSpec
sendafter that boundary independently.” The preload throws before the real sender call, and the mode catches that exception in the same check it is meant to verify. The current check would expose the exception's distinct reason, but inference: a mode that attempts the send and then reports the peer shutdown reason anyway would satisfy the expected output while the preload silently prevented the send. - Record attempted post-close sends through a separate test-only diagnostic, delegate to the real call, and require that diagnostic to be absent in A4. - class: failure control intercepts the behavior it measuresCode review round 1, lens text-and-safety
Code-review: pass
Standards
FAIL closed-peer-not-live, andsessionsstill fails with the injected reason. The instructions check only the labels, so they cannot distinguish that regression from correct behavior. - Require exit 1, the injected shutdown reason on each expected failure line, and success on all unrelated checks. - class: failure control accepts the wrong errornot runafter an earlier failure if the final scans are clean. The shutdown control demonstrates the opposite:closed-peer-not-livefails after attribution has already recorded a successful registry verdict, and clean final scans leave it intact. - Say that a later scenario failure does not reset a completed registry check. - class: stale check-order documentationsessionslines discard that diagnostic. The old timeout report included it, and the warning scan only surfaces lines matching its plugin-warning filter. - Append the existing bounded stderr excerpt to thesessionsreason when nonempty. Keep the probe reason unchanged. - class: dropped shutdown diagnosticthe peer omp exited null. The result type explicitly identifiesnullas signal termination, but the text presents it as an exit status. - Render a confirmed signal termination as such in both paths without inventing an exit code. - class: signal termination rendered as an exit statusSpec
None.
DocksDocks commentedon Dec 1, 2026
Code review round 2, delta
Code-review: pass
Previous findings
closewould now fail the deadline test at cli/test/unit/verifySmokePeerShutdown.test.ts:38-50.Standards
--ompoption writes only blank lines to stderr, inference: the preload skips its fallback because the raw string is nonempty, but both formatters trim it to empty. The failure control then lacks the required excerpt even though shutdown handling is correct. The same applies intalk-uiif only its last 600 stderr characters are whitespace. - Append the fixture diagnostic when that tail contains no non-whitespace text, preserving the original stderr for warning checks. - class: diagnostic fallback checks raw rather than displayed outputSpec
None.
Manager response to round 1
Repaired in 9b145ef:
last diagnostic. Both modes now display the bounded stderr excerpt. A4 checks both real outputs and an unchanged probe reason. The shared signal-exit formatter also describes termination by a signal instead of anexited nullstatus in both the pending RPC error and the session verdict.exitandclosethrough the same listener registration as a real child. The last bytes arrive at 249 ms; release is required at 250 ms.Rejected: none.
Redesigned: none.
DocksDocks commentedon Dec 1, 2026
Code review round 3, delta
Code-review: pass
Previous findings
talknow shows an excerpt for whitespace-only stderr, andtalk-uishows one even when the original last 600 characters were all whitespace. The marker does not affect warning detection. Normal runs do not load the preload, and the delta leaves live peer behavior and the post-close send check unchanged.Standards
None.
Spec
None.
Manager response to round 2
Repaired in 448d443: the test preload now appends a diagnostic line to the original stderr before either display formatter sees it. The previous truthiness check dropped the excerpt for whitespace-only stderr or a 600-character whitespace tail. The repair preserves every original byte. An independent preload run exercised empty, blank, padded and ordinary stderr through both excerpt policies.
Rejected: none.
Redesigned: none.
DocksDocks commentedon Dec 1, 2026
Archived with landing pull request #282