Skip to content

test(trading): qualify lane A OVERNIGHT stage admission - #1095

Draft
seathatflowsinourveins wants to merge 6 commits into
foundation/overnight-arming-20261013from
codex/ns2604-lane-a-overnight-acceptance-20261013
Draft

seathatflowsinourveins wants to merge 6 commits into
foundation/overnight-arming-20261013from
codex/ns2604-lane-a-overnight-acceptance-20261013

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator

Scope

Main's adaptive-paper preflight refuses an OVERNIGHT stage start. #1081 already implements the qualified overnight port and admission branch; this stacked draft adds a fail-before acceptance pack and retained venue evidence for lane A without duplicating that implementation.

The new regression accepts 21:00 ET only with the existing BOATS REST/overnight configuration and coupled extended-hours flags. Extended hours alone continues to refuse OVERNIGHT. An overnight stage is bounded at 04:00 ET; a DAY order's separate expiry at 20:00 ET cannot supply the missing cleanup window. The opted-in port retains must-end-flat, while PRE/RTH/POST/default-policy controls retain their existing behavior. Production source, source-hash manifests and frozen/shipped configurations are byte-unchanged against the parent.

SOTA sources

  • native-agent-stack/native-agent-stack #1081, pin ea0a51a6b2a485977d8aaf8e11dc0e93fe820a06: blueprints/us-equities/adaptive-paper/runner.py (validate_preflight), sessions.py (validated overnight policy, order extended-hours flag, session close and must-end-flat), overnight.py and the existing reduce-only dispatch/ledger/wire guards. Reuses the port; does not rebuild it.
  • Alpaca 24/5 Trading, vendor update 2026-07-07T14:17:11.000Z, retained 2026-10-10 capture. Public verbatim excerpt: evidence/artifacts/lane-a-overnight-acceptance-20261013/alpaca-245-trading-excerpt.md. Overnight is LIMIT-only; DAY carries to 20:00 ET of the trade date; DTBP does not apply and 2x is the maximum margin buying power. This is a ceiling, not a sizing target or account entitlement.
  • NautilusTrader, 2.0.0rc5 at 1b0a49d2792a9432a3aca3fcb617ce7a630d905e: crates/model/src/enums.rs (TradingState::Reducing) and crates/risk/src/engine/mod.rs (is_reducing_submission and denial). Pinned source verified directly. The CC's 2026-10-13 06:11Z P1-B ruling uses this mechanism for the parent's residual exit path; this PR repeats its synthetic dispatch regression, not an engine E2E.

Evidence-class table

Claim Evidence class Command / receipt
Exact positive OVERNIGHT start regression fails against main, succeeds with the existing qualified port synthetic Genuine detached main worktree: 1 test, exit 1, regular_session_window_unavailable; final acceptance module: 6 tests, exit 0
Missing port flags, too-short overnight window and ordinary session controls preserve refusals/bounds synthetic Acceptance module and session module; session module 151 tests, 34 optional native-runtime skips
Existing 2x/Reg-T controls remain enforced by their pure policy regressions synthetic Three named leverage controls, exit 0
PRE entry is refused and a held position has a reduce-only LIMIT exit at 04:00:01 ET, with oversell refusal synthetic Two existing #1081 regressions, exit 0; committed dispatch AST plus real ledger/wire guards with protocol fixtures
Venue order/TIF/buying-power facts source_review Six verbatim paragraphs from the retained public Alpaca page capture
Native engine, broker entitlement/data/position/order execution and reconciliation acceptance Not established No broker or native-engine E2E performed

Retained results: evidence/artifacts/lane-a-overnight-acceptance-20261013/validation.json. The initial four-test module and exact final one-test main probe are distinguished there; neither is reported as a pass. Raw local traceback logs remain private, with no raw-log digest published.

Local commands run

TMPDIR=/var/tmp python3 -B -m unittest tests.test_adaptive_paper_overnight_acceptance.OvernightStartAcceptance.test_overnight_stage_start_is_admitted_only_with_qualified_flags
# genuine main worktree at 04f64a05: exit 1, 1 test / 1 error, regular_session_window_unavailable

TMPDIR=/var/tmp python3 -B -m unittest tests.test_adaptive_paper_overnight_acceptance
# implementation parent: exit 0, 6 tests

TMPDIR=/var/tmp python3 -B -m unittest tests.test_adaptive_paper_sessions
# exit 0, 151 tests, 34 optional native-runtime skips

TMPDIR=/var/tmp python3 -B -m unittest tests.test_adaptive_paper_leverage.RefusalTests.test_overnight_max_leverage_above_2_refused tests.test_adaptive_paper_leverage.RefusalTests.test_overnight_gross_exceeds_regt_refused tests.test_adaptive_paper_leverage.PropertyGridTests.test_overnight_cap_bounds_ceiling_at_2_in_every_session
# exit 0, 3 tests

TMPDIR=/var/tmp python3 -B -m unittest tests.test_adaptive_paper_overnight_arming.OvernightArming.test_pre_entry_remains_refused tests.test_adaptive_paper_overnight_arming.OvernightArming.test_held_overnight_position_exits_at_pre_as_extended_hours_limit
# exit 0, 2 tests

python3 -B scripts/validate.py
# exit 0; 71 components, 11956 hashed files, 4 profiles, 240 receipts

All five additions are registered through host_receipts.register_file. New-file native identity/email scan and gitleaks pass; the vendor excerpt's six paragraphs match the retained public capture verbatim. No allowlist or privacy-guard change was added by this PR.

Decision record

docs/decisions/2026-10-13-lane-a-overnight-acceptance.md; implementation/acceptance boundary in blueprints/us-equities/adaptive-paper/README-overnight-acceptance.md.

Host evidence

No host receipt or platform-status change.

Checklist

  • No Actions or workflow change.
  • No secrets or private identities added; raw local traces stay private.
  • No new paid service, dependency, account operation or credential load.
  • Peer-owned worktrees and PR heads preserved.
  • No deployment or service/unit action.

Follow-ups

  • Parent Arm bounded overnight REST diagnostics with owned lifecycle and residual exits #1081 must pass its own reads and land; retarget/rebase this draft afterward and reverify any changed admission/exit contract.
  • Fresh merge-tree is clean against the pinned Arm bounded overnight REST diagnostics with owned lifecycle and residual exits #1081 parent. Against current main, inherited parent conflicts remain in mover.py, source-hashes.json and manifests/evidence.json; the parent owner resolves its implementation carry before this draft retargets. This PR does not edit those production or frozen files.
  • Native-runtime and genuine overnight paper qualification remain owning-lane work. The 34 skips and synthetic dispatch do not establish entitlement, current BOATS data, fills, liquidity or broker reconciliation.
  • Review the acceptance boundary before widening stages; the default flatten lead and must-end-flat rule remain constraints.

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.
@seathatflowsinourveins seathatflowsinourveins added the lane:trading Trading lane: sim, paper and live north star label Oct 13, 2026
@seathatflowsinourveins
seathatflowsinourveins force-pushed the foundation/overnight-arming-20261013 branch from ea0a51a to 8f64d5a Compare October 13, 2026 21:08
@seathatflowsinourveins
seathatflowsinourveins force-pushed the foundation/overnight-arming-20261013 branch 2 times, most recently from 02e19f1 to 9d43e30 Compare October 14, 2026 05:32

This branch has not been deployed

No deployments
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