Skip to content

Fix the open review findings of the sync signal fixture and the tidy move #304

Done

Description

@DocksDocks

Goal

Fix every open review finding that #294 and #295 left: the four findings of #300 (the sync signal test fixture) and the fifteen findings of #302 (the tidy move to Effect: the scratch activity race, serialized metadata reads, UTF-8 BOM handling, runner failure publication, log-boundary defects, the tidy-context guidance, unused exports, and the test-fixture findings). Keep the tidy plan rules, the output, and the exit codes. The pull request closes #300 and #302.

Yolo: the user delegated every decision except the merge to the agent.

Mode: plan-and-implement

Research

Tool facts (2026-12-02, host and bun.lock): Bun 1.4.5 (bun --version; CI pins it in .github/actions/setup-bun-cache/action.yml), Node v26.13.0, Git 2.53.0, Vitest 5.1.2 and effect 4.1.7 (package.json, bun.lock); @effect/tsgo 0.74.1 and oxlint 1.95.0 (package.json); host tools on the local Linux x64 run, Ubuntu 26.04.1, each resolved with which and readlink -f and its package version read with dpkg-query -W (2026-12-02): bash 5.3-2ubuntu1 (the docks-kit launcher), /bin/sh is dash 0.5.12-12ubuntu3 (the stub scripts), mv from gnu-coreutils 9.7-3ubuntu2.1, du, dirname, and uname from rust-coreutils 0.10.0-1ubuntu2~26.04.1, ps from procps 4.0.4-9ubuntu1, lsof 4.99.4+dfsg-2build2, ss from iproute2 6.19.0-1ubuntu1.1, tar 1.35+dfsg-4ubuntu0.4, gpg 2.4.8-4ubuntu3.1, and script from bsdutils 2.41.3-3ubuntu2.2. Every Acceptance row runs locally on that Linux x64 host. Full CI (.github/workflows/parity.yml) runs on Ubuntu 24.04 the audit and static checks (with check:types), test:unit, and smoke:package; on macOS 26 typecheck, check:generated, test:unit:portable, and smoke:package; on Windows 2025 the sharded test:unit, check:generated, and typecheck; plus the golden jobs. Runner tools are those of the Ubuntu 24.04 inventory (GNU coreutils, GNU tar), the macOS 26 inventory (BSD du, bsdtar 3.5.3), and the Windows 2025 inventory (Git 2.56.1, which runs the Windows --repo case). The only flags in use, du -sk <path> and tar -tzf <archive>, have the same meaning in the GNU, BSD, and uutils tools.

Sources: the finding lists of #300 (code review round 9 of #294) and #302 (code review round 1 of #295); the code on main at 7728465.

Signal fixture (#300; cli/test/lib/signalSupervisor.ts, signalSelfPreload.ts, supervisedRun.ts, goldenResources.ts, cli/test/unit/syncSignals.test.ts):

  • F300-1 and F300-2, the CLI pid record (delegated, one line): the supervisor writes cli.pid after the spawn, so a failed write leaves a waiting stub without a record and the supervisor polls for a state that cannot come. Decision: the self-signal preload writes the pid record of its own process (process.pid, write-then-rename) before the CLI entry runs, and ends the CLI with a fixed exit code when that write fails, so a stub never starts before the record exists and no second write is needed; the supervisor stops writing the record, reports a missing record as one JSON event, and, once the CLI and every stub are gone without a record, exits 1 with no shutdown-confirmed. A waiting stub reads the record once and exits when that process is gone. The listener-order entry cli/test/lib/signalEngineEntry.ts, which runs without the preload because its own clock delivers the signal, writes the same record itself at startup. The supervisor checks whether the CLI has ended before it writes a stop request, and a failed request write is reported as one JSON event and does not stop the shutdown wait; that wait stays bounded. The tidy spawned cases use the same record instead of process.ppid (F302-7). Rejected: a stub poll for the record, which can wait for a record that never comes.
  • F300-3 (delegated, one line): a new case makes the exit-record rename of a supervised stub fail (a file in place of stub-records/) and asserts that the ticket stays and teardown keeps the root.
  • F300-4 (delegated, one line): the two teardown paths share one per-fixture closed flag that is set only after a successful non-recursive rmdir of active/; ENOENT counts as closed only when that flag is set, and otherwise teardown reports the root as unconfirmed and keeps it.

Tidy (#302; cli/src/engine-native/tidy.ts, tidyReport.ts, syncConcurrency.ts, cli/src/commands/tidy.ts, and their tests):

  • F302-1, the scratch activity race (delegated, one line): entryActivity reads the entry again after the children scan and treats a changed mtime or inode, or an entry it cannot read again, as unknown, so the entry stays (fail closed); a test with a FileSystem layer that writes a child during the scan shows the keep. Rejected: a lock on the scratch entry, which agents do not take.
  • F302-2, serialized reads (delegated, one line; corrected after code review round 1): only the process cwd reads run with a concurrency of 8, through Effect.forEach with concurrency over Effect.exit of each read, read back in input order; the scratch-child and worktree metadata reads stay serial, as in the base, because parallel reads let a write that lands between two reads escape both the child scan and the parent recheck, and the worktree verdict must stop at its first failed read; checkWorktree takes its idle verdict from the newest activity of both of its scans, so a timestamp that the second scan sees keeps the worktree. Rejected: parallel metadata reads, whose speed gain was never measured.
  • F302-13, the UTF-8 BOM (delegated, one line): the .git marker, the Bun global package.json, and .trashinfo are read as bytes and decoded with new TextDecoder("utf-8", { ignoreBOM: true }), which keeps a leading BOM as the base readFileSync(path, "utf8") did (TextDecoder ignoreBOM); a test with a BOM-prefixed .git marker shows the base keep reason.
  • F302-14 (delegated, one line): runBounded records a failure synchronously in the body of the Effect.onExit callback of the task, before that callback returns its Effect, so no queued task starts after a failure. The window of the base loop is the inline continuation limit: succeedWith (node_modules/effect/src/internal/effect.ts) returns a separate primitive at multiples of 32 operations, so a failure at operation 2047 reaches the yield check at 2048 before the base loop records it. Its regression case drives a failing worker to that limit under a controlled Scheduler and asserts that the queued task does not start with the fix and does start with the base loop.
  • F302-15 (delegated, one line): the log write recovers every failure and defect, but not an interruption, as a log failure line, as the base catch did.
  • F302-9 (delegated, one line): the four new exports without an importer become module-local.
  • F302-3, F302-4, F302-5, F302-10, F302-11 (delegated, one line): in the spawned tidy cases, the du stub delegates to the real du only for the seeded .npm path and prints a fixed size for other paths; the .npm case seeds a file whose independent du -sk size formats to a value other than 0.0 MB and other than the stub's fixed size, and compares the exact line; a waiting stub also exits when the test writes a release file, so teardown never repeats a signal; the Windows PATH holds git, with a positive spawned --repo case; stub scripts quote every path with shQuote and use a shell cleanup function as the trap.
  • F302-6 and F302-12 (delegated, one line): new runner cases for a defect in a task (it drains the pool and keeps its cause) and for a caller interrupt (both started tasks are interrupted and no queued task starts); a new report case where one section dies and gives its unavailable: line while another section prints normally.
  • F302-8, guidance (delegated, one line): tidy-context says that a signal recorded between apply steps makes the CLI exit 130 before it starts the next git or docker call, and that a signal during a waiting call exits at once; its description and its Lock section name tryAcquireKitLock for the production lock and acquireKitLock as test-only; the kitLock.ts range reaches releaseKitLock; cli/src/engine-native/DESIGN.md names tryAcquireKitLock where it names the tidy lock.
  • Version (correction of the Goal, delegated, one line): F302-1 changes which scratch entries tidy --apply removes in a race, so this plan bumps the patch version to 0.32.3 with a CHANGELOG.md entry (AGENTS.md Version bumps), regenerates the payload and the talk bundle, and accepts only the version-derived golden changes. The BOM fix restores the behavior before Move tidy to Effect #295, which the last published release 0.31.3 has (its tidy.ts reads the .git marker with readFileSync(..., "utf8")).

Steps

# Id Task Files Depends Effect Status Done when
1 fixture Fix F300-1 to F300-4 as the Research decisions say, with the pid record in the self-signal preload and the shared closed flag; add the F300-3 case cli/test/lib/signalSupervisor.ts, cli/test/lib/signalSelfPreload.ts, cli/test/lib/supervisedRun.ts, cli/test/lib/goldenResources.ts, cli/test/lib/signalEngineEntry.ts, cli/test/unit/syncSignals.test.ts - local done the signals row passes
2 tidy Fix F302-1 to F302-7 and F302-9 to F302-15 as the Research decisions say, with a test for each code fix that fails when the fix is removed cli/src/engine-native/tidy.ts, cli/src/engine-native/tidyReport.ts, cli/src/engine-native/syncConcurrency.ts, cli/src/commands/tidy.ts, cli/test/unit/tidy.test.ts, cli/test/unit/tidyReport.test.ts, cli/test/unit/syncConcurrency.test.ts 1 local done the tidy row passes
3 guidance Fix F302-8 .agents/skills/tidy-context/SKILL.md, cli/src/engine-native/DESIGN.md 2 local done the guidance row passes
4 version Bump to 0.32.3 with a CHANGELOG.md entry, regenerate the payload (bun cli/scripts/generate-sot-payload.ts) and the talk bundle, and update only the version-derived golden values package.json, CHANGELOG.md, cli/src/generated/sotPayload.ts, SoT/.omp/plugin/extensions/talk.js, cli/test/goldens/mutation.json 3 local done the goldens and gen rows pass
5 repairs Repair code review round 1: serial scratch-child and worktree metadata reads with the idle verdict from the newest activity of both scans (F302-2), the controlled-scheduler regression of F302-14 at the inline continuation limit, and each other reproduced finding of that round cli/src/engine-native/tidy.ts, cli/src/engine-native/syncConcurrency.ts, cli/test/unit/syncConcurrency.test.ts, cli/test/unit/tidy.test.ts, cli/test/unit/syncSignals.test.ts, cli/test/lib/supervisedRun.ts, cli/test/lib/signalSupervisor.ts, .agents/skills/tidy-context/SKILL.md, CHANGELOG.md 4 local done the tidy and signals rows pass

Acceptance

ID Command Expected
deps bun install --frozen-lockfile in the linked worktree Exit 0
signals bun x --no-install vitest run --reporter=verbose cli/test/unit/syncSignals.test.ts Exit 0 on Linux and macOS, with the F300-3 case and a case that runs the real self-signal preload over a bounded test entry with the pid record write made to fail, and asserts the fixed child exit code, that the entry never ran, the supervisor's JSON diagnostic, and supervisor exit 1 after the child exits and before the shutdown deadline, with no shutdown-confirmed; and a case that closes the control pipe while the CLI still runs and makes the stop-request write fail, then asserts the JSON diagnostic, that the supervisor is still running while the CLI is held alive after that diagnostic, and, with a short shutdown deadline that the test sets for the supervisor and the CLI still held alive through it, that the supervisor exits 1 no earlier than that deadline, with no shutdown-confirmed, within the spawn timeout; the stop-request fault case runs the supervisor over a stand-in CLI (a small Bun script given as the supervisor command) that writes its pid record and ends on its own after a hard lifetime shorter than the spawn timeout, so its release needs neither the stop request nor the test's finally; the two fault cases and the F300-3 case own their teardown instead of the tracked afterEach fixture path: each uses a short supervisor deadline, waits for the supervisor, the CLI or stand-in, and the stubs to exit, and then removes its isolated fixture, and F300-3 first asserts the keep decision of normal teardown, which stays fail-closed for every other case; both cases fail against the base supervisor (red baseline)
tidy bun x --no-install vitest run --reporter=verbose cli/test/unit/tidy.test.ts cli/test/unit/tidyReport.test.ts cli/test/unit/syncConcurrency.test.ts cli/test/unit/kitLock.test.ts cli/test/unit/scratch.test.ts cli/test/unit/skillMetadata.test.ts Exit 0, with the new cases of steps 2 and 5; each case of a code fix fails when that fix is removed (red baseline)
scan git grep -nE -e '^[[:space:]]*([^/*[:space:]].*)?Promise<' -e '^[[:space:]]*([^/*[:space:]].*)?async ' -e '^[[:space:]]*([^/*[:space:]].*)?\bthrow\b' -e 'Effect\.promise\(' -e 'Effect\.run[A-Za-z]*\(' -e 'Effect\.tryPromise\(' -e 'from "node:fs"' -- cli/src/engine-native/tidy.ts cli/src/engine-native/tidyReport.ts cli/src/engine-native/syncConcurrency.ts cli/src/commands/tidy.ts Exit 1, no match
guidance git grep -n -w -e 'acquireKitLock' -e 'tryAcquireKitLock' -- .agents/skills/tidy-context/SKILL.md cli/src/engine-native/DESIGN.md; git grep -n -e 'before it starts the next' -- .agents/skills/tidy-context/SKILL.md; git grep -n -A1 'path: cli/src/engine-native/kitLock.ts' -- .agents/skills/tidy-context/SKILL.md; git grep -n 'export function releaseKitLock' -- cli/src/engine-native/kitLock.ts In the first output, the skill description (line 3), its Lock section, and DESIGN.md each name tryAcquireKitLock for the production lock, and every line that names acquireKitLock calls it test-only; the second prints the signal sentence; the range end of the third is at or after the closing line of releaseKitLock, which starts at the line that the fourth prints
goldens On the reviewed commit with git status --porcelain empty: bun run golden:dryrun && bun run golden:mutation && git diff --merge-base origin/main HEAD -- cli/test/goldens Both suites OK; the diff changes only version-derived values (the version string and the digests of files that hold it)
gen bun run check:generated Exit 0
dry ./docks-kit sync --dry-run Exit 0
red-dry bun run golden:dryrun --prove-red Exit 1; prints prove-red OK: golden-dryrun
red-mut bun run golden:mutation --prove-red Exit 1; prints prove-red OK: golden-mutation
types bun run check:types Exit 0
ci-tools bun cli/scripts/verify-ci-tools.ts Exit 0
smoke bun run smoke:package Exit 0
gate bun run check Exit 0

Do not touch

Open questions

Verification Results

On reviewed head 5bdbef2 (Linux x64):

  • deps: exit 0.
  • signals: exit 0, 10 passed. Red baselines: the pid-record fault case and the stop-request fault case failed against the base supervisor and preload.
  • tidy: exit 0, 111 passed, 1 skipped (Windows only). Red baselines: each case of a code fix failed with its fix removed (scratch recheck, apply-time missing entry, worktree newest activity, BOM, log recovery and rotation, runner defect, caller interrupt, runner window at the inline continuation limit, report section defect, .npm measurement, late stub, missing ticket folder).
  • scan: exit 1, no match. guidance: the description, the Lock section, and DESIGN.md name tryAcquireKitLock; every acquireKitLock line says test-only; the signal sentence is present; the kitLock.ts range is 1-162 and releaseKitLock starts at line 155.
  • goldens: both suites OK; the golden diff changes only the version-derived digests in mutation.json.
  • gen, dry, types, ci-tools, smoke: exit 0. red-dry, red-mut: exit 1 with prove-red OK.
  • gate: exit 0, 6524 passed, 12 skipped.

Activity

  1. self-assigned this
    on Dec 2, 2026
  2. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Delegation grant: yolo: "continue with all remaining issues via yolo please, but its an "ultra-yolo" i allow you to review rounds untill it passes and i allow you to merge without asking."

  3. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 1

    Plan-review: repair

    • goal_fit - Research F300-1/F300-2; Steps fixture - The two listener-order cases launch signalEngineEntry.ts without the preload or the PID-record environment key (cli/test/unit/syncSignals.test.ts:482–515). Once the supervisor stops writing cli.pid, those cases can get the expected exit 130 and still fail teardown because launchConfirmed requires the record (cli/test/lib/supervisedRun.ts:82–85). Enabling the preload's signal timer there would bypass the clock-controlled delivery that the cases are meant to exercise (cli/test/lib/signalEngineEntry.ts, signallingClock) - Route every supervised entry through PID publication, with publication only for the listener-order entry so its clock still delivers the signal - class: alternate caller misses the replacement startup path
    • goal_fit - Research F300-1/F300-2; Acceptance signals - shutDown writes signal-request.pending before it checks whether the CLI has ended (cli/test/lib/signalSupervisor.ts:74–101). If the control pipe closes while the preload is failing to publish in an unwritable launch folder, that request write can throw before the supervisor reaches the promised JSON error and exit 1. Removing the preload write on the fixed tree does not exercise this path or distinguish it from the old supervisor, which publishes its own record at lines 117–130 - Make shutdown independent of a successful request write, and make the existing red check force a publication failure and assert the diagnostic, bounded exit, and lack of confirmation - class: failure handling depends on another write to the failed location
    • research_gap - Research F302-2; Goal and Do not touch - Effect 4.1.7 orders successful forEach results by index, but its concurrent traversal selects a terminal failure as fibers finish and interrupts siblings (node_modules/effect/src/internal/effect.ts:5183–5230,5251–5267). If the second scratch child fails its lstat before the first, the new scan can print the second child's path instead of the first child's path. The current latestMtime stops at the first failure in scan order, and both plan and apply print that failure's message (cli/src/engine-native/tidy.ts:797–848,1170–1177,1407–1412) - Keep the bounded reads, but collect their outcomes and apply the existing failure precedence in input order - class: ordered successes mistaken for ordered failures
    • research_gap - Research F302-14; Steps tidy - Effect.onExit invokes its callback while handling the task exit, but the cleanup Effect returned by that callback is another scheduled operation (node_modules/effect/src/internal/effect.ts:4224–4251). The run loop can yield before that operation even when it is uninterruptible (lines 703–723). If publication happens inside a returned Effect.sync, another worker can still claim a queued task while the pool is accepting (cli/src/engine-native/syncConcurrency.ts:42–47) - Specify that the callback publishes the failure synchronously before returning its cleanup Effect - class: exit hook mistaken for a scheduler-atomic cleanup effect
    • goal_fit - Research F302-5; Acceptance tidy - A nonzero .npm file does not guarantee a distinguishable report line. formatKb rounds to one decimal place in MB (cli/src/engine-native/tidyReport.ts:112–114), so an independent du -sk result of 8 KiB and a broken report that always prints zero both produce 0.0 MB. The current fixture already writes a nonempty file (cli/test/unit/tidy.test.ts:1195–1220) - Require the independent measurement to format to a value different from zero and the stub's fixed size before comparing the exact line - class: acceptance fixture rounds away the value under test
    • research_gap - Research F302-8, “when the next git or docker call starts” - signalExitPoint checks the recorded signal and exits 130 in the acquire phase, before it runs the wrapped Effect (cli/src/engine.ts:114–130). A SIGTERM recorded just before docker rm prevents that command from starting; the proposed wording implies it starts - State that the CLI exits before starting the next git or docker call, and distinguish that from a signal arriving while the call is already waiting - class: signal timing contradicts the implementation
    • goal_fit - Acceptance guidance and tidy; Steps guidance - The case-sensitive search for acquireKitLock does not match tryAcquireKitLock. Removing the outdated mentions without adding the production name still leaves the existing test-only mention at .agents/skills/tidy-context/SKILL.md:73, so guidance can pass with no production lock citation in cli/src/engine-native/DESIGN.md:145. It also ignores the signal wording and range. skillMetadata.test.ts:9–19,49–69 intentionally accepts a range that ends early, so the existing 1-121 passes even though releaseKitLock starts at kitLock.ts:155. Step guidance changes only prose and adds none of the test cases the tidy row promises - Make guidance positively verify the production and test-only lock references, signal timing, and range coverage. Remove the promise of new step-3 cases from tidy and keep the metadata test as a regression guard - class: acceptance does not verify the documentation outcome
    • goal_fit - Research Version; Steps tidy; Acceptance goldens, smoke, and gate; Do not touch - F302-1 changes which scratch paths tidy --apply removes, and F302-13 changes the keep result for a BOM-prefixed .git marker (cli/src/engine-native/tidy.ts:615–642,1401–1421). AGENTS.md:52–53,71 requires a package bump, payload regeneration, and a checkout sync --dry-run for user-facing changes. A bump also changes the deployed plugin manifest (cli/src/engine-native/ompKitPlugin.ts:71–78), whose bytes are hashed in cli/test/lib/goldenSnapshot.ts:160–166 and pinned in cli/test/goldens/mutation.json:29. Keeping that hash unchanged would fail the mutation gate - Scope the package bump and generated payload, add the required dry-run check, and allow only the version-derived golden changes while requiring all other golden output to stay unchanged - class: no-version-bump decision conflicts with repository policy and version-sensitive goldens
    • research_gap - Research Sources; Acceptance deps, signals, tidy, scan, guidance, goldens, red-dry, red-mut, types, ci-tools, smoke, and gate - The plan contract's “Record and mode” section requires tool versions and their sources. Research gives none. For example, the focused tests depend on Bun's --no-install handling and the Node shebang handoff, while goldens relies on Git's two-commit --merge-base form. The repository supplies Bun in .github/actions/setup-bun-cache/action.yml:8 and Vitest and effect-tsgo in package.json:56–62, but the plan does not establish which host Node, Git, or du runs the checks - Record or reference the applicable pins and dated host tool versions for the acceptance environments - class: required tool-version evidence missing
  4. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 2, delta

    Plan-review: repair

    • goal_fit - Research F300-1/F300-2; Acceptance signals - The revised case can block only the PID-record write and let the CLI exit before shutdown. It then sees the missing-record diagnostic and exit 1 even if the stop-request write can still throw out of shutDown before the wait starts (cli/test/lib/signalSupervisor.ts:74–101). The original control-pipe race remains untested - Make the existing failure case close the control pipe while the CLI is still up, force the stop-request write to fail, and check the diagnostic, bounded exit, and absence of confirmation - class: failure handling depends on another write to the failed location
    • goal_fit - Research F302-8; Steps guidance; Acceptance guidance - Fixing only DESIGN.md, the signal sentence, and the source range satisfies the row while leaving the skill description and Lock section unchanged. The first grep already matches .agents/skills/tidy-context/SKILL.md:59,73,138, even though lines 3 and 170 still describe the old lock path - Make the existing row check the description and Lock section specifically for production tryAcquireKitLock and test-only acquireKitLock - class: acceptance does not verify the documentation outcome
    • goal_fit - Research Version; Steps version; Acceptance goldens; Do not touch - The patch bump, payload regeneration, and dry-run check are now in scope, but Do not touch still forbids changing the goldens. The bumped version changes the deployed manifest (cli/src/engine-native/ompKitPlugin.ts:69–78) and therefore its pinned digest (cli/test/goldens/mutation.json:29). Leaving the golden untouched fails the mutation suite - Exempt only the version-derived values from the golden prohibition - class: no-version-bump decision conflicts with repository policy and version-sensitive goldens
    • research_gap - Research Version, “published 0.32.2” - The npm latest record reports 0.31.3, and the exact 0.32.2 record returns 404. The BOM parity claim cites a release that users cannot install. The 0.31.3 source does show the BOM-preserving .git read - Cite the actual published baseline or describe the fix as restoring pre-Move tidy to Effect #295 behavior. Keep the independent patch-bump decision - class: checkout version mistaken for a published release
    • research_gap - Research Tool facts; Acceptance tidy, types, ci-tools, smoke, and gate - The version record still calls the CI du only “system du” and omits other tools the checks actually run. package.json:31,45,57–61 pins the Effect checker and linter; cli/scripts/package-smoke.ts:260–262 invokes host tar; and the Linux gate uses GnuPG and util-linux script (AGENTS.md:77, .agents/skills/review-benchmark/tests/keys.test.mjs:25–45,465–488). The contract requires enough version evidence to review the commands against the environment that runs them - Reference the existing package pins and record the missing host tool versions or runner-image package records - class: required tool-version evidence missing

    Previous findings:

    • Round-1 finding on Research F300-1/F300-2 and Steps fixture: resolved - The listener-order entry publishes the PID record at startup without loading the preload, and fixture now lists that entry.
    • Round-1 finding on Research F300-1/F300-2 and Acceptance signals: open - repeated above
    • Round-1 finding on Research F302-2, Goal, and Do not touch: resolved - The traversal collects each read's Exit and selects the first failure in input order.
    • Round-1 finding on Research F302-14 and Steps tidy: resolved - The callback records failure synchronously before returning its cleanup Effect.
    • Round-1 finding on Research F302-5 and Acceptance tidy: resolved - The independent measurement must format differently from zero and the stub value before the exact line is compared.
    • Round-1 finding on Research F302-8 signal timing: resolved - The guidance now distinguishes exit before the next command starts from exit while a command waits.
    • Round-1 finding on Acceptance guidance and tidy and Steps guidance: open - repeated above
    • Round-1 finding on Research Version, Steps tidy, Acceptance goldens, smoke, and gate, and Do not touch: open - repeated above
    • Round-1 finding on Research Sources and Acceptance tool versions: open - repeated above

    Manager response to round 1

    Repaired:

    • Listener-order entry: signalEngineEntry.ts writes the pid record itself; it joins the step 1 Files.
    • Shutdown: the supervisor checks the CLI end before a stop request, and a failed request write is a JSON event that does not stop the bounded wait; the signals row adds a forced publication failure case that fails against the base supervisor.
    • F302-2: the bounded reads run over Effect.exit of each read, and the first failure in scan order still decides the message.
    • F302-14: the failure is recorded in the body of the onExit callback, before it returns its Effect.
    • F302-5: the seeded size formats to a value other than 0.0 MB and the stub size, and the line is compared exactly.
    • F302-8 wording: the CLI exits before it starts the next git or docker call.
    • guidance row: positive checks for the production lock, the signal sentence, and the kitLock.ts range; the tidy row no longer promises step-3 cases.
    • Version: corrected to a patch bump 0.32.3 (new step version, rows gen and dry, version-derived golden changes only).
    • Tool facts: Research names Bun, Node, Git, Vitest, effect, and du versions with their sources.

    Rejected: none.

    Redesigned: none.

  5. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 3, delta

    Plan-review: repair

    • goal_fit - Research F300-1/F300-2; Acceptance signals - The new case reaches the failed stop-request write, but it still does not show that shutdown keeps waiting. In cli/test/lib/signalSupervisor.ts:85–99, the wait checks whether the CLI and stubs have exited before confirming shutdown. An implementation that logs the write failure and exits immediately while the CLI is still alive would satisfy the row’s diagnostic, bounded-exit, and no-confirmation assertions - Make the existing case distinguish an immediate exit from the bounded wait. Hold the CLI alive across the diagnostic, verify the supervisor is still waiting, then check the exit code and absence of confirmation at the deadline - class: failure handling depends on another write to the failed location
    • research_gap - Research Tool facts; Acceptance tidy, types, ci-tools, smoke, and gate - The local version record is now present, but runner labels do not record runner tool versions. The claim that CI runs the same commands also conflicts with .github/workflows/parity.yml:78–92,124–160: Linux runs the Effect checker, macOS and Windows use plain typecheck, and package smoke runs on Linux and macOS. For example, cli/scripts/package-smoke.ts:260–262 invokes tar -tzf, but the macOS image inventory lists tar as bsdtar 3.5.3, not the local GNU tar 1.35. The Ubuntu image inventory likewise lists GNU coreutils for the du -sk check, not local uutils - State which rows run locally and which checks CI runs on each platform. Record or reference the actual runner tool versions for the checks that use them - class: required tool-version evidence missing

    Previous findings:

    • Round-2 finding on Research F300-1/F300-2 and Acceptance signals: open - repeated above
    • Round-2 finding on Research F302-8, Steps guidance, and Acceptance guidance: resolved - The row now checks the description, Lock section, and DESIGN.md specifically and requires every acquireKitLock reference to identify it as test-only.
    • Round-2 finding on Research Version, Steps version, Acceptance goldens, and Do not touch: resolved - Do not touch now exempts only the version-derived values from step version.
    • Round-2 finding on Research Version, “published 0.32.2”: resolved - Research now names the pre-Move tidy to Effect #295 behavior and the actual published 0.31.3, whose tagged source uses the BOM-preserving .git read.
    • Round-2 finding on Research Tool facts and Acceptance tidy, types, ci-tools, smoke, and gate: open - repeated above

    Manager response to round 2

    Repaired:

    • Stop-request failure: the signals row adds a case that closes the control pipe while the CLI runs and makes the stop-request write fail.
    • guidance row: it checks the skill description, the Lock section, and DESIGN.md for the production tryAcquireKitLock, and that every acquireKitLock line calls it test-only.
    • Do not touch: the version-derived golden values of step version are exempt.
    • Baseline: the BOM fix restores the behavior before Move tidy to Effect #295, which the published 0.31.3 has.
    • Tool facts: the package pins of the checker and linter, the host tar, GnuPG, and script versions, and the CI runner images.

    Rejected: none.

    Redesigned: none.

  6. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 4, delta

    Plan-review: repair

    • goal_fit - Research F300-1/F300-2; Acceptance signals, “once the CLI ends or the bound passes” - The new liveness assertion addresses an immediate exit, but the two endings have different expected results. cli/test/lib/signalSupervisor.ts:83–99 confirms shutdown and exits 0 if the PID record exists and the CLI and stubs have ended. It exits 1 without confirmation if the wait expires. The row requires no confirmation for either ending, so it can reject a correct shutdown if the CLI exits first. Holding the CLI through the existing 120-second bound would instead exceed the 60-second POSIX test ceiling in cli/test/lib/spawnTimeout.ts:49–50 - Give the spawned fault case a short test-controlled deadline. Keep the CLI alive through it, then assert supervisor exit 1 and no shutdown-confirmed - class: shutdown acceptance conflates completion with timeout
    • research_gap - Research Tool facts; Acceptance tidy, dry, and gate - The local/CI split and the Ubuntu and macOS inventories fix the earlier platform description, but required tool-version evidence is still missing. The positive Windows --repo case uses Git for rev-parse --path-format=absolute --git-common-dir (cli/src/engine-native/tidy.ts:752–774); the plan gives only the local Git version, while the Windows 2025 inventory lists Git 2.56.1.windows.1. Locally, dry invokes Bash, dirname, and uname (docks-kit:1–18), tidy exercises /bin/sh and mv in the cleanup trap (cli/test/unit/tidy.test.ts:933–949), and the Linux gate also uses ps (vitest.config.ts:13–30). Research does not identify the versions or providers for those commands, so a reviewer cannot reproduce the launcher and fixture checks from the recorded environment as the plan contract requires - Reference the Windows runner Git version and record the local shell and utility versions or their package sources - class: required tool-version evidence missing

    Previous findings:

    • Round-3 finding on Research F300-1/F300-2 and Acceptance signals: open - repeated above
    • Round-3 finding on Research Tool facts and Acceptance tidy, types, ci-tools, smoke, and gate: open - repeated above

    Manager response to round 3

    Repaired:

    • Stop-request failure case: it asserts that the supervisor still runs while the CLI is held alive after the diagnostic, then the exit and no confirmation.
    • Tool facts: every row runs locally on Linux x64; Research lists what Full CI runs on each runner image, links the Ubuntu and macOS image inventories, and notes that du -sk and tar -tzf mean the same in the GNU, BSD, and uutils tools.

    Rejected: none.

    Redesigned: none.

  7. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 5, delta

    Plan-review: repair

    • research_gap - Research Tool facts; Acceptance tidy and gate - The Windows inventory and the local Bash and utility versions are now recorded, but /bin/sh is still identified only as dash. The tidy fixture runs that interpreter to execute its cleanup trap (cli/test/unit/tidy.test.ts:933–949), and gate runs the same suite. A reviewer cannot recover the dash release from the stated --version source: the dash option parser rejects that flag. The same blanket source misidentifies the lsof version command, which the upstream manual documents as -v - Record the installed dash package version and its source, and name the command or package source actually used for lsof - class: required tool-version evidence missing
    • goal_fit - Steps fixture; Acceptance signals, stop-request write failure - The row keeps the CLI alive through the deadline, but only requires one observation that the supervisor is alive after the diagnostic and an upper bound on its exit. Inference: a supervisor that reports the error, skips the polling loop in cli/test/lib/signalSupervisor.ts:89–99, and exits 1 shortly after the liveness observation would satisfy both checks without waiting until the deadline - Require the same case to verify that the supervisor reaches its shutdown deadline before exiting 1 without shutdown-confirmed - class: timeout acceptance permits an early exit
    • goal_fit - Steps fixture; Acceptance signals, both supervisor fault cases and F300-3 - The suite's makeFixture registers each root with afterEach. That hook throws when any launch lacks confirmation, even if the case already asserted that absence as its expected result (cli/test/unit/syncSignals.test.ts:185–242,244–274; cli/test/lib/supervisedRun.ts:81–89). Inference: using the tracked fixture path, a correct supervisor exit 1 with no confirmation still fails the suite. In the timeout case, the deliberately held CLI also outlives the supervisor that normally requests its exit - Give the intentional fault cases explicit teardown ownership. Release and verify the held CLI and any stubs in finally, and let F300-3 assert the normal keep decision before cleaning its isolated fixture. Keep the normal hook's fail-closed behavior - class: expected shutdown failure trips automatic teardown

    Previous findings:

    • Round-4 finding on Research F300-1/F300-2 and Acceptance signals: resolved - The current row holds the CLI alive through a short supervisor deadline and expects exit 1 without confirmation. It no longer applies that expectation to a completed shutdown.
    • Round-4 finding on Research Tool facts and Acceptance tidy, dry, and gate: open - repeated above.

    Manager response to round 4

    Repaired:

    • Shutdown case: the test sets a short supervisor deadline, keeps the CLI alive through it, and asserts exit 1 and no shutdown-confirmed within the spawn timeout.
    • Tool facts: the version of every host tool that a row runs (bash, dash, mv, du, dirname, uname, ps, lsof, ss, tar, GnuPG, script) with its provider, and the Windows 2025 inventory with its Git version.

    Rejected: none.

    Redesigned: none.

  8. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 6, delta

    Plan-review: repair

    • goal_fit - Acceptance signals, stop-request write failure - The new finally cleanup handles a normal test return, but the worker's SIGINT/SIGTERM handler runs registered cleanup and then re-raises the signal. The registered signal-fixture cleanup only closes supervisor stdin, which this case has already closed (cli/test/lib/goldenResources.ts:275–297, cli/test/unit/syncSignals.test.ts:185–186,232–236,344–350). Inference: cancelling the worker while the CLI is held can leave the CLI alive after the supervisor reaches its deadline, because neither closing stdin again nor terminating the worker releases it - Give the held CLI a bounded release path independent of the broken stop request and of the test reaching finally. Keep the ordinary teardown hook fail-closed - class: fault-case cleanup depends on the test reaching finally
    • goal_fit - Research F300-3 and Acceptance signals, F300-3 teardown - The row waits for the CLI and stubs but does not wait for the supervisor before removing the fixture. A retained ticket makes stubsEnded return false, and removing the root does not help: the missing records directory also makes it return false (cli/test/lib/supervisedRun.ts:58–62). Inference: the case can pass its keep assertion and delete the root while the detached supervisor still polls it, with a default bound of 120 seconds (cli/test/unit/syncSignals.test.ts:323–325, cli/test/lib/signalSupervisor.ts:38–40,85–99) - After asserting the keep decision, use a short supervisor deadline and await its exit before deleting the isolated root - class: fault-case cleanup omits a live fixture process

    Previous findings:

    • Round-5 finding on Research Tool facts; Acceptance tidy and gate: resolved - The export now gives the installed dash and lsof versions and identifies the dated dpkg-query -W source instead of claiming both support --version.
    • Round-5 finding on Steps fixture; Acceptance signals, stop-request write failure: resolved - The row now requires supervisor exit 1 no earlier than the test's shutdown deadline while the CLI remains held, without shutdown-confirmed.
    • Round-5 finding on Steps fixture; Acceptance signals, both supervisor fault cases and F300-3: resolved - The three cases now own their normal teardown outside the throwing afterEach path. F300-3 asserts the normal keep decision before fixture removal, and the ordinary hook stays fail-closed.

    Manager response to round 5

    Repaired:

    • Tool facts (redesigned after the finding returned): every host tool is resolved with which and readlink -f, and its version is the Ubuntu package version from dpkg-query -W, which also covers dash and lsof.
    • Deadline case: the supervisor exits 1 no earlier than the test deadline.
    • Fault-case teardown: the two fault cases and F300-3 own their teardown, release and wait for the held CLI and stubs in finally, and remove their isolated fixture; F300-3 asserts the keep decision first; normal teardown stays fail-closed.

    Rejected: none.

    Redesigned: none.

  9. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 7, delta

    Plan-review: repair

    • goal_fit - Research F300-1/F300-2 and Acceptance signals, PID-record write failure - The stand-in handles the failed write itself, bypassing signalSelfPreload.ts, which launchSync runs before the real CLI entry (cli/test/unit/syncSignals.test.ts:362–375). Inference: the row can pass even if the real preload lets the entry run after a failed write, allowing a stub to start without cli.pid - Run the PID-write fault through the real preload with a bounded test entry. Assert the fixed child exit code and that the entry never ran. Keep the autonomous stand-in for the stop-request fault - class: fault test substitutes the code it needs to verify
    • goal_fit - Research F300-1/F300-2 and Acceptance signals, PID-record write failure - Research requires the supervisor to exit 1 once the CLI and stubs are gone without a record. The row also accepts exit 1 at the short shutdown deadline with no shutdown-confirmed, which is already the generic timeout behavior (cli/test/lib/signalSupervisor.ts:85–98). Inference: adding the diagnostic but omitting the missing-record exit branch can still pass - Require supervisor exit 1 after the child exits and before the shutdown deadline. Keep the opposite deadline expectation for the stop-request fault - class: timeout fallback satisfies the acceptance check

    Previous findings:

    • Round-6 finding on Acceptance signals, stop-request write failure: resolved - The held stand-in now exits on its own within a hard lifetime, independent of the broken request and the worker reaching finally.
    • Round-6 finding on Research F300-3 and Acceptance signals, F300-3 teardown: resolved - The case now uses a short supervisor deadline and waits for the supervisor, CLI, and stubs to exit before removing the fixture, after asserting that normal teardown keeps it.

    Manager response to round 6

    Repaired:

    • Held CLI release: the two fault cases run the supervisor over a stand-in CLI script that ends on its own after a hard lifetime shorter than the spawn timeout, so its release needs neither the stop request nor the test's finally.
    • F300-3 teardown: each self-owned case uses a short supervisor deadline and waits for the supervisor, the CLI or stand-in, and the stubs before it removes its fixture.

    Rejected: none.

    Redesigned: none.

  10. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 8, delta

    Plan-review: pass

    None.

    Previous findings:

    • Round-7 finding on Research F300-1/F300-2 and Acceptance signals, PID-record write failure: resolved - The fault now runs through the real self-signal preload. The test asserts the fixed child exit code and that the entry never ran. The stand-in is used only for the stop-request fault.
    • Round-7 finding on Research F300-1/F300-2 and Acceptance signals, PID-record write failure: resolved - The test requires supervisor exit 1 after the child exits and before the shutdown deadline. The generic timeout no longer satisfies the check.

    Manager response to round 7

    Repaired:

    • Pid-record fault: it runs the real preload over a bounded test entry and asserts the fixed child exit code and that the entry never ran; the stand-in stays only for the stop-request fault.
    • Missing-record exit: the supervisor must exit 1 after the child exits and before the shutdown deadline; the stop-request fault keeps the deadline expectation.

    Rejected: none.

    Redesigned: none.

  11. 2 remaining items

  12. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 10, delta

    Plan-review: repair

    • goal_fit - Research F302-2 and F302-14, lines 26 and 28; Steps tidy, line 41; Acceptance tidy, line 51 - Both repairs are assigned only to step 2, which is already done. The plan contract explicitly requires a new step when a decision changes completed work (SoT/.omp/plugin/skills/plan-manager/references/plan-contract.md:393–395). The candidate still reads metadata in parallel and calculates worktree idle time from the first scan (cli/src/engine-native/tidy.ts:862–872,1002–1012), so a fresh index seen on the second scan can still leave the worktree scheduled for removal. Its runner tests still wait for the failing worker to settle before releasing the sibling (cli/test/unit/syncConcurrency.test.ts:204–218,246–260), so they do not exercise the newly required schedule. The plan has no pending step to deliver either repair - Add a planned local step after tidy for the F302-2 metadata repairs and the F302-14 controlled-scheduler regression, and make the tidy Acceptance row cover that step - class: repair decision assigned only to a completed step

    Previous findings:

    • Round-9 finding on Research F302-2, line 26: resolved - The revised decision bases the idle verdict on the newest activity from both scans.
    • Round-9 finding on Research F302-14, line 28; Steps tidy, line 41; Acceptance tidy, line 51: resolved - The revised decision removes the waiver and requires the controlled schedule to distinguish the fixed runner from the base loop.

    Manager response to round 9

    Repaired:

    • Worktree verdict: checkWorktree takes its idle verdict from the newest activity of both scans.
    • F302-14: the waiver is gone; the regression case uses a controlled Effect Scheduler that runs the sibling at the old publication boundary.

    Rejected: none.

    Redesigned: none.

  13. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 11, delta

    Plan-review: pass

    None.

    Previous findings:

    • Round-10 finding on Research F302-2 and F302-14, Steps tidy, and Acceptance tidy: resolved - Planned step 5 assigns both the metadata repair and the controlled-scheduler regression to pending work. The tidy acceptance row now covers step 5 and requires the regression cases to fail without their fixes.

    Manager response to round 10

    Repaired:

    • New planned step 5 repairs holds the F302-2 and F302-14 repairs and the other reproduced findings of code review round 1; the tidy row covers the cases of steps 2 and 5.

    Rejected: none.

    Redesigned: none.

  14. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 12, delta

    Plan-review: repair

    • research_gap - Research F302-14 (line 28) and Steps repairs (line 44) - Effect 4.1.7 can yield after capturing the failure but before runBounded publishes it. node_modules/effect/src/internal/effect.ts:3835 calls succeedWith, which returns a separate success primitive at multiples of 32 operations (:778–783, :858). If the failure primitive runs at operation 2047, that conversion reaches 2048, and the next budget check yields before the worker reaches cli/src/engine-native/syncConcurrency.ts:47 (internal/effect.ts:704–720, Scheduler.ts:217–219,303–315). Inference from this path: a ready sibling can claim the next task while the pool still accepts work, although the failure has already been captured. An onExit callback body runs in the failure continuation itself (internal/effect.ts:4241–4249) - Restore synchronous failure publication in onExit and make the controlled-scheduler regression hit the inline limit and yield before the old loop publishes. - class: scheduler trace misses the inline continuation limit

    Previous findings:

    None.

    Manager response to round 11

    Repaired: none (round 11 passed).

    Rejected: none.

    Redesigned: none.

    This round reviews the plan edit made after the round-11 pass:

    • F302-14 corrected to a rejection with evidence: a checkpoint trace under a controlled Scheduler (effect 4.1.7, four failure shapes) shows no scheduler yield between Effect.exit and the next worker statement, so the base loop already records a failure before any queued task can start; runBounded keeps the base loop and gets no regression case.
  15. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 13, delta

    Plan-review: pass

    None.

    Previous findings:

    • Round-12 finding on Research F302-14 and Steps repairs: resolved - F302-14 now publishes failure synchronously in the task’s Effect.onExit callback, before the worker can yield. Step repairs includes a controlled-scheduler regression at the inline continuation limit that checks that the queued task starts with the old loop but not with the fix.

    Manager response to round 12

    Repaired:

    • F302-14: the rejection is withdrawn. The onExit fix stays, the decision names the inline continuation limit as the window, and the regression case drives a failing worker to that limit under a controlled Scheduler.

    Rejected: none.

    Redesigned: none.

  16. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Code review round 1, lens correctness

    Code-review: pass

    Standards

    • [MEDIUM] Bug - cli/src/engine-native/tidy.ts:862-899, cli/src/engine-native/tidy.ts:1166-1189, cli/src/engine-native/tidy.ts:1462-1474 - A process outside an idle scratch entry can update an existing child after its parallel lstat completes while an earlier child's read is still pending. The old serial scan would see that update. Updating an existing file does not change the parent directory's mtime or inode. Inference: the new scan can still classify the entry as idle and delete it, or stop its containers during planning. This assumes no process has a working directory inside the entry. That breaks the "idle scratch" boundary in base cli/AGENTS.md:19. - Revalidate the sampled children's activity, not just the parent, before accepting an idle result for a destructive action. - class: stale child activity after parallel scan
    • [MEDIUM] Bug - cli/src/engine-native/tidy.ts:988-1012, cli/src/engine-native/tidy.ts:1407-1423 - A clean, merged worktree can be scheduled for removal even when the second metadata scan sees recent activity. If index is updated after its parallel read but before the HEAD read finishes, the old serial scan would see the new timestamp. The new scan records it in latest on the second pass but still decides removal from stale activity. Inference: if no process working directory protects the worktree, apply can remove its containers before Git checks the removal. Base cli/AGENTS.md:19 limits the sweep to "merged idle worktrees and their containers". - Use the newest activity seen across both scans for the worktree removal verdict. - class: stale worktree removal verdict
    • [LOW] Performance - cli/src/engine-native/tidy.ts:149-155, cli/src/engine-native/tidy.ts:862-870 - A scratch directory with many immediate children now keeps every full lstat record live until the last read finishes. The serial scan released each record after extracting its timestamp. Inference: large directories raise peak memory even though only one timestamp per child is needed. - Extract the optional timestamp within each bounded read and collect those results in input order. - class: retained file metadata

    Spec

    None.

    Code review round 1, lens spec-and-tests

    Code-review: pass

    Standards

    • [LOW] Maintainability - cli/test/unit/syncSignals.test.ts:221-248, cli/test/unit/syncSignals.test.ts:615-636 - Unreached: No current teardown caller, fixture, or documented input removes active/ before either teardown closes it. The new retained-ticket case leaves active/ present and stops at the missing launch confirmation. It would not catch a return to treating ENOENT as proof of closure. - Add a case where all launches have confirmed, active/ is missing, and closed is false. Assert that teardown reports the root as unconfirmed and leaves it on disk. - class: untested missing-ticket-folder refusal
    • [LOW] Bug - cli/test/unit/tidy.test.ts:1395-1415 - The .npm report test can reject correct output on a transparent-compression filesystem. The fixture writes one repeated byte, so du can legitimately measure less than the amount that rounds up to 0.1 MB. Both guards then reject the expected measurement. - Seed the cache with deterministic, incompressible bytes and retain the exact comparison against the independent du result. - class: compressible disk-usage fixture

    Spec

    • [MEDIUM] Spec - cli/test/unit/syncSignals.test.ts:409-415, cli/test/unit/syncSignals.test.ts:520-536, cli/test/unit/syncSignals.test.ts:638-640, cli/test/unit/syncSignals.test.ts:683-686 - If the supervisor reaches its deadline while the CLI is still alive, its close handler also resolves run.ended. Both teardown promises then settle, and removeOwnedRoot deletes the fixture without proof that the CLI or its stubs exited. This contradicts plan-304-cr1.md:50: each fault case “waits for the supervisor, the CLI or stand-in, and the stubs to exit, and then removes its isolated fixture.” - Separate the fallback outcome used in test assertions from evidence of actual child exit. Keep the root whenever teardown cannot prove that the CLI and its stubs have exited. - class: supervisor exit mistaken for child exit
    • [MEDIUM] Spec - cli/test/unit/syncSignals.test.ts:671-677, cli/test/unit/syncSignals.test.ts:721-740, cli/test/lib/signalSupervisor.ts:110-124 - The fault cases do not measure the supervisor's shutdown deadline. The pid-record case starts timing after the worker receives the CLI exit report; inference: delayed delivery can make a supervisor that waited out the full deadline look prompt. The stop-request case times from before the supervisor receives the request until after the worker observes its exit, so delivery delays can hide an early exit. plan-304-cr1.md:50 requires exit “before the shutdown deadline” in the first case and “no earlier than that deadline” in the second. - Observe shutdown start and the decision to exit on the supervisor's clock, and keep the independent assertions on the actual process exit. - class: observer timing substituted for shutdown timing
    • [MEDIUM] Spec - cli/src/engine-native/syncConcurrency.ts:43-54, cli/test/unit/syncConcurrency.test.ts:180-218, cli/test/unit/syncConcurrency.test.ts:246-290 - The runner cases do not distinguish the publication fix from the old worker loop. The failure cases let the failing worker settle before releasing its sibling, or fail both workers. The interruption case does not exercise the publication window. Inference: reverting to recording the failure after yield* Effect.exit(task) leaves these cases green. plan-304-cr1.md:28,41,51 requires coverage of the scheduler-yield race and “a test for each code fix that fails when the fix is removed.” - Control the scheduler so the successful sibling can take its next turn at the old publication boundary. Assert that the queued task never runs and that the case fails with the old worker loop. - class: missing regression for the failure-publication window
    • [MEDIUM] Spec - cli/src/engine-native/tidy.ts:862-869, cli/src/engine-native/tidy.ts:988-1003 - A worktree with an early metadata error now waits for all remaining metadata reads, including reads of paths listed by git status. Previously it stopped at the first error. Inference: a slow later read can now delay a keep verdict that the first error already decided. plan-304-cr1.md:26 limits this change to “the process cwd reads and the child lstat calls of entryActivity.” - Apply bounded parallel reads at the scratch-child call site and preserve short-circuiting for worktree metadata. - class: shared helper broadens planned concurrency
    • [LOW] Spec - cli/src/engine-native/tidy.ts:1305-1318, cli/src/engine-native/tidy.ts:1479-1488 - If an oversized log disappears after stat but before rotation, the ENOENT handler swallows the failed rename. The outer recovery never sees it, so tidy appends to a new file without a failed log line. plan-304-cr1.md:29 says the log write “recovers every failure and defect, but not an interruption, as a log failure line.” - Treat ENOENT as normal only when the initial stat finds no log. Let rotation errors reach the log failure handler. - class: missing-file recovery swallows rotation error
    • [LOW] Spec - cli/test/unit/tidy.test.ts:1143-1171, cli/test/unit/tidy.test.ts:1524-1582 - The waiting-stub cases let the stub publish the signal request while its CLI is still alive. Inference: restoring process.ppid as the PID source still passes those cases because it still identifies the CLI at that point. plan-304-cr1.md:19 requires the tidy stubs to use the PID record instead, and lines 41 and 51 require a red baseline for each code fix. - Exercise a stub that starts after its recorded CLI has exited. Assert that it exits promptly without publishing a signal request, and that reverting to process.ppid fails the case. - class: missing regression for a late-starting stub

    Code review round 1, lens text-and-safety

    Code-review: pass

    Standards

    • [MEDIUM] Bug - cli/src/engine-native/tidy.ts:880-896, cli/src/engine-native/tidy.ts:1462-1473 - If a planned scratch entry is missing at the first apply-time lstat, the activity check returns undefined and apply proceeds to deletion. Inference: if another agent recreates that path before deletion, removeTemporaryPath accepts the new directory without checking its activity. The new final lstat only protects entries the scan found initially. - Require a positive idle result before calling removeTemporaryPath. Preserve the existing missing-entry failure when the path is absent. - class: missing activity proof permits deletion
    • [MEDIUM] Bug - cli/test/unit/syncSignals.test.ts:407-413, cli/test/unit/syncSignals.test.ts:520-535, cli/test/unit/syncSignals.test.ts:637-640, cli/test/unit/syncSignals.test.ts:683-686 - If the supervisor reaches its deadline while the CLI is still alive, its close event resolves both promises that these fault cases pass to removeOwnedRoot. The helper ignores what the promises report and recursively deletes the fixture. Even a genuine CLI exit does not prove that the stubs have exited in the case that deliberately breaks their exit records. - Require separate evidence that the CLI and any started stubs have exited. Keep the fixture when that evidence is missing. - class: supervisor closure mistaken for descendant exit
    • [LOW] Bug - cli/test/unit/tidy.test.ts:993-1002, cli/test/unit/tidy.test.ts:1097-1108, cli/test/unit/tidy.test.ts:1192-1199 - The .npm report case executes real du before acquiring a ticket, contrary to the fixture's stated cleanup guarantee. If the CLI exits while du is still running, the empty ticket folder does not prove that the measurement has ended. - Run the real measurement inside the ticketed shell body and preserve its exit status. - class: untracked fixture subprocess
    • [LOW] Bug - CHANGELOG.md:3-12, .agents/skills/tidy-context/SKILL.md:221, cli/src/engine-native/tidy.ts:887-899 - The release note overstates what the scratch scan detects. An agent can append to an existing child after that child's lstat without changing the parent directory's modification time or inode. The skill also says a vanished entry gets no keep line, but an entry that vanishes before the final lstat now does. - Describe which directory changes the recheck detects, and limit the silent-skip guidance to entries missing at the first read. - class: inaccurate scratch check boundary
    • [LOW] Bug - .agents/skills/tidy-context/SKILL.md:147, cli/src/engine.ts:102-128 - The signal paragraph says a signal in a plain apply step exits only after printing the results. If a Git or Docker call follows, its exit point instead terminates the CLI before those results print. - State the two outcomes together: exit before the next Git or Docker call, or print the results and then exit if no such call remains. - class: contradictory signal guidance
    • [LOW] Bug - .agents/skills/tidy-context/SKILL.md:171, .agents/skills/tidy-context/SKILL.md:196, cli/src/engine-native/kitLock.ts:23, cli/src/engine-native/kitLock.ts:129-144 - The lock guidance names a nonexistent POLL_MS and describes a fixed retry interval. The test helper defaults to KIT_LOCK_POLL_MS, accepts a pollMs override, and caps each sleep at the remaining wait. - Name the actual default and describe how the helper applies it. - class: stale lock polling guidance
    • [LOW] Maintainability - cli/test/lib/supervisedRun.ts:98-112 - The new publishPidRecord export has no importer. The preload, listener-order entry, and stand-in CLI all use publishPidRecordOrExit, the wrapper that enforces the fixture's failure policy. - Keep publishPidRecord module-local or inline it into its only caller. - class: unused export

    Spec

    None.

  17. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Code review round 2, delta

    Code-review: pass

    Previous findings

    • Round-1 finding on cli/src/engine-native/tidy.ts:862-899: fixed - Scratch child reads are serial again at cli/src/engine-native/tidy.ts:850-877. The parallel scan no longer reads a later child early.
    • Round-1 finding on cli/src/engine-native/tidy.ts:988-1012: fixed - The removal verdict uses the newest timestamp from both scans at cli/src/engine-native/tidy.ts:986-1002.
    • Round-1 finding on cli/src/engine-native/tidy.ts:149-155: fixed - The serial scan extracts each timestamp before the next read at cli/src/engine-native/tidy.ts:850-858.
    • Round-1 finding on cli/test/unit/syncSignals.test.ts:221-248: fixed - The new case confirms the launch, moves active/ aside, and verifies that teardown retains the root at cli/test/unit/syncSignals.test.ts:816-835.
    • Round-1 finding on cli/test/unit/tidy.test.ts:1395-1415: fixed - The fixture uses seeded pseudorandom bytes and still compares the exact independent measurement at cli/test/unit/tidy.test.ts:1467-1499.
    • Round-1 finding on cli/test/unit/syncSignals.test.ts:409-415: open - repeated under Spec. Supervisor closure no longer resolves cliExited, but the stand-in's marker still precedes process exit.
    • Round-1 finding on cli/test/unit/syncSignals.test.ts:671-677: open - repeated under Spec. Both tests now use the supervisor's clock, but the PID-record case times the decision rather than the exit.
    • Round-1 finding on cli/src/engine-native/syncConcurrency.ts:43-54: fixed - The new test puts the failing worker at the yield boundary and checks that its sibling does not start the queued task at cli/test/unit/syncConcurrency.test.ts:304-364.
    • Round-1 finding on cli/src/engine-native/tidy.ts:862-869: fixed - The first failed metadata read ends the serial scan at cli/src/engine-native/tidy.ts:850-858. Only process working-directory reads keep the parallel helper behavior at cli/src/engine-native/tidy.ts:320-330.
    • Round-1 finding on cli/src/engine-native/tidy.ts:1305-1318: fixed - Only the initial stat treats ENOENT as normal. A failed rotation reaches the log failure handler at cli/src/engine-native/tidy.ts:1296-1306,1476-1486.
    • Round-1 finding on cli/test/unit/tidy.test.ts:1143-1171: fixed - The new case starts the stub under a live parent after the recorded process exits and verifies that the stub sends no request at cli/test/unit/tidy.test.ts:1598-1622.
    • Round-1 finding on cli/src/engine-native/tidy.ts:880-896: fixed - Apply reports a missing entry and skips deletion at cli/src/engine-native/tidy.ts:1454-1470.
    • Round-1 finding on cli/test/unit/syncSignals.test.ts:407-413: open - repeated under Standards. The stop-request case still accepts a marker written by the stand-in before it exits.
    • Round-1 finding on cli/test/unit/tidy.test.ts:993-1002: fixed - The shell runs real du inside the ticketed body and preserves its status at cli/test/unit/tidy.test.ts:1257-1267.
    • Round-1 finding on CHANGELOG.md:3-12: fixed - CHANGELOG.md:5-14 describes the directory recheck and its limit. .agents/skills/tidy-context/SKILL.md:221 restricts the silent skip to the first read.
    • Round-1 finding on .agents/skills/tidy-context/SKILL.md:147: fixed - The paragraph distinguishes exit before the next tool call from exit after printing when no tool call remains.
    • Round-1 finding on .agents/skills/tidy-context/SKILL.md:171: fixed - The guide names KIT_LOCK_POLL_MS, the override, and the cap on each sleep at .agents/skills/tidy-context/SKILL.md:171,196.
    • Round-1 finding on cli/test/lib/supervisedRun.ts:98-112: fixed - publishPidRecord is module-local at cli/test/lib/supervisedRun.ts:98-112.

    Standards

    • [MEDIUM] Bug - cli/test/unit/syncSignals.test.ts:584-593,758-768,805-811 - If the stand-in pauses after creating its marker, teardown can delete the root while the process is still alive. The marker is written inside the stand-in's exit callback, and fileAppears checks only that the file exists. Inference: the worker can observe the marker before the callback returns. - Wait for operating-system exit evidence for the recorded stand-in, not just the marker. - class: supervisor closure mistaken for descendant exit
    • [LOW] Bug - cli/test/unit/syncSignals.test.ts:541-555,586-593 - Unreached: If a retained ticket cannot be read while stub-records is a file, stubsGone skips the ticket and authorizes deletion without checking its process. The three fault teardowns and the plan's fault inputs were checked. The retained-ticket fixture replaces stub-records, but none makes a retained ticket unreadable. - Treat a read failure as unconfirmed unless the corresponding exit record proves the ticket was released. - class: unreadable ticket treated as exit proof
    • [LOW] Bug - .agents/skills/tidy-context/SKILL.md:147, cli/src/engine-native/tidy.ts:1476-1486, cli/src/commands/tidy.ts:77-82 - The no-more-tools signal guidance puts printing before logging and says the log is written. Apply attempts the log first. If that attempt fails, the CLI prints the log failure with its results before exiting. - Describe the log attempt, then result printing, then signal exit. - class: reversed output and logging order

    Spec

    • [MEDIUM] Spec - cli/test/unit/syncSignals.test.ts:758-768,805-811 - plan-304-cr2.md:51 says teardown “waits for the supervisor, the CLI or stand-in, and the stubs to exit, and then removes its isolated fixture.” The stop-request case waits for a file the stand-in creates before exiting. Inference: if the stand-in is descheduled after the write, teardown can remove the fixture before it exits. - Require process exit evidence before removal. - class: supervisor exit mistaken for child exit
    • [MEDIUM] Spec - cli/test/lib/signalSupervisor.ts:118-130, cli/test/unit/syncSignals.test.ts:734-737 - plan-304-cr2.md:51 requires supervisor exit “before the shutdown deadline” in the PID-record fault case. The test checks a timestamp taken before the report write, but the supervisor can wait up to another second for its write callback. Inference: a decision just before the deadline and a write that completes just after it can still pass. - Measure at the exit boundary, after any asynchronous report wait, and keep the independent exit-code assertion. - class: decision timing substituted for exit timing
    • [LOW] Spec - cli/src/engine-native/tidy.ts:819-827,1454-1464, cli/src/engine-native/scratch.ts:175-179 - plan-304-cr2.md:67 protects “the reason strings, the output, [and] the exit codes.” If the scratch root becomes a regular file between planning and apply on POSIX, the first child lstat returns ENOTDIR. The old removal path printed that error. The new path reports does not exist, which previously meant ENOENT only. - Keep the two diagnostics distinct without retrying deletion when either error prevents an idle verdict. - class: distinct filesystem errors collapsed into one reason
    • [LOW] Spec - cli/src/engine-native/tidy.ts:850-858, cli/test/unit/tidy.test.ts:542-589 - plan-304-cr2.md:26,44,52 requires serial metadata reads, first-error short-circuiting, and a test that fails when each fix is removed. The scratch case changes the parent directory, so the final parent check also protects it with parallel reads. The worktree case checks timestamp selection, not short-circuiting. Inference: restoring the parallel scan while retaining the other repairs leaves both cases green. - Add regressions for a write to an existing scratch child during the scan and for a worktree scan that must return its first error without waiting on a later read. - class: missing regression for serial metadata reads

    Manager response to round 1

    Repaired:

    • Correctness MEDIUM x2, Spec MEDIUM (short-circuit), Correctness LOW (memory): scratch-child and worktree metadata reads are serial again and stop at the first failure; checkWorktree takes its idle verdict from the newest activity of both scans; new case where the second scan sees a newer index time.
    • Spec MEDIUM (runner window): the onExit fix stays; a new case sweeps 0 to 63 padding operations under a 64-operation budget and fails on the base loop at the inline continuation limit.
    • Text MEDIUM (missing entry at apply): an entry is removed only on a positive idle result; a missing entry gets its failure line and no removal; new case.
    • Spec and Text MEDIUM (fault-case teardown): removeOwnedRoot needs the CLI's own exit report or the stand-in's end marker, and every stub gone (exited ticket pids, .stub-exited for each .started); otherwise the root stays.
    • Spec MEDIUM (timing): the supervisor reports its shutdown time on its own clock; the fault cases assert on it.
    • Spec LOW (rotation ENOENT): ENOENT is normal only when the first stat finds no log; new case.
    • Spec LOW (late stub): new case with a pid record of an exited process.
    • Spec LOW (missing ticket folder): new case; teardown keeps the root unconfirmed.
    • Spec LOW (compressible bytes): the .npm fixture uses seeded incompressible bytes.
    • Text LOW: the real du runs inside the ticketed body; the changelog and skill describe what the recheck detects; the signal paragraph states both outcomes; the lock guidance names KIT_LOCK_POLL_MS; publishPidRecord is module-local.
    • Plan: F302-2 and F302-14 decisions were corrected and reviewed in plan rounds 9 to 13 (step repairs).

    Rejected: none.

    Redesigned: none.

    Round 2 passed. Under the ultra-yolo instruction of this run (review until a pass) and the round policy analysis in #305, this run lands on this pass. Its open findings (three MEDIUM and two LOW in test fixtures, two LOW in text and product reason strings) are listed in a follow-up issue.

  18. DocksDocks commented on Dec 2, 2026

    @DocksDocks
    OwnerAuthor

    Archived with landing pull request #307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions