Skip to content

Commit 8892373

Browse files
feat(governance): roadmap phases 5-8 first-class, runnable 2028 pilot gates, close dashboard High findings
- Roadmap YAML: promoted extension entries to first-class segments phase_5..phase_8 (2031-2035), each with feasibility_tier, objectives, exit_criteria, and gating preconditions for the Tier C/D phases. 9 phases total; YAML parses clean. - Pilot: governance_artifacts/pilot/run_pilot_acceptance_gates.py operationalizes decadal-plan section 14 as a runnable checklist. Executes the 6 Tier-A gates (terraform validate, OPA gates, PQC WORM tamper, containment TLC, zk relayer, full assurance) and reports 6 Tier-B/hardware gates as PENDING-EVIDENCE with precise criteria (never faked). Current: 6/6 automated gates PASS. + README. - Dashboard security: closed DASH-01/02/03/05/08. * lib/auth/session.ts - HMAC-signed tokens; principal derived server-side only (Bearer/cookie), constant-time sig check, expiry enforced; canAccessSubject authz. * lib/http/guard.ts - 16 KiB body cap + safe JSON parse; SSE/log-injection sanitizer. * consent route: identity bound to authenticated principal (no body userId); export requires ownership or dpo role (IDOR closed). * chat stream route: authn + body cap; unauthenticated GET text-gen removed; moderation 'block' now ENFORCED (suppresses reply); SSE values sanitized. * intent route: authn + body cap + validation. * tests rewritten to assert FIXED behaviour: vitest 14/14 pass (11 security + 3 gov). * DASHBOARD_SECURITY_REVIEW.md status table updated (Resolved/Open). * My new files typecheck clean (0 TS errors); pre-existing repo TS errors untouched. - Decadal plan: noted first-class phases 0-8 and the runnable pilot checklist. Regression: run_runnable_assurance.sh still 11/11 PASS.
1 parent 41f1edf commit 8892373

11 files changed

Lines changed: 759 additions & 107 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 2028 G-SIFI Pilot — Acceptance Gates
2+
3+
`run_pilot_acceptance_gates.py` operationalizes §14 of
4+
`governance_blueprint/DECADAL_STRATEGIC_TECHNICAL_PLAN_2026_2035.md` as a runnable checklist.
5+
6+
```bash
7+
python3 governance_artifacts/pilot/run_pilot_acceptance_gates.py
8+
python3 governance_artifacts/pilot/run_pilot_acceptance_gates.py --json # machine-readable
9+
```
10+
11+
Each of the six monthly pilot gates is one of:
12+
13+
- **AUTOMATED (Tier A):** actually executed against in-repo artifacts (Terraform validate, OPA
14+
gates, PQC WORM tamper test, containment TLC, zk relayer, full assurance suite). The script
15+
reports a real PASS/FAIL.
16+
- **MANUAL (Tier B):** depends on real hardware / vendor accounts / a supervisor. The script does
17+
**not** fake these — it prints the precise acceptance criterion and the evidence the pilot team
18+
must capture, and marks them `PENDING-EVIDENCE`.
19+
20+
**Exit code** is non-zero only if an *automated* gate fails. Manual gates never fail the run
21+
(faking them would violate the program's integrity discipline). The pilot go-decision requires all
22+
automated gates green **and** all manual evidence items collected and signed off.
23+
24+
| Month | Automated gate | Manual / Tier-B gate |
25+
|-------|----------------|----------------------|
26+
| 1 | P1-IAC (terraform validate) | P1-ATTEST (PCR_MATCH=TRUE on real HW) |
27+
| 2 | P2-OPA (policy gates green) | P2-MOE (drift index ≤ 0.1 on live model) |
28+
| 3 | P3-WORM (tamper detected) | P3-GSRI (prod Kafka/S3 Object Lock) |
29+
| 4 | P4-CONTAIN (containment TLC) | P4-MTTC (Red-Dawn MTTC ≤ 60s) |
30+
| 5 | P5-ZK (relayer verifier compiles) | P5-DOSSIER (Annex IV ≥ 98% auto) |
31+
| 6 | P6-REPRO (assurance 11/11) | P6-SUPERVISOR (supervisor sign-off) |
Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
#!/usr/bin/env python3
2+
"""
3+
2028 G-SIFI Pilot — Acceptance-Gate Checklist (runnable).
4+
5+
Operationalizes section 14 ("2028 G-SIFI pilot deployment") of
6+
governance_blueprint/DECADAL_STRATEGIC_TECHNICAL_PLAN_2026_2035.md.
7+
8+
Each of the six monthly pilot gates is either:
9+
* AUTOMATED - verifiable now against in-repo artifacts (feasibility Tier A).
10+
The script actually runs the check and reports PASS/FAIL.
11+
* MANUAL - depends on real hardware / vendor accounts / a supervisor
12+
(Tier B). The script prints the precise acceptance criterion
13+
and the evidence the pilot team must capture; it does not fake
14+
a pass.
15+
16+
Exit code is non-zero ONLY if an AUTOMATED gate fails. MANUAL gates never fail
17+
the run (they are reported as PENDING-EVIDENCE), because faking them would
18+
violate the program's integrity discipline.
19+
20+
Usage:
21+
python3 governance_artifacts/pilot/run_pilot_acceptance_gates.py
22+
python3 .../run_pilot_acceptance_gates.py --json # machine-readable
23+
"""
24+
from __future__ import annotations
25+
26+
import argparse
27+
import json
28+
import os
29+
import subprocess
30+
import sys
31+
from dataclasses import dataclass, field
32+
from pathlib import Path
33+
34+
ROOT = Path(__file__).resolve().parents[2]
35+
GA = ROOT / "governance_artifacts"
36+
37+
# ANSI (suppressed when not a tty)
38+
_TTY = sys.stdout.isatty()
39+
GREEN = "\033[32m" if _TTY else ""
40+
RED = "\033[31m" if _TTY else ""
41+
YEL = "\033[33m" if _TTY else ""
42+
DIM = "\033[2m" if _TTY else ""
43+
RST = "\033[0m" if _TTY else ""
44+
45+
46+
@dataclass
47+
class GateResult:
48+
month: int
49+
gate_id: str
50+
title: str
51+
kind: str # "automated" | "manual"
52+
status: str # "PASS" | "FAIL" | "PENDING-EVIDENCE"
53+
detail: str
54+
criterion: str
55+
evidence: list[str] = field(default_factory=list)
56+
57+
58+
def _run(cmd: list[str], cwd: Path | None = None, timeout: int = 240) -> tuple[int, str]:
59+
"""Run a command, return (rc, combined_output)."""
60+
try:
61+
p = subprocess.run(
62+
cmd,
63+
cwd=str(cwd) if cwd else None,
64+
capture_output=True,
65+
text=True,
66+
timeout=timeout,
67+
)
68+
return p.returncode, (p.stdout or "") + (p.stderr or "")
69+
except FileNotFoundError:
70+
return 127, f"command not found: {cmd[0]}"
71+
except subprocess.TimeoutExpired:
72+
return 124, f"timeout after {timeout}s: {' '.join(cmd)}"
73+
74+
75+
# ---------------------------------------------------------------------------
76+
# AUTOMATED gate checks (Tier A) — each returns (ok: bool, detail: str)
77+
# ---------------------------------------------------------------------------
78+
def check_terraform_validate() -> tuple[bool, str]:
79+
tf = ROOT / "governance_blueprint" / "terraform"
80+
rc, out = _run(["terraform", "init", "-backend=false", "-input=false", "-no-color"], cwd=tf)
81+
if rc != 0:
82+
return False, f"terraform init failed: {out.strip().splitlines()[-1] if out.strip() else rc}"
83+
rc, out = _run(["terraform", "validate", "-no-color"], cwd=tf)
84+
ok = rc == 0 and ("Success" in out or "valid" in out.lower())
85+
return ok, out.strip().splitlines()[-1] if out.strip() else f"rc={rc}"
86+
87+
88+
def check_opa_gates() -> tuple[bool, str]:
89+
rc, out = _run(["opa", "test", str(GA / "rego")])
90+
line = next((l for l in out.splitlines() if l.startswith("PASS:") or l.startswith("FAIL")), out.strip()[-80:])
91+
return rc == 0, line.strip()
92+
93+
94+
def check_worm_tamper() -> tuple[bool, str]:
95+
rc, out = _run(["python3", str(GA / "kafka" / "pqc_worm_logger_v2.py")])
96+
ok = rc == 0 and "tampering detected" in out
97+
return ok, "ML-DSA-65 sign+chain verify; tampering detected" if ok else out.strip()[-120:]
98+
99+
100+
def check_zk_relayer() -> tuple[bool, str]:
101+
rc, out = _run(["bash", "run_relayer_pipeline.sh"], cwd=GA / "zk", timeout=300)
102+
ok = rc == 0 and "relayer pipeline complete" in out
103+
line = next((l.strip() for l in out.splitlines() if "compiles" in l), "")
104+
return ok, line or (out.strip()[-120:])
105+
106+
107+
def check_containment_tlc() -> tuple[bool, str]:
108+
jar = GA / "tla" / "tools" / "tla2tools.jar"
109+
rc, out = _run(
110+
["java", "-cp", str(jar), "tlc2.TLC",
111+
"-config", str(GA / "tla" / "SentinelContainmentProtocol.cfg"),
112+
str(GA / "tla" / "SentinelContainmentProtocol.tla")],
113+
timeout=300,
114+
)
115+
ok = "No error has been found" in out
116+
states = next((l.strip() for l in out.splitlines() if "distinct states found" in l), "")
117+
return ok, ("ratchet invariants hold; " + states) if ok else out.strip()[-120:]
118+
119+
120+
def check_full_assurance() -> tuple[bool, str]:
121+
rc, out = _run(["bash", str(GA / "run_runnable_assurance.sh")], timeout=400)
122+
ok = rc == 0 and "ALL RUNNABLE ASSURANCE CHECKS PASSED" in out
123+
npass = sum(1 for l in out.splitlines() if "PASS" in l and "ASSURANCE" not in l)
124+
return ok, f"{npass} checks PASS" if ok else out.strip()[-160:]
125+
126+
127+
# ---------------------------------------------------------------------------
128+
# Gate catalog — mirrors the §14 month-by-month pilot table.
129+
# ---------------------------------------------------------------------------
130+
def build_gates() -> list[GateResult]:
131+
gates: list[GateResult] = []
132+
133+
# Month 1 — enclave substrate + attestation + OPA decision service
134+
ok, detail = check_terraform_validate()
135+
gates.append(GateResult(
136+
1, "P1-IAC", "Enclave substrate IaC validates in pilot account",
137+
"automated", "PASS" if ok else "FAIL", detail,
138+
criterion="`terraform validate` clean for the multi-region confidential-enclave module",
139+
))
140+
gates.append(GateResult(
141+
1, "P1-ATTEST", "First PCR_MATCH=TRUE admission on real hardware",
142+
"manual", "PENDING-EVIDENCE",
143+
"Tier B: requires TDX/SEV-SNP hardware + AMD/Intel attestation roots.",
144+
criterion="A T0 workload is admitted only after a fresh, signature-valid attestation with PCR_MATCH=TRUE",
145+
evidence=["attestation verifier log showing PCR_MATCH=TRUE",
146+
"golden measurement registry entry used for the admission"],
147+
))
148+
149+
# Month 2 — use-cases behind gates + StaR-MoE
150+
ok, detail = check_opa_gates()
151+
gates.append(GateResult(
152+
2, "P2-OPA", "T1 decisions routed through OPA release/credit/fairness gates",
153+
"automated", "PASS" if ok else "FAIL", detail,
154+
criterion="OPA policy suite green; 100% of T1 decisions evaluated by a default-deny gate",
155+
))
156+
gates.append(GateResult(
157+
2, "P2-MOE", "StaR-MoE routing drift index <= 0.1",
158+
"manual", "PENDING-EVIDENCE",
159+
"Tier B: requires the pilot's live MoE model + production traffic.",
160+
criterion="MoE routing drift index <= 0.1 over the pilot window (SARA+ACR enabled)",
161+
evidence=["StaR-MoE telemetry export showing drift_index timeseries <= 0.1"],
162+
))
163+
164+
# Month 3 — 24h monitor + G-SRI + PQC WORM
165+
ok, detail = check_worm_tamper()
166+
gates.append(GateResult(
167+
3, "P3-WORM", "PQC WORM audit integrity 100% (tamper detected)",
168+
"automated", "PASS" if ok else "FAIL", detail,
169+
criterion="ML-DSA-65 signatures + hash chain verify; any tamper is detected",
170+
))
171+
gates.append(GateResult(
172+
3, "P3-GSRI", "24h monitor + G-SRI emitting to production Kafka/S3 Object Lock",
173+
"manual", "PENDING-EVIDENCE",
174+
"Tier B: requires production Kafka + S3 Object Lock (COMPLIANCE) bucket.",
175+
criterion="G-SRI checkpoints written every interval; WORM batches retained under Object Lock",
176+
evidence=["S3 Object Lock retention config (COMPLIANCE mode)",
177+
"24h monitor checkpoint log with G-SRI + PCR_MATCH"],
178+
))
179+
180+
# Month 4 — containment dry-runs (Red-Dawn) + dead-man's switch
181+
ok, detail = check_containment_tlc()
182+
gates.append(GateResult(
183+
4, "P4-CONTAIN", "Containment ratchet behaves per TLA+ model",
184+
"automated", "PASS" if ok else "FAIL", detail,
185+
criterion="SentinelContainmentProtocol TLC: TrippedStaysTripped + KillSwitchIntegrity hold",
186+
))
187+
gates.append(GateResult(
188+
4, "P4-MTTC", "Critical-breach MTTC <= 60s in Red-Dawn simulation",
189+
"manual", "PENDING-EVIDENCE",
190+
"Tier B: requires a staged live containment exercise (GAI-SOC).",
191+
criterion="Measured mean-time-to-containment <= 60s across Red-Dawn scenarios",
192+
evidence=["Red-Dawn exercise report with per-scenario MTTC measurements"],
193+
))
194+
195+
# Month 5 — zk systemic-risk proof via relayer + OSCAL dossier
196+
ok, detail = check_zk_relayer()
197+
gates.append(GateResult(
198+
5, "P5-ZK", "zk systemic-risk proof -> on-chain verifier (relayer)",
199+
"automated", "PASS" if ok else "FAIL", detail,
200+
criterion="Groth16 proof exported to a Solidity verifier that compiles; calldata produced",
201+
))
202+
gates.append(GateResult(
203+
5, "P5-DOSSIER", "OSCAL Annex IV dossier >= 98% auto-assembled",
204+
"manual", "PENDING-EVIDENCE",
205+
"Tier B: requires the institution's live control evidence feeds.",
206+
criterion=">= 98% of the Annex IV dossier assembled automatically from OSCAL + WORM evidence",
207+
evidence=["dossier-assembly report with manual-fraction <= 2%"],
208+
))
209+
210+
# Month 6 — supervisor read-only + reproducible assurance (go-decision)
211+
ok, detail = check_full_assurance()
212+
gates.append(GateResult(
213+
6, "P6-REPRO", "Independent reproduction of the assurance suite (11/11)",
214+
"automated", "PASS" if ok else "FAIL", detail,
215+
criterion="`run_runnable_assurance.sh` reproduces green in the pilot environment",
216+
))
217+
gates.append(GateResult(
218+
6, "P6-SUPERVISOR", "Supervisor signs off on evidence reproducibility",
219+
"manual", "PENDING-EVIDENCE",
220+
"Requires a participating supervisor (observer role).",
221+
criterion="Supervisor confirms dashboards + GIEN events + proofs are independently reproducible",
222+
evidence=["signed supervisor sign-off memo", "supervisor dashboard access audit record"],
223+
))
224+
225+
return gates
226+
227+
228+
def main() -> int:
229+
ap = argparse.ArgumentParser(description="2028 G-SIFI pilot acceptance-gate checklist")
230+
ap.add_argument("--json", action="store_true", help="emit machine-readable JSON")
231+
args = ap.parse_args()
232+
233+
print("=" * 70)
234+
print(" 2028 G-SIFI Pilot — Acceptance-Gate Checklist")
235+
print(" (automated gates verified now; manual/Tier-B gates report criteria)")
236+
print("=" * 70)
237+
238+
gates = build_gates()
239+
240+
if args.json:
241+
print(json.dumps([g.__dict__ for g in gates], indent=2))
242+
243+
automated_fail = 0
244+
by_month: dict[int, list[GateResult]] = {}
245+
for g in gates:
246+
by_month.setdefault(g.month, []).append(g)
247+
248+
for month in sorted(by_month):
249+
print(f"\nMonth {month}")
250+
for g in by_month[month]:
251+
if g.status == "PASS":
252+
badge = f"{GREEN}PASS{RST}"
253+
elif g.status == "FAIL":
254+
badge = f"{RED}FAIL{RST}"
255+
automated_fail += 1
256+
else:
257+
badge = f"{YEL}MANUAL{RST}"
258+
print(f" [{badge}] {g.gate_id:<13} {g.title}")
259+
print(f" {DIM}criterion:{RST} {g.criterion}")
260+
if g.detail:
261+
print(f" {DIM}detail :{RST} {g.detail}")
262+
if g.kind == "manual" and g.evidence:
263+
print(f" {DIM}evidence :{RST} " + "; ".join(g.evidence))
264+
265+
n_auto = sum(1 for g in gates if g.kind == "automated")
266+
n_auto_pass = sum(1 for g in gates if g.kind == "automated" and g.status == "PASS")
267+
n_manual = sum(1 for g in gates if g.kind == "manual")
268+
269+
print("\n" + "=" * 70)
270+
print(f" Automated gates: {n_auto_pass}/{n_auto} PASS | "
271+
f"Manual/Tier-B gates pending evidence: {n_manual}")
272+
if automated_fail == 0:
273+
print(f" {GREEN}ALL AUTOMATED PILOT GATES PASS{RST} — "
274+
f"go-decision blocked only on {n_manual} manual/Tier-B evidence items.")
275+
else:
276+
print(f" {RED}{automated_fail} AUTOMATED PILOT GATE(S) FAILED{RST} — fix before pilot go-decision.")
277+
print("=" * 70)
278+
return 1 if automated_fail else 0
279+
280+
281+
if __name__ == "__main__":
282+
raise SystemExit(main())

governance_blueprint/DECADAL_STRATEGIC_TECHNICAL_PLAN_2026_2035.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@ decade.
283283
## 13. Phased decadal roadmap (2026 → 2035)
284284

285285
This roadmap is the human-readable companion to the machine-readable
286-
`governance_blueprint/roadmap_2026_2035.yaml` (phases 0–4 + extension). Exit criteria below match
287-
that file so the two cannot drift.
286+
`governance_blueprint/roadmap_2026_2035.yaml`, which now carries **all nine phases (0–8) as
287+
first-class segments** — each with `feasibility_tier`, `objectives`, and `exit_criteria` (and, for
288+
the Tier C/D phases, an explicit `gating` precondition). Exit criteria below match that file so the
289+
two cannot drift.
288290

289291
| Phase | Period | Theme | Key objectives | Hard exit criteria | Dominant tier |
290292
|-------|--------|-------|----------------|--------------------|---------------|
@@ -326,6 +328,13 @@ confidential-enclave fleet.
326328
**Pilot exit / go-decision:** all six gates green + an independent reproduction of
327329
`run_runnable_assurance.sh` (11/11) in the pilot environment.
328330

331+
> **Runnable checklist.** These gates are operationalized as
332+
> `governance_artifacts/pilot/run_pilot_acceptance_gates.py`. It *actually executes* the
333+
> Tier‑A gates (Terraform validate, OPA gates, PQC WORM tamper test, containment TLC, zk
334+
> relayer, full assurance suite) and reports the Tier‑B/hardware gates as `PENDING-EVIDENCE`
335+
> with their precise acceptance criteria — it never fakes a manual gate. Current state:
336+
> **6/6 automated gates PASS**, 6 manual/Tier‑B evidence items outstanding.
337+
329338
**Pilot risks & mitigations:** real attestation hardware lead-time (mitigate: start Tier B
330339
procurement in 2027); supervisor data-residency constraints (mitigate: GIEN shares only signed
331340
events/proofs, never raw data/PII); trusted-setup concern (mitigate: document zk‑STARK migration

0 commit comments

Comments
 (0)