Skip to content

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

Merged
DocksDocks merged 5 commits into
mainfrom
304-fix-the-open-review-findings-of-the-sync-signal-fixture-and-the-tidy-move
Dec 2, 2026
Merged

DocksDocks merged 5 commits into
mainfrom
304-fix-the-open-review-findings-of-the-sync-signal-fixture-and-the-tidy-move

Conversation

@DocksDocks

Copy link
Copy Markdown
Owner

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

Reviewed head: 5bdbef21. Checks: see the pull request.

What changed

  • docks-kit 0.32.3. tidy --apply keeps a scratch entry when the entry itself changes during the activity check (a child created, removed, or renamed). It removes an entry only on a positive idle result, and it keeps a merged worktree when the second activity scan sees newer activity.
  • tidy reads the .git marker, the Bun global package.json, and .trashinfo with a leading BOM kept, as before Move tidy to Effect #295. A failed log rotation or append prints its failed log line. Four internal types are no longer exported.
  • runBounded records a task failure in the exit callback of the task, so no queued task starts after a failure at the scheduler's inline continuation limit.
  • Signal test fixture (Harden the remaining failure paths of the sync signal test fixture #300): the CLI writes its own pid record before its entry runs. The supervisor reports a missing record or a failed stop request and keeps a bounded wait. Both teardown paths share the closure flag of the ticket folder.
  • Tidy tests (Fix the open review findings of the tidy move to Effect #302): new cases for each fix. The spawned fixtures read the pid record, quote every path, release stubs without signals, and measure a seeded .npm cache exactly.
  • Guidance: tidy-context and DESIGN.md name tryAcquireKitLock as the production lock, describe both signal outcomes, and describe what the scratch recheck detects.

Delegated decisions

  • Version: patch bump to 0.32.3, because the scratch recheck changes which entries an apply removes. Record: Research "Version".
  • Metadata reads: serial, as before Move tidy to Effect #295; only the process cwd reads are parallel. Rejected: parallel metadata reads, whose speed gain was never measured. Record: Research F302-2 (corrected after code review round 1).
  • Runner window: the fix stays with a regression case at the inline continuation limit. A first trace said the window could not be reached; that trace had run the fix twice, and the rerun against the real base reproduced the window. Record: Research F302-14.
  • Landing on the round-2 pass: the user asked this run to review until a pass and to merge without a question. The open findings of the pass are in Fix the open review findings of #304 #306.
  • Worktree: a worktree under the agent worktree folder.

Reviews

  • Plan review passed in round 8. The edits after code review round 1 passed in round 13.
  • Code review: round 1 (panel of three lenses) passed with findings, which were repaired; round 2 (delta) passed.
  • Open findings: 3 MEDIUM and 3 LOW, mostly in test fixtures, in Fix the open review findings of #304 #306.

Verification (on 5bdbef21)

  • signals: exit 0, 10 passed. tidy: exit 0, 111 passed, 1 skipped. Red baselines: each case of a code fix failed with its fix removed.
  • scan: exit 1, no match. guidance: as expected.
  • goldens: OK; only the version-derived digests changed. gen, dry, types, ci-tools, smoke: exit 0. red-dry, red-mut: exit 1 with prove-red OK.
  • gate (bun run check): exit 0, 6524 passed, 12 skipped.

Limits and failures

  • Local checks ran on Linux x64 only. Full CI covers Ubuntu, macOS, and Windows. The signal cases run on Linux and macOS only.
  • One earlier bun run check failed only in the load-sensitive ompTriggerBackstop.test.ts timing cases while many agents ran; the run on the reviewed head passed.

Kept resources

  • After the merge: none.

After merge

  • none

Checklist

  • bun run check passes
  • Tested locally end to end (signals, tidy, scan, guidance, goldens, gen, dry, prove-red, types, ci-tools, smoke, gate)
  • Code review passed

Closes #304
Closes #300
Closes #302

…ardown closure

Step fixture of #304 (findings of #300): the preload and the listener-order entry write the
CLI pid record before the entry runs; the supervisor reports a missing record or a failed
stop request as a diagnostic and waits within its bound; both teardown paths share the
closed flag of the ticket folder; new cases for each fault.

Verified: bun x --no-install vitest run cli/test/unit/syncSignals.test.ts
Step tidy of #304 (findings of #302): the scratch activity check reads the entry again after
its children; metadata reads run up to 8 at a time with the first failure in scan order;
text reads keep a leading BOM; the runner records failures in the exit callback; the log
write recovers defects; unused exports become local; the spawned fixtures read the pid
record, quote paths, release stubs without signals, and cover more paths.

Verified: bun x --no-install vitest run cli/test/unit/tidy.test.ts cli/test/unit/tidyReport.test.ts cli/test/unit/syncConcurrency.test.ts; bun run check:types
Step guidance of #304: tryAcquireKitLock is the production lock and acquireKitLock is
test-only; a recorded signal exits before the next git or docker call starts; the source
ranges cover releaseKitLock and the new file lengths.

Verified: bun x --no-install vitest run cli/test/unit/skillMetadata.test.ts
Step version of #304: the tidy scratch re-check changes which entries an apply removes in a
race. Payload, talk bundle, and the version-derived mutation digests are regenerated.

Verified: bun run check:generated; bun run golden:mutation; ./docks-kit sync --dry-run; bun run check
Step repairs of #304:
- Scratch-child and worktree metadata reads are serial again; the worktree idle verdict uses
  the newest activity of both scans; apply removes a scratch entry only on a positive idle result.
- A rotation error after a successful stat reaches the log failure line.
- A regression case for the runner failure window at the inline continuation limit.
- Fault-case teardown needs CLI and stub exit evidence; the supervisor reports its shutdown
  time on its own clock; new cases for a late stub and a missing ticket folder.
- Guidance and changelog describe what the scratch recheck detects, both signal outcomes, and
  the lock poll constant.

Verified: bun x --no-install vitest run cli/test/unit/syncSignals.test.ts 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; bun run check:types; bun run lint; bun run check
@DocksDocks
DocksDocks marked this pull request as ready for review December 2, 2026 05:14
@DocksDocks
DocksDocks merged commit ab33f4f into main Dec 2, 2026
10 checks passed
@DocksDocks
DocksDocks deleted the 304-fix-the-open-review-findings-of-the-sync-signal-fixture-and-the-tidy-move branch December 2, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant