feat(arguments): פופאפ פרופוזיציות גולמיות בלחיצה על "מסתמך על N"
הקישור טיעון↔פרופוזיציות כבר נשמר ב-DB (legal_argument_propositions),
אך ה-UI הציג רק את המספר. מעשיר את get_legal_arguments באותו round-trip
(JOIN ל-claims) להחזיר supporting_propositions = {id, text, source_document},
ועוטף את שורת "מסתמך על N פרופוזיציות" ב-Popover שמציג את הטענות הגולמיות
verbatim עם מקור. שקיפות ועקיבוּת מהטיעון המאוגד חזרה לטענות-המקור.
- supporting_claims נשאר id-only (תאימות לאחור: מונה, צרכני MCP)
- supporting_propositions שדה חדש אופציונלי; fallback לטקסט סטטי כשחסר
- אין מסלול מקביל (G2) — העשרה של אותו endpoint; נרמול-במקור (G1)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -335,18 +335,30 @@ async def get_legal_arguments(
|
||||
case_id,
|
||||
)
|
||||
|
||||
# Pull supporting claim ids for each argument in one round-trip.
|
||||
# Pull supporting claims (id + full text) for each argument in one
|
||||
# round-trip. ``supporting_claims`` stays id-only for backwards compat
|
||||
# (counts, MCP consumers); ``supporting_propositions`` carries the text
|
||||
# so the UI can show the raw propositions without an extra fetch.
|
||||
arg_ids = [r["id"] for r in rows]
|
||||
supporting: dict[UUID, list[str]] = {}
|
||||
propositions: dict[UUID, list[dict]] = {}
|
||||
if arg_ids:
|
||||
joins = await conn.fetch(
|
||||
"""SELECT argument_id, claim_id
|
||||
FROM legal_argument_propositions
|
||||
WHERE argument_id = ANY($1::uuid[])""",
|
||||
"""SELECT lap.argument_id, lap.claim_id,
|
||||
c.claim_text, c.source_document, c.claim_index
|
||||
FROM legal_argument_propositions lap
|
||||
JOIN claims c ON c.id = lap.claim_id
|
||||
WHERE lap.argument_id = ANY($1::uuid[])
|
||||
ORDER BY c.claim_index""",
|
||||
arg_ids,
|
||||
)
|
||||
for j in joins:
|
||||
supporting.setdefault(j["argument_id"], []).append(str(j["claim_id"]))
|
||||
propositions.setdefault(j["argument_id"], []).append({
|
||||
"id": str(j["claim_id"]),
|
||||
"text": j["claim_text"],
|
||||
"source_document": j["source_document"],
|
||||
})
|
||||
|
||||
out: list[dict] = []
|
||||
for r in rows:
|
||||
@@ -354,5 +366,6 @@ async def get_legal_arguments(
|
||||
d["id"] = str(d["id"])
|
||||
d["case_id"] = str(d["case_id"])
|
||||
d["supporting_claims"] = supporting.get(r["id"], [])
|
||||
d["supporting_propositions"] = propositions.get(r["id"], [])
|
||||
out.append(d)
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user