Repository navigation
Conversation
Pin read-only FuseControl main engine (46a86eed) by content digest 12e9b502367a4993d0c36e75ac5c8d24acaee2d1247c5b594796d5adda04ca45 with spec/bundle/freeze metadata, provenance, and SH-1 entry-gate record.
- Add VendoredFuseEvaluator with runtime hash, spec_version, __pycache__ verification, and V2 boolean hwm_adjusted gate - Enforce structural StubEvaluator quarantine and OA-SH2-2 default lock - Add atomic state_snapshots/ restart continuity across runs - Isolate US 23/5 16:00 ET close and post-21:00 ET boundary (Item 13) - Add secret-free GCP Cloud Run Jobs us-east1 entrypoint (Item 18) - Add D1-D10 demo, SH2-A01..A14 acceptance suite, and full unit tests
- Remove unlock_production_override and forbid fixtures_dir in prod. - Require strict booleans and yahoo_symbol_map XSOX in prod config. - Lock check_forward_clock_credit defaults for SH-2 production chains. - Drop fabricated sources/returns in build_fuse_validated_inputs; wire live corporate_action events into FUSE-1 V2 and enforce NO-NEW-RISK and per-fund sizing isolation. - Persist pending O1/O2 rejected-day row state and fuse_context for bit-for-bit replay across rejected and normal sessions. - Reject Tiingo row.timestamp midnight markers, non-daily Yahoo charts, and mismatched calendar spec_digest overrides. - Stage state snapshots inside atomic ledger commit hooks with rollback and deterministic reconciliation, and add .chain.lease.json cross-instance fencing (CLI exit 4, Cloud Run maxRetries: 0).
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (14)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6691b07910
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 6691b07910
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
- Require exact immediately preceding trading session close via resolve_previous_trading_date and target_prior_date. - Allow same-session O1 clearing_period retries without double advancing counters while preserving base_prior_row_state. - Reject non-production or missing config_path in check_forward_clock_credit. - Switch Cloud Run CSI driver to gcsfuse.run.googleapis.com. - Bind evaluator.next_row_state_sha256 into canonical ledger records and enforce ledger-digest + monotonic latch checks on snapshots.
Pin pending_rejected_state.json base_prior_row_state strictly to the committed seq-1 state across 2+ consecutive O1/O2-rejected days so intervening rejected runs do not overwrite base_prior_row_state with uncommitted intermediate state. Pass expected_base_session_date into load_pending_rejected_state_snapshot and bound monotonic counter steps (L5, O1, V4, V5) by elapsed calendar days from the committed baseline while keeping un-committed latch downgrades and arbitrary counter jumps fail-closed. Refresh pinned production code/policy hashes in docs/sh2-acceptance-pack.md and add multi-day V4 clearing regression coverage in tests/test_sh2_pipeline.py.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0dc148a208
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 0dc148a208
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Address all four Codex review findings on ShadowResearch#7: - ledger: allow valid 10th-session V4 clearing inside pending_rejected_state.json when elapsed days reach >=10 while blocking premature clearing and invalid counter >=10. - scheduler: add _retire_superseded_pending_rejected_state and call it across every return path of committed snapshot reconciliation so interrupted post-commit unlinks clean up on retry. - feeder: share _validate_tiingo_official_close_row between select_tiingo_row and extract_prior_close_from_tiingo_bytes to reject extended/overnight markers and off-close session_time values. - scheduler/cloudrun_job/docs: require external history authentication (expected_prior_head_sha256 / SHADOW_TRUSTED_HEAD_SHA256 or bitcoin_merkle_roots / SHADOW_BITCOIN_MERKLE_ROOTS_PATH) before reusing non-empty production ledger history (CLI exit 3 on failure). - docs/tests: refresh pinned production code/policy hashes and add positive and negative regression tests across all four fixes.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: a5599c5af8
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Fail closed with production_genesis_unauthenticated on empty SHADOW_DATA_DIR unless expected_prior_head_sha256 matches GENESIS_PREV_HASH (Codex Security PRRT_kwDOV2RNAc67knPD), blocking wiped-bucket replay and updating acceptance hashes and tests.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0800291e30
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 0800291e30
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
AI Code Review (opencode /
|
Require explicit current record_sha256 or external BTC roots on same-session retries, fetch prior trading close via live Tiingo lookback for FUSE genesis, reconcile uncommitted staged state snapshots, and narrow native FUSE input detection.
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 2639145d8b
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Require SHADOW_TRUSTED_HEAD_SHA256 on all recurring and retry production runs (even when BTC roots are provided, closing PRRT_kwDOV2RNAc67m4A-), and pin pending_rejected_state.json with SHADOW_TRUSTED_PENDING_STATE_SHA256 (closing PRRT_kwDOV2RNAc67m4BM).
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cedaf69e3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: cedaf69e3b
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
AI Code Review (opencode /
|
|
@claude review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 6d29a7fc96
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
AI Code Review (opencode /
|
Vendor the FuseControl FUSE-1 engine package (fuse-eval-spec/v1, engine_hash 12e9b502...) with its provenance, freeze, spec, result bundle and disposition register metadata. No runtime code consumes it yet; the adapter lands in a follow-up part of the SH-2 split of #7. Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…5) (#9) * feat(fuse): add vendored FUSE-1 adapter and per-tier sizing isolation Add VendoredFuseEvaluator, which re-verifies the vendored engine digests before each evaluate() call, plus FUSE input translation, NO-NEW-RISK clamping and per-tier sizing controls. Register fuse_adapter in the code manifest, hash explicit scheduler config paths by their relative path, and record the SH-2 entry gates. Part 2 of the SH-2 split of #7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): honor O5 settled-cash alias, V7 session time, pyc flags Resolve o5_settled_cash before defaulting settled_cash to the bankroll, keep a missing V7 session_time as missing instead of asserting a regular session, and compile vendored source with dont_inherit=True so legitimately compiled __pycache__ bytecode verifies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): keep O5 counter aliases, forward H, drop return-as-loss Default the canonical O5 session counters only when no alias carries evidence, forward H so O9 can match authorized H change descriptors, and stop substituting one_session_loss (a return fraction) for the cumulative dollar loss L when re-tiering explicit FUSE payloads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * docs(fuse): document O3 model self-reconciliation in Stage N Stage N has no broker evidence in any mode, so absent broker_* observations are substituted with modelled values and O3 is a model self-reconciliation, not reconciliation evidence. Comment only; no change to validated inputs or record hashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): preserve explicitly null O5 session counters Default session_order_count and session_turnover only when the key is omitted; an explicitly null counter is unknown evidence and is passed through as None so evaluate_O5() fails closed on turnover/order limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): compare pyc code structurally and keep null settled cash Compare cached vendored bytecode by code-object equality instead of marshal encoding, which differs between py_compile and compile() on CPython 3.11/3.12, while still rejecting altered constants. Preserve an explicitly null settled_cash or o5_settled_cash as unknown evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra P1s in adapter inputs and engine loading Validate every market record (including optional SPX) for eligibility, calendar digest and effective session, apply corporate actions to V1 returns only when the ex-date is the decision session, pass explicit null policy hashes and heartbeats through uncoerced, leave absent settled cash unknown, pin the complete metadata digest set in code, and execute only verified engine source bytes via a dedicated finder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): label adapter self-heartbeat with heartbeat_source Record heartbeat_source="adapter_self" when the adapter defaults the O7 heartbeat to as_of, and "caller" when session inputs supply it, so a self-attested heartbeat is never mistaken for liveness evidence. The ledger-supplied heartbeat follows in part 4 (#13). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * docs(fuse): document EOD half-day O2 mapping and pin it with a test SH-2 decisions are end-of-day, so every trading day, half days included, maps to `open`; FuseControl's half_day_cutoff is a pre-trade rule. Pin that the 2026-11-27 14:30 ET half-day decision maps to open with O2 clear, and that late runs are the scheduler cutoff's job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra round-2 P1s and default substitutions Apply the feeder's exact rate freshness rule, reject records retrieved after the decision instant, reject the ineffective kill_switch_tripped flag, fail closed on conflicting corporate actions and on caller closes that disagree with the validated market close, and pass explicit nulls (broker, cash, exposures, tolerance, proposal) through as missing. Unknown tiers and missing high-water marks no longer fall back to balanced or bankroll defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): compare caller and market closes by decimal value The close-mismatch guard must compare values, not the strict sizing parser (which rejects floats by design), so a float and a canonical decimal string for the same close are treated as equal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra round-3 safety P1s in adapter and evaluator Reject conflicting corporate actions before any successor state, never let current_index_closes override a validated record, propagate unknown held-position values into reconciliation and aggregates, reject kill_switch_tripped on the effective payload at the evaluator boundary, drop source records dated after the decision instant, and compare timestamps as aware instants rather than strings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): guard source dates at evaluator, keep unknown shares None Drop source records dated after the decision instant at the evaluator boundary so nested fuse_inputs and direct payloads are covered, and pass an unknown ledger quantity as share_count None (0 only for an explicitly flat position) so O3/V2 cannot clear on an invented zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…2 3/5) (#14) * feat(fuse): add vendored FUSE-1 adapter and per-tier sizing isolation Add VendoredFuseEvaluator, which re-verifies the vendored engine digests before each evaluate() call, plus FUSE input translation, NO-NEW-RISK clamping and per-tier sizing controls. Register fuse_adapter in the code manifest, hash explicit scheduler config paths by their relative path, and record the SH-2 entry gates. Part 2 of the SH-2 split of #7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * feat(feeder): isolate US 23/5 official close and bound upstream HTTP Consume the csa22-v2 calendar to classify core RTH vs extended and overnight windows, reject non-official-close and T+1 bars, resolve the immediately preceding trading date, and bound decimal inputs. Add http_limits with streaming byte caps and monotonic total deadlines for market and OTS fetches. Part 3 of the SH-2 split of #7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): honor O5 settled-cash alias, V7 session time, pyc flags Resolve o5_settled_cash before defaulting settled_cash to the bankroll, keep a missing V7 session_time as missing instead of asserting a regular session, and compile vendored source with dont_inherit=True so legitimately compiled __pycache__ bytecode verifies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): keep O5 counter aliases, forward H, drop return-as-loss Default the canonical O5 session counters only when no alias carries evidence, forward H so O9 can match authorized H change descriptors, and stop substituting one_session_loss (a return fraction) for the cumulative dollar loss L when re-tiering explicit FUSE payloads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * docs(fuse): document O3 model self-reconciliation in Stage N Stage N has no broker evidence in any mode, so absent broker_* observations are substituted with modelled values and O3 is a model self-reconciliation, not reconciliation evidence. Comment only; no change to validated inputs or record hashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): preserve explicitly null O5 session counters Default session_order_count and session_turnover only when the key is omitted; an explicitly null counter is unknown evidence and is passed through as None so evaluate_O5() fails closed on turnover/order limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): compare pyc code structurally and keep null settled cash Compare cached vendored bytecode by code-object equality instead of marshal encoding, which differs between py_compile and compile() on CPython 3.11/3.12, while still rejecting altered constants. Preserve an explicitly null settled_cash or o5_settled_cash as unknown evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra P1s in adapter inputs and engine loading Validate every market record (including optional SPX) for eligibility, calendar digest and effective session, apply corporate actions to V1 returns only when the ex-date is the decision session, pass explicit null policy hashes and heartbeats through uncoerced, leave absent settled cash unknown, pin the complete metadata digest set in code, and execute only verified engine source bytes via a dedicated finder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): label adapter self-heartbeat with heartbeat_source Record heartbeat_source="adapter_self" when the adapter defaults the O7 heartbeat to as_of, and "caller" when session inputs supply it, so a self-attested heartbeat is never mistaken for liveness evidence. The ledger-supplied heartbeat follows in part 4 (#13). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * docs(fuse): document EOD half-day O2 mapping and pin it with a test SH-2 decisions are end-of-day, so every trading day, half days included, maps to `open`; FuseControl's half_day_cutoff is a pre-trade rule. Pin that the 2026-11-27 14:30 ET half-day decision maps to open with O2 clear, and that late runs are the scheduler cutoff's job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra round-2 P1s and default substitutions Apply the feeder's exact rate freshness rule, reject records retrieved after the decision instant, reject the ineffective kill_switch_tripped flag, fail closed on conflicting corporate actions and on caller closes that disagree with the validated market close, and pass explicit nulls (broker, cash, exposures, tolerance, proposal) through as missing. Unknown tiers and missing high-water marks no longer fall back to balanced or bankroll defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): compare caller and market closes by decimal value The close-mismatch guard must compare values, not the strict sizing parser (which rejects floats by design), so a float and a canonical decimal string for the same close are treated as equal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra round-3 safety P1s in adapter and evaluator Reject conflicting corporate actions before any successor state, never let current_index_closes override a validated record, propagate unknown held-position values into reconciliation and aggregates, reject kill_switch_tripped on the effective payload at the evaluator boundary, drop source records dated after the decision instant, and compare timestamps as aware instants rather than strings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): guard source dates at evaluator, keep unknown shares None Drop source records dated after the decision instant at the evaluator boundary so nested fuse_inputs and direct payloads are covered, and pass an unknown ledger quantity as share_count None (0 only for an explicitly flat position) so O3/V2 cannot clear on an invented zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(feeder): address SH-2 part 3 Astra review findings * fix(feeder): reject post-cutoff or future-published market records --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… Run job (SH-2 4/5) (#15) * feat(fuse): add vendored FUSE-1 adapter and per-tier sizing isolation Add VendoredFuseEvaluator, which re-verifies the vendored engine digests before each evaluate() call, plus FUSE input translation, NO-NEW-RISK clamping and per-tier sizing controls. Register fuse_adapter in the code manifest, hash explicit scheduler config paths by their relative path, and record the SH-2 entry gates. Part 2 of the SH-2 split of #7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * feat(feeder): isolate US 23/5 official close and bound upstream HTTP Consume the csa22-v2 calendar to classify core RTH vs extended and overnight windows, reject non-official-close and T+1 bars, resolve the immediately preceding trading date, and bound decimal inputs. Add http_limits with streaming byte caps and monotonic total deadlines for market and OTS fetches. Part 3 of the SH-2 split of #7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * feat(ledger): bind FUSE row state to ledger and authenticate history Embed next_row_state_sha256 in record bodies, authenticate persisted production history against an external trusted head and monotonic anchor, and recover pending rejected state across multi-day rejections. Wire FUSE into scheduler and replay, add the locked production config, the Cloud Run job module, and the SH-2 demo used by the pipeline tests. Part 4 of the SH-2 split of #7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): honor O5 settled-cash alias, V7 session time, pyc flags Resolve o5_settled_cash before defaulting settled_cash to the bankroll, keep a missing V7 session_time as missing instead of asserting a regular session, and compile vendored source with dont_inherit=True so legitimately compiled __pycache__ bytecode verifies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): keep O5 counter aliases, forward H, drop return-as-loss Default the canonical O5 session counters only when no alias carries evidence, forward H so O9 can match authorized H change descriptors, and stop substituting one_session_loss (a return fraction) for the cumulative dollar loss L when re-tiering explicit FUSE payloads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * docs(fuse): document O3 model self-reconciliation in Stage N Stage N has no broker evidence in any mode, so absent broker_* observations are substituted with modelled values and O3 is a model self-reconciliation, not reconciliation evidence. Comment only; no change to validated inputs or record hashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): preserve explicitly null O5 session counters Default session_order_count and session_turnover only when the key is omitted; an explicitly null counter is unknown evidence and is passed through as None so evaluate_O5() fails closed on turnover/order limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): compare pyc code structurally and keep null settled cash Compare cached vendored bytecode by code-object equality instead of marshal encoding, which differs between py_compile and compile() on CPython 3.11/3.12, while still rejecting altered constants. Preserve an explicitly null settled_cash or o5_settled_cash as unknown evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra P1s in adapter inputs and engine loading Validate every market record (including optional SPX) for eligibility, calendar digest and effective session, apply corporate actions to V1 returns only when the ex-date is the decision session, pass explicit null policy hashes and heartbeats through uncoerced, leave absent settled cash unknown, pin the complete metadata digest set in code, and execute only verified engine source bytes via a dedicated finder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * test(ledger): give hand-built market records an effective session Market records are now validated against the decision session, so the ledger-integration and pipeline fixtures that build records by hand carry the effective_session the feeder always sets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): label adapter self-heartbeat with heartbeat_source Record heartbeat_source="adapter_self" when the adapter defaults the O7 heartbeat to as_of, and "caller" when session inputs supply it, so a self-attested heartbeat is never mistaken for liveness evidence. The ledger-supplied heartbeat follows in part 4 (#13). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * docs(fuse): document EOD half-day O2 mapping and pin it with a test SH-2 decisions are end-of-day, so every trading day, half days included, maps to `open`; FuseControl's half_day_cutoff is a pre-trade rule. Pin that the 2026-11-27 14:30 ET half-day decision maps to open with O2 clear, and that late runs are the scheduler cutoff's job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra round-2 P1s and default substitutions Apply the feeder's exact rate freshness rule, reject records retrieved after the decision instant, reject the ineffective kill_switch_tripped flag, fail closed on conflicting corporate actions and on caller closes that disagree with the validated market close, and pass explicit nulls (broker, cash, exposures, tolerance, proposal) through as missing. Unknown tiers and missing high-water marks no longer fall back to balanced or bankroll defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * test(ledger): align hand-built records with session validation Ledger and pipeline fixtures that build market records by hand now carry a T-1 SOFR effective date, a retrieval time before the decision instant, and per-fund closes that match the fund payload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): compare caller and market closes by decimal value The close-mismatch guard must compare values, not the strict sizing parser (which rejects floats by design), so a float and a canonical decimal string for the same close are treated as equal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra round-3 safety P1s in adapter and evaluator Reject conflicting corporate actions before any successor state, never let current_index_closes override a validated record, propagate unknown held-position values into reconciliation and aggregates, reject kill_switch_tripped on the effective payload at the evaluator boundary, drop source records dated after the decision instant, and compare timestamps as aware instants rather than strings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): guard source dates at evaluator, keep unknown shares None Drop source records dated after the decision instant at the evaluator boundary so nested fuse_inputs and direct payloads are covered, and pass an unknown ledger quantity as share_count None (0 only for an explicitly flat position) so O3/V2 cannot clear on an invented zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * test(fuse): restore part 4 test_fuse_adapter additions after main merge * feat(ledger): wire O7 previous-record heartbeat and L0 two-pass * fix(sh2): resolve Astra Round 1 P1s for retry, receipts, L0, Cloud Run, lock * fix(sh2): harden default prod lock, nested O7, evidence staging, and CLK-01 * fix(sh2): recover drill evidence, propagate nested L0, guard _by_tier --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…-2 5/5) (#16) * feat(fuse): add vendored FUSE-1 adapter and per-tier sizing isolation Add VendoredFuseEvaluator, which re-verifies the vendored engine digests before each evaluate() call, plus FUSE input translation, NO-NEW-RISK clamping and per-tier sizing controls. Register fuse_adapter in the code manifest, hash explicit scheduler config paths by their relative path, and record the SH-2 entry gates. Part 2 of the SH-2 split of #7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * feat(feeder): isolate US 23/5 official close and bound upstream HTTP Consume the csa22-v2 calendar to classify core RTH vs extended and overnight windows, reject non-official-close and T+1 bars, resolve the immediately preceding trading date, and bound decimal inputs. Add http_limits with streaming byte caps and monotonic total deadlines for market and OTS fetches. Part 3 of the SH-2 split of #7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * feat(ledger): bind FUSE row state to ledger and authenticate history Embed next_row_state_sha256 in record bodies, authenticate persisted production history against an external trusted head and monotonic anchor, and recover pending rejected state across multi-day rejections. Wire FUSE into scheduler and replay, add the locked production config, the Cloud Run job module, and the SH-2 demo used by the pipeline tests. Part 4 of the SH-2 split of #7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * feat(cloudrun): add Cloud Run job packaging and SH-2 acceptance pack Add the secret-free Cloud Run Job Dockerfile and example job spec, the Cloud Run runbook, the SH-2 acceptance pack (sh2_acceptance) and its docs, the Cloud Run job test suite, and deprecation notes for the SH-1 host templates. Part 5 of the SH-2 split of #7; the tree now matches feat/sh2-live-engine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): honor O5 settled-cash alias, V7 session time, pyc flags Resolve o5_settled_cash before defaulting settled_cash to the bankroll, keep a missing V7 session_time as missing instead of asserting a regular session, and compile vendored source with dont_inherit=True so legitimately compiled __pycache__ bytecode verifies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): keep O5 counter aliases, forward H, drop return-as-loss Default the canonical O5 session counters only when no alias carries evidence, forward H so O9 can match authorized H change descriptors, and stop substituting one_session_loss (a return fraction) for the cumulative dollar loss L when re-tiering explicit FUSE payloads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * docs(fuse): document O3 model self-reconciliation in Stage N Stage N has no broker evidence in any mode, so absent broker_* observations are substituted with modelled values and O3 is a model self-reconciliation, not reconciliation evidence. Comment only; no change to validated inputs or record hashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): preserve explicitly null O5 session counters Default session_order_count and session_turnover only when the key is omitted; an explicitly null counter is unknown evidence and is passed through as None so evaluate_O5() fails closed on turnover/order limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): compare pyc code structurally and keep null settled cash Compare cached vendored bytecode by code-object equality instead of marshal encoding, which differs between py_compile and compile() on CPython 3.11/3.12, while still rejecting altered constants. Preserve an explicitly null settled_cash or o5_settled_cash as unknown evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra P1s in adapter inputs and engine loading Validate every market record (including optional SPX) for eligibility, calendar digest and effective session, apply corporate actions to V1 returns only when the ex-date is the decision session, pass explicit null policy hashes and heartbeats through uncoerced, leave absent settled cash unknown, pin the complete metadata digest set in code, and execute only verified engine source bytes via a dedicated finder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * test(ledger): give hand-built market records an effective session Market records are now validated against the decision session, so the ledger-integration and pipeline fixtures that build records by hand carry the effective_session the feeder always sets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): label adapter self-heartbeat with heartbeat_source Record heartbeat_source="adapter_self" when the adapter defaults the O7 heartbeat to as_of, and "caller" when session inputs supply it, so a self-attested heartbeat is never mistaken for liveness evidence. The ledger-supplied heartbeat follows in part 4 (#13). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * docs(fuse): document EOD half-day O2 mapping and pin it with a test SH-2 decisions are end-of-day, so every trading day, half days included, maps to `open`; FuseControl's half_day_cutoff is a pre-trade rule. Pin that the 2026-11-27 14:30 ET half-day decision maps to open with O2 clear, and that late runs are the scheduler cutoff's job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra round-2 P1s and default substitutions Apply the feeder's exact rate freshness rule, reject records retrieved after the decision instant, reject the ineffective kill_switch_tripped flag, fail closed on conflicting corporate actions and on caller closes that disagree with the validated market close, and pass explicit nulls (broker, cash, exposures, tolerance, proposal) through as missing. Unknown tiers and missing high-water marks no longer fall back to balanced or bankroll defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * test(ledger): align hand-built records with session validation Ledger and pipeline fixtures that build market records by hand now carry a T-1 SOFR effective date, a retrieval time before the decision instant, and per-fund closes that match the fund payload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): compare caller and market closes by decimal value The close-mismatch guard must compare values, not the strict sizing parser (which rejects floats by design), so a float and a canonical decimal string for the same close are treated as equal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): resolve Astra round-3 safety P1s in adapter and evaluator Reject conflicting corporate actions before any successor state, never let current_index_closes override a validated record, propagate unknown held-position values into reconciliation and aggregates, reject kill_switch_tripped on the effective payload at the evaluator boundary, drop source records dated after the decision instant, and compare timestamps as aware instants rather than strings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(fuse): guard source dates at evaluator, keep unknown shares None Drop source records dated after the decision instant at the evaluator boundary so nested fuse_inputs and direct payloads are covered, and pass an unknown ledger quantity as share_count None (0 only for an explicitly flat position) so O3/V2 cannot clear on an invented zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq * fix(sh2): harden acceptance checks, offline OTS, Cloud Run volume UID * fix(sh2): resolve Astra Round 2 P0 group name, remove image data dir, harden A13 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Superseded and completed via 5 clean stacked PRs merged into
Offline SH-2 acceptance ( |
AI assistance
Assisted by OpenAI Codex CLI (
gpt-6.2-astrareasoning high pre-push blocker review) and Coordinator/subagent orchestration (shadow-sh2-engineer); all vendored checksums, unit/integration suites (185/185), design demos (SH2-D1..D10),sh2_acceptance, andgitleakswere independently verified on exact HEAD0cddff241cc85aebfbb7a7de96e28d2bd6f08153.What changed
Implements
SHADOW-N SH-2offline software slices onShadowResearchmain(20412087), integrating digest-pinnedFuseControlfuse-eval-spec/v1(46a86eed),csa22-v22026 XNYS calendar + US 23/516:00 ETclose isolation (Roadmap v2.0 Item 13), and secret-free GCP Cloud Run Jobs (us-east1) runtime containerization (Item 18), with zero production unlock (production_chain_locked: true,clk01_active: false) and zero orders (orders_placed: 0,kelly_applied: false,H = "0",B0 = "50000"):FUSE-1Vendoring & Entry Gates:.pyfiles fromQuantStrategyLab/FuseControl46a86eed(0444, zero__pycache__/) undervendor/fuse_engine/fuse-eval-spec-v1/12e9b502367a4993d0c36e75ac5c8d24acaee2d1247c5b594796d5adda04ca45/fuse_engine/plusmetadata/, verified againstF1-A01/A03/A04/A10/A11(docs/sh2-entry-gates.md).src/shadow/fuse_adapter.py,src/shadow/ledger.py,src/shadow/replay.py,src/shadow/sizing.py,src/shadow/scheduler.py):VendoredFuseEvaluatorre-verifies source SHA-256 digests, framedengine_hash,spec_version, and__pycache__bytecode before load and before everyevaluate(..., mode="shadow", ...)call with zero conformance shims.hwm_adjustedon V2 reconciliation payloads (adjustment_complete is True), wiresmarket_records[].corporate_action(split_ratio/cash_per_share_usd) intoV2, preserves fund-levelhwm_adjusted, fractionalq_pre/broker_positionquantities forO3, missing/invalidV1modelled_fee/modelled_financing,V4long_run_volatility,V5shortfall_observed/shortfall_predicted,V6carrying_cost_measured/excess_return_shrunk, andV7quote_staleness/spread_width/trading_pauseobservations asNone(emitting explicitmissing_inputinstead of fabricating defaults; explicitlong_run_vol_by_instsupported viascheduler.py/fuse_context/replay.py), derivesL6benchmark returns independently of missing fund returns (while still gatingsource_records["market_data"]on complete fund returns),five_session_history/sessions_window, O5 pre-trade order evidence, O7 explicit silence flags (o7_runtime_silent/o7_monitor_silent), andO9change signals (tier_change_event/o9_change_descriptors), preserves list-formauthorized_events, validates caller-suppliedmarket_data/session_calendarsource_records, rejects stale mismatchedcalendar_session["trade_date"], removes silent synthesis of missingbroker_reconciliationor zeroindex_one_session_returns, scales derivedjoint_exposure/proposed_exposureinto U-013x * beta / (1 + H/E*)units, derives split-adjusted returns &L4one_session_loss, evaluates per-tier FUSE controls independently before sizing each tier (evaluator.by_tier&_by_tier, including explicitfuse_inputs/ direct FUSE payloads via_apply_explicit_payload_tier), and structurally quarantinesStubEvaluator/ synthetic observations inproductionmode.resolve_previous_trading_date()andtarget_prior_date(no stale-session fallback across skipped/rejected days), enforces_validate_tiingo_official_close_rowacross both current and prior-close Tiingo extraction (rejectingextended_overnight_openand off-closesession_time), forwards non-empty partialindex_one_session_returnsinto vendoredFUSE-1so single-benchmarkL6-10%crash latches still trigger even when another benchmark is missing/ineligible (O1still enforces benchmark completeness), and requires complete fund returns beforeevaluate().NO-NEW-RISKexposure clamping (q_ideal <= q_pre_i) and per-fund / per-tier control scopes insizing.py&ledger.py.src/shadow/ledger.py,src/shadow/scheduler.py,src/shadow/cloudrun_job.py):evaluator.next_row_state_sha256inside RFC 8785 canonicalrecord_body(bound byrecord_sha256/ OTS receipt) for all non-stub evaluators, and enforcesload_row_state_snapshot(..., expected_state_sha256=...)verification with deterministic rebuild from OTS-verifiedreplay_bundle.jsonon mid-commit crash recovery._authenticate_production_history) before reusing any persisted production ledger:expected_prior_head_sha256(SHADOW_TRUSTED_HEAD_SHA256, verified viahmac.compare_digest) is mandatory on all advancing runs ("0" * 64for one-time empty-bucket genesis) and same-session retries (bitcoin_merkle_rootscorroborates only viaassess_receipt_creditability(...), fail-closed exit3,0writes), enforces external monotonictrusted_head_anchor_path(SHADOW_TRUSTED_HEAD_ANCHOR_PATH/--trusted-head-anchor-path, required outsideSHADOW_DATA_DIR, updated underflockCAS with monotonicsequence/anchor_version, pre-persistedsequence=-1genesis anchor in_stage_bundle_before_marker()beforeseq_000000.record.jsoncommit,pending_rejected_session_date+pending_rejected_revision/pending_revisionsame-day anti-rollback ordering, plus authenticated forward interrupted-commit and interrupted-pending catch-up) to defeat synchronized ledger+head rollback attacks, hashes in-memorypending_payloaddirectly (zero post-write TOCTOU re-read), and enforces mandatorySHADOW_TRUSTED_PENDING_STATE_SHA256/expected_pending_state_sha256(NO_PENDING_REJECTED_STATE_SHA256 = GENESIS_PREV_HASHwhen absent) continuity verification across all production cycles and post-evaluation OTS/deadline rejections._reconcile_uncommitted_staged_snapshots), preserves unlatched cross-sessionO5resets &exact_reconciliation_auto_clearon unlatchedV2.pending_adjustmentswhile locking latchedV2/O5states, allows verified terminal-statusO4order resolution (o4_resolved_symbols) and Q4-validatedauthorized_eventslatch clearing (normalize_pending_authorized_events,_has_authorized_pending_clearwith scope isolation, session windowing, and L3 30-day cooling-off enforcement; forwarded throughrun_daily_drill_cycle,run_production_cycle,_persist_pending_rejected_state,fuse_context, andreplay_window) in pending rejected snapshots, narrows native FUSE input detection cleanly without swallowing optional SHADOWhigh_water_mark/source_records, and passes prior-sessionlookback_daysin live Tiingo fetches forseq=0FUSE bootstrapping.O1/O2rejections (includingO1 clearing_periodtransitions underNO-NEW-RISKand legitimate 10th-sessionV4clearing) without double-advancing counters, pinspending_rejected_state.json["base_prior_row_state"]strictly to the committedseq - 1baseline across 2+ consecutive rejected sessions, enforces monotonic latch/counter bounds, and cleanly retires supersededpending_rejected_state.jsonon committed-session recovery (_retire_superseded_pending_rejected_state).23/5Isolation & Cloud Run Jobsus-east1(config/production-scheduler.json,src/shadow/calendar_consumer.py,src/shadow/feeder.py,src/shadow/feeder_live.py,src/shadow/ots.py,src/shadow/http_limits.py,src/shadow/manifest.py,src/shadow/cloudrun_job.py,Dockerfile,deploy/cloudrun/job-spec.example.yaml,docs/sh2-cloudrun-runbook.md):config/production-scheduler.jsonships locked (production_chain_locked: true,clk01_active: false), switchestreasury_endpointtodaily_treasury_yield_curvepar yield dataset, validates strict booleans, checks loadedspec["spec_digest"] == cfg.calendar_spec_digest, forbids offlinefixtures_dirinproductionmode, and rejects missing or non-productionconfig_pathoverrides insidecheck_forward_clock_credit().23/516:00 ET(13:00 EThalf-day) Official Close isolation, rejects Tiingo bartimestampmidnight markers & Yahoo non-dailydataGranularity, separatescore_session_openvsextended_overnight_openinO2, bounds text length, significant digits, exponents, and market-close value ranges ((0, 1e9]) in_parse_finite_decimal/canonical_decimal_str(fast-pathing0without fixed-point expansion and converting rejected numeric values into missing market records insideemit_market_records_from_payloads), and enforces bounded streaming +Content-Length+ error-body byte caps and monotonic end-to-end connect/TLS/header/body deadlines + Cloud Runtask_timeout_secondsreporting reserve across all upstream market (feeder_live.py: Tiingo/Yahoo2 MiB, NYFed SOFR1 MiB, Treasury/default4 MiB,15sdefault HTTP deadline) and OTS (ots.py:256 KiB) HTTP fetches viasrc/shadow/http_limits.py(registered inRUNTIME_MODULE_FILES).us-east1) entrypoint usingdriver: gcsfuse.run.googleapis.comand append-only lease epoch slots (.chain.lease.jsonat epoch0and immutable.chain.lease.epoch.<N>.jsonon reclamation via_latest_lease_slot()and atomicos.link_publish_exclusive_file()— zeroos.unlink()calls on lease slot files) + 0-byte initializing guard + CAS stale-reclamation cross-instance mutex (ChainConcurrencyConflictError, pre-scan active higher-generation guard + generational exclusive.chain.lease.reclaim.<key>[.g<N>].lockclaims up to_MAX_RECLAIM_GENERATIONS = 64+reclaim_expiresfence before epoch publish + 5s empty-claim initializing/abandonment recovery in_is_reclaim_claim_expired+ background daemon immutable sidecar.chain.lease.renew.<lease_id>.<uuid>.jsonrenewal (lease_ttl_seconds=300.0,_effective_lease_expiry(), post-publish slot/identity/expiry/active-reclaim verification) + immutable release tombstone.chain.lease.released.<lease_id>.json(_is_lease_released()) +assert_active_chain_lease()writer fencing acrossappend_record/_stage_bundle_before_marker/anchor/pending-state persistence + re-entrantchain_lock(),dev/ino/digest verification,maxRetries: 0template,--expected-pending-state-sha256/SHADOW_TRUSTED_PENDING_STATE_SHA256,--trusted-head-anchor-path/SHADOW_TRUSTED_HEAD_ANCHOR_PATH) while preservingSH-1drills/tests.cash_per_share_usdalongside split corporate actions insrc/shadow/fuse_adapter.py(_map_market_corporate_action()and_compute_ca_adjusted_fund_return()), gates feeder-derived corporate actions, derived fund returns, and benchmark returns on market-record validity (not bad_market_payloadand instrument not inbad_market_insts), excludes unadjusted QQQ split prices from benchmarkL6index-crash derivation (_INDEX_RETURN_LABELS), preserves explicit invalid/nullhigh_water_markas missing for fail-closedO1evaluation, and requires strictly positivesigma_forecastbefore marking volatility valid (vol_ok).D1–D10), Acceptance & Regression Tests (demo/run_sh2_demo.py,src/shadow/sh2_acceptance.py,docs/sh2-acceptance-pack.md,tests/test_*.py):SH2-D1..D10,SH2-A01..A14, and full regression coverage (185total tests).How verified
Independently verified on exact HEAD
0cddff241cc85aebfbb7a7de96e28d2bd6f08153(185/185 OKin353.610s,production_chain_locked=true,clk01_active=false,engine_hash=12e9b502367a4993d0c36e75ac5c8d24acaee2d1247c5b594796d5adda04ca45,csa22_v2_spec_digest=2ba8cd7684c361209df68bfa2e10004c1f9922a645c7ec55d421fda520561798,production_code_version_sha=b6f677a8113058120499fcacb03d63728635aa6cae57ea66e8ff215fe2c822bd,production_policy_config_hash=23d8f3d42fd15a285b4dbef67c4a2b7a2372ca9c58a9e2f2af1ed2f3a2a43e8c):PYTHONPATH=src python3 -m unittest discover -s tests: PASS (185/185 OKin353.610s)PYTHONPATH=src python3 -m shadow.sh2_acceptance: PASS (overall_status="PASS_OFFLINE",demo_cases_passed="10/10",oa_sh2_2_locked=true,hygiene_violations=[])gitleaks(85 commits,0leaks),git diff --check; vendored files0444with zero__pycache__/.qsl-ai-reviewer[bot]) findings across6691b079..cedaf69e,d43db216(PRRT_kwDOV2RNAc67nx2K/Q/U/Z),57a442db(PRRT_kwDOV2RNAc67n1S7),f1423a13(PRRT_kwDOV2RNAc67oei4/i_/jF/jO),7c153394(PRRT_kwDOV2RNAc67o8zW/d/j),88ff3282(PRRT_kwDOV2RNAc67pU3Y/e/m/q),be0a9317(PRRT_kwDOV2RNAc67pqv1,PRRT_kwDOV2RNAc67pqv7),8136ff76(PRRT_kwDOV2RNAc67qGz1),c4bb9d95(PRRT_kwDOV2RNAc67qYmN/S/U,PRRT_kwDOV2RNAc67qas6),2e8d559c(PRRT_kwDOV2RNAc67rQES,PRRT_kwDOV2RNAc67rRKq,PRRT_kwDOV2RNAc67rRKY,PRRT_kwDOV2RNAc67rRKc,PRRT_kwDOV2RNAc67rRKh,PRRT_kwDOV2RNAc67rRKk),3bc694f6(PRRT_kwDOV2RNAc67sDWf,PRRT_kwDOV2RNAc67sDWs),e1dd173b(PRRT_kwDOV2RNAc67sgT5),36ecc1a9(PRRT_kwDOV2RNAc67tITU),ddb89b0b(PRRT_kwDOV2RNAc67tin_,PRRT_kwDOV2RNAc67tioE,PRRT_kwDOV2RNAc67uDPn),ca05cbef(PRRT_kwDOV2RNAc67t_7Y,PRRT_kwDOV2RNAc67t_7d),8c8ae695,a45f7644(PRRT_kwDOV2RNAc67uZos,PRRT_kwDOV2RNAc67uZxP),7ef5f910(PRRT_kwDOV2RNAc67u2Rh,PRRT_kwDOV2RNAc67u6aV),5aed8309(PRRT_kwDOV2RNAc67vD5g),c407d1f7(PRRT_kwDOV2RNAc67zG1k),a41a3b61(PRRT_kwDOV2RNAc67zkEJ,PRRT_kwDOV2RNAc67zkEX),5fcd4d3d(PRRT_kwDOV2RNAc670YfQ,PRRT_kwDOV2RNAc670YfW,PRRT_kwDOV2RNAc670Yfa),79a77c39(PRRT_kwDOV2RNAc671Lqz),c48e4290(PRRT_kwDOV2RNAc671w9t,PRRT_kwDOV2RNAc671w94),583ac1d3(PRRT_kwDOV2RNAc672bN8,PRRT_kwDOV2RNAc672bOF),a8c13900(PRRT_kwDOV2RNAc673Exc,PRRT_kwDOV2RNAc673ExU),ad970e5d(PRRT_kwDOV2RNAc673qT5),472a6c42(PRRT_kwDOV2RNAc674gAl,PRRT_kwDOV2RNAc674gAg, plus half-day prior-close extraction &run_production_cycledirect-config guard),b8de8ae3(PRRT_kwDOV2RNAc674l91: monotonic total connect/TLS/header/body/error-body HTTP deadlines & Cloud Run reporting reserve),8f3fba55(PRRT_kwDOV2RNAc675CO1lease/byte-fenced transaction rollback &PRRT_kwDOV2RNAc675CPDmulti-tier O1/O2 fail-closed guard before sizing),291573de(PRRT_kwDOV2RNAc675yIQ: crash-safe partial fallback lease/reclaim cleanup and grace-window CAS recovery),9f7cec1a(PRRT_kwDOV2RNAc676Dwjsignals[0,1]O1 validation &PRRT_kwDOV2RNAc676Dwo_DeadlineSocketProxyper-socket-read deadline enforcement),5ffcea0b(PRRT_kwDOV2RNAc676aSQ: exclusiveseq_NNNNNN.record.jsonand detached.ots/.receiptpublication via_publish_exclusive_file), and0cddff24(PRRT_kwDOV2RNAc676zyT: exclusively published append-only<anchor>.v<N>.jsontrusted-head anchor history slots protecting external rollback defense across separate hosts).docker builddid not run locally (no Docker daemon in local environment; Dockerfile and Cloud Run job spec verified statically + direct module execution).Why
Delivers the complete
SHADOW-N SH-2offline software layer onShadowResearchmainbindingFuseControlFUSE-1,csa22-v2, US23/5close isolation, ledger-bound state & authenticated production history integrity, and secret-free Cloud Run Jobs containerization ahead of owner-gated cloud deployment (OA-3) andCLK-01unlock (OA-SH2-2).Risk
Tier: R2 / High-rigor shadow risk-engine integration & fail-closed forward-clock scaffolding (
production_chain_locked=true,orders_placed=0,live=OFF,kelly=OFF,H="0").config/production-scheduler.jsonkeepsproduction_chain_locked: trueandclk01_active: false, guaranteeing zero production ledger writes or clock activation until explicit ownerOA-SH2-2sign-off in a separate gated change.main; existingSH-1drill chains andcsa22-v1/csa22-v2specs remain unchanged and backward-compatible.