Skip to content

feat(gate): produce the verdict through the provabl/evidence kernel (closes #7) - #9

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/gate-via-evidence-kernel
Jun 9, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/gate-via-evidence-kernel

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #7. Phase-two Stream A, step 1 of ADR 0001 — tracked in the epic hub provabl/evidence#2.

What changes

vet gate no longer judges with hand-rolled if-statements. It now 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 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 in internal/evidence rather than importing evidence/providers/vet:

  • The kernel CLAUDE.md blesses tool-owned providers ("a provider may move into its tool's repo — the import direction is identical").
  • The no-ASP-branch invariant constrains only the kernel packages; providers are not kernel.
  • The kernel's reference Bundle is structurally insufficient for vet's real contract (it lacks CVEHigh/SBOMPresent/Signed/ArtifactHash and the high-vs-critical threshold). Authoring 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.

Files

  • internal/evidence/provider.go (new) — the vet ASP pair. VerificationRecord is the measurer payload (round-trips → field fidelity); missing record → CollectFailed (kernel-native fail-closed); appraiser emits the full PascalCase workload.* claim set + structured workload.failure claims, applying min_slsa_level + cve_threshold (incl. the high semantics 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; gateResultFromAttrs is the single attrs→GateResult chokepoint; missing-record + failure list reconstructed from claims.
  • cmd/vet/main.go — thread cmd.Context() into Evaluate; stdout + exit path unchanged.

Contract preserved (hard constraint — attest reads this file)

  • All 4 pre-existing gate tests pass unchanged.
  • gate-result.json and stdout are byte-identical old-vs-new for both the pass and missing-record cases (verified against an origin/main build, 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.go doesn't set SBOMPresent/ArtifactHash on the record — pre-existing, out of scope; issue to follow.

…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.
@scttfrdmn
scttfrdmn merged commit ea7a987 into main Jun 9, 2026
1 check passed
@scttfrdmn
scttfrdmn deleted the feat/gate-via-evidence-kernel branch June 9, 2026 01:23
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.

Re-point gate output onto provabl/evidence (vet ASP + appraiser pair)

1 participant