Skip to content

fix(trading): make paper qualification proofs optional and mark receipts - #989

Merged
seathatflowsinourveins merged 1 commit into
mainfrom
foundation/paper-exploratory-20261010
Oct 11, 2026
Merged

seathatflowsinourveins merged 1 commit into
mainfrom
foundation/paper-exploratory-20261010

Conversation

@seathatflowsinourveins

@seathatflowsinourveins seathatflowsinourveins commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Scope

  • What this PR changes, in one or two sentences: runner.py paper starts without archived qualification proofs, and supplying either proof still requests the complete promotion check. The paper receipt's preflight block records promotion_gate (validated or not_supplied), as the mover runner's receipt does.
  • Base commit: 03a986ed637349403658f23da694c1833527819d. The branch is one commit on it.
  • Lane: lane:trading.
  • Owned paths touched:
    • blueprints/us-equities/adaptive-paper/runner.py, README-paper-exploration.md and source-hashes.json;
    • tests/test_adaptive_paper_runner.py;
    • blueprints/us-equities/data/README.md, whose stale mandatory-gate text this corrects;
    • the matching manifests/evidence.json registrations.

SOTA sources

  • native-agent-stack mover_runner.py:703-704 at the base above. Line 703 is the optional proof-pair selection adopted here, and line 704 is the promotion_gate receipt marker adopted here. The mover's recover command (command_recover, mover_runner.py:885) sets no marker, and neither does this runner's recover.
  • runner.py:661 and runner.py:2310 at the base: qualification dispatch, and the prior unconditional CLI selection. The account, margin, session, inventory and reconciliation checks stay in their established paths.
  • Registration follows the docs/lanes.md hot-file protocol (scripts/host_receipts.py register_file). source-hashes.json was recomputed from the current bytes of the files it lists, after a byte-identical serialization round trip.

Evidence-class table

Claim Evidence class Command / receipt
Paper without proofs reaches post-gate execution, and its preflight summary records promotion_gate: not_supplied local_integration (fixture credentials, hermetic broker observation) MainCommandGateWiring; its marker assertions failed first, see below
A blocked account without proofs still refuses with account_not_ready, and its written receipt records not_supplied local_integration same
A valid complete proof pair passes and records validated; either proof alone and invalid complete proofs refuse local_integration same
recover adds no marker; preflight is unchanged local_integration same
Registered hashes match the head bytes local_integration source-hash manifest tests, evidence_manifest.py --check, validate.py
Measured broker-paper acceptance is NOT_RUN source_review No account was selected and no broker runtime was started

Local commands run

The engine environment was built with the README-native.md install command, uv pip sync --python "$ENGINE_PYTHON" --require-hashes blueprints/us-equities/adaptive-paper/requirements-linux-x86_64-py312.lock. It has Python 3.12.4, exchange-calendars 4.13.2 and nautilus_trader 2.0.0rc5.

$ "$ENGINE_PYTHON" -B -m unittest tests.test_adaptive_paper_runner.MainCommandGateWiring   # new tests, previous head's runner.py (blob 4951f603)
exit 1: Ran 10 tests, FAILED (failures=3): None != 'not_supplied' (both no-proof tests), None != 'validated' (valid-proof test)
$ "$ENGINE_PYTHON" -B -m unittest tests.test_adaptive_paper_runner.MainCommandGateWiring   # with this change
exit 0: Ran 10 tests, OK
$ "$ENGINE_PYTHON" -B -m unittest tests.test_adaptive_paper_runner
exit 0: Ran 187 tests, OK
$ "$ENGINE_PYTHON" -B -m unittest tests.test_adaptive_paper_credential_source tests.test_adaptive_paper_fees tests.test_alpaca_admission_regressions tests.test_adaptive_paper_mover tests.test_adaptive_paper_mover_native
exit 0: Ran 219 tests, OK   # the other modules that drive runner.main()
$ python3 -B -m unittest tests.test_adaptive_paper_source_hashes_manifest tests.test_trading_gates_bindings
exit 0: Ran 20 tests, OK
$ python3 scripts/evidence_manifest.py --check
exit 0: {"files": 11423, "status": "passed"}
$ python3 scripts/validate.py
exit 0: {"components": 70, "hashed_files": 11423, "profiles": 4, "receipts": 239, "status": "passed"}
$ gitleaks git --log-opts="03a986ed637349403658f23da694c1833527819d..HEAD"   # merge-base with origin/main
exit 0: 1 commits scanned, no leaks found
$ python3 scripts/validate.py --scan-history 03a986ed637349403658f23da694c1833527819d HEAD
exit 0: {"matching_locations": 0, "status": "passed"}

Decision record

blueprints/us-equities/adaptive-paper/README-paper-exploration.md records the exploration direction, the pinned mechanism and the test evidence. It states preset and leverage-rung coverage as the direction, not current behavior. The existing config-hash continuity check still refuses same-account preset or rung rotation. No runner or configuration alias for the exploratory paper runs has been verified, and the inspected T22 snapshot supplies no production paper dispatcher.

Alternative considered: setting the marker on every paper/recover path. That would stamp not_supplied on recover receipts for trials that a validated paper run admitted. It was rejected because the mover's recover sets no marker. If recover receipts later need to restate the admitting run's qualification, that would be a change to carry the original marker forward, not to recompute it.

Host evidence

No host-evidence files or platform statuses change.

Checklist

  • New/changed GitHub Actions are pinned to a full commit SHA with a
    version comment (no floating tags). No workflow or action changes.
  • New/changed workflows declare top-level permissions: {} and grant each job
    only what it needs (contents: read, or an explicitly justified addition). No workflow changes.
  • No secrets are printed, logged or committed; no new required secret was
    added without a documented owner.
  • No new paid hosting, subscription or billing surface was introduced.
  • Peer-owned untracked files and worktrees were preserved (not deleted,
    moved or overwritten).

🤖 Generated with Claude Code

@seathatflowsinourveins seathatflowsinourveins added the lane:trading Trading lane: sim, paper and live north star label Oct 10, 2026
`runner.py paper` now starts without `--gate-result` and `--snapshot`.
Supplying either argument still requests the complete promotion check, so
both must then be supplied and pass. This adopts the mover runner's
optional-proof selection and its receipt marker (mover_runner.py:703-704 at
03a986e): the paper receipt's preflight block records `promotion_gate` as
"validated" or "not_supplied", so a receipt without proofs never reads like a
qualified one. `recover` adds no marker, because the paper receipt that
admitted the trial carries it, and `preflight` is unchanged.

MainCommandGateWiring drives runner.main(). Its no-proof test failed first
with promotion_gate_missing. Its promotion_gate assertions in the two
no-proof tests and the valid-proof test failed first against the previous
head's runner.py (blob 4951f60), with None != 'not_supplied' and
None != 'validated', and pass with this change.

README-paper-exploration.md paraphrases the 2026-10-10 exploration
direction, states preset and leverage-rung coverage as that direction rather
than current behavior, and replaces terms the repository does not define.
blueprints/us-equities/data/README.md no longer says `paper` always
validates the gate.

source-hashes.json was recomputed from the current bytes of the files it
lists. The manifests/evidence.json entries were re-registered with
scripts/host_receipts.py register_file, per the docs/lanes.md hot-file
protocol.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seathatflowsinourveins
seathatflowsinourveins force-pushed the foundation/paper-exploratory-20261010 branch from 8fd9583 to 01a14da Compare October 11, 2026 00:24
@seathatflowsinourveins seathatflowsinourveins changed the title fix(trading): allow paper startup without qualification receipts fix(trading): make paper qualification proofs optional and mark receipts Oct 11, 2026
@seathatflowsinourveins
seathatflowsinourveins marked this pull request as ready for review October 11, 2026 02:08
@seathatflowsinourveins
seathatflowsinourveins merged commit f38116f into main Oct 11, 2026
38 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the foundation/paper-exploratory-20261010 branch October 11, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:trading Trading lane: sim, paper and live north star

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant