Simplify the configuration adoption roadmap

This commit is contained in:
2026-11-23 02:19:14 +00:00
parent c6214f6259
commit 1d5dc370e8

View File

@@ -4,7 +4,8 @@
Adopt ConfigKit v1.4.0 and use its native configured-secrets bootstrap to reduce Adopt ConfigKit v1.4.0 and use its native configured-secrets bootstrap to reduce
Narratio-owned configuration machinery. Adopt the coordinated CommandKit v0.8.0 Narratio-owned configuration machinery. Adopt the coordinated CommandKit v0.8.0
and `ckconfig` v0.11.0 releases in the same scope, preserving current CLI behavior. 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.
ConfigKit owns configuration resolution through the final handoff; Narratio owns ConfigKit owns configuration resolution through the final handoff; Narratio owns
startup ordering, domain interpretation, and execution, as defined by startup ordering, domain interpretation, and execution, as defined by
[ADR 0003](../adr/0003-assign-configuration-ownership.md). [ADR 0003](../adr/0003-assign-configuration-ownership.md).
@@ -72,9 +73,9 @@ The [configuration reference](../config.md#secrets-handling),
### Configured startup ### Configured startup
When acquiring the primary pipeline without an explicit `--secrets-dir`, Narratio When acquiring the primary pipeline, Narratio passes its native `File` or
passes its existing native `File` or `SearchConfig` source to `SearchConfig` source to `LoadSecretsIntoEnvironmentFromConfig`. Operators can
`LoadSecretsIntoEnvironmentFromConfig`. Operators can declare: declare:
```yaml ```yaml
config: config:
@@ -82,86 +83,62 @@ config:
secrets_overwrite: false secrets_overwrite: false
``` ```
ConfigKit selects and captures the main document, interprets these controls, Pass ConfigKit's returned prepared source to ordinary `Load` with Narratio's
resolves the directory, performs bootstrap, and returns a safe report and prepared schema, defaults, resolution callbacks, validation, imports, overlay, and supported
source. Narratio passes that source to ordinary `Load` with its existing schema, inspection overrides. Keep existing pipeline discovery choices. ConfigKit owns
defaults, resolution callbacks, validation, imports, overlay, and explicit main-document capture, bootstrap controls, path resolution, environment writes,
configuration overrides. Bootstrap and loading use the same captured main and credential lookup; use its
document. Imports and credential lookup retain their native load-time behavior. [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.
Use upstream path and filesystem-context semantics. The configured directory is Remove `--secrets-dir`, its direct-directory bootstrap route, and the automatic
relative to the canonical main file and contained by its ConfigKit filesystem fixed-directory fallback. Secrets-directory selection belongs in the pipeline
root. Keep existing discovery choices; introduce no parallel YAML parsing, configuration. Environment-only deployments remain supported when no directory
control extraction, or application-specific source reconstruction. is configured.
The automatic fixed-directory fallback is removed. With neither a configured
directory nor an explicit flag, credential references use the existing process
environment. A deployment retaining the former system-wide directory can place
`secrets_dir: secrets` in its adjacent pipeline configuration or supply the flag.
### Explicit directory selection and precedence
Retain `--secrets-dir` as an explicit alternative to configured-directory
bootstrap. Its existing caller-relative path behavior remains. This route uses
ConfigKit's direct-directory helper and preserves existing environment values.
It performs the selected direct bootstrap instead of configured bootstrap.
The configured helper has no directory-override option. A small application-owned
selection branch is appropriate; Narratio does not first bootstrap the YAML
directory and then load the flag-selected directory. Normal configuration loading
still validates and consumes main-document controls according to ConfigKit.
`config.secrets_overwrite` applies to the configured-bootstrap route; it does not
change the explicit flag's environment-preserving behavior.
For configured bootstrap, leave ConfigKit's overwrite option unspecified so the
main document controls it. Omission or false preserves existing values, including
empty values; true permits files to replace them. Credentials remain typed
environment-name references, and ConfigKit resolves every surviving reference
under its existing rules. Native eligibility, bounds, symlink handling, and
failure semantics remain upstream-owned.
### Invocation lifecycle and inspection ### Invocation lifecycle and inspection
Narratio calls bootstrap during command-owned startup, before typed credential Give startup one invocation-owned coordinator for source preparation, bootstrap,
resolution and adapter construction. ConfigKit's preparation may read and parse and the handoff to configuration loading. Share it across execution, planning,
the main document before this point. Loading a prepared source does not repeat and inspection where needed, retaining bootstrap completion for the invocation.
bootstrap. Preserve invocation-level reuse without introducing a global cache. Bootstrap remains explicit, lazy, and fallible, before pipeline credential
resolution and adapter construction; ordinary library loaders do not mutate the
environment.
Help, version, completion, and scope listing retain their current acquisition-free Help, version, completion, and scope listing retain their current acquisition-free
behavior. Direct inspection of campaign, session, or party documents retains lazy behavior. Direct inspection of campaign, session, or party documents retains lazy
acquisition: configured pipeline bootstrap runs when that invocation actually acquisition: configured pipeline bootstrap runs when that invocation actually
needs the pipeline. An explicit secrets-directory flag remains usable without needs the pipeline. Direct document inspection does not acquire a pipeline solely
requiring an otherwise unnecessary pipeline load. to bootstrap credentials.
Configuration comparisons use one startup environment. The primary pipeline Configuration comparisons use one startup environment. The primary pipeline
selection owns configured bootstrap; comparison-only pipeline sources undergo selection owns configured bootstrap; comparison-only pipeline sources undergo
ordinary loading without additional bootstrap. A different comparison overlay ordinary loading without additional bootstrap. Preserve separate ConfigKit
does not initiate another bootstrap. Preserve separate ConfigKit results for results for each side; no per-side environment isolation is required.
each side. This feature adds no independent per-side environment snapshots or
credential-isolation promise. 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.
### Reports, errors, and ownership ### Reports, errors, and ownership
Keep the native `SecretsReport` separate from later configuration results and Keep the native `SecretsReport` separate from later configuration results and
retain the report on bootstrap failure. Present safe report contents and retain the report on bootstrap failure. Present safe report contents and
`SecretsError` diagnostics through Narratio's CommandKit reporting boundary. `SecretsError` diagnostics through Narratio's CommandKit reporting boundary.
Preparation failures retain native `LoadError` evidence. Preserve typed causes Preparation failures retain native `LoadError` evidence. Preserve native causes,
and relevant operation context rather than embedding a rendered report into an diagnostics, and useful operation context. Use upstream failure and partial-write
otherwise opaque error string. semantics without adding rollback or a local filesystem policy.
ConfigKit owns file validation, limits, environment writes, and safe evidence.
Narratio owns scheduling, selection of the explicit flag route, and presentation.
Use native partial-write semantics: completed environment writes survive a later
bootstrap or configuration failure. This work adds no rollback, transaction,
concurrent-environment protection, or custom filesystem-hardening layer.
### Adoption boundaries ### Adoption boundaries
Keep configuration inspection delegated to `ckconfig` and preserve the app, Keep configuration inspection delegated to `ckconfig` and preserve the app,
campaign, session, and party scopes. Current typed field access, command campaign, session, and party scopes. Preserve supported commands and workflows
declarations, and domain lifecycle remain appropriate. New inspection scopes, except for the secrets-startup changes specified here; internal assembly may be
invocation features, generic accessors, and `ckprompt` adoption are outside this replaced or simplified. New inspection scopes, generic accessors, and `ckprompt`
scope. The linked upstream documentation owns those library capabilities. adoption are outside this scope.
Domain catalogs, credential forwarding, persisted configuration projections, and Domain catalogs, credential forwarding, persisted configuration projections, and
stage-owned resume fingerprints retain their current responsibilities. Diagnostic stage-owned resume fingerprints retain their current responsibilities. Diagnostic
@@ -176,11 +153,6 @@ schema, selected configuration sources and scopes, adapter wiring, domain rules,
and operator workflows. General library syntax, feature behavior, and API and operator workflows. General library syntax, feature behavior, and API
semantics remain documented upstream. semantics remain documented upstream.
Keep the Narratio-specific integration decisions in this roadmap actionable;
link their underlying library semantics upstream. Implementation does not require
writing consumer-local tutorials or feature references for ConfigKit, CommandKit,
or PromptKit.
## Required Changes ## Required Changes
### Dependency and startup wiring ### Dependency and startup wiring
@@ -190,18 +162,11 @@ and `ckconfig` v0.11.0. Keep other dependency versions unless dependency
resolution requires a related adjustment. Update all three attribution entries resolution requires a related adjustment. Update all three attribution entries
and affected pinned contract links to their adopted revisions. and affected pinned contract links to their adopted revisions.
Retain current command declarations, flags, reporting, and configuration scope
assembly. Review affected upstream struct literals for newly added exported
fields; use keyed literals where an adjustment is needed. The CLI dependency
upgrade itself requires no operator configuration migration or upstream feature
request.
Connect native pipeline source selection, configured bootstrap, and prepared-source Connect native pipeline source selection, configured bootstrap, and prepared-source
loading through the application/configuration boundary. Preserve pure library loading through the application/configuration boundary. Remove duplicate startup
loaders: command-owned startup invokes the environment-mutating helper explicitly. entry paths, the secrets-directory flag and selector wiring, the direct-directory
Share that startup service across execution, planning, and configuration inspection route, and the conventional-directory probe. Keep invocation state small; this
where applicable. Remove the conventional-directory probe and obsolete fallback work does not require a generic startup framework or global cache.
logic. Keep the remaining explicit-selection and invocation-lifecycle wiring small.
Adapt reporting to retain native reports and typed failures separately. Keep Adapt reporting to retain native reports and typed failures separately. Keep
existing CommandKit outcome handling and useful native diagnostic details. existing CommandKit outcome handling and useful native diagnostic details.
@@ -215,24 +180,22 @@ configuration ownership decision remains applicable.
Update the configuration reference, CLI reference, operations and troubleshooting Update the configuration reference, CLI reference, operations and troubleshooting
guidance, configuration internals, and affected maintained examples. Document guidance, configuration internals, and affected maintained examples. Document
Narratio's selection of configured or explicit-directory bootstrap, the primary configured startup, the primary comparison source, and removal of `--secrets-dir`
comparison source, and the removal of automatic conventional-directory loading. and automatic conventional-directory loading.
Link upstream for bootstrap control definitions and overwrite semantics. Replace Link upstream for bootstrap control definitions and overwrite semantics. Replace
stale fixed-fallback and before-any-configuration-read language. stale fixed-fallback and before-any-configuration-read language.
The [documentation policy](../policy/documentation.md#upstream-dependencies) Follow the adopted
now adopts upstream v1.13's dependency-documentation guidance. Policy adoption [dependency-documentation policy](../policy/documentation.md#upstream-dependencies).
is complete; the documentation cleanup below remains pending. Record the library Keep version-appropriate upstream links in the existing local owners; attribution
integration and canonical upstream links in the existing relevant local owners. remains governed separately by the OSS policy.
Use links appropriate to the adopted versions and refresh them with dependency
updates; attribution remains governed separately by the OSS policy.
Review the following existing documentation for duplicated upstream explanations: Review the following existing documentation for duplicated upstream explanations:
- `docs/config.md`: replace general ConfigKit composition, import, inheritance, - `docs/config.md`: replace general ConfigKit composition, import, inheritance,
presence, overlay, and secret-file processing descriptions with upstream links. presence, overlay, and secret-file processing descriptions with upstream links.
Retain Narratio's schema, discovery choices, resource interpretation, and Retain Narratio's schema, discovery choices, resource interpretation, and
bootstrap-route selection. configured-startup wiring.
- `docs/cli.md`: link to CommandKit and `ckconfig` for generic parsing, reporting - `docs/cli.md`: link to CommandKit and `ckconfig` for generic parsing, reporting
controls, inspection operations, report fields, and pointer semantics. Retain controls, inspection operations, report fields, and pointer semantics. Retain
Narratio's command inventory, installed selectors and scopes, domain reports, Narratio's command inventory, installed selectors and scopes, domain reports,
@@ -247,29 +210,30 @@ Review the following existing documentation for duplicated upstream explanations
accurately where downstream tools use it; this work adds no Narratio PromptKit accurately where downstream tools use it; this work adds no Narratio PromptKit
dependency. dependency.
Consolidate or remove redundant prose and repair affected links. Preserve actual Consolidate redundant prose and repair links while preserving useful operator
Narratio-specific choices, supported examples, and useful operator navigation. navigation and runnable examples. Provide a concise migration for both removed
Library behavior needs no new local prose merely because it is adopted here. secrets-directory selection mechanisms: remove the CLI flag from invocations and
declare the directory in the main pipeline file using native ConfigKit path rules.
Provide a concise manual migration for operators relying on the former fallback. For a pipeline adjacent to the former system-wide directory, `secrets_dir: secrets`
Retain environment-only deployments. Preserve existing credential-protection retains that selection. Other layouts may require relocating the directory or
guidance and ConfigKit's safe reporting; this adoption adds no permission-mode supplying credentials through the process environment. Preserve existing
enforcement or new credential naming convention. credential-protection guidance.
### Verification ### Verification
Use focused offline behavioral tests covering native configured startup and Use focused offline behavioral tests covering native configured startup and
discovery, prepared-main handoff, configured path resolution, preservation and discovery, prepared-main handoff, configured path resolution, preservation and
explicit overwrite, direct-flag precedence, and environment-only operation. explicit overwrite, removal of the flag and fallback, and environment-only
Cover useful reports and typed errors on failure, including retained partial operation. Cover useful reports and typed errors on failure, including retained
effects, without duplicating ConfigKit's complete file-validation test suite. partial effects, without duplicating ConfigKit's complete file-validation test
suite.
Exercise invocation reuse, lazy non-pipeline inspection, acquisition-free CLI Exercise invocation reuse, lazy non-pipeline inspection, acquisition-free CLI
paths, bare `config explain` help, and primary-source comparison bootstrap. paths, bare `config explain` help, and primary-source comparison bootstrap.
Verify the existing command tree and native configuration operations against the Verify the existing command tree and native configuration operations against the
coordinated dependency versions. Retain existing tests for native inspection, coordinated dependency versions. Retain existing tests for native inspection,
credential forwarding/redaction, separate domain derivation, and semantic reuse. credential forwarding/redaction, separate domain derivation, and semantic reuse.
Update tests that deliberately encode the retired directory fallback or Update tests that deliberately encode the retired flag, directory fallback, or
environment precedence that is now operator-selectable. environment precedence that is now operator-selectable.
Run the repository's normal tests, race tests, vet, build, maintained-example, Run the repository's normal tests, race tests, vet, build, maintained-example,