Files
famlaw_v2/scripts
tocmo0nlord 979bbfa14a Step 3: documents + the attorney review gate (Gate 1)
familylaw.document — every piece of work product, attached to a PROCEEDING:
- States: ai_draft -> attorney_review -> approved (+ rejected, filed, sent)
- AI-sourced documents born in ai_draft
- Gate 1 enforced in code: _ensure_approved() blocks file/send unless approved;
  _ensure_attorney() restricts approve/reject/file/send to the attorney group
- approved_by_id / approved_date stamped on approval; cleared on reject
- mail.thread audit on every transition
- proceeding.document_ids One2many; case_id derived (stored) from proceeding

Views: document list/form/search + menu; inline documents tab on proceeding form.
Security + manifest + menu updated.

Also folds in a correctness fix for Steps 2-3 view bindings: replaced the invalid
`view_id="..."` attribute on x2many fields with canonical inline <list> subviews
(case notebook tabs + proceeding documents tab). Avoids load-order/attr issues.

Added scripts/validate_module.py: static gate (py compile, xml well-formed,
forbidden-construct scan, button->method mapping, manifest+ACL integrity).

Tests (familylaw_step3): 16 tests — born-draft, Gate 1 (no file/send unapproved
from draft or review), attorney-only approve/reject/file/send, full happy path,
reject clears approval + resubmit, audit, proceeding linkage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 03:58:48 +00:00
..