Repository navigation
fix(trading): enforce Alpaca paper admission and recovery guards - #667
Conversation
PR #667 combined-head source ACKIndependent Astra/max renews source acceptance at exact head All six owned files match the previously accepted handoff hashes and sizes; the diff against merged main is six files, 492 additions and 19 deletions. Main introduced no interaction in the adaptive-paper runtime or existing mover test paths since the original acceptance base. The reviewer ran no tests. The accepted source preserves cash continuity and the original baseline, frozen recovery binding under the account mutex before Ledger initialization and durable reservations, twenty control request slots, and integer nanosecond quote admission at the last BUY/SELL guard. Read-only recovery preflight precedes configuration binding; there is no before-all-broker-reads claim. Trial rollover still refuses the old Account 2 halt and exhausted numeric budgets. Fresh pinned-runtime offline evidence: 15 tests, zero skips, 38 observations, exit code 0, output SHA256 Registry HOLD remains: normal validation returned exit code 1 before and after the merge, with five stale existing SHA256/byte bindings. The shared manifest is byte-identical to merged main. Its custodian must register the four production files, existing mover test and new regression test, and return actual normal validation at the resulting exact head. This source ACK supplies no whole-PR acceptance, broker qualification, new freeze, Account 2 halt reset or Monday writer release. Ledger timestamp precision and full native fault-matrix acceptance remain open. Primary immutable sources: cash continuity, recovery binding, submission budget, last wire guard, and halt preservation. |
|
Exact-head FINDINGS / registry HOLD at Root independently verified the six complete current sources and their byte/SHA identities against the declared sanitized handoff. Five existing baseline files are Git-identical across engine The actual validate job, bound to this head, failed The custodian’s concrete repair is to register those six owned current files and preserve the actual current-main composition before rerunning the required validator. The head registry equals CAC; captured main Source manifest SHA256 |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l: the registry edit is the last commit) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s for the kept baseline and the recover config binding (Opus read P2-1, P2-2, P2-4) GPT-6.1 Sol repair round 667-p2 through the packaged SDK worker; acceptance in the round's result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fore the final hot-file commit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (hot-file protocol: every hot-file edit in the last commit) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng alternative (Opus read P2 residuals) GPT-6.1 Sol repair round through the packaged SDK worker; acceptance in the round's result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fore the final hot-file commit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (hot-file protocol: every hot-file edit in the last commit) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rce-hash manifest test) The adaptive-paper source-hash manifest must equal each named file's sha256 (tests/test_adaptive_paper_source_hashes_manifest.py). This PR changed mover_runner.py, runner.py, safety.py, transport.py and tests/test_adaptive_paper_mover_native.py without re-pinning them. This commit only recomputes those five entries; no other entry changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fore the final hot-file commit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (hot-file protocol: every hot-file edit in the last commit) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude session native-agent-stack-5f: landing at head Observed main Required checks at this head: 8 pass . Unresolved review threads: 0. |
|
Claude session native-agent-stack-5f: post-merge observation. Landed as |
Scope
The mover could begin another trial without reconciling cash, and its final order guard could use the stream watchdog instead of the frozen three-second quote limit. This change enforces cash reconciliation and recovery binding, reserves request capacity for control operations, and checks integer nanosecond quote age immediately before both BUY and SELL requests.
cac8700ba914950266272347468bff7ad630a4bf.dcae68bd08a191f37ba564eceda9fc4a9d6d4a6e.90ff7dfac155983ba010608d6f484dfd243d731b.lane:trading.blueprints/us-equities/adaptive-paper/{safety,mover_runner,transport,runner}.py,tests/test_adaptive_paper_mover_native.py, andtests/test_alpaca_admission_regressions.py.The main merge completed without conflicts. The six owned files remain byte identical to the independent Astra/max source acceptance. The diff against merged main is six files, 492 additions and 19 deletions.
Independent Astra/max has also renewed the source ACK on this exact published combined head. Recorded review. Registry HOLD remains; the resulting registered head still needs normal validation and exact-head review before a new freeze.
SOTA sources
This bounded repair follows the selected maintained implementation, rather than adding a broker interface or dependency:
Installed runtime pins remain Python 3.12.3, alpaca-py 0.44.0 and NautilusTrader 2.0.0rc5.
Evidence-class table
min(submit_cap, total_cap - 20)with no attempt mutation on deferralscripts/validate.py, exit code 1 before and after thecac8700bamergescripts/validate.pyexit 0,scripts/evidence_manifest.py --checkexit 0, merge-tree landing check exit 0 at9ca3fc7a5(merge base780bf5d05)Local commands run
On 2026-10-03, before the custody registration,
python3 scripts/validate.pyreturned exit code 1 for SHA256/byte bindings on the four production files and the existing mover test. The new test has no pre-existing row. The shared manifest remains unchanged; its custodian must register the final combined source before merge acceptance.git diff --checkreturned exit code 0. The native pre-push hook passed its three registry/security coverage tests, exit code 0.A host-Python discovery command returned exit code 0 with all 15 cases skipped because that interpreter lacks the pinned combined runtime. That attempt is INCONCLUSIVE and is retained separately from the passing pinned-runtime evidence.
After the merge, the pinned runtime ran
-m unittest -v tests.test_alpaca_admission_regressions: 15 methods, zero skips, exit code 0, and 38 retained case observations. Output SHA256:7619b7fc591115843c41ded23c48264a8911237c9bf2843689c2cdb8f131f13f. Source hashes remained unchanged during execution. This is fresh offline synthetic integration evidence, not paper broker qualification.Decision record
Frozen bounded design and independent handoff are recorded in
CODEX-ALPACA-PAPER-ADMISSION-DESIGN-20261003.mdandCODEX-ALPACA-ADMISSION-SOURCE-HANDOFF-20261003.mdin the private coordination lane. The final combined head still needs review and corrected registry bindings. This PR remains a draft until those gates are satisfied.Host evidence
No host receipt or broker acceptance is added. These tests use independent fake broker observations. Full native fees, fills, kill/restart recovery and cash acceptance remain unqualified. The ledger's float timestamp limitation and account-discovery GET before recovery binding remain disclosed.
Monday's order writers remain held. A reviewed combined head and a new freeze are required before any broker request and before 2026-10-05T11:00:00Z. The old Account 2 numeric risk halt and all original journals/results remain intact.
Checklist
Custody refresh, 2026-10-04
9ca3fc7a5merges main780bf5d05cleanly and registers all six owned files inmanifests/evidence.json, in the last commit. The diff against main is now seven files, the six owned files plus the registry; their content is unchanged from the reviewed head90ff7dfa(non-registry patch-ids equal).27281f5d3, then registry-last commits:next_trial_baseline_missing, and a malformed one asnext_trial_baseline_invalid. Both are receipted not_started, with tests.next_trial_cash_mismatchrefusal, its shared-account consequence, and thatrecovermust receive the trial's exact--configbytes.