Commit Graph

13 Commits

Author SHA1 Message Date
tocmo0nlord
53285ed5a6 Step 11: DocuSeal e-signature (client-facing docs; mocked)
familylaw.docuseal.client (AbstractModel): _create_submission isolates the real
DocuSeal Pro API call (the mock point); send() records submission + flips status.
Pro-tier + internet-facing/isolated-host caveats documented in-module.

familylaw.document (_inherit): signature_status/submission id/signer_email/signed_date.
- action_send_for_signature: attorney-only + requires APPROVED (Gate 1 holds);
  requires signer email. Court filings stay /s/ + Portal, NOT DocuSeal.
- _process_signature_event: webhook handler core — flips sent->signed (or declined);
  unknown submissions are a safe no-op (never raises on stray events).

controllers/main.py: thin POST /familylaw/docuseal/webhook (public, csrf off, shared
-secret check, fail-closed) delegating to the handler. The one internet-facing route.
Send-for-signature button + signature fields on the document form.

Tests (familylaw_step11, DocuSeal mocked): cannot send draft/in-review (Gate 1);
approved sends + records submission; requires signer email; attorney-only; webhook
marks signed/declined; signed alias; unknown-submission no-op.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 04:23:55 +00:00
tocmo0nlord
91d4cec0e0 Step 10: emergency workflow (12.941 pick-up/removal) — fork + attachment block
familylaw.emergency.motion (+ familylaw.emergency.attachment):
- have-order-vs-not FORK: action_seed_requirements seeds different required
  attachments (existing-order path = certified copy + proposed order; no-order path =
  verified motion/sworn affidavit + proposed order)
- MISSING-ATTACHMENT BLOCK: _ensure_complete raises if any required attachment is
  unprovided (or no checklist seeded); action_mark_ready / action_file gated on it
- open_for_case() uses the case's open proceeding (fast-path matter from Step 2)

Wizard + views + menu; "Emergency Motion" button on the case form (shown when the
matter is_emergency). ACL added.

Tests (familylaw_step10): fork seeds differ; missing/partial blocks ready; complete
allows ready + file; file requires ready; no-checklist blocks; intake fast-path
(urgency -> is_emergency case) then motion creation; motion uses open proceeding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 04:21:39 +00:00
tocmo0nlord
7eb944c83c Step 9: child-support modification workflow (end to end)
familylaw.support.modification — wires Steps 1-8 for a support modification:
- open_for_case() opens a NEW modification proceeding under the same case (locked
  decision) and sets a 20-day answer deadline on it
- 15%/$50 substantial-change PRESUMPTION: threshold = max($50, 15% of current);
  meets_threshold computed. Explicitly a deterministic test, NOT a prediction of
  whether the court grants it (no outcome/probability — EXCLUDED capability honored)
- DOR / Title IV-D flag; retroactivity to filing date + note
- prior-judgment handling: action_extract_prior_judgment produces a plain summary +
  FLAGGED interpretation QUESTIONS (carries a not-a-conclusion disclaimer); the model
  has no conclusion/ruling field by design. AI call mocked.

Wizard + views + menu; "Open Support Modification" button on the case form (shown
for support_modification matters). ACL added.

Tests (familylaw_step9): new proceeding created + distinct from original; threshold
15% prong, $50 prong (met/not), change %, no-change; 20-day answer deadline + date
math; DOR flag; retroactivity date; extraction summarizes + flags (not concluded,
no conclusion field); extraction logs a done ai.task.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 04:19:23 +00:00
tocmo0nlord
83f970a031 Step 8: discovery + Rule 12.351 subpoena (objection-window gate + pro-se/attorney routing)
familylaw.discovery.request (per proceeding):
- discovery_type incl. nonparty_production (Rule 12.351)
- HARD objection-window gate: a non-party subpoena cannot issue before notice is
  served + the 10-day objection window elapses, or while an objection is pending
  (_ensure_objection_window_elapsed). Party discovery is not gated.
- issuance_route computed from representation: attorney issues directly, pro se via
  the clerk (Forms & Playbook Part C)
- on issue: Notice of Issuance served the SAME DAY; response due +30 days
- objection_deadline (+10, weekend roll) and response_due (+30, roll) computed
- VERIFY note: Rule 12.410 subpoena amendment eff. Oct 1 2025

Proceeding gets a Discovery tab; discovery views + menu + ACL.

Tests (familylaw_step8, fixed dates): cannot issue before notice / before window /
with pending objection; can issue after window; 10-day deadline math with weekend
roll; same-day notice of issuance; attorney vs clerk routing; party production not
gated; serve-notice transition; proceeding linkage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 04:16:25 +00:00
tocmo0nlord
f8029eafa4 Step 7: citation gate (Gate 2) — fail-closed verification, filing block, research loop
familylaw.citation.verifier (AbstractModel): fail-CLOSED engine
- _verify_courtlistener (primary) + _verify_fallback (secondary) isolate the only
  network calls (mock points). FL coverage caveat documented.
- verify_citation(): only an affirmative found+good_law -> 'verified'; found+!good ->
  'rejected'; affirmative no-record -> 'not_found'; any source unavailable ->
  stays 'unverified' (FAIL CLOSED, never assume good). Records source/date/note,
  posts to chatter.

familylaw.citation: verification fields + action_verify (engine), attorney-only
action_attorney_verify (audited human attestation), action_reject.

familylaw.document — Gate 2 wired:
- unverified_citation_count; _ensure_citations_verified() raises listing bad cites
- action_mark_filed / action_mark_sent now enforce Gate 1 AND Gate 2
- action_request_filing validates both gates (staff-runnable); action_verify_citations
- Gate 2 banner + Verify Citations / Request Filing buttons on the form

familylaw.research.agent (AbstractModel): in-Odoo research loop (propose -> verify
each fail-closed -> synthesize). Memo born ai_draft; synthesis uses only verified
authority; unverified cites block filing. FastAPI orchestrator is the optional swap.

Tests (familylaw_step7, all externals mocked): verified only on found+good_law,
not_found/rejected paths, primary-down+fallback verifies, both-down fail-closed,
attorney attest (+permission), filing BLOCKED on unverified / allowed when all
verified / no-citations files, send blocked, unverified count, research loop
produces ai_draft + verifies, hallucinated cite -> not_found -> blocks filing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 04:13:58 +00:00
tocmo0nlord
941da091b8 Step 6: Claude client + ai.task ledger + drafting agent + citation ledger (Tier 3)
TIER 3 scaffolding — structure built, legal CONTENT born unapproved/unverified and
NOT authoritative until attorney validation. External calls mocked in all tests.

familylaw.ai.client (AbstractModel service):
- _route_model() pluggable provider seam (Ollama = future config flip)
- BLOCKED_TASK_TYPES (trust_billing/reconciliation/iota) RAISE before any call —
  trust/billing never reaches a model (Bar Rule 5-1.1, IOTA)
- per-task token ceiling caps max_tokens; config via ir.config_parameter
- _call_provider isolates the real HTTPS call (the single mock point)
- generate() routes, calls, and logs an ai.task; returns (result, task)

familylaw.ai.task — the audit/economics ledger: model_used, prompt/completion/total
tokens, estimated cost_usd (per-model price table, flagged estimate), latency_ms,
request/response summaries, error, links to case/proceeding/document.

familylaw.citation — born 'unverified' (Gate 2 verification + filing block come in
Step 7); is_verified computed; linked to document + source ai.task.

familylaw.document.ai_assemble(): single-shot drafting agent — doc born ai_draft
(source ai), proposed citations born unverified, task linked. NOT auto-approved.
Plus familylaw.ai.draft.wizard for the UI walkthrough; Citations tab on document;
AI Draft button on proceeding; AI Tasks + Citations menus.

Tests (familylaw_step6, mocked _call_provider): doc born ai_draft, ai.task logged
with model+tokens+cost+latency, citations born unverified, token ceiling caps
max_tokens, trust/billing blocked before any provider call, provider error marks
task failed, deterministic cost estimate, missing-key raises, AI draft cannot be
filed even by an attorney (Gate 1 intact).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 04:10:01 +00:00
tocmo0nlord
82f9d3c0e8 Step 5: mandatory disclosure (Rule 12.285) — checklist + financial affidavit
Three per-proceeding models:
- familylaw.disclosure.item: Rule 12.285 checklist; is_mandatory items refuse
  waiver in code (action_waive raises); non-mandatory can be waived
- familylaw.financial.affidavit: form-by-income selection — short 12.902(b) below
  the $50,000 gross-annual threshold, long 12.902(c) at/above it; 45-day due date
  (Rule 12.285(e)) with weekend roll; line totals + net worth
- familylaw.fin.line: income/expense/asset/liability line items

All thresholds/counts flagged "verify current rule" (volatile FL law).
proceeding gets disclosure_item_ids + affidavit_ids, Seed Disclosure Checklist
button, and Disclosure / Financial Affidavits notebook tabs. Views + menu + ACL.

Tests (familylaw_step5): 15 tests — form selection across the threshold boundary
(49999 short / 50000 long / 80000 long), recompute on income change, 45-day due
with/without weekend roll (fixed dates), mandatory-cannot-waive, non-mandatory
waive, totals + net worth, idempotent seeding, per-proceeding isolation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 04:04:57 +00:00
tocmo0nlord
a6f8d31316 Step 4: deadline engine (per-proceeding clocks, weekend roll, overdue cron, calendar mirror)
familylaw.deadline — a procedural clock attached to a PROCEEDING:
- Deterministic due_date: trigger_date + days, with Rule-2.514-style weekend
  roll-forward (_roll_forward); _holiday_dates() hook left empty by design
  (holidays are jurisdiction/year-specific — content-maintenance concern)
- STANDARD_OFFSETS (answer 20 / disclosure 45 / discovery 30 / objection 10) as
  defaults; per-record `days` override. Flagged "verify current rule".
- state pending/done/waived/overdue; is_overdue computed + searchable
- _cron_flag_overdue daily ir.cron flips pending+past -> overdue, audited
- calendar.event mirror auto-created/updated on date changes (allday)
- proceeding.deadline_ids + action_seed_standard_deadlines (idempotent)

Adds 'calendar' dependency, data/familylaw_cron.xml, deadline views + menu,
Deadlines tab + Seed button on proceeding form, security rules.

Tests (familylaw_step4): 20 tests with FIXED dates — 20/45/30-day math, weekend
roll (Sat/Sun -> Mon), type-default vs explicit days, overdue detect, cron flag,
is_overdue search, calendar mirror create+update, per-proceeding isolation,
idempotent seeding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 04:02:20 +00:00
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
tocmo0nlord
8bbae06b06 Step 2: parties, children, issues, proceeding layer, conflict screening, intake wizard
Models:
- familylaw.party — party to a matter (client/opposing/opposing counsel/other)
- familylaw.child — minor child with DOB constraint (rejects future + >25 years)
- familylaw.issue — contested issue (time-sharing, support, equitable distribution, etc.)
- familylaw.proceeding — unit of legal action; auto-created on every case create()
- familylaw.conflict.hit — records of conflict screening hits for attorney review
- familylaw.intake.wizard — multi-step intake questionnaire (TransientModel)

familylaw.case updates:
- case_number (indexed, unique, searchable), county, is_emergency, urgency_notes
- One2many to party/child/issue/proceeding/conflict_hit
- create() override: auto-opens an initial proceeding typed by case_type
- action_run_conflict_screening(): full-DB party + client name search; never auto-clears gate

Intake wizard (conditional strictness):
- Triage step first; urgency screen selects emergency vs. standard path
- Emergency fast-path: create on minimum facts (who + urgency flags), defer rest
- Standard strict path: matter name + client + case type + county required
- Modification branch (step 3) for support/parenting/alimony modifications
- Caller concern logged on case as attorney question; software never answers it
- Runs conflict screening on completion

Views: party/child/issue/proceeding/intake form+list+inline views; case form now
shows emergency banner, conflict warning, notebook tabs for all related records;
search extended to find by party name, child name, case_number (filter_domain).
Menu: "New Intake" entry launches the wizard.

Security: access rules for all 5 new models + intake wizard (base.group_user).

Tests (familylaw_step2): 34 tests across 4 classes covering:
- Initial proceeding creation and type mapping
- Multiple independent proceedings per case
- DOB validation (future + implausible age)
- Search by party name / child name / case_number
- Conflict screening (finds client match, does not auto-clear, hit count, no false
  positives for unrelated parties)
- Standard path strict validation (missing name/type/county/client each rejected)
- Emergency path (creates case on caller name alone, sets is_emergency, captures notes)
- Caller concern logged on chatter, never answered by software

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 03:43:10 +00:00
tocmo0nlord
8c716d6ba0 Merge remote-tracking branch 'origin/main' 2026-06-02 03:14:59 +00:00
tocmo0nlord
0d53967422 Initial commit — Step 1 complete: case spine, lifecycle, attorney gates
Delivers the validated Step 1 slice of the Active Blue Family Law platform
(Odoo 18 Community module `activeblue_familylaw`):
- familylaw.case model: identity, team, representation flag, conflict_check_cleared gate
- Full lifecycle state machine (intake→engaged→disclosure→discovery→mediation→hearing→closed)
- Attorney-only guards enforced in Python + view groups=
- Security groups (Family Law/Staff, Family Law/Attorney), model access rules
- List, form, and search views (Odoo 18 <list> syntax; no attrs=/states=)
- Family Law app menu with Configuration placeholder
- 10 tagged unit tests (familylaw_step1): transitions, conflict gate, attorney-only, audit
- CLAUDE.md, BUILD_PLAN.md, START_HERE.md: full design brief and step contract

Step 2 (parties, children, issues, proceeding model, conflict screening,
intake questionnaire) is the next build target.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 03:14:33 +00:00
8f4e664360 Upload files to "/" 2026-06-02 03:06:02 +00:00