Skip to content

feat: add compare command for retained pull-request reviews - #153

Open
sundaram2021 wants to merge 4 commits into
prooflinedev:mainfrom
sundaram2021:feat/review-compare
Open

sundaram2021 wants to merge 4 commits into
prooflinedev:mainfrom
sundaram2021:feat/review-compare

Conversation

@sundaram2021

@sundaram2021 sundaram2021 commented Dec 3, 2026 •

Copy link
Copy Markdown

Summary

Add proofline compare, a read-only command for comparing two retained reviews of the same pull request.

proofline compare --base-review BASE_UUID --review TARGET_UUID
proofline compare --base-review BASE_UUID --review TARGET_UUID --json
proofline compare --schema

The command reads existing review records. It does not request another review, modify findings, or require a local checkout.

Why this

After running another review on a pull request, users need to understand what changed since an earlier run. Inspecting each review separately makes it difficult to track findings and distinguish recorded changes from missing or incomplete results.

This command presents those differences directly while preserving the limits of the retained data: a finding missing from the target review is not automatically treated as fixed.

How it works

  • Validate that both review IDs refer to retained PULL_REQUEST reviews of the same repository and pull request.

  • Compare CODE and ENVIRONMENT findings separately, matching only exact server-retained fingerprints rather than guessing from finding text or location.

  • Report matched findings, findings visible only in one snapshot, recorded lifecycle transitions, field changes, and evidence-reference additions/removals. Evidence comparison uses the retained references, not the contents of linked URLs.

  • Keep missing fingerprints, duplicate matches, and incomplete assessments explicitly unmatchable, ambiguous, or partial instead of presenting an unsupported conclusion.

  • Provide terminal-safe text output, versioned JSON (proofline.review-comparison.v1) containing both retained snapshots, and an offline JSON Schema through --schema.

Exit codes follow the existing CLI conventions: 0 for a complete comparison, 2 for a partial comparison, and 1 for invalid arguments, incompatible reviews, or read failures.

Relevant files

Files Purpose
src/compare.rs Command arguments, review validation, matching, completeness, and report construction.
src/compare/render.rs Text and JSON rendering.
src/compare/schema.rs Versioned comparison JSON Schema.
src/compare/tests.rs, tests/compare.rs Unit and real-binary integration tests; render/schema modules also contain unit tests.
src/lib.rs, tests/completions.rs, README.md Command registration, discovery/completions coverage, and usage documentation.
src/update.rs, src/update/tests.rs, tests/update.rs Windows redirected-output background-discovery fix and cache/subprocess regressions.
src/agent/tests.rs, tests/agent_install.rs, tests/hooks.rs, tests/local_patch.rs, tests/mcp.rs Inherited Windows test and lint portability corrections.

Scope: Windows follow-up fixes

Validation reproduced inherited Windows failures in files unchanged by the original comparison feature. This PR also includes two separate follow-up commits:

  • 9663272 makes the existing test fixtures portable: clone ownership, exact permission restoration, canonical executable/path comparisons, a valid Windows filename, a relative local push remote, and preservation of SYSTEMROOT in the isolated MCP test subprocess.

  • 801a594 defers advisory background update discovery when Windows output is redirected. Native diagnostics showed that the foreground invocation exited successfully while its discovery descendant kept the captured output pipes open. A deferred check does not consume the daily attempt, so a later console invocation can still check normally; cached notices and non-Windows behavior are retained.

These follow-ups overlap existing work in #79, #103 and #116 and are isolated from the feature commit for review/reconciliation. No timeout was increased and no new test was skipped or ignored. The temporary diagnostic workflow is not part of this PR, and its remote test branch has been removed.

Before the comparison review follow-up, native Windows validation passed the complete suite (197 passed, 0 failed), strict all-target Clippy, formatting, and 12 consecutive updater-regression repetitions: https://github.com/sundaram2021/proofline-cli/actions/runs/47051658475. This is evidence for the existing Windows follow-up commits, not a claim of a fresh native Windows run for subsequent comparison-only changes.

Testing

All 41 comparison tests passed: 23 unit/render/schema tests and 18 real-binary integration tests using loopback API fixtures.

Coverage includes fingerprint matching and ambiguity, lifecycle transitions, evidence canonicalization, incomplete lane coverage, subject and response-ID validation, organization isolation, schema validation, safe rendering, bounded retries, and transport failures. New regressions cover missing ENV assessments in both directions, duplicate groups alongside unrelated one-sided fingerprints, current completed ENV records without retired check receipts, all documented no-receipt check states, ten incomplete/contradictory controls, and safe uppercase text/enum-change rendering.

Current review-fix commit: a23e21b. On pinned Rust 1.100.0, the complete Linux all-target suite passed with 211 passed, 0 failed, and one pre-existing opt-in pre-commit test ignored. Formatting, strict all-target Clippy, and cargo deny check also passed; the latter retains existing duplicate-dependency warnings.

cargo test --locked --lib compare:: -- --nocapture
cargo test --locked --test compare -- --nocapture
cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings
cargo test --locked --all-targets --no-fail-fast
cargo deny check

Contributor-reported live testing also passed in both comparison directions for two retained review runs. Both live records had zero findings; finding-bearing behavior was validated with fixtures.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T07:35:29.619953Z 801a594 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 801a5942e2

ℹ️ 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 src/compare.rs Resolved
Distinguish missing ENV assessments from completed empty inventories, isolate duplicate fingerprint ambiguity, and support completed ENV records without retired check receipts. Normalize safe text output and validate duplicate identities before indexing evidence. Add unit and real-binary regressions for the review findings.

This branch has not been deployed

No deployments
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