6.7 KiB
Development
Start here when contributing to ConfigKit. Read the task-specific owners below before making changes. The component overview maps implementation responsibilities; the configuration contract owns public behavior.
Initial orientation
- Inspect the working tree and preserve unrelated changes.
- Read the architecture policy for code or design work.
- Read the policy, contract, and internal documents applicable to the task.
- Inspect the relevant implementation and behavioral tests before changing them.
Task-specific reading guide
| Task | Read |
|---|---|
| Repository orientation or component responsibility | Architecture policy and component overview |
| Documentation changes | Documentation policy and the owning document |
| Architecture decisions or future work | Documentation policy, initial target record, and relevant ADRs listed below |
| Code and test changes | Architecture policy, testing policy, and the owning contract and tests from the map below |
| Examples or copyable assets | The owning implemented contract and consumer adoption guide |
| Release preparation | Release policy, release procedure, and release-readiness evidence |
Accepted decisions:
- Separate composition and overlay
- Own YAML semantics behind a private parser boundary
- Preserve presence and record application resolution
- Secret references and explicit bootstrap
- Explicit overrides and safe explanation
For cross-cutting changes, follow every applicable row. The implementation plan owns the ordered stages and their acceptance checks and recorded implementation evidence.
Baseline validation
Install Go 1.25.0 or a supported patched/newer Go toolchain. Acquire declared dependencies explicitly before entering an offline development or validation environment:
go mod download
Run the everyday check with Bash 3.2 or newer and Git:
./scripts/check.sh
The script runs from the repository root regardless of the
invocation directory. It checks Go formatting without rewriting files, checks
staged/unstaged and untracked whitespace, then runs go test ./...,
go vet ./..., and go build ./..., stopping on the first failure. It uses the
installed Go toolchain by default, honors an explicit GOTOOLCHAIN, and disables
dependency downloads. Acquire dependencies and any selected toolchain beforehand.
Format reported Go files with gofmt -w <files>.
The default suite includes executable examples, maintained consumer fixtures, local documentation-link checks, and the dependency import-boundary check. It must stay deterministic and runnable without network access or credentials. Still inspect new/untracked content and review paths, examples, ownership, and current-versus-planned claims; automated checks do not replace content review.
Use focused checks while iterating, with validation proportionate to the change
under the testing policy. Documentation-only work normally needs the local-link
check below and whitespace review; behavior-bearing examples and commands also
need execution. Use go test -race ./... for ownership or concurrency changes.
The separate release checker adds
two-toolchain, module-hygiene, race, and cross-build gates.
Task-to-test map
Commands run from the repository root after dependency acquisition. These are starting points for focused iteration; run the everyday check before handing off code changes. Use the component overview to find the corresponding implementation.
| Task | Behavioral test owners | Focused command |
|---|---|---|
| YAML syntax, diagnostics, parser limits | Adapter tests, source translation | go test ./internal/yaml and go test . -run '^TestParseSource' |
| File/reader access, imports, globs, containment | Sources, FIFO, imports, globs | `go test . -run 'Source |
| Composition, profiles, CLI precedence | Composition, overlay, profiles, overrides | `go test . -run 'Compose |
| Schema, defaults, projection, cloning | Schema, decoding, projection | `go test . -run 'Schema |
| Lifecycle, resolution, validation, callback ownership | Loading, resolution, validation, ownership, independence | `go test . -run 'Load |
| Paths, metadata, provenance | Paths, metadata, provenance | `go test . -run 'Path |
| Secrets, bootstrap, redaction, explanation | References, bootstrap, rendering, explanation | `go test . -run 'Secret |
| Consumer examples and migration fixtures | Consumer tests, API examples | go test ./examples/consumers and go test . -run '^Example' |
| Documentation links and dependency isolation | Link checks, import boundary | `go test . -run '^(TestLocalDocumentationLinks |
| Check-command behavior | Shell regression | go test . -run '^TestCheckScripts' |
Fuzz validation
Run the bounded fuzz targets independently from the repository root. These exact commands keep each campaign short and constrain concurrent workers:
go test . -run='^$' -fuzz='^FuzzParsePath$' -fuzztime=30s -parallel=2
go test ./internal/yaml -run='^$' -fuzz='^FuzzParseDocument$' -fuzztime=30s -parallel=2
go test . -run='^$' -fuzz='^FuzzCompositionAndOverlay$' -fuzztime=30s -parallel=2