Add Case provider decision packet
This commit is contained in:
@@ -36,6 +36,8 @@ REQUIRED_FILES = [
|
||||
"sot/03-PROTOCOLS/CTO-CASE-MODEL-PROVIDER-ADMISSION-ISSUES.md",
|
||||
"sot/03-PROTOCOLS/CTO-CASE-LOCAL-PROVIDER-ROUTE-PRD.md",
|
||||
"sot/03-PROTOCOLS/CTO-CASE-LOCAL-PROVIDER-ROUTE-ISSUES.md",
|
||||
"sot/03-PROTOCOLS/CTO-CASE-PROVIDER-DECISION-PACKET-PRD.md",
|
||||
"sot/03-PROTOCOLS/CTO-CASE-PROVIDER-DECISION-PACKET-ISSUES.md",
|
||||
]
|
||||
|
||||
REQUIRED_BRIEF_PHRASES = [
|
||||
@@ -506,6 +508,61 @@ REQUIRED_LOCAL_PROVIDER_ROUTE_ISSUE_PHRASES = [
|
||||
"Real Case Stage 2 produces a pass report only through the Harness Evidence Interface.",
|
||||
]
|
||||
|
||||
REQUIRED_PROVIDER_DECISION_PACKET_PRD_PHRASES = [
|
||||
"Local planning SOT only. Not a Core Protocol. Not active Core authority.",
|
||||
"`CTO-WORK-020` is blocked by a provider policy decision.",
|
||||
"`external_provider_approved`",
|
||||
"`local_provider_required`",
|
||||
"`not_decided` as the current safe state",
|
||||
"does not approve a provider/model",
|
||||
"does not approve or admit any provider/model",
|
||||
"is not Stage 2 pass evidence",
|
||||
"structured decision record using only `not_decided`, `external_provider_approved`, or `local_provider_required`",
|
||||
"Reference existing evidence paths and commits; do not copy runtime evidence into the packet.",
|
||||
"Keep `CTO-WORK-020` as the admission authority.",
|
||||
"CTO_HARNESS_CASE_MODEL_ADMISSION_FILE",
|
||||
"exact provider/model, approval source, credential source class, allowed network class, review trigger, and evidence expectations",
|
||||
"no secret value in SOT, task file, argv, report, trace, backend logs, generated config, or commit",
|
||||
"`CTO-WORK-022` blocked unless `decision_status=local_provider_required`",
|
||||
"real Case Stage 2 blocked unless a provider/model is admitted and a pass report exists through the Harness Evidence Interface",
|
||||
"no Target Repository path may be inspected or copied",
|
||||
"`provider_class`: `external_anthropic`",
|
||||
"`provider_class`: `local_case_compatible`",
|
||||
"No external fallback to `anthropic` or `claude-sonnet-4-6` is allowed.",
|
||||
"Missing local adapter config blocks before `case_process_started`.",
|
||||
"Admission JSON mismatch blocks before `case_process_started`.",
|
||||
]
|
||||
|
||||
REQUIRED_PROVIDER_DECISION_PACKET_ISSUE_IDS = [
|
||||
"CTO-WORK-023",
|
||||
"CTO-WORK-024",
|
||||
]
|
||||
|
||||
REQUIRED_PROVIDER_DECISION_PACKET_ISSUE_PHRASES = [
|
||||
"Status: validated.",
|
||||
"Status: blocked.",
|
||||
"`not_decided` is current safe state",
|
||||
"`external_provider_approved`",
|
||||
"`local_provider_required`",
|
||||
"does not approve or admit any provider/model",
|
||||
"Says it is not Stage 2 pass evidence.",
|
||||
"Requires a structured decision record using only `not_decided`, `external_provider_approved`, or `local_provider_required`.",
|
||||
"References existing evidence paths and commits instead of copying runtime evidence.",
|
||||
"Keeps `CTO-WORK-020` as provider/model admission authority.",
|
||||
"Keeps `CTO_HARNESS_CASE_MODEL_ADMISSION_FILE` as execution admission gate.",
|
||||
"Requires exact provider/model, approval source, credential source class, allowed network class, review trigger, and evidence expectations before admission.",
|
||||
"Requires no secrets in SOT, task file, argv, report, trace, backend logs, generated config, or commits.",
|
||||
"States `CTO-WORK-022` stays blocked unless `decision_status=local_provider_required`.",
|
||||
"States real Case Stage 2 remains blocked until admitted provider/model and Harness Evidence Interface pass report exist.",
|
||||
"States no Target Repository path may be inspected or copied.",
|
||||
"Decision record selects exactly one branch: `external_provider_approved` or `local_provider_required`.",
|
||||
"Decision record is structured and uses only `not_decided`, `external_provider_approved`, or `local_provider_required`.",
|
||||
"Decision record references existing evidence paths and commits instead of copying runtime evidence.",
|
||||
"`CTO-WORK-020` remains blocked until admitted provider/model and real Stage 2 pass report exist.",
|
||||
"`CTO-WORK-022` remains blocked unless `decision_status=local_provider_required`.",
|
||||
"Real Case Stage 2 remains blocked unless `CTO_HARNESS_CASE_MODEL_ADMISSION_FILE` exists and matches `CTO_HARNESS_CASE_MODEL_PROVIDER` and `CTO_HARNESS_CASE_MODEL`.",
|
||||
]
|
||||
|
||||
|
||||
def workboard_status(text: str, issue_id: str) -> str | None:
|
||||
pattern = rf"- id: {re.escape(issue_id)}\n(?: .+\n)*? status: ([^\n]+)"
|
||||
@@ -749,6 +806,32 @@ def main() -> int:
|
||||
if phrase not in text:
|
||||
errors.append(f"missing_local_provider_route_issue_phrase:{phrase}")
|
||||
|
||||
provider_decision_packet_prd = ROOT / "sot/03-PROTOCOLS/CTO-CASE-PROVIDER-DECISION-PACKET-PRD.md"
|
||||
if provider_decision_packet_prd.is_file():
|
||||
text = provider_decision_packet_prd.read_text(encoding="utf-8")
|
||||
if "core_promotion_status: not-promoted" not in text:
|
||||
errors.append("provider_decision_packet_prd_missing_not_promoted_frontmatter")
|
||||
for phrase in REQUIRED_PROVIDER_DECISION_PACKET_PRD_PHRASES:
|
||||
checked.append(f"provider_decision_packet_prd_phrase:{phrase}")
|
||||
if phrase not in text:
|
||||
errors.append(f"missing_provider_decision_packet_prd_phrase:{phrase}")
|
||||
|
||||
provider_decision_packet_issues = ROOT / "sot/03-PROTOCOLS/CTO-CASE-PROVIDER-DECISION-PACKET-ISSUES.md"
|
||||
if provider_decision_packet_issues.is_file():
|
||||
text = provider_decision_packet_issues.read_text(encoding="utf-8")
|
||||
if "core_promotion_status: not-promoted" not in text:
|
||||
errors.append("provider_decision_packet_issues_missing_not_promoted_frontmatter")
|
||||
if "Local planning SOT only. Not a Core Protocol. Not active Core authority." not in text:
|
||||
errors.append("provider_decision_packet_issues_missing_local_planning_notice")
|
||||
for issue_id in REQUIRED_PROVIDER_DECISION_PACKET_ISSUE_IDS:
|
||||
checked.append(f"provider_decision_packet_issue_id:{issue_id}")
|
||||
if issue_id not in text:
|
||||
errors.append(f"missing_provider_decision_packet_issue_id:{issue_id}")
|
||||
for phrase in REQUIRED_PROVIDER_DECISION_PACKET_ISSUE_PHRASES:
|
||||
checked.append(f"provider_decision_packet_issue_phrase:{phrase}")
|
||||
if phrase not in text:
|
||||
errors.append(f"missing_provider_decision_packet_issue_phrase:{phrase}")
|
||||
|
||||
board = ROOT / "WORKBOARD.yaml"
|
||||
if board.is_file():
|
||||
text = board.read_text(encoding="utf-8")
|
||||
@@ -780,6 +863,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_DECISION_PACKET_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",
|
||||
@@ -802,6 +889,8 @@ def main() -> int:
|
||||
"CTO-WORK-020": "blocked",
|
||||
"CTO-WORK-021": "validated",
|
||||
"CTO-WORK-022": "blocked",
|
||||
"CTO-WORK-023": "validated",
|
||||
"CTO-WORK-024": "blocked",
|
||||
}
|
||||
for issue_id, expected in expected_statuses.items():
|
||||
checked.append(f"workboard_status:{issue_id}:{expected}")
|
||||
@@ -844,6 +933,10 @@ def main() -> int:
|
||||
errors.append("workboard_missing_local_provider_route_prd_source")
|
||||
if "CTO-CASE-LOCAL-PROVIDER-ROUTE-ISSUES.md" not in text:
|
||||
errors.append("workboard_missing_local_provider_route_issues_source")
|
||||
if "CTO-CASE-PROVIDER-DECISION-PACKET-PRD.md" not in text:
|
||||
errors.append("workboard_missing_provider_decision_packet_prd_source")
|
||||
if "CTO-CASE-PROVIDER-DECISION-PACKET-ISSUES.md" not in text:
|
||||
errors.append("workboard_missing_provider_decision_packet_issues_source")
|
||||
|
||||
payload = {
|
||||
"ok": not errors,
|
||||
|
||||
Reference in New Issue
Block a user