2026-11-23 00:49:14 +00:00
# Adopt ConfigKit v1.4 and native secrets startup
## Purpose
Adopt ConfigKit v1.4.0 and use its native configured-secrets bootstrap to reduce
2026-11-23 01:02:15 +00:00
Narratio-owned configuration machinery. Adopt the coordinated CommandKit v0.8.0
2026-11-23 02:19:14 +00:00
and `ckconfig` v0.11.0 releases in the same scope. Configure secrets startup through
the pipeline file; remove `--secrets-dir` and automatic secrets-directory probing.
2026-11-23 01:02:15 +00:00
ConfigKit owns configuration resolution through the final handoff; Narratio owns
startup ordering, domain interpretation, and execution, as defined by
[ADR 0003 ](../adr/0003-assign-configuration-ownership.md ).
2026-11-23 00:49:14 +00:00
This roadmap defines the target and required changes. A subsequent implementation
plan will define staged work. Audita adoption and session layout remain in the
separate [Audita ](audita.md ) and [workspace ](workspace.md ) roadmaps.
2026-11-23 01:02:15 +00:00
## Reviewed Upstream Releases
2026-11-23 00:49:14 +00:00
ConfigKit v1.4.0 identifies commit
`4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3` . Its
[configuration contract ](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md )
and [consumer guide ](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/consumers/README.md )
own upstream semantics. The
[v1.3.0 notes ](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.3.0/docs/releases/v1.3.0.md )
describe configured bootstrap; the
[v1.4.0 notes ](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/releases/v1.4.0.md )
describe typed value access and focused inspection.
2026-11-23 01:02:15 +00:00
The coordinated CLI releases are:
| Module | Target | Upstream commit |
| --- | --- | --- |
| CommandKit | v0.8.0 | `0b53a63648c536afe50c46f948159116f776adae` |
| `ckconfig` | v0.11.0 | `cd5cf483a46caeff7ca0a91fb4747d57188a3888` |
The [CommandKit release notes ](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/releases/v0.8.0.md )
describe invocation features and help-only preflight. The
[`ckconfig` v0.10.0 notes ](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/cd5cf483a46caeff7ca0a91fb4747d57188a3888/integrations/ckconfig/docs/releases/v0.10.0.md )
describe native subtree scopes, and the
[v0.11.0 notes ](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/cd5cf483a46caeff7ca0a91fb4747d57188a3888/integrations/ckconfig/docs/releases/v0.11.0.md )
describe help-only preflight integration. `ckconfig` v0.11.0 requires core v0.8.0
and ConfigKit v1.4.0.
All three modules retain the Go 1.27.0 consumer minimum and LGPL-3.0-or-later
licensing. Their license texts are unchanged relative to Narratio's pinned
versions. Existing command and scope assembly remains compatible.
2026-11-23 00:49:14 +00:00
## Current Baseline
- Narratio pins ConfigKit v1.2.1. Pipeline discovery, YAML composition, typed
credential resolution, validation, and provenance already use ConfigKit.
2026-11-23 01:02:15 +00:00
- CommandKit v0.7.0 owns CLI mechanics and reporting; `ckconfig` v0.9.0 exposes
native configuration operations. Narratio uses neither invocation features nor
the separate `ckprompt` integration.
2026-11-23 00:49:14 +00:00
- `internal/app/secrets_bootstrap.go` selects `--secrets-dir` or automatically
probes `/usr/local/etc/narratio/secrets` . It delegates file loading to
`LoadSecretsIntoEnvironment` , retains invocation-level completion, and renders
reports. Existing environment values win, including empty values.
- Pipeline source selection occurs separately from bootstrap. Narratio has no
configured-bootstrap handoff using a prepared ConfigKit source.
- Lazy configuration acquisition supports independent app, campaign, session,
and party scopes. Comparisons acquire their own results while sharing startup
bootstrap. Native inspection is exposed through `ckconfig` .
- Narratio derives separate domain catalogs, persisted configuration projections,
and semantic resume evidence. These serve application responsibilities rather
than replacing ConfigKit inspection.
The [configuration reference ](../config.md#secrets-handling ),
[configuration internals ](../internal/configuration.md ), and
[architecture policy ](../policy/architecture.md#configuration ) own current behavior.
## Targeted End State
### Configured startup
2026-11-23 02:19:14 +00:00
When acquiring the primary pipeline, Narratio passes its native `File` or
`SearchConfig` source to `LoadSecretsIntoEnvironmentFromConfig` . Operators can
declare:
2026-11-23 00:49:14 +00:00
```yaml
config:
secrets_dir: secrets
secrets_overwrite: false
```
2026-11-23 02:19:14 +00:00
Pass ConfigKit's returned prepared source to ordinary `Load` with Narratio's
schema, defaults, resolution callbacks, validation, imports, overlay, and supported
inspection overrides. Keep existing pipeline discovery choices. ConfigKit owns
main-document capture, bootstrap controls, path resolution, environment writes,
and credential lookup; use its
[configured-startup contract ](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap )
directly. Leave the helper's overwrite option unspecified so the main document
controls precedence.
Remove `--secrets-dir` , its direct-directory bootstrap route, and the automatic
fixed-directory fallback. Secrets-directory selection belongs in the pipeline
configuration. Environment-only deployments remain supported when no directory
is configured.
2026-11-23 00:49:14 +00:00
### Invocation lifecycle and inspection
2026-11-23 02:19:14 +00:00
Give startup one invocation-owned coordinator for source preparation, bootstrap,
and the handoff to configuration loading. Share it across execution, planning,
and inspection where needed, retaining bootstrap completion for the invocation.
Bootstrap remains explicit, lazy, and fallible, before pipeline credential
resolution and adapter construction; ordinary library loaders do not mutate the
environment.
2026-11-23 00:49:14 +00:00
Help, version, completion, and scope listing retain their current acquisition-free
behavior. Direct inspection of campaign, session, or party documents retains lazy
acquisition: configured pipeline bootstrap runs when that invocation actually
2026-11-23 02:19:14 +00:00
needs the pipeline. Direct document inspection does not acquire a pipeline solely
to bootstrap credentials.
2026-11-23 00:49:14 +00:00
Configuration comparisons use one startup environment. The primary pipeline
selection owns configured bootstrap; comparison-only pipeline sources undergo
2026-11-23 02:19:14 +00:00
ordinary loading without additional bootstrap. Preserve separate ConfigKit
results for each side; no per-side environment isolation is required.
Use CommandKit invocation features if they reduce local lifecycle or reporting
plumbing. Evaluate their native report timing and visibility against Narratio's
reporting needs. They need not perform bootstrap themselves: acquisition can
remain responsible for fallible work. Do not preserve existing buffers, wrappers,
or assembly solely to retain the current implementation structure.
2026-11-23 00:49:14 +00:00
### Reports, errors, and ownership
Keep the native `SecretsReport` separate from later configuration results and
retain the report on bootstrap failure. Present safe report contents and
`SecretsError` diagnostics through Narratio's CommandKit reporting boundary.
2026-11-23 02:19:14 +00:00
Preparation failures retain native `LoadError` evidence. Preserve native causes,
diagnostics, and useful operation context. Use upstream failure and partial-write
semantics without adding rollback or a local filesystem policy.
2026-11-23 00:49:14 +00:00
2026-11-23 01:03:24 +00:00
### Adoption boundaries
Keep configuration inspection delegated to `ckconfig` and preserve the app,
2026-11-23 02:19:14 +00:00
campaign, session, and party scopes. Preserve supported commands and workflows
except for the secrets-startup changes specified here; internal assembly may be
replaced or simplified. New inspection scopes, generic accessors, and `ckprompt`
adoption are outside this scope.
2026-11-23 00:49:14 +00:00
Domain catalogs, credential forwarding, persisted configuration projections, and
stage-owned resume fingerprints retain their current responsibilities. Diagnostic
inspection output is not substituted for reloadable configuration or semantic
reuse evidence.
2026-11-23 01:03:24 +00:00
### Documentation ownership
Narratio documents which libraries it uses and links to their canonical upstream
documentation for adopted library features. Local documentation owns Narratio's
schema, selected configuration sources and scopes, adapter wiring, domain rules,
and operator workflows. General library syntax, feature behavior, and API
semantics remain documented upstream.
2026-11-23 00:49:14 +00:00
## Required Changes
### Dependency and startup wiring
2026-11-23 01:02:15 +00:00
Update `go.mod` and `go.sum` together to ConfigKit v1.4.0, CommandKit v0.8.0,
and `ckconfig` v0.11.0. Keep other dependency versions unless dependency
resolution requires a related adjustment. Update all three attribution entries
and affected pinned contract links to their adopted revisions.
2026-11-23 00:49:14 +00:00
Connect native pipeline source selection, configured bootstrap, and prepared-source
2026-11-23 02:19:14 +00:00
loading through the application/configuration boundary. Remove duplicate startup
entry paths, the secrets-directory flag and selector wiring, the direct-directory
route, and the conventional-directory probe. Keep invocation state small; this
work does not require a generic startup framework or global cache.
2026-11-23 00:49:14 +00:00
Adapt reporting to retain native reports and typed failures separately. Keep
existing CommandKit outcome handling and useful native diagnostic details.
### Policy, documentation, and operator migration
When implementation lands, update the architecture policy's startup wording to
affirm the native preparation, bootstrap, and final-load boundary. Describe
environment precedence as the selected ConfigKit bootstrap policy. ADR 0003's
configuration ownership decision remains applicable.
Update the configuration reference, CLI reference, operations and troubleshooting
2026-11-23 01:03:24 +00:00
guidance, configuration internals, and affected maintained examples. Document
2026-11-23 02:19:14 +00:00
configured startup, the primary comparison source, and removal of `--secrets-dir`
and automatic conventional-directory loading.
2026-11-23 01:03:24 +00:00
Link upstream for bootstrap control definitions and overwrite semantics. Replace
stale fixed-fallback and before-any-configuration-read language.
2026-11-23 02:19:14 +00:00
Follow the adopted
[dependency-documentation policy ](../policy/documentation.md#upstream-dependencies ).
Keep version-appropriate upstream links in the existing local owners; attribution
remains governed separately by the OSS policy.
2026-11-23 01:03:24 +00:00
Review the following existing documentation for duplicated upstream explanations:
- `docs/config.md` : replace general ConfigKit composition, import, inheritance,
presence, overlay, and secret-file processing descriptions with upstream links.
Retain Narratio's schema, discovery choices, resource interpretation, and
2026-11-23 02:19:14 +00:00
configured-startup wiring.
2026-11-23 01:03:24 +00:00
- `docs/cli.md` : link to CommandKit and `ckconfig` for generic parsing, reporting
controls, inspection operations, report fields, and pointer semantics. Retain
Narratio's command inventory, installed selectors and scopes, domain reports,
and application-specific behavior.
- `docs/internal/configuration.md` , `docs/internal/overview.md` , and
`docs/development.md` : identify imported libraries and link upstream for their
APIs; keep Narratio component ownership and integration wiring locally.
- `docs/operations.md` , `docs/troubleshooting.md` , affected integration documents,
and `examples/README.md` : keep Narratio workflows and minimal runnable examples;
replace repeated library guidance with links. Direct downstream configuration
guidance to the owning application's documentation. Describe PromptKit's role
accurately where downstream tools use it; this work adds no Narratio PromptKit
dependency.
2026-11-23 02:19:14 +00:00
Consolidate redundant prose and repair links while preserving useful operator
navigation and runnable examples. Provide a concise migration for both removed
secrets-directory selection mechanisms: remove the CLI flag from invocations and
declare the directory in the main pipeline file using native ConfigKit path rules.
For a pipeline adjacent to the former system-wide directory, `secrets_dir: secrets`
retains that selection. Other layouts may require relocating the directory or
supplying credentials through the process environment. Preserve existing
credential-protection guidance.
2026-11-23 00:49:14 +00:00
### Verification
Use focused offline behavioral tests covering native configured startup and
discovery, prepared-main handoff, configured path resolution, preservation and
2026-11-23 02:19:14 +00:00
explicit overwrite, removal of the flag and fallback, and environment-only
operation. Cover useful reports and typed errors on failure, including retained
partial effects, without duplicating ConfigKit's complete file-validation test
suite.
2026-11-23 00:49:14 +00:00
Exercise invocation reuse, lazy non-pipeline inspection, acquisition-free CLI
2026-11-23 01:02:15 +00:00
paths, bare `config explain` help, and primary-source comparison bootstrap.
Verify the existing command tree and native configuration operations against the
coordinated dependency versions. Retain existing tests for native inspection,
credential forwarding/redaction, separate domain derivation, and semantic reuse.
2026-11-23 02:19:14 +00:00
Update tests that deliberately encode the retired flag, directory fallback, or
2026-11-23 01:02:15 +00:00
environment precedence that is now operator-selectable.
2026-11-23 00:49:14 +00:00
Run the repository's normal tests, race tests, vet, build, maintained-example,
and documentation checks in proportion to the implemented change. Default tests
use temporary files and disposable environment values and remain independent of
sibling checkouts, real credentials, and live services.
2026-11-23 01:03:24 +00:00
Review documentation changes for clear ownership: generic library features link
upstream, Narratio-specific behavior remains discoverable locally, and rewritten
sections introduce no runtime requirement changes. Verify affected links and
maintained examples after removing duplicated descriptions.