Update configuration and CLI startup documentation
This commit is contained in:
67
docs/cli.md
67
docs/cli.md
@@ -40,16 +40,9 @@ configuration, contact storage, or initialize adapters.
|
||||
## Invocation syntax
|
||||
|
||||
Place flags after the complete command path; they may be interspersed with
|
||||
operands there. For example, `narratio session plan --format json SESSION`
|
||||
and `narratio session plan SESSION --format json` are equivalent. Flags are
|
||||
local to the selected command. `--` ends option parsing.
|
||||
|
||||
Value flags accept `--name value` or `--name=value`. Boolean flags accept
|
||||
presence as true or an explicit value such as `--force=false`. Repeated
|
||||
single-value flags use the last successfully parsed value; every occurrence
|
||||
must parse. Repeatable flags accumulate values. An explicitly supplied empty,
|
||||
false, or zero value differs from omission. Narratio additionally normalizes
|
||||
repeatable `--artifacts` values as described below.
|
||||
operands. Use command help for installed flags. The [CommandKit CLI contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#registered-command-syntax)
|
||||
describes parsing, repetition, and boolean values. Narratio additionally
|
||||
normalizes repeatable `--artifacts` selections as described below.
|
||||
|
||||
## Configuration selectors
|
||||
|
||||
@@ -62,7 +55,6 @@ repeatable `--artifacts` values as described below.
|
||||
| `--session ID` | Session identity for native configuration inspection only. |
|
||||
| `--session-file PATH` | Exact session source; domain commands use positional `SESSION` as the identity assertion. |
|
||||
| `--party-file PATH` | Select the canonical roster instead of the campaign's default file. |
|
||||
| `--secrets-dir PATH` | Explicit credential-bootstrap directory. |
|
||||
| `--previous-session-id ID` | Assert the configured previous-session identity on applicable domain commands. |
|
||||
|
||||
Explicit relative file/directory paths use the invocation directory. Explicit
|
||||
@@ -74,7 +66,7 @@ players, family expansion, planning, and execution consistently.
|
||||
|
||||
Selectors are installed only where applicable; command help lists them.
|
||||
`session init` creates new input and therefore has no existing-session-file
|
||||
or party-file selection. `session clean --all` accepts pipeline/overlay/secrets
|
||||
or party-file selection. `session clean --all` accepts pipeline/overlay
|
||||
selection and rejects campaign, session, party, and previous-session selectors.
|
||||
|
||||
When no explicit session file is selected, local discovery precedes remote
|
||||
@@ -190,7 +182,7 @@ narratio session init SESSION --remote --audio-s3-prefix audio/session/
|
||||
|
||||
Choose exactly one destination: `--output PATH` or `--remote`. Options include
|
||||
`--date YYYY-MM-DD`, `--title TEXT`, `--previous-session-id ID`, `--force`,
|
||||
configuration/overlay/campaign/secrets selectors, and exactly one audio override
|
||||
configuration/overlay/campaign selectors, and exactly one audio override
|
||||
if needed: `--audio-dir PATH` or `--audio-s3-prefix PREFIX`.
|
||||
|
||||
A configured session template retains its import/resource authoring context;
|
||||
@@ -268,26 +260,11 @@ narratio config explain --list --under /scriptorium --historical
|
||||
narratio config validate --details --severity error
|
||||
```
|
||||
|
||||
- `show` displays safe effective values; `--path POINTER` selects a current
|
||||
value, including present null. An empty pointer selects the root.
|
||||
- `sources` lists native source records, imports, placements, version evidence,
|
||||
and empty optional-import selections. `--source-id ID` selects a record from
|
||||
that load. Available source evidence can be reported after load failure.
|
||||
- `explain --path POINTER` reports effective/history fragments, origins,
|
||||
resolution reasons/dependencies, and safe secret-reference metadata.
|
||||
`explain --list` discovers paths. `--under POINTER`, `--historical`, and
|
||||
`--explicit=true|false` filter discovery; they require `--list`. Historical-only
|
||||
paths do not match an explicitness filter. Neither mode supplied shows help.
|
||||
- `validate` returns concise status or native structured scope outcomes.
|
||||
`--details` includes findings; repeatable `--severity error|warning` and
|
||||
`--code CODE` filter displayed findings, never validation success.
|
||||
- `--scope all` is supported for show/validate, requiring applicable context for
|
||||
every reached scope. It is unsupported for sources, explain, and diff.
|
||||
|
||||
Paths use JSON Pointer: escape `/` as `~1` and `~` as `~0`. Malformed pointers
|
||||
fail as usage; a well-formed unknown selected path fails operationally.
|
||||
Native report fields and detailed source/history semantics are documented in the
|
||||
[selected CommandKit CLI contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/b57bfe176cff05a892e6cb07ebb5f350239e55d4/docs/cli.md#configuration-scopes).
|
||||
Use native show, sources, explain, and validation operations; their options,
|
||||
path syntax, findings, and report shapes are described in the
|
||||
[CommandKit configuration contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#configuration-scopes).
|
||||
`--scope all` is supported for show and validate and requires applicable context
|
||||
for every reached scope. Domain catalog and plan views remain separate.
|
||||
|
||||
### Independent comparisons and overrides
|
||||
|
||||
@@ -304,11 +281,9 @@ and `--against-overlay`, applicable scopes accept `--against-campaign`,
|
||||
defaults; they never inherit left-side selections. Each party default follows
|
||||
that side's campaign.
|
||||
|
||||
Concise diff reports `additions`, `changes`, and `deletions`; detailed diff
|
||||
reports `scope` and `differences` with `path`, `before`, `after`, and
|
||||
`hidden_changed`. Snapshots distinguish absence, null, and redaction. Comparison
|
||||
uses effective values rather than source arrangement. Secret changes remain
|
||||
hidden safely. A diff is inspection output, not a configuration patch.
|
||||
Each reached pipeline side performs its own configured startup; both sides use
|
||||
the process environment. See the [native comparison contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#compare-configuration-selections)
|
||||
for report and comparison semantics.
|
||||
|
||||
Only app inspection supports ordered, repeatable `--set POINTER=JSON`, plus
|
||||
`--against-set POINTER=JSON` for the comparison side. ConfigKit applies these
|
||||
@@ -325,18 +300,9 @@ reports use YAML; text uses the same data. Version and native inspection command
|
||||
may have native text renderers. Report format does not change artifact formats.
|
||||
There is no public report schema-version field.
|
||||
|
||||
| Category | Ordinary | `--quiet` | `--verbose` | `--debug` |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Final report | Shown | Hidden | Shown | Shown |
|
||||
| Terminal failure | Shown | Shown | Shown | Shown |
|
||||
| Info and Warning | Hidden | Hidden | Shown | Shown |
|
||||
| Debug | Hidden | Hidden | Hidden | Shown |
|
||||
| Progress by default | Hidden | Hidden | Hidden | Shown |
|
||||
|
||||
The last enabled quiet/verbose/debug mode wins. Explicit false clears only the
|
||||
currently selected matching mode, returning to ordinary mode. There is no mode
|
||||
stack. Independent `--progress` or `--progress=false` overrides the default;
|
||||
quiet always suppresses progress. Verbose and progress can be combined.
|
||||
[CommandKit reporting](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#reporting) defines formats and visibility controls.
|
||||
Bootstrap evidence is presented as final diagnostics on stderr, independently
|
||||
of the substantive command report and its `--format` selection.
|
||||
|
||||
Progress covers stage transitions/reuse, audio transfers/cache reuse, and
|
||||
individual durable speaker/artifact checkpoints and validated reuse. Info adds
|
||||
@@ -438,6 +404,7 @@ Removed command paths have no compatibility aliases.
|
||||
| `session locks SESSION` | `session locks list SESSION` |
|
||||
| `--session FILE` | `--session-file FILE`; inspection `--session` now asserts identity |
|
||||
| `--session-id ID` | Positional `SESSION` on domain commands; `--session ID` on config inspection |
|
||||
| `--secrets-dir PATH` | Configure the main pipeline file or supply environment values; see [Secrets Handling](config.md#secrets-handling). |
|
||||
| `config diff LEFT_OVERLAY RIGHT_OVERLAY` | `config diff --overlay LEFT_OVERLAY --against-overlay RIGHT_OVERLAY` |
|
||||
|
||||
Campaign identity and file selectors may now accompany each other. Party-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.
|
||||
|
||||
@@ -320,6 +320,12 @@ per-side environment snapshots, or a matrix duplicating native library tests.
|
||||
|
||||
## Stage 8 — Simplify public configuration and CLI documentation
|
||||
|
||||
**Completed.** Updated the configuration and CLI references for configured
|
||||
startup, shared-process comparison, final diagnostics, and removal of the flag
|
||||
and fallback. General ConfigKit and CommandKit syntax and reporting descriptions
|
||||
now link to the adopted versions while Narratio selectors, domain behavior, and
|
||||
report fields remain local. Documentation checks pass with Go 1.27.4.
|
||||
|
||||
Read `docs/config.md`, `docs/cli.md`, and the adopted documentation policy's
|
||||
Upstream Dependencies rule. Use the roadmap's pinned upstream contracts.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user