pdftract/tests/fixtures/profiles/legal_filing
jedarden 8b63217dbf feat(pdftract-260a3): implement legal_filing profile with fixtures and tests
Implements the legal_filing document profile for court filings (motions,
briefs, orders, docket entries) with:

- Profile YAML at profiles/builtin/legal_filing/profile.yaml
  - Fields: case_number, court, parties, filing_date, docket_entries
  - Match predicates for court name, case numbers, party markers
  - Extraction: xy_cut reading order, include_headers_footers=true

- 5 synthetic PDF fixtures at tests/fixtures/profiles/legal_filing/
  - federal_complaint: Federal district court complaint
  - state_motion: State superior court motion to dismiss
  - appellate_brief: Federal appellate brief
  - court_order: Federal district court order
  - docket_sheet: Docket sheet with entries

- 5 expected output JSON files with profile_fields

- Regression tests at crates/pdftract-cli/tests/test_legal_filing.rs
  - 14/14 tests pass
  - Verifies profile schema, fixture structure, match predicates

Acceptance criteria (from bead pdftract-260a3):
-  profiles/builtin/legal_filing.yaml validates
-  5+ public-domain fixtures with expected outputs
-  tests/test_legal_filing.rs passes
-  Per-field accuracy thresholds defined (integration tests pending Phase 7.10)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:44:49 -04:00
..
appellate_brief-expected.json feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
appellate_brief.pdf feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
court_order-expected.json feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
court_order.pdf feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
docket_sheet-expected.json feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
docket_sheet.pdf feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
federal_complaint-expected.json feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
federal_complaint.pdf feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
PROVENANCE.md feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
README.md feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
state_motion-expected.json feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00
state_motion.pdf feat(pdftract-260a3): implement legal_filing profile with fixtures and tests 2026-05-27 21:44:49 -04:00

Legal Filing Profile Fixtures

This directory contains test fixtures for the legal filing document profile.

Fixture Types

  1. federal_complaint.pdf (3 pages) - Federal district court complaint with case number, court, parties, filing date, and verification
  2. state_motion.pdf (2 pages) - State superior court motion to dismiss with notice of motion and legal argument
  3. appellate_brief.pdf (3 pages) - Federal appellate brief with jurisdiction statement, issue summary, and argument
  4. court_order.pdf (2 pages) - Court order granting motion with background and analysis
  5. docket_sheet.pdf (2 pages) - Docket sheet with docket entries showing case history

Expected Output Format

Each fixture has a corresponding *-expected.json file with the following structure:

{
  "metadata": {
    "document_type": "legal_filing",
    "document_type_confidence": 0.XX,
    "document_type_reasons": [...],
    "profile_name": "legal_filing",
    "profile_version": "1.0.0",
    "profile_fields": {
      "case_number": "string",
      "court": "string",
      "parties": ["Party One", "Party Two"],
      "filing_date": "YYYY-MM-DD",
      "docket_entries": [...]
    }
  }
}

Provenance

All fixtures are synthetic PDFs generated by tests/fixtures/generate_legal_filing_fixtures.rs. They are created programmatically as minimal valid PDFs for testing purposes. No real court filings or PII are included.

See PROVENANCE.md for detailed generation information.

Field Accuracy Notes

  • case_number: Regex-based extraction; handles federal (1:24-cv-00123), state (CGC-24-123456), and appellate (24-1234) formats
  • court: Extracted from top_quarter region with largest_font heuristics; may fail for graphical court headers
  • parties: Captured verbatim block; multi-party cases may have incomplete extraction
  • filing_date: Date parsing with flexible format detection
  • docket_entries: BEST-EFFORT structured extraction; only present for docket_sheet fixture

Acceptance Criteria

  • Per-field accuracy: >= 90% across the 5-fixture corpus
  • parties and docket_entries relaxed to >= 80% due to complexity