Skip to content

ADR: Separate Law and Judicial Ingestion Hubs

Status

Accepted (foundation-only refactor).

Context

The current ingestion runtime is law-source focused (Normattiva), but the product roadmap requires future judicial sentence ingestion and explicit law↔judicial relationships.

Without a hard boundary now, judicial data risks being mixed into law-oriented tables/contracts, which would couple release cadence, complicate migrations, and weaken ownership boundaries.

Decision

  • Keep the existing runtime behavior for Normattiva unchanged.
  • Treat the current download + ingest persistence stack as the law ingest hub.
  • Add explicit source-owner alias identity contracts (owner_alias_kind, owner_alias_value) so the law hub can support multiple law sources.
  • Define judicial ingestion contracts as interfaces only (no runtime yet).
  • Define cross-link contracts as typed DTO + interface only (no runtime yet).

Consequences

Positive

  • New law source adapters can be added without changing shared orchestration.
  • Judicial ingestion can land in its own schema/domain without reworking law-table contracts.
  • Cross-linking can evolve independently from both ingestion runtimes.

Trade-offs

  • API updates are required across store/repository call sites for explicit alias identity.
  • Existing databases require one forward migration for source-ref identity normalization.

Non-goals in this ADR

  • No second law source implementation.
  • No judicial runtime implementation.
  • No new CLI commands.