Add CTO agent contract blocks
This commit is contained in:
@@ -124,6 +124,21 @@ REQUIRED_FILES = [
|
||||
"tools/codex_ephemeral_exec.py",
|
||||
]
|
||||
|
||||
AGENT_CONTRACT_SNIPPETS = [
|
||||
"## Universal Cortex OS Agent Contract",
|
||||
"## Repo-Custom Agent Contract",
|
||||
"Record proof and handoffs as refs-only artifacts.",
|
||||
"CTO owns child-local execution-routing planning",
|
||||
"it does not activate Case as default backend",
|
||||
"mutate OpenDesign",
|
||||
]
|
||||
|
||||
README_CONTRACT_SNIPPETS = [
|
||||
"Cortex OS use is child-local and refs-only by default",
|
||||
"It is not Core truth, Runtime authority, Host Runtime authority, backend ownership",
|
||||
"permission to activate Case, mutate target repos, call providers, read secrets, publish, deploy, or release",
|
||||
]
|
||||
|
||||
REQUIRED_BRIEF_PHRASES = [
|
||||
"Cortex governs.",
|
||||
"Hermes controls.",
|
||||
@@ -1871,6 +1886,22 @@ def main() -> int:
|
||||
if not path.is_file():
|
||||
errors.append(f"missing_required_file:{rel}")
|
||||
|
||||
agents = ROOT / "AGENTS.md"
|
||||
if agents.is_file():
|
||||
text = agents.read_text(encoding="utf-8")
|
||||
for snippet in AGENT_CONTRACT_SNIPPETS:
|
||||
checked.append(f"agent_contract_snippet:{snippet}")
|
||||
if snippet not in text:
|
||||
errors.append(f"missing_agent_contract_snippet:{snippet}")
|
||||
|
||||
readme = ROOT / "README.md"
|
||||
if readme.is_file():
|
||||
text = readme.read_text(encoding="utf-8")
|
||||
for snippet in README_CONTRACT_SNIPPETS:
|
||||
checked.append(f"readme_contract_snippet:{snippet}")
|
||||
if snippet not in text:
|
||||
errors.append(f"missing_readme_contract_snippet:{snippet}")
|
||||
|
||||
legacy_ingest = ROOT / "docs/LEGACY-INGEST.md"
|
||||
if legacy_ingest.is_file():
|
||||
text = legacy_ingest.read_text(encoding="utf-8")
|
||||
@@ -3090,7 +3121,7 @@ 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 ["CTO-WORK-098", "CTO-WORK-099", "CTO-WORK-100", "CTO-WORK-101"]:
|
||||
for issue_id in ["CTO-WORK-098", "CTO-WORK-099", "CTO-WORK-100", "CTO-WORK-101", "CTO-WORK-102"]:
|
||||
checked.append(f"workboard_id:{issue_id}")
|
||||
if issue_id not in text:
|
||||
errors.append(f"missing_workboard_id:{issue_id}")
|
||||
@@ -3193,6 +3224,7 @@ def main() -> int:
|
||||
"CTO-WORK-099": "validated",
|
||||
"CTO-WORK-100": "validated",
|
||||
"CTO-WORK-101": "validated",
|
||||
"CTO-WORK-102": "validated",
|
||||
}
|
||||
for issue_id, expected in expected_statuses.items():
|
||||
checked.append(f"workboard_status:{issue_id}:{expected}")
|
||||
@@ -3299,6 +3331,10 @@ def main() -> int:
|
||||
errors.append("workboard_missing_stage5_target_stale_state_source")
|
||||
if "docs/STAGE5-TARGET-SANDBOX-CUSTODY-PREFLIGHT.md" not in text:
|
||||
errors.append("workboard_missing_stage5_target_custody_preflight_source")
|
||||
if "CTO Agent Contract Enforcement" not in text:
|
||||
errors.append("workboard_missing_agent_contract_title")
|
||||
if "source: AGENTS.md" not in text:
|
||||
errors.append("workboard_missing_agent_contract_source")
|
||||
|
||||
payload = {
|
||||
"ok": not errors,
|
||||
|
||||
Reference in New Issue
Block a user