Skip to content

Show what the --fail-on verdict counted in review output - #104

Open
iguigova wants to merge 2 commits into
prooflinedev:mainfrom
iguigova:ci-output-matches-verdict
Open

iguigova wants to merge 2 commits into
prooflinedev:mainfrom
iguigova:ci-output-matches-verdict

Conversation

@iguigova

@iguigova iguigova commented Nov 27, 2026 •

Copy link
Copy Markdown

Who it helps

Teams that run proofline ci review with --fail-on or --annotations, and anyone who reads a pull request's review in a terminal.

The verdict and the output read different data, so they can disagree. --fail-on measures the server's open_items counts, and those respect what people decided about each finding. The annotations, the text and SARIF don't see those decisions. So a SERIOUS finding someone dismissed on GitHub stays a red ::error on the diff while the job passes, and nothing says it was dismissed.

It also breaks the other way. The counts include findings that no assessment lists: open findings of earlier runs that this review didn't find again, and environment findings that have no severity. A job can fail --fail-on warning on one of those while its log says production: COMPLETED, no findings.

What changes

The output now shows what the verdict counted. Here is ci review --annotations --fail-on serious against a local fake of one review (exit 3):

::error file=src/app.rs,line=3,endLine=5,title=Proofline production%3A data_integrity::Retries drop orders.%0A%0Aorders are lost
::error title=Proofline production%3A data_integrity (DISMISSED)::Stale cache.%0A%0Aorders are lost
::notice title=Proofline production%3A iam (INVESTIGATION)::The role cannot read the bucket
::error title=Proofline earlier run 1::Pool exhausts connections
acme/app #12 run 2 at 89abcdef0123: COMPLETED

production: COMPLETED, 3 findings
  SERIOUS  data_integrity  Retries drop orders.
           at src/app.rs:3-5
           impact: orders are lost
           id: 0190f3a0-0000-7000-8000-0000000000a1
  SERIOUS  data_integrity  Stale cache.
           impact: orders are lost
           decision: DISMISSED by ada (GITHUB_COMMENT, 2026-11-20T10:00:00Z)
           id: 0190f3a0-0000-7000-8000-0000000000a2
  INVESTIGATION  iam  The role cannot read the bucket

Still open from earlier runs, not found again by this review:
  SERIOUS  run 1  Pool exhausts connections
           review: 0190f3a0-0000-7000-8000-0000000000e3
The review has an open finding at or above the --fail-on severity. Proofline counts 3 open findings, 2 of them SERIOUS.
  • Decisions. A finding with a recorded decision gets a decision: line in the text, a (DISMISSED)-style suffix on its annotation title, and a decision property in SARIF.
  • Environment findings with no severity (investigation_findings) print under their environment. Each line starts with its source: CONFIRMED_REQUIREMENT, INVESTIGATION or SHARED_IDENTITY. The environment's finding count includes them, so it no longer says "no findings" beside one. On the job they're notices. One whose assessment the review doesn't list gets its own section after the assessments.
  • Earlier runs' open findings (open_items.earlier_findings) print after the assessments, with the review that recorded each. On the job they're errors or warnings by severity, or notices for a severity this CLI doesn't know.
  • The --fail-on line on a pull-request review names the counts it measured.

This sits beside #80, which adds review gaps to the annotations. Both change src/annotations.rs, so whichever merges second needs a rebase. I'll do it if this one is second.

Decisions

  • Label, never hide. The contract says a dismissal or risk acceptance can expire, and the finding carries no expiry. An expired dismissal counts as open again. Hiding dismissed findings could hide the one that's failing the job. So a decision labels the finding, keeps its level, and is never a SARIF suppression.
  • Render what the API returns. No new command, no new route and no change to the verdict. Each new field is optional with a default, so an older server's response decodes as before. A review with none of this data prints exactly as it did, and --json still prints the raw document.
  • One rule for both renderers. The text and the annotations both show an environment finding whose assessment isn't listed, so neither drops what the counts include.
  • Counts only where they decided the verdict. Only pull-request reviews are measured by open_items, so only they print the counts. Other reviews keep the plain line.

How I verified it

  • cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked (167 passed, 1 ignored; 156 before) and cargo deny check with cargo-deny 0.20.2 all pass.
  • tests/contract.rs holds the three new types to openapi.public.json, decoding both the smallest and the fullest document the contract allows.
  • tests/http.rs runs ci review end to end against a fake server: a dismissed finding, an investigation finding and an earlier run's finding become the annotations above, and --fail-on serious exits 3 naming the counts. The existing --fail-on matrix now also checks the counts line for ci review and review --pr.
  • Unit tests in render.rs, annotations.rs and lib.rs cover each source label, a missing source, an unlisted assessment, an untitled earlier finding, an automatic decision, terminal escapes in the new server text, and that a commit review never prints counts.
  • tests/sarif.rs checks the decision property, that there's no suppression, and that a finding without a decision has no decision key.
  • cargo llvm-cov: every one of the 523 source lines this change adds runs under the tests.
  • cargo mutants --in-diff over this change: 39 mutants on the changed lines, all killed. The change adds no function above cyclomatic complexity 10 and raises none that was, as lizard counts it.

🤖 Generated with Claude Code

iguigova and others added 2 commits November 26, 2026 20:04
`ci review --fail-on` measures the server's open-item counts, which honour
finding decisions and include findings no assessment lists. The text,
annotations and SARIF now show the same data:

- each finding's recorded decision, as a `decision:` line, an annotation
  title suffix and a SARIF `decision` property, never a suppression,
  because a dismissal can expire unseen;
- environment findings with no severity, under their environment and led
  by their source, counted in the environment's findings;
- earlier runs' open findings that the review did not find again;
- the counts themselves on the `--fail-on` line of a pull-request review.

Every new field is optional, so older responses decode as before, and a
review without the new data prints exactly as it did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`emit` only joins its properties, so it borrows them. An earlier run's
finding with a severity this CLI does not know is annotated as a notice,
and a test now holds that. The review's environment findings field states
what it holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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