From c5970ff8347d2fb14e1294705922754976c3c2f0 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 23 Nov 2026 14:31:49 +0000 Subject: [PATCH] Align operator guidance with configured secrets startup --- docs/development.md | 2 ++ docs/internal/configuration.md | 12 ++++++++---- docs/internal/overview.md | 3 +++ docs/operations.md | 18 ++++++++---------- docs/policy/architecture.md | 14 +++++++------- docs/roadmap/implementation.md | 6 ++++++ docs/troubleshooting.md | 14 +++++++------- examples/README.md | 10 ++++------ examples/pipeline.full.annotated.yml | 6 ++++-- 9 files changed, 49 insertions(+), 36 deletions(-) diff --git a/docs/development.md b/docs/development.md index 2d825d7..20612dd 100644 --- a/docs/development.md +++ b/docs/development.md @@ -14,6 +14,8 @@ Agents must read [Agent Policy](policy/agents.md) before recommending, planning, or implementing changes. It owns implementation discipline and the default commit-after-completed-work rule; it does not authorize pushing or releasing. +Narratio integrates [ConfigKit v1.4.0](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/consumers/README.md) and [CommandKit v0.8.0](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/consumers/guide.md); their guides own upstream APIs and behavior. + ## Go Prerequisite The Go consumer minimum is 1.27.0, declared in `go.mod`. Maintained development diff --git a/docs/internal/configuration.md b/docs/internal/configuration.md index d4667d4..0c6a2cb 100644 --- a/docs/internal/configuration.md +++ b/docs/internal/configuration.md @@ -33,8 +33,8 @@ acquired context. Exact sources and effective-identity assertions are complementary. App acquisition needs no campaign or party for expansion; campaign acquisition needs no session. Session acquisition loads campaign context when required for defaults. Explicit party acquisition does not require -a session. Credential bootstrap runs once per reached invocation after static -input checks. +a session. Each reached pipeline acquisition prepares its native source and applies +configured bootstrap after static input checks; completed acquisitions are reused. `LoadedPipelineCampaign` retains one selected pipeline/campaign while local or remote session resolution proceeds. Only absence permits remote fallback; @@ -54,8 +54,8 @@ synthetic source reconciliation, or generated family catalog in app inspection. Comparison sides load independently using each side's normal defaults and selectors. App-only overrides pass through native selection into ConfigKit; they remain invocation-local. Field overrides are unavailable to domain -execution/planning and other scopes. Shared bootstrap does not imply shared -overridden results. Public inspection and error paths preserve typed-secret +execution/planning and other scopes. Comparison sides acquire separately and share the process environment while +retaining separate completed results. Public inspection and error paths preserve typed-secret redaction and credential reference metadata. Load failures retain native errors and source evidence; domain commands use `ckconfig.AdaptDiagnostics` for their presentation without rewriting diagnostic records. @@ -96,3 +96,7 @@ labels alone do not invalidate work. Focused configuration/application fixtures cover imports, defaults, selected rosters, independent comparisons, override isolation, secret-safe persistence, and unchanged completed configuration across domain derivation and execution. + +ConfigKit's [consumer guide](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/consumers/README.md) +and [CommandKit consumer guide](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/consumers/guide.md) +own the upstream APIs and feature behavior. diff --git a/docs/internal/overview.md b/docs/internal/overview.md index ebf97db..c703d22 100644 --- a/docs/internal/overview.md +++ b/docs/internal/overview.md @@ -8,6 +8,9 @@ in the [CLI](../cli.md), [Configuration](../config.md), Externally observable tool and format contracts belong under [Integrations](../integrations/). +Configuration and CLI integration use [ConfigKit v1.4.0](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/consumers/README.md) and [CommandKit v0.8.0](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/consumers/guide.md); the upstream guides +own their APIs. + ## Execution Path ```text diff --git a/docs/operations.md b/docs/operations.md index 133c852..79e4229 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -809,14 +809,12 @@ Provision a credential directory as `0700` and credential files as `0600`; these permission modes are an operator requirement and are not enforced by ConfigKit. -Every pipeline-loading command bootstraps credentials once, before the first -configuration load and before any adapter is constructed. `--secrets-dir` -selects an explicit directory (relative paths use caller CWD). Otherwise a -present `/usr/local/etc/narratio/secrets` directory is used, while an absent -conventional directory is skipped. Explicit missing/empty selections and -invalid existing directories fail the command. ConfigKit follows a symlink used -as the selected directory, but immediate entries must be regular non-symlink -files. Existing environment variables—including empty values—always win. +Pipeline acquisition uses the directory declared in the main pipeline file, +when present, before resolving typed credentials. Remove `--secrets-dir` from +old invocations and declare `config.secrets_dir`, or provision environment values. +A pipeline beside the former system-wide directory can select `secrets`; other +layouts follow [ConfigKit's path rules](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap). +See [Secrets Handling](config.md#secrets-handling) for Narratio's integration. S3 `access_key_id` and `secret_access_key` are an optional pair of typed environment references. When both are absent, the AWS SDK retains its default @@ -887,8 +885,8 @@ normal migration path. - Publish requires prerequisite stages through `render` and `analyze` to be succeeded. - Markdown publish defaults require render outputs (`transcripts/final.md` and `transcripts/final.trimmed.md`). - Restore requires configured object storage and committed remote current state. -- Pipeline-loading commands bootstrap filesystem secrets once before configuration - resolution and object-store initialization. +- Each reached pipeline acquisition applies its configured startup before typed + credential resolution and object-store initialization. Console progress and informational diagnostics use native invocation visibility. `--progress` shows work without requiring verbose mode; `--verbose` adds source diff --git a/docs/policy/architecture.md b/docs/policy/architecture.md index 6c4e865..840a837 100644 --- a/docs/policy/architecture.md +++ b/docs/policy/architecture.md @@ -2,7 +2,7 @@ **Base Policy Version:** 1.3 -**Last Updated**: 2026-11-19 +**Last Updated**: 2026-11-22 **Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/architecture.md @@ -290,12 +290,12 @@ uses a separate restrictive contract. Raw secrets must not be stored in pipeline, campaign, or session YAML or written to manifests, logs, generated configuration, reports, publish metadata, -documentation, or examples. Pipeline configuration names environment variables; -command-owned startup may populate previously unset variables from ConfigKit's -explicit or conventional secrets directory. This bootstrap occurs once per -invocation before any typed configuration load or adapter construction and is -not hidden inside library loaders. Safe bootstrap diagnostics may identify -files and statuses but never values. Diagnostics should avoid transcript and +documentation, or examples. Pipeline configuration names environment variables. Command-owned pipeline +acquisition explicitly prepares the selected source through ConfigKit's +configured bootstrap before typed credential resolution and adapter construction. +Completed acquisitions are reused normally; ConfigKit's selected environment +policy governs each preparation. Library loading does not write the environment. +Safe bootstrap diagnostics may identify files and statuses but never values. Diagnostics should avoid transcript and prompt content unless a deliberate, bounded inspection mechanism requires it. Logs, reports, generated invocation files, generated configuration, and render diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 643b4bb..8aefcf3 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -351,6 +351,12 @@ belongs in Narratio as part of this cleanup. ## Stage 9 — Align policy, operator guidance, internals, and examples +**Completed.** Updated architecture startup policy and operator, troubleshooting, +internal, and example guidance for configured bootstrap and migration. Added +version-pinned upstream links and a commented main-file example while preserving +credential protection and historical decisions. Documentation and maintained +example checks pass with Go 1.27.4. + Read `docs/policy/architecture.md`, `docs/operations.md`, `docs/troubleshooting.md`, `docs/internal/configuration.md`, `docs/internal/overview.md`, `docs/development.md`, `examples/README.md`, and diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 801f7cd..e8d577f 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -324,15 +324,15 @@ Likely causes: - the named environment variable is absent or empty; - the selected secrets directory lacks a file with that exact name; -- a process environment variable exists but is empty, so bootstrap correctly - leaves it in place; or +- a process environment variable is empty and the selected bootstrap policy + preserves it; or - the Narratio reference name does not match `api_key_env` in the selected Notarius/PromptKit profile. Safe fix: - set the exact nonempty environment variable or provide an equivalently named - file through the conventional or explicit secrets directory; + file through the pipeline-configured secrets directory; - remove, set to `null`, or set to `[]` when that deployment needs no credential; and - use `config show`, `config sources`, and `config diff` to inspect the public @@ -359,7 +359,7 @@ Likely causes: - the Narratio pipeline still uses v1 endpoint, model, capacity, singular key, report, or retention settings; - the named key is missing or empty, including a present but empty process - environment variable that takes precedence over a secrets-directory file; + environment variable preserved by the selected bootstrap policy; - Audita's external v2 file references a backend credential name not forwarded by `pipeline.audita.credentials`, including a backend not selected by the current profile; or @@ -962,8 +962,8 @@ Symptom: Likely causes: -- missing, unreadable, or invalid explicit `--secrets-dir`; -- invalid entries in `/usr/local/etc/narratio/secrets`; +- a missing, unreadable, or invalid pipeline-configured secrets directory; +- invalid secret-directory entries; - missing credential environment variables; - invalid S3 endpoint/bucket settings. @@ -976,7 +976,7 @@ env | sed 's/=.*//' | grep -E 'OBJECT_STORAGE|AWS|AUDITA|NOTARIUS|SCRIPTORIUM' Safe fix: -- correct `--secrets-dir`, secret-file type/name, and operator-managed permissions; +- correct the main pipeline secrets selection, file type/name, and operator-managed permissions; - provide required env vars; - keep secret values out of YAML. diff --git a/examples/README.md b/examples/README.md index 50f1476..22ba8d5 100644 --- a/examples/README.md +++ b/examples/README.md @@ -39,9 +39,7 @@ in the [configuration reference](../docs/config.md). needs no tools or cloud services. Native app inspection retains family declarations; `artifacts list` derives their concrete members using the selected campaign. Diff selects the example root on both sides because omitted - right-side selectors use their own discovery defaults. To isolate the - walkthrough from installed credential files, add `--secrets-dir` pointing to - an existing empty directory to each command. + right-side selectors use their own discovery defaults. - [Full annotated pipeline](pipeline.full.annotated.yml): every implemented pipeline section with explanatory comments. - [Extraction subset pipeline](pipeline.extraction-subset.yml): a focused @@ -89,8 +87,8 @@ names, or the Narratio credential lists must be changed to match. See the [Audita v2 migration guide](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/docs/migrations/v2.md) for maintained downstream configuration examples. -For a deployed bundle, keep credential files out of source control in the -conventional `/usr/local/etc/narratio/secrets` directory, one file per referenced -environment-variable name, or select another directory with `--secrets-dir`. +For a deployed bundle, keep credential files out of source control. Select a +directory in the main pipeline or provide environment values; see +[Secrets Handling](../docs/config.md#secrets-handling). Static S3 credentials are optional: omit both S3 credential references to use the AWS SDK discovery chain. diff --git a/examples/pipeline.full.annotated.yml b/examples/pipeline.full.annotated.yml index a8b1b00..90e6e1a 100644 --- a/examples/pipeline.full.annotated.yml +++ b/examples/pipeline.full.annotated.yml @@ -7,8 +7,10 @@ workspace: # Optional: remove run-scoped workdir after successful publish commit. cleanup_after_publish: false -# Credential files, when used, belong in a sibling secrets/ directory or in the -# directory selected with --secrets-dir; they are not pipeline configuration. +# Optional configured bootstrap; see the ConfigKit configured-startup contract: +# https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap +# config: +# secrets_dir: secrets storage: # Defaults to "local". Use "s3" explicitly for publish + S3 audio workflows.