Repository navigation
feat(verify): tier SLO catalog and enforce campaign artifact reality (#1063) - #1086
Conversation
Pack B: add a `tier:` field (cheap-local | lab) to every row in docs/plans/slo-catalog.yaml. devtools verify-slos now filters by tier (default: cheap-local; --include-lab adds lab; --all-tiers runs all). The daemon convergence row moves to the lab tier so the default verify loop does not invoke 30 s benchmarks. devtools verify --lab now invokes verify-slos with --include-lab. Added a real pytest-benchmark JSON fixture-driven test that exercises the parser end-to-end, plus a catalog-level test forbidding "required + lab" rows. Pack C: check_campaign_coverage_catalog now requires every active campaign's tests (and mutation paths_to_mutate) to exist on disk and be non-empty. Added optional freshness_days / artifact_glob fields on campaign rows (with Pydantic model and verifier support). Benchmark campaigns default the artifact glob to .local/benchmark-campaigns/*-<name>.json. Missing, empty, or stale artifacts fail loudly; mutation campaigns must declare an artifact_glob to use freshness_days. Ref #1063 Co-Authored-By: Claude <[email protected]>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
## Summary Six pre-existing test failures on master were blocking every newly opened PR in the #1058 wave (#1081, #1086, #1087, #1088, #1089). All trace to incomplete cleanup after earlier proof-runner retirement work. ## Problem `pytest --ignore=tests/integration,benchmarks,fuzz` on `origin/master@fc3c43f` exits with 6 failures: - `tests/unit/devtools/test_benchmark_campaign.py::test_compile_benchmark_campaigns_indexes_by_name` - `tests/unit/devtools/test_benchmark_campaign.py::test_benchmark_scenario_index_tracks_authored_catalog` - `tests/unit/devtools/test_scenario_projections.py::test_all_projection_operation_targets_are_declared` - `tests/proof/laws/completeness/test_every_command_has_help_claim.py::*` - `tests/proof/laws/completeness/test_every_json_command_has_envelope_claim.py::*` - `tests/proof/laws/anti_dead_code/test_every_subject_has_at_least_one_claim.py::test_every_subject_of_a_fully_bound_kind_is_selected[cli.command]` Multiple parallel agents inherited and flagged these failures; they cannot be cleared at PR scope because each PR is supposed to follow the "no inherited debt" rule. ## Solution 1. **Benchmark catalog drift** — `BENCHMARK_SCENARIOS` grew to include `reader-api` and `daemon-convergence` (real entries with pytest paths). Two tests still asserted the old 3-element set, and the new `operation_targets` (`benchmark.reader.api`, `benchmark.daemon.convergence`) had no declared `OperationSpec`. Added the two missing `OperationSpec` rows in `polylogue/operations/specs.py` and updated the test assertions. 2. **Stale proof-law tests** — `tests/proof/laws/completeness/test_every_command_has_help_claim.py` and `test_every_json_command_has_envelope_claim.py` asserted the existence of `cli.command.{help,no_traceback,plain_mode,json_envelope}` proof claims. Those were intentionally retired in PRs #1069/#594 (proof-runner cleanup) because the intent is now pinned by pytest contract evidence tests under `tests/unit/cli/` (`test_json_envelope_contract.py`, `test_plain_output_contract.py`, `test_help_contract.py`, `test_cli_error_boundaries.py`). The law tests are stale debt — both files deleted. 3. **\`_FULLY_BOUND_KINDS\` parametrize drift** — same retirement removed all claims selecting `cli.command` / `cli.json_command` subjects. Removed both kinds from `_FULLY_BOUND_KINDS` in `test_every_subject_has_at_least_one_claim.py` — the CLI contract suites cover the surface directly now. 4. **Generated docs** — `docs/test-quality-workflows.md` and `docs/verification-catalog.md` regen as part of the new OperationSpec rows. ## Verification ``` nix develop -c pytest --ignore=tests/integration --ignore=tests/benchmarks --ignore=tests/fuzz -q --no-header # 6841 passed, 2 xfailed, 0 failed (was 6 failed before) nix develop -c devtools verify --quick # exit 0 ``` Ref #1058 #594 #1069 --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
… (#1091) ## Summary Adds `devtools evidence-dashboard` and `devtools evidence-dashboard trace` as the V7/V8 surface for #998 — a pytest-first evidence dashboard built over the real artifacts produced by PRs #1083/#1086/#1087/#1088, plus a changed-path traceability view that links each change to its committed contract evidence and required gates. ## Problem The pytest-first evidence model is now real: `.cache/verify/last-pytest.json` (#1087), `.cache/verification/evidence/*.json` (100+ artifacts), `.cache/last-verify-result.json`, the SLO catalog with tier/freshness (#1086), and parsed CI workflow facts (#1088) all exist. What was missing was the single surface that reads those artifacts and presents the V7 dashboard / V8 traceability view from #998, without rebuilding a proof-row aggregator. `devtools evidence-report` overlaps in shape but is anchored to verify-history + suppressions + witnesses. It is intentionally left in place; the new dashboard is a sibling so existing consumers and tests are not disturbed. ## Solution New module `devtools/evidence_dashboard.py` with sections, each backed by a real artifact (or reported as `available: false` with the reason — no aspirational rows): - pytest health from `.cache/verify/last-pytest.json` (status, counts, duration, last-run, staleness) - contract evidence inventory from `.cache/verification/evidence/*.json`, grouped by surface, with stale-artifact and dirty-tree detection - coverage from `coverage.xml` (line %) or `.coverage` (presence only) when present - benchmark campaign freshness from `.local/benchmark-campaigns/` - SLO catalog rows (required vs informational) parsed via the existing `devtools.verify_slos._parse_slo_catalog` - static gate status from `.cache/last-verify-result.json` (preferred) falling back to `.cache/verify-history.jsonl` - witness counts (`tests/witnesses/` + `.local/witnesses/`) - mutation campaign freshness from `.local/mutation-campaigns/` `evidence-dashboard trace --base <ref> --head <ref>` reuses `build_verification_impact_report` and joins each change subject (by `test_nodeid` → test source path) to the contract-evidence artifacts emitted by that test, plus required PR gates and deployment gates. Output is JSON by default and Markdown when `--markdown` is set; both formats are combinable. Registered in `devtools/command_catalog.py`, `docs/devtools.md` regenerated. ## Verification Local commands run: - `nix develop -c pytest tests/unit/devtools/test_evidence_dashboard.py -v` — 15 passed - `nix develop -c pytest tests/unit/devtools/test_evidence_dashboard.py tests/unit/devtools/test_evidence_report.py tests/unit/devtools/test_command_catalog.py tests/unit/devtools/test_render_devtools_reference.py -q` — 35 passed - `nix develop -c mypy devtools/evidence_dashboard.py tests/unit/devtools/test_evidence_dashboard.py` — Success: no issues - `nix develop -c ruff check devtools/evidence_dashboard.py tests/unit/devtools/test_evidence_dashboard.py` — clean - `nix develop -c devtools render-all --check` — sync OK - `nix develop -c devtools verify --quick` — exit_code 0 - `nix develop -c devtools evidence-dashboard --json` — emits dashboard against this worktree, correctly reports missing pytest/coverage/campaign artifacts on the clean fixture worktree, surfaces real SLO catalog rows (3 required, 3 informational) and witness counts - `nix develop -c devtools evidence-dashboard trace --base origin/master --head HEAD --json` — emits trace; 0 changes on the post-commit working tree, required_gates and deployment_gates populated from the verification-impact pipeline ## Artifact gaps observed The dashboard reports these as `available: false` because the underlying artifacts don't exist in this worktree: - `.cache/verify/last-pytest.json` — only produced by `devtools verify` runs that include the pytest step; a fresh worktree without a verify run reports unavailable - `coverage.xml` / `.coverage` — none committed; `devtools coverage-gate` produces them - `.local/benchmark-campaigns/` — populated only by `devtools benchmark-campaign run <name>` - `.local/mutation-campaigns/` — populated only by `devtools mutmut-campaign run <name>` These gaps are honest: the dashboard does not fabricate values, and each section names the command needed to populate it. The main checkout at `/realm/project/polylogue` is the same shape — the SLO catalog, witnesses, and static-gate cache are present; coverage and pytest-report artifacts depend on operator runs. Ref #998 Ref #1058 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added `evidence-dashboard` developer command with a dashboard mode to visualize verification artifacts, test health, coverage status, and benchmark freshness. * Includes a trace subcommand to map changed paths to verification impacts and related evidence. * Both modes support JSON and Markdown output formats with configurable thresholds. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/Sinity/polylogue/pull/1091?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Sonnet 4.7 <[email protected]>
Summary
Adds a
tier:axis to the SLO catalog so the default verify loop runsonly cheap-local benchmarks while
--include-lab(anddevtools verify --lab) escalates to lab-tier rows. Extendscheck_campaign_coverage_catalogto require every active campaign to route to executable test paths,
and to enforce optional
freshness_days/artifact_globsemantics sodeclared coverage cannot drift from real artifacts.
Problem
The SLO catalog let any row be marked
gate: requiredregardless ofwhether its benchmark fixture was cheap enough to run on every push.
The daemon convergence row (30 s+) was nominally informational but
sat alongside cheap reader/query rows with no contract preventing
someone from promoting it. Meanwhile, every row in
campaign-coverage.yamldeclared
tests:, but no check verified those paths existed on disk —a row could carry a name and description and route nowhere
executable. The Pydantic model accepted
freshness_daysonly becausenothing rejected it, and the verifier never inspected artifacts.
Solution
Pack B —
devtools/verify_slos.py,docs/plans/slo-catalog.yaml,devtools/verify.py,tests/unit/devtools/test_slo_catalog.py:tier: cheap-local | labfield on every SLO row. Defaultcheap-local. Invalid tiers fail the catalog the same way invalidgates already do.
_collect_benchmark_tests()and the scoring loop filter by tier.Default invocation runs cheap-local.
--include-labadds lab;--tier <name>and--all-tierscover the other operator paths.Skipped surfaces are reported in a new
skipped_tierJSON section.devtools verify --labnow runsverify-slos --include-lab.already informational; the tier just makes the cost visible).
gate: requiredmust implytier: cheap-local, so nobody can promote a row into a gate thedefault loop cannot run.
test_real_pytest_benchmark_json_fixture_parsesdrives
parse_pytest_benchmark_statsover the committedtests/data/pytest-benchmark/reader-status.jsonfixture, andtest_verify_slos_scores_against_real_pytest_benchmark_fixturerunsthe parsed result through
verify_slos.main()to confirm budgetarithmetic.
Pack C —
devtools/verify_manifests.py,polylogue/verification/manifests/models.py,tests/unit/devtools/test_verify_manifests.py:_check_campaign_test_pathsenforces that every active campaigndeclares a non-empty
tests:list whose entries exist on disk(and, for mutation campaigns, the same for
paths_to_mutate).Inactive campaigns are exempt by design.
freshness_daysandartifact_globfields added to thePydantic
MutationCampaignEntry/BenchmarkCampaignEntrymodels(
freshness_daysmust be positive when set)._check_campaign_freshnessis silent when neither field isdeclared. When either is declared, it requires at least one
matching artifact, requires the newest match to be non-empty, and
(with
freshness_days) checks the artifact mtime against thedeclared window. Benchmark campaigns default the glob to
.local/benchmark-campaigns/*-<name>.json, matching thedevtools benchmark-campaign runoutput path. Mutation campaignsmust declare
artifact_globexplicitly._manifest_named_entriesnow treats a missing campaign section asan empty list, so the two enforcement passes compose cleanly when
manifests omit one section.
The existing pass/reject campaign-catalog tests are updated to seed
the referenced paths so they continue to assert the original
catalog-mismatch contract under the stricter path check.
Verification
Follow-ups
query,reader,facets)are still uncovered until they are actually run;
verify_slosintentionally blocks until a real benchmark JSON lands.
No campaign rows currently declare
freshness_days; the field isavailable for opt-in once campaign runs are scheduled.
Ref #1063