fix(dispatch): release the scope after a late answer on the received-journal replay (ISS-4) #119
No reviewers
Labels
No labels
severity/s2
severity/s3
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
janpeter/scrum4me-docker!119
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/competent-snyder-d261fd"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes a leak found while reviewing the ISS-4 fix.
In
runDispatchAttempt, thephase==='received' && receiptIdreplay returned{outcome:'late'}without callingreleaseScope. Thestagedpath and the main path both release on a late answer. Because of that, the broker container, the broker attempt directory (holding the child's provider key) and the prepared-sources staging in/run/sourcesstayed behind. The 48h orphan sweep (armPreparedSourcesSweep) skips them because the supervisor journal stays.Change: call
releaseScope(ports,scope,proof.attempt_id)before returninglateon that path, following the M41 U3 rule indocs/dispatch-runtime-operator.md("A late answer is released too").Test:
release after the terminal answer→ releases after a late answer on the received-journal replay too. It writes areceivedjournal withreceiptIdandresult, andsubmitResultanswers{status:'late',result_id:null}. The test expects outcomelateandruntime.release(scope,id). It failed before the fix (0 calls) and passes after.Verification:
npx vitest run __tests__/dispatch-supervisor.test.ts: 63/63 passednpm run typecheck:dispatch: clean🤖 Generated with Claude Code
The phase 'received' replay returned `late` without releaseScope, unlike the 'staged' and main late paths. The broker container, its attempt directory (with the child's provider key) and the /run/sources staging stayed behind, and the 48h orphan sweep skips them because the supervisor journal remains. Release there too, per M41 U3 ("A late answer is released too"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>COMMENT
De wijziging in lib/dispatch-supervisor.ts:195 hergebruikt releaseScope vóór de late-return op het received-replaypad. Dit sluit aan op de bestaande staged-/normale paden en de expliciete M41 U3-regel in docs/dispatch-runtime-operator.md. De helper behoudt het terminale resultaat bij cleanup-fouten; de broker controleert zelf de gestopte scope en ondersteunt herhaalde release. Geen blokkerende codekwaliteit-, architectuur- of documentatiefindings gevonden. Deze kleine correctie vereist geen nieuwe productdocumentatie.
Findings:
Verificatie: PR resolveert en head komt overeen met
d77b152c15; diff gecontroleerd. Typecheck (node node_modules/typescript/bin/tsc -p tsconfig.dispatch.json) slaagt na initialisatie van de gepinde shared-submodule.git diff --checkslaagt. Vitest-uitvoering blijft door de genoemde omgevingsbeperking onbevestigd.geen gekoppeld plan gevonden — beoordeeld op codekwaliteit + product-standaarden.
Test run for the review's open INFO point: Vitest was run locally (macOS) on head
d77b152c1571f136e4d47d513f8740edead854e6. CI does not run Vitest; it only validates compose, checks build-arg coverage and runs the docker build.npx vitest run __tests__/dispatch-supervisor.test.ts: 63/63 passed, including releases after a late answer on the received-journal replay too. Before the fix this test failed with 0runtime.releasecalls.npm run typecheck:dispatch: clean.__tests__/transcript-retention.test.ts(chmod: illegal option -- -). The script calls GNU-stylechmod, which macOS rejects. This PR doesn't touch that test or script.🤖 Generated with Claude Code