Skip to content

refactor(proof): retire CLI proof runners covered by pytest (#594) - #1069

Merged
Sinity merged 3 commits into
masterfrom
feature/test/verifiability-phase3
May 16, 2026
Merged

Sinity merged 3 commits into
masterfrom
feature/test/verifiability-phase3

Conversation

@Sinity

@Sinity Sinity commented May 16, 2026

Copy link
Copy Markdown
Owner

Summary

Retires three CLI proof runners (cli.command.json_envelope, cli.command.help, cli.command.no_traceback) now that pytest owns their behavioral contracts. Extends test_stdout_stderr_split.py with 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 EvidenceEnvelope objects, and require special-purpose tooling to run — adding complexity with no additional coverage value.

Solution

Commit 1 — retire cli.command.json_envelope:

  • Remove run_cli_json_envelope_evidence() and _json_args_for_subject() from runners.py
  • Remove cli.command.json_envelope claim and runner binding from catalog.py
  • Remove test_cli_json_envelope_runner_emits_ok_evidence from test_evidence_runners.py
  • Remove from evidence-freshness.yaml per_push policy
  • Update test_catalog.py and test_diffing.py assertions

Commit 2 — expand TestHelpExitCodeAndContent + retire cli.command.help / cli.command.no_traceback:

  • Add _ALL_COMMANDS tuple (53 command paths) to test_stdout_stderr_split.py
  • Parametrize test_help_exits_zero_with_usage() over all 53 paths — asserts exit 0, "Usage:" present, no traceback
  • Remove _run_cli_help_evidence(), _run_cli_no_traceback_evidence() from runners.py
  • Remove their dispatch cases from run_cli_visual_evidence() (plain_mode branch kept — no pytest owner yet)
  • Remove both claims from catalog, runner bindings, evidence-freshness, test assertions

Result: 497 obligations (was 603), 38 claims (was 40). Catalog regenerated.

Verification

git push   # pre-push gate ran all 15 checks in 19.7s, all pass
python -m pytest tests/unit/cli/test_stdout_stderr_split.py -q  # 54 passed
python -m devtools verify --quick  # exit_code: 0

Stacks on #1068. Ref #594

Co-Authored-By: Claude [email protected]

@coderabbitai

coderabbitai Bot commented May 16, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 51 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d599bb32-dda6-4041-9261-127972353247

📥 Commits

Reviewing files that changed from the base of the PR and between b4d58f9 and 98f2123.

📒 Files selected for processing (12)
  • docs/plans/evidence-freshness.yaml
  • docs/verification-catalog.md
  • polylogue/proof/__init__.py
  • polylogue/proof/catalog.py
  • polylogue/proof/runners.py
  • tests/unit/cli/test_deterministic_output.py
  • tests/unit/cli/test_stdout_stderr_split.py
  • tests/unit/proof/test_catalog.py
  • tests/unit/proof/test_diffing.py
  • tests/unit/proof/test_evidence_runners.py
  • tests/witnesses/blob-store-layout.witness.json
  • tests/witnesses/mcp-tool-schemas.witness.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/test/verifiability-phase3

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread polylogue/proof/catalog.py Resolved
Base automatically changed from feature/test/verifiability-phase1 to master May 16, 2026 05:06
Sinity and others added 3 commits May 16, 2026 07:06
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]>
@Sinity
Sinity force-pushed the feature/test/verifiability-phase3 branch from e37c0f5 to 98f2123 Compare May 16, 2026 05:07
@Sinity
Sinity merged commit 7de3f0b into master May 16, 2026
3 checks passed
@Sinity
Sinity deleted the feature/test/verifiability-phase3 branch May 16, 2026 05:07
Sinity added a commit that referenced this pull request May 16, 2026
…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]>
Sinity added a commit that referenced this pull request May 16, 2026
## 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]>
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant