Repository navigation
Description
Parent
Part of #401. Verifiability-coherence track. Complements #421 (product-surface obligation families) and #444 (MCP authz/validation).
Problem
Polylogue exposes the same archive through three surfaces — CLI, MCP, Python facade — and within the facade through both async and sync APIs. Nothing verifies that these surfaces stay isomorphic.
Symptoms visible today:
- Filter parity. CLI supports
--message-role user|assistant; MCP has no equivalent filter (feat(mcp): add authorization, validation, and error sanitization #444 calls this out). Nothing flags it as a parity gap. - Output-shape parity.
export_conversation()returns raw string;export_query_results()returns JSON wrapper (feat(mcp): add authorization, validation, and error sanitization #444). Inconsistent across MCP tools and across MCP↔CLI. - Async/sync parity.
polylogue.facade*(async) andpolylogue.sync*(sync) declare overlapping surfaces. A function added to async without a sync counterpart is invisible — no lint catches the asymmetry. The cross-cut vocabulary intopology-target.yamlhasapi: sync | async, but coverage is sparse and the tag doesn't enforce parity. - Coverage gaps. Some MCP-only tools (
neighbor_candidates,archive_coverage) have no CLI counterpart and no proof-catalog subjects (zero coverage from feat(devtools): make architectural cohesion executable #429/feat(proof): add product-surface obligation families #421). Symmetric gaps exist on the CLI side.
The proof catalog has 51 cli.command subjects, ~38 MCP tool subjects (per #444), and an unknown count of facade method subjects. Nothing asserts mappings between them.
Target
Add docs/plans/surface-parity.yaml declaring the parity contract:
operations:
- name: list-conversations
cli: polylogue list
mcp: list_conversations
facade_async: polylogue.facade.list_conversations
facade_sync: polylogue.sync.list_conversations
shared_filters:
- provider
- message_role # currently CLI-only; expected to land in MCP per #444
- has_tool_use
- has_thinking
output_shape: paginated_envelope
parity_exceptions:
- surface: facade_sync
reason: "sync surface returns blocking iterator; async returns AsyncIterator"
- name: export-conversation
cli: polylogue export
mcp: export_conversation
facade_async: polylogue.facade.export_conversation
facade_sync: polylogue.sync.export_conversation
output_shape: bytes_or_string
parity_exceptions:
- surface: mcp
reason: "MCP wraps in JSON envelope per #444; CLI returns raw"
until: "#444"Add devtools verify-surface-parity:
- Surface presence. For each operation, every declared surface column resolves to a real subject in the proof catalog (CLI command, MCP tool, facade method).
- Filter parity. Every entry in
shared_filtersis supported by every surface column listed in the row, except those covered by aparity_exceptionsentry with anuntil: "#NNN"reference. - Output-shape parity. All surfaces in a row produce the same
output_shape(string, JSON envelope, paginated envelope, raw bytes), modulo declared exceptions. - Async/sync parity. Every facade method declared with
api: asyncin cross-cut tags has asyncpeer at the corresponding path inpolylogue/api/sync/(post-refactor: rationalize package-root layout and consolidate facade surface #426); reverse holds.
Wire verify-surface-parity into verify --quick.
Why this matters
- The CLI/MCP/facade triple is the entire user-facing API. Drift between them is the worst kind: a feature that works in one place and silently fails in another. Today the only way to find such drift is reading three help texts and three modules side-by-side.
- This is the natural follow-up to feat(mcp): add authorization, validation, and error sanitization #444 (MCP authz). feat(mcp): add authorization, validation, and error sanitization #444 enumerates the gaps once; this issue makes the parity contract continuously checkable so new gaps are caught at PR time.
- Async/sync parity is currently folk convention. The cross-cut tag exists in the projection vocabulary; this issue gives it teeth.
Coordination
- feat(mcp): add authorization, validation, and error sanitization #444 — fixes the MCP-side gaps once. The parity contract written here records what "fixed" means and prevents regression.
- refactor: rationalize package-root layout and consolidate facade surface #426 — establishes
polylogue/api/{sync,async}/; this issue depends on that landing for the async/sync peering check to work. - feat(devtools): evidence-driven structural specification — cross-cut manifest, witness, dashboard #432 — provides the cross-cut tag vocabulary this lint reads.
Acceptance (executable)
devtools verify-surface-parity # exits 0
devtools verify-surface-parity --json # machine-readable per-operation parity report
Initial manifest seeded from a sweep of CLI command subjects + MCP tool subjects + facade entry points. Exceptions documented with until: "#NNN" references.
Cross-reference: holistic assurance umbrella
Filed 2026-04-27. This issue is part of the holistic assurance coverage map (#506) which restructures verifiability work around four tracks (stop lying / coverage map / routing-proof-pack / product confidence) and introduces an Oracle primitive (#507), declarative coverage manifests (#508 assurance-domains, #509 oracle-quality), and operator-facing proof packs (#510).
Read in conjunction with #506 to see how this issue fits into the broader confidence model.
Expand (2026-04-27)
Per the holistic assurance audit (#506), this issue's surface-parity.yaml manifest is the surface_parity domain entry in docs/plans/assurance-domains.yaml (#508). Expand the original "filter parity / output-shape parity" scope to the full audit-recommended set:
Required claim families:
presence_parity— every operation present on its declared surfacesfilter_parity— every filter accepts the same vocabulary across surfacesoutput_shape_parity— JSON envelope / row shape / error shape matcherror_shape_parity— error payloads use the same envelope across CLI / MCP / facadetrace_equivalence— normalized observable traces equivalent across surfaces (extends test: add trace equivalence and observability-parity evidence #341's trace runner; test: add trace equivalence and observability-parity evidence #341 currently total-order, expand to partial-order per the original plan)auth_limit_parity— MCP authz / rate limits / size caps documented and consistent (consumes feat(mcp): add authorization, validation, and error sanitization #444)destructive_safety_parity— destructive operations require exact identity (no prefix match) on every surface (consumes fix(mcp): complement #444 — limit upper-bound, filter asymmetry, prefix-match safety #476's prefix-match concerns)sync_async_parity—polylogue.facade.*(async) andpolylogue.sync.*(sync) expose isomorphic surfaces; new async functions auto-imply a sync peer
Surfaces covered:
cli.commandmcp.toolfacade.method(async)sync.methodasync.method(alias for facade.method, kept for explicit pairing)
Allowed oracle kinds: trace_equivalence, corpus_replay, benchmark_baseline. Same-source / self-attestation are blocked for serious surface-parity claims (#509 enforces).
Coverage threshold: 90% of declared operations have all 8 claim families satisfied. Track per-operation coverage in the dashboard rendered by #508.
Coordination updates:
- feat(mcp): add authorization, validation, and error sanitization #444 (MCP authz/validation/error sanitization) → implements
auth_limit_parityanderror_shape_parity. - fix(mcp): complement #444 — limit upper-bound, filter asymmetry, prefix-match safety #476 (MCP prefix-match safety) → implements
destructive_safety_parity. - test: add trace equivalence and observability-parity evidence #341 (trace equivalence) → expand to partial-order traces and wire as
trace_equivalenceoracle.
The original "isomorphic surfaces" framing stands; this comment records the expanded claim-family set so the manifest schema is concrete.
Activity
Sinity commentedon Apr 29, 2026
Implemented: suppressions.yaml registry with expiry validation, API parity manifest, and evidence freshness SLA manifest.
feat(proof): land verifiability ontology foundation — Oracle, Assuran…
feat(proof): land verifiability ontology foundation — Oracle, Assuran…