Files
audita/docs/roadmap/configkit.md

182 lines
11 KiB
Markdown
Raw Normal View History

2026-11-08 01:31:18 +00:00
# ConfigKit Adoption Outline
**Updated:** 2026-11-08
2026-11-08 01:31:18 +00:00
**Status:** Initial outline. The [master roadmap](library-adoption.md) owns the
agreed adoption policy, reviewed versions, shared sequencing, and completion.
## Baseline and Target
Audita currently uses ConfigKit v0.7.1 through its former import path. Its
[configuration contract](../config.md) describes application file discovery,
overlays, defaults, inheritance, secret references, and explicit CLI settings.
Adopt ConfigKit v1.1.0 and its stable public API as the configuration foundation.
Use its native loading, discovery, presence, composition, resolution, diagnostics,
and inspection mechanisms. Audita supplies domain types and validation; retain
custom loading behavior only for a demonstrated domain requirement. Standard
operator access is implemented through the [CommandKit outline](commandkit.md).
The main upstream references are the
[v1 API migration](https://forge.maximumdirect.net/base-layer/configkit/src/commit/191015e289d7f2b91abb9fdd9c4f2f5cf75b4de9/docs/releases/v1.0.0.md),
[v1.1 release](https://forge.maximumdirect.net/base-layer/configkit/src/commit/191015e289d7f2b91abb9fdd9c4f2f5cf75b4de9/docs/releases/v1.1.0.md),
and [configuration contract](https://forge.maximumdirect.net/base-layer/configkit/src/commit/191015e289d7f2b91abb9fdd9c4f2f5cf75b4de9/docs/config.md).
## Agreed Direction and Migration Work
### Application Schema Version — Resolved
Use `version: 3` for Audita's application configuration in the next major
release, with a hard cutover. The new contract includes the selected native
PromptKit ownership boundaries and the final stage-specific glossary design.
Finalize that combined schema before release so operators migrate once.
Reject obsolete application schema versions with migration guidance. Do not
retain version-2 loading, automatic conversion, or dual-schema compatibility.
Update application defaults, examples, and schema validation together when the
new schema is implemented. The no-main-file behavior below remains supported;
embedded defaults must supply the current application version.
This is Audita's application schema version, independent of library releases and
ConfigKit or PromptKit source headers. It does not require a version header on
every imported fragment. Hard-cutover guidance must explain the actual field and
ownership changes, including glossary-stage configuration, rather than merely
instructing operators to change the version number.
### Discovery Locations and Import Selection — Resolved
An explicit `--config` selects exactly that file. A missing, inaccessible, or
invalid explicit file is an error; do not fall back to discovery.
Without an explicit file, search in this order using ConfigKit's native presets
and filename rules with application name `audita`:
1. `WorkingDirectory` for project-local configuration.
2. `UserConfigDirectory` for personal configuration.
3. `UnixSystemDirectories` for system configuration.
Select the first matching file. Do not merge every discovered file or continue
searching after a selected file fails to load. Additional composition is explicit
through native imports and overlays. Recommend explicit configuration paths for
automation so its selection does not depend on the working directory.
Enable native imports for operator configuration sources, retaining upstream
defaults and declaration-level controls. Imports compose peer documents, not
higher-priority override layers. Missing optional imports may be absent;
operators use `required: true` for essential inputs. Invalid declarations,
unreadable selected files, and composition conflicts retain native errors.
### No Configuration File Found — Resolved
Use ConfigKit's optional-search behavior when automatic discovery finds no file:
continue with embedded defaults, underlays, and explicit CLI settings, then
validate what the requested command needs. Require sufficient configuration for
the operation, not the existence of a main configuration file.
Resource inspection can work without a main file. Processing can run when its
required selections and inputs are otherwise supplied through supported
mechanisms. Report missing command-specific settings clearly; do not invent an
implicit model or profile selection to make incomplete execution settings pass.
Inspection must accurately show that no main file was selected.
Define filesystem context explicitly where overlays or relative resource inputs
need it; do not infer a base from unsuccessful search candidates. Preserve the
native absent-main lifecycle instead of manufacturing a placeholder file or
source record. Explicit-file errors and failures loading a selected discovered
file remain terminal.
### Migration Work
2026-11-08 01:31:18 +00:00
1. Move imports to `go.maximumdirect.net/configkit` with the coordinated
PromptKit cutover. Raise the toolchain as specified by the master roadmap.
Replace `Resolution.Record` uses with the appropriate dedicated recording
method; review affected metadata and diagnostics APIs, not only compilation.
Relevant renamed concepts include `EntryInfo`, `Sensitive`, `LayerMain`,
version evidence, and destination fallback. Typed `Secret` and its field tag
retain their spelling.
2. Adopt the native lifecycle: source composition and inheritance, typed decoding,
explicit CLI assignments, then application resolution and validation. CLI
assignments do not repair earlier decoding failures, alter inheritance
relationships, or propagate parent edits through already resolved children.
Update the current loading-order explanation and realistic integration tests.
3. Migrate genuine source-root control blocks to `config:` where present.
Implement the version-3 application schema and hard cutover above. Distinguish
application schema versions from source version evidence; do not impose
headers on every fragment merely because the API supports them.
2026-11-08 01:31:18 +00:00
4. Use identified collections where records have meaningful identity. ConfigKit
upsert replaces matching records in full; inspection follows registered
identities through movement, while list diffs remain atomic. Preserve ordinary
ordered/repeated pipeline stages and explicit empty-pipeline semantics:
2026-11-08 01:31:18 +00:00
these express Audita domain behavior, so uniqueness/upsert is inappropriate.
5. Integrate native source discovery and standard inspection instead of retaining
equivalent private infrastructure. Adopt source diagnostics, explanation,
history, normalization, and safe effective output through ckconfig. Account
for the provenance label changing from `base` to `main`.
6. Apply the resolved [PromptKit ownership decision](promptkit.md#backend-and-credential-ownership--resolved):
remove Audita's separate backend mapping and LLM credential references from
its application schema. Native PromptKit resources own those settings and
their resolution. Coordinate the hard cutover and examples here, using the
resolved discovery and import policy above.
7. Account for the [root-default and stage-override model](glossary-stages.md#root-defaults-and-stage-overrides--resolved)
in version-3 schema design. Implement it during the glossary feature stage
after library adoption. Each stage resolves independently with explicit-value
presence and source provenance, and its module and validators receive consistent
effective settings. Apply its [selected scope and fallback rules](glossary-stages.md#configuration-scope--resolved)
and [compound-value and clearing rules](glossary-stages.md#compound-values-and-explicit-clearing--resolved),
together with its [CLI precedence and native-support boundary](glossary-stages.md#cli-overrides-and-stage-precedence--resolved).
Use its [separate glossary and protection selections](glossary-stages.md#glossary-selection-and-protected-vocabulary--resolved),
including root protection defaulting through recorded application resolution.
Adopt its [glossary configuration ownership boundary](glossary-stages.md#glossary-configuration-ownership--resolved):
glossary assets use native loading, composition, inheritance, collection
identity, and typed decoding before handoff. Audita derives consumer-specific
runtime views from that result and removes its separate glossary YAML loader.
Use its [named collections and recursive import placement](glossary-stages.md#named-collections-and-recursive-imports--resolved),
retaining native discovery, source context, and tier semantics.
Supply its [optional default glossary sources](glossary-stages.md#default-sources-and-explicit-configuration--resolved)
in one underlay, with higher-priority explicit main configuration.
Register its [collection-scoped entry IDs](glossary-stages.md#entry-identity--resolved)
through native sequence identity registration.
Complete its required durable decision record. The glossary roadmap owns
the remaining rich-field, runtime-view,
selection-input, and attribution decisions. This
application scope model does not change native source composition or
sibling-inheritance semantics.
2026-11-08 01:31:18 +00:00
## Documentation and Acceptance
Update [configuration](../config.md), relevant [CLI](../cli.md) behavior,
[change recipes](../internal/cli-config.md), maintained examples, migration
guidance, and attribution as the corresponding behavior lands. Public docs
remain descriptions of implemented behavior until then.
Acceptance should demonstrate native file selection, source composition,
overlays, explicit false/zero/empty values, derived settings, and secret handling
through real ConfigKit loading. Cover the changed inheritance/assignment order,
source errors, useful failure evidence, and secret-safe inspection. Reuse upstream
coverage for generic grammar rather than copying its test matrix. Verify the
standard ckconfig surface through the assembled CLI and run the full application
suite at the coordinated migration boundary.
Check explicit-file selection without fallback, native working/user/system
search precedence, and terminal errors for a selected invalid file. Verify
optional and required imports and peer-composition errors through Audita's
integration. Verify that discovery exhaustion permits inspection and sufficiently
configured processing, while incomplete processing reports its missing inputs.
Cover absent-main provenance and filesystem context for selected overlays or
relative resources without weakening explicit-file error behavior.
Verify acceptance of the final version-3 schema and rejection of obsolete
application versions. Check that no-main-file loading uses version-3 defaults,
and that maintained examples and migration guidance cover the final library
ownership and glossary-stage changes without a legacy compatibility path.
2026-11-08 01:31:18 +00:00
The earlier passing configuration suite is useful baseline evidence, not proof
that operators see unchanged semantics. Native semantics and clear migration are
the target; preserving incidental old output or validation order is not.
## Upstream Requests
No ConfigKit change request is currently identified. Prefer adapting Audita to
its stable supported API. Record any necessary exception with a concrete domain
requirement and the smallest integration boundary that satisfies it.