Compare commits
384 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 831665c913 | |||
| ab0aa9cfad | |||
| 313423a19c | |||
| 99437a24eb | |||
| ff77f7b0b0 | |||
| 450d73f2c9 | |||
| 080b2c1944 | |||
| 719fe8d49e | |||
| d39f03fd10 | |||
| f4a8488167 | |||
| f7a7afe12f | |||
| 6fb15b0094 | |||
| 39d9184c14 | |||
| 0e63c3d11a | |||
| 5d07476e2c | |||
| e4659f2dfd | |||
| 2e14dcef51 | |||
| d2f8b21c97 | |||
| 106036cf5b | |||
| 3d09745a79 | |||
| a623ecb518 | |||
| 93876ff2cf | |||
| e824e133d7 | |||
| 134513e3b9 | |||
| abc25dfc38 | |||
| 9ae5443073 | |||
| 19b720742e | |||
| 0965b7c7ac | |||
| 6c8301c78e | |||
| 886ee12311 | |||
| 3e0f455b6d | |||
| d3b4f25f71 | |||
| 17f930b8d5 | |||
| af0baa03b5 | |||
| 21d4eebb5e | |||
| adf4dc87e0 | |||
| 87a749d26d | |||
| d6df530312 | |||
| 845738a665 | |||
| 3c5533d310 | |||
| a053ffab79 | |||
| 042431e246 | |||
| a172eebeba | |||
| e5d91cb19b | |||
| 56483f9064 | |||
| e7fada4372 | |||
| ad8a5df97b | |||
| 4f50a57a38 | |||
| ebdf8b522f | |||
| 7ad8deb381 | |||
| 62778f5c5b | |||
| 6e74b436f6 | |||
| 9367c7b713 | |||
| 93c8695250 | |||
| eb146d3298 | |||
| cf8fd71a83 | |||
| 07fac1b968 | |||
| b82ab47c6c | |||
| 663e02e21e | |||
| 76f99184ac | |||
| 7a25a50056 | |||
| a057ce3397 | |||
| 56fadeb27d | |||
| 59e324a8aa | |||
| c1f43de5f9 | |||
| 11de2262a0 | |||
| c0c8a95f7c | |||
| 6c869495cf | |||
| 89a587311c | |||
| 6ae2fc852e | |||
| 914d98dd25 | |||
| 0ec57fe2f4 | |||
| 9e2fc7313e | |||
| 3b16bf2790 | |||
| 35ddc5ed96 | |||
| 62ec37d9e2 | |||
| f902e50def | |||
| 9b59fa16b2 | |||
| 1a66db4708 | |||
| 0288111c72 | |||
| 89c8e5de3c | |||
| 4d7fc57a5e | |||
| 75eddf8adc | |||
| f59a53e31b | |||
| d311579dc0 | |||
| d70bf98871 | |||
| 59813b72fa | |||
| 6f5464615e | |||
| d0c879ad09 | |||
| da4de023ad | |||
| eb100e54f2 | |||
| 9e3fc25fdd | |||
| 038105ece9 | |||
| 8e4627e262 | |||
| a92a117ad9 | |||
| 074fe64e12 | |||
| 3d24fc4130 | |||
| 473f39bd90 | |||
| b5ea9b4786 | |||
| aa0379294f | |||
| 096a2f6745 | |||
| 4b75e283db | |||
| bfd6369bc1 | |||
| 5b8cc0c45c | |||
| 9e07e9e5db | |||
| d8bc99b17e | |||
| 935b513255 | |||
| 2763890ffc | |||
| 02683f6d96 | |||
| 191bd4342b | |||
| 1b7742cd38 | |||
| bd8e8a0627 | |||
| 28e54fb657 | |||
| bca7cd7c3a | |||
| 8f7d2ab181 | |||
| 7a9bbbde9f | |||
| f0e45b6035 | |||
| f02e7ec8de | |||
| 3c00167912 | |||
| 89ea4ff155 | |||
| 723b788161 | |||
| 8aa552070d | |||
| 7320fd7957 | |||
| c11b4ac309 | |||
| f292edfe5c | |||
| b2877c1ea0 | |||
| 727ed783d1 | |||
| 6ea1b42d2a | |||
| 2b4123f48f | |||
| 5ca879e7e2 | |||
| 61e2a85842 | |||
| 1f494c285a | |||
| d4e5cfe41b | |||
| 07e6faed5a | |||
| 826369c81a | |||
| fec29b541f | |||
| afd04e49d7 | |||
| 719a6839d1 | |||
| e9d74a7de0 | |||
| e9a81509b0 | |||
| c00c8169e2 | |||
| 03c16df524 | |||
| 5196c67570 | |||
| 2ca09e2a00 | |||
| 95e297e917 | |||
| 39ad49e09d | |||
| 3b6449113e | |||
| 13b28eeea8 | |||
| 7906b2915e | |||
| 1f5c0c435e | |||
| 4d81a37638 | |||
| 949e1ab189 | |||
| b45e934feb | |||
| 807fbbeda3 | |||
| 3795d86587 | |||
| dbfcfa3f75 | |||
| bc4878f2d7 | |||
| b6492ab4e8 | |||
| 7ad6b718a0 | |||
| 4ee706bfb6 | |||
| d3d7728f1f | |||
| 2ec43305da | |||
| 706c1bb7ad | |||
| b5b4672920 | |||
| 52a5d483e3 | |||
| 3118bc35ba | |||
| e19ba81406 | |||
| 3094ad892f | |||
| c07d4f24a2 | |||
| 16c3d7d643 | |||
| a5d541529d | |||
| 7eed744ad1 | |||
| 815d727361 | |||
| a3ce64f841 | |||
| 4e3ac343b4 | |||
| f05e711328 | |||
| 4e94b2157b | |||
| 5c4ca20b11 | |||
| c70de21a7b | |||
| d5e6d44fa7 | |||
| d1bf1fbfff | |||
| f923d75562 | |||
| 816453b444 | |||
| 8bc3ae56cb | |||
| c53c764c4d | |||
| f2829f31e8 | |||
| b472ccfbbe | |||
| 2043cdf25f | |||
| 8dc1724846 | |||
| c88182811c | |||
| cd12eb2f4c | |||
| 9c61299e86 | |||
| d1d505c9a2 | |||
| 0676d7e40c | |||
| 1d09762e31 | |||
| b65f653380 | |||
| 782bcceb1c | |||
| 806526de68 | |||
| 65b774b568 | |||
| 55a4c49a31 | |||
| 89f5a6a0ad | |||
| aa0c1f1c03 | |||
| eb5e912fa3 | |||
| 447888e062 | |||
| d4036eea47 | |||
| 54ba768a28 | |||
| 4f27331636 | |||
| 0de73ba25f | |||
| 8b9c0e664b | |||
| cfcb55e28c | |||
| 410a4109ad | |||
| d178e2c437 | |||
| b9b154e59e | |||
| 2db2554d1e | |||
| 5bafae048e | |||
| 16e28b25a2 | |||
| 5da7db2b27 | |||
| 0ce7568103 | |||
| 28d149f7ed | |||
| 1bb1daa1f2 | |||
| caddd668ca | |||
| 1cc37ef980 | |||
| 5d44b41e74 | |||
| 66b7674e43 | |||
| a6c1bceb26 | |||
| 6e6d64c289 | |||
| bf86acd0a4 | |||
| 4f68fb27d9 | |||
| 9400eb20da | |||
| 6fe5afcca4 | |||
| 95aac6367f | |||
| f2cc45ea26 | |||
| fa22c89622 | |||
| 9029dc4d7d | |||
| 3b1718c44f | |||
| c9828b220e | |||
| 0a43b67847 | |||
| 72eb597a72 | |||
| f930ebf337 | |||
| e9d57fb7aa | |||
| d48215678a | |||
| 150a59a928 | |||
| 0cee77887d | |||
| 2c9668683a | |||
| 3e7200ef28 | |||
| f1fb77baa0 | |||
| de325006de | |||
| b790cc73ca | |||
| fcd7cffd18 | |||
| a9705a6b56 | |||
| bb84094385 | |||
| b9d56b8923 | |||
| e586e8c733 | |||
| 1d1dfdf1ed | |||
| 9fa179736b | |||
| e7b266f908 | |||
| b266031d56 | |||
| c893e1086a | |||
| 3185795b4b | |||
| c2c3232d8f | |||
| b031d35af7 | |||
| ef4335cda3 | |||
| 8e5511b112 | |||
| 7ab594bc8b | |||
| 5776733ebd | |||
| aef88a9602 | |||
| 0d0596b204 | |||
| abaa3c78df | |||
| 7f7033779c | |||
| bb15edc057 | |||
| f04b6097b8 | |||
| c5970ff834 | |||
| 6026933b24 | |||
| 43a7d398b6 | |||
| 716869d553 | |||
| 457b5a3976 | |||
| 6175945230 | |||
| a4491a8517 | |||
| af3f49b644 | |||
| 14f33dde04 | |||
| 9fb0c6a994 | |||
| b63bef2d43 | |||
| 1d5dc370e8 | |||
| c6214f6259 | |||
| 04483a68e8 | |||
| b1ef8e20b6 | |||
| 1701f0461f | |||
| b47cb35966 | |||
| 39b4bddbc9 | |||
| 7e45ffca43 | |||
| 672b7f0ebd | |||
| f44078724a | |||
| af6cf8b6f1 | |||
| 7e65c29a61 | |||
| 846f8470dc | |||
| 32ff928786 | |||
| 25c59ff62f | |||
| 38866110a7 | |||
| 65d24fb88f | |||
| 8be65fd3a1 | |||
| 0117f3f35d | |||
| 0e9cbc9c2a | |||
| faa8cb5822 | |||
| 7db626781e | |||
| c523def852 | |||
| c7a5ff316d | |||
| a6c6f1e4ab | |||
| 85df36a770 | |||
| 6b7a0847d4 | |||
| e44247b5b1 | |||
| 97cced5d88 | |||
| 0238f82847 | |||
| ed29bdc473 | |||
| c3c6849bed | |||
| 1e67c429b7 | |||
| b537cb38ae | |||
| 065a615e5f | |||
| 6900cad104 | |||
| c3e6245416 | |||
| 16a4f7ee12 | |||
| a3c58141a0 | |||
| 86692d58f9 | |||
| bcbfc0fa4a | |||
| e476c08ea4 | |||
| 8824ce330f | |||
| 87142508e3 | |||
| 7cc877ea7f | |||
| 7ee362f1c3 | |||
| 084e6d178b | |||
| 86ec48d2e4 | |||
| 3868822277 | |||
| d83c5f0062 | |||
| 981eb6be8f | |||
| 6b027873a5 | |||
| d00cc8037d | |||
| b4b618a913 | |||
| 8ba001750e | |||
| fa9ed78a6d | |||
| 4dae8e0d36 | |||
| 35eaefd05d | |||
| f85f93bdfb | |||
| 0e34ea1d48 | |||
| 97a93d3393 | |||
| 435ec79185 | |||
| 33d2ebf44c | |||
| e93fb8d5ab | |||
| 69dc5cc8ec | |||
| 5d62f9a88b | |||
| ba9079ee74 | |||
| 583c5bdf1b | |||
| bccf03a99f | |||
| 39a958675d | |||
| 413b0d7134 | |||
| ff4bdaa483 | |||
| ebcc5b32a0 | |||
| ce661252d0 | |||
| ed7e722077 | |||
| bcfca7a044 | |||
| 05f5607968 | |||
| 1657c9f65d | |||
| c3023cb609 | |||
| 6593ccbeaf | |||
| 341fe93e3b | |||
| 65d0e518e5 | |||
| 4a0e3c83db | |||
| f5451a0cf5 | |||
| 381668568f | |||
| 8afb49c018 | |||
| 535f47ef20 | |||
| dcb9bae215 | |||
| f1f71d8cdf | |||
| 39af6ef941 | |||
| e1c934a492 | |||
| dd760d84e0 | |||
| 6db49b3949 | |||
| f1672f6f95 | |||
| 428f435734 | |||
| c4abdc19df | |||
| 08327c2e63 | |||
| 2850498043 | |||
| fe9817f354 | |||
| 40cbf42438 | |||
| 44a318694b | |||
| 9389f69eb0 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
# ---> Codex
|
# ---> Codex
|
||||||
.codex
|
.codex
|
||||||
|
.releasekit/
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
|
|
||||||
# Go cache
|
# Go cache
|
||||||
.gocache
|
.gocache
|
||||||
|
/dist/
|
||||||
|
|
||||||
# Go workspace file
|
# Go workspace file
|
||||||
go.work
|
go.work
|
||||||
|
|||||||
@@ -1,39 +1,56 @@
|
|||||||
|
# Adapted from ReleaseKit v0.10.0 tag-delivery.yml.
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- GO_IMAGE: golang:1.27.4-bookworm
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: tag
|
- event: tag
|
||||||
|
ref: refs/tags/v*
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
validate-release:
|
- name: deliver
|
||||||
image: golang:1.26.7
|
image: ${GO_IMAGE}
|
||||||
commands:
|
environment:
|
||||||
- ./scripts/check-release-candidate.sh "$CI_COMMIT_TAG"
|
RELEASEKIT_GITEA_TOKEN:
|
||||||
|
from_secret: GITEA_RELEASE_TOKEN
|
||||||
build-release-assets:
|
|
||||||
image: golang:1.26.7
|
|
||||||
depends_on:
|
|
||||||
- validate-release
|
|
||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
set -eu
|
set -eu
|
||||||
case "$PWD" in
|
test -n "$${CI_COMMIT_TAG}"
|
||||||
/*) ;;
|
test -n "$${CI_COMMIT_SHA}"
|
||||||
*) echo "release workspace must have an absolute path" >&2; exit 1 ;;
|
git check-ref-format "refs/tags/$${CI_COMMIT_TAG}"
|
||||||
esac
|
git fetch origin "refs/tags/$${CI_COMMIT_TAG}:refs/tags/$${CI_COMMIT_TAG}"
|
||||||
./scripts/build-release-assets.sh "$CI_COMMIT_TAG" "$PWD/dist"
|
tag_commit=$(git rev-parse --verify "refs/tags/$${CI_COMMIT_TAG}^{commit}")
|
||||||
|
expected_commit=$(git rev-parse --verify "$${CI_COMMIT_SHA}^{commit}")
|
||||||
|
if [ "$${tag_commit}" != "$${expected_commit}" ]; then
|
||||||
|
printf 'Tag %s resolves to commit %s; event %s resolves to commit %s\n' \
|
||||||
|
"$${CI_COMMIT_TAG}" "$${tag_commit}" "$${CI_COMMIT_SHA}" "$${expected_commit}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git checkout --detach "$${tag_commit}"
|
||||||
|
test "$(git rev-parse HEAD | tr '[:upper:]' '[:lower:]')" = "$${expected_commit}"
|
||||||
|
test -z "$(git status --porcelain --untracked-files=all)"
|
||||||
|
|
||||||
publish-release:
|
bootstrap_dir=$(mktemp -d "$${CI_WORKSPACE%/*}/.releasekit-bootstrap.XXXXXX")
|
||||||
image: woodpeckerci/plugin-release:0.3.1
|
trap 'rm -rf "$${bootstrap_dir}"' EXIT
|
||||||
depends_on:
|
cp go.mod "$${bootstrap_dir}/releasekit.mod"
|
||||||
- build-release-assets
|
if [ -f go.sum ]; then
|
||||||
settings:
|
cp go.sum "$${bootstrap_dir}/releasekit.sum"
|
||||||
api_key:
|
else
|
||||||
from_secret: GITEA_RELEASE_TOKEN
|
: > "$${bootstrap_dir}/releasekit.sum"
|
||||||
files:
|
fi
|
||||||
- dist/narratio-*
|
|
||||||
title: Narratio ${CI_COMMIT_TAG}
|
export GOWORK=off
|
||||||
note: docs/releases/${CI_COMMIT_TAG}.md
|
export GOTOOLCHAIN=local
|
||||||
checksum: sha256
|
releasekit_host_os=$(go env GOHOSTOS) || exit $?
|
||||||
checksum-file: SHA256SUMS
|
releasekit_host_arch=$(go env GOHOSTARCH) || exit $?
|
||||||
checksum-flatten: true
|
export GOOS="$${releasekit_host_os}" GOARCH="$${releasekit_host_arch}"
|
||||||
file-exists: skip
|
releasekit_module=go.maximumdirect.net/releasekit
|
||||||
overwrite: false
|
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -m "$${releasekit_module}"
|
||||||
prerelease: false
|
go mod edit -modfile="$${bootstrap_dir}/releasekit.mod" -tool="$${releasekit_module}/cmd/releasekit"
|
||||||
|
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -deps "$${releasekit_module}/cmd/releasekit" > /dev/null
|
||||||
|
go tool -modfile="$${bootstrap_dir}/releasekit.mod" "$${releasekit_module}/cmd/releasekit" ci-deliver \
|
||||||
|
--repo "$${CI_WORKSPACE}" \
|
||||||
|
--prepared \
|
||||||
|
--commit "$${expected_commit}" \
|
||||||
|
"$${CI_COMMIT_TAG}"
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ when:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
shuffled-race-tests:
|
shuffled-race-tests:
|
||||||
image: golang:1.26
|
image: golang:1.27.4
|
||||||
commands:
|
commands:
|
||||||
- go test -race -shuffle=on -count=3 ./...
|
- go test -race -shuffle=on -count=3 ./...
|
||||||
|
|||||||
@@ -3,30 +3,30 @@ when:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
tests:
|
tests:
|
||||||
image: golang:1.26
|
image: golang:1.27.4
|
||||||
commands:
|
commands:
|
||||||
- go test ./...
|
- go test ./...
|
||||||
|
|
||||||
race-tests:
|
race-tests:
|
||||||
image: golang:1.26
|
image: golang:1.27.4
|
||||||
depends_on: tests
|
depends_on: tests
|
||||||
commands:
|
commands:
|
||||||
- go test -race ./...
|
- go test -race ./...
|
||||||
|
|
||||||
static-analysis:
|
static-analysis:
|
||||||
image: golang:1.26
|
image: golang:1.27.4
|
||||||
depends_on: tests
|
depends_on: tests
|
||||||
commands:
|
commands:
|
||||||
- go vet ./...
|
- go vet ./...
|
||||||
|
|
||||||
build:
|
build:
|
||||||
image: golang:1.26
|
image: golang:1.27.4
|
||||||
depends_on: tests
|
depends_on: tests
|
||||||
commands:
|
commands:
|
||||||
- go build ./...
|
- go build ./...
|
||||||
|
|
||||||
cross-build:
|
cross-build:
|
||||||
image: golang:1.26
|
image: golang:1.27.4
|
||||||
depends_on: [race-tests, static-analysis, build]
|
depends_on: [race-tests, static-analysis, build]
|
||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ polished transcripts, validated Notarius extraction lanes, and generated
|
|||||||
artifacts.
|
artifacts.
|
||||||
|
|
||||||
It runs a deterministic workflow with manifest-driven continuation, remote
|
It runs a deterministic workflow with manifest-driven continuation, remote
|
||||||
publish, and restore support.
|
publish, and restore support. Its CommandKit CLI provides native configuration
|
||||||
|
inspection, structured operation reports, progress, and shell completion.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
narratio run 2026-04-04
|
narratio run 2026-04-04
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"os"
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"gitea.maximumdirect.net/eric/narratio/internal/app"
|
"go.maximumdirect.net/commandkit"
|
||||||
|
|
||||||
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/app"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
os.Exit(app.Execute(os.Args[1:], os.Stdout, os.Stderr))
|
os.Exit(runProcess(os.Args[1:], commandkit.Streams{Out: os.Stdout, Err: os.Stderr}, app.Execute))
|
||||||
|
}
|
||||||
|
|
||||||
|
func runProcess(args []string, streams commandkit.Streams, execute func(context.Context, []string, commandkit.Streams) commandkit.Outcome) int {
|
||||||
|
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||||
|
defer stop()
|
||||||
|
return execute(ctx, args, streams).Status
|
||||||
}
|
}
|
||||||
|
|||||||
56
cmd/narratio/main_test.go
Normal file
56
cmd/narratio/main_test.go
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"syscall"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"go.maximumdirect.net/commandkit"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestProcessSignalsCancelInvocation(t *testing.T) {
|
||||||
|
if os.Getenv("NARRATIO_TEST_SIGNAL_CHILD") == "1" {
|
||||||
|
os.Exit(runProcess(nil, commandkit.Streams{Out: os.Stdout, Err: os.Stderr}, func(ctx context.Context, _ []string, streams commandkit.Streams) commandkit.Outcome {
|
||||||
|
fmt.Fprintln(streams.Out, "ready")
|
||||||
|
<-ctx.Done()
|
||||||
|
return commandkit.Failure("interrupted").WithCause(ctx.Err())
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
for _, sig := range []os.Signal{os.Interrupt, syscall.SIGTERM} {
|
||||||
|
t.Run(sig.String(), func(t *testing.T) {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
child := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestProcessSignalsCancelInvocation$")
|
||||||
|
child.Env = append(os.Environ(), "NARRATIO_TEST_SIGNAL_CHILD=1")
|
||||||
|
out, err := child.StdoutPipe()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
child.Stderr = os.Stderr
|
||||||
|
if err := child.Start(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
scanner := bufio.NewScanner(out)
|
||||||
|
if !scanner.Scan() || scanner.Text() != "ready" {
|
||||||
|
_ = child.Process.Kill()
|
||||||
|
_ = child.Wait()
|
||||||
|
t.Fatal("child failed to register its signal context")
|
||||||
|
}
|
||||||
|
if err := child.Process.Signal(sig); err != nil {
|
||||||
|
_ = child.Process.Kill()
|
||||||
|
_ = child.Wait()
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
err = child.Wait()
|
||||||
|
exit, ok := err.(*exec.ExitError)
|
||||||
|
if !ok || exit.ExitCode() != 1 {
|
||||||
|
t.Fatalf("child result=%v, want operational exit 1", err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
84
docs/adr/0001-classify-session-content.md
Normal file
84
docs/adr/0001-classify-session-content.md
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
# 0001. Classify session content by purpose and lifecycle
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Accepted
|
||||||
|
|
||||||
|
## Date
|
||||||
|
|
||||||
|
2026-11-29
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
Narratio coordinates applications that produce transcripts, artifacts,
|
||||||
|
diagnostics, and working files. The current session layout mixes some of these
|
||||||
|
roles, including complete Notarius bundles under `artifacts/`. Operators use
|
||||||
|
transcripts and artifacts to evaluate results during development and need
|
||||||
|
predictable locations for diagnostics.
|
||||||
|
|
||||||
|
A shared classification model will guide the workspace design and subsequent
|
||||||
|
adapter changes. The [operator guide](../operations.md#local-state-layout)
|
||||||
|
describes the implemented layout.
|
||||||
|
|
||||||
|
## Decision
|
||||||
|
|
||||||
|
Classify content by its primary purpose and lifecycle:
|
||||||
|
|
||||||
|
| Category | Purpose |
|
||||||
|
| --- | --- |
|
||||||
|
| Inputs | Material consumed by an application, including audio, configuration, and reference documents. |
|
||||||
|
| Outputs | Completed substantive products, including intermediate artifacts exposed for further use. |
|
||||||
|
| Logs | Records of execution, including process logs, execution reports, warnings, and diagnostic summaries. |
|
||||||
|
| Cache | Reusable information whose absence permits ordinary recomputation or retrieval. |
|
||||||
|
| State | Application condition, progress, recovery records, and unfinished work. |
|
||||||
|
|
||||||
|
Classification is relative to the consuming application. An output of one stage
|
||||||
|
can serve as an input to another while retaining its output location. Completed
|
||||||
|
outputs reused to skip work remain Outputs. Narratio's manifest is State and
|
||||||
|
records whether those outputs are reusable.
|
||||||
|
|
||||||
|
Classify checkpoints according to their recovery behavior. A checkpoint needed
|
||||||
|
to continue a particular interrupted operation is State. A saved work result
|
||||||
|
that can be reused or recomputed is Cache. Recomputation cost informs retention
|
||||||
|
policy. File-specific classification remains necessary for stores serving both
|
||||||
|
purposes.
|
||||||
|
|
||||||
|
Treat Debug as a capture and retention mode that can include detailed Logs,
|
||||||
|
snapshots of State, and other diagnostic evidence. Retained debug snapshots have
|
||||||
|
a diagnostic role; live recovery records retain their State role.
|
||||||
|
|
||||||
|
Apply these directory principles to Narratio:
|
||||||
|
|
||||||
|
- Store completed artifacts, including intermediate artifacts like
|
||||||
|
`session_bounds.json`, directly in a flat `artifacts/` directory.
|
||||||
|
- Store combined transcripts directly in `transcripts/`, with a subdirectory
|
||||||
|
for the initial per-speaker transcripts.
|
||||||
|
- Store prepared external audio in `audio/` and other prepared external inputs
|
||||||
|
in `inputs/`.
|
||||||
|
- Organize Logs under `logs/` by stage. Execution reports belong to this category.
|
||||||
|
- Organize Cache under a cache root by the application that owns its format and
|
||||||
|
reuse behavior.
|
||||||
|
- Treat scratch files and unfinished outputs as State until completion permits
|
||||||
|
promotion to Outputs.
|
||||||
|
|
||||||
|
## Alternatives Considered
|
||||||
|
|
||||||
|
- Group outputs by producer. This exposes subprocess packaging to operators;
|
||||||
|
flat artifact and transcript locations better support comparison and review.
|
||||||
|
- Group Logs by application. Stage names match the operator's workflow and
|
||||||
|
collect diagnostics from stages that invoke multiple applications.
|
||||||
|
- Classify all checkpoints as State. Recovery behavior provides a more useful
|
||||||
|
distinction for eviction and reuse decisions.
|
||||||
|
- Treat all Debug material as Logs. A separate debug location can accommodate
|
||||||
|
retained state snapshots and larger diagnostic bundles when needed.
|
||||||
|
|
||||||
|
## Consequences
|
||||||
|
|
||||||
|
Each managed file family needs an identified role, owner, scope, and retention
|
||||||
|
rule. Subprocess bundles require classification before their contents are
|
||||||
|
placed in Narratio's output and diagnostic directories.
|
||||||
|
|
||||||
|
The [workspace reference](../operations.md#local-state-layout) defines the selected
|
||||||
|
physical layout, latest-attempt views, retention boundaries, and new-session cutover.
|
||||||
|
Current versus historical views remain separate from content categories.
|
||||||
|
Acceptance of this policy does not establish implementation of that layout.
|
||||||
77
docs/adr/0002-assign-subprocess-content-ownership.md
Normal file
77
docs/adr/0002-assign-subprocess-content-ownership.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# 0002. Assign subprocess content ownership
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Accepted
|
||||||
|
|
||||||
|
## Date
|
||||||
|
|
||||||
|
2026-11-29
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
[ADR 0001](0001-classify-session-content.md) defines content categories and
|
||||||
|
operator-facing directory principles. Narratio also needs an ownership boundary
|
||||||
|
for the applications it invokes. That boundary determines who selects locations,
|
||||||
|
manages retained files, and controls cleanup.
|
||||||
|
|
||||||
|
Subprocesses have their own execution state and reusable caches. Narratio
|
||||||
|
maintains its own session progress and recovery records.
|
||||||
|
|
||||||
|
## Decision
|
||||||
|
|
||||||
|
Assign responsibility by content category:
|
||||||
|
|
||||||
|
| Category | Responsibility |
|
||||||
|
| --- | --- |
|
||||||
|
| Inputs | Narratio supplies paths to prepared inputs, transcripts, and artifacts. |
|
||||||
|
| Outputs | Narratio selects destinations and promotes completed products into the output locations defined by ADR 0001. |
|
||||||
|
| Logs | Narratio selects stage-based destinations and captures subprocess output streams. |
|
||||||
|
| Debug | Narratio selects the destination when capture is enabled; the subprocess defines the diagnostic contents. |
|
||||||
|
| Subprocess State | Each application manages its working directory, temporary files, and execution lifecycle through its own configuration and defaults. |
|
||||||
|
| Subprocess Cache | Each application manages its configured persistent cache, including its format, identity, and reuse behavior. |
|
||||||
|
|
||||||
|
Narratio retains ownership of its own State, including the session manifest,
|
||||||
|
recovery bookkeeping, and staging files it manages.
|
||||||
|
|
||||||
|
Recommend a dedicated cache root for each cache-aware application, configurable
|
||||||
|
through that application's supported controls. For system-wide deployments,
|
||||||
|
`/var/cache/<application>` is a suggested location; `/var/cache/notarius` is an
|
||||||
|
example for Notarius. Each application defines its cache configuration, defaults,
|
||||||
|
and internal layout. Operators select locations and retention settings through
|
||||||
|
those controls. Narratio's session cleanup leaves subprocess caches under their
|
||||||
|
separate lifecycle policies.
|
||||||
|
|
||||||
|
Subprocesses retain ownership of their file formats and bundle structures.
|
||||||
|
Narratio can receive a complete result bundle at a selected staging destination
|
||||||
|
and promote the selected products into its canonical output directories.
|
||||||
|
Diagnostic snapshots of subprocess State follow the Debug destination selected
|
||||||
|
by Narratio.
|
||||||
|
|
||||||
|
Narratio's `runs/` directory can hold staging outputs and retained execution
|
||||||
|
evidence. Subprocess working directories follow the application's configuration
|
||||||
|
and may reside elsewhere. Narratio cleanup manages Narratio-owned material;
|
||||||
|
subprocess State and Cache follow their separate lifecycle policies.
|
||||||
|
|
||||||
|
## Alternatives Considered
|
||||||
|
|
||||||
|
- Place all subprocess working files and caches inside each Narratio session.
|
||||||
|
This makes sessions easier to collect as a unit, but couples application
|
||||||
|
internals and cache retention to Narratio's session lifecycle.
|
||||||
|
- Allow subprocesses to choose output, log, and debug destinations independently.
|
||||||
|
This simplifies invocation but scatters the material operators inspect.
|
||||||
|
- Give Narratio control of downstream bundle formats. This simplifies some
|
||||||
|
destination mappings but increases integration coupling. Selecting and
|
||||||
|
promoting products preserves application ownership of those formats.
|
||||||
|
|
||||||
|
## Consequences
|
||||||
|
|
||||||
|
Adapters need supported controls for Narratio-selected output, log, and debug
|
||||||
|
locations. Upstream changes may be needed where those destinations are coupled
|
||||||
|
to application working directories or to one another.
|
||||||
|
|
||||||
|
Workspace layout and file classification remain independent of subprocess
|
||||||
|
working-directory conventions. The
|
||||||
|
[workspace reference](../operations.md#local-state-layout) defines debug
|
||||||
|
placement, retained diagnostic views, and the new-session cutover.
|
||||||
|
Acceptance of this policy does not establish implementation of those changes.
|
||||||
38
docs/adr/0003-assign-configuration-ownership.md
Normal file
38
docs/adr/0003-assign-configuration-ownership.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# 0003. Assign configuration ownership
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Accepted
|
||||||
|
|
||||||
|
## Date
|
||||||
|
|
||||||
|
2026-11-19
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
Configuration loading, inspection, and domain execution need explicit ownership
|
||||||
|
so that effective configuration has one authority.
|
||||||
|
|
||||||
|
## Decision
|
||||||
|
|
||||||
|
- **ConfigKit owns configuration policy and resolution through the final
|
||||||
|
handoff.** Narratio supplies its schema, defaults, and configuration rules
|
||||||
|
through ConfigKit's supported extension points. The completed ConfigKit
|
||||||
|
result is authoritative.
|
||||||
|
- **Narratio owns domain interpretation and execution.** It consumes the
|
||||||
|
completed configuration without mutation and produces separate domain
|
||||||
|
objects. It must not construct a replacement effective configuration.
|
||||||
|
- **CommandKit owns CLI mechanics and presentation; `ckconfig` exposes
|
||||||
|
ConfigKit's inspection features.** Narratio supplies selection and acquisition
|
||||||
|
wiring and exposes those features through native adapters, without altering
|
||||||
|
their semantics or substituting its own inspection views.
|
||||||
|
|
||||||
|
## Alternatives Considered
|
||||||
|
|
||||||
|
Post-handoff configuration resolution and custom inspection projections are
|
||||||
|
rejected because they create competing configuration authorities.
|
||||||
|
|
||||||
|
## Consequences
|
||||||
|
|
||||||
|
Domain catalogs and plans remain separate from native configuration inspection.
|
||||||
|
Missing configuration or inspection capabilities are addressed upstream.
|
||||||
811
docs/cli.md
811
docs/cli.md
@@ -1,485 +1,454 @@
|
|||||||
# CLI Reference
|
# CLI Reference
|
||||||
|
|
||||||
## Shortest Useful Command
|
## Command tree
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run 2026-04-04
|
|
||||||
```
|
|
||||||
|
|
||||||
This runs the canonical full pipeline for session `2026-04-04`.
|
|
||||||
|
|
||||||
## Command Overview
|
|
||||||
|
|
||||||
Top-level commands:
|
|
||||||
|
|
||||||
- `version`: print the Narratio build version.
|
|
||||||
- `run <session_id>`: run all or one contiguous range of the canonical stage order.
|
|
||||||
- `regenerate-artifacts <session_id>`: force-run extraction through analysis.
|
|
||||||
- `run-stage <stage> <session_id>`: run one stage.
|
|
||||||
- `analyze <session_id>`: force-run analyze.
|
|
||||||
- `publish <session_id>`: force-run publish.
|
|
||||||
- `clean <session_id>` or `clean --all`: remove local work/spool state.
|
|
||||||
- `session <subcommand>`: session helper commands.
|
|
||||||
- `config <subcommand>`: validate, display, source-trace, catalog, or compare resolved pipeline configuration.
|
|
||||||
|
|
||||||
Session subcommands:
|
|
||||||
|
|
||||||
- `session init <session_id>`
|
|
||||||
- `session plan <session_id>`
|
|
||||||
- `session validate <session_id>`
|
|
||||||
- `session status <session_id>`
|
|
||||||
- `session restore <session_id>`
|
|
||||||
- `session artifacts <session_id>`
|
|
||||||
- `session locks <session_id>`
|
|
||||||
- `session locks add <session_id> <source>`
|
|
||||||
- `session locks remove <session_id> <source>`
|
|
||||||
|
|
||||||
## Common Config Flags
|
|
||||||
|
|
||||||
Most session-aware commands accept:
|
|
||||||
|
|
||||||
- `--config <pipeline.yml>`
|
|
||||||
- `--campaign <id>`
|
|
||||||
- `--campaign-file <campaign.yml>`
|
|
||||||
- `--session <session.yml>`
|
|
||||||
- `--session-id <session_id>`
|
|
||||||
- `--previous-session-id <session_id>`
|
|
||||||
- `--overlay <name>`
|
|
||||||
- `--secrets-dir <directory>`
|
|
||||||
|
|
||||||
Rules:
|
|
||||||
|
|
||||||
- `--campaign` and `--campaign-file` are mutually exclusive.
|
|
||||||
- `--session` is not used by `session init`.
|
|
||||||
- if both positional `<session_id>` and `--session-id` are provided, values must match.
|
|
||||||
- `--previous-session-id` is a strict expectation: the selected session file
|
|
||||||
must contain the same `previous_session_id`.
|
|
||||||
- `--overlay` selects `overlays/<name>.yml` relative to the pipeline root. It
|
|
||||||
may be supplied once; omitted, empty, and the exact name `default` select the
|
|
||||||
base configuration, while an unknown named overlay fails. The same selection
|
|
||||||
applies to all common-flag commands, including `regenerate-artifacts`.
|
|
||||||
- `--secrets-dir` selects ConfigKit credential-file bootstrap explicitly. A
|
|
||||||
relative value uses caller CWD. Without the flag, a present `secrets/`
|
|
||||||
directory beside the resolved root pipeline is used; an absent one is skipped.
|
|
||||||
- `clean --all` cannot be combined with campaign/session selectors.
|
|
||||||
- notification delivery is currently limited to the configured `noop` mode; see
|
|
||||||
the [configuration reference](./config.md#notifications).
|
|
||||||
|
|
||||||
## Session ID Input Rules
|
|
||||||
|
|
||||||
Session-aware commands accept one of these forms:
|
|
||||||
|
|
||||||
- positional session ID: `... <session_id>`
|
|
||||||
- compatibility flag: `... --session-id <session_id>`
|
|
||||||
|
|
||||||
When both are present, command parsing requires an exact match.
|
|
||||||
|
|
||||||
Commands with additional positionals keep their command-specific order:
|
|
||||||
|
|
||||||
- `run-stage <stage> <session_id>` or `run-stage <stage> --session-id <session_id>`
|
|
||||||
- `session locks add <session_id> <source>` or `session locks add --session-id <session_id> <source>`
|
|
||||||
- `session locks remove <session_id> <source>` or `session locks remove --session-id <session_id> <source>`
|
|
||||||
|
|
||||||
## Command Reference
|
|
||||||
|
|
||||||
### `config validate`, `config show`, `config sources`, `config artifacts`, and `config diff`
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio config validate [--config <pipeline.yml>] [--campaign <id> | --campaign-file <campaign.yml>] [--overlay <name>] [--secrets-dir <directory>]
|
|
||||||
narratio config show [--config <pipeline.yml>] [--campaign <id> | --campaign-file <campaign.yml>] [--overlay <name>] [--secrets-dir <directory>]
|
|
||||||
narratio config sources [--config <pipeline.yml>] [--campaign <id> | --campaign-file <campaign.yml>] [--overlay <name>] [--secrets-dir <directory>]
|
|
||||||
narratio config artifacts [--config <pipeline.yml>] [--campaign <id> | --campaign-file <campaign.yml>] [--overlay <name>] [--secrets-dir <directory>]
|
|
||||||
narratio config diff <left-overlay> <right-overlay> [--config <pipeline.yml>] [--campaign <id> | --campaign-file <campaign.yml>] [--secrets-dir <directory>]
|
|
||||||
```
|
|
||||||
|
|
||||||
These commands resolve the selected overlay, defaults, ordinary paths, and—if
|
|
||||||
a campaign is selected—the campaign-owned party. They neither discover or load
|
|
||||||
a session nor create a workspace, manifest, run, lock, adapter, or remote
|
|
||||||
connection. Like every pipeline-loading command, they bootstrap the selected or
|
|
||||||
conventional secrets directory before resolving configuration; `config show`
|
|
||||||
never includes bootstrap reports or secret values in its YAML output.
|
|
||||||
Typed credential references, including `notarius.credentials[]`, must therefore
|
|
||||||
resolve even though these inspection commands never construct an adapter.
|
|
||||||
|
|
||||||
Campaign selection is optional for a pipeline without party-driven artifact
|
|
||||||
families. A pipeline with `scriptorium.artifact_families` needs a selected or
|
|
||||||
configured default campaign so Narratio can expand its concrete artifacts and
|
|
||||||
publish rules. `--campaign` and `--campaign-file` remain mutually exclusive.
|
|
||||||
Session, range, force, and artifact-execution flags are not accepted.
|
|
||||||
|
|
||||||
`config validate` writes a concise root-path, selected-overlay (or `none`), and
|
|
||||||
effective-digest summary after successful complete validation. `config show`
|
|
||||||
writes one deterministic, secret-free YAML document containing defaulted and
|
|
||||||
expanded concrete configuration. It omits ConfigKit directives, artifact
|
|
||||||
family declarations, and runtime provenance.
|
|
||||||
|
|
||||||
`config sources` reports the same fully validated resolution without printing
|
|
||||||
effective values. Its header identifies the root, ordered imports, selected
|
|
||||||
overlay and its file, selected campaign, party source, and digest. The
|
|
||||||
remaining tab-separated records are sorted as `path`, `role`, and `source`.
|
|
||||||
Roles distinguish root, import, overlay, centralized default, campaign, party,
|
|
||||||
and generated family ownership. A generated party member has
|
|
||||||
one family record and one party record at the same logical path. The output
|
|
||||||
never reads or prints secret values.
|
|
||||||
|
|
||||||
`config artifacts` prints the concrete catalog used by analysis, ordered by
|
|
||||||
artifact key. Its tab-separated header is `key`, `source`, `definitions`,
|
|
||||||
`enabled`, `output`, `dependencies`, `family`, `character`, `family_source`, and
|
|
||||||
`party_source`. Definitions and effective dependencies are sorted comma-separated
|
|
||||||
lists, and control characters in fields are escaped. Family-member rows identify
|
|
||||||
their family, character, defining family file, and party file. An empty catalog
|
|
||||||
prints only the header. Ordinary artifacts can be inspected without a campaign;
|
|
||||||
party-driven families retain the campaign requirement. See
|
|
||||||
[Scriptorium Artifact Entries](./config.md#scriptorium-artifact-entries) for the
|
|
||||||
configuration layout.
|
|
||||||
|
|
||||||
`config diff` resolves both supplied overlay names independently and compares
|
|
||||||
their fully resolved, secret-free effective mappings. It does
|
|
||||||
not accept `--overlay`; the two positional names must be distinct, valid
|
|
||||||
overlays. When party-driven families are present, both overlays must resolve to
|
|
||||||
the same selected campaign and party. Use `--campaign-file` if overlay-specific
|
|
||||||
campaign configuration would otherwise select different files.
|
|
||||||
|
|
||||||
Equal overlays print `no differences`. Otherwise, sorted tab-separated records
|
|
||||||
use one of these forms, with compact JSON values:
|
|
||||||
|
|
||||||
```text
|
```text
|
||||||
added <path> <right-value>
|
narratio
|
||||||
removed <path> <left-value>
|
├── run SESSION
|
||||||
changed <path> <left-value> <right-value>
|
├── preflight SESSION
|
||||||
|
├── artifacts
|
||||||
|
│ ├── list
|
||||||
|
│ └── regenerate SESSION
|
||||||
|
├── session
|
||||||
|
│ ├── init SESSION
|
||||||
|
│ ├── plan SESSION
|
||||||
|
│ ├── status SESSION
|
||||||
|
│ ├── restore SESSION
|
||||||
|
│ ├── clean [SESSION | --all]
|
||||||
|
│ ├── artifacts SESSION
|
||||||
|
│ └── locks
|
||||||
|
│ ├── list SESSION
|
||||||
|
│ ├── add SESSION SOURCE
|
||||||
|
│ └── remove SESSION SOURCE
|
||||||
|
├── config
|
||||||
|
│ ├── scopes
|
||||||
|
│ ├── validate
|
||||||
|
│ ├── show
|
||||||
|
│ ├── sources
|
||||||
|
│ ├── explain
|
||||||
|
│ └── diff
|
||||||
|
├── version
|
||||||
|
├── completion bash|zsh|fish
|
||||||
|
└── help [COMMAND...]
|
||||||
```
|
```
|
||||||
|
|
||||||
Mappings are flattened to their logical field paths; lists remain one atomic
|
Bare root and command groups display help. Use `narratio help session plan`
|
||||||
value. The command compares defaulted concrete artifacts and publish rules, not
|
or `narratio session plan --help` for command-local flags and operands. Help,
|
||||||
overlay names, source-file layout, or formatting. It succeeds when differences
|
version, completion, and `config scopes` do not bootstrap credentials, load
|
||||||
are found, making it suitable for review and migration checks.
|
configuration, contact storage, or initialize adapters.
|
||||||
|
|
||||||
### `version`
|
## Invocation syntax
|
||||||
|
|
||||||
```bash
|
Place flags after the complete command path; they may be interspersed with
|
||||||
narratio version
|
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
|
||||||
|
|
||||||
|
| Selector | Meaning |
|
||||||
|
| --- | --- |
|
||||||
|
| `--config PATH` | Exact pipeline root, regardless of configuration scope; omission uses discovery. |
|
||||||
|
| `--overlay NAME` | Pipeline overlay; omitted, empty, or `default` selects the base. |
|
||||||
|
| `--campaign ID` | Select and assert the effective campaign identity. |
|
||||||
|
| `--campaign-file PATH` | Exact campaign source; may accompany its identity assertion. |
|
||||||
|
| `--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. |
|
||||||
|
| `--previous-session-id ID` | Assert the configured previous-session identity on applicable domain commands. |
|
||||||
|
|
||||||
|
Explicit relative file/directory paths use the invocation directory. Explicit
|
||||||
|
file errors and identity mismatches fail without fallback. A file selects the
|
||||||
|
source; an identity asserts its effective ID after resolution. File-only
|
||||||
|
configuration inspection may obtain identity from the file. Selecting a party
|
||||||
|
file does not rewrite the campaign's party setting; the selected roster feeds
|
||||||
|
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
|
||||||
|
selection and rejects campaign, session, party, and previous-session selectors.
|
||||||
|
|
||||||
|
When no explicit session file is selected, local discovery precedes remote
|
||||||
|
acquisition. Only local absence permits remote fallback, with a known identity.
|
||||||
|
Remote loading prefers authored session-root YAML, then the current commit's
|
||||||
|
prepared snapshot only when the authored object is absent. Read-only commands
|
||||||
|
may perform these reads without initializing runtime state. See
|
||||||
|
[discovery](config.md#discovery-and-selection) and
|
||||||
|
[credential bootstrap](config.md#secrets-handling) for configuration details.
|
||||||
|
|
||||||
|
## Run
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio run SESSION
|
||||||
|
narratio run SESSION --from extract --through analyze
|
||||||
|
narratio run SESSION --stage analyze --force --artifacts session_recap
|
||||||
```
|
```
|
||||||
|
|
||||||
Official release binaries report their exact Git tag. Binaries built directly
|
The default is the full canonical pipeline:
|
||||||
from source without release linker metadata report `dev`.
|
`prepare`, `transcribe`, `merge`, `polish`, `normalize`, `trim`, `render`,
|
||||||
|
`extract`, `analyze`, `publish`, `notify`, `cleanup`.
|
||||||
|
`--from` and `--through` select inclusive contiguous bounds. `--stage` selects
|
||||||
|
one stage and cannot accompany explicitly supplied range flags. `--force`
|
||||||
|
reruns selected work; dependent invalidation can extend beyond that range.
|
||||||
|
Bounded starts use valid preceding state or an imported-product baseline.
|
||||||
|
In an imported workspace, selected consumers require their actual inputs;
|
||||||
|
unrelated producer-stage history is unnecessary. Narratio prepares required
|
||||||
|
references before downstream checks. Ordinary execution uses
|
||||||
|
semantic resume checks rather than rerunning all selected work.
|
||||||
|
|
||||||
### `run`
|
After preparation, `run` checks projected Audita, Notarius, and Scriptorium work before
|
||||||
|
processing continues. Failed checks stop the invocation; prompt warnings alone
|
||||||
|
do not. `artifacts regenerate` uses the same check.
|
||||||
|
See [operations](operations.md#prompt-requirements-preflight) for recovery.
|
||||||
|
|
||||||
```bash
|
Analysis-only rebuilding uses `run SESSION --stage analyze --force`; it does
|
||||||
narratio run <session_id> [--from <stage>] [--through <stage>] [--force] [--artifacts <name[,name...]>] [...common config flags]
|
not refresh extraction. Publishing alone uses `run SESSION --stage publish`,
|
||||||
|
adding `--force` when a rerun is intended. It does not schedule cleanup. See
|
||||||
|
[operations](operations.md#artifact-development-workflows) for regeneration workflows.
|
||||||
|
|
||||||
|
## Artifacts regenerate
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio artifacts regenerate SESSION
|
||||||
|
narratio artifacts regenerate SESSION --artifacts session_recap,player_handout
|
||||||
```
|
```
|
||||||
|
|
||||||
Behavior:
|
Forces the fixed inclusive `extract` through `analyze` range. It refreshes the
|
||||||
|
whole configured Notarius extraction bundle and chunk work, then selected
|
||||||
|
analysis targets and required prerequisites. `--artifacts` narrows analysis,
|
||||||
|
not extraction lanes. Publication, notification, and cleanup are outside this
|
||||||
|
range. Independent `--from`, `--through`, `--stage`, and `--force` flags are
|
||||||
|
not installed on this command. It accepts applicable context selectors and
|
||||||
|
returns the same run report as `run`.
|
||||||
|
|
||||||
- evaluates one inclusive contiguous range of the canonical stage order;
|
## Artifacts list
|
||||||
- defaults an omitted `--from` to `prepare` and an omitted `--through` to
|
|
||||||
`cleanup`, so omitting both retains full-pipeline behavior;
|
|
||||||
- rejects unknown endpoints and a `--from` endpoint after `--through`;
|
|
||||||
- runs `render` before `extract`; an omitted or disabled Notarius
|
|
||||||
configuration records an explicit `notarius_disabled` self-skip;
|
|
||||||
- resolves every selected typed credential during the initial configuration
|
|
||||||
load, including Notarius credentials when extract is disabled, outside the
|
|
||||||
selected range, or later skipped as resumable;
|
|
||||||
- skips already-succeeded stages unless `--force` is set or a stage-specific
|
|
||||||
resume check finds its durable result obsolete;
|
|
||||||
- applies `--force` only to stages in the selected range;
|
|
||||||
- rejects repeated `--from`, `--through`, or `--force` options, including
|
|
||||||
`--name=value` spellings;
|
|
||||||
- continues interrupted or partially completed sessions by running non-succeeded stages;
|
|
||||||
- writes the session manifest as the sole durable progress ledger. Each
|
|
||||||
invocation also creates its run-local directory and returns an immediate
|
|
||||||
command summary; neither creates another durable progress record.
|
|
||||||
- reports the resolved overlay (or `none`) and effective configuration digest.
|
|
||||||
|
|
||||||
When `--artifacts` is present, the selected range must contain `analyze` or
|
```sh
|
||||||
`publish`. Either consumer is sufficient, including a one-stage range.
|
narratio artifacts list --config pipeline.yml --campaign-file campaign.yml
|
||||||
|
|
||||||
### `regenerate-artifacts`
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio regenerate-artifacts <session_id> [--artifacts <name[,name...]>] [...common config flags]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Exactly equivalent to:
|
Lists domain definitions: source identities, producers, outputs, dependencies,
|
||||||
|
and selected-party family/member provenance. It acquires the context needed to
|
||||||
|
derive that catalog, without requiring a session solely for listing definitions.
|
||||||
|
It does not add generated members to native `config show` output.
|
||||||
|
|
||||||
```bash
|
## Session plan
|
||||||
narratio run <session_id> --force --from extract --through analyze [caller options]
|
|
||||||
|
```sh
|
||||||
|
narratio session plan SESSION --stage analyze --force --format json
|
||||||
```
|
```
|
||||||
|
|
||||||
The command always reruns extraction. Analysis rebuilds the selected configured
|
Accepts the same stage/range, force, artifact, and context selections as `run`.
|
||||||
artifacts and any prerequisites required by those targets; without
|
Reports execution/reuse actions and reasons, analysis targets, prerequisite work,
|
||||||
`--artifacts`, it uses the normal default analysis selection. Publish and notify
|
and publication mappings through shared planners. For applicable bounded runs,
|
||||||
never run. Common session/configuration options and repeatable artifact values
|
the report also describes reference preparation and identifies unavailable
|
||||||
pass through unchanged.
|
built-in inputs. Planning reads existing state
|
||||||
|
without creating a workspace, changing manifests, acquiring execution locks, or
|
||||||
|
initializing stage-execution adapters or invoking requirements inspection. For a
|
||||||
|
selected, previously successful S3 audio preparation eligible for reuse, planning
|
||||||
|
composes object storage and reads current audio identities. An inspection failure
|
||||||
|
or insufficient identity evidence schedules preparation with an unverified-source
|
||||||
|
reason; dependent decisions reflect that projected rerun. Object-store
|
||||||
|
initialization errors fail the command. The check observes sources at planning
|
||||||
|
time and does not guarantee they remain unchanged during execution. Planning does
|
||||||
|
not predict unknown output identities.
|
||||||
|
|
||||||
The forced extraction rebuilds the complete configured Notarius bundle,
|
## Preflight
|
||||||
disables Notarius checkpoint loading, and requests chunk-plan refresh.
|
|
||||||
`--artifacts` narrows only the analysis work; it never selects Notarius lanes.
|
|
||||||
|
|
||||||
Because the expansion owns `--force`, `--from`, and `--through`, callers cannot
|
```sh
|
||||||
supply those options. The shared `run` parser reports them as duplicate
|
narratio preflight SESSION --session-file ./session.yml
|
||||||
singleton flags. The alias has no private execution options or behavior, and
|
narratio preflight SESSION --format json
|
||||||
runtime diagnostics may identify the operation as `run`.
|
|
||||||
|
|
||||||
### `run-stage`
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run-stage <stage> <session_id> [--force] [--artifacts <name[,name...]>] [...common config flags]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Valid stage names:
|
Preflight resolves the same session and configuration selectors as `run`,
|
||||||
|
prepares or reuses inputs, and checks enabled downstream capabilities and
|
||||||
|
prompt prerequisites even when their processing outputs are reusable. It may
|
||||||
|
create a workspace, download inputs, update the manifest, and contact providers.
|
||||||
|
It stops before processing and publication. Required failures or blocked
|
||||||
|
checks prevent readiness; conditional or incomplete prompt discovery can warn
|
||||||
|
without failing. Preparation remains reusable after a later readiness failure.
|
||||||
|
See [operations](operations.md#prompt-requirements-preflight) for details.
|
||||||
|
|
||||||
- `prepare`
|
## Session status
|
||||||
- `transcribe`
|
|
||||||
- `merge`
|
|
||||||
- `polish`
|
|
||||||
- `normalize`
|
|
||||||
- `trim`
|
|
||||||
- `render`
|
|
||||||
- `extract`
|
|
||||||
- `analyze`
|
|
||||||
- `publish`
|
|
||||||
- `notify`
|
|
||||||
- `cleanup`
|
|
||||||
|
|
||||||
Rules:
|
```sh
|
||||||
|
narratio session status SESSION --format json
|
||||||
- `--artifacts` is accepted only for `analyze` and `publish` stage targets.
|
|
||||||
|
|
||||||
### `analyze`
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio analyze <session_id> [--artifacts <name[,name...]>] [...common config flags]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Equivalent to:
|
Reports local manifest stages and artifacts, configuration provenance, readiness,
|
||||||
|
and remote current state when storage is available. Remote output entries retain
|
||||||
|
exact committed declarations and carried-output origins separately from current
|
||||||
|
configured destinations. An absent remote current pointer is a reported missing
|
||||||
|
state, rather than an error by itself. Genuine inspection failures can return a
|
||||||
|
partial report with a failed outcome.
|
||||||
|
|
||||||
```bash
|
## Session artifacts
|
||||||
narratio run-stage analyze <session_id> --force [...common config flags]
|
|
||||||
|
```sh
|
||||||
|
narratio session artifacts SESSION --remote
|
||||||
```
|
```
|
||||||
|
|
||||||
This selects only `analyze`: it does not invoke Notarius, replace extraction,
|
Reports definitions, dependencies, local availability/evidence, and optional
|
||||||
or remove existing extract outputs. `--artifacts` narrows the forced analysis
|
remote publication state without reading artifact payload bodies. Without
|
||||||
targets and their required analysis prerequisites.
|
`--remote`, this command avoids remote artifact inspection. Remote entries use
|
||||||
|
the selected publication inventory and current lock state.
|
||||||
|
For built-ins, `recorded` identifies producer-output or supplied-product manifest
|
||||||
|
evidence; supplied entries carry `manifest.supplied_product` provenance.
|
||||||
|
Consumer resolution performs the corresponding payload validation.
|
||||||
|
|
||||||
### `publish`
|
## Session init
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
narratio publish <session_id> [--artifacts <name[,name...]>] [...common config flags]
|
narratio session init SESSION --output ./session.yml --audio-dir ./audio
|
||||||
|
narratio session init SESSION --remote --audio-s3-prefix audio/session/
|
||||||
```
|
```
|
||||||
|
|
||||||
Equivalent to:
|
Choose exactly one destination: `--output PATH` or `--remote`. Options include
|
||||||
|
`--date YYYY-MM-DD`, `--title TEXT`, `--previous-session-id ID`, `--force`,
|
||||||
|
configuration/overlay/campaign selectors, and exactly one audio override
|
||||||
|
if needed: `--audio-dir PATH` or `--audio-s3-prefix PREFIX`.
|
||||||
|
|
||||||
```bash
|
A configured session template retains its import/resource authoring context;
|
||||||
narratio run-stage publish <session_id> --force [...common config flags]
|
relative CLI audio paths use the invocation directory. Generated YAML is
|
||||||
|
standalone and concrete. `--format` changes only the confirmation report,
|
||||||
|
never the generated YAML file. See [initialization](operations.md#session-initialization).
|
||||||
|
|
||||||
|
## Session restore
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio session restore SESSION --dry-run
|
||||||
|
narratio session restore SESSION --force --include-audio
|
||||||
```
|
```
|
||||||
|
|
||||||
This command selects only `publish`; it does not invoke cleanup. Use a normal
|
Imports products from the pointer-selected publication and returns actions,
|
||||||
full run to include configured cleanup, or `run-stage cleanup` to retry cleanup
|
conflicts, and projected work. Dry runs make no local directory or
|
||||||
from valid publication evidence.
|
mode changes. Actual restore merges verified products with local progress under
|
||||||
|
the workspace lock and saves the local manifest last. `--force` permits
|
||||||
|
replacement only of eligible regular files; it does not force pipeline work.
|
||||||
|
Interrupted imports retain a recovery marker. Remote execution-checkpoint
|
||||||
|
recovery is deferred. See [restore operations](operations.md#restore-workflow).
|
||||||
|
|
||||||
### `clean`
|
## Session clean
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
narratio clean <session_id> [--dry-run] [--clear-cache] [...common config flags]
|
narratio session clean SESSION --dry-run
|
||||||
narratio clean --all [--dry-run] [--clear-cache] [--config <pipeline.yml>]
|
narratio session clean --all --dry-run
|
||||||
```
|
```
|
||||||
|
|
||||||
Behavior:
|
Choose positional `SESSION` or `--all`. Removes the selected local workspace
|
||||||
|
state. Dry runs return planned
|
||||||
|
actions without deletion. Partial failures retain completed actions. This manual
|
||||||
|
operation is separate from the pipeline cleanup stage. Exact scope and recovery
|
||||||
|
implications belong in [cleanup operations](operations.md#cleanup).
|
||||||
|
|
||||||
- session mode removes the selected session's local work and spool state;
|
## Session locks
|
||||||
- `--all` removes all local session work and spool state;
|
|
||||||
- cache remains unless `--clear-cache` is provided.
|
|
||||||
|
|
||||||
See [Operations: Cleanup](./operations.md#cleanup) for manual and pipeline-stage
|
```sh
|
||||||
deletion scope.
|
narratio session locks list SESSION
|
||||||
|
narratio session locks add SESSION narratio.artifact.session_recap --reason 'manual review'
|
||||||
### `session plan`
|
narratio session locks remove SESSION narratio.artifact.session_recap
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio session plan <session_id> [--from <stage>] [--through <stage>] [--force] [--artifacts <name[,name...]>] [...common config flags]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Uses the same inclusive bounds, endpoint validation, force scope, and artifact
|
A bare locks group displays help. List reports independent remote locks sorted
|
||||||
selection contract as `run`. It validates config and prints run/skip decisions
|
by source. Add reports an existing lock unless `--force` requests one
|
||||||
for selected stages only without creating the local workdir or changing the
|
conditional, generation-matched replacement; concurrent change requires retry.
|
||||||
manifest. Resume-capable selected stages are checked against durable evidence.
|
Remove is idempotent. `--reason TEXT` is available on add. See
|
||||||
The output includes the resolved overlay (or `none`) and effective configuration
|
[publish locks](operations.md#publish-locks) for their publication effect.
|
||||||
digest without writing provenance or any manifest state.
|
|
||||||
For `analyze`, the preview also lists explicit targets, prerequisite-only work,
|
|
||||||
execution order, and reusable current artifacts with concise reasons. These
|
|
||||||
artifact decisions come from the same reconciliation and work planner used by
|
|
||||||
execution; the preview does not predict output identities.
|
|
||||||
|
|
||||||
### `session validate`
|
## `--artifacts` selection rules
|
||||||
|
|
||||||
```bash
|
`run`, `session plan`, and `artifacts regenerate` accept repeatable
|
||||||
narratio session validate <session_id> [...common config flags]
|
`--artifacts NAME[,NAME...]`. Values are trimmed, deduplicated, and sorted.
|
||||||
|
Family keys select all concrete members; concrete keys select one member.
|
||||||
|
Analysis includes required prerequisite closure. Publication selects applicable
|
||||||
|
configured artifact outputs. The option requires a selected analysis or publish
|
||||||
|
consumer and does not select built-in output sources or individual extraction
|
||||||
|
lanes. See [artifact configuration](config.md#scriptorium-artifact-families).
|
||||||
|
|
||||||
|
## Configuration inspection
|
||||||
|
|
||||||
|
`config scopes` lists operations and features without loading. The four scopes
|
||||||
|
are `app` (default), `campaign`, `session`, and `party`. They expose their actual
|
||||||
|
typed ConfigKit results, with native provenance, resolution history, and safe
|
||||||
|
secret views. App inspection needs no campaign/party expansion. Domain catalogs
|
||||||
|
and execution plans are separate views.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio config show --scope app --format json
|
||||||
|
narratio config show --scope session --session SESSION --session-file ./session.yml
|
||||||
|
narratio config show --scope party --party-file ./party.yml
|
||||||
|
narratio config show --path /scriptorium --format yaml
|
||||||
|
narratio config sources --scope campaign --campaign-file ./campaign.yml
|
||||||
|
narratio config explain --path /scriptorium --format json
|
||||||
|
narratio config explain --list --under /scriptorium --historical
|
||||||
|
narratio config validate --details --severity error
|
||||||
```
|
```
|
||||||
|
|
||||||
Read-only preflight checks for config validity, required inputs, audio mode,
|
Use native show, sources, explain, and validation operations; their options,
|
||||||
previous-session requirements, publish outputs, and independent remote locks.
|
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.
|
||||||
|
|
||||||
### `session status`
|
### Independent comparisons and overrides
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
narratio session status <session_id> [...common config flags]
|
narratio config diff --config pipeline.yml --against-config pipeline.yml --against-overlay testing --details --check
|
||||||
|
narratio config diff --scope party --party-file before.yml --against-party-file after.yml
|
||||||
|
narratio config show --scope app --set '/whisperx/concurrency=2'
|
||||||
```
|
```
|
||||||
|
|
||||||
Prints local manifest state and, when storage is available, status for the
|
Diff loads each side independently. In addition to native `--against-config`
|
||||||
pointer-selected remote commit and its declared published outputs. Current
|
and `--against-overlay`, applicable scopes accept `--against-campaign`,
|
||||||
publish metadata reports `published`, `carried_locked`, `locked_unpublished`,
|
`--against-campaign-file`, `--against-session`, `--against-session-file`, and
|
||||||
`optional_missing`, and `unselected`; carried output lines include the run
|
`--against-party-file`. Omitted right-side selectors use their own normal
|
||||||
derived from their exact declared key, the key itself, and its declared
|
defaults; they never inherit left-side selections. Each party default follows
|
||||||
destination. A separately displayed `dest` is the destination requested by the
|
that side's campaign.
|
||||||
current configuration and may differ while an older declaration is locked.
|
|
||||||
|
|
||||||
### `session init`
|
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.
|
||||||
|
|
||||||
```bash
|
Only app inspection supports ordered, repeatable `--set POINTER=JSON`, plus
|
||||||
narratio session init <session_id> --output ./session.yml [options]
|
`--against-set POINTER=JSON` for the comparison side. ConfigKit applies these
|
||||||
narratio session init <session_id> --remote [options]
|
during that load. They affect only that invocation. Other scopes and aggregate
|
||||||
|
inspection reject overrides. Execution/planning use files and overlays;
|
||||||
|
they have no field-override flags.
|
||||||
|
|
||||||
|
## Reporting and visibility
|
||||||
|
|
||||||
|
Reports go to stdout; diagnostics and progress go to stderr. Domain commands
|
||||||
|
return one final public report where useful, including meaningful partial work
|
||||||
|
on failure. `--format text|yaml|json` selects presentation. Automatic structured
|
||||||
|
reports use YAML; text uses the same data. Version and native inspection commands
|
||||||
|
may have native text renderers. Report format does not change artifact formats.
|
||||||
|
There is no public report schema-version field.
|
||||||
|
|
||||||
|
[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
|
||||||
|
selected sources, destinations, and decision context. Concurrent completion
|
||||||
|
order is not fixed. Workers settle before the final report.
|
||||||
|
|
||||||
|
Console debug does not enable downstream debug captures or change retention.
|
||||||
|
Downstream streams stay in captured logs and are not replayed automatically.
|
||||||
|
Quiet changes visibility, not execution, persistence, or logging. A report or
|
||||||
|
diagnostic delivery failure can fail the invocation after durable work has
|
||||||
|
completed; it does not roll back that work.
|
||||||
|
|
||||||
|
### Public domain report fields
|
||||||
|
|
||||||
|
Optional fields appear when meaningful; these reports do not expose raw
|
||||||
|
manifests, resolved credentials, or internal dependency containers.
|
||||||
|
|
||||||
|
| Report | Fields |
|
||||||
|
| --- | --- |
|
||||||
|
| Run/regenerate | `campaign`, `session_id`, `run_id`, `stages`, `executed`, `skipped`, `stage_results`, `available_artifacts`, `artifact_targets`, `complete` |
|
||||||
|
| Plan | `campaign`, `session_id`, `stages` with `name`, `action`, `reason`, optional `analysis`; `publication_actions` |
|
||||||
|
| Catalog | `artifacts` with source, producer, output, enabled state, dependencies, optional concrete key and family/member/source provenance |
|
||||||
|
| Preflight | `campaign`, `session_id`, optional `session_source` and `run_id`, `preparation` with outcome and optional reason, `ready`, `checks` with group, outcome and optional message, `findings` with severity, category and message |
|
||||||
|
| Status/artifacts | Identities/source, `local_manifest`, `stages`, `artifacts`, optional `remote`, configuration provenance, audio/previous-artifact readiness, `findings` |
|
||||||
|
| Init | `campaign`, `session_id`, `destination`, `remote`, `written` |
|
||||||
|
| Locks | Identities, `operation`, `result`, `complete`, optional `source`, `locks` |
|
||||||
|
| Restore | Identities/run, `dry_run`, `complete`, `status`, `downloaded`, `conflicts`, `actions`, projected satisfied/remaining work |
|
||||||
|
| Clean | Optional identities, `all`, `dry_run`, `complete`, `cache`, `actions`, optional `error` |
|
||||||
|
|
||||||
|
Preflight preparation outcomes are `completed`, `reused`, `failed`, or
|
||||||
|
`not_attempted`. Check outcomes are `succeeded`, `failed`, or `blocked`;
|
||||||
|
inapplicable groups may be omitted. Findings include errors, warnings, and
|
||||||
|
information where available. Quiet mode suppresses the report and retains
|
||||||
|
failure diagnostics on stderr.
|
||||||
|
|
||||||
|
Run `stages` is the complete selection. `executed` includes attempted work,
|
||||||
|
including failures and self-skips. `skipped` includes reuse and self-skips.
|
||||||
|
Each `stage_results` entry has `name`, `attempted`, `outcome`
|
||||||
|
(`completed`, `failed`, `reused`, `skipped`, `not_attempted`), and optional
|
||||||
|
`reason`. Available artifacts carry `stage`, optional `source`, `kind`, `path`,
|
||||||
|
optional `producer_run_id`, and durable `evidence` (`stage_result`,
|
||||||
|
`speaker_checkpoint`, `artifact_checkpoint`). Failed or unpersisted work is not
|
||||||
|
reported as completed.
|
||||||
|
|
||||||
|
Plan analysis contains `targets`, `prerequisites`, `execute`, and `reuse`;
|
||||||
|
artifact entries identify key, optional family/character, role, reason, and
|
||||||
|
force. Publication actions identify source, destination, required, and selected.
|
||||||
|
Remote status outputs retain source, destination, required, state, lock state,
|
||||||
|
declared destination/key, origin run, and error. Restore
|
||||||
|
actions carry kind, optional product source, relative local path, remote key,
|
||||||
|
status, and optional reason/error.
|
||||||
|
Clean actions carry path, status (`would_delete`, `deleted`, `missing`, `empty`,
|
||||||
|
`failed`), and optional error; cache records whether it was preserved, requested,
|
||||||
|
processed, or not applicable. Lock rows include source, reason, creation time,
|
||||||
|
and whether publication is configured for that source.
|
||||||
|
|
||||||
|
## Cancellation and exit status
|
||||||
|
|
||||||
|
Ctrl-C and termination cancel acquisition and active operations. Narratio stops
|
||||||
|
scheduling work, waits for started workers, attempts terminal local manifest
|
||||||
|
persistence, and releases acquired resources. Successful checkpoints remain
|
||||||
|
resumable. Cancellation does not schedule cleanup. Abrupt process death has no
|
||||||
|
added finalization guarantee.
|
||||||
|
|
||||||
|
| Status | Meaning |
|
||||||
|
| --- | --- |
|
||||||
|
| `0` | Success, including ordinary diff with differences. |
|
||||||
|
| `1` | Operational/readiness failure, cancellation, or output failure. |
|
||||||
|
| `2` | Invalid invocation or identifiable invalid configuration input. |
|
||||||
|
| `3` | `config diff --check` found differences. |
|
||||||
|
|
||||||
|
Missing/unreadable sources and ambiguous or callback loading failures are
|
||||||
|
operational; malformed or explicitly rejected configuration input uses native
|
||||||
|
input classification. Mixed failures preserve underlying causes and operational
|
||||||
|
precedence. Terminal failure is presented once, including in quiet mode.
|
||||||
|
|
||||||
|
## Version and completion
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio version --format text
|
||||||
|
narratio version --scope commandkit --format json
|
||||||
|
source <(narratio completion bash)
|
||||||
|
source <(narratio completion zsh)
|
||||||
|
narratio completion fish | source
|
||||||
```
|
```
|
||||||
|
|
||||||
Required target selection:
|
Version text is `NAME VERSION` with an optional revision; structured identity
|
||||||
|
contains `name`, `version`, and `revision`. ReleaseKit supplies the version:
|
||||||
|
it uses an injected release identifier, then the main-module version when
|
||||||
|
available, and otherwise reports `dev`. Bash requires bash-completion
|
||||||
|
initialized; Zsh requires its completion system initialized. Native completion offers command/flag names,
|
||||||
|
static stage/scope values, and applicable file/directory hints. Dynamic campaign
|
||||||
|
and artifact completion is deferred.
|
||||||
|
|
||||||
- exactly one of:
|
## Migration from the previous CLI
|
||||||
- `--output <path>`
|
|
||||||
- `--remote`
|
|
||||||
|
|
||||||
Options:
|
Removed command paths have no compatibility aliases.
|
||||||
|
|
||||||
- `--config <pipeline.yml>`
|
| Previous invocation | Current invocation |
|
||||||
- `--campaign <id>` or `--campaign-file <campaign.yml>`
|
| --- | --- |
|
||||||
- `--secrets-dir <directory>`
|
| `session validate SESSION` | `preflight SESSION` |
|
||||||
- `--previous-session-id <id>`
|
| `run-stage STAGE SESSION` | `run SESSION --stage STAGE` |
|
||||||
- `--date <YYYY-MM-DD>`
|
| `analyze SESSION` | `run SESSION --stage analyze --force` |
|
||||||
- `--title <text>`
|
| `publish SESSION` | `run SESSION --stage publish --force` |
|
||||||
- `--audio-dir <path>`
|
| `regenerate-artifacts SESSION` | `artifacts regenerate SESSION` |
|
||||||
- `--audio-s3-prefix <prefix>`
|
| `clean SESSION` / `clean --all` | `session clean SESSION` / `session clean --all` |
|
||||||
- `--force`
|
| `config artifacts` | `artifacts list` |
|
||||||
|
| `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` |
|
||||||
|
|
||||||
Rules:
|
Unlike the former `session validate`, `preflight` prepares or reuses inputs and
|
||||||
|
can create workspace state, download inputs, and update the manifest. See
|
||||||
|
[preflight](#preflight) for its readiness-check behavior.
|
||||||
|
|
||||||
- `--audio-dir` and `--audio-s3-prefix` are mutually exclusive.
|
Campaign identity and file selectors may now accompany each other. Party-file
|
||||||
- if campaign `session_template_file` is configured, `session init` renders it.
|
selection consistently overrides the roster without editing campaign settings.
|
||||||
- generated session YAML must be concrete (no unresolved `{{ ... }}` placeholders).
|
Native configuration inspection retains declarations and their actual evidence;
|
||||||
|
use catalog/plan/session views for generated domain products. Comparison defaults
|
||||||
### `session restore`
|
are independent. Field overrides are inspection-only. Update scripts to consume
|
||||||
|
structured reports and exit classifications, place flags after the complete
|
||||||
```bash
|
command path, and account for native repetition and cancellation behavior.
|
||||||
narratio session restore <session_id> [--dry-run] [--force] [--include-audio] [...common config flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
Behavior:
|
|
||||||
|
|
||||||
- discovers committed remote current state;
|
|
||||||
- plans local restores;
|
|
||||||
- writes an execution report;
|
|
||||||
- blocks unresolved conflicts. `--force` permits replacement only of eligible
|
|
||||||
regular files.
|
|
||||||
|
|
||||||
See [Operations: Restore Workflow](./operations.md#restore-workflow) for the
|
|
||||||
default restore scope, report location, and conflict-handling workflow.
|
|
||||||
|
|
||||||
### `session artifacts`
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio session artifacts <session_id> [--remote] [...common config flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
Lists effective built-in, configured Scriptorium, and configured extraction
|
|
||||||
sources; reports planned, available, unavailable, and published state without
|
|
||||||
reading payload bodies; and includes publish rules, lock state, and optional
|
|
||||||
remote published-state availability. Remote inspection uses exact commit
|
|
||||||
declarations and displays the five current publish outcomes when recorded.
|
|
||||||
|
|
||||||
### `session locks`
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio session locks <session_id> [...common config flags]
|
|
||||||
narratio session locks add <session_id> <source> [--reason <text>] [--force] [...common config flags]
|
|
||||||
narratio session locks remove <session_id> <source> [...common config flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
Behavior:
|
|
||||||
|
|
||||||
- list mode validates and reports independent remote locks sorted by source;
|
|
||||||
- add creates one lock and reports an existing lock unless `--force` is used;
|
|
||||||
- `--force` performs one generation-matched replacement and reports a
|
|
||||||
concurrent change for operator retry; and
|
|
||||||
- remove is idempotent and reports when the source was not locked.
|
|
||||||
|
|
||||||
See [Operations: Publish Locks](./operations.md#publish-locks) for lock storage
|
|
||||||
and publication behavior.
|
|
||||||
|
|
||||||
## `--artifacts` Selection Rules
|
|
||||||
|
|
||||||
An artifact-family key selects all of its concrete character members. A
|
|
||||||
concrete generated key selects only that member; mixed family and concrete
|
|
||||||
selection is deduplicated and executed as concrete keys. The resulting plan
|
|
||||||
and command output identify both the concrete key and, where applicable, its
|
|
||||||
family and character ID.
|
|
||||||
|
|
||||||
- accepted on `run`, `session plan`, `run-stage`, `analyze`, and `publish`;
|
|
||||||
- repeatable and comma-separated values are combined, surrounding whitespace
|
|
||||||
is removed, and duplicate names are collapsed;
|
|
||||||
- names must exist in `pipeline.scriptorium.artifacts`;
|
|
||||||
- empty entries are invalid;
|
|
||||||
- on `run-stage`, only `analyze` and `publish` accept the option.
|
|
||||||
|
|
||||||
Effects:
|
|
||||||
|
|
||||||
- selects explicit analyze targets; required configured prerequisites may be
|
|
||||||
reused or rebuilt before them;
|
|
||||||
- filters publish rules that source `narratio.artifact.<name>`;
|
|
||||||
- does not filter built-in transcript/bounds or explicitly configured
|
|
||||||
`narratio.extraction.<name>` publish sources; and
|
|
||||||
- does not select or filter Notarius lanes.
|
|
||||||
|
|
||||||
## Common Workflows
|
|
||||||
|
|
||||||
Run full pipeline:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run 2026-04-04
|
|
||||||
```
|
|
||||||
|
|
||||||
Dry-run restore plan:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio session restore 2026-04-04 --dry-run
|
|
||||||
```
|
|
||||||
|
|
||||||
Generate a concrete session file from template/default structure:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio session init 2026-04-04 --output ./session.yml --date 2026-04-04 --title "Session 12"
|
|
||||||
```
|
|
||||||
|
|
||||||
Force publish only:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio publish 2026-04-04
|
|
||||||
```
|
|
||||||
|
|
||||||
Regenerate post-transcript artifacts without publishing:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio regenerate-artifacts 2026-04-04 --artifacts session_recap,player_handout
|
|
||||||
```
|
|
||||||
|
|
||||||
## Output And Exit Behavior
|
|
||||||
|
|
||||||
- Successful commands write their result or summary to standard output and
|
|
||||||
exit with status `0`.
|
|
||||||
- Command failures and invalid invocations write an error to standard error and
|
|
||||||
exit with status `1`.
|
|
||||||
- An unknown top-level command also prints the top-level usage summary to
|
|
||||||
standard error.
|
|
||||||
- `session restore --help` prints its command-specific usage and exits with
|
|
||||||
status `0`.
|
|
||||||
|
|
||||||
Output is intended for operator inspection. Narratio does not currently offer
|
|
||||||
a machine-readable CLI output mode; durable machine-readable state is recorded
|
|
||||||
in manifests and reports described in [Operations](./operations.md).
|
|
||||||
|
|||||||
548
docs/config.md
548
docs/config.md
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
Narratio resolves three YAML documents:
|
Narratio loads pipeline, campaign, and session YAML, with a canonical party
|
||||||
|
roster selected explicitly or through the campaign:
|
||||||
|
|
||||||
- `pipeline.yml`: pipeline/runtime settings
|
- `pipeline.yml`: pipeline/runtime settings
|
||||||
- `campaign.yml`: campaign identity and stable input defaults
|
- `campaign.yml`: campaign identity and stable input defaults
|
||||||
@@ -12,10 +13,20 @@ Narratio resolves three YAML documents:
|
|||||||
|
|
||||||
### `pipeline.yml`
|
### `pipeline.yml`
|
||||||
|
|
||||||
When `--config` is omitted, search order is:
|
An explicit `--config` selects exactly that file, including a custom filename.
|
||||||
|
Otherwise ConfigKit searches these locations in order:
|
||||||
|
|
||||||
1. `/usr/local/etc/narratio/pipeline.yml`
|
1. The working directory, for `narratio.yml` then `narratio.yaml`.
|
||||||
2. `/etc/narratio/pipeline.yml`
|
2. The Go user-config directory's `narratio/` subdirectory, for those named
|
||||||
|
files followed by `config.yml`, `config.yaml`, `main.yml`, and `main.yaml`.
|
||||||
|
3. The Go user-config directory itself, for the named files.
|
||||||
|
4. `/usr/local/etc/narratio/` and then `/etc/narratio/`, each for named files
|
||||||
|
followed by the generic filenames above.
|
||||||
|
5. `/etc/`, for the named files.
|
||||||
|
|
||||||
|
On Linux, the user-config directory normally follows `XDG_CONFIG_HOME`, or
|
||||||
|
`~/.config` when it is unset. A selected invalid file fails loading; discovery
|
||||||
|
does not continue to another candidate.
|
||||||
|
|
||||||
### `campaign.yml`
|
### `campaign.yml`
|
||||||
|
|
||||||
@@ -27,56 +38,52 @@ Selection rules:
|
|||||||
|
|
||||||
### `session.yml`
|
### `session.yml`
|
||||||
|
|
||||||
When `--session` is omitted, local search order is:
|
An explicit `--session-file` selects exactly that file. Otherwise local search
|
||||||
|
order is:
|
||||||
|
|
||||||
1. `/usr/local/etc/narratio/session.yml`
|
1. `/usr/local/etc/narratio/session.yml`
|
||||||
2. `/etc/narratio/session.yml`
|
2. `/etc/narratio/session.yml`
|
||||||
|
|
||||||
If local session discovery fails and a `session_id` is known, Narratio attempts remote session loading from:
|
If no local session exists and a `session_id` is known, Narratio loads the
|
||||||
|
session from configured object storage. Downloaded session bytes are contextless
|
||||||
|
snapshots, with remote object
|
||||||
|
provenance retained independently of locally materialized checksums.
|
||||||
|
|
||||||
- `{root_prefix}/campaigns/{campaign}/sessions/{session_id}/session.yml`
|
Remote loading prefers an authored session-root `session.yml`, including updates
|
||||||
|
from `session init --remote --force`. When that object is absent, loading falls
|
||||||
|
back to the current commit's standalone prepared session. Published snapshots
|
||||||
|
remain immutable; restore validates the pointer-selected committed state.
|
||||||
|
|
||||||
using configured object storage.
|
### Native inspection and domain derivation
|
||||||
|
|
||||||
The downloaded remote session file is command-scoped: Narratio removes it after
|
Native configuration inspection exposes four actual typed ConfigKit results:
|
||||||
the command finishes and records only the remote object provenance alongside
|
app (the default pipeline scope), campaign, session, and party. Defaults,
|
||||||
the durable copied session input.
|
normalization, and configuration-owned validation finish within their supported
|
||||||
|
load lifecycle. Session configuration includes applicable campaign defaults
|
||||||
|
before handoff. Completed values remain unchanged by planning or execution.
|
||||||
|
|
||||||
### Read-only effective pipeline inspection
|
App inspection retains artifact-family declarations and needs no campaign or
|
||||||
|
party solely for expansion. Narratio derives concrete artifact catalogs, players,
|
||||||
|
resolved dependencies, and publication actions separately using the selected
|
||||||
|
canonical roster. `artifacts list` inspects those domain definitions;
|
||||||
|
`session plan` and `session artifacts` expose decisions and availability.
|
||||||
|
|
||||||
`narratio config validate`, `narratio config show`, `narratio config sources`,
|
Native sources/explanations retain actual imports, origins, history, and recorded
|
||||||
and `narratio config artifacts` use the same `--config`, `--campaign`,
|
resolution evidence. Comparisons load each side independently using its own
|
||||||
`--campaign-file`, and
|
normal defaults. App-only inspection overrides apply during that invocation's
|
||||||
`--overlay` selection rules as pipeline commands, but do not select, discover,
|
load. Safe views hide resolved credentials. Persisted preparation projections
|
||||||
or load a session. They resolve configured typed credential references as part
|
retain reference names and do not replace the native inspection result.
|
||||||
of the ordinary ConfigKit load but expose only their environment-variable names;
|
See the [CLI reference](cli.md#configuration-inspection) for scopes, selectors,
|
||||||
they do not create runtime state.
|
path operations, overrides, comparison modes, and report shapes.
|
||||||
`narratio config diff <left-overlay> <right-overlay>` uses the same pipeline and
|
|
||||||
campaign selectors, resolves each named overlay with an independent ConfigKit
|
|
||||||
load, and does not accept a separate `--overlay` flag.
|
|
||||||
|
|
||||||
Campaign selection is optional only when the resolved pipeline has no
|
### Party selection
|
||||||
`scriptorium.artifact_families`. When families are declared, Narratio selects a
|
|
||||||
campaign through an explicit flag or `pipeline.campaigns.default_campaign_id`,
|
|
||||||
then parses the campaign-owned party and expands concrete artifacts and any
|
|
||||||
family publish rules before validation. `config validate` prints the resulting
|
|
||||||
root, overlay, and effective digest. `config show` emits the normalized
|
|
||||||
effective pipeline YAML, with defaults and concrete expansion included but
|
|
||||||
ConfigKit directives and family declarations omitted. This review projection is
|
|
||||||
not promised to be a reloadable authoring document. `config sources` prints a stable
|
|
||||||
source projection instead of effective values: root/import/overlay/default
|
|
||||||
ownership plus campaign/party and generated-family records. Canonical derived
|
|
||||||
players trace to the party. `config artifacts` lists the concrete artifact map,
|
|
||||||
effective dependencies, and defining sources. The [CLI reference](cli.md#config-validate-config-show-config-sources-config-artifacts-and-config-diff)
|
|
||||||
owns command syntax and output conventions.
|
|
||||||
|
|
||||||
`config diff` compares normalized field values rather than YAML text or source
|
`--party-file` selects an exact canonical roster instead of the campaign-default
|
||||||
ownership. It emits sorted `added`, `removed`, and `changed` records, uses
|
file. Explicit relative paths use the invocation directory; invalid or missing
|
||||||
compact deterministic JSON values, treats lists atomically, and reports `no
|
explicit input fails without fallback. The campaign's configured party field
|
||||||
differences` when the complete effective configurations are equal. Concrete
|
remains unchanged. Inspection, players, family derivation, planning, and execution
|
||||||
family members and generated publish rules participate after expansion; moving
|
use the same selected roster. Format and validation belong in the
|
||||||
an equal value between eligible root/import sources does not create a
|
[party integration contract](integrations/party.md).
|
||||||
difference.
|
|
||||||
|
|
||||||
### Migrating to the maintained bundle
|
### Migrating to the maintained bundle
|
||||||
|
|
||||||
@@ -87,7 +94,8 @@ in the fixed `overlays/testing.yml` overlay. Put ordinary artifacts and families
|
|||||||
in the recommended one-definition files shown by that bundle. Convert campaign
|
in the recommended one-definition files shown by that bundle. Convert campaign
|
||||||
rosters to [canonical party input](integrations/party.md), then express character
|
rosters to [canonical party input](integrations/party.md), then express character
|
||||||
work as families. Inspect the result with `config validate`, `config show`,
|
work as families. Inspect the result with `config validate`, `config show`,
|
||||||
`config sources`, and `config artifacts`; use `config diff default testing` to
|
`config sources`, and `artifacts list`; use
|
||||||
|
`config diff --against-overlay testing` to
|
||||||
review the overlay before running a session. Unversioned party documents are
|
review the overlay before running a session. Unversioned party documents are
|
||||||
rejected.
|
rejected.
|
||||||
|
|
||||||
@@ -102,25 +110,13 @@ remote state with an unsafe legacy identity must be migrated before use.
|
|||||||
|
|
||||||
## Validation and Merge Rules
|
## Validation and Merge Rules
|
||||||
|
|
||||||
- ConfigKit performs strict typed YAML decoding and accepts exactly one document;
|
- Local pipeline, campaign, session, and party documents may declare native
|
||||||
unknown fields, duplicate keys, and trailing documents fail load.
|
imports and sibling inheritance. Only the pipeline selects an overlay.
|
||||||
- A pipeline file may explicitly import additive YAML fragments through the
|
- An omitted overlay, empty overlay option, and exact `default` select the base;
|
||||||
root-only `configkit.imports` list. Imported files contribute fields to one
|
another name selects `overlays/<name>.yml` relative to the pipeline root.
|
||||||
logical pipeline document; they do not override fields supplied by the root
|
|
||||||
or another import.
|
|
||||||
- An omitted overlay, an empty overlay option, and the exact name `default`
|
|
||||||
select the base configuration. Any other name selects
|
|
||||||
`overlays/<name>.yml` relative to the pipeline root. Move previously selected
|
|
||||||
`profiles/<name>.yml` files there; the old directory is not searched, and
|
|
||||||
`--profile` is no longer accepted for Narratio pipeline selection. Explicit
|
|
||||||
imports from a directory named `profiles` remain valid.
|
|
||||||
- Campaign, session, and canonical-party documents are strict single-source
|
|
||||||
ConfigKit schemas. They do not enable imports, overlays, or `configkit`
|
|
||||||
directives.
|
|
||||||
- Configured timeout and retry-delay durations must be positive. An omitted
|
- Configured timeout and retry-delay durations must be positive. An omitted
|
||||||
artifact timeout continues to inherit its configured Scriptorium timeout.
|
artifact timeout continues to inherit its configured Scriptorium timeout.
|
||||||
- Session files must be concrete; unresolved `{{ ... }}` placeholders fail load.
|
- Session files must be concrete; unresolved `{{ ... }}` placeholders fail load.
|
||||||
- Session and party inputs inspected before typed loading are limited to 8 MiB.
|
|
||||||
- Pipeline defaults are applied before validation.
|
- Pipeline defaults are applied before validation.
|
||||||
- Defaults apply only to absent fields. Explicit empty strings, zero values,
|
- Defaults apply only to absent fields. Explicit empty strings, zero values,
|
||||||
`false`, and `null` retain ConfigKit's typed meaning and are then checked by
|
`false`, and `null` retain ConfigKit's typed meaning and are then checked by
|
||||||
@@ -128,71 +124,60 @@ remote state with an unsafe legacy identity must be migrated before use.
|
|||||||
Explicit null optional stage sections stay absent, while required sections
|
Explicit null optional stage sections stay absent, while required sections
|
||||||
fail validation.
|
fail validation.
|
||||||
- Campaign and session identities must agree.
|
- Campaign and session identities must agree.
|
||||||
- Required stable files (`speakers_file`, `autocorrect_file`, `glossary_file`,
|
- The campaign supplies required speakers, autocorrect, and canonical party
|
||||||
`party_file`) are campaign-owned; the first three may be overridden by the
|
files. Sessions may independently override speakers and autocorrect.
|
||||||
session. The optional `spell_catalog_file` also inherits a campaign value
|
Optional glossary selections and the separate spell overlay inherit as
|
||||||
when omitted by the session.
|
described under [glossary inputs](#glossary-inputs).
|
||||||
- `party_file` is parsed when pipeline and campaign configuration are combined.
|
- The selected party is parsed when domain context or party inspection needs
|
||||||
It must be a versioned [canonical party](integrations/party.md), is
|
it. It must be a versioned [canonical party](integrations/party.md). The
|
||||||
campaign-owned and derives the players input internally. `players_file` and
|
campaign supplies its default file; an explicit CLI selection replaces it
|
||||||
|
for the invocation and supplies the derived players input. `players_file` and
|
||||||
session `party_file` are unsupported configuration keys.
|
session `party_file` are unsupported configuration keys.
|
||||||
- Exactly one audio mode must be configured in session input:
|
- When audio is needed, configure one audio mode in session input:
|
||||||
- local (`audio_dir` or `audio_files`), or
|
- local (`audio_dir` or `audio_files`), or
|
||||||
- S3 (`audio_s3.prefix`).
|
- S3 (`audio_s3.prefix`).
|
||||||
|
|
||||||
### Pipeline imports and overlays
|
### Pipeline imports and overlays
|
||||||
|
|
||||||
Large pipeline configurations may be split into explicitly named fragments and
|
Narratio uses ConfigKit v1.4.0 for imports, composition, inheritance, and
|
||||||
may use fixed-path selected overlays:
|
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.
|
||||||
|
|
||||||
```yaml
|
Relative host-resource paths, including integration configuration files,
|
||||||
configkit:
|
workspace/campaign roots, campaign template and stable inputs, and
|
||||||
imports:
|
session stable inputs and local audio references, resolve from the effective
|
||||||
- path: config/storage.yml
|
value's defining source. Inherited values follow their origin. When no distinct
|
||||||
- path: config/integrations.yaml
|
usable source context exists, the main source is the fallback; if it too is
|
||||||
|
contextless, the invocation directory is used. Explicit CLI-relative file paths
|
||||||
|
use the invocation directory. Artifact outputs, publish destinations, logical
|
||||||
|
IDs, and binary names retain their domain meanings.
|
||||||
|
|
||||||
campaigns:
|
The effective digest excludes source layout, overlay identity, and secret values;
|
||||||
root: /usr/local/share/narratio/campaigns
|
credential reference names and resolved resource paths participate. Prepared
|
||||||
```
|
campaign, session, and party documents contain effective standalone values rather
|
||||||
|
than authored import directives. A prepared session snapshot carries the resolved
|
||||||
|
values used for that session; retain authored files for future edits.
|
||||||
|
|
||||||
The maintained [production/testing bundle](../examples/production-testing/pipeline.yml)
|
### Upgrade from earlier configuration
|
||||||
is a complete copyable example of this structure, including canonical-party
|
|
||||||
artifact families.
|
|
||||||
|
|
||||||
Imports are resolved relative to the directory containing the root pipeline
|
- Rename source-root `configkit:` controls to `config:`. Nested `config` data
|
||||||
file and are loaded in declaration order. Narratio does not scan directories or
|
and the Go `configkit` package and secret tags have different meanings.
|
||||||
infer fragments. Each import must be a confined regular `.yml` or `.yaml` file:
|
- Rename or move pipeline files to the discovery names above, or retain a custom
|
||||||
absolute paths, traversal, symlinks, directories, duplicate files, and an
|
filename such as `pipeline.yml` and pass it with `--config`.
|
||||||
import of the root pipeline itself are rejected. Imported files cannot declare
|
- Remove `--secrets-dir` from invocations and configure the pipeline main file
|
||||||
another `configkit` control section.
|
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
|
||||||
|
intended. Verify the effective result with the inspection commands.
|
||||||
|
- Prepared documents contain effective values; retain authored roots and their
|
||||||
|
companions separately for editing. Separately installed downstream tools own
|
||||||
|
their own configuration migrations.
|
||||||
|
|
||||||
Base merging is additive. A map may be extended by multiple files when every
|
These control-key changes require a major version for the eventual Narratio
|
||||||
leaf is distinct, but a scalar, list, or map/list/scalar kind cannot be claimed
|
release. This migration does not itself publish a release.
|
||||||
more than once, even when the repeated values are identical. Conflict errors
|
|
||||||
name the full field path and every source that claimed it. Narratio additionally
|
|
||||||
rejects an artifact or artifact-family key declared by more than one base file,
|
|
||||||
even when those files contribute disjoint children.
|
|
||||||
|
|
||||||
Overlay names are case-sensitive and use ConfigKit's safe fixed-path naming
|
|
||||||
rules. Only the selected overlay is opened; a malformed unselected overlay does
|
|
||||||
not affect a base or different-overlay load. Maps merge recursively, overlay
|
|
||||||
scalars replace base scalars, and overlay lists replace base lists completely.
|
|
||||||
Explicit `false`, zero, empty strings, empty containers, and null values remain
|
|
||||||
explicit inputs and are not refilled by defaults. Overlays cannot inherit,
|
|
||||||
stack, import files, or declare another ConfigKit control section.
|
|
||||||
|
|
||||||
During ConfigKit loading, Narratio applies fresh typed defaults, recorded
|
|
||||||
entry-level defaults and normalization, read-only file-local validation, and
|
|
||||||
ordinary path resolution before computing a deterministic effective
|
|
||||||
configuration digest. The digest represents the normalized, secret-free
|
|
||||||
runtime pipeline mapping; it excludes ConfigKit directives, source
|
|
||||||
provenance, overlay identity, and raw environment secret values. Equivalent
|
|
||||||
effective mappings therefore have the same digest regardless of how fields are
|
|
||||||
split among the root and imports.
|
|
||||||
|
|
||||||
An imported field has the same meaning it would have in a monolithic root
|
|
||||||
pipeline. In particular, ordinary relative pipeline paths continue to resolve
|
|
||||||
from the root pipeline directory, not from the importing fragment's directory.
|
|
||||||
|
|
||||||
## Minimal Working Configuration
|
## Minimal Working Configuration
|
||||||
|
|
||||||
@@ -209,12 +194,12 @@ whisperx:
|
|||||||
`campaign.yml`
|
`campaign.yml`
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
campaign_id: sample-campaign
|
schema_version: maximumdirect.rpg.campaign.v1
|
||||||
|
id: sample-campaign
|
||||||
|
references: {party: ./party.yml}
|
||||||
|
narratio:
|
||||||
inputs:
|
inputs:
|
||||||
speakers_file: ./speakers.yml
|
speakers_file: ./speakers.yml
|
||||||
autocorrect_file: ./autocorrect.yml
|
|
||||||
glossary_file: ./glossary.yml
|
|
||||||
party_file: ./party.yml
|
|
||||||
```
|
```
|
||||||
|
|
||||||
`session.yml` (local audio)
|
`session.yml` (local audio)
|
||||||
@@ -227,32 +212,31 @@ inputs:
|
|||||||
|
|
||||||
## Secrets Handling
|
## Secrets Handling
|
||||||
|
|
||||||
- Do not place raw secrets in YAML.
|
Credential fields contain environment-variable names as ConfigKit typed secret
|
||||||
- Credential fields contain environment-variable names, represented internally
|
references. Each surviving reference must resolve to a nonempty value when the
|
||||||
as ConfigKit typed secret references (for example
|
pipeline loads, including for disabled integrations or stages outside the run.
|
||||||
`pipeline.notarius.credentials: [NOTARIUS_LLM_API_KEY]`). A configured reference
|
Do not put raw secret values in YAML.
|
||||||
must resolve to a nonempty environment value during load.
|
|
||||||
- Every surviving reference is resolved during ordinary pipeline loading,
|
A pipeline main file can select configured bootstrap before its typed load:
|
||||||
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
|
```yaml
|
||||||
that deployment should not require the credential.
|
config:
|
||||||
- Every command that loads a pipeline accepts `--secrets-dir <path>`. When the
|
secrets_dir: secrets
|
||||||
flag is omitted, Narratio uses a present `secrets/` directory beside the
|
```
|
||||||
resolved root `pipeline.yml`; an absent conventional directory is ignored.
|
|
||||||
Explicit relative paths are resolved from the caller's working directory,
|
Narratio passes the selected pipeline source to ConfigKit's configured bootstrap,
|
||||||
and a missing or empty explicit selection is an error.
|
then loads the returned prepared source. Without a directory declaration,
|
||||||
- Each immediate regular file whose name is a valid environment-variable name
|
credentials may be supplied in the process environment. Narratio no longer
|
||||||
supplies one value. ConfigKit removes trailing CR/LF, permits a symlink as the
|
accepts `--secrets-dir` or probes a conventional directory automatically. See
|
||||||
selected directory, rejects non-hidden symlink entries, and limits input to
|
[ConfigKit's configured-startup contract](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap)
|
||||||
1 MiB per file, 8 MiB total, and 1024 entries. Dot-prefixed entries (including
|
for path rules, environment precedence and overwrite controls.
|
||||||
files, directories, and symlinks) are ignored and omitted from bootstrap
|
|
||||||
reports, but still count toward the directory entry limit.
|
Each pipeline acquisition prepares its own source; an already acquired result is
|
||||||
- An existing process environment value takes precedence over a credential file.
|
reused. Comparisons use ordinary acquisition on each reached side and share the
|
||||||
- On POSIX, operators must provision the directory with no group/other access
|
process environment. Direct local campaign, session, and party inspection does
|
||||||
(normally `0700`) and files with no group/other access (normally `0600`);
|
not load a pipeline solely for bootstrap. Bootstrap reports and diagnostics are
|
||||||
ConfigKit validates type and bounds but does not enforce permission modes.
|
safe, final stderr output, separate from command reports. Protect provisioned
|
||||||
- Bootstrap happens once per command, before any configuration load or adapter
|
secret directories and files from access by other users.
|
||||||
construction. Safe reports contain filenames, paths, and statuses, never values.
|
|
||||||
|
|
||||||
## Publish Configuration Summary
|
## Publish Configuration Summary
|
||||||
|
|
||||||
@@ -282,7 +266,7 @@ Rules:
|
|||||||
- `outputs[].source` is required.
|
- `outputs[].source` is required.
|
||||||
- `outputs[].dest` may be omitted when derivable from source.
|
- `outputs[].dest` may be omitted when derivable from source.
|
||||||
- extraction sources require an explicit `outputs[].dest` and publish only when
|
- extraction sources require an explicit `outputs[].dest` and publish only when
|
||||||
a rule names that source; the Notarius index and complete bundle are not
|
a rule names that source; the Notarius bundle is not
|
||||||
publish sources.
|
publish sources.
|
||||||
- `outputs[].required` defaults to `true`.
|
- `outputs[].required` defaults to `true`.
|
||||||
- publish locks are independent remote session objects managed with
|
- publish locks are independent remote session objects managed with
|
||||||
@@ -294,11 +278,14 @@ Rules:
|
|||||||
|
|
||||||
| Field | Type | Required | Default / Rule |
|
| Field | Type | Required | Default / Rule |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| `configkit.imports[].path` | string | No | explicit additive pipeline fragment relative to the root pipeline directory; `.yml` or `.yaml` regular files only |
|
| `config.imports` | list | No | native source-root import selections; see [imports and overlays](#pipeline-imports-and-overlays) |
|
||||||
|
| `pipeline.reference_catalog.settings` | map[string]string | No | setting IDs to source-relative vocabulary files |
|
||||||
|
| `pipeline.reference_catalog.systems` | map[string]string | No | system IDs to source-relative vocabulary files |
|
||||||
| `pipeline.workspace.root` | string | No | `/var/lib/narratio` |
|
| `pipeline.workspace.root` | string | No | `/var/lib/narratio` |
|
||||||
| `pipeline.workspace.cleanup_after_publish` | bool | No | `false`; selects the published run's workspace target for final cleanup and requires effective `pipeline.publish.enabled=true` and `pipeline.publish.upload_run=true` |
|
| `pipeline.workspace.cleanup_after_publish` | bool | No | `false`; selects the session's entire run history for final cleanup and requires effective `pipeline.publish.enabled=true` and `pipeline.publish.upload_run=true` |
|
||||||
| `pipeline.campaigns.root` | string | No | `/usr/local/share/narratio/campaigns` |
|
| `pipeline.campaigns.root` | string | No | `/usr/local/share/narratio/campaigns` |
|
||||||
| `pipeline.campaigns.default_campaign_id` | string | No | empty |
|
| `pipeline.campaigns.default_campaign_id` | string | No | empty |
|
||||||
|
| `pipeline.campaigns.session_template_file` | string | No | installation session template; built-in default when absent |
|
||||||
| `pipeline.storage.backend` | string | No | `local`; supported values are `local` and `s3` (case-insensitive) |
|
| `pipeline.storage.backend` | string | No | `local`; supported values are `local` and `s3` (case-insensitive) |
|
||||||
| `pipeline.storage.s3.bucket` | string | Conditional | required when backend is `s3` and S3 session-audio or publish upload is enabled |
|
| `pipeline.storage.s3.bucket` | string | Conditional | required when backend is `s3` and S3 session-audio or publish upload is enabled |
|
||||||
| `pipeline.storage.s3.root_prefix` | string | No | `dnd` |
|
| `pipeline.storage.s3.root_prefix` | string | No | `dnd` |
|
||||||
@@ -307,10 +294,6 @@ Rules:
|
|||||||
| `pipeline.storage.s3.force_path_style` | bool | No | `false` |
|
| `pipeline.storage.s3.force_path_style` | bool | No | `false` |
|
||||||
| `pipeline.storage.s3.access_key_id` | secret reference | Conditional | unset; must be paired with `secret_access_key` |
|
| `pipeline.storage.s3.access_key_id` | secret reference | Conditional | unset; must be paired with `secret_access_key` |
|
||||||
| `pipeline.storage.s3.secret_access_key` | secret reference | Conditional | unset; must be paired with `access_key_id` |
|
| `pipeline.storage.s3.secret_access_key` | secret reference | Conditional | unset; must be paired with `access_key_id` |
|
||||||
| `pipeline.spool.root` | string | No | `/var/spool/narratio` |
|
|
||||||
| `pipeline.spool.delete_audio_after_publish` | bool | No | `false`; selects the published run's spool-audio target for final cleanup and requires effective `pipeline.publish.enabled=true` and `pipeline.publish.upload_run=true` |
|
|
||||||
| `pipeline.cache.root` | string | No | `/var/cache/narratio` |
|
|
||||||
| `pipeline.cache.s3_audio` | bool | No | `true` |
|
|
||||||
| `pipeline.publish.enabled` | bool | No | `true` |
|
| `pipeline.publish.enabled` | bool | No | `true` |
|
||||||
| `pipeline.publish.upload_run` | bool | No | `true` |
|
| `pipeline.publish.upload_run` | bool | No | `true` |
|
||||||
| `pipeline.publish.outputs[]` | list | No | defaults to final trimmed JSON plus final and final-trimmed Markdown outputs |
|
| `pipeline.publish.outputs[]` | list | No | defaults to final trimmed JSON plus final and final-trimmed Markdown outputs |
|
||||||
@@ -335,7 +318,7 @@ Rules:
|
|||||||
| `pipeline.audita.binary` | string | No | `audita` |
|
| `pipeline.audita.binary` | string | No | `audita` |
|
||||||
| `pipeline.audita.timeout` | duration | No | `3h` |
|
| `pipeline.audita.timeout` | duration | No | `3h` |
|
||||||
| `pipeline.audita.credentials[]` | list[secret reference] | No | empty; exact environment-variable names forwarded to Audita |
|
| `pipeline.audita.credentials[]` | list[secret reference] | No | empty; exact environment-variable names forwarded to Audita |
|
||||||
| `pipeline.audita.modules[]` | list[string] | No | unset; omit to use Audita defaults, set `[]` for no modules |
|
| `pipeline.audita.debug` | bool | No | `false`; true requests Audita debug capture |
|
||||||
| `pipeline.audita.overlay` | string | No | empty; no downstream overlay override |
|
| `pipeline.audita.overlay` | string | No | empty; no downstream overlay override |
|
||||||
| `pipeline.audita.proposal_profile` | string | No | empty; no downstream proposal-profile override |
|
| `pipeline.audita.proposal_profile` | string | No | empty; no downstream proposal-profile override |
|
||||||
| `pipeline.audita.validation_profile` | string | No | empty; no downstream validation-profile override |
|
| `pipeline.audita.validation_profile` | string | No | empty; no downstream validation-profile override |
|
||||||
@@ -359,21 +342,23 @@ Rules:
|
|||||||
| `pipeline.notarius.binary` | string | No | `notarius` |
|
| `pipeline.notarius.binary` | string | No | `notarius` |
|
||||||
| `pipeline.notarius.credentials[]` | list[secret reference] | No | empty; exact environment-variable names forwarded to Notarius |
|
| `pipeline.notarius.credentials[]` | list[secret reference] | No | empty; exact environment-variable names forwarded to Notarius |
|
||||||
| `pipeline.notarius.config_overlay` | string | No | unset; exact Notarius ConfigKit overlay selector |
|
| `pipeline.notarius.config_overlay` | string | No | unset; exact Notarius ConfigKit overlay selector |
|
||||||
| `pipeline.notarius.config_path` | string | Conditional | required when enabled; relative paths resolve from the pipeline file directory |
|
| `pipeline.notarius.config_path` | string | Conditional | required when enabled; relative paths resolve from their defining source |
|
||||||
| `pipeline.notarius.pipeline_id` | string | Conditional | required when enabled |
|
| `pipeline.notarius.pipeline_id` | string | Conditional | required when enabled |
|
||||||
| `pipeline.notarius.timeout` | duration | No | `3h`; must be positive |
|
| `pipeline.notarius.timeout` | duration | No | `3h`; must be positive |
|
||||||
| `pipeline.notarius.working_directory` | string | No | directory containing resolved `config_path`; relative paths resolve from the pipeline file directory |
|
| `pipeline.notarius.working_directory` | string | No | directory containing resolved `config_path`; relative paths resolve from their defining source |
|
||||||
| `pipeline.notarius.resume` | bool | No | `false`; request compatible Notarius checkpoint reuse during ordinary executed extraction |
|
| `pipeline.notarius.cache` | string | No | unset; when set, `auto`, `bypass`, or `refresh` |
|
||||||
| `pipeline.notarius.chunk_cache` | string | No | empty; when set, exactly `auto`, `bypass`, or `refresh` |
|
| `pipeline.notarius.debug` | bool | No | `false`; true requests debug capture |
|
||||||
| `pipeline.notarius.references` | map[string]string | No | empty; maps normalized Notarius selectors to supported prepared Narratio source IDs; maximum 256 entries |
|
| `pipeline.notarius.references` | map[string]string | No | empty; maps normalized Notarius selectors to supported prepared Narratio source IDs; maximum 256 entries |
|
||||||
| `pipeline.notarius.outputs` | map | Conditional | at least one entry when enabled |
|
| `pipeline.notarius.outputs` | map | Conditional | at least one entry when enabled |
|
||||||
| `pipeline.render.enabled` | bool | No | `true` |
|
| `pipeline.render.enabled` | bool | No | `true` |
|
||||||
|
| `pipeline.render.variants` | list[string] | No | `[normalized, trimmed]`; select either or both; `[]` or `null` selects none |
|
||||||
| `pipeline.render.format` | string | No | `markdown` (only supported value) |
|
| `pipeline.render.format` | string | No | `markdown` (only supported value) |
|
||||||
| `pipeline.render.title` | string | No | empty (falls back to `session.title` when set) |
|
| `pipeline.render.title` | string | No | empty (falls back to `session.title` when set) |
|
||||||
| `pipeline.render.include_timestamps` | bool | No | `true` |
|
| `pipeline.render.include_timestamps` | bool | No | `true` |
|
||||||
| `pipeline.render.include_segment_ids` | bool | No | `true` |
|
| `pipeline.render.include_segment_ids` | bool | No | `true` |
|
||||||
| `pipeline.render.include_metadata` | bool | No | `false` |
|
| `pipeline.render.include_metadata` | bool | No | `false` |
|
||||||
| `pipeline.scriptorium.binary` | string | No | `scriptorium` |
|
| `pipeline.scriptorium.binary` | string | No | `scriptorium` |
|
||||||
|
| `pipeline.scriptorium.credentials[]` | list[secret reference] | No | empty; exact environment-variable names forwarded to Scriptorium |
|
||||||
| `pipeline.scriptorium.config_path` | string | No | empty |
|
| `pipeline.scriptorium.config_path` | string | No | empty |
|
||||||
| `pipeline.scriptorium.timeout` | duration | No | `10m` |
|
| `pipeline.scriptorium.timeout` | duration | No | `10m` |
|
||||||
| `pipeline.scriptorium.render_debug` | bool | No | `false` |
|
| `pipeline.scriptorium.render_debug` | bool | No | `false` |
|
||||||
@@ -383,38 +368,30 @@ Rules:
|
|||||||
|
|
||||||
### Audita Selection and Credentials
|
### Audita Selection and Credentials
|
||||||
|
|
||||||
`pipeline.audita.config_path` optionally passes an Audita v2 configuration file;
|
`pipeline.audita.config_path` optionally selects an Audita v4.3.0 configuration;
|
||||||
when empty, Audita uses its own native config discovery. `overlay`,
|
otherwise Audita uses native discovery. `overlay`, `proposal_profile`, and
|
||||||
`proposal_profile`, and `validation_profile` are independent, optional Audita
|
`validation_profile` independently select downstream settings. Empty values
|
||||||
selectors. Empty or omitted strings add no command-line override. Narratio's
|
add no override. Narratio does not create Audita configuration or infer its
|
||||||
selected pipeline overlay is never inferred as an Audita overlay, and Narratio
|
selectors from a Narratio overlay. Configure the ordered Audita pipeline in
|
||||||
does not create or validate Audita's backend or PromptKit profile files. Prepare
|
Audita itself; the retired `pipeline.audita.modules` field is rejected. See
|
||||||
them with [Audita's v2 migration guide](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/docs/migrations/v2.md).
|
[Audita's configuration guide](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
||||||
|
and the [integration contract](integrations/audita.md). `debug: true` requests
|
||||||
|
Audita debug capture; false or omission adds no debug override. Debug alone does
|
||||||
|
not invalidate a completed polish result.
|
||||||
|
|
||||||
Omit `modules` or set it to `null` to use Audita's configured default sequence.
|
`pipeline.audita.credentials` contains exact environment-variable references,
|
||||||
Set `modules: []` to run no correction modules. A nonempty list is passed in
|
not values. Narratio resolves each name at pipeline load and forwards its value
|
||||||
order, including repetitions. Narratio does not add a reporting or debug flag;
|
under the same name. Supply every credential required by the selected Audita
|
||||||
Audita's external configuration controls those settings.
|
configuration. Omission, `null`, or `[]` forwards nothing; a Narratio overlay
|
||||||
|
replaces the list. Captured diagnostics redact those values.
|
||||||
`pipeline.audita.credentials` lists secret-reference names, not values. Narratio
|
|
||||||
resolves every listed name during pipeline loading and forwards the captured
|
|
||||||
nonempty value under that exact name to Audita. It does not inspect Audita's
|
|
||||||
configuration to discover names or map them to aliases. Audita v2 resolves
|
|
||||||
credentials for **all configured backends**, even ones not selected by the
|
|
||||||
current profiles: list every named backend credential in the selected Audita
|
|
||||||
configuration. An unauthenticated backend needs no reference. Omission, `null`,
|
|
||||||
or `[]` forwards nothing. A Narratio overlay replaces the entire list, and
|
|
||||||
`[]` clears it. See the [Audita integration contract](./integrations/audita.md)
|
|
||||||
for the subprocess and redaction boundary.
|
|
||||||
|
|
||||||
<a id="notarius-configuration-profile"></a>
|
<a id="notarius-configuration-profile"></a>
|
||||||
|
|
||||||
### Notarius Configuration Overlay
|
### Notarius Configuration Overlay
|
||||||
|
|
||||||
Migration: rename `pipeline.notarius.config_profile` to `config_overlay`.
|
Migration: rename `pipeline.notarius.config_profile` to `config_overlay`.
|
||||||
The old field is rejected; there is no compatibility alias. For Notarius v0.8+
|
The old field is rejected; there is no compatibility alias. For current Notarius versions, move selected downstream files from `profiles/`
|
||||||
move selected downstream files from `profiles/` to `overlays/` beside its root
|
to `overlays/` beside its root configuration. This does not rename PromptKit LLM profiles.
|
||||||
configuration. This does not rename PromptKit LLM profiles.
|
|
||||||
The renamed selector also changes extraction resume evidence for named
|
The renamed selector also changes extraction resume evidence for named
|
||||||
selections: their existing extraction is regenerated on the next applicable
|
selections: their existing extraction is regenerated on the next applicable
|
||||||
run, with normal dependent invalidation. Omitted/base selections do not acquire
|
run, with normal dependent invalidation. Omitted/base selections do not acquire
|
||||||
@@ -474,75 +451,58 @@ delivery and redaction boundary.
|
|||||||
|
|
||||||
### Notarius Cache Controls
|
### Notarius Cache Controls
|
||||||
|
|
||||||
`pipeline.notarius.resume` defaults to `false`. When true, an executed ordinary
|
`pipeline.notarius.cache` is optional; omission leaves the Notarius configuration
|
||||||
extraction passes `--resume`; the deployed Notarius configuration must already
|
in control. Supply `auto`, `bypass`, or `refresh` to select native cache behavior.
|
||||||
enable checkpoint recording and should select an explicit persistent checkpoint
|
Forced extraction uses `refresh`. Narratio's own completed-stage reuse is separate;
|
||||||
root. Narratio does not inspect or generate that configuration.
|
changing cache or debug selection alone does not invalidate completed products.
|
||||||
|
Notarius owns its configuration, pipeline, and cache storage.
|
||||||
`pipeline.notarius.chunk_cache` is empty by default, leaving Notarius's
|
|
||||||
configured mode in control. A nonempty value must be `auto`, `bypass`, or
|
|
||||||
`refresh` and is passed as `--chunk_cache`. Forced extraction takes precedence
|
|
||||||
over both fields: it omits `--resume` and passes `--chunk_cache refresh`.
|
|
||||||
Neither field changes Narratio's semantic extraction fingerprint, so changing
|
|
||||||
them alone does not rerun an otherwise complete durable extraction.
|
|
||||||
|
|
||||||
### Notarius Reference Bindings
|
### Notarius Reference Bindings
|
||||||
|
|
||||||
`pipeline.notarius.references` maps a Notarius CLI selector to a prepared
|
Map selectors to prepared source IDs, for example:
|
||||||
Narratio source, not to a filesystem path:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
notarius:
|
notarius:
|
||||||
references:
|
references:
|
||||||
glossary: narratio.input.glossary
|
|
||||||
party: narratio.input.party
|
party: narratio.input.party
|
||||||
players: narratio.input.players
|
glossary: narratio.input.glossary.combined
|
||||||
spell_catalog: narratio.input.spell_catalog
|
spell_catalog: narratio.input.glossary.combined
|
||||||
```
|
```
|
||||||
|
|
||||||
Supported sources are `narratio.input.party`, `narratio.input.players`,
|
Supported IDs are `narratio.input.party`, `narratio.input.players`, and
|
||||||
`narratio.input.glossary`, and `narratio.input.spell_catalog`. Each map entry is
|
`narratio.input.glossary.{party,campaign,setting,spells,combined}`. Every
|
||||||
required by its presence: omit a binding when the selected Notarius pipeline
|
configured binding is required; omit unused bindings. Selectors use Notarius's
|
||||||
does not need it. A spell-catalog binding additionally requires an effective
|
native slot forms. Narratio verifies and snapshots the prepared files before
|
||||||
campaign or session `spell_catalog_file`.
|
passing them to the subprocess. See the [Notarius contract](integrations/notarius.md)
|
||||||
|
and [complete example](../examples/pipeline.full.annotated.yml).
|
||||||
Selectors accept Notarius's `slot`, `chunk.slot`, `lane.slot`,
|
|
||||||
`lane.extract.slot`, `lane.merge.slot`, and `lane.normalize.slot` forms.
|
|
||||||
Narratio trims whitespace around
|
|
||||||
selectors and their dot-separated components, rejects empty components and
|
|
||||||
`=`, rejects duplicate normalized selectors, and limits the map to 256 entries.
|
|
||||||
It validates only selector structure and the prepared source vocabulary;
|
|
||||||
Notarius owns target-slot declarations and media compatibility.
|
|
||||||
|
|
||||||
Before extraction, Narratio resolves every binding from the current prepared
|
|
||||||
session manifest and streams it into a verified, content-addressed session
|
|
||||||
snapshot whose absolute path is passed to Notarius. Missing, unsafe, empty,
|
|
||||||
changed-during-copy, or checksum-inconsistent prepared evidence fails with
|
|
||||||
guidance to force `prepare`. Bindings are sorted by normalized selector and are
|
|
||||||
part of extraction fingerprint and resume identity. See the
|
|
||||||
[Notarius integration contract](./integrations/notarius.md) for the subprocess
|
|
||||||
boundary and the [complete example](../examples/pipeline.full.annotated.yml)
|
|
||||||
for a copyable configuration.
|
|
||||||
|
|
||||||
### Notarius Output Entries
|
### Notarius Output Entries
|
||||||
|
|
||||||
For each `pipeline.notarius.outputs.<name>`:
|
Each `pipeline.notarius.outputs.<name>` requires a unique `lane_id` and may set
|
||||||
|
`filename` to a flat JSON filename. The default is `<name>.json`. Names create
|
||||||
|
`narratio.extraction.<name>` source IDs. Each configured lane is required, and
|
||||||
|
its completed JSON is promoted into the session's flat artifacts directory.
|
||||||
|
See the [Notarius contract](integrations/notarius.md).
|
||||||
|
|
||||||
| Field | Type | Required | Rule |
|
### Scriptorium Credentials
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| `lane_id` | string | Yes | unique Notarius lane ID |
|
|
||||||
| `media_type` | string | Yes | exact accepted descriptor media type |
|
|
||||||
| `schema_id` | string | Yes | exact accepted descriptor schema ID |
|
|
||||||
| `schema_version` | string | Yes | exact accepted descriptor schema version |
|
|
||||||
| `module_key` | string | No | exact accepted module key when set |
|
|
||||||
|
|
||||||
Output names must match `^[a-z][a-z0-9_]*$` and become selectable sources named
|
Set `scriptorium.credentials: [OPENROUTER_API_KEY]` in the pipeline file to
|
||||||
`narratio.extraction.<name>`. Lane IDs must be unique. Every declared output is
|
forward that provider key to Scriptorium. List additional provider names only
|
||||||
required from a successful Notarius result; a missing, rejected, duplicate, or
|
when the selected downstream configuration needs them. The same list applies
|
||||||
contract-incompatible lane fails extraction. See the
|
to requirements inspection, trim bounds generation, analysis (including
|
||||||
[complete maintained example](../examples/pipeline.full.annotated.yml) for the
|
character families), and their render-debug calls. Scriptorium retains
|
||||||
current ten-lane D&D mapping and the [Notarius contract](./integrations/notarius.md)
|
provider/profile selection; Narratio does not pass a model-request
|
||||||
for compatibility ownership.
|
`--api-key-env` override.
|
||||||
|
|
||||||
|
As with Audita and Notarius, names are ConfigKit secret references resolved at
|
||||||
|
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.
|
||||||
|
Inspection and generated metadata contain names only. Credential changes do
|
||||||
|
not invalidate completed trim or analysis work; rotating values also leaves
|
||||||
|
the effective configuration digest unchanged. Other environment variables
|
||||||
|
retain the shared minimal subprocess inheritance rules.
|
||||||
|
|
||||||
### Scriptorium Artifact Entries
|
### Scriptorium Artifact Entries
|
||||||
|
|
||||||
@@ -561,6 +521,9 @@ For each `pipeline.scriptorium.artifacts.<name>`:
|
|||||||
| `vars` | map | No | values must be string or bool; `session_id` is reserved and overwritten by Narratio |
|
| `vars` | map | No | values must be string or bool; `session_id` is reserved and overwritten by Narratio |
|
||||||
|
|
||||||
Narratio adds `session_id=narratio-session-<session_id>` to every Scriptorium request for sticky upstream LLM routing. If an artifact config sets `vars.session_id`, Narratio replaces that value before invoking Scriptorium. Use a different variable name if a prompt needs the raw Narratio session ID as content.
|
Narratio adds `session_id=narratio-session-<session_id>` to every Scriptorium request for sticky upstream LLM routing. If an artifact config sets `vars.session_id`, Narratio replaces that value before invoking Scriptorium. Use a different variable name if a prompt needs the raw Narratio session ID as content.
|
||||||
|
Discovery, preview, and generation receive the same effective variables,
|
||||||
|
including family member values and explicitly empty strings. Narratio forwards
|
||||||
|
the sticky value as a template variable, not as a direct session override.
|
||||||
|
|
||||||
Without `--artifacts`, analyze executes enabled configured artifacts. With an
|
Without `--artifacts`, analyze executes enabled configured artifacts. With an
|
||||||
explicit `--artifacts` list, the exact named configured artifacts are the
|
explicit `--artifacts` list, the exact named configured artifacts are the
|
||||||
@@ -579,6 +542,13 @@ For each artifact input `pipeline.scriptorium.artifacts.<name>.inputs.<input_nam
|
|||||||
| `source` | string | Yes | built-in runtime source, prepared input source, `narratio.extraction.<name>`, `narratio.artifact.<name>`, or `narratio.previous_session.artifact.<name>` |
|
| `source` | string | Yes | built-in runtime source, prepared input source, `narratio.extraction.<name>`, `narratio.artifact.<name>`, or `narratio.previous_session.artifact.<name>` |
|
||||||
| `required` | bool | No | optional input requirement |
|
| `required` | bool | No | optional input requirement |
|
||||||
|
|
||||||
|
The input map key is the prompt input name; `source` identifies the Narratio
|
||||||
|
artifact that supplies it. Requirements discovery compares exact input names
|
||||||
|
with these keys before generated files exist. A required prompt input bound to
|
||||||
|
an optional source produces a warning when availability is unknown; runtime
|
||||||
|
resolution may still omit the source. See
|
||||||
|
[prompt preflight](operations.md#prompt-requirements-preflight).
|
||||||
|
|
||||||
`artifact` and `path` are obsolete and rejected by strict configuration
|
`artifact` and `path` are obsolete and rejected by strict configuration
|
||||||
loading. Use the canonical `source` identifier to select the input; Narratio
|
loading. Use the canonical `source` identifier to select the input; Narratio
|
||||||
does not provide adapter-specific input passthrough fields.
|
does not provide adapter-specific input passthrough fields.
|
||||||
@@ -586,19 +556,19 @@ does not provide adapter-specific input passthrough fields.
|
|||||||
Each `narratio.artifact.<name>` input source automatically contributes an
|
Each `narratio.artifact.<name>` input source automatically contributes an
|
||||||
effective dependency on that configured artifact. Narratio unions these inferred
|
effective dependency on that configured artifact. Narratio unions these inferred
|
||||||
edges with explicit `depends_on` entries, then trims, deduplicates, and sorts the
|
edges with explicit `depends_on` entries, then trims, deduplicates, and sorts the
|
||||||
result during final configuration resolution. Authors use `depends_on` only for
|
result during domain catalog derivation. Authors use `depends_on` only for
|
||||||
ordering constraints that are not already expressed by an artifact input.
|
ordering constraints that are not already expressed by an artifact input.
|
||||||
Use [`narratio config artifacts`](./cli.md#config-validate-config-show-config-sources-config-artifacts-and-config-diff)
|
Use [`narratio artifacts list`](./cli.md#artifacts-list)
|
||||||
to inspect keys, definition sources, outputs, and effective dependencies without
|
to inspect keys, definition sources, outputs, and effective dependencies without
|
||||||
loading a session or creating runtime state.
|
loading a session or creating runtime state.
|
||||||
|
|
||||||
### Scriptorium Artifact Families
|
### Scriptorium Artifact Families
|
||||||
|
|
||||||
`pipeline.scriptorium.artifact_families` declares a shared artifact template
|
`pipeline.scriptorium.artifact_families` declares a shared artifact template
|
||||||
for every canonical campaign character. Configuration resolution expands each
|
for every canonical campaign character. Domain catalog derivation expands each
|
||||||
family into ordinary `pipeline.scriptorium.artifacts` entries before analyze
|
family into separate concrete artifact entries before analyze planning or
|
||||||
planning or Scriptorium invocation. Party parsing rejects unsupported document
|
Scriptorium invocation, retaining the authored declarations in configuration.
|
||||||
schemas before family expansion.
|
Party parsing rejects unsupported document schemas before family expansion.
|
||||||
|
|
||||||
For each `pipeline.scriptorium.artifact_families.<name>`:
|
For each `pipeline.scriptorium.artifact_families.<name>`:
|
||||||
|
|
||||||
@@ -606,10 +576,19 @@ For each `pipeline.scriptorium.artifact_families.<name>`:
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| `enabled`, `prompt_id`, `profile_id`, `timeout`, `render_debug`, `depends_on`, `inputs`, `vars` | ordinary artifact fields | No | copied to each generated artifact under the corresponding ordinary rules |
|
| `enabled`, `prompt_id`, `profile_id`, `timeout`, `render_debug`, `depends_on`, `inputs`, `vars` | ordinary artifact fields | No | copied to each generated artifact under the corresponding ordinary rules |
|
||||||
| `for_each` | string | Yes | exactly `party.characters` |
|
| `for_each` | string | Yes | exactly `party.characters` |
|
||||||
| `output_path_pattern` | string | Yes | safe path beneath `artifacts/` with exactly one `{character_id}` token and no other brace syntax |
|
| `output_path_pattern` | string | Yes | flat filename directly beneath `artifacts/` with exactly one `{character_id}` token and no other brace syntax |
|
||||||
| `member_vars` | map | No | maps an ordinary Scriptorium variable name to a supported canonical character selector |
|
| `member_vars` | map | No | maps an ordinary Scriptorium variable name to a supported canonical character selector |
|
||||||
| `member_dependencies` | list | No | unique family keys; each generated member depends on the corresponding generated member of each listed family |
|
| `member_dependencies` | list | No | unique family keys; each generated member depends on the corresponding generated member of each listed family |
|
||||||
| `publish` | map | No | typed family publish policy (`enabled`, `required`, `dest_pattern`) expanded into concrete publish outputs when enabled |
|
| `publish` | map | No | typed family publish policy (`enabled`, `required`, `dest_pattern`) validated against effective `pipeline.publish` settings and expanded into concrete publish outputs when enabled |
|
||||||
|
|
||||||
|
An enabled family publish declaration is validated against the effective
|
||||||
|
`pipeline.publish` configuration, including its defaults; it does not require
|
||||||
|
an explicit `publish.enabled` declaration in the same source file.
|
||||||
|
|
||||||
|
Explicit and generated analysis artifacts and session bounds must use flat
|
||||||
|
filenames directly beneath `artifacts/`; combined transcripts use flat filenames
|
||||||
|
directly beneath `transcripts/`. Remote publish destinations remain independent.
|
||||||
|
Collisions among effective producers are rejected.
|
||||||
|
|
||||||
Generated keys are `<family>_<character_id>` and generated output paths must
|
Generated keys are `<family>_<character_id>` and generated output paths must
|
||||||
not collide with explicit artifacts or another generated artifact. Families
|
not collide with explicit artifacts or another generated artifact. Families
|
||||||
@@ -640,15 +619,45 @@ integration.
|
|||||||
|
|
||||||
### Campaign
|
### Campaign
|
||||||
|
|
||||||
| Field | Type | Required | Notes |
|
The campaign is a shared [RPG campaign document](https://schemas.maximumdirect.net/rpg/campaign/v0.2.0/schema.json).
|
||||||
| --- | --- | --- | --- |
|
Shared extensions are allowed; Narratio's `narratio` settings are strict.
|
||||||
| `campaign_id` | string | Yes | canonical opaque campaign identity |
|
|
||||||
| `session_template_file` | string | No | used by `session init` when set |
|
| Field | Required | Meaning |
|
||||||
| `inputs.speakers_file` | string | Yes | stable input default |
|
| --- | --- | --- |
|
||||||
| `inputs.autocorrect_file` | string | Yes | stable input default |
|
| `schema_version` | Yes | `maximumdirect.rpg.campaign.v1` |
|
||||||
| `inputs.glossary_file` | string | Yes | stable input default |
|
| `id` | Yes | campaign identity |
|
||||||
| `inputs.party_file` | string | Yes | stable campaign party source; relative paths resolve from `campaign.yml` |
|
| `name`, `description` | No | shared context |
|
||||||
| `inputs.spell_catalog_file` | string | No | optional spell-catalog overlay default; required when a Notarius reference selects `narratio.input.spell_catalog` |
|
| `references.party` | Yes | shared roster path; `--party-file` can select another roster |
|
||||||
|
| `setting`, `system` | No | selected installed catalog IDs |
|
||||||
|
| `references.glossaries` | No | shared relationships, not an ordered Narratio composition list |
|
||||||
|
| `narratio.inputs.speakers_file` | Yes | speaker mapping path |
|
||||||
|
| `narratio.inputs.glossary_file` | No | shared campaign glossary path |
|
||||||
|
| `narratio.inputs.glossary` | No | inline campaign collection |
|
||||||
|
| `narratio.inputs.autocorrect` | No | replacement rules, default empty |
|
||||||
|
| `narratio.session_template_file` | No | campaign template; otherwise installation or built-in template |
|
||||||
|
|
||||||
|
Resource paths resolve relative to their defining source. See the
|
||||||
|
[three-file example](../examples/campaigns/lantern-coast/campaign.yml) and
|
||||||
|
[party contract](integrations/party.md).
|
||||||
|
|
||||||
|
### Glossary Inputs
|
||||||
|
|
||||||
|
Install a reference catalog and import its root into the pipeline. Selected
|
||||||
|
setting and system IDs resolve to source-relative shared glossary files; only
|
||||||
|
selected files are read. Campaign file and inline contributions compose using
|
||||||
|
ConfigKit identity and list controls. Session omissions inherit each selection
|
||||||
|
independently; explicit null or empty optional selectors clear them. A supplied
|
||||||
|
inline glossary or autocorrection list replaces the campaign contribution as a
|
||||||
|
whole, and null clears it. Clearing inline vocabulary leaves a selected file
|
||||||
|
unchanged; `autocorrect: []` disables inherited campaign rules.
|
||||||
|
|
||||||
|
Preparation writes shared envelopes for party, campaign, setting, spells, and
|
||||||
|
combined collections, including empty collections. Audita receives the four
|
||||||
|
individual envelopes and Notarius may bind the combined envelope to both glossary
|
||||||
|
roles. Collection extensions such as `instruction` are data, not prompt guidance.
|
||||||
|
[Shared glossary schema](https://schemas.maximumdirect.net/glossary/v0.2.0/schema.json)
|
||||||
|
and [semantics](https://schemas.maximumdirect.net/glossary/v0.2.0/semantics.md)
|
||||||
|
own the contract; see the [maintained examples](../examples/README.md).
|
||||||
|
|
||||||
### Session
|
### Session
|
||||||
|
|
||||||
@@ -660,17 +669,36 @@ integration.
|
|||||||
| `date` | string | No | metadata |
|
| `date` | string | No | metadata |
|
||||||
| `title` | string | No | metadata |
|
| `title` | string | No | metadata |
|
||||||
| `inputs.speakers_file` | string | No | overrides campaign stable input |
|
| `inputs.speakers_file` | string | No | overrides campaign stable input |
|
||||||
| `inputs.autocorrect_file` | string | No | overrides campaign stable input |
|
| `inputs.autocorrect` | list | No | replaces inherited rules; null or empty clears them |
|
||||||
| `inputs.glossary_file` | string | No | overrides campaign stable input |
|
| `inputs.setting` | string | No | independently overrides the campaign setting selection |
|
||||||
| `inputs.spell_catalog_file` | string | No | overrides the optional campaign spell catalog; empty or omitted inherits the campaign value |
|
| `inputs.system` | string | No | independently overrides the campaign system selection |
|
||||||
|
| `inputs.glossary_file` | string | No | independently overrides the campaign vocabulary file |
|
||||||
|
| `inputs.glossary` | mapping | No | replaces the campaign's inline contribution |
|
||||||
| `inputs.audio_dir` | string | Conditional | local audio mode |
|
| `inputs.audio_dir` | string | Conditional | local audio mode |
|
||||||
| `inputs.audio_files[]` | list[string] | Conditional | local audio mode |
|
| `inputs.audio_files[]` | list[string] | Conditional | local audio mode |
|
||||||
| `inputs.audio_s3.prefix` | string | Conditional | S3 audio mode |
|
| `inputs.audio_s3.prefix` | string | Conditional | S3 audio mode |
|
||||||
|
|
||||||
Audio rules:
|
Audio rules:
|
||||||
|
|
||||||
|
- Audio selection may be omitted when remaining work does not require it;
|
||||||
|
uncovered or forced transcription requires audio.
|
||||||
- configure local mode (`audio_dir` or `audio_files`) or S3 mode (`audio_s3.prefix`), not both.
|
- configure local mode (`audio_dir` or `audio_files`) or S3 mode (`audio_s3.prefix`), not both.
|
||||||
- `audio_s3` requires `pipeline.storage.backend: s3` and a configured S3 bucket.
|
- `audio_s3` requires `pipeline.storage.backend: s3` and a configured S3 bucket.
|
||||||
|
- Explicit `audio_files` take precedence over `audio_dir`. Paths are resolved relative
|
||||||
|
to the session document and must identify regular files. Explicit files and
|
||||||
|
manifest-registered audio may have any suffix or none.
|
||||||
|
- Local directory scans are non-recursive. S3 selection scans the configured
|
||||||
|
prefix relative to the session's S3 prefix. Both use the same case-insensitive
|
||||||
|
candidate suffixes: `.aac`, `.aif`, `.aifc`, `.aiff`, `.alac`, `.amr`,
|
||||||
|
`.ape`, `.au`, `.caf`, `.flac`, `.m4a`, `.m4b`, `.mka`, `.mp2`, `.mp3`,
|
||||||
|
`.mp4`, `.oga`, `.ogg`, `.opus`, `.snd`, `.wav`, `.wave`, `.weba`, `.webm`,
|
||||||
|
`.wma`, and `.wv`. Other entries are ignored by automatic discovery.
|
||||||
|
- Distinct local paths with the same full basename receive distinct prepared
|
||||||
|
names. Speaker IDs use the prepared filename without its final extension. If
|
||||||
|
two resulting IDs match, choose one encoding or rename the recordings. S3
|
||||||
|
objects with the same full basename are rejected.
|
||||||
|
- Selection does not verify encoding. The transcription backend determines
|
||||||
|
whether it can decode the selected bytes.
|
||||||
|
|
||||||
### Storage backend selection
|
### Storage backend selection
|
||||||
|
|
||||||
@@ -685,6 +713,16 @@ select a backend on its own. Unknown backend names and an S3 block paired with
|
|||||||
`--previous-session-id`, however, the session file must contain the same value;
|
`--previous-session-id`, however, the session file must contain the same value;
|
||||||
an omitted or different value is rejected before the command performs work.
|
an omitted or different value is rejected before the command performs work.
|
||||||
|
|
||||||
|
## Shared contract provenance
|
||||||
|
|
||||||
|
Narratio validates the shared glossary, RPG party, and RPG campaign `0.2.0`
|
||||||
|
schemas and their dependency closure offline from schemas distribution
|
||||||
|
`2026.11.1`, commit `f7e3cedeca11ed903311cdf29ca4d81fb1f216b7`.
|
||||||
|
The supplied synthetic catalog data is based on commit
|
||||||
|
`02dd53c6ea026347452d497350c40249c949f8ce`. Installed catalogs are selected
|
||||||
|
independently. See [attribution](oss/attribution.md) and the
|
||||||
|
[integration contracts](integrations/README.md) for tested consumers.
|
||||||
|
|
||||||
## Maintained Examples
|
## Maintained Examples
|
||||||
|
|
||||||
See the [maintained examples index](../examples/README.md) for complete pipeline,
|
See the [maintained examples index](../examples/README.md) for complete pipeline,
|
||||||
|
|||||||
@@ -14,10 +14,14 @@ Agents must read [Agent Policy](policy/agents.md) before recommending, planning,
|
|||||||
or implementing changes. It owns implementation discipline and the default
|
or implementing changes. It owns implementation discipline and the default
|
||||||
commit-after-completed-work rule; it does not authorize pushing or releasing.
|
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), [CommandKit v0.8.0](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/consumers/guide.md), and [ReleaseKit v0.10.0](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/adoption.md); their guides own upstream APIs and behavior.
|
||||||
|
|
||||||
## Go Prerequisite
|
## Go Prerequisite
|
||||||
|
|
||||||
Maintained development and verification require Go 1.26. Use the official Go
|
The Go consumer minimum is 1.27.0, declared in `go.mod`. Maintained development
|
||||||
1.26 toolchain before running repository commands.
|
and verification use the official Go 1.27.4 toolchain. Release validation and
|
||||||
|
builds use the selected patch version and setup instructions in the
|
||||||
|
[release procedure](release.md#release-toolchain).
|
||||||
|
|
||||||
## Policy Reading Guide
|
## Policy Reading Guide
|
||||||
|
|
||||||
@@ -78,9 +82,8 @@ The full suite includes documentation-link and Woodpecker dependency checks
|
|||||||
and loads maintained pipeline and session examples. For focused diagnosis,
|
and loads maintained pipeline and session examples. For focused diagnosis,
|
||||||
run `go test ./internal/doccheck` or
|
run `go test ./internal/doccheck` or
|
||||||
`go test ./internal/config -run '^TestExamplesLoadAndValidate$'` directly;
|
`go test ./internal/config -run '^TestExamplesLoadAndValidate$'` directly;
|
||||||
these are available developer tools, not additional CI steps. Tag CI
|
these are available developer tools, not additional CI steps. Tag CI delivers assets asynchronously from the tagged source; it does not
|
||||||
independently revalidates the tagged source before asynchronous asset delivery;
|
repeat candidate validation. The normal maintainer
|
||||||
it is not a second synchronous release prerequisite. The normal maintainer
|
|
||||||
entry point is the single publication command in the
|
entry point is the single publication command in the
|
||||||
[Release Procedure](release.md).
|
[Release Procedure](release.md).
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ focused stage documents.
|
|||||||
## Integration Contracts
|
## Integration Contracts
|
||||||
|
|
||||||
- [Audita](./audita.md): transcript polishing (`audita process`).
|
- [Audita](./audita.md): transcript polishing (`audita process`).
|
||||||
- [Notarius](./notarius.md): complete pipeline execution and safe JSON bundle
|
- [Notarius](./notarius.md): complete pipeline execution and safe JSON product
|
||||||
discovery (`notarius run`).
|
promotion (`notarius run`).
|
||||||
- [Party](./party.md): canonical campaign roster input.
|
- [Party](./party.md): canonical campaign roster input.
|
||||||
- [Seriatim](./seriatim.md): merge, normalize, trim, and render operations.
|
- [Seriatim](./seriatim.md): merge, normalize, trim, and render operations.
|
||||||
- [Scriptorium](./scriptorium.md): artifact generation and debug rendering
|
- [Scriptorium](./scriptorium.md): artifact generation, prepared previews, and
|
||||||
(`scriptorium run|render`).
|
prompt requirements discovery.
|
||||||
- [WhisperX](./whisperx.md): speaker-audio transcription over HTTP.
|
- [WhisperX](./whisperx.md): speaker-audio transcription over HTTP.
|
||||||
|
|
||||||
## Related Canonical Docs
|
## Related Canonical Docs
|
||||||
|
|||||||
@@ -1,54 +1,46 @@
|
|||||||
# Integration: Audita
|
# Integration: Audita
|
||||||
|
|
||||||
Narratio invokes Audita v2's `process INPUT --glossary PATH --output PATH`
|
Narratio invokes Audita v4.3.0 for polishing. Its adapter supplies the prepared
|
||||||
subprocess for `polish`. The configured timeout and parent cancellation bound
|
party, campaign, setting, and spells documents as repeated `--glossary-file`
|
||||||
execution. Narratio passes explicit `--config`, `--overlay`,
|
arguments, the merged transcript and requested output, and run-local report and
|
||||||
`--proposal-profile`, `--validation-profile`, `--transcript-description`,
|
work destinations. Optional config, overlay, profile, transcript-description,
|
||||||
`--output-schema`, and `--modules` only when selected. An omitted module list
|
and output-schema selectors are forwarded only when set. `audita.debug: true`
|
||||||
leaves Audita's default sequence in place; `modules: []` passes an explicit
|
forwards `--debug`; false adds no debug override. Audita owns its
|
||||||
empty argument and runs no correction modules. Order and repetitions are kept.
|
configuration, ordered pipeline, profiles, and native discovery. Narratio does
|
||||||
Narratio passes no debug, work-directory, or reporting flags, leaving those
|
not generate a downstream configuration. See [Audita configuration](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
||||||
choices to Audita's own configuration.
|
and its [runtime glossary input contract](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/integrations/transcript-glossary-files.md).
|
||||||
|
|
||||||
Audita owns its ConfigKit file, backend and profile definitions, native config
|
All four entry lists are supplied, including empty ones, and replace same-named
|
||||||
discovery, and their validation. Narratio does not create an Audita
|
Audita-configured lists. Other collections and configured instructions retain native downstream
|
||||||
configuration or infer downstream overlay/profile names from its own selected
|
composition; shared collection extensions are data, not prompt guidance. The [configuration reference](../config.md#glossary-inputs)
|
||||||
pipeline overlay. An empty Narratio Audita selector adds no CLI override.
|
explains selection and migration of the prepared inputs.
|
||||||
The [configuration reference](../config.md#audita-selection-and-credentials)
|
|
||||||
owns Narratio's fields and defaults. Audita's
|
|
||||||
[v2 migration guide](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/docs/migrations/v2.md)
|
|
||||||
owns its downstream file format.
|
|
||||||
|
|
||||||
Each name in `pipeline.audita.credentials` is a ConfigKit secret reference
|
After preparation, Narratio runs native Audita preflight when projected polish
|
||||||
resolved when Narratio loads the pipeline. Narratio forwards only the selected
|
work needs execution. The adapter supplies the same selections and prepared
|
||||||
names and their captured, nonempty values under those exact names, in the
|
files with a synthetic transcript. Audita's provider smoke checks remain enabled;
|
||||||
minimal child environment; it never maps them to a fixed alias or rereads the
|
they can contact providers and destination probes can create directories.
|
||||||
parent environment. Every name is registered for captured stdout/stderr and
|
Standalone `preflight` prepares or reuses inputs and checks Audita regardless
|
||||||
failure-diagnostic redaction. Audita resolves credentials for all configured
|
of output reuse, using invocation-scoped probe destinations. A successful check
|
||||||
backends, including unselected ones, so operators must list every backend
|
does not guarantee later real-transcript processing or editorial quality. See
|
||||||
credential that its selected configuration needs. The downstream files and
|
[operations](../operations.md#prompt-requirements-preflight)
|
||||||
provider output remain Audita's responsibility, outside Narratio's
|
and [Audita preflight](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/cli.md#preflight).
|
||||||
captured-stream redaction boundary.
|
|
||||||
|
|
||||||
The corrected transcript is the only canonical polish output. A successful
|
Each `pipeline.audita.credentials` value is an exact ConfigKit secret reference.
|
||||||
invocation must produce a valid JSON transcript with a top-level `segments`
|
Narratio forwards selected names and captured values in the child environment
|
||||||
array within Narratio's 64 MiB bound. Exit zero is accepted even if Audita's
|
and registers them for captured-stream redaction. It does not discover backend
|
||||||
ordinary reports describe recoverable model errors or no corrections. Narratio
|
credentials or scrub files created by Audita. The configured timeout and parent
|
||||||
does not parse report status, counts, or Markdown. It discovers only
|
cancellation initiate subprocess shutdown; completion can take longer while
|
||||||
`errors.yml`, `recoveries.yml`, and `report.md` next to the requested output,
|
process output finishes.
|
||||||
each subject to a 16 MiB read bound. Missing reports are allowed, for example
|
|
||||||
when Audita reporting is disabled externally. Available reports are diagnostic
|
|
||||||
references, not canonical artifact outputs. See Audita's
|
|
||||||
[ordinary output contract](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/docs/integrations/output-files.md)
|
|
||||||
for their schemas, and [operations](../operations.md) for placement and
|
|
||||||
publication.
|
|
||||||
|
|
||||||
On nonzero exit, Narratio preserves the original subprocess error and
|
The corrected transcript is the only canonical polish output. It must be valid
|
||||||
available run-local evidence; it never promotes a transcript merely because
|
JSON with a top-level `segments` array within Narratio's 64 MiB limit. Exit zero
|
||||||
the file exists. The adapter returns safe paths, exit details, and selection
|
is accepted even when ordinary reports describe recoverable errors or no
|
||||||
metadata on failure. Narratio's `audita.generated.v2` YAML records the
|
corrections. Narratio records available `errors.yml`, `recoveries.yml`, and
|
||||||
invocation, including arguments, paths, and credential names but never values;
|
`report.md` from the requested report directory as diagnostics, each subject
|
||||||
it is a diagnostic record, not a generated Audita config file.
|
to a 16 MiB bound. Reports may be absent when disabled. See Audita's
|
||||||
|
[output contract](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/integrations/output-files.md).
|
||||||
|
|
||||||
Maintained Narratio examples: [full annotated pipeline](../../examples/pipeline.full.annotated.yml)
|
On nonzero exit, Narratio preserves the subprocess error and available run-local
|
||||||
and [production-shaped pipeline](../../examples/pipeline.production.yml).
|
evidence and does not promote an incidental transcript. The generated invocation
|
||||||
|
record contains arguments, paths, and credential names, never values; it is a
|
||||||
|
diagnostic record, not an Audita configuration file.
|
||||||
|
|||||||
@@ -1,201 +1,50 @@
|
|||||||
# Notarius Integration Contract
|
# Notarius Integration Contract
|
||||||
|
|
||||||
## Boundary
|
Narratio invokes a separately installed Notarius v0.10.0 executable and the
|
||||||
|
operator's existing Notarius configuration and pipeline. Narratio does not build
|
||||||
Narratio uses Notarius as a subprocess to extract configured structured JSON
|
that configuration. The [Notarius consumer guide](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/consumers/dnd-pipeline.md)
|
||||||
lanes from the final trimmed Seriatim transcript. Narratio owns invocation,
|
owns the maintained pipeline and [CLI](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/cli.md)
|
||||||
safe bundle discovery, lane selection, and its own artifact metadata. Notarius
|
owns its invocation and native output contracts. Controlled local-provider
|
||||||
owns pipeline definitions, lane schemas, the receipt, and bundle formats.
|
compatibility was exercised against commit `752c9b44d2c0bb3bfb1e02a5d4379f7cc5b6261e`.
|
||||||
|
|
||||||
Canonical Notarius v0.8.1 references:
|
|
||||||
|
|
||||||
- [CLI reference](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/cli.md)
|
|
||||||
- [Subprocess consumer contract](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/consumers/subprocess.md)
|
|
||||||
- [D&D pipeline and lane contracts](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/consumers/dnd-pipeline.md)
|
|
||||||
- [Run-result receipt](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/integrations/run-result.md)
|
|
||||||
- [JSON output bundle](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/integrations/json-output.md)
|
|
||||||
- [D&D spell-catalog overlay](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/integrations/dnd-spell-catalog-overlays.md)
|
|
||||||
|
|
||||||
The [complete Narratio example](../../examples/pipeline.full.annotated.yml)
|
|
||||||
records the exact current constraints for all ten D&D lanes. Treat the linked
|
|
||||||
Notarius documents as canonical when changing those values; Narratio does not
|
|
||||||
duplicate the complete schemas.
|
|
||||||
|
|
||||||
## Invocation
|
## Invocation
|
||||||
|
|
||||||
When `pipeline.notarius.enabled` is true, Narratio resolves the executable,
|
Narratio supplies `run <pipeline_id>`, `--config`, `--input-file`, `--output-dir`,
|
||||||
configuration path, input path, output directory, and working directory to
|
`--debug-dir`, and `--format json`. It forwards an explicitly selected overlay,
|
||||||
absolute paths. Configured references require support for the `--reference`
|
cache mode, and reference bindings; debug true requests capture. The configured
|
||||||
contract introduced in Notarius v0.6.0. Cache controls require support for the
|
child credentials are forwarded by exact name and captured streams are redacted.
|
||||||
selected `--resume` and `--chunk_cache` flags. Notarius v0.8.1 is the tested
|
The same selected configuration, credentials, references and cache mode are used
|
||||||
cache integration baseline, not an unconditional minimum version; Narratio
|
for native pipeline inspection and preflight. Preflight may contact providers and
|
||||||
does not impose a runtime version gate. Each reference binding is a separate
|
probe destinations; a synthetic transcript establishes readiness for that input
|
||||||
argument before `--json`. When `pipeline.notarius.config_overlay` is present,
|
only. See [operations](../operations.md#prompt-requirements-preflight).
|
||||||
its exact value is another argument pair before `--json`:
|
|
||||||
|
|
||||||
```text
|
The prepared shared roster can bind to `party`; the combined shared glossary can
|
||||||
notarius run <pipeline_id> --config <config_path> --input <trimmed_json> --output-dir <staging_dir> [--resume] [--chunk_cache <mode>] [--reference <selector>=<verified_snapshot_path>]... [--config-overlay <name>] --json
|
bind to both `glossary` and `spell_catalog`. Notarius owns collection selection,
|
||||||
```
|
D&D recognition, its configuration and caches. See [configuration](../config.md#notarius-reference-bindings).
|
||||||
|
Narratio stage reuse and Notarius cache reuse are separate. Forced extraction
|
||||||
Notarius v0.8.1 is a known supporting version for `--config-overlay`; using the
|
requests native cache refresh.
|
||||||
option requires a compatible Notarius executable, but deployments that omit the
|
|
||||||
field acquire no additional version requirement. Omitted or null configuration
|
|
||||||
adds no flag. Supplied empty, `default`, and named selectors are forwarded
|
|
||||||
without normalization so Notarius can apply its own ConfigKit semantics. This
|
|
||||||
option selects a Notarius configuration overlay, not a PromptKit profile through
|
|
||||||
`--llm-profile`, and Narratio never substitutes its own selected overlay name.
|
|
||||||
A missing or invalid downstream overlay is an ordinary Notarius subprocess
|
|
||||||
failure: Narratio does not retry without the selector or fall back to another
|
|
||||||
overlay.
|
|
||||||
|
|
||||||
Reference paths are absolute stable snapshots streamed from manifest-verified
|
|
||||||
canonical files prepared inside the current Narratio session workspace. They
|
|
||||||
live at `cache/notarius/references/<sha256>/<prepared-basename>` and retain the
|
|
||||||
full lowercase content digest. Narratio verifies snapshot checksum and size
|
|
||||||
before and after the subprocess, reconstructs missing or corrupt regular files
|
|
||||||
from a still-valid prepared source, and passes only configured bindings,
|
|
||||||
ordered lexically by normalized selector, as direct argument-vector entries
|
|
||||||
without shell interpretation. Symlinks, directories, other non-regular
|
|
||||||
conflicts, and prepared-source mismatches fail rather than being deleted. A CLI
|
|
||||||
binding takes precedence over a matching external path in Notarius
|
|
||||||
configuration. Narratio never emits `--without-reference`.
|
|
||||||
|
|
||||||
For canonical party configuration, the `party` binding is the unchanged,
|
|
||||||
validated authored roster and the `players` binding is its generated
|
|
||||||
projection. Both retain their established `narratio.input.party` and
|
|
||||||
`narratio.input.players` source IDs, and both are resolved from the prepared
|
|
||||||
manifest rather than from campaign configuration at extraction time.
|
|
||||||
|
|
||||||
The maintained D&D boundary binds only the four campaign-owned external slots:
|
|
||||||
|
|
||||||
```text
|
|
||||||
notarius run dnd-session \
|
|
||||||
--config <absolute config path> \
|
|
||||||
--input <absolute trimmed transcript path> \
|
|
||||||
--output-dir <absolute staging directory> \
|
|
||||||
--reference glossary=<absolute verified glossary snapshot> \
|
|
||||||
--reference party=<absolute verified party snapshot> \
|
|
||||||
--reference players=<absolute verified players snapshot> \
|
|
||||||
--reference spell_catalog=<absolute verified spell catalog snapshot> \
|
|
||||||
--json
|
|
||||||
```
|
|
||||||
|
|
||||||
The spell-catalog binding is omitted when the campaign does not maintain that
|
|
||||||
optional overlay. Registry, scene-description, combat-turn, and occurrence
|
|
||||||
handoffs generated during the same Notarius run remain in Notarius pipeline
|
|
||||||
composition and must not be emitted as CLI references. The linked CLI and D&D
|
|
||||||
consumer documents own selector targeting, declared slots, media compatibility,
|
|
||||||
and generated-handoff collision rules.
|
|
||||||
|
|
||||||
Standard output is reserved for the JSON receipt. Standard error is captured
|
|
||||||
separately as diagnostic output. Narratio applies the configured timeout and
|
|
||||||
does not interpret stdout as a receipt unless the subprocess exits successfully.
|
|
||||||
It does not pass a Narratio session ID or run `notarius config validate`
|
|
||||||
automatically; the configured working directory and Narratio's minimal child
|
|
||||||
environment apply to the subprocess.
|
|
||||||
|
|
||||||
Ordinary extraction maps `pipeline.notarius.resume: true` to `--resume` and a
|
|
||||||
nonempty `pipeline.notarius.chunk_cache` to `--chunk_cache <mode>`. Forced
|
|
||||||
extraction always omits `--resume` and supplies `--chunk_cache refresh`.
|
|
||||||
Notarius owns checkpoint enablement, recording, identity, and both cache roots;
|
|
||||||
Narratio neither reads nor synthesizes its configuration. Use explicit
|
|
||||||
persistent roots in Notarius when reuse must span subprocess invocations.
|
|
||||||
Changing a reference path/digest or other upstream identity input correctly
|
|
||||||
causes a cold miss. Chunk refresh bypasses lookup and publishes the accepted
|
|
||||||
replacement for the active source; it does not delete unrelated plans or
|
|
||||||
checkpoint state.
|
|
||||||
|
|
||||||
When `pipeline.notarius.credentials` is absent, null, or empty, Narratio adds no
|
|
||||||
credentials to that environment. When configured, each list entry names an
|
|
||||||
environment variable whose already-loaded nonempty value is forwarded under
|
|
||||||
that exact name. Operators must use the names referenced by the selected
|
|
||||||
Notarius/PromptKit providers. Narratio does not inspect the Notarius configuration
|
|
||||||
to infer providers or destination names, and it does not forward unrelated
|
|
||||||
credentials from its parent environment or secrets directory. A Narratio
|
|
||||||
overlay replaces the whole credential list; `[]` clears it.
|
|
||||||
|
|
||||||
Every selected name is registered with Narratio's shared streaming redactor.
|
|
||||||
Credential bytes written by the child to captured stdout, captured stderr, or
|
|
||||||
stderr-derived failure diagnostics are replaced with `<redacted>`, including
|
|
||||||
custom names not known to the built-in sensitive-name list. Narratio does not
|
|
||||||
serialize the credential into arguments, stage metadata, manifests, or
|
|
||||||
generated configuration.
|
|
||||||
|
|
||||||
This captured-stream protection is not a filesystem sandbox. Notarius remains
|
|
||||||
responsible for keeping credentials out of files it writes directly, including
|
|
||||||
bundle artifacts and its own diagnostics. Narratio does not scan or rewrite
|
|
||||||
arbitrary downstream files and cannot promise redaction of transformed or
|
|
||||||
encoded credentials.
|
|
||||||
|
|
||||||
## Accepted Result
|
## Accepted Result
|
||||||
|
|
||||||
Narratio's tested invocation baseline is Notarius v0.8.1. The accepted
|
After a successful exit, Narratio reads the native JSON completion report, checks
|
||||||
receipt remains `notarius.run-result.v2`; reference flags do not change the
|
its pipeline and confined output directory, and validates each configured
|
||||||
receipt or ten-lane output contract. The receipt
|
`lanes/<lane-id>.json` as a safe regular JSON file. It promotes those required
|
||||||
must identify the configured pipeline, and its `index_file` must be exactly
|
lanes to flat session artifacts and records content evidence. The reported
|
||||||
`index.json` beneath the reported bundle root. The production index must name
|
`artifact_count` can include reused or auxiliary results; it is not an inventory.
|
||||||
the management files exactly as `manifest.json`, `rejected.json`,
|
Optional `chunk-map.json` and `evidence-context.json` stay in the original
|
||||||
`warnings.json`, and `diagnostics.json`. All receipt, index, and lane paths must
|
bundle, which is subject to Narratio cleanup. Selected canonical products and
|
||||||
stay inside that bundle; symlinks and non-regular lane payloads are rejected.
|
their recorded evidence support reuse without that bundle. A positive native
|
||||||
|
`fallback_count` remains visible in fresh and reused reports.
|
||||||
|
|
||||||
Supported receipt and index shapes tolerate unknown fields for forward
|
Nonzero exit, malformed completion, unsafe output, or a missing required lane
|
||||||
compatibility, while required identity, validation, count, manifest,
|
fails extraction. Diagnostics and available files remain for investigation; an
|
||||||
rejection, warning, diagnostic, and lane-list fields remain mandatory.
|
incidental file or partial report does not establish success. See
|
||||||
Narratio applies bounded reads to the receipt, index, rejection, warning, and
|
[extraction operations](../operations.md#extraction-workflow).
|
||||||
diagnostic documents. Warning and diagnostic envelopes, group counts,
|
|
||||||
occurrence counts, truncation state, framework-owned origins, and
|
|
||||||
receipt-to-bundle counts must be internally consistent. Optional chunk-map and
|
|
||||||
evidence-context descriptors must carry their complete generic contract
|
|
||||||
metadata when present.
|
|
||||||
|
|
||||||
For every entry in `pipeline.notarius.outputs`, Narratio requires exactly one
|
|
||||||
index descriptor with the configured lane ID, media type, schema ID, schema
|
|
||||||
version, and, when configured, module key. Missing, duplicate, rejected, or
|
|
||||||
incompatible required lanes fail extraction even if Notarius exited zero. A
|
|
||||||
configured lane whose v2 validation summary is `rejected` or `incomplete` also
|
|
||||||
fails extraction.
|
|
||||||
An accepted reused producer may report `producer_attempt_count: 0`; Narratio
|
|
||||||
preserves that valid summary rather than treating it as a missing field.
|
|
||||||
Unconfigured lanes may remain in the preserved bundle but do not become
|
|
||||||
selectable Narratio sources.
|
|
||||||
|
|
||||||
Each accepted configured lane is registered as
|
|
||||||
`narratio.extraction.<output_key>`. The bundle index is retained for audit and
|
|
||||||
resume validation but is not selectable. Scriptorium and publish rules consume
|
|
||||||
only explicitly named lane sources; `--artifacts` never selects Notarius lanes.
|
|
||||||
|
|
||||||
## Failure And Compatibility Behavior
|
|
||||||
|
|
||||||
- Startup and nonzero-exit errors fail extraction and retain captured diagnostics.
|
|
||||||
- Invalid receipt JSON or an unsupported receipt schema fails before bundle use.
|
|
||||||
- Unsafe or incompatible index data and required-lane rejection fail before the
|
|
||||||
staged bundle is promoted to durable storage.
|
|
||||||
- Contract and external provenance metadata are preserved on lane artifact
|
|
||||||
records and through explicit publication.
|
|
||||||
- Undeclared selectors, incompatible reference files, and external/generated
|
|
||||||
reference collisions are Notarius errors and fail extraction normally.
|
|
||||||
|
|
||||||
Rejection, validation, warning, and diagnostic summaries retain bounded stable
|
|
||||||
identity, category, origin, reason-code, status, and occurrence fields without
|
|
||||||
copying free-form external messages into Narratio manifest metadata or reading
|
|
||||||
lane payload bodies.
|
|
||||||
|
|
||||||
Configuration fields and defaults are in [Configuration](../config.md).
|
|
||||||
Operator paths, rerun procedures, and bundle retention are in
|
|
||||||
[Operations](../operations.md). See [Troubleshooting](../troubleshooting.md)
|
|
||||||
for failure recovery.
|
|
||||||
|
|
||||||
## Opt-in Integration Test
|
## Opt-in Integration Test
|
||||||
|
|
||||||
The production-boundary cache test requires an absolute path to a locally
|
The [catalog compatibility script](https://forge.maximumdirect.net/eric/narratio-reference-catalog/src/commit/016473fd16b15847f3e913670c423faa7c35720b/scripts/check-compatibility.sh)
|
||||||
built Notarius v0.8.1-compatible executable. It uses only a local
|
accepts explicit Narratio and Notarius checkouts and Audita and Notarius binary
|
||||||
OpenAI-compatible `httptest` provider and temporary cache/config/output roots:
|
paths. It uses a controlled local provider and verifies readiness, the ten-lane
|
||||||
|
pipeline, flat promotion, cache reuse, and forced refresh. Ordinary tests skip
|
||||||
```sh
|
external binaries.
|
||||||
NARRATIO_TEST_NOTARIUS_BINARY=/absolute/path/to/notarius \
|
|
||||||
GOWORK=off go test ./internal/stage \
|
|
||||||
-run '^TestNotariusCacheReuseIntegration$' -count=1 -v
|
|
||||||
```
|
|
||||||
|
|
||||||
When the variable is unset, the normal test suite skips this test and never
|
|
||||||
searches `PATH`, a sibling checkout, the network, or a real provider.
|
|
||||||
|
|||||||
@@ -1,71 +1,27 @@
|
|||||||
# Canonical Party Input
|
# Canonical Party Input
|
||||||
|
|
||||||
`party.yml` is a campaign-owned roster input. It must be a single, versioned
|
`party.yml` is a campaign-owned roster conforming to the [shared RPG party
|
||||||
`narratio.party.v1` document when Narratio resolves a pipeline, campaign, and
|
contract](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/rpg/party/v0.2.0/semantics.md).
|
||||||
session together.
|
ConfigKit resolves native imports before Narratio validates the complete roster.
|
||||||
|
Shared extensions and the authored null or empty `aliases` values survive in the
|
||||||
|
prepared party document and native inspection.
|
||||||
|
|
||||||
```yaml
|
Narratio additionally requires a nonempty roster, stable character IDs using the
|
||||||
schema_version: narratio.party.v1
|
configured-artifact key grammar, player and character names, and at least one
|
||||||
|
class per character. Names, aliases, and class names must be nonempty, trimmed
|
||||||
|
strings without control characters. Character names and aliases cannot be
|
||||||
|
ambiguous under case-insensitive comparison; class names cannot repeat within
|
||||||
|
one character. Player names may repeat. A supplied class level must be positive.
|
||||||
|
|
||||||
characters:
|
The maintained [party example](../../examples/campaigns/sample-campaign/party.yml)
|
||||||
arannis:
|
shows the shared marker and plural `aliases` field. The configuration reference
|
||||||
player:
|
owns party selection and source-relative paths.
|
||||||
name: Eric
|
|
||||||
character:
|
|
||||||
name: Arannis
|
|
||||||
alias:
|
|
||||||
- Ari
|
|
||||||
- The Grey Owl
|
|
||||||
classes:
|
|
||||||
- name: wizard
|
|
||||||
level: 8
|
|
||||||
```
|
|
||||||
|
|
||||||
`characters` is a non-empty mapping. Each key is a stable character ID using
|
|
||||||
the configured-artifact key grammar: a lowercase ASCII letter followed by zero
|
|
||||||
or more lowercase ASCII letters, digits, or underscores. Character order is
|
|
||||||
preserved where roster order matters.
|
|
||||||
|
|
||||||
Every entry has `player.name`, `character.name`, and a non-empty
|
|
||||||
`character.classes` list. Class entries require a non-empty `name` and may
|
|
||||||
include a positive integer `level`. The optional, intentionally singular
|
|
||||||
`character.alias` field is a list. Names, aliases, and class names must be
|
|
||||||
non-empty, trimmed display strings without control characters. Character names
|
|
||||||
and aliases must be unique across the full roster under Unicode-aware
|
|
||||||
case-insensitive comparison; player names may repeat.
|
|
||||||
|
|
||||||
The document has exactly one YAML document and accepts no unknown fields.
|
|
||||||
`schema_version` is required: a missing, wrong, or malformed value is an error.
|
|
||||||
|
|
||||||
## Migration
|
|
||||||
|
|
||||||
Unversioned party inputs are rejected. Replace each legacy party document with
|
|
||||||
the versioned structure above, move each roster entry under `characters`, and
|
|
||||||
remove separate player and session-party settings: those keys are unsupported.
|
|
||||||
|
|
||||||
The configuration rules and source-relative path behavior are defined in the
|
|
||||||
[Configuration Reference](../config.md).
|
|
||||||
|
|
||||||
## Derived players document
|
## Derived players document
|
||||||
|
|
||||||
During `prepare`, Narratio copies the canonical party source bytes unchanged
|
During preparation, Narratio writes the resolved shared roster to
|
||||||
to `inputs/party.yml` and writes this deterministic players-only projection to
|
`inputs/party.yml` and derives `inputs/players.yml`. The projection uses
|
||||||
`inputs/players.yml`:
|
`narratio.players.v1`, contains one entry per character sorted by stable ID,
|
||||||
|
and keeps its existing singular `alias` field. It contains player and character
|
||||||
```yaml
|
names and aliases, but no class data. Repeated player names remain separate
|
||||||
schema_version: narratio.players.v1
|
entries. Its manifest source is `derived_from_party`.
|
||||||
players:
|
|
||||||
- name: Eric
|
|
||||||
character:
|
|
||||||
id: arannis
|
|
||||||
name: Arannis
|
|
||||||
alias:
|
|
||||||
- Ari
|
|
||||||
- The Grey Owl
|
|
||||||
```
|
|
||||||
|
|
||||||
There is one entry per character, sorted by stable character ID. Repeated
|
|
||||||
player names remain separate entries. The optional `alias` list retains its
|
|
||||||
declared order and is omitted when empty. The projection carries no class
|
|
||||||
data. Its prepared manifest record is marked `derived_from_party`; it is not a
|
|
||||||
separate user-provided `players_file`.
|
|
||||||
|
|||||||
@@ -1,71 +1,57 @@
|
|||||||
# Integration: Scriptorium
|
# Integration: Scriptorium
|
||||||
|
|
||||||
## Purpose
|
## Boundary
|
||||||
Define the Scriptorium adapter contract used by `analyze` and trim-bounds generation in `trim`.
|
|
||||||
|
|
||||||
## External Boundary
|
Narratio uses the independently installed Scriptorium v0.16.0 native CLI for
|
||||||
|
trim bounds and configured analysis artifacts. It invokes `run PROMPT_ID` for
|
||||||
|
generation, `promptkit show prepared PROMPT_ID` for optional preview, and
|
||||||
|
`promptkit requirements show PROMPT_ID` for early discovery. Scriptorium owns
|
||||||
|
prompt, profile, backend, and private configuration resolution. The
|
||||||
|
[upstream CLI migration guide](https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/consumers/upgrading-cli.md)
|
||||||
|
and [subprocess contract](https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/integrations/subprocess.md)
|
||||||
|
own the native interface and deployment migration.
|
||||||
|
|
||||||
Narratio invokes Scriptorium as a subprocess in these modes:
|
Configured glossary inputs use explicit prepared `narratio.input.glossary.*`
|
||||||
|
source IDs while prompt input names remain independently configured bindings.
|
||||||
|
See [glossary inputs](../config.md#glossary-inputs).
|
||||||
|
|
||||||
- `scriptorium run`
|
Generation selects artifact-only text output. Preview and requirements use
|
||||||
- `scriptorium render`
|
native JSON. Narratio forwards selected configuration and profile identifiers,
|
||||||
|
sorted repeated `--input-file NAME=PATH` bindings where files are needed, and
|
||||||
|
repeated `--var KEY=VALUE` assignments. Commas and later equals signs remain
|
||||||
|
literal. Discovery supplies no input paths and makes no model call. Narratio's
|
||||||
|
supervisor deadline covers each invocation; generation also forwards the same
|
||||||
|
duration as `--run-timeout`, separate from Scriptorium's per-attempt timeout.
|
||||||
|
|
||||||
The request timeout and parent cancellation bound each invocation. Internal
|
## Streams And Outcomes
|
||||||
runner composition is documented in
|
|
||||||
[the adapter implementation guide](../internal/adapters.md).
|
|
||||||
|
|
||||||
## Request Contract
|
Narratio captures stdout directly into the run-local artifact or preview, or
|
||||||
Both request types carry:
|
into memory for discovery. Result bytes are preserved and limited to 64 MiB;
|
||||||
- binary/config/prompt/profile IDs;
|
they are not diagnostic logs and are not redacted. Treat generated artifacts
|
||||||
- input map and vars map;
|
and prepared previews as potentially sensitive. Stderr remains separately
|
||||||
- output path;
|
bounded and redacted. A capture failure aborts the supervised subprocess.
|
||||||
- timeout;
|
|
||||||
- generated config + stdout/stderr log paths;
|
|
||||||
- optional API-key env var name;
|
|
||||||
- optional working directory.
|
|
||||||
|
|
||||||
## Result Contract
|
A successful generation or preview must produce a nonempty result; preview must
|
||||||
`ArtifactResult` returns:
|
also be valid JSON. Narratio validates the result before stage-owned canonical
|
||||||
- output/log/generated-config paths;
|
promotion. A nonzero outcome or delivery failure remains an error even if
|
||||||
- exit code and duration;
|
stdout contains bytes. Native exit status 4 identifies completed generated
|
||||||
- command mode (`run` or `render`);
|
content validation failure; status 2 is a usage or configuration failure.
|
||||||
- prompt/profile provenance;
|
Invocation records describe the actual arguments and stdout destination.
|
||||||
- `ValidationFailed` marker;
|
|
||||||
- metadata map.
|
|
||||||
|
|
||||||
## Validation and Failure Semantics
|
Requirements discovery returns the native inventories, identities,
|
||||||
Request validation fails for:
|
completeness, and structured issues. A successful partial report is distinct
|
||||||
- missing binary, prompt id, or output path;
|
from a process or decoding failure. Narratio compares the reported requirements
|
||||||
- non-positive timeout;
|
with its intended bindings; discovery does not establish future file availability
|
||||||
- empty input/var names;
|
or guarantee a later model call. See [preflight internals](../internal/preflight.md)
|
||||||
- empty input path values;
|
and the [upstream requirements contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#promptkit-requirements).
|
||||||
- missing required credential env var when `APIKeyEnv` is set.
|
|
||||||
|
|
||||||
Run behavior:
|
## Credentials And Configuration
|
||||||
- subprocess errors propagate with context;
|
|
||||||
- `run` exit code `2` is mapped to `ValidationFailed=true`;
|
|
||||||
- successful subprocess still fails if output file is missing or empty.
|
|
||||||
|
|
||||||
Each artifact result is limited to 64 MiB and must be a regular file without
|
Selected ConfigKit secret references are forwarded by exact environment name
|
||||||
symlinked path components.
|
for discovery, preview, and generation. Their captured values are registered
|
||||||
|
for stderr diagnostic redaction, while invocation records retain names only.
|
||||||
Render behavior:
|
Narratio does not choose the provider or pass a direct API-key override. This
|
||||||
- subprocess errors propagate;
|
does not scrub arbitrary result content or files written by Scriptorium. See
|
||||||
- output file must exist and be non-empty.
|
[Scriptorium credentials](../config.md#scriptorium-credentials) and
|
||||||
|
[artifact entries](../config.md#scriptorium-artifact-entries) for Narratio's
|
||||||
## Deterministic Behavior
|
configuration and binding semantics.
|
||||||
- input and var maps are sorted into deterministic `--input` and `--var` CLI args.
|
|
||||||
- stage wiring adds `session_id=narratio-session-<session_id>` to every Scriptorium request for sticky upstream routing, overriding any configured `vars.session_id`.
|
|
||||||
- generated invocation YAML (`scriptorium.generated.v1`) is emitted when requested.
|
|
||||||
- adapter is stateless and does not own artifact-selection policy.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Operator-selected values are defined under `pipeline.scriptorium.*`, including
|
|
||||||
per-artifact settings under `pipeline.scriptorium.artifacts.*`, in the
|
|
||||||
[configuration reference](../config.md#pipeline).
|
|
||||||
|
|
||||||
Maintained examples with Scriptorium config:
|
|
||||||
|
|
||||||
- [Full annotated pipeline](../../examples/pipeline.full.annotated.yml)
|
|
||||||
- [Production-shaped pipeline](../../examples/pipeline.production.yml)
|
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ Narratio invokes Seriatim as a subprocess in these modes:
|
|||||||
- `seriatim trim`
|
- `seriatim trim`
|
||||||
- `seriatim render`
|
- `seriatim render`
|
||||||
|
|
||||||
The configured timeout and parent cancellation bound each invocation. Internal
|
The configured timeout and parent cancellation initiate subprocess shutdown;
|
||||||
|
completion can take longer while process output finishes. Internal
|
||||||
runner composition is documented in
|
runner composition is documented in
|
||||||
[the adapter implementation guide](../internal/adapters.md).
|
[the adapter implementation guide](../internal/adapters.md).
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ Narratio sends an HTTP `POST` to the configured transcription URL using
|
|||||||
- `language`: the configured language string.
|
- `language`: the configured language string.
|
||||||
|
|
||||||
The server must return a `2xx` response whose body is valid JSON. Narratio does
|
The server must return a `2xx` response whose body is valid JSON. Narratio does
|
||||||
not currently require a more specific response schema at this boundary.
|
not currently require a more specific response schema at this boundary. The
|
||||||
|
backend determines codec and container support; a malformed or unsupported
|
||||||
|
recording remains a transcription failure. Narratio does not transcode or probe
|
||||||
|
the selected audio. See [audio selection](../config.md#session).
|
||||||
|
|
||||||
The transcription URL must be an absolute `http` or `https` URL. Each
|
The transcription URL must be an absolute `http` or `https` URL. Each
|
||||||
application attempt creates one bounded multipart framing and streams the audio
|
application attempt creates one bounded multipart framing and streams the audio
|
||||||
|
|||||||
@@ -61,27 +61,32 @@ state without constructing or invoking stage-execution adapters. The shared
|
|||||||
command configuration loader may still use object storage to retrieve a missing
|
command configuration loader may still use object storage to retrieve a missing
|
||||||
remote session file before planning begins.
|
remote session file before planning begins.
|
||||||
|
|
||||||
Notarius is composed only when extraction is enabled; the extract stage owns
|
After preparation, the application projects remaining selected work and uses
|
||||||
prepared reference resolution, receipt, bundle, and configured-lane policy.
|
invocation-owned Audita, Notarius, and Scriptorium runners for applicable
|
||||||
The adapter validates the ordered selector/absolute-path pairs and is the sole
|
readiness checks. The same runners are available to processing. Standalone
|
||||||
owner of serializing them as repeated `--reference` arguments before `--json`.
|
preflight prepares inputs through the same lifecycle and uses invocation-owned
|
||||||
It also serializes an effective resume request as `--resume` and a nonempty
|
factories for all enabled readiness checks. See
|
||||||
validated chunk mode as `--chunk_cache <mode>`. The extract stage, not the
|
[preflight internals](preflight.md).
|
||||||
adapter, resolves force precedence before constructing the request.
|
|
||||||
|
Notarius is composed only when extraction is enabled. The stage resolves
|
||||||
|
prepared references and promotes configured products; the adapter builds native
|
||||||
|
inspection, preflight, and run commands, resolves the executable and native
|
||||||
|
lane paths, and validates the completion report.
|
||||||
|
Force selects native cache refresh before request construction.
|
||||||
Its request may also carry already-resolved ConfigKit secret references.
|
Its request may also carry already-resolved ConfigKit secret references.
|
||||||
Audita's request carries the same kind of list. Both adapters use the shared
|
Audita and Scriptorium requests carry the same kind of list. All three adapters use the shared
|
||||||
subprocess helper to convert their selected references into exact-name child
|
subprocess helper to convert their selected references into exact-name child
|
||||||
environment overrides and sensitive-name registration. That helper rejects
|
environment overrides and sensitive-name registration. That helper rejects
|
||||||
unresolved or empty programmatic references, but neither adapter rereads the
|
unresolved or empty programmatic references, but no adapter rereads the
|
||||||
parent environment or inspects downstream configuration to discover names.
|
parent environment or inspects downstream configuration to discover names.
|
||||||
Empty lists add no credential overrides. See the public [Audita](../integrations/audita.md)
|
Empty lists add no credential overrides. See the public [Audita](../integrations/audita.md)
|
||||||
and [Notarius](../integrations/notarius.md) contracts for selection and
|
[Notarius](../integrations/notarius.md), and [Scriptorium](../integrations/scriptorium.md) contracts for selection and
|
||||||
downstream-file boundaries.
|
downstream-file boundaries.
|
||||||
|
|
||||||
Application-owned object-store construction loads configured filesystem
|
Invocation configuration acquisition calls [ConfigKit configured startup](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap);
|
||||||
secrets before invoking the invocation's storage factory. Production commands
|
the storage factory consumes resolved values. [Operations](../operations.md#workspace-permissions)
|
||||||
use the concrete storage adapter constructor; focused tests can supply an
|
describes credential permissions. Production commands use the concrete storage
|
||||||
in-memory backend without changing package state.
|
adapter constructor; focused tests can supply an in-memory backend.
|
||||||
|
|
||||||
## Failure Semantics
|
## Failure Semantics
|
||||||
|
|
||||||
@@ -95,11 +100,15 @@ in-memory backend without changing package state.
|
|||||||
for remaining group members and uses bounded graceful then forceful termination.
|
for remaining group members and uses bounded graceful then forceful termination.
|
||||||
Cancellation, deadlines, and
|
Cancellation, deadlines, and
|
||||||
diagnostic limits use the same terminal disposal path without losing their
|
diagnostic limits use the same terminal disposal path without losing their
|
||||||
original result classification. Child environments contain only the execution
|
original result classification. Escalation is bounded, but the command waiter
|
||||||
|
and output copying are joined before logs are flushed or ownership returns;
|
||||||
|
blocked I/O may prolong shutdown and workspace lock ownership. Child environments contain only the execution
|
||||||
baseline and adapter-specified values; configured credentials are resolved
|
baseline and adapter-specified values; configured credentials are resolved
|
||||||
once by ConfigKit and passed explicitly as sensitive values. Adapters do not
|
once by ConfigKit and passed explicitly as sensitive values. Adapters do not
|
||||||
re-read their named environment references. Stdout and stderr are redacted while streaming into separate
|
re-read their named environment references. Diagnostic-only stdout and stderr
|
||||||
8 MiB diagnostic captures; a bounded wait closes a stream retained by a
|
are redacted while streaming into separate 8 MiB captures. Scriptorium result
|
||||||
|
mode directs stdout to a caller-owned, byte-preserving bounded writer instead;
|
||||||
|
capture failures use the same abort path. A bounded wait closes a stream retained by a
|
||||||
departed leader's descendant. Unsupported platforms reject owned command
|
departed leader's descendant. Unsupported platforms reject owned command
|
||||||
execution.
|
execution.
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,15 @@ validator. The focused stage documents own their input/output flow;
|
|||||||
All formats are validated by strict source-policy rules. Configured artifact and
|
All formats are validated by strict source-policy rules. Configured artifact and
|
||||||
extraction keys use `^[a-z][a-z0-9_]*$`; source parsers never normalize an
|
extraction keys use `^[a-z][a-z0-9_]*$`; source parsers never normalize an
|
||||||
unrecognized token into a valid source. Extraction sources are registered only
|
unrecognized token into a valid source. Extraction sources are registered only
|
||||||
from `pipeline.notarius.outputs`; the Notarius index has no selectable source
|
from `pipeline.notarius.outputs`; the original bundle is not a selectable
|
||||||
ID.
|
source.
|
||||||
|
|
||||||
Prepared stable source IDs are `narratio.input.players`,
|
Prepared stable source IDs are `narratio.input.players`,
|
||||||
`narratio.input.party`, `narratio.input.glossary`, and
|
`narratio.input.party`, `narratio.input.glossary.party`,
|
||||||
`narratio.input.spell_catalog`. Artifact policy owns their canonical manifest
|
`narratio.input.glossary.campaign`, `narratio.input.glossary.setting`,
|
||||||
|
`narratio.input.glossary.spells`, and `narratio.input.glossary.combined`. Artifact policy owns their canonical manifest
|
||||||
kind and prepared filename vocabulary. Canonical party mode preserves the
|
kind and prepared filename vocabulary. Canonical party mode preserves the
|
||||||
party source bytes in the party record and supplies the players record from the
|
effective standalone party document in the party record and supplies the players record from the
|
||||||
deterministic `derived_from_party` projection; both remain ordinary prepared
|
deterministic `derived_from_party` projection; both remain ordinary prepared
|
||||||
source IDs for consumers.
|
source IDs for consumers.
|
||||||
|
|
||||||
@@ -58,20 +59,24 @@ Configured definitions are always registered. Without an explicit selection,
|
|||||||
the effective analyze set contains enabled definitions. With `--artifacts`, the
|
the effective analyze set contains enabled definitions. With `--artifacts`, the
|
||||||
exact named configured definitions become the effective set for that invocation,
|
exact named configured definitions become the effective set for that invocation,
|
||||||
regardless of their `enabled` value. The effective-set resolver itself does not
|
regardless of their `enabled` value. The effective-set resolver itself does not
|
||||||
expand dependencies. Configuration has already materialized the sorted union of
|
expand dependencies. Shared domain catalog derivation has materialized the sorted
|
||||||
explicit ordering edges and configured-artifact input edges, and the analyze
|
union of explicit ordering edges and configured-artifact input edges. The
|
||||||
work planner closes targets over that one concrete prerequisite graph.
|
derived catalog holds an immutable `internal/artifactdeps` graph shared by
|
||||||
Availability is separate from executability. Configuration may normalize a
|
validation, prerequisite ordering, and analysis planning. Supplied products can
|
||||||
|
stop prerequisite traversal; explicit forced targets still include their
|
||||||
|
prerequisites.
|
||||||
|
Availability is separate from executability. Invocation selection normalizes a
|
||||||
family selection into its concrete generated members before this resolver runs.
|
family selection into its concrete generated members before this resolver runs.
|
||||||
The effective set retains optional family
|
The effective set retains optional family
|
||||||
and character origin metadata, but its keys, catalog sources, and runtime
|
and character origin metadata, but its keys, catalog sources, and runtime
|
||||||
lookups remain concrete configured-artifact identities.
|
lookups remain concrete configured-artifact identities.
|
||||||
Family publish policies are likewise expanded into ordinary configured-source
|
Family publish policies are likewise expanded into ordinary configured-source
|
||||||
publish rules during configuration resolution.
|
publish actions during domain catalog derivation.
|
||||||
Configured outputs, including non-executable prerequisites, become available
|
Configured outputs, including non-executable prerequisites, become available
|
||||||
only when the versioned analyze state identifies a current result whose source,
|
when the versioned analyze state identifies a current result whose source,
|
||||||
contract, canonical configured path, size, and checksum match a confined
|
contract, canonical configured path, size, and checksum match a confined
|
||||||
no-follow regular file. An incidental canonical file is unavailable, and a
|
no-follow regular file, or when a supplied record validates against that path
|
||||||
|
and its bytes. An incidental canonical file is unavailable, and a
|
||||||
manifest with an unsupported aggregate-only representation is rejected before
|
manifest with an unsupported aggregate-only representation is rejected before
|
||||||
catalog construction.
|
catalog construction.
|
||||||
Extraction entries are registered from configuration and become available only
|
Extraction entries are registered from configuration and become available only
|
||||||
@@ -87,6 +92,7 @@ Current provenance values:
|
|||||||
|
|
||||||
- `generated.current_analyze_run`
|
- `generated.current_analyze_run`
|
||||||
- `manifest.current_analyze_artifact`
|
- `manifest.current_analyze_artifact`
|
||||||
|
- `manifest.supplied_product`
|
||||||
- `manifest.inputs.previous_cache`
|
- `manifest.inputs.previous_cache`
|
||||||
- `current_session.previous_cache`
|
- `current_session.previous_cache`
|
||||||
|
|
||||||
@@ -94,10 +100,11 @@ Current provenance values:
|
|||||||
|
|
||||||
Built-ins:
|
Built-ins:
|
||||||
|
|
||||||
- resolve only from the current manifest's succeeded registered producer;
|
- resolve from validated supplied records or the current manifest's succeeded
|
||||||
- require exactly one output with the registered source ID and output kind, a
|
registered producer;
|
||||||
safe session-rooted path, producer run ID, canonical checksum, and valid
|
- for generated products, require exactly one output with the registered source
|
||||||
content; and
|
ID and output kind, a safe session-rooted path, producer run ID, canonical
|
||||||
|
checksum, and valid content; and
|
||||||
- verify the registered checksum against the durable bytes. Incidental files,
|
- verify the registered checksum against the durable bytes. Incidental files,
|
||||||
canonical filenames, duplicate outputs, failed/stale producer records, and
|
canonical filenames, duplicate outputs, failed/stale producer records, and
|
||||||
malformed evidence are unavailable.
|
malformed evidence are unavailable.
|
||||||
@@ -105,9 +112,10 @@ Built-ins:
|
|||||||
Configured sources (`narratio.artifact.*`):
|
Configured sources (`narratio.artifact.*`):
|
||||||
|
|
||||||
- resolve only through runtime catalog availability;
|
- resolve only through runtime catalog availability;
|
||||||
|
- accept a validated supplied record without historical analyze evidence;
|
||||||
- use the shared typed analyze-evidence inspection in
|
- use the shared typed analyze-evidence inspection in
|
||||||
`analyze_evidence.go` for prior current-session results;
|
`analyze_evidence.go` for prior current-session results;
|
||||||
- require the supported analyze-state and fingerprint versions, a `current`
|
- for generated products, require the supported analyze-state and fingerprint versions, a `current`
|
||||||
record for the exact configured key and source ID, a complete contract, the
|
record for the exact configured key and source ID, a complete contract, the
|
||||||
configured canonical relative path, positive stored size, and stored
|
configured canonical relative path, positive stored size, and stored
|
||||||
checksum matching bytes read from a confined no-follow regular file; and
|
checksum matching bytes read from a confined no-follow regular file; and
|
||||||
@@ -131,10 +139,13 @@ Prepared stable sources (`narratio.input.*`):
|
|||||||
|
|
||||||
Extraction sources (`narratio.extraction.*`):
|
Extraction sources (`narratio.extraction.*`):
|
||||||
|
|
||||||
- use the shared typed bundle evidence inspection in `extraction_evidence.go`;
|
- accept individually validated supplied products without historical Notarius
|
||||||
- require a current successful extract record with the exact configured source,
|
metadata or transcript fingerprints; all configured products must be present
|
||||||
compatible contract and Notarius provenance, a confined regular durable
|
to satisfy extraction as a whole;
|
||||||
payload, matching checksum, and the current resolved trimmed-transcript
|
- use the shared product evidence inspection in `extraction_evidence.go`;
|
||||||
|
- for locally generated products, require a current successful extract record with the exact configured source,
|
||||||
|
Notarius provenance, a confined regular flat product with matching size and
|
||||||
|
checksum, and the current resolved trimmed-transcript
|
||||||
identity;
|
identity;
|
||||||
- remain unavailable unless catalog hydration receives valid evidence. Resume
|
- remain unavailable unless catalog hydration receives valid evidence. Resume
|
||||||
treats absent or obsolete evidence as a rerun decision and unsafe evidence as
|
treats absent or obsolete evidence as a rerun decision and unsafe evidence as
|
||||||
@@ -156,7 +167,8 @@ separate from a stage's lifecycle outcome.
|
|||||||
|
|
||||||
Validation by content type:
|
Validation by content type:
|
||||||
|
|
||||||
- transcript JSON built-ins: JSON with top-level `segments` array;
|
- transcript JSON built-ins: JSON with top-level `segments` array, validated
|
||||||
|
through the shared `internal/contracts` envelope predicate;
|
||||||
- transcript Markdown built-ins: non-empty text file;
|
- transcript Markdown built-ins: non-empty text file;
|
||||||
- bounds built-in: valid JSON;
|
- bounds built-in: valid JSON;
|
||||||
- configured/previous-session artifact files: non-empty text file.
|
- configured/previous-session artifact files: non-empty text file.
|
||||||
@@ -165,22 +177,32 @@ Validation by content type:
|
|||||||
|
|
||||||
`CollectPreviousArtifactRequirements`:
|
`CollectPreviousArtifactRequirements`:
|
||||||
|
|
||||||
- scans the effective configured artifact set;
|
- expands the effective target set to its full configured prerequisite closure,
|
||||||
|
including disabled prerequisites, independently of artifact reuse;
|
||||||
|
- scans only definitions in that closure;
|
||||||
- extracts only canonical previous-session sources;
|
- extracts only canonical previous-session sources;
|
||||||
- deduplicates by artifact key;
|
- deduplicates by artifact key;
|
||||||
- merges required and optional references (required wins);
|
- merges required and optional references (required wins);
|
||||||
- returns deterministic ordering and source locations.
|
- returns deterministic ordering and source locations.
|
||||||
|
|
||||||
|
`PreviousArtifactRequirementsForKeys` applies the same source collection to
|
||||||
|
planned generation and reused local checkpoint keys. Bounded reference
|
||||||
|
preparation uses it after analysis planning has resolved supplied-product reuse
|
||||||
|
boundaries.
|
||||||
|
|
||||||
## Current-State Helpers
|
## Current-State Helpers
|
||||||
|
|
||||||
Artifacts package owns shared remote current-state loading mechanics used by
|
Artifacts package owns shared remote current-state loading mechanics used by
|
||||||
restore, status and validation checks, and previous-cache planning.
|
restore, status and validation checks, and previous-cache planning.
|
||||||
|
`LoadCurrentInventory` reads and verifies the pointer-selected commit without
|
||||||
|
fetching an execution snapshot. Status, publication inspection, and session
|
||||||
|
configuration acquisition and previous-session acquisition use that inventory.
|
||||||
|
Restore uses the same inventory. Obsolete execution-snapshot declarations are
|
||||||
|
ignored without reading their contents; unsupported local progress must be moved
|
||||||
|
aside before creating a new local baseline.
|
||||||
|
|
||||||
The selected session manifest is accepted only with
|
Session inspection collects local catalog, remote publication and lock, and
|
||||||
`schema_version: narratio.session-manifest.v1` and complete stage identity.
|
input-readiness evidence separately before projecting its existing report.
|
||||||
An unsupported local or downloaded manifest must be replaced by regeneration,
|
|
||||||
verified restore, or republication; artifact resolution never fills in missing
|
|
||||||
authority markers.
|
|
||||||
|
|
||||||
For a new-protocol current state, the pointer-selected immutable commit is the
|
For a new-protocol current state, the pointer-selected immutable commit is the
|
||||||
complete restore authority. Callers receive its declared object identities and
|
complete restore authority. Callers receive its declared object identities and
|
||||||
@@ -192,10 +214,9 @@ Only this declaration type may refer to an earlier run; other declared objects
|
|||||||
remain confined to the selected commit's run.
|
remain confined to the selected commit's run.
|
||||||
|
|
||||||
The reader opens each small control object directly and enforces owner-specific
|
The reader opens each small control object directly and enforces owner-specific
|
||||||
limits before decoding: 64 KiB for the mutable commit pointer, 4 MiB for the
|
limits before decoding: 64 KiB for the mutable commit pointer and 4 MiB for the
|
||||||
immutable commit manifest, and 8 MiB for the selected session manifest. These
|
immutable commit manifest. These are exposed as `MaxCurrentCommitPointerBytes`
|
||||||
are exposed as `MaxCurrentCommitPointerBytes`,
|
and `MaxRemoteCommitManifestBytes`.
|
||||||
`MaxRemoteCommitManifestBytes`, and `MaxRemoteSessionManifestBytes`.
|
|
||||||
|
|
||||||
Each read uses the generation and size metadata returned with its opened body.
|
Each read uses the generation and size metadata returned with its opened body.
|
||||||
Actual bytes remain subject to a limit-plus-one read even if size metadata is
|
Actual bytes remain subject to a limit-plus-one read even if size metadata is
|
||||||
@@ -207,8 +228,8 @@ identity before replacing a canonical local path.
|
|||||||
|
|
||||||
Core helpers:
|
Core helpers:
|
||||||
|
|
||||||
- `LoadCurrentState`
|
- `LoadCurrentInventory`, returning the selected `CurrentState`
|
||||||
- `ValidateCurrentStateIdentity`
|
- `CurrentStateValidation`, supplying optional expected publication identity
|
||||||
- `RemoteCommitManifest` and `CurrentCommitPointer`
|
- `RemoteCommitManifest` and `CurrentCommitPointer`
|
||||||
|
|
||||||
Typed missing-state error:
|
Typed missing-state error:
|
||||||
@@ -219,7 +240,12 @@ Identity validation supports caller-provided expectations:
|
|||||||
|
|
||||||
- expected campaign;
|
- expected campaign;
|
||||||
- expected session ID;
|
- expected session ID;
|
||||||
- expected run ID, or pointer/manifest run-ID consistency check.
|
- expected publication run ID.
|
||||||
|
|
||||||
|
The reader always checks campaign, session, and run identity agreement between
|
||||||
|
the current pointer and selected publication inventory. It verifies the selected
|
||||||
|
inventory's namespace, size, checksum, and storage generation. These reads use
|
||||||
|
the pointer and inventory; execution-snapshot bodies are not fetched.
|
||||||
|
|
||||||
Caller policy is intentionally outside artifacts helpers:
|
Caller policy is intentionally outside artifacts helpers:
|
||||||
|
|
||||||
@@ -248,11 +274,11 @@ generation, and removal is idempotent.
|
|||||||
|
|
||||||
- session/work/run paths;
|
- session/work/run paths;
|
||||||
- previous-cache paths;
|
- previous-cache paths;
|
||||||
- spool/cache paths;
|
- managed session, run, and diagnostic paths;
|
||||||
- S3 session/run/current-state key layout.
|
- S3 session/run/current-state key layout.
|
||||||
|
|
||||||
New publication creates run-scoped immutable objects, including
|
New publication creates run-scoped immutable objects, including
|
||||||
`runs/{run_id}/commit.json` and `runs/{run_id}/session-manifest.json`. The sole
|
`runs/{run_id}/commit.json`, without an execution snapshot. The sole
|
||||||
mutable selector is `current/commit-pointer.json`; readers verify its selected
|
mutable selector is `current/commit-pointer.json`; readers verify its selected
|
||||||
commit and declared object generations/checksums.
|
commit and declared object generations/checksums.
|
||||||
|
|
||||||
@@ -276,8 +302,8 @@ physical layout.
|
|||||||
|
|
||||||
- source ID formats are stable contracts;
|
- source ID formats are stable contracts;
|
||||||
- artifact resolution is deterministic and manifest-aware;
|
- artifact resolution is deterministic and manifest-aware;
|
||||||
- extraction sources are available only from a compatible successful manifest
|
- extraction sources require compatible local generation evidence or a valid
|
||||||
record;
|
supplied-product record;
|
||||||
- previous-session source resolution in `analyze` is local-only;
|
- previous-session source resolution in `analyze` is local-only;
|
||||||
- remote current-state key construction remains centralized in artifacts helpers.
|
- remote current-state key construction remains centralized in artifacts helpers.
|
||||||
|
|
||||||
@@ -293,7 +319,7 @@ physical layout.
|
|||||||
`internal/artifacts/current_state_commit.go`,
|
`internal/artifacts/current_state_commit.go`,
|
||||||
- Paths and keys: `internal/artifacts/paths.go`,
|
- Paths and keys: `internal/artifacts/paths.go`,
|
||||||
`internal/artifacts/s3_keys.go`
|
`internal/artifacts/s3_keys.go`
|
||||||
- Previous requirements: `internal/artifacts/previous_requirements.go`
|
- Previous requirements: `internal/artifacts/previous_requirements.go`, `internal/artifacts/dependencies.go`
|
||||||
- Tests: `internal/artifacts/artifact_resolver_test.go`,
|
- Tests: `internal/artifacts/artifact_resolver_test.go`,
|
||||||
`internal/artifacts/catalog_test.go`,
|
`internal/artifacts/catalog_test.go`,
|
||||||
`internal/artifacts/extraction_catalog_test.go`,
|
`internal/artifacts/extraction_catalog_test.go`,
|
||||||
|
|||||||
@@ -2,126 +2,69 @@
|
|||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
Explain the implemented restore discovery, planning, installation, and
|
Restore imports products declared by the selected publication inventory into a
|
||||||
reporting flow in `internal/app`. User invocation belongs in
|
local session. The [CLI](../cli.md#session-restore) describes invocation and
|
||||||
[CLI](../cli.md#session-restore), and the operator recovery procedure and
|
[Operations](../operations.md#restore-workflow) describes operator recovery.
|
||||||
physical restore scope belong in
|
The session progress manifest stays local; publication is not a checkpoint backup.
|
||||||
[Operations](../operations.md#restore-workflow).
|
|
||||||
|
|
||||||
Restore separates remote authority, local conflict policy, and filesystem
|
## Discovery and planning
|
||||||
mutation so each remains testable independently.
|
|
||||||
|
|
||||||
The public command supplies production defaults to one private,
|
`internal/artifacts` validates the current pointer and its immutable commit,
|
||||||
invocation-scoped dependency value. Discovery, planning, and execution use that
|
including campaign, session, run, checksum, size, generation, and namespace.
|
||||||
same value, so focused sequencing tests can replace one boundary without
|
Discovery binds the plan to that inventory. Obsolete execution-snapshot
|
||||||
mutable package hooks.
|
declarations are ignored without reading their bodies. Authored session YAML
|
||||||
|
remains a separate configuration input.
|
||||||
|
|
||||||
## Discovery Contract
|
The planner maps each recognized published source through the built-in product
|
||||||
|
registry or current concrete configured definitions. Local products use flat
|
||||||
|
canonical paths regardless of remote destination names. Exact immutable keys,
|
||||||
|
checksums, sizes, and generations remain attached to actions, including products
|
||||||
|
carried from earlier publications by locks. Supported prepared documents and,
|
||||||
|
with `--include-audio`, audio retain their input paths. Prepared glossary inputs
|
||||||
|
include the four individual envelopes and the combined glossary. Previous-session
|
||||||
|
requirements use the shared prerequisite-inclusive collector and exact
|
||||||
|
published-output declarations; execution diagnostics and remote progress
|
||||||
|
snapshots are not imported.
|
||||||
|
|
||||||
Discovery delegates current-state pointer and manifest loading to
|
Each target is classified as `download`, `skip_same`, or `conflict` beneath the
|
||||||
`internal/artifacts`, then validates the result against the resolved request:
|
session root. Symlinked or non-regular ancestors and leaves remain conflicts;
|
||||||
|
`--force` authorizes replacement of differing regular files only. Duplicate
|
||||||
|
local destinations fail planning. Dry runs perform no durable session writes and
|
||||||
|
report imports plus projected work using the normal read-only assessment for
|
||||||
|
preserved local progress. Product coverage is conditional on successful
|
||||||
|
verification of planned downloads; unavailable local assessment is conservative.
|
||||||
|
|
||||||
- campaign must match;
|
## Installation and local baseline
|
||||||
- session ID must match.
|
|
||||||
- run ID must match the pointer-selected committed run.
|
|
||||||
|
|
||||||
Restore treats any missing or invalid remote current state as a command error.
|
A non-dry run acquires the same workspace lock used by runners before loading
|
||||||
|
local state and classifying files. It writes an incomplete-restore marker before
|
||||||
|
installation. Transfers use confined sibling temporary files and verify the
|
||||||
|
inventory's content and object identity before replacement. Installed products
|
||||||
|
are checked against their canonical paths, content rules, sizes, and checksums.
|
||||||
|
|
||||||
## Planning Contract
|
Restore merges accepted products into a clone of local state and saves the local
|
||||||
|
manifest last. Identical content with valid local generation evidence keeps that
|
||||||
|
authority. Other accepted products receive typed supplied records. Changed
|
||||||
|
products invalidate dependent local work using the existing stage relations;
|
||||||
|
unrelated checkpoints and locally recorded diagnostics remain. Co-published
|
||||||
|
products need no shared generation history. The resulting coverage satisfies
|
||||||
|
work without inventing intermediate files or successful publish, notify, or
|
||||||
|
cleanup execution.
|
||||||
|
|
||||||
Restore planner action kinds:
|
Failure leaves the marker and any already-installed files. A retry reclassifies
|
||||||
|
those files, verifies them, and saves the merged baseline; the marker is removed
|
||||||
|
after that save succeeds. This is not a whole-workspace rollback guarantee.
|
||||||
|
|
||||||
- `download`;
|
## Reporting and ownership
|
||||||
- `skip_same`;
|
|
||||||
- `conflict`.
|
|
||||||
|
|
||||||
Planner behavior:
|
Reports identify publication identity, actions, counts, and failures. Actual
|
||||||
|
attempts persist under the restore run's logs. `restore --force` governs file
|
||||||
|
replacement and is independent of pipeline force.
|
||||||
|
|
||||||
- a new-protocol restore uses only the selected commit's declared artifact set;
|
Discovery is in `internal/app/restore_discovery.go`, planning and coverage in
|
||||||
each action carries that artifact's immutable key, checksum, size, and
|
`internal/app/restore_plan.go`, transfers in `internal/app/restore_execute.go`,
|
||||||
generation;
|
local baseline installation in `internal/app/restore_manifest_paths.go`, and
|
||||||
- remote-to-local mapping is traversal-safe;
|
command coordination/reporting in `internal/app/restore_command.go` and
|
||||||
- actions are sorted by local relative path and then remote key;
|
`internal/app/restore_report.go`. The restore, import-workflow, artifact, and
|
||||||
- planning opens the selected session root and inspects every target by its
|
recovery tests cover source mapping, identity, conflicts, preservation, retry,
|
||||||
normalized session-relative path. Missing ancestors produce a missing target;
|
and carried products.
|
||||||
an ancestor or leaf symlink is a non-regular conflict and is never opened for
|
|
||||||
hashing;
|
|
||||||
- force converts differing eligible regular files from conflicts to downloads;
|
|
||||||
directories, symlinks, and other non-regular targets remain conflicts.
|
|
||||||
|
|
||||||
For a non-dry-run restore, planning/classification happens only after acquiring
|
|
||||||
the session lock. Runner manifest/reuse checks acquire that same lock first.
|
|
||||||
|
|
||||||
Previous-cache readiness is resolved through `previouscache.Resolve` for restore,
|
|
||||||
prepare, status, and validation. Each requirement selects the unique
|
|
||||||
`published_output` for its canonical source in the pointer-selected commit,
|
|
||||||
then strips only that run's immutable `published/` prefix for its safe local
|
|
||||||
cache path. It never probes candidate objects or derives paths from manifests,
|
|
||||||
configuration, or basenames.
|
|
||||||
|
|
||||||
## Execution Contract
|
|
||||||
|
|
||||||
Execution order and safety:
|
|
||||||
|
|
||||||
- non-manifest downloads happen before manifest install;
|
|
||||||
- `manifest.json` installs last;
|
|
||||||
- downloads use sibling temp files, validate the complete object, then use an
|
|
||||||
atomic rename;
|
|
||||||
- manifest replacement is validated before rename;
|
|
||||||
- each committed object is verified against its declared checksum, size, and
|
|
||||||
generation before installation;
|
|
||||||
- installation reopens the selected session root, creates only validated
|
|
||||||
missing directory components with workspace modes, and rejects symlinked or
|
|
||||||
non-regular ancestors and leaves before replacement;
|
|
||||||
- a committed manifest already verified during discovery is retained for the
|
|
||||||
matching restore action and revalidated before installation, avoiding a
|
|
||||||
second body transfer;
|
|
||||||
- failed installs do not roll back files already written in the same execution.
|
|
||||||
- a durable `.restore-incomplete.json` marker is written before installation.
|
|
||||||
It blocks runners until a restore retry completes all verified installs and
|
|
||||||
the local manifest replacement, at which point it is removed.
|
|
||||||
- restored manifest local references are rebased beneath the selected local
|
|
||||||
session root. Unsafe relative references and producer-machine absolute paths
|
|
||||||
outside the manifest's producer session root are rejected; producer-local
|
|
||||||
spool paths and run-local diagnostic references are not restored as
|
|
||||||
authority. Cleanup remains ordinary restored stage state and is not reset or
|
|
||||||
synthesized by restore.
|
|
||||||
|
|
||||||
Audio restore path:
|
|
||||||
|
|
||||||
- uses `audio.MaterializeS3Audio`;
|
|
||||||
- integrates spool and S3 audio cache paths;
|
|
||||||
- reuses cached audio only when its opened regular file, content digest, and
|
|
||||||
identity sidecar all match the selected remote object version; otherwise it
|
|
||||||
refreshes through the validated download path.
|
|
||||||
|
|
||||||
## Reporting Contract
|
|
||||||
|
|
||||||
- dry-run mode prints a summary, performs no durable session writes, and may
|
|
||||||
read remote current-state or object-identity data to produce that summary;
|
|
||||||
- execution mode persists the canonical restore report described in
|
|
||||||
[Operations](../operations.md#restore-workflow);
|
|
||||||
- report includes plan counts, per-action status, and execution failures.
|
|
||||||
|
|
||||||
## Invariants
|
|
||||||
|
|
||||||
- restore uses committed remote current state as authority;
|
|
||||||
- one restore or status inspection observes the single pointer-selected commit
|
|
||||||
loaded at discovery; later pointer changes cannot add objects or substitute a
|
|
||||||
different run into its plan;
|
|
||||||
- a verified `current/commit-pointer.json` and its selected immutable commit
|
|
||||||
establish remote commitment; when absent, republish the session;
|
|
||||||
- restore does not execute pipeline stages.
|
|
||||||
|
|
||||||
## Implementation And Tests
|
|
||||||
|
|
||||||
- Discovery: `internal/app/restore_discovery.go`
|
|
||||||
- Planning: `internal/app/restore_plan.go`, `internal/previouscache`
|
|
||||||
- Execution: `internal/app/restore_execute.go`
|
|
||||||
- Reporting and command coordination: `internal/app/restore_report.go`,
|
|
||||||
`internal/app/restore.go`
|
|
||||||
- Tests: `internal/app/restore_discovery_test.go`,
|
|
||||||
`internal/app/restore_plan_test.go`,
|
|
||||||
`internal/app/restore_execution_test.go`,
|
|
||||||
`internal/app/restore_recovery_test.go`,
|
|
||||||
`internal/app/restore_workflow_test.go`
|
|
||||||
|
|||||||
@@ -1,216 +1,124 @@
|
|||||||
# Configuration Internals
|
# Configuration Internals
|
||||||
|
|
||||||
User-visible fields, defaults, and selection behavior belong in the
|
User-visible fields, defaults, discovery, and selection belong in the
|
||||||
[Configuration Reference](../config.md). This document describes the internal
|
[Configuration Reference](../config.md). This document describes the
|
||||||
pipeline-loading boundary implemented by `internal/config`.
|
`internal/config` loading and derivation boundary established by
|
||||||
|
[ADR 0003](../adr/0003-assign-configuration-ownership.md).
|
||||||
|
|
||||||
## Pipeline Loading
|
## Typed Configuration Handoff
|
||||||
|
|
||||||
`LoadPipeline` assembles and validates a pipeline in this order:
|
Pipeline, campaign, session, and party loaders retain their actual
|
||||||
|
ConfigKit results. Campaign and party inputs retain shared extensions, while
|
||||||
|
Narratio's operational settings use strict typed bindings. ConfigKit owns imports, overlay composition, inheritance,
|
||||||
|
presence, typed secrets, and native source/history evidence. Narratio's
|
||||||
|
supported definition callbacks complete configuration-owned defaults,
|
||||||
|
normalization, resource resolution, and validation before handoff. Consumers
|
||||||
|
read completed values without mutation.
|
||||||
|
|
||||||
1. Give ConfigKit a fresh typed `PipelineConfig` default value, the root file,
|
Session definitions receive selected-campaign defaults before loading finishes.
|
||||||
enabled imports, and the caller's overlay selection. Omitted, empty, and
|
Recorded resolution preserves explicit empty/null/false/zero behavior and
|
||||||
exact `default` selections use the base; named overlays use the fixed
|
truthful dependencies. Campaign, session, and previous-session assertions run
|
||||||
`overlays/<name>.yml` convention.
|
against resolved values in native validation callbacks. Standalone document
|
||||||
2. ConfigKit parses the root and declared imports, additively merges base
|
renderers preserve materialization semantics without providing a second
|
||||||
sources, applies only the selected overlay, and strictly decodes the result.
|
inspection authority.
|
||||||
3. The definition resolver applies recorded entry-level and inherited defaults,
|
|
||||||
runs deterministic domain normalization, records derived publish destinations,
|
|
||||||
and resolves ordinary paths relative to the root pipeline file.
|
|
||||||
4. The definition validator performs read-only checks that require only the
|
|
||||||
pipeline file. Checks requiring canonical-party family expansion remain at
|
|
||||||
the existing explicit pipeline/campaign resolution boundary.
|
|
||||||
5. Narratio inspects public ConfigKit metadata to reject artifact and family keys
|
|
||||||
declared by multiple base files, adapts source ownership records, attaches
|
|
||||||
runtime-only state, and computes the normalized effective digest.
|
|
||||||
|
|
||||||
This ordering preserves monolithic configuration behavior. Moving a field to
|
Resource resolution consults native entry origins and source contexts. A usable
|
||||||
an imported fragment changes its source ownership, not its path base, default,
|
effective source supplies the base, otherwise the main source and then captured
|
||||||
or schema semantics.
|
invocation directory provide the fallback. Explicit CLI paths use the invocation
|
||||||
|
directory. Reference-catalog entries are resolved individually from their native
|
||||||
|
field origins; selection does not read unused vocabulary files. See [resource rules](../config.md#pipeline-imports-and-overlays).
|
||||||
|
|
||||||
## Loaded Context Resolution
|
## Resolved Domain Validation
|
||||||
|
|
||||||
`LoadedPipelineCampaign` carries one already composed pipeline and its selected
|
`Validate` checks cross-document storage/audio relations and product destinations
|
||||||
campaign into session resolution. `LoadSessionWithPipelineCampaignOptions`
|
after the configuration handoff. These rejections use `DomainInputError`;
|
||||||
loads a local session against that context, while
|
catalog derivation retains `ArtifactCatalogInputError`. Both preserve their
|
||||||
`ResolveLoadedPipelineCampaign` also accepts an already loaded remote session
|
causes for the application's [CLI classification](../cli.md#cancellation-and-exit-status).
|
||||||
or no session while a caller retrieves one. Compatibility loaders route through
|
Native loading errors retain their existing classification. Path-resolution
|
||||||
these functions after their initial pipeline and campaign reads.
|
failures during destination validation remain operational. Joined operational
|
||||||
|
or cancellation causes retain precedence over input errors.
|
||||||
|
|
||||||
Application commands own pipeline and campaign discovery, campaign-file versus
|
## Invocation Acquisition
|
||||||
registry selection, and the corresponding mutual-exclusion rules. Once they
|
|
||||||
have a `LoadedPipelineCampaign`, local session discovery and remote-session
|
|
||||||
download retain that exact pipeline object and its private provenance. Removing
|
|
||||||
a temporary downloaded session file therefore cannot invalidate the resolved
|
|
||||||
pipeline or campaign context.
|
|
||||||
|
|
||||||
Campaign and session files use independent ConfigKit definitions with imports
|
`internal/app/configuration_acquisition.go` owns lazy invocation selections and
|
||||||
and overlays disabled. Campaign files normally load directly from their source;
|
acquired context. Exact sources and effective-identity assertions are
|
||||||
session files are first read through the 8 MiB bounded-read boundary because the
|
complementary. App acquisition needs no campaign or party for expansion;
|
||||||
application must reject unresolved template placeholders before passing an exact
|
campaign acquisition needs no session. Session acquisition loads campaign
|
||||||
byte snapshot to ConfigKit. Local and remotely downloaded session bytes then use
|
context when required for defaults. Explicit party acquisition does not require
|
||||||
the same typed loader and retain the existing post-load identity expectations,
|
a session. Each reached pipeline acquisition prepares its native source and applies
|
||||||
stable-input precedence, and source-relative path semantics.
|
configured bootstrap after static input checks; completed acquisitions are reused.
|
||||||
|
|
||||||
The application also has a separate read-only inspection resolver for `config
|
`LoadedPipelineCampaign` retains one selected pipeline/campaign while local or
|
||||||
validate`, `config show`, `config sources`, and `config artifacts`. It uses the
|
remote session resolution proceeds. Only absence permits remote fallback;
|
||||||
same production root, overlay, and campaign selection functions, but never routes
|
access, decoding, and identity failures retain their causes. Remote acquisition
|
||||||
through session discovery,
|
prefers authored session-root input and uses the committed prepared snapshot
|
||||||
remote-session download, adapter composition, workspace
|
only when authored input is absent. Temporary materialization retains object
|
||||||
initialization, manifest access, or cleanup. A pipeline with retained artifact
|
provenance and releases resources on success or failure. Read-only acquisition
|
||||||
family declarations must resolve its selected campaign before ordinary pipeline
|
creates no runtime workspace, execution lock, restore state, or stage adapter.
|
||||||
validation, which expands its canonical-party members and generated publish
|
|
||||||
rules. A pipeline without those declarations may be validated by itself.
|
|
||||||
Secret-directory bootstrap remains invocation-scoped and happens before the
|
|
||||||
ordinary ConfigKit load because explicit typed references must resolve even for
|
|
||||||
inspection.
|
|
||||||
|
|
||||||
`MarshalEffectivePipeline` is the configuration-owned projection for `config
|
## Native Inspection
|
||||||
show`. It serializes one explicit typed safe projection with the existing YAML
|
|
||||||
encoder. The projection has no slots for resolution-only artifact family
|
|
||||||
declarations or private provenance. The result has one trailing newline;
|
|
||||||
commands do not marshal runtime objects directly.
|
|
||||||
|
|
||||||
`EffectivePipelineSources` and `EffectiveCampaignSources` provide the separate
|
`configuration_commands.go` adapts actual results with `ckconfig.FromConfigKit`.
|
||||||
safe provenance projection for `config sources`. Pipeline ownership begins with
|
Native show, sources, explain/history, validation, and comparisons consume that
|
||||||
the complete logical field paths projected from the schema and classifies
|
result's values and evidence. There is no flattened replacement snapshot,
|
||||||
each contributor as root, import, overlay, or centralized default. The
|
synthetic source reconciliation, or generated family catalog in app inspection.
|
||||||
projection replaces generated concrete member paths with paired family and
|
|
||||||
canonical-party records, and does the same for generated publish rules.
|
|
||||||
Campaign records identify campaign-owned fields and party inputs; canonical
|
|
||||||
derived players point to the party source. The application command only joins these sorted
|
|
||||||
records with selection metadata and never reparses configuration files.
|
|
||||||
|
|
||||||
`EffectiveArtifactCatalog` projects the same finalized concrete artifact map for
|
Comparison sides load independently using each side's normal defaults and
|
||||||
`config artifacts`. It derives source identity from each map key, carries sorted
|
selectors. App-only overrides pass through native selection into ConfigKit;
|
||||||
effective dependencies, aggregates ConfigKit definition contributors, and adds
|
they remain invocation-local. Field overrides are unavailable to domain
|
||||||
family/character/party provenance for generated members. It does not inspect
|
execution/planning and other scopes. Comparison sides acquire separately and share the process environment while
|
||||||
files named after artifacts or infer another runtime graph.
|
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.
|
||||||
|
|
||||||
`config diff` uses a thin paired loader that performs two independent ConfigKit
|
## Glossary Derivation
|
||||||
loads. When campaign
|
|
||||||
resolution is needed, the command loads one selected campaign and party and
|
|
||||||
expands both effective pipelines from that same party value. The configuration
|
|
||||||
owner projects each normalized effective mapping directly from that same typed
|
|
||||||
projection into sorted logical paths using JSON number preservation;
|
|
||||||
mapping leaves are compared individually while sequence values remain atomic.
|
|
||||||
Values are compact deterministic JSON representations for command output, not
|
|
||||||
raw YAML fragments, ownership records, or secret material. A differing digest
|
|
||||||
with no projected difference is treated as an internal consistency error.
|
|
||||||
|
|
||||||
Campaign context construction reads the campaign-owned party source through
|
`internal/config` adapts resolved selections and canonical party context to
|
||||||
`ParseParty`. The required canonical party retains its raw bytes and normalized
|
`internal/glossary`. That owner loads native vocabulary, validates the pinned
|
||||||
roster in runtime-only `ResolvedParty` provenance. Canonical resolution creates
|
schema, projects the roster, and serializes four individual envelopes and a
|
||||||
a deterministic `derived_from_party` players projection. The party is the only
|
combined envelope.
|
||||||
configured roster authority; player and session-party fields are unsupported.
|
Preparation and resume comparison share this resolver. Derived vocabulary does
|
||||||
|
not replace the authored ConfigKit results used by native inspection. Catalog
|
||||||
|
entry imports use the source file's native relative context.
|
||||||
|
|
||||||
## Canonical Party Domain
|
## Canonical Party And Derived Catalog
|
||||||
|
|
||||||
`ParseParty` is the package-owned boundary for parsing a party source. Its
|
File-backed party loading supports imports; contextless `ParseParty` accepts
|
||||||
single-source ConfigKit definition disables imports and overlays, requires
|
bytes. The completed native mapping is validated against the shared contract and
|
||||||
`schema_version` through `VersionRule`, and strictly decodes the
|
Narratio's roster requirements. Character IDs determine projection order. The
|
||||||
character-keyed typed schema before applying Narratio's party-domain checks.
|
native result supplies standalone canonical party YAML. The selected roster
|
||||||
Successful metadata coordinates recover authored character-map order without a
|
supplies both the players projection and concrete family members, including when
|
||||||
second YAML parse; class and alias slice order comes directly from typed decode.
|
an explicit party file replaces the campaign default.
|
||||||
The canonical value retains a separate exact byte copy of its source so
|
|
||||||
consumers can materialize the authored party document without reserializing it.
|
|
||||||
Its `PlayersYAML` method deterministically derives the ID-sorted, versioned
|
|
||||||
players-only projection.
|
|
||||||
|
|
||||||
An unversioned source is rejected before resolution, family expansion, or
|
`ArtifactCatalog` carries derived artifacts, family/member origins, resolved
|
||||||
prepare-stage materialization.
|
dependencies, and expanded publication outputs separately from pipeline values.
|
||||||
|
Family declarations remain in the typed pipeline result. Derivation sorts
|
||||||
|
family keys and character IDs, substitutes `{character_id}` in outputs,
|
||||||
|
resolves closed member variables, and checks key/output collisions and domain
|
||||||
|
dependencies. Member-artifact inputs become ordinary concrete artifact sources;
|
||||||
|
family publish declarations become ordinary publication actions. No family
|
||||||
|
wildcard matcher is added to runtime publication.
|
||||||
|
|
||||||
## Validation Ownership
|
Catalog listing, planning, stage execution, artifact inspection, fingerprinting,
|
||||||
|
and previous-session requirements consume the same derived products. Validation
|
||||||
|
of these products belongs to domain derivation rather than app inspection.
|
||||||
|
External roster shape belongs in the [party contract](../integrations/party.md).
|
||||||
|
|
||||||
Configuration validation remains within `internal/config`, with the public
|
## Safe Persistence And Semantic Resume
|
||||||
entry points and pipeline-domain sequencing separated from the private owners
|
|
||||||
for core pipeline/session rules, external adapters, publish/storage, Notarius,
|
|
||||||
Scriptorium, and shared scalar/path checks. These are package-local ownership
|
|
||||||
boundaries rather than extension points or a general validation framework.
|
|
||||||
|
|
||||||
Validation is read-only, fails fast, and does not define which of several
|
Preparation materializes standalone campaign/session/party/players and five glossary inputs and
|
||||||
independent invalid fields is reported first. Map-backed declarations are
|
a secret-safe pipeline projection. The projection preserves credential names,
|
||||||
nevertheless traversed deterministically. Reusable domain normalization is an
|
family declarations, numeric values, and null/empty distinctions. It is a
|
||||||
explicit preceding operation for both loaded and programmatically constructed
|
persistence service, not a fabricated native result. An effective digest is
|
||||||
pipelines. Notarius normalization commits canonical scalar, reference, and output
|
informational; resume compares result-affecting semantic evidence from the same
|
||||||
values only after the complete normalization succeeds; its validator then checks
|
concrete products used by execution. Source arrangement, provenance, and overlay
|
||||||
that candidate without changing it. Scriptorium validates artifact declarations
|
labels alone do not invalidate work.
|
||||||
and outputs, dependencies and inputs, variables, referenced outputs, and the final
|
|
||||||
dependency graph in deterministic artifact order.
|
|
||||||
|
|
||||||
Diagnostics identify the relevant semantic field. Merge conflicts also
|
Focused configuration/application fixtures cover imports, defaults, selected
|
||||||
retain every claiming source needed to correct an additive ownership conflict.
|
rosters, independent comparisons, override isolation, secret-safe persistence,
|
||||||
Complete prose, punctuation, formatting, and private validation choreography are
|
and unchanged completed configuration across domain derivation and execution.
|
||||||
not compatibility contracts.
|
|
||||||
|
|
||||||
## Diagnostics And Runtime Metadata
|
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)
|
||||||
Syntax, duplicate-key, merge, overlay, and schema failures include the
|
own the upstream APIs and feature behavior.
|
||||||
relevant source name and full field path. Additive conflicts report every
|
|
||||||
claiming source so operators can repair the split without repeatedly
|
|
||||||
rediscovering additional conflicts.
|
|
||||||
|
|
||||||
The loaded pipeline retains private runtime metadata for the absolute root
|
|
||||||
path, ordered imports, selected overlay name, source, and path, original
|
|
||||||
ConfigKit metadata and source snapshots, effective digest,
|
|
||||||
and leaf ownership. Base
|
|
||||||
leaves retain their root/import owners, replaced leaves belong to the selected
|
|
||||||
overlay, and centrally supplied values use the synthetic `default` owner. This
|
|
||||||
metadata does not participate in YAML decoding or alter the public
|
|
||||||
configuration model.
|
|
||||||
|
|
||||||
The effective digest is SHA-256 over a versioned deterministic JSON encoding of
|
|
||||||
the same typed safe projection used by show and diff. Runtime Notarius paths remain absolute for
|
|
||||||
execution, but the digest substitutes their normalized logical values captured
|
|
||||||
before root-relative resolution, so relocating an equivalent configuration
|
|
||||||
bundle does not change provenance. Because ConfigKit and resolution metadata
|
|
||||||
are private, the digest excludes source layout, overlay name, and ownership.
|
|
||||||
Configuration stores credentials as ConfigKit typed references. A successful
|
|
||||||
load resolves their values inside the opaque typed boundary, while this safe
|
|
||||||
projection serializes only `EnvName()` identities. Credential-value changes are
|
|
||||||
therefore never hashed; reference-name changes remain ordinary provenance.
|
|
||||||
The optional Notarius credential follows the same path even for disabled or
|
|
||||||
resumable extraction; normalization copies the opaque reference without reading
|
|
||||||
or resolving it again. Direct YAML serialization has a configuration-owned safe
|
|
||||||
projection so only the reference name can leave this boundary.
|
|
||||||
`recomputePipelineEffectiveDigest` is the single package-owned refresh point
|
|
||||||
for later runtime expansion.
|
|
||||||
|
|
||||||
## Test Surfaces
|
|
||||||
|
|
||||||
`pipeline_configkit_test.go` exercises real imports and fixed-path overlays,
|
|
||||||
base selection, unselected-overlay isolation, source attribution, and Narratio's
|
|
||||||
unique artifact/family base-declaration rule. Existing focused configuration
|
|
||||||
tests protect defaults, explicit-value semantics, strict decoding, validation,
|
|
||||||
metadata, and root-relative path behavior. Application configuration-loader tests protect the
|
|
||||||
single-read boundary by changing the pipeline file after its initial load and
|
|
||||||
confirming local session resolution retains the original pipeline. Other
|
|
||||||
configuration tests continue to protect defaults and validation after assembly.
|
|
||||||
`party_test.go` protects the versioned typed party schema, domain invariants,
|
|
||||||
authored character order, retained bytes, and deterministic players projection
|
|
||||||
without involving campaign or runtime wiring.
|
|
||||||
`party_resolution_test.go` protects campaign-owned party loading, canonical
|
|
||||||
input restrictions, source provenance, and virtual players input selection.
|
|
||||||
|
|
||||||
## Artifact Family Resolution
|
|
||||||
|
|
||||||
Pipeline loading retains `scriptorium.artifact_families` as a resolution-only
|
|
||||||
declaration. Once campaign party resolution establishes a canonical roster,
|
|
||||||
configuration expands families in sorted family-key and character-ID order
|
|
||||||
into ordinary `ScriptoriumArtifactConfig` values. The expansion owns the narrow
|
|
||||||
`{character_id}` output substitution, closed member-variable selectors, key and
|
|
||||||
output collision checks, and the runtime-only family-origin catalog. It then
|
|
||||||
removes family declarations from `ScriptoriumConfig`, runs ordinary Scriptorium
|
|
||||||
validation, and refreshes the effective pipeline digest. Stages and adapters
|
|
||||||
therefore receive only concrete artifact maps.
|
|
||||||
|
|
||||||
The catalog retains sorted family member keys plus family/character/source
|
|
||||||
origins and the typed dependency/publish declarations for their later owners.
|
|
||||||
`member_dependencies` add corresponding ordinary concrete dependencies, while
|
|
||||||
the family-only `narratio.member_artifact.<family>` input form is rewritten to
|
|
||||||
the matching ordinary configured-artifact source. The catalog records those
|
|
||||||
resolved dependency and input identities with their declaring family and party
|
|
||||||
member. No member-artifact source is registered as a runtime policy source.
|
|
||||||
An enabled family publish declaration expands to ordinary configured-artifact
|
|
||||||
publish rules before the existing publish and lock validators run. Runtime
|
|
||||||
publication consequently receives no family wildcard or special matcher.
|
|
||||||
|
|||||||
@@ -9,14 +9,18 @@ and destination-directory policy.
|
|||||||
Ordinary workspace replacement uses standard operating-system path semantics.
|
Ordinary workspace replacement uses standard operating-system path semantics.
|
||||||
Callers with a root-scoped safety contract own that validation at their boundary.
|
Callers with a root-scoped safety contract own that validation at their boundary.
|
||||||
|
|
||||||
Remote object acquisition is owned by its domain caller. The caller writes a
|
Remote object acquisition is owned by its domain caller. `WriteSiblingTemp` writes and closes a sibling temporary file, returning
|
||||||
sibling temporary file, validates the complete result, and passes that file to
|
ownership to the caller. The caller validates the complete result and passes it
|
||||||
`InstallSiblingTempFile` only when it is ready to become canonical. Callers own
|
to `InstallSiblingTempFile` only when it is ready to become canonical. Callers own
|
||||||
remote object selection, validation, conflict handling, and temporary-file
|
remote object selection, validation, conflict handling, and temporary-file
|
||||||
cleanup.
|
cleanup.
|
||||||
|
|
||||||
Directory bundles are not promoted by `internal/fileops`; extraction owns its
|
Directory bundles are not promoted by `internal/fileops`; extraction keeps
|
||||||
validated Notarius bundle rename.
|
the original bundle in its run until cleanup and promotes individual validated
|
||||||
|
products.
|
||||||
|
|
||||||
|
The workspace path owner manages latest-attempt links; fileops provides confined
|
||||||
|
directory creation and removal mechanics.
|
||||||
|
|
||||||
## Cleanup Contract
|
## Cleanup Contract
|
||||||
|
|
||||||
@@ -30,8 +34,7 @@ existing leaf to be regular. Command and post-publish policy remains owned by
|
|||||||
## Bounded Reads
|
## Bounded Reads
|
||||||
|
|
||||||
`ReadFileBounded` opens a normal path and reads at most its caller-supplied
|
`ReadFileBounded` opens a normal path and reads at most its caller-supplied
|
||||||
limit. Credential mode policy and environment precedence remain owned by
|
limit.
|
||||||
`internal/app`.
|
|
||||||
|
|
||||||
## Replacement Contract
|
## Replacement Contract
|
||||||
|
|
||||||
|
|||||||
@@ -10,31 +10,41 @@ manifest placement belongs in
|
|||||||
|
|
||||||
`manifest.Manifest` records:
|
`manifest.Manifest` records:
|
||||||
|
|
||||||
- required `schema_version: narratio.session-manifest.v1`
|
- required `schema_version: narratio.session-manifest.v2`
|
||||||
- identity (`session_id`, `campaign`, `run_id`)
|
- identity (`session_id`, `campaign`, `run_id`)
|
||||||
- local path metadata (`local_workdir`, `local_spool_dir`)
|
- local path metadata (`local_workdir`)
|
||||||
- remote identity metadata (`s3_bucket`, `s3_session_prefix`, `s3_run_prefix`)
|
- remote identity metadata (`s3_bucket`, `s3_session_prefix`, `s3_run_prefix`)
|
||||||
- `inputs` records
|
- `inputs` records
|
||||||
- durable `artifacts` records
|
- durable `artifacts` records
|
||||||
|
- optional versioned `supplied_products` records, keyed by source ID
|
||||||
- per-stage `stages` map, including the ordinary cleanup stage record
|
- per-stage `stages` map, including the ordinary cleanup stage record
|
||||||
|
|
||||||
Session, campaign, and run identities in local and downloaded manifests must be
|
Supplied records hold a canonical session-relative path, SHA-256 checksum,
|
||||||
|
byte size, and optional product contract. The manifest store validates their
|
||||||
|
structure; artifact helpers check the recorded path and actual content. A
|
||||||
|
separate coverage helper derives transcript work satisfied by valid supplied
|
||||||
|
transcripts without creating records for absent intermediate products. Planning
|
||||||
|
and execution use that coverage to reuse satisfied transcript work without
|
||||||
|
historical producer evidence. Restore merges verified records into local progress
|
||||||
|
as described in [restore internals](command-restore.md).
|
||||||
|
|
||||||
|
Session, campaign, and run identities in local manifests must be
|
||||||
portable opaque segments. Unsafe legacy identities are rejected with migration
|
portable opaque segments. Unsafe legacy identities are rejected with migration
|
||||||
guidance rather than being normalized into a different workspace or remote
|
guidance rather than being normalized into a different workspace or remote
|
||||||
namespace.
|
namespace.
|
||||||
|
|
||||||
Decoding rejects unknown typed fields, including informational fields inside
|
Decoding rejects unknown typed fields, including informational fields inside
|
||||||
`effective_config` and its nested selection. The schema version remains
|
`effective_config` and its nested selection. The schema version is
|
||||||
`narratio.session-manifest.v1`; there is no compatibility reader that silently
|
`narratio.session-manifest.v2`; there is no compatibility reader that silently
|
||||||
drops retired fields. See [overlay migration](../operations.md#migrating-manifest-overlay-provenance)
|
drops retired fields. See [overlay provenance](../operations.md#migrating-manifest-overlay-provenance)
|
||||||
for deliberate migration of retired selection provenance. Cleanup progress uses
|
for handling retired selection provenance. Cleanup progress uses only the
|
||||||
only the cleanup entry in `stages`.
|
cleanup entry in `stages`.
|
||||||
|
|
||||||
Every persisted session manifest has a non-nil `stages` map. Each entry is
|
Every persisted session manifest has a non-nil `stages` map. Each entry is
|
||||||
non-nil and its embedded `name` exactly matches its map key; loading never
|
non-nil and its embedded `name` exactly matches its map key; loading never
|
||||||
invents either marker. A missing or unsupported schema version, or incomplete
|
invents either marker. A missing or unsupported schema version, or incomplete
|
||||||
stage identity, is unsupported local state: move it aside and regenerate it,
|
stage identity, is unsupported local state: move it aside before regenerating
|
||||||
or restore a verified current committed snapshot when that is authoritative.
|
or importing published products into a new local baseline.
|
||||||
|
|
||||||
Prepare records independent `party` and `players` input checksums. In canonical
|
Prepare records independent `party` and `players` input checksums. In canonical
|
||||||
party mode, the party record retains its campaign source identity while the
|
party mode, the party record retains its campaign source identity while the
|
||||||
@@ -86,10 +96,8 @@ from reviving pre-force results.
|
|||||||
|
|
||||||
Older aggregate-only transcribe success is conservatively regenerated once
|
Older aggregate-only transcribe success is conservatively regenerated once
|
||||||
when transcribe is selected because it does not bind individual outputs to the
|
when transcribe is selected because it does not bind individual outputs to the
|
||||||
audio bytes used. The session-manifest schema identifier remains
|
audio bytes used. The transcribe subcollection has its own version independent
|
||||||
`narratio.session-manifest.v1`; this additive state is accepted by current
|
of the session-manifest marker.
|
||||||
Narratio, but older strict-decoding binaries may reject manifests after these
|
|
||||||
fields have been written.
|
|
||||||
|
|
||||||
### Analyze-owned artifact state
|
### Analyze-owned artifact state
|
||||||
|
|
||||||
@@ -167,7 +175,7 @@ be non-successful, but every completed artifact checkpoint remains reusable.
|
|||||||
|
|
||||||
## Remote Commit Manifest
|
## Remote Commit Manifest
|
||||||
|
|
||||||
`artifacts.RemoteCommitManifest` is a separate, versioned remote snapshot
|
`artifacts.RemoteCommitManifest` is a separate, versioned publication inventory
|
||||||
contract. It is not a serialized session manifest and contains no local
|
contract. It is not a serialized session manifest and contains no local
|
||||||
post-publication assertion such as `current_pointer_written`. A remote commit
|
post-publication assertion such as `current_pointer_written`. A remote commit
|
||||||
identifies one campaign, session, and run and declares its immutable artifact
|
identifies one campaign, session, and run and declares its immutable artifact
|
||||||
@@ -181,7 +189,7 @@ unknown fields, version mismatches, pointer/commit identity mismatches, and
|
|||||||
objects that do not match their declaration.
|
objects that do not match their declaration.
|
||||||
|
|
||||||
An absent commit pointer means no remote state is published. Republish to
|
An absent commit pointer means no remote state is published. Republish to
|
||||||
establish a current immutable snapshot.
|
establish a current immutable publication.
|
||||||
|
|
||||||
## Persistence Semantics
|
## Persistence Semantics
|
||||||
|
|
||||||
@@ -207,8 +215,8 @@ it promote the saved target record and manifest `updated_at` into live state;
|
|||||||
it preserves an existing target record's identity and leaves unrelated live
|
it preserves an existing target record's identity and leaves unrelated live
|
||||||
stage records in place.
|
stage records in place.
|
||||||
|
|
||||||
The copy boundary includes stage records, input and artifact slices, aggregate
|
The copy boundary includes stage records, input and artifact slices, supplied
|
||||||
output/log/configuration slices, and the typed analyze and transcribe
|
product records, aggregate output/log/configuration slices, and the typed analyze and transcribe
|
||||||
collections that callbacks or `LocalStore.Save` may modify. Metadata and other
|
collections that callbacks or `LocalStore.Save` may modify. Metadata and other
|
||||||
pointer fields remain shared read-only because neither checkpoint callback nor
|
pointer fields remain shared read-only because neither checkpoint callback nor
|
||||||
the store mutates them. This is a bounded execution helper, not a general
|
the store mutates them. This is a bounded execution helper, not a general
|
||||||
@@ -268,6 +276,13 @@ cannot contain outputs. An intentional self-skip records the current semantic
|
|||||||
fingerprint because it is a completed, reusable stage result; failed or
|
fingerprint because it is a completed, reusable stage result; failed or
|
||||||
interrupted work never promotes one.
|
interrupted work never promotes one.
|
||||||
|
|
||||||
|
Supplied completion is revalidated against local bytes before planning or
|
||||||
|
execution reuses it. It can satisfy transcript work through the supplied JSON,
|
||||||
|
selected render outputs, or a complete configured extraction set. An attempted
|
||||||
|
replacement retires the supplied authority for its affected products before
|
||||||
|
execution; forced work therefore cannot revive an earlier supplied result.
|
||||||
|
Coverage never makes an absent consumer input available.
|
||||||
|
|
||||||
When an already-succeeded stage is skipped, the session manifest deliberately
|
When an already-succeeded stage is skipped, the session manifest deliberately
|
||||||
retains its existing succeeded record because it remains the cross-invocation
|
retains its existing succeeded record because it remains the cross-invocation
|
||||||
progress authority. If a stage supplies semantic configuration evidence, reuse first
|
progress authority. If a stage supplies semantic configuration evidence, reuse first
|
||||||
@@ -287,7 +302,7 @@ evidence and focused durable validators:
|
|||||||
|
|
||||||
| Work | Reuse authority | Focused owners |
|
| Work | Reuse authority | Focused owners |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| prepare | aggregate semantic fingerprint | [prepare](stage-prepare.md) |
|
| prepare | aggregate semantic fingerprint plus durable-copy and current-source validation | [prepare](stage-prepare.md) |
|
||||||
| transcribe speakers | aggregate semantic fingerprint plus per-speaker input/output reconciliation | [transcribe](stage-transcribe.md), [WhisperX](../integrations/whisperx.md) |
|
| transcribe speakers | aggregate semantic fingerprint plus per-speaker input/output reconciliation | [transcribe](stage-transcribe.md), [WhisperX](../integrations/whisperx.md) |
|
||||||
| merge | aggregate semantic fingerprint | [merge](stage-merge.md), [Seriatim](../integrations/seriatim.md) |
|
| merge | aggregate semantic fingerprint | [merge](stage-merge.md), [Seriatim](../integrations/seriatim.md) |
|
||||||
| polish | aggregate semantic fingerprint | [polish](stage-polish.md), [Audita](../integrations/audita.md) |
|
| polish | aggregate semantic fingerprint | [polish](stage-polish.md), [Audita](../integrations/audita.md) |
|
||||||
@@ -325,19 +340,21 @@ values that cannot affect canonical results. Concrete coverage is owned by the
|
|||||||
focused stage and integration documents linked above.
|
focused stage and integration documents linked above.
|
||||||
|
|
||||||
Before an explicitly bounded execution starts after `prepare`, the application
|
Before an explicitly bounded execution starts after `prepare`, the application
|
||||||
reads the session manifest and accepts only `succeeded` or `skipped` for every
|
reads the session manifest and checks excluded canonical prefix stages. Valid
|
||||||
excluded canonical prefix stage. The first other status or absent record fails
|
supplied transcript coverage satisfies the corresponding producer work; in that
|
||||||
|
context prepare and the independent render and extract stages do not block a
|
||||||
|
downstream selection. Other excluded stages require `succeeded` or `skipped`.
|
||||||
|
The first other status or absent record fails
|
||||||
the request before layout mutation, adapter initialization, session-manifest
|
the request before layout mutation, adapter initialization, session-manifest
|
||||||
writes, or run-directory creation. Excluded prefix records are not passed to
|
writes, or run-directory creation. Excluded prefix records are not passed to
|
||||||
resume validators. Records after the selected end are not prerequisites and
|
resume validators. Records after the selected end are not prerequisites and
|
||||||
may be made stale by selected work without being scheduled.
|
may be made stale by selected work without being scheduled.
|
||||||
|
|
||||||
After a publish commits remotely, any configured local cleanup is first recorded
|
Cleanup is an ordinary selected stage. It validates recorded successful
|
||||||
as a session-manifest obligation before deletion begins. Each target becomes
|
publication evidence before deleting local run history, saves its normal stage
|
||||||
complete only after its confined deletion (or safe absence check) and a
|
transition, and retries incomplete work on a later selected invocation without
|
||||||
successful manifest save. An incomplete obligation is retried when publish
|
republishing. Historical run-local paths in records are provenance, not a
|
||||||
executes again and retains the committed run and remote identity that authorized
|
requirement that those files remain present. See [cleanup](stage-cleanup.md).
|
||||||
it; an invocation that does not execute publish does not perform cleanup.
|
|
||||||
|
|
||||||
Each invocation derives campaign, session, run, local-path, and remote-prefix
|
Each invocation derives campaign, session, run, local-path, and remote-prefix
|
||||||
metadata from the validated resolved configuration as one projection. A persisted
|
metadata from the validated resolved configuration as one projection. A persisted
|
||||||
@@ -353,7 +370,8 @@ where the last session transition can require operator interpretation.
|
|||||||
## Invariants
|
## Invariants
|
||||||
|
|
||||||
- stage resume/skip decisions are session-manifest driven.
|
- stage resume/skip decisions are session-manifest driven.
|
||||||
- semantic fingerprint comparison precedes stage-specific resume validation.
|
- ordinary local semantic fingerprint comparison precedes stage-specific resume
|
||||||
|
validation; valid supplied coverage is assessed independently.
|
||||||
- only successful and intentional-skipped results promote current semantic
|
- only successful and intentional-skipped results promote current semantic
|
||||||
evidence.
|
evidence.
|
||||||
- running, failed, and self-skipped stages do not retain result payloads from
|
- running, failed, and self-skipped stages do not retain result payloads from
|
||||||
@@ -373,4 +391,13 @@ where the last session transition can require operator interpretation.
|
|||||||
- Transcribe speaker state: `internal/manifest/transcribe_state.go`
|
- Transcribe speaker state: `internal/manifest/transcribe_state.go`
|
||||||
- Package tests: `internal/manifest/*_test.go`
|
- Package tests: `internal/manifest/*_test.go`
|
||||||
- Assembled execution behavior: `internal/app/runner_test.go`,
|
- Assembled execution behavior: `internal/app/runner_test.go`,
|
||||||
`internal/app/run_stage_test.go`
|
`internal/app/run_selection_test.go`
|
||||||
|
|
||||||
|
## Prepared Glossary Evidence
|
||||||
|
|
||||||
|
Preparation records the party, campaign, setting, spells, and combined glossary
|
||||||
|
documents with canonical paths, checksums, sizes, and provenance. Audita's polish
|
||||||
|
request consumes the four individual envelopes. Publish includes recorded
|
||||||
|
prepared documents, and restore selects their declared immutable objects.
|
||||||
|
See [prepare](stage-prepare.md), [polish](stage-polish.md), and
|
||||||
|
[artifact internals](artifacts.md).
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ in the [CLI](../cli.md), [Configuration](../config.md),
|
|||||||
Externally observable tool and format contracts belong under
|
Externally observable tool and format contracts belong under
|
||||||
[Integrations](../integrations/).
|
[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
|
## Execution Path
|
||||||
|
|
||||||
```text
|
```text
|
||||||
@@ -16,36 +19,44 @@ cmd/narratio -> internal/app -> configuration and production composition
|
|||||||
-> manifests and artifact resolution -> durable local/remote output
|
-> manifests and artifact resolution -> durable local/remote output
|
||||||
```
|
```
|
||||||
|
|
||||||
The executable delegates process behavior to the application boundary. The
|
The executable supplies signal-aware context and caller-owned streams to the
|
||||||
|
native CommandKit application boundary. The
|
||||||
application resolves configuration, composes concrete collaborators, acquires
|
application resolves configuration, composes concrete collaborators, acquires
|
||||||
session safety controls, and runs commands. Pipeline commands execute the
|
session safety controls, and runs commands. Pipeline commands execute the
|
||||||
canonical stage sequence through adapter interfaces, while manifests record
|
canonical stage sequence through adapter interfaces, while manifests record
|
||||||
progress and artifact services resolve durable inputs and outputs.
|
progress and artifact services resolve durable inputs and outputs.
|
||||||
|
|
||||||
The pipeline runner follows one explicit invocation lifecycle: inspect bounded
|
The pipeline runner follows one explicit invocation lifecycle: inspect bounded
|
||||||
prerequisites without mutation, prepare the workspace layout, acquire one
|
prerequisites without mutation, acquire the workspace lock, prepare the workspace
|
||||||
session lock, load or create the authoritative session manifest, compose only
|
layout, load or create the authoritative session manifest, complete or
|
||||||
the collaborators needed by the selected range, execute each selected stage in
|
reuse selected preparation, check projected downstream work, compose only the
|
||||||
order, and then return the summary. Cleanup, when selected, is the ordinary
|
collaborators needed by selected work, execute each selected stage in order, finalize terminal state, release resources, and return a possibly partial
|
||||||
final stage rather than runner finalization work.
|
summary with preserved failure causes. Narrow terminal local persistence detaches
|
||||||
The lock remains held from manifest initialization through finalization, and a
|
cancellation; active work retains the canceled operation context. Cleanup, when
|
||||||
|
selected, is the ordinary final stage rather than runner finalization work.
|
||||||
|
The lock remains held from layout preparation through finalization, and a
|
||||||
failed stage or required manifest save prevents later stages from starting.
|
failed stage or required manifest save prevents later stages from starting.
|
||||||
|
Standalone preflight shares that lifecycle, runs only preparation, and checks
|
||||||
|
enabled capabilities while holding the same lock.
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
| Area | Implemented owners | Responsibility |
|
| Area | Implemented owners | Responsibility |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| Executable | `cmd/narratio` | Process entry, standard stream wiring, argument handoff, and exit status. |
|
| Executable | `cmd/narratio` | Process entry, standard stream wiring, argument handoff, and exit status. |
|
||||||
| Application orchestration | `internal/app` | Command dispatch, configuration selection, secret-file environment loading, production composition, session locking, planning, execution, restore, and user-facing reporting. |
|
| Application orchestration | `internal/app` | Native CommandKit declarations/reporting, lazy configuration selection, ConfigKit startup invocation, production composition, workspace locking, planning, execution, restore, and user-facing reporting. |
|
||||||
| Configuration | [`internal/config`](configuration.md) | ConfigKit-backed pipeline imports and overlays, canonical party and family expansion, strict YAML loading, defaults, normalization, session templating, and validation. |
|
| Configuration | [`internal/config`](configuration.md) | Typed ConfigKit results and lifecycle defaults, imports/overlays, canonical party loading, separate catalog/player/publication derivation, session templating, and validation. |
|
||||||
| Pipeline stages | `internal/stage` | Canonical stage registry, shared stage contract, execution dependencies, and implemented stage behavior. |
|
| Pipeline stages | `internal/stage` | Canonical stage registry, shared stage contract, execution dependencies, and implemented stage behavior. |
|
||||||
|
| Glossaries | `internal/glossary` | Native vocabulary resolution, schema validation, party projection, and deterministic documents. |
|
||||||
|
| Downstream preflight | [`internal/preflight`](preflight.md) | Assess Audita, Notarius, and prompt requirements for execution and standalone preflight. |
|
||||||
| External boundaries | `internal/adapters`, `internal/audio` | WhisperX HTTP, downstream subprocesses, notification, object storage, and S3 audio materialization behind Narratio contracts. |
|
| External boundaries | `internal/adapters`, `internal/audio` | WhisperX HTTP, downstream subprocesses, notification, object storage, and S3 audio materialization behind Narratio contracts. |
|
||||||
| Manifests | `internal/manifest` | Durable session progress, stage transitions, validation, and atomic persistence. |
|
| Manifests | `internal/manifest` | Durable session progress, stage transitions, validation, and atomic persistence. |
|
||||||
| Artifacts and paths | `internal/artifacts`, `internal/pathsafe` | Artifact identities and resolution, local and remote path/key models, current-state discovery, and confined relative destinations. |
|
| Artifacts and paths | `internal/artifacts`, `internal/pathsafe` | Artifact identities and resolution, local and remote path/key models, current-state discovery, and confined relative destinations. |
|
||||||
| Previous-session cache | `internal/previouscache` | Deterministic planning and materialization requirements for configured previous-session inputs. |
|
| Previous-session cache | `internal/previouscache` | Deterministic planning and materialization requirements for configured previous-session inputs. |
|
||||||
|
| Artifact dependencies | `internal/artifactdeps` | Immutable configured-artifact dependency ordering, closure, and dependent traversal. |
|
||||||
| Artifact policy | `internal/artifactpolicy` | Source and destination policy, configured artifact identity validation, and publish destination safety. |
|
| Artifact policy | `internal/artifactpolicy` | Source and destination policy, configured artifact identity validation, and publish destination safety. |
|
||||||
| Shared models and file operations | `internal/artifactmodel`, `internal/contracts`, [`internal/fileops`](fileops.md) | Transcript and artifact data contracts plus atomic single-file replacement, bounded reads, workspace modes, and root-scoped cleanup helpers. |
|
| Shared models and file operations | `internal/artifactmodel`, `internal/contracts`, [`internal/fileops`](fileops.md) | Transcript and artifact data contracts plus atomic single-file replacement, bounded reads, workspace modes, and root-scoped cleanup helpers. |
|
||||||
| Logging | `internal/logging` | Application logger construction and shared structured logging behavior. |
|
| Logging | `internal/logging` | Small Narratio-owned diagnostic/progress interface adapted to the invocation reporter. |
|
||||||
|
|
||||||
The application boundary composes concrete implementations. Stages depend on
|
The application boundary composes concrete implementations. Stages depend on
|
||||||
Narratio-level contracts; external transport and SDK details remain in
|
Narratio-level contracts; external transport and SDK details remain in
|
||||||
@@ -65,8 +76,10 @@ model and the same pure pre-execution decision over recorded status, force, and
|
|||||||
normalized resume validation. Planning applies that decision and modeled
|
normalized resume validation. Planning applies that decision and modeled
|
||||||
selected-stage transitions to cloned session state; it does not persist, create
|
selected-stage transitions to cloned session state; it does not persist, create
|
||||||
invocation state, initialize stage-execution adapters, or claim to observe an
|
invocation state, initialize stage-execution adapters, or claim to observe an
|
||||||
execution result. Command configuration loading can still retrieve a
|
execution result. For eligible S3 preparation reuse, the projection receives a
|
||||||
missing session file through configured remote storage. It retains the initially
|
read-only object-store collaborator for the shared resume validator. Command
|
||||||
|
configuration loading can still retrieve a missing session file through
|
||||||
|
configured remote storage. It retains the initially
|
||||||
composed pipeline and selected campaign while resolving either a local or
|
composed pipeline and selected campaign while resolving either a local or
|
||||||
downloaded remote session, so one invocation cannot mix pipeline revisions.
|
downloaded remote session, so one invocation cannot mix pipeline revisions.
|
||||||
Analyze planning additionally exposes the artifact closure's targets,
|
Analyze planning additionally exposes the artifact closure's targets,
|
||||||
@@ -107,9 +120,11 @@ so any earlier replacement can stale a prior cleanup result.
|
|||||||
## Focused Documentation
|
## Focused Documentation
|
||||||
|
|
||||||
- [Configuration Internals](configuration.md): pipeline imports and overlays,
|
- [Configuration Internals](configuration.md): pipeline imports and overlays,
|
||||||
field ownership, decoding, and root-relative path semantics.
|
field ownership, decoding, and source-relative resource semantics.
|
||||||
- [Adapter Internals](adapters.md): external adapter boundaries, composition,
|
- [Adapter Internals](adapters.md): external adapter boundaries, composition,
|
||||||
failure behavior, and test surfaces.
|
failure behavior, and test surfaces.
|
||||||
|
- [Preflight Internals](preflight.md): projected target selection and shared
|
||||||
|
requirements assessment and standalone preparation.
|
||||||
- [Artifact Internals](artifacts.md): source identities, runtime catalog,
|
- [Artifact Internals](artifacts.md): source identities, runtime catalog,
|
||||||
resolution, previous requirements, and current-state helpers.
|
resolution, previous requirements, and current-state helpers.
|
||||||
- [Manifest Internals](manifest.md): session records, persistence, and execution
|
- [Manifest Internals](manifest.md): session records, persistence, and execution
|
||||||
@@ -137,4 +152,4 @@ before changing behavior.
|
|||||||
The stage registry is implemented in `internal/stage/placeholders.go` and its
|
The stage registry is implemented in `internal/stage/placeholders.go` and its
|
||||||
ordering is protected by `internal/app/planner_test.go`. Cross-invocation skip,
|
ordering is protected by `internal/app/planner_test.go`. Cross-invocation skip,
|
||||||
force, failure, and invalidation behavior is exercised in
|
force, failure, and invalidation behavior is exercised in
|
||||||
`internal/app/runner_test.go` and `internal/app/run_stage_test.go`.
|
`internal/app/runner_test.go` and `internal/app/run_selection_test.go`.
|
||||||
|
|||||||
52
docs/internal/preflight.md
Normal file
52
docs/internal/preflight.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# Internal: Downstream Preflight
|
||||||
|
|
||||||
|
The application runs automatic downstream checks after selected preparation and
|
||||||
|
before selected processing. It projects remaining work against a clone of the
|
||||||
|
locked manifest, using the stage decisions and analysis planner shared with
|
||||||
|
`session plan`. Projected polish selects Audita; projected enabled extraction
|
||||||
|
selects Notarius; projected trim and analysis select Scriptorium requirements.
|
||||||
|
A projection is not an execution commitment, and an empty target set invokes no
|
||||||
|
checker.
|
||||||
|
|
||||||
|
Standalone `preflight` acquires configuration once and uses the runner's locked
|
||||||
|
invocation lifecycle to execute or reuse `prepare`. Within that same lock it
|
||||||
|
selects all enabled capabilities and prompt prerequisites regardless of reuse,
|
||||||
|
then invokes the shared downstream request builders and checkers. A preparation
|
||||||
|
failure blocks probes requiring prepared inputs but permits independent prompt
|
||||||
|
and remote-lock inspection while the context remains active. Preparation success
|
||||||
|
is persisted even when later readiness fails; readiness itself creates no stage
|
||||||
|
or reusable success record.
|
||||||
|
|
||||||
|
The composed store is passed to the shared preparation validator. If source
|
||||||
|
inspection fails, preparation attempts the ordinary rerun, and its report retains
|
||||||
|
the unverified-source reason alongside any resulting preparation failure.
|
||||||
|
|
||||||
|
Shared finalization retains terminal manifest evidence while locked. Normal
|
||||||
|
pipeline execution projects that evidence into its run-artifact inventory;
|
||||||
|
standalone preflight returns its readiness report without building that inventory.
|
||||||
|
|
||||||
|
Audita receives verified prepared glossary files and production selections with
|
||||||
|
an embedded synthetic transcript. Its adapter performs native provider smoke
|
||||||
|
checks and retains failure causes. Notarius receives production controls and
|
||||||
|
verified reference snapshots, which are checked again after its native call.
|
||||||
|
The application projects transcript-producing work before allowing a verified
|
||||||
|
current transcript; otherwise it reports the synthetic fallback. Neither probe
|
||||||
|
publishes work, and the synthetic input cannot establish real-transcript
|
||||||
|
feasibility or editorial quality.
|
||||||
|
|
||||||
|
Scriptorium input-map keys remain binding names distinct from Narratio source
|
||||||
|
IDs. Missing required bindings or variables and inspection failures are errors;
|
||||||
|
optional sources for required inputs, conditional requirements, incomplete
|
||||||
|
discovery, and discovery issues produce warnings. Findings survive independent
|
||||||
|
failures and cancellation stops new work. Each report is interpreted by a pure
|
||||||
|
assessment; the surrounding loop owns provider calls and ordered failure handling.
|
||||||
|
Tool-specific readiness operations retain initialized adapters on the invocation;
|
||||||
|
preparation and transcript projection are assessed before report presentation.
|
||||||
|
|
||||||
|
Probe files use invocation-scoped destinations under `runs/`, protected by the
|
||||||
|
workspace lock through report consumption, reference verification, and terminal
|
||||||
|
persistence. A later authorized cleanup can remove those files without removing
|
||||||
|
durable prepared inputs. See [workspace internals](workspace.md),
|
||||||
|
[CLI](../cli.md#preflight), and [operations](../operations.md#prompt-requirements-preflight).
|
||||||
|
Implementation is in `internal/preflight`, `internal/app/downstream_readiness.go`,
|
||||||
|
`internal/app/runner_preflight.go`, and `internal/app/session_readiness.go`.
|
||||||
@@ -20,7 +20,7 @@ dependency order, and safely materialize validated outputs.
|
|||||||
Supported source families:
|
Supported source families:
|
||||||
- built-ins: `narratio.transcript.*`, `narratio.bounds.session`
|
- built-ins: `narratio.transcript.*`, `narratio.bounds.session`
|
||||||
- prepared stable inputs: `narratio.input.players`, `narratio.input.party`,
|
- prepared stable inputs: `narratio.input.players`, `narratio.input.party`,
|
||||||
`narratio.input.glossary`, `narratio.input.spell_catalog`
|
`narratio.input.glossary.{party,campaign,setting,spells,combined}`
|
||||||
- configured artifacts: `narratio.artifact.<key>`
|
- configured artifacts: `narratio.artifact.<key>`
|
||||||
- extraction lanes: `narratio.extraction.<key>`
|
- extraction lanes: `narratio.extraction.<key>`
|
||||||
- previous-session cache: `narratio.previous_session.artifact.<key>`
|
- previous-session cache: `narratio.previous_session.artifact.<key>`
|
||||||
@@ -52,8 +52,9 @@ Supported source families:
|
|||||||
- makes a non-executable configured artifact reusable only when its current
|
- makes a non-executable configured artifact reusable only when its current
|
||||||
manifest record and durable output pass the configured-artifact evidence
|
manifest record and durable output pass the configured-artifact evidence
|
||||||
contract; an incidental or stale canonical file is unavailable.
|
contract; an incidental or stale canonical file is unavailable.
|
||||||
- validates selected artifact dependency order (cycle-safe topo ordering).
|
- uses the shared artifact closure and cycle-safe dependency ordering described in
|
||||||
- consumes only the concrete dependency graph finalized by configuration;
|
[Artifact Internals](artifacts.md#previous-requirement-collection).
|
||||||
|
- consumes only the concrete dependency graph derived in the shared domain catalog;
|
||||||
planning, prerequisite closure, execution, reuse, invalidation, and semantic
|
planning, prerequisite closure, execution, reuse, invalidation, and semantic
|
||||||
evidence do not infer a second graph from inputs.
|
evidence do not infer a second graph from inputs.
|
||||||
- resolves required/optional inputs per artifact source definition into an
|
- resolves required/optional inputs per artifact source definition into an
|
||||||
@@ -77,20 +78,24 @@ Supported source families:
|
|||||||
JSON payload and no map serialization. Configured artifacts are fingerprinted
|
JSON payload and no map serialization. Configured artifacts are fingerprinted
|
||||||
in deterministic dependency order.
|
in deterministic dependency order.
|
||||||
- fingerprints the normalized artifact key, prompt and profile identifiers,
|
- fingerprints the normalized artifact key, prompt and profile identifiers,
|
||||||
effective render-debug behavior, session-relative output identity, sorted
|
session-relative output identity, sorted
|
||||||
dependency keys, ordered input declarations and semantic identities,
|
dependency keys, ordered input declarations and semantic identities,
|
||||||
validated current dependency-output identities, and sorted effective
|
validated current dependency-output identities, and sorted effective
|
||||||
Scriptorium variables (including Narratio's sticky session variable).
|
Scriptorium variables (including Narratio's sticky session variable).
|
||||||
|
Render-debug is diagnostic and does not affect the fingerprint.
|
||||||
- provides read-only reconciliation that classifies each configured record as
|
- provides read-only reconciliation that classifies each configured record as
|
||||||
current, stale, missing, failed, or otherwise non-resumable, and
|
supplied, current, stale, missing, failed, or otherwise non-resumable, and
|
||||||
separately identifies manifest records removed from current configuration.
|
separately identifies manifest records removed from current configuration.
|
||||||
A record is current only when its fingerprint version and value match and its
|
A record is current only when its fingerprint version and value match and its
|
||||||
configured output still passes manifest-authoritative evidence validation.
|
configured output still passes manifest-authoritative evidence validation.
|
||||||
|
A valid supplied product is classified first and does not need its historical
|
||||||
|
generation inputs or fingerprint.
|
||||||
- owns a read-only typed work planner. Its explicit targets are enabled
|
- owns a read-only typed work planner. Its explicit targets are enabled
|
||||||
artifacts by default or the exact normalized `--artifacts` selection when
|
artifacts by default or the exact normalized `--artifacts` selection when
|
||||||
supplied. It closes targets over configured prerequisites, orders the closure
|
supplied. It closes targets over configured prerequisites, stopping at valid
|
||||||
topologically, reuses current members, and schedules every non-current member
|
supplied products unless they are explicit forced targets. It orders the work
|
||||||
before its dependents.
|
topologically, reuses current or supplied members, and schedules non-current
|
||||||
|
members before their dependents.
|
||||||
- force applies only to explicit targets. A current prerequisite is reused
|
- force applies only to explicit targets. A current prerequisite is reused
|
||||||
unless it is itself an explicit forced target; disabled prerequisites may be
|
unless it is itself an explicit forced target; disabled prerequisites may be
|
||||||
rebuilt when required, while unrelated disabled artifacts are excluded.
|
rebuilt when required, while unrelated disabled artifacts are excluded.
|
||||||
@@ -113,7 +118,9 @@ Supported source families:
|
|||||||
Scriptorium; newly produced prerequisites enter that catalog with the same
|
Scriptorium; newly produced prerequisites enter that catalog with the same
|
||||||
contract, checksum, and size identity used for persisted current evidence.
|
contract, checksum, and size identity used for persisted current evidence.
|
||||||
- before the first adapter call, checkpoints the reconciled starting collection
|
- before the first adapter call, checkpoints the reconciled starting collection
|
||||||
when it removed configuration records or cleared obsolete authority. After
|
when it removed configuration records or cleared obsolete authority. A
|
||||||
|
scheduled replacement retires its supplied record in this checkpoint, so a
|
||||||
|
failed attempt cannot revive the old supplied product. After
|
||||||
each successful artifact, checkpoints the complete collection before making
|
each successful artifact, checkpoints the complete collection before making
|
||||||
that artifact available to the next scheduled dependent. Analyze supplies
|
that artifact available to the next scheduled dependent. Analyze supplies
|
||||||
its typed update to the shared
|
its typed update to the shared
|
||||||
@@ -138,9 +145,14 @@ Supported source families:
|
|||||||
order after the complete reconciled collection has been checkpointed;
|
order after the complete reconciled collection has been checkpointed;
|
||||||
unrelated stale records do not make an otherwise successful partial
|
unrelated stale records do not make an otherwise successful partial
|
||||||
invocation fail.
|
invocation fail.
|
||||||
- resolves previous-session sources from local `previous/` cache only.
|
- resolves previous-session sources from manifest-backed local `previous/` cache
|
||||||
|
only; preparation collects requirements for the selected prerequisite closure.
|
||||||
- runs optional render-debug, then artifact execution.
|
- runs optional render-debug, then artifact execution.
|
||||||
- validates non-empty output files and materializes canonical outputs.
|
- validates non-empty output files and materializes canonical outputs.
|
||||||
|
- shares effective prompt context and variables with requirements inspection;
|
||||||
|
preview and generation capture their own results separately from stderr logs.
|
||||||
|
Application preflight selects projected work through the same planner; see
|
||||||
|
[preflight internals](preflight.md).
|
||||||
|
|
||||||
## Failure Semantics
|
## Failure Semantics
|
||||||
|
|
||||||
@@ -183,8 +195,8 @@ Supported source families:
|
|||||||
visible only inside Scriptorium—such as a file privately loaded by its config
|
visible only inside Scriptorium—such as a file privately loaded by its config
|
||||||
path—requires an explicit forced regeneration.
|
path—requires an explicit forced regeneration.
|
||||||
- output provenance and metadata are deterministic per execution.
|
- output provenance and metadata are deterministic per execution.
|
||||||
- a canonical file without current per-artifact manifest evidence is never
|
- a canonical file without current per-artifact evidence or a validated
|
||||||
promoted to current state.
|
supplied-product record is never promoted to current state.
|
||||||
- an ordinary retry after interruption or partial failure reuses every valid
|
- an ordinary retry after interruption or partial failure reuses every valid
|
||||||
earlier checkpoint and schedules only failed, stale, missing, or otherwise
|
earlier checkpoint and schedules only failed, stale, missing, or otherwise
|
||||||
non-current work in dependency order.
|
non-current work in dependency order.
|
||||||
|
|||||||
@@ -1,54 +1,28 @@
|
|||||||
# Stage: cleanup
|
# Stage: cleanup
|
||||||
|
|
||||||
## Purpose
|
## Purpose And Authorization
|
||||||
|
|
||||||
Remove explicitly configured local data for the run selected by a successful
|
The final selected cleanup stage removes local run history after successful
|
||||||
publish commit. Cleanup is the twelfth and final canonical stage, after
|
publication when `workspace.cleanup_after_publish` is enabled. It validates the
|
||||||
`notify`.
|
published run, commit and pointer evidence and configured campaign/session
|
||||||
|
identity. Explicit whole-session cleanup is a separate operator action.
|
||||||
## Authorization And Targets
|
|
||||||
|
|
||||||
Cleanup is disabled unless at least one of these policies is true:
|
|
||||||
|
|
||||||
- `pipeline.spool.delete_audio_after_publish`
|
|
||||||
- `pipeline.workspace.cleanup_after_publish`
|
|
||||||
|
|
||||||
An enabled cleanup requires the manifest's publish stage to be succeeded with
|
|
||||||
`uploaded=true`, a canonical `published_run_id`, and the exact remote commit and
|
|
||||||
current commit-pointer keys for the manifest campaign/session prefix. The
|
|
||||||
configured campaign and session must match the manifest. Cleanup derives its
|
|
||||||
only possible targets through the canonical artifact path helpers:
|
|
||||||
|
|
||||||
- the published run's session spool-audio directory; and
|
|
||||||
- the published run's workspace run directory.
|
|
||||||
|
|
||||||
It does not scan parent directories, infer the newest run, or read object
|
|
||||||
storage. Every deletion uses the root-confined file operation, which rejects a
|
|
||||||
root itself, traversal, symlink escape, and out-of-root targets.
|
|
||||||
|
|
||||||
## Execution And Resume
|
## Execution And Resume
|
||||||
|
|
||||||
Disabled cleanup records an explicit skipped result. Enabled cleanup removes
|
Cleanup removes recognized managed stage and restore log/debug links without
|
||||||
targets in deterministic policy order and treats an already-missing target as
|
following them, then deletes the selected session's entire `runs/` directory
|
||||||
success. A successful record contains the published run ID and completed policy
|
through a confined workspace root. Missing runs and links are successful;
|
||||||
names.
|
unsafe paths and managed-name conflicts fail. Subprocess state, caches, durable
|
||||||
|
session products and remote objects are outside its scope.
|
||||||
|
|
||||||
A previous cleanup success is reusable only while its semantic configuration
|
Resume inspects both the runs directory and managed views without mutation. An
|
||||||
matches and every selected target remains absent. A recreated target makes the
|
empty runs directory, a new attempt, or a dangling managed view requires cleanup
|
||||||
stage non-resumable. A failure is recorded against cleanup; publish remains
|
again. Deletion is not transactional: a failure can leave partial progress and
|
||||||
succeeded and remote current state is unchanged. On a later normal full run,
|
is recorded as a failed stage. A later selected cleanup retries without another
|
||||||
valid upstream stages are skipped and cleanup is retried without republishing.
|
publish. See [operations](../operations.md#cleanup).
|
||||||
|
|
||||||
`narratio publish` selects publish only and never invokes cleanup. A bounded run
|
|
||||||
through `notify` or any earlier endpoint also excludes it. Operators may run
|
|
||||||
`narratio run-stage cleanup <session_id>` directly; missing, failed, malformed,
|
|
||||||
or identity-mismatched publication evidence fails before deletion.
|
|
||||||
|
|
||||||
## Implementation And Tests
|
## Implementation And Tests
|
||||||
|
|
||||||
- Planning and evidence validation: `internal/stage/cleanup_plan.go`
|
`internal/stage/cleanup_plan.go`, `cleanup.go`, `internal/fileops/cleanup.go`,
|
||||||
- Execution and resume: `internal/stage/cleanup.go`
|
`internal/artifacts/attempt_views.go`, and their tests own authorization, inspection, managed view
|
||||||
- Root-confined deletion: `internal/fileops/cleanup.go`
|
removal and confined deletion.
|
||||||
- Focused tests: `internal/stage/cleanup_plan_test.go`,
|
|
||||||
`internal/stage/cleanup_test.go`, and
|
|
||||||
`internal/app/cleanup_orchestration_test.go`
|
|
||||||
|
|||||||
@@ -2,147 +2,51 @@
|
|||||||
|
|
||||||
## Responsibility
|
## Responsibility
|
||||||
|
|
||||||
`extract` runs after `render` and before `analyze`. It converts the canonical
|
The extract stage invokes the configured Notarius pipeline on the verified
|
||||||
`narratio.transcript.final_trimmed` JSON into configured Notarius lane artifacts.
|
final trimmed transcript and prepared references, promotes configured lane
|
||||||
An omitted or disabled Notarius section makes the stage explicitly self-skip
|
products, and records Narratio-owned content evidence. Notarius owns its
|
||||||
with reason `notarius_disabled`, no outputs, and no Notarius runner.
|
pipeline, cache, validation and completion protocol; see the
|
||||||
|
[integration contract](../integrations/notarius.md).
|
||||||
The external protocol is documented in the
|
|
||||||
[Notarius integration contract](../integrations/notarius.md). Configuration
|
|
||||||
fields belong in [Configuration](../config.md), and physical paths and force
|
|
||||||
procedures belong in [Operations](../operations.md).
|
|
||||||
|
|
||||||
## Lifecycle
|
## Lifecycle
|
||||||
|
|
||||||
`internal/stage/extract.go`:
|
Disabled extraction records a skip. An execution resolves manifest-backed input
|
||||||
|
identities, creates immutable content-addressed reference snapshots, and invokes
|
||||||
|
Notarius with run-local output, log and debug destinations. Execution and
|
||||||
|
readiness share resolved binary, configuration, credential, timeout and cache
|
||||||
|
options while retaining their own input and diagnostic paths. The adapter accepts a
|
||||||
|
successful native completion report for the expected pipeline and confined output
|
||||||
|
directory. The stage reads each configured lane JSON, validates its safe path and
|
||||||
|
content, then promotes all required products to flat artifact paths before
|
||||||
|
recording success. The original bundle and optional domain auxiliaries stay in
|
||||||
|
the producing run until authorized cleanup removes run history. Positive native
|
||||||
|
fallback counts are recorded and reported. `internal/artifacts` owns the typed
|
||||||
|
metadata codecs shared by extraction, evidence hydration, resume, and fallback
|
||||||
|
reporting.
|
||||||
|
|
||||||
1. resolves the final trimmed transcript from the shared artifact catalog;
|
An imported lane is individually available from its validated supplied record
|
||||||
2. resolves every configured prepared reference through the shared
|
without historical Notarius metadata. Extraction is satisfied by supplied
|
||||||
manifest-authoritative identity resolver before creating run-local output;
|
products only when all configured lanes are available. Executing a missing
|
||||||
3. resolves each reference to a stable content-addressed session snapshot,
|
bundle regenerates the complete configured set and retires its supplied records.
|
||||||
reusing verified bytes or reconstructing a missing/corrupt regular entry,
|
|
||||||
and rejects any source change observed while copying;
|
|
||||||
4. fingerprints the byte- and provenance-bearing Notarius invocation evidence,
|
|
||||||
including sorted reference identities and the explicit downstream
|
|
||||||
configuration-overlay selection;
|
|
||||||
5. creates a run-local staging directory and invokes the injected
|
|
||||||
`notarius.Runner`, carrying the optional already-resolved credential
|
|
||||||
reference without exposing its value, the optional exact configuration
|
|
||||||
overlay, plus effective resume and chunk-cache controls after force
|
|
||||||
precedence;
|
|
||||||
6. revalidates the reference snapshots, then validates the v2 successful
|
|
||||||
receipt, confined index, management documents, configured required lane
|
|
||||||
descriptors, validation summaries, and regular payload files;
|
|
||||||
7. atomically promotes the complete bundle to its immutable durable location;
|
|
||||||
8. records one non-selectable `notarius_index` output and one selectable
|
|
||||||
`notarius_lane` output per configured lane; and
|
|
||||||
9. registers each lane as `narratio.extraction.<output_key>` for downstream
|
|
||||||
Scriptorium and publish resolution.
|
|
||||||
|
|
||||||
Lane records retain checksum, contract, producer run ID, and Notarius system,
|
|
||||||
run, pipeline, and lane provenance. Stage metadata retains the durable bundle
|
|
||||||
root, receipt, diagnostic paths, rejection/warning summaries, producing
|
|
||||||
Narratio run ID, the resolved trimmed-input identity, and invocation
|
|
||||||
fingerprint. The input identity binds the exact transcript bytes, canonical
|
|
||||||
source ID, producer stage/output/run identity, and resolution provenance.
|
|
||||||
Reference metadata contains only selector, source ID, canonical session-relative
|
|
||||||
path, checksum, and size; adapter requests receive selector and absolute stable
|
|
||||||
snapshot path, never payload contents. Snapshot bytes must
|
|
||||||
match the prepared identity both before and after Notarius runs, so a concurrent
|
|
||||||
prepared-file replacement cannot make recorded provenance describe different
|
|
||||||
bytes from those supplied to Notarius.
|
|
||||||
Validation completes before the single durable rename, so a rejected result
|
|
||||||
cannot expose a partial durable bundle.
|
|
||||||
|
|
||||||
Snapshot destinations are owned by `internal/artifacts` under
|
|
||||||
`cache/notarius/references/<sha256>/<prepared-basename>`. They contain no run ID
|
|
||||||
or timestamp and can be reused across invocations. Identical bytes and basename
|
|
||||||
share a verified file; changed bytes select a different digest directory.
|
|
||||||
Unsafe path components and non-regular conflicts fail without recursive
|
|
||||||
deletion. Snapshot paths are delivery details and never become manifest output
|
|
||||||
evidence or prerequisites for reuse of an already complete extract bundle.
|
|
||||||
|
|
||||||
Any executed extraction outcome that replaces a different effective outcome
|
|
||||||
marks succeeded analysis and delivery dependents stale. Render is an independent
|
|
||||||
sibling and remains current. Repeating the same disabled self-skip with no
|
|
||||||
outputs is stable and does not repeatedly invalidate dependent stages.
|
|
||||||
|
|
||||||
## Resume Validation
|
## Resume Validation
|
||||||
|
|
||||||
Before the focused validator runs, the application compares extract's versioned
|
Resume checks the direct transcript identity, configured pipeline and lane
|
||||||
semantic fingerprint. It covers enablement, Notarius pipeline identity, sorted
|
selection, reference identities, and manifest-backed output checksums and sizes.
|
||||||
reference selector/source mappings, sorted declared output contracts, and each
|
It does not reopen the original bundle or completion report.
|
||||||
canonical `narratio.extraction.<key>` output identity. It also covers the
|
Cache and debug selection, executable version and private downstream config are
|
||||||
explicit Notarius configuration-overlay selection; omitted, empty, and exact
|
not blanket invalidators. Force invokes extraction with cache refresh. A failed
|
||||||
`default` selectors share the base-selection identity. It excludes executable,
|
replacement is not represented as a current successful extraction.
|
||||||
timeout, working directory, config path, and private Notarius config contents.
|
|
||||||
Credential presence, reference name, and resolved value are likewise
|
|
||||||
operational-only and excluded. Ordinary command loading still resolves a
|
|
||||||
selected reference before resume evaluation, but a credential-only change does
|
|
||||||
not rerun a valid completed extraction or stale its dependents.
|
|
||||||
|
|
||||||
`internal/stage/extract_resume.go` then permits a skip only when the existing
|
|
||||||
stage record still matches the current byte- and provenance-bearing invocation
|
|
||||||
evidence. That evidence covers the current direct trimmed-transcript identity,
|
|
||||||
sorted prepared-reference identities, pipeline identity, and configured output
|
|
||||||
contracts, plus the same downstream overlay-selection identity. The same
|
|
||||||
reference helper and transcript identity are resolved again for artifact
|
|
||||||
evidence, so changing current transcript bytes, reference bytes, producer
|
|
||||||
identity, or a named downstream selection makes the prior extraction obsolete.
|
|
||||||
Operational runner settings do not invalidate otherwise current durable
|
|
||||||
evidence. This includes `resume` and `chunk_cache`; changing them alone cannot
|
|
||||||
make a complete extraction non-resumable. If extraction executes, ordinary
|
|
||||||
runs forward the configured values, while force disables resume and selects
|
|
||||||
`refresh`.
|
|
||||||
|
|
||||||
A valid prepared-reference change makes extraction non-resumable. Missing,
|
|
||||||
unsafe, or checksum-inconsistent prepared evidence is a hard validation error
|
|
||||||
with prepare-force guidance because an immediate extract rerun cannot succeed.
|
|
||||||
|
|
||||||
The validator then checks the producing run identity, canonical immutable
|
|
||||||
bundle root, path confinement and absence of symlink components, receipt
|
|
||||||
identity, exactly one canonical index, the exact configured source set,
|
|
||||||
contracts and provenance, regular-file status, and stored checksums. Missing or
|
|
||||||
obsolete results are non-resumable and run again; unsafe filesystem conditions
|
|
||||||
return an error rather than silently accepting or replacing data.
|
|
||||||
|
|
||||||
This sensitivity is limited to the explicit downstream selector. Narratio's
|
|
||||||
own overlay label and whole effective-configuration digest are not blanket
|
|
||||||
extraction invalidators. Neither contract can observe files imported by
|
|
||||||
Notarius configuration, profile contents, prompt/module definitions, or other
|
|
||||||
transitive inputs. Operators must force extraction after changing any such
|
|
||||||
private input behind a stable identifier.
|
|
||||||
|
|
||||||
## Failure Behavior
|
## Failure Behavior
|
||||||
|
|
||||||
Adapter startup, timeout, nonzero exit, receipt decoding, path confinement,
|
Native errors, malformed completion, missing required lanes, unsafe paths, or
|
||||||
index compatibility, inconsistent warning or diagnostic envelopes,
|
invalid JSON fail the attempt while preserving available diagnostics. A partial
|
||||||
required-lane rejection or incomplete validation, payload inspection,
|
report or incidental output is not success. See [operations](../operations.md#extraction-workflow).
|
||||||
checksum, or installation errors fail the stage through ordinary manifest
|
|
||||||
transition handling.
|
|
||||||
Stdout receipt and stderr diagnostics remain separate. Downstream stages are
|
|
||||||
not given selectable extraction sources unless the complete configured result
|
|
||||||
has passed validation and installation.
|
|
||||||
|
|
||||||
When a replacement attempt begins, the current session-stage record no longer
|
|
||||||
advertises payload from the previous success. A failed replacement therefore
|
|
||||||
has no current outputs, logs, generated configuration references, or metadata,
|
|
||||||
while the earlier immutable promoted bundle remains available for audit and
|
|
||||||
recovery.
|
|
||||||
|
|
||||||
## Implementation And Focused Tests
|
## Implementation And Focused Tests
|
||||||
|
|
||||||
- Stage execution, selection, and resume validation: `internal/stage/extract.go`,
|
`internal/stage/extract.go`, `extract_preflight.go`, `extract_native_test.go`,
|
||||||
`internal/stage/extract_resume.go`,
|
`internal/artifacts/extraction_evidence.go`, and `internal/adapters/notarius/`
|
||||||
`internal/stage/extract_test.go`,
|
own the stage, readiness, evidence and subprocess boundaries. The opt-in
|
||||||
`internal/stage/semantic_contracts_delivery.go`
|
`notarius_cache_integration_test.go` exercises a real executable.
|
||||||
- Stable snapshot materialization and verification:
|
|
||||||
`internal/stage/extract_references.go`
|
|
||||||
- Subprocess boundary: `internal/adapters/notarius/subprocess.go`,
|
|
||||||
`internal/adapters/notarius/subprocess_test.go`
|
|
||||||
- Catalog hydration: `internal/artifacts/extraction_catalog.go`,
|
|
||||||
`internal/artifacts/extraction_catalog_test.go`
|
|
||||||
- Composition and downstream behavior: `internal/app/runner_test.go`,
|
|
||||||
`internal/stage/analyze_test.go`, `internal/stage/publish_test.go`
|
|
||||||
- Opt-in Notarius v0.8.1 production-boundary coverage:
|
|
||||||
`internal/stage/notarius_cache_integration_test.go`
|
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ Normalize raw transcript inputs and merge into base transcript via Seriatim.
|
|||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
- `transcripts/base.json`
|
- `transcripts/base.json`
|
||||||
- optional `artifacts/seriatim.report.json`
|
|
||||||
|
The optional Seriatim report is a run-local diagnostic, not a canonical
|
||||||
|
product. See [Operations](../operations.md#local-state-layout) for placement
|
||||||
|
and retention.
|
||||||
|
|
||||||
## Key Behavior
|
## Key Behavior
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ Normalize polished transcript into final transcript using Seriatim.
|
|||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
- `transcripts/final.json` (or configured normalize output path)
|
- `transcripts/final.json` (or configured normalize output path)
|
||||||
- optional `artifacts/seriatim.normalize.report.json`
|
|
||||||
|
The optional Seriatim report is a run-local diagnostic, not a canonical
|
||||||
|
product. See [Operations](../operations.md#local-state-layout) for placement
|
||||||
|
and retention.
|
||||||
|
|
||||||
## Key Behavior
|
## Key Behavior
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +1,23 @@
|
|||||||
# Stage: polish
|
# Stage: polish
|
||||||
|
|
||||||
## Purpose
|
Polish resolves the base transcript from verified merge evidence and all four
|
||||||
|
prepared glossary documents from manifest-backed input records. It invokes the
|
||||||
|
Audita adapter with those paths and configured downstream selectors, then
|
||||||
|
validates the returned transcript before promoting `transcripts/polished.json`.
|
||||||
|
The transcript is the only canonical output. Available ordinary reports,
|
||||||
|
stdout/stderr, and the generated invocation record are run-local diagnostics;
|
||||||
|
Audita's work directory is separately selected. The [Audita contract](../integrations/audita.md)
|
||||||
|
owns invocation and diagnostic behavior.
|
||||||
|
|
||||||
Run Audita polishing on base transcript and produce polished transcript.
|
Polish records the prepared glossary identities as resume evidence alongside
|
||||||
|
semantic configuration. Changes to effective glossary content require new
|
||||||
|
polish work through ordinary prepare invalidation. Credentials, executable,
|
||||||
|
timeout, and diagnostics are operational. Narratio does not fingerprint the
|
||||||
|
contents of Audita-owned configuration or profiles: force polish after changing
|
||||||
|
those files behind unchanged selectors. Older evidence is reconsidered when
|
||||||
|
polish is selected; a downstream-only invocation does not eagerly run it.
|
||||||
|
|
||||||
## Inputs
|
A failed invocation does not promote an incidental output. Preflight is an
|
||||||
|
invocation check after preparation, not a successful polish record. See
|
||||||
- `transcripts/base.json`
|
[preflight internals](preflight.md), `internal/stage/polish.go`,
|
||||||
- `inputs/glossary.yml`
|
`internal/stage/polish_resume.go`, and their focused tests.
|
||||||
|
|
||||||
## Outputs
|
|
||||||
|
|
||||||
- `transcripts/polished.json`
|
|
||||||
|
|
||||||
The transcript is the only canonical output. Available `errors.yml`,
|
|
||||||
`recoveries.yml`, and `report.md` remain beside the run-local transcript and
|
|
||||||
are recorded as diagnostics, not artifact outputs.
|
|
||||||
|
|
||||||
## Key Behavior
|
|
||||||
|
|
||||||
- resolves base transcript only from verified merge manifest output evidence.
|
|
||||||
- invokes an Audita v2 runner with external configuration selectors and
|
|
||||||
explicitly forwarded provider credentials; the invocation supplies paths.
|
|
||||||
- validates processed transcript structure (`segments` array required).
|
|
||||||
- validates reported diagnostic paths against the three fixed adjacent names.
|
|
||||||
- materializes only the canonical transcript; records available reports with
|
|
||||||
stdout/stderr logs, generated invocation, and safe adapter metadata.
|
|
||||||
|
|
||||||
## Invariants
|
|
||||||
|
|
||||||
- polished transcript schema validation is mandatory.
|
|
||||||
- reports are optional diagnostics; Audita's external configuration may disable
|
|
||||||
them. A failed invocation never promotes an incidental transcript.
|
|
||||||
|
|
||||||
## Resume Semantics
|
|
||||||
|
|
||||||
Version 2 semantic evidence covers Audita's config path, downstream overlay,
|
|
||||||
proposal and validation profile selectors, ordered module selection (including
|
|
||||||
the distinction between omission and an explicit empty list), transcript
|
|
||||||
description, output schema, and canonical polished-transcript identity.
|
|
||||||
Credentials, executable path, timeout, and diagnostics are operational and do
|
|
||||||
not invalidate a successful result. Public credential reference names may
|
|
||||||
participate in configuration provenance but never expose resolved values.
|
|
||||||
|
|
||||||
Narratio fingerprints selections, not the contents of Audita-owned config or
|
|
||||||
profiles. Force `polish` after changing those files behind unchanged selections.
|
|
||||||
When polish is selected, older semantic evidence is reconsidered and the stage
|
|
||||||
reruns; a downstream-only invocation does not eagerly run polish.
|
|
||||||
|
|
||||||
## Related Contracts And Tests
|
|
||||||
|
|
||||||
- [Audita](../integrations/audita.md) owns subprocess, validation, and failure
|
|
||||||
semantics.
|
|
||||||
- [Configuration](../config.md#pipeline) owns operator-selected Audita values.
|
|
||||||
- Implementation and tests: `internal/stage/polish.go`,
|
|
||||||
`internal/stage/polish_test.go`,
|
|
||||||
`internal/stage/semantic_contracts_refinement.go`
|
|
||||||
|
|||||||
@@ -7,10 +7,9 @@ Materialize canonical current-session inputs before processing stages.
|
|||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
- resolved campaign, session, and pipeline configuration
|
- resolved campaign, session, and pipeline configuration
|
||||||
- stable input files (`speakers`, `autocorrect`, `glossary`, `players`, `party`)
|
- the stable speakers input, inline autocorrection rules, canonical party, and optional glossary selections
|
||||||
- optional spell-catalog overlay
|
- a local or S3 audio source when transcription needs audio
|
||||||
- one resolved local or S3 audio source
|
- previous-session input requirements from selected targets and their configured prerequisites
|
||||||
- enabled configured artifact input requirements for previous-session sources
|
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
@@ -19,32 +18,56 @@ Materialize canonical current-session inputs before processing stages.
|
|||||||
- `inputs/pipeline.resolved.yml`
|
- `inputs/pipeline.resolved.yml`
|
||||||
- `inputs/speakers.yml`
|
- `inputs/speakers.yml`
|
||||||
- `inputs/autocorrect.yml`
|
- `inputs/autocorrect.yml`
|
||||||
- `inputs/glossary.yml`
|
- `inputs/glossaries/{party,campaign,setting,spells,combined}.yml`
|
||||||
- `inputs/players.yml`
|
- `inputs/players.yml`
|
||||||
- `inputs/party.yml`
|
- `inputs/party.yml`
|
||||||
- optional `inputs/spell_catalog.json`
|
- prepared recordings in `audio/` when audio is acquired
|
||||||
- `audio/*.flac`
|
- optional `inputs/previous/artifacts/**`
|
||||||
- optional `previous/manifest.json`
|
|
||||||
- optional `previous/artifacts/**`
|
|
||||||
- deterministic `manifest.inputs` entries (checksums + provenance)
|
- deterministic `manifest.inputs` entries (checksums + provenance)
|
||||||
|
|
||||||
## Key Behavior
|
## Key Behavior
|
||||||
|
|
||||||
- validates required config/store state.
|
A stage-owned stable-product inventory supplies the data, destinations, and
|
||||||
|
manifest provenance for reference materialization. Resume projects source
|
||||||
|
identities from the same inventory, using normalized snapshots and a durable-copy
|
||||||
|
check for the pipeline projection. Semantic selection uses its presence-only
|
||||||
|
projection without rendering source content. Audio and previous-session hydration
|
||||||
|
are handled separately.
|
||||||
|
|
||||||
|
- validates required config/store state and resolves selected vocabulary before audio work.
|
||||||
|
- prepares references and history without acquiring audio when a validated
|
||||||
|
supplied transcript satisfies transcription. Forced or uncovered transcription
|
||||||
|
requires an audio selection. Preparation metadata records whether audio was
|
||||||
|
prepared, and reference-only preparation preserves supplied-product records.
|
||||||
|
- bounded downstream runs may prepare or reuse references under the workspace
|
||||||
|
lock before readiness checks, even when prepare lies outside the selected range.
|
||||||
|
Existing audio input records remain available without being recertified by
|
||||||
|
reference-only preparation. An imported configured or extraction product can
|
||||||
|
support this workflow without any transcript. Reference-only validation
|
||||||
|
explicitly excludes audio acquisition and source checks.
|
||||||
|
- derives the party glossary and resolves the remaining named collections through
|
||||||
|
`internal/glossary`; writes four individual shared envelopes and a combined
|
||||||
|
envelope with checksums, sizes, and provenance. The combined record declares
|
||||||
|
its four individual input dependencies.
|
||||||
- enforces local audio vs S3 audio mutual exclusivity.
|
- enforces local audio vs S3 audio mutual exclusivity.
|
||||||
- rejects duplicate explicit local audio sources after resolution.
|
- uses `internal/audio` for read-only source discovery shared with inspection;
|
||||||
|
rejects duplicate explicit local audio sources after resolution.
|
||||||
- gives distinct local source paths with the same basename deterministic unique
|
- gives distinct local source paths with the same basename deterministic unique
|
||||||
prepared filenames so neither source is overwritten.
|
prepared filenames so neither source is overwritten; unresolved speaker-ID
|
||||||
- materializes S3 audio through spool/cache-aware logic.
|
collisions fail before audio materialization.
|
||||||
- materializes a configured spell catalog with checksum and provenance, or
|
- downloads S3 audio into a temporary sibling before verifying and installing the prepared copy; its recorded identity comes from the same response as the bytes.
|
||||||
safely removes an obsolete canonical spell catalog and its manifest record
|
- writes effective autocorrection rules as a Seriatim envelope, with checksum,
|
||||||
when the effective input is omitted.
|
size, and source provenance, including an empty list when no rules apply.
|
||||||
- copies the validated canonical party bytes unchanged and deterministically
|
- renders standalone effective campaign, session, and canonical party documents,
|
||||||
generates the prepared players projection.
|
and deterministically generates the prepared players projection.
|
||||||
- scans enabled configured artifact inputs for `narratio.previous_session.artifact.*` requirements.
|
- collects `narratio.previous_session.artifact.*` requirements from the selected
|
||||||
- clears managed `previous/` state on every invocation, then, when requirements exist:
|
targets and their full prerequisite closure, including disabled prerequisites;
|
||||||
|
see [previous requirement collection](artifacts.md#previous-requirement-collection).
|
||||||
|
Bounded reference preparation uses projected work and reused local checkpoint
|
||||||
|
keys, preserving their history while excluding supplied products' history.
|
||||||
|
- clears managed `inputs/previous/` state on every invocation, then, when requirements exist:
|
||||||
- resolves the pointer-selected previous source through the shared resolver;
|
- resolves the pointer-selected previous source through the shared resolver;
|
||||||
- downloads previous manifest/artifacts;
|
- downloads declared previous artifacts;
|
||||||
- records previous inputs in `manifest.inputs`.
|
- records previous inputs in `manifest.inputs`.
|
||||||
|
|
||||||
Required previous-session inputs fail when unavailable; optional missing inputs
|
Required previous-session inputs fail when unavailable; optional missing inputs
|
||||||
@@ -55,45 +78,50 @@ cache path, then validates the committed checksum, size, and generation.
|
|||||||
|
|
||||||
## Invariants
|
## Invariants
|
||||||
|
|
||||||
- only `prepare` hydrates canonical `previous/` cache state.
|
- prepare and restore hydrate canonical `inputs/previous/` state from exact
|
||||||
- managed previous artifacts are stored under `previous/artifacts/**` without
|
declared previous-session products.
|
||||||
|
- managed previous artifacts are stored under `inputs/previous/artifacts/**` without
|
||||||
duplicate `artifacts/artifacts/` nesting.
|
duplicate `artifacts/artifacts/` nesting.
|
||||||
- managed `previous/` state represents only the current requirement set.
|
- managed `inputs/previous/` state represents only the current requirement set.
|
||||||
- `manifest.inputs` ordering is deterministic (`kind`, `path`).
|
- `manifest.inputs` ordering is deterministic (`kind`, `path`).
|
||||||
|
|
||||||
## Resume Evidence
|
## Resume Evidence
|
||||||
|
|
||||||
Prepare records a versioned semantic-configuration fingerprint for the
|
Prepare records a versioned semantic-configuration fingerprint for the
|
||||||
resolved campaign/session selection, local-versus-S3 audio mode and canonical
|
resolved campaign/session selection, local-versus-S3 audio mode and canonical
|
||||||
audio names, stable-input ownership/presence, previous-session identity, and
|
audio names, stable-input presence, previous-session identity, the canonical
|
||||||
the party mode plus canonical players projection version, and the effective
|
players projection version, and the effective
|
||||||
previous-artifact requirement set. A change reruns prepare and
|
previous-artifact requirement set. A change reruns prepare and
|
||||||
stales its fixed descendants. Existing successful records without this
|
stales its fixed descendants. Existing successful records without this
|
||||||
evidence rerun once when selected.
|
evidence rerun once when selected.
|
||||||
|
|
||||||
Workspace, spool, and cache placement and absolute source relocation are not
|
Source ownership and workspace placement are not semantic when logical selection,
|
||||||
semantic when logical selection, canonical names, and bytes are equivalent.
|
canonical names, and effective bytes are equivalent.
|
||||||
The fingerprint deliberately does not read or rehash large audio. Prepared
|
The fingerprint deliberately does not read or rehash large audio. Prepared
|
||||||
input checksums remain the content provenance. Before reusing success, prepare
|
input checksums remain the content provenance. Before reusing success, prepare
|
||||||
validates every durable prepared copy and compares current stable-input bytes,
|
validates every durable prepared copy and compares current stable-input bytes,
|
||||||
canonical party and derived-player bytes, local audio membership/checksums, or
|
effective campaign/session, canonical party, derived-player and resolved glossary
|
||||||
S3 key/size/entity-tag identity with that provenance. Source relocation with
|
bytes, and, when audio was needed, local audio membership/checksums or S3
|
||||||
equivalent names and bytes remains reusable; changed or unavailable evidence
|
key/size/entity-tag identity with that provenance.
|
||||||
causes a normal prepare rerun.
|
Source relocation with equivalent effective documents, names, and bytes remains
|
||||||
|
reusable; changed or unavailable evidence causes a normal prepare rerun.
|
||||||
|
Confirmed mismatches and sources that cannot be verified have distinct reasons;
|
||||||
|
the latter retains the inspection error. Planning supplies the same S3 identity
|
||||||
|
collaborator to this validator without running preparation.
|
||||||
|
|
||||||
## Related Contracts And Tests
|
## Related Contracts And Tests
|
||||||
|
|
||||||
- [Configuration](../config.md) owns audio selection, stable input fields, and
|
- [Configuration](../config.md) owns audio selection, stable input fields, and
|
||||||
previous-session settings.
|
previous-session settings.
|
||||||
- [Operations](../operations.md) owns physical input, audio, spool, cache, and
|
- [Operations](../operations.md) owns physical input, audio, and
|
||||||
previous-state layout.
|
previous-state layout.
|
||||||
- [Storage Internals](storage.md) and [Artifact Internals](artifacts.md) explain
|
- [Storage Internals](storage.md) and [Artifact Internals](artifacts.md) explain
|
||||||
the internal collaborators.
|
the internal collaborators.
|
||||||
- Implementation and tests: `internal/stage/prepare.go`,
|
- Implementation and tests: `internal/stage/prepare.go`,
|
||||||
`internal/stage/prepare_test.go`,
|
`internal/stage/prepare_party.go`, `internal/stage/prepare_test.go`,
|
||||||
`internal/stage/prepare_resume.go`,
|
`internal/stage/prepare_resume.go`,
|
||||||
`internal/stage/prepare_resume_test.go`,
|
`internal/stage/prepare_resume_test.go`,
|
||||||
`internal/stage/semantic_contracts_initial.go`,
|
`internal/stage/semantic_contracts_initial.go`,
|
||||||
`internal/stage/semantic_contracts_initial_test.go`,
|
`internal/stage/semantic_contracts_initial_test.go`,
|
||||||
`internal/audio/s3_audio_test.go`,
|
`internal/audio/discovery_test.go`, `internal/audio/s3_audio_test.go`,
|
||||||
`internal/previouscache/*_test.go`
|
`internal/previouscache/*_test.go`
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Upload run/session outputs to object storage and atomically advance remote curre
|
|||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
- successful preceding stages from the [canonical stage set](overview.md#pipeline-stage-set)
|
- ordinary preceding stage evidence or valid supplied product availability
|
||||||
- declared run-local diagnostic files
|
- declared run-local diagnostic files
|
||||||
- resolved publish output rules
|
- resolved publish output rules
|
||||||
- independent per-source remote lock objects read at planning start
|
- independent per-source remote lock objects read at planning start
|
||||||
@@ -15,8 +15,8 @@ Upload run/session outputs to object storage and atomically advance remote curre
|
|||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
- uploaded session manifest, declared run-local diagnostics, and selected
|
- uploaded prepared campaign/session/party inputs, declared
|
||||||
publish outputs;
|
run-local diagnostics, and selected publish outputs;
|
||||||
- uploaded durable previous-session cache files when present;
|
- uploaded durable previous-session cache files when present;
|
||||||
- immutable run-scoped commit manifest; and
|
- immutable run-scoped commit manifest; and
|
||||||
- current commit pointer, written last.
|
- current commit pointer, written last.
|
||||||
@@ -31,17 +31,21 @@ manifest-derived archive metadata, confined opening, and checksum validation
|
|||||||
live in `publish_sources.go`; artifact-catalog matching, selection, required
|
live in `publish_sources.go`; artifact-catalog matching, selection, required
|
||||||
and optional rules, destination resolution, and collision inputs live in
|
and optional rules, destination resolution, and collision inputs live in
|
||||||
`publish_outputs.go`. Copying, hashing, immutable upload, reuse checks, and
|
`publish_outputs.go`. Copying, hashing, immutable upload, reuse checks, and
|
||||||
remote verification live in `publish_transfer.go`; committed-manifest,
|
remote verification live in `publish_transfer.go`; immutable-commit and
|
||||||
immutable-commit, and current-pointer encoding and writes live in
|
current-pointer encoding and writes live in
|
||||||
`publish_commit.go`. `publish_output_plan.go` owns the deterministic, I/O-free
|
`publish_commit.go`. `publish_output_plan.go` owns the deterministic, I/O-free
|
||||||
five-outcome model and its secret-free metadata projection.
|
five-outcome model and its secret-free metadata projection. Prepared input
|
||||||
|
objects are committed under the immutable run; the committed standalone session
|
||||||
|
supports remote loading when no authored session override is available. The
|
||||||
|
[configuration reference](../config.md#sessionyml) owns input selection.
|
||||||
|
|
||||||
- when publishing or run upload is disabled, completes successfully with no
|
- when publishing or run upload is disabled, completes successfully with no
|
||||||
outputs and records explanatory metadata. This is not an explicit self-skip:
|
outputs and records explanatory metadata. This is not an explicit self-skip:
|
||||||
the session manifest records success. Enablement and upload policy are
|
the session manifest records success. Enablement and upload policy are
|
||||||
fingerprinted, so changing either automatically makes the prior result
|
fingerprinted, so changing either automatically makes the prior result
|
||||||
non-resumable.
|
non-resumable.
|
||||||
- validates prerequisite stage success and object-store availability.
|
- validates ordinary prerequisites or valid supplied availability and requires
|
||||||
|
an object store. Every selected source is independently resolved and checked.
|
||||||
- derives a deterministic run-archive allowlist from the session manifest's
|
- derives a deterministic run-archive allowlist from the session manifest's
|
||||||
declared current-run outputs, logs, and generated configurations. References
|
declared current-run outputs, logs, and generated configurations. References
|
||||||
outside the current run root, including canonical session files and prior-run
|
outside the current run root, including canonical session files and prior-run
|
||||||
@@ -50,16 +54,20 @@ five-outcome model and its secret-free metadata projection.
|
|||||||
- opens each archive candidate beneath its archive root without following
|
- opens each archive candidate beneath its archive root without following
|
||||||
symlinked ancestors or leaf entries, verifies that it is a regular file and
|
symlinked ancestors or leaf entries, verifies that it is a regular file and
|
||||||
checks a declared checksum when present, then streams the opened descriptor.
|
checks a declared checksum when present, then streams the opened descriptor.
|
||||||
- derives the durable previous-cache archive from its validated manifest using
|
- derives the durable previous-cache archive from recorded previous inputs using
|
||||||
the same confinement and regular-file checks.
|
the same confinement and regular-file checks.
|
||||||
- resolves publish output sources through runtime artifact catalog and
|
- resolves publish output sources through runtime artifact catalog and
|
||||||
manifest-aware resolution. Configured Scriptorium outputs are publishable
|
manifest-aware resolution. Configured Scriptorium outputs are publishable
|
||||||
only from validated `current` per-artifact analyze evidence; an incidental
|
from validated `current` per-artifact analyze evidence or a valid supplied
|
||||||
|
product; an incidental
|
||||||
canonical file, aggregate output, stale/failed/unselected record, or
|
canonical file, aggregate output, stale/failed/unselected record, or
|
||||||
mismatched path, size, or checksum remains unavailable. Built-in and
|
mismatched path, size, or checksum remains unavailable. Built-in and
|
||||||
extraction sources likewise require their own current manifest evidence.
|
extraction sources likewise require their own current local or supplied evidence.
|
||||||
|
- includes the four individual prepared glossary documents and the combined
|
||||||
|
glossary with their declared input identities for restore;
|
||||||
- publishes extraction lanes only through explicit configured output rules;
|
- publishes extraction lanes only through explicit configured output rules;
|
||||||
neither run-local nor durable Notarius bundles are scanned or uploaded wholesale.
|
original Notarius bundles are not scanned or uploaded wholesale. Historical
|
||||||
|
run-local references are not required for later publication.
|
||||||
- selected artifact filter applies to configured artifact sources only.
|
- selected artifact filter applies to configured artifact sources only.
|
||||||
- plans every configured output into exactly one source-sorted outcome:
|
- plans every configured output into exactly one source-sorted outcome:
|
||||||
`published`, `carried_locked`, `locked_unpublished`, `optional_missing`, or
|
`published`, `carried_locked`, `locked_unpublished`, `optional_missing`, or
|
||||||
@@ -69,11 +77,13 @@ five-outcome model and its secret-free metadata projection.
|
|||||||
an earlier run in the same session and retains its source, key, checksum,
|
an earlier run in the same session and retains its source, key, checksum,
|
||||||
size, and generation; the bytes are not copied.
|
size, and generation; the bytes are not copied.
|
||||||
- verifies a carried object's exact key, size, and generation through object
|
- verifies a carried object's exact key, size, and generation through object
|
||||||
metadata without downloading or opening the local output source.
|
metadata without downloading or opening the local output source; catalog
|
||||||
|
hydration skips carried output payloads.
|
||||||
- an initially locked source with no prior declaration remains absent even
|
- an initially locked source with no prior declaration remains absent even
|
||||||
when the output rule is required. Optional missing unlocked outputs remain
|
when the output rule is required. Optional missing unlocked outputs remain
|
||||||
absent; required missing unlocked outputs fail.
|
absent; required missing unlocked outputs fail.
|
||||||
- creates one complete immutable source-to-destination mapping before upload;
|
- creates one complete immutable source-to-destination mapping before upload,
|
||||||
|
then opens, verifies, transfers, and closes sources sequentially;
|
||||||
- uploads and verifies every declared immutable object and the commit manifest;
|
- uploads and verifies every declared immutable object and the commit manifest;
|
||||||
- writes the immutable commit from the combined new and exact carried
|
- writes the immutable commit from the combined new and exact carried
|
||||||
declarations.
|
declarations.
|
||||||
@@ -86,6 +96,10 @@ five-outcome model and its secret-free metadata projection.
|
|||||||
|
|
||||||
## Metadata Signals
|
## Metadata Signals
|
||||||
|
|
||||||
|
`internal/artifacts` owns the typed codecs for completion identity and output
|
||||||
|
outcomes. Cleanup applies strict authorization to decoded fields; inspection
|
||||||
|
skips malformed outcome rows independently.
|
||||||
|
|
||||||
Includes counts/lists for:
|
Includes counts/lists for:
|
||||||
- run uploads
|
- run uploads
|
||||||
- published output uploads
|
- published output uploads
|
||||||
@@ -98,12 +112,13 @@ Includes counts/lists for:
|
|||||||
## Invariants
|
## Invariants
|
||||||
|
|
||||||
- `current/commit-pointer.json` is the remote commit marker and is written last.
|
- `current/commit-pointer.json` is the remote commit marker and is written last.
|
||||||
- run files, selected outputs, previous-cache files, and the committed session
|
- run files, selected outputs, and previous-cache files are declared by an
|
||||||
manifest are all declared by an immutable commit under the run prefix.
|
immutable commit under the run prefix. Execution ledgers are not published.
|
||||||
- run and previous uploads contain only manifest-declared regular files opened
|
- run and previous uploads contain only manifest-declared regular files opened
|
||||||
from verified descriptors; symlinks, special files, replacement races, and
|
from verified descriptors. Symlinks, special files, and changed declared
|
||||||
undeclared entries are rejected or ignored before uploads begin.
|
content are rejected; undeclared entries are ignored. A later invalid source
|
||||||
- run-local diagnostics, including Notarius receipt and stderr files, are
|
can leave earlier immutable uploads unselected.
|
||||||
|
- run-local diagnostics, including Notarius completion report and stderr files, are
|
||||||
archived only when recorded by the session manifest. A run with no declared
|
archived only when recorded by the session manifest. A run with no declared
|
||||||
current-run diagnostics legitimately uploads none.
|
current-run diagnostics legitimately uploads none.
|
||||||
- independent publish locks are not overridden by `--force`; every initially
|
- independent publish locks are not overridden by `--force`; every initially
|
||||||
@@ -126,7 +141,7 @@ evidence does not replace those safety checks.
|
|||||||
The commit boundary and cleanup authorization are normative architecture invariants; see
|
The commit boundary and cleanup authorization are normative architecture invariants; see
|
||||||
[Architecture](../policy/architecture.md#publish-commit-boundary).
|
[Architecture](../policy/architecture.md#publish-commit-boundary).
|
||||||
|
|
||||||
Publish never deletes local state. The standalone `publish` command selects
|
Publish never deletes local state. `run SESSION --stage publish` selects
|
||||||
only this stage; a full run selects notify and cleanup afterward.
|
only this stage; a full run selects notify and cleanup afterward.
|
||||||
|
|
||||||
## Related Contracts And Tests
|
## Related Contracts And Tests
|
||||||
|
|||||||
@@ -20,19 +20,20 @@ records that may consume rendered transcripts.
|
|||||||
|
|
||||||
## Key Behavior
|
## Key Behavior
|
||||||
|
|
||||||
- uses `pipeline.render` settings (enabled/format/title/booleans).
|
- uses `pipeline.render` settings (enabled/variants/format/title/booleans).
|
||||||
- resolves inputs only from verified manifest output evidence.
|
- resolves and renders only selected variants; duplicate selections have no effect.
|
||||||
|
- resolves inputs from verified local output evidence or supplied records.
|
||||||
- writes run-local outputs first, then materializes canonical session outputs.
|
- writes run-local outputs first, then materializes canonical session outputs.
|
||||||
- records input provenance, output paths, adapter metadata, logs, and generated config refs.
|
- records input provenance, output paths, adapter metadata, logs, and generated config refs.
|
||||||
- when `pipeline.render.enabled=false`, completes successfully with no outputs
|
- when `pipeline.render.enabled=false`, completes successfully with no outputs
|
||||||
and records explanatory metadata. This is not an explicit self-skip: both
|
and records explanatory metadata. This is not an explicit self-skip: the
|
||||||
manifests record success. Because enablement is fingerprinted, enabling
|
local manifest records success. Because enablement is fingerprinted, enabling
|
||||||
render later automatically makes the prior result non-resumable.
|
render later automatically makes the prior result non-resumable.
|
||||||
|
|
||||||
## Failure Semantics
|
## Failure Semantics
|
||||||
|
|
||||||
- missing normalized input fails with normalize rerun guidance.
|
- a missing selected normalized input fails with normalize rerun guidance.
|
||||||
- missing trimmed input fails with trim rerun guidance.
|
- a missing selected trimmed input fails with trim rerun guidance.
|
||||||
- adapter/subprocess failure fails stage.
|
- adapter/subprocess failure fails stage.
|
||||||
- empty render output files fail validation.
|
- empty render output files fail validation.
|
||||||
|
|
||||||
@@ -45,8 +46,8 @@ records that may consume rendered transcripts.
|
|||||||
|
|
||||||
The versioned semantic fingerprint covers enablement, final format, resolved
|
The versioned semantic fingerprint covers enablement, final format, resolved
|
||||||
title (including the session-title fallback), timestamp, segment-ID and
|
title (including the session-title fallback), timestamp, segment-ID and
|
||||||
metadata inclusion, both canonical input identities, and both Markdown output
|
metadata inclusion, and the selected input and Markdown output identities.
|
||||||
identities. Seriatim's executable, timeout, and report behavior are operational
|
Seriatim's executable, timeout, and report behavior are operational
|
||||||
and do not invalidate rendered transcripts. A render-only change leaves the
|
and do not invalidate rendered transcripts. A render-only change leaves the
|
||||||
independent `extract` sibling reusable while invalidating their shared
|
independent `extract` sibling reusable while invalidating their shared
|
||||||
downstream consumers.
|
downstream consumers.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Generate raw per-speaker transcripts from prepared audio using WhisperX.
|
|||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
- `audio/*.flac` from `prepare`
|
- prepared recordings in `audio/` from `prepare`
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
@@ -15,7 +15,9 @@ Generate raw per-speaker transcripts from prepared audio using WhisperX.
|
|||||||
## Key Behavior
|
## Key Behavior
|
||||||
|
|
||||||
- discovers prepared audio from manifest inputs or the canonical audio
|
- discovers prepared audio from manifest inputs or the canonical audio
|
||||||
directory and derives each speaker identity from its `.flac` filename.
|
directory. Manifest-selected files are authoritative; fallback scans use the
|
||||||
|
shared candidate filter. Speaker IDs remove the final filename extension;
|
||||||
|
duplicate IDs are rejected before dispatch.
|
||||||
- hashes the current audio and reconciles it with the versioned per-speaker
|
- hashes the current audio and reconciles it with the versioned per-speaker
|
||||||
completion collection before starting HTTP work.
|
completion collection before starting HTTP work.
|
||||||
- reuses only records whose audio identity, observable WhisperX semantics,
|
- reuses only records whose audio identity, observable WhisperX semantics,
|
||||||
@@ -83,7 +85,7 @@ reuse it normally.
|
|||||||
|
|
||||||
- [WhisperX](../integrations/whisperx.md) owns HTTP, retry, timeout, and
|
- [WhisperX](../integrations/whisperx.md) owns HTTP, retry, timeout, and
|
||||||
cancellation semantics.
|
cancellation semantics.
|
||||||
- [Configuration](../config.md#pipeline) owns concurrency and other
|
- [Configuration](../config.md) owns source selection, concurrency, and other
|
||||||
operator-selected values.
|
operator-selected values.
|
||||||
- Implementation and tests: `internal/stage/transcribe.go`,
|
- Implementation and tests: `internal/stage/transcribe.go`,
|
||||||
`internal/stage/transcribe_reconciliation.go`,
|
`internal/stage/transcribe_reconciliation.go`,
|
||||||
|
|||||||
@@ -16,7 +16,12 @@ applies a bounds-driven trim.
|
|||||||
|
|
||||||
## Key Behavior
|
## Key Behavior
|
||||||
|
|
||||||
|
Bounds generation, selector validation, transcript production, and final
|
||||||
|
acceptance are separate operations. Both enabled and disabled paths validate
|
||||||
|
the resulting transcript before materializing its canonical output.
|
||||||
|
|
||||||
When `trim.enabled=true`:
|
When `trim.enabled=true`:
|
||||||
|
- shares the effective prompt context with early requirements inspection;
|
||||||
- runs Scriptorium bounds artifact generation;
|
- runs Scriptorium bounds artifact generation;
|
||||||
- optionally runs render-debug output generation;
|
- optionally runs render-debug output generation;
|
||||||
- validates bounds payload against transcript;
|
- validates bounds payload against transcript;
|
||||||
@@ -32,6 +37,12 @@ When `trim.enabled=false`:
|
|||||||
- normalized transcript is required input.
|
- normalized transcript is required input.
|
||||||
- bounds output exists only in enabled trim path.
|
- bounds output exists only in enabled trim path.
|
||||||
- render-debug output is diagnostic and not a declared stage output.
|
- render-debug output is diagnostic and not a declared stage output.
|
||||||
|
- prepared preview and generated bounds use separate result destinations;
|
||||||
|
Scriptorium stderr and invocation records are the diagnostic references.
|
||||||
|
|
||||||
|
The application checks projected bounds requirements before attempting any
|
||||||
|
stage. See [preflight internals](preflight.md); actual transcript resolution and
|
||||||
|
bounds validation remain responsibilities of this stage.
|
||||||
|
|
||||||
## Resume Semantics
|
## Resume Semantics
|
||||||
|
|
||||||
@@ -53,5 +64,5 @@ Scriptorium or Seriatim privately resolves behind a stable identifier. Force
|
|||||||
- [Seriatim](../integrations/seriatim.md) owns transcript trimming behavior.
|
- [Seriatim](../integrations/seriatim.md) owns transcript trimming behavior.
|
||||||
- [Configuration](../config.md#pipeline) owns trim fields and defaults.
|
- [Configuration](../config.md#pipeline) owns trim fields and defaults.
|
||||||
- Implementation and tests: `internal/stage/trim.go`,
|
- Implementation and tests: `internal/stage/trim.go`,
|
||||||
`internal/stage/trim_test.go`,
|
`internal/stage/trim_operations.go`, `internal/stage/trim_test.go`,
|
||||||
`internal/stage/semantic_contracts_refinement.go`
|
`internal/stage/semantic_contracts_refinement.go`
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ operator-selected storage fields and credential mechanisms belong in
|
|||||||
|
|
||||||
- `List(ctx, prefix)`
|
- `List(ctx, prefix)`
|
||||||
- `Read(ctx, key)` returns an object body and the generation observed with it
|
- `Read(ctx, key)` returns an object body and the generation observed with it
|
||||||
- `Download(ctx, key, localPath)`
|
|
||||||
- `Upload(ctx, localPath, key, opts)`
|
- `Upload(ctx, localPath, key, opts)`
|
||||||
- `UploadConditional(ctx, source, key, opts, condition)`
|
- `UploadConditional(ctx, source, key, opts, condition)`
|
||||||
- `Delete(ctx, key)` removes one object and succeeds when it is already absent
|
- `Delete(ctx, key)` removes one object and succeeds when it is already absent
|
||||||
@@ -30,12 +29,18 @@ limit-plus-one read. It closes the body on every exit. Callers own the policy
|
|||||||
limit and add the control-object category to errors; this helper is not used for
|
limit and add the control-object category to errors; this helper is not used for
|
||||||
large artifact payloads.
|
large artifact payloads.
|
||||||
|
|
||||||
|
`StreamObject` transfers payloads to caller-owned writers using the metadata
|
||||||
|
from the same response. It checks a caller-declared size or the observed size
|
||||||
|
when available, reads at most one byte beyond that size, and closes the body.
|
||||||
|
Unknown-size responses stream to EOF; known zero is distinct from unknown.
|
||||||
|
|
||||||
## Composition
|
## Composition
|
||||||
|
|
||||||
`NewObjectStoreFromConfig` constructs the S3-backed implementation from
|
`NewObjectStoreFromConfig` constructs the S3-backed implementation from
|
||||||
resolved configuration. The application loads configured filesystem secrets
|
resolved configuration. Invocation acquisition calls [ConfigKit configured startup](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap)
|
||||||
before calling it. The storage adapter consumes already-resolved values; it does
|
before typed loading; the storage adapter consumes the resolved values. It does
|
||||||
not own discovery, defaults, or configuration validation.
|
not own discovery, defaults, or configuration validation. See
|
||||||
|
[Operations](../operations.md#workspace-permissions) for credential permissions.
|
||||||
|
|
||||||
## S3 Backend Behavior
|
## S3 Backend Behavior
|
||||||
|
|
||||||
@@ -43,7 +48,6 @@ not own discovery, defaults, or configuration validation.
|
|||||||
- `List` paginates and returns normalized `ObjectInfo`.
|
- `List` paginates and returns normalized `ObjectInfo`.
|
||||||
- A truncated S3 listing must supply a new, non-empty continuation token;
|
- A truncated S3 listing must supply a new, non-empty continuation token;
|
||||||
otherwise listing fails with bucket and prefix context instead of looping.
|
otherwise listing fails with bucket and prefix context instead of looping.
|
||||||
- `Download` writes local files with parent directory creation.
|
|
||||||
- `Upload` streams local file and returns remote metadata.
|
- `Upload` streams local file and returns remote metadata.
|
||||||
- `Read` binds a returned body to its S3 ETag. `UploadConditional` maps an ETag
|
- `Read` binds a returned body to its S3 ETag. `UploadConditional` maps an ETag
|
||||||
match or absence precondition directly to the provider request and reports a
|
match or absence precondition directly to the provider request and reports a
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ retention workflow belong in [Operations](../operations.md#local-state-layout).
|
|||||||
|
|
||||||
## Path Ownership
|
## Path Ownership
|
||||||
|
|
||||||
`internal/artifacts` owns canonical session, run, spool, cache, and
|
`internal/artifacts` owns canonical session, run, and
|
||||||
previous-cache path construction. `SessionPathsFor` provides the session-scoped
|
previous-cache path construction. `SessionPathsFor` provides the session-scoped
|
||||||
path model, and layout creation goes through `EnsureLayoutFor`. Callers should
|
path model, and layout creation goes through `EnsureLayoutFor`. Callers should
|
||||||
consume those helpers instead of rebuilding relative paths.
|
consume those helpers instead of rebuilding relative paths.
|
||||||
@@ -32,29 +32,37 @@ materialized into canonical session paths before stage success. Managed
|
|||||||
previous-session cache paths remain session-durable and are never redirected
|
previous-session cache paths remain session-durable and are never redirected
|
||||||
into run-local output space.
|
into run-local output space.
|
||||||
|
|
||||||
Extraction uses run-local receipt, stderr, and output-root helpers, then
|
Polish and extraction write to actual run-local output, log, and debug paths.
|
||||||
validates and renames the external bundle to the unique immutable Notarius
|
The artifact path owner advances managed relative `logs/<stage>` and `debug/<stage>` links;
|
||||||
bundle path supplied by `internal/artifacts`. Exact physical paths belong in
|
skips do not rotate them. Restore has its own diagnostic attempt. Extraction
|
||||||
[Operations](../operations.md#extraction-workflow).
|
promotes validated lanes to flat artifacts; the original bundle remains in
|
||||||
|
the producing run until cleanup. See [Operations](../operations.md#local-state-layout).
|
||||||
|
|
||||||
Prepared references delivered to Notarius use session-durable paths owned by
|
Prepared references delivered to Notarius use session-durable paths owned by
|
||||||
`internal/artifacts` beneath
|
`internal/artifacts` beneath
|
||||||
`cache/notarius/references/<sha256>/<prepared-basename>`. These verified
|
`inputs/references/<sha256>/<prepared-basename>`. These verified
|
||||||
content-addressed snapshots are outside run-local layout, survive ordinary
|
content-addressed snapshots are outside run-local layout, survive ordinary
|
||||||
published-run cleanup, and are excluded from publish and restore enumeration.
|
session run-history cleanup, and are excluded from publish and restore enumeration.
|
||||||
|
|
||||||
## Locking
|
## Locking
|
||||||
|
|
||||||
`artifacts.LocalStore` enforces the single-writer session lock via an
|
`artifacts.LocalStore` enforces single-writer workspace access via an
|
||||||
operating-system lock held on `.lock` (`ErrLockConflict` on contention). The
|
operating-system lock held on `<workspace.root>/.lock` (`ErrLockConflict` on contention). The
|
||||||
file retains owner metadata after release or process death; its existence is
|
file retains owner metadata after release or process death; its existence is
|
||||||
not evidence that a lock is active. Command and restore flows wait for this
|
not evidence that a lock is active. Runs, preflight, mutating restore, and
|
||||||
lock only while their context remains active, and report a release failure.
|
manual cleanup acquire it before creating or changing managed session state.
|
||||||
|
Initialization targeting managed work also acquires it. They wait only while
|
||||||
|
their context remains active and report a release failure. Read-only inspection
|
||||||
|
and dry runs do not acquire it; separate workspaces remain independent.
|
||||||
|
Standalone preflight holds the same lock through preparation, readiness probes,
|
||||||
|
and finalization, keeping active probe files outside concurrent cleanup.
|
||||||
|
Preparation uses ordinary manifest transitions and invalidation.
|
||||||
|
|
||||||
The runner assigns every invocation a run-workspace identity but creates the
|
The runner assigns every invocation a run-workspace identity but creates the
|
||||||
physical directory only before an executing stage that requires it. Fully
|
physical stage run directory only when an executing stage requires it. Fully
|
||||||
reused invocations and cleanup-only invocations therefore do not accumulate
|
reused pipeline invocations and cleanup-only invocations do not accumulate
|
||||||
empty run directories.
|
empty run directories. Readiness probes create their separate invocation-scoped
|
||||||
|
diagnostic directories when checks run, including during a reused preparation.
|
||||||
|
|
||||||
## Cleanup Semantics
|
## Cleanup Semantics
|
||||||
|
|
||||||
@@ -65,6 +73,7 @@ The canonical cleanup stage:
|
|||||||
ID, remote commit key, and current commit-pointer key;
|
ID, remote commit key, and current commit-pointer key;
|
||||||
- consumes the resolved cleanup policy described in
|
- consumes the resolved cleanup policy described in
|
||||||
[Configuration](../config.md);
|
[Configuration](../config.md);
|
||||||
|
- removes the entire session run history and recognized managed diagnostic views;
|
||||||
- refuses unsafe deletes (root delete, traversal, and out-of-root targets);
|
- refuses unsafe deletes (root delete, traversal, and out-of-root targets);
|
||||||
- treats missing targets as successful, idempotent deletion; and
|
- treats missing targets as successful, idempotent deletion; and
|
||||||
- uses its ordinary failed/succeeded manifest stage record for retry. A later
|
- uses its ordinary failed/succeeded manifest stage record for retry. A later
|
||||||
@@ -72,7 +81,7 @@ The canonical cleanup stage:
|
|||||||
republishing.
|
republishing.
|
||||||
|
|
||||||
Manual cleanup uses the same root-confined deletion mechanism. Invocation
|
Manual cleanup uses the same root-confined deletion mechanism. Invocation
|
||||||
syntax and exact deletion scope belong in [CLI](../cli.md#clean) and
|
syntax and exact deletion scope belong in [CLI](../cli.md#session-clean) and
|
||||||
[Operations](../operations.md#cleanup).
|
[Operations](../operations.md#cleanup).
|
||||||
|
|
||||||
## Invariants
|
## Invariants
|
||||||
@@ -88,9 +97,9 @@ syntax and exact deletion scope belong in [CLI](../cli.md#clean) and
|
|||||||
## Implementation And Tests
|
## Implementation And Tests
|
||||||
|
|
||||||
- Path model and local store: `internal/artifacts/paths.go`,
|
- Path model and local store: `internal/artifacts/paths.go`,
|
||||||
`internal/artifacts/local.go`
|
`internal/artifacts/local.go`, `internal/artifacts/attempt_views.go`
|
||||||
- Run-local materialization: `internal/stage/run_local.go`
|
- Run-local materialization: `internal/stage/run_local.go`
|
||||||
- Immutable bundle installation: `internal/stage/extract.go`
|
- Bundle validation and product promotion: `internal/stage/extract.go`
|
||||||
- Workspace modes: `internal/fileops/modes.go`
|
- Workspace modes: `internal/fileops/modes.go`
|
||||||
- Cleanup confinement: `internal/fileops/cleanup.go`,
|
- Cleanup confinement: `internal/fileops/cleanup.go`,
|
||||||
`internal/stage/cleanup.go`, `internal/stage/cleanup_plan.go`, and
|
`internal/stage/cleanup.go`, `internal/stage/cleanup_plan.go`, and
|
||||||
|
|||||||
@@ -6,17 +6,13 @@ For command syntax, see [docs/cli.md](./cli.md). For field-level config, see [do
|
|||||||
|
|
||||||
## Campaign and Session Selection
|
## Campaign and Session Selection
|
||||||
|
|
||||||
Campaign selection priority:
|
Identity and exact-file selection are complementary: a selected file supplies
|
||||||
|
configuration and an explicit ID asserts its effective identity. Session domain
|
||||||
- `--campaign-file`
|
commands take positional identity; `--session-file` selects its source. An
|
||||||
- `--campaign`
|
explicit `--party-file` supplies the roster consistently across consumers.
|
||||||
- `pipeline.campaigns.default_campaign_id`
|
See [CLI selectors](cli.md#configuration-selectors) and
|
||||||
|
[configuration discovery](config.md#discovery-and-selection) for selection rules.
|
||||||
Session source priority:
|
Existing scripts should follow the [CLI migration table](cli.md#migration-from-the-previous-cli).
|
||||||
|
|
||||||
- `--session`
|
|
||||||
- local default search paths
|
|
||||||
- remote session object (S3) when local session file is not found and storage is configured
|
|
||||||
|
|
||||||
## Session Initialization
|
## Session Initialization
|
||||||
|
|
||||||
@@ -34,22 +30,52 @@ Remote session object:
|
|||||||
narratio session init 2026-04-04 --remote --force
|
narratio session init 2026-04-04 --remote --force
|
||||||
```
|
```
|
||||||
|
|
||||||
If `campaign.yml` sets `session_template_file`, `session init` renders it. Template variables must resolve to concrete values.
|
Installation config supplies services, credentials, and an optional reference
|
||||||
|
catalog. Onboard a campaign with [campaign.yml](../examples/campaigns/lantern-coast/campaign.yml),
|
||||||
|
[party.yml](../examples/campaigns/lantern-coast/party.yml), and
|
||||||
|
[speakers.yml](../examples/campaigns/lantern-coast/speakers.yml). The campaign
|
||||||
|
selects its roster, speakers, optional catalog sources, inline vocabulary and
|
||||||
|
replacement rules. The roster describes characters and players; speaker mapping
|
||||||
|
separately describes recordings. The example uses synthetic catalog data.
|
||||||
|
|
||||||
Campaigns must provide stable input files for speakers, autocorrect, glossary,
|
`session init` uses a campaign template if configured, otherwise the installation
|
||||||
players, and party, and may provide an optional spell-catalog overlay. Session
|
template or built-in default. Supply session audio and metadata, for example:
|
||||||
files may override those paths for one session. The `prepare` stage
|
|
||||||
materializes them under `inputs/`; configured consumers use the prepared files,
|
```bash
|
||||||
never the original campaign or session source paths. Field definitions and
|
narratio session init 2026-04-04 --output ./session.yml --audio-dir ./audio
|
||||||
source IDs are in [Configuration](./config.md#notarius-reference-bindings).
|
```
|
||||||
|
|
||||||
|
Preparation resolves the roster, rules, and vocabularies into standalone inputs.
|
||||||
|
See [Configuration](config.md#campaign) for fields, inheritance and clearing.
|
||||||
|
|
||||||
|
## Migrating to the shared pipeline
|
||||||
|
|
||||||
|
Before upgrading an existing deployment, retain its authored sources and any
|
||||||
|
committed snapshots. Convert campaign identity and inputs to the shared campaign
|
||||||
|
fields and Narratio extension in [Configuration](config.md#campaign); replace
|
||||||
|
file-based autocorrection with inline rules and the private spell source with a
|
||||||
|
shared glossary. Reauthor wrapperless vocabularies as shared envelopes. Remove
|
||||||
|
retired spool/audio-cache settings, Notarius descriptor fields, `resume`, and
|
||||||
|
`chunk_cache`; select native `cache` and optional debug controls as needed.
|
||||||
|
Keep external tool configuration under each tool's ownership: Audita uses its
|
||||||
|
version 3 configuration and Notarius its version 6 configuration. Consult the
|
||||||
|
[Audita](integrations/audita.md) and [Notarius](integrations/notarius.md)
|
||||||
|
contracts for their upstream guides.
|
||||||
|
|
||||||
|
Move unsupported local state aside before regenerating or importing published
|
||||||
|
products into a new local baseline. Do not edit state markers manually.
|
||||||
|
Products now use flat session paths and diagnostics use
|
||||||
|
latest-attempt views; explicit remote destinations remain independent. Review
|
||||||
|
cleanup and separately configured subprocess caches before removing old state.
|
||||||
|
This guidance does not create a release or publish any changes.
|
||||||
|
|
||||||
## Standard Session Workflow
|
## Standard Session Workflow
|
||||||
|
|
||||||
1. Select pipeline/campaign/session config.
|
1. Select pipeline/campaign/session config.
|
||||||
2. Validate session readiness:
|
2. Prepare inputs and check session readiness:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio session validate 2026-04-04
|
narratio preflight 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
3. (Optional) inspect stage decisions:
|
3. (Optional) inspect stage decisions:
|
||||||
@@ -70,21 +96,56 @@ narratio run 2026-04-04
|
|||||||
narratio session status 2026-04-04
|
narratio session status 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
Run, plan, and status output identify the resolved pipeline overlay (or `none`)
|
Status distinguishes currently resolved configuration provenance from the last
|
||||||
and effective configuration digest. Status distinguishes the current resolved
|
persisted configuration, helping diagnose overlay switches without changing
|
||||||
value from the last value persisted in the session manifest, which helps
|
semantic resume authority. Run and plan reports describe execution and decisions;
|
||||||
diagnose overlay switches without changing resume authority.
|
see the [report fields](cli.md#public-domain-report-fields).
|
||||||
|
|
||||||
Before switching an operational overlay, compare its effective meaning with the
|
Before switching an operational overlay, compare its effective configuration
|
||||||
production base through `narratio config diff default <overlay>`.
|
with the base through `narratio config diff --against-overlay NAME`. When using an
|
||||||
The command is read-only and succeeds whether it finds differences or not. Its
|
explicit root, supply it with both `--config` and `--against-config`. Each side
|
||||||
sorted records describe defaulted, expanded concrete configuration—not source
|
loads independently using its own defaults. Native inspection retains authored
|
||||||
file layout—so it can be used to review model, artifact, and publish changes
|
family declarations; use `narratio artifacts list` to review concrete identities,
|
||||||
without creating a session or run. Use `narratio config artifacts` to review the
|
outputs, dependencies, and selected-party members. See
|
||||||
concrete artifact identities, definitions, outputs, and dependencies. Select the
|
[configuration inspection](cli.md#configuration-inspection) for selection and
|
||||||
same campaign explicitly when overlays could resolve different campaign paths;
|
comparison details.
|
||||||
see the [CLI reference](cli.md#config-validate-config-show-config-sources-config-artifacts-and-config-diff)
|
|
||||||
for syntax and record format.
|
### Prompt requirements preflight
|
||||||
|
|
||||||
|
After selected preparation completes or is reused, Narratio checks downstream
|
||||||
|
work projected to run before processing continues. Audita preflight uses the
|
||||||
|
prepared glossary files, a synthetic transcript, and the selected Audita
|
||||||
|
configuration; its native provider smoke checks are enabled. Notarius inspection
|
||||||
|
and preflight use its configured pipeline and the verified transcript when available,
|
||||||
|
or a synthetic transcript otherwise. Both may contact providers. Scriptorium
|
||||||
|
requirements discovery checks projected trim and analysis bindings. A missing
|
||||||
|
required binding or failed check stops the invocation; incomplete or conditional
|
||||||
|
prompt discovery can produce warnings. Already completed work remains recorded.
|
||||||
|
`session plan` does not invoke these downstream checks.
|
||||||
|
|
||||||
|
Standalone `preflight` prepares or reuses the session's real inputs before
|
||||||
|
checking every enabled downstream capability and prompt prerequisite, including
|
||||||
|
work whose outputs could be reused. It may create workspace state, download
|
||||||
|
inputs, update the manifest, and contact providers. Changed inputs can stale
|
||||||
|
dependent stage records through ordinary preparation rules. Preparation remains
|
||||||
|
available for reuse if a later readiness check fails. Preflight stops before
|
||||||
|
processing, publishing, notification, or cleanup.
|
||||||
|
|
||||||
|
For S3 audio, preflight checks source identity through ordinary preparation
|
||||||
|
reuse and can download current inputs when preparation runs. An access failure
|
||||||
|
can prevent readiness. In contrast, [session planning](cli.md#session-plan)
|
||||||
|
only inspects the source evidence and projects the resulting work.
|
||||||
|
|
||||||
|
Audita checks a synthetic transcript. Notarius uses a verified trimmed
|
||||||
|
transcript only when the normal work projection indicates its producers will
|
||||||
|
not rerun; otherwise it uses a synthetic input. These checks do not establish
|
||||||
|
real-transcript feasibility, editorial quality, or future provider availability.
|
||||||
|
See [Audita](integrations/audita.md) and [Scriptorium](integrations/scriptorium.md).
|
||||||
|
|
||||||
|
The workspace lock covers preparation, probes, and finalization. Probe diagnostics
|
||||||
|
under `runs/` are disposable and can be removed by a later authorized cleanup;
|
||||||
|
prepared inputs remain durable. Preflight itself does not run cleanup or rotate
|
||||||
|
processing-stage diagnostic views. See [cleanup](#cleanup).
|
||||||
|
|
||||||
## Stage Execution and Continuation Behavior
|
## Stage Execution and Continuation Behavior
|
||||||
|
|
||||||
@@ -125,13 +186,13 @@ its fixed descendants without requiring `--force`. Changing prepare selection
|
|||||||
semantics likewise reruns all fixed descendants; changing
|
semantics likewise reruns all fixed descendants; changing
|
||||||
WhisperX language/service identity reuses prepare; changing a Seriatim merge
|
WhisperX language/service identity reuses prepare; changing a Seriatim merge
|
||||||
transformation reuses prepare and transcribe; and changing a selected Audita
|
transformation reuses prepare and transcribe; and changing a selected Audita
|
||||||
overlay, profile, or module sequence reuses prepare, transcribe, and merge while
|
overlay or profile reuses prepare, transcribe, and merge while rebuilding
|
||||||
rebuilding transcript refinement. A trim change invalidates both render and
|
transcript refinement. A trim change invalidates both render and
|
||||||
extract through the fixed dependency relation, while a render-only change
|
extract through the fixed dependency relation, while a render-only change
|
||||||
preserves the extract sibling.
|
preserves the extract sibling.
|
||||||
|
|
||||||
Operational timeouts, retry/concurrency tuning, executable paths,
|
Operational timeouts, retry/concurrency tuning, executable paths,
|
||||||
workspace/cache/spool placement, reports, diagnostics, and secret values are
|
workspace placement, reports, diagnostics, and secret values are
|
||||||
excluded. Configuration, models, prompts, modules, or resources loaded
|
excluded. Configuration, models, prompts, modules, or resources loaded
|
||||||
privately inside external tools remain unobservable to Narratio. If their
|
privately inside external tools remain unobservable to Narratio. If their
|
||||||
contents change behind the same configured identifier, explicitly force the
|
contents change behind the same configured identifier, explicitly force the
|
||||||
@@ -141,14 +202,17 @@ An explicit self-skip is a durable `skipped` stage outcome that later runs
|
|||||||
reconsider. It differs from successful no-output execution: disabled `render`
|
reconsider. It differs from successful no-output execution: disabled `render`
|
||||||
and `publish`, and absent or no-executable `analyze`, record `succeeded` with
|
and `publish`, and absent or no-executable `analyze`, record `succeeded` with
|
||||||
metadata and no outputs. Ordinary later runs reuse those successful results;
|
metadata and no outputs. Ordinary later runs reuse those successful results;
|
||||||
force the affected stage after enabling or configuring it. Optional artifact
|
when the observable enablement or configuration changes, selected work is
|
||||||
|
reassessed and reruns as needed. Use force to replace a current result or for
|
||||||
|
private upstream changes Narratio cannot observe. Supplied products are assessed
|
||||||
|
independently of historical producer configuration. Optional artifact
|
||||||
inputs are omitted only from the consuming artifact invocation and do not make
|
inputs are omitted only from the consuming artifact invocation and do not make
|
||||||
the stage self-skip.
|
the stage self-skip.
|
||||||
|
|
||||||
Single-stage execution:
|
Single-stage execution:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage normalize 2026-04-04 --force
|
narratio run 2026-04-04 --stage normalize --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Contiguous bounded execution uses inclusive canonical endpoints:
|
Contiguous bounded execution uses inclusive canonical endpoints:
|
||||||
@@ -170,9 +234,11 @@ prerequisite rebuilds, scheduled execution, and current reuse. This lets a
|
|||||||
coarsely stale aggregate analyze stage show zero artifact executions when its
|
coarsely stale aggregate analyze stage show zero artifact executions when its
|
||||||
selected artifact evidence is still semantically current.
|
selected artifact evidence is still semantically current.
|
||||||
|
|
||||||
Before a bounded run or plan whose range starts after `prepare`, every excluded
|
Before a bounded run or plan whose range starts after `prepare`, excluded
|
||||||
prefix stage must already have a session-manifest status of `succeeded` or
|
prefix work needs local success/skip evidence or applicable supplied-product
|
||||||
`skipped`. Narratio reports the first absent, pending, running, failed, stale,
|
coverage. With a supplied transcript, prepare and independent render/extract
|
||||||
|
work do not automatically block downstream selections; required consumer inputs
|
||||||
|
must still exist. Narratio reports the first unsatisfied absent, pending, running, failed, stale,
|
||||||
or interrupted prerequisite without creating a run-local directory or changing
|
or interrupted prerequisite without creating a run-local directory or changing
|
||||||
session state. Widen `--from` to include that stage, or recover it explicitly
|
session state. Widen `--from` to include that stage, or recover it explicitly
|
||||||
before retrying. Excluded prefix stages are not resume-validated or repaired as
|
before retrying. Excluded prefix stages are not resume-validated or repaired as
|
||||||
@@ -199,13 +265,15 @@ canonical `transcripts/raw/<speaker>.json` files remain durable, however.
|
|||||||
After correcting the underlying problem, retry normally:
|
After correcting the underlying problem, retry normally:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage transcribe 2026-04-04
|
narratio run 2026-04-04 --stage transcribe
|
||||||
```
|
```
|
||||||
|
|
||||||
Narratio hashes the current prepared audio, validates recorded transcript JSON,
|
Narratio hashes the current prepared audio, validates recorded transcript JSON,
|
||||||
checksum, size, and location, and calls WhisperX only for missing or obsolete
|
checksum, size, and location, and calls WhisperX only for missing or obsolete
|
||||||
speakers. A changed audio file replaces only its speaker; a changed WhisperX
|
speakers. Preparation and inspection share read-only [audio selection](config.md#session);
|
||||||
URL or language makes every current speaker non-reusable. Retry, timeout, and
|
prepared recordings retain their bytes and filename suffixes. A changed audio
|
||||||
|
file replaces only its speaker; a changed WhisperX URL or language makes every
|
||||||
|
current speaker non-reusable. Retry, timeout, and
|
||||||
concurrency tuning do not invalidate completed speakers.
|
concurrency tuning do not invalidate completed speakers.
|
||||||
|
|
||||||
Use force only when every current transcript must be replaced, including after
|
Use force only when every current transcript must be replaced, including after
|
||||||
@@ -213,7 +281,7 @@ a WhisperX model or private server-side configuration changes behind the same
|
|||||||
URL and language:
|
URL and language:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage transcribe 2026-04-04 --force
|
narratio run 2026-04-04 --stage transcribe --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Force durably clears the reusable collection before sending requests. If that
|
Force durably clears the reusable collection before sending requests. If that
|
||||||
@@ -230,8 +298,8 @@ identifier is unchanged, but older strict-decoding Narratio binaries may reject
|
|||||||
a manifest after current Narratio writes the additive speaker fields; retain a
|
a manifest after current Narratio writes the additive speaker fields; retain a
|
||||||
backup or complete the upgrade before relying on downgrade.
|
backup or complete the upgrade before relying on downgrade.
|
||||||
|
|
||||||
Restoring a manifest does not implicitly publish or restore every raw speaker
|
Importing published products does not restore every raw speaker file. If a
|
||||||
file. If a recorded canonical transcript is absent locally, ordinary
|
recorded canonical speaker transcript is absent locally, ordinary
|
||||||
reconciliation schedules that speaker again. Removing run directories does not
|
reconciliation schedules that speaker again. Removing run directories does not
|
||||||
remove canonical checkpointed transcripts and does not by itself invalidate
|
remove canonical checkpointed transcripts and does not by itself invalidate
|
||||||
them.
|
them.
|
||||||
@@ -242,21 +310,21 @@ Choose the narrowest workflow that matches the intended replacement:
|
|||||||
|
|
||||||
| Intent | Command | Preserved and rebuilt state |
|
| Intent | Command | Preserved and rebuilt state |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| Rebuild analysis only | [`narratio analyze 2026-04-04`](./cli.md#analyze) | Preserves transcripts and the current extraction bundle; force-runs selected analysis artifacts and their required analysis prerequisites. |
|
| Rebuild analysis only | [`narratio run 2026-04-04 --stage analyze --force`](./cli.md#run) | Preserves transcripts and current extraction products; force-runs selected analysis artifacts and their required analysis prerequisites. |
|
||||||
| Rebuild extraction and analysis | [`narratio regenerate-artifacts 2026-04-04`](./cli.md#regenerate-artifacts) | Preserves transcripts; force-runs the complete configured extraction bundle, then selected analysis. `--artifacts` narrows analysis only. |
|
| Rebuild extraction and analysis | [`narratio artifacts regenerate 2026-04-04`](./cli.md#artifacts-regenerate) | Preserves transcripts; force-runs the complete configured extraction bundle, then selected analysis. `--artifacts` narrows analysis only. |
|
||||||
| Continue bounded work normally | [`narratio run 2026-04-04 --from extract --through analyze`](./cli.md#run) | Uses ordinary resume decisions: current extraction and analysis can be skipped, while incomplete or obsolete work runs. |
|
| Continue bounded work normally | [`narratio run 2026-04-04 --from extract --through analyze`](./cli.md#run) | Uses ordinary resume decisions: current extraction and analysis can be skipped, while incomplete or obsolete work runs. |
|
||||||
|
|
||||||
All three stop before publication. Inspect the results and run
|
All three stop before publication. Inspect the results and run
|
||||||
[`narratio publish`](./cli.md#publish) separately when delivery is intended.
|
[`narratio run SESSION --stage publish --force`](./cli.md#run) separately when delivery is intended.
|
||||||
|
|
||||||
For the extraction-plus-analysis development loop, use:
|
For the extraction-plus-analysis development loop, use:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio regenerate-artifacts 2026-04-04
|
narratio artifacts regenerate 2026-04-04
|
||||||
narratio regenerate-artifacts 2026-04-04 --artifacts session_recap,player_handout
|
narratio artifacts regenerate 2026-04-04 --artifacts session_recap,player_handout
|
||||||
```
|
```
|
||||||
|
|
||||||
This command is a transparent expansion to a forced bounded `run` from
|
This command shares the forced bounded execution operation from
|
||||||
`extract` through `analyze`. Extraction always rebuilds its complete configured
|
`extract` through `analyze`. Extraction always rebuilds its complete configured
|
||||||
bundle. Analysis rebuilds the selected targets and their required analysis
|
bundle. Analysis rebuilds the selected targets and their required analysis
|
||||||
prerequisites, or uses the normal default selection when no artifact names are
|
prerequisites, or uses the normal default selection when no artifact names are
|
||||||
@@ -268,7 +336,7 @@ set is ready:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio session artifacts 2026-04-04
|
narratio session artifacts 2026-04-04
|
||||||
narratio publish 2026-04-04
|
narratio run 2026-04-04 --stage publish --force
|
||||||
```
|
```
|
||||||
|
|
||||||
If planning or execution reports stale, missing, failed, or tampered
|
If planning or execution reports stale, missing, failed, or tampered
|
||||||
@@ -304,26 +372,12 @@ Select the Narratio file with `--overlay testing` on the desired command. Each
|
|||||||
downstream selector is used only when its stage actually executes: `polish` for
|
downstream selector is used only when its stage actually executes: `polish` for
|
||||||
Audita and `extract` for Notarius. Production can omit both selectors.
|
Audita and `extract` for Notarius. Production can omit both selectors.
|
||||||
|
|
||||||
For Audita debug inspection, its testing overlay can include:
|
Set `audita.debug: true` in Narratio to request Audita debug capture. Omission
|
||||||
|
or false adds no debug override. Narratio supplies the run-local `polish/debug` work destination and
|
||||||
```yaml
|
the separate `polish/logs` report destination. Set `notarius.debug: true` to request Notarius capture; its debug directory alone
|
||||||
diagnostics:
|
does not enable capture.
|
||||||
debug: true
|
See the upstream [Audita configuration](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
||||||
work_dir: /path/to/audita-debug
|
and [Notarius CLI](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/cli.md).
|
||||||
```
|
|
||||||
|
|
||||||
Audita retains detailed artifacts under that directory. Inspect them there;
|
|
||||||
Narratio does not collect or manage them. Ordinary Audita reports remain a
|
|
||||||
separate existing integration. Leave debug disabled in Audita's production
|
|
||||||
configuration unless deliberately needed.
|
|
||||||
|
|
||||||
Notarius's debug controls are different: `debug.directory` selects a location
|
|
||||||
but does not enable capture. Capture requires its `--debug` flag, which Narratio
|
|
||||||
does not currently forward. Selecting a Notarius testing overlay therefore does
|
|
||||||
not by itself enable a debug bundle. See the upstream
|
|
||||||
[Audita configuration](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.1/docs/config.md)
|
|
||||||
and [Notarius CLI](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/cli.md)
|
|
||||||
for their respective controls.
|
|
||||||
|
|
||||||
Edits inside downstream configuration behind an unchanged selector are not
|
Edits inside downstream configuration behind an unchanged selector are not
|
||||||
automatically detected by Narratio. To inspect a fresh Audita debug run, explicitly
|
automatically detected by Narratio. To inspect a fresh Audita debug run, explicitly
|
||||||
@@ -337,12 +391,8 @@ This replaces polish output and invalidates dependent results; it is not a
|
|||||||
diagnostics-only operation. Selecting testing does not create an isolated
|
diagnostics-only operation. Selecting testing does not create an isolated
|
||||||
workspace or retain a separate current result.
|
workspace or retain a separate current result.
|
||||||
|
|
||||||
Notarius v0.8+ defaults to two additional eligible transient provider attempts
|
Review downstream retry settings and Narratio's extraction timeout together;
|
||||||
per generation. Review downstream retry settings and Narratio's extraction
|
retries can increase elapsed time and provider charges.
|
||||||
timeout together; retries can increase elapsed time and provider charges.
|
|
||||||
Notarius v0.8.1 refreshes its built-in profile checkpoint identity, so older
|
|
||||||
checkpoints may not be reused. Source-keyed chunk plans and already published
|
|
||||||
outputs are unaffected; no manual cache deletion is required.
|
|
||||||
|
|
||||||
Selecting Narratio's `testing` overlay then supplies `downstream-economy` only
|
Selecting Narratio's `testing` overlay then supplies `downstream-economy` only
|
||||||
when extraction executes. Switching that explicit selector makes a recorded
|
when extraction executes. Switching that explicit selector makes a recorded
|
||||||
@@ -352,8 +402,9 @@ not create a separate workspace or retain a separate current extraction result.
|
|||||||
|
|
||||||
Narratio cannot observe edits inside Notarius configuration behind an unchanged
|
Narratio cannot observe edits inside Notarius configuration behind an unchanged
|
||||||
selector. Force extraction after such an edit when a replacement is intended.
|
selector. Force extraction after such an edit when a replacement is intended.
|
||||||
Use `regenerate-artifacts` when both extraction and analysis must be rebuilt;
|
Use `artifacts regenerate` when both extraction and analysis must be rebuilt;
|
||||||
use `analyze` when the existing extraction bundle should be preserved. Field
|
use `run SESSION --stage analyze --force` when the existing extraction products
|
||||||
|
should be preserved. Field
|
||||||
semantics belong in [Configuration](./config.md#notarius-configuration-overlay),
|
semantics belong in [Configuration](./config.md#notarius-configuration-overlay),
|
||||||
with Audita selectors covered under
|
with Audita selectors covered under
|
||||||
[Audita selection and credentials](./config.md#audita-selection-and-credentials).
|
[Audita selection and credentials](./config.md#audita-selection-and-credentials).
|
||||||
@@ -367,15 +418,17 @@ concrete character artifact. Select a concrete generated key to operate on one
|
|||||||
member only. Manifests and plan output retain the concrete key as the durable
|
member only. Manifests and plan output retain the concrete key as the durable
|
||||||
identity and include the family and character ID as optional provenance.
|
identity and include the family and character ID as optional provenance.
|
||||||
|
|
||||||
`--artifacts` can be used on `run`, `session plan`, `run-stage`, `analyze`, and
|
`--artifacts` can be used on `run`, `session plan`, and
|
||||||
`publish`. For a bounded run or plan, the selected range must contain `analyze`
|
`artifacts regenerate`. For a bounded run or plan, the selected range must contain `analyze`
|
||||||
or `publish`.
|
or `publish`.
|
||||||
|
|
||||||
Selection behavior:
|
Selection behavior:
|
||||||
|
|
||||||
- validates names against `pipeline.scriptorium.artifacts`;
|
- validates names against the derived concrete catalog and family selections;
|
||||||
- selects explicit analyze targets and permits their required configured
|
- selects explicit analyze targets and permits their required configured
|
||||||
prerequisites to be reused or rebuilt first;
|
prerequisites to be reused or rebuilt first;
|
||||||
|
- uses those targets and their full prerequisite closure when preparation
|
||||||
|
collects previous-session input requirements;
|
||||||
- filters publish rules for `narratio.artifact.<name>` sources only;
|
- filters publish rules for `narratio.artifact.<name>` sources only;
|
||||||
- does not suppress built-in transcript, bounds, or explicitly configured
|
- does not suppress built-in transcript, bounds, or explicitly configured
|
||||||
`narratio.extraction.<name>` publish sources; and
|
`narratio.extraction.<name>` publish sources; and
|
||||||
@@ -383,162 +436,58 @@ Selection behavior:
|
|||||||
|
|
||||||
## Extraction Workflow
|
## Extraction Workflow
|
||||||
|
|
||||||
When Notarius is omitted or disabled, `extract` records an explicit skipped
|
Disabled extraction records a skipped outcome. When enabled, Narratio uses the
|
||||||
outcome with reason `notarius_disabled` and no outputs. A later invocation
|
configured Notarius pipeline and verified prepared inputs. Bind the shared party
|
||||||
reconsiders the skipped stage, so enabling Notarius does not require force.
|
and combined glossary as described in [Configuration](config.md#notarius-reference-bindings).
|
||||||
|
The final trimmed transcript and content-identified snapshots under
|
||||||
|
`inputs/references/` are passed to the subprocess.
|
||||||
|
|
||||||
When Notarius extraction is enabled, the stage consumes the final trimmed JSON
|
Successful configured lanes become flat `artifacts/<name>.json` products and
|
||||||
and preserves the complete validated Notarius bundle at:
|
`narratio.extraction.<name>` sources. The original bundle remains under the
|
||||||
|
producing run until authorized cleanup removes it; it is not implicitly
|
||||||
|
published. A failed replacement does not make the earlier extraction record current. Native fallback counts and
|
||||||
|
readiness warnings remain visible in command reports.
|
||||||
|
|
||||||
- `artifacts/notarius/{narratio_run_id}/`
|
Narratio can reuse completed extraction without starting Notarius. When extraction
|
||||||
|
runs, Notarius owns its own cache and configuration. Select native `cache` if
|
||||||
The directory is immutable once promoted. Configured lanes become
|
needed; force extraction requests `refresh`. Configure downstream cache locations
|
||||||
`narratio.extraction.<name>` sources for Scriptorium and explicit publish rules;
|
in Notarius, outside Narratio cleanup. A changed private downstream model or config
|
||||||
the bundle and `index.json` are retained for audit and resume validation but
|
is not automatically detected; force extraction when fresh work is needed.
|
||||||
are not selectable or published implicitly.
|
See [Notarius integration](integrations/notarius.md).
|
||||||
|
|
||||||
Configured Notarius references resolve only from the current manifest-backed
|
|
||||||
prepared inputs. Their canonical locations are `inputs/party.yml`,
|
|
||||||
`inputs/players.yml`, `inputs/glossary.yml`, and, when configured,
|
|
||||||
`inputs/spell_catalog.json`. Extraction supplies Notarius with verified,
|
|
||||||
content-addressed copies under
|
|
||||||
`cache/notarius/references/<sha256>/<prepared-basename>`. The full lowercase
|
|
||||||
SHA-256 digest identifies the reference bytes, so retries and later invocations
|
|
||||||
reuse the same path while changed bytes select a new path. Older snapshots are
|
|
||||||
retained and are not current artifact evidence. A concurrent refresh of
|
|
||||||
canonical prepared files therefore cannot change the bytes consumed by an
|
|
||||||
in-flight invocation.
|
|
||||||
For a canonical party, preparation retains the validated authored party bytes
|
|
||||||
at `inputs/party.yml` and generates `inputs/players.yml` from that roster.
|
|
||||||
The manifest records their checksums separately, with the players input marked
|
|
||||||
as derived from the party; refresh preparation after changing the roster rather
|
|
||||||
than editing either prepared file.
|
|
||||||
Inspect the effective stable-input inventory and
|
|
||||||
prepared-file readiness with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio session status 2026-04-04
|
|
||||||
narratio session validate 2026-04-04
|
|
||||||
```
|
|
||||||
|
|
||||||
Reference metadata records selector, source ID, session-relative path,
|
|
||||||
checksum, and byte size, but never payload contents. Changing a prepared
|
|
||||||
reference changes extraction identity: ordinary continuation rejects the old
|
|
||||||
result, reruns Notarius, and marks successful downstream stages stale. If the
|
|
||||||
prepared file is missing or inconsistent with its manifest checksum, repair
|
|
||||||
the source configuration and refresh prepared state first:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run-stage prepare 2026-04-04 --force
|
|
||||||
```
|
|
||||||
|
|
||||||
Starting a replacement clears the previous extraction payload from the current
|
|
||||||
session-stage record. If that replacement fails or self-skips, the current
|
|
||||||
record does not fall back to the earlier outputs. The earlier immutable bundle
|
|
||||||
remains available for inspection, but downstream resolution requires a new
|
|
||||||
current successful extraction record.
|
|
||||||
|
|
||||||
Notarius extraction validates its run-local bundle and moves it once to the
|
|
||||||
unique durable bundle path. A pre-existing durable destination is a collision;
|
|
||||||
no duplicate promotion tree is created.
|
|
||||||
|
|
||||||
`pipeline.notarius.resume` and `pipeline.notarius.chunk_cache` control work
|
|
||||||
inside an executed Notarius invocation. Ordinary extraction forwards their
|
|
||||||
configured values. Forced extraction always disables checkpoint loading and
|
|
||||||
requests chunk-plan `refresh`, even when the configured mode is `bypass`.
|
|
||||||
Refresh regenerates and replaces only the active input's accepted chunk plan;
|
|
||||||
it is not cache deletion.
|
|
||||||
|
|
||||||
Notarius checkpoint recording must be enabled in the deployed Notarius
|
|
||||||
configuration. Narratio neither creates a Notarius pipeline/configuration nor
|
|
||||||
reads it to infer checkpoint availability. Configure explicit persistent
|
|
||||||
Notarius chunk-plan and checkpoint roots when reuse must survive separate
|
|
||||||
Narratio subprocesses. A changed reference, transcript, selected profile,
|
|
||||||
profile content, endpoint, or other Notarius checkpoint identity input can
|
|
||||||
produce a legitimate cold miss.
|
|
||||||
|
|
||||||
There are two independent resume boundaries: Narratio may skip a completed
|
|
||||||
`extract` stage without invoking Notarius, while `--resume` allows Notarius to
|
|
||||||
reuse compatible accepted work only after Narratio has decided extraction must
|
|
||||||
execute. Deleting Narratio's local reference snapshots does not invalidate a
|
|
||||||
complete durable extraction; missing snapshots are reconstructed only when a
|
|
||||||
later extraction actually runs.
|
|
||||||
|
|
||||||
## Migrating Manifest Overlay Provenance
|
## Migrating Manifest Overlay Provenance
|
||||||
|
|
||||||
The pipeline-selection rename is a clean cutover. Manifests containing
|
Manifests containing `effective_config.selected_profile` are rejected by strict
|
||||||
`effective_config.selected_profile` are rejected by strict decoding; Narratio
|
decoding. Historical session state is not converted in place; move it aside and
|
||||||
does not silently discard or translate that retired field.
|
regenerate the session using the supported format. Do not edit immutable remote
|
||||||
|
snapshots.
|
||||||
Before using an affected local session with the new version:
|
|
||||||
|
|
||||||
1. Stop Narratio activity for the session and back up its manifest.
|
|
||||||
2. Rename only `effective_config.selected_profile` to `selected_overlay`, keeping
|
|
||||||
its `name` and `source`, or remove the retired informational member. If a
|
|
||||||
current `selected_overlay` member already exists, retain it and remove the
|
|
||||||
retired member rather than creating duplicate keys.
|
|
||||||
3. Preserve the schema version, digest, stage records, checkpoint evidence,
|
|
||||||
output references, and other session state. Retry the intended command.
|
|
||||||
|
|
||||||
This metadata is informational, not resume authority. Do not delete session
|
|
||||||
progress or force all stages merely to perform this migration. Other unknown
|
|
||||||
fields still require investigation rather than blanket removal.
|
|
||||||
|
|
||||||
Do not edit immutable remote committed snapshots. Restoring an older snapshot
|
|
||||||
with retired provenance requires a compatible previous Narratio version, followed
|
|
||||||
by migration of the restored local manifest before using the new version.
|
|
||||||
|
|
||||||
## Migrating Audita and Provider Credentials
|
## Migrating Audita and Provider Credentials
|
||||||
|
|
||||||
This is a breaking clean cutover to Audita v2. Narratio does not translate an
|
Install Audita v4.3.0 and its own configuration and selected pipeline before
|
||||||
Audita v1 configuration, retain old field aliases, or generate a downstream
|
running polish. Move ordered processing configuration into Audita; remove the
|
||||||
configuration. Update both the deployed Audita executable/configuration and
|
retired Narratio `pipeline.audita.modules` field. Update every old
|
||||||
the Narratio pipeline before running polish. Retired Narratio fields are
|
`narratio.input.glossary` binding to the intended explicit glossary source and
|
||||||
rejected by strict configuration loading; account for this break when choosing
|
rewrite legacy glossary files into the named-collection format. Narratio does
|
||||||
a release version.
|
not translate these settings or files. Install a catalog separately when using
|
||||||
|
setting or system selections; see [glossary inputs](config.md#glossary-inputs).
|
||||||
|
|
||||||
| Previous Narratio setting | New ownership and selection |
|
List each downstream provider's exact environment-variable name in
|
||||||
| --- | --- |
|
`audita.credentials`; Narratio passes resolved values to Audita and does not
|
||||||
| `audita.base_url` | Audita v2 `backends.<id>.endpoint` |
|
infer names or generate the downstream configuration. `audita.config_path`
|
||||||
| `audita.total_llm_concurrency`, `proposal_llm_concurrency`, `validation_llm_concurrency` | Audita v2 `backends.<id>.concurrency` and optional `queue_capacity`; backend capacity is shared across roles |
|
and `audita.overlay` select Audita's configuration independently of Narratio's
|
||||||
| `audita.model`, `validation_model` | Audita PromptKit profile files; optionally select them from Narratio with `audita.proposal_profile` and `validation_profile` |
|
overlay. Consult [Audita's configuration guide](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md).
|
||||||
| `audita.llm_api_key` | `audita.credentials: [PROVIDER_KEY_NAME]`, matching each Audita backend's `credential` name |
|
Operators can install the independently maintained [D&D recipes](https://forge.maximumdirect.net/eric/audita-pipelines-dnd/src/commit/6d5e66dcfca4bb5971a8423332a19ce884b846c0/README.md)
|
||||||
| `notarius.llm_api_key` | `notarius.credentials: [PROVIDER_KEY_NAME]`, matching references in Notarius-owned profiles |
|
and select their production or testing overlays explicitly; Narratio does not
|
||||||
| `audita.work_dir_retention`, `report` | Remove; Audita's external configuration owns diagnostics and reporting |
|
bundle those recipes or infer a downstream selection.
|
||||||
|
|
||||||
An Audita configuration can also be selected through `audita.config_path`,
|
Preparation compares effective vocabulary and prepared evidence when deciding
|
||||||
and `audita.overlay` selects an Audita overlay independently of Narratio's
|
reuse. If it changes, normal preparation invalidation applies; use
|
||||||
`--overlay`. Narratio forwards no implicit provider key: a single provider-named
|
`narratio run <session-id> --stage prepare --force` when regeneration is needed.
|
||||||
secret source may be listed for both adapters, and an Audita-only backend key
|
Polish tracks its selected configuration and prepared glossary evidence, but
|
||||||
may be listed only for Audita. Audita resolves credentials for all configured
|
does not inspect the contents of Audita-owned files. Force polish after changing
|
||||||
backends, including those not currently selected. Notarius looks up its own
|
those files behind unchanged selectors. Reports and debug destinations are
|
||||||
profiles; Narratio does not discover their credential names. Credential lists
|
run-local; see the [Audita integration contract](integrations/audita.md).
|
||||||
may be cleared with `[]` in a Narratio overlay.
|
|
||||||
|
|
||||||
Prepare the external file from Audita's maintained
|
|
||||||
[local example](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/examples/minimal-config.yml),
|
|
||||||
[service example](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/examples/production-config.yml),
|
|
||||||
and [v2 migration guide](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/docs/migrations/v2.md).
|
|
||||||
Before switching the executable, validate the file offline:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
audita config validate --config /usr/local/etc/audita/config.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
Use `audita config print-effective --config /usr/local/etc/audita/config.yml --view profiles`
|
|
||||||
to inspect downstream profile selection without contacting a provider. For a
|
|
||||||
production Audita configuration, leave ordinary reports enabled
|
|
||||||
and debug disabled unless an operator deliberately chooses otherwise; Narratio
|
|
||||||
does not override those settings. Audita writes `errors.yml`, `recoveries.yml`,
|
|
||||||
and `report.md` beside the polished output when reporting is enabled. An
|
|
||||||
exit-zero run with a valid transcript succeeds even if those reports describe
|
|
||||||
recoverable errors or no applied corrections. See the [Audita integration
|
|
||||||
contract](./integrations/audita.md) for report placement and limits.
|
|
||||||
|
|
||||||
Narratio's polish resume evidence tracks selected config path, Audita overlay,
|
|
||||||
profiles, ordered modules, description, schema, and output identity. Editing
|
|
||||||
Audita-owned files behind unchanged selectors is invisible to Narratio; force
|
|
||||||
polish with `narratio run-stage polish <session-id> --force` after such edits.
|
|
||||||
|
|
||||||
## External Command Lifecycle
|
## External Command Lifecycle
|
||||||
|
|
||||||
@@ -550,38 +499,41 @@ reaped, and descendants that keep standard output or error open cannot keep
|
|||||||
the invocation blocked. Other operating systems fail closed rather than launch
|
the invocation blocked. Other operating systems fail closed rather than launch
|
||||||
a command without tree ownership.
|
a command without tree ownership.
|
||||||
|
|
||||||
Subprocess stdout and stderr diagnostics are separately redacted and capped at
|
Subprocess diagnostic streams are separately redacted and capped at 8 MiB per
|
||||||
8 MiB per invocation. Narratio does not retain configured credential values in
|
invocation. Narratio does not retain configured credential values in these logs
|
||||||
these logs or their error tails; reaching a capture limit terminates the command
|
or their error tails; reaching a capture limit terminates the command tree and
|
||||||
tree and reports which stream exceeded the limit.
|
reports which stream exceeded the limit. Scriptorium result stdout is captured
|
||||||
|
separately without redaction; see its [integration contract](integrations/scriptorium.md).
|
||||||
|
|
||||||
Run-local diagnostics are:
|
Run-local diagnostics are:
|
||||||
|
|
||||||
- `runs/{run_id}/polish/outputs/transcripts/errors.yml`,
|
- `runs/{run_id}/polish/logs/{errors.yml,recoveries.yml,report.md}` when
|
||||||
`recoveries.yml`, and `report.md` when Audita writes them beside its
|
Audita reporting is enabled, alongside captured streams and invocation records
|
||||||
run-local polished transcript
|
- `runs/{run_id}/extract/logs/notarius.report.json`
|
||||||
- `runs/{run_id}/extract/notarius.receipt.json`
|
- `runs/{run_id}/extract/logs/notarius.stderr.log`
|
||||||
- `runs/{run_id}/extract/notarius.stderr.log`
|
- `runs/{run_id}/extract/notarius-output/` for original bundles until cleanup
|
||||||
- `runs/{run_id}/extract/notarius-output/` before durable promotion
|
|
||||||
|
|
||||||
The run upload is an allowlist derived from the session manifest's declared
|
The run upload is an allowlist derived from the session manifest's declared
|
||||||
current-run outputs, logs, and generated configurations, not a workspace scan.
|
current-run outputs, logs, and generated configurations, not a workspace scan.
|
||||||
References to canonical session files and prior-run paths are excluded. Each
|
References to canonical session files and prior-run paths are excluded. Each
|
||||||
declared source is opened without following symlinked ancestors or the leaf,
|
declared source is opened without following symlinked ancestors or the leaf,
|
||||||
verified as a regular file, and streamed from that verified descriptor.
|
verified as a regular file, and streamed from that verified descriptor. After
|
||||||
|
destination planning, sources are verified and transferred sequentially. A
|
||||||
|
later invalid source can leave unselected immutable uploads; the current
|
||||||
|
publication remains unchanged.
|
||||||
Unlisted files and unsafe entries are never uploaded; a run with no declared
|
Unlisted files and unsafe entries are never uploaded; a run with no declared
|
||||||
current-run diagnostics uploads no run-local files. No distinguished diagnostic
|
current-run diagnostics uploads no run-local files. No distinguished diagnostic
|
||||||
file is uploaded. The durable bundle is never scanned for implicit publication;
|
file is uploaded. The original bundle is never scanned for implicit publication;
|
||||||
only lanes named by explicit `pipeline.publish.outputs` rules are uploaded.
|
only lanes named by explicit `pipeline.publish.outputs` rules are uploaded.
|
||||||
To inspect a published polish report remotely, read its declared object under
|
To inspect a published polish report remotely, read its declared object under
|
||||||
the run archive's `polish/outputs/transcripts/` prefix. Session restore does
|
the run archive's `polish/logs/` prefix. Session restore does
|
||||||
not restore run-archive diagnostics as canonical session files; it restores only
|
not restore run-archive diagnostics as canonical session files; it restores only
|
||||||
the committed manifest and declared transcript/artifact objects.
|
the committed manifest and declared transcript/artifact objects.
|
||||||
|
|
||||||
To intentionally replace the current extraction result, run:
|
To intentionally replace the current extraction result, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage extract 2026-04-04 --force
|
narratio run 2026-04-04 --stage extract --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Narratio automatically reruns extraction when its recorded invocation contract,
|
Narratio automatically reruns extraction when its recorded invocation contract,
|
||||||
@@ -610,31 +562,29 @@ before commit selection.
|
|||||||
Run publish only:
|
Run publish only:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio publish 2026-04-04
|
narratio run 2026-04-04 --stage publish --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Equivalent:
|
This selection stops after publish and does not invoke cleanup. A
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run-stage publish 2026-04-04 --force
|
|
||||||
```
|
|
||||||
|
|
||||||
This standalone command stops after publish and does not invoke cleanup. A
|
|
||||||
default full `run` continues through notify and cleanup.
|
default full `run` continues through notify and cleanup.
|
||||||
|
|
||||||
Publish commit model:
|
Publish commit model:
|
||||||
|
|
||||||
- uploads eligible run files under `{session_prefix}/runs/{run_id}/`, excluding
|
- uploads eligible run files under `{session_prefix}/runs/{run_id}/`, excluding
|
||||||
audio and the run-local Notarius staging bundle;
|
audio and the run-local Notarius staging bundle;
|
||||||
|
- uploads prepared campaign, session, and party documents under the run's
|
||||||
|
`prepare/inputs/` prefix, when recorded by the manifest;
|
||||||
- uploads configured published outputs and `previous/**` cache files into the
|
- uploads configured published outputs and `previous/**` cache files into the
|
||||||
same immutable run scope, including only explicitly configured extraction
|
same immutable run scope, including only explicitly configured extraction
|
||||||
lanes;
|
lanes;
|
||||||
|
- does not upload the local execution ledger; and
|
||||||
- writes `{session_prefix}/runs/{run_id}/commit.json` after all declared
|
- writes `{session_prefix}/runs/{run_id}/commit.json` after all declared
|
||||||
immutable objects are uploaded and verified; and
|
immutable objects are uploaded and verified; and
|
||||||
- writes `{session_prefix}/current/commit-pointer.json` once, last.
|
- writes `{session_prefix}/current/commit-pointer.json` once, last.
|
||||||
|
|
||||||
`current/commit-pointer.json` is the remote current-state commit marker. It
|
`current/commit-pointer.json` is the remote current-state commit marker. It
|
||||||
selects exactly one immutable commit, which declares the complete object set.
|
selects exactly one immutable commit, which declares the complete object set.
|
||||||
|
Restore reads that inventory without fetching an execution ledger.
|
||||||
|
|
||||||
## Remote Commit Migration
|
## Remote Commit Migration
|
||||||
|
|
||||||
@@ -652,7 +602,7 @@ source; they do not reconstruct a current-run key or scan the session prefix.
|
|||||||
Other artifact types remain confined to the selected commit's own run.
|
Other artifact types remain confined to the selected commit's own run.
|
||||||
|
|
||||||
When the pointer is absent, remote state is not published; republish the
|
When the pointer is absent, remote state is not published; republish the
|
||||||
session to establish a committed snapshot. Remote commit state does not carry
|
session to establish a committed publication. Remote commit state does not carry
|
||||||
local `current_pointer_written` metadata.
|
local `current_pointer_written` metadata.
|
||||||
|
|
||||||
## Publish Locks
|
## Publish Locks
|
||||||
@@ -687,14 +637,15 @@ Operational rules:
|
|||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio session locks 2026-04-04
|
narratio session locks list 2026-04-04
|
||||||
narratio session locks add 2026-04-04 narratio.artifact.session_recap --reason "manual edits" --force
|
narratio session locks add 2026-04-04 narratio.artifact.session_recap --reason "manual edits" --force
|
||||||
narratio session locks remove 2026-04-04 narratio.artifact.session_recap
|
narratio session locks remove 2026-04-04 narratio.artifact.session_recap
|
||||||
```
|
```
|
||||||
|
|
||||||
## Restore Workflow
|
## Restore Workflow
|
||||||
|
|
||||||
Use restore when local durable session state is missing or stale and remote committed current state is authoritative.
|
Use restore to import products from the selected publication into a local session.
|
||||||
|
Existing local progress is retained where its evidence remains valid.
|
||||||
|
|
||||||
Dry run:
|
Dry run:
|
||||||
|
|
||||||
@@ -710,14 +661,20 @@ narratio session restore 2026-04-04
|
|||||||
|
|
||||||
`--dry-run` does not write durable session files. It still reads the selected
|
`--dry-run` does not write durable session files. It still reads the selected
|
||||||
remote current state and may read object identity/content needed to classify the
|
remote current state and may read object identity/content needed to classify the
|
||||||
plan, so it is not a network-free operation.
|
plan, so it is not a network-free operation. The inventory-based preview maps
|
||||||
|
published source identities to current canonical local product paths; the remote
|
||||||
|
destination name does not choose the local filename. Projected satisfied and
|
||||||
|
remaining work combines conditional product coverage with the read-only
|
||||||
|
assessment of preserved local evidence. Planned downloads must still pass
|
||||||
|
content verification; the preview does not certify an import or pipeline run.
|
||||||
|
|
||||||
Default restore scope:
|
Default restore scope:
|
||||||
|
|
||||||
- the committed session manifest and the committed transcript/artifact objects
|
- prepared inputs and currently recognized transcript/artifact products declared
|
||||||
declared by the selected remote commit
|
by the selected remote commit
|
||||||
- `previous/**` when needed by configured previous-session artifact inputs;
|
- `inputs/previous/**` when needed by enabled targets or their configured
|
||||||
each is selected from its exact committed `published_output` declaration
|
prerequisites, including disabled prerequisites; each is selected from its
|
||||||
|
exact committed `published_output` declaration
|
||||||
|
|
||||||
Optional:
|
Optional:
|
||||||
|
|
||||||
@@ -725,6 +682,12 @@ Optional:
|
|||||||
- `--force` to overwrite eligible conflicting regular files; it never replaces
|
- `--force` to overwrite eligible conflicting regular files; it never replaces
|
||||||
directories, symlinks, or other non-regular local targets
|
directories, symlinks, or other non-regular local targets
|
||||||
|
|
||||||
|
Verified products without valid local execution evidence receive local supplied
|
||||||
|
product records. Identical files preserve valid local execution evidence. Changed
|
||||||
|
products invalidate dependent local work; unrelated checkpoints are preserved.
|
||||||
|
This import does not claim that the remote execution occurred locally, and
|
||||||
|
`--force` here authorizes replacement rather than pipeline regeneration.
|
||||||
|
|
||||||
Restore treats a local leaf symlink or any symlinked ancestor beneath the
|
Restore treats a local leaf symlink or any symlinked ancestor beneath the
|
||||||
selected session root as a conflict, even when the linked content matches the
|
selected session root as a conflict, even when the linked content matches the
|
||||||
selected remote object. `--force` does not override that conflict.
|
selected remote object. `--force` does not override that conflict.
|
||||||
@@ -733,78 +696,41 @@ Before each install, restore validates the destination again beneath the
|
|||||||
selected session root. A target changed into a symlink, directory, or other
|
selected session root. A target changed into a symlink, directory, or other
|
||||||
non-regular entry is not overwritten.
|
non-regular entry is not overwritten.
|
||||||
|
|
||||||
Restore writes an execution report at `reports/restore-latest.json`.
|
Restore writes an execution report under `runs/<run_id>/restore/logs/restore.json`;
|
||||||
|
`logs/restore` points to the latest actual restore attempt.
|
||||||
|
|
||||||
If restore fails after beginning installation, it leaves a durable
|
If restore fails after beginning installation, it leaves a durable
|
||||||
`.restore-incomplete.json` marker in the session root. Pipeline runs will stop
|
`.restore-incomplete.json` marker in the session root. Pipeline runs will stop
|
||||||
until you rerun the same restore command and it completes. Restore intentionally
|
until you rerun the same restore command and it completes. Restore intentionally
|
||||||
does not try to roll back files already installed; retrying the selected remote
|
does not try to roll back files already installed; retrying the selected remote
|
||||||
snapshot is the recovery procedure.
|
publication is the recovery procedure.
|
||||||
|
|
||||||
## Local State Layout
|
## Local State Layout
|
||||||
|
|
||||||
Session root:
|
A session lives at `{workspace.root}/work/{campaign}/{session_id}`. It contains
|
||||||
|
`manifest.json`, prepared `inputs/` and `audio/`, `transcripts/` (including
|
||||||
|
`raw/` speaker files), flat `artifacts/`, and `runs/` for actual attempts.
|
||||||
|
Previous-session inputs live under `inputs/previous/`; verified subprocess
|
||||||
|
reference snapshots live under `inputs/references/`.
|
||||||
|
|
||||||
- `{workspace.root}/work/{campaign}/{session_id}`
|
Each attempted stage writes actual logs and debug capture beneath its run.
|
||||||
|
`logs/<stage>` and `debug/<stage>` are relative links to the latest attempt,
|
||||||
|
including failed attempts; skipped work does not rotate them. Restore writes its
|
||||||
|
own diagnostic attempt. Original Notarius bundles remain in the producing run
|
||||||
|
until authorized cleanup. The `runs/` directory is created on demand.
|
||||||
|
|
||||||
Durable session paths:
|
Remote audio is downloaded to a temporary sibling and verified before replacing
|
||||||
|
its single prepared `audio/` copy. Restore follows the same layout. Subprocess
|
||||||
|
cache and state locations are configured separately in those applications.
|
||||||
|
|
||||||
- `manifest.json`
|
Only `narratio.session-manifest.v2` is supported locally. Move older local state
|
||||||
- `inputs/**`
|
aside and regenerate it or import published products into a new baseline. Do not
|
||||||
- `audio/**`
|
edit old markers by hand.
|
||||||
- `transcripts/**`
|
|
||||||
- `artifacts/**`
|
|
||||||
- `previous/**`
|
|
||||||
- `reports/**`
|
|
||||||
- `logs/**`
|
|
||||||
- `config/**`
|
|
||||||
- `runs/**`
|
|
||||||
- `cache/notarius/references/<sha256>/<prepared-basename>`
|
|
||||||
|
|
||||||
`manifest.json` is the versioned session-progress document. Narratio accepts
|
|
||||||
only `narratio.session-manifest.v1`. Do not edit unsupported session state to
|
|
||||||
add missing markers. Move it aside and regenerate it, restore a verified
|
|
||||||
current committed snapshot, or republish healthy regenerated state as the
|
|
||||||
relevant workflow requires.
|
|
||||||
|
|
||||||
Validated Notarius bundles live below `artifacts/notarius/{run_id}/`; receipt,
|
|
||||||
stderr, and pre-promotion output remain in the producing run's `extract`
|
|
||||||
directory as described in [Extraction Workflow](#extraction-workflow).
|
|
||||||
Stable reference snapshots live in the session cache path above. Ordinary
|
|
||||||
published-run cleanup removes its selected run-local target but retains this
|
|
||||||
cache, and publish/restore never enumerate it as an artifact. Remove a snapshot
|
|
||||||
or digest directory manually only while no command is active for the session;
|
|
||||||
regular missing or corrupt content is reconstructed on the next executed
|
|
||||||
extraction, while symlinks, directories, and other unsafe conflicts must be
|
|
||||||
investigated and removed deliberately.
|
|
||||||
|
|
||||||
Run-local layout:
|
|
||||||
|
|
||||||
- `runs/{run_id}/{stage}/outputs`
|
|
||||||
- `runs/{run_id}/{stage}/logs`
|
|
||||||
- `runs/{run_id}/{stage}/reports`
|
|
||||||
- `runs/{run_id}/{stage}/config`
|
|
||||||
- `runs/{run_id}/{stage}/scratch`
|
|
||||||
|
|
||||||
Spool layout (runtime/transient):
|
|
||||||
|
|
||||||
- `{spool.root}/{campaign}/{session_id}/{run_id}/...`
|
|
||||||
- restore audio spool under `{spool.root}/{campaign}/{session_id}/restore/audio`
|
|
||||||
|
|
||||||
Cache layout (durable S3 audio cache):
|
|
||||||
|
|
||||||
- `{cache.root}/s3/{bucket}/...`
|
|
||||||
|
|
||||||
Each cached audio file has an adjacent managed identity record. It binds the
|
|
||||||
file to its remote object version and verified digest; deleting or altering the
|
|
||||||
record simply causes Narratio to download and verify the object again.
|
|
||||||
Remote audio and restored files are fully transferred into sibling temporary
|
|
||||||
files and validated before they replace their canonical workspace paths.
|
|
||||||
|
|
||||||
### Workspace Permissions
|
### Workspace Permissions
|
||||||
|
|
||||||
Ordinary Narratio workspace content is intentionally shareable with the
|
Ordinary Narratio workspace content is intentionally shareable with the
|
||||||
workspace group. On POSIX systems, Narratio-created workspace, spool, and cache
|
workspace group. On POSIX systems, Narratio-created workspace
|
||||||
directories converge on setgid `02775`; ordinary files, including manifests,
|
directories converge on setgid `02775`; ordinary files, including manifests,
|
||||||
transcripts, generated configuration, logs, reports, and Notarius artifacts,
|
transcripts, generated configuration, logs, reports, and Notarius artifacts,
|
||||||
converge on `0664`. Narratio explicitly applies these modes so a restrictive
|
converge on `0664`. Narratio explicitly applies these modes so a restrictive
|
||||||
@@ -818,14 +744,12 @@ Provision a credential directory as `0700` and credential files as `0600`;
|
|||||||
these permission modes are an operator requirement and are not enforced by
|
these permission modes are an operator requirement and are not enforced by
|
||||||
ConfigKit.
|
ConfigKit.
|
||||||
|
|
||||||
Every pipeline-loading command bootstraps credentials once, before the first
|
Pipeline acquisition uses the directory declared in the main pipeline file,
|
||||||
configuration load and before any adapter is constructed. `--secrets-dir`
|
when present, before resolving typed credentials. Remove `--secrets-dir` from
|
||||||
selects an explicit directory (relative paths use caller CWD). Otherwise a
|
old invocations and declare `config.secrets_dir`, or provision environment values.
|
||||||
present `secrets/` beside the resolved root pipeline is used, while an absent
|
A pipeline beside the former system-wide directory can select `secrets`; other
|
||||||
conventional directory is skipped. Explicit missing/empty selections and
|
layouts follow [ConfigKit's path rules](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap).
|
||||||
invalid existing directories fail the command. ConfigKit follows a symlink used
|
See [Secrets Handling](config.md#secrets-handling) for Narratio's integration.
|
||||||
as the selected directory, but immediate entries must be regular non-symlink
|
|
||||||
files. Existing environment variables—including empty values—always win.
|
|
||||||
|
|
||||||
S3 `access_key_id` and `secret_access_key` are an optional pair of typed
|
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
|
environment references. When both are absent, the AWS SDK retains its default
|
||||||
@@ -842,59 +766,40 @@ the session workload.
|
|||||||
|
|
||||||
## Cleanup
|
## Cleanup
|
||||||
|
|
||||||
Session-scoped cleanup:
|
Use `narratio session clean SESSION` to remove an entire local session, or
|
||||||
|
`narratio session clean --all` for all local sessions. Add `--dry-run` to inspect
|
||||||
|
planned targets. These commands do not delete subprocess caches or remote data.
|
||||||
|
Mutating cleanup waits for the same workspace lock used by runs, preflight, and
|
||||||
|
restore. Waiting can be cancelled; dry-run inspection does not take the lock.
|
||||||
|
Mutating commands report the lock path through progress reporting before
|
||||||
|
acquisition; normal visibility controls apply.
|
||||||
|
The lock file remains at `<workspace.root>/.lock` after cleanup.
|
||||||
|
|
||||||
```bash
|
Automatic cleanup requires `workspace.cleanup_after_publish=true` and successful
|
||||||
narratio clean 2026-04-04
|
publication evidence. When selected, it removes the entire session `runs/` tree,
|
||||||
```
|
including older failures, restore attempts, probes, logs, debug captures, and
|
||||||
|
original Notarius bundles. Managed stage and restore views are removed as well.
|
||||||
|
Canonical products, prepared inputs, manifests, other sessions, subprocess
|
||||||
|
state and caches, and remote objects remain. Set the option to `false` to keep
|
||||||
|
run history and diagnostics.
|
||||||
|
|
||||||
Global cleanup:
|
A failed cleanup is reported and may have removed some files already. Retry the
|
||||||
|
cleanup stage or a full run without republishing. Bounded runs ending before
|
||||||
```bash
|
cleanup do not execute it; their new attempts remain until a later authorized
|
||||||
narratio clean --all
|
cleanup. See [cleanup internals](internal/stage-cleanup.md).
|
||||||
```
|
|
||||||
|
|
||||||
Dry-run and cache variants:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio clean 2026-04-04 --dry-run --clear-cache
|
|
||||||
narratio clean --all --dry-run --clear-cache
|
|
||||||
```
|
|
||||||
|
|
||||||
Rules:
|
|
||||||
|
|
||||||
- `clean` deletes work/spool session state;
|
|
||||||
- cache is preserved unless `--clear-cache` is set;
|
|
||||||
- each deletion is confined beneath its configured workspace, spool, or cache
|
|
||||||
root; root, traversal, and out-of-root targets are refused;
|
|
||||||
- the final cleanup stage is gated by successful publish evidence plus:
|
|
||||||
- `pipeline.spool.delete_audio_after_publish=true`
|
|
||||||
- `pipeline.workspace.cleanup_after_publish=true`
|
|
||||||
- the manifest publish record has `uploaded=true`, the published run ID, the
|
|
||||||
exact remote commit key, and the current commit-pointer key.
|
|
||||||
|
|
||||||
Cleanup derives only the configured run-scoped spool and workspace targets,
|
|
||||||
uses root-confined deletion, and does not read or mutate object storage. A
|
|
||||||
failure leaves publish succeeded and the remote committed snapshot current.
|
|
||||||
Retry with a normal full run: valid upstream work, including publish and notify,
|
|
||||||
is skipped while the failed cleanup stage runs again. `run-stage cleanup` is
|
|
||||||
also available when the manifest has valid publish evidence. A range ending at
|
|
||||||
`notify` or earlier and the standalone `publish` command never delete local
|
|
||||||
state.
|
|
||||||
|
|
||||||
Older local manifests that contain the retired cleanup-obligation field are
|
|
||||||
intentionally incompatible with strict manifest decoding. If such an
|
|
||||||
obligation is still outstanding, complete it with the pre-upgrade binary.
|
|
||||||
Otherwise verify that the remote publication is committed, move aside or
|
|
||||||
regenerate the incompatible local manifest (or restore the verified remote
|
|
||||||
snapshot), and then use the cleanup stage. Manual JSON editing is not the
|
|
||||||
normal migration path.
|
|
||||||
|
|
||||||
## Operational Caveats
|
## Operational Caveats
|
||||||
|
|
||||||
- Local and S3 audio modes are mutually exclusive.
|
- Local and S3 audio modes are mutually exclusive.
|
||||||
- Publish requires prerequisite stages through `render` and `analyze` to be succeeded.
|
- Ordinary publication checks prerequisite stage success; a supplied-product
|
||||||
|
baseline permits publication of individually validated selected sources.
|
||||||
- Markdown publish defaults require render outputs (`transcripts/final.md` and `transcripts/final.trimmed.md`).
|
- Markdown publish defaults require render outputs (`transcripts/final.md` and `transcripts/final.trimmed.md`).
|
||||||
- Restore requires configured object storage and committed remote current state.
|
- Restore requires configured object storage and committed remote current state.
|
||||||
- Pipeline-loading commands bootstrap filesystem secrets once before configuration
|
- Each reached pipeline acquisition applies its configured startup before typed
|
||||||
resolution and object-store initialization.
|
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
|
||||||
|
and decision context. Console `--debug` does not enable downstream debug capture
|
||||||
|
or change retention. Downstream streams stay in captured logs. See
|
||||||
|
[CLI reporting](cli.md#reporting-and-visibility) for mode combinations and formats.
|
||||||
|
|||||||
@@ -2,23 +2,28 @@
|
|||||||
|
|
||||||
## Standard Repository Policies
|
## Standard Repository Policies
|
||||||
|
|
||||||
Material: `docs/policy/agents.md`, `architecture.md`, `documentation.md`,
|
Material: `docs/policy/documentation.md`, adapted from revision
|
||||||
`testing.md`, `release.md`, `meta.md`, and `oss.md`; root `AGENTS.md` and the policy reading
|
`5b9088601290564647a9e20c13f95c0da9f4cb15`; `docs/policy/agents.md`,
|
||||||
guide in `docs/development.md`, adapted for this repository.
|
`architecture.md`, `testing.md`, `release.md`, `meta.md`, and `oss.md`; root
|
||||||
|
`AGENTS.md` and the policy reading guide in `docs/development.md`, adapted from
|
||||||
|
revision `593c9b52273c5c879785ae9e995d21026df467b4` for this repository.
|
||||||
|
|
||||||
Copyright (C) 2026 Eric Rakestraw
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
SPDX-License-Identifier: CC-BY-SA-4.0
|
SPDX-License-Identifier: CC-BY-SA-4.0
|
||||||
|
|
||||||
License and notices: [CC BY-SA 4.0](licenses/CC-BY-SA-4.0.txt) |
|
License and notices: [CC BY-SA 4.0](licenses/CC-BY-SA-4.0.txt) |
|
||||||
[COPYRIGHT](https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843/COPYRIGHT) |
|
[COPYRIGHT](https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/COPYRIGHT) |
|
||||||
[LICENSE](https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843/LICENSE).
|
[LICENSE](https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/LICENSE) |
|
||||||
|
[COPYRIGHT](https://gitea.maximumdirect.net/eric/policy/src/commit/5b9088601290564647a9e20c13f95c0da9f4cb15/COPYRIGHT) |
|
||||||
|
[LICENSE](https://gitea.maximumdirect.net/eric/policy/src/commit/5b9088601290564647a9e20c13f95c0da9f4cb15/LICENSE).
|
||||||
|
|
||||||
[Source](https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843).
|
[Source](https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4).
|
||||||
|
[Source](https://gitea.maximumdirect.net/eric/policy/src/commit/5b9088601290564647a9e20c13f95c0da9f4cb15).
|
||||||
|
|
||||||
## ConfigKit
|
## ConfigKit
|
||||||
|
|
||||||
Selected module: `gitea.maximumdirect.net/eric/ConfigKit` at `v0.4.2`.
|
Selected module: `go.maximumdirect.net/configkit` at `v1.4.0`.
|
||||||
|
|
||||||
Copyright (C) 2026 Eric Rakestraw
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
@@ -26,10 +31,83 @@ SPDX-License-Identifier: LGPL-3.0-or-later
|
|||||||
|
|
||||||
License and notices: [LGPL 3.0](licenses/LGPL-3.0.txt) |
|
License and notices: [LGPL 3.0](licenses/LGPL-3.0.txt) |
|
||||||
[GPL 3.0](licenses/GPL-3.0.txt) |
|
[GPL 3.0](licenses/GPL-3.0.txt) |
|
||||||
[COPYRIGHT](https://gitea.maximumdirect.net/eric/ConfigKit/src/commit/67c03690181c5af8dde6be325abac241dae6732f/COPYRIGHT) |
|
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/COPYRIGHT) |
|
||||||
[LICENSE](https://gitea.maximumdirect.net/eric/ConfigKit/src/commit/67c03690181c5af8dde6be325abac241dae6732f/LICENSE).
|
[LICENSE](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/LICENSE).
|
||||||
|
|
||||||
[Source](https://gitea.maximumdirect.net/eric/ConfigKit/src/commit/67c03690181c5af8dde6be325abac241dae6732f).
|
[Source](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3).
|
||||||
|
|
||||||
|
## CommandKit
|
||||||
|
|
||||||
|
Selected module: `go.maximumdirect.net/commandkit` at `v0.8.0`.
|
||||||
|
|
||||||
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
|
License and notices: [LGPL 3.0](licenses/LGPL-3.0.txt) |
|
||||||
|
[GPL 3.0](licenses/GPL-3.0.txt) |
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/COPYRIGHT) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae).
|
||||||
|
|
||||||
|
## CommandKit ckconfig
|
||||||
|
|
||||||
|
Selected module: `go.maximumdirect.net/ckconfig` at `v0.11.0`.
|
||||||
|
|
||||||
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
|
License and notices: [LGPL 3.0](licenses/LGPL-3.0.txt) |
|
||||||
|
[GPL 3.0](licenses/GPL-3.0.txt) |
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/cd5cf483a46caeff7ca0a91fb4747d57188a3888/integrations/ckconfig/COPYRIGHT) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/cd5cf483a46caeff7ca0a91fb4747d57188a3888/integrations/ckconfig/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/cd5cf483a46caeff7ca0a91fb4747d57188a3888).
|
||||||
|
|
||||||
|
## ReleaseKit
|
||||||
|
|
||||||
|
Selected module: `go.maximumdirect.net/releasekit` at `v0.10.0`; adapted launcher and Woodpecker delivery workflow.
|
||||||
|
|
||||||
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
|
License and notices: [LGPL 3.0](licenses/LGPL-3.0.txt) |
|
||||||
|
[GPL 3.0](licenses/GPL-3.0.txt) |
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/releasekit/src/commit/82bac1a3ab935beddd4b8789d1e07f52135d4243/COPYRIGHT) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/base-layer/releasekit/src/commit/82bac1a3ab935beddd4b8789d1e07f52135d4243/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/base-layer/releasekit/src/commit/82bac1a3ab935beddd4b8789d1e07f52135d4243).
|
||||||
|
|
||||||
|
## Cobra
|
||||||
|
|
||||||
|
Selected module: `github.com/spf13/cobra` at `v1.10.2` (transitive dependency).
|
||||||
|
|
||||||
|
Copyright 2013-2023 The Cobra Authors
|
||||||
|
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
License and notices: [Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
|
[LICENSE.txt](https://github.com/spf13/cobra/blob/88b30ab89da2d0d0abb153818746c5a2d30eccec/LICENSE.txt).
|
||||||
|
|
||||||
|
[Source](https://github.com/spf13/cobra/commit/88b30ab89da2d0d0abb153818746c5a2d30eccec).
|
||||||
|
|
||||||
|
## pflag
|
||||||
|
|
||||||
|
Selected module: `github.com/spf13/pflag` at `v1.1.0` (transitive dependency).
|
||||||
|
|
||||||
|
Copyright (c) 2012 Alex Ogier. All rights reserved.
|
||||||
|
|
||||||
|
Copyright (c) 2012 The Go Authors. All rights reserved.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/spf13/pflag/blob/f8a990678a6d44385313e9b19e40737f889f9b14/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://github.com/spf13/pflag/commit/f8a990678a6d44385313e9b19e40737f889f9b14).
|
||||||
|
|
||||||
## YAML v3
|
## YAML v3
|
||||||
|
|
||||||
@@ -54,7 +132,7 @@ License and notices: [MIT](licenses/MIT.txt) |
|
|||||||
|
|
||||||
## YAML v4
|
## YAML v4
|
||||||
|
|
||||||
Selected module: `go.yaml.in/yaml/v4` at `v4.0.0-rc.6`.
|
Selected module: `go.yaml.in/yaml/v4` at `v4.0.0`.
|
||||||
|
|
||||||
Copyright 2006-2010 Kirill Simonov
|
Copyright 2006-2010 Kirill Simonov
|
||||||
|
|
||||||
@@ -66,10 +144,10 @@ SPDX-License-Identifier: MIT AND Apache-2.0
|
|||||||
|
|
||||||
License and notices: [MIT](licenses/MIT.txt) |
|
License and notices: [MIT](licenses/MIT.txt) |
|
||||||
[Apache 2.0](licenses/Apache-2.0.txt) |
|
[Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
[LICENSE](https://github.com/yaml/go-yaml/blob/1c17b9cee72bf81ae73a8be50fbd7dd3a9985125/LICENSE) |
|
[LICENSE](https://github.com/yaml/go-yaml/blob/f2f9563503f11b7a60da0c532175dcc693ce8d5a/LICENSE) |
|
||||||
[NOTICE](https://github.com/yaml/go-yaml/blob/1c17b9cee72bf81ae73a8be50fbd7dd3a9985125/NOTICE).
|
[NOTICE](https://github.com/yaml/go-yaml/blob/f2f9563503f11b7a60da0c532175dcc693ce8d5a/NOTICE).
|
||||||
|
|
||||||
[Source](https://github.com/yaml/go-yaml/commit/1c17b9cee72bf81ae73a8be50fbd7dd3a9985125).
|
[Source](https://github.com/yaml/go-yaml/commit/f2f9563503f11b7a60da0c532175dcc693ce8d5a).
|
||||||
|
|
||||||
## go-cmp
|
## go-cmp
|
||||||
|
|
||||||
@@ -114,18 +192,18 @@ License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
|||||||
|
|
||||||
## Go runtime and standard library
|
## Go runtime and standard library
|
||||||
|
|
||||||
Material: Go `1.26.7` runtime and standard library material incorporated in
|
Material: Go `1.27.4` runtime and standard library material incorporated in
|
||||||
release binaries built with the declared `golang:1.26.7` CI toolchain.
|
release binaries built with the declared `golang:1.27.4` CI toolchain.
|
||||||
|
|
||||||
Copyright 2009 The Go Authors.
|
Copyright 2009 The Go Authors.
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-3-Clause
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
[LICENSE](https://github.com/golang/go/blob/e3336a22ad3f0a90bd252c95d8b5544e02674205/LICENSE) |
|
[LICENSE](https://github.com/golang/go/blob/7b2881024c95a11ddb86663a616340aa3a88b67f/LICENSE) |
|
||||||
[PATENTS](https://github.com/golang/go/blob/e3336a22ad3f0a90bd252c95d8b5544e02674205/PATENTS).
|
[PATENTS](https://github.com/golang/go/blob/7b2881024c95a11ddb86663a616340aa3a88b67f/PATENTS).
|
||||||
|
|
||||||
[Source](https://github.com/golang/go/commit/e3336a22ad3f0a90bd252c95d8b5544e02674205).
|
[Source](https://github.com/golang/go/commit/7b2881024c95a11ddb86663a616340aa3a88b67f).
|
||||||
|
|
||||||
## AWS SDK for Go v2
|
## AWS SDK for Go v2
|
||||||
|
|
||||||
@@ -211,3 +289,54 @@ License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
|||||||
[LICENSE](https://github.com/aws/smithy-go/blob/e094f45e716e33a1b950cf8bbe804790bf87f965/internal/sync/singleflight/LICENSE).
|
[LICENSE](https://github.com/aws/smithy-go/blob/e094f45e716e33a1b950cf8bbe804790bf87f965/internal/sync/singleflight/LICENSE).
|
||||||
|
|
||||||
[Source](https://github.com/aws/smithy-go/commit/e094f45e716e33a1b950cf8bbe804790bf87f965).
|
[Source](https://github.com/aws/smithy-go/commit/e094f45e716e33a1b950cf8bbe804790bf87f965).
|
||||||
|
|
||||||
|
## JSON Schema
|
||||||
|
|
||||||
|
Selected module: `github.com/santhosh-tekuri/jsonschema/v6` at `v6.0.3`.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
License and notices: [Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
|
[LICENSE](https://github.com/santhosh-tekuri/jsonschema/blob/b0fc661f4939578bc429f408c18202573dbafcc4/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://github.com/santhosh-tekuri/jsonschema/commit/b0fc661f4939578bc429f408c18202573dbafcc4).
|
||||||
|
|
||||||
|
## Go text extension
|
||||||
|
|
||||||
|
Selected module: `golang.org/x/text` at `v0.14.0`.
|
||||||
|
|
||||||
|
Copyright 2009 The Go Authors.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/golang/text/blob/6c97a165dd661335ff7bce6104a008558123c353/LICENSE) |
|
||||||
|
[PATENTS](https://github.com/golang/text/blob/6c97a165dd661335ff7bce6104a008558123c353/PATENTS).
|
||||||
|
|
||||||
|
[Source](https://github.com/golang/text/commit/6c97a165dd661335ff7bce6104a008558123c353).
|
||||||
|
|
||||||
|
## Maximum Direct shared schemas
|
||||||
|
|
||||||
|
Material: `internal/domaininput/resources/`, copied without modification from `2026.11.1`.
|
||||||
|
|
||||||
|
Copyright 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
License and notices: [CC0 1.0](licenses/CC0-1.0.txt) |
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/COPYRIGHT) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7).
|
||||||
|
|
||||||
|
## Narratio reference catalog
|
||||||
|
|
||||||
|
Material: synthetic files under `examples/reference-catalog/`, adapted from
|
||||||
|
revision `02dd53c6ea026347452d497350c40249c949f8ce`.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
License and notices: [CC0 1.0](licenses/CC0-1.0.txt) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/eric/narratio-reference-catalog/src/commit/02dd53c6ea026347452d497350c40249c949f8ce/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/eric/narratio-reference-catalog/src/commit/02dd53c6ea026347452d497350c40249c949f8ce).
|
||||||
|
|||||||
121
docs/oss/licenses/CC0-1.0.txt
Normal file
121
docs/oss/licenses/CC0-1.0.txt
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
Creative Commons Legal Code
|
||||||
|
|
||||||
|
CC0 1.0 Universal
|
||||||
|
|
||||||
|
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||||
|
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||||
|
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||||
|
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||||
|
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||||
|
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||||
|
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||||
|
HEREUNDER.
|
||||||
|
|
||||||
|
Statement of Purpose
|
||||||
|
|
||||||
|
The laws of most jurisdictions throughout the world automatically confer
|
||||||
|
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||||
|
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||||
|
authorship and/or a database (each, a "Work").
|
||||||
|
|
||||||
|
Certain owners wish to permanently relinquish those rights to a Work for
|
||||||
|
the purpose of contributing to a commons of creative, cultural and
|
||||||
|
scientific works ("Commons") that the public can reliably and without fear
|
||||||
|
of later claims of infringement build upon, modify, incorporate in other
|
||||||
|
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||||
|
and for any purposes, including without limitation commercial purposes.
|
||||||
|
These owners may contribute to the Commons to promote the ideal of a free
|
||||||
|
culture and the further production of creative, cultural and scientific
|
||||||
|
works, or to gain reputation or greater distribution for their Work in
|
||||||
|
part through the use and efforts of others.
|
||||||
|
|
||||||
|
For these and/or other purposes and motivations, and without any
|
||||||
|
expectation of additional consideration or compensation, the person
|
||||||
|
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||||
|
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||||
|
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||||
|
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||||
|
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||||
|
|
||||||
|
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||||
|
protected by copyright and related or neighboring rights ("Copyright and
|
||||||
|
Related Rights"). Copyright and Related Rights include, but are not
|
||||||
|
limited to, the following:
|
||||||
|
|
||||||
|
i. the right to reproduce, adapt, distribute, perform, display,
|
||||||
|
communicate, and translate a Work;
|
||||||
|
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||||
|
iii. publicity and privacy rights pertaining to a person's image or
|
||||||
|
likeness depicted in a Work;
|
||||||
|
iv. rights protecting against unfair competition in regards to a Work,
|
||||||
|
subject to the limitations in paragraph 4(a), below;
|
||||||
|
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||||
|
in a Work;
|
||||||
|
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||||
|
European Parliament and of the Council of 11 March 1996 on the legal
|
||||||
|
protection of databases, and under any national implementation
|
||||||
|
thereof, including any amended or successor version of such
|
||||||
|
directive); and
|
||||||
|
vii. other similar, equivalent or corresponding rights throughout the
|
||||||
|
world based on applicable law or treaty, and any national
|
||||||
|
implementations thereof.
|
||||||
|
|
||||||
|
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||||
|
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||||
|
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||||
|
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||||
|
of action, whether now known or unknown (including existing as well as
|
||||||
|
future claims and causes of action), in the Work (i) in all territories
|
||||||
|
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||||
|
treaty (including future time extensions), (iii) in any current or future
|
||||||
|
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||||
|
including without limitation commercial, advertising or promotional
|
||||||
|
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||||
|
member of the public at large and to the detriment of Affirmer's heirs and
|
||||||
|
successors, fully intending that such Waiver shall not be subject to
|
||||||
|
revocation, rescission, cancellation, termination, or any other legal or
|
||||||
|
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||||
|
as contemplated by Affirmer's express Statement of Purpose.
|
||||||
|
|
||||||
|
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||||
|
be judged legally invalid or ineffective under applicable law, then the
|
||||||
|
Waiver shall be preserved to the maximum extent permitted taking into
|
||||||
|
account Affirmer's express Statement of Purpose. In addition, to the
|
||||||
|
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||||
|
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||||
|
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||||
|
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||||
|
maximum duration provided by applicable law or treaty (including future
|
||||||
|
time extensions), (iii) in any current or future medium and for any number
|
||||||
|
of copies, and (iv) for any purpose whatsoever, including without
|
||||||
|
limitation commercial, advertising or promotional purposes (the
|
||||||
|
"License"). The License shall be deemed effective as of the date CC0 was
|
||||||
|
applied by Affirmer to the Work. Should any part of the License for any
|
||||||
|
reason be judged legally invalid or ineffective under applicable law, such
|
||||||
|
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||||
|
of the License, and in such case Affirmer hereby affirms that he or she
|
||||||
|
will not (i) exercise any of his or her remaining Copyright and Related
|
||||||
|
Rights in the Work or (ii) assert any associated claims and causes of
|
||||||
|
action with respect to the Work, in either case contrary to Affirmer's
|
||||||
|
express Statement of Purpose.
|
||||||
|
|
||||||
|
4. Limitations and Disclaimers.
|
||||||
|
|
||||||
|
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||||
|
surrendered, licensed or otherwise affected by this document.
|
||||||
|
b. Affirmer offers the Work as-is and makes no representations or
|
||||||
|
warranties of any kind concerning the Work, express, implied,
|
||||||
|
statutory or otherwise, including without limitation warranties of
|
||||||
|
title, merchantability, fitness for a particular purpose, non
|
||||||
|
infringement, or the absence of latent or other defects, accuracy, or
|
||||||
|
the present or absence of errors, whether or not discoverable, all to
|
||||||
|
the greatest extent permissible under applicable law.
|
||||||
|
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||||
|
that may apply to the Work or any use thereof, including without
|
||||||
|
limitation any person's Copyright and Related Rights in the Work.
|
||||||
|
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||||
|
consents, permissions or other rights required for any use of the
|
||||||
|
Work.
|
||||||
|
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||||
|
party to this document and has no duty or obligation with respect to
|
||||||
|
this CC0 or use of the Work.
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
**Base Policy Version:** 1.3
|
**Base Policy Version:** 1.3
|
||||||
|
|
||||||
**Last Updated**: 2026-09-28
|
**Last Updated**: 2026-11-17
|
||||||
|
|
||||||
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843/docs/policy/agents.md
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/agents.md
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
**Base Policy Version:** 1.3
|
**Base Policy Version:** 1.3
|
||||||
|
|
||||||
**Last Updated**: 2026-09-28
|
**Last Updated**: 2026-11-22
|
||||||
|
|
||||||
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843/docs/policy/architecture.md
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/architecture.md
|
||||||
|
|
||||||
## Purpose And Ownership
|
## Purpose And Ownership
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ their domains:
|
|||||||
- Notarius extracts validated structured artifact bundles; and
|
- Notarius extracts validated structured artifact bundles; and
|
||||||
- Scriptorium executes prompts and produces configured artifacts.
|
- Scriptorium executes prompts and produces configured artifacts.
|
||||||
|
|
||||||
Narratio owns orchestration, configuration resolution, session and run state,
|
Narratio owns orchestration, configuration interpretation, session and run state,
|
||||||
artifact and path modeling, manifest persistence, stage sequencing, resume,
|
artifact and path modeling, manifest persistence, stage sequencing, resume,
|
||||||
restore, cleanup gates, and publish semantics. External contracts are defined
|
restore, cleanup gates, and publish semantics. External contracts are defined
|
||||||
in the [integration documentation](../integrations/).
|
in the [integration documentation](../integrations/).
|
||||||
@@ -73,8 +73,8 @@ itself an architectural goal.
|
|||||||
|
|
||||||
## Ownership And Dependency Direction
|
## Ownership And Dependency Direction
|
||||||
|
|
||||||
The application boundary owns command dispatch, configuration selection,
|
The application boundary owns command composition, configuration selection,
|
||||||
production composition, session locking, and top-level lifecycle. It may depend
|
production composition, workspace locking, and top-level lifecycle. It may depend
|
||||||
on concrete implementations to assemble a run.
|
on concrete implementations to assemble a run.
|
||||||
|
|
||||||
Stage orchestration expresses intent in Narratio-level data and interfaces.
|
Stage orchestration expresses intent in Narratio-level data and interfaces.
|
||||||
@@ -115,18 +115,27 @@ Each stage has one explicit responsibility and declares:
|
|||||||
- failure behavior.
|
- failure behavior.
|
||||||
|
|
||||||
Stages write and validate run-local results before materializing canonical
|
Stages write and validate run-local results before materializing canonical
|
||||||
outputs where that distinction applies. A stage is complete only after its
|
outputs where that distinction applies. Executed work is complete after its
|
||||||
required outputs have been written, validated, and recorded in durable manifest
|
required outputs have been written, validated, and recorded in durable manifest
|
||||||
state. Later stages depend on recorded success and artifact resolution, not
|
state. Validated supplied products recorded in that state can also satisfy work
|
||||||
merely on incidental files existing on disk.
|
according to the application's fixed coverage rules. Consumers resolve actual
|
||||||
|
recorded products; completion does not imply that an absent intermediate file
|
||||||
|
exists.
|
||||||
|
|
||||||
A failed or interrupted stage must not be presented as successful. Failure
|
A failed or interrupted stage must not be presented as successful. Failure
|
||||||
should preserve enough local state and diagnostics for inspection, recovery,
|
should preserve enough local state and diagnostics for inspection, recovery,
|
||||||
and resume. Forcing a stage invalidates succeeded transitive dependents
|
and resume until a later authorized cleanup. Forcing a stage invalidates
|
||||||
|
succeeded transitive dependents
|
||||||
according to a fixed application-owned relation that is separate from canonical
|
according to a fixed application-owned relation that is separate from canonical
|
||||||
execution order. The relation is validated against the stage inventory and is
|
execution order. The relation is validated against the stage inventory and is
|
||||||
not configurable.
|
not configurable.
|
||||||
|
|
||||||
|
Downstream readiness is an invocation check after selected preparation and
|
||||||
|
before the selected processing work. It does not create a stage success.
|
||||||
|
Standalone preflight prepares or reuses session inputs and checks enabled
|
||||||
|
capabilities under the same workspace lock; its checks may probe destinations and
|
||||||
|
contact configured providers.
|
||||||
|
|
||||||
A stage may explicitly self-skip with a stable reason and no outputs. That
|
A stage may explicitly self-skip with a stable reason and no outputs. That
|
||||||
outcome is persisted, clears older outputs owned by the stage, and is
|
outcome is persisted, clears older outputs owned by the stage, and is
|
||||||
reconsidered on a later invocation. A stage may also validate whether an
|
reconsidered on a later invocation. A stage may also validate whether an
|
||||||
@@ -147,23 +156,30 @@ adapter and publish metadata.
|
|||||||
|
|
||||||
Resume and skip decisions are manifest-driven. Filesystem state may be
|
Resume and skip decisions are manifest-driven. Filesystem state may be
|
||||||
inspected and validated, but file presence alone does not replace recorded
|
inspected and validated, but file presence alone does not replace recorded
|
||||||
stage state. Each invocation retains an in-memory command summary and a
|
stage state or accepted supplied-product records. Each invocation retains an
|
||||||
run-local workspace identity, but neither is a durable progress ledger. The
|
in-memory command summary and a run-local workspace identity, but neither is a
|
||||||
|
durable progress ledger. The
|
||||||
physical run directory is created on demand only when an executing stage
|
physical run directory is created on demand only when an executing stage
|
||||||
requires it; a fully reused invocation or a cleanup-only invocation does not
|
requires it; a fully reused invocation or a cleanup-only invocation does not
|
||||||
leave an empty run directory.
|
leave an empty run directory.
|
||||||
|
|
||||||
Restore treats committed remote current state as its authority. It must plan
|
Restore treats the pointer-selected publication inventory as its authority. It
|
||||||
deterministically, confine remote-to-local paths, protect local conflicts, and
|
must plan deterministically, confine remote-to-local paths, protect local
|
||||||
install the validated session manifest after other restored durable files. The
|
conflicts, and save a merged local baseline after accepting restored products.
|
||||||
physical workflow and recovery procedures belong in
|
Valid supplied records represent actual local products and may satisfy the
|
||||||
|
fixed work they cover without asserting that their historical producers ran
|
||||||
|
locally. Imported products are independent of one another; publication does
|
||||||
|
not require common generation history. Local generation keeps its ordinary
|
||||||
|
checkpoint and freshness rules. Import alone must not record successful
|
||||||
|
publication, notification, or cleanup execution.
|
||||||
|
The physical workflow and recovery procedures belong in
|
||||||
[Operations](../operations.md).
|
[Operations](../operations.md).
|
||||||
|
|
||||||
Restore and runner transitions for one session use the same local lock. A
|
Restore and runner transitions for one session use the same local lock. A
|
||||||
durable incomplete-restore marker blocks runner reuse after a partial restore;
|
durable incomplete-restore marker blocks runner reuse after a partial restore;
|
||||||
safe retry, rather than rollback of arbitrary local effects, is the recovery
|
safe retry, rather than rollback of arbitrary local effects, is the recovery
|
||||||
mechanism. Restored manifest-local references must be confined to the selected
|
mechanism. Imported product paths must be confined to the selected local
|
||||||
local session root, never trusted as producer-machine absolute paths.
|
session root and derived from current source definitions, not producer paths.
|
||||||
|
|
||||||
For the immutable remote-commit protocol, a restore or status operation binds
|
For the immutable remote-commit protocol, a restore or status operation binds
|
||||||
to one pointer-selected commit and only its declared object identities. A force
|
to one pointer-selected commit and only its declared object identities. A force
|
||||||
@@ -172,21 +188,36 @@ or other non-regular conflict into a successful restore.
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Configuration is strict, explicit, centralized, and operator-oriented.
|
Configuration ownership follows
|
||||||
|
[ADR 0003](../adr/0003-assign-configuration-ownership.md):
|
||||||
|
|
||||||
|
- ConfigKit owns configuration policy and resolution through the final handoff.
|
||||||
|
Narratio supplies its schema, defaults, and configuration rules through
|
||||||
|
supported extension points. The completed ConfigKit result is authoritative.
|
||||||
|
- Narratio consumes that result without mutation and derives separate domain
|
||||||
|
objects. It must not construct a replacement effective configuration.
|
||||||
|
- CommandKit owns CLI mechanics and presentation; `ckconfig` exposes ConfigKit
|
||||||
|
inspection. Narratio supplies selection and acquisition wiring through native
|
||||||
|
adapters without changing upstream semantics or substituting inspection views.
|
||||||
|
|
||||||
|
Missing configuration or inspection capabilities are addressed upstream.
|
||||||
|
|
||||||
- YAML decoding rejects unknown fields.
|
- YAML decoding rejects unknown fields.
|
||||||
- Defaults are centralized and testable.
|
- Defaults are centralized and testable.
|
||||||
- Empty configured values do not silently replace meaningful defaults.
|
- Defaults apply only to absent fields. Explicit false, zero, empty, and null
|
||||||
|
values remain present and are evaluated by Narratio's domain rules.
|
||||||
- Validation rejects invalid configuration before stage execution where
|
- Validation rejects invalid configuration before stage execution where
|
||||||
practical.
|
practical.
|
||||||
- Root-owned imports and one selected overlay resolve deterministically through
|
- ConfigKit resolves local imports and the selected pipeline overlay. Shared
|
||||||
the configuration owner; commands do not implement their own merge rules.
|
campaign, party, and glossary documents permit schema extensions; Narratio
|
||||||
- Canonical party rosters are campaign-owned. Their derived players projection
|
operational settings remain strict, as selected in [ADR 0003](../adr/0003-assign-configuration-ownership.md).
|
||||||
and concrete character-family artifacts are resolved before runtime stages
|
- Canonical party rosters are campaign-owned inputs. Narratio derives players
|
||||||
or adapters receive configuration.
|
projections and concrete character-family artifacts as separate domain
|
||||||
|
objects before execution, without modifying configuration.
|
||||||
- Resume uses stage- or artifact-owned semantic evidence for observable
|
- Resume uses stage- or artifact-owned semantic evidence for observable
|
||||||
result-affecting configuration; overlay identity and an effective digest are
|
result-affecting configuration of locally generated work. Accepted supplied
|
||||||
provenance, never blanket cache keys.
|
products do not require historical generation evidence; overlay identity and
|
||||||
|
an effective digest are provenance, never blanket cache keys.
|
||||||
- Session templating remains narrow and deterministic rather than becoming a
|
- Session templating remains narrow and deterministic rather than becoming a
|
||||||
general configuration language.
|
general configuration language.
|
||||||
- Secret values are supplied indirectly and are not persisted in ordinary
|
- Secret values are supplied indirectly and are not persisted in ordinary
|
||||||
@@ -201,27 +232,26 @@ field-level contract and credential-supply mechanisms belong in
|
|||||||
## Artifacts, Paths, And Storage
|
## Artifacts, Paths, And Storage
|
||||||
|
|
||||||
Artifact identities and local and remote paths are application contracts.
|
Artifact identities and local and remote paths are application contracts.
|
||||||
Canonical helpers own workspace, spool, cache, session, run, input, transcript,
|
Canonical helpers own workspace, session, run, input, transcript,
|
||||||
artifact, log, report, configuration, and publish-current paths. Callers must
|
artifact, log, report, configuration, and publish-current paths. Callers must
|
||||||
not reconstruct canonical paths through scattered string concatenation.
|
not reconstruct canonical paths through scattered string concatenation.
|
||||||
|
|
||||||
Reusable audio cache entries require a typed record that binds a confined,
|
Prepared audio reuse requires manifest-backed identity and checksum evidence.
|
||||||
no-follow regular file and its digest to the selected remote object identity.
|
Subprocess applications own their own state and caches, separately configured
|
||||||
Size alone and unqualified multipart ETags are not content-integrity evidence.
|
and outside Narratio cleanup. See [ADR 0001](../adr/0001-classify-session-content.md)
|
||||||
|
and [ADR 0002](../adr/0002-assign-subprocess-content-ownership.md).
|
||||||
|
|
||||||
Artifact resolution is deterministic and manifest-aware. Producers materialize
|
Artifact resolution is deterministic and manifest-aware. Producers materialize
|
||||||
canonical outputs before reporting success, and consumers resolve declared
|
canonical outputs before reporting success, and consumers resolve declared
|
||||||
artifact identities rather than infer files from unrelated directory contents.
|
artifact identities rather than infer files from unrelated directory contents.
|
||||||
External artifact bundles become current only through validated immutable
|
Configured products become current through validated promotion or accepted
|
||||||
promotion and manifest records; directory presence alone never establishes
|
supplied-product records; directory presence alone never establishes availability.
|
||||||
availability.
|
|
||||||
|
|
||||||
Writes, moves, replacements, and deletions must use narrow, explicit,
|
Writes, moves, replacements, and deletions must use narrow, explicit,
|
||||||
root-confined destinations. Symlinks, traversal, broad roots, and ambiguous
|
root-confined destinations. Symlinks, traversal, broad roots, and ambiguous
|
||||||
relative destinations must not expand the scope of an operation. Cleanup is
|
relative destinations must not expand the scope of an operation. Cleanup is
|
||||||
permitted only through explicit operator action or the configured final cleanup
|
permitted only through explicit operator action or the configured final cleanup
|
||||||
stage, and it must preserve durable cache unless cache removal is explicitly
|
stage, and must preserve subprocess-owned state and caches.
|
||||||
requested.
|
|
||||||
|
|
||||||
Physical layout, retention, and operational lifecycle belong in
|
Physical layout, retention, and operational lifecycle belong in
|
||||||
[Operations](../operations.md). Logical external formats and durable integration
|
[Operations](../operations.md). Logical external formats and durable integration
|
||||||
@@ -232,6 +262,8 @@ contracts belong under [Integrations](../integrations/).
|
|||||||
Publish has one explicit remote commit boundary. A remote run becomes current
|
Publish has one explicit remote commit boundary. A remote run becomes current
|
||||||
only after Narratio has successfully uploaded its immutable run-scoped objects,
|
only after Narratio has successfully uploaded its immutable run-scoped objects,
|
||||||
the immutable commit manifest, and finally the current commit pointer.
|
the immutable commit manifest, and finally the current commit pointer.
|
||||||
|
Destination planning precedes sequential source verification and transfer;
|
||||||
|
failed attempts may leave immutable objects that are not selected as current.
|
||||||
|
|
||||||
`current/commit-pointer.json` is the sole mutable selector and must be written
|
`current/commit-pointer.json` is the sole mutable selector and must be written
|
||||||
exactly once, last. Failed, incomplete, skipped, or uncommitted publish attempts
|
exactly once, last. Failed, incomplete, skipped, or uncommitted publish attempts
|
||||||
@@ -246,14 +278,14 @@ transaction boundary.
|
|||||||
|
|
||||||
Automatic local cleanup is permitted only after a successful publish commit,
|
Automatic local cleanup is permitted only after a successful publish commit,
|
||||||
only when explicitly configured, and only through the path-safety guardrails.
|
only when explicitly configured, and only through the path-safety guardrails.
|
||||||
It is the final ordinary pipeline stage after `notify`. The stage derives its
|
It is the final ordinary pipeline stage after `notify`. The stage derives the
|
||||||
exact run-scoped targets from validated publish metadata and the configured
|
selected session's run-history target from validated publish metadata and the
|
||||||
campaign/session identity; it never infers a target from directory contents or
|
configured campaign/session identity; it never infers a target from directory contents or
|
||||||
rereads remote storage. A cleanup failure makes the invocation incomplete while
|
rereads remote storage. A cleanup failure makes the invocation incomplete while
|
||||||
leaving publish succeeded and the committed remote snapshot authoritative. A
|
leaving publish succeeded and the committed remote snapshot authoritative. A
|
||||||
normal later full run reuses valid upstream stages and retries cleanup.
|
normal later full run reuses valid upstream stages and retries cleanup.
|
||||||
|
|
||||||
The standalone `publish` command selects only publish and therefore never
|
`run SESSION --stage publish` selects only publish and therefore never
|
||||||
invokes cleanup. Operators may select cleanup directly only when the manifest
|
invokes cleanup. Operators may select cleanup directly only when the manifest
|
||||||
contains valid successful publication evidence.
|
contains valid successful publication evidence.
|
||||||
|
|
||||||
@@ -278,18 +310,18 @@ uses a separate restrictive contract.
|
|||||||
|
|
||||||
Raw secrets must not be stored in pipeline, campaign, or session YAML or written
|
Raw secrets must not be stored in pipeline, campaign, or session YAML or written
|
||||||
to manifests, logs, generated configuration, reports, publish metadata,
|
to manifests, logs, generated configuration, reports, publish metadata,
|
||||||
documentation, or examples. Pipeline configuration names environment variables;
|
documentation, or examples. Pipeline configuration names environment variables. Command-owned pipeline
|
||||||
command-owned startup may populate previously unset variables from ConfigKit's
|
acquisition explicitly prepares the selected source through ConfigKit's
|
||||||
explicit or conventional secrets directory. This bootstrap occurs once per
|
configured bootstrap before typed credential resolution and adapter construction.
|
||||||
invocation before any typed configuration load or adapter construction and is
|
Completed acquisitions are reused normally; ConfigKit's selected environment
|
||||||
not hidden inside library loaders. Safe bootstrap diagnostics may identify
|
policy governs each preparation. Library loading does not write the environment.
|
||||||
files and statuses but never values. Diagnostics should avoid transcript and
|
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.
|
prompt content unless a deliberate, bounded inspection mechanism requires it.
|
||||||
|
|
||||||
Logs, reports, generated invocation files, generated configuration, and render
|
Logs, reports, generated invocation files, generated configuration, and render
|
||||||
debug files are diagnostics, not canonical pipeline products. They should be
|
debug files are diagnostics, not canonical pipeline products. They remain
|
||||||
durable and discoverable where configured, and manifest references must preserve
|
discoverable until configured cleanup removes their run history. Manifest
|
||||||
the distinction between diagnostics and artifacts.
|
references must preserve the distinction between diagnostics and artifacts.
|
||||||
|
|
||||||
Documentation security rules belong in the
|
Documentation security rules belong in the
|
||||||
[Documentation Policy](documentation.md). Credential supply belongs in
|
[Documentation Policy](documentation.md). Credential supply belongs in
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
# Documentation Policy
|
# Documentation Policy
|
||||||
|
|
||||||
**Base Policy Version:** 1.11
|
**Base Policy Version:** 1.13
|
||||||
|
|
||||||
**Last Updated**: 2026-09-28
|
**Last Updated**: 2026-11-22
|
||||||
|
|
||||||
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843/docs/policy/documentation.md
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/5b9088601290564647a9e20c13f95c0da9f4cb15/docs/policy/documentation.md
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
This policy assigns each documentation topic to one canonical owner. Its goal is
|
This policy assigns each documentation topic to one canonical owner. Its goal is
|
||||||
to keep Narratio's documentation accurate, concise, discoverable, and resistant
|
to keep this application's documentation accurate, concise, discoverable, and resistant
|
||||||
to drift for users, operators, developers, integrators, and LLM coding agents.
|
to drift for users, operators, developers, integrators, and LLM coding agents.
|
||||||
|
|
||||||
## Core Rules
|
## Core Rules
|
||||||
@@ -75,19 +75,19 @@ secret values.
|
|||||||
| Release policy | `docs/policy/release.md` | Versioning, compatibility, release integrity and immutability, release documentation, proportionate gates, publication controls, completion, and required versus optional checks. | Repository-specific commands, product installation guidance, CLI version semantics, historical release summaries, and CI implementation detail. |
|
| Release policy | `docs/policy/release.md` | Versioning, compatibility, release integrity and immutability, release documentation, proportionate gates, publication controls, completion, and required versus optional checks. | Repository-specific commands, product installation guidance, CLI version semantics, historical release summaries, and CI implementation detail. |
|
||||||
| Open source licensing and attribution policy | `docs/policy/oss.md` | License defaults and author choices, COPYRIGHT and attribution formats, license/notice links, discoverability, maintenance, and concrete exceptions. | Component entries, license texts, release commands, and dependency security review. |
|
| Open source licensing and attribution policy | `docs/policy/oss.md` | License defaults and author choices, COPYRIGHT and attribution formats, license/notice links, discoverability, maintenance, and concrete exceptions. | Component entries, license texts, release commands, and dependency security review. |
|
||||||
| Project copyright and license grant | `COPYRIGHT` | Project identity, copyright holders and years, SPDX expression, grant, warranty disclaimer, and third-party statement. | Complete license texts and upstream component attribution. |
|
| Project copyright and license grant | `COPYRIGHT` | Project identity, copyright holders and years, SPDX expression, grant, warranty disclaimer, and third-party statement. | Complete license texts and upstream component attribution. |
|
||||||
| Project license text | `LICENSE` | Complete GPLv3 project license text. | Companion dependency license texts and upstream component attribution. |
|
| Project license texts | `LICENSE` | Complete project and incorporated companion license texts, with required project-specific fields. | General licensing policy and upstream component attribution. |
|
||||||
| Upstream component attribution | `docs/oss/attribution.md` | House Format component entries: identity, material scope and modifications where applicable, copyright, license, required notices, and license, notice, and source links. | General attribution policy, exception reasoning, research narratives, compliance commentary, and complete standard license texts. |
|
| Upstream component attribution | `docs/oss/attribution.md` | House Format component entries: identity, material scope and modifications where applicable, copyright, license, required notices, and license, notice, and source links. | General attribution policy, exception reasoning, research narratives, compliance commentary, and complete standard license texts. |
|
||||||
| Standard dependency license texts | `docs/oss/licenses/` | Complete, verbatim standard license texts shared by applicable entries. | Project-specific upstream notices, attribution prose, and policy interpretation. |
|
| Standard dependency license texts | `docs/oss/licenses/` | Complete, verbatim standard license texts shared by applicable entries. | Project-specific upstream notices, attribution prose, and policy interpretation. |
|
||||||
| Repository-specific release procedure | `docs/release.md` | Maintainer prerequisites, candidate preparation, validation and publication commands and automated guards, asynchronous deliverables, delivery status, optional consumer verification, and recovery. | General release requirements, product installation guidance, historical release summaries, and current compatibility contracts. |
|
| Repository-specific release procedure | `docs/release.md` | Maintainer prerequisites, candidate preparation, validation and publication commands and automated guards, asynchronous deliverables, delivery status, optional consumer verification, and recovery. | General release requirements, product installation guidance, historical release summaries, and current compatibility contracts. |
|
||||||
| CLI contract (if applicable) | `docs/cli.md` | Commands, arguments, flags, invocation semantics, and exit codes. | End-to-end operating procedures, configuration field definitions, runtime filesystem layout, module implementation details. |
|
| CLI contract (if applicable) | `docs/cli.md` | Commands, arguments, flags, invocation semantics, and exit codes. | End-to-end operating procedures, configuration field definitions, runtime filesystem layout, module implementation details. |
|
||||||
| Configuration contract (if applicable) | `docs/config.md` | Discovery, precedence, schema, fields, defaults, environment overrides, validation, and selectable module and validator keys. | Complete example files, CLI syntax, runtime state lifecycle, module implementation details. |
|
| Configuration contract (if applicable) | `docs/config.md` | Discovery, precedence, schema, fields, defaults, environment overrides, validation, and selectable module and validator keys. | Complete example files, CLI syntax, runtime state lifecycle, module implementation details. |
|
||||||
| Operations | `docs/operations.md` | Runtime workflows, physical filesystem and state layout, output, cache and debug handling, resume, cleanup, permissions, recovery, and limits. | CLI flag syntax, configuration field definitions, logical output schemas, implementation mechanics. |
|
| Operations (if applicable) | `docs/operations.md` | Runtime workflows, physical filesystem and state layout, output, cache and debug handling, resume, cleanup, permissions, recovery, and limits. | CLI flag syntax, configuration field definitions, logical output schemas, implementation mechanics. |
|
||||||
| Troubleshooting | `docs/troubleshooting.md` | Symptom-driven diagnosis, likely causes, safe inspection, and remedies. | Canonical commands, configuration definitions, operational procedures, and integration contracts. |
|
| Troubleshooting | `docs/troubleshooting.md` | Symptom-driven diagnosis, likely causes, safe inspection, and remedies. | Canonical commands, configuration definitions, operational procedures, and integration contracts. |
|
||||||
| Integration contracts for external components (if applicable) | `docs/integrations/` | External formats and protocols, upstream and downstream contracts, logical output paths and schemas, media types, and compatibility. | Physical runtime placement and lifecycle, internal transformations, CLI syntax, configuration defaults. |
|
| Integration contracts for external components (if applicable) | `docs/integrations/` | External formats and protocols, upstream and downstream contracts, logical output paths and schemas, media types, and compatibility. | Physical runtime placement and lifecycle, internal transformations, CLI syntax, configuration defaults. |
|
||||||
| Inventory of implemented internal packages | `docs/internal/overview.md` | Implemented packages and components, responsibilities, and links to focused internal docs. | Normative architecture, contributor reading policy, external contracts. |
|
| Inventory of implemented internal packages | `docs/internal/overview.md` | Implemented packages and components, responsibilities, and links to focused internal docs. | Normative architecture, contributor reading policy, external contracts. |
|
||||||
| Behavior and architecture of internal packages | Other files under `docs/internal/` | Implementation flow, collaborators, state transitions, package-local guarantees and failures, and relevant tests. | Global architecture invariants, configuration definitions and defaults, external schemas, operator procedures. |
|
| Behavior and architecture of internal packages | Other files under `docs/internal/` | Implementation flow, collaborators, state transitions, package-local guarantees and failures, and relevant tests. | Global architecture invariants, configuration definitions and defaults, external schemas, operator procedures. |
|
||||||
| Architectural decision records | `docs/adr/` | Significant decisions, context, alternatives, rationale, consequences, and supersession history. | Current behavior reference, implementation status, task sequencing. |
|
| Architectural decision records | `docs/adr/` | Records of significant architectural decisions and supporting rationale. | Ordinary design choices, current behavior reference, implementation status, task sequencing. |
|
||||||
| Future work and implementation status | `docs/roadmap/` | Proposed, accepted, deferred, or rejected work; implementation status, sequencing, and task breakdowns. | Implemented behavior reference and architectural decision rationale. |
|
| Future work and implementation status | `docs/roadmap/` | Proposed, accepted, or future work; implementation status, sequencing, and task breakdowns. | Implemented behavior reference and architectural decision rationale. |
|
||||||
| Release-note history | `docs/releases/` | One checked-in summary per source release under the procedure; the note at its immutable tag is the release record. | Current commands, behavior, contracts, and compatibility definitions. |
|
| Release-note history | `docs/releases/` | One checked-in summary per source release under the procedure; the note at its immutable tag is the release record. | Current commands, behavior, contracts, and compatibility definitions. |
|
||||||
| Complete copyable artifacts | `examples/` | Maintained configuration, inputs, and other copyable or runnable files. | Field-by-field reference, command reference, prose explanation. |
|
| Complete copyable artifacts | `examples/` | Maintained configuration, inputs, and other copyable or runnable files. | Field-by-field reference, command reference, prose explanation. |
|
||||||
|
|
||||||
@@ -131,6 +131,15 @@ semantics. Internal documents explain how this application implements or consume
|
|||||||
contracts. Internal docs may name a field, file, or protocol to identify a
|
contracts. Internal docs may name a field, file, or protocol to identify a
|
||||||
dependency, but must link to its canonical contract for the definition.
|
dependency, but must link to its canonical contract for the definition.
|
||||||
|
|
||||||
|
### Upstream Dependencies
|
||||||
|
|
||||||
|
When documenting an upstream dependency, identify the library and link to its
|
||||||
|
canonical documentation for its features and behavior. Maintain local
|
||||||
|
documentation for application-specific integration, configuration, and
|
||||||
|
adaptations. Brief summaries may orient readers; upstream documentation remains
|
||||||
|
the canonical reference for upstream behavior. Where behavior differs by
|
||||||
|
version, link to documentation applicable to the imported version.
|
||||||
|
|
||||||
### Security Topics
|
### Security Topics
|
||||||
|
|
||||||
This policy owns what documentation and examples may contain. Architecture owns
|
This policy owns what documentation and examples may contain. Architecture owns
|
||||||
@@ -153,8 +162,15 @@ Use sequentially numbered ADR filenames such as
|
|||||||
|
|
||||||
Treat the decision content of an accepted ADR as immutable. When a decision
|
Treat the decision content of an accepted ADR as immutable. When a decision
|
||||||
changes, create a new ADR and update the earlier ADR's status to superseded.
|
changes, create a new ADR and update the earlier ADR's status to superseded.
|
||||||
Rejected architectural alternatives belong in the ADR; rejected product ideas
|
|
||||||
belong in the roadmap.
|
ADRs should be reserved for major architectural decisions, such as ownership
|
||||||
|
boundaries, large-scale architectural features, or invariants that rise to
|
||||||
|
the level of architectural significance. Routine choices, implementation
|
||||||
|
decisions, and rejected suggestions do not warrant an ADR unless they
|
||||||
|
otherwise represent a significant architectural decision.
|
||||||
|
|
||||||
|
Roadmaps should preserve plausible future work, not rejected product
|
||||||
|
ideas.
|
||||||
|
|
||||||
## Maintenance
|
## Maintenance
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
**Base Policy Version:** 1.0
|
**Base Policy Version:** 1.0
|
||||||
|
|
||||||
**Last Updated**: 2026-09-28
|
**Last Updated**: 2026-11-17
|
||||||
|
|
||||||
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843/docs/policy/meta.md
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/meta.md
|
||||||
|
|
||||||
## Origin And Local Authority
|
## Origin And Local Authority
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# Open Source Licensing And Attribution Policy
|
# Open Source Licensing And Attribution Policy
|
||||||
|
|
||||||
**Base Policy Version:** 1.8
|
**Base Policy Version:** 1.9
|
||||||
|
|
||||||
**Last Updated**: 2026-09-28
|
**Last Updated**: 2026-11-17
|
||||||
|
|
||||||
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843/docs/policy/oss.md
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/oss.md
|
||||||
|
|
||||||
## Purpose And Scope
|
## Purpose And Scope
|
||||||
|
|
||||||
@@ -74,6 +74,9 @@ individual packages.
|
|||||||
Use the upstream [application COPYRIGHT example](https://gitea.maximumdirect.net/eric/policy/src/commit/a469273adda336625f96b9d769ea27b33999f146/examples/licensing/application/COPYRIGHT)
|
Use the upstream [application COPYRIGHT example](https://gitea.maximumdirect.net/eric/policy/src/commit/a469273adda336625f96b9d769ea27b33999f146/examples/licensing/application/COPYRIGHT)
|
||||||
or [library COPYRIGHT example](https://gitea.maximumdirect.net/eric/policy/src/commit/a469273adda336625f96b9d769ea27b33999f146/examples/licensing/library/COPYRIGHT)
|
or [library COPYRIGHT example](https://gitea.maximumdirect.net/eric/policy/src/commit/a469273adda336625f96b9d769ea27b33999f146/examples/licensing/library/COPYRIGHT)
|
||||||
to create the project’s root `COPYRIGHT` file.
|
to create the project’s root `COPYRIGHT` file.
|
||||||
|
Use the COPYRIGHT examples exactly as provided, except for placeholder
|
||||||
|
substitutions and changes expressly required or authorized by this policy or
|
||||||
|
the author.
|
||||||
Use verified project names, contribution years, and copyright holders.
|
Use verified project names, contribution years, and copyright holders.
|
||||||
For another selected license, adapt the grant, SPDX expression, disclaimer, and
|
For another selected license, adapt the grant, SPDX expression, disclaimer, and
|
||||||
text references together to reflect the author's selected grant.
|
text references together to reflect the author's selected grant.
|
||||||
@@ -169,10 +172,15 @@ source files; the central attribution entry does not authorize stripping them.
|
|||||||
|
|
||||||
## Discoverability
|
## Discoverability
|
||||||
|
|
||||||
End Narratio's README with two friendly statements linking to its actual grant
|
End the project's README with two friendly statements linking to its actual
|
||||||
in root `COPYRIGHT` and to `docs/oss/attribution.md`, using paths relative to
|
grant in `COPYRIGHT` and the attribution document. For example, for a project
|
||||||
the README. The statements identify Narratio's GPL v3.0-or-later grant and make
|
with the stated license:
|
||||||
the open source attribution notices discoverable.
|
|
||||||
|
```markdown
|
||||||
|
PROJECT_NAME is licensed under the [LGPL v3.0 or later](COPYRIGHT).
|
||||||
|
|
||||||
|
[Open Source attribution notices](docs/oss/attribution.md) are available.
|
||||||
|
```
|
||||||
|
|
||||||
Each new checked-in release document and its hosted download page must end
|
Each new checked-in release document and its hosted download page must end
|
||||||
with links whose visible text is `COPYRIGHT | LICENSE | ATTRIBUTION`. Use absolute
|
with links whose visible text is `COPYRIGHT | LICENSE | ATTRIBUTION`. Use absolute
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# Release Policy
|
# Release Policy
|
||||||
|
|
||||||
**Base Policy Version:** 1.4
|
**Base Policy Version:** 1.7
|
||||||
|
|
||||||
**Last Updated**: 2026-09-28
|
**Last Updated**: 2026-11-23
|
||||||
|
|
||||||
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843/docs/policy/release.md
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/release.md
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
@@ -12,6 +12,9 @@ This policy defines a proportionate workflow for validating and publishing an
|
|||||||
intended source revision under a fresh version. Releases should require little
|
intended source revision under a fresh version. Releases should require little
|
||||||
routine intervention, avoid repeated work, and preserve published contents.
|
routine intervention, avoid repeated work, and preserve published contents.
|
||||||
|
|
||||||
|
Adopt stronger verification or reproducibility requirements through an explicit
|
||||||
|
project-specific decision justified by the intended audience and support needs.
|
||||||
|
|
||||||
The repository-specific commands belong in `docs/release.md`. Historical release
|
The repository-specific commands belong in `docs/release.md`. Historical release
|
||||||
summaries belong in `docs/releases/`. The procedure must agree with the adopted
|
summaries belong in `docs/releases/`. The procedure must agree with the adopted
|
||||||
policy and link to it rather than introduce additional release requirements.
|
policy and link to it rather than introduce additional release requirements.
|
||||||
@@ -59,9 +62,14 @@ requires a deliberate update to the policy and procedure where needed.
|
|||||||
For releases at or after `v1.0.0`:
|
For releases at or after `v1.0.0`:
|
||||||
|
|
||||||
- a major release may make intentional incompatible changes;
|
- a major release may make intentional incompatible changes;
|
||||||
- a minor release may add backward-compatible behavior; and
|
- a minor release may add backward-compatible behavior or raise the Go consumer
|
||||||
|
minimum as described below; and
|
||||||
- a patch release may make backward-compatible fixes.
|
- a patch release may make backward-compatible fixes.
|
||||||
|
|
||||||
|
In this context, "backward-compatible" means only that pre-existing, valid
|
||||||
|
configurations will continue to work following the release. Behavior need not
|
||||||
|
remain strictly identical.
|
||||||
|
|
||||||
Before `v1.0.0`, a minor release may change a documented public, operational,
|
Before `v1.0.0`, a minor release may change a documented public, operational,
|
||||||
configuration, data, integration, or compatibility contract when the release
|
configuration, data, integration, or compatibility contract when the release
|
||||||
note explains the impact and required consumer action. A patch release must
|
note explains the impact and required consumer action. A patch release must
|
||||||
@@ -71,6 +79,36 @@ Additional compatibility promises and deliberate exceptions belong in the
|
|||||||
adopted policy or canonical contract documentation. Release notes explain
|
adopted policy or canonical contract documentation. Release notes explain
|
||||||
changes; they do not redefine current compatibility contracts.
|
changes; they do not redefine current compatibility contracts.
|
||||||
|
|
||||||
|
## Consumer Minimum And Release Toolchain
|
||||||
|
|
||||||
|
Distinguish the minimum toolchain supported for consumers from the toolchain
|
||||||
|
maintainers use to build and validate a release. Record the consumer minimum in
|
||||||
|
the language's standard metadata and explain its support meaning in canonical
|
||||||
|
documentation. Define the selected release toolchain and its setup commands in
|
||||||
|
`docs/release.md`. Toolchain selection and upgrade cadence are repository-specific
|
||||||
|
choices.
|
||||||
|
|
||||||
|
For Go repositories, normally declare the initial stable release of the selected
|
||||||
|
series as the consumer minimum, such as `go 1.26.0`. Use a higher patch minimum
|
||||||
|
when a dependency or an identified correctness fix requires it, and document
|
||||||
|
the reason.
|
||||||
|
|
||||||
|
For release-policy purposes, successful build and release validation on the
|
||||||
|
selected Go patch release are sufficient to presume support across that Go
|
||||||
|
series, subject to the declared consumer minimum and concrete evidence of
|
||||||
|
incompatibility. Investigate specific compatibility concerns as they arise.
|
||||||
|
|
||||||
|
Use the selected release toolchain for candidate validation and release builds,
|
||||||
|
including CI jobs performing those tasks. A newer validation patch version alone
|
||||||
|
leaves the consumer minimum unchanged.
|
||||||
|
|
||||||
|
A minor release may raise the Go consumer minimum, including from one Go series
|
||||||
|
to the next, both before and after `v1.0.0`. This is an explicit exception to the
|
||||||
|
backward-compatibility requirement for minor releases. Patch releases preserve
|
||||||
|
the consumer minimum. Explain an increase's impact and required consumer action
|
||||||
|
in the release note. Other incompatible changes remain subject to the versioning
|
||||||
|
rules above.
|
||||||
|
|
||||||
## Release Documentation And Preparation
|
## Release Documentation And Preparation
|
||||||
|
|
||||||
Every new release must include `docs/releases/<version>.md` in the tagged
|
Every new release must include `docs/releases/<version>.md` in the tagged
|
||||||
@@ -136,23 +174,12 @@ Do not add routine confirmations for checks the command can perform itself.
|
|||||||
|
|
||||||
## Narratio Candidate Checks
|
## Narratio Candidate Checks
|
||||||
|
|
||||||
Narratio's candidate checker adds the following checks to the one full,
|
Narratio selects one race-enabled offline suite, full `go vet`, Go formatting,
|
||||||
race-enabled offline suite:
|
and local module-replacement checks through ReleaseKit. The selected builds
|
||||||
|
verify Linux amd64, Linux arm64, and best-effort macOS arm64 binaries and the
|
||||||
- `go mod tidy -diff` detects an incomplete checked-in module graph without
|
embedded version on a host executable. Versioned module replacements remain
|
||||||
changing source.
|
allowed; filesystem replacements are not release inputs. Workspace and vendor
|
||||||
- Tracked Go formatting and diff whitespace checks catch inexpensive source
|
files are not prohibited solely by their presence.
|
||||||
hygiene defects before publication.
|
|
||||||
- Race instrumentation adds distinct coverage for concurrent I/O,
|
|
||||||
cancellation, and shared state.
|
|
||||||
- `go vet ./...` detects static issues not established by runtime tests.
|
|
||||||
- The asset builder verifies the declared Linux amd64, Linux arm64, and
|
|
||||||
best-effort macOS arm64 binaries and checks the embedded version on the host.
|
|
||||||
|
|
||||||
The checker uses `GOWORK=off` and readonly module mode for tests, vet, and
|
|
||||||
builds. Versioned module replacements are allowed; filesystem replacements
|
|
||||||
are not release inputs. Workspace and vendor files are not prohibited solely
|
|
||||||
by their presence.
|
|
||||||
|
|
||||||
## Publication Guards
|
## Publication Guards
|
||||||
|
|
||||||
@@ -206,7 +233,8 @@ release without replacing its contents or reusing its version.
|
|||||||
Maintain `docs/release.md` as a short, executable maintainer runbook. It must
|
Maintain `docs/release.md` as a short, executable maintainer runbook. It must
|
||||||
identify:
|
identify:
|
||||||
|
|
||||||
1. prerequisites, primary branch, and authoritative remote;
|
1. prerequisites, selected release toolchain, primary branch, and authoritative
|
||||||
|
remote;
|
||||||
2. version and release-note preparation;
|
2. version and release-note preparation;
|
||||||
3. one publication command with its selected local checks and automated guards;
|
3. one publication command with its selected local checks and automated guards;
|
||||||
4. declared deliverables, required build targets, and automation responsibilities;
|
4. declared deliverables, required build targets, and automation responsibilities;
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
**Base Policy Version:** 1.3
|
**Base Policy Version:** 1.3
|
||||||
|
|
||||||
**Last Updated**: 2026-09-28
|
**Last Updated**: 2026-11-17
|
||||||
|
|
||||||
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/d84a38ebab26f048cafbe59a2246700c35d29843/docs/policy/testing.md
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/testing.md
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
|
|||||||
163
docs/release.md
163
docs/release.md
@@ -1,114 +1,97 @@
|
|||||||
# Releasing Narratio
|
# Releasing Narratio
|
||||||
|
|
||||||
This is the maintainer runbook for the [Release Policy](policy/release.md).
|
This is the maintainer runbook for the [release policy](policy/release.md).
|
||||||
The source release completes when the intended tag is successfully pushed to
|
The authoritative source destination is `origin` at
|
||||||
`origin`; binary delivery is a separate asynchronous status.
|
`ssh://git@forge.maximumdirect.net:22222/eric/narratio.git`; use `main`.
|
||||||
|
The hosted destination is [Narratio on Gitea](https://forge.maximumdirect.net/eric/narratio).
|
||||||
|
Install Git, a POSIX shell, and the native compiler and tools needed for Go race
|
||||||
|
builds. Git access must permit fetching and pushing tags.
|
||||||
|
|
||||||
## Prepare the candidate
|
## Release toolchain
|
||||||
|
|
||||||
Use `main` and the authoritative Git remote `origin`. Install Git, a POSIX
|
Use the official Go 1.27.4 toolchain for validation and builds. The consumer
|
||||||
shell, standard Unix build tools, and Go 1.26. Have the selected Go modules
|
minimum remains Go 1.27.0. Prepare the selected toolchain, application modules,
|
||||||
available before offline validation. Git access must permit fetch and tag push.
|
and the module-selected ReleaseKit tool before offline validation:
|
||||||
Application-provider credentials are not required; Gitea delivery credentials
|
|
||||||
belong to CI.
|
|
||||||
|
|
||||||
Choose an unused stable `vMAJOR.MINOR.PATCH` under the
|
```sh
|
||||||
[compatibility rules](policy/release.md#versioning-and-compatibility). Narratio
|
export GOTOOLCHAIN=go1.27.4
|
||||||
is past v1.0.0, so intentional CLI or configuration breaks require a major
|
go version
|
||||||
release. Update affected canonical documentation with the change. Write the
|
go mod download
|
||||||
matching `docs/releases/vMAJOR.MINOR.PATCH.md` with a short summary and any
|
./releasekit version
|
||||||
relevant compatibility impact or upgrade action; choose sections to suit the
|
```
|
||||||
release.
|
|
||||||
|
|
||||||
End that checked-in note with these three links, replacing the version in
|
The launcher runs the ReleaseKit version selected in `go.mod`. The CI image
|
||||||
each URL with the intended tag. The tag need not exist remotely yet. Check that
|
uses the same Go patch. See [upstream adoption guidance](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/adoption.md).
|
||||||
`COPYRIGHT`, `LICENSE`, and `docs/oss/attribution.md` are present in the
|
|
||||||
candidate. The tag CI reuses the checked-in note as the hosted release body.
|
## Prepare and publish
|
||||||
|
|
||||||
|
Choose an unused stable version under the [versioning and compatibility
|
||||||
|
rules](policy/release.md#versioning-and-compatibility). Update affected current
|
||||||
|
documentation and prepare `docs/releases/vMAJOR.MINOR.PATCH.md` with a title
|
||||||
|
containing Narratio and the version, a summary, and any compatibility impact
|
||||||
|
or upgrade instructions. End the note with this footer, replacing the version
|
||||||
|
in each URL with the intended tag:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
[COPYRIGHT](https://gitea.maximumdirect.net/eric/narratio/src/tag/vMAJOR.MINOR.PATCH/COPYRIGHT) | [LICENSE](https://gitea.maximumdirect.net/eric/narratio/src/tag/vMAJOR.MINOR.PATCH/LICENSE) | [ATTRIBUTION](https://gitea.maximumdirect.net/eric/narratio/src/tag/vMAJOR.MINOR.PATCH/docs/oss/attribution.md)
|
[COPYRIGHT](https://forge.maximumdirect.net/eric/narratio/src/tag/vMAJOR.MINOR.PATCH/COPYRIGHT) | [LICENSE](https://forge.maximumdirect.net/eric/narratio/src/tag/vMAJOR.MINOR.PATCH/LICENSE) | [ATTRIBUTION](https://forge.maximumdirect.net/eric/narratio/src/tag/vMAJOR.MINOR.PATCH/docs/oss/attribution.md)
|
||||||
```
|
```
|
||||||
|
|
||||||
Retire completed roadmaps included in the release while preserving planned or
|
For the next release note, describe the cleanup retention change: when automatic
|
||||||
deferred work and repairing affected links. Review the change through the
|
cleanup is enabled and authorized, it removes the selected session's entire run
|
||||||
ordinary development workflow for unintended files, credentials, private data,
|
history, including failed-attempt diagnostics and original Notarius bundles.
|
||||||
and documentation accuracy. Commit and push the candidate to `origin/main`
|
Operators can retain that material by setting `workspace.cleanup_after_publish`
|
||||||
before tagging; record its exact commit if needed:
|
to `false`.
|
||||||
|
|
||||||
|
Also document the replacement of `session validate` with `preflight SESSION`,
|
||||||
|
which prepares or reuses inputs before checking readiness. See the
|
||||||
|
[preflight command](cli.md#preflight).
|
||||||
|
|
||||||
|
Retire completed roadmaps as appropriate, preserve pending work, and review the
|
||||||
|
candidate through the ordinary development workflow. Commit the candidate and
|
||||||
|
push it to `origin/main`, then publish from the clean `main` checkout:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git rev-parse HEAD
|
git add <candidate-files>
|
||||||
|
git commit -m "Prepare Narratio release"
|
||||||
|
git push origin main
|
||||||
|
./releasekit publish vMAJOR.MINOR.PATCH
|
||||||
```
|
```
|
||||||
|
|
||||||
## Publish
|
ReleaseKit validates the committed candidate with the selected race-enabled
|
||||||
|
suite, full vet, Go formatting and local-replacement checks, and builds the
|
||||||
|
three selected binaries with an injected-version smoke check. It creates an
|
||||||
|
annotated tag and pushes it. Confirmed source-tag publication completes the
|
||||||
|
release; CI and hosted delivery are separate observations. For optional
|
||||||
|
diagnosis, use `./releasekit check vMAJOR.MINOR.PATCH`; publication runs its
|
||||||
|
own validation, so this is not a prerequisite. See the upstream
|
||||||
|
[check](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/check.md)
|
||||||
|
and [publish](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/publish.md)
|
||||||
|
guides for native behavior and diagnostics.
|
||||||
|
|
||||||
From a clean `main` checkout at the pushed candidate, run one command:
|
## Delivery and recovery
|
||||||
|
|
||||||
```sh
|
Tag-triggered Woodpecker CI uses the tagged module's ReleaseKit selection to
|
||||||
scripts/release.sh vMAJOR.MINOR.PATCH
|
build and deliver the checked-in note and these assets asynchronously:
|
||||||
```
|
|
||||||
|
|
||||||
It fetches `origin/main` and tags; requires local `HEAD` to equal
|
|
||||||
`origin/main`; checks the committed note and unused version; runs the
|
|
||||||
candidate checker **once**; then repeats cheap mutable-state guards before
|
|
||||||
creating an unsigned lightweight tag at the recorded commit. It verifies the
|
|
||||||
tag target and pushes only
|
|
||||||
`refs/tags/vMAJOR.MINOR.PATCH:refs/tags/vMAJOR.MINOR.PATCH`. It does not
|
|
||||||
commit, push `main`, force updates, or publish all tags.
|
|
||||||
|
|
||||||
The checker runs `go mod tidy -diff`, tracked Go formatting and diff whitespace
|
|
||||||
checks, one `go test -mod=readonly -race -count=1 ./...` full suite, and
|
|
||||||
`go vet -mod=readonly ./...`. Its asset builder cross-builds Linux amd64,
|
|
||||||
Linux arm64, and best-effort macOS arm64, then checks the embedded version
|
|
||||||
on a host binary. The macOS cross-build proves compilation, not native
|
|
||||||
runtime behavior. Owned Go commands run with `GOWORK=off`; tests, vet, and
|
|
||||||
builds use readonly module mode. The deterministic suite includes documentation
|
|
||||||
and maintained-example checks. The command does not contact application
|
|
||||||
services or Gitea and does not wait for CI.
|
|
||||||
|
|
||||||
A successful tag push is the source-release completion point. The command
|
|
||||||
prints the tag and commit and exits without a separate network read-back.
|
|
||||||
For optional diagnosis before publication, run
|
|
||||||
`scripts/check-release-candidate.sh vMAJOR.MINOR.PATCH`; publication will
|
|
||||||
validate the candidate again, so this is not a required preparation step.
|
|
||||||
|
|
||||||
## Artifact delivery
|
|
||||||
|
|
||||||
Tag-triggered `.woodpecker/release.yml` independently validates the tagged
|
|
||||||
source, builds the same three targets, and publishes these Gitea downloads:
|
|
||||||
|
|
||||||
- `narratio-vMAJOR.MINOR.PATCH-linux-amd64`
|
- `narratio-vMAJOR.MINOR.PATCH-linux-amd64`
|
||||||
- `narratio-vMAJOR.MINOR.PATCH-linux-arm64`
|
- `narratio-vMAJOR.MINOR.PATCH-linux-arm64`
|
||||||
- `narratio-vMAJOR.MINOR.PATCH-darwin-arm64` (best effort)
|
- `narratio-vMAJOR.MINOR.PATCH-darwin-arm64` (best effort)
|
||||||
- `SHA256SUMS`
|
- `SHA256SUMS`
|
||||||
|
|
||||||
The builder embeds the tag version and checks host `version` output. CI
|
A cross-build establishes compilation, not native macOS runtime coverage.
|
||||||
generates checksums and uses non-overwriting publication settings. It does
|
CI maps its existing `GITEA_RELEASE_TOKEN` secret to
|
||||||
not select versions, change the source, or move tags. No image or package
|
`RELEASEKIT_GITEA_TOKEN`. Delivery does not determine source-release completion.
|
||||||
registry output is declared. Tag publication is not proof that these
|
|
||||||
asynchronous downloads are available.
|
|
||||||
|
|
||||||
## Failure and recovery
|
Local delivery uses the ignored `.releasekit/gitea-token` file when the configured
|
||||||
|
environment token is absent. Keep the token file owner-readable only; see the
|
||||||
|
[upstream credential configuration](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/config.md)
|
||||||
|
for credential selection.
|
||||||
|
|
||||||
If validation fails before tagging, correct and commit the candidate, push
|
If publication is uncertain, use the recovery entry point printed by ReleaseKit
|
||||||
it to `main`, and rerun the publication command. If the tag push reports
|
and its saved private publication record to reconcile the outcome before
|
||||||
failure, its outcome may be ambiguous: keep the local tag and inspect the
|
retrying. Follow the [publication recovery guide](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/publish.md#retain-and-reconcile-publication-evidence).
|
||||||
exact `refs/tags/vMAJOR.MINOR.PATCH` at `origin` before declaring success
|
For failed or partial delivery, retry from the same immutable tag using the
|
||||||
or retrying. A reachable matching remote tag at the recorded commit establishes
|
[delivery guide](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/delivery.md).
|
||||||
publication; a confirmed absent tag permits investigation of the transport
|
Investigate conflicts or uncertain outcomes according to that guide; do not
|
||||||
failure. If `origin` cannot be inspected, publication status is unknown.
|
replace published content. For older tags, use the tooling and workflow selected
|
||||||
Do not move, overwrite, or automatically retry the tag. Remove a local tag
|
by those tags.
|
||||||
only after confirming it was never published or used by a release channel.
|
|
||||||
|
|
||||||
A transient CI or delivery failure can be retried from the same immutable
|
|
||||||
tag. Missing assets may be added later if they match the tagged source and
|
|
||||||
any published checksum manifest; do not overwrite existing binaries,
|
|
||||||
checksums, or release-note contents. A source/content defect, or delivery
|
|
||||||
that cannot be corrected without replacement, requires a new suitable
|
|
||||||
version and matching note. Leave the original release intact.
|
|
||||||
|
|
||||||
Optional consumer inspection may compare the tag's remote commit with the
|
|
||||||
recorded candidate, check the Woodpecker delivery job and hosted Gitea note,
|
|
||||||
download the assets into an empty directory, run `sha256sum --check
|
|
||||||
SHA256SUMS` (or `shasum -a 256 --check SHA256SUMS` on macOS), and run
|
|
||||||
the matching host binary's `version` command. This is separate delivery
|
|
||||||
observation, never a source-release gate.
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ See the [release procedure](../release.md) for creating a candidate and tag.
|
|||||||
When asynchronous publication succeeds, the corresponding Gitea release is the
|
When asynchronous publication succeeds, the corresponding Gitea release is the
|
||||||
canonical source for downloadable binaries and checksums.
|
canonical source for downloadable binaries and checksums.
|
||||||
|
|
||||||
|
- [v4.0.0](v4.0.0.md)
|
||||||
|
- [v3.1.0](v3.1.0.md)
|
||||||
- [v3.0.0](v3.0.0.md)
|
- [v3.0.0](v3.0.0.md)
|
||||||
- [v2.2.1](v2.2.1.md)
|
- [v2.2.1](v2.2.1.md)
|
||||||
- [v2.2.0](v2.2.0.md)
|
- [v2.2.0](v2.2.0.md)
|
||||||
|
|||||||
40
docs/releases/v3.1.0.md
Normal file
40
docs/releases/v3.1.0.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Narratio v3.1.0
|
||||||
|
|
||||||
|
This minor release adds explicit provider-credential forwarding to Scriptorium
|
||||||
|
for trim bounds generation and artifact analysis.
|
||||||
|
|
||||||
|
## Compatibility and upgrade
|
||||||
|
|
||||||
|
Existing pipelines remain valid. An omitted, null, or empty
|
||||||
|
`pipeline.scriptorium.credentials` list continues to forward no provider keys.
|
||||||
|
When Scriptorium needs a credential, provision its environment variable through
|
||||||
|
Narratio's existing environment or secrets-directory mechanism and list the
|
||||||
|
exact name in the pipeline, for example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
scriptorium:
|
||||||
|
credentials: [OPENROUTER_API_KEY]
|
||||||
|
```
|
||||||
|
|
||||||
|
Selected references must resolve to nonempty values when Narratio loads the
|
||||||
|
pipeline, even if the current command will not run Scriptorium. A Narratio
|
||||||
|
overlay replaces the complete list, and `[]` clears it. After correcting a
|
||||||
|
failed trim or analysis invocation, retry normally; successful work need not be
|
||||||
|
forced solely because a credential was added or rotated. See
|
||||||
|
[Scriptorium credentials](../config.md#scriptorium-credentials) and the
|
||||||
|
[401 troubleshooting guide](../troubleshooting.md#scriptorium-returns-http-401-during-trim-or-analyze).
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Forward selected, already-resolved credential names and values to Scriptorium
|
||||||
|
for trim, analysis, character-family generation, and render-debug calls.
|
||||||
|
Scriptorium still owns provider and profile selection; Narratio does not add
|
||||||
|
a model-request `--api-key-env` override.
|
||||||
|
- Register selected values for captured subprocess-output and failure-diagnostic
|
||||||
|
redaction. Inspection and invocation metadata contain credential names, never
|
||||||
|
their values. This protection does not scan files Scriptorium writes directly.
|
||||||
|
- Reuse the credential-forwarding boundary shared with Audita and Notarius.
|
||||||
|
Retire the completed Scriptorium credential-forwarding bug report from the
|
||||||
|
source roadmap; its history remains in Git.
|
||||||
|
|
||||||
|
[COPYRIGHT](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.1.0/COPYRIGHT) | [LICENSE](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.1.0/LICENSE) | [ATTRIBUTION](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.1.0/docs/oss/attribution.md)
|
||||||
224
docs/releases/v4.0.0.md
Normal file
224
docs/releases/v4.0.0.md
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
# Narratio v4.0.0
|
||||||
|
|
||||||
|
Narratio v4.0.0 adopts a native CommandKit CLI, shared campaign and glossary
|
||||||
|
schemas, and current Audita, Notarius, and Scriptorium interfaces. A standalone
|
||||||
|
preflight command prepares real inputs and checks readiness before processing.
|
||||||
|
Published products can be imported for further work without restoring the
|
||||||
|
execution history that produced them.
|
||||||
|
|
||||||
|
This is a breaking upgrade from v3.1.0. Update authored configuration, input
|
||||||
|
documents, command invocations, and scripts that consume command reports. Older
|
||||||
|
local session state is not converted in place.
|
||||||
|
|
||||||
|
## Compatibility and deployment
|
||||||
|
|
||||||
|
- The Go module path is now `gitea.maximumdirect.net/eric/narratio/v4`.
|
||||||
|
Source integrations and build scripts that reference the module path must update it.
|
||||||
|
- Building from source now requires Go 1.27.0 or later, up from 1.26.0.
|
||||||
|
Maintained builds use Go 1.27.4. Release targets remain Linux amd64 and arm64,
|
||||||
|
plus best-effort macOS arm64.
|
||||||
|
- The integration baselines are Audita v4.3.0, Notarius v0.10.0, and Scriptorium
|
||||||
|
v0.16.0. Install the applicable tools separately and migrate their own
|
||||||
|
configuration using the guides linked from the
|
||||||
|
[integration contracts](../integrations/README.md). Audita uses its version 3
|
||||||
|
configuration and Notarius its version 6 configuration.
|
||||||
|
- Narratio embeds the shared glossary, RPG party, and RPG campaign schemas at
|
||||||
|
version 0.2.0 from schemas distribution `2026.11.1`. Validation is offline;
|
||||||
|
the schema markers remain `maximumdirect.glossary.v1`,
|
||||||
|
`maximumdirect.rpg.party.v1`, and `maximumdirect.rpg.campaign.v1`.
|
||||||
|
- The configuration and CLI integrations now use ConfigKit v1.4.0,
|
||||||
|
CommandKit v0.8.0, and ckconfig v0.11.0. ReleaseKit v0.10.0 owns version
|
||||||
|
reporting and the maintainer release workflow.
|
||||||
|
|
||||||
|
## CLI and reporting changes
|
||||||
|
|
||||||
|
CommandKit now owns parsing, configuration inspection, reporting, diagnostics,
|
||||||
|
and completion. Removed command paths have no compatibility aliases.
|
||||||
|
|
||||||
|
| Previous invocation | Replacement |
|
||||||
|
| --- | --- |
|
||||||
|
| `session validate SESSION` | `preflight SESSION` |
|
||||||
|
| `run-stage STAGE SESSION` | `run SESSION --stage STAGE` |
|
||||||
|
| `analyze SESSION` | `run SESSION --stage analyze --force` |
|
||||||
|
| `publish SESSION` | `run SESSION --stage publish --force` |
|
||||||
|
| `regenerate-artifacts SESSION` | `artifacts regenerate SESSION` |
|
||||||
|
| `clean SESSION` / `clean --all` | `session clean SESSION` / `session clean --all` |
|
||||||
|
| `config artifacts` | `artifacts list` |
|
||||||
|
| `session locks SESSION` | `session locks list SESSION` |
|
||||||
|
| `--session FILE` | `--session-file FILE` |
|
||||||
|
| `--session-id ID` | Positional `SESSION` on domain commands |
|
||||||
|
| `config diff LEFT RIGHT` | `config diff --overlay LEFT --against-overlay RIGHT` |
|
||||||
|
|
||||||
|
Place flags after the complete command path. Configuration inspection uses
|
||||||
|
`--session` to assert an identity, not to select a file. Campaign identity and
|
||||||
|
file selectors may now be used together; `--party-file` selects a roster without
|
||||||
|
editing the campaign. See the [CLI reference](../cli.md).
|
||||||
|
|
||||||
|
Native inspection exposes `app`, `campaign`, `session`, and `party` scopes,
|
||||||
|
including source explanations and independent comparisons. It preserves authored
|
||||||
|
artifact-family declarations. Use `artifacts list` for expanded domain
|
||||||
|
definitions, `session plan` for execution and reuse decisions, and
|
||||||
|
`session artifacts` for product availability. App inspection supports native
|
||||||
|
field overrides; execution and planning continue to use files and overlays.
|
||||||
|
|
||||||
|
Reports go to stdout through native text, YAML, or JSON rendering; automatic
|
||||||
|
structured output uses YAML. Diagnostics and progress go to stderr.
|
||||||
|
`--progress` reports work such as transfers and speaker/artifact completion;
|
||||||
|
`--verbose` adds informational context. Quiet mode suppresses reports while
|
||||||
|
retaining failure diagnostics. Console debug does not enable downstream debug
|
||||||
|
capture. Scripts must adapt to the new report shapes and
|
||||||
|
[exit classifications](../cli.md#cancellation-and-exit-status), including status
|
||||||
|
2 for identifiable invalid configuration input and status 1 for operational
|
||||||
|
failures.
|
||||||
|
|
||||||
|
`artifacts regenerate` forces the whole configured extraction before rebuilding
|
||||||
|
selected analysis targets and prerequisites. `--artifacts` narrows analysis,
|
||||||
|
not extraction lanes; this command stops before publication and cleanup.
|
||||||
|
|
||||||
|
## Configuration and shared inputs
|
||||||
|
|
||||||
|
Configuration policy is delegated to ConfigKit. The main migration steps are:
|
||||||
|
|
||||||
|
- Rename source-root `configkit:` controls to `config:`. Review native import,
|
||||||
|
inheritance, and sequence-composition rules; mark required imports explicitly.
|
||||||
|
- Update pipeline discovery filenames, or pass an existing custom filename such
|
||||||
|
as `pipeline.yml` with `--config`. The former implicit search for
|
||||||
|
`/etc/narratio/pipeline.yml` and `/usr/local/etc/narratio/pipeline.yml` has been
|
||||||
|
replaced by [native discovery](../config.md#discovery-and-selection).
|
||||||
|
- Remove `--secrets-dir`. Declare `config.secrets_dir` in the pipeline main file
|
||||||
|
or provide credentials through the process environment. There is no automatic
|
||||||
|
conventional secrets-directory probe. Retain exact credential-reference names
|
||||||
|
in the applicable downstream `credentials` lists.
|
||||||
|
- Review relative resource paths: imported and inherited values resolve from
|
||||||
|
their defining source. Defaults apply to absent fields; explicit empty, null,
|
||||||
|
zero, and false values retain their native meaning and undergo domain checks.
|
||||||
|
|
||||||
|
Campaigns now use the shared campaign envelope: `schema_version` and `id`,
|
||||||
|
`references.party` for the roster, and the `narratio` extension for speakers,
|
||||||
|
inline autocorrection, campaign vocabulary, and session templates. Replace
|
||||||
|
file-based autocorrection and private spell-catalog inputs with the maintained
|
||||||
|
shared-input model. Party rosters use the shared party schema and plural
|
||||||
|
`aliases`; Narratio derives the players document and party glossary from that
|
||||||
|
single roster.
|
||||||
|
|
||||||
|
Glossaries use shared named-collection envelopes. Preparation writes `party`,
|
||||||
|
`campaign`, `setting`, and `spells` glossaries plus a combined document. Campaign
|
||||||
|
vocabulary may come from a file, inline entries, or native composition of both.
|
||||||
|
Optional setting and system selections use a separately installed reference
|
||||||
|
catalog. Replace old `narratio.input.glossary` and private spell-catalog bindings
|
||||||
|
with the applicable `narratio.input.glossary.*` sources. No legacy document
|
||||||
|
conversion is performed.
|
||||||
|
|
||||||
|
Audita receives the four individual glossaries. Its ordered processing pipeline
|
||||||
|
belongs in Audita configuration; remove Narratio's retired `audita.modules`.
|
||||||
|
Notarius can consume the prepared roster and combined glossary through explicit
|
||||||
|
reference bindings. Rename `notarius.config_profile` to `config_overlay`, replace
|
||||||
|
`resume` and `chunk_cache` with native cache selection as needed, and remove old
|
||||||
|
output descriptor fields. Output entries now select a `lane_id` and optional
|
||||||
|
flat JSON `filename`. Forced extraction requests native cache refresh.
|
||||||
|
|
||||||
|
Use the [production/testing bundle](../../examples/production-testing/pipeline.yml)
|
||||||
|
and [three-file campaign example](../../examples/campaigns/lantern-coast/campaign.yml)
|
||||||
|
as migration references. The [configuration reference](../config.md) owns the
|
||||||
|
complete field, clearing, and source-resolution rules.
|
||||||
|
|
||||||
|
## Preflight and processing
|
||||||
|
|
||||||
|
`narratio preflight SESSION` prepares or reuses inputs, then checks configured
|
||||||
|
readiness, including native Audita and Notarius preflight and Scriptorium prompt
|
||||||
|
requirements. Unlike the former validation command, it can create a workspace,
|
||||||
|
download inputs, and update preparation state. It may contact providers.
|
||||||
|
Changed inputs use ordinary dependent invalidation; a later readiness failure
|
||||||
|
does not discard successful preparation.
|
||||||
|
|
||||||
|
Standalone preflight checks enabled capabilities even when processing outputs
|
||||||
|
are reusable. Automatic preflight checks projected work after preparation and
|
||||||
|
before processing. Required failures stop execution; advisory prompt-discovery
|
||||||
|
findings retain warning treatment. Audita uses a synthetic transcript; Notarius
|
||||||
|
uses a suitable verified transcript or its synthetic fallback. These checks do
|
||||||
|
not guarantee future provider availability or real-transcript processing quality.
|
||||||
|
|
||||||
|
Scriptorium generation now uses its native CLI and captures result stdout
|
||||||
|
separately from diagnostic stderr. Prepared previews and requirements inspection
|
||||||
|
use native structured output. Missing required bindings and failed inspection
|
||||||
|
are caught before the affected processing begins.
|
||||||
|
|
||||||
|
Audio discovery now accepts common formats beyond FLAC, including WAV, MP3,
|
||||||
|
M4A, and Opus, with the same case-insensitive suffix selection for local directory
|
||||||
|
and S3 prefix scans. Explicit files can have any suffix. Narratio does not
|
||||||
|
transcode or certify the encoding; WhisperX must be able to decode the bytes.
|
||||||
|
Prepared names and speaker identities are checked for collisions before audio
|
||||||
|
materialization. See [audio selection](../config.md#session).
|
||||||
|
|
||||||
|
## Workspace, publication, and restore
|
||||||
|
|
||||||
|
The local workspace now separates prepared `inputs/` and `audio/`, combined
|
||||||
|
`transcripts/` with `raw/` speaker transcripts, flat `artifacts/`, and run-local
|
||||||
|
attempt material. Logs and debug views point to the latest actual attempt,
|
||||||
|
including failures. Selected Notarius lane products are promoted into canonical
|
||||||
|
artifact locations and can be reused without the original bundle. Retired
|
||||||
|
spool and audio-cache configuration is no longer accepted; prepared audio has
|
||||||
|
one verified copy. Subprocess state and caches remain under each tool's control.
|
||||||
|
|
||||||
|
Only `narratio.session-manifest.v2` is accepted locally. Preserve older workspaces
|
||||||
|
separately, then regenerate or import compatible published products into a new
|
||||||
|
local baseline. Do not change old schema markers or edit immutable remote
|
||||||
|
snapshots to bypass validation.
|
||||||
|
|
||||||
|
Publication now transfers products and prepared inputs without uploading the
|
||||||
|
local execution ledger. `session restore` imports recognized products from the
|
||||||
|
selected publication inventory and merges them with valid local progress. It
|
||||||
|
does not restore remote execution checkpoints or claim that remote stages ran
|
||||||
|
locally. Identical products preserve valid local evidence; changed products
|
||||||
|
invalidate dependent work while unrelated checkpoints remain.
|
||||||
|
|
||||||
|
Imported transcripts and artifacts can satisfy downstream work without their
|
||||||
|
original producer history. Bounded downstream runs prepare required references
|
||||||
|
without demanding audio for unrelated transcription. Uncovered or forced
|
||||||
|
transcription still requires audio. `render.variants` can select normalized,
|
||||||
|
trimmed, both, or neither transcript variant. Restore dry runs report planned
|
||||||
|
imports, conflicts, and projected work; `restore --force` permits eligible file
|
||||||
|
replacement rather than forcing processing. See the
|
||||||
|
[restore workflow](../operations.md#restore-workflow).
|
||||||
|
|
||||||
|
When `workspace.cleanup_after_publish` is enabled and publication evidence
|
||||||
|
authorizes cleanup, the final cleanup stage removes the **entire session run
|
||||||
|
history**: earlier failures, logs, debug captures, restore/probe attempts, and
|
||||||
|
original Notarius bundles. Managed diagnostic links are removed too. Prepared
|
||||||
|
inputs, canonical products, and the local manifest remain reusable; remote
|
||||||
|
published objects and subprocess caches are unaffected. Set the
|
||||||
|
option to `false` to retain execution evidence. `session clean` is different:
|
||||||
|
it removes the entire local session. See [cleanup](../operations.md#cleanup).
|
||||||
|
|
||||||
|
## Reliability improvements
|
||||||
|
|
||||||
|
- Workspace coordination now covers active processing, restore, initialization,
|
||||||
|
and manual cleanup; lock waiting is cancellation-aware and reported as progress.
|
||||||
|
- Subprocess completion waits for owned process output before releasing resources.
|
||||||
|
- Audio and publication transfers stream data and verify available size and
|
||||||
|
object-identity evidence; publication sources are handled one at a time.
|
||||||
|
- Planning checks current S3 source evidence before predicting preparation reuse.
|
||||||
|
- Previous-session hydration includes configured artifact prerequisites, including
|
||||||
|
disabled prerequisites needed by selected work.
|
||||||
|
- Shared dependency and input indexes reduce repeated scans during analysis,
|
||||||
|
inspection, publication, and restore.
|
||||||
|
|
||||||
|
## Upgrade sequence
|
||||||
|
|
||||||
|
1. Preserve authored sources, old local workspaces, and any execution evidence
|
||||||
|
you want to retain. Published products are not execution-checkpoint backups.
|
||||||
|
2. Install the applicable downstream versions and migrate their configuration.
|
||||||
|
3. Update Narratio configuration and shared input documents using the maintained
|
||||||
|
examples. Remove retired keys and update CLI scripts and report consumers.
|
||||||
|
4. Validate and inspect configuration with native `config` commands, then review
|
||||||
|
expanded inputs and outputs with `artifacts list`. Use a new local baseline
|
||||||
|
for unsupported state; preview any product import with
|
||||||
|
`session restore SESSION --dry-run` before applying it.
|
||||||
|
5. Run `preflight SESSION`, inspect `session plan SESSION`, and execute the desired
|
||||||
|
full or bounded `run`. Review cleanup retention before a full published run.
|
||||||
|
|
||||||
|
Maintainers now use the module-selected ReleaseKit launcher for candidate
|
||||||
|
validation, tagging, and asynchronous binary delivery; the old release scripts
|
||||||
|
have been removed. See the [release procedure](../release.md).
|
||||||
|
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/eric/narratio/src/tag/v4.0.0/COPYRIGHT) | [LICENSE](https://forge.maximumdirect.net/eric/narratio/src/tag/v4.0.0/LICENSE) | [ATTRIBUTION](https://forge.maximumdirect.net/eric/narratio/src/tag/v4.0.0/docs/oss/attribution.md)
|
||||||
@@ -22,7 +22,7 @@ narratio session plan 2026-04-04
|
|||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
- pass explicit `--config`, `--campaign` or `--campaign-file`, and `--session`.
|
- pass explicit `--config`, `--campaign` or `--campaign-file`, and `--session-file`, with the positional session ID.
|
||||||
|
|
||||||
Relevant reference: [Configuration discovery](./config.md#discovery-and-selection).
|
Relevant reference: [Configuration discovery](./config.md#discovery-and-selection).
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ Likely cause:
|
|||||||
Diagnostics:
|
Diagnostics:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio session validate 2026-04-04 --session /path/session.yml
|
narratio preflight 2026-04-04 --session-file /path/session.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
@@ -62,17 +62,16 @@ Likely cause:
|
|||||||
Diagnostics:
|
Diagnostics:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio session plan 2026-04-04 --config /path/pipeline.yml --campaign-file /path/campaign.yml --session /path/session.yml
|
narratio session plan 2026-04-04 --config /path/pipeline.yml --campaign-file /path/campaign.yml --session-file /path/session.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
- align config with [Configuration](./config.md) and the
|
- align config with [Configuration](./config.md) and the
|
||||||
[maintained examples](../examples/README.md).
|
[maintained examples](../examples/README.md).
|
||||||
- for a manifest schema error, move the unsupported local state aside and
|
- for a manifest schema error, move unsupported local state aside and regenerate
|
||||||
regenerate it; restore a verified current committed snapshot or republish
|
it or import verified published products into a new local baseline. Do not add
|
||||||
healthy regenerated state when appropriate. Do not add version or stage
|
version or stage markers by hand.
|
||||||
markers by hand.
|
|
||||||
- if an older manifest is rejected for its retired cleanup-obligation field,
|
- if an older manifest is rejected for its retired cleanup-obligation field,
|
||||||
finish outstanding cleanup with the pre-upgrade binary. Otherwise verify the
|
finish outstanding cleanup with the pre-upgrade binary. Otherwise verify the
|
||||||
remote commit, move aside or regenerate the incompatible manifest, and use
|
remote commit, move aside or regenerate the incompatible manifest, and use
|
||||||
@@ -90,13 +89,13 @@ Symptom:
|
|||||||
|
|
||||||
Likely cause:
|
Likely cause:
|
||||||
|
|
||||||
- the campaign `party.yml` is an unversioned legacy document, or names a
|
- the campaign party main document is unversioned, or names a
|
||||||
schema other than `narratio.party.v1`.
|
schema other than `maximumdirect.rpg.party.v1`.
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
- replace the file with one exact, single-document
|
- replace the main file with a versioned
|
||||||
[`narratio.party.v1` party](./integrations/party.md); do not add a version
|
[`maximumdirect.rpg.party.v1` party](./integrations/party.md); do not add a version
|
||||||
marker to an otherwise incompatible legacy structure. The versioned party is
|
marker to an otherwise incompatible legacy structure. The versioned party is
|
||||||
the only configured roster authority.
|
the only configured roster authority.
|
||||||
|
|
||||||
@@ -115,22 +114,27 @@ Diagnostics:
|
|||||||
narratio config sources --config /path/pipeline.yml --overlay testing
|
narratio config sources --config /path/pipeline.yml --overlay testing
|
||||||
```
|
```
|
||||||
|
|
||||||
Add `--campaign` or `--campaign-file` when the pipeline has party-driven
|
Native sources list the actual files and import evidence for the selected
|
||||||
artifact families. The output identifies each effective logical field's root,
|
scope. To trace a value, use `config explain --path POINTER`, or discover paths
|
||||||
import, overlay, default, campaign, party, or family source without printing
|
with `config explain --list`. App inspection keeps family declarations;
|
||||||
the field value or credential contents.
|
`artifacts list` derives concrete members from the selected campaign/party.
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
- move a duplicated base field so it has one owner;
|
- inspect the field's effective origin and history;
|
||||||
- correct the selected overlay; or
|
- correct the selected source or overlay; or
|
||||||
- correct the campaign party/family declaration that owns generated values.
|
- select the intended roster when reviewing family members.
|
||||||
|
|
||||||
To review what would actually change before switching overlays, run `config
|
To compare an explicit pipeline root with its testing overlay, select the root
|
||||||
diff` with the same pipeline and campaign selectors. It compares normalized
|
on both sides:
|
||||||
effective values rather than YAML formatting or source-file layout.
|
|
||||||
|
|
||||||
Relevant reference: [Configuration inspection](./config.md#read-only-effective-pipeline-inspection).
|
```sh
|
||||||
|
narratio config diff --config /path/pipeline.yml --against-config /path/pipeline.yml --against-overlay testing --details
|
||||||
|
```
|
||||||
|
|
||||||
|
The sides use independent defaults. Comparison concerns effective native values,
|
||||||
|
including declarations, rather than generated domain objects or YAML layout.
|
||||||
|
See [configuration inspection](./cli.md#configuration-inspection).
|
||||||
|
|
||||||
## Audio mode conflict
|
## Audio mode conflict
|
||||||
|
|
||||||
@@ -145,7 +149,7 @@ Likely cause:
|
|||||||
Diagnostics:
|
Diagnostics:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio session validate 2026-04-04
|
narratio preflight 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
@@ -164,7 +168,7 @@ Likely causes:
|
|||||||
|
|
||||||
- key not defined in `pipeline.scriptorium.artifacts`;
|
- key not defined in `pipeline.scriptorium.artifacts`;
|
||||||
- empty list entry (for example trailing comma);
|
- empty list entry (for example trailing comma);
|
||||||
- `run-stage` used with non-`analyze`/`publish` target.
|
- selected run/plan range contains neither `analyze` nor `publish`.
|
||||||
|
|
||||||
Diagnostics:
|
Diagnostics:
|
||||||
|
|
||||||
@@ -201,7 +205,7 @@ narratio session plan 2026-04-04 --from render --through analyze
|
|||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
- widen the bounded range to include the first reported stage, or recover that
|
- widen the bounded range to include the first reported stage, or recover that
|
||||||
stage explicitly with `run-stage` before retrying. The failed check does not
|
stage explicitly with `run --stage` before retrying. The failed check does not
|
||||||
create a run-local directory or modify the manifest. Narratio does not
|
create a run-local directory or modify the manifest. Narratio does not
|
||||||
resume-validate excluded prefix stages, and stages after `--through` are not
|
resume-validate excluded prefix stages, and stages after `--through` are not
|
||||||
prerequisites.
|
prerequisites.
|
||||||
@@ -242,7 +246,7 @@ Safe fix:
|
|||||||
for a successful checkpoint.
|
for a successful checkpoint.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage transcribe 2026-04-04
|
narratio run 2026-04-04 --stage transcribe
|
||||||
```
|
```
|
||||||
|
|
||||||
Valid earlier speaker checkpoints remain reusable even while aggregate
|
Valid earlier speaker checkpoints remain reusable even while aggregate
|
||||||
@@ -270,7 +274,7 @@ Safe fix:
|
|||||||
retry if the replacement attempt is interrupted.
|
retry if the replacement attempt is interrupted.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage transcribe 2026-04-04 --force
|
narratio run 2026-04-04 --stage transcribe --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Transport replay and application retries do not provide an exactly-once remote
|
Transport replay and application retries do not provide an exactly-once remote
|
||||||
@@ -319,15 +323,15 @@ Likely causes:
|
|||||||
|
|
||||||
- the named environment variable is absent or empty;
|
- the named environment variable is absent or empty;
|
||||||
- the selected secrets directory lacks a file with that exact name;
|
- the selected secrets directory lacks a file with that exact name;
|
||||||
- a process environment variable exists but is empty, so bootstrap correctly
|
- a process environment variable is empty and the selected bootstrap policy
|
||||||
leaves it in place; or
|
preserves it; or
|
||||||
- the Narratio reference name does not match `api_key_env` in the selected
|
- the Narratio reference name does not match `api_key_env` in the selected
|
||||||
Notarius/PromptKit profile.
|
Notarius/PromptKit profile.
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
- set the exact nonempty environment variable or provide an equivalently named
|
- 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;
|
- remove, set to `null`, or set to `[]` when that deployment needs no credential;
|
||||||
and
|
and
|
||||||
- use `config show`, `config sources`, and `config diff` to inspect the public
|
- use `config show`, `config sources`, and `config diff` to inspect the public
|
||||||
@@ -341,7 +345,16 @@ for the command to proceed.
|
|||||||
Relevant references: [Secrets](./config.md#secrets-handling) and
|
Relevant references: [Secrets](./config.md#secrets-handling) and
|
||||||
[Notarius credentials](./config.md#notarius-credentials).
|
[Notarius credentials](./config.md#notarius-credentials).
|
||||||
|
|
||||||
## Audita v2 configuration or credential failure
|
## Prepared glossary is unavailable or invalid
|
||||||
|
|
||||||
|
If preflight or downstream work reports missing, changed, or invalid prepared
|
||||||
|
glossary evidence, check the selected catalog IDs, source-relative files, and
|
||||||
|
campaign inline contribution. Re-run `prepare` after correcting the source;
|
||||||
|
use `--force` when an explicit refresh is needed. Update old monolithic source
|
||||||
|
bindings and glossary files using the [glossary input guidance](config.md#glossary-inputs).
|
||||||
|
Preflight runs or reuses preparation; after correcting the source, retry it.
|
||||||
|
|
||||||
|
## Audita configuration or credential failure
|
||||||
|
|
||||||
Symptom:
|
Symptom:
|
||||||
|
|
||||||
@@ -354,16 +367,16 @@ Likely causes:
|
|||||||
- the Narratio pipeline still uses v1 endpoint, model, capacity, singular key,
|
- the Narratio pipeline still uses v1 endpoint, model, capacity, singular key,
|
||||||
report, or retention settings;
|
report, or retention settings;
|
||||||
- the named key is missing or empty, including a present but empty process
|
- 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
|
- Audita's external configuration references a backend credential name not forwarded
|
||||||
by `pipeline.audita.credentials`, including a backend not selected by the
|
by `pipeline.audita.credentials`, including a backend not selected by the
|
||||||
current profile; or
|
current profile; or
|
||||||
- an Audita overlay or profile selector names a missing downstream definition.
|
- an Audita overlay or profile selector names a missing downstream definition.
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
- follow the [migration table](./operations.md#migrating-audita-and-provider-credentials)
|
- follow the [migration guidance](./operations.md#migrating-audita-and-provider-credentials)
|
||||||
and use a supported Audita v2 executable and configuration;
|
and use an Audita v4.3.0 executable and configuration;
|
||||||
- provide each needed provider-named variable through the environment or
|
- provide each needed provider-named variable through the environment or
|
||||||
secrets directory, and list that same name in `pipeline.audita.credentials`;
|
secrets directory, and list that same name in `pipeline.audita.credentials`;
|
||||||
- validate the external file offline with
|
- validate the external file offline with
|
||||||
@@ -374,7 +387,7 @@ Safe fix:
|
|||||||
An exit-zero polish with a valid transcript succeeds even when Audita reports
|
An exit-zero polish with a valid transcript succeeds even when Audita reports
|
||||||
recoverable errors or no corrections. Missing reports are allowed when Audita
|
recoverable errors or no corrections. Missing reports are allowed when Audita
|
||||||
reporting is disabled externally. Edits to Audita-owned files behind unchanged
|
reporting is disabled externally. Edits to Audita-owned files behind unchanged
|
||||||
selectors require `narratio run-stage polish <session-id> --force` to replace a
|
selectors require `narratio run <session-id> --stage polish --force` to replace a
|
||||||
previously successful result. See the [Audita integration contract](./integrations/audita.md).
|
previously successful result. See the [Audita integration contract](./integrations/audita.md).
|
||||||
|
|
||||||
## Notarius executable missing
|
## Notarius executable missing
|
||||||
@@ -400,12 +413,12 @@ and [Notarius integration](./integrations/notarius.md).
|
|||||||
|
|
||||||
Symptom:
|
Symptom:
|
||||||
|
|
||||||
- extraction reports a Notarius exit error instead of a receipt.
|
- extraction reports a Notarius exit error instead of a completion report.
|
||||||
|
|
||||||
Diagnostics:
|
Diagnostics:
|
||||||
|
|
||||||
- inspect `runs/{run_id}/extract/notarius.stderr.log`; stdout is reserved for
|
- inspect `runs/{run_id}/extract/logs/notarius.stderr.log`; stdout is reserved for
|
||||||
the receipt and is not merged with diagnostics.
|
the completion report and is not merged with diagnostics.
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
@@ -431,13 +444,13 @@ Likely causes:
|
|||||||
- `prepare` has not run since the campaign/session stable input changed;
|
- `prepare` has not run since the campaign/session stable input changed;
|
||||||
- the configured source file is missing;
|
- the configured source file is missing;
|
||||||
- a prepared `inputs/` file or its manifest record was modified independently;
|
- a prepared `inputs/` file or its manifest record was modified independently;
|
||||||
- a spell-catalog binding exists without an effective `spell_catalog_file`.
|
- a configured glossary binding does not identify a prepared shared glossary.
|
||||||
|
|
||||||
Diagnostics:
|
Diagnostics:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio session status 2026-04-04
|
narratio session status 2026-04-04
|
||||||
narratio session validate 2026-04-04
|
narratio preflight 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
@@ -446,7 +459,7 @@ Safe fix:
|
|||||||
evidence before extraction:
|
evidence before extraction:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage prepare 2026-04-04 --force
|
narratio run 2026-04-04 --stage prepare --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Do not point Notarius directly at the original source path or edit the manifest
|
Do not point Notarius directly at the original source path or edit the manifest
|
||||||
@@ -458,7 +471,7 @@ and [Operations: Extraction Workflow](./operations.md#extraction-workflow).
|
|||||||
Symptom:
|
Symptom:
|
||||||
|
|
||||||
- extraction reports that a path beneath
|
- extraction reports that a path beneath
|
||||||
`cache/notarius/references/<sha256>/` is a symlink, directory, or another
|
`inputs/references/<sha256>/` is a symlink, directory, or another
|
||||||
non-regular or unsafe entry.
|
non-regular or unsafe entry.
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
@@ -477,34 +490,11 @@ Relevant reference: [Operations: Extraction Workflow](./operations.md#extraction
|
|||||||
|
|
||||||
## Notarius resume executes work instead of reusing it
|
## Notarius resume executes work instead of reusing it
|
||||||
|
|
||||||
Symptom:
|
Narratio may reuse a completed extraction without invoking Notarius. When it
|
||||||
|
executes, Notarius independently selects cached results based on its own
|
||||||
- Narratio executes `extract`, and Notarius makes provider calls despite
|
configuration and inputs. Verify its configured cache location and native
|
||||||
`pipeline.notarius.resume: true`.
|
cache mode; force requests `refresh`. Changed inputs or downstream settings can
|
||||||
|
cause a cold miss. See [cache controls](config.md#notarius-cache-controls).
|
||||||
Likely causes:
|
|
||||||
|
|
||||||
- checkpoint recording is disabled in the Notarius configuration;
|
|
||||||
- Notarius is using a nonpersistent or different checkpoint root;
|
|
||||||
- transcript/reference bytes, reference paths, pipeline/profile content,
|
|
||||||
local-backend endpoint, selected lanes, or another checkpoint identity input
|
|
||||||
changed; or
|
|
||||||
- Narratio extraction was forced, which deliberately omits `--resume`.
|
|
||||||
|
|
||||||
Safe fix:
|
|
||||||
|
|
||||||
- validate the deployed Notarius configuration and configure explicit
|
|
||||||
persistent chunk-plan and checkpoint roots;
|
|
||||||
- inspect Notarius checkpoint decision reason codes for a legitimate cold miss;
|
|
||||||
and
|
|
||||||
- retry without force only when reuse is intended.
|
|
||||||
|
|
||||||
Remember that Narratio skipping a completed `extract` stage is separate from
|
|
||||||
Notarius reusing work inside an extraction that does execute. Narratio does not
|
|
||||||
read the Notarius configuration to infer checkpoint enablement.
|
|
||||||
|
|
||||||
Relevant references: [Notarius cache controls](./config.md#notarius-cache-controls)
|
|
||||||
and [Notarius integration](./integrations/notarius.md).
|
|
||||||
|
|
||||||
## Notarius reference selector or generated-handoff collision
|
## Notarius reference selector or generated-handoff collision
|
||||||
|
|
||||||
@@ -531,44 +521,13 @@ Narratio validates selector structure and prepared evidence, while Notarius
|
|||||||
owns slot declarations, media compatibility, and generated-handoff conflicts.
|
owns slot declarations, media compatibility, and generated-handoff conflicts.
|
||||||
Relevant reference: [Notarius integration](./integrations/notarius.md).
|
Relevant reference: [Notarius integration](./integrations/notarius.md).
|
||||||
|
|
||||||
## Notarius receipt or index incompatible
|
## Notarius completion or required lane invalid
|
||||||
|
|
||||||
Symptom:
|
If successful subprocess output is rejected, inspect the native completion
|
||||||
|
report and stderr under the extraction attempt's logs. Confirm the configured
|
||||||
- extraction rejects the receipt schema, pipeline identity, bundle/index path,
|
pipeline identity, safe output directory, and required lane IDs against the
|
||||||
lane descriptor, or payload path even though Notarius exited successfully.
|
[Notarius contract](integrations/notarius.md). Correct the configuration and
|
||||||
|
rerun; do not treat partial output as a success or bypass confinement checks.
|
||||||
Likely causes:
|
|
||||||
|
|
||||||
- Narratio and Notarius versions disagree on their consumer contract;
|
|
||||||
- the configured pipeline or lane constraints are stale;
|
|
||||||
- output paths escape the bundle or traverse symlinks.
|
|
||||||
|
|
||||||
Safe fix:
|
|
||||||
|
|
||||||
- compare installed Notarius output with the canonical Notarius contracts,
|
|
||||||
including receipt `index_file: index.json` and index management names
|
|
||||||
`manifest.json`, `rejected.json`, `warnings.json`, and `diagnostics.json`; align
|
|
||||||
`pipeline.notarius` constraints and rerun. Do not bypass confinement or schema
|
|
||||||
checks.
|
|
||||||
|
|
||||||
Relevant reference: [Notarius integration](./integrations/notarius.md).
|
|
||||||
|
|
||||||
## Required Notarius lane rejected or missing
|
|
||||||
|
|
||||||
Symptom:
|
|
||||||
|
|
||||||
- extraction fails because a configured lane is rejected, missing, duplicated,
|
|
||||||
or incompatible, including after a zero exit.
|
|
||||||
|
|
||||||
Safe fix:
|
|
||||||
|
|
||||||
- inspect the Notarius diagnostic log and bundle rejection/warning information;
|
|
||||||
- correct the Notarius module or the exact declared lane contract;
|
|
||||||
- remove an output declaration only if downstream consumers genuinely no longer
|
|
||||||
require that source, then rerun extraction.
|
|
||||||
|
|
||||||
Every configured output is required. Narratio does not promote a partial result.
|
|
||||||
|
|
||||||
## Extraction resume invalidated
|
## Extraction resume invalidated
|
||||||
|
|
||||||
@@ -578,11 +537,11 @@ Symptom:
|
|||||||
|
|
||||||
Likely causes:
|
Likely causes:
|
||||||
|
|
||||||
- the pipeline ID or configured output contracts changed;
|
- the pipeline ID or configured output selection changed;
|
||||||
- a configured prepared reference selector, source, path, checksum, or byte
|
- a configured prepared reference selector, source, path, checksum, or byte
|
||||||
size changed;
|
size changed;
|
||||||
- the direct trimmed transcript identity or bytes changed; or
|
- the direct trimmed transcript identity or bytes changed; or
|
||||||
- the durable bundle, index, lane set, provenance, regular-file status, or
|
- a promoted product, its manifest provenance, regular-file status, size, or
|
||||||
checksum no longer validates.
|
checksum no longer validates.
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
@@ -606,7 +565,7 @@ Symptom:
|
|||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage extract 2026-04-04 --force
|
narratio run 2026-04-04 --stage extract --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Narratio fingerprints its invocation contract and prepared Narratio reference
|
Narratio fingerprints its invocation contract and prepared Narratio reference
|
||||||
@@ -649,7 +608,7 @@ Safe fix:
|
|||||||
the canonical path as a substitute for current evidence.
|
the canonical path as a substitute for current evidence.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio analyze 2026-04-04 --artifacts session_recap
|
narratio run 2026-04-04 --stage analyze --force --artifacts session_recap
|
||||||
```
|
```
|
||||||
|
|
||||||
Relevant references: [Operations: Artifact Selection](./operations.md#artifact-selection)
|
Relevant references: [Operations: Artifact Selection](./operations.md#artifact-selection)
|
||||||
@@ -707,8 +666,7 @@ Safe fix:
|
|||||||
Symptom:
|
Symptom:
|
||||||
|
|
||||||
- Narratio rejects a local session manifest because `schema_version` is missing
|
- Narratio rejects a local session manifest because `schema_version` is missing
|
||||||
or unsupported; or
|
or unsupported.
|
||||||
- restore rejects a committed remote session manifest for the same reason.
|
|
||||||
|
|
||||||
Likely causes:
|
Likely causes:
|
||||||
|
|
||||||
@@ -720,25 +678,59 @@ Likely causes:
|
|||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
|
|
||||||
- for unsupported local state, move the old manifest aside and regenerate, or
|
- for unsupported local state, move the old manifest aside and regenerate or
|
||||||
restore a verified current committed snapshot when one is authoritative;
|
import products from a verified current publication; and
|
||||||
- for unsupported committed remote state, regenerate healthy local state as
|
|
||||||
needed and republish the session; and
|
|
||||||
- for a downgrade rejection, return to the current binary or restore a verified
|
- for a downgrade rejection, return to the current binary or restore a verified
|
||||||
pre-upgrade backup. Do not delete only the speaker fields by hand.
|
pre-upgrade backup. Do not delete only the speaker fields by hand.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run 2026-04-04
|
narratio run 2026-04-04 --through analyze
|
||||||
narratio publish 2026-04-04
|
narratio session status 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
After current records exist, inspect them and publish explicitly. Do not copy
|
Inspect the regenerated records and outputs, then publish explicitly:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio run 2026-04-04 --stage publish --force
|
||||||
|
```
|
||||||
|
|
||||||
|
Do not copy
|
||||||
old files into canonical paths merely to influence selection; availability is
|
old files into canonical paths merely to influence selection; availability is
|
||||||
manifest-owned.
|
manifest-owned.
|
||||||
|
|
||||||
Relevant references: [Operations: Stage Execution and Continuation Behavior](./operations.md#stage-execution-and-continuation-behavior)
|
Relevant references: [Operations: Stage Execution and Continuation Behavior](./operations.md#stage-execution-and-continuation-behavior)
|
||||||
and [Manifest Internals](./internal/manifest.md#transcribe-owned-speaker-state).
|
and [Manifest Internals](./internal/manifest.md#transcribe-owned-speaker-state).
|
||||||
|
|
||||||
|
## Prompt requirements fail during preflight
|
||||||
|
|
||||||
|
If a run or `preflight` reports a missing prompt input, compare the exact
|
||||||
|
input name in the finding with the configured binding key, not just the source
|
||||||
|
ID. Supply a missing required variable, or correct the selected prompt and
|
||||||
|
profile. An optional source warning means the source may be omitted later; make
|
||||||
|
it required only if that is the intended configuration. Incomplete discovery
|
||||||
|
and conditional requirements warn without failing by themselves.
|
||||||
|
|
||||||
|
If inspection cannot start or decode a report, check the selected executable,
|
||||||
|
its native configuration and prompt resources, and the diagnostic context.
|
||||||
|
The [Scriptorium migration guide](https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/consumers/upgrading-cli.md)
|
||||||
|
explains the v0.16.0 interface and configuration changes. Retry after correcting
|
||||||
|
the issue; a preflight failure preserves completed output authority. See
|
||||||
|
[prompt preflight](operations.md#prompt-requirements-preflight).
|
||||||
|
|
||||||
|
## Scriptorium returns HTTP 401 during trim or analyze
|
||||||
|
|
||||||
|
Check that Narratio's pipeline selects the credential names required by
|
||||||
|
Scriptorium, for example `scriptorium.credentials: [OPENROUTER_API_KEY]`.
|
||||||
|
Provision the values through the existing environment or secrets directory;
|
||||||
|
exporting a key without selecting it does not forward it to the child process.
|
||||||
|
See [Scriptorium credentials](config.md#scriptorium-credentials).
|
||||||
|
|
||||||
|
Once corrected, retry the failed run normally; forcing previously successful
|
||||||
|
transcription or analysis is unnecessary. If authentication still fails, check
|
||||||
|
the selected Scriptorium backend, credential validity, and provider access
|
||||||
|
without printing keys. A 401 can indicate an invalid key as well as a missing
|
||||||
|
one.
|
||||||
|
|
||||||
## Scriptorium private input changed without a rerun
|
## Scriptorium private input changed without a rerun
|
||||||
|
|
||||||
Symptom:
|
Symptom:
|
||||||
@@ -760,7 +752,7 @@ Safe fix:
|
|||||||
reusable unless selected themselves.
|
reusable unless selected themselves.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio analyze 2026-04-04 --artifacts session_recap
|
narratio run 2026-04-04 --stage analyze --force --artifacts session_recap
|
||||||
```
|
```
|
||||||
|
|
||||||
Relevant reference: [Analyze Internals](./internal/stage-analyze.md#invariants).
|
Relevant reference: [Analyze Internals](./internal/stage-analyze.md#invariants).
|
||||||
@@ -781,7 +773,7 @@ Likely causes:
|
|||||||
Diagnostics:
|
Diagnostics:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio session validate 2026-04-04
|
narratio preflight 2026-04-04
|
||||||
narratio session status 2026-04-04
|
narratio session status 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -794,26 +786,26 @@ narratio session restore 2026-04-04
|
|||||||
or rerun prepare after correcting session config:
|
or rerun prepare after correcting session config:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage prepare 2026-04-04 --force
|
narratio run 2026-04-04 --stage prepare --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Relevant reference: [Operations: Restore Workflow](./operations.md#restore-workflow).
|
Relevant reference: [Operations: Restore Workflow](./operations.md#restore-workflow).
|
||||||
|
|
||||||
## Session lock conflict (`.lock`)
|
## Workspace lock wait (`.lock`)
|
||||||
|
|
||||||
Symptom:
|
Symptom:
|
||||||
|
|
||||||
- command fails acquiring session lock.
|
- a mutating command waits for the workspace lock or is cancelled while waiting.
|
||||||
|
|
||||||
Likely causes:
|
Likely causes:
|
||||||
|
|
||||||
- another process is running for the same session;
|
- another process is mutating the same workspace;
|
||||||
- a process still holds the operating-system lock while it is shutting down.
|
- a process still holds the operating-system lock while it is shutting down.
|
||||||
|
|
||||||
Diagnostics:
|
Diagnostics:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ls -l {workspace.root}/work/{campaign}/{session_id}/.lock
|
ls -l {workspace.root}/.lock
|
||||||
ps aux | grep narratio
|
ps aux | grep narratio
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -858,7 +850,7 @@ Relevant reference: [Operations: Restore Workflow](./operations.md#restore-workf
|
|||||||
|
|
||||||
Symptom:
|
Symptom:
|
||||||
|
|
||||||
- restore cannot find current pointer or current manifest.
|
- restore cannot find the current pointer or its selected publication inventory.
|
||||||
|
|
||||||
Likely causes:
|
Likely causes:
|
||||||
|
|
||||||
@@ -896,7 +888,6 @@ Diagnostics:
|
|||||||
```bash
|
```bash
|
||||||
narratio session artifacts 2026-04-04 --remote
|
narratio session artifacts 2026-04-04 --remote
|
||||||
narratio session status 2026-04-04
|
narratio session status 2026-04-04
|
||||||
narratio run-stage publish 2026-04-04 --force
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
@@ -905,6 +896,13 @@ Safe fix:
|
|||||||
- correct publish source/destination rules;
|
- correct publish source/destination rules;
|
||||||
- retry after storage failure is resolved.
|
- retry after storage failure is resolved.
|
||||||
|
|
||||||
|
To retry publication after inspection and repair, run the following mutating
|
||||||
|
command; it can update remote publication state:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio run 2026-04-04 --stage publish --force
|
||||||
|
```
|
||||||
|
|
||||||
Relevant reference: [Publish configuration](./config.md#publish-configuration-summary).
|
Relevant reference: [Publish configuration](./config.md#publish-configuration-summary).
|
||||||
|
|
||||||
## Render markdown source missing
|
## Render markdown source missing
|
||||||
@@ -929,8 +927,8 @@ Safe fix:
|
|||||||
- rerun render and then retry downstream stage(s):
|
- rerun render and then retry downstream stage(s):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage render 2026-04-04 --force
|
narratio run 2026-04-04 --stage render --force
|
||||||
narratio run-stage analyze 2026-04-04 --force
|
narratio run 2026-04-04 --stage analyze --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Relevant reference: [Operations: Stage Execution](./operations.md#stage-execution-and-continuation-behavior).
|
Relevant reference: [Operations: Stage Execution](./operations.md#stage-execution-and-continuation-behavior).
|
||||||
@@ -943,8 +941,8 @@ Symptom:
|
|||||||
|
|
||||||
Likely causes:
|
Likely causes:
|
||||||
|
|
||||||
- missing, unreadable, or invalid explicit `--secrets-dir`;
|
- a missing, unreadable, or invalid pipeline-configured secrets directory;
|
||||||
- invalid entries in the conventional `secrets/` directory beside the root pipeline;
|
- invalid secret-directory entries;
|
||||||
- missing credential environment variables;
|
- missing credential environment variables;
|
||||||
- invalid S3 endpoint/bucket settings.
|
- invalid S3 endpoint/bucket settings.
|
||||||
|
|
||||||
@@ -957,7 +955,7 @@ env | sed 's/=.*//' | grep -E 'OBJECT_STORAGE|AWS|AUDITA|NOTARIUS|SCRIPTORIUM'
|
|||||||
|
|
||||||
Safe fix:
|
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;
|
- provide required env vars;
|
||||||
- keep secret values out of YAML.
|
- keep secret values out of YAML.
|
||||||
|
|
||||||
@@ -972,13 +970,13 @@ Symptom:
|
|||||||
Likely causes:
|
Likely causes:
|
||||||
|
|
||||||
- incorrect `session.inputs.audio_s3.prefix`;
|
- incorrect `session.inputs.audio_s3.prefix`;
|
||||||
- no matching `.flac` objects;
|
- no matching [audio candidates](config.md#session);
|
||||||
- storage connectivity or permissions failure.
|
- storage connectivity or permissions failure.
|
||||||
|
|
||||||
Diagnostics:
|
Diagnostics:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio session validate 2026-04-04
|
narratio preflight 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
Safe fix:
|
Safe fix:
|
||||||
|
|||||||
@@ -9,28 +9,41 @@ in the [configuration reference](../docs/config.md).
|
|||||||
|
|
||||||
- [Minimal pipeline](pipeline.minimal.yml): campaign discovery plus the required
|
- [Minimal pipeline](pipeline.minimal.yml): campaign discovery plus the required
|
||||||
WhisperX URL.
|
WhisperX URL.
|
||||||
|
- [Synthetic catalog pipeline](pipeline.catalog.yml): imports the small
|
||||||
|
[example catalog](reference-catalog/catalog.yml), whose setting imports a
|
||||||
|
relative fragment. Install an operator-selected catalog separately for a
|
||||||
|
production deployment.
|
||||||
- [Production-shaped pipeline](pipeline.production.yml): S3 storage, publish,
|
- [Production-shaped pipeline](pipeline.production.yml): S3 storage, publish,
|
||||||
external tools, and configured Scriptorium artifacts.
|
external tools, and configured Scriptorium artifacts.
|
||||||
- [Production-base/testing-overlay bundle](production-testing/pipeline.yml):
|
- [Production-base/testing-overlay bundle](production-testing/pipeline.yml):
|
||||||
explicit `conf.d` imports, one ordinary artifact per `artifacts/<key>.yml`,
|
explicit required `conf.d` imports, an optional local import, destination-mounted
|
||||||
one family per `artifact-families/<key>.yml`, and the fixed
|
artifact files, a YAML-filtered directory of keyed families, and the fixed
|
||||||
`overlays/testing.yml` overlay. Production values live in the base. The
|
`overlays/testing.yml` overlay. Production values live in the base. The
|
||||||
bundle demonstrates an input-only artifact dependency, two character families
|
bundle demonstrates an input-only artifact dependency, two character families
|
||||||
sharing the campaign party, and a testing-only disabled artifact. Inspect it
|
sharing the campaign party, and a testing-only disabled artifact. The testing
|
||||||
offline with:
|
overlay's `testing_notes` artifact inherits the recap prompt, inputs, and
|
||||||
|
testing profile while retaining its disabled status and separate output path.
|
||||||
|
The testing overlay upserts the transcript publish rule by `source`. A
|
||||||
|
destination key defines each artifact ID; filenames do not. Full-root and
|
||||||
|
disjoint definitions are also valid. Upsert replaces a matching list record
|
||||||
|
as a whole; empty append or upsert contributions leave existing entries intact.
|
||||||
|
Inspect it offline with:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
narratio config validate --config examples/production-testing/pipeline.yml --campaign-file examples/campaigns/sample-campaign/campaign.yml
|
narratio config validate --config examples/production-testing/pipeline.yml
|
||||||
narratio config show --config examples/production-testing/pipeline.yml --campaign-file examples/campaigns/sample-campaign/campaign.yml --overlay testing
|
narratio config show --config examples/production-testing/pipeline.yml --overlay testing
|
||||||
narratio config sources --config examples/production-testing/pipeline.yml --campaign-file examples/campaigns/sample-campaign/campaign.yml --overlay testing
|
narratio config sources --config examples/production-testing/pipeline.yml --overlay testing
|
||||||
narratio config artifacts --config examples/production-testing/pipeline.yml --campaign-file examples/campaigns/sample-campaign/campaign.yml --overlay testing
|
narratio artifacts list --config examples/production-testing/pipeline.yml --campaign-file examples/campaigns/sample-campaign/campaign.yml --overlay testing
|
||||||
narratio config diff default testing --config examples/production-testing/pipeline.yml --campaign-file examples/campaigns/sample-campaign/campaign.yml
|
narratio config diff --against-config examples/production-testing/pipeline.yml --against-overlay testing --config examples/production-testing/pipeline.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
These inspection commands load configuration and resolve explicit credential
|
These inspection commands load configuration and resolve explicit credential
|
||||||
references, but do not load a session or create runtime state. This bundle is
|
references, but do not load a session or create runtime state. This bundle is
|
||||||
intentionally local-storage and credential-reference free so the walkthrough
|
intentionally local-storage and credential-reference free so the walkthrough
|
||||||
needs no tools or cloud services.
|
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.
|
||||||
- [Full annotated pipeline](pipeline.full.annotated.yml): every implemented
|
- [Full annotated pipeline](pipeline.full.annotated.yml): every implemented
|
||||||
pipeline section with explanatory comments.
|
pipeline section with explanatory comments.
|
||||||
- [Extraction subset pipeline](pipeline.extraction-subset.yml): a focused
|
- [Extraction subset pipeline](pipeline.extraction-subset.yml): a focused
|
||||||
@@ -41,30 +54,49 @@ with the sample campaign and a compatible local- or S3-audio session.
|
|||||||
|
|
||||||
## Campaign And Session Configuration
|
## Campaign And Session Configuration
|
||||||
|
|
||||||
|
- [Lantern Coast](campaigns/lantern-coast/campaign.yml) is a complete three-file
|
||||||
|
campaign with adjacent [party](campaigns/lantern-coast/party.yml) and
|
||||||
|
[speakers](campaigns/lantern-coast/speakers.yml). Its optional vocabulary and
|
||||||
|
autocorrection rules may be omitted. Select the synthetic catalog through the
|
||||||
|
[catalog pipeline](pipeline.catalog.yml).
|
||||||
|
|
||||||
- [Sample campaign](campaigns/sample-campaign/campaign.yml), its
|
- [Sample campaign](campaigns/sample-campaign/campaign.yml), its
|
||||||
[session template](campaigns/sample-campaign/session.template.yml), and its
|
[session template](campaigns/sample-campaign/session.template.yml), and its
|
||||||
adjacent stable inputs provide a complete campaign directory shape.
|
adjacent stable inputs provide a complete campaign directory shape. Its
|
||||||
|
imported settings and split party demonstrate local secondary imports;
|
||||||
|
relative resources follow the file that supplies each value.
|
||||||
- [Local-audio session](session.local-audio.yml) and
|
- [Local-audio session](session.local-audio.yml) and
|
||||||
[S3-audio session](session.s3-audio.yml) are concrete session files.
|
[S3-audio session](session.s3-audio.yml) are concrete session files.
|
||||||
|
- [Published-products session](session.published-products.yml) omits audio for
|
||||||
|
downstream work after import. Configure the needed references, and use
|
||||||
|
`render.variants: [trimmed]` when only the final trimmed transcript is
|
||||||
|
available. Transcription and forced transcription still require audio; see
|
||||||
|
the [restore workflow](../docs/operations.md#restore-workflow).
|
||||||
- [Session template](session.template.yml) and the campaign-local equivalent
|
- [Session template](session.template.yml) and the campaign-local equivalent
|
||||||
demonstrate the narrow placeholder syntax consumed by `session init`; they
|
demonstrate the narrow placeholder syntax consumed by `session init`; they
|
||||||
are templates, not runtime session files.
|
are templates, not runtime session files.
|
||||||
|
|
||||||
|
The [inline-only](glossary-authoring/inline-only.yml),
|
||||||
|
[file-only](glossary-authoring/file-only.yml), and
|
||||||
|
[combined](glossary-authoring/combined.yml) inputs fragments illustrate campaign
|
||||||
|
vocabulary selection. They omit optional setting and system selections; add
|
||||||
|
those IDs only when the pipeline imports a matching catalog.
|
||||||
|
|
||||||
## Input Fixtures
|
## Input Fixtures
|
||||||
|
|
||||||
- [Speakers](speakers.yml), [autocorrect](autocorrect.yml), and
|
- [Speakers](speakers.yml) and [glossary](glossary.yml) show standalone
|
||||||
[glossary](glossary.yml) show the standalone input shapes.
|
formats. Autocorrection is authored inline in campaign or session configuration.
|
||||||
- The sample campaign references its local
|
- The sample campaign uses its local [speakers](campaigns/sample-campaign/speakers.yml),
|
||||||
[speakers](campaigns/sample-campaign/speakers.yml),
|
[glossary](campaigns/sample-campaign/glossary.yml), and
|
||||||
[autocorrect](campaigns/sample-campaign/autocorrect.yml),
|
[party](campaigns/sample-campaign/party.yml). Narratio derives players from
|
||||||
[glossary](campaigns/sample-campaign/glossary.yml), and canonical
|
the roster and writes the Seriatim autocorrection input during preparation.
|
||||||
[party](campaigns/sample-campaign/party.yml) fixture, plus an optional
|
- The synthetic [reference catalog](reference-catalog/catalog.yml) is adapted
|
||||||
[spell-catalog overlay](campaigns/sample-campaign/spell_catalog.json) that
|
from catalog commit `02dd53c6ea026347452d497350c40249c949f8ce`, under CC0-1.0;
|
||||||
follows the Notarius v0.7 contract. Narratio derives the players projection
|
see [attribution](../docs/oss/attribution.md).
|
||||||
from this party source.
|
|
||||||
- [Sample speaker audio](audio/sample-speaker.flac) is a text placeholder that
|
- [Sample speaker audio](audio/sample-speaker.flac) is a text placeholder that
|
||||||
reserves the expected filename and directory shape. Replace it with a real
|
reserves the expected filename and directory shape. Replace it with a real
|
||||||
FLAC file before running transcription.
|
supported recording before running transcription; keep the configured filename
|
||||||
|
or update the session file to match.
|
||||||
|
|
||||||
The examples contain environment-variable names but no credential values. Set
|
The examples contain environment-variable names but no credential values. Set
|
||||||
`OBJECT_STORAGE_KEY_ID`, `OBJECT_STORAGE_KEY`, `AUDITA_LLM_API_KEY`, and
|
`OBJECT_STORAGE_KEY_ID`, `OBJECT_STORAGE_KEY`, `AUDITA_LLM_API_KEY`, and
|
||||||
@@ -73,11 +105,11 @@ examples that reference them. They use fictional campaign content and reserved
|
|||||||
example domains. The Audita and Notarius names are example references, not
|
example domains. The Audita and Notarius names are example references, not
|
||||||
implicit aliases: external backend/profile configurations must use those exact
|
implicit aliases: external backend/profile configurations must use those exact
|
||||||
names, or the Narratio credential lists must be changed to match. See the
|
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)
|
[Audita v4.3.0 configuration guide](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
||||||
for maintained downstream configuration examples.
|
for maintained downstream configuration examples.
|
||||||
|
|
||||||
For a deployed bundle, keep credential files out of source control in a
|
For a deployed bundle, keep credential files out of source control. Select a
|
||||||
`secrets/` directory beside the root `pipeline.yml`, one file per referenced
|
directory in the main pipeline or provide environment values; see
|
||||||
environment-variable name, or select another directory with `--secrets-dir`.
|
[Secrets Handling](../docs/config.md#secrets-handling).
|
||||||
Static S3 credentials are optional: omit both S3 credential references to use
|
Static S3 credentials are optional: omit both S3 credential references to use
|
||||||
the AWS SDK discovery chain.
|
the AWS SDK discovery chain.
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
[]
|
|
||||||
|
|
||||||
18
examples/campaigns/lantern-coast/campaign.yml
Normal file
18
examples/campaigns/lantern-coast/campaign.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Synthetic three-file campaign example.
|
||||||
|
schema_version: maximumdirect.rpg.campaign.v1
|
||||||
|
id: lantern-coast
|
||||||
|
name: Lantern Coast expedition
|
||||||
|
setting: lantern_coast_sample
|
||||||
|
system: sample_magic
|
||||||
|
references:
|
||||||
|
party: ./party.yml
|
||||||
|
narratio:
|
||||||
|
inputs:
|
||||||
|
speakers_file: ./speakers.yml
|
||||||
|
glossary:
|
||||||
|
entries:
|
||||||
|
- id: glass-harbor
|
||||||
|
name: Glass Harbor
|
||||||
|
category: place
|
||||||
|
aliases: [The Harbor]
|
||||||
|
autocorrect: []
|
||||||
11
examples/campaigns/lantern-coast/party.yml
Normal file
11
examples/campaigns/lantern-coast/party.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
schema_version: maximumdirect.rpg.party.v1
|
||||||
|
characters:
|
||||||
|
mira:
|
||||||
|
player:
|
||||||
|
name: Rowan
|
||||||
|
character:
|
||||||
|
name: Mira
|
||||||
|
aliases: [Mira of Glass Harbor]
|
||||||
|
classes:
|
||||||
|
- name: Wizard
|
||||||
|
level: 3
|
||||||
7
examples/campaigns/lantern-coast/speakers.yml
Normal file
7
examples/campaigns/lantern-coast/speakers.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
match:
|
||||||
|
- speaker: Rowan
|
||||||
|
match:
|
||||||
|
- Rowan_recording
|
||||||
|
- speaker: GM
|
||||||
|
match:
|
||||||
|
- GM_recording
|
||||||
@@ -1 +0,0 @@
|
|||||||
[]
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
campaign_id: sample-campaign
|
schema_version: maximumdirect.rpg.campaign.v1
|
||||||
session_template_file: ./session.template.yml
|
id: sample-campaign
|
||||||
inputs:
|
config:
|
||||||
speakers_file: ./speakers.yml
|
imports:
|
||||||
autocorrect_file: ./autocorrect.yml
|
- path: fragments/inputs.yml
|
||||||
glossary_file: ./glossary.yml
|
required: true
|
||||||
party_file: ./party.yml
|
|
||||||
spell_catalog_file: ./spell_catalog.json
|
|
||||||
|
|||||||
12
examples/campaigns/sample-campaign/fragments/brenna.yml
Normal file
12
examples/campaigns/sample-campaign/fragments/brenna.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
brenna:
|
||||||
|
player:
|
||||||
|
name: Rowan Hale
|
||||||
|
character:
|
||||||
|
name: Brenna
|
||||||
|
aliases:
|
||||||
|
- Shield of Dawn
|
||||||
|
classes:
|
||||||
|
- name: paladin
|
||||||
|
level: 6
|
||||||
|
- name: warlock
|
||||||
|
level: 2
|
||||||
8
examples/campaigns/sample-campaign/fragments/inputs.yml
Normal file
8
examples/campaigns/sample-campaign/fragments/inputs.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
references:
|
||||||
|
party: ../party.yml
|
||||||
|
narratio:
|
||||||
|
session_template_file: ../session.template.yml
|
||||||
|
inputs:
|
||||||
|
speakers_file: ../speakers.yml
|
||||||
|
glossary_file: ../glossary.yml
|
||||||
|
autocorrect: []
|
||||||
@@ -1 +1,5 @@
|
|||||||
[]
|
schema_version: maximumdirect.glossary.v1
|
||||||
|
collections:
|
||||||
|
campaign:
|
||||||
|
entries:
|
||||||
|
- {id: lantern_watch, name: Lantern Watch, category: organization}
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
schema_version: narratio.party.v1
|
schema_version: maximumdirect.rpg.party.v1
|
||||||
|
config:
|
||||||
|
imports:
|
||||||
|
- path: fragments/brenna.yml
|
||||||
|
destination: [characters]
|
||||||
|
required: true
|
||||||
|
|
||||||
characters:
|
characters:
|
||||||
arannis:
|
arannis:
|
||||||
@@ -6,21 +11,9 @@ characters:
|
|||||||
name: Rowan Hale
|
name: Rowan Hale
|
||||||
character:
|
character:
|
||||||
name: Arannis
|
name: Arannis
|
||||||
alias:
|
aliases:
|
||||||
- Ari
|
- Ari
|
||||||
- The Grey Owl
|
- The Grey Owl
|
||||||
classes:
|
classes:
|
||||||
- name: wizard
|
- name: wizard
|
||||||
level: 8
|
level: 8
|
||||||
brenna:
|
|
||||||
player:
|
|
||||||
name: Rowan Hale
|
|
||||||
character:
|
|
||||||
name: Brenna
|
|
||||||
alias:
|
|
||||||
- Shield of Dawn
|
|
||||||
classes:
|
|
||||||
- name: paladin
|
|
||||||
level: 6
|
|
||||||
- name: warlock
|
|
||||||
level: 2
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"schema_version": "notarius.dnd.spell-catalog-overlay.v1",
|
|
||||||
"catalogs": [
|
|
||||||
{
|
|
||||||
"id": "narratio.sample-campaign",
|
|
||||||
"ruleset": "dnd-5e-2014",
|
|
||||||
"source": {
|
|
||||||
"title": "Narratio sample campaign spell names"
|
|
||||||
},
|
|
||||||
"spells": [
|
|
||||||
{
|
|
||||||
"name": "Aegis of Emberfall",
|
|
||||||
"aliases": ["Emberfall Aegis"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
8
examples/glossary-authoring/combined.yml
Normal file
8
examples/glossary-authoring/combined.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Inline records compose above the file using ConfigKit entry identities.
|
||||||
|
narratio:
|
||||||
|
inputs:
|
||||||
|
glossary_file: ../glossary.yml
|
||||||
|
glossary:
|
||||||
|
instruction: Use established campaign terminology.
|
||||||
|
entries:
|
||||||
|
- {id: lantern_watch, name: Silver Watch, category: organization}
|
||||||
4
examples/glossary-authoring/file-only.yml
Normal file
4
examples/glossary-authoring/file-only.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Campaign inputs fragment; select the adjacent sample file when importing this fragment.
|
||||||
|
narratio:
|
||||||
|
inputs:
|
||||||
|
glossary_file: ../glossary.yml
|
||||||
6
examples/glossary-authoring/inline-only.yml
Normal file
6
examples/glossary-authoring/inline-only.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Campaign inputs fragment; include the required roster and other inputs separately.
|
||||||
|
narratio:
|
||||||
|
inputs:
|
||||||
|
glossary:
|
||||||
|
entries:
|
||||||
|
- {id: watch, name: Silver Watch, category: organization}
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
[]
|
schema_version: maximumdirect.glossary.v1
|
||||||
|
collections:
|
||||||
|
campaign:
|
||||||
|
entries:
|
||||||
|
- {id: lantern_watch, name: Lantern Watch, category: organization}
|
||||||
|
|||||||
10
examples/pipeline.catalog.yml
Normal file
10
examples/pipeline.catalog.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Synthetic catalog example; production installations select their own local catalog.
|
||||||
|
config:
|
||||||
|
imports:
|
||||||
|
- path: reference-catalog/catalog.yml
|
||||||
|
required: true
|
||||||
|
campaigns:
|
||||||
|
root: /usr/local/share/narratio/campaigns
|
||||||
|
default_campaign_id: sample-campaign
|
||||||
|
whisperx:
|
||||||
|
transcribe_url: https://transcription.example.com/transcribe
|
||||||
@@ -15,29 +15,16 @@ notarius:
|
|||||||
pipeline_id: dnd-session
|
pipeline_id: dnd-session
|
||||||
timeout: 3h
|
timeout: 3h
|
||||||
references:
|
references:
|
||||||
glossary: narratio.input.glossary
|
glossary: narratio.input.glossary.combined
|
||||||
party: narratio.input.party
|
party: narratio.input.party
|
||||||
players: narratio.input.players
|
spell_catalog: narratio.input.glossary.combined
|
||||||
spell_catalog: narratio.input.spell_catalog
|
|
||||||
outputs:
|
outputs:
|
||||||
npc_registry:
|
npc_registry:
|
||||||
lane_id: npc-registry
|
lane_id: npc-registry
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.npc_registry
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/npc-registry
|
|
||||||
location_registry:
|
location_registry:
|
||||||
lane_id: location-registry
|
lane_id: location-registry
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.location_registry
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/location-registry
|
|
||||||
scene_descriptions:
|
scene_descriptions:
|
||||||
lane_id: scene-descriptions
|
lane_id: scene-descriptions
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.scene_descriptions
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/scene-descriptions
|
|
||||||
|
|
||||||
scriptorium:
|
scriptorium:
|
||||||
binary: scriptorium
|
binary: scriptorium
|
||||||
|
|||||||
@@ -4,11 +4,14 @@
|
|||||||
workspace:
|
workspace:
|
||||||
# Optional: defaults to /var/lib/narratio.
|
# Optional: defaults to /var/lib/narratio.
|
||||||
root: /var/lib/narratio/workspace
|
root: /var/lib/narratio/workspace
|
||||||
# Optional: remove run-scoped workdir after successful publish commit.
|
# Optional: remove the session run history after successful publish commit.
|
||||||
|
# See docs/operations.md#cleanup.
|
||||||
cleanup_after_publish: false
|
cleanup_after_publish: false
|
||||||
|
|
||||||
# Credential files, when used, belong in a sibling secrets/ directory or in the
|
# Optional configured bootstrap; see the ConfigKit configured-startup contract:
|
||||||
# directory selected with --secrets-dir; they are not pipeline configuration.
|
# https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap
|
||||||
|
# config:
|
||||||
|
# secrets_dir: secrets
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
# Defaults to "local". Use "s3" explicitly for publish + S3 audio workflows.
|
# Defaults to "local". Use "s3" explicitly for publish + S3 audio workflows.
|
||||||
@@ -22,7 +25,8 @@ storage:
|
|||||||
region: us-east-1
|
region: us-east-1
|
||||||
endpoint: ""
|
endpoint: ""
|
||||||
force_path_style: false
|
force_path_style: false
|
||||||
# Optional; defaults shown explicitly.
|
# Optional operator-selected secret-reference names; omit both for the provider chain.
|
||||||
|
# See docs/config.md#secrets-handling.
|
||||||
access_key_id: OBJECT_STORAGE_KEY_ID
|
access_key_id: OBJECT_STORAGE_KEY_ID
|
||||||
secret_access_key: OBJECT_STORAGE_KEY
|
secret_access_key: OBJECT_STORAGE_KEY
|
||||||
|
|
||||||
@@ -32,12 +36,6 @@ campaigns:
|
|||||||
# Optional command default when --campaign is omitted.
|
# Optional command default when --campaign is omitted.
|
||||||
default_campaign_id: sample-campaign
|
default_campaign_id: sample-campaign
|
||||||
|
|
||||||
spool:
|
|
||||||
# Optional; defaults to /var/spool/narratio.
|
|
||||||
root: /var/spool/narratio
|
|
||||||
# Optional cleanup of run-scoped spool audio after successful publish commit.
|
|
||||||
delete_audio_after_publish: false
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
# Optional booleans; defaults are true.
|
# Optional booleans; defaults are true.
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -59,8 +57,7 @@ publish:
|
|||||||
- source: narratio.artifact.player_handout
|
- source: narratio.artifact.player_handout
|
||||||
dest: artifacts/player_handout.md
|
dest: artifacts/player_handout.md
|
||||||
required: false
|
required: false
|
||||||
# Extraction lanes publish only when named explicitly; the bundle and index
|
# Extraction lanes publish only when named explicitly; the bundle stays local.
|
||||||
# are never implicit publish sources.
|
|
||||||
- source: narratio.extraction.npc_registry
|
- source: narratio.extraction.npc_registry
|
||||||
dest: artifacts/extraction/npc-registry.json
|
dest: artifacts/extraction/npc-registry.json
|
||||||
required: true
|
required: true
|
||||||
@@ -75,6 +72,10 @@ whisperx:
|
|||||||
retry_delay: 2s
|
retry_delay: 2s
|
||||||
concurrency: 2
|
concurrency: 2
|
||||||
|
|
||||||
|
render:
|
||||||
|
# Omit variants to render both, or select only the variants needed.
|
||||||
|
variants: [normalized, trimmed]
|
||||||
|
|
||||||
seriatim:
|
seriatim:
|
||||||
# Optional overrides; defaults shown explicitly.
|
# Optional overrides; defaults shown explicitly.
|
||||||
binary: seriatim
|
binary: seriatim
|
||||||
@@ -93,9 +94,10 @@ audita:
|
|||||||
# Optional overrides. Audita owns its own configuration and profiles.
|
# Optional overrides. Audita owns its own configuration and profiles.
|
||||||
binary: audita
|
binary: audita
|
||||||
timeout: 3h
|
timeout: 3h
|
||||||
# Names must match credentials on every backend in the Audita v2 config.
|
# Names must match credentials on the configured Audita backends.
|
||||||
credentials: [AUDITA_LLM_API_KEY]
|
credentials: [AUDITA_LLM_API_KEY]
|
||||||
# Omit modules for Audita's default sequence; modules: [] disables corrections.
|
debug: false # true requests a run-local Audita debug capture
|
||||||
|
# Configure processing order in Audita configuration.
|
||||||
overlay: ""
|
overlay: ""
|
||||||
proposal_profile: ""
|
proposal_profile: ""
|
||||||
validation_profile: ""
|
validation_profile: ""
|
||||||
@@ -104,13 +106,11 @@ audita:
|
|||||||
output_schema: audita-v1
|
output_schema: audita-v1
|
||||||
|
|
||||||
normalize:
|
normalize:
|
||||||
# Optional; defaults shown explicitly.
|
|
||||||
output_path: transcripts/final.json
|
output_path: transcripts/final.json
|
||||||
output_schema: seriatim-intermediate
|
output_schema: seriatim-intermediate
|
||||||
report: true
|
report: true
|
||||||
|
|
||||||
trim:
|
trim:
|
||||||
# Optional; defaults shown explicitly.
|
|
||||||
enabled: true
|
enabled: true
|
||||||
output_path: transcripts/final.trimmed.json
|
output_path: transcripts/final.trimmed.json
|
||||||
bounds:
|
bounds:
|
||||||
@@ -138,85 +138,43 @@ notarius:
|
|||||||
pipeline_id: dnd-session
|
pipeline_id: dnd-session
|
||||||
timeout: 3h
|
timeout: 3h
|
||||||
working_directory: /usr/local/etc/notarius
|
working_directory: /usr/local/etc/notarius
|
||||||
# Reuse compatible accepted Notarius checkpoints during executed extraction.
|
# Forced extraction requests refresh from Notarius.
|
||||||
# The Notarius config must enable recording and provide persistent cache roots.
|
cache: auto
|
||||||
resume: true
|
debug: false # true requests run-local Notarius debug capture
|
||||||
# auto uses or creates a source-addressed chunk plan. Forced Narratio
|
|
||||||
# extraction overrides this with refresh and disables checkpoint loading.
|
|
||||||
chunk_cache: auto
|
|
||||||
# External campaign references use prepared Narratio source IDs. Omit an
|
# External campaign references use prepared Narratio source IDs. Omit an
|
||||||
# optional binding when the selected Notarius pipeline does not need it.
|
# optional binding when the selected Notarius pipeline does not need it.
|
||||||
references:
|
references:
|
||||||
glossary: narratio.input.glossary
|
glossary: narratio.input.glossary.combined
|
||||||
party: narratio.input.party
|
party: narratio.input.party
|
||||||
players: narratio.input.players
|
spell_catalog: narratio.input.glossary.combined
|
||||||
spell_catalog: narratio.input.spell_catalog
|
# Each key creates source narratio.extraction.<key> for its selected lane.
|
||||||
# Each key creates source narratio.extraction.<key>. These constraints match
|
|
||||||
# the current Notarius D&D lane contracts; update them with Notarius.
|
|
||||||
outputs:
|
outputs:
|
||||||
item_registry:
|
item_registry:
|
||||||
lane_id: item-registry
|
lane_id: item-registry
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.item_registry
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/item-registry
|
|
||||||
npc_registry:
|
npc_registry:
|
||||||
lane_id: npc-registry
|
lane_id: npc-registry
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.npc_registry
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/npc-registry
|
|
||||||
location_registry:
|
location_registry:
|
||||||
lane_id: location-registry
|
lane_id: location-registry
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.location_registry
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/location-registry
|
|
||||||
scene_descriptions:
|
scene_descriptions:
|
||||||
lane_id: scene-descriptions
|
lane_id: scene-descriptions
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.scene_descriptions
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/scene-descriptions
|
|
||||||
item_occurrences:
|
item_occurrences:
|
||||||
lane_id: item-occurrences
|
lane_id: item-occurrences
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.item_occurrences
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/item-occurrences
|
|
||||||
spells:
|
spells:
|
||||||
lane_id: spells
|
lane_id: spells
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.spells
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/spells
|
|
||||||
combat_turns:
|
combat_turns:
|
||||||
lane_id: combat-turns
|
lane_id: combat-turns
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.combat_turns
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/combat-turns
|
|
||||||
npc_occurrences:
|
npc_occurrences:
|
||||||
lane_id: npc-occurrences
|
lane_id: npc-occurrences
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.npc_occurrences
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/npc-occurrences
|
|
||||||
location_occurrences:
|
location_occurrences:
|
||||||
lane_id: location-occurrences
|
lane_id: location-occurrences
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.location_occurrences
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/location-occurrences
|
|
||||||
enemy_events:
|
enemy_events:
|
||||||
lane_id: enemy-events
|
lane_id: enemy-events
|
||||||
media_type: application/json
|
|
||||||
schema_id: notarius.dnd.enemy_events
|
|
||||||
schema_version: v1
|
|
||||||
module_key: dnd/enemy-events
|
|
||||||
|
|
||||||
scriptorium:
|
scriptorium:
|
||||||
binary: scriptorium
|
binary: scriptorium
|
||||||
|
# Select provider names provisioned through Narratio's environment/secrets.
|
||||||
|
# Used for requirements inspection, trim, analysis, and render-debug calls.
|
||||||
|
# credentials: [OPENROUTER_API_KEY, RAKESTRAWHOME_API_KEY]
|
||||||
config_path: /usr/local/etc/scriptorium/config.yml
|
config_path: /usr/local/etc/scriptorium/config.yml
|
||||||
timeout: 10m
|
timeout: 10m
|
||||||
render_debug: false
|
render_debug: false
|
||||||
@@ -242,7 +200,7 @@ scriptorium:
|
|||||||
source: narratio.input.party
|
source: narratio.input.party
|
||||||
required: true
|
required: true
|
||||||
glossary:
|
glossary:
|
||||||
source: narratio.input.glossary
|
source: narratio.input.glossary.campaign
|
||||||
required: false
|
required: false
|
||||||
vars:
|
vars:
|
||||||
session_id: true
|
session_id: true
|
||||||
@@ -253,7 +211,8 @@ scriptorium:
|
|||||||
|
|
||||||
# Example dependent artifact:
|
# Example dependent artifact:
|
||||||
# - depends_on entries use artifact keys.
|
# - depends_on entries use artifact keys.
|
||||||
# - narratio.artifact.<key> sources require matching depends_on membership.
|
# - narratio.artifact.<key> inputs infer dependency edges; depends_on adds explicit ordering.
|
||||||
|
# - See docs/config.md for artifact dependency configuration.
|
||||||
player_handout:
|
player_handout:
|
||||||
enabled: true
|
enabled: true
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
# If this file is installed under /etc/narratio, install the selected catalog
|
||||||
|
# at /etc/narratio/reference-catalog and enable its root-relative import:
|
||||||
|
# config:
|
||||||
|
# imports:
|
||||||
|
# - path: reference-catalog/catalog.yml
|
||||||
|
# required: true
|
||||||
|
|
||||||
workspace:
|
workspace:
|
||||||
root: /var/lib/narratio/workspace
|
root: /var/lib/narratio/workspace
|
||||||
cleanup_after_publish: true
|
cleanup_after_publish: true
|
||||||
@@ -15,10 +22,6 @@ campaigns:
|
|||||||
root: /usr/local/share/narratio/campaigns
|
root: /usr/local/share/narratio/campaigns
|
||||||
default_campaign_id: sample-campaign
|
default_campaign_id: sample-campaign
|
||||||
|
|
||||||
spool:
|
|
||||||
root: /var/spool/narratio
|
|
||||||
delete_audio_after_publish: true
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
enabled: true
|
enabled: true
|
||||||
upload_run: true
|
upload_run: true
|
||||||
@@ -58,7 +61,7 @@ audita:
|
|||||||
binary: audita
|
binary: audita
|
||||||
timeout: 3h
|
timeout: 3h
|
||||||
credentials: [AUDITA_LLM_API_KEY]
|
credentials: [AUDITA_LLM_API_KEY]
|
||||||
# Omit modules to use Audita defaults; modules: [] disables corrections.
|
# Configure processing order in Audita configuration.
|
||||||
output_schema: audita-v1
|
output_schema: audita-v1
|
||||||
|
|
||||||
normalize:
|
normalize:
|
||||||
@@ -68,6 +71,7 @@ normalize:
|
|||||||
|
|
||||||
scriptorium:
|
scriptorium:
|
||||||
binary: scriptorium
|
binary: scriptorium
|
||||||
|
# credentials: [OPENROUTER_API_KEY] # Enable when this provider is configured.
|
||||||
config_path: /usr/local/etc/scriptorium/config.yml
|
config_path: /usr/local/etc/scriptorium/config.yml
|
||||||
timeout: 10m
|
timeout: 10m
|
||||||
render_debug: false
|
render_debug: false
|
||||||
@@ -92,7 +96,7 @@ scriptorium:
|
|||||||
source: narratio.input.party
|
source: narratio.input.party
|
||||||
required: true
|
required: true
|
||||||
glossary:
|
glossary:
|
||||||
source: narratio.input.glossary
|
source: narratio.input.glossary.campaign
|
||||||
required: false
|
required: false
|
||||||
vars:
|
vars:
|
||||||
session_id: true
|
session_id: true
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
scriptorium:
|
|
||||||
artifact_families:
|
|
||||||
character_items:
|
character_items:
|
||||||
enabled: true
|
enabled: true
|
||||||
for_each: party.characters
|
for_each: party.characters
|
||||||
prompt_id: dnd.character_items
|
prompt_id: dnd.character_items
|
||||||
profile_id: production-placeholder
|
profile_id: production-placeholder
|
||||||
output_path_pattern: artifacts/characters/{character_id}/items.md
|
output_path_pattern: artifacts/{character_id}-items.md
|
||||||
inputs:
|
inputs:
|
||||||
character_meta:
|
character_meta:
|
||||||
source: narratio.member_artifact.character_meta
|
source: narratio.member_artifact.character_meta
|
||||||
@@ -17,4 +15,4 @@ scriptorium:
|
|||||||
publish:
|
publish:
|
||||||
enabled: true
|
enabled: true
|
||||||
required: false
|
required: false
|
||||||
dest_pattern: artifacts/characters/{character_id}/items.md
|
dest_pattern: artifacts/{character_id}-items.md
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
scriptorium:
|
|
||||||
artifact_families:
|
|
||||||
character_meta:
|
character_meta:
|
||||||
enabled: true
|
enabled: true
|
||||||
for_each: party.characters
|
for_each: party.characters
|
||||||
prompt_id: dnd.character_meta
|
prompt_id: dnd.character_meta
|
||||||
profile_id: production-placeholder
|
profile_id: production-placeholder
|
||||||
output_path_pattern: artifacts/characters/{character_id}/meta.md
|
output_path_pattern: artifacts/{character_id}-meta.md
|
||||||
member_vars:
|
member_vars:
|
||||||
character_id: character_id
|
character_id: character_id
|
||||||
character_name: character.name
|
character_name: character.name
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
scriptorium:
|
|
||||||
artifacts:
|
|
||||||
player_handout:
|
|
||||||
enabled: true
|
enabled: true
|
||||||
prompt_id: dnd.player_handout
|
prompt_id: dnd.player_handout
|
||||||
profile_id: production-placeholder
|
profile_id: production-placeholder
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
scriptorium:
|
|
||||||
artifacts:
|
|
||||||
session_recap:
|
|
||||||
enabled: true
|
enabled: true
|
||||||
prompt_id: dnd.session_recap
|
prompt_id: dnd.session_recap
|
||||||
profile_id: production-placeholder
|
profile_id: production-placeholder
|
||||||
|
|||||||
@@ -4,9 +4,3 @@ workspace:
|
|||||||
campaigns:
|
campaigns:
|
||||||
root: ../../campaigns
|
root: ../../campaigns
|
||||||
default_campaign_id: sample-campaign
|
default_campaign_id: sample-campaign
|
||||||
|
|
||||||
cache:
|
|
||||||
root: ./cache
|
|
||||||
|
|
||||||
spool:
|
|
||||||
root: ./spool
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ seriatim:
|
|||||||
|
|
||||||
audita:
|
audita:
|
||||||
binary: audita
|
binary: audita
|
||||||
modules: [glossary, grammar]
|
|
||||||
output_schema: audita-v1
|
output_schema: audita-v1
|
||||||
proposal_profile: narratio-production-model-placeholder
|
proposal_profile: narratio-production-model-placeholder
|
||||||
validation_profile: narratio-production-validator-placeholder
|
validation_profile: narratio-production-validator-placeholder
|
||||||
|
|||||||
@@ -1,3 +1,15 @@
|
|||||||
|
config:
|
||||||
|
sequences:
|
||||||
|
- destination: [publish, outputs]
|
||||||
|
key: source
|
||||||
|
mode: upsert
|
||||||
|
|
||||||
|
publish:
|
||||||
|
outputs:
|
||||||
|
- source: narratio.transcript.final_markdown
|
||||||
|
dest: transcripts/final.md
|
||||||
|
required: false
|
||||||
|
|
||||||
audita:
|
audita:
|
||||||
proposal_profile: narratio-testing-model-placeholder
|
proposal_profile: narratio-testing-model-placeholder
|
||||||
validation_profile: narratio-testing-validator-placeholder
|
validation_profile: narratio-testing-validator-placeholder
|
||||||
@@ -9,6 +21,7 @@ scriptorium:
|
|||||||
player_handout:
|
player_handout:
|
||||||
profile_id: testing-placeholder
|
profile_id: testing-placeholder
|
||||||
testing_notes:
|
testing_notes:
|
||||||
|
extends: session_recap
|
||||||
enabled: false
|
enabled: false
|
||||||
output_path: artifacts/testing-notes.md
|
output_path: artifacts/testing-notes.md
|
||||||
artifact_families:
|
artifact_families:
|
||||||
|
|||||||
@@ -1,13 +1,25 @@
|
|||||||
# Copyable production-base/testing-overlay entry point. ConfigKit expands only
|
# ConfigKit assembles these declared sources; destinations define artifact IDs.
|
||||||
# these explicit path and glob imports; Narratio never scans directories itself.
|
config:
|
||||||
configkit:
|
|
||||||
imports:
|
imports:
|
||||||
- path: conf.d/platform.yml
|
- path: conf.d/platform.yml
|
||||||
|
required: true
|
||||||
- path: conf.d/storage.yml
|
- path: conf.d/storage.yml
|
||||||
|
required: true
|
||||||
- path: conf.d/transcript.yml
|
- path: conf.d/transcript.yml
|
||||||
|
required: true
|
||||||
- path: conf.d/publish.yml
|
- path: conf.d/publish.yml
|
||||||
- glob: artifacts/*.yml
|
required: true
|
||||||
- glob: artifact-families/*.yml
|
- path: conf.d/local.yml
|
||||||
|
- path: artifacts/session_recap.yml
|
||||||
|
destination: [scriptorium, artifacts, session_recap]
|
||||||
|
required: true
|
||||||
|
- path: artifacts/player_handout.yml
|
||||||
|
destination: [scriptorium, artifacts, player_handout]
|
||||||
|
required: true
|
||||||
|
- dir: artifact-families
|
||||||
|
pattern: "*.yml"
|
||||||
|
destination: [scriptorium, artifact_families]
|
||||||
|
required: true
|
||||||
|
|
||||||
scriptorium:
|
scriptorium:
|
||||||
binary: scriptorium
|
binary: scriptorium
|
||||||
|
|||||||
5
examples/reference-catalog/catalog.yml
Normal file
5
examples/reference-catalog/catalog.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
reference_catalog:
|
||||||
|
settings:
|
||||||
|
lantern_coast_sample: ./setting.yml
|
||||||
|
systems:
|
||||||
|
sample_magic: ./spells.yml
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
collections:
|
||||||
|
setting:
|
||||||
|
entries:
|
||||||
|
- id: harbor_crossing
|
||||||
|
name: Harbor Crossing
|
||||||
|
category: place
|
||||||
|
aliases: [The Crossing]
|
||||||
7
examples/reference-catalog/fragments/sample-spells.yml
Normal file
7
examples/reference-catalog/fragments/sample-spells.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
collections:
|
||||||
|
spells:
|
||||||
|
entries:
|
||||||
|
- id: tide_step
|
||||||
|
name: Tide Step
|
||||||
|
category: spell
|
||||||
|
aliases: [Tidal Step]
|
||||||
16
examples/reference-catalog/setting.yml
Normal file
16
examples/reference-catalog/setting.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
config:
|
||||||
|
imports:
|
||||||
|
- path: fragments/lantern-coast-places.yml
|
||||||
|
required: true
|
||||||
|
schema_version: maximumdirect.glossary.v1
|
||||||
|
collections:
|
||||||
|
setting:
|
||||||
|
provenance:
|
||||||
|
id: lantern_coast_sample
|
||||||
|
title: Lantern Coast synthetic sample
|
||||||
|
license: CC0-1.0
|
||||||
|
entries:
|
||||||
|
- id: lantern_coast
|
||||||
|
name: Lantern Coast
|
||||||
|
category: place
|
||||||
|
description: A fictional coast in the sample setting.
|
||||||
16
examples/reference-catalog/spells.yml
Normal file
16
examples/reference-catalog/spells.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
config:
|
||||||
|
imports:
|
||||||
|
- path: fragments/sample-spells.yml
|
||||||
|
required: true
|
||||||
|
schema_version: maximumdirect.glossary.v1
|
||||||
|
collections:
|
||||||
|
spells:
|
||||||
|
provenance:
|
||||||
|
id: sample_magic
|
||||||
|
title: Sample Magic synthetic sample
|
||||||
|
license: CC0-1.0
|
||||||
|
entries:
|
||||||
|
- id: lantern_glow
|
||||||
|
name: Lantern Glow
|
||||||
|
category: spell
|
||||||
|
description: A fictional light-producing spell.
|
||||||
2
examples/session-inputs/local-audio.yml
Normal file
2
examples/session-inputs/local-audio.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
inputs:
|
||||||
|
audio_dir: ../audio
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
config:
|
||||||
|
imports:
|
||||||
|
- path: session-inputs/local-audio.yml
|
||||||
|
required: true
|
||||||
session_id: 2026-05-03
|
session_id: 2026-05-03
|
||||||
date: 2026-05-03
|
date: 2026-05-03
|
||||||
title: Sample Session
|
title: Sample Session
|
||||||
inputs:
|
|
||||||
audio_dir: ./audio
|
|
||||||
|
|||||||
5
examples/session.published-products.yml
Normal file
5
examples/session.published-products.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Start downstream work after importing this session's published products.
|
||||||
|
# Add an audio source if transcription or forced transcription is selected.
|
||||||
|
session_id: 2026-05-03
|
||||||
|
date: 2026-05-03
|
||||||
|
title: Sample Session
|
||||||
20
go.mod
20
go.mod
@@ -1,14 +1,18 @@
|
|||||||
module gitea.maximumdirect.net/eric/narratio
|
module gitea.maximumdirect.net/eric/narratio/v4
|
||||||
|
|
||||||
go 1.26.0
|
go 1.27.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
gitea.maximumdirect.net/eric/ConfigKit v0.4.2
|
|
||||||
github.com/aws/aws-sdk-go-v2/config v1.32.17
|
github.com/aws/aws-sdk-go-v2/config v1.32.17
|
||||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.16
|
github.com/aws/aws-sdk-go-v2/credentials v1.19.16
|
||||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.101.0
|
github.com/aws/aws-sdk-go-v2/service/s3 v1.101.0
|
||||||
github.com/aws/smithy-go v1.25.1
|
github.com/aws/smithy-go v1.25.1
|
||||||
github.com/google/go-cmp v0.7.0
|
github.com/google/go-cmp v0.7.0
|
||||||
|
github.com/santhosh-tekuri/jsonschema/v6 v6.0.3
|
||||||
|
go.maximumdirect.net/ckconfig v0.11.0
|
||||||
|
go.maximumdirect.net/commandkit v0.8.0
|
||||||
|
go.maximumdirect.net/configkit v1.4.0
|
||||||
|
go.maximumdirect.net/releasekit v0.10.0
|
||||||
golang.org/x/sync v0.22.0
|
golang.org/x/sync v0.22.0
|
||||||
golang.org/x/sys v0.47.0
|
golang.org/x/sys v0.47.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
@@ -29,5 +33,13 @@ require (
|
|||||||
github.com/aws/aws-sdk-go-v2/service/sso v1.30.17 // indirect
|
github.com/aws/aws-sdk-go-v2/service/sso v1.30.17 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.21 // indirect
|
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.21 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.42.1 // indirect
|
github.com/aws/aws-sdk-go-v2/service/sts v1.42.1 // indirect
|
||||||
go.yaml.in/yaml/v4 v4.0.0-rc.6 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
|
github.com/spf13/cobra v1.10.2 // indirect
|
||||||
|
github.com/spf13/pflag v1.1.0 // indirect
|
||||||
|
github.com/yuin/goldmark/v2 v2.1.16 // indirect
|
||||||
|
go.yaml.in/yaml/v4 v4.0.0 // indirect
|
||||||
|
golang.org/x/mod v0.43.0 // indirect
|
||||||
|
golang.org/x/text v0.14.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
tool go.maximumdirect.net/releasekit/cmd/releasekit
|
||||||
|
|||||||
34
go.sum
34
go.sum
@@ -1,5 +1,3 @@
|
|||||||
gitea.maximumdirect.net/eric/ConfigKit v0.4.2 h1:ZMxmv8pOnLtAx2hFTf8Z+pHKUbR89xErkBhwjr4yK24=
|
|
||||||
gitea.maximumdirect.net/eric/ConfigKit v0.4.2/go.mod h1:tYWpsrbLyu05r8+1MapWp5fN6ZrX9I8hU2xEPedYmYk=
|
|
||||||
github.com/aws/aws-sdk-go-v2 v1.41.7 h1:DWpAJt66FmnnaRIOT/8ASTucrvuDPZASqhhLey6tLY8=
|
github.com/aws/aws-sdk-go-v2 v1.41.7 h1:DWpAJt66FmnnaRIOT/8ASTucrvuDPZASqhhLey6tLY8=
|
||||||
github.com/aws/aws-sdk-go-v2 v1.41.7/go.mod h1:4LAfZOPHNVNQEckOACQx60Y8pSRjIkNZQz1w92xpMJc=
|
github.com/aws/aws-sdk-go-v2 v1.41.7/go.mod h1:4LAfZOPHNVNQEckOACQx60Y8pSRjIkNZQz1w92xpMJc=
|
||||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.10 h1:gx1AwW1Iyk9Z9dD9F4akX5gnN3QZwUB20GGKH/I+Rho=
|
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.10 h1:gx1AwW1Iyk9Z9dD9F4akX5gnN3QZwUB20GGKH/I+Rho=
|
||||||
@@ -36,14 +34,42 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.42.1 h1:F/M5Y9I3nwr2IEpshZgh1GeHpOIt
|
|||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.42.1/go.mod h1:mTNxImtovCOEEuD65mKW7DCsL+2gjEH+RPEAexAzAio=
|
github.com/aws/aws-sdk-go-v2/service/sts v1.42.1/go.mod h1:mTNxImtovCOEEuD65mKW7DCsL+2gjEH+RPEAexAzAio=
|
||||||
github.com/aws/smithy-go v1.25.1 h1:J8ERsGSU7d+aCmdQur5Txg6bVoYelvQJgtZehD12GkI=
|
github.com/aws/smithy-go v1.25.1 h1:J8ERsGSU7d+aCmdQur5Txg6bVoYelvQJgtZehD12GkI=
|
||||||
github.com/aws/smithy-go v1.25.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
|
github.com/aws/smithy-go v1.25.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
|
||||||
|
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||||
|
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
|
||||||
|
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
go.yaml.in/yaml/v4 v4.0.0-rc.6/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
|
github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 h1:1EYB5IzjZawrrnELUi78f9fPu57HuXjmddZPjrls/28=
|
||||||
|
github.com/santhosh-tekuri/jsonschema/v6 v6.0.3/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
|
||||||
|
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
|
||||||
|
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
|
||||||
|
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/spf13/pflag v1.1.0 h1:6W6MbVUrnMb8PEhjkqwsVLY7ryuzRfFHF4mQd7L94ag=
|
||||||
|
github.com/spf13/pflag v1.1.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/yuin/goldmark/v2 v2.1.16 h1:MXvCVo+Cb2SVJ5cwJUzXetDjI7HECRJCkcqylEQtcJo=
|
||||||
|
github.com/yuin/goldmark/v2 v2.1.16/go.mod h1:G6M4/qOFtfn01/o14BU1UR2Lo5N3S9Qo7xCuz/sHjGQ=
|
||||||
|
go.maximumdirect.net/ckconfig v0.11.0 h1:oTPW5R4vW5TNs97rqgABC/dir723rbGBz0FUyZ9QiNk=
|
||||||
|
go.maximumdirect.net/ckconfig v0.11.0/go.mod h1:9phvXeLAgQSBKpJWqPyIQASKVJr0nRhiPMIQkfNhaRo=
|
||||||
|
go.maximumdirect.net/commandkit v0.8.0 h1:EBDjr7SvfgvVDsA2S95hkOhgZe7oGZdDvURDJxHyX48=
|
||||||
|
go.maximumdirect.net/commandkit v0.8.0/go.mod h1:sVp3JXKpm2YrP4Ie8Q3nWmQgwBdPN8uO+wQU72erDns=
|
||||||
|
go.maximumdirect.net/configkit v1.4.0 h1:TfOupZbQ23/ZMs+xt5lmyukCF11ekqKep8KbmFQD63o=
|
||||||
|
go.maximumdirect.net/configkit v1.4.0/go.mod h1:ewu6blSokUDCMovy8JBXAdXRikGmlHXAQpFghnPWRfs=
|
||||||
|
go.maximumdirect.net/releasekit v0.10.0 h1:3GOgaIigXTkvYaRkntWZASE//2NTR1+IhkoKmt64aJo=
|
||||||
|
go.maximumdirect.net/releasekit v0.10.0/go.mod h1:cT5NZNEcf7SKDx4MPG40YNK9V4bNyIxcLLFuNlbGQ90=
|
||||||
|
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
||||||
|
go.yaml.in/yaml/v4 v4.0.0 h1:/LG1pNO84Z4l603j/xMn69CcS5OYhMQ/f7l2LoQUGuw=
|
||||||
|
go.yaml.in/yaml/v4 v4.0.0/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
|
||||||
|
golang.org/x/mod v0.43.0 h1:MFuq5J6s35W9D3IjkwyWc9vHh0nENOrt5K8Iof4ofmg=
|
||||||
|
golang.org/x/mod v0.43.0/go.mod h1:4ec1JnuyBz5+FIVhg86UsA39YG8BpnrZdJYSNHmGzHY=
|
||||||
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
|
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
|
||||||
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||||
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
|
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
|
||||||
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||||
|
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||||
|
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
|||||||
@@ -6,12 +6,17 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"gitea.maximumdirect.net/eric/narratio/internal/fileops"
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/fileops"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NoopRunner is a deterministic no-op audita adapter.
|
// NoopRunner is a deterministic no-op audita adapter.
|
||||||
type NoopRunner struct{}
|
type NoopRunner struct{}
|
||||||
|
|
||||||
|
// Preflight accepts the synthetic request in no-op environments.
|
||||||
|
func (*NoopRunner) Preflight(ctx context.Context, _ PolishRequest) (PreflightResult, error) {
|
||||||
|
return PreflightResult{}, ctx.Err()
|
||||||
|
}
|
||||||
|
|
||||||
// Run returns requested output path with placeholder metadata.
|
// Run returns requested output path with placeholder metadata.
|
||||||
func (n *NoopRunner) Run(ctx context.Context, req PolishRequest) (PolishResult, error) {
|
func (n *NoopRunner) Run(ctx context.Context, req PolishRequest) (PolishResult, error) {
|
||||||
if err := ctx.Err(); err != nil {
|
if err := ctx.Err(); err != nil {
|
||||||
@@ -34,6 +39,17 @@ type FakeRunner struct {
|
|||||||
Requests []PolishRequest
|
Requests []PolishRequest
|
||||||
Err error
|
Err error
|
||||||
Result PolishResult
|
Result PolishResult
|
||||||
|
PreflightRequests []PolishRequest
|
||||||
|
PreflightErr error
|
||||||
|
}
|
||||||
|
|
||||||
|
// Preflight records a readiness request in deterministic tests.
|
||||||
|
func (f *FakeRunner) Preflight(ctx context.Context, req PolishRequest) (PreflightResult, error) {
|
||||||
|
if err := ctx.Err(); err != nil {
|
||||||
|
return PreflightResult{}, err
|
||||||
|
}
|
||||||
|
f.PreflightRequests = append(f.PreflightRequests, req)
|
||||||
|
return PreflightResult{}, f.PreflightErr
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run records request and returns configured response.
|
// Run records request and returns configured response.
|
||||||
@@ -53,7 +69,7 @@ func (f *FakeRunner) Run(ctx context.Context, req PolishRequest) (PolishResult,
|
|||||||
res.ProcessedTranscriptPath = req.OutputProcessedPath
|
res.ProcessedTranscriptPath = req.OutputProcessedPath
|
||||||
}
|
}
|
||||||
if res.Reports == (ReportBundle{}) {
|
if res.Reports == (ReportBundle{}) {
|
||||||
dir := filepath.Dir(req.OutputProcessedPath)
|
dir := reportDirectory(req)
|
||||||
res.Reports = ReportBundle{
|
res.Reports = ReportBundle{
|
||||||
ErrorsPath: filepath.Join(dir, "errors.yml"),
|
ErrorsPath: filepath.Join(dir, "errors.yml"),
|
||||||
RecoveriesPath: filepath.Join(dir, "recoveries.yml"),
|
RecoveriesPath: filepath.Join(dir, "recoveries.yml"),
|
||||||
@@ -78,7 +94,7 @@ func (f *FakeRunner) Run(ctx context.Context, req PolishRequest) (PolishResult,
|
|||||||
func materializePlaceholders(req PolishRequest, reports bool) error {
|
func materializePlaceholders(req PolishRequest, reports bool) error {
|
||||||
if req.GeneratedConfigPath != "" {
|
if req.GeneratedConfigPath != "" {
|
||||||
payload := map[string]any{
|
payload := map[string]any{
|
||||||
"schema": "audita.generated.v2",
|
"schema": "audita.generated.v3",
|
||||||
"placeholder": true,
|
"placeholder": true,
|
||||||
"merged_transcript_path": req.MergedTranscriptPath,
|
"merged_transcript_path": req.MergedTranscriptPath,
|
||||||
"output_path": req.OutputProcessedPath,
|
"output_path": req.OutputProcessedPath,
|
||||||
@@ -111,7 +127,7 @@ func materializePlaceholders(req PolishRequest, reports bool) error {
|
|||||||
{"recoveries.yml", "schema: audita-recoveries\nversion: 1\nstatus: completed\nrecoveries: []\n"},
|
{"recoveries.yml", "schema: audita-recoveries\nversion: 1\nstatus: completed\nrecoveries: []\n"},
|
||||||
{"report.md", "# Audita report\n"},
|
{"report.md", "# Audita report\n"},
|
||||||
} {
|
} {
|
||||||
path := filepath.Join(filepath.Dir(req.OutputProcessedPath), report.name)
|
path := filepath.Join(reportDirectory(req), report.name)
|
||||||
if err := fileops.WriteFileAtomic(path, []byte(report.contents), fileops.WorkspaceFileMode); err != nil {
|
if err := fileops.WriteFileAtomic(path, []byte(report.contents), fileops.WorkspaceFileMode); err != nil {
|
||||||
return fmt.Errorf("write report %q: %w", path, err)
|
return fmt.Errorf("write report %q: %w", path, err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package audita
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"gitea.maximumdirect.net/eric/narratio/internal/fileops"
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/fileops"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
74
internal/adapters/audita/preflight.go
Normal file
74
internal/adapters/audita/preflight.go
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
package audita
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
_ "embed"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/adapters/subprocess"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed synthetic-transcript.json
|
||||||
|
var syntheticTranscript []byte
|
||||||
|
|
||||||
|
// SyntheticTranscript returns a detached known-good transcript for readiness
|
||||||
|
// checks where the real execution transcript does not yet exist.
|
||||||
|
func SyntheticTranscript() []byte { return append([]byte(nil), syntheticTranscript...) }
|
||||||
|
|
||||||
|
// PreflightResult records the native invocation outcome.
|
||||||
|
type PreflightResult struct {
|
||||||
|
ExitCode int
|
||||||
|
Duration time.Duration
|
||||||
|
}
|
||||||
|
|
||||||
|
// Preflight checks actual processing settings with a synthetic transcript and native smoke checks.
|
||||||
|
func (r *SubprocessRunner) Preflight(ctx context.Context, req PolishRequest) (PreflightResult, error) {
|
||||||
|
if r == nil {
|
||||||
|
return PreflightResult{}, fmt.Errorf("audita subprocess runner is nil")
|
||||||
|
}
|
||||||
|
if strings.TrimSpace(req.OutputProcessedPath) == "" {
|
||||||
|
return PreflightResult{}, fmt.Errorf("audita output processed path is required")
|
||||||
|
}
|
||||||
|
for i, path := range req.GlossaryFiles {
|
||||||
|
if strings.TrimSpace(path) == "" {
|
||||||
|
return PreflightResult{}, fmt.Errorf("audita glossary file at index %d is empty", i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dir, err := os.MkdirTemp("", "narratio-audita-preflight-")
|
||||||
|
if err != nil {
|
||||||
|
return PreflightResult{}, fmt.Errorf("create audita preflight directory: %w", err)
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(dir)
|
||||||
|
req.MergedTranscriptPath = filepath.Join(dir, "transcript.json")
|
||||||
|
req.StdoutLogPath = filepath.Join(dir, "stdout.log")
|
||||||
|
req.StderrLogPath = filepath.Join(dir, "stderr.log")
|
||||||
|
req.GeneratedConfigPath = filepath.Join(dir, "invocation.yml")
|
||||||
|
if err := os.WriteFile(req.MergedTranscriptPath, syntheticTranscript, 0600); err != nil {
|
||||||
|
return PreflightResult{}, fmt.Errorf("write synthetic transcript: %w", err)
|
||||||
|
}
|
||||||
|
args := r.buildArgs("preflight", req)
|
||||||
|
env, names, err := subprocess.CredentialEnvironment(r.cfg.Credentials)
|
||||||
|
if err != nil {
|
||||||
|
return PreflightResult{}, fmt.Errorf("audita credentials: %w", err)
|
||||||
|
}
|
||||||
|
if err := r.writeInvocationConfig(req, args, names); err != nil {
|
||||||
|
return PreflightResult{}, fmt.Errorf("write preflight invocation: %w", err)
|
||||||
|
}
|
||||||
|
run := r.run
|
||||||
|
if run == nil {
|
||||||
|
run = subprocess.Run
|
||||||
|
}
|
||||||
|
out, err := run(ctx, subprocess.RunRequest{Executable: r.cfg.Binary, Args: args, Timeout: r.cfg.Timeout, EnvOverrides: env, SensitiveEnvNames: names, DiagnosticOwner: "audita preflight", StdoutLogPath: req.StdoutLogPath, StderrLogPath: req.StderrLogPath})
|
||||||
|
result := PreflightResult{ExitCode: out.ExitCode, Duration: out.Duration}
|
||||||
|
if err != nil {
|
||||||
|
return result, fmt.Errorf("audita preflight failed: %w", err)
|
||||||
|
}
|
||||||
|
if out.ExitCode != 0 {
|
||||||
|
return result, fmt.Errorf("audita preflight failed with exit code %d", out.ExitCode)
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
114
internal/adapters/audita/preflight_test.go
Normal file
114
internal/adapters/audita/preflight_test.go
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
package audita
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"reflect"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/adapters/subprocess"
|
||||||
|
configkit "go.maximumdirect.net/configkit"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestPreflightUsesNativeProcessingSettingsAndCleansTemporaryInputs(t *testing.T) {
|
||||||
|
key := auditaTestSecret(t, "NARRATIO_PREFLIGHT_TEST_KEY", "synthetic-secret")
|
||||||
|
runner := auditaTestRunner(t, SubprocessRunnerConfig{Credentials: []configkit.Secret{key}, Debug: true, ConfigPath: "config.yml", Overlay: "testing", ProposalProfile: "proposal", ValidationProfile: "validation", OutputSchema: "audita-v1"})
|
||||||
|
req := auditaTestRequest(t)
|
||||||
|
req.GlossaryFiles = []string{filepath.Join(t.TempDir(), "party.yml"), filepath.Join(t.TempDir(), "campaign.yml"), filepath.Join(t.TempDir(), "setting.yml"), filepath.Join(t.TempDir(), "spells.yml")}
|
||||||
|
req.ReportDir = filepath.Join(t.TempDir(), "reports")
|
||||||
|
req.WorkDir = filepath.Join(t.TempDir(), "debug")
|
||||||
|
originalStdout := req.StdoutLogPath
|
||||||
|
if err := os.WriteFile(originalStdout, []byte("prior"), 0600); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
var captured subprocess.RunRequest
|
||||||
|
var tempDir string
|
||||||
|
runner.run = func(_ context.Context, r subprocess.RunRequest) (subprocess.RunResult, error) {
|
||||||
|
captured = r
|
||||||
|
tempDir = filepath.Dir(r.StdoutLogPath)
|
||||||
|
data, err := os.ReadFile(filepath.Join(tempDir, "transcript.json"))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
var transcript struct {
|
||||||
|
Segments []map[string]any `json:"segments"`
|
||||||
|
}
|
||||||
|
if err := json.Unmarshal(data, &transcript); err != nil || len(transcript.Segments) < 2 {
|
||||||
|
t.Fatalf("fixture: %s %v", data, err)
|
||||||
|
}
|
||||||
|
if r.StdoutLogPath == originalStdout || r.StderrLogPath == req.StderrLogPath {
|
||||||
|
t.Fatal("overwrote processing diagnostics")
|
||||||
|
}
|
||||||
|
if r.EnvOverrides["NARRATIO_PREFLIGHT_TEST_KEY"] != "synthetic-secret" || !reflect.DeepEqual(r.SensitiveEnvNames, []string{"NARRATIO_PREFLIGHT_TEST_KEY"}) {
|
||||||
|
t.Fatal("credential forwarding lost")
|
||||||
|
}
|
||||||
|
return subprocess.RunResult{}, nil
|
||||||
|
}
|
||||||
|
result, err := runner.Preflight(context.Background(), req)
|
||||||
|
if err != nil || result.ExitCode != 0 {
|
||||||
|
t.Fatalf("preflight: %+v %v", result, err)
|
||||||
|
}
|
||||||
|
args := runner.buildArgs("process", req)
|
||||||
|
if captured.Args[0] != "preflight" || !reflect.DeepEqual(captured.Args[2:], args[2:]) {
|
||||||
|
t.Fatalf("settings differ: %v vs %v", captured.Args, args)
|
||||||
|
}
|
||||||
|
if strings.Contains(strings.Join(captured.Args, " "), "--smoke=false") {
|
||||||
|
t.Fatal("smoke disabled")
|
||||||
|
}
|
||||||
|
if _, err := os.Stat(tempDir); !os.IsNotExist(err) {
|
||||||
|
t.Fatalf("temporary directory remains: %v", err)
|
||||||
|
}
|
||||||
|
prior, err := os.ReadFile(originalStdout)
|
||||||
|
if err != nil || string(prior) != "prior" {
|
||||||
|
t.Fatalf("prior diagnostics changed: %q %v", prior, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPreflightPreservesFailureAndRedactsDiagnostics(t *testing.T) {
|
||||||
|
const name = "NARRATIO_PREFLIGHT_SECRET"
|
||||||
|
secret := auditaTestSecret(t, name, "synthetic-private-value")
|
||||||
|
binary := filepath.Join(t.TempDir(), "helper")
|
||||||
|
writeAuditaTestFile(t, binary, "#!/bin/sh\nprintf 'provider rejected %s\\n' \"$"+name+"\" >&2\nexit 2\n")
|
||||||
|
if err := os.Chmod(binary, 0700); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
runner := auditaTestRunner(t, SubprocessRunnerConfig{Binary: binary, Credentials: []configkit.Secret{secret}})
|
||||||
|
result, err := runner.Preflight(context.Background(), auditaTestRequest(t))
|
||||||
|
if err == nil || result.ExitCode != 2 || !strings.Contains(err.Error(), "provider rejected") || strings.Contains(err.Error(), "synthetic-private-value") {
|
||||||
|
t.Fatalf("failure: %+v %v", result, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPreflightCancellationPreservesCause(t *testing.T) {
|
||||||
|
runner := auditaTestRunner(t, SubprocessRunnerConfig{})
|
||||||
|
runner.run = func(ctx context.Context, _ subprocess.RunRequest) (subprocess.RunResult, error) {
|
||||||
|
return subprocess.RunResult{Canceled: true}, ctx.Err()
|
||||||
|
}
|
||||||
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
cancel()
|
||||||
|
_, err := runner.Preflight(ctx, auditaTestRequest(t))
|
||||||
|
if !errors.Is(err, context.Canceled) {
|
||||||
|
t.Fatalf("cancellation: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPreflightCleansTemporaryFilesOnFailure(t *testing.T) {
|
||||||
|
runner := auditaTestRunner(t, SubprocessRunnerConfig{})
|
||||||
|
failure := errors.New("synthetic provider failure")
|
||||||
|
var tempDir string
|
||||||
|
runner.run = func(_ context.Context, r subprocess.RunRequest) (subprocess.RunResult, error) {
|
||||||
|
tempDir = filepath.Dir(r.StderrLogPath)
|
||||||
|
return subprocess.RunResult{ExitCode: 1}, failure
|
||||||
|
}
|
||||||
|
_, err := runner.Preflight(context.Background(), auditaTestRequest(t))
|
||||||
|
if !errors.Is(err, failure) {
|
||||||
|
t.Fatalf("cause lost: %v", err)
|
||||||
|
}
|
||||||
|
if _, err := os.Stat(tempDir); !os.IsNotExist(err) {
|
||||||
|
t.Fatalf("temporary directory remains: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,19 +11,19 @@ type Runner interface {
|
|||||||
Run(ctx context.Context, req PolishRequest) (PolishResult, error)
|
Run(ctx context.Context, req PolishRequest) (PolishResult, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PolishRequest describes an Audita invocation. Nil Modules uses the runner's
|
// PolishRequest describes an Audita invocation.
|
||||||
// configured selection; a non-nil empty slice selects no modules.
|
|
||||||
type PolishRequest struct {
|
type PolishRequest struct {
|
||||||
GeneratedConfigPath string
|
GeneratedConfigPath string
|
||||||
MergedTranscriptPath string
|
MergedTranscriptPath string
|
||||||
OutputProcessedPath string
|
OutputProcessedPath string
|
||||||
GlossaryPath string
|
GlossaryFiles []string
|
||||||
Modules []string
|
ReportDir string
|
||||||
|
WorkDir string
|
||||||
StdoutLogPath string
|
StdoutLogPath string
|
||||||
StderrLogPath string
|
StderrLogPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReportBundle contains optional reports adjacent to the requested output.
|
// ReportBundle contains optional reports in the requested report directory.
|
||||||
type ReportBundle struct {
|
type ReportBundle struct {
|
||||||
ErrorsPath string
|
ErrorsPath string
|
||||||
RecoveriesPath string
|
RecoveriesPath string
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package audita
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
@@ -10,9 +9,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
configkit "gitea.maximumdirect.net/eric/ConfigKit"
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/adapters/subprocess"
|
||||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/subprocess"
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/contracts"
|
||||||
"gitea.maximumdirect.net/eric/narratio/internal/fileops"
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/fileops"
|
||||||
|
configkit "go.maximumdirect.net/configkit"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MaxProcessedOutputBytes bounds Audita's processed-transcript JSON result.
|
// MaxProcessedOutputBytes bounds Audita's processed-transcript JSON result.
|
||||||
@@ -26,7 +26,7 @@ type SubprocessRunnerConfig struct {
|
|||||||
Binary string
|
Binary string
|
||||||
Timeout time.Duration
|
Timeout time.Duration
|
||||||
Credentials []configkit.Secret
|
Credentials []configkit.Secret
|
||||||
Modules []string
|
Debug bool
|
||||||
Overlay string
|
Overlay string
|
||||||
ProposalProfile string
|
ProposalProfile string
|
||||||
ValidationProfile string
|
ValidationProfile string
|
||||||
@@ -49,11 +49,6 @@ func NewSubprocessRunner(cfg SubprocessRunnerConfig) (*SubprocessRunner, error)
|
|||||||
if cfg.Timeout <= 0 {
|
if cfg.Timeout <= 0 {
|
||||||
return nil, fmt.Errorf("audita timeout must be > 0")
|
return nil, fmt.Errorf("audita timeout must be > 0")
|
||||||
}
|
}
|
||||||
for i, module := range cfg.Modules {
|
|
||||||
if strings.TrimSpace(module) == "" {
|
|
||||||
return nil, fmt.Errorf("audita module at index %d is empty", i)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
switch strings.TrimSpace(cfg.OutputSchema) {
|
switch strings.TrimSpace(cfg.OutputSchema) {
|
||||||
case "", "bare-segments", "audita-v1":
|
case "", "bare-segments", "audita-v1":
|
||||||
default:
|
default:
|
||||||
@@ -61,20 +56,9 @@ func NewSubprocessRunner(cfg SubprocessRunnerConfig) (*SubprocessRunner, error)
|
|||||||
}
|
}
|
||||||
cfg.Binary = strings.TrimSpace(cfg.Binary)
|
cfg.Binary = strings.TrimSpace(cfg.Binary)
|
||||||
cfg.Credentials = append([]configkit.Secret(nil), cfg.Credentials...)
|
cfg.Credentials = append([]configkit.Secret(nil), cfg.Credentials...)
|
||||||
cfg.Modules = cloneModules(cfg.Modules)
|
|
||||||
for i := range cfg.Modules {
|
|
||||||
cfg.Modules[i] = strings.TrimSpace(cfg.Modules[i])
|
|
||||||
}
|
|
||||||
return &SubprocessRunner{cfg: cfg, run: subprocess.Run}, nil
|
return &SubprocessRunner{cfg: cfg, run: subprocess.Run}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func cloneModules(modules []string) []string {
|
|
||||||
if modules == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return append([]string{}, modules...)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run executes Audita process and validates its corrected transcript.
|
// Run executes Audita process and validates its corrected transcript.
|
||||||
func (r *SubprocessRunner) Run(ctx context.Context, req PolishRequest) (PolishResult, error) {
|
func (r *SubprocessRunner) Run(ctx context.Context, req PolishRequest) (PolishResult, error) {
|
||||||
if r == nil {
|
if r == nil {
|
||||||
@@ -82,33 +66,24 @@ func (r *SubprocessRunner) Run(ctx context.Context, req PolishRequest) (PolishRe
|
|||||||
}
|
}
|
||||||
for _, field := range []struct{ name, value string }{
|
for _, field := range []struct{ name, value string }{
|
||||||
{"merged transcript path", req.MergedTranscriptPath},
|
{"merged transcript path", req.MergedTranscriptPath},
|
||||||
{"glossary path", req.GlossaryPath},
|
|
||||||
{"output processed path", req.OutputProcessedPath},
|
{"output processed path", req.OutputProcessedPath},
|
||||||
} {
|
} {
|
||||||
if strings.TrimSpace(field.value) == "" {
|
if strings.TrimSpace(field.value) == "" {
|
||||||
return PolishResult{}, fmt.Errorf("audita %s is required", field.name)
|
return PolishResult{}, fmt.Errorf("audita %s is required", field.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modules := req.Modules
|
for i, path := range req.GlossaryFiles {
|
||||||
if modules == nil {
|
if strings.TrimSpace(path) == "" {
|
||||||
modules = r.cfg.Modules
|
return PolishResult{}, fmt.Errorf("audita glossary file at index %d is empty", i)
|
||||||
}
|
|
||||||
for i, module := range modules {
|
|
||||||
if strings.TrimSpace(module) == "" {
|
|
||||||
return PolishResult{}, fmt.Errorf("audita module at index %d is empty", i)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modules = cloneModules(modules)
|
args := r.buildArgs("process", req)
|
||||||
for i := range modules {
|
|
||||||
modules[i] = strings.TrimSpace(modules[i])
|
|
||||||
}
|
|
||||||
args := r.buildArgs(req, modules)
|
|
||||||
env, names, err := subprocess.CredentialEnvironment(r.cfg.Credentials)
|
env, names, err := subprocess.CredentialEnvironment(r.cfg.Credentials)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return PolishResult{}, fmt.Errorf("audita credentials: %w", err)
|
return PolishResult{}, fmt.Errorf("audita credentials: %w", err)
|
||||||
}
|
}
|
||||||
if req.GeneratedConfigPath != "" {
|
if req.GeneratedConfigPath != "" {
|
||||||
if err := r.writeInvocationConfig(req, args, modules, names); err != nil {
|
if err := r.writeInvocationConfig(req, args, names); err != nil {
|
||||||
return PolishResult{}, fmt.Errorf("write audita invocation config %q: %w", req.GeneratedConfigPath, err)
|
return PolishResult{}, fmt.Errorf("write audita invocation config %q: %w", req.GeneratedConfigPath, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,17 +96,17 @@ func (r *SubprocessRunner) Run(ctx context.Context, req PolishRequest) (PolishRe
|
|||||||
EnvOverrides: env, SensitiveEnvNames: names, DiagnosticOwner: "audita",
|
EnvOverrides: env, SensitiveEnvNames: names, DiagnosticOwner: "audita",
|
||||||
StdoutLogPath: req.StdoutLogPath, StderrLogPath: req.StderrLogPath,
|
StdoutLogPath: req.StdoutLogPath, StderrLogPath: req.StderrLogPath,
|
||||||
})
|
})
|
||||||
result := r.result(req, modules, names, runRes)
|
result := r.result(req, names, runRes)
|
||||||
if runErr != nil {
|
if runErr != nil {
|
||||||
result.Reports, _ = discoverReports(req.OutputProcessedPath)
|
result.Reports, _ = discoverReports(reportDirectory(req))
|
||||||
return result, fmt.Errorf("run audita process (binary=%q, output_dir=%q, stdout_log=%q, stderr_log=%q): %w",
|
return result, fmt.Errorf("run audita process (binary=%q, output_dir=%q, stdout_log=%q, stderr_log=%q): %w",
|
||||||
r.cfg.Binary, filepath.Dir(req.OutputProcessedPath), req.StdoutLogPath, req.StderrLogPath, runErr)
|
r.cfg.Binary, filepath.Dir(req.OutputProcessedPath), req.StdoutLogPath, req.StderrLogPath, runErr)
|
||||||
}
|
}
|
||||||
if err := validateProcessedOutput(req.OutputProcessedPath); err != nil {
|
if err := validateProcessedOutput(req.OutputProcessedPath); err != nil {
|
||||||
result.Reports, _ = discoverReports(req.OutputProcessedPath)
|
result.Reports, _ = discoverReports(reportDirectory(req))
|
||||||
return result, fmt.Errorf("validate audita processed output %q: %w", req.OutputProcessedPath, err)
|
return result, fmt.Errorf("validate audita processed output %q: %w", req.OutputProcessedPath, err)
|
||||||
}
|
}
|
||||||
reports, err := discoverReports(req.OutputProcessedPath)
|
reports, err := discoverReports(reportDirectory(req))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
@@ -139,14 +114,14 @@ func (r *SubprocessRunner) Run(ctx context.Context, req PolishRequest) (PolishRe
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *SubprocessRunner) result(req PolishRequest, modules, names []string, runRes subprocess.RunResult) PolishResult {
|
func (r *SubprocessRunner) result(req PolishRequest, names []string, runRes subprocess.RunResult) PolishResult {
|
||||||
return PolishResult{
|
return PolishResult{
|
||||||
ProcessedTranscriptPath: req.OutputProcessedPath,
|
ProcessedTranscriptPath: req.OutputProcessedPath,
|
||||||
StdoutLogPath: req.StdoutLogPath, StderrLogPath: req.StderrLogPath,
|
StdoutLogPath: req.StdoutLogPath, StderrLogPath: req.StderrLogPath,
|
||||||
GeneratedConfigPath: req.GeneratedConfigPath, ExitCode: runRes.ExitCode,
|
GeneratedConfigPath: req.GeneratedConfigPath, ExitCode: runRes.ExitCode,
|
||||||
Duration: runRes.Duration, InvokedBinary: r.cfg.Binary,
|
Duration: runRes.Duration, InvokedBinary: r.cfg.Binary,
|
||||||
Metadata: map[string]any{
|
Metadata: map[string]any{
|
||||||
"adapter": "audita_subprocess", "modules": modules,
|
"adapter": "audita_subprocess", "glossary_files": req.GlossaryFiles, "report_dir": req.ReportDir, "work_dir": req.WorkDir, "debug": r.cfg.Debug,
|
||||||
"overlay": r.cfg.Overlay, "proposal_profile": r.cfg.ProposalProfile,
|
"overlay": r.cfg.Overlay, "proposal_profile": r.cfg.ProposalProfile,
|
||||||
"validation_profile": r.cfg.ValidationProfile,
|
"validation_profile": r.cfg.ValidationProfile,
|
||||||
"transcript_description": r.cfg.TranscriptDescription,
|
"transcript_description": r.cfg.TranscriptDescription,
|
||||||
@@ -156,37 +131,45 @@ func (r *SubprocessRunner) result(req PolishRequest, modules, names []string, ru
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *SubprocessRunner) buildArgs(req PolishRequest, modules []string) []string {
|
func (r *SubprocessRunner) buildArgs(command string, req PolishRequest) []string {
|
||||||
args := []string{"process", req.MergedTranscriptPath, "--glossary", req.GlossaryPath, "--output", req.OutputProcessedPath}
|
args := []string{command, req.MergedTranscriptPath, "--output", req.OutputProcessedPath}
|
||||||
if modules != nil {
|
for _, path := range req.GlossaryFiles {
|
||||||
args = append(args, "--modules", strings.Join(modules, ","))
|
args = append(args, "--glossary-file", path)
|
||||||
}
|
}
|
||||||
for _, setting := range []struct{ flag, value string }{
|
for _, setting := range []struct{ flag, value string }{
|
||||||
{"--config", r.cfg.ConfigPath}, {"--overlay", r.cfg.Overlay},
|
{"--config", r.cfg.ConfigPath}, {"--overlay", r.cfg.Overlay},
|
||||||
{"--proposal-profile", r.cfg.ProposalProfile}, {"--validation-profile", r.cfg.ValidationProfile},
|
{"--proposal-profile", r.cfg.ProposalProfile}, {"--validation-profile", r.cfg.ValidationProfile},
|
||||||
{"--transcript-description", r.cfg.TranscriptDescription}, {"--output-schema", r.cfg.OutputSchema},
|
{"--transcript-description", r.cfg.TranscriptDescription}, {"--output-schema", r.cfg.OutputSchema},
|
||||||
|
{"--report-dir", req.ReportDir}, {"--work-dir", req.WorkDir},
|
||||||
} {
|
} {
|
||||||
if setting.value != "" {
|
if setting.value != "" {
|
||||||
args = append(args, setting.flag, setting.value)
|
args = append(args, setting.flag, setting.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if r.cfg.Debug {
|
||||||
|
args = append(args, "--debug")
|
||||||
|
}
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *SubprocessRunner) writeInvocationConfig(req PolishRequest, args, modules, names []string) error {
|
func (r *SubprocessRunner) writeInvocationConfig(req PolishRequest, args, names []string) error {
|
||||||
return writeGeneratedYAML(req.GeneratedConfigPath, map[string]any{
|
return writeGeneratedYAML(req.GeneratedConfigPath, map[string]any{
|
||||||
"schema": "audita.generated.v2", "binary": r.cfg.Binary, "args": args,
|
"schema": "audita.generated.v3", "binary": r.cfg.Binary, "args": args, "timeout": r.cfg.Timeout.String(),
|
||||||
"timeout": r.cfg.Timeout.String(), "modules": modules,
|
"glossary_files": req.GlossaryFiles, "report_dir": req.ReportDir, "work_dir": req.WorkDir, "debug": r.cfg.Debug,
|
||||||
"overlay": r.cfg.Overlay, "proposal_profile": r.cfg.ProposalProfile,
|
"overlay": r.cfg.Overlay, "proposal_profile": r.cfg.ProposalProfile, "validation_profile": r.cfg.ValidationProfile,
|
||||||
"validation_profile": r.cfg.ValidationProfile,
|
"transcript_description": r.cfg.TranscriptDescription, "config_path": r.cfg.ConfigPath, "output_schema": r.cfg.OutputSchema,
|
||||||
"transcript_description": r.cfg.TranscriptDescription,
|
"merged_transcript_path": req.MergedTranscriptPath, "output_path": req.OutputProcessedPath, "credential_names": names,
|
||||||
"config_path": r.cfg.ConfigPath, "output_schema": r.cfg.OutputSchema,
|
|
||||||
"merged_transcript_path": req.MergedTranscriptPath, "glossary_path": req.GlossaryPath,
|
|
||||||
"output_path": req.OutputProcessedPath, "credential_names": names,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func discoverReports(outputPath string) (ReportBundle, error) {
|
func reportDirectory(req PolishRequest) string {
|
||||||
|
if req.ReportDir != "" {
|
||||||
|
return req.ReportDir
|
||||||
|
}
|
||||||
|
return filepath.Dir(req.OutputProcessedPath)
|
||||||
|
}
|
||||||
|
|
||||||
|
func discoverReports(reportDir string) (ReportBundle, error) {
|
||||||
var reports ReportBundle
|
var reports ReportBundle
|
||||||
for _, report := range []struct {
|
for _, report := range []struct {
|
||||||
name string
|
name string
|
||||||
@@ -196,7 +179,7 @@ func discoverReports(outputPath string) (ReportBundle, error) {
|
|||||||
{"recoveries.yml", &reports.RecoveriesPath},
|
{"recoveries.yml", &reports.RecoveriesPath},
|
||||||
{"report.md", &reports.OverviewPath},
|
{"report.md", &reports.OverviewPath},
|
||||||
} {
|
} {
|
||||||
path := filepath.Join(filepath.Dir(outputPath), report.name)
|
path := filepath.Join(reportDir, report.name)
|
||||||
info, err := os.Lstat(path)
|
info, err := os.Lstat(path)
|
||||||
if errors.Is(err, os.ErrNotExist) {
|
if errors.Is(err, os.ErrNotExist) {
|
||||||
continue
|
continue
|
||||||
@@ -207,7 +190,7 @@ func discoverReports(outputPath string) (ReportBundle, error) {
|
|||||||
if !info.Mode().IsRegular() {
|
if !info.Mode().IsRegular() {
|
||||||
return reports, fmt.Errorf("audita report %q is not a regular file", path)
|
return reports, fmt.Errorf("audita report %q is not a regular file", path)
|
||||||
}
|
}
|
||||||
if _, err := fileops.ReadFileBounded(path, MaxReportOutputBytes); err != nil {
|
if err := fileops.CheckFileBounded(path, MaxReportOutputBytes); err != nil {
|
||||||
return reports, fmt.Errorf("audita report %q exceeds or cannot be read within %d-byte limit: %w", path, MaxReportOutputBytes, err)
|
return reports, fmt.Errorf("audita report %q exceeds or cannot be read within %d-byte limit: %w", path, MaxReportOutputBytes, err)
|
||||||
}
|
}
|
||||||
*report.dest = path
|
*report.dest = path
|
||||||
@@ -220,16 +203,10 @@ func validateProcessedOutput(path string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("audita processed transcript result exceeds or cannot be read within %d-byte limit: %w", MaxProcessedOutputBytes, err)
|
return fmt.Errorf("audita processed transcript result exceeds or cannot be read within %d-byte limit: %w", MaxProcessedOutputBytes, err)
|
||||||
}
|
}
|
||||||
var payload map[string]any
|
err = contracts.ValidateTranscriptEnvelope(data)
|
||||||
if err := json.Unmarshal(data, &payload); err != nil {
|
var decode *contracts.TranscriptDecodeError
|
||||||
return fmt.Errorf("parse json: %w", err)
|
if errors.As(err, &decode) {
|
||||||
|
return fmt.Errorf("parse json: %w", decode.Err)
|
||||||
}
|
}
|
||||||
segments, ok := payload["segments"]
|
return err
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("top-level segments is required")
|
|
||||||
}
|
|
||||||
if _, ok := segments.([]any); !ok {
|
|
||||||
return fmt.Errorf("top-level segments must be an array")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user