Repository navigation
fix(evidence): record opt-in-only service values as not-inferable (#2631) - #2894
Conversation
A generic recipe's service can never be produced by a snapshot fingerprint, which reports the provisioner it sees (metal3, rke2, ...). Fingerprint.Match therefore called the dimension mismatched and every generic-recipe attestation carried criteriaMatch.matched: false, even when the run was sound. CriteriaRegistry.IsOptInOnly classifies such values (today: service generic). Fingerprint.MatchWith records them as a fourth disposition, not-inferable, keeping the observed provider in fingerprintProvides, and Matched is no longer flipped by them. The verifier report gains a matching verdict. Existing v3 bundles verify unchanged; no predicate type bump. Fixes #2631 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Atif Mahmood <atif1996@users.noreply.github.com>
Recipe evidence checkNo leaf overlays affected by this PR. This gate is warning-only and never blocks merge. |
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository: NVIDIA/aicr/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA/aicr/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (15)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe change adds Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
Comment |
|
🌿 Preview your docs: https://nvidia-preview-fix-2631-opt-in-only-criteria.docs.buildwithfern.com/aicr |
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. |
Summary
Recipe evidence for an opt-in-only service value can now qualify.
generic(#2568) is selectable only by--service generic; a snapshot fingerprints the provisioner it sees (metal3,rke2, …) and nevergeneric, soFingerprint.Matchreported the service dimension asmismatchedand every generic-recipe attestation carriedcriteriaMatch.matched: false. The dimension is now recorded asnot-inferable, with the observed provider kept infingerprintProvides, and does not flipmatched.Fixes: #2631
Related: #2568, #2851
Motivation / Context
The committed pointer for
gb300-generic-ubuntu-training(#2851) is the live example. Its signed predicate reads:The bundle is internally valid and the measurement stands, but the predicate says the recipe was validated on a cluster that did not match it, which is not what happened: the fingerprint cannot produce
generic, so the comparison was never meaningful. The pointer merged because the per-source contract gate (evidence-pointercheck) is structural and never reads the predicate; this change is about the honesty of the predicate and readiness for design doc 007's step 7, not about unblocking CI.Per @yuanchen8911's options in #2631 this implements (c), a per-dimension disposition, which carries (b), the observed provider, and delivers (a), an explicitly selected opt-in-only value no longer disqualifies the evidence.
Type of Change
Component(s) Affected
pkg/recipe)pkg/fingerprint,pkg/evidence/attestation,pkg/evidence/verifierdocs/)Implementation Notes
pkg/recipe/criteria_registry.go):CriteriaRegistry.IsOptInOnly(field, value)backed by a package-level set, seeded withservice: generic. It is a property of the OSS value set, so a zero-value or--data-seeded registry answers the same;--datavalues are never opt-in-only.pkg/fingerprint/types.go):DimensionNotInferable = "not-inferable".unknownwas not reused: it means the fingerprint captured nothing, whereas here the fingerprint did capturemetal3and the predicate should say so.Fingerprint.MatchWith(c, reg)(pkg/fingerprint/match.go): a service diff thatmatchDimwould callmismatchedis reclassified when the recipe value is opt-in-only.Match(c)keeps its signature and delegates with the embedded registry.Matchedstill flips only onmismatched. An uncaptured provider staysunknown; an inferable service (eksvsmetal3) still mismatches.pkg/evidence/attestation/builder.go) callsMatchWithwith the embedded registry.pkg/evidence/verifier/report.go) gains a third verdict,✓ criteria satisfied; opt-in-only dimensions recorded as not-inferable (see rows), and the existing row format rendersnot-inferable recipe=generic snapshot=metal3.matchedare unchanged; the only wire difference is a new string inperDimension[].match, which every consumer today renders as an opaque string (the dashboard and pointer check do not readcriteriaMatchat all). Verifying the existing v3 bundle from docs(evidence): attest gb300-generic-ubuntu-training recipe-evidence v3 #2851 with this branch's binary passes 4/4 steps and still renders itsmismatchedrow, so old bundles are unaffected. If maintainers prefer aPredicateTypeV4for the enum addition, the fix(evidence): make recipe digest content-only via PredicateTypeV3 #2789 pattern applies.criteriaMatchexample was stale (map keyed by dimension, booleanmatch, v1 URI) and now shows the ordered array with the string enum; a new "Opt-in-only criteria values" section defines the rule; verification step 7 states thatunknownandnot-inferabledo not fail the step and that anot-inferablerow must carryfingerprintProvides.api-reference.md,cli-reference.md,pkg/recipe/doc.go) now say the dimension is recorded asnot-inferableand does not disqualify the evidence, replacing the "expected to report mismatched" wording.Out of scope, as Yuan noted in #2631: the selection question (a snapshot of a metal3 rack does not select the generic leaf) and any change to what the pointer-check gate reads.
Testing
New tests:
TestMatch_OptInOnlyServiceIsNotInferable,TestMatch_OptInOnlyServiceUncapturedStaysUnknown,TestMatch_ConcreteServiceStillMismatches,TestMatchWith_NilRegistryUsesEmbedded(pkg/fingerprint);TestCriteriaRegistry_IsOptInOnly(pkg/recipe);TestBuild_OptInOnlyServiceIsNotInferable(pkg/evidence/attestation, generic GB300 recipe against ametal3snapshot →matched: true, servicenot-inferable);TestRenderMarkdown_FingerprintVerdicts(pkg/evidence/verifier).No goldens or schemas change: the predicate has no JSON schema, and no recipe content moved.
make testrunstest-shelllast; on my machine ninetools/api-diff_test.shscenarios (reachable-internal-target-*,deleted-alias-target-*) fail withwant rc=16 got rc=17. They fail identically on untouchedmainatfd9001acawith this branch stashed, so it is a local api-diff environment issue, not this change; CI is the arbiter.Risk Assessment
Rollout notes: Additive. Existing bundles verify unchanged. New attestations of generic recipes carry
matched: truewith anot-inferableservice row; the nextgb300-generic-ubuntu-trainingrepublish (planned against the release that contains this fix, without a mutable validator tag per #2884) will be the first to show it.Checklist
make testwith-race)make lint)git commit -S)🤖 Generated with Claude Code