E2E docs follow SDD; a Resume at the instant of finish is no longer refused as busy - #1529
Merged
Merged
Conversation
sdd.md scopes spec.md files to business logic and explicitly excludes test code, and specs are plain-language product docs — the e2e spec.md was both misplaced and written as technical harness documentation. - src/e2e/spec.md becomes src/e2e/README.md (developer doc, where telefunction names, env vars, and file references belong); the five source-comment references follow the rename. - The two product behaviors #1528 shipped move to the specs that own them, in spec language: acting on a session the instant it finishes is safe (product spec, teardown) and a live stream follows the log into the archive without dropping the ending (dashboard-rpc spec). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XKihCTfcazhDgt4dhUmfM9
The settings story flaked on CI (#1529): sendStart with continueRunId hit the busy guard while the finished first leg's child was still mid-exit — the slot held a live pid, and the continuation of a session that was over by its own account was refused as "already active". daemon-runtime now parks each leg's exit → retirement chain per run slot (retiring), and a continuation of a run whose meta reads terminal (via findRun — the live copy wins, since the just-written `done` is not archived until teardown) waits out the exit and the queued retirement, bounded, before the guard judges. A refusal is reserved for sessions genuinely still running, and the checkout reuse always reads a settled archive. waitOutFinishedLeg carries six unit tests; the settings story pins the full path (15× stress green, from 5/15 red). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XKihCTfcazhDgt4dhUmfM9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two things, the second surfaced by this PR's own CI run:
src/e2e/spec.mdwas technical harness documentation.donewas refused as "already active" on a slow runner.SDD conformance (
e73f6a77)src/e2e/spec.md→src/e2e/README.md— the content is genuinely useful developer documentation, so it lives on as a README, where technical detail belongs and sdd.md doesn't govern. The five source-comment references follow the rename.packages/the-framework/spec.md, teardown) and a live watcher never misses a session's ending (src/dashboard-rpc/spec.md).The Resume-at-finish refusal (
5957d36b)CI failed
settings written in the dashboard reach the next resumed run (#858/#1467):sendStart({continueRunId})returnedbusy. A run's row flipsdonethe moment the child writes its ending, but the child takes a beat more to actually exit — and a Resume landing in that gap found the run's slot still holding a live pid, so the busy guard turned away a continuation of a session that was over by its own account. #1528's run lock made acting-at-finish safe; this window could still make it fail.Fix in
daemon-runtime:markFailedStart→tearDownWorktree→ transient retry) is parked per run slot in aretiringmap.findRun— the composed read where the live copy wins — because the just-writtendoneisn't in the archive until teardown puts it there.runningis a genuine collision and keeps its refusal, and a leg that never exits within the grace still reaches the guard.Validation:
waitOutFinishedLeghas six deterministic unit tests; the settings story went from 5/15 red under standalone stress to 15/15 green, the other three story files 4/4 each, and the full package suite passes 1719 tests. Changeset (patch) included for the behavior fix.🤖 Generated with Claude Code
https://claude.ai/code/session_01XKihCTfcazhDgt4dhUmfM9