Commit Graph

4 Commits

Author SHA1 Message Date
23c54b1b9f Align case stages to 5-stage spec and add Paralegal AI agent
Stage alignment:
- Replace the 11 procedural stages with the spec's 5-stage machine
  (Intake/Active/Discovery/Pre-Trial/Closed); only Closed is folded
- Make fl_stage_data.xml updatable (drop noupdate) so the rename applies on
  upgrade; keep fl_stage_intake/discovery/closed XML ids
- Update case search filters to the new stage names (Intake/Active/Discovery/Pre-Trial)

Issue-tag bug fix (fl_ai_engine):
- Rule-based tagging and caselaw matching compared snake_case keys against the
  human-readable seeded tag names, so they never matched and issue_tag_ids was
  never populated. Add RULE_KEY_TO_TAG_NAME and translate keys to real names
  before all fl.issue.tag / fl.caselaw lookups

Paralegal agent (fl.paralegal.agent, AbstractModel):
- on_stage_change(): fast rule-based pass fired automatically on stage entry and
  case creation — generates the stage task batch (idempotent), recalculates
  filing/service deadlines, cross-references statutes by issue tag + case type,
  posts a chatter summary. No Claude call, so it never blocks the workflow
- run_manual(): full pass adding a best-effort Claude procedural briefing with
  rule-based fallback; wired to a "Paralegal Review" button on the case form
- AI audit-time logging is guarded behind a fl.timesheet existence check
  (model not built yet)
- fl.case.write fires on_stage_change only when stage_id actually changes;
  create() generates the Intake batch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 19:12:53 +00:00
b8ab8494c7 Migrate AI engine to Claude API; convert stage field to Many2one Kanban model
- Replace fl.case.stage Selection field with Many2one → fl.case.stage model,
  enabling Kanban grouping and dynamic stage management
- Add FlCaseStage model (sequence, fold, description) and fl_stage_data.xml
  with all 11 procedural stages seeded with noupdate=1
- Migrate fl_ai_engine.py from Ollama/llama3.1 to Claude API
  (claude-sonnet-4-20250514); key from ir.config_parameter fl_ai.claude_api_key
- Fix stale field references in _rule_based_tagging and _build_case_context:
  employment/income now read from party_ids, timesharing fields corrected
- Add _fallback_complexity() for graceful degradation when API unavailable
- Add Kanban view to fl_case_views.xml; update action view_mode to kanban,tree,form
- Add fl.case.stage ACL entries to ir.model.access.csv

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 17:45:26 +00:00
Carlos Garcia
7ce691a394 Phase 5: Full AI engine + caselaw seed data (23 FL cases)
fl_ai_engine.py: Complete Ollama integration with 7-step pipeline:
rule-based issue tagging, caselaw matching (3rd DCA-prioritized),
case context serialization, prompt construction, Ollama HTTP call
(llama3.1 at 192.168.2.10:11434), JSON parsing with fence-strip,
and fl.analysis persistence with attorney referral chatter alert.

fl_caselaw_data.xml: 23 seeded Florida cases covering modification
threshold (Daly, Regan, Pimm, El Kohen, Rolfe), income imputation
(Barner, Sitterson), self-employment (Smith, Young), timesharing
(Freid, Kennedy, Boykin), domestic violence (Conlin, Kahle),
default judgment (Lindsey, North), residency (Fults), parenting
class (Maddox), fee waiver (Abdool, Kielbania), disclosure,
withholding, above-schedule, and discovery sanctions.

fl_case.py: trigger_ai_analysis() wired to engine.analyze_case();
returns form popup of fl.analysis result.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 23:39:41 -04:00
Carlos Garcia
1d52d85a78 Phase 1: core models, security, seed data, and backend views
Implements full Phase 1 of the activeblue_familylaw Odoo 18 module:
- 17 Python models (fl.case, fl.party, fl.child, fl.support.calculation,
  fl.fee.waiver, fl.income.withholding, fl.deadline, fl.hearing,
  fl.deposition, fl.discovery, fl.document, fl.caselaw, fl.analysis,
  fl.ai.engine, fl.argument, fl.statute, fl.issue.tag) + hr.expense extension
- 3 wizard stubs (intake, analysis, generate-packet)
- Security: 4 groups (admin/paralegal/portal-petitioner/portal-respondent)
  + record rules scoping portal users to their own cases
- Seed data: issue tags, FL statutes, FL DCF support schedule, ir.sequence
- 13 backend view XML files with FL 61.30 worksheet, fee waiver
  eligibility banner, DV safety resources, emancipation alerts
- Static CSS/JS stubs for Phase 6 portal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 18:52:04 -04:00