Skip to main content

Internals

The ciz codebase keeps command wiring, compilation stages, and runtime execution in separate packages so the planner remains testable and extensible.

Top-level structure

AreaResponsibility
cmd/cizCobra command wiring and flag definitions
internal/loaderLoad intent, component manifests, and composition assets
internal/schemaCompile and enforce JSON schema validation
internal/normalizeCanonicalize input structures before expansion
internal/expandMaterialize environment × component instances
internal/plannerBind jobs, resolve dependencies, topologically order the DAG
internal/renderMaterialize deterministic plan output
internal/runnerExecute a compiled plan with state tracking
internal/executorBackend adapters for local, Docker, and GitHub Actions execution
internal/ghaGitHub Actions-compatible execution engine
internal/gitChange-detection helpers
internal/uiTerminal formatting and presentation helpers

Design constraints

  • planning stages should be deterministic
  • runtime behavior should stay explicit in the plan artifact
  • command handlers should stay thin
  • internal model contracts should be stable between stages

That split is what lets ciz keep the compile boundary clean while still supporting multiple execution backends.