Repository navigation
Description
Goal
Scan first-party code for lifecycles whose valid states and transitions are implicit. Make each confirmed machine explicit. Preserve observable behavior except for the stale cleanup checks described in #273. Record coverage and exclusions.
Yolo: the user delegated every decision except the merge to the agent.
Mode: plan-and-implement
Research
Use a state model when an event changes which operation is legal or which data must exist. Do not turn every Boolean, counter or ordered procedure into a state machine.
| Owner | Evidence and disposition |
|---|---|
| Bounded workers | syncConcurrency.ts:19–41 keeps a stop flag and an independent failure map. Admission and draining are mutually exclusive; tidy and its report share the runner. |
| CLI engine | logger.ts:77–169 coordinates exclusive output, release and queued writers. exec.ts:175–195 arbitrates close and timeout. Separate independent leases, resources and counters; do not collapse them into a single global phase. |
| Plan helper | plan/commands.ts:187–196 prepares claims; plan/github.ts:725–745,836–842 compares and confirms them. latestCloser produces a dependent timestamp and closer. Existing phase labels and authority event variants are already explicit. Check interleaved reads in the fake GitHub server. |
| Talk transport and binding | transport/listener.ts and extension.ts coordinate publishing, withdrawal and cleanup. Distinguish outstanding requests from registration identity. Keep existing protocol schemas and actual sources of truth. |
| Talk delivery and UI | tool/delivery.ts:209–226,259–290 maintains a cursor while watches exist. tool/asks.ts:176–182 stores a heartbeat counter on ended rows. ui/command.ts:258–275 keeps active and outgoing view handles across asynchronous mounting. Existing message outcomes and acknowledgement tags already name their states. |
| Supporting code | .agents/skills/verify/scripts/smokeScan.ts:65–92 pairs a final promise with a completion flag. hygiene.ts, verify-gate-core.ts and cli/scripts/build-talk.ts have token readers with data that applies only to certain phases. Inspect those readers and reusable harnesses before changing them. |
Already explicit or not machines: workflow job dependencies in parity.yml and release-cli.yml; linear installer, update and release steps; the sync lock stack released in finally; independent plugin uninstall failures; static data, Markdown, goldens and third-party code. Regenerate derived files only from their sources. The last child must reconcile the tracked first-party file list against all six children, including findings not listed above. Record dispositions and paths in the issues, not a new permanent catalog.
Assign source coverage before implementation: #268 owns syncConcurrency.ts; #270 owns cli/src/plan and the fake GitHub harness; #269 owns the remaining cli/src. #271 owns cli/talk/transport and the binding/transport portion of extension.ts; #272 owns the rest of cli/talk, including UI event wiring. Each owns the tests for its behavior. #273 owns all remaining first-party inputs: cli/scripts, reusable test infrastructure, .agents, source extensions under SoT, root launchers, installers, workflows, and any unclassified path. Its final report indexes all dispositions by path and commit. At the start of each child, check its entire assigned group, not just known examples.
When later evidence finds a machine outside a started child's scope, do not reopen frozen steps or silently defer it. Create a new reviewed implementation child under #267, add its parent row, review the revised parent, and require that child's archive and refreshed proofs before closure. Repeat reconciliation if the default branch moves before closure.
Decision: split by owner and start with the worker pool. It has one implementation shared by two CLI paths and deterministic overlap tests. A single repository-wide change would join unrelated regressions and make them harder to revert. Local state models need no new dependency or common framework. Revert each child separately. To prevent the split from hiding omissions, the final child checks all tracked first-party executable inputs against the inventory.
Scoped correction from #273 code review. Asked: “without changing observable behavior”. A stop result may update a key or emit a reminder only while the checked record is still pending under that key. Discard stale positive and negative results. This suppresses duplicate reminders and preserves a replacement for its own check. Two fixture tests reproduced a duplicate and a lost replacement on f7a17633972baaf419dff7b99ffa329e9984bd99. P3 must replay those tests and a late positive for a replaced record on final main. Keep normal output and immediate creation notices unchanged. A global lock would serialize unrelated resources; a second child for the same check would separate the model from its invariant. Revert the correction through #273 if normal stop behavior regresses.
Tools: docks-kit 0.31.0, gh 2.103.3, git 2.53.0 (local version output). For typed phase-specific data, use the TypeScript narrowing handbook. Prefer the existing single source of state over adding a tag that can disagree with it.
Steps
| # | Id | Task | Files | Depends | Effect | Status | Done when |
|---|---|---|---|---|---|---|---|
| 1 | workers | Model bounded worker admission and failure drain | - | - | local | done | child #268 finished |
| 2 | engine | Model terminal and child-process lifetimes | - | - | local | done | child #269 finished |
| 3 | plan_io | Model plan write claims and close observations | - | - | local | done | child #270 finished |
| 4 | transport | Model talk registration and transport lifetimes | - | - | local | done | child #271 finished |
| 5 | interaction | Model talk delivery and interactive flow lifetimes | - | 4 | local | done | child #272 finished |
| 6 | tooling | Model supporting tooling and reconcile the full inventory | - | 1, 2, 3, 4, 5 | local | done | child #273 finished |
Acceptance
| ID | Command | Expected |
|---|---|---|
| P1 | docks-kit plan show 267 |
Every child listed in Steps, initially #268–273 and including any additions, appears once and is finished. Open, missing or retired work fails. |
| P2 | For each P1 child, run the three reads below, then gh pr view "$pr" --repo DocksDocks/docks-kit --json state,baseRefName,mergeCommit,headRefOid,body. |
Match Verification Results to the PR head, a merge into main, its closing keyword, and the current trusted landing archive record for that PR. Fail on missing evidence or multiple assigned actors. |
| P3 | git fetch origin main then git rev-parse origin/main; use that output as revision. Run git ls-tree "$revision", descending each tree with git ls-tree "$revision:$directory" except docs/plans/finished. In a clean checkout of exactly revision, rerun every child's reproducible behavior checks and inspect every candidate at that revision. |
Record new results for this one revision, including cross-owner interactions, callers and test inputs. Each first-party executable input maps to an owner and disposition. New confirmed machines require a reviewed child and P2. Earlier results, unchanged filenames and abandoned PR branches are not final proof. |
Pass conditions for P2 and P3: P2 requires passing behavior checks for every confirmed machine on its exact reviewed PR head. P3 requires every required rerun to pass on revision and every confirmed machine to be explicit in that tree. Missing, skipped, failed or stale evidence fails acceptance. A model lost after an earlier merge fails even when all behavior tests pass. For both new discoveries and regressions, land the repair in a reviewed child, verify its archive through P2, and repeat P3 on the new final revision. Do not close the parent until all three rows pass together.
P2 reads, with child set to the issue number and pr taken from the trusted archive line:
gh issue view "$child" --repo DocksDocks/docks-kit --json body
gh api graphql -F n="$child" -f query='query($n:Int!){repository(owner:"DocksDocks",name:"docks-kit"){issue(number:$n){assignedActors(first:2){nodes{... on Actor{login}}}}}}'
gh api graphql --paginate -F n="$child" -f query='query($n:Int!,$endCursor:String){repository(owner:"DocksDocks",name:"docks-kit"){issue(number:$n){comments(first:100,after:$endCursor){nodes{author{login} createdAt body} pageInfo{hasNextPage endCursor}}}}}'Use the latest archive record from the sole actor in the current cycle, after any Reopened: comment by that actor. Preserve API order for equal timestamps, as trustedComments and archiveKind do. P3 needs only the final main tree; it does not fetch or compare historical PR heads.
Do not touch
Except for discarding stale stop results and the resulting kit patch version in #273, preserve external commands, wire formats, ordering, output and failure semantics. Do not change release policy, dependency versions or trusted user settings. Do not inventory frozen plan history or add a state machine library.
Open questions
Verification Results
Final main: 49f308a17a13c116bf4bfa0adf0289fe280b7da8. Its tree 0f1e8b9a7a44dca72f209611eb86c319a05417eb matches both the reviewed head and the protected CI merge.
- P1: the plan helper listed exactly Model the bounded worker pool’s failure drain #268, Make CLI terminal and child-process lifetimes explicit #269, Model plan write ownership and close-event evidence #270, Make talk transport and binding lifetimes explicit #271, Make talk delivery and interactive flow phases explicit #272 and Model stateful tooling and complete the repository inventory #273 as finished. All six Steps rows are done.
- P2: checked each child's owner, latest archive, verification results, reviewed head, closing reference and merged pull request. The pairs were Model the bounded worker pool’s failure drain #268/Model worker pool admission and failure draining #274, Make CLI terminal and child-process lifetimes explicit #269/Make terminal and child-process lifetimes explicit #275, Model plan write ownership and close-event evidence #270/Make plan write ownership and closure evidence explicit #276, Make talk transport and binding lifetimes explicit #271/Make talk transport and binding lifetimes explicit #277, Make talk delivery and interactive flow phases explicit #272/Make talk delivery and interactive flow phases explicit #278 and Model stateful tooling and complete the repository inventory #273/Model verification and cleanup lifecycles and reconcile the final inventory #280. Each child has passing plan and code reviews.
- P3: rebuilt the recursive inventory on this
mainrevision. All 1,151 paths have an owner: 20 modeled files, 156 other source files, 138 tests, 11 fixtures, 3 generated files and 823 records. The path, owner and blob manifest matches the reviewed one byte for byte: SHA-2561ccdb0e91cebbc76f44b5570407f0c430f7196c964af565f4e09e58e76b4789a. Inspected the final declarations for worker admission, process and terminal lifetime, plan writes, transport and registration, delivery and UI, and the verification and cleanup tools. - On final
main, 34 affected suites passed: 1,313 tests passed and two conditional tests did not run locally. The dirty-worktree and actual Vitest guard controls passed. The public dry-run checks passed twice and all 12 sync mutation cases passed. The three overlapping reminder cases passed. All 628 inert lexer outputs matched the baseline. Four positive and twelve negative isolated driver runs returned their expected results and removed their private registries. - Type checking, generated files, scoped lint and formatting passed. An offline pack and a separate clean consumer install verified the exact tarball SHA-256
c724beb0e0aebb93b0e1765520b3d7d5519ad286f81a8a166e627d9c5ccf7c1b, four dependency pins and CLI/plugin version0.31.3. No publication or deployment. - Protected CI: all ten jobs passed, including Linux, macOS and Windows. The full local suite did not run. #279 records three unreached verification-driver timeout cases from review. It does not represent a missing model in this inventory.
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"
DocksDocks commentedon Nov 30, 2026
Plan review round 1
Plan-review: repair
transportandtooling; Acceptance P2–P3 - The only repository-wide reconciliation starts after the five earlier owners finish. Inference: if Model stateful tooling and complete the repository inventory #273 confirms that the route-claim lifecycle incli/talk/transport/client.ts:432–455,479–497needs a model, Make talk transport and binding lifetimes explicit #271 is already finished and Model stateful tooling and complete the repository inventory #273 owns supporting tooling. The plan can flag the omission but has no landing owner for it. The plan contract’s “Status, ownership, and frozen state” section does not let the final child absorb new scope after it starts. - Assign every first-party source group to an owner before that owner starts. Keep Model stateful tooling and complete the repository inventory #273 as the cross-check, and require any late confirmed work to land through a reviewed child before parent closure. - class: audit scheduled after its implementation owners finishshowreportsfinishedfrom GitHub’sCLOSEDandCOMPLETEDstate, not from merge or archive proof (cli/src/plan/commands.ts:374–391,cli/src/plan/records.ts:592–603). A child can record passing checks before merge and then be closed manually as completed. P1 and P2 can both pass even though its code never landed. The parent archive checks child status, while the child archive verifies the merge into the default branch (cli/src/plan/commands.ts:878–888,924–966). - Keep P1 as the status check. Before archiving Make implicit state machines explicit across the codebase #267, require P2 to match each child’s verification to its successful child archive and merged pull request. - class: issue closure used as landing proofgit ls-filesreads the current checkout’s index, and P2 reads historical verification records. If a later merge changes an already-audited file without renaming it, P3 still reports the same path and P2 still reports the earlier pass. Neither proves that the final code was audited or preserves behavior. RootAGENTS.md:73says a relevant later edit invalidates the affected evidence. - Reconcile the inventory against a named commit on the merged default branch. Compare it with the commits each child verified, and refresh only the affected audit and behavior evidence before archiving. - class: completion evidence not tied to the landed revisionDocksDocks commentedon Nov 30, 2026
Plan review round 2, delta
Plan-review: repair
gh issue view --commentsprints only comments when output is captured, omitting the issue body where the plan contract records per-head verification. Even in a terminal, gh 2.103.3 displaysassignees, notassignedActors, so it cannot establish the sole-assignee rule for an issue with a human and a bot assigned. P2 can see an archive comment without the evidence it needs to validate the author or the verified head - Read the issue body, all assigned actors, and timestamped comments explicitly. Match the verified head to the PR and require the latest valid archive record after any trusted reopen, as incli/src/plan/reviews.ts:188–248. - class: acceptance command omits required proof fieldscli/src/engine-native/tidyReport.ts:104–125calls Model the bounded worker pool’s failure drain #268’s worker pool and pairs its results with the original inputs. Inference: if Make CLI terminal and child-process lifetimes explicit #269 changes that caller after Model the bounded worker pool’s failure drain #268 verifies report behavior, Model the bounded worker pool’s failure drain #268’s owned files can still match its older head, and Make CLI terminal and child-process lifetimes explicit #269’s files can match its newer head. Neither comparison flags the stale Model the bounded worker pool’s failure drain #268 proof, even thoughAGENTS.md:73requires refreshing evidence after a relevant edit - Compare each proof’s callers and test inputs against the head that produced it, regardless of ownership, or rerun the cross-owner behavior checks on the pinned revision. - class: completion evidence not tied to the landed revisiongit fetch origin mainfetchesmain, not each PR head. After a squash merge and branch deletion, a fresh checkout can pass P2 and still lack the original$verifiedHeadobject, so P3’s diff cannot run - Fetch each recorded PR’s head ref and confirm that it matches the verified SHA before comparing trees. - class: required Git comparison base not fetchedPrevious findings:
transportandtooling; Acceptance P2–P3: resolved - Research assigns coverage before work starts and gives late discoveries a reviewed child that must land before closure.Manager response to round 1
Repaired:
Rejected: none.
Redesigned: none.
DocksDocks commentedon Nov 30, 2026
Plan review round 3, delta
Plan-review: repair
cli/src/plan/commands.ts:713–729does not check those results when archiving a child. P3 then requires fresh results to be recorded, but does not say they must pass. Inference: if a later change breaks the input ordering asserted incli/test/unit/engine-di.test.ts:22–49, P2 can still pass and recording the failed rerun satisfies P3 as written, despite the Goal requiring unchanged behavior. - Require passing behavior evidence for each confirmed machine at the PR head in P2, and make P3 fail if any required rerun is missing or fails on the pinned revision. - class: acceptance records results without requiring a passcli/src/engine-native/syncConcurrency.ts:19–40, the worker pool remains owned and inventoried, and the drain test incli/test/unit/engine-di.test.ts:74–96can still pass because it checks behavior, not how the lifecycle is represented. P3 can therefore pass while a previously confirmed machine is implicit again. - Make P3 fail if any confirmed machine remains or becomes implicit on the pinned revision, and apply the reviewed-child and refreshed-proof rule to those regressions as well as new discoveries. - class: final audit does not require the implemented outcomePrevious findings:
Manager response to round 2
Repaired:
Redesigned:
Rejected: none.
DocksDocks commentedon Nov 30, 2026
Plan review round 4, delta
Plan-review: pass
None.
Previous findings:
Manager response to round 3
Repaired:
Rejected: none.
Redesigned: none.
DocksDocks commentedon Dec 1, 2026
Plan review round 5
Plan-review: repair
SoT/.omp/plugin/extensions/hygiene.ts:1946–1950,2254–2284, re-recording replaces the pending entry, while a positive result currently emits a reminder without checking that entry. Inference: if a stop observes a directory and waits for another check while the directory is replaced and re-recorded, the candidate emits the old reminder. The planned fix suppresses it and leaves the replacement pending. Neither of the two named outcomes covers that change - Apply the exception to stop results for records that are no longer pending. Keep normal stop output and immediate creation notices unchanged, and retain both reproduced cases in P3. - class: behavior-preservation promise contradicts the chosen ownership ruleManager response to round 4
Repaired: none.
Rejected: none.
Redesigned: none.
DocksDocks commentedon Dec 1, 2026
Plan review round 6, delta
Plan-review: pass
None.
Previous findings:
main: a duplicate reminder, a stale negative after replacement, and a stale positive after replacement. Normal output and immediate creation notices remain unchanged.Manager response to round 5
Repaired: cover any stale result for a record no longer pending under its key. Require the late-positive replacement case in final P3.
Rejected: none.
Redesigned: use the ownership invariant as the scope boundary rather than a list of examples. It covers both signs and duplicate completion without widening the set of resources or commands.
DocksDocks commentedon Dec 1, 2026
Archived as parent: children #268, #269, #270, #271, #272, #273