Repository navigation
feat(training): write attest:* tags through the evidence kernel (closes #38) - #39
Merged
Merged
Conversation
#38) Phase-two Stream A, step 2 of ADR 0001, following the merged vet#7. Training completion no longer becomes IAM tags via a mechanical moduleID->key map: the verdict is produced by running a Copland term Seq(Nonce, Seq(Meas, Sig)) through the evidence kernel's CVM, appraising it, and lowering the verdict to the attest:* attributes written via the same iamTagWriter.TagRole interface. The facts attest's principal resolver trusts are now appraised, not unconditional. Design (Option B, mirrors vet): qualify defines its own (ASP, appraiser) pair in-repo (internal/evidence, package qualifyasp, ASP id 'training', target scheme principal://). One PR; new dep github.com/provabl/evidence v0.1.0. - internal/evidence/provider.go: the training pair. Completion event injected via Provider(Input). Unmapped module -> ev.NotApplicable (the kernel-native form of the old 'if !ok return nil'). Appraiser judges score>=passingScore: on pass emits the attest:<module> + -expiry claims, on fail emits none. Keys arrive pre-resolved from tags.go (TagForModule/ModuleExpiryTag) and flow verbatim through lower — the appraiser never types an attest:* literal (drift guard). - internal/evidence/trust.go: ephemeral per-run ed25519 AM (Signer+Store), as in vet. - service.go: CompleteModule gains a passingScore param; writeAttestTags drives the CVM and funnels through tagsFromAttrs (the single attrs->[]iamtypes.Tag chokepoint, filtering on the attest: prefix so synthetic 'attested'/'training.*' never leak). - tags.go: add DefaultPassingScore=80 (backend default; CLI overrides per-module). - call sites: CLI passes mc.PassingScore; backend passes DefaultPassingScore. Behavior change (deliberate, documented): a failing score now writes NO tags. Previously the backend handler called CompleteModule unconditionally and wrote tags for failing scores — a latent false-attestation bug this fixes. The pass-case attest:* tag set + RFC3339 expiry on the wire is unchanged (the contract attest reads). Tag key strings remain sourced solely from tags.go (relates to #32). Tests: provider pass/fail/unmapped-NotApplicable/freshness/expiry-format (golden key set); service-level pass-writes / fail-none / unmapped-none via mock tagger. make check (gofmt+vet+staticcheck+short tests) green.
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 #38. Phase-two Stream A, step 2 of ADR 0001 — epic hub provabl/evidence#2 — following the merged vet#7 (#9).
What changes
Training completion no longer becomes IAM tags via a mechanical
moduleID → attest:* keymap. The verdict is produced by running a Copland termSeq(Nonce, Seq(Meas, Sig))through the evidence kernel's CVM, appraising it, and lowering the verdict to theattest:*attributes written via the sameiamTagWriter.TagRoleinterface. The facts attest's principal resolver trusts are now appraised, not unconditional writes.Design (Option B, mirrors vet)
qualify defines its own
(ASP, appraiser)pair in-repo:internal/evidence(packagequalifyasp), ASP idtraining, target schemeprincipal://. One PR; new depgithub.com/provabl/evidence v0.1.0.internal/evidence/provider.go— completion event injected viaProvider(Input). Unmapped module →ev.NotApplicable(the kernel-native form of the oldif !ok return nil). Appraiser judgesscore >= passingScore: pass emitsattest:<module>+-expiryclaims, fail emits none. Drift guard: keys arrive pre-resolved fromtags.go(TagForModule/ModuleExpiryTag) and flow verbatim throughlower— the appraiser never types anattest:*literal.internal/evidence/trust.go— ephemeral per-run ed25519 AM (Signer+Store), as in vet.internal/training/service.go—CompleteModulegains apassingScoreparam;writeAttestTagsdrives the CVM and funnels throughtagsFromAttrs(the single attrs→[]iamtypes.Tagchokepoint, filtering on theattest:prefix so syntheticattested/training.*never leak).tags.go—DefaultPassingScore = 80(backend default; CLI overrides per-module). Tag constants +moduleTagMapunchanged.mc.PassingScore; backend passesDefaultPassingScore.A failing score now writes NO tags. Previously the backend handler called
CompleteModuleunconditionally and wroteattest:*tags even for failing scores — a latent false-attestation bug this fixes. The pass-caseattest:*tag set + RFC3339 expiry on the wire is unchanged (the contract attest reads).Tests
Provider: pass / fail-emits-nothing / unmapped-NotApplicable / freshness nonce-mismatch / expiry-format (golden key set). Service-level via mock tagger: pass-writes-tags / fail-writes-nothing / unmapped-writes-nothing.
make check(gofmt + vet + staticcheck + short tests) green.Relationships
attest:*tag schema): this PR routes all key emission through thetags.goconstants, lowering future drift cost; it does not implement versioning.SetIdentityTags(lab-id, admin-level) andRecordCountryCheck(country, coc-*) through the kernel too — out of scope here (training modules only).