Repository navigation
Add ci review --annotations to show findings on the pull request diff - #52
Merged
Merged
Conversation
`ci review --annotations` prints each finding that is not resolved as a GitHub Actions workflow command on stderr, placed on the cited file and lines when an evidence ref is verified at the review's head. Annotations work on every GitHub plan, while uploading SARIF to code scanning needs GitHub Advanced Security on private repositories. Values are escaped like @actions/core does, so a claim cannot end its command or start another one.
mohsen1
approved these changes
Nov 17, 2026
mohsen1
left a comment
Member
There was a problem hiding this comment.
Codex
Resolved README changes and updated the identity regression fixture for the opt-in flag. Exact-head location checks and workflow-command escaping remain intact. Both required jobs passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Who this helps
Teams that run
proofline ci reviewin GitHub Actions and want findings where they read code, on the diff.Right now the way to get there is
--sarifplusgithub/codeql-action/upload-sarif, and on a private repository that upload needs GitHub Advanced Security. A lot of teams in the 20 to 150 engineer range don't have it, so findings stay in the job log or behind the review link and the author has to go and look for them.Workflow annotations work on every plan. With
--annotations, each finding that is not resolved becomes one::error(SERIOUS) or::warning(WARNING) line, and GitHub pins it to the cited file and lines in the Files changed tab and lists it on the run summary.What changed
src/annotations.rs(new) walks the same findings as the SARIF export (the CODE assessment for this head, then each environment assessment) and writes one workflow command per finding.src/sarif.rsexposeslocation(), a thin wrapper over the existingcode_location(), so annotations and SARIF agree on where a finding goes.src/outcome.rsgets a smallresolved()helper, now used both by--fail-onand by annotations instead of comparing against"RESOLVED"in two places. Severities go through the existingSeverityenum.src/lib.rsadds the--annotationsflag toci reviewand calls the writer right after the review is read.README.mdgets a short paragraph next to the other CI notes.Decisions
::add-mask::or::stop-commands::, or post a fake error. Values first go throughtext::terminal_safe, which already strips control characters for terminal output, then get the same escaping as@actions/core:%and newlines in the message, plus:and,in properties. The integration test feeds a claim that tries exactly this.file=/line=/endLine=only when one of its evidence refs passes the checks SARIF already applies: a verified repository read at the review's head commit, with a valid path and line range. Other findings are annotated on the job with no location.GITHUB_ACTIONS=true, andci reviewalready leaves behaviour changes to explicit flags (--fail-onfails nothing unless you pass it). Turning annotations on by default inside Actions would change the logs of existing jobs. If you want that later, it is a small follow-up with a--no-annotationsswitch.--jsonoutput stays one parseable document. The runner wires a step's stderr to the sameOutputManageras stdout (ScriptHandler.cs), so the commands are still processed, and progress messages already use stderr throughsay().--fail-ontreats CODE findings. A severity this CLI doesn't know yet becomes a::notice, so a new server value still shows up instead of disappearing from the job.Verification
src/annotations.rscovers the escaping table:\r\n,%,::add-mask::inside a value, and an ANSI escape sequence.tests/http.rsruns the binary against the axum mock server with three ENV findings: a SERIOUS one with a verified ref at the head, a WARNING one cited at another commit, and a RESOLVED one. Without the flag, no stderr line starts with::. With it, stderr holds exactly two commands. The first is placed onsrc/app.rslines 3 to 5 with the injection attempt escaped; the second has no location. stdout is still valid JSON and the exit code is unchanged.cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsandcargo test --lockedpass on Linux with the pinned 1.98.1 toolchain, andcargo deny checkpasses.Not in this PR
$GITHUB_STEP_SUMMARY. GitHub shows at most 10 error and 10 warning annotations per step, so a long review gets cut off; a summary table could list the rest using the same walk.GITHUB_ACTIONS=true.