Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b26457c
feat(fuse): add vendored FUSE-1 adapter and per-tier sizing isolation
Pigbibi Nov 25, 2026
970fd37
feat(feeder): isolate US 23/5 official close and bound upstream HTTP
Pigbibi Nov 25, 2026
c98525e
feat(ledger): bind FUSE row state to ledger and authenticate history
Pigbibi Nov 25, 2026
3d95bf7
feat(cloudrun): add Cloud Run job packaging and SH-2 acceptance pack
Pigbibi Nov 25, 2026
5b63a6e
chore: merge main after SH-2 part 1 (#8)
Pigbibi Nov 26, 2026
d10093c
fix(fuse): honor O5 settled-cash alias, V7 session time, pyc flags
Pigbibi Nov 26, 2026
1b94f66
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
a4d6d63
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
bc05b02
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
649007c
fix(fuse): keep O5 counter aliases, forward H, drop return-as-loss
Pigbibi Nov 26, 2026
a190c08
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
5751780
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
a986877
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
a9d93ba
docs(fuse): document O3 model self-reconciliation in Stage N
Pigbibi Nov 26, 2026
0cb490f
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
307f2d5
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
d77ff3a
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
fcc30ce
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
e830ae9
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
b0e285a
fix(fuse): preserve explicitly null O5 session counters
Pigbibi Nov 26, 2026
85fe1a3
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
0236a00
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
7f07789
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
9137a64
fix(fuse): compare pyc code structurally and keep null settled cash
Pigbibi Nov 26, 2026
07b61e6
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
7c05d1e
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
78e8ed4
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
9734174
fix(fuse): resolve Astra P1s in adapter inputs and engine loading
Pigbibi Nov 26, 2026
f1ba4f6
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
f36cf13
test(ledger): give hand-built market records an effective session
Pigbibi Nov 26, 2026
9abb9fa
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
f85af85
fix(fuse): label adapter self-heartbeat with heartbeat_source
Pigbibi Nov 26, 2026
bf62dd2
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
2de1849
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
8420ad5
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
c221b30
docs(fuse): document EOD half-day O2 mapping and pin it with a test
Pigbibi Nov 26, 2026
4f00351
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
4000216
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
3564135
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
8a78f15
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
052c107
fix(fuse): resolve Astra round-2 P1s and default substitutions
Pigbibi Nov 26, 2026
736756d
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
e98fa48
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
56dc31c
test(ledger): align hand-built records with session validation
Pigbibi Nov 26, 2026
94f9aa4
fix(fuse): compare caller and market closes by decimal value
Pigbibi Nov 26, 2026
f205738
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
aa2c01a
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
4a86abb
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
cd7a2c1
fix(fuse): resolve Astra round-3 safety P1s in adapter and evaluator
Pigbibi Nov 26, 2026
46af4b8
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
63645df
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
c5f5d2b
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
f75ca8b
fix(fuse): guard source dates at evaluator, keep unknown shares None
Pigbibi Nov 26, 2026
4ec7887
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
40a68ea
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
534a286
chore: merge earlier SH-2 part into this part
Pigbibi Nov 26, 2026
ff1aa94
chore(sh2): merge origin/main (SH-2 4/5) into Part 5 acceptance branch
Pigbibi Nov 26, 2026
a499535
fix(sh2): harden acceptance checks, offline OTS, Cloud Run volume UID
Pigbibi Nov 26, 2026
31e5662
fix(sh2): resolve Astra Round 2 P0 group name, remove image data dir,…
Pigbibi Nov 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git/
**/__pycache__/
*.pyc
*.pyo
data/
.pytest_cache/
docs/audits/
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Secret-free Cloud Run Jobs (us-east1) container image for SHADOW-N SH-2
FROM python:3.13-slim-bookworm

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app/src \
TZ=UTC \
SHADOW_CONFIG_PATH=/app/config/production-scheduler.json

# Debian base already reserves group 'shadow' (GID 42); use 'shadowapp' with UID/GID 10001 to match GCS FUSE mountOptions
RUN groupadd --gid 10001 shadowapp \
&& useradd --uid 10001 --gid 10001 --create-home --shell /usr/sbin/nologin shadowapp \
&& mkdir -p /app

WORKDIR /app

COPY --chown=root:root src/ /app/src/
COPY --chown=root:root vendor/ /app/vendor/
COPY --chown=root:root specs/ /app/specs/
COPY --chown=root:root config/ /app/config/

# Enforce read-only vendored engine permissions (0444 files / 0555 directories)
RUN find /app/vendor/fuse_engine -type f -exec chmod 0444 {} + \
&& find /app/vendor/fuse_engine -type d -exec chmod 0555 {} +

USER shadowapp

ENTRYPOINT ["python3", "-B", "-m", "shadow.cloudrun_job"]
18 changes: 17 additions & 1 deletion demo/run_sh2_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
save_row_state_snapshot,
)
from shadow.manifest import compute_code_manifest_hash # noqa: E402
from shadow.ots import build_synthetic_ots_fixture # noqa: E402
from shadow.ots import OpenTimestampsClient, build_synthetic_ots_fixture # noqa: E402
from shadow.replay import replay_window # noqa: E402
from shadow.scheduler import ( # noqa: E402
load_production_scheduler_config,
Expand Down Expand Up @@ -587,11 +587,17 @@ def run_all_demos() -> dict[str, dict]:
fuse_spec_version=PINNED_FUSE_SPEC_VERSION,
fuse_engine_hash=PINNED_FUSE_ENGINE_HASH,
)
class _DemoOfflineOts(OpenTimestampsClient):
def stamp_digest(self, sha256_hex: str) -> tuple[bytes, str]:
ots_b, _ = build_synthetic_ots_fixture(sha256_hex, bitcoin_height=880100)
return ots_b, "https://a.pool.opentimestamps.org"

res_d7 = run_daily_drill_cycle(
session_date="2026-01-05",
data_dir=ddir,
config=base_cfg,
fixtures_dir=fdir,
ots_client=_DemoOfflineOts(),
wall_clock=lambda: datetime(2026, 1, 5, 22, 30, tzinfo=timezone.utc),
evaluator=ev,
)
Expand Down Expand Up @@ -626,11 +632,19 @@ def run_all_demos() -> dict[str, dict]:
fdir = Path(tmpdir) / "fixtures"
_build_session_fixture_files(fdir, "2026-01-05")
wc = lambda: datetime(2026, 1, 5, 22, 30, tzinfo=timezone.utc)

class _CloudRunOfflineOts(OpenTimestampsClient):
def stamp_digest(self, sha256_hex: str) -> tuple[bytes, str]:
ots_b, _ = build_synthetic_ots_fixture(sha256_hex, bitcoin_height=880100)
return ots_b, "https://a.pool.opentimestamps.org"

d9_ots = _CloudRunOfflineOts()
first = run_cloudrun_job(
data_dir=cdir,
config_path=REPO_ROOT / "config" / "drill-scheduler.json",
session_date="2026-01-05",
fixtures_dir=fdir,
ots_client=d9_ots,
wall_clock=wc,
)
assert first["status"] == "committed" and first["appended"] is True
Expand All @@ -641,6 +655,7 @@ def run_all_demos() -> dict[str, dict]:
config_path=REPO_ROOT / "config" / "drill-scheduler.json",
session_date="2026-01-05",
fixtures_dir=fdir,
ots_client=d9_ots,
wall_clock=wc,
)
f2 = pool.submit(
Expand All @@ -649,6 +664,7 @@ def run_all_demos() -> dict[str, dict]:
config_path=REPO_ROOT / "config" / "drill-scheduler.json",
session_date="2026-01-05",
fixtures_dir=fdir,
ots_client=d9_ots,
wall_clock=wc,
)
r_c1, r_c2 = f1.result(), f2.result()
Expand Down
99 changes: 99 additions & 0 deletions deploy/cloudrun/job-spec.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Secret-free Cloud Run Job specification example for SHADOW-N SH-2 (us-east1)
# Replace <project-id>, <repo>, <tag>, <service-account>, and <bucket-name> before deploy.
# Keep config/production-scheduler.json production_chain_locked=true until OA-SH2-2 sign-off.
# Single-writer concurrency discipline: maxRetries: 0, parallelism: 1, and taskCount: 1 only
# limit concurrency within one Cloud Run execution. Launching multiple overlapping executions (e.g.
# duplicate Cloud Scheduler triggers or manual runs while a prior execution is still active) is NOT
# serialized by Cloud Run or GCS FUSE O_EXCL (which lacks pre-close creation atomicity). Production
# deployment MUST gate execution launches behind an execution-lifecycle lock (rejecting any new
# run while an execution is active) OR mount POSIX-locking storage (e.g. Cloud Filestore) / use
# storage-native GCS ifGenerationMatch=0 lease objects before enabling writes on the ledger.
# Production history authentication:
# - One-time genesis initialization (seq=0 on empty SHADOW_DATA_DIR): set
# SHADOW_TRUSTED_HEAD_SHA256="0000000000000000000000000000000000000000000000000000000000000000"
# (GENESIS_PREV_HASH) once, then replace or remove it after seq=0 commits.
# - Recurring runs & retries (seq >= 1): ALWAYS set SHADOW_TRUSTED_HEAD_SHA256 (e.g., via Secret
# Manager) to the externally authorized committed head digest (for both advancing runs and
# same-session retries) WITHOUT keeping the zero genesis marker; ALWAYS set
# SHADOW_TRUSTED_PENDING_STATE_SHA256 on every production run (0*64 NO_PENDING_REJECTED_STATE_SHA256
# when no unconsumed rejection exists, or the emitted pending_rejected_state_sha256 after any
# O1/O2/deadline/OTS rejection until a committed session retires it); AND mount
# SHADOW_TRUSTED_HEAD_ANCHOR_PATH on a separate dedicated GCS anchor bucket outside SHADOW_DATA_DIR
# so each committed record or persisted pending state atomically advances a monotonic external
# head anchor and blocks state-bucket rollback even if secret rotation lags; optional
# SHADOW_BITCOIN_MERKLE_ROOTS_PATH adds corroborating OTS verification.
apiVersion: run.googleapis.com/v1
kind: Job
metadata:
name: shadow-sh2-eod-job
namespace: "<project-id>"
labels:
cloud.googleapis.com/location: us-east1
component: shadow-sh2
spec:
template:
metadata:
annotations:
run.googleapis.com/execution-environment: gen2
spec:
parallelism: 1
taskCount: 1
template:
spec:
maxRetries: 0
timeoutSeconds: 300
serviceAccountName: "<service-account>@<project-id>.iam.gserviceaccount.com"
containers:
- image: "us-east1-docker.pkg.dev/<project-id>/<repo>/shadow-sh2:<tag>"
env:
- name: SHADOW_DATA_DIR
value: /var/lib/shadow/data
- name: SHADOW_CONFIG_PATH
value: /app/config/production-scheduler.json
- name: SHADOW_CHAIN_MODE
value: production
# Genesis requires GENESIS_PREV_HASH (0*64); recurring chains always require authorized head SHA-256:
# - name: SHADOW_TRUSTED_HEAD_SHA256
# valueFrom:
# secretKeyRef:
# name: shadow-trusted-head-sha256
# key: latest
# - name: SHADOW_TRUSTED_PENDING_STATE_SHA256
# valueFrom:
# secretKeyRef:
# name: shadow-trusted-pending-state-sha256
# key: latest
# - name: SHADOW_TRUSTED_HEAD_ANCHOR_PATH
# value: /var/run/shadow/anchor/trusted_head.json
# - name: SHADOW_BITCOIN_MERKLE_ROOTS_PATH
# value: /var/run/shadow/trusted/bitcoin-merkle-roots.json
- name: TIINGO_API_KEY
valueFrom:
secretKeyRef:
name: tiingo-api-key
key: latest
resources:
limits:
cpu: "1"
memory: 512Mi
volumeMounts:
- name: shadow-state
mountPath: /var/lib/shadow/data
# Dedicated separate anchor bucket mount strictly outside /var/lib/shadow/data:
# - name: shadow-anchor
# mountPath: /var/run/shadow/anchor
volumes:
- name: shadow-state
csi:
driver: gcsfuse.run.googleapis.com
readOnly: false
volumeAttributes:
bucketName: "<bucket-name>"
mountOptions: "uid=10001,gid=10001,implicit-dirs"
# - name: shadow-anchor
# csi:
# driver: gcsfuse.run.googleapis.com
# readOnly: false
# volumeAttributes:
# bucketName: "<anchor-bucket-name>"
# mountOptions: "uid=10001,gid=10001,implicit-dirs"
5 changes: 5 additions & 0 deletions deploy/scheduler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Deprecated Mac mini / Launchd / Systemd Templates (Superseded by Item 18)

The host templates in this directory (`shadow-drill.*`, `shadow-missed-run.*`, `shadow-watchdog.sh`, and `.plist` files) were authored for the retired Mac mini (`SH-1`) topology and are **deprecated / superseded** per Roadmap Item 18.

Do not deploy these units to a workstation or Mac mini host. For `SH-2` runtime execution, use the secret-free GCP Cloud Run Jobs (`us-east1`) container and template under [`deploy/cloudrun/`](../cloudrun/) (`Dockerfile` + `shadow.cloudrun_job`). These archived templates remain solely so existing SH-1 unit tests (`tests/test_scheduler.py`) stay passing.
8 changes: 7 additions & 1 deletion docs/sh1-scheduler-runbook.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# SH-1 Drill-Chain Scheduler & Runbook
# SH-1 Drill-Chain Scheduler & Runbook (Deprecated / Superseded by Item 18)

> **Deprecation / Supersession Notice (Item 18):** Mac mini / Asia-Singapore runtime templates
> in [`deploy/scheduler/`](../deploy/scheduler/) and this SH-1 host layout are permanently
> retired for runtime operations. All SH-2 execution targets secret-free GCP Cloud Run Jobs
> (`us-east1`); see [`docs/sh2-cloudrun-runbook.md`](sh2-cloudrun-runbook.md). Existing
> `deploy/scheduler/` files remain archived solely for SH-1 offline test compatibility.

This runbook covers the AI-independent daily drill-chain scheduler (`OA-SH1-6`, **drill chain only**; `CLK-01` remains inactive until `SH-2`).

Expand Down
48 changes: 48 additions & 0 deletions docs/sh2-acceptance-pack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SH-2 Acceptance Pack (`SH2-A01`–`SH2-A14`) & Runtime Architecture

- **Branch:** `feat/sh2-live-engine`
- **Standing Safety Locks:** `live=OFF`, `kelly=OFF`, `kelly_applied=false`, `orders_placed=0`, `loss_breakers_armed=false`, `enforcement_mode="shadow_would_have_tripped"`, `H="0"`, `B0="50000"`, `stop_loss_return_rule="OFF"`, `production_chain_locked=true` (`OA-SH2-2` locked; `clk01_active=false`).

## 1. Pinned Upstream & Production Identities

| Artifact | Value |
| --- | --- |
| Upstream `FuseControl` commit | `46a86eedb0d33f6133a066edeb8c3660cda9097d` (`main`) |
| `fuse_spec_version` | `fuse-eval-spec/v1` |
| `fuse_engine_hash` | `12e9b502367a4993d0c36e75ac5c8d24acaee2d1247c5b594796d5adda04ca45` |
| `fuse_bundle_hash` | `78fed9dfc9b0b0a618fce6bb5a956063135f34845545e6a5154a32e119354cc9` |
| `fuse_freeze_hash` | `1da74ca508161ba6d9a424101321381a9f5156d8cb2c84c03be2fd2fe3f22a74` |
| `csa22-v2` `spec_digest` | `2ba8cd7684c361209df68bfa2e10004c1f9922a645c7ec55d421fda520561798` |
| `production_code_version_sha` | `31eca529ef5b26f5918c8847bbb758966f7aa9e0fd4186973845c3ee9bc2f7e7` |
| `production_policy_config_hash` | `4d37bc9713f45a4b85673b46dd0ed048f572092ac60619cc2901ce0b4dfad150` |
| Production config | [`config/production-scheduler.json`](../config/production-scheduler.json) (`chain_id="prod-sh2-v1"`, `mode="production"`, `production_chain_locked=true`, `clk01_active=false`) |
| Deployment target (Item 18) | Secret-free GCP Cloud Run Jobs (`us-east1`); legacy Mac mini units marked deprecated |

## 2. Offline Acceptance Matrix (`SH2-A01`–`SH2-A14`)

Reproduced offline via `PYTHONPATH=src python3 -m shadow.sh2_acceptance` and `demo/run_sh2_demo.py`:

| Row | Status | Verified Scope |
| --- | --- | --- |
| `SH2-A01` | `PASS_OFFLINE` | Entry gates `F1-A01` (`24/24` IDs), `F1-A03` (`264/264`), `F1-A04` (`132/132`), `F1-A10` (`13/13`), `F1-A11` (`['O5', 'V5', 'V7']` `UNRESOLVED-FAIL-CLOSED`), and `SH1-ACCEPTANCE.json` (`20be23f1ce4f4f23bd2f863aef43213894947bf3`) verified. |
| `SH2-A02` | `PASS_OFFLINE` | Vendored 8-file package verified offline by source digest and `__pycache__/*.pyc` match (`12e9b502...`); [`Dockerfile`](../Dockerfile) declares `chmod 0444` (container build permissions unbuilt locally without Docker daemon). |
| `SH2-A03` | `PASS_OFFLINE` | Structural `StubEvaluator` and `stub-*` hash quarantine verified on production `build_record_body`, `replay_window`, and `run_production_cycle`. |
| `SH2-A04` | `PASS_OFFLINE` | Zero conformance shims or fabricated sources/returns: omitted `positions`/`broker_reconciliation`/`index_one_session_returns` fail `O1` closed, feeder `corporate_action` (`split_ratio`/`cash_per_share_usd`) wires into `V2`, `NO-NEW-RISK` clamps + per-fund sizing isolation hold, `U-01` unresolved parameters stay fail-closed (`['O5', 'V5', 'V7']`), `live` mode fails verbatim, and 1-byte source/bytecode tamper fails pre-`evaluate()`. |
| `SH2-A05` | `PASS_OFFLINE` | Upstream caller schema enforces explicit boolean `hwm_adjusted` whenever `corporate_action.adjustment_complete=true` (`V2PayloadSchemaError` before `evaluate()`); explicit `false` triggers FUSE-1 `V2` `HALT`. |
| `SH2-A06` | `PASS_OFFLINE` | `csa22-v2` verified by digest (`2ba8cd76...`) and pinned `calendar_spec_digest` mismatch rejection, covering 2026 holidays (`2026-07-03` closed) and early closes (`2026-11-27`, `2026-12-24` at `13:00` ET). |
| `SH2-A07` | `PASS_OFFLINE` | US `23/5` `16:00` ET Official Close isolation & post-`21:00` ET `T+1` clearing boundary enforced across calendar, Tiingo (`row["timestamp"]` midnight rejection), Yahoo (`dataGranularity` non-daily rejection), and market record validation (`Item 13`). |
| `SH2-A08` | `PASS_OFFLINE` | Atomic commit-staged `state_snapshots/` bound to committed `evaluator.next_row_state_sha256` (plus `pending_rejected_state.json` carrying ledger-bound `base_prior_row_state` with elapsed-day monotonic latch/counter preservation including 10th-session `V4` clearing, external `SHADOW_TRUSTED_PENDING_STATE_SHA256` authentication on production consumption, retirement of superseded pending files on committed-session retry, uncommitted pre-marker snapshot pruning/recovery of `latest.state.json` from committed ledger head, and deterministic recovery on `already_committed_session_preserved`) prevents forged state downgrades across restarts. |
| `SH2-A09` | `PASS_OFFLINE` | `python3 -m shadow.cloudrun_job` (`us-east1`, `Item 18`) enforces strict boolean config validation, forbids `fixtures_dir` in production, removes `unlock_production_override`, requires external monotonic `SHADOW_TRUSTED_HEAD_ANCHOR_PATH` outside `SHADOW_DATA_DIR` (atomically advancing on each commit and persisted pending state to reject state-bucket rollback before secret rotation), explicit `GENESIS_PREV_HASH` for one-time genesis, mandatory `SHADOW_TRUSTED_HEAD_SHA256` matching both the anchor and current committed head across advancing runs and same-session retries (with `SHADOW_BITCOIN_MERKLE_ROOTS_PATH` as corroborating OTS check), and mandatory `SHADOW_TRUSTED_PENDING_STATE_SHA256` on every advancing production run (`0*64` `NO_PENDING_REJECTED_STATE_SHA256` when clean or `pending_rejected_state_sha256` after a rejection) with post-head rejected report cross-check against tamper, substitution, deletion, rollback, or wiped buckets (`exit 3` on failure), guarantees `already_committed_no_op` idempotency (`<= 1` append/session), and fences concurrent writers via CAS-reclaimed `.chain.lease.json` (`ChainConcurrencyConflictError`, exit `4`). |
| `SH2-A10` | `PASS_OFFLINE` | `replay_window()` deterministically re-derives vendored `FUSE-1` ledger records (including `fuse_context` immediate-prior trading session closes and `prior_row_state_used`) bit-for-bit without `StubEvaluator`. |
| `SH2-A11` | `PASS_OFFLINE` | Default `config/production-scheduler.json` remains structurally locked (`production_chain_locked=true`, `clk01_active=false`, `OA-SH2-2` blocks appends with `0` writes). |
| `SH2-A12` | `PASS_OFFLINE` | Forward-clock creditability verifies OTS BTC proof, `engine_hash`/`spec_version`, and `observation_class="decision_time_market"` when unlocked via `mode="production"` `config_path`, and fails closed by default when locked or given non-production configs. |
| `SH2-A13` | `PASS_OFFLINE` | Secret-free [`Dockerfile`](../Dockerfile) (`shadowapp` UID/GID `10001`, no default `SHADOW_DATA_DIR`, `chmod 0444` vendor, `-B` bytecode guard) and [`deploy/cloudrun/job-spec.example.yaml`](../deploy/cloudrun/job-spec.example.yaml) (`us-east1`, `maxRetries: 0`, explicit `SHADOW_DATA_DIR` mount with `uid=10001,gid=10001`, Secret Manager ref, execution-lifecycle single-writer requirement) verified statically. |
| `SH2-A14` | `PASS_OFFLINE` | Standing locks enforced across [`config/production-scheduler.json`](../config/production-scheduler.json) and emitted tiers/assertions (`H="0"`, `B0="50000"`, `orders_placed=0`, `kelly=OFF`, `live=OFF`); tracked text scan confirms zero matches for the three checked host-path/PEM patterns (`0` violations; full secret scanning is performed by CI Gitleaks/GitGuardian). |

## 3. Design Demonstration Summary (`D1`–`D10`)

`python3 demo/run_sh2_demo.py` passes `10/10` covering entry gates (`D1`), core swap + tamper + `hwm_adjusted` negative controls (`D2`), FUSE-1 breaker transitions `NO-NEW-RISK`/`DE-RISK`/`HALT` (`D3`), fresh-subprocess `state_snapshots/` restart (`D4`), `OA-SH2-2` locked production guard (`D5`), zero conformance shims / zero fabricated sources (`D6`), bit-for-bit replay (`D7`), `csa22-v2` + `23/5` `16:00 ET` isolation (`D8`), Cloud Run concurrent/sequential retry idempotency (`D9`), and default-locked vs config-unlocked mock-HTTP OTS creditability (`D10`).

## 4. Verification Scope Notes

- Local Docker daemon binary is not installed in this development workspace; container runtime semantics are verified via [`Dockerfile`](../Dockerfile) static inspection and direct execution of the identical `python3 -B -m shadow.cloudrun_job` entrypoint under stripped environment variables.
Loading
Loading