From 5fa76a09b4651462c49577d05f7e8ac58ca13a32 Mon Sep 17 00:00:00 2001 From: Chaim Date: Sat, 6 Jun 2026 19:25:13 +0000 Subject: [PATCH] =?UTF-8?q?feat(style-acq=20T8):=20analyze=5Fcorpus=20?= =?UTF-8?q?=E2=80=94=20=D7=94=D7=A1=D7=A8=D7=AA=20LIMIT=2020=20(=D7=9B?= =?UTF-8?q?=D7=99=D7=A1=D7=95=D7=99=2048/48)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LIMIT 20 קבוע השמיט בשקט שליש מקורפוס דפנה מחילוץ author-features שהפרופיל של הכותב (T0) נסמך עליו. עכשיו limit=0 (ברירת-מחדל) = כל הקורפוס; פרמטר lim>0 אופציונלי לתקרה. G11. Co-Authored-By: Claude Opus 4.8 (1M context) --- mcp-server/src/legal_mcp/services/style_analyzer.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mcp-server/src/legal_mcp/services/style_analyzer.py b/mcp-server/src/legal_mcp/services/style_analyzer.py index 1103807..810b0b1 100644 --- a/mcp-server/src/legal_mcp/services/style_analyzer.py +++ b/mcp-server/src/legal_mcp/services/style_analyzer.py @@ -109,26 +109,30 @@ SYNTHESIS_PROMPT = """\ """ -async def analyze_corpus(appeal_subtype: str = "") -> dict: +async def analyze_corpus(appeal_subtype: str = "", limit: int = 0) -> dict: """Analyze the style corpus and extract/update patterns. Args: appeal_subtype: filter by appeal subtype (e.g. 'betterment_levy', 'building_permit'). Empty string = all decisions. + limit: max decisions to analyze. 0 = ALL (T8 — full 48/48 coverage feeds the + author-features the writer's profile relies on; the old LIMIT 20 silently + dropped a third of Dafna's corpus). Returns summary of patterns found. """ pool = await db.get_pool() + lim_sql = f" LIMIT {int(limit)}" if limit and limit > 0 else "" async with pool.acquire() as conn: if appeal_subtype: rows = await conn.fetch( "SELECT full_text, decision_number FROM style_corpus " - "WHERE appeal_subtype = $1 ORDER BY decision_date DESC LIMIT 20", + "WHERE appeal_subtype = $1 ORDER BY decision_date DESC" + lim_sql, appeal_subtype, ) else: rows = await conn.fetch( - "SELECT full_text, decision_number FROM style_corpus ORDER BY decision_date DESC LIMIT 20" + "SELECT full_text, decision_number FROM style_corpus ORDER BY decision_date DESC" + lim_sql ) if not rows: -- 2.49.1