Repository navigation
feat(sh2): add Cloud Run deployment spec and SH-2 acceptance pack (SH-2 5/5) - #16
Merged
Merged
Conversation
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
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
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
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
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
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
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> Claude-Session: https://claude.ai/code/session_011iHeYdGvqQh5k2bkN5Eiuq
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI assistance
gpt-6.2-astra, reasoninghigh, 2 local review rounds).What changed
Dockerfile,.dockerignore, UID/GID10001shadowapp, no defaultSHADOW_DATA_DIR) anddeploy/cloudrun/job-spec.example.yaml(us-east1,maxRetries: 0,Secret Managerref, UID-matchedmountOptions).src/shadow/sh2_acceptance.pyimplementingSH2-A01..A14offline acceptance checks (PASS_OFFLINE,10/10, zero network OTS transport calls offline, concreteconfig/production-scheduler.jsonsafety-lock assertions, git-tracked hygiene scan).tests/test_cloudrun_job.py,tests/test_sh2_acceptance.py) plusdocs/sh2-acceptance-pack.mdanddocs/sh2-cloudrun-runbook.md(marking legacy Mac mini units deprecated underdeploy/scheduler/).src/shadow/manifest.pyruntime file list unchanged from SH-2 4/5 and preserve all safety locks (production_chain_locked: true,clk01_active: false,live: OFF,kelly: OFF,H: "0",B0: "50000").How verified
origin/main(SH-2 4/5 feat(ledger): add SH-2 ledger integrity, scheduler, replay, and Cloud Run job (SH-2 4/5) #15) intofeat/sh2-part5-cloudrun-acceptance.PYTHONPATH=src python3 -m shadow.sh2_acceptanceafter final edits:overall_status: PASS_OFFLINE,demo_cases_passed: 10/10,oa_sh2_2_locked: true,hygiene_violations: [], all 14 checksPASS_OFFLINE.PYTHONPATH=src python3 -m unittest discover -s tests->Ran 220 tests in 249.127s OK.Why
OA-SH2-2).Risk
RUNTIME_MODULE_FILESdigests.