You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SH-2 adapter/sizing hardening: P2 follow-ups from Astra review of #9 #12
P2 findings from the local Codex gpt-6.2-astra (high) adversarial review of #9 @ 9137a64. Per the SH-2 split policy, P2s are tracked here and not fixed in the part PR. The P1s from the same review were fixed in #9 (commit 9734174, with regression tests).
Host-path-independent config identity.compute_code_manifest_hash() hashes explicit config paths by repo-relative path, or external/<abs path> outside the repo, so the identity depends on the host path.
Decimal precision pinning. Pin a decimal context (precision and rounding) for sizing and adapter arithmetic, so results do not depend on the ambient context.
BIL quote evidence. BIL is whitelisted for O5 but has no quote or eligibility evidence path.
Frozen-holding exact share target (sizing.py:684). The target share count for frozen holdings should equal the held quantity exactly.
Numeric overflow. Bound float conversions of very large Decimal inputs (exposure, notional) so they cannot overflow to inf.
Fund-level pending orders for O4. Accept and validate per-fund pending_orders evidence, not only the account-level map.
Decimal-bound failures in sizing validation. Make sure out-of-bound decimals (canonical_decimal_str bounds) raise SizingInputError and fail closed consistently.
Valid bytecode cache through evaluator init. Add a test that loads VendoredFuseEvaluator with a legitimate __pycache__ present, covering the full init path, not only verify_vendored_engine_bundle().
Acceptance: each item gets a regression test, and the full suite plus python -m shadow.sh2_acceptance stay green.
More items from the final safety-class Astra pass on #9 @ cd7a2c1. None of these block, and none fail open:
fuse_adapter._compute_return_ratio (around :793): a nonpositive current close becomes a -100% return and latches L6 HALT. It should be reported to O1 as missing or invalid data. This fails safe (it HALTs), but it misattributes the cause.
Compare corporate-action amounts in one canonical numeric form (ratio and cash_per_share_usd as float vs Decimal vs str).
Quote evidence for proposed non-fund symbols (e.g. BIL) before O5 or sizing accept them.
Tracked bytecode vs local caches: decide and document whether any __pycache__ may exist under vendor/ at runtime. Loading already ignores caches.
Frozen-holding targets in integer shares, equal to the held quantity (repeat of an earlier item).
Repeats from earlier passes that are already listed here.
Deferred P2 items from local Codex gpt-6.2-astra (high) review of SH-2 part 3 (feat/sh2-part3-close-isolation) per SH-2 split review policy:
Parse JSON numbers as Decimal before float rounding (src/shadow/feeder.py Tiingo/Yahoo/NYFed parsers): decode JSON numbers with parse_float=Decimal / parse_int=Decimal (or preserve original text) before _parse_finite_decimal, so boundary values like 1000000000.000000001 or 1e-400 are not rounded to 1000000000.0 / 0.0 before validation.
Calendar overnight window across adjacent trading days (src/shadow/calendar_consumer.py:345-352): classify_us_equity_session_window should determine extended_overnight_open vs closed using the target trading session (e.g., Sunday 21:00 ET opens into Monday's trading session; Friday 21:00 ET and pre-holiday evenings are closed).
Thread monotonic deadlines into live fetch and OTS client (src/shadow/scheduler.py / src/shadow/feeder_live.py): pass remaining budget from decision_cutoff_utc / commitment_deadline_utc as deadline_monotonic into emit_live_market_records and OpenTimestampsClient so 429 backoffs and OTS retries stop when the budget expires.
Additional deferred P2 items from Astra Round 2 on SH-2 part 3 (feat/sh2-part3-close-isolation) per SH-2 split review policy:
Pass calendar_session in direct adapter fetch_daily calls (src/shadow/feeder_live.py): TiingoDailyAdapter.fetch_daily() and YahooChartAdapter.fetch_daily() parse payloads without passing calendar_session, falling back to 16:00 close on half days.
Reject Yahoo multi-bar intraday payloads without dataGranularity (src/shadow/feeder.py:489-491 & prior-close helper): when meta.dataGranularity is absent and multiple RTH bars exist for one session, do not pick the last bar by array order.
Thread YahooChartAdapter(deadline_monotonic=...) into default transport (src/shadow/feeder_live.py:452-455): pass adapter's deadline_monotonic into urllib_fetch_bytes on both initial request and 429 retries.
Deferred non-blocking P2s from SH-2 Part 4 Astra Round 1 review:
src/shadow/scheduler.py:1791-1795: consecutive_session_scope labels clk01_forward_clock before receipt/Bitcoin creditability verification completes.
src/shadow/scheduler.py:2035-2038 / _summarize_committed_receipt: production mode reuses drill receipt reason label drill_mode instead of ots_pending_bitcoin_confirmation or similar mode-accurate reason.
src/shadow/ledger.py:3504-3508: _assert_pending_state_preserves_committed_breakers skips _by_tier check when pending_state omits _by_tier (kept compatible with single-tier ev.evaluate callers in test_sh2_pipeline.py).
Deferred non-blocking P2s from SH-2 Part 4 Astra Round 2 review:
src/shadow/scheduler.py:2030-2034: run_production_cycle(config=...) direct config-object path checks evaluator identity; unify pinned config fuse_engine_hash/fuse_spec_version and strict bool clk01_active validation with load_production_scheduler_config.
src/shadow/scheduler.py:4233-4237: include decision-time fuse_context source evidence (positions_source_record.as_of, etc.) inside compute_inputs_digest() and verify on replay.
tests/test_sh2_pipeline.py:503-507: inject offline OTS mock client in remaining fixture-based tests so offline runs never wait on public OTS calendars.
Deferred non-blocking P2s from SH-2 Part 5 Astra Round 2 review:
tests/test_cloudrun_job.py:103-107: inject synthetic offline OTS client in Cloud Run unit tests so fixtures_dir drill tests do not invoke default OpenTimestampsClient network calendars.
src/shadow/sh2_acceptance.py:152-155: catch AssertionError / CalledProcessError from run_all_demos() and emit structured overall_status: "FAILED" JSON instead of propagating traceback.
src/shadow/sh2_acceptance.py:308-309: verify computed production_code_version_sha and production_policy_config_hash against documented/independent pinned values rather than only echoing computed values under pinned_identities.
Activity
Pigbibi commentedon Nov 26, 2026
More P2s from the Astra review of #9, rounds 2 and 3. These are tracked here under the SH-2 split policy; round-3 P1s were fixed in #9.
proposed_exposureto the effective exposure. The L0 two-pass check against the real proposal is in O7: ledger supplies last_heartbeat from previous committed record #13's part-4 scope.eligible is True(strictly) and a finite market value.Generated by Claude Code
Pigbibi commentedon Nov 26, 2026
More items from the final safety-class Astra pass on #9 @ cd7a2c1. None of these block, and none fail open:
fuse_adapter._compute_return_ratio(around :793): a nonpositive current close becomes a -100% return and latches L6 HALT. It should be reported to O1 as missing or invalid data. This fails safe (it HALTs), but it misattributes the cause.ratioandcash_per_share_usdas float vs Decimal vs str).__pycache__may exist undervendor/at runtime. Loading already ignores caches.Generated by Claude Code
Pigbibi commentedon Nov 26, 2026
Deferred P2 items from local Codex
gpt-6.2-astra(high) review of SH-2 part 3 (feat/sh2-part3-close-isolation) per SH-2 split review policy:Decimalbefore float rounding (src/shadow/feeder.pyTiingo/Yahoo/NYFed parsers): decode JSON numbers withparse_float=Decimal/parse_int=Decimal(or preserve original text) before_parse_finite_decimal, so boundary values like1000000000.000000001or1e-400are not rounded to1000000000.0/0.0before validation.src/shadow/calendar_consumer.py:345-352):classify_us_equity_session_windowshould determineextended_overnight_openvsclosedusing the target trading session (e.g., Sunday 21:00 ET opens into Monday's trading session; Friday 21:00 ET and pre-holiday evenings are closed).src/shadow/scheduler.py/src/shadow/feeder_live.py): pass remaining budget fromdecision_cutoff_utc/commitment_deadline_utcasdeadline_monotonicintoemit_live_market_recordsandOpenTimestampsClientso 429 backoffs and OTS retries stop when the budget expires.Pigbibi commentedon Nov 26, 2026
Additional deferred P2 items from Astra Round 2 on SH-2 part 3 (
feat/sh2-part3-close-isolation) per SH-2 split review policy:calendar_sessionin direct adapterfetch_dailycalls (src/shadow/feeder_live.py):TiingoDailyAdapter.fetch_daily()andYahooChartAdapter.fetch_daily()parse payloads without passingcalendar_session, falling back to 16:00 close on half days.dataGranularity(src/shadow/feeder.py:489-491& prior-close helper): whenmeta.dataGranularityis absent and multiple RTH bars exist for one session, do not pick the last bar by array order.YahooChartAdapter(deadline_monotonic=...)into default transport (src/shadow/feeder_live.py:452-455): pass adapter'sdeadline_monotonicintourllib_fetch_byteson both initial request and 429 retries.Pigbibi commentedon Nov 26, 2026
Deferred non-blocking P2s from SH-2 Part 4 Astra Round 1 review:
src/shadow/scheduler.py:1791-1795:consecutive_session_scopelabelsclk01_forward_clockbefore receipt/Bitcoin creditability verification completes.src/shadow/scheduler.py:2035-2038/_summarize_committed_receipt: production mode reuses drill receipt reason labeldrill_modeinstead ofots_pending_bitcoin_confirmationor similar mode-accurate reason.src/shadow/ledger.py:3504-3508:_assert_pending_state_preserves_committed_breakersskips_by_tiercheck whenpending_stateomits_by_tier(kept compatible with single-tierev.evaluatecallers intest_sh2_pipeline.py).Pigbibi commentedon Nov 26, 2026
Deferred non-blocking P2s from SH-2 Part 4 Astra Round 2 review:
src/shadow/scheduler.py:2030-2034:run_production_cycle(config=...)direct config-object path checks evaluator identity; unify pinned configfuse_engine_hash/fuse_spec_versionand strict boolclk01_activevalidation withload_production_scheduler_config.src/shadow/scheduler.py:4233-4237: include decision-timefuse_contextsource evidence (positions_source_record.as_of, etc.) insidecompute_inputs_digest()and verify on replay.tests/test_sh2_pipeline.py:503-507: inject offline OTS mock client in remaining fixture-based tests so offline runs never wait on public OTS calendars.Pigbibi commentedon Nov 26, 2026
Deferred non-blocking P2s from
ShadowResearch#15GitHub Codex review (0ffbdca):src/shadow/scheduler.py:3027: invokerecover_pending_evidence()for drill-mode retries too before reconciling completeness reports.src/shadow/ledger.py:875: propagate Pass-2proposed_exposureoverride into nestedfuse_inputspayloads inside_apply_explicit_payload_tier.src/shadow/ledger.py:3600missing_by_tierin pending state already tracked above in this issue.)Pigbibi commentedon Nov 26, 2026
Deferred non-blocking P2s from SH-2 Part 5 Astra Round 2 review:
tests/test_cloudrun_job.py:103-107: inject synthetic offline OTS client in Cloud Run unit tests sofixtures_dirdrill tests do not invoke defaultOpenTimestampsClientnetwork calendars.src/shadow/sh2_acceptance.py:152-155: catchAssertionError/CalledProcessErrorfromrun_all_demos()and emit structuredoverall_status: "FAILED"JSON instead of propagating traceback.src/shadow/sh2_acceptance.py:308-309: verify computedproduction_code_version_shaandproduction_policy_config_hashagainst documented/independent pinned values rather than only echoing computed values underpinned_identities.