Skip to content

feat: inspect commit-pinned review evidence against local Git - #163

Open
kapolos wants to merge 1 commit into
prooflinedev:mainfrom
kapolos:feat/evidence-inspect
Open

kapolos wants to merge 1 commit into
prooflinedev:mainfrom
kapolos:feat/evidence-inspect

Conversation

@kapolos

@kapolos kapolos commented Dec 3, 2026

Copy link
Copy Markdown

feat: inspect commit-pinned review evidence against local Git

Why this matters

A finding is tied to the source Proofline reviewed. The engineer or coding agent acting on it may already be working from a different revision.

Consider a PR with several findings. An engineer fixes the first, commits the change, then investigates the next. The original review is still useful, but some of its cited files may no longer match the source being investigated. The same problem arises when an agent picks up findings from an earlier review.

While testing Proofline against a small multitenant service, I found that its API already exposes the commit, path and file digest needed to inspect this relationship. Establishing it locally, however, required retrieving that metadata and inspecting Git objects by hand.

This PR makes that inspection a first-class CLI operation. It gives engineers and coding agents a deterministic way to check their source assumptions before acting on a finding, without requesting another AI review.

proofline evidence inspect <REVIEW_ID>
proofline evidence inspect <REVIEW_ID> --json

Same review. Same recorded evidence. Different local revision.

The demonstration below uses a genuine hosted Proofline review before and after a locally committed fix. Watch the two independent results: the recorded digests still match, while the cited file differs at local HEAD.

proofline-evidence-inspect.mp4

Two independent observations

flowchart TD
    A[Proofline review] --> B[Reviewed commit and source path]
    A --> C[Recorded SHA-256]
    B --> D[Original Git blob]
    D --> E[Compute SHA-256]
    C --> F[Compare digests]
    E --> F
    D --> G[Compare blob identities]
    H[Source at local HEAD] --> G
    F --> I[Evidence integrity]
    G --> J[Local source comparison]
    style I fill:#18754e,stroke:#18754e,color:#ffffff
    style J fill:#315b9a,stroke:#315b9a,color:#ffffff
Loading

Evidence integrity checks whether the original Git blob bytes match Proofline's recorded digest. Local source comparison checks whether the cited file has the same Git blob identity at local HEAD. The second observation does not require a recorded digest.

These are deliberately separate. A file can differ at HEAD while its historical evidence remains intact. A matching digest does not prove a finding is correct, and a changed file does not establish that the finding has been resolved.

Validated against Proofline itself

I used Proofline to review a synthetic Python/SQLite service with two tenant isolation defects. It identified both. Before implementing the command, I independently compared its recorded digests with the original Git blob bytes. I then exercised the new CLI against the same review in three local states.

Observation Reviewed revision Staged and unstaged edits Committed fix
Recorded digests matched 5/5 5/5 5/5
References unchanged at HEAD 5/5 5/5 0/5
References changed at HEAD 0/5 0/5 5/5

Five evidence references to one unique source file, two findings, one hosted review. No additional AI review was required.

Implementation

flowchart LR
    A[CLI] --> B[Existing API client]
    A --> C[Inspection engine]
    C --> D[Bounded local Git inspection]
    C --> E[Shared source eligibility]
    F[SARIF export] --> E
    C --> G[Typed report]
    G --> H[Terminal output]
    G --> I[JSON output]
Loading

The implementation uses the existing API and dependency set. No backend changes or new crates.

  • Bind the local repository to the review's repository identity and resolve HEAD once.
  • Read immutable Git objects without replacement objects, implicit fetching or working-tree filters. Bound subprocess output and execution time.
  • Reuse shared source eligibility rules with SARIF and cache repeated object reads without hiding contradictory digests.
  • Report unavailable and unsupported evidence explicitly, rather than treating it as verified.

I used AI coding agents for implementation and testing, with separate empirical feasibility, correctness and architectural review passes.

Scope

This is a read-only diagnostic, not a deployment gate or a finding reassessment. It compares committed revisions, not uncommitted changes, and does not infer that a changed file was modified after the reviewed commit. Partial and promisor clones, companion repositories and historical cloud-state verification are outside its scope.

Verification

  • cargo fmt --check
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo test --locked
  • cargo deny check
  • git diff --check
  • Existing SARIF regression tests
  • Live hosted review validation

181 tests passed on Linux, with zero failures and one pre-existing ignored test. Live validation covered CODE_ONLY findings; ENV-lane source references and negative paths are covered by automated fixtures. Windows execution remains unverified.

Verify recorded source digests against immutable Git blobs and compare
cited source content with a fixed local HEAD revision.

Bind inspection to the reviewed repository, distinguish integrity from
source changes, and report unavailable evidence explicitly.

Keep Git inspection bounded and local-only, reuse shared source
eligibility rules, and support human-readable and JSON output.

Validate against a genuine hosted Proofline review and cover security,
eligibility, resource limits, and failure paths with regression tests.

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