Skip to content

Manifests, Inventories, and Ownership

This page defines architecture and ownership boundaries for manifest data. Table-level schema contracts live in dedicated table-reference pages.

Architecture Invariants

  • Download-state authority is download_manifest.db.
  • Ingest-state authority is ingest_manifest.db.
  • Coverage and reports are derived outputs, not primary source-of-truth state.
  • Runtime pipeline code reads/writes through shared storage contracts.
  • Runtime paths do not run schema/data migrations.

Completeness Model

Catalog size is not completeness. Completeness is asserted by checkpoint/run ledgers and successful window processing, not by the count of known acts alone.

Ownership Boundary

The ingest persistence stack has a strict split:

  • IngestRepository owns SQL primitives only.
  • IngestManifestDbStore owns orchestration and policy.
  • Runners call store intent methods, not repository methods directly.

Repository Owns

  • Single-table primitives (or deterministic replace of fixed dependent rows).
  • Inputs that are already normalized row payloads and resolved IDs.
  • No policy decisions (no batching strategy, retries, or dedupe policy).

Store Owns

  • Multi-step units of work across repository calls.
  • Transaction scope, write ordering, and lock scope.
  • Identity resolution and run-scope caches.
  • Domain-facing intent APIs consumed by runners.

Placement Checklist

Put code in repository when all are true:

  1. It is a table-oriented primitive operation.
  2. Inputs are normalized rows / resolved IDs.
  3. No application policy is applied.

Put code in store when any are true:

  1. It coordinates multiple repository operations.
  2. It decides sequencing, transaction scope, or lock scope.
  3. It resolves identities or manages run-scope state.
  4. It is the domain-facing API used by runners.

Artifact Flow (High-Level)

  • Download phase writes download inventory/catalog/checkpoint state to download_manifest.db and artifacts to export storage.
  • Ingest phase writes ingest run/checkpoint/canonical-output state to ingest_manifest.db.
  • Backfill consumes missing-interval hints and updates ingest state.

Where Table Contracts Live

  • Download DB table contracts: docs/download/download_manifest_db_tables.md
  • Ingest DB table contracts: docs/ingest/ingest_manifest_db_tables.md
  • Law/judicial hub separation ADR: docs/development/adr-law-judicial-hub-separation.md
  • Law-judicial cross-link contract spec: docs/development/spec-law-judicial-cross-link.md