Expand description
ocp-conformance — the public Open Context Protocol conformance suite
(06-context-protocol.md §3.6).
“OCP conformant” means green on this suite for your declared capability
set — a checkable claim, which is what makes third-party adoption safe.
run_conformance drives a provider through the protocol and returns a
typed ConformanceReport with a pass/fail verdict per check and an
evidence string for each, so a failure says exactly what was wrong.
The checks (all against the frozen ocp-types contracts):
- handshake — the provider completes the handshake and reports a non-empty identity + capabilities (§3.2).
- frame-validity — queried frames pass
ocp-typesvalidation: score in[0, 1], a non-empty title, a non-emptycitation_label(§3.4 — “NEVER a bare uuid”). - budget-honesty — returned frames’ summed
token_costnever exceeds the query budget (§3.3 — “never lies about cost”). - shutdown-clean — the provider tears down without error (§3.2).
- malformed-input-tolerance — a garbage line is ignored-or-errored, never crashing the host (§3.5, task deliverable). Wire-level, so it applies to stdio providers.
The suite is deliberately adversarial: pointed at a provider that lies
about costs, emits an out-of-range score, omits a citation label, or dies
mid-query, the matching check fails loudly. The bundled ocp-example-docs
fixture has --misbehave flags that trip each one, proving the suite
catches a broken provider (task deliverable).
Structs§
- Check
Result - One check’s outcome: which check, its verdict, and human-readable evidence.
- Conformance
Report - The result of a conformance run: every check, against a described target.
Enums§
- Check
Status - The verdict for a single conformance check.
- Provider
Target - How to reach the provider under test.
ocp-inspectbuilds one of these from its CLI arguments; tests build them directly.
Constants§
- CHECK_
BUDGET_ HONESTY - CHECK_
FRAME_ VALIDITY - CHECK_
HANDSHAKE - The stable check names, so reports and callers agree on identifiers.
- CHECK_
MALFORMED - CHECK_
SHUTDOWN
Functions§
- check_
frames - Validate a query result’s frames against the
ContextFramecontract (§3.4). Returns(passed, evidence). Zero frames is permitted — a provider may simply have nothing relevant. - run_
conformance - Run the full conformance suite against a provider, returning a typed report. Never panics: every failure mode becomes a failing check with evidence.
- sample_
query - The query the suite probes every provider with — no
kindsfilter, so any provider is asked for its best frames (§3.3).