Repository navigation
refactor(proof): retire CLI proof runners covered by pytest (#594) - #1069
Conversation
|
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 (12)
✨ 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cd36ba57a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The test_json_envelope_contract.py pytest suite now owns this claim with 5 deterministic subjects (doctor, insights status, neighbors, schema list, tags). The proof runner is no longer the evidence owner. Removed: - run_cli_json_envelope_evidence() from proof/runners.py - _json_args_for_subject() helper (only used by removed function) - cli.command.json_envelope Claim from proof/catalog.py - json_envelope runner binding from default_runner_bindings() - re-export from proof/__init__.py - test_cli_json_envelope_runner_emits_ok_evidence from test_evidence_runners.py - claim from evidence-freshness.yaml per_push policy - assertion from test_catalog.py and test_diffing.py Regenerated docs/verification-catalog.md (40 claims, 603 obligations). Witness timestamps refreshed after passing regression suite. Closes slice of #594 Co-Authored-By: Claude <[email protected]>
… proof runners (#594) test_stdout_stderr_split.py::TestHelpExitCodeAndContent now parametrizes over all 53 CLI commands (+ --version), providing complete pytest evidence for both claims. The proof runners are no longer the evidence owners. Removed: - cli.command.help and cli.command.no_traceback claims from catalog.py - _run_cli_help_evidence(), _run_cli_no_traceback_evidence() from runners.py - help/no_traceback dispatch branches from run_cli_visual_evidence() (plain_mode branch kept — no pytest owner yet) - runner bindings for both claims from default_runner_bindings() - test_cli_help_runner_emits_ok_evidence from test_evidence_runners.py - claims from evidence-freshness.yaml per_push policy - assertions from test_catalog.py and test_diffing.py Catalog: 497 obligations, 38 claims (was 603/40). Added 53 parametrized --help tests to test_stdout_stderr_split.py. Closes slice of #594 Co-Authored-By: Claude <[email protected]>
Replace custom run_cli_visual_evidence proof runner with parametrized pytest contracts across all 53 CLI commands. Before: 5 commands tested via proof runner in TestPlainModeNoAnsi. After: all 53 commands tested via @pytest.mark.contract in TestPlainModeNoAnsi, no dependency on proof runner infrastructure. Removes: - run_cli_visual_evidence() from runners.py and __init__.py - _run_cli_plain_mode_evidence(), _plain_help_args_for_subject(), _without_plain_flag() helpers from runners.py - cli.command.plain_mode claim from catalog.py and test_catalog.py - plain_mode runner binding from default_runner_bindings() - per_push freshness policy (now in pytest, not proof runners) Fixes stale "smoke" evidence_class assertion in test_catalog.py (no smoke-class runners remain in catalog — pre-existing failure). Ref #594 Co-Authored-By: Claude <[email protected]>
e37c0f5 to
98f2123
Compare
…ces (#1065 #594) (#1083) ## Summary Pack C of #1065 — retire the proof-era operator entry points now that Pack A renamed report headings and Pack B added artifact-source grouping. The `devtools proof-pack` library and `devtools affected-obligations` command are replaced with `devtools verification-impact` and a `verification_impact` module that delegates the same diff-shaped report. No backwards-compat aliases. ## Problem After Pack A/B, the operator surface still said "proof-pack" / "affected-obligations" even though the report headings and grouping had been moved to standard verification terminology. The terminology kept users confused about what guarantee the report actually provides — it summarizes catalog-routed checks, not mathematical proofs. The `devtools verify` baseline also still ran an `affected-obligations check` step, exporting the old name through git hooks and PR comments. ## Solution - Rename `devtools/proof_pack.py` → `devtools/verification_impact.py`, `build_proof_pack` → `build_verification_impact_report`. - Rename `devtools/affected_obligations.py` → `devtools/verification_impact_cli.py`. - Rename CLI command `affected-obligations` → `verification-impact` in `devtools/command_catalog.py` (with help/description updated to drop "proof-pack" language). - Rename verify baseline step `affected-obligations check` → `verification-impact check` (and the `--commit` tier help text). - Update changed-path routing in `polylogue/proof/diffing.py` to recommend `devtools verification-impact` and point at the renamed test files. - Update CLAUDE.md / CONTRIBUTING.md "Proof Pack workflow" section to "Verification Impact workflow"; the markdown report heading was already "## Polylogue Verification Impact" from Pack A. - Update catalog claim wording in `polylogue/proof/catalog.py` to talk about the verification catalog and changed-path routing instead of "proof-pack routing" / "proof-pack known-gap rendering". - Fix inherited proof_catalog routing tests in `tests/unit/proof/test_diffing_runtime.py` that were left red after PR #1079 narrowed the claim-file fan-out (used `diffing.py` as a fan-out example; the test now uses `catalog.py`, which is a claim-defining file, and expects the new infrastructure reason text). No `obligation-diff` command existed in the tree — only a stale CHANGELOG reference. No CI workflow invoked `devtools proof-pack` (proof-comment.yml is currently a no-op). The library symbol `affected_obligations` (a dataclass field on `AffectedObligationReport`) is still used inside `polylogue/proof/diffing.py`. That is an internal substrate name, not the operator-facing surface; renaming it is out of scope for this PR. #594 catalog-row pruning is a deeper survey of `polylogue/proof/catalog.py` that was not done here; the catalog surface still exists and PR #1069 / #1074 already retired CLI proof runners and dead runners. ## Verification ``` nix develop -c devtools render-all --check nix develop -c devtools verify --quick # exit 0 (30s) nix develop -c pytest tests/unit/devtools/test_verification_impact.py \ tests/unit/devtools/test_verification_impact_cli.py \ tests/unit/devtools/test_verify.py \ tests/unit/devtools/test_devtools_main.py \ tests/unit/devtools/test_render_devtools_reference.py \ tests/unit/proof/ \ tests/unit/verification/test_breakers.py -q # -> 134 passed, 1 xfailed nix develop -c devtools verification-impact --json --path docs/verification-catalog.md # -> emits the same report shape under the new command name ``` The generated `docs/devtools.md` table now lists `devtools verification-impact` in both the Verification-Lab Surface block and the Verification command table. Pre-existing failing tests in `tests/unit/devtools/test_benchmark_campaign.py` and `tests/unit/devtools/test_scenario_projections.py` (benchmark scenario catalog drift) are unchanged by this PR and outside its surface area. Closes #1065 Ref #594 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.6 <[email protected]>
## 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]>
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Retires three CLI proof runners (
cli.command.json_envelope,cli.command.help,cli.command.no_traceback) now that pytest owns their behavioral contracts. Extendstest_stdout_stderr_split.pywith a parametrized matrix covering all 53 CLI commands.Problem
After PR #1068 adds CLI contract tests, three proof claims remain backed only by proof runner infrastructure rather than standard pytest evidence. The proof runners duplicate test logic, emit custom
EvidenceEnvelopeobjects, and require special-purpose tooling to run — adding complexity with no additional coverage value.Solution
Commit 1 — retire
cli.command.json_envelope:run_cli_json_envelope_evidence()and_json_args_for_subject()fromrunners.pycli.command.json_envelopeclaim and runner binding fromcatalog.pytest_cli_json_envelope_runner_emits_ok_evidencefromtest_evidence_runners.pyevidence-freshness.yamlper_push policytest_catalog.pyandtest_diffing.pyassertionsCommit 2 — expand
TestHelpExitCodeAndContent+ retirecli.command.help/cli.command.no_traceback:_ALL_COMMANDStuple (53 command paths) totest_stdout_stderr_split.pytest_help_exits_zero_with_usage()over all 53 paths — asserts exit 0, "Usage:" present, no traceback_run_cli_help_evidence(),_run_cli_no_traceback_evidence()fromrunners.pyrun_cli_visual_evidence()(plain_mode branch kept — no pytest owner yet)Result: 497 obligations (was 603), 38 claims (was 40). Catalog regenerated.
Verification
Stacks on #1068. Ref #594
Co-Authored-By: Claude [email protected]