Repository navigation
Arm bounded overnight REST diagnostics with owned lifecycle and residual exits - #1081
Draft
seathatflowsinourveins wants to merge 11 commits into
Draft
seathatflowsinourveins wants to merge 11 commits into
seathatflowsinourveins wants to merge 11 commits into
Conversation
5 tasks done
seathatflowsinourveins
force-pushed
the
foundation/overnight-arming-20261013
branch
from
October 13, 2026 21:08
ea0a51a to
8f64d5a
Compare
seathatflowsinourveins
marked this pull request as ready for review
October 14, 2026 03:04
seathatflowsinourveins
force-pushed
the
foundation/overnight-arming-20261013
branch
from
October 14, 2026 04:32
09a1426 to
02e19f1
Compare
Use the supported BOATS REST path with fresh carrier, quote and lifecycle guards. Transient entry dispatch denials leave the node and other held positions alive; exit-residual refusal retains the node-stop handoff. Under the CC's 06:11Z P1-B ruling, held positions retain reduce-only PRE/RTH/POST exits after the 04:00 ET overnight boundary. PRE/POST use extended-hours LIMIT DAY; RTH uses LIMIT DAY without extended hours. Existing held-quantity guards also permit bounded explicit recovery. New entries remain refused outside OVERNIGHT. The opted-in REST quote path selects SIP for these residual exits. Keep the strict carrier freshness bound, refuse final transport readiness before journaling wire submission, and retain synthetic evidence separately from broker acceptance. Paper acceptance remains NOT_RUN.
…entory Derive the one missing exact repository grant through scripts/local_pages_policy_grants.py at f8d11a6. Preserve every existing grant and publish the inventory regression evidence: two assertion failures before the generated row, all 60 policy tests passing after it. Trading runtime and test code are unchanged.
Consume the actual Alpaca cancellation-rejection event, keep venue halts scoped to OVERNIGHT, adopt the companion scan trade-date/rule primitives, and dispatch bounded cancellation tasks outside owner ticks with joined shutdown. Preserve published history under CC correction 216. Exact 448 base: seven tests fail fifteen assertions with zero errors; native related 726 and CI-like 726 pass after correction, with eight mutation plans killed. Publish sanitized run preimages and exact historical public source inputs, plus a generic seven-character prefix regression without a blacklist.
Propagate failed cancellation outcomes as bounded TransportError so the owner releases its pending latch and retries without a rejection stream event. Keep confirmed terminal 404/422 responses and successful DELETE acknowledgements as data. The production transport/controller regression fails at ea0a51a and passes after correction; targeted native transport132 and CI-visible cancellation/publication/source13 checks pass. Preserve exact public execution-input preimages needed by the approved main integration.
seathatflowsinourveins
force-pushed
the
foundation/overnight-arming-20261013
branch
from
October 14, 2026 05:32
02e19f1 to
9d43e30
Compare
Collaborator
Author
|
Parked at 9d43e30 (2026-10-14 20:17Z). The co-op is recording the command center's ruling. The command center parked this PR under its bounded-rounds rule, after the review of fix round 8 returned a P1. The P1, by locator only: a publication-rule-19 occurrence at What happens now:
|
seathatflowsinourveins
marked this pull request as draft
October 14, 2026 20:17
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
Current PR head:
09a1426908b5dbb6ca0d8d4d621752bd82b131b2, tree41b044269c420ba1ab43a5985d9ce411bb8626f7, one normal forward child offddebeb9a79eed9e6dcb1cef19adff7c3b7ddd4dunder the CC's 2026-10-14 01:39Z last-attempt ruling, 01:49Z conditional-correlation acceptance and 02:12Z all-owned-side liveness ruling. Broker UUID/request-marker correlation and retained refusal dedupe protect newer acknowledgements; every held cancel has bounded autonomous REST reconciliation and at most one lookup-confirmed retry per bound. Recovery joins owned cancellation work and its final lookup.ONE final read wave: local review, Astra and the CC's Claude micro read this structural head. Any P1 in that wave, or no landing by 2026-10-14 06:30Z, parks #1081 and moves the cancel state machine to a design PR. Lane B stays on seq2 until a landed, armed head exists. Paper acceptance remains NOT_RUN. PR ready-for-review is set with FIX-PUSHED.
The prior task-only refusal correction was disproved by delayed/replayed refusal and is superseded by this structural correction. Known broker keys and consumed refusals survive local completion; missing, unchanged or ambiguous carriers stay held. HTTP acknowledgement followed by lookup failure also stays held. Native/worker and ownership controls are retained; further P2/P3 findings are Follow-ups.
Explicitly enable bounded BOATS REST overnight diagnostics with fresh quote and asset-carrier guards, client-side LIMIT exits, persisted carry deadlines and execution receipts. Entry refusals deny the order while other held positions keep running; owned reduce-only residual exits remain available in PRE/RTH/POST.
329985de1c8dccf0df7491373d0d9932eaa723d4; the mechanical rebase preserves all 103 non-listing path patches, compared with--unified=0stable patch IDs against the old baseba6afd8d71893fdf190c4b137330c98fca15cc75and local headd55c0484.lane:trading.The cross-family correction refreshes an exit's admitted market close at reservation and pending revalidation, including recovery on the same controller across 04:00. Entry carry/expiry timestamps and ledger cleanup budgets remain fixed. Adaptive exit cancellation/repricing first checks residual admission in every session. Successful asset reads deliver immediately even if the quote fails or returns 429; each symbol polls and reschedules independently.
Historical correction head before the mechanical main integration:
f8d11a6eb76d67bd929c87974b9c73c1517e5c66, one fast-forward commit on2658e7b8; tree3554b76e56f50cb2e45287aa8a821d1ff67b062e. The privacy-squash rewrite was withdrawn under correction216. The later CC approval authorizes replay of the six commits onto current main with the full published-head lease; it preserves their content and does not purge historical digests.Fixture output hashes now bind committed sanitized logs under
evidence/artifacts/overnight-arming-20261013/. Historical public source preimages are published separately. The new publication regression rejects any receipt digest without a preimage in the published set and verifies every historical hash-map value against public bytes. The existing anchored gitleaks content-digest exception covers exactly the two validated historical map paths; tests keep credential-shaped keys and other paths detected.Historical round-two verification and history scope
The controller consumes the real
order_cancel_rejectedtrade-update envelope and releases the retry latch for a still-live entry. Overnight venue halts apply during OVERNIGHT; standing trading halts continue to protect daytime residual exits. Shared mover scan primitives use the calendar trade date and midnight-aware rule order; full mover configuration and command timing remain in the companion change.Cancellation runs in tracked tasks with a five-second coroutine budget. This keeps cutoff and cleanup decisions moving while the broker request waits. Astra's real-SDK probe showed that the original timeout abandoned synchronous SDK workers; the original coroutine fixtures did not establish worker ownership through transport shutdown. The forward correction below retains and joins actual work; it establishes no broker latency guarantee.
blueprints/us-equities/adaptive-paper/overnight-review-round2-validation.json. Sanitized output hashes bind published bytes; six exact public historical source blobs preserve older execution-input hashes. Derived registry hashes have their own listing checks.Correction216 withdrew the proposed privacy rewrite. Historical SHAs remain viewable; no purge is claimed. The later approved mechanical main rebase preserves all non-listing patches. The historical round-two receipt binds parent448 and its own source snapshots; current integration and forward-correction results are recorded separately below. Both listing rows and the approved mover import union are validated on the integrated tree.
SOTA sources
cc4cb3b7ba50ae250e621983c2779047fb16bb28:alpaca/data/historical/stock.py:163-182,StockLatestQuoteRequest,TradingClient.get_asset,Asset.attributes. Its supported BOATS REST API is used; its stock stream still refuses BOATS.1b0a49d2792a9432a3aca3fcb617ce7a630d905e:python/nautilus_trader/live/clients.py:451-455queues denial;crates/live/src/python/node.rs:175-183stops the node;crates/risk/src/engine/mod.rs:727-771,2305-2328defines eligible reducing submissions;crates/model/src/python/orders/limit.rs:260-264exposesis_reduce_only.dbe38b1f6887434bbdd1a7d2df6ff8f1742a048a: XNYS session APIs used by existingsessions.session_atandovernight_bounds.scripts/host_receipts.py:sanitize, 2026-09-24 community sweep: effort-guard SessionStart notice, working plugin-install commands, dated dispositions #161 published-byte rule, and the line-anchored.gitleaks.tomlsource-map exception: adopted for sanitized public preimages and narrowly scoped historical-map validation.Evidence-class table
test_adaptive_paper_overnight_transition.py; exact parent red, fix greentest_adaptive_paper_overnight_guard_pins.py, native emitter plus CI-visible pins and mutantstest_overnight_published_preimages.py, repository digest/privacy and scanner testsLocal commands run
All runs completed in serialized idle scopes; native fixture runs held the canonical runtime read lock.
2658e7b8: 10 functional/publication tests, 18 assertion failures, zero errors. The required same-controller, recovery and halt cases fail before; their fixtures never repair the controller close.IntegratedRunner.test_native_adaptive_policy_reaches_ledger_and_flat_reconciliation; that case passed alone at the fix and exact9cb7c0d3. The failed run and isolated runs are separately published; no code changed for it.env -i, scratch USER-site hash-locked calendar dependencies, no Nautilus/alpaca.python3 scripts/validate.py: passed, 71 components, 11,935 hashed files, 240 receipts. Redacted gitleaks scan of the committed PR rangeba6afd8d..f8d11a6: exit 0, no leaks. The committed repository privacy/publication modules passed 18 tests with host-name guarding enabled. All 54 changed evidence bindings and 12 fix input hashes were recomputed and verified.Records:
overnight-arming-validation.json,overnight-guard-pins-validation.jsonandovernight-review-fix-validation.jsonunder adaptive-paper. Every output digest names committed sanitized bytes. Historical receipts retain their input scope through published historical source preimages.Decision record
docs/decisions/2026-10-13-overnight-rest-arming.mdrecords the supported REST adoption and the reproduced same-controller, lost-halt and private-preimage corrections.README-overnight.mddescribes the opt-in, independent polling, residual session checks and acceptance boundaries.The historical pre-push PASS records are
arming-prepush-claude-read-staged-e7d9ccb4.md,overnight-arming-prepush-claude-read-restaged-a9ad1d71.mdandovernight-arming-prepush-claude-read-rebased-9cb7c0d3.mdin coordination/trading-cc/reads. They authorized the original push. Their overall PASS verdicts were subsequently withdrawn byarming-1081-claude-correction-2658e7b8.mdafter the reproduced P1s; this draft awaits the new exact-head reads and gate.Host evidence
No host platform-status change or broker acceptance is contributed.
Checklist
No workflow change, credential publication, new paid service or real broker action.
Peer tests/worktrees and protected trading inputs preserved.
Original release pushed once; subsequent fixes use fast-forward commits, with no history rewrite or hook bypass.
Paper acceptance remains NOT_RUN.
Final exact-head trading-cc gate and both review families.
All hosted shards at the corrected head assessed before landing.
Round two: Alpaca's official streaming source at07f9c20b, installed alpaca-py0.44
TradeUpdate.event, and Python3.12asyncio.timeout; dates, current-doc HTTP403 and fixture limits are recorded in the decision.Receipt completion (CC05:01 ruling): current head
9d43e306e9bf8f43c758717a02898b408fcc30a7, treebac49c4661d459244c8d40f8c54329402499a73a, is rebased onto main67469fb6ba5476459d3d8dac9d11bc62dd1c1f4b. The only new completion commit publishes the four lost exact Git preimages plus the auto-merged source-policy and publication-test registration dependencies, and adds a new integrated validation record, SHA256b2f0713e417d39a647c0b06c6863bcdba22b808db458e4a59c24ce5f964cda6b. Existing sealed receipts retain their historical bindings and exact bytes. Trading source remains byte-identical to reviewed02e19f10. On the exact committed head before push: publication tests 4/4, ten native modules 474/474 (all 14 cancellation tests ran; zero skips), validator rc 0, merge-tree against the stated main rc 0. The failed namespace-only fixture calibration is retained separately and is not a passing result. Current head is frozen for CI, the co-op native receipt and the Astra/CC Opus completion wave; landing and broker acceptance remain pending.Follow-ups
hold_422_nonterminal_cancel(CC04:53 Follow-up). At reviewed09a14269:transport.py:1966-1967and:2140-2143; the immediate owner retry is atrunner.py:1135-1139and:1151-1167. A DELETE answered 422 followed by a nonterminal GET releases pending, so another DELETE/GET can run on the next tick (about 12 ms). The fake probe reproduces the same behavior atfddebeb9a; this is pre-existing and the CC adjudicated it P2, not a landing blocker. Named fix: hold a 422 whose follow-up GET is nonterminal and let the bounded reconciliation handle it. Fail-first regression: assert bounded DELETE and GET counts across repeated ticks and the reconciliation interval, including pending_cancel/accepted and terminal release; extend the existingtest_adaptive_paper_transport.py:779-787raise-only case rather than accepting only its exception assertion. Owner/trigger: ns-seeds' own small PR after the quiet box lifts. No code change or new head in this read wave.transport.py:2111: a stop or terminal stream event during the budget wait can still allow one idempotent DELETE after the last stopping check (F1). Trigger: cancellation lifecycle design work; check stop/terminal admission at the actual DELETE sink and test the post-budget race.cancel()may return a joined reconciliation's lookup result, None after a 404, or a prior result without sending DELETE; the adapter may neither observe nor fail, while the runner logsovernight_entry_cancel. Trigger: cancellation interface/lifecycle design work; distinguish a sent cancel, a joined lookup and no new wire action, and test adapter observation plus truthful controller logging.transport.py:2078and:2055-2056: retry_authorized is temporarily resolved before its completion callback, and stopping can discard pending for a broker-live order (F8a/F8b). A fresh recovery port prevents the exposure path in the reviewed cases. Trigger: lifecycle design work; define and test the logical pending invariant through authorized retry, completion and shutdown handover.transport.py:2139:confirmed()can bind from the cached stream view when the REST row is stale. Trigger: cancellation-correlation design work; test stale REST/newer stream provenance and keep broker-key confirmation attribution explicit.held_unattributed_refusalsincludes refusals attributed later and excludes refusals removed by stale filtering (F11);lookup_confirmed_retriesincrements when the wire starts. Trigger: counter-validation follow-up; document ingestion/attribution/stale-drop/wire-start meanings and assert all four paths, extending the existing counter item below.transport.py:2247-2252swallows caller cancellation without re-raising; the:2241comment that it cancels only the caller's wait does not describe that behavior (F9a). A caller from_tasksor_cancel_operationsawaitingport.stop()could hang (F9b; the base also fails, and no such caller exists at the reviewed head). Trigger: lifecycle design work; reconcile the public stop contract/comment with owned teardown and explicitly test cancellation and prohibited/self-join callers._tasksuntil stop; the monitor arms for every held owned cancel, including RTH transport use. The reviewer did not read the CC02:12 all-owned-side liveness ruling. Trigger: lifecycle design work; reap completed tracked retry tasks and retain an explicit scope/policy record with RTH BUY/SELL/recovery coverage. Do not present the synthetic regressions as measured broker acceptance.These eight trading-cc dispositions follow its PASS/no-P1 read of
09a14269, sealed recordcoordination/trading-cc/reads/nas1081-claude-read-09a14269.md, SHA256b9843d494bbd742a533a4d41b82183c798cde678a05acd3096762f15f7f7e632. The review's probe limitations remain: copied controller logic/plain-task recovery stand-ins are separately attributed, and actual broker marker/event/cancellation behavior is unmeasured. The CC04:53 ruling leaves02e19f10under read; these are body-only dispositions.09a14269tree:runner.py:1147,transport.py:1853andtransport.py:1687. A background cancel lookup reaches the controller before the native execution observer. Trigger: cancellation lifecycle design work; deliver idempotent terminal REST observations to the native order-state path while preserving execution/fill deduplication, with a delayed-trade_updatesregression. This remains an open follow-up under the CC's severity ruling.09a14269locations:transport.py:1325(constructor),:1718(quote age),runner.py:2671(preflight), plus both listing files. Trigger/disposition: the landing rebase onto59899aafprepared02e19f10with four preserve-both code hunks; main's readiness reservation and benchmark maximum remain alongside overnight recovery feed, kwargs and BOATS minimum age. Both registries were regenerated without dropping main rows; cancellation tests 14/14, readiness tests 18/18, no skips, validator rc 0. The new resolution wave must verify this integration before landing. Per-hunk record:pr1081-landing-resolution-59899aaf.md, SHA2560dbd0989239ce86cacca8675db454ef0bf3c7279a1f8116c11a41688eec9e997.tests/test_catalog_freshness_propose.py:830,catalogs/foundation/model-currency.json:127,scripts/validate.py:248. The historical failure repeats and is not classified as flaky. Trigger/disposition: carry main's reviewed Restore model-currency validation with sourced Fable and Astra landscape checks #1101 correction (04926b5d) through landing and rerun current validation. This correction is present in02e19f10's main base;python3 scripts/validate.pyreturned rc 0 on that exact prepared tree. Historical sealed passes alone do not qualify a later head.docs/decisions/2026-10-13-overnight-rest-arming.md:335and:342,overnight-cancel-identity-validation.json#/sources, and the body's cancellation citations. Websocket/Orders page locators and the older owner-free handoff, vendor/24-5, halt-policy, UTP and historical-review references lack the corresponding captured bytes in the supplied read packet. Trigger: source-publication follow-up; add sanitized primary captures or pinned blobs with matching hashes and locators. Keep dependent claims unverified until captured; the absence of a capture does not establish that a vendor claim is false.docs/decisions/2026-10-13-overnight-rest-arming.md:229citespython/cpython@f6650f9ad73359051f3e558c2431a109bc016664:Lib/concurrent/futures/thread.py:219-241; the pinned file has 239 lines and 219-238 supports the claim. Trigger: citation-maintenance follow-up; change the endpoint to 238. No test-enforced locator failure was reproduced; this body-only disposition changes no source at the read head.transport.py:2294raises on a live stream thread before subsequent HTTP-session closes; this existing stream-leak branch is distinct from the tested cancellation-worker join. Also retain qualifications on historical/pinned references and current maintenance comments such astests/test_adaptive_paper_metrics.py:149. Trigger: lifecycle design work; make exceptional cleanup ownership explicit and test it. Update current-code locators when they move while retaining historical pins. Successful cancel regressions do not establish universal cleanup success.Rebase note: the CC authorized one leased landing rebase from
09a14269to the prepared02e19f10on59899aaf. The four code resolutions preserve #1097's request reservations/readiness and the overnight behavior together; the new head requires its own resolution wave. Astra fix5 is a final unconditional ACK of09a14269, not a broker-acceptance, arming or landing authorization. Its sealed verdict SHA256 is15ef329785a56d15b1c7c9dbb8a900d6229b947cc3449ece1a401116175022e7.blueprints/us-equities/adaptive-paper/transport.py:954-959, compared with:969-973.held_unattributed_refusalscounts a refusal at ingestion that can be attributed later; no current test asserts counters on that later-attribution path. Trigger: the cancellation-state design PR or the next counter-validation change; distinguish permanently unattributed refusals from temporarily unresolved attribution and add that counter assertion.blueprints/us-equities/adaptive-paper/runner.py:1135-1139. An explicit4xx DELETE refusal releases the latch and the runner can re-cancel on every tick. Trigger: the cancellation-state retry design or the first observed venue refusal; back off according to the venue's wait, following the bounded transient policy in#1091, and retain a test that forbids per-tick retries during that wait.first_stage_cancel_carrier). At the first owning-lane paper stage, measure whethercancel_requested_atis populated and advances per DELETE, and exactly what a lateorder_cancel_rejectedobservation carries. Retain sanitized request/response/event observations and counter values. This check is still unmeasured against the broker; nullable example fields and synthetic fixtures do not establish venue behavior.safety.pybound and update the old locator.recovery.py:168locators with the current literal's line.thread.py:219-241to219-238. The supported shutdown implementation and joining behavior are unchanged. Hostname hygiene is removed as a finding under the owner's22:25Z ruling.completed_no_signalsin1/3 isolated runs at exact8f64 and1/3 at the worker-fix tree, with no adapter errors; its MoverSimulatedPort does not execute the changed SDK transport. Retain both failing measurements and the full native failed run alongside the repeat.The separate mover-awareness change and readiness must land before overnight-diag-1. No strategy claim, live operation or model order authority is introduced.
HTTP422 cancellation blocker and main integration
A refused DELETE followed by a still-live broker lookup raises
TransportError("cancellation_unresolved"); unknown identity and missing finality also raise their explicit transport failures. Those completed failure outcomes release the pending mark for a retry. The previous5b34905 callback incorrectly released it after HTTP204 plus a live lookup; that preservation claim is superseded by this correction. HTTP204 plusaccepted,neworpending_cancelnow retains all pending marks until a terminal stream/later lookup, while terminal HTTP404/422 observations remain resolved data.The production-path synthetic-I/O regression is
OvernightCancelRefusal.test_422_live_lookup_releases_latch_retries_and_stops_entry_at_cutoff. It fails at the exact publishedea0a51a6baseline (one assertion failure, zero errors), then passes with the blocker fix. The pre-rebase native test plus transport module passed 132 tests. Its receipt and public historical input snapshots retain their original pre-rebase bindings; post-rebase checks below validate the integrated tree separately.Rebase note: the only manual code conflict was the adjacent import block in
mover.py. The approved union preserves main'srisk_ceiling_kwargsimport and this PR'sSessionKind/session_atimports. No function body was manually merged. All 103 non-listing per-path stable patch IDs are equal, including mover.py. Both listings were regenerated from main plus the original PR rows, followed byscripts/evidence_manifest.py --write; all main and PR keys, evidence rows and receipt IDs are retained.Post-rebase checks: full
scripts/validate.pyrc0 (71 components, 12001 hashed files, 240 receipts); CI-like related suite 778 tests OK with 220 native-only skips; hook/blind-checkout runner 45 tests OK with no skips; publication/source-map modules 12 tests OK; pinned mover import from its source directory OK. The committed six-prefix audit resolves all six private inputs and finds zero matching locations; all 36 published sanitized excerpts have public preimages. Gitleaks scans the six rebased commits with rc0 and zero leaks. All jobs run in idle CPU class; all broker I/O is synthetic.The post-rebase native related suite passes all 778 tests with no skips in 223.212s under
runtime_read_lock(). Its two mover modules pass all 107 tests; the CI-like mover modules pass 76 tests and skip 31 requiring the pinned native runtime. The CI-like complete related run takes 77.085s. The four hook tests plus the complete blind-checkout module pass 45 tests in 83.968s.git merge-tree --write-tree 329985de HEADexits 0 and yields this exact tree.Forward P1 exception: actual SDK cancellation ownership
Under the CC's21:13Z approval, one normal forward correction on published8f64 retains a shielded per-order transport operation and its actual concurrent SDK future. The five-second owner timeout releases only its wait. Retries await the same operation; a late completion forwards its final observation. Shutdown cancels operations waiting for the operation lock and not-started futures, joins started calls and reconciliation, and joins the supported
ThreadPoolExecutorbefore closing the SDK HTTP session. The copied context retains the existing per-order budget identity. The SDK implementation is unchanged.Pinned CPython3.12.3
Future.cancel()explicitly refuses to cancel running work (python/cpython@f6650f9a,Lib/concurrent/futures/_base.py:364-372), and its supported executor shutdown cancels queued work and joins worker threads (Lib/concurrent/futures/thread.py:219-241). The installed alpaca-py0.44.0 cancellation remainsalpacahq/alpaca-py@cc4cb3b7,alpaca/trading/client.py:217.The final real-SDK module
tests.test_adaptive_paper_cancel_worker_ownershipcovers actual5s HTTP timeout, blocked budget, late completion, queued shutdown, and halt-clear/order-timeout retry after a real422/live lookup. Five cases fail four assertions with zero errors/skips against exact8f64 production modules, including the money-path assertion of zero strategy retries before flatten; all five pass at this head in9.822s. Four CI-visible production-method controls fail four assertions at the base and pass at the head. They cover both adaptive/mover mirrors and preservation of unrelated engine-cancel marks. Five removed guards fail7 assertions total with zero errors: shielding, queued-work cancellation, controller live ownership, adaptive mark release, mover mark release.Controller pending state remains set through a running SDK operation and, following its HTTP204 acknowledgement, through a nonterminal broker snapshot. Confirmed terminal state or definitive refusal/failure releases it; the next strategy pass clears only its mirrored background mark. Finishing a successful DELETE await alone does not authorize another DELETE. The historical q9 probe reports zero engine cancels before flatten at exact8f64 in both failure modes, and one at5b34905 in both. Its strategy is a protocol owner, not a running rc5 node; the separate worker tests exercise the installed SDK/transport against synthetic HTTP.
Final CI-like related suite:787 tests OK,225 native-only skips,111.087s. Final native suite:787 tests, one inherited achieved-leverage fixture failure, zero errors/skips,260.185s; it is rc1, not a passing full-native claim. The identical zero-exposure assertion reproduces1/3 at exact8f64 production and0/3 at this head in paired isolated runs. All nine cancellation regressions pass. Earlier worker-only782 failures and their exact inputs are preserved separately and do not stand in for combined-source validation.
New receipt:
blueprints/us-equities/adaptive-paper/overnight-cancel-worker-validation.json; preserved prior-stage receipt:evidence/artifacts/overnight-arming-20261013/review-cancel-worker/worker-only/validation.json. The seven-receipt/source-map shard passes12 tests. Final full validator rc0:71 components,12051 hashed files,240 receipts. Four hook tests plus complete blind-checkout:45 PASS/no skips,149.477s. All62 published sanitized excerpts have public preimages; six private-prefix inputs resolve with zero tree matches. The original422 regression waits for its tracked cancellation task before checking the failure latch, preserving its assertion and production-path behavior. No broker or actual credential is used, and no SDK is replaced or forked.Narrow acknowledgement correction
Runtime delta: one completion callback,7 lines added/3 removed. The new test
CancelAcknowledgement.test_three_ticks_keep_acknowledged_live_cancel_pending_until_terminalexecutes the reviewer's three-tick scenario using the real pinned SDK, GuardedSession, Controller, ledger and request budget. It coversaccepted,new,pending_cancel, with terminal stream and later-lookup controls for each. At exact5b34905 all six subcases fail[1,2,3]versus[1,1,1]DELETEs, with zero errors. At this head all six send one DELETE, reserve one cancellation budget slot and hold controller/adaptive/mover marks through all three ticks; terminal confirmation releases them without another DELETE. Removing the guard fails the same six assertions.Alpaca's primary Orders page L1560 states that canceled orders receive no further updates; L1563 defines pending_cancel as “The order is waiting to be canceled.” The pinned OrderStatus enum distinguishes these statuses; installed enum bytes match that mirror.
Focused native integration218/218 PASS/no skips,39.807s; CI-like218 OK/93 native-only skips,50.834s, covering transport, recovery, prior worker/shutdown/422/strand tests and the new regression. Eight-receipt/source-map12 PASS; full validator rc0 (71 components,12063 files,240 receipts); hook/blind-checkout45 PASS/no skips,88.755s. All67 sanitized excerpts have public preimages and exact prior5b source snapshots preserve earlier receipt bindings. New receipt:
blueprints/us-equities/adaptive-paper/overnight-cancel-ack-validation.json. This focused run is not represented as a new full adaptive-paper suite or live-broker acceptance.Historical refusal-provenance correction (superseded)
Historical runtime delta at fddebeb: transport10 lines added/1 removed. Current-task attribution was disproved by Astra's delayed/replayed refusal probe; it allowed an older refusal to release the retry's acknowledgement. The source and validation below retain that stage's measured results, and the structural cancellation correction supersedes its preservation claim.
CancelAcknowledgement.test_rejection_during_lookup_releases_pending_and_allows_one_retrydelivers the rejection on the actual owner loop while the pinned SDK getter/follow-up lookup is live. Six accepted/new/pending_cancel × terminal-route subcases fail at exact35df (DELETE counts1/1/1, marks stuck), then pass with exactly one retry (counts1/2/2, marks released after refusal and retained on the retry's acknowledgement). The original no-refusal test stays1/1/1. Both tests pass7.321s; removing refusal consumption fails the same six assertions with zero errors. Native focused219/219 PASS/no skips32.251s; CI-like219 OK/94 native-only skips29.747s.Primary Orders page L1564 documents that pending_replace “will reject cancel request while in this state.” At alpaca-pycc4cb3b7,
alpaca/trading/enums.py:321-333defines TradeEvent names, whilealpaca/trading/models.py:640acceptsUnion[TradeEvent, str];alpaca/trading/stream.py:115-139dispatches/casts trade updates. That pin has no order_cancel_rejected enum member; the string-compatible path carries the event. These primary sources were read first-hand.Nine-receipt/source-map12 PASS; historical sealed full validator rc0:71 components/12075 files/240 receipts; hook/blind-checkout45 PASS/no skips93.007s. All72 sanitized log excerpts resolve to public preimages; exact35df transport/doc/publication/ack-test snapshots preserve earlier input hashes. Receipt:
blueprints/us-equities/adaptive-paper/overnight-cancel-provenance-validation.json. These checks predate midnight's model-currency freshness incident and do not establish current readiness.Structural cancellation correction: final attempt
The CC's 2026-10-14 01:39Z ruling and 01:49Z conditional-correlation acceptance authorize one structural forward commit on fddebeb. A copied ContextVar binds each local attempt to its exact SDK DELETE at the HTTP seam after its budget wait. HTTP acknowledgements and definitive refusals stay with that identity. A 204 followed by a failed lookup keeps holding; the failure cannot authorize another DELETE.
Stream refusal correlation is conditional on a broker key:
(order UUID, cancel_requested_at), confirmed by that operation's follow-up response and strictly advanced from its pre-operation broker marker. A prior operation with unknown identity makes later markers ambiguous. Keys and refusal observations remain deduplicated after local completion.updated_at, local receive time and the current task never infer a missing request identity. An older or unattributed refusal cannot release a newer acknowledgement, including after its task has completed. The transport latch covers direct adapter callers too.The primary Websocket Streaming page, read first-hand, documents
pending_cancelat L158 andorder_cancel_rejectedat L163; L178 includes only a nullablecancel_requested_atexample field and documents no per-DELETE id. The pinned alpaca-py Order model does not declare it; selectedraw_data=Truepreserves raw broker carriers when present. The Orders page L1560, L1563 and L1564 supplies the terminal/pending/refusal definitions. No upstream guarantee of universal request correlation is claimed.A transport-owned monitor gives every held cancellation an independent REST lookup on a fixed five-second bound without requiring owner ticks. The CC's 02:12Z ruling includes held SELL and recovery cancellations. Terminal results release it;
pending_cancelretains it; another nonterminal result authorizes exactly one lookup-confirmed DELETE per bound through the ordinary SDK/budget/operation registry. Run-end stream-health and recovery receipt fields exposeheld_unattributed_refusalsandlookup_confirmed_retries, including nonzero values. Recovery joins the supported in-flight SDK budget wait, final lookup and teardown; its unrelated ten-second stop timer is removed. Caller cancellation cannot release the account while the transport still owns a worker.Five core regression tests fail at exact fddebeb: replay/delayed refusal, acknowledgement plus failed lookup, hold reconciliation, cutoff flatten, and recovery timeout (15 assertion failures, zero errors). The two explicit SELL/recovery cases add two baseline assertion failures and zero errors. Both relocated Astra modes fail six assertions at that baseline. Replay now sends1/1/1 DELETEs; delayed mode sends1/2/2 in total (the initial refused A plus exactly one acknowledged B, no C). The permanent test additionally covers identified/missing keys and delivery during lookup/after completion. The earlier no-refusal and correlated-refusal controls remain green; the latter now supplies the documented broker marker. Removing correlation fails three assertions, removing recovery ownership joins fails one, and removing the autonomous monitor fails both SELL/recovery cases; each control has zero errors.
The held-at-cutoff BUY test drives actual pinned SDK cancellation, Controller and durable accounting, then the production deterministic recovery exit loop with the repository's synthetic fill/position oracle. Two additional SELL/recovery tests use the actual constructor, SDK DELETE/GET/POST, GuardedSession, Controller, ledger, recovery and reconciliation with synthetic HTTP. Held SELL cancellation permits no second DELETE inside the bound, retries once after a live lookup and reaches flat with one owned reduce-only SELL; held recovery cancellation releases on a terminal lookup and reaches flat with just one DELETE. Recovery reports its nonzero held counter. These paths are not measured against the broker, and these specific probes do not run rc5 nodes. The ownership test crosses the actual10.2-second boundary with the SDK worker still waiting for its supported budget callback and verifies pending ownership, final lookup and close ordering. All new session clocks are fixed; real elapsed time is used only for async waits/watchdogs. The new receipt is
blueprints/us-equities/adaptive-paper/overnight-cancel-identity-validation.json; exact prior fddeb input snapshots preserve historical evidence bindings.The first broad all-side native run found one test-fixture deadline failure: the0.5s confirmation wait expired before the virtual5s advancement under load. A controlled0.7s fixture delay reproduces
cancellation_not_confirmedwith recovery already stopped; increasing only fixture budgets passes. Confirmation now6s, cleanup20s and watchdog10s; no runtime change was made for that calibration. The failed diagnostic remains published and is not final-tree acceptance.Validation and the exact published head are recorded at FIX-PUSHED after sealing. This head gets ONE local/Astra/Claude read wave. Any P1 in that wave, or no landing by 2026-10-14 06:30Z, parks #1081 and moves the cancel state machine to a design PR. Lane B remains on seq2 until a landed, armed head exists. The PR is marked ready with the push; the separate mover child stays held until landing.
Additional Follow-up: REST-terminal background cancellations reach the controller sink before
trade_updatesreaches the native client. Trigger: the owning cancel-state design work or a measured delayed-stream terminal observation. Source captures, lifecycle notes and the CPython citation correction remain the existing Follow-ups. Hostname hygiene is no longer a finding under the owner's 22:25Z ruling. No actual credentials, broker operation, arming or paper acceptance run.Final sealed validation at09a14269: native1600/1600 PASS/no skips489.360s; CI-like1600 OK/455 native-only skips459.914s. Structural14/14 native PASS53.689s; focused226 native PASS88.771s/no skips; focused CI226 OK/101 native-only skips78.855s. Three repeated SELL/recovery pairs6/6 PASS30.169s. Ten-receipt/source-map12 PASS0.551s. Four hook tests plus complete blind-checkout45 PASS/no skips124.884s. All96 sanitized log excerpts resolve to public preimages. Six private-prefix inputs resolve; zero tree/body matches. No historical receipt input hashes were rebound.
scripts/validate.pyon this unre-based head is rc1, solely for inheritedclaude-fable-5-1release freshness; no publication/hash integrity errors remain. #1101 fixes that row on main, and the CC explicitly reserves rebase for the landing cue. This is not a current validator PASS or landing-ready claim. At that cue, preserve every non-registry path patch-id from this read head, regenerate both registries with all current-main rows retained and byte hashes verified, and record merge-tree rc0 before pushing the rebase. The strict source-hash lander then requires the CC's one micro read wave on the rebased head, as ruled02:35Z.