skald/migrations/0011_dedup_pass.sql
Kayos 2820d173e8 forge: dedup pass — the fix half of the audit loop
Adds `skald dedup --story <id>`: reads a story's most recent
prose-audit findings and walks every chapter, handing the author
the chapter prose + the findings with instructions to rephrase
ONLY the flagged repetitions (each recurrence made distinct) and
fix flagged continuity errors — everything else stays verbatim.
A surgical dedup, not a rewrite. Overwrites body_md, clears
body_md_tts so the chapter is re-prepped before narration. High
effort (prose-craft). Migration 0011 adds the 'dedup' run kind.

Completes the QC loop: audit (find) -> dedup (fix) -> re-audit.
2026-05-15 14:49:08 -07:00

9 lines
483 B
SQL

-- The dedup pass: the fix half of the audit loop. Takes a chapter
-- plus the story's prose-audit findings and rephrases only the
-- flagged repetitions, leaving everything else verbatim.
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', 'dedup'
]));