fix(verifier): add trust level reason to verify output#705
Merged
Conversation
Add TrustReason field to VerifyResult so every trust-level decision carries a human-readable rationale. Displayed in CLI text output as an indented line below the trust level, and included in JSON output via the struct tag. This explains why --attest + --data produces "attested" instead of "verified" (external data provenance is unknown).
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
Coverage Report ✅
Coverage BadgeMerging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
lalitadithya
approved these changes
Apr 28, 2026
lockwobr
pushed a commit
that referenced
this pull request
Apr 28, 2026
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.
Summary
Add
TrustReasonfield toVerifyResultso every trust-level decision carries a human-readable rationale. Displayed inaicr verifytext output as an indented line below the trust level, and included in JSON output via the struct tag.Example output after fix:
Motivation / Context
aicr verifyreports different trust levels for--attestvs--attest --databundles but gives no explanation for the difference. The tier delta is intentional (external data provenance is unknown) but the lack of signal is confusing.Fixes: #683
Related: N/A
Type of Change
Component(s) Affected
pkg/bundler,pkg/component/*)cmd/aicr,pkg/cli)Implementation Notes
TrustReason stringfield toVerifyResultinpkg/bundler/verifier/trust.gosetTrust()helper method to set level + reason atomically (also keepsVerify()under thefunlenlint limit)Verify()andverifyChecksumStep()(10 return paths total)↳ <reason>below the trust level linetrustReasonfield automatically via struct tagTesting
pkg/bundler/verifier: ALL PASS — addedTrustReasonassertions to 3 integration testspkg/cli: ALL PASS — added test case verifying reason display in text outputgolangci-lint: 0 issues on changed packagespkg/trust(Sigstore TUF) is unrelatedRisk Assessment
Rollout notes: N/A — purely additive UX improvement. Existing JSON consumers ignore unknown fields.
Checklist
make testwith-race)make lint)git commit -S) — GPG signing info