Add CTO Case Stage 1 gated engine PRD

This commit is contained in:
Svrnty
2026-05-31 19:00:20 -04:00
parent 1f37722bc9
commit 217efe3f0a
5 changed files with 241 additions and 1 deletions
+57
View File
@@ -23,6 +23,8 @@ REQUIRED_FILES = [
"sot/03-PROTOCOLS/CTO-CASE-ADAPTER-CONTRACT.md",
"sot/03-PROTOCOLS/CTO-CASE-FAILURE-FIXTURE-MATRIX.md",
"sot/03-PROTOCOLS/CTO-CASE-STAGED-PROOF-GATES.md",
"sot/03-PROTOCOLS/CTO-CASE-STAGE1-GATED-ENGINE-PRD.md",
"sot/03-PROTOCOLS/CTO-CASE-STAGE1-GATED-ENGINE-ISSUES.md",
]
REQUIRED_BRIEF_PHRASES = [
@@ -182,6 +184,31 @@ REQUIRED_STAGED_PROOF_PHRASES = [
"must not skip to real-repo execution",
]
REQUIRED_STAGE1_PRD_PHRASES = [
"Local planning SOT only. Not a Core Protocol. Not active Core authority.",
"Stage 1 must prove only the smallest safe executable behavior",
"no-op gated `case` backend path",
"It does not run Case",
"Stage 1 keeps allowed mutation scope as `none`.",
"`case` is disabled by default.",
"Missing gate produces blocked status, not warning.",
"CTO_HARNESS_ALLOW_CASE=1",
"backend.gate.blocked",
"case_process_started: false",
"source_admission_status: not_admitted",
"backend/case-gate.log",
"Stage 1 gate runs before case workspace copy",
"No files under harness source checkout, target repo, Case source, vendor source, or Cortex Core are changed by the Stage 1 run.",
"fake remains the default validation lane",
"/home/svrnty/workspaces/hermes/cto/harness",
"Stage 1 does not make Case executable",
]
REQUIRED_STAGE1_ISSUE_IDS = [
"CTO-WORK-009",
"CTO-WORK-010",
]
def main() -> int:
checked: list[str] = []
@@ -279,6 +306,28 @@ def main() -> int:
if phrase not in text:
errors.append(f"missing_staged_proof_phrase:{phrase}")
stage1_prd = ROOT / "sot/03-PROTOCOLS/CTO-CASE-STAGE1-GATED-ENGINE-PRD.md"
if stage1_prd.is_file():
text = stage1_prd.read_text(encoding="utf-8")
if "core_promotion_status: not-promoted" not in text:
errors.append("stage1_prd_missing_not_promoted_frontmatter")
for phrase in REQUIRED_STAGE1_PRD_PHRASES:
checked.append(f"stage1_prd_phrase:{phrase}")
if phrase not in text:
errors.append(f"missing_stage1_prd_phrase:{phrase}")
stage1_issues = ROOT / "sot/03-PROTOCOLS/CTO-CASE-STAGE1-GATED-ENGINE-ISSUES.md"
if stage1_issues.is_file():
text = stage1_issues.read_text(encoding="utf-8")
if "core_promotion_status: not-promoted" not in text:
errors.append("stage1_issues_missing_not_promoted_frontmatter")
if "Local planning SOT only. Not a Core Protocol. Not active Core authority." not in text:
errors.append("stage1_issues_missing_local_planning_notice")
for issue_id in REQUIRED_STAGE1_ISSUE_IDS:
checked.append(f"stage1_issue_id:{issue_id}")
if issue_id not in text:
errors.append(f"missing_stage1_issue_id:{issue_id}")
board = ROOT / "WORKBOARD.yaml"
if board.is_file():
text = board.read_text(encoding="utf-8")
@@ -286,6 +335,10 @@ def main() -> int:
checked.append(f"workboard_id:{issue_id}")
if issue_id not in text:
errors.append(f"missing_workboard_id:{issue_id}")
for issue_id in REQUIRED_STAGE1_ISSUE_IDS:
checked.append(f"workboard_id:{issue_id}")
if issue_id not in text:
errors.append(f"missing_workboard_id:{issue_id}")
if "CTO-HARNESS-EVIDENCE-INTERFACE-CONTRACT.md" not in text:
errors.append("workboard_missing_evidence_interface_contract_source")
if "CTO-WORK-004" in text and "status: validated" not in text:
@@ -298,6 +351,10 @@ def main() -> int:
errors.append("workboard_missing_failure_matrix_source")
if "CTO-CASE-STAGED-PROOF-GATES.md" not in text:
errors.append("workboard_missing_staged_proof_gates_source")
if "CTO-CASE-STAGE1-GATED-ENGINE-PRD.md" not in text:
errors.append("workboard_missing_stage1_prd_source")
if "CTO-CASE-STAGE1-GATED-ENGINE-ISSUES.md" not in text:
errors.append("workboard_missing_stage1_issues_source")
payload = {
"ok": not errors,