diff --git a/mcp-server/src/legal_mcp/services/block_writer.py b/mcp-server/src/legal_mcp/services/block_writer.py index 1026a7a..38caccb 100644 --- a/mcp-server/src/legal_mcp/services/block_writer.py +++ b/mcp-server/src/legal_mcp/services/block_writer.py @@ -983,6 +983,22 @@ async def _build_style_context(practice_area: str = "") -> str: ("anti_patterns", "אנטי-דפוסים (להימנע)"), ): ov = await db.get_methodology_overrides(cat) + if cat == "anti_patterns": + # Anti-patterns are STRUCTURAL INVARIANTS of Dafna's style (no + # markdown headers, no bullet lists, no mid-paragraph mini-lists — + # she writes continuous legal narrative). They must reach the writer + # ALWAYS, from the SAME canonical list style_distance measures against + # (lessons.ANTI_PATTERNS) — otherwise the loop detects them but never + # corrects them, and drafts keep emitting them (the gap that left + # 8137 with 28 hits). Chair additions layer on top; they never + # remove the canonical ones. + from legal_mcp.services.lessons import ANTI_PATTERNS as _ANTI + learned.append(f"\n**{label} — כתוב נרטיב משפטי רציף; הימנע מ:**") + for ap in _ANTI: + learned.append(f"- {ap['note']}") + for k, v in (ov or {}).items(): + learned.append(f"- (יו\"ר) {k}: {json.dumps(v, ensure_ascii=False)}") + continue if ov: learned.append(f"\n**{label} — ערכי היו\"ר (גוברים על ברירת-המחדל):**") for k, v in ov.items():