Skip to content

Close spy-lean-parity and dividend-sim-module on the qualifying parity v2 replay (sim rung ready) - #103

Merged
seathatflowsinourveins merged 10 commits into
mainfrom
claude/spy-parity-v2-qualify-20260923
Sep 23, 2026
Merged

seathatflowsinourveins merged 10 commits into
mainfrom
claude/spy-parity-v2-qualify-20260923

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator

Summary

Closes spy-lean-parity and dividend-sim-module. The simulation rung of the trading gate ladder is now ready: trading_gates.py --check reports rung_ready.sim = true.

Qualifying SPY/LEAN parity v2 replay: verdict-v2.json reads PASS with preregistration_qualifying: true.

  • 136 checks: 0 failed, 0 skipped.
  • 106/106 execution checks.
  • Native OCO open fills: 304 @ 323.58 and −304 @ 291.69, each at the engine's open tick with the sibling leg cancelled.
  • Native SimulationModule dividend cash: 428.64, posted as reported AccountStates.
  • Native end cash 90,734.08, matching the rebuilt ledger and the LEAN oracle.
  • Two-run bwrap determinism.
  • Every precondition passes, including all 9 engine isolation checks.

How it was produced (bias control):

  1. The v2 manifest was preregistered and sealed in Preregister SPY/LEAN parity mapping manifest v2 (not run; gates unchanged) #90 (12059ba). Tolerances are unchanged.
  2. A separate peer session (agent-lab-17) implemented it. Its early replays ran before independent review, violating sealed precondition[0]. They are disclosed in replay-history-v2.json and recorded as superseded.
  3. Independent pre-run reviews:
    • Harness f079f6c: not accepted. Five required fixes to the comparator.
    • Harness cc4503f: accepted with zero unresolved findings. Each round used three Opus lenses plus one read-only Codex review (gpt-6-astra, high) and an adjudication.
  4. This gate-owner session committed review-record-v2-cc4503f.json and deviation-acceptance-v2.json (efcdb11, 04:14:49Z) before running the qualifying replay itself (04:15:06Z) from the reviewed harness.
    • The replay appears in replay-history-v2.json as bwrap-cc4503f-qualifying, with full hashes.
    • No retry from cc4503f can qualify.

Gate changes:

  • spy-lean-parity → established, receipt_path now verdict-v2.json. v1's BLOCKED verdict.json is retained.
  • dividend-sim-module → established (native_proven).
    • New dividend-module-receipt.json, matching the gate's preregistered schema (status: closed, mappings_closed).
    • New dated revision mapping-status-20260923.json: all three v2 rows move from preregistered to resolved under the v2 manifest's own rule.
    • The sealed v2 and hash-bound v1 manifests are not edited. This is a declared deviation from the note's v1 wording.

Limits:

  • one_zero case only.
  • The open-fill proxy is not a general market-on-open equivalent when the open equals the prior close.
  • Isolation is partially observed (declared deviation).
  • The v1 sizing rule excludes module-posted cash, so any case that resizes after a paid ex-date needs a new preregistration.

Evidence

  • Independent result review:
    • Round 1: publish with a fix. The closure receipt schema and the resolution record were addressed.
    • Round 2: publish.
  • python3 -m unittest: 2593 OK (338 skipped).
  • All validate.yml steps, trading_gates.py --check, evidence_manifest.py --check and build_ecosystem.py --check rc=0.
  • Guarded gitleaks on origin/main..HEAD: no leaks.
  • Test edits:
    • Four spy-parity tests moved from the superseded state to the qualifying state.
    • New V2GateClosureTests tie the closure receipt and revision to the verdict.
    • Two trading-gates content-condition tests now evaluate a not-established copy of the gate.
  • Private raw run outputs stay host-local. Their hashes are in the receipt.

🤖 Generated with Claude Code

…d DistributionModule)

Implements harness_changes_required of the sealed mapping-manifest-v2.json
(sha256 1b821d7b...): the market-on-open proxy as a native OCO pair of
STOP_MARKET and MARKET_IF_TOUCHED orders submitted from the decision bar at
the decision close +/- 0.0001, and dividend cash through a native
SimulationModule (distribution_module.py) that posts frozen per-share x
ctx.positions quantity at 00:00 New York on LEAN's next-session ex-date.
run.py binds the v2 manifest (and v1 by its recorded sha256), passes the
explicit venue settings, checks the engine extension sha256 and scans the
fully captured engine log for ERROR lines. compare.py binds v2, treats
engine-posted distributions as native cash, adds the OCO, gap/open, log and
module checks, and reports FAIL for any failure (no unsupported rows).
Tests add the no-gap, flat-bar, double-fill, partial-fill, late-emission and
calendar+1 boundary fixtures. The published v2 receipt and verdict follow in
the next commit; the sealed manifest, preregistration, tolerances and probes
are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
run.py now copies a constant list of deviations from the sealed v2 text
into the receipt: the run precedes the independent review the
preconditions require, the sealed status fields stay unedited, a late
module emission is refused after engine.run() rather than mid-run, the v2
results use receipt-v2.json/verdict-v2.json, the annotated manifest
evidence class, INFO-level captured engine logging, and the operator-declared
--harness-commit argument. Nothing sealed, no tolerance and no input changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eviewed)

receipt-v2.json is the unedited output of the documented bwrap two-run
replay (rc5, extension sha256 a53dd5a2..., no network namespace, cleared
environment) run from commit 8c4d7e7.
verdict-v2.json is compare.py --bars against the sealed v2 manifest and
unchanged tolerances; --lean-data re-derivation writes a byte-identical
verdict. Entry 304 @ 323.58 and exit -304 @ 291.69 by native OCO gap-open
fills, engine-posted distributions 0.00 and 428.64, native end cash
90734.08, zero ERROR log lines, two runs equal after UUID normalization.
The receipt carries the declared deviations, including that the replay
precedes the independent review the preconditions require. v1 receipt.json
and verdict.json (BLOCKED) and every gate row are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…engine views, replay history)

compare.py evaluates acceptance_criteria.preconditions as checks under the
sealed verdict rule: a retained review of exactly the files that ran,
completed before the run; the sealed manifest, tolerances and frozen inputs at
run time and, with --lean-data only, at comparison time; the engine pin and
isolation. It pins the sealed v2 manifest and preregistration sha256 and
refuses a v2 receipt bound to any other file, judges the OCO structure from
the engine cache's own order records at OrderAccepted and at run end, and
checks that every reported AccountState after the initial one is a module
emission. The verdict reports preregistration_qualifying and the execution
checks separately.

run.py records started_utc, an optional --review-record, the read-only mount
observation, the engine order views, the configured module count labelled as
configuration, the full replay history (replay-history-v2.json) and revised
deviations; the sizing note is a limitation. fixture_strategy.py reads each
accepted order back from the engine cache. Nothing sealed changes; the
published receipt-v2.json and verdict-v2.json are stale until the re-run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ondition (96/96 execution checks pass)

receipt-v2.json is the unedited output of the documented bwrap two-run replay
(rc5, extension sha256 a53dd5a2..., loopback only, cleared environment,
read-only harness and data mounts) run from commit
f079f6c. verdict-v2.json is compare.py
--lean-data against the sealed v2 manifest and unchanged tolerances: every
execution check passes (entry 304 @ 323.58 and exit -304 @ 291.69 by native
OCO gap-open fills read back from the engine cache, engine-posted
distributions 0.00 and 428.64, native end cash 90734.08, zero ERROR lines,
two runs equal after UUID normalization), and nine of ten precondition checks
pass. precondition_review fails because no retained independent review
preceded this run, so under the sealed verdict rule the verdict is FAIL and
preregistration_qualifying is false. This supersedes the unqualified PASS
published at 9d55cb4. replay-history-v2.json appends this run. v1
receipt.json and verdict.json and every gate row are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dge OCO timing and legs from the engine

compare.py (precondition_review) no longer reports PASS or
preregistration_qualifying while any recorded earlier v2 replay has
reviewed_before_run other than true, unless the gate owner's acceptance of
deviation first_v2_run_preceded_review (deviation-acceptance-v2.json, not
created here) existed at run time, is unchanged at comparison time, has exactly
the six schema keys, names that deviation, binds the five reviewed harness
files that ran and is dated before started_utc. The replay history is
re-hashed at comparison time (append-only growth only), and a run whose
reviewed files equal an earlier replay's fails.

v2_oco_checks replaces the tautological submission-instant check with the
engine clock (submitted_clock_ns) and each leg's OrderSubmitted and
OrderAccepted ts_event at the decision ts (probe_oco_moo_p4: 96/96 accepted
legs at the decision bar), checks the filled leg per fill_rule_by_open from
engine_at_accept, and requires unique order_refs equal to the intents, four
distinct legs, no other client_order_id in order_events and no denial or
rejection anywhere. final_quantity and receipt intents/fills project strictly.

Also: determinism is recomputed from runs[*].normalized_economic_sha256 and
undeclared_differing_fields; under v2 a skipped check is FAIL; MOO attribution
is computed only for a failing price; run.py records python -I, a read-only
interpreter prefix, user/pid namespace indicators and documented environment
values (compare.py checks them; the rest is declared as
isolation_partially_observed) and derives the sizing limitation from the
intents. Every replay from f079f6c is listed as superseded. No replay was run;
receipt-v2.json and verdict-v2.json stay the superseded f079f6c results.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ceptance

Review record (schema spy-parity-v2-harness-review/1): harness cc4503f
independently reviewed and accepted with zero unresolved findings, accepted
limitations listed. Deviation acceptance first_v2_run_preceded_review: the
six earlier replays ran before review and are superseded; the first replay
from the reviewed harness, run after this commit with the committed history,
may qualify under unchanged sealed criteria; no retry from cc4503f can.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ity and dividend-sim-module

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ping-status revision

Result review: the closure receipt now carries mappings_closed per the
gate's preregistered schema, and mapping-status-20260923.json records the
three v2 rows as resolved under the v2 manifest's own rule (the sealed v2
and hash-bound v1 manifests are not edited; declared deviation from the
note's v1 wording). Tests tie the receipt and revision to the qualifying
verdict and receipt. Stale gate-note sentences rewritten as history.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@seathatflowsinourveins
seathatflowsinourveins merged commit 51d6600 into main Sep 23, 2026
12 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/spy-parity-v2-qualify-20260923 branch September 23, 2026 04:31
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