skald/migrations/0010_prose_audit.sql
Kayos fd7a34ac1d forge: prose-quality audit pass + anti-repetition directives
Adds `skald audit --story <id>`: a whole-story QC pass that reads
every chapter end to end and flags repetition, template tics,
self-restatement and continuity drift — the gate before a story
goes to narration, where repetition a silent reader skims is
glaring read aloud. Runs at max effort (real reasoning work,
worth the spend); findings land in audit_findings and print.

Also hardens the gen + cleanup directives to hunt repetition at
the source: re-phrase recurring motifs fresh, no stacked template
anaphora, dialogue echoed verbatim at most once.

Migration 0010: 'prose_audit' generation_runs.kind, 'repetition'
audit_findings.area.
2026-05-15 11:19:04 -07:00

20 lines
921 B
SQL

-- The prose-quality audit pass: a QC gate that reads a finished
-- story end to end and flags repetition, template tics, self-
-- restatement and continuity drift before it goes to narration.
-- Repetition a silent reader skims is glaring once narrated aloud.
-- Allow 'prose_audit' as a generation_runs.kind.
ALTER TABLE generation_runs DROP CONSTRAINT generation_runs_kind_check;
ALTER TABLE generation_runs ADD CONSTRAINT generation_runs_kind_check
CHECK (kind = ANY (ARRAY[
'gen', 'cleanup', 'audit', 'summary', 'embed',
'narrate_prep', 'rewrite', 'prose_audit'
]));
-- 'repetition' is a first-class audit finding area.
ALTER TABLE audit_findings DROP CONSTRAINT audit_findings_area_check;
ALTER TABLE audit_findings ADD CONSTRAINT audit_findings_area_check
CHECK (area = ANY (ARRAY[
'character', 'continuity', 'tone', 'fact',
'timeline', 'repetition', 'other'
]));