feat(style-acq T12): /methodology — קטגוריות ביטויי-מעבר + אנטי-דפוסים

מרחיב את עורך-הפרופיל ב-/methodology עם 2 קטגוריות נוספות שהכותב (T15)
והמדד (T7) צורכים — כך שהיו"ר עורכת אותן והעריכה זורמת לכתיבה:

- app.py: _METHODOLOGY_DEFAULTS += transition_phrases (מקובץ לפי תוצאה) +
  anti_patterns (מ-lessons.ANTI_PATTERNS). דרך ה-CRUD הגנרי הקיים (appeal_type_rules).
- block_writer (T15 loop): קורא overrides גם ל-transition_phrases + anti_patterns.
- web-ui: GenericMethodologyPanel (עורך key→JSON) + 2 טאבים ב-/methodology.

voice_invariants (doc) — נדחה (לא key-value). G11, INV-LRN4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 19:08:44 +00:00
parent dc0936adf9
commit e4fbda6c1f
4 changed files with 137 additions and 0 deletions

View File

@@ -3995,12 +3995,27 @@ from legal_mcp.services.lessons import (
GOLDEN_RATIOS,
DISCUSSION_RULES,
CONTENT_CHECKLISTS,
ANTI_PATTERNS,
TRANSITION_PHRASES,
)
def _transition_phrases_by_bucket() -> dict[str, list[str]]:
"""Group TRANSITION_PHRASES into editable buckets by outcome (None→universal)."""
out: dict[str, list[str]] = {}
for p in TRANSITION_PHRASES:
bucket = p.get("outcome") or "universal"
out.setdefault(bucket, []).append(p["phrase"])
return out
_METHODOLOGY_DEFAULTS: dict[str, dict] = {
"golden_ratios": {k: {s: list(v) for s, v in sec.items()} for k, sec in GOLDEN_RATIOS.items()},
"discussion_rules": dict(DISCUSSION_RULES),
"content_checklists": dict(CONTENT_CHECKLISTS),
# T12 — editable abstract-profile categories the writer (T15) + metric (T7) consume.
"transition_phrases": _transition_phrases_by_bucket(),
"anti_patterns": {ap["name"]: {"regex": ap["regex"], "note": ap["note"]} for ap in ANTI_PATTERNS},
}
_VALID_CATEGORIES = set(_METHODOLOGY_DEFAULTS.keys())