Skip to content

Gate C audit — provenance, confidence, source absence, patent backend

The runnable artifact for OGUR-74, the last child of Gate C (OGUR-62). Re-run it with:

uv run --extra dev python -m pytest tests/unit/api/test_gate_c_audit.py -v

It lives at tests/unit/api/test_gate_c_audit.py, so make test and CI run it on every push with no extra wiring. Every test name is a finding; a green run is the verdict.

What it audits

The two served packs — gns561-cca-autophagy-001 and polygon-cd8-ami-001 — through the real loader and the real HTTP boundary. Not ogur.db: reports are served from the committed JSON packs, the container builds its own content.db from the GNS561 pack at image-build time (Dockerfile), Polygon has no seeder at all, and neither landscape exists in the developer ogur.db.

Gate C acceptance bullet Discharged by
Empty results distinguish "no records" from "not searched" the evidence-depth banner, on every variant of both packs, served together from one index
Every reachable claim has a working source link the builders' own grounding gate, replayed read-only
Every synthesized block carries the required confidence display per-row provenance tags + the report-level depth banner (see below)
Confirm which patent backend produced the Polygon scan the pack's own evidence chain (see below)

The pack roster is pinned, not inherited

The audit sets EXPLORE_REPORT_PACK_PATH itself. Without that the verdict is a property of the developer's .env rather than of the repository: adding an in-progress pack from an unmerged worktree does not merely add a report. A records layer evidence_depth has no sentence for raises while the shared index is being built, so every pack 503s. That is the current state of tests/unit/api/test_explore_report.py in a working tree whose .env names the cardiometabolic or obesity packs: 4 failures that have nothing to do with the code under test. The audit passes under both that path and a nonexistent one.

Served together, not one at a time

test_the_polygon_depth_states_match_what_the_run_ingested passes only because its fixture repoints the single configured pack path — GNS561 is unserved inside it. The two packs had never been asserted live in one index, which is the container's actual configuration. This audit does that; the per-pack floor numbers stay pinned where they are, in test_explore_report.py.

Patent-backend verdict

The served Polygon patent layer was produced by gpatents — the live BigQuery backend — via scripts/eval/polygon_discovery/patent_scan.py.

source_filters.patents.backend cannot answer the question and never could: the Polygon pack sets no source_filters, the landscape is in no database, and gpatents-db is not a legal value there (_PATENT_BACKENDS = ("lens", "epo", "gpatents"), ogur/sources/patents.py). Nor can the signal rows — the gpatents and gpatents-db projections are byte-identical once written.

Three marks on the committed artifacts, all asserted by the audit:

  1. every patent row carries assignees_harmonized, the BigQuery patents.publications harmonized-assignee column. No other patent path emits it: GNS561's rows carry plain assignees, and the Lens path stores the raw Lens hit. A further case asserts no other served pack carries the column, so it keeps discriminating;
  2. the layer's 1,560 rows equal distinct_publications in patents_scan_cd8_depleting_meta.json, and the CSV behind it stays digest-bound through meta.source_digests;
  3. that scan meta records a BigQuery query shape — CPC prefixes, row limit, lookback window.

One thing to know when reading the run history: RUN_SUMMARY.md cites Lens, and the Explore run's document manifest attributes 68 documents to lens. That is a different, earlier scan. It is not what the served pack holds.

Confidence

Explore packs carry no confidence field, by design. The analogues are the per-row provenance tag (searched / supplied / program context, a closed vocabulary the pack declares itself) and the report-level depth banner. The audit asserts both, and asserts the tag contract both ways: a table that declares a Provenance column tags every row, and a table that declares none serves no stray tags. A blank cell under a Provenance heading reads as a value.

confidence lives on the Briefing/KIQ path (ogur/engine/verification.py). Its absence from an Explore pack is not a regression.

Deliberately not audited

Both settled by OGUR-78 (PR #254):

  • Per-source-chip depth labels. Built, then removed by product decision. A regression test pins that no source link carries one (frontend/src/components/ui/__tests__/SourceChip.test.tsx). Re-deriving them here would re-litigate a closed call.
  • Whether a brief cites a document the pack holds no record for. A grounding property, not a depth one. It belongs with grounding_failures and the other builder gates. Add it there if it is wanted.

Two further exclusions of this audit's own:

  • Identifier checks against a tag-grounded pack. A brief grounds itself by provenance tag or by source identifier, and the builder's tag path short-circuits. Polygon's tables carry no NCT column, so grading it on identifiers reports a defect against a contract it was never written to. Those two cases skip with that reason named.
  • Promoting link grounding from build time to load time. ogur/api/report_pack.py argues against it explicitly: it would turn an editorial regression into a 503.