feat(dagger): Factor-based SSDLC/SLSA/SSDF pipeline with local-first execution#20
Open
MChorfa wants to merge 3 commits intoanthropics:mainfrom
Open
feat(dagger): Factor-based SSDLC/SLSA/SSDF pipeline with local-first execution#20MChorfa wants to merge 3 commits intoanthropics:mainfrom
MChorfa wants to merge 3 commits intoanthropics:mainfrom
Conversation
This was referenced Apr 9, 2026
971f055 to
054d293
Compare
Author
Major Improvements to Dagger ModuleThis PR has been significantly enhanced from the original basic implementation: What is new:Caching & Performance:
Artifact Outputs (not just stdout):
Cross-Platform Builds:
Security & Supply Chain:
Linting:
Complete Pipeline:
Technical Updates:
Ready for review! 🚀 |
5e74f83 to
f8b9e8f
Compare
…execution
Adds a Dagger module (dagger/ant-cli, engine v0.20.6) that replaces the
scattered GitHub Actions YAML with composable, locally executable Factor units.
## What this adds
- Factor pattern (inspired by Spin SIP 021): each pipeline concern is an
independent Go struct implementing Name/Dependencies/Execute.
- FactorRegistry with acyclic dependency resolution and lazy composition;
single Sync at the end to materialize the full graph.
- Atomic Dagger functions exposed on AntCli for direct CLI invocation:
Build, BuildForPlatform, Test, Lint, StaticAnalysis, SecretScanning,
VulnScan, SBOM, LicenseCheck, CollectEvidence, All.
- Function-level TTL caching:
+cache="1h" Build, Test, Lint, StaticAnalysis, VulnScan, SBOM, LicenseCheck
+cache="session" CacheWarmup, SecretScanning
+cache="never" CollectEvidence, All
- Named Dagger cache volumes shared across all factors:
go-mod-cache, go-build-cache, golangci-lint-cache, gosec-cache,
gitleaks-cache, govulncheck-cache, syft-cache, go-licenses-cache,
goreleaser-cache.
- Parallel cross-platform builds (linux/darwin/windows × amd64/arm64)
via goroutines in CrossPlatformBuildFactor.
- Security/compliance factors (non-blocking; evidence always produced):
gosec (SAST), gitleaks (secrets), govulncheck (CVE), Syft CycloneDX SBOM,
SLSA v1.0 provenance, Conftest policy-as-code, go-licenses.
- ImageCatalog() helper listing every pinned OCI image used.
- MIGRATION.md: full GitHub Actions → Dagger mapping, benchmark table,
caching strategy, hybrid CI example, and compliance coverage matrix.
## Benchmark highlights (M3 Max, v1.7.0 source)
Full pipeline cold: GHA ~4m45s → Dagger ~3m20s
Full pipeline cached: GHA ~2m10s → Dagger ~1m37s
Repeated image pulls: GHA 8-12/run → Dagger 0 (content-addressed cache)
## Files
dagger/main.go AntCli struct + atomic Dagger functions
dagger/factors_types.go Factor interface, FactorState, FactorRegistry
dagger/factors_build.go BuildFactor, TestFactor, LintFactor
dagger/factors_security.go StaticAnalysisFactor, SecretScanningFactor, VulnScanFactor
dagger/factors_slsa.go SBOMFactor, SLSAProvenanceFactor
dagger/factors_ssdf.go PolicyCheckFactor, LicenseCheckFactor
dagger/factors_cicd.go GoReleaserFactor, CrossPlatformBuildFactor,
ReleaseVerificationFactor, PrivateRepoAccessFactor
dagger/factors_cache.go CacheWarmupFactor
dagger/factors_catalog.go ImageCatalog()
dagger/MIGRATION.md Full migration guide + benchmarks
dagger.json Module manifest (source: dagger/, engine: v0.20.6)
ad5a277 to
ad960cc
Compare
2cfb503 to
3f80732
Compare
…tructure Reformats tables for better readability with consistent column alignment, adds comprehensive nested table of contents with section anchors, and fixes numbered list formatting in "Adding a New Factor" section.
3f80732 to
87db778
Compare
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.
feat(dagger): Factor-based SSDLC/SLSA/SSDF pipeline with local-first execution
Summary
Adds a Dagger module (
dagger/ant-cli, enginev0.20.6) thatexposes the full CI pipeline as composable, locally executable Go functions — runnable
identically on a laptop and in GitHub Actions with no YAML changes to the runner.
The design replaces the inner steps of the existing workflows with typed, content-addressed
Dagger calls. The GitHub Actions triggers, artifact upload, and release publishing remain
unchanged.
Why Dagger over raw GitHub Actions YAML?
act(limited fidelity) or a pushdagger call --source=. all— identical to CIlatesttagsactions/cache; re-declared per workflowDirectoryFactoris a Go struct;FactorStateis injectable for mockingBenchmark (M3 Max,
v1.7.0source, p50 over 10 runs)go mod downloadper runArchitecture: Factor Pattern
Inspired by Spin SIP 021 — Spin Factors.
Each pipeline concern is an independent Go struct:
FactorRegistry.ExecuteAllresolves the dependency graph, composes outputs lazily withWithDirectory, and materializes once with a singleoutput.Sync(ctx).Dependency graph executed by
dagger call --source=. all:New files
dagger/main.goAntClistruct + atomic Dagger functionsdagger/factors_types.goFactorinterface,FactorState,FactorRegistrydagger/factors_build.goBuildFactor,TestFactor,LintFactordagger/factors_security.goStaticAnalysisFactor,SecretScanningFactor,VulnScanFactordagger/factors_slsa.goSBOMFactor,SLSAProvenanceFactordagger/factors_ssdf.goPolicyCheckFactor,LicenseCheckFactordagger/factors_cicd.goGoReleaserFactor,CrossPlatformBuildFactor,ReleaseVerificationFactor,PrivateRepoAccessFactordagger/factors_cache.goCacheWarmupFactordagger/factors_catalog.goImageCatalog()— lists all pinned OCI imagesdagger/MIGRATION.mddagger.jsonsource: dagger/, enginev0.20.6)Function-level TTL caching
+cache="1h"Build,Test,Lint,StaticAnalysis,VulnScan,SBOM,LicenseCheck+cache="session"CacheWarmup,SecretScanning+cache="never"CollectEvidence,AllAllandCollectEvidenceareneverto prevent Dagger returning a stale evidencebundle from a previous failed run. All inner container operations still benefit from
Dagger's content-addressed layer cache.
How to run locally
Hybrid CI (drop-in replacement for inner steps)
No
actions/cachestep needed — Dagger manages volumes internally.Compliance coverage
StaticAnalysis,SecretScanning,VulnScangosec-report.json,gitleaks-report.json,vulns.jsonSBOM,SLSAProvenancesbom.cdx.json,slsa.json,provenance.sha256PolicyCheck,LicenseCheckconftest-report.json,licenses.jsonGoReleaser,ReleaseVerificationFull migration guide, benchmark methodology, and step-by-step adoption instructions:
dagger/MIGRATION.md
Checklist
go build ./dagger/...passesdagger call --source=. allcompletes locally (~1m37s, all 11 factors)latestin production factors)MIGRATION.mdcovers adoption path, benchmarks, and compliance mapping