feat(status): single source of truth for case-status model + canonicalize intermediates #382

Merged
chaim merged 1 commits from worktree-status-single-source into main 2026-06-30 19:32:00 +00:00
Owner

מתקן את חוסר-העקביות שזיהית (1043-02-26): התגית, ה-stepper והפופאפ סיפרו שלוש "שפות" שונות כי analyst_verified נפל בין הקנוני ל-legacy.

תיקון-שורש — מקור-אמת יחיד + קינון מצבי-הביניים

  • חדש: case_status_model.py — הרשומה היחידה: רשימת StatusDef מסודרת (key/label/description/phase/selectable/terminal/on_enter), 5 השלבים, STATUS_ORDER, ו-assertion שה-enum תואם. on_enter = השער שבו "סטטוס יבצע משהו" — מוגדר ליד ההגדרה (דיספטצ'ר עתידי).
  • models.CaseStatus: analyst_verified + research_complete הפכו לסטטוסים קנוניים מהמעלה הראשונה (הסוכנים מציבים אותם → מקומם במודל).
  • tools/cases.py: שומר ה-forward-only נגזר מהרשומה (לא רשימה inline).
  • GET /api/status-model חושף את המודל (ה-frontend נגזר מולו).
  • case-status.ts מיישר: 2 הביניים עברו מה-legacy ל-CASE_STATUSES/PHASES/labels/descriptions; status-badge הורחב. כך התגית (סטטוס), ה-stepper (השלב שלו) והפופאפ (כולל אותו) מסכימים.

Invariants

  • G2 — מאחד את הגדרות-הסטטוס המפוזרות (enum + STATUS_ORDER inline + 2 מפות-תוויות ב-frontend) על authority אחד + מראָה מתועדת. אין רשימת-סטטוס מקבילה.
  • יישור-פרומפטי-הסוכנים + backfill = בנפרד (PR הבא).

בדיקות

py_compile · tsc --noEmit · eslint .

לאחר deploy: להריץ npm run api:types כדי לסנכרן את enum-הסטטוס ב-openapi.

🤖 Generated with Claude Code

מתקן את חוסר-העקביות שזיהית (1043-02-26): התגית, ה-stepper והפופאפ סיפרו שלוש "שפות" שונות כי `analyst_verified` נפל בין הקנוני ל-legacy. ## תיקון-שורש — מקור-אמת יחיד + קינון מצבי-הביניים - **חדש: `case_status_model.py`** — הרשומה היחידה: רשימת `StatusDef` מסודרת (key/label/description/phase/selectable/terminal/**on_enter**), 5 השלבים, `STATUS_ORDER`, ו-assertion שה-enum תואם. **`on_enter`** = השער שבו "סטטוס יבצע משהו" — מוגדר ליד ההגדרה (דיספטצ'ר עתידי). - **`models.CaseStatus`**: `analyst_verified` + `research_complete` הפכו לסטטוסים קנוניים מהמעלה הראשונה (הסוכנים מציבים אותם → מקומם במודל). - **`tools/cases.py`**: שומר ה-forward-only נגזר מהרשומה (לא רשימה inline). - **`GET /api/status-model`** חושף את המודל (ה-frontend נגזר מולו). - **`case-status.ts`** מיישר: 2 הביניים עברו מה-legacy ל-CASE_STATUSES/PHASES/labels/descriptions; status-badge הורחב. כך **התגית (סטטוס), ה-stepper (השלב שלו) והפופאפ (כולל אותו) מסכימים**. ## Invariants - **G2** — מאחד את הגדרות-הסטטוס המפוזרות (enum + STATUS_ORDER inline + 2 מפות-תוויות ב-frontend) על authority אחד + מראָה מתועדת. אין רשימת-סטטוס מקבילה. - יישור-פרומפטי-הסוכנים + backfill = בנפרד (PR הבא). ## בדיקות `py_compile` ✅ · `tsc --noEmit` ✅ · `eslint` ✅. > לאחר deploy: להריץ `npm run api:types` כדי לסנכרן את enum-הסטטוס ב-openapi. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-30 19:31:52 +00:00
feat(status): single source of truth for the case-status model + canonicalize intermediates
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 4s
Lint — undefined names / undefined-names (pull_request) Successful in 11s
44f6915f0c
Fixes the case where the H1 chip, the pipeline stepper and the manual-changer
dropdown disagreed (e.g. 1043-02-26 on analyst_verified): the status sat between
the canonical 10 and a legacy bucket, so each surface read a different list.

Root fix — ONE authoritative status model + canonicalize the real intermediate
states (chair-approved):

- New mcp-server/.../case_status_model.py — the single registry: ordered
  StatusDef list (key/label/description/phase/selectable/terminal/on_enter),
  the 5 phases, STATUS_ORDER, phase_of/label_of, and a drift assertion that the
  CaseStatus enum matches it. `on_enter` is the seam for a status to *do*
  something on entry, declared next to its definition (no dispatcher wired yet).
- models.CaseStatus enum: analyst_verified + research_complete promoted to
  first-class canonical statuses (the agents set them — they belong in the
  model, not a legacy fallback).
- tools/cases.py: the forward-only STATUS_ORDER guard now derives from the
  registry instead of an inline list.
- GET /api/status-model exposes the model so the frontend mirror can be
  generated against it.
- web-ui case-status.ts mirrors it: the two intermediates moved from the
  legacy map into CASE_STATUSES / PHASES(thinking) / STATUS_LABELS /
  STATUS_DESCRIPTIONS; status-badge icons+tones extended. So the chip (status),
  stepper (its phase) and dropdown (now includes it) all agree.

Invariants: G2 — collapses the scattered status definitions (enum, inline
STATUS_ORDER, two frontend label maps) onto one backend authority + a documented
frontend mirror; no parallel status list remains. Agent-prompt alignment +
backfill follow in a separate change. py_compile + tsc + eslint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit d1ca1152b1 into main 2026-06-30 19:32:00 +00:00
chaim deleted branch worktree-status-single-source 2026-06-30 19:32:00 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ezer-mishpati/legal-ai#382