Repository navigation
fix(execution): a permissions refusal on a bracket leg is definite -- rejected and retried, not state-unknown (#945) - #948
Merged
Conversation
… rejected and retried, not state-unknown (#945) R5 booked every post-row raise as state-unknown: the pending row stayed, the unbracketed: retry was cleared, and the product's exits waited on a human to reconcile a row no venue order backed. A TradeScopeDenied is not ambiguity -- the venue refused the order outright, so nothing rests at the exchange. The row now takes rejected (the status a broker-rejected placement already takes), the retry record is armed, and a CRITICAL executor.bracket_refused names the position; the next cycle's sweep re-places, and heals the moment the credential trades again. Timeouts and network raises keep R5's state-unknown booking. _run_order's refutation write (#233) is untouched.
…al-is-definite # Conflicts: # docs/superpowers/plans/2026-09-28-dca-sleeve-sell-side-build.md
This was referenced Sep 30, 2026
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.
Closes #945.
What
R5 booked every post-row bracket-leg raise the same way: the
pendingrow stayed, theunbracketed:retry was cleared, and a CRITICALexecutor.bracket_state_unknownparked the product's exits on a human -- correct for a timeout, where the venue really may be holding the order.TradeScopeDeniedwas folded into that bucket on purpose, but a permissions refusal is a DEFINITE answer: the venue did not take the order, nothing rests at the exchange, and there is no unknown to reconcile.The fix (the review's S-6, R80 in the plan)
A dedicated
except TradeScopeDeniedahead of the broad handler:rejected-- the status a broker-rejected placement already takes in_run_order, and whatreconcile's own docstring says a broker rejection writes;unbracketed:retry record is armed (not cleared), soreconcile_unbracketed_positionsre-places next cycle and heals the moment the credential trades again -- a rejected row is not a resting one and blocks nothing;executor.bracket_refusednames the position: unprotected, loudly, but not unknown.Timeouts and every other raise keep R5's state-unknown booking unchanged.
_run_order's refutation write (#233) is untouched -- a placement-path refusal is a credential fact; only its row bookkeeping changes. A refusal at the PREVIEW (before any row exists) keeps the pre-row retry path it always had.Tests
test_bracket_downgrade.py: the parametrized place-raise test keeps only the ambiguous timeout; a new test pins rejected-row + armed retry +bracket_refused+ no unknown event, and a preview-stage refusal still writes no row.test_reconcile.py: the sweep-level mirror of the [PR #889] scale_out's CRITICAL claims the unbracketed record is retained after a place-stage bracket throw clears it #892 timeout test -- first sweep refuses (rejected row, retry survives, escalation saysretry_scheduled=True), second sweep with a working broker heals.Plan doc: R80 (note: this branch and #944 both append after R77 -- trivial conflict, keep R78/R79 then R80).