Skip to content

Judgments & classification

Partial

Participant, enrichment and classification storage exists; the complete producer and classification pipelines do not.

Code and tests

Keep original judicial text, participant identity and derived analysis distinct. Names, summaries and model scores must not silently become authoritative facts.

erDiagram
  judgments ||--o{ judgment_participations : involves
  persons ||--o{ judgment_participations : participates
  judgment_participations ||--o{ participation_roles : holds
  judgment_participations ||--o{ party_representations : lawyer
  judgment_participations ||--o{ party_representations : party
  judgments ||--o{ judgment_enrichments : enriches
  judgments ||--o{ judgment_classifications : receives
  categories ||--o{ judgment_classifications : labels
  taxonomies ||--o{ categories : defines
  category_prototype_sets ||--o{ category_prototypes : versions
  categories ||--o{ category_prototypes : represents

A person can be natural, legal or unresolved. Judge, lawyer and party are participation categories in a particular judgment. President, rapporteur, claimant and respondent are roles; one participation may hold multiple roles.

Retain observed names, addresses, raw roles and resolution provenance. Names alone cannot merge identities. Representation connects a lawyer to a party in the same judgment, with many-to-many edges; missing representation is unknown, not self-representation.

Preserve subject, description, outcome description, extracted outcome, awarded/claimed amounts, costs, currency and model/pipeline provenance. Missing amounts remain null. Map source-specific outcome encodings explicitly and retain raw values; a case outcome is not automatically every party’s outcome.

Enrichments reference the judgment. This does not establish exact text-snapshot provenance: source corrections require review or regeneration. Multiple extractions need an explicit selection policy. Derived summaries may aid discovery but must never be quoted as original judicial text.

Only judgments receive semantic classifications. Version taxonomies, categories and complete prototype sets independently of assignments. Each generated assignment records category, score, role, classifier version and compatible input/profile/prototype provenance.

Legacy clustering and cluster fallback are excluded. Use the semantic classification path; unknown imported provenance remains unknown. Hierarchies need valid parent relationships and cycle checks.

Vectors retain their exact input/hash and embedding profile. Analytics are rebuildable projections with source generation, formula and refresh metadata, not primary legal facts.

The same-judgment representation guards, ownership checks and prototype/profile constraints are in services/legal-core-api/schema/target.sql, with cases in target_test.sql. They prevent an assignment from claiming provenance from another judgment or incompatible vector space. product-worker/internal/capabilities/legal_test.go checks that a derived summary cannot be quoted as original text.

Participant resolution, enrichment generation, semantic classification execution and analytics production are not complete ingestion capabilities. The tables can retain imported metadata; their existence is not a claim that the algorithms above are running. Unknown outcome mappings and source provenance still require importer work.