fix(family): a decision read as precedent says its reason once - to_brief for precedents and idea history; the decision log keeps the full row (#5131)
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 53s
CI & Build / integration (push) Successful in 1m13s
CI & Build / Python tests (push) Successful in 1m54s
CI & Build / Build & push image (push) Successful in 40s

Each decision stored its reason three times (reason, before.reason, after.reason)
and a promotion carried the whole criteria reasoning in evidence. Precedents
(assess, promote, get_family_adoption, get_family_idea) and get_family_idea's
history now serve FamilyDecision.to_brief(): reason once, before/after as status,
canon_version and platforms, evidence as the cited list. list_family_decisions
and the decision echoed back by a write keep to_dict. The precedent count was
already bounded at five.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 18:30:48 -04:00
co-authored by Claude Opus 5.5
parent 07169e1274
commit f006f15058
6 changed files with 88 additions and 6 deletions
+1 -2
View File
@@ -545,8 +545,7 @@ async def assessment_precedents(user_id: int, project_id: int, idea_id: int,
for d, idea_title, project_title in rows:
if not await access.can_read_project(user_id, d.project_id):
continue
item = d.to_dict()
item.update({"idea_title": idea_title, "project_title": project_title})
item = {**d.to_brief(), "idea_title": idea_title, "project_title": project_title}
if d.idea_id == idea_id:
item["relation"] = "same idea, another project"
out_same.append(item)