feat(ingest): adopt llm-ingestion-okf as Door A implementation (first consumer)

Replace the local 391-line ingest implementation with a thin adapter over
the shared llm-ingestion-okf library (git-pinned dae0bd1a via Forgejo,
tool.uv.sources). The materialize() signature is preserved; error types are
now the library's typed hierarchy rooted in IngestError, re-exported from
the consumer seam.

- tests/test_ingest_adoption.py: new load-bearing seam tests (delegation,
  offline invariant — allow_network is never passed, error contract),
  detach-proven red twice.
- Golden suites (file + sql) pass UNCHANGED — byte-exact behaviour proven
  against the repo-local fixtures.
- 6 test files migrated to the library error hierarchy; escaping/typed-cell
  unit tests dropped (byte-bound by the ingest-edge.md golden, unit-owned by
  the library's own 189-test suite). Provenance stamp now asserted
  independently from the §5 rule.
- mypy override follow_untyped_imports for llm_ingestion_okf (no py.typed
  upstream yet — reported as a finding).

Suite: 386 passed; ruff + format + mypy --strict clean; shared/, examples/,
runs/s10/ and run_s10.py byte-untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-07-16 20:46:51 +02:00
commit 5732d13369
9 changed files with 307 additions and 495 deletions

View file

@ -32,7 +32,8 @@ from portfolio_optimiser_claude.experience import (
mint_verdict_id,
)
# R-6 id grammar — mirrors ingest.py's _ID_RE: lowercase alphanumerics and
# R-6 id grammar — mirrors the ingest-spec §4 id grammar (enforced by the
# llm-ingestion-okf library on the ingest side): lowercase alphanumerics and
# hyphens only, so a verdict id can NEVER traverse paths (no dots, no
# separators). Minted ids (16 hex chars, §4.2) always match.
_ID_RE = re.compile(r"^[a-z0-9][a-z0-9-]*$")