fix(dispatch): a claim-bound stop closes a managed Task too (ISS-9) #210

Merged
janpeter merged 1 commit from feat/iss-9-close-task-stops into main 2026-10-09 17:05:44 +02:00
Owner

ISS-9 / IDEA-245 — PR 2 (scrum4me-mcp), T7. Follows Scrum4Me PR janpeter/Scrum4Me#346 (merged b50ab6fc), whose closed-schema link 0001 is live on prod (T6, 2026-10-09: migrate + policy-apply green, activation preflight OK, live guard fingerprint = 0001 afterSchemaHash).

What

  • src/dispatch/stop-evidence.ts: closesAtStop removed. A claim-bound stop (claim_bound_unscoped) on a task_implementation now closes in the same transaction like every other action (FAILED, or cancellation for CANCEL_REQUESTED), so the Task binding and reservation are released. Accepted states are CLAIMED/UNCERTAIN/CANCEL_REQUESTED for every action.
  • scripts/dispatch-test-db.mjs: pinned overlay of link 0001 (commit b50ab6fc, path prisma/migrations/20261009140000_closed_schema_0001_task_guard_unscoped_stops/migration.sql, sha256 e6c32f39…5767 of the raw bytes), read with git show, applied as the schema owner after the harness overlay; also checked by check.
  • Tests (host-task): the pre-ISS-2 test is replaced by (1) a claim-bound stop closes a host Task FAILED, binding NULL, reservation released, Task FAILED; a stop replay returns the same receipt and adds no result/projection; (2) the ISS-12 orphan sweep closes a host Task whose supervisor was replaced before start (this path already closed task_implementation and would have rolled back on the old guard).

T0 evidence

main = 48555ea6 = the T0 pin (GRILLS/idea-245-t0-mcp-evidence rev 2); no drift in stop-evidence.ts, attempts.ts, artifacts.ts, lifecycle.ts, dispatch-test-db.mjs.

Verification (local)

  • npm run typecheck green; npm test 268 files / 2634 tests green.
  • Dispatch gate (run-dispatch-ci.mjs, pgvector/pg17, schema root 6dc581d): 30 files / 371 tests green.
  • Sanity: with the overlay disabled exactly the two new tests fail (old guard refuses the release).

After merge

JP redeploys the dispatch service. Sign-off (ISS-9): the next real task_implementation with a pre-scope refusal or an orphan close ends terminal, with a result, released reservation and tasks.dispatch_request_id cleared; then ISS-9 and ISS-2 close.

🤖 Generated with Claude Code

ISS-9 / IDEA-245 — PR 2 (scrum4me-mcp), T7. Follows Scrum4Me PR janpeter/Scrum4Me#346 (merged `b50ab6fc`), whose closed-schema link 0001 is **live on prod** (T6, 2026-10-09: migrate + policy-apply green, activation preflight OK, live guard fingerprint = 0001 `afterSchemaHash`). ## What - `src/dispatch/stop-evidence.ts`: `closesAtStop` removed. A claim-bound stop (`claim_bound_unscoped`) on a `task_implementation` now closes in the same transaction like every other action (FAILED, or cancellation for `CANCEL_REQUESTED`), so the Task binding and reservation are released. Accepted states are `CLAIMED`/`UNCERTAIN`/`CANCEL_REQUESTED` for every action. - `scripts/dispatch-test-db.mjs`: pinned overlay of link 0001 (commit `b50ab6fc`, path `prisma/migrations/20261009140000_closed_schema_0001_task_guard_unscoped_stops/migration.sql`, sha256 `e6c32f39…5767` of the raw bytes), read with `git show`, applied as the schema owner after the harness overlay; also checked by `check`. - Tests (`host-task`): the pre-ISS-2 test is replaced by (1) a claim-bound stop closes a host Task FAILED, binding `NULL`, reservation released, Task `FAILED`; a stop replay returns the same receipt and adds no result/projection; (2) the ISS-12 orphan sweep closes a host Task whose supervisor was replaced before start (this path already closed task_implementation and would have rolled back on the old guard). ## T0 evidence `main` = `48555ea6` = the T0 pin (`GRILLS/idea-245-t0-mcp-evidence` rev 2); no drift in `stop-evidence.ts`, `attempts.ts`, `artifacts.ts`, `lifecycle.ts`, `dispatch-test-db.mjs`. ## Verification (local) - `npm run typecheck` green; `npm test` 268 files / 2634 tests green. - Dispatch gate (`run-dispatch-ci.mjs`, pgvector/pg17, schema root `6dc581d`): 30 files / 371 tests green. - Sanity: with the overlay disabled exactly the two new tests fail (old guard refuses the release). ## After merge JP redeploys the dispatch service. Sign-off (ISS-9): the next real `task_implementation` with a pre-scope refusal or an orphan close ends terminal, with a result, released reservation and `tasks.dispatch_request_id` cleared; then ISS-9 and ISS-2 close. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(dispatch): a claim-bound stop closes a managed Task too (ISS-9)
All checks were successful
CI / Final merge attestation and immutable publication (pull_request) Has been skipped
CI / PR candidate (never published) (pull_request) Successful in 7m58s
718cf3d40d
closed-schema link 0001 (Scrum4Me IDEA-245, merged b50ab6fc, live on prod)
lets queue_dispatch_guard_task() release a Task binding after a
claim_bound_unscoped or signed_off_unstarted stop. closesAtStop goes:
task_implementation now closes at the stop like every other action. The
dispatch test DB applies that link as a pinned overlay (commit, path,
sha256 of the raw bytes) as the schema owner after the harness overlay.
Tests: a host Task closes FAILED with its binding released and a stop
replay changes nothing; the ISS-12 orphan sweep closes a host Task.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
s4m-codex-reviewer left a comment

APPROVED

Findings:

  • Geen blokkerende of overige concrete findings gevonden.

De wijziging sluit managed Tasks via de bestaande transactionele afsluitpaden, behoudt de authenticatie en pre-scope-controles, en voorkomt een tweede afsluiting bij replay. De database-overlay volgt het bestaande patroon met een geverifieerde commit-, pad- en SHA-256-pin. De integratietests dekken terminale afsluiting, vrijgave van binding/reservering, replay en orphan-afsluiting. Geen strijdigheid met de geraadpleegde productstandaarden; de codecommentaren en PR-beschrijving beschrijven de afhankelijkheid en vervolguitrol voldoende.

Plan gekoppeld via commits (product Scrum4Me). References: ST-1651 (Scrum4Me). Geen omitted onderdelen. Deze PR levert het MCP-deel van T7; de eerdere schema-/uitroltaken vallen buiten deze diff. Scrum4Me-PR #346 is gemerged op de gepinde commit. De echte productie-aftekening na herdeploy blijft expliciet vervolgwerk volgens de PR en is geen claim van volledige story-oplevering.

Onafhankelijke verificatie op head 718cf3d40db5bd605b4031d5ff668d973e7ead10: beide typechecks groen; gewone suite 2634 tests geslaagd (81 standaard overgeslagen); disposable PostgreSQL 17-dispatch-gate 371/371 tests groen; diff-check en SQL-pin groen. De eerste dispatch-run had twee tijdzonegevoelige failures; na correctie van de lokale testcluster naar UTC is de volledige gate op een verse database geslaagd. Geen productie-mutaties uitgevoerd.

# APPROVED Findings: - Geen blokkerende of overige concrete findings gevonden. De wijziging sluit managed Tasks via de bestaande transactionele afsluitpaden, behoudt de authenticatie en pre-scope-controles, en voorkomt een tweede afsluiting bij replay. De database-overlay volgt het bestaande patroon met een geverifieerde commit-, pad- en SHA-256-pin. De integratietests dekken terminale afsluiting, vrijgave van binding/reservering, replay en orphan-afsluiting. Geen strijdigheid met de geraadpleegde productstandaarden; de codecommentaren en PR-beschrijving beschrijven de afhankelijkheid en vervolguitrol voldoende. Plan gekoppeld via commits (product Scrum4Me). References: ST-1651 (Scrum4Me). Geen omitted onderdelen. Deze PR levert het MCP-deel van T7; de eerdere schema-/uitroltaken vallen buiten deze diff. Scrum4Me-PR #346 is gemerged op de gepinde commit. De echte productie-aftekening na herdeploy blijft expliciet vervolgwerk volgens de PR en is geen claim van volledige story-oplevering. Onafhankelijke verificatie op head `718cf3d40db5bd605b4031d5ff668d973e7ead10`: beide typechecks groen; gewone suite 2634 tests geslaagd (81 standaard overgeslagen); disposable PostgreSQL 17-dispatch-gate 371/371 tests groen; diff-check en SQL-pin groen. De eerste dispatch-run had twee tijdzonegevoelige failures; na correctie van de lokale testcluster naar UTC is de volledige gate op een verse database geslaagd. Geen productie-mutaties uitgevoerd.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
janpeter/scrum4me-mcp!210
No description provided.