block_writer: Rewrote block-zayin prompt to require synthesis by topic
instead of listing each claim separately. Now produces 3 organized
sections (appellants 8, committee 6, permit applicants 3+) instead
of 40 scattered paragraphs. Target: 800-1500 words.
claims_extractor: Fix markdown code block stripping (same bug as
qa_validator had). Enables parsing claims from Claude responses
wrapped in ```json blocks.
Tested on Hecht: block-zayin from 40 paragraphs/1049 words to
17 organized paragraphs/1039 words. Structure now matches Dafna's
original (3 parties, grouped by topic).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
block_writer: new renumber_all_blocks() function that renumbers all
paragraphs across all blocks sequentially (1, 2, 3...). Handles both
plain "N." and bold "**N.**" formats. Added missing 'import re'.
qa_validator: sequential_numbering check now matches bold-formatted
numbers (**N.**) in addition to plain (N.).
Tested on Hecht: renumbered 115 paragraphs across 7 blocks, QA 6/6.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
block_writer: _build_precedents_context now searches both
paragraph_embeddings (other decisions by Dafna) and case_law_embeddings
(precedent case law). Previously only searched document_chunks which
had no cross-case data. Now returns ~2400 chars from 3 other decisions.
processor: Step 1.6 auto-updates case appellants/respondents from
classifier results when they're empty. Prevents blank party fields.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
claims_coverage now uses Claude Haiku to check if each claim is
semantically addressed in the discussion, not just keyword-matched.
- Sends all claims + discussion to Claude in one API call
- Returns addressed/partial/missing for each claim
- Handles markdown code block wrapping in response
- max_tokens 4096 (was 2048) for 48+ claims
Result on Hecht: 45/48 addressed (94%), 1 partial, 3 missing.
The 3 missing are genuinely unaddressed (personal/procedural claims).
Previously keyword check showed 47/48 but missed semantic gaps.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
block_writer: _build_claims_context now filters out block-zayin claims
(from final decision) and uses only claims from original pleadings.
Reduces noise from 78 to 48 real claims for Hecht case.
qa_validator: claims_coverage check rewritten:
- Filter block-zayin claims (same reason)
- Keyword-based matching instead of 3-word phrase matching
- 25% keyword overlap threshold (was: any 3-word match)
- Allow up to 20% uncovered claims before failing
- Check both block-yod and block-zayin for coverage
Result: Hecht case QA goes from 4/6 to 6/6, 47/48 claims covered (98%).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add minimum word count guidance (2000-4000 words)
- Number each claim in claims_context for explicit tracking
- Require 3-5 case law citations minimum
- Fix max_tokens > budget_tokens for extended thinking
- Use streaming for opus+thinking requests (>10min timeout)
Tested on Hecht case: block-yod improved from 1039 to 1927 words.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously matched any word after תב"ע (e.g., "תב"ע ואין", "תב"ע קיפחה").
Now requires a plan number (digits/hyphens) — reduces false positives from 24 to 4
on the Hecht case test.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Expose case management, search, workflow status, and drafting tools
via HTTP endpoints for the Paperclip plugin to consume.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Upload interface now supports three targets:
- Ezer Mishpati case documents
- Ezer Mishpati training corpus
- Din Leumi NI court decisions (new)
Din Leumi uploads auto-extract metadata (court, judge, date, parties,
topics, outcome) using Claude API, eliminating manual form filling.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Coolify requires curl or wget in the container for HTTP healthchecks.
Removed custom HEALTHCHECK instruction - Coolify manages it via UI settings.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Coolify requires curl/wget for HTTP healthchecks on Dockerfile deployments,
but the python:3.12-slim image doesn't include them. Use python3 urllib instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add expected_outcome field to cases (rejection/partial/full/betterment_levy)
- New lessons.py module with golden ratios, templates, and drafting guidance per outcome type
- Style analyzer now uses Opus with full decision text (no truncation), with multi-pass fallback for large corpora
- Drafting tool provides outcome-specific templates, section guidance, and ratio comments
- Improved JSON extraction with bracket-matching fallback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ezer Mishpati - AI legal decision drafting system with:
- MCP server (FastMCP) with document processing pipeline
- Web upload interface (FastAPI) for file upload and classification
- pgvector-based semantic search
- Hebrew legal document chunking and embedding