generated from coulomb/repo-seed
feat(ACTIVITY-WP-0016-T02): strict bounded daily-triage output schema
Replace the accept-anything recommendations.items ({type: object}) with a strict
per-item contract (required [rank, candidate, action, why] + typed wsjf) and a
maxItems:7 hint. Strict item structure is what lets the T03 boundary parser
validate each recommendation independently and quarantine only malformed ones.
maxItems is a producer hint (prompt + llm-connect json_schema + T03 mitigation),
NOT a hard reject — a hard maxItems reject would discard a whole 16-item report,
the blast-radius bug WP-0016 removes. DEPLOY COUPLING: the strict schema is also
consumed by the current whole-doc validator, so it must ship with T03's per-item
quarantine parser; until then it increases whole-doc hard-fails. Prompt + max_tokens
headroom + NDJSON framing are documented as a runtime-bundle handoff.
Updated four tests to the strict contract; the forwarded-schema test now reads the
live schema file instead of hard-coding it. Full suite: 213 passed, 1 skipped.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -333,7 +333,14 @@ def test_execute_instruction_forwards_output_schema_to_llm_connect(tmp_path, mon
|
||||
def test_execute_instruction_with_audit_accepts_report_payload():
|
||||
report_data = {
|
||||
"summary": "State Hub has loose ends.",
|
||||
"recommendations": [{"action": "revisit", "candidate": "CUST-WP-0045"}],
|
||||
"recommendations": [
|
||||
{
|
||||
"rank": 1,
|
||||
"action": "revisit",
|
||||
"candidate": "CUST-WP-0045",
|
||||
"why": "Loose ends need attention.",
|
||||
}
|
||||
],
|
||||
}
|
||||
llm = _CountingLLM([json.dumps(report_data)])
|
||||
instr = _instr(
|
||||
@@ -353,7 +360,14 @@ def test_execute_instruction_with_audit_accepts_report_payload():
|
||||
def test_execute_instruction_with_audit_accepts_fenced_report_payload():
|
||||
report_data = {
|
||||
"summary": "State Hub has loose ends.",
|
||||
"recommendations": [{"action": "revisit", "candidate": "CUST-WP-0045"}],
|
||||
"recommendations": [
|
||||
{
|
||||
"rank": 1,
|
||||
"action": "revisit",
|
||||
"candidate": "CUST-WP-0045",
|
||||
"why": "Loose ends need attention.",
|
||||
}
|
||||
],
|
||||
}
|
||||
llm = _CountingLLM([f"```json\n{json.dumps(report_data)}\n```"])
|
||||
instr = _instr(
|
||||
|
||||
Reference in New Issue
Block a user