d7201736f2075ccd3390165e65a2babea6691b5f
The learning loop measured anti-patterns but never corrected them. style_distance detects markdown headers / bullet lists / mid-paragraph mini-lists (from the canonical lessons.ANTI_PATTERNS), but the writer only received anti-pattern guidance if a chair `anti_patterns` override existed in appeal_type_rules — and none does. So _build_style_context's `if ov:` branch injected nothing, the writer was never told to avoid them, and drafts kept emitting them (8137: 28 hits, the worst, newest — anti-patterns were trending UP, not down). Anti-patterns are structural invariants of Dafna's voice (continuous legal narrative — no markdown, no bullets), not overridable preferences. So inject the canonical ANTI_PATTERNS notes ALWAYS, from the same list style_distance measures against (single source of truth), with any chair additions layered on top. This closes the measure-but-don't-correct gap: the next draft should show the markdown/ bullet anti-patterns drop, and Path A (style_distance_history) will confirm it. Invariants: G1 (correct at source — the writer, not a post-hoc stripper), G2 (one canonical anti-pattern list shared by detection and instruction — no parallel list), INV-LRN4 (closes the feedback half of the draft↔final loop). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Description
AI Legal Decision Drafting System — MCP server, web upload, RAG search
Languages
Python
65.8%
TypeScript
32.2%
JavaScript
1%
Shell
0.7%
CSS
0.2%