Add CTO Case provider admission route
This commit is contained in:
@@ -28,6 +28,8 @@ REQUIRED_FILES = [
|
||||
"sot/03-PROTOCOLS/CTO-CASE-STAGE1-GATED-ENGINE-ISSUES.md",
|
||||
"sot/03-PROTOCOLS/CTO-CASE-STAGE2-ARTIFICIAL-FIXTURE-PRD.md",
|
||||
"sot/03-PROTOCOLS/CTO-CASE-STAGE2-ARTIFICIAL-FIXTURE-ISSUES.md",
|
||||
"sot/03-PROTOCOLS/CTO-CASE-PROVIDER-ADMISSION-PRD.md",
|
||||
"sot/03-PROTOCOLS/CTO-CASE-PROVIDER-ADMISSION-ISSUES.md",
|
||||
]
|
||||
|
||||
REQUIRED_BRIEF_PHRASES = [
|
||||
@@ -252,6 +254,37 @@ REQUIRED_STAGE2_ISSUE_IDS = [
|
||||
"CTO-WORK-012",
|
||||
]
|
||||
|
||||
REQUIRED_PROVIDER_ADMISSION_PRD_PHRASES = [
|
||||
"Local planning SOT only. Not a Core Protocol. Not active Core authority.",
|
||||
"https://github.com/workos/case.git",
|
||||
"7959ac917cdeb0983b4aaa20bb9f42021747fed8",
|
||||
"Package status: `private: true`.",
|
||||
"Public npm package `case` is not WorkOS Case.",
|
||||
"Case CLI binary name is `ca`",
|
||||
"Case setup requires Bun.",
|
||||
"bun run build:binary",
|
||||
"dist/ca",
|
||||
"ca run --task <task-file>",
|
||||
"ca session <repo-path> --task <task-file>",
|
||||
"CTO_HARNESS_CASE_BIN",
|
||||
"WorkOS Case expects a task file and a Case command shape, not an arbitrary prompt string.",
|
||||
"The provider path must be explicit and durable",
|
||||
"The adapter must not pass the task brief as a raw positional prompt.",
|
||||
"The task file must contain no Target Repository path for Stage 2.",
|
||||
"Missing Bun, missing `dist/ca`, wrong commit, wrong command shape, or wrong task file means blocked.",
|
||||
"Case may execute only inside the Harness Evidence Interface.",
|
||||
"Case may recommend. Case must not approve itself.",
|
||||
"Stage 2 pass report exists only after a real `ca run --task <task-file>` execution.",
|
||||
"Fake remains the default validation lane.",
|
||||
"Do not install or use the unrelated npm `case` package.",
|
||||
"Do not treat Case as CTO authority.",
|
||||
]
|
||||
|
||||
REQUIRED_PROVIDER_ADMISSION_ISSUE_IDS = [
|
||||
"CTO-WORK-013",
|
||||
"CTO-WORK-014",
|
||||
]
|
||||
|
||||
|
||||
def workboard_status(text: str, issue_id: str) -> str | None:
|
||||
pattern = rf"- id: {re.escape(issue_id)}\n(?: .+\n)*? status: ([^\n]+)"
|
||||
@@ -399,6 +432,28 @@ def main() -> int:
|
||||
if issue_id not in text:
|
||||
errors.append(f"missing_stage2_issue_id:{issue_id}")
|
||||
|
||||
provider_admission_prd = ROOT / "sot/03-PROTOCOLS/CTO-CASE-PROVIDER-ADMISSION-PRD.md"
|
||||
if provider_admission_prd.is_file():
|
||||
text = provider_admission_prd.read_text(encoding="utf-8")
|
||||
if "core_promotion_status: not-promoted" not in text:
|
||||
errors.append("provider_admission_prd_missing_not_promoted_frontmatter")
|
||||
for phrase in REQUIRED_PROVIDER_ADMISSION_PRD_PHRASES:
|
||||
checked.append(f"provider_admission_prd_phrase:{phrase}")
|
||||
if phrase not in text:
|
||||
errors.append(f"missing_provider_admission_prd_phrase:{phrase}")
|
||||
|
||||
provider_admission_issues = ROOT / "sot/03-PROTOCOLS/CTO-CASE-PROVIDER-ADMISSION-ISSUES.md"
|
||||
if provider_admission_issues.is_file():
|
||||
text = provider_admission_issues.read_text(encoding="utf-8")
|
||||
if "core_promotion_status: not-promoted" not in text:
|
||||
errors.append("provider_admission_issues_missing_not_promoted_frontmatter")
|
||||
if "Local planning SOT only. Not a Core Protocol. Not active Core authority." not in text:
|
||||
errors.append("provider_admission_issues_missing_local_planning_notice")
|
||||
for issue_id in REQUIRED_PROVIDER_ADMISSION_ISSUE_IDS:
|
||||
checked.append(f"provider_admission_issue_id:{issue_id}")
|
||||
if issue_id not in text:
|
||||
errors.append(f"missing_provider_admission_issue_id:{issue_id}")
|
||||
|
||||
board = ROOT / "WORKBOARD.yaml"
|
||||
if board.is_file():
|
||||
text = board.read_text(encoding="utf-8")
|
||||
@@ -414,6 +469,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_PROVIDER_ADMISSION_ISSUE_IDS:
|
||||
checked.append(f"workboard_id:{issue_id}")
|
||||
if issue_id not in text:
|
||||
errors.append(f"missing_workboard_id:{issue_id}")
|
||||
expected_statuses = {
|
||||
"CTO-WORK-002": "validated",
|
||||
"CTO-WORK-003": "validated",
|
||||
@@ -426,6 +485,8 @@ def main() -> int:
|
||||
"CTO-WORK-010": "validated",
|
||||
"CTO-WORK-011": "validated",
|
||||
"CTO-WORK-012": "blocked",
|
||||
"CTO-WORK-013": "validated",
|
||||
"CTO-WORK-014": "candidate",
|
||||
}
|
||||
for issue_id, expected in expected_statuses.items():
|
||||
checked.append(f"workboard_status:{issue_id}:{expected}")
|
||||
@@ -452,6 +513,10 @@ def main() -> int:
|
||||
errors.append("workboard_missing_stage2_prd_source")
|
||||
if "CTO-CASE-STAGE2-ARTIFICIAL-FIXTURE-ISSUES.md" not in text:
|
||||
errors.append("workboard_missing_stage2_issues_source")
|
||||
if "CTO-CASE-PROVIDER-ADMISSION-PRD.md" not in text:
|
||||
errors.append("workboard_missing_provider_admission_prd_source")
|
||||
if "CTO-CASE-PROVIDER-ADMISSION-ISSUES.md" not in text:
|
||||
errors.append("workboard_missing_provider_admission_issues_source")
|
||||
|
||||
payload = {
|
||||
"ok": not errors,
|
||||
|
||||
Reference in New Issue
Block a user