talents/sense: migrate to external sense.schema.json
Move sense's structured-output schema out of the inline ```json fenced
block in talent/sense.md into talent/sense.schema.json (Draft 2020-12,
additionalProperties:false at every closed level), wired via the
`schema` frontmatter field that landed in cde43afc. The inline ##
Output Schema block becomes a one-line pointer; the field-by-field
prose stays as the model's semantic reference.
First real consumer of the structured-outputs infrastructure landed
in c030248d (Lode 1 — provider json_schema plumbing) and cde43afc
(Lode 2 — talent dispatcher schema wiring). This lode is the L3 pilot;
remaining `output: "json"` talents migrate one at a time.
Schema design:
- 9 required top-level fields; all enums copied verbatim from the
field-by-field prose
- speakers tightened to array<string> per apps/speakers/routes.py and
apps/speakers/bootstrap.py contracts
- Provider-intersection subset only: type, enum, required,
additionalProperties, properties, items, minLength
Test fixture alignment:
- _make_sense_output() helper now returns a schema-valid default
- test_pipeline_smoke SEGMENTS padded to schema-valid shape
- test_sense_contamination_guard payloads padded to schema-valid shape
- Intentionally degraded splitter inputs ({} and null-valued dict)
retained as defensive tests with comments explaining why
Live validation deferred — provider creds not available in this
worktree environment. End-to-end wiring is verified by:
- get_talent("sense")["json_schema"] equals the on-disk schema
(new test_sense_loaded_json_schema_matches_on_disk_schema)
- existing test_generate_full.py:129/:221 cover json_schema forwarding
and schema_validation surfacing on the finish event
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>