Reject CTO generated cache residue
This commit is contained in:
@@ -5,10 +5,17 @@ from __future__ import annotations
|
||||
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.dont_write_bytecode = True
|
||||
|
||||
GENERATED_ARTIFACT_DIRS = [
|
||||
"tools/__pycache__",
|
||||
".pytest_cache",
|
||||
]
|
||||
|
||||
REQUIRED_FILES = [
|
||||
"AGENTS.md",
|
||||
@@ -180,6 +187,7 @@ REQUIRED_LEGACY_INGEST_PHRASES = [
|
||||
"Source Clusters Assessed By Intention",
|
||||
"Do not activate Case as default backend.",
|
||||
"Do not mutate target repositories.",
|
||||
"Generated Cache Custody",
|
||||
]
|
||||
|
||||
REQUIRED_ARCHITECTURE_CLOSEOUT_PRD_PHRASES = [
|
||||
@@ -1903,6 +1911,15 @@ def workboard_status(text: str, issue_id: str) -> str | None:
|
||||
return match.group(1).strip() if match else None
|
||||
|
||||
|
||||
def validate_no_generated_artifact_residue(checked: list[str]) -> list[str]:
|
||||
errors: list[str] = []
|
||||
for relpath in GENERATED_ARTIFACT_DIRS:
|
||||
checked.append(f"generated_artifact_absent:{relpath}")
|
||||
if (ROOT / relpath).exists():
|
||||
errors.append(f"generated_artifact_residue:{relpath}")
|
||||
return errors
|
||||
|
||||
|
||||
def main() -> int:
|
||||
checked: list[str] = []
|
||||
errors: list[str] = []
|
||||
@@ -1945,6 +1962,8 @@ def main() -> int:
|
||||
if phrase not in text:
|
||||
errors.append(f"missing_legacy_ingest_phrase:{phrase}")
|
||||
|
||||
errors.extend(validate_no_generated_artifact_residue(checked))
|
||||
|
||||
brief = ROOT / ".sot/03-PROTOCOLS/CTO-CASE-BACKEND-BRIEF.md"
|
||||
if brief.is_file():
|
||||
text = brief.read_text(encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user