Skip to content

Say where text output's non-head evidence was read - #152

Open
ammartahamohamedy wants to merge 3 commits into
prooflinedev:mainfrom
ammar-taha-dev:fix/text-evidence-location
Open

ammartahamohamedy wants to merge 3 commits into
prooflinedev:mainfrom
ammar-taha-dev:fix/text-evidence-location

Conversation

@ammartahamohamedy

@ammartahamohamedy ammartahamohamedy commented Dec 2, 2026 •

Copy link
Copy Markdown

Fixes #151

Problem

render::location printed every cited file as at path:lines, ignoring commit_sha, companion_repository and provenance_status. A read of the base commit or of a companion repository looked like a line at the reviewed head. SARIF and --annotations already place only verified reads at the head.

Fix

  • render::location keeps every cited file. A citation SARIF would place prints as before. Any other gets a note on where it was read: (base <sha12>) when the commit is the reviewed base, (commit <sha12>) for another commit, (in <owner/repo>) (or in a companion repository, also for a blank name) and (unverified).
  • The reviewed commits are a CommitPair: a code assessment's findings use its own base and head, and the rest use the review's. A patch review records no head of its own, so without this a read at the code assessment's head would print as commit …. When the review does record a head, outcome::code_assessment already requires the code assessment to match it.
  • The note comes from sarif::code_location's status (now pub(super) with LocationStatus), so text and SARIF use one rule. A citation SARIF skips for other reasons, such as one with no line or no recorded commit, prints as before.
  • Both text views get it: render::review (review, findings, run) and the hook summary line (hooks::print_findings).
  • Text only: --json, SARIF and annotations are unchanged.
           at src/lib.rs:10-14
           at src/lib.rs:10-14 (base bbbbbbbbbbbb)
           at src/lib.rs:10-14 (in acme/contracts)

Tests (written first; each failed before the change)

Test What it checks
text_output_says_where_each_citation_sarif_does_not_place_was_read (new, tests/sarif.rs) findings --review notes the base, another commit, a companion repository and an unverified read, leaves the head read alone, and SARIF from the same review places only that one
a_finding_cited_off_the_reviewed_head_says_where_it_was_read (new, tests/hooks.rs) The pre-commit summary line notes a citation read at the patch's base. The stand-in's patch review now records base_commit_sha
a_code_finding_in_the_hook_line_is_read_against_its_assessments_commits (new, tests/hooks.rs) With no head on the patch review, a code finding cited at the CODE record's head prints a plain location, and one cited at its base prints (base …)
a_citation_off_the_reviewed_head_says_where_it_was_read (new, src/render.rs unit) Head match ignores case. No recorded commit, a nameless companion and an empty or blank name are handled, and a companion name is made terminal-safe
a_code_finding_is_read_against_its_assessments_commits (new, src/render.rs unit) With no review head, a code finding at the code assessment's head prints plain, and one at its base prints (base …)

Mutation checks: printing commit for a base read, or dropping the unverified note, fails both the unit and the SARIF integration test. Reading code findings against the review's commits fails both code-finding tests. Dropping the blank-name check fails the citation unit test. Dropping the code assessment's base fails the hook test.

End to end, offline, with the built binary: the issue's repro prints three identical at src/lib.rs:10-14 lines on main, and with this change the base and companion reads carry their notes.

Checks

  • cargo fmt --check: ✅
  • cargo clippy --locked -- -D warnings: clean on the lib, the bins and the integration tests. --all-targets stops at the 2 errors main already has on Windows (src/agent/tests.rs).
  • cargo test --locked: the new tests pass. Otherwise, the same 12 Windows failures as on main (tests/mcp.rs ×7, agent_install ×2, update, local_patch, hooks on a Windows push URL), none of them in this change.
  • cargo deny check: no dependency changes.
  • Fork CI: ✅ check and windows pass on the fork PR after rebasing onto upstream f00327b (the first run failed only at cargo deny, on a yanked pin-project-lite 0.2.18 that upstream had already bumped).

Proofline review log

Fork review PR: ammar-taha-dev/proofline-cli#6. Rounds capped at 2; round 3 ran only because the PR was rebased.

Round Finding What I made of it Outcome
1 WARNING: code assessment findings are labelled against the review's head, so with no review head a read at the code assessment's head prints as commit … Correct: a patch review records no head, and the code assessment's pair is the real one Fixed: CommitPair, with a hook test and a unit test written first
1 WARNING: an empty or blank companion_repository prints (in ) Correct Fixed: a blank name reads as none (in a companion repository), and the unit test covers both
2 No findings Clean
3 4 findings in tests/mcp.rs, src/api.rs and openapi.public.json Upstream's own code: the rebase put upstream's commits in the fork PR's diff, because the fork's main was behind Not part of this change
3 WARNING: the hook test only checks a citation at the head, so the hook could lose the code assessment's base Correct Fixed: the hook test adds a code finding cited at the base, which must print (base …)
3 WARNING: a citation with no commit prints bare, like a verified head read Out of scope by design: the contract leaves commit_sha null only when the review recorded no head, and those print as before Declined

The prompts below are the ones that drove this implementation, except the round-3 test change (4beaa1e), which was made in a separate session; the investigation, reproduction and fix scope were done before them and aren't included.

@ammartahamohamedy
ammartahamohamedy force-pushed the fix/text-evidence-location branch from c33b250 to a45af32 Compare December 3, 2026 10:57

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.

Text output prints evidence read at another commit or in a companion repository as a head location

1 participant