OpenAPI Reference Library
Purpose
This guide is the discoverability contract for OpenAPI-backed Decision Gate reference packs. It answers, for every pack:
- Where is the canonical OpenAPI file?
- Is it hand-authored or sourced upstream?
- Which system-test enforces behavior?
- Where are the upstream API docs for human readers?
Canonical Contract
The machine-readable source-of-truth is:
references/openapi/reference_library.json
Validated by schema:
references/openapi/reference_library.schema.json
Every pack listed there must pass hard-gate checks in:
system-tests/src/suites/openapi_reference_library.rs
Current Pack Catalog
| Pack ID | Domain | Canonical OpenAPI | Mirrors | System Test | Upstream Docs |
|---|---|---|---|---|---|
courtlistener-legal-citation-v1 | Legal citation verification | references/openapi/courtlistener-legal-citation-v1/openapi.json | system-tests/tests/fixtures/legal_citation/courtlistener_reference_openapi.json and examples/agentic/legal-citation-verification/courtlistener_reference_openapi.json | legal_citation_reference_projection_first_end_to_end in system-tests/src/suites/legal_citation.rs | REST Overview, Citation Lookup, API Root (v4) |
Coverage and Execution Metadata
Each pack entry now declares:
execution_modes: required set fromoffline_fixtureand/orlive_opt_in.coverage: required deterministic counts:operationsfabricated_casesknown_good_casesambiguous_casesinvalid_cases
live_mode: required env + CI policy contract:enabled_by_envrequired_envoptional_envci_policy(manual_onlyordisabled)
For CourtListener, required_env is intentionally empty because runtime auth
uses pre-provisioned secret://courtlistener/api_token from the encrypted
secret store. COURTLISTENER_API_TOKEN is only used by manual fixture-capture
tooling, not runtime live smoke execution. Store the raw token value; typed
runtime render metadata applies the required Token prefix on outbound auth.
When keyring is unavailable/headless, set
DECISION_GATE_SECRETS_PASSPHRASE before secrets init/put/list commands so
the encrypted store can be unlocked.
Projection Authoring Rule (Canonical)
Projection metadata is evaluated on the normalized/resolved response schema.
Component-level projection metadata referenced via $ref is first-class and
preferred.
Do not inline duplicate response schemas just to satisfy importer checks. Keep one canonical projection location (usually the referenced component schema) and mirror that byte-for-byte across canonical/system/example pack copies.
Source Provenance Policy
For each pack, catalog provenance must explicitly declare origin:
hand_authored_fixtureupstream_openapi_snapshotgenerated_from_upstream_docs
CourtListener currently uses hand_authored_fixture.
Hard-Gate Coverage
Standard CI enforces offline deterministic gates:
- Catalog JSON is schema-valid.
- All cataloged paths exist.
- Canonical and mirrored OpenAPI artifacts are byte-equal (including
operation_fixture_corpus.jsonand live capture manifest files). - Catalog
system_test_nameexists inDocs/generated/testing/proof_catalog.json. - Catalog
docs_pathsexist inDocs/verification/registry.toml. - Upstream URLs are absolute
https://and metadata-complete. - Coverage and execution/live-mode metadata are structurally valid.
No live network reachability checks run in standard CI.
New Pack Checklist (PubMed/arXiv Ready)
Use this checklist when adding DG + PubMed, DG + arXiv, or similar:
- Create canonical directory:
references/openapi/<pack-id>/ - Add canonical files:
openapi.jsontyped_import_payload_example.jsoncitation_cases.json(or domain-equivalent deterministic corpus)README.md
- Add mirror copies under:
system-tests/tests/fixtures/<domain_pack>/examples/agentic/<domain-pack>/
- Add/extend system-test suite under
system-tests/src/suites/. - Register suite in
system-tests/tests/providers.rs. - Update
crates/decision-gate-test-contracts/src/source_catalog.jsonandsystem-tests/TEST_MATRIX.md. - Add pack entry to
references/openapi/reference_library.json. - Ensure
docs_pathsare registered inDocs/verification/registry.toml. - Include named markdown links to upstream API docs in pack README.
- Declare
execution_modes,coverage, andlive_modemetadata.
Metadata Template
{
"pack_id": "<kebab-case-pack-id>",
"version": "v1",
"domain": "<domain>",
"status": "active",
"provenance": "hand_authored_fixture",
"canonical_openapi_path": "references/openapi/<pack-id>/openapi.json",
"system_fixture_openapi_path": "system-tests/tests/fixtures/<pack>/openapi.json",
"example_openapi_path": "examples/agentic/<pack>/openapi.json",
"system_suite_path": "system-tests/src/suites/<suite>.rs",
"system_test_name": "<exact_test_name>",
"docs_paths": [
"/docs/decision-gate/guides/openapi-reference-library"
],
"upstream_docs": [
{
"label": "<human label>",
"url": "https://...",
"kind": "rest_overview",
"verified_on_utc": "2026-02-21"
}
],
"execution_modes": [
"offline_fixture",
"live_opt_in"
],
"coverage": {
"operations": 4,
"fabricated_cases": 6,
"known_good_cases": 3,
"ambiguous_cases": 1,
"invalid_cases": 1
},
"live_mode": {
"enabled_by_env": "COURTLISTENER_LIVE",
"required_env": [],
"optional_env": [
"COURTLISTENER_BASE_URL",
"COURTLISTENER_LIVE_CASE_LIMIT"
],
"ci_policy": "manual_only"
},
"notes": "<deterministic note>"
}