Repository navigation
feat(gate): produce the verdict through the provabl/evidence kernel (closes #7) - #9
Merged
Merged
Conversation
…loses #7) Phase-two Stream A, step 1 of ADR 0001. 'vet gate' no longer judges with hand-rolled if-statements: it runs the canonical Copland term Seq(Nonce, Seq(Meas, Sig)) through the evidence kernel's CVM, appraises the evidence bundle, and lowers the verdict to the Cedar workload attributes written to .vet/gate-result.json. The facts attest's PDP trusts are now appraised and freshness-bound (kernel nonce+SIG spine), not bare computations. Design (Option B): vet defines its own (ASP, appraiser) pair in-repo (internal/evidence), rather than importing evidence/providers/vet. The kernel CLAUDE.md blesses tool-owned providers; the no-ASP-branch invariant constrains only the kernel packages (providers are not kernel); and the kernel's reference Bundle is structurally insufficient for vet's real contract (CVEHigh, SBOMPresent, Signed, ArtifactHash, and high-vs-critical threshold semantics). Keeping the claim shape next to store.GateResult is what prevents Cedar-contract drift. No evidence-repo change; new dep github.com/provabl/evidence v0.1.0. - internal/evidence/provider.go: vet ASP pair. VerificationRecord is the measurer payload (round-trips, guaranteeing field fidelity); missing record -> CollectFailed (the kernel-native fail-closed path); appraiser emits the full PascalCase workload.* claim set + structured workload.failure claims, and applies min_slsa_level + cve_threshold (incl. the 'high' semantics the reference provider lacks). - internal/evidence/trust.go: ephemeral per-run ed25519 AM (Signer+Store). Ephemeral on purpose — in-process Run/Appraise; the durable artifact is the lowered JSON, and a persisted key would weaken freshness. - gate.go: Evaluate(ctx, ref) drives the CVM; gateResultFromAttrs is the single attrs->GateResult chokepoint; missing-record + failure list reconstructed from claims. - main.go: thread cmd.Context() into Evaluate; stdout + exit path unchanged. Contract preserved: all 4 pre-existing gate tests pass unchanged, and gate-result.json + stdout are byte-identical old-vs-new for both the pass and missing-record cases (verified against an origin/main build). New tests: provider pass / fail-min-SLSA / fail-critical / high≠critical / freshness nonce-mismatch / missing-record, plus an end-to-end high-threshold gate test. go vet clean, go test ./... green.
This was referenced Jun 9, 2026
Merged
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.
Closes #7. Phase-two Stream A, step 1 of ADR 0001 — tracked in the epic hub provabl/evidence#2.
What changes
vet gateno longer judges with hand-rolled if-statements. It now runs the canonical Copland termSeq(Nonce, Seq(Meas, Sig))through the evidence kernel's CVM, appraises the evidence bundle, and lowers the verdict to the Cedar workload attributes written to.vet/gate-result.json. The facts attest's PDP trusts become appraised and freshness-bound (kernel nonce + SIG spine), not bare computations.Design decision — Option B (vet-owned provider, one PR)
vet defines its own
(ASP, appraiser)pair ininternal/evidencerather than importingevidence/providers/vet:Bundleis structurally insufficient for vet's real contract (it lacksCVEHigh/SBOMPresent/Signed/ArtifactHashand the high-vs-critical threshold). Authoring the claim shape next tostore.GateResultis what prevents Cedar-contract drift.No evidence-repo change. New dep:
github.com/provabl/evidence v0.1.0.Files
internal/evidence/provider.go(new) — the vet ASP pair.VerificationRecordis the measurer payload (round-trips → field fidelity); missing record →CollectFailed(kernel-native fail-closed); appraiser emits the full PascalCaseworkload.*claim set + structuredworkload.failureclaims, applyingmin_slsa_level+cve_threshold(incl. thehighsemantics the reference provider lacks).internal/evidence/trust.go(new) — ephemeral per-run ed25519 AM (Signer+Store). Ephemeral on purpose: in-process Run/Appraise; the durable artifact is the lowered JSON; a persisted key would weaken freshness.internal/gate/gate.go—Evaluate(ctx, ref)drives the CVM;gateResultFromAttrsis the single attrs→GateResult chokepoint; missing-record + failure list reconstructed from claims.cmd/vet/main.go— threadcmd.Context()intoEvaluate; stdout + exit path unchanged.Contract preserved (hard constraint — attest reads this file)
gate-result.jsonand stdout are byte-identical old-vs-new for both the pass and missing-record cases (verified against anorigin/mainbuild, ignoring the timestamp).New tests
Provider: pass / fail-min-SLSA / fail-critical / high≠critical / freshness nonce-mismatch / missing-record (golden-asserts the exact claim key set). Plus an end-to-end
TestGateHighThresholdViaKernel.Verification
go vet ./...clean ·go test ./...green ·go build ./...ok.Follow-up (filed separately)
verify.godoesn't setSBOMPresent/ArtifactHashon the record — pre-existing, out of scope; issue to follow.