Repository navigation
fix(ladder): refuse to execute an execution whose tranche is already settled - #853
Conversation
…settled The execute-time recheck read the config switches and the run status but never the tranche status. An execution that carries a tranche key but is not on the locked retry chain could still buy after the tranche was failed, completed or canceled. GetLadderExecutionGate now returns the tranche status and ladderGateRefusal refuses unless the tranche is scheduled or fired; a missing status refuses too. The refusal is a beforeSubmission error as before. Refs #118 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 4 billable files and costs up to $1.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 12 minutes for your next included review. View limit details
Comment |
|
Gate (Opus, money path) at 9db3305: CHANGES REQUESTED, not merged. Blocker
Review of the logic (no defects found; reviewed by reading the archived head)
Non-blocking follow-ups
Local evidence: none run this pass. The machine has ~119 MB free (ENOSPC hit during the gate), so no PG17 cluster or Go test build was possible; CI is red on lint regardless, and the next gate at the fixed head must run the unit + integration suites locally. |
Refs #118 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Gate (Opus, money path) at d8338bc: APPROVE, merging. Delta since 9db3305 (previous gate) is test-only: Local evidence (macOS,
Non-blocking follow-up (surviving mutant): replacing |
Refs #118
Second review finding on the operator resolve plan (#848 hole): the execute-time recheck (
ladderGateRefusal) read the ladder config switches and the run status but never the tranche's own status. An execution carrying a tranche key but not on the locked retry chain could still buy after the tranche was failed, completed or canceled (for example after an operator resolve, PR5b). This lands first so PR5b does not depend on it being right.GetLadderExecutionGatealso returnst.statusasTrancheStatus.ladderGateRefusalrefuses when the tranche is settled (LadderTrancheSettled: anything but scheduled or fired) or the status is missing. The refusal is a beforeSubmission error, so the row ends failed with no_submission stamped, as for the other gate refusals.Verification (local macOS, real PG17 for the SQL; the rest is the existing mock-store harness, labelled FIXTURE in the test file):
TestLadderRecheck_*unit tests pass, including new cases for failed, completed and cancelled tranches and a missing status, and a new positive control that fired and scheduled tranches still buy exactly once (an inverted check fails it).TestGetLadderExecutionGate(integration, PG17) asserts the real tranche status. Mutants run: check removed, check inverted; both fail the suite.internal/purchaseintegration suite passes.🤖 Generated with Claude Code