Repository navigation
Keep shared-runner sell commitments durable and refresh exit pricing - #1170
Open
seathatflowsinourveins wants to merge 2 commits into
Open
seathatflowsinourveins wants to merge 2 commits into
seathatflowsinourveins wants to merge 2 commits into
Conversation
7 of 9 tasks
This branch has not been deployed
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.
Scope
The shared runner needs whole-share sell chunks that finish their durable reduction target across ticks, fills and restarts. This PR carries the sanitized #1091 change and keeps commitment strength separate from current exit pricing. A stop or trailing signal now changes the resting order's pricing basis even when an older, stronger commitment still targets zero. A closed-session refusal automatically re-arms when the validated session window opens.
9cf1225581ffca6ea42e30076ddd7ac9074f828f.lane:trading.93f34f01057a9eb68dc07d098a8c3755670959a0.7511c8ae350f4e1b868b097fb163284a4822ff12. This replacement PR carries all its sanitized content. CC owns landing; test(trading): qualify lane A OVERNIGHT stage admission #1095 remains gated.The complete carried behavior includes bounded whole-share sells; durable targets and completion/scale-in handling; refusal pacing and uncertain-submission reconciliation; pinned native-denial policy; type-only foreign diagnostics; and bounded integrity-loss cancellation integrated with landed #1119. The second integrity guard remains after snapshot/refresh work and before rebalance.
Current pricing basis and session rearm
At the reviewed parent, a stale-quote commitment could survive a fresh take-profit at 100.50 and a later stop at 99.70. Both orders inherited the durable
quote_stalereason'smarketrule. At 100 bps replacement tolerance the roughly 80 bps price move requested no cancel, leaving the 100.48 limit above the market. Similar cases involved risk-off, gap/corporate-action commitments and a stop followed by a volatility-scaled trailing signal.The durable target and strongest reason remain monotone until completion. The separately persisted pricing basis comes from the exit priced on this tick: a session
limitrule where applicable, otherwise its current reason'sREASON_PRICE_RULE, defaultmarket. No newly proposed exit keeps the last basis across ticks and restart. The durable strength reason never supplies an order label or pricing rule.Any basis change passes the price-change gate regardless of tolerance. Existing replacement enablement, attempt/interval limits, freshness, session, ownership and refusal guards remain operative. A second basis change during cancellation places no second sell. After confirmed cancellation, replacement uses the latest basis and re-reads owned quantity minus the current target before applying the whole-share envelope. It handles both a confirmed partial fill (100 held minus 40 filled gives 60) and a strengthened target (staged 50 becomes the current 100-share residual).
outside_allowed_sessionnow has a session-scoped lifetime. Its named no-HTTP provenance survives the transport bridge. A validatedmarket_open is Truewindow with at least one second before close releases it, including legacy records marked definitive; next-session strategy exits and recovery do not require manual reconciliation. Other permanent or integrity-loss refusals retain their gates.The CC FULL read requested these P1/P2 changes; GPT full1 ACKed the parent with P3 follow-ups. The CC's subsequent pricing-basis ruling governs this fold. Both families now review the delta from the pinned parent.
SOTA sources
1b0a49d2792a9432a3aca3fcb617ce7a630d905e: quantity precision, native risk guard, and denial event contract. Installed native execution uses 2.0.0rc5; the mirror pin is a source citation, not a wheel-build claim.gen_close. Remaining carried citations are preserved indocs/decisions/2026-10-13-adaptive-paper-sell-chunks.md.Evidence-class table
Fold receipts:
evidence/artifacts/adaptive-paper-committed-exit-priority-20261015/fold1/.red-final-parent-replay.txtcomes from a detached checkout at exactly93f34f01, with only the final priority/recovery test modules overlaid. Earlier fail-first outputs, focused GREEN, full runtime results and the receipt are retained beside it. Paths and line-end whitespace are sanitized; assertion text and counts are retained. Fourteen pre-existing temporary-directory ResourceWarnings remain.The initial correction's receipts remain historical evidence: bare main passes the original exact TP-to-stop tolerance controls and independently fails its pending-cancel variant. This fold's RED baseline is the reviewed #1170 parent.
Local commands run
All native runs use CPython 3.12.3 / NautilusTrader 2.0.0rc5 / alpaca-py 0.44.0,
unshare -rn,nice -n 19, explicit source roots and private fixtures. Module groups and commands are retained infold1/runtime-tests.jsonand the handoff.Whitespace checks pass for the fold. The single trailing space in the historical
round2/red-tests.txtcapture remains byte-identical and is excluded only from the aggregate base-to-head whitespace check.Decision record and custody
docs/decisions/2026-10-15-shared-runner-committed-exit-priority.md#pricing-basis-and-session-rearm-foldrecords the current behavior, source pins, tests and adjudication. The older sell-chunk amendment now explicitly marks its permanent closed-session rule superseded.Review/ruling references are name-only:
MICRO-full-93f34f01.md,ruling-cc-20261015T1717Z-pr1170-pricing-basis.md, andGPT-VERDICT-93f34f010.md. No unpublished review/helper digest is bound. All historical receipts and main/parked evidence rows remain retained. Older replaced #1091 commits may remain reachable until GitHub garbage collection; a purge is an owner-only GitHub Support action, and none was performed.Follow-up disposition
round3/receipt.jsonat lines 11 and 14 remain a separate portability cleanup. New review references use names only.strategies_v1.py:219andrunner.py:780, remain separate cleanup. The continuity-decision locator allegation remains a false positive because it explicitly pins an immutable revision.Host evidence
No operating qualification, strategy merit or broker fill is claimed. No live paper unit, keyed/broker call, credential-store read, host runtime lock, live STOP or ISSUER-HOLD is used or changed.
Checklist