Embed full style guide in block prompts for Dafna's voice
_build_style_context rewritten from 10-line summary to comprehensive
style guide including:
- Tone rules per appeal type (warm for licensing, cold for levy)
- 15 mandatory expressions ("כידוע", "ברי כי", "אין בידנו לקבל")
- Discussion structure rules (continuous prose, conclusion first)
- Per-party phrasing templates (appellants, committee, permit applicants)
- DB patterns grouped by type (phrases, transitions, openings, closings)
This addresses the main quality gap: style rated 2/5 because the output
was "dry and overly formal" vs Dafna's "direct and clear" voice.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -568,12 +568,69 @@ async def _build_precedents_context(case_id: UUID, block_id: str) -> str:
|
|||||||
|
|
||||||
|
|
||||||
async def _build_style_context() -> str:
|
async def _build_style_context() -> str:
|
||||||
patterns = await db.get_style_patterns()
|
"""Build comprehensive style guide from DB patterns + SKILL.md rules.
|
||||||
if not patterns:
|
|
||||||
return "(אין דפוסי סגנון)"
|
Per Anthropic: explicit style instructions reduce generic output.
|
||||||
|
"""
|
||||||
lines = []
|
lines = []
|
||||||
for p in patterns[:10]:
|
|
||||||
lines.append(f"- [{p['pattern_type']}] {p['pattern_text']}")
|
# Core style rules (from SKILL.md analysis)
|
||||||
|
lines.append("""## כללי סגנון דפנה תמיר — חובה:
|
||||||
|
|
||||||
|
### טון:
|
||||||
|
- ערר רישוי (1xxx): חם יחסית, עם אלמנטים אנושיים
|
||||||
|
- ערר השבחה (8xxx): קר, יבש, מקצועי
|
||||||
|
- גוף ראשון רבים: "אנו סבורים", "מצאנו כי", "לדעתנו"
|
||||||
|
- ישיר ובהיר — לא אקדמי ולא מסורבל
|
||||||
|
|
||||||
|
### ביטויים ייחודיים (חובה להשתמש):
|
||||||
|
- "לפנינו..." (פתיחה)
|
||||||
|
- "כידוע..." (הצגת עקרון ידוע)
|
||||||
|
- "ברי כי..." / "ודוק..." (הדגשה)
|
||||||
|
- "אין בידנו לקבל" (דחיית טענה)
|
||||||
|
- "בטענה זו מצאנו טעם" (קבלת טענה)
|
||||||
|
- "יחד עם זאת" (מעבר לאיזון)
|
||||||
|
- "למעלה מן הצורך" / "נבקש שלא לצאת בחסר" (הרחבה)
|
||||||
|
- "הדברים מתחדדים שעה ש..." (חידוד)
|
||||||
|
- "מחד... מאידך... על כן..." (איזון לפני הכרעה)
|
||||||
|
- "לאור כל האמור לעיל" (סיכום)
|
||||||
|
- "ניתנה פה אחד היום" (סיום)
|
||||||
|
|
||||||
|
### מבנה דיון:
|
||||||
|
- אסה רציפה ללא כותרות משנה (חריג: נושאים נפרדים לחלוטין)
|
||||||
|
- מסקנה בפתיחה, לא בסוף
|
||||||
|
- מעברים טקסטואליים, לא כותרות
|
||||||
|
- ניטרול טענות חלשות לפני ניתוח מעמיק
|
||||||
|
- ציטוטי פסיקה כבלוקים מוגדלים
|
||||||
|
|
||||||
|
### טענות צדדים:
|
||||||
|
- עוררים: "העוררים טוענים כי...", "לטענתם...", "עוד ציינו כי..."
|
||||||
|
- ועדה: "הוועדה המקומית הציגה/הבהירה/הוסיפה כי..."
|
||||||
|
- מבקשי היתר: "מבקשי ההיתר דוחים מכל וכל...", "לטענתם...", "מבקשי ההיתר מציינים כי..."
|
||||||
|
""")
|
||||||
|
|
||||||
|
# DB patterns (actual examples from Dafna's decisions)
|
||||||
|
patterns = await db.get_style_patterns()
|
||||||
|
if patterns:
|
||||||
|
lines.append("### דפוסים שחולצו מהחלטות קודמות:")
|
||||||
|
grouped: dict[str, list] = {}
|
||||||
|
for p in patterns:
|
||||||
|
grouped.setdefault(p["pattern_type"], []).append(p)
|
||||||
|
|
||||||
|
type_names = {
|
||||||
|
"opening_formula": "פתיחה",
|
||||||
|
"transition": "מעברים",
|
||||||
|
"characteristic_phrase": "ביטויים אופייניים",
|
||||||
|
"closing_formula": "סיום",
|
||||||
|
"citation_style": "ציטוט",
|
||||||
|
}
|
||||||
|
for ptype in ["characteristic_phrase", "transition", "opening_formula", "closing_formula"]:
|
||||||
|
items = grouped.get(ptype, [])
|
||||||
|
if items:
|
||||||
|
lines.append(f"\n**{type_names.get(ptype, ptype)}:**")
|
||||||
|
for item in items[:8]:
|
||||||
|
lines.append(f"- {item['pattern_text']}")
|
||||||
|
|
||||||
return "\n".join(lines)
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user