4.2 KiB
4.2 KiB
Tasks — enterprise-slsa
Closed 2026-04-19 — landed alongside this change; all tasks completed unless noted.
Package scaffolding
- Move from
src/lib/*.tsflat layout to co-located four-file feature modules. - Rewrite
package.jsonwith per-feature subpathexports. - Rewrite
vite.config.tsfor preserveModules + workspace externals. - Drop legacy
tsconfig.json; keeptsconfig.lib.jsononly. - Rewrite
vitest.config.tswith istanbul provider and polyfills setup file. - Create
tests/setup/polyfills.tsto polyfill WebCrypto under Node.
Dependencies
- Add
@suaveplan/error(workspace). - Add
@suaveplan/types(workspace). - Add
@suaveplan/crypto(workspace). - Add
@suaveplan/crypto-hash(workspace). - Add
@suaveplan/crypto-utils(workspace). - Add
@suaveplan/serialize(workspace). - Add
@opentelemetry/api(catalog:observability). - Add
zod(catalog:forms).
Errors
- Create
SLSA_CODESregistry viadefineCodes. - Create
SlsaErrorbase class. - Create
InvalidProvenanceError. - Create
InvalidSbomError. - Create
VerificationFailedError. - Create
PolicyViolationError. - Create
RekorUploadError. - Create
RekorInclusionError. - Create
AttestationInvalidError. - Create
EnvironmentUnsupportedError. - Co-located tests, md, and barrel.
Schemas
- Provenance schemas (
ProvenanceStatementSchemaand descendants). - SBOM schemas (
SbomSchema,SbomInputSchema, components). - Verification schemas (
VerificationPolicySchema,VerificationResultSchema, assessment). - Attestation schemas (
DsseEnvelopeSchema,RekorEntrySchema,InclusionProofSchema). parseProvenance/parseSbomwith structured error output.parseProvenance/parseSbomtests.
OTel
SlsaEventAttributestyped attribute bag.SlsaOtelAdapterinterface +createSlsaOtelAdapterfactory.noopSlsaOtelAdapterdefault.- Co-located tests, md.
Provenance
canonicalize(sorted-key JSON).computeDigestvia@suaveplan/crypto-hash.generateProvenancewith Zod-compatible inputs.- Validation via structured errors.
serializeProvenance,hashProvenance.- OTel
slsa.provenance.generatedevent wiring. - Co-located tests, md.
Verification
- Split
checks.tsrule file. - Add
checkBuildAge,checkSourceRepoPrefix,allowedBuilders. verifyProvenancewith injectable clock and OTel adapter.- Co-located tests, md.
SBOM
generateSbomwith injectable clock + serial.- Structured
InvalidSbomErroron missing fields. serializeSbom,hashSbom,buildPurl.- Co-located tests, md.
Assessment
assessSlsaLevelwith optional Rekor inclusion signal.detectEnvironmentreadingSLSA_*env vars.- Co-located tests, md.
Attestation (DSSE)
encodeDssePaeper DSSE spec.wrapInDsse.verifyDsseEnvelope(ed25519, keyid scoping).- Co-located tests, md.
Rekor
verifyRfc6962InclusionProofwith odd-size carry-up.rfc6962LeafHashutility.RekorClientwith injectablefetch.uploadHashedrekordv0.0.1.uploadIntotov0.0.2 (computes payload sha256 automatically).getEntryByUuid,getEntryByLogIndex.verifyInclusionProofemitsslsa.rekor.inclusion_verifiedOTel event.- Response envelope flattening + Zod validation.
- Co-located tests (no live Rekor), md.
Policy
evaluatePolicylayering provenance verification + DSSE signatures + Rekor inclusion + min SLSA level.- OTel
slsa.policy.violationon failures. - Co-located tests, md.
Docs
- Co-located
.mdfor every.tsimplementation file. - Root
README.mdrewritten with Modules section.
Verification
bunx turbo typecheck --filter=@suaveplan/slsagreen.bunx turbo lint --filter=@suaveplan/slsagreen.bunx turbo test --filter=@suaveplan/slsagreen (170 tests).bunx turbo test:coverage --filter=@suaveplan/slsameets 95% threshold on every axis.bunx turbo build --filter=@suaveplan/slsagreen.