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:
@@ -170,6 +170,45 @@ Done when:
|
||||
occur at the expected size;
|
||||
- the output schema file (`_load_output_schema` target) is updated to match.
|
||||
|
||||
2026-06-26 progress (in-repo portion):
|
||||
|
||||
- **Strict, bounded schema written** — `schemas/daily-triage-report.json` went
|
||||
from `recommendations.items: {type: object}` (accept-anything) to a strict
|
||||
per-item contract: `required [rank, candidate, action, why]` with typed
|
||||
`wsjf` sub-fields, plus `maxItems: 7`. The strict item shape is what lets the
|
||||
T03 boundary parser validate each recommendation independently.
|
||||
- **`maxItems` is a hint, not a hard reject** — the in-repo validator
|
||||
(`_validate_schema_node`) only enforces `type`/`required`/`properties`/`items`
|
||||
and ignores `maxItems`/`enum`. That is deliberate: a hard `maxItems` reject
|
||||
would discard a whole 16-item report — the exact blast-radius bug WP-0016
|
||||
removes. The bound is enforced via the prompt + the llm-connect `json_schema`
|
||||
constraint hint + T03 mitigation (keep top-N by rank, quarantine extras).
|
||||
- **DEPLOY COUPLING (important):** this schema file is consumed *both* as the
|
||||
llm-connect hint *and* by the current whole-document validator. Tightening
|
||||
per-item `required` fields makes the existing whole-doc validation hard-fail
|
||||
**more** until T03 replaces it with per-item quarantine. Therefore the schema
|
||||
change MUST ship together with T03 — do not deploy the strict schema to the
|
||||
runtime bundle ahead of the T03 parser. Four executor/instruction tests that
|
||||
asserted the old loose contract were updated to the strict contract; the
|
||||
forwarded-schema test now reads the live file instead of hard-coding it.
|
||||
- **Truncation hypothesis corroborated** — the instruction config carries
|
||||
`max_tokens` on the order of ~1200 (per the wiring test fixture). 5268 chars ≈
|
||||
~1300–1500 tokens, so a ~1200-token cap would truncate a 16-item list right at
|
||||
the observed break. This strengthens T01's leading hypothesis and makes the
|
||||
`max_tokens` headroom change below concrete.
|
||||
|
||||
**Bundle handoff (NOT in this repo — runtime-projected definition).** The triage
|
||||
prompt and `max_tokens` live in the Railiance runtime bundle, not in repo files.
|
||||
Apply there:
|
||||
1. Instruct a **bounded top-N** (≤ 7) ranked recommendations, "if uncertain emit
|
||||
fewer well-formed items rather than more."
|
||||
2. Specify the **per-item framing** the T03 parser will consume (NDJSON: a
|
||||
leading summary object, then one recommendation JSON object per line).
|
||||
3. Raise **`max_tokens`** to give clear headroom for 7 framed items (eliminate
|
||||
truncation at the expected size).
|
||||
4. State the value vocabularies (`action`, `confidence`) the T04 guardrails will
|
||||
check.
|
||||
|
||||
## Boundary Parser — Verify & Mitigate (Posture B)
|
||||
|
||||
```task
|
||||
|
||||
Reference in New Issue
Block a user