Skip to content

Integrate the reviewed adaptive-paper engine change (rotation, sessions, exit plan; SYN) - #69

Merged
seathatflowsinourveins merged 6 commits into
mainfrom
claude/adaptive-paper-engine-20260922
Sep 22, 2026
Merged

seathatflowsinourveins merged 6 commits into
mainfrom
claude/adaptive-paper-engine-20260922

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator

Summary

Rebases the reviewed adaptive-paper engine change from c2019e6 onto main (03f0ad4), keeping PR-4/#64 guards (paper promotion gate, hardened credentials(), metrics.py confinement and their tests):

  • feed selection (iex|sip) with a frozen SIP config;
  • opt-in strategy rotation (registry validated without executing modules; RegimeSelector fed by STOP file, ledger halt, transport health and quote freshness);
  • session model with opt-in extended hours and overnight holds;
  • ordered exit plan (vol-scaled stops, partial take-profit, time decay) with opt-in cancel-then-replace and opt-in gap-risk stop.

Shipped defaults are byte-identical in behaviour (sessions off, rotation off, replace off, gap stop off, feed iex); the 16-case golden fixture passes through both policy classes.

Gate ladder

Rows handed over with adaptive-paper integration (adaptive-paper-broker-trial, leverage ladder, native fault behaviour) now name this lane as owner. adaptive-paper-broker-trial stays not_established; its note records the 2026-09-22 SIP trial (completed_no_signals, 0 orders) and the measured root cause: the Windows host clock was +0.64 s off NTP, so live quotes tripped the −0.25 s future-quote guard. Next attempt needs a host time resync and, since PR-4, a passing promotion-gate result.

Evidence class

SYN (unit and local integration tests with fakes). No broker-observed receipt for rotation, sessions, cancel-then-replace, partial take-profit or the gap stop.

Checks run

  • engine + PR-4 suites → 523 OK (1 skipped)
  • unittest discover -s tests -q → 1729 OK (5 skipped)
  • scripts/validate.py → passed; validate_catalogs.py → ok; trading_gates.py --check → passed
  • guarded gitleaks on the staged change → no leaks

Review

Each component went through independent Opus review rounds before the rebase (G-d 3 + final, G-s 3 + final, merged-tree final + 2 fix rounds, G-f 8 rounds). A review of this rebased diff follows before merge.

🤖 Generated with Claude Code

Rebase of the reviewed engine change from c2019e6 onto main 03f0ad4:
- data feed selection (iex|sip) with a frozen SIP config;
- opt-in strategy rotation (registry validated without executing modules,
  RegimeSelector with operational status from the STOP file, ledger halt,
  transport health and quote freshness);
- session model with opt-in extended hours and overnight holds (NYSE 2026
  calendar, broker-snapshot adoption, held_overnight phase, session-aware
  gross cap, gap-risk evaluation, halted quotes);
- ordered exit plan with vol-scaled stops, partial take-profit and time decay,
  plus opt-in cancel-then-replace and an opt-in gap-risk stop.
Shipped config defaults are byte-identical in behaviour (16-case golden
fixture through both policy classes). PR-4/#64 guards are kept: the paper
promotion gate, hardened credentials() and metrics.py confinement.

Evidence class SYN: no broker-observed receipt for the new behaviour. Gate
rows handed over with adaptive-paper integration now name this lane as owner;
adaptive-paper-broker-trial stays not_established with the measured NTP root
cause of the 2026-09-22 trial in its note.

Checks: engine + PR-4 suites 523 OK (1 skipped); unittest discover 1729 OK
(5 skipped); scripts/validate.py passed; validate_catalogs ok;
trading_gates.py --check passed; guarded gitleaks: no leaks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The hosted validate job's build_ecosystem.py --check failed on the stale
generated explorer. Rebuilt with --write and repinned its manifest row; every
step of the validate workflow passes locally.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Rebase review of PR #69 found two defects in the opt-in overnight-hold path:
- D1: with overnight_holds enabled the flat-account/no-open-orders preflight
  gate was relaxed for every paper start, so positions created outside any
  trial could be adopted. The relaxation now requires the prior trial phase to
  be held_overnight (read before preflight, re-checked under the account lock);
  a first trial or any other prior phase still requires a flat account.
- D2: main() re-read the session clock after run_native returned and could
  relabel a needs_attention end as held_overnight; it now reuses run_native's
  own decision (_final_boundary_from_run_status).
Four regression tests; reverting D1 makes the first-trial test fail.

Checks: engine + PR-4 suites 527 OK (1 skipped); python3 -m unittest 1733 OK
(318 skipped); every hosted validate step and trading_gates.py --check pass;
explorer rebuilt; guarded gitleaks: no leaks.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Re-review of the PR #69 fix commit found the receipt's rebase block still
recorded pre-fix hashes for runner.py, its tests and source-hashes.json, and
trial_phase_and_exit_code's docstring still described main() re-reading the
session clock. The block's file map now matches source-hashes.json for every
shared path, the docstring describes _final_boundary_from_run_status, and the
explorer is rebuilt.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Fix-verification review of c3f8921: a non-object trial.json now keeps the
strict flat gate instead of raising; the locked re-check
trial_state_changed_during_preflight is tested in both directions (removing
it fails both tests); two stale docstrings corrected; receipt and pins
refreshed. Explorer regenerated in the following merge.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Explorer regenerated and the gate-file and explorer evidence rows repinned;
all hosted validate steps, trading_gates and 1987 unit tests pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@seathatflowsinourveins
seathatflowsinourveins merged commit 4ba8ac9 into main Sep 22, 2026
5 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/adaptive-paper-engine-20260922 branch September 25, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant