Skip to content

feat(training): route identity + countries-of-concern tags through the kernel (closes #40) - #41

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/route-identity-coc-kernel
Jun 9, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/route-identity-coc-kernel

Conversation

@scttfrdmn

Copy link
Copy Markdown
Collaborator

Closes #40. Follow-up to qualify#38 (#39), which routed training-module tag writing through the evidence kernel but scoped out the other two attest:* writers. This finishes the qualify re-point: all of qualify's attest:* emission now flows through lower.ToAttributes — no hand-built tag sets remain.

What changes

  • SetIdentityTags (attest:lab-id, attest:admin-level) and RecordCountryCheck (attest:country, attest:coc-check-current, -expiry) now produce their tags through the kernel and the same tagsFromAttrs chokepoint.

Design

  • internal/evidence: new AttributesProvider (ASP id attrs) — a second (ASP, appraiser) pair for direct attribute attestation. Unlike training there's no quiz, so the appraiser always passes: the verdict is "these recorded attributes are attested as of now" and the claims are the attest:* tags. Empty input → NotApplicable.
  • service.go: extracted runProviderToTags (shared CVM run → appraise → lower path) and tagRole (the IAM write); writeAttestTags, SetIdentityTags, RecordCountryCheck all use them — one kernel path.
  • Drift guard: tag keys come from tags.go constants (TagLabID, TagCountry, …); the package never types an attest:* literal.

Contract preserved

Existing TestRecordCountryCheck_WritesIAMTags (asserts the exact tags) passes unchanged through the new path. Added TestSetIdentityTags_WritesIAMTags (+ no-stray-tags), invalid-admin-level guard, and attributes-provider tests (verbatim emission + empty=NotApplicable). make check green.

Completes Stream A's qualify re-point — training, identity, and countries-of-concern all route through the kernel.

…e kernel (closes #40)

Follow-up to qualify#38 (#39), which routed training-module tag writing through
the evidence kernel but scoped out the other two attest:* writers. This finishes
the qualify re-point: SetIdentityTags (attest:lab-id, attest:admin-level) and
RecordCountryCheck (attest:country, attest:coc-check-current, -expiry) now produce
their tags through the kernel and the same tagsFromAttrs chokepoint, so ALL of
qualify's attest:* emission flows through lower.ToAttributes — no hand-built tag
sets remain.

- internal/evidence: new AttributesProvider (ASP id 'attrs') — a second pair for
  direct attribute attestation. Unlike training there is no quiz, so the appraiser
  always passes; the verdict is 'these recorded attributes are attested as of now'
  and the claims are the attest:* tags. Empty input -> NotApplicable.
- service.go: extracted runProviderToTags (the shared CVM run/appraise/lower path)
  and tagRole (the IAM write); writeAttestTags, SetIdentityTags, and
  RecordCountryCheck all use them. Tag KEYS are sourced from tags.go constants
  (TagLabID, TagCountry, ...) so the package never types an attest:* literal —
  same drift guard as the training pair.

Behavior unchanged: the existing TestRecordCountryCheck_WritesIAMTags (which
asserts the exact attest:country/coc-check-* tags) passes through the new path.
Added TestSetIdentityTags_WritesIAMTags, an invalid-admin-level guard test, and
attributes-provider tests (verbatim emission + empty=NotApplicable).

make check (gofmt + vet + staticcheck + tests) green.
@scttfrdmn
scttfrdmn merged commit b1286a9 into main Jun 9, 2026
4 of 5 checks passed
@scttfrdmn
scttfrdmn deleted the feat/route-identity-coc-kernel branch June 9, 2026 20:02
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.

Route SetIdentityTags + RecordCountryCheck through the evidence kernel

1 participant