17 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.
- Use the Policy Reading Guide below to select applicable policies.
- Read the contract and internal documents applicable to the task.
- Inspect the relevant implementation and behavioral tests before changing them.
Policy Reading Guide
| Policy | Read before… |
|---|---|
| Policy set provenance | Adopting policies, checking upstream revisions, or updating the adopted policy set. |
| Agents | Recommending, planning, or implementing repository changes. |
| Architecture | Planning or changing Go library code or its structure. |
| Testing | Selecting validation for code changes, or adding, changing, removing, or evaluating tests. |
| Documentation | Writing, revising, or reorganizing documentation. |
| OSS | Adding or updating dependencies or incorporated third-party material, or changing licensing or attribution. |
| Release | Preparing or publishing a release, changing release procedures, or making versioning and compatibility decisions. |
- Read applicable policies before making decisions they govern; multiple policies may apply.
- Select policies using the task triggers above. Follow cross-references to relevant sections when needed to resolve a concrete question.
- Reuse policies already available in context; reread when changed or no longer available.
- Expand reading when the task's scope expands.
- When revising a policy itself, read that policy and any provisions elsewhere affected by the revision.
Task-specific reading guide
| Task | Read |
|---|---|
| Repository orientation or component responsibility | Component overview |
| Input destinations | Configuration contract, ADR 0011, and the destination tests below |
| Shared source-version checks | Configuration contract, ADR 0013, and the version/source-version tests below |
| Documentation changes | The owning document |
| Licensing, dependencies, attribution, or release-document changes | Project grant and attribution; release changes also follow the release procedure |
| Architecture decisions or future work | Future features and relevant ADRs listed below |
| Code and test changes | The owning contract and tests from the map below |
| Examples or copyable assets | The owning implemented contract and consumer adoption guide |
| Release preparation | Release procedure |
Accepted decisions:
- Separate composition and overlay
- Check source versions with one shared policy
- Own YAML semantics behind a private parser boundary
- Preserve presence and record application resolution
- Explicit configured secrets bootstrap
- Explicit overrides and safe explanation
- Keep the public facade root-owned
- Compare frozen effective configuration snapshots
- Compare inspection views across application types
- Place inputs at literal application mapping paths
- Share dependency-ready ordering
- Separate import selection controls
- Define identity and merge rules for each collection
- Apply CLI overrides after inheritance and decoding
- Keep main-file discovery explicit and composable
- Scope configuration controls to document roots
- Match registered records during resolution inspection
- Bind companion contexts after main selection
For cross-cutting changes, follow every applicable row. Use current contracts and the component overview for ongoing work.
Release-candidate, publication, and verification work follows the operational
release procedure. Its module-selected ReleaseKit publish
invocation validates the committed candidate and publishes only the intended
tag; those release checks remain distinct from the everyday development check.
Baseline validation
Install the Go version required by go.mod or a compatible newer 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, and the dependency/public boundary checks. 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 review of
affected links and whitespace; behavior-bearing examples and commands also
need execution. Automated Markdown link checking runs against the committed
candidate through ReleaseKit, not during ordinary Go tests or the everyday
checker. See the release procedure
for the selected checks and optional diagnostic command. Use
go test -race ./... for ownership or concurrency changes.
The release procedure performs
its selected validation through one publish invocation. The everyday checker
remains a development gate and is not a separate release prerequisite. CI never
gates a release.
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 ./internal/engine -run '^TestParseSource' |
| File/reader access, imports, globs, containment | Import internals, source acquisition, FIFO, import traversal, import evidence, relative destinations, globs | go test ./internal/engine -run 'Source|Import|Glob|Filesystem|Nonregular|RegularFile' |
| Explicit main-file discovery and absent-input loading | Candidate selection, load integration, public facade, and maintained catalog and preset examples | go test ./internal/engine -run 'Discovery|Search', go test . -run 'Search', and go test ./examples/consumers -run 'WorkingDirectoryPreset|SequenceCatalog' |
| Import defaults, empty-selection evidence, and dependency-ready ordering | Defaults and facade evidence, engine import evidence, scheduler, scheduling integrations | go test ./internal/engine -run 'Import|ScheduleDependencies|Inheritance', go test . -run 'ImportDefaults|FacadeImport', and go test ./examples/consumers |
| Native filesystem and mapping sources | Native acquisition, filesystem facade, mapping facade | go test ./internal/engine -run 'NativeFilesystem' and go test . -run 'TestFacade' |
| Composition, selected overlays, CLI precedence | Composition, overlay, selected overlays, overrides | go test ./internal/engine -run 'Compose|Overlay|Override' |
| Sequence identity, declarations, and operations | Identity, registrations, declarations, combination, final facade validation, and consumer catalog | go test ./internal/engine -run 'Sequence|Collection', go test . -run 'SequenceIdentity|SequenceRegistration', and go test ./examples/consumers |
| Sibling inheritance, provenance, history, sensitivity | Implementation flow, expansion, destination scopes, origins, history, secrets, public loading | go test ./internal/engine -run 'Inheritance|Inherited' and go test . -run '^TestFacadeInheritance|^TestFacadeInheritedSecrets' |
| Layered loading and source equivalence | Grouped lifecycle, layered facade, equivalence | go test ./internal/engine -run '^TestGrouped', go test . -run '^TestFacadeLayered', and go test . -run '^TestEquivalentSourceForms' |
| Input and relative-import destinations, mounted sources, and source ownership | Destination engine tests, tier tests, import traversal and version tests, accounting tests, lifecycle inspection tests, public source/error tests, resource contexts, and consumer examples | go test ./internal/engine -run 'Destination|Import|Glob|Mounted', go test . -run 'Destination|Import|SourceContext|FacadeMounted', and go test ./examples/consumers |
| Shared source-version modes and evidence | Engine source-version tests, public facade tests, and consumer example tests | go test ./internal/engine -run 'SourceVersion', go test . -run 'SourceVersion', and go test ./examples/consumers |
| Schema, defaults, projection, cloning | Implementation flow, schema, decoding, projection and typed cloning | go test ./internal/engine -run 'Schema|Decode|Projection|Clone|Inline|CompareDocument' |
| Current values and focused inspection | Value tests, view tests, comparison tests, and history integration | go test . -run 'TestResultValue|TestInspectionView' and go test ./internal/engine -run 'TestResultValue|Diff|History' |
| Lifecycle, resolution, validation, callback ownership | Loading, resolution, validation, ownership, independence | go test ./internal/engine -run 'Load|Resolution|Validation|Validator|Hook|Callback|Parallel' |
| Resolution sequence matching and inspection | Correspondence, auditing and history, public integration | go test ./internal/engine -run 'Resolution|History|Explain|Sensitivity' and go test . -run 'Resolution|SequenceIdentity|Diff' |
| Paths, metadata, provenance | Paths, metadata, provenance | go test ./internal/engine -run 'Path|Metadata|Provenance|Queries' |
| Passive resource contexts | Engine contexts, public contexts | go test ./internal/engine -run 'Resource' and go test . -run 'SourceContext' |
| Secrets, bootstrap, redaction, explanation | References, directory bootstrap, configured preparation, public handoff, consumer example, rendering, explanation | go test ./internal/engine -run 'Secret|Bootstrap|Effective|Explain|Explanation|History|Sensitivity', go test . -run 'Secrets|Bootstrap', and go test ./examples/consumers -run 'ConfiguredSecrets' |
| Effective configuration diff | Engine comparison and masking tests, engine operation tests, root facade tests, and consumer examples | go test ./internal/engine -run 'Diff|Explain|History|Secret|Independent', go test . -run 'Diff|FacadeInspection|PublicFacadeBoundary|DependencyImportBoundary', go test ./examples/consumers, and go test . -run '^ExampleDiff$' |
| Consumer examples and migration fixtures | Consumer tests, native, layered, and ordinary relative-import examples, mounted collection examples, API examples | go test ./examples/consumers and go test . -run '^Example' |
| Assembly and layered scaling evidence | Assembly benchmarks, layered benchmarks | go test ./internal/engine -run '^$' -bench '^BenchmarkUnderlay' -benchmem; repeat with ^BenchmarkCompose and ^BenchmarkOverlay |
| Identified-sequence scaling evidence | Mixed-upsert benchmark | go test ./internal/engine -run '^$' -bench '^BenchmarkSequenceMixedUpsert$' -benchmem |
| Inheritance scaling evidence | Expansion benchmarks | go test ./internal/engine -run '^$' -bench '^BenchmarkInheritance' -benchmem |
| Dependency and public API isolation | Import boundary, public boundary | go test . -run 'TestDependencyImportBoundary|TestPublicFacadeBoundary' |
| Development check behavior | Development checker test | go test . -run '^TestDevelopmentCheckHandlesFilenamesAndStopsOnFailure$' |
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 ./internal/engine -run='^$' -fuzz='^FuzzParsePath$' -fuzztime=30s -parallel=2
go test ./internal/yaml -run='^$' -fuzz='^FuzzParseDocument$' -fuzztime=30s -parallel=2
go test ./internal/engine -run='^$' -fuzz='^FuzzCompositionAndOverlay$' -fuzztime=30s -parallel=2