Update configuration and CLI startup documentation

This commit is contained in:
2026-11-23 14:30:39 +00:00
parent 43a7d398b6
commit 6026933b24
3 changed files with 56 additions and 116 deletions

View File

@@ -110,8 +110,6 @@ remote state with an unsafe legacy identity must be migrated before use.
## Validation and Merge Rules
- ConfigKit performs strict typed YAML decoding and accepts exactly one document;
unknown fields, duplicate keys, and trailing documents fail load.
- Local pipeline, campaign, session, and party documents may declare native
imports and sibling inheritance. Only the pipeline selects an overlay.
- An omitted overlay, empty overlay option, and exact `default` select the base;
@@ -119,7 +117,6 @@ remote state with an unsafe legacy identity must be migrated before use.
- Configured timeout and retry-delay durations must be positive. An omitted
artifact timeout continues to inherit its configured Scriptorium timeout.
- Session files must be concrete; unresolved `{{ ... }}` placeholders fail load.
- ConfigKit applies its acquisition limits to configuration sources and imports.
- Pipeline defaults are applied before validation.
- Defaults apply only to absent fields. Explicit empty strings, zero values,
`false`, and `null` retain ConfigKit's typed meaning and are then checked by
@@ -142,40 +139,11 @@ remote state with an unsafe legacy identity must be migrated before use.
### Pipeline imports and overlays
Local pipeline, campaign, session, and party files can use source-root
`config.imports` and `config.sequences`. Every acquired document has its own
source-root controls, including imported fragments. Nested `config` keys are
ordinary data. `extends` is reserved for native sibling inheritance; parents
remain ordinary entries subject to Narratio's effective-domain validation.
```yaml
config:
imports:
- path: artifacts/session-recap.yml
destination: [scriptorium, artifacts, session_recap]
required: true
- dir: artifacts/families
pattern: "*.yml"
```
Imports support `path`, `dir`, and `glob` selectors, applicable filters and
relative destinations. Paths are relative to the declaring source. Missing or
empty selections are optional by default; use `required: true` when a selection
is essential. Selected invalid input fails. Destinations place content under
literal mapping keys, independent of filenames; nested imports can declare
relative destinations. Strict peer contributions must satisfy ConfigKit's
composition rules, and Narratio validates the resulting effective entries.
A selected pipeline overlay is applied after base composition. It may declare
root `config.sequences` but cannot import other files. Ordinary overlay lists
replace the lower list; declared collections can use native `replace`, `append`,
or `upsert`. Upsert replaces a whole matching record; an empty append or upsert
does not clear the lower list. Mapping and identified-list inheritance follow
native sibling rules. See the pinned [ConfigKit configuration contract](https://forge.maximumdirect.net/base-layer/configkit/src/commit/51ef3144158db1a09fabdbd1c7ae59908c84923b/docs/config.md)
and [consumer guide](https://forge.maximumdirect.net/base-layer/configkit/src/commit/51ef3144158db1a09fabdbd1c7ae59908c84923b/docs/consumers/README.md)
for full selection, composition, collection, and reserved-key semantics.
The [maintained bundle](../examples/production-testing/pipeline.yml) illustrates
these controls, family expansion, and a split roster.
Narratio uses ConfigKit v1.4.0 for imports, composition, inheritance, and
pipeline overlays. The [ConfigKit configuration contract](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md)
owns their syntax and semantics; the [maintained bundle](../examples/production-testing/pipeline.yml)
shows a complete Narratio configuration. Only the pipeline selects an overlay;
Narratio validates the resulting effective domain entries.
Relative host-resource paths, including integration configuration files,
workspace/campaign/spool/cache roots, campaign template and stable inputs, and
@@ -198,8 +166,8 @@ eligible to inherit the receiving campaign's values.
and the Go `configkit` package and secret tags have different meanings.
- Rename or move pipeline files to the discovery names above, or retain a custom
filename such as `pipeline.yml` and pass it with `--config`.
- Move conventional secrets to `/usr/local/etc/narratio/secrets`, supply them
through the environment, or pass the previous directory with `--secrets-dir`.
- Remove `--secrets-dir` from invocations and configure the pipeline main file
as described in [Secrets Handling](#secrets-handling), or provision environment values.
- Review relative resource references moved into fragments: their defining
source now supplies the base. Mark necessary imports `required: true`.
- Review lists and use `config.sequences` where append or whole-record upsert is
@@ -244,32 +212,31 @@ inputs:
## Secrets Handling
- Do not place raw secrets in YAML.
- Credential fields contain environment-variable names, represented internally
as ConfigKit typed secret references (for example
`pipeline.notarius.credentials: [NOTARIUS_LLM_API_KEY]`). A configured reference
must resolve to a nonempty environment value during load.
- Every surviving reference is resolved during ordinary pipeline loading,
regardless of whether its integration is disabled, outside the selected
stage range, or eligible for resume. Omit the field or set it to `null` when
that deployment should not require the credential.
- Every command that loads a pipeline accepts `--secrets-dir <path>`. When the
flag is omitted, Narratio uses `/usr/local/etc/narratio/secrets` when present;
an absent conventional directory is ignored.
Explicit relative paths are resolved from the caller's working directory,
and a missing or empty explicit selection is an error.
- Each immediate regular file whose name is a valid environment-variable name
supplies one value. ConfigKit removes trailing CR/LF, permits a symlink as the
selected directory, rejects non-hidden symlink entries, and limits input to
1 MiB per file, 8 MiB total, and 1024 entries. Dot-prefixed entries (including
files, directories, and symlinks) are ignored and omitted from bootstrap
reports, but still count toward the directory entry limit.
- An existing process environment value takes precedence over a credential file.
- On POSIX, operators must provision the directory with no group/other access
(normally `0700`) and files with no group/other access (normally `0600`);
ConfigKit validates type and bounds but does not enforce permission modes.
- Bootstrap happens once per command, before any configuration load or adapter
construction. Safe reports contain filenames, paths, and statuses, never values.
Credential fields contain environment-variable names as ConfigKit typed secret
references. Each surviving reference must resolve to a nonempty value when the
pipeline loads, including for disabled integrations or stages outside the run.
Do not put raw secret values in YAML.
A pipeline main file can select configured bootstrap before its typed load:
```yaml
config:
secrets_dir: secrets
```
Narratio passes the selected pipeline source to ConfigKit's configured bootstrap,
then loads the returned prepared source. Without a directory declaration,
credentials may be supplied in the process environment. Narratio no longer
accepts `--secrets-dir` or probes a conventional directory automatically. See
[ConfigKit's configured-startup contract](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap)
for path rules, environment precedence and overwrite controls.
Each pipeline acquisition prepares its own source; an already acquired result is
reused. Comparisons use ordinary acquisition on each reached side and share the
process environment. Direct local campaign, session, and party inspection does
not load a pipeline solely for bootstrap. Bootstrap reports and diagnostics are
safe, final stderr output, separate from command reports. Protect provisioned
secret directories and files from access by other users.
## Publish Configuration Summary
@@ -572,7 +539,7 @@ render-debug calls. Scriptorium retains provider/profile selection; Narratio
does not pass a model-request `--api-key-env` override.
As with Audita and Notarius, names are ConfigKit secret references resolved at
pipeline load time using the existing environment/secrets bootstrap precedence,
pipeline load time using the configured bootstrap and environment,
even when no Scriptorium stage executes. Omitted, null, or empty lists forward
nothing. An overlay replaces the entire list; `[]` clears it. Captured values
are forwarded under their exact names and registered for diagnostic redaction.