Skip to content

feat(evidence): surface aicr build commit on corroboration dashboard - #3063

Merged
mchmarny merged 1 commit into
NVIDIA:mainfrom
mikecook:feat/aicr-commit-dashboard
Oct 2, 2026
Merged

mchmarny merged 1 commit into
NVIDIA:mainfrom
mikecook:feat/aicr-commit-dashboard

Conversation

@mikecook

@mikecook mikecook commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Thread the aicr build commit from the CLI through the evidence predicate, ingest meta.json, and corroborate RunMeta to the dashboard. Each run now shows its short SHA, linked to the commit on GitHub.

Motivation / Context

Nightly main runs all share aicrVersion: main, so on the dashboard they could only be told apart by GitHub run id and attested date. The commit was captured at build time but dropped before it reached any metadata the dashboard reads.

Fixes: #1596
Related: N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Build/CI/tooling

Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)
  • API server (cmd/aicrd, pkg/server)
  • Recipe engine / data (pkg/recipe)
  • Bundler and deployers (pkg/bundler, pkg/component)
  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)
  • Validator (pkg/validator)
  • Core libraries (pkg/errors, pkg/k8s)
  • Docs/examples (docs/, examples/)
  • Other: pkg/evidence/attestation, pkg/evidence/project, pkg/corroborate (incl. renderer), pkg/client/v1

Implementation Notes

  • New optional field aicrCommit on the predicate, project.Meta, corroborate.RunMeta, Latest, and SeriesBuild. It is omitempty everywhere, so output for a commit-less run is byte-identical to before.
  • No schema version bumps. The predicate stays 1.0.0, meta.json stays aicr-corroboration-meta/v1, and the dashboard stays aicr-corroboration/v1. The field is additive and optional, every consumer decodes leniently, and nothing gates on the predicate schemaVersion.
  • The commit is validated at the producer and at the consumer. BuildPredicate lowercases it and drops anything that is not a 7-40 character hex SHA, so the unstamped ldflags default unknown is never recorded. corroborate.loadRun drops a malformed commit from meta.json with a warning but keeps the run, because the input tree may not come from the trusted ingest. The renderer re-checks the hex pattern before building the link, and every value still goes through esc.
  • catalog.isValidCommit is exported as catalog.IsValidCommit so both stages reuse the existing SHA check instead of duplicating it.
  • Display and traceability only. Version consensus still groups by aicrVersion.
  • Renderer: build column headers in the per-source history show the short SHA under the version. The matrix cell and build cell detail panels get a commit row linking to https://github.com/NVIDIA/aicr/commit/<sha>.
  • Publish and SignExisting rebuild from the on-disk statement, so a commit stamped at emit time survives later signing.
  • Out of scope, as the issue states: stamping the UAT main cell binary with commit=<github.sha>. Until that lands, those runs carry no commit and render as they do today.

Testing

# Commands run (prefer `make qualify` for non-trivial changes)
make qualify
go test -race ./pkg/evidence/... ./pkg/corroborate/... ./pkg/client/v1/... ./pkg/validator/catalog/... ./pkg/cli/... ./tools/evidence-project/... ./tools/testgrid-publish/...

make qualify passes. All listed packages pass under -race. New or extended tests:

  • TestBuildPredicate_AICRCommit: a full or short SHA is kept, and uppercase is lowercased. unknown, an empty value, a too-short value, and non-hex values are dropped, and the key is then absent from the JSON.
  • TestEmit_StampsAICRCommitIntoStatement: the commit lands in the on-disk in-toto statement, not just the in-memory predicate.
  • TestSynthesize_HappyPath / TestSynthesize_CommitlessPredicateOmitsCommit: meta.json carries the commit, and a commit-less predicate omits the key.
  • TestGenerateSurfacesAICRCommit: two main runs from different commits are distinguishable in both index.json and the series. A malformed commit is dropped but its run is kept, and the value never reaches the output.
  • TestRendererCommitLinkRequiresSHA: the renderer only builds the commit link for a hex SHA.

Coverage:

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert
  • Medium — Touches multiple components or has broader impact
  • High — Breaking change, affects critical paths, or complex rollout

The field is optional and omitted when empty. Older bundles and release cells ingest and render unchanged.

Rollout notes: Backward compatible in both directions. Older verifiers and consumers ignore the new field, and newer consumers treat a missing field as no commit. No migration or flag needed.

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are signed off and cryptographically signed (git commit -s -S) — GPG signing info

Runs that share an aicrVersion, such as nightly main runs, were only
distinguishable by run id and attested date. The build commit now flows
from the CLI through the evidence predicate (aicrCommit), the ingest
meta.json, and corroborate RunMeta into the dashboard JSON. The renderer
shows a short SHA on each build column and a linked commit row in the
run details panels.

The field is optional. A value that is not a 7-40 character hex SHA,
including the unstamped default "unknown", is omitted at emit time and
dropped at dashboard generation, so commit-less bundles ingest and
render unchanged. catalog.IsValidCommit is exported so both stages
reuse the existing SHA check.

Signed-off-by: Mike Cook <micook@nvidia.com>
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Recipe evidence check

No leaf overlays affected by this PR.

This gate is warning-only and never blocks merge.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/aicr/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 104f198a-05ed-4c85-b994-ef61cb7616a4

📥 Commits

Reviewing files that changed from the base of the PR and between 8d73c92 and 98e81a4.

📒 Files selected for processing (20)
  • docs/contributor/evidence-ingest.md
  • docs/design/007-recipe-evidence.md
  • pkg/client/v1/evidence.go
  • pkg/corroborate/generate.go
  • pkg/corroborate/generate_test.go
  • pkg/corroborate/meta.go
  • pkg/corroborate/model.go
  • pkg/corroborate/renderer/index.html
  • pkg/corroborate/renderer_test.go
  • pkg/evidence/attestation/builder.go
  • pkg/evidence/attestation/emit.go
  • pkg/evidence/attestation/emit_test.go
  • pkg/evidence/attestation/predicate.go
  • pkg/evidence/attestation/predicate_test.go
  • pkg/evidence/attestation/types.go
  • pkg/evidence/project/meta.go
  • pkg/evidence/project/synthesize.go
  • pkg/evidence/project/synthesize_test.go
  • pkg/validator/catalog/catalog.go
  • pkg/validator/catalog/catalog_test.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The AICR build commit now passes through evidence predicates and synthesized run metadata into corroboration output. The dashboard displays valid commits as short SHAs and GitHub links. Invalid commit values are omitted without excluding their runs. The commit remains display metadata and is not a consensus key.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Suggested reviewers: njhensley

Fixed issue severity: <fixed_issue_severity>Medium</fixed_issue_severity>

Merge Risk: ⚪ Minimal · up to 98e81

The commit display change appears mergeable after normal checks. Commit-less runs continue to render without the new field.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue [#1596] requires optional commit flow through the predicate, meta.json, and RunMeta. The changes add AICRCommit at each stage and pass it from EvidenceOptions.Commit. loadRun validates…
Out of Scope Changes check ✅ Passed The changes stay within issue [#1596]. The catalog validation export, documentation updates, propagation models, renderer changes, and tests support commit validation, backward-compatible ingestion, o…
Title check ✅ Passed The title clearly and concisely describes the main change: exposing the AICR build commit on the corroboration dashboard.
Description check ✅ Passed The description directly explains the commit metadata flow, dashboard behavior, compatibility, testing, and motivation described by the changeset.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@mikecook
mikecook marked this pull request as ready for review October 2, 2026 20:57
@mikecook
mikecook requested a review from a team as a code owner October 2, 2026 20:57

@mchmarny mchmarny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve: no findings against 98e81a4. Reviewed-SHA CI and local make qualify passed.

@mchmarny
mchmarny merged commit 8e43f71 into NVIDIA:main Oct 2, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Surface aicr build commit on the corroboration dashboard

2 participants