Repository navigation
Closed
Labels
area:devtoolsDevtools and repo control-plane toolingarea:qaQAtheme:evidence-trustEvidence trust, reproducibility, privacy, and witness metadatatheme:verifiabilitySchema-native proof and evidence architecturetype:fixBug fix
Description
Problem
Polylogue has several proof/evidence systems with the right shape but insufficient operational signal. This issue activates those systems; it is not the broad test-architecture issue and it is not the schema-drift issue.
Scope
- Witness discovery connected to real quarantine/error paths.
- Mutation campaigns that exercise currently uncovered meaningful domains.
- Showcase exercises with semantic invariants, not only CLI smoke.
- Proof claims with real oracle labels and evidence runners.
- Evidence freshness/staleness policies tied to changed paths or PR scope.
- Verification gates that catch cross-surface contract, layering, SQL safety, API completeness, and error-handling drift.
- Dashboard/traceability surfaces if they help agents choose gates and understand evidence.
- Fix broken validation lanes that still belong in the verification-lab surface.
Boundaries
- test(archive): systematic test architecture — catalog-driven invariants across all domains #807 owns broad catalog-driven tests across parser/storage/search/daemon/surface domains.
- fix(schemas): regenerate from current data, fix privacy threshold for structural fields, wire detect_drift() and schema-promote #800 owns schema regeneration,
detect_drift(), and schema CI/staleness policy. - fix(daemon): surface raw validation and parse failures in ingest/status #844 owns raw validation/parse/provider-detection failure surfacing.
- refactor(core): structural simplification — delete vacuous abstractions, collapse parallel implementations #805 owns structural simplification of duplicated or vacuous verification machinery.
Acceptance criteria
- At least one automated discovery path can produce a witness from a real failure/quarantine boundary.
- Mutation campaigns cover at least one currently meaningful uncovered domain.
- Showcase/lab checks include semantic invariants with deterministic output.
- Broken validation lanes are fixed, removed, or explicitly reclassified.
- Proof/evidence freshness produces useful signal without blocking unrelated work on stale boilerplate.
-
devtools verify --labor adjacent lab commands report the activated evidence clearly.
Metadata
Metadata
Assignees
Labels
area:devtoolsDevtools and repo control-plane toolingarea:qaQAtheme:evidence-trustEvidence trust, reproducibility, privacy, and witness metadatatheme:verifiabilitySchema-native proof and evidence architecturetype:fixBug fix
Activity
Sinity commentedon May 4, 2026
V-Agent Concrete Designs
V1 — Proof claims
5 claims operationalizable <1 day. Root cause: 17 mislabeled as construction_sanity (Claim dataclass default at models.py:324). Fix: explicit oracle= kwarg. First 5: cli.command.help (smoke), cli.command.no_traceback (smoke), cli.command.json_envelope (proof), archive.query.provider_filter_consistency (proof), schema.values.value_closure (proof). Next 5: maintenance.repair, trace.operation, parser.quarantine, error.machine, artifact.path. Hardened --check: new --verify flag exercises real evidence runners.
V2 — Evidence freshness
Git-diff staleness detection reusing changed_paths_between_refs. Per-claim policies (per_push, per_pr, 7d/14d/31d/90d, manual). 3-tier override: --skip-freshness flag, YAML claim overrides with auto-expiry, per-PR reviewer acknowledgement.
V3 — 5 verification gates (AST-based, all <3s)
Found real injection:
f"SELECT name FROM sqlite_master WHERE type='table' AND name='{self.table_name}'".V4 — Mutation expansion
3 new campaigns: daemon-http, repair-core, daemon-events. CI-compatible 5-min subset: filters+json+models = 165s. Tiered timeouts via pytest markers. Compact survivor JSON for result persistence.
V5 — Witness capture
15 trigger points (6 MachineError constructors + 3 daemon/MCP boundaries + quarantine persistence). Binary-search minimization over CLI args. 5-gate auto-promotion: minimized + classified + validated + reproduced + severity-gated. CI: hard cap 50, xfail strict, staleness >30d.
V6 — Semantic invariants (7 SQL checks, all sub-2s)
V7 — Dashboard
8 sections (Lint and Type, Topology, Surfaces, Proof Policy, Witnesses, Tests, Coverage, Mutation). Tiered caching: warm ~5s, cold ~4min. TUI + JSON + Markdown. Historical daily snapshots with ASCII sparklines.
V8 — Traceability
Change-claim-evidence-gate-merge. New modules: evidence_store.py, gating.py, verify_trace.py. Gate blocks on absence of evidence. devtools verify-trace renders full tree. Reactivate pr-policy.yml + proof-comment.yml.
Sinity commentedon May 4, 2026
Acceptance Criteria
detect_drift()wired intodevtools schema-audit— produces actionable outputWhen closing: comment on this issue or the PR explicitly stating how each criterion was satisfied, deferred, or found misframed.
Sinity commentedon May 4, 2026
Correction: detect_drift() wiring and schema CI gate are already covered by #800 (schema fixes). #806 scope is: witness activation, mutation campaigns, showcase semantic invariants, broken validation lanes, proof claim operationalization, evidence freshness, verification gates, dashboard, traceability.
Sinity commentedon May 6, 2026
Backlog hygiene note: verification activation, not generic test expansion
Keep this distinct from #807.
This issue is about making already-designed proof/evidence infrastructure produce operational signal: witness discovery, mutation campaigns, semantic showcase invariants, evidence freshness, verification gates, dashboard, traceability, and the two broken validation lanes.
#807 owns broad catalog-driven tests. A PR for #806 should be allowed to add narrow tests proving the activated infrastructure works, but it should not try to implement the whole parser/storage/search/daemon test architecture from #807.
Schema drift/regeneration remains #800. Raw parse/validation failure surfacing remains #844.
Sinity commentedon May 6, 2026
Backlog refinement note
Project-wide verification audit split a sharper issue out of this one: #853.
Keep this issue focused on activating useful proof/evidence infrastructure and making the existing verification-lab surfaces operational. #853 owns the pruning pass:
#807 should absorb any resulting new invariant/property/fuzz tests once #853 identifies which harness gaps are real behavior coverage gaps rather than proof-catalog cleanup.
Sinity commentedon May 6, 2026
Refinement: real verification, not less verification
#853 now makes the pruning standard explicit: vacuous or implementation-locking verification surfaces should be stripped, demoted, or replaced, but the underlying goal is comprehensive automated verifiability.
For this issue, that means activation work should prioritize mechanisms that can fail for real regressions and produce actionable evidence. Where activation touches topology/source/proof surfaces, classify them before wiring them deeper:
Do not promote metadata-only or exact-file-layout checks to serious proof unless they protect a durable architectural boundary.
Sinity commentedon May 6, 2026
Execution supplement
Mass-execution wave: #852 Wave 6 after #855/#856/#857 clarify what evidence surfaces should survive.
Focused verification:
devtools proof-pack --checkanddevtools render-verification-catalog --checkwhen proof catalog surfaces change;devtools verify --labonly once the verification changes are coherent, not after every small edit;devtools verify --quick, then fulldevtools verifybefore PR readiness.Do not reanimate vacuous or implementation-locking layers that #853 demotes.
Sinity commentedon May 6, 2026
Additional audit evidence: witness lifecycle freshness is authored metadata today
devtools verify-witness-lifecycle --jsoncurrently reports seven committed witnesses and zero issues. The committed witness metadata carries fields like:The verifier checks staleness against this metadata, but the audit did not find a mechanism that updates
last_exercised_atfrom an actual replay/test run during normal verification. That makes the lifecycle check partly real (privacy/minimization/known-failing metadata validation) and partly authored freshness metadata.Activation guidance:
Refs #853 #855 #807.
Sinity commentedon May 7, 2026
Reconnaissance Report for #806
Date: 2026-05-07 | Wave: 6 (depends on Wave 0 #855/#856/#857)
Agent: Codebase exploration complete.
Build this
Wire proof claim execution (V1 top-5): Explicitly set
oracle=kwarg for the 17 claims misclassified asconstruction_sanity(default atmodels.py:324). Prioritize 5 executable claims:cli.command.help(smoke),cli.command.no_traceback(smoke),cli.command.json_envelope(proof),archive.query.provider_filter_consistency(proof),schema.values.value_closure(proof). Add--verifyflag todevtools proof-packso it exercises real evidence runners.Activate witness discovery pipeline: Wire
devtools witness-discoverinto at least one automated discovery path so the witness inbox is non-empty. Current state: 7 committed witnesses, zero issues, but no mechanism populates the inbox from test/parse failures.Add 3 daemon/repair mutation campaigns: Extend
mutation_scenario_catalog.pywith campaigns forpolylogue/daemon/http.pyandpolylogue/storage/repair.py. The existing 3 campaigns (filters, models, json) emit CI-compatible 165s subsets.Label witness lifecycle freshness honestly:
devtools verify-witness-lifecyclecurrently reports freshness from authoredlast_exercised_atmetadata — no mechanism updates it from actual replay/test runs. Either wire replay evidence into freshness timestamps, or addevidence_notelabeling freshness as "authored metadata" (same pattern asrunners.pylines 748-751, 797-799).Add 3 semantic invariants to showcase:
showcase/invariants.pycurrently has 3 invariants but all are smoke/process:json_valid,exit_code,nonempty_output. Add at least 3 semantic invariants (from the V6 list):content_hash_recomputation,fts_integrity,provider_meta_roundtrip(see issue body V6 table).Fix 2 broken validation lanes:
semantic-insight-normalizationandpipeline-probe-chatgptare classified assmoke/process(exit-code-only defaultAssertionSpec()). They have no semantic assertions. Either add real assertions or classify them honestly as smoke/process lanes.Do NOT build this
detect_drift()— that is owned by fix(schemas): regenerate from current data, fix privacy threshold for structural fields, wire detect_drift() and schema-promote #800.verify-witness-lifecycleas proof of recent replay unless replay is actually wired.Files to touch
polylogue/proof/catalog.pyoracle=overrides from defaultconstruction_sanitypolylogue/proof/models.pyEvidenceTaxonomy(from #855) — no changes neededdevtools/proof_pack.py--verifyflag to exercise runners; wirebuild_slop_dashboardinto actionable outputdevtools/witness_discover.pydevtools/verify_witness_lifecycle.pyevidence_notelabeling freshness as authored metadata OR wire replaydevtools/mutation_scenario_catalog.pypolylogue/showcase/invariants.pydevtools/validation_lane_catalog_contracts.pysemantic-insight-normalization(line 144) andpipeline-probe-chatgpt(line 63) assertionstests/unit/proof/test_evidence_runners.pytests/unit/showcase/test_invariants_runtime.pytests/unit/devtools/test_proof_pack.py--verifyflag testsCoordination
Focused tests
Acceptance criteria
ls polylogue/proof/local_witnesses/or equivalent inbox is non-empty after running a discovery command.devtools mutation --listshowing new campaigns.pytest tests/unit/showcase/test_invariants_runtime.py.devtools verify-witness-lifecycle --jsonshows either wired replay evidence or authored-metadata note.Ambiguities / Stale comments
#806-comment-6(audit evidence) instructs "either connect witness exercise timestamps or label as authored metadata" — this is the correct direction, not full witness-replay automation.Close when: comment on this issue or the PR explicitly stating how each of the 5 criteria above was satisfied, deferred, or found misframed.
Sinity commentedon May 7, 2026
Implementation Scope for #806
Branch:
feature/fix/verification-infra-806What will be done
Wire witness-discover into test failure path (
tests/conftest.py):pytest_runtest_makereporthook that writes witness metadata toLOCAL_WITNESS_INBOXon test failures.Fix 2 broken validation lanes (
devtools/validation_lane_catalog_contracts.py):pipeline-probe-chatgpt: Addstdout_min_lines=3semantic assertion (probe produces meaningful output).semantic-insight-normalization: Add explicitclassification_override=AssertionClass.SMOKE_PROCESSsince the lane delegates semantic assertions to the pytest tests it runs.Fix 18 claim oracle overrides (
polylogue/proof/catalog.py):oracle=kwarg to all claims that default toconstruction_sanity:smokesmokesmokeproofproofconstruction_sanity(explicit)construction_sanity(explicit)proofconstruction_sanity(explicit)drift_checkproofproofproofproofconstruction_sanity(explicit)construction_sanity(explicit)proofconstruction_sanity(explicit)Add daemon/repair mutation campaigns (
devtools/mutation_scenario_catalog.py):daemon-http: Targetpolylogue/daemon/http.py, tests:tests/unit/daemon/test_daemon_http.pyrepair-core: Targetpolylogue/storage/repair.py, tests:tests/unit/storage/test_repair.pyLabel witness lifecycle freshness honestly (
devtools/verify_witness_lifecycle.py):evidence_noteto JSON output: "freshness derived from authored metadata (last_exercised_at), not wired to actual replay/test artifacts."Non-goals
Files changed
tests/conftest.py— witness discovery hookdevtools/validation_lane_catalog_contracts.py— lane assertion fixespolylogue/proof/catalog.py— oracle= overridesdevtools/mutation_scenario_catalog.py— new campaignsdevtools/verify_witness_lifecycle.py— honesty annotationpolylogue/showcase/invariants.py— 3 semantic invariantsSinity commentedon May 7, 2026
Completion Report for #806
Branch:
feature/fix/final-vet(commit8609f37)Acceptance criteria — all 6 satisfied
1. Witness inbox non-empty — at least one automated discovery path produces witnesses SATISFIED
tests/conftest_witness.py: a pytest plugin that hookspytest_runtest_makereportto capture test failures as witnesses inLOCAL_WITNESS_INBOX(.local/witnesses/new/)..witness.txtand.metadata.jsonpair with provenance, privacy classification, and lifecycle metadata.tests/conftest.pyviapytest_plugins.2. Mutation campaigns cover daemon/http and storage/repair SATISFIED
daemon-httpcampaign: targetspolylogue/daemon/http.py, teststests/unit/daemon/test_daemon_http.py.repair-corecampaign: targetspolylogue/storage/repair.py, teststests/unit/storage/test_repair.py.MUTATION_CAMPAIGNSdict indevtools/mutation_scenario_catalog.py(now 19 campaigns total).from devtools.mutation_scenario_catalog import MUTATION_CAMPAIGNS; assert 'daemon-http' in MUTATION_CAMPAIGNS3. Showcase has >=3 semantic invariants SATISFIED
polylogue/showcase/invariants.py:check_fts_integrity: FTS5 COUNT(messages_fts) = COUNT(messages WHERE text IS NOT NULL)check_provider_meta_roundtrip: JSON serialize-deserialize-reserialize equivalence up to 1000 messagescheck_schema_consistency: all non-system tables have rows or are in allowlistdb_semantic_invariant_checksdict andrun_db_invariants().from polylogue.showcase.invariants import db_semantic_invariant_checks; assert len(db_semantic_invariant_checks) == 34. 2 broken validation lanes fixed SATISFIED
pipeline-probe-chatgpt: Addedstdout_min_lines=3semantic assertion and explicitclassification_override=AssertionClass.SMOKE_PROCESS.semantic-insight-normalization: Added explicitclassification_override=AssertionClass.SMOKE_PROCESS(this lane runs pytest tests that contain their own semantic assertions; the lane classification honestly reflects that it checks only exit code).CONTRACT_LANES['pipeline-probe-chatgpt'].assertion.stdout_min_lines == 35. Witness freshness is honest SATISFIED
evidence_notefield todevtools verify-witness-lifecycle --jsonoutput: "freshness derived from authored metadata (last_exercised_at), not wired to actual replay/test artifacts"devtools verify-witness-lifecycle --jsonoutput includesevidence_note.6. Proof claim oracle classes fixed (18 claims) SATISFIED
oracle=kwarg to 18 claims inpolylogue/proof/catalog.py:smoke(cli.command.help, .no_traceback, .plain_mode; operation.effect.preview)proof(cli.command.json_envelope, archive.query, schema.values, maintenance.repair, parser.quarantine, error.machine, trace.operation, generated.scenario.local_deterministic, schema.roundtrip, + effect implications)construction_sanity(explicit: provider.capability.*, schema.foreign_key, diagnostic, generated.scenario.family, coverage manifests, insight surface, + effect implications)drift_check(artifact.path + 5 architecture controls)manual_review(operation.effect.privacy_safe_evidence)assurance_domainmatching the architectural ring.build_verification_catalog()produces the oracle mix above.Files changed
tests/conftest.pytests.conftest_witnessplugintests/conftest_witness.pydevtools/validation_lane_catalog_contracts.pypolylogue/proof/catalog.pydevtools/mutation_scenario_catalog.pydevtools/verify_witness_lifecycle.pypolylogue/showcase/invariants.pyNot done (deferred or misframed)
--verifyflag: Deferred — requires runner execution infrastructure that is not yet wired. The--checkflag already evaluates blocking policy from catalog quality checks.Verification commands
Refs #805 #807 #800 #853 #855.
Closes #806.
fix(verification): wire witness discovery, fix oracle labels, add mut…
fix(verification): wire witness discovery and oracle labels (#936)
fix(verification): wire witness discovery and oracle labels (#936)
Sinity commentedon May 9, 2026
Tracker filed at #998 — V7 (dashboard) and V8 (traceability) sub-designs were never built and were not previously tracked.