From 13b28eeea80edd5d02c93bce50fc281acf3000b1 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 30 Nov 2026 12:16:02 +0000 Subject: [PATCH] Remove completed pipeline planning documents --- docs/adr/0001-classify-session-content.md | 6 +- ...002-assign-subprocess-content-ownership.md | 5 +- docs/development.md | 2 - docs/roadmap/examples/campaign/campaign.yml | 18 - docs/roadmap/examples/campaign/party.yml | 11 - docs/roadmap/examples/campaign/speakers.yml | 7 - docs/roadmap/implementation.md | 918 ------------------ docs/roadmap/pipeline.md | 612 ------------ docs/roadmap/remediation.md | 497 ---------- 9 files changed, 6 insertions(+), 2070 deletions(-) delete mode 100644 docs/roadmap/examples/campaign/campaign.yml delete mode 100644 docs/roadmap/examples/campaign/party.yml delete mode 100644 docs/roadmap/examples/campaign/speakers.yml delete mode 100644 docs/roadmap/implementation.md delete mode 100644 docs/roadmap/pipeline.md delete mode 100644 docs/roadmap/remediation.md diff --git a/docs/adr/0001-classify-session-content.md b/docs/adr/0001-classify-session-content.md index daa644b..7e3da8f 100644 --- a/docs/adr/0001-classify-session-content.md +++ b/docs/adr/0001-classify-session-content.md @@ -78,7 +78,7 @@ 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 [consolidated roadmap](../roadmap/pipeline.md) defines the selected physical -layout, latest-attempt views, retention boundaries, and new-session cutover. +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 roadmap. +Acceptance of this policy does not establish implementation of that layout. diff --git a/docs/adr/0002-assign-subprocess-content-ownership.md b/docs/adr/0002-assign-subprocess-content-ownership.md index eb1ef34..f263656 100644 --- a/docs/adr/0002-assign-subprocess-content-ownership.md +++ b/docs/adr/0002-assign-subprocess-content-ownership.md @@ -71,6 +71,7 @@ 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 [consolidated roadmap](../roadmap/pipeline.md) -defines debug placement, retained diagnostic views, and the new-session cutover. +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. diff --git a/docs/development.md b/docs/development.md index 10b5d86..7483a47 100644 --- a/docs/development.md +++ b/docs/development.md @@ -35,8 +35,6 @@ builds use the selected patch version and setup instructions in the | [OSS](policy/oss.md) | Adding or updating dependencies or incorporated third-party material, or changing licensing or attribution. | | [Release](policy/release.md) | Preparing or publishing a release, changing release procedures, or making versioning and compatibility decisions. | -The [pipeline roadmap](roadmap/pipeline.md) records the design and implementation history. - - Read applicable policies before making decisions they govern; multiple policies may apply. - Select policies using the task triggers above. Follow cross-references to diff --git a/docs/roadmap/examples/campaign/campaign.yml b/docs/roadmap/examples/campaign/campaign.yml deleted file mode 100644 index 3828f71..0000000 --- a/docs/roadmap/examples/campaign/campaign.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Planned Narratio interface: see ../../pipeline.md. -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: [] diff --git a/docs/roadmap/examples/campaign/party.yml b/docs/roadmap/examples/campaign/party.yml deleted file mode 100644 index ff7df85..0000000 --- a/docs/roadmap/examples/campaign/party.yml +++ /dev/null @@ -1,11 +0,0 @@ -schema_version: maximumdirect.rpg.party.v1 -characters: - mira: - player: - name: Rowan - character: - name: Mira - aliases: [Mira of Glass Harbor] - classes: - - name: Wizard - level: 3 diff --git a/docs/roadmap/examples/campaign/speakers.yml b/docs/roadmap/examples/campaign/speakers.yml deleted file mode 100644 index 005ac94..0000000 --- a/docs/roadmap/examples/campaign/speakers.yml +++ /dev/null @@ -1,7 +0,0 @@ -match: - - speaker: Rowan - match: - - Rowan_recording - - speaker: GM - match: - - GM_recording diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md deleted file mode 100644 index 7fbf732..0000000 --- a/docs/roadmap/implementation.md +++ /dev/null @@ -1,918 +0,0 @@ -# Shared pipeline cutover implementation plan - -## Purpose and execution instructions - -Implement the final state in [pipeline.md](pipeline.md). That roadmap owns product -intent, operator choices, upstream baselines, and compatibility scope. This plan -owns the ordered implementation steps. All stages below are initially pending. -Each stage is a bounded prompt for a Luna coding agent. Execute them in order. - -This is one end-to-end sprint across Narratio and `../narratio-reference-catalog`. -Intermediate stages may leave build errors or transitional test failures; record -the unresolved integration work and continue through the specified later stages. -Do not add temporary compatibility machinery to make an intermediate checkpoint -usable. A stage's completion means its assigned outcome is implemented and -reviewed; the sprint completes only after the final verification stage. - -Start with [Development](../development.md) and [Agent Policy](../policy/agents.md). -Read the architecture, testing, documentation, and OSS policies for their -applicable work. Read each owning repository's agent instructions before changing -it. Follow its scoped commit policy; record the commit and verification outcome -for each completed stage here. Preserve unrelated changes. Publication, release -tags, pushes, and changes to other upstream applications are outside this plan. - -Coverage map for the roadmap's verification outcomes: - -| Outcome | Primary stages | -| --- | --- | -| Campaign contract and initialization | 4–6, 8, 22 | -| Shared contracts and catalog | 1, 4, 5, 7 | -| Prepared inputs, glossaries, references | 8–9 | -| Flat destinations and collision checks | 3, 10, 12, 16 | -| Audita and Notarius execution | 11–13 | -| Readiness | 14 | -| Latest views and diagnostic routing | 15–16 | -| Audio simplification | 17 | -| New-state boundary, publication, restore, cleanup | 2, 18–20 | -| Reuse, force, and integration evidence | 21–22 | -| Canonical documentation and final verification | 23 | - -Read the complete feature roadmap once at sprint entry. Subsequent prompts can -read the named sections and owner documents for their stage. Inspect existing -tests and use codebase-memory-mcp for code discovery; the entry points below -identify owners rather than authorize indiscriminate rewrites. Prefer native -library APIs and the existing implementation boundaries. - -## Baseline and fixed implementation choices - -- Narratio baseline: `f2829f31e800551bce4a28ca73059d82357e61f7`. - It has native ConfigKit/CommandKit acquisition, four wrapperless glossaries, - Audita v4.2, Notarius v0.8.1 receipt/index handling, and the old workspace. -- Catalog baseline: `974b0403b610056f3477abb5dfa22d210cd3c2a9` at - `../narratio-reference-catalog`. Its catalog index and synthetic vocabulary - already exist; migration does not create real-world vocabulary. -- Use the exact released schema, ConfigKit, Audita, and Notarius revisions in - [Released baselines](pipeline.md#released-baselines-and-ownership). Obtain - contracts from those revisions, not an arbitrary later checkout. No schema SDK - import or subprocess Go-package dependency is required. -- Use `narratio.session-manifest.v2` as the new supported session-state marker. - Change the existing marker/validator, not a parallel migration framework. - Retain current remote commit/pointer formats unless a field actually changes. - Their referenced session manifest must be supported before local installation. -- Keep schema resources in a small `internal/domaininput` owner, with exact - versioned resource paths, adjacent semantics, and source provenance. It owns - shared structural/semantic validation, not configuration resolution or task - execution. Reuse the existing JSON Schema engine and register resources offline. -- Shared extensibility must survive typed binding. Use native dynamic mappings - and/or supported inline maps at extensible boundaries, retaining the actual - ConfigKit result and its presence/source evidence. Typed operational settings - remain strict. Do not round-trip YAML through a second loader to manufacture a - typed view; ordinary field interpretation yields separate domain views. -- Keep all campaign/session fields and omission rules exactly as specified in - [Campaign and session field layout](pipeline.md#campaign-and-session-field-layout). - Shared optional null rules and Narratio session clearing rules are distinct. -- Preserve the four individual glossary IDs and add exactly - `narratio.input.glossary.combined`, prepared as - `inputs/glossaries/combined.yml`. Bind it to both Notarius glossary roles. - The complete roster remains `narratio.input.party`. -- Keep existing absolute/relative output-path syntax where it can identify a - valid product destination. Analysis/bounds outputs must resolve directly under - `artifacts/`; combined transcripts directly under `transcripts/`. Extraction - output configuration gains optional `filename`, defaulting to `.json`. - It names one flat file, not a remote publish destination. -- Use reported Notarius bundle roots below the run-local staging output root. - Retain original bundle evidence under its producing run, with its prior - session-durable lifetime. Canonical extraction availability depends on promoted - files and Narratio evidence, not on an index or diagnostic bundle surviving. -- Keep current byte limits, credential handling, workspace sharing modes, - cancellation, and file confinement. Add neither new caps nor exact-error-text - contracts. Managed latest-attempt links are a specifically supported navigation - feature, not general permission to follow arbitrary symlinks. - -## Stage 1 — Bundle shared contracts and add offline domain validation - -**Complete.** Commit: `Bundle shared domain contracts and validation`. -Verification: `go test ./internal/domaininput ./internal/glossary ./internal/doccheck` -with Go 1.27.4 passed. The existing private glossary validator remains in use -until its callers migrate to shared envelopes in later stages. - -**Read:** roadmap “Shared acquisition and prepared inputs”; schema release -validation and each selected semantic document; OSS policy. Entry points: -`internal/glossary/glossary.go`, existing schema resources, and `go.mod`. - -**Implement:** - -1. Vendor the unmodified glossary, RPG party, and RPG campaign `0.2.0` schema - resources and their actual dependency closure from `2026.11.1`. Retain IDs, - semantics, exact source commit, and applicable licensing/attribution. -2. Add `internal/domaininput` using the existing JSON Schema dependency. Decode - schema-resource numbers exactly; register all required resources locally and - refuse missing-resource network retrieval through the compiler's loader. -3. Accept completed native domain values. Add only shared semantic checks not - expressed by JSON Schema, notably exact entry-ID uniqueness per collection. - Schema-valid extensions and omitted/null/empty distinctions remain data. -4. Replace the private glossary validator as callers migrate; leave acquisition - and composition with ConfigKit. Do not copy the schemas repository's harness. - -**Verify:** structural and semantic boundaries for all three contracts, valid -extensions, aliases null/empty, duplicate glossary IDs, and the class-level bound. -Use local synthetic fixtures; no sibling checkout is needed by default tests. - -## Stage 2 — Establish the supported-state boundary - -**Complete.** Commit: `Reject unsupported session state before execution and restore`. -Verification: `go test ./internal/app ./internal/manifest ./internal/artifacts -./internal/doccheck` with Go 1.27.4 passed, including forced local and remote -rejection without session-file mutation. Remote discovery uses the existing -strict manifest loader before planning. - -**Read:** roadmap “One cutover and durable-state boundary”; -[Manifest Internals](../internal/manifest.md) and -[Restore Internals](../internal/command-restore.md). Entry points: -`internal/manifest/{manifest,store}.go`, `internal/artifacts/current_state.go`, -runner acquisition, and restore discovery. - -**Implement:** - -1. Change creation, loading, saving, and validation to the selected v2 marker. - Keep current transcribe/analyze subcollections and their versioned contracts. -2. Reject unsupported local session state before changing historical session - files, creating execution workspaces, normalizing records, or attempting reuse. - Absence permits new-session creation; unsupported state is not absence. -3. Validate the session manifest in remote current-state discovery before restore - planning/installation and previous-session preparation. Do not migrate old - snapshots or change remote history. Disposable download staging is not a - conversion of historical state. -4. Preserve ordinary explicit whole-session deletion and lock behavior. Force - execution/restore does not reinterpret unsupported state as new-format data. - Explain regeneration or deliberate manual relocation using existing diagnostics. - -**Verify:** current/new state succeeds; old, absent-version, and unsupported local -and remote manifests fail without rewriting existing session files. Test through -runner and restore entry points, not just the version comparison function. - -## Stage 3 — Define the canonical workspace paths - -**Complete.** Commit: `Define canonical session workspace paths`. -Verification: focused path-model, layout, reference-snapshot, and run-local tests -passed with Go 1.27.4. The broader `internal/stage` test run still has two -publication failures because previous-session publication enumeration uses the -old path; its migration belongs to Stage 18. Restore tests also retain old -previous-session paths and are assigned to Stage 19. Root reports/config paths -remain temporarily in use by producers until their routing changes later. - -**Read:** roadmap “Final layout and ownership”; [Workspace Internals](../internal/workspace.md). -Entry points: `internal/artifacts/paths.go`, layout creation in its local store, -`internal/config` path constants, and `internal/stage/run_local.go`. - -**Implement:** - -1. Model flat products, raw/combined transcripts, inputs, audio, run-local - logs/debug, and latest-view paths through the existing path owner. -2. Move previous-session preparation to `inputs/previous/` and verified reference - snapshots to `inputs/references//`. Keep their existing - content identity and confinement rather than inventing another cache. -3. Remove unused root-level reports/config/current/cache scaffolding where it - has no remaining content role, plus `transcripts/trimmed/`. Route remaining - consumers to their selected category in later stages; add no legacy aliases. -4. Retain root, campaign/session identity, manifest, lock, and restore-marker - placement. Do not eagerly create run directories or latest links for reuse. - -**Verify:** path-model tests cover the complete target layout and preserved -configurable root. This stage defines paths; producer routing follows later. - -## Stage 4 — Adopt the shared roster with Narratio-wide validation - -**Complete.** Commit: `Adopt the shared party roster contract`. -Verification: `go test ./internal/config ./internal/domaininput ./internal/doccheck` -and focused party/roster stage tests passed with Go 1.27.4. A broader app/stage -run has the previously recorded publication and restore path transitions only. - -**Read:** roadmap “Narratio-wide roster requirements”; shared party semantics; -[Party Contract](../integrations/party.md). Entry points: `internal/config/party.go`, -party acquisition/rendering, `artifact_families.go`, and native party inspection. - -**Implement:** - -1. Acquire shared party envelopes through ConfigKit; validate the completed - mapping with Stage 1 and apply Narratio's existing nonempty roster, ID, - player/name/class, ambiguity, and positive-level requirements consistently. -2. Replace the marker and singular `alias` with shared `aliases`. Preserve - supported extensions and explicit shared null/empty states in retained data; - derive family/member and players views separately. Preserve deterministic - consumer ordering without claiming YAML map order is shared identity. -3. Update file/bytes loading, explicit `--party-file` selection, native inspection, - and canonical rendering together. An override selects the roster for the - invocation without rewriting the campaign's authored reference. -4. Keep stable character-based artifact IDs and the existing players projection - identity. Its local projection format need not become another shared schema. - -**Verify:** imports, overrides, whole-document extension forwarding, shared marker -and alias spelling, and consistent Narratio rejection even without class-related -artifacts. Family keys, dependencies, and repeated player names still work. - -## Stage 5 — Replace campaign and session configuration shapes - -**Complete.** Commit: `Adopt shared campaign and session configuration`. -Verification: focused shared-campaign, session-default, imported-origin, -snapshot, party, family, and template-path tests passed with Go 1.27.4; -`go test ./... -run '^$'` compiled all packages. A broader configuration and -application test run still contains many retired campaign/session fixtures and -the old prepared-autocorrection and spell-input consumers; acquisition, -preparation, and fixture reconciliation belong to Stages 6, 8, 21, and 22. -The shared optional-field binding and snapshot round trip were corrected in the -following session-acquisition commit after inspection exposed null expansion. - -**Read:** roadmap “Campaign and session field layout” and “Shared acquisition”; -[Configuration Internals](../internal/configuration.md). Entry points: -`config.go`, `document_configkit.go`, validation, resource resolution, and renderers. - -**Implement:** - -1. Replace campaign `campaign_id` with shared `id`; use `references.party`, root - setting/system selectors, and the specified `narratio.inputs` extension. - Validate the shared envelope and strict typed Narratio settings through the - native lifecycle. Preserve shared extensions outside those typed settings. -2. Add inline autocorrection rules with the existing Seriatim rule fields - `target` and `match`; keep explicit replacement behavior separate from glossary - data. Remove campaign/session `autocorrect_file` and `spell_catalog_file`. -3. Apply each session default independently. Absent inherits; supplied values - replace; `[]`/null clears autocorrection; supplied inline glossary replaces - that whole contribution. Clearing inline vocabulary does not clear its file. - Retain existing optional-selector clears and reject null/empty required paths. -4. Resolve resource origins at their new native paths, including inherited/imported - references. Keep identity agreement, CLI-relative invocation context, safe - snapshots, and captured provenance. Shared root optional-field nulls remain - invalid where upstream says so; do not impose that rule on session clears. -5. Add optional `pipeline.campaigns.session_template_file`, resolving its source - origin. Keep the explicit campaign template override under `narratio`. - -**Verify:** table-driven absent/null/empty/replacement cases, invalid retired keys, -wrong campaign identity, native imported origins, shared extensions, and strict -unknown operational fields. Exercise file and contextless session snapshots. - -## Stage 6 — Complete native acquisition, inspection, and session initialization - -**Complete.** Commit: `Complete native session acquisition and initialization`. -Verification: focused application tests for acquisition, independent native -inspection, party selection, remote authored-document preference, three-document -initialization, both template overrides, invalid templates, and template-relative -imports passed with Go 1.27.4. Focused shared-configuration tests also passed. - -**Read:** roadmap “Author once” and “Worked campaign bundle”; native acquisition -and inspection sections of Configuration Internals. Entry points: -`configuration_acquisition.go`, `configuration_commands.go`, campaign selection, -`session_init_command.go`, and session-template helpers. - -**Implement:** - -1. Thread the new campaign identity/roster/settings through lazy campaign/session - acquisition, derived catalogs, identity assertions, and local/remote session - loading. Preserve actual ConfigKit results for all inspection scopes. -2. Select templates in campaign → pipeline installation → built-in order. Use - existing narrow placeholders and explicit session/audio options; add a small - built-in template rather than a new templating engine or required installed file. -3. Keep independent comparison acquisition, source/history evidence, redaction, - and inspection-only override behavior. Native inspection must not present a - prepared document or derived catalog as the effective configuration. -4. Render valid local and remote session documents with the new defaults and - original authoring-context behavior. No new CLI route is needed. - -**Verify:** three-file setup initializes a session with no extra template; both -template overrides work and invalid selected templates do not fall back silently. -Cover party override, independent inspection, remote authored-session preference, -and source-relative template resources through existing application tests. - -## Stage 7 — Migrate the shared reference catalog and its local checks - -**Complete.** Catalog commit: `02dd53c6ea026347452d497350c40249c949f8ce` -(`Adopt shared glossary contracts in the reference catalog`). Verification in -the catalog with Go 1.27.4 and `GOPROXY=off GOSUMDB=off`: `go test ./...` -and `go run ./cmd/validate` passed after dependency preparation. Consumer -compatibility remains an opt-in Stage 22 verification. - -**Read:** roadmap “Reference catalog adoption”; catalog README, FORMAT, license, -agent instructions if present, and compatibility script. Work only in -`../narratio-reference-catalog` for its migration, then record its resulting commit. - -**Implement:** - -1. Convert the indexed setting/spell entry points to shared envelopes, retaining - selectors, paths, entries, and partial import fragments. Remove consumer - instruction fields from maintained examples. Keep provenance factual and CC0. -2. Replace its private schema with the exact shared glossary resources, semantics, - dependency closure, and notices. FORMAT becomes the catalog authoring/selection - guide; upstream remains the field-level owner. No resolved export copies. -3. Add a small Go development validator under `cmd/validate` and a minimal module - using ConfigKit v1.4.0 and the maintained JSON Schema engine. Validate every - indexed source after native imports, its expected setting/spells role, and - exact final entry-ID uniqueness. Partial examples validate after composition - with a complete fixture; no new private partial schema is necessary. -4. Add focused valid/invalid tests and a local CI invocation of the same checker. - Keep dependencies pinned, source paths relative to their native definitions, - and default checks offline after dependency preparation. Read-only checking - must not generate canonical vocabulary. Update notices for actual dependencies. -5. Update README/FORMAT and retain the opt-in compatibility script; final consumer - execution is Stage 22. Commit this repository's unit locally and record its - full new commit for Narratio examples/verification. No catalog tag is required. - -**Verify:** every indexed source and maintained example, imports, null aliases, -extensions, wrong marker/known shape, wrong collection role, and duplicate IDs. -Record `go test ./...` and validator results in the catalog checkout. Do not -require Narratio or Audita binaries for catalog validity. - -## Stage 8 — Prepare campaign, session, speaker, and autocorrection inputs - -**Complete.** Commit: `Prepare resolved documents and autocorrection rules`. -Verification: focused imported standalone-document, empty and populated rule, -checksum/provenance, reuse/invalidation, relocation, and prepared-source tests -passed with Go 1.27.4. The broader stage suite has the previously recorded -publication path failures and one maintained-example failure; the example -migration is assigned to Stage 22. - -**Read:** roadmap “Shared acquisition and prepared inputs”; -[Prepare Internals](../internal/stage-prepare.md). Entry points: `prepare.go`, -`prepare_resume.go`, prepared-input identities, config renderers, and semantic contracts. - -**Implement:** - -1. Materialize effective standalone new-format campaign/session/party documents, - unchanged speaker-mapping input, and the players projection in canonical - `inputs/` locations. Derive from completed results, not a second resolution pass. -2. Serialize selected autocorrection rules to the Seriatim input envelope - `autocorrect: [...]`, including an empty list when no replacements apply. - The campaign/session authored field is the rule list, not a file wrapper. - Reuse existing replacement semantics and adapter validation boundaries. -3. Keep manifest-backed checksum/size/provenance records for the generated input. - Resume compares effective rule bytes and source meaning, not obsolete authored - filenames. Preserve independent session replacement/clearing behavior. -4. Remove private spell-overlay copies, cleanup, and prepared records. Update - input-source registration to reject its retired source rather than alias it. - -**Verify:** imports and standalone snapshots, empty/nonempty autocorrection with -Seriatim-shaped files, checksum/provenance records, and changed rules triggering -ordinary preparation invalidation. Source relocation with equivalent effective -values must not gain a new blanket invalidator. - -## Stage 9 — Prepare shared glossary envelopes, combined input, and references - -**Complete.** Commit: `Prepare shared glossary envelopes and combined input`. -Verification: focused native composition, selected-only catalog acquisition, -individual/combined schema, dependency persistence, shared reference snapshot, -corruption, reuse, and safe publication-enumeration tests passed with Go 1.27.4. -The broader stage suite retains the previously recorded old-example and -publication-path transitions; downstream consumer execution is updated later. - -**Read:** roadmap “Glossary composition and bindings”. Entry points: -`internal/glossary/{glossary,resolve}.go`, glossary configuration adaptation, -prepared source registration, and `extract_references.go`. - -**Implement:** - -1. Resolve only selected catalog files and the optional campaign file/inline - contribution. Compose campaign under inline through native ConfigKit inputs - and sequence identities, then validate the completed shared mapping. -2. Derive party vocabulary from the selected canonical roster. Write four - individual shared envelopes and the combined envelope, each with the shared - marker and collections mapping. Always include all four roles in the combined - file, even when empty. Preserve applicable collection metadata/extensions. -3. Register the combined logical identity and explicit input dependencies. - Preserve complete source data where task projections omit it; do not turn - collection extraction into an upstream schema rewrite or custom merge engine. -4. Use the Stage 3 reference snapshot paths and existing streamed checksum/size - verification before/after execution. Share verified paths between generation - and readiness. These files are managed inputs, not subprocess cache. -5. Update prepare reuse comparison and safe publication input enumeration for - the fifth file; later lifecycle stages complete transport/install behavior. - -**Verify:** selected-only reads, native composition, empty and extended collections, -both Notarius roles resolving the same prepared source, four individual Audita -inputs, corrupted/missing snapshot handling, and whole-file invalidation when any -combined collection changes. Tests use a copied synthetic catalog, not a live repo. - -## Stage 10 — Configure flat outputs and native Notarius controls - -**Complete.** Commit: `Configure flat outputs and native Notarius controls`. -Verification: focused native configuration, retired-field rejection, extraction -filename, expanded-family/bounds/transcript collision, and explicit remote -destination tests passed with Go 1.27.4; `go test ./... -run '^$'` compiled all -packages. Older tests still author the retired campaign and Notarius formats; -their fixture reconciliation and the replacement extraction protocol follow in -the scheduled subsequent work. - -**Read:** roadmap “Output placement and collision checks” and Notarius invocation -and cache sections. Entry points: output config/validation, artifact-family -derivation, artifact catalogs, and bounded planning. - -**Implement:** - -1. Replace Notarius resume/chunk-cache settings with optional native `cache` - modes; add enable-only `debug`. Remove output descriptor constraint fields, - retaining required output keys/lane IDs and optional flat `filename` overrides. -2. Apply the fixed output naming choices above. Reconcile analysis/family/bounds - configuration with flat local products and combined-transcript categories. - Reject collisions across built-ins, extraction, explicit artifacts, and all - expanded families, naming both producers before execution. -3. Perform session/roster-dependent checks after domain derivation but before - an execution attempt; app-only inspection need not acquire a roster. Planning - and execution consume the same validated derived destinations. -4. Preserve explicit remote publish destinations and semantic source IDs. - Do not sanitize or silently rename colliding products, filter lanes implicitly, - or require descriptor fields the producer no longer supplies. - -**Verify:** native control omission/selection, retired-field rejection, default and -explicit extraction filenames, family/built-in cross-collisions, valid absolute -and relative canonical output forms, and unchanged remote destination semantics. - -## Stage 11 — Replace the Notarius generation adapter protocol - -**Complete.** Commit: `Adopt native Notarius completion reports`. -Verification: focused native argument, omission, successful fallback, failed -process, malformed report, and unsafe output-directory tests passed with Go -1.27.4; all packages compiled. The runner no longer parses receipt/index/sidecar -data; legacy test helpers and result fields remain temporarily for the extraction -consumer and fixtures migrated by the following work. - -**Read:** roadmap Notarius invocation/completion sections and pinned upstream -subprocess, output, and CLI contracts. Entry points: -`internal/adapters/notarius/{runner,subprocess,fake}.go` and supervision tests. - -**Implement:** - -1. Build native args: `--input-file`, `--overlay`, `--format json`, references, - staging output, native cache, and debug controls. Preserve omitted versus - explicit overlay selectors, exact credentials, timeouts, and cancellation. -2. Decode completion only after successful process exit. Preserve expected - pipeline, reported absolute directory, counts, optional debug location, and - positive fallback count. Require a confined reported root under supplied - staging; never discover outputs by scanning or parsing run names. -3. Replace receipt/index/sidecar structs and parsing with the native report. - Keep stdout separate from bounded redacted diagnostics. Handle nonzero, - malformed, partial, or capture-failed outcomes without recovering success - from incidental files. Add no independent domain-quality assessment. -4. Update fakes to represent the native result and actual published directory; - remove old receipt-driven fixture machinery as its callers migrate. - -**Verify:** argument vectors and environment, overlay omission/empty forwarding, -success/failure report delivery, unsafe directories, cancellation, and permissive -successful fallback. Do not compare artifact count with required lane count. - -## Stage 12 — Promote extraction products and replace extraction evidence - -**Complete.** Commit: `Promote native Notarius lane products`. -Verification: focused tests with Go 1.27.4 covered ten required lanes, custom -filenames and lane mapping, mapped-name collisions, missing and unsafe lanes, -partial promotion, a supervised subprocess report, canonical catalog/analysis/ -publication resolution, JSON manifest round trips, reuse without the bundle, -changed references, cache/debug-only changes, forced refresh, visible fallback -counts, and retention-aware run cleanup. All packages compiled with -`go test ./... -run '^$'`. Tests and compatibility fields for the retired -receipt-based fixtures remain for their scheduled reconciliation. - -**Read:** roadmap “Notarius completion, products, and cache”; artifact and extract -internals. Entry points: `extract.go`, `extract_resume.go`, extraction evidence, -catalog hydration/resolution, and source/publication metadata. - -**Implement:** - -1. Resolve required lanes using the upstream lane-ID filename mapping. Validate - bounded regular JSON files and stage every required result before promotion - to its Stage 10 flat destination. Keep existing promotion/failure semantics; - do not invent a multi-file transaction or rollback guarantee. -2. Record canonical output checksum/size, configured lane identity, factual - native completion metadata, and result-affecting reference/input evidence. - Remove `notarius_index` and descriptor/receipt acceptance dependencies. -3. Retain the original bundle under its producing run, including optional - chunk-map/evidence-context auxiliaries. Mark its retention role explicitly so - cleanup does not shorten the old bundle's session-durable lifetime. It is not - a required runtime index, wholesale publish payload, or diagnostic API. -4. Update runtime artifact resolution, status/catalog views, analysis inputs, - and resume to use canonical products and Narratio evidence. Display qualified - fallback counts for fresh and reused results without inferring lane quality. -5. Forced extract passes cache refresh; ordinary executed extract respects the - selected native mode. Cache/debug-only changes do not stale completed products. - Preserve transitive invalidation and old completed-file availability rules. - -**Verify:** all ten maintained lanes, custom filename mapping, missing/unsafe lane, -partial failure, durable promotion, independent canonical resolution, ordinary -reuse, changed references, forced refresh, and visible fallback on reuse. - -## Stage 13 — Adopt Audita shared inputs and workspace destinations - -**Complete.** Commit: `Verify Audita shared inputs and diagnostics`. -The shared request builder and native report/debug routing were already in place; -the maintained polish fixtures now use schema-validated shared envelopes with -explicit empty lists and inert extension data. Verification with Go 1.27.4 passed -for prepared-file parity, repeated glossary arguments, destination/debug modes, -failure reports, transcript acceptance, resume evidence, credentials, and -cancellation. Controlled real-binary evidence remains scheduled separately. - -**Read:** roadmap Audita section and pinned runtime-input/migration contracts; -[Polish Internals](../internal/stage-polish.md). Entry points: Audita adapter, -polish stage, production composition, and adapter boundary tests. - -**Implement:** - -1. Supply the four verified individual shared envelopes through existing repeated - `--glossary-file` args, including empty collections. Keep identical saved - inputs in process/preflight; retain config/overlay/profile and credential flow. -2. Keep collection selection, instruction handling, and empty-task readiness - downstream. No local nonempty-glossary rule or generated Audita config. -3. Select staged transcript output, actual polish logs/report destination, and - run-local diagnostic/debug destination through supported Audita controls. - Retain default ordinary reporting and enable-only debug behavior. -4. Keep existing transcript/report acceptance and failure evidence behavior. - Change semantic evidence for new prepared bytes without version-only reruns. - -**Verify:** repeated envelopes, explicit empty replacement, inert shared instruction -extensions, process/preflight parity, default reporting, failed-run reports, -debug on/off destinations, and unchanged transcript validation and cancellation. - -## Stage 14 — Integrate native Notarius readiness with shared preflight - -**Complete.** Commit: `Add native Notarius readiness checks`. -Verification with Go 1.27.4 covered projected selection and reuse, forced cache -refresh, preparation ordering, isolated automatic and explicit probe paths, -real-versus-synthetic input choice, prepared-reference integrity, complete lane -inspection, missing lanes, incomplete/failed assessments, cache warnings, -credential forwarding, cancellation, lazy initialization, and unchanged stage -records on failure. All packages compiled with `go test ./... -run '^$'`. -The pipeline-inspection shape was also checked against the pinned v0.10.0 -checkout; controlled real-binary interoperability evidence remains in Stage 22. - -**Read:** roadmap “Readiness and invocation lifecycle”; pinned Notarius preflight -and pipeline inspection contracts; [Preflight Internals](../internal/preflight.md). -Entry points: Notarius adapter, `internal/preflight`, `runner_preflight.go`, lazy -dependencies, and session validation. - -**Implement:** - -1. Add native Notarius pipeline preflight and pipeline inspection through the - adapter. Inspect required lane definitions because upstream readiness cannot - know Narratio's required-output map. Preserve incomplete inspection as such. -2. Select extraction readiness only when projected selected work requires it; - retain full Audita readiness and existing Scriptorium requirements discovery. - Run after selected prepare/reuse and before remaining selected processing. -3. Share execution config/overlay, refs, credentials, cache choice, and native - debug settings, but use diagnostic probe destinations outside actual attempt - views. Use a verified real execution transcript when available, otherwise the - known-good synthetic input; report the input actually checked. -4. Accept only successful process status plus a complete expected-pipeline - assessment with ready true. Preserve warnings, including nonfatal cache - warnings. Keep native failures, partial delivery, and optional debug locations. -5. Explicit session validation uses existing prepared inputs and its established - probe namespace. Planning remains subprocess-free; no preflight stage record, - cached readiness guarantee, second mandatory paid probe, profile list, or - additional automatic offline validation subprocess is introduced. - -**Verify:** target selection for bounded/reused/forced runs, preparation ordering, -missing lane/reference/provider, cache warnings, failed/incomplete reports, -synthetic limitations, lazy unrelated adapters, and probes leaving latest views -and ordinary stage records unchanged. Use controlled providers/subprocesses. - -## Stage 15 — Add latest-attempt log/debug views to the runner - -**Complete.** Commit: `Track latest stage attempt diagnostics`. -Verification with Go 1.27.4 covered first and repeated attempts, failed attempts, -empty debug directories, self-skips and reuse, distinct producer runs, relative -targets, reserved probe names, conflicting files and links, unsafe directory -components, creation failures, and workspace-free cleanup. The confined layout -checks also reject symlinked session directories. Focused preflight tests passed; -all packages compiled. Legacy fixture failures remain scheduled for reconciliation. - -**Read:** roadmap “Latest attempts, debug, and retention”; workspace and runner -lifecycle docs. Entry points: run-local path owner, `runner_runtime.go`, execution -attempt transitions, and shared file operations. - -**Implement:** - -1. Add one narrow operation creating actual run-local stage log/debug directories - and advancing the two relative session symlinks at an actual attempt boundary. - Use existing confined operations; do not weaken general symlink rejection. -2. Advance both views on attempts that fail, with an empty debug directory when - capture is absent. Leave skipped/reused stage views untouched. Keep physical - run creation lazy; preserve cleanup-only behavior when no diagnostics need it. -3. Keep actual paths in manifest/publication references. Probes do not advance - actual stage views. Restore's independent diagnostic group is wired in Stage 19. -4. Handle managed-link replacement and unexpected path conflicts with existing - error/confinement semantics; do not delete arbitrary conflicting content. - -**Verify:** first/repeated attempt, failure, no capture, skip/reuse, different -producing runs per stage, safe relative targets, unexpected conflicts, and -directory-write failure. Check that a reused invocation creates no empty run. - -## Stage 16 — Route all producer diagnostics and remaining flat products - -**Complete.** Commit: `Route producer diagnostics to run directories`. -Verification: focused artifact and producer-stage tests passed, including multiple -render invocations and debug-independent fingerprints; `go test ./... -run '^$'` -passed with Go 1.27.4. Broader publication tests still include old previous-cache -and extraction fixtures, to be reconciled in the publication, restore, and test -cutover stages. - -**Read:** roadmap workspace and diagnostics sections; focused merge, normalize, -trim, render, and analyze internals. Entry points: `run_local.go`, those stages, -Seriatim/Scriptorium adapters, and render-debug helpers. - -**Implement:** - -1. Send process streams, invocation descriptions, Seriatim execution reports, and - ordinary failures to actual stage log directories. Remove reports from - canonical artifacts and unused root-level diagnostic destinations. -2. Route Scriptorium prepared render-debug products to trim/analyze run-local - debug paths, keeping per-artifact selection and distinguishable invocation - names. Preserve declared publication eligibility for existing render-debug - products; full Audita/Notarius capture remains local. -3. Finish flat analysis/family/session-bounds promotion and direct combined/raw - transcript placement. Generated files consumed later retain their product - location. Update paths in invocation metadata and per-artifact evidence. -4. Keep debug enablement from invalidating products and preserve result stdout - versus redacted diagnostic separation. Do not add a Seriatim debug mode. - -**Verify:** representative successful/failed stages, multiple artifact invocations, -flat bounds/analysis/family outputs, log/debug categorization, preserved captured -result bytes, and correct latest views. Reuse existing stage tests rather than -creating a parallel orchestration harness. - -## Stage 17 — Simplify audio acquisition to one retained session copy - -**Complete.** Commit: `Keep one verified copy of session audio`. -Verification: focused audio, prepare, resume, cleanup, and command tests passed, -including reuse, changed or missing sources, corrupt bytes, failed download and -retry, and preservation of historical storage. All packages compile with -`go test ./... -run '^$'` using Go 1.27.4. Restore integration and remaining old -fixtures are reconciled in the subsequent restore and test cutover stages. - -**Read:** roadmap “Audio acquisition”; current audio and restore contracts. -Entry points: `internal/audio`, prepare audio handling, artifact spool/cache -helpers, configuration, and manifest local-path bookkeeping. - -**Implement:** - -1. Refactor S3 materialization to validate/reuse canonical session audio or - download into a temporary destination and install verified bytes there. - Preserve current source-object identity/content checks and cancellation. -2. Remove persistent audio-cache identities/sidecars, retained spool copies, - cache/spool configuration and cleanup controls, and obsolete manifest fields. - Retain narrowly necessary download staging; no separate retained copy remains. -3. Keep local audio collision handling, membership, checksums, and per-speaker - continuation evidence. Restore uses the same materializer in Stage 19. -4. Do not delete recordings, historical old-session caches, or prepared audio - automatically as a side effect of removing the old configuration feature. - -**Verify:** current prepared reuse, changed/missing/corrupt content, interrupted -download/retry, local/S3 selection, and no retained cache/spool duplicates. Missing -prepared audio is fetched again; separate subprocess caches are never targeted. - -## Stage 18 — Publish new-format products and prepared inputs - -**Complete.** Commit: `Publish prepared inputs and flat extraction products`. -Verification: focused publication and output-planning tests passed with Go -1.27.4, covering committed prepared inputs, flat extraction evidence, previous -input enumeration, declared diagnostics and private capture exclusion, locks, -failures, and pointer ordering. Restore mapping of these prepared inputs follows -in the next stage. - -**Read:** roadmap durable lifecycle sections; [Publish Internals](../internal/stage-publish.md). -Entry points: publish source/output planning, transfer and commit code, -runtime catalog/evidence, and archive enumeration. - -**Implement:** - -1. Publish the supported manifest, standalone prepared inputs including five - glossaries and generated autocorrection, selected flat products, and declared - diagnostics using actual run paths. Relocate previous-session enumeration to - the new input subtree without changing immutable remote output destinations. -2. Remove distinguished index/receipt assumptions. Do not scan/upload Notarius - bundles wholesale, follow latest symlinks, upload reference snapshot duplicates, - or add full debug archives because capture was enabled. -3. Keep the existing five publish outcomes, remote locks, carried source identity, - confined regular-file streaming, immutable commit declaration, and pointer-last - commit boundary. Current canonical availability still requires manifest evidence. -4. Update metadata consumed by restore and cleanup; preserve exact successful - publication authorization rather than inferring it from directory contents. - -**Verify:** prepared-input and extraction declarations, actual diagnostic paths, -local flat/remote nested mapping, absent index, debug exclusion, carried locks, -optional/required missing products, upload failure, and unchanged pointer safety. - -## Stage 19 — Restore new-format sessions and previous-session inputs - -**Complete.** Commit: `Restore prepared inputs and flat session products`. -Verification: focused restore planning, execution, unsupported-state, conflict, -audio, previous-input, transition-lock, and interrupted-retry tests passed, as -did previous-cache and manifest tests with Go 1.27.4. Older forced-analysis -workflow fixtures remain for the subsequent integration-test cutover. - -**Read:** roadmap state boundary and workspace; Restore Internals. Entry points: -restore discovery/plan/execute/report, shared current-state acquisition, -`internal/previouscache`, and prepared-input mapping. - -**Implement:** - -1. Finish v2 remote/local checks before destination mutation. Map selected commit - declarations to new canonical input/product/audio paths, installing the - verified manifest last. Preserve generation/checksum/size and conflict rules. -2. Restore all prepared input records including combined vocabulary and generated - rules. Keep producer-local resource paths from becoming destination authority; - rebase through existing confined mapping. Reference snapshots can be recreated - from verified prepared inputs rather than archived twice. -3. Use the simplified audio materializer. Map previous-session data beneath - `inputs/previous/` while preserving source-to-published-object resolution and - restore/prepare/status/validation agreement. -4. Write restore diagnostics under a run-local restore group and update - `logs/restore` for actual execution, including useful failure reports. Dry-run - planning creates no execution view. Preserve incomplete-restore markers, - shared session locking, retries, and current non-rollback behavior. - -**Verify:** publish/restore round trips into a new root, forced regular conflicts, -non-regular conflicts, unsupported old snapshots, partial-install retry, single -pointer-selected authority, audio restore without cache/spool, and previous-session -requirements. Restore never executes pipeline stages. - -## Stage 20 — Reconcile cleanup with diagnostic and bundle retention - -**Complete.** Commit: `Preserve current diagnostics during run cleanup`. -Verification: focused cleanup, managed-view, native bundle-retention, and -orchestration tests passed with Go 1.27.4, including link rotation, retained -evidence, unsafe links, publication authorization, cleanup-only execution, -and failure/retry without republishing. - -**Read:** roadmap retention and durable lifecycle; [Cleanup Internals](../internal/stage-cleanup.md). -Entry points: `cleanup_plan.go`, `cleanup.go`, app cleanup targets, and confined -file operations. - -**Implement:** - -1. Remove spool/audio-cache deletion policies and targets. Keep explicit prepared - audio/session deletion under existing manual authorization, not a replacement - automatic cleanup behavior. -2. Replace whole-run deletion where needed with role-aware run cleanup preserving - latest log/debug targets and original Notarius bundle evidence for its prior - session-durable lifetime. Older diagnostics remain eligible under existing run - cleanup once no protected view refers to them. Add no age/count retention policy. -3. Derive protections through the canonical managed-link/evidence owner, not - arbitrary filesystem traversal. Do not delete subprocess working State/Cache. -4. Preserve publish-evidence prerequisites, selected published-run identity, - idempotence, and cleanup failure/retry semantics. Resume treats retained - protected material as intentional, not as recreated work requiring endless - cleanup. Explicit entire-session deletion removes that session's views/evidence. - -**Verify:** latest targets from multiple runs, old eligible diagnostics, bundle -retention independent of latest views, no external cache deletion, disabled policy, -partial delete retry, cleanup-only invocation, and publication authorization. - -## Stage 21 — Reconcile reuse, planning, and inspection across the cutover - -**Complete.** Commit: `Reconcile reuse and inspection with native extraction`. -Verification: the Go 1.27.4 suite passed with only the maintained-example and -assembled-example tests assigned to Stage 22 excluded. Focused tests also passed -for restored reuse, forced analysis and extraction, bounded execution, -credential sharing, fallback reporting, current extraction evidence, and prepared -session publication. The full suite still identifies the example migrations -scheduled for Stage 22; no legacy-format fallback was added. - -**Read:** roadmap verification and existing semantic/invalidation contracts. -Entry points: prepare/extract/analyze resume, artifact hydration, session planning, -status/validation, configuration persistence, and command result reporting. - -**Implement:** - -1. Close remaining source-ID/path/evidence references left by earlier stages. - Remove retired private spell, receipt/index, wrapperless, and persistent - audio-cache branches and fixtures; add no old-format fallback. -2. Verify that supported sessions preserve per-speaker/per-artifact checkpoints, - aggregate decisions, explicit forced refresh, and fixed transitive invalidation. - Config source layout, credential rotation, debug/cache selection, or executable - version alone must not become blanket reasons to repeat work. -3. Check bounded plan/run parity, prerequisite guards, source availability, and - non-mutating planning. Keep old completed-file/failed-replacement availability - consistent with the owning stage's current behavior; do not normalize all - stages to a newly invented availability policy. -4. Keep user-visible fallback/readiness qualifications and native failure causes - available through fresh and reused command reports, without a new error taxonomy. - -**Verify:** assembled interrupted/retried transcript and artifact workflows, -force-extract versus analyze-only force, changed/unchanged vocabulary, bounded -runs with unrelated adapters absent, restored reuse, and no unexpected workspace -creation on fully reused or plan-only invocations. - -## Stage 22 — Prove the three-file workflow and real consumer boundaries - -**Complete.** Commit: `Exercise shared campaign and consumer workflows`. -The synthetic reference data is copied from catalog commit `02dd53c6`; the -catalog compatibility entry point is committed there separately as `016473f`. -Offline `go test ./...` passed with Go 1.27.4, and the three-document onboarding -fixture passed with omitted and supplied inline content, controlled consumer -failure/retry, and prepared-input reuse. Existing assembled coverage exercises -installation and campaign templates and bounded workflows. - -Controlled compatibility was run using the catalog script with local builds from -Audita v4.3.0 commit `6f97f31ccb1436c9b1e144182f6ad0b1fd9524be` and Notarius -v0.10.0 commit `752c9b44d2c0bb3bfb1e02a5d4379f7cc5b6261e`: - -```sh -scripts/check-compatibility.sh /home/eric/Workspace/narratio \ - /home/eric/.cache/narratio-roadmap-tmp/audita-v430 \ - /tmp/narratio-notarius-v010 /home/eric/Workspace/notarius -``` - -The catalog, Audita shared-input inspection, positive and negative preflight, -processing, and ten-lane Notarius readiness and flat promotion checks passed. -The controlled Notarius provider observed 9, 0, and 9 calls for initial, -reused, and forced-refresh execution respectively. External binaries remain -opt-in and default tests require no paid provider or external executable. - -**Read:** roadmap verification table and compatibility guidance. Entry points: -`internal/app/compatibility_test.go`, assembled workflow fixtures, existing -Notarius integration tests, and the catalog compatibility script. - -**Implement:** - -1. Copy the planning bundle into maintained examples, adjust remaining full and - production/testing examples, and use synthetic shared catalog data pinned to - the Stage 7 commit. Keep planning fixtures clearly labeled until replacement. -2. Extend existing offline assembled workflows to onboard with only the three - campaign documents, initialize a session, prepare selected vocabularies and - rules, execute controlled consumers, and exercise reuse/failure recovery. - Cover omitted/supplied inline sections and installation/campaign templates. -3. Refresh opt-in real Audita v4.3.0 checks and Notarius v0.10.0 checks using a - controlled local provider. Cover shared inputs, processing/preflight parity, - the complete ten-lane Notarius pipeline, cache reuse/refresh, and flat promotion. - Record executable revisions, catalog commit, commands, and results here. -4. Retarget the catalog's existing compatibility script to those checks. Keep - explicit binary/repository selection and opt-in gates. Default tests must - skip those external requirements and use repository-local fixtures. - -**Verify:** run the offline workflow tests and available controlled real-binary -checks. If an executable cannot be obtained, record the precise missing evidence; -do not replace it with a paid-provider dependency or claim tested interoperability -from schema/unit results. Complete that evidence before claiming the sprint's -tested consumer baselines. No source release is needed to exercise local binaries. - -## Stage 23 — Finish canonical documentation and end-to-end verification - -**Complete.** Commit: `Document the shared pipeline and verify the cutover`. -The canonical configuration, operations, CLI, integration, troubleshooting, -architecture, internal, example, and attribution documents now describe the -implemented contracts and cutover. Obsolete authored private-input fixtures were -removed. Schema distribution `2026.11.1` is pinned at -`f7e3cedeca11ed903311cdf29ca4d81fb1f216b7`; catalog and tested consumer revisions -and controlled results are recorded above. - -Final verification used Go 1.27.4 after `go mod download`: `go test ./...`, -`go test -race ./...`, `go vet ./...`, and `go build ./...` passed. CGO-disabled -CLI cross-builds passed for Linux amd64, Linux arm64, and darwin arm64; the last -is compile evidence, not a native macOS run. Catalog `go mod download`, -`go test ./...`, and `go run ./cmd/validate` passed independently. Local -documentation links, maintained examples, formatting and scoped diffs were -checked. The Stage 22 script passed the pinned controlled Audita and Notarius -boundaries; default tests remain offline. - -The verification table in [pipeline.md](pipeline.md#delivery-documentation-and-verification) -was checked against the stage evidence above: campaign/acquisition, prepared -and catalog inputs, consumer/readiness, paths/diagnostics, reuse, durable -lifecycle and audio each have focused tests, and assembled/real-consumer -checks cover their boundaries. No required outcome remains open. - -**Read:** roadmap “Delivery, documentation, and verification”; documentation, -architecture, testing, and OSS policies; Development validation commands. - -**Implement:** - -1. Publish the operator setup/campaign/session responsibilities and complete - three-file onboarding workflow in Operations, linking field definitions in - Configuration and shared contracts upstream. Document required/optional - fields, defaults, clearing/override semantics, and source-relative references. -2. Update CLI examples, party/shared integration references, adapter and - preparation/preflight/workspace/artifact/manifest internals, troubleshooting, - and maintained example navigation. Document flat products, latest views, - diagnostic retention, separately configured subprocess caches, and the state - cutover/regeneration procedure. Remove obsolete cache/spool/index assumptions. -3. Align architecture policy with the accepted ADR ownership/layout and the - distinction between extensible shared documents and strict operational - settings. Preserve API-key protection and ordinary group sharing. Current - upstream APIs remain linked, not re-documented or translated locally. -4. Complete exact schema/catalog/dependency provenance and applicable attribution. - Keep catalog CC0 and Narratio's existing licensing scopes. Release migration - guidance can be written without creating a release note/tag or running publish. -5. Audit the roadmap verification table against the actual implementation and - Stage 22 evidence. Record final results and any genuinely unfinished work - here. Do not mark the sprint complete with unresolved required outcomes. - -**Verify:** prepare dependencies separately, then use the maintained Go 1.27.4 -toolchain for `go test ./...`, `go test -race ./...`, `go vet ./...`, and -`go build ./...`. Run declared Linux amd64/arm64 and best-effort darwin arm64 -cross-builds using the repository's existing target selections; native macOS is -not required. Catalog checks run independently in its module. Validate local -documentation links, maintained examples, formatting/diffs, recorded real-binary -evidence, and a clean scoped Git status in each changed repository. Reuse passing -checks for unchanged final content rather than duplicating release validation. - -## Open Questions - -None requiring a product decision. The roadmap settles campaign/session fields, -roster policy, glossary bindings, state compatibility, and workspace behavior. -This plan selects the state marker, source/file identities, owner boundaries, and -work ordering. Record stage-local implementation details and evidence without -reopening those decisions or introducing additional policy. diff --git a/docs/roadmap/pipeline.md b/docs/roadmap/pipeline.md deleted file mode 100644 index 5773269..0000000 --- a/docs/roadmap/pipeline.md +++ /dev/null @@ -1,612 +0,0 @@ -# Shared inputs, native consumers, and session workspace - -## Status and scope - -This is the consolidated feature roadmap for one end-to-end Narratio cutover. -It includes shared domain inputs, the campaign operator contract, reference -catalog adoption, Audita v4.3.0, Notarius v0.10.0, and workspace reorganization. -It defines the final behavior and settled campaign/session interface. The -[implementation plan](implementation.md) assigns code changes and verification -to ordered stages. - -The scope is one coordinated final-state cutover. Do not introduce compatibility -aliases, legacy readers, automatic conversions, version-negotiated adapters, or -duplicate operator-authored vocabulary. Publication remains a separately -authorized action. - -This document supersedes Narratio's separate schema, Audita, Notarius, and -workspace roadmaps, the completed schema-repository implementation plan, and -the reference catalog's shared-glossary roadmap. Their historical versions remain -in Git. The schemas and upstream applications have already shipped; their -implementation work is not part of this sprint. - -## Released baselines and ownership - -Reviewed on 2026-11-29: - -| Component | Adopted release | Source commit | -| --- | --- | --- | -| Shared schemas | `2026.11.1`; glossary, RPG party, RPG campaign `0.2.0` | `f7e3cedeca11ed903311cdf29ca4d81fb1f216b7` | -| Audita | `v4.3.0` | `6f97f31ccb1436c9b1e144182f6ad0b1fd9524be` | -| Notarius | `v0.10.0` | `752c9b44d2c0bb3bfb1e02a5d4379f7cc5b6261e` | -| ConfigKit | `v1.4.0` | `4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3` | - -Canonical contracts: - -- Schemas: [release](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.1/docs/releases/2026.11.1.md), - [validation](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.1/docs/validation.md), - and [compatibility](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.1/docs/compatibility.md). -- Audita: [runtime inputs](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/integrations/transcript-glossary-files.md) - and [migration](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/migrations/v4.3.md). -- Notarius: [subprocess contract](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/consumers/subprocess.md), - [shared inputs](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/integrations/shared-domain-inputs.md), - [CLI](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/cli.md), - [domain outputs](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/integrations/json-output.md), - and [migration](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/consumers/native-migration.md). -- ConfigKit: [configuration contract](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md) - and [consumer guide](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/consumers/README.md). - -Narratio currently supplies private roster and wrapperless glossary formats, -targets Audita v4.2 and Notarius's v0.8.1 receipt/index protocol, and uses the -workspace described in [Operations](../operations.md#local-state-layout). -Installing the new executables alone is not a compatible upgrade. - -Follow [ADR 0003](../adr/0003-assign-configuration-ownership.md): ConfigKit owns -configuration acquisition and resolution through the final handoff; CommandKit -owns CLI mechanics and native inspection; Narratio interprets resolved values -and prepares separate domain objects without constructing another effective -configuration. Shared contracts must fit ConfigKit's supported values. Do not -add a parser, scalar repair, arbitrary-precision bridge, private input inspection, -or custom merge policy. Downstream applications own prompts, profiles, provider -selection, task validation, and their execution caches. - -[ADR 0001](../adr/0001-classify-session-content.md) and -[ADR 0002](../adr/0002-assign-subprocess-content-ownership.md) define the selected -content and ownership model. Acceptance of those decisions does not establish -that this workspace has been implemented. - -## Campaign operator contract - -### Author once - -Installation setup supplies the pipeline, services, credentials, and an explicitly -installed reference catalog. An operator onboards a campaign with three primary -documents, then supplies session identity, audio, and session-specific metadata: - -| Document | Responsibility | -| --- | --- | -| `party.yml` | Shared RPG party roster, with Narratio's additional roster requirements. | -| `campaign.yml` | Shared RPG campaign identity/context, roster reference, catalog selectors, and a `narratio` operational extension. | -| `speakers.yml` | Existing speaker-mapping format connecting recording names/identifiers to transcript speaker labels. | - -Recording identity is separate from character identity; speaker mappings can -include players, a GM, and other participants. No extra authored player list, -combined glossary, private spell overlay, campaign-context file, autocorrection -file, or per-campaign template is required. Native imports and optional authoring -splits remain available; the three-file bundle is the standard onboarding path, -not a limit on the number of files. - -### Campaign and session field layout - -Keep shared fields at the root and group Narratio-only inputs under -`narratio.inputs`. The following agreed fields describe the target interface, -not the current CLI or configuration. - -| Campaign field | Meaning and omission behavior | -| --- | --- | -| `schema_version` | Required `maximumdirect.rpg.campaign.v1`. | -| `id` | Required campaign identity; replaces `campaign_id`, retaining Narratio's identity checks. | -| `name`, `description` | Shared optional display/context fields. | -| `references.party` | Required by Narratio; standard bundle explicitly uses `./party.yml`. `--party-file` remains an invocation-specific selection. | -| `setting`, `system` | Optional catalog keys; the standard workflow supplies both. Omission means no selected vocabulary for that role. Shared optional-field null rules still apply. | -| `references.glossaries` | Optional shared relationships, not an implicitly ordered Narratio composition list. Operational vocabulary selection uses the fields below. | -| `narratio.inputs.speakers_file` | Required by Narratio; standard bundle explicitly uses `./speakers.yml`. | -| `narratio.inputs.glossary_file` | Optional path to a shared glossary supplying `campaign`. No path means no file contribution. | -| `narratio.inputs.glossary` | Optional inline campaign collection, using shared entry/provenance shapes; omission or null means no inline contribution. | -| `narratio.inputs.autocorrect` | Optional list using the existing Seriatim replacement-rule shape; omission, null, or `[]` supplies no campaign replacements. | -| `narratio.session_template_file` | Optional campaign template; omission uses the installation template, or Narratio's built-in default. | - -Use optional `pipeline.campaigns.session_template_file` for the installation -template. Do not require installation of a separate template -to make ordinary `session init` usable. Keep its existing explicit session/audio -selection and narrow templating behavior. - -Session identity, audio, title, date, and previous-session behavior remain in -the session document. Retain session `inputs.speakers_file`, `inputs.setting`, -`inputs.system`, `inputs.glossary_file`, and `inputs.glossary` selectors. Add -`inputs.autocorrect` for session rules. Omission inherits the corresponding -campaign value independently. Null/empty optional selectors clear a selection; -supplied inline glossary or autocorrection data replaces the corresponding -campaign contribution as a whole, with null clearing it. Explicit empty/null -required paths fail validation rather than silently selecting defaults. - -File and inline glossary contributions are independent: clearing inline data -does not clear a selected glossary file. A session `inputs.autocorrect: []` -explicitly disables campaign replacements; omission inherits them. Do not -implicitly accumulate campaign and session lists. Express these domain rules -through supported ConfigKit mechanisms without changing native composition or -the shared schemas' null rules. - -Retire campaign/session `autocorrect_file` authoring in favor of inline rules -or native imported mapping contributions; preparation still supplies Seriatim -a file. Retire `spell_catalog_file` entirely. Do not introduce session -`party_file` or `players_file`. Campaign/session identities must agree, using -the new campaign `id` as the authoritative campaign identity. - -Resolve authored resource paths from the effective value's defining source, -including imports and inherited values; preserve existing source-context and -invocation-directory fallback rules. CLI-relative paths use the invocation -directory. Register resolution/default rules through native ConfigKit extension -points. Configuration inspection exposes that native result, not prepared -snapshots or a hand-built inspection view. - -### Worked campaign bundle - -The complete target-interface files are under -[examples/campaign/](examples/campaign/campaign.yml): -[campaign.yml](examples/campaign/campaign.yml), -[party.yml](examples/campaign/party.yml), and -[speakers.yml](examples/campaign/speakers.yml). They are planning fixtures, not -inputs supported by the current Narratio release. The campaign and party -documents conform to the released shared schemas and illustrate the agreed -Narratio extension. - -With the synthetic catalog installed, the example selects -`lantern_coast_sample` and `sample_magic`, references its adjacent roster and -speakers, and provides one inline campaign term. Its empty autocorrection list -requires no extra file. Removing both optional inline sections still permits -onboarding. Session initialization uses the installation/built-in template; -the operator then selects session audio through the ordinary workflow. -Preparation derives party vocabulary, resolves the two catalog sources, writes -the campaign collection and combined glossary, and passes verified prepared -paths to both consumers. No fictional setting is presented as a complete -Forgotten Realms or D&D reference library. - -### Narratio-wide roster requirements - -After shared RPG party validation, consistently require a nonempty roster, -stable IDs satisfying Narratio's artifact-key rules, player and character names, -and a nonempty class list per character. Preserve existing trimmed/nonempty -display-name checks, character-name/alias ambiguity checks, and duplicate-class -checks; player names may repeat. Class names are required and supplied levels -remain positive within the shared contract's range. - -Use `aliases` and the shared marker. Preserve supported extensions and optional -shared values without normalizing the forwarded document. These are Narratio's -consumer requirements, not changes to the shared schema, and do not depend on -which artifacts happen to be selected. Derive separate artifact-family and -prompt views; retain a complete shared roster for forwarding. - -## Shared acquisition and prepared inputs - -Pin all three `0.2.0` schemas, adjacent semantics, exact dependency closure, and -source distribution `2026.11.1` for offline validation. Keep canonical IDs under -`https://schemas.maximumdirect.net//v0.2.0/schema.json`; retain `.v1` -markers. Markers are not exact-version selectors. Do not import the schemas -repository's internal harness as an SDK or fetch schemas at runtime. - -Validate completed mappings after ConfigKit composition, then apply domain -semantic rules such as exact per-collection glossary ID uniqueness and Narratio's -roster profile. Preserve supported resolved values, extensions, and -omission/null/empty distinctions. Numeric binding and source limits remain -upstream; schema-resource JSON retains exact numeric constraints. Ordinary -shared extensions are allowed even where Narratio's typed operational settings -reject unknown fields. An `instruction` extension is data, never prompt guidance. - -Refactor campaign acquisition, identity selection, inspection, resource -resolution, campaign-to-session defaults, and initialization together. Prepared -campaign/session/party documents are effective standalone snapshots; source -configuration remains authoritative. Update autocorrection preparation and its -evidence without turning glossary context into deterministic replacement rules. - -### Glossary composition and bindings - -Keep the four logical prepared sources and add one generated projection: - -| Logical source | Contents and consumers | -| --- | --- | -| `narratio.input.glossary.party` | Roster-derived party collection; supplied individually to Audita. | -| `narratio.input.glossary.campaign` | Campaign file/inline contribution; supplied individually to Audita. | -| `narratio.input.glossary.setting` | Selected setting vocabulary; supplied individually to Audita. | -| `narratio.input.glossary.spells` | Selected system vocabulary; supplied individually to Audita. | -| `narratio.input.glossary.combined` | One saved shared envelope containing all four collections; bound to both Notarius glossary roles. | - -All prepared glossary files use the shared envelope. Save each collection even -when its entries are empty. Keep collection metadata/extensions where they are -part of the source, and preserve source documents where task projections omit -data. The combined file is a domain projection with explicit dependencies on -the four inputs, not a second authored source or configuration merge engine. - -Resolve the selected campaign file beneath the effective inline contribution -through existing native ConfigKit identity/list controls. Inline and imported -authoring remain supported. Catalog IDs select paths from -`pipeline.reference_catalog.settings` and `.systems`; only selected documents -are acquired, and unknown selected IDs fail. These are Narratio's interpretations -of the shared campaign labels, not schema-defined lookup semantics. Do not infer -composition precedence from `references.glossaries` ordering. - -Retain `narratio.input.party` for the complete shared roster and -`narratio.input.players` for consumers still needing its derived view. Do not -require a default Notarius players binding: Notarius derives relationships from -the shared roster. Remove private spell-overlay acquisition and -`narratio.input.spell_catalog`; do not restore the retired -`narratio.input.glossary` alias. - -Keep manifest-verified prepared sources, reference snapshots, and whole-file -content evidence. A change in any combined collection may invalidate extraction -even if a role does not select it. Collection-aware fingerprinting is outside -this feature. Stable logical IDs remain stable where their meaning is retained; -new projections have explicit identities and invalidation dependencies. - -## Reference catalog adoption - -Update `narratio-reference-catalog` in the same coordinated scope. Its existing -synthetic bundle still owns a wrapperless schema and targets Audita v4.2. Adopt -the pinned shared glossary `0.2.0` instead. This work covers the synthetic -Lantern Coast/Sample Magic bundle, not new real-world vocabulary or source -licensing research. - -Distribute authored entry points with their local native-import fragments; -Narratio prepares standalone downstream files. Do not add a generated export -product or maintain parallel resolved copies. Keep existing selectors, paths, -IDs, names, descriptions, aliases, and categories unless correcting a specific -defect. Source entry points resolve to complete envelopes; fragments may remain -partial. Keep `setting` and `spells` as the sample collection roles. - -`catalog.yml` remains a Narratio configuration index, distinct from a glossary -and from the schemas repository's `catalog.json`. Native configuration permits -operator catalog extensions. Retire the catalog-owned glossary schema; vendor -the unmodified shared schema, semantics, dependency closure, and applicable -license/attribution with exact provenance. Do not rewrite `$id` or maintain -local schema amendments. Rewrite `FORMAT.md` as the catalog authoring/selection -guide and link upstream for shared field definitions. - -Remove consumer instructions from maintained vocabulary and partial examples. -Preserve supported extensions and meaningful provenance; use synthetic source -IDs/titles and the known license without invented upstream versions, URLs, or -ruleset semantics. Preserve CC0 and record terms for incorporated material. - -Add a small catalog-local development/CI check using native ConfigKit composition, -maintained JSON Schema validation, and the necessary ID-uniqueness check. Check -every indexed source, source-relative imports, expected collection roles, complete -and partial examples, and focused negative fixtures. Do not duplicate parser -or merge machinery or copy the schemas harness. Ordinary validation is offline -after dependency preparation and needs no sibling application or LLM service. - -Retain the compatibility script as an opt-in integration check with the new -Narratio and Audita releases; retire its old compatibility claims when migration -lands. Catalog validity does not establish consumer readiness. Record the actual -tested revisions before claiming interoperability. - -Pin an explicit catalog commit for this sprint. Named releases are not a -prerequisite; an eventual independent catalog release convention remains separate -future work. Do not couple vocabulary versions to schema versions, fetch updates -during execution, mutate published revisions, or require hosting/ReleaseKit work. - -## Consumer execution - -### Audita v4.3.0 - -Keep the repeated `--glossary-file` interface, now supplying the four prepared -shared envelopes. Audita can also accept multi-collection files, but no new -Narratio configuration generator or collection-selection flags are needed. -Supplied entry lists replace same-named configured lists at CLI priority, -including empty lists; unrelated collections and disjoint native overrides stay -upstream concerns. Audita selects correction/protection collections separately. -Empty data is schema-valid, while configured glossary correction requires at -least one selected entry; native readiness reports that failure. - -Instructions stay in Audita configuration. Automatic glossary companions have -been removed upstream; operators must pass desired files explicitly. Narratio -already supplies explicit paths. Automatic prompt companions, application -configuration version 3, transcript/report contracts, config/overlay/profile -forwarding, and ordinary reporting remain unchanged. - -Use the same saved envelopes for processing and preflight. Update semantic -evidence for the new bytes. Direct the transcript to staged product storage, -ordinary and failure reports to the actual polish log directory, and retained -debug work to the actual polish debug directory through supported controls. - -### Notarius v0.10.0 invocation and references - -Notarius remains an installed executable, not a Go package dependency. Use -`notarius run ` with flags after the complete command path: - -| Concern | Target | -| --- | --- | -| Transcript | `--input-file` with the absolute final trimmed transcript; remove `--input`. | -| Configuration | Preserve `--config`; forward `config_overlay` as `--overlay`, distinguishing omission from an explicit value. | -| Machine report | `--format json`, independent of Narratio display flags; remove `--json`. | -| References | Repeated `--reference =`. | -| Output | `--output-dir` with Narratio's run-local staging destination. | -| Cache | Native `--cache auto\|bypass\|refresh`; remove `--resume` and `--chunk_cache`. | -| Debug | True `pipeline.notarius.debug` adds `--debug`; always supply the actual run-local `--debug-dir` for configured capture. | - -Keep minimal child environments, exact-name credential forwarding, stream -supervision, cancellation, limits, redaction, and native errors. Preserve native -input-based LLM session selection; add no generic execution overrides or runtime -version negotiation. Required outputs do not become an implicit `--lane` filter. - -Supply the shared roster to `party` (or native accepted `roster` bindings) and -the combined glossary to `glossary` and `spell_catalog`. Each role keeps its native -collection selection: general context defaults to available campaign/setting; -a bound spell role defaults to `spells`, which must exist. Explicit selected -names must exist; omitted/null selections use defaults and `[]` selects none. -CLI path overrides retain effective configured selections. Narratio does not -implement another selection policy. - -Notarius owns embedded D&D 5e 2014 SRD recognition, canonical display names, -alias augmentation and collision checks. No private overlay or ruleset -provenance is required. A catalog system selector does not choose an inferred -recognition ruleset. References are context, not transcript evidence; generated -same-run handoffs remain configured within Notarius. - -### Notarius completion, products, and cache - -Wait for successful process completion before interpreting stdout as a successful -report. The native report contains `pipeline`, `artifact_count`, absolute -`output_directory`, and optional `debug_directory` and positive `fallback_count`. -It is not a receipt, inventory, or validation ledger. Use that exact directory -under the supplied staging root; never scan for the newest bundle or infer a run -ID from a name. No upstream run-ID field exists. - -Every configured extraction output remains required. Read documented -`lanes/.json` files, applying the upstream mapping for custom -lane IDs. Check expected pipeline, safe placement, regular files, bounded JSON -readability, and checksums with existing machinery. Keep `lane_id`; remove -`media_type`, `schema_id`, `schema_version`, and `module_key` descriptor constraints. -Trust Notarius's native domain validation rather than adding payload schemas or -semantic assessment. Preserve `narratio.extraction.` source identities. - -Promote configured products to the flat artifact destinations only after bundle -acceptance, preserving existing staged-validation/atomic-promotion guarantees -before recording success. `artifact_count` includes reused results and enabled -auxiliaries, so it is not a required-output-count check. Retain optional -`chunk-map.json` and `evidence-context.json` with the original bundle when emitted; -they are domain auxiliaries, not report sidecars. New selectable sources for them -are not required. The maintained complete D&D pipeline still has ten lanes. - -Remove receipt/index/sidecar parsing, descriptor comparisons, rejection/warning -count reconciliation, and `notarius_index` from execution, hydration, evidence, -reuse, publication, and restore. Do not create a substitute index. Record -Narratio-owned input/output evidence and factual native completion information, -distinguishing configured expectations from producer attestations. - -Nonzero exit, malformed successful stdout, or missing required files fail. Report -or capture failure can follow artifact publication: preserve diagnostics and -available files, but do not recover success automatically from partial stdout -or incidental files. Honor native successful permissive completion subject to -required-file checks. Record and display positive `fallback_count` in ordinary -extraction results and later reuse; it counts emitting operations, not affected -lanes. Notarius owns strict/permissive settings and its strict default. - -Replace Narratio's `pipeline.notarius.resume` and `.chunk_cache` with optional -`.cache`. Omission passes no flag; forced extraction uses `--cache refresh`. -Narratio's stage reuse and Notarius's accepted-result cache are separate. -Cache/debug selection alone does not stale completed Narratio products. Fingerprint -result-affecting Narratio inputs, references, output selection, pipeline identity, -and explicit overlay selection, not private downstream config or cache formats. -Downstream model/settings/validation changes may still hit native cache; document -forced extraction as the explicit way to request fresh work. Notarius owns cache -placement and cleanup; old native caches stay ignored and untouched. - -## Readiness and invocation lifecycle - -Reuse `internal/preflight`, lazy adapter composition, and production acquisition -paths. Automatic readiness follows selected preparation and precedes processing -for stages needing execution. Explicit `session validate` uses prepared inputs; -planning remains subprocess-free. Keep prepared-reference integrity checks and -Narratio's required-lane checks through native pipeline inspection. A failed or -incomplete required inspection is not evidence of readiness. - -Run full Audita preflight and native -`notarius preflight --input-file ... --format json` -with the execution config/overlay, references, credentials, cache selection, and -appropriate probe output/debug destinations. Notarius chooses applicable provider -targets and checks modules, transcript/references, destination/cache access, -reachability, authentication, and structured generation. It does not extract or -publish domain artifacts. No separate `promptkit test all`, maintained profile -list, or mandatory additional `pipeline validate` subprocess is needed. - -Require successful status and a complete assessment for the expected Notarius -pipeline with `ready: true`. Preserve warnings and debug locations; cache-access -warnings alone do not fail readiness. Nonzero exit fails even with `ready: true`; -early failure can omit the report and failed delivery can leave partial bytes. -Keep native error semantics rather than inventing an error taxonomy. - -Provider probes can be billable and may create probe directories, temporary files, -and selected debug capture. Use an appropriate real execution transcript when -available; otherwise use the existing known-good synthetic transcript for early -readiness as with Audita. Report which input was checked. Synthetic success does -not validate the future final trimmed transcript, which run validates normally. -Do not add two mandatory paid probe passes. - -Readiness is an invocation check, not another resumable pipeline stage. Keep its -diagnostics distinct from actual extraction/polish attempts so a probe does not -misrepresent which stage last executed. Use existing validation/reporting paths -for explicit and automatic checks, with additional explanatory output where useful. - -## Session workspace and diagnostics - -### Final layout and ownership - -Keep the configurable workspace root and default `/var/lib/narratio`; sessions -remain under `work//`. Centralize all changed paths in the -existing path owner. - -| Session-relative path | Role | -| --- | --- | -| `manifest.json` | Narratio progress, supported-state identity, evidence, and output references. | -| `artifacts/` | Flat completed configured artifacts, including intermediate session bounds. | -| `transcripts/` | Combined and rendered transcripts. | -| `transcripts/raw/.json` | Initial per-speaker transcripts. | -| `audio/` | The single retained Narratio-managed prepared audio copy. | -| `inputs/` | Prepared configuration and other external inputs. | -| `inputs/previous/` | Prepared previous-session material. | -| `inputs/references/` | Content-identified reference snapshots supplied to subprocesses. | -| `logs/` | Relative symlink to the latest actual attempt's run-local logs. | -| `debug/` | Relative symlink to that attempt's debug directory, possibly empty. | -| `runs///logs/` | Actual process streams, invocation records, and execution reports. | -| `runs///debug/` | Actual optional captures and retained diagnostic state snapshots. | -| `runs//` | Narratio staging, original tool bundles, and retained execution evidence. | - -Outputs consumed by later stages retain their output paths. Narratio's lock, -manifest, restore marker, and staging are its State; no extra root-level State -directory is needed. Input configuration follows its input/staging role; -invocation descriptions are Logs. Subprocesses own their working State and Cache -through their supported configuration, outside Narratio cleanup responsibility. -Dedicated cache roots such as `/var/cache/notarius` are deployment recommendations, -not Narratio-imposed internal layouts. - -### Output placement and collision checks - -Apply flat artifact placement to explicit analysis outputs, expanded character -families, extraction products, and session bounds. Preserve configured analysis -filenames within that constraint. Derive extraction names from configured output -keys plus `.json`, with an optional explicit filename override. Keep -`session_bounds.json` as the default bounds name. Validate collisions across the -effective pipeline, expanded families, and built-in destinations before execution; -report conflicting producers and destinations, without silently renaming files. - -Combined transcripts stay directly beneath `transcripts/`. Remove unused -`transcripts/trimmed/` scaffolding and reconcile configurable destinations with -their categories. Local flattening does not flatten explicit remote publish -destinations. Seriatim execution reports move from artifacts to run-local Logs. -Promoted extraction products resolve independently of their original bundle. -Retained bundle evidence remains under runs with an explicit retention role; -relocation must not silently shorten its existing lifetime. - -### Audio acquisition - -Remove Narratio's persistent S3 audio cache and retained spool duplicates, -obsolete configuration, manifest bookkeeping, and cleanup controls. Temporary -download files may be used to install validated session audio. Preserve reuse -of valid prepared audio and restore into the same `audio/` layout. Recreating -a session after its prepared audio is removed fetches the source again. This -change does not delete original recordings or newly authorize prepared-audio -deletion; downstream caches remain separately managed. - -### Latest attempts, debug, and retention - -At each actual stage attempt, create its run-local log and debug directories -and advance both relative links, including when the attempt fails. For example, -`logs/polish` points to `../runs//polish/logs/`. An attempt without capture -exposes an empty debug directory; a skipped stage leaves both prior views intact. -Fully reused invocations must not create empty run directories merely for views. -Distinguish multiple applications/artifact invocations by their diagnostic names. -Restore has its own run-local diagnostic group and `logs/restore` latest view. - -Producers write to actual run paths; links are operator navigation, not a duplicate -store. Publication and manifest diagnostics reference actual paths. Support these -managed links without permitting arbitrary symlink traversal. Rotation does not -move historical files. Run cleanup preserves current latest-view targets and -retained evidence according to role; add no automatic history age/count limit. -Explicit whole-session removal removes its views with it. - -Retain Audita's debug selector and add Notarius's enable-only selector. True -requests capture; omission/false passes no enablement override and preserves -downstream settings. Supply actual destinations even when upstream configuration -enables capture. Notarius's destination alone does not enable capture. Audita's -debug work-directory control is diagnostic placement, not ownership of generic -working State. - -Route Scriptorium's existing per-artifact render-debug products to run-local -`analyze`/`trim` debug directories. Preserve per-artifact selection. Seriatim -needs no invented debug mode; ordinary reports are Logs. Subprocess-defined -nested capture directories are allowed. Notarius capture stays private: do not -parse it as an API or use its `latest` link to find outputs. Capture does not -imply sanitization of arbitrary file contents; retain existing stream redaction -boundaries, write-failure semantics, and useful evidence on error. - -Full Audita/Notarius debug bundles remain local. Preserve publication of currently -declared diagnostics, including existing render-debug products; enabling capture -does not add remote archives implicitly. Debug controls act when a stage executes, -not as product invalidators. Operators force execution to obtain fresh diagnostics -when products would otherwise be reused. - -## One cutover and durable-state boundary - -This combined feature supports newly prepared sessions in the new format. -Introduce an explicit supported-state identity/version using Narratio's existing -manifest/state mechanism. Old local sessions and old remote snapshots must not -be silently resumed, converted, rewritten, or restored into the new layout. -Detect unsupported state before mutation and provide regeneration/manual -configuration guidance. Historical files and bundles remain untouched; no -compatibility path or automatic deletion is introduced. - -This boundary supersedes the separate adapter roadmap's proposal to upgrade -old extraction evidence in place. Within supported new-format sessions, preserve -ordinary per-speaker/per-artifact reuse, forced execution, obsolete-evidence -staling, and transitive invalidation. Do not rerun unrelated stages solely because -an executable version changes. Keep the existing treatment of old completed -products after invalidation or failed replacement, including manifest-backed -availability; relocation does not introduce rollback, fallback, or stale-file -deletion semantics. - -Update prepared records, reference snapshots, semantic evidence, artifact -resolution, publication, restore, and cleanup together. Publish declared products -and diagnostics; restore new-format inputs/products into canonical new paths. -Preserve session locking, incomplete-restore recovery, the existing remote commit -protocol, and successful-publication prerequisites for automatic cleanup. Respect -separate subprocess Cache/State and latest-attempt retention when computing -cleanup targets. - -## Delivery, documentation, and verification - -The final state includes shared acquisition, the migrated catalog and campaign -examples, native consumer execution/readiness, and consistent workspace lifecycle -behavior. Prepared inputs, product promotion, reuse, publication, restore, and -cleanup must agree with that state. Implementation sequencing and stage-specific -verification belong in [implementation.md](implementation.md). No intermediate -release or compatibility layer is part of the feature. - -Keep existing application/adapter boundaries and reuse production checking paths. -Replace obsolete tests and fixtures rather than preserving retired protocols. -Verification must cover the following observable outcomes: - -| Area | Required evidence | -| --- | --- | -| Campaign workflow | A complete synthetic three-file bundle selects catalog data and initializes sessions without extra vocabulary, autocorrection, or template files; omitted/supplied sections and explicit overrides behave as documented. | -| Shared acquisition | Native source-relative imports and resolution, schema/semantic failures, Narratio roster requirements, shared extensions, and omitted/null/empty distinctions are exercised without a second parser. | -| Preparation | Four individual envelopes and the combined file have verified manifest-backed identities/dependencies; changed combined content invalidates downstream extraction as specified. | -| Catalog | Every indexed source resolves to the intended shared collection; independent checks cover partial inputs, null aliases, extensions, wrong markers/known fields, and duplicate final IDs. | -| Audita | Repeated shared files, empty collection/task readiness, extension/instruction handling, native flags, and processing/preflight parity work with v4.3.0. | -| Notarius | Native args, overlay/reference forwarding, custom lane filename mapping, optional auxiliaries, safe required-file checks, malformed/nonzero completion, and visible fallback qualifications including reuse are covered. | -| Readiness | Shared automatic/explicit paths, preparation ordering, required-lane checks, provider/reference failures, cache warnings, and synthetic-input limitations are covered without duplicate probe passes. | -| Paths and diagnostics | Flat products, effective collision detection, success/failure latest views, empty debug views, skipped stages, lazy run creation, and debug routing preserve their selected semantics. | -| Reuse and cache | Forced refresh, completed-work reuse, changed-input invalidation, unchanged cache/debug-only selection, and failed replacements retain the intended boundaries. | -| Durable lifecycle | New-format publication/restore and cleanup preserve products, latest targets, retained evidence, and separate caches; unsupported old state is rejected without mutation. | -| Audio | Acquisition, reuse, and restore use one retained prepared copy without persistent spool/cache duplicates. | - -Use temporary filesystems and controlled subprocess/provider boundaries. Default -tests remain offline, deterministic, independent of sibling checkouts, credentials, -and paid services. Refresh opt-in real Audita/Notarius compatibility checks with -controlled local providers, including the complete Notarius D&D pipeline and -native reuse, before claiming tested interoperability. Do not equate valid schemas -or green unit tests with that evidence. Run the appropriate repository checks -from [Development](../development.md) for the completed implementation. - -When behavior lands, update canonical configuration/CLI/integration references, -Operations, internal preparation/workspace/artifact/manifest/adapter documentation, -troubleshooting, architecture policy, and maintained examples. Distinguish typed -operational settings from extensible shared documents. Remove obsolete audio -cache/spool and extraction-bundle/index assumptions. Document managed navigation -links and independently configured application caches. - -Release guidance must describe the new campaign/session fields, shared input -formats, removed private sources and descriptors, native cache/debug behavior, -state cutover and regeneration, and changed local layout. Audita remains config -version 3; Notarius uses version 6. Link upstream for resource composition, -producer modes, semantic correction turns, concurrency, and other downstream -migration details rather than translating them in Narratio. Record tested -dependency/catalog revisions and preserve schema attribution. No runtime old-version -gate or fallback adapter is needed; unsupported executable interfaces fail normally. - -## Open decisions - -None. The campaign/session layout, replacement and clearing behavior, inline -autocorrection with native imports, and campaign → installation → built-in -template selection are settled. No upstream capability request or catalog -release machinery blocks this scope. -Package placement, the exact state-version value, and implementation task ordering -belong in the implementation plan, not additional product decisions. diff --git a/docs/roadmap/remediation.md b/docs/roadmap/remediation.md deleted file mode 100644 index 6643cd7..0000000 --- a/docs/roadmap/remediation.md +++ /dev/null @@ -1,497 +0,0 @@ -# Shared pipeline cutover review findings - -Reviewed Narratio commit `2ec43305da6c47709909d5cee167c7be0358b311` -against all 23 stages in [implementation.md](implementation.md) and the target -in [pipeline.md](pipeline.md). The catalog migration and controlled consumer -boundaries were included. This document records required remediations and -algorithmic refactoring opportunities for consideration. It does not implement -them or change the agreed operator contract. - -## Remediation completion - -All nine issues below are complete, with a separate implementation commit and -completion note for each. Historical audit observations below describe the -reviewed revisions, rather than the remediated baseline. - -Final verification with Go 1.27.4 passed: `go test ./...`, -`go test -race ./...`, `go vet ./...`, `go build ./...`, documentation checks, -and `git diff --check`. CGO-disabled CLI cross-builds passed for Linux amd64, -Linux arm64, and macOS arm64; the last establishes compilation only. All tests -used controlled boundaries without paid providers. No upstream application or -catalog changes were needed. - -## 1. Preserve available producer files after failed extraction - -**Priority:** P2 - -**Status:** Complete - -Producer output is retained on failure; temporary promotion copies still clean -up. Stage regressions cover failed delivery and missing/invalid lanes, without -promoting incidental files. Verified with `go test ./internal/stage`. - -**Stages:** 11–12; failure-evidence and workspace requirements in 16 and 21–23. - -**Evidence:** [extract.go](../../internal/stage/extract.go), -`extractStage.Run`, lines 154–164. Its deferred cleanup removes the entire -`notarius-output` root whenever `accepted` remains false. That includes a -subprocess failure, malformed completion, required-file failure, or failed -promotion after Notarius has already written files. - -The roadmap's Notarius completion section explicitly accounts for report/capture -failure after artifact publication and requires retaining available files and -diagnostics without recovering success from them. The current cleanup discards -those producer files before an operator can inspect them. Separate stdout/stderr -logs and debug captures can survive, but they do not replace the discarded lane -payloads and optional domain evidence. This is a target-state gap, not a request -to treat partial results as successful extraction. - -**Reproduction:** a temporary Go-overlay test used the existing -`nativeExtractFixture`, returned an adapter error representing failed completion -delivery, and checked an existing producer lane after `extractStage.Run` failed. -The lane was gone (`no such file or directory`). The test added no repository -file and made no model call. - -**Required change:** retain the producing attempt's Notarius output tree on -failure, under its existing run-local destination. Keep the failure result and -existing canonical-promotion checks. Continue removing Narratio-owned temporary -product copies where appropriate. Failed producer output remains attempt -evidence subject to the ordinary run lifecycle; it gains neither automatic -success/reuse authority nor a new permanent-retention guarantee. - -**Verification:** add a durable regression at the extraction stage boundary for -producer files present when report delivery fails, and for successful subprocess -completion followed by missing/invalid required lanes. Confirm files remain -inspectable, the stage fails, and no incidental output becomes available as a -successful extraction. Preserve prior canonical files where failure occurs -before promotion, as the existing staging test already requires. - -## 2. Limit cleanup's managed-view validation to the views it owns - -**Priority:** P2 - -**Status:** Complete - -Cleanup inspects only canonical stage and restore views. Unrelated files, -directories, and links remain untouched; conflicts at owned views still fail. -Verified cleanup/resume/rotation and file-operation tests with -`go test ./internal/fileops ./internal/stage`. - -**Stages:** 15 and 20; requirement-strengthening review in 21–23. - -**Evidence:** [attempt_views.go](../../internal/fileops/attempt_views.go), -`ManagedAttemptTargets`, especially lines 179–188; -[cleanup_retained_bundle.go](../../internal/stage/cleanup_retained_bundle.go), -lines 36–39. Cleanup enumerates every entry in the session's `logs/` and -`debug/` roots and passes each to `existingManagedView`. A regular file or -ordinary directory causes an error even when unrelated to a stage view or to -the run being cleaned. - -For example, an operator's `logs/README.txt` blocks both cleanup execution and -cleanup resume checks with a managed-view conflict. Finder metadata or other -unrelated entries can have the same effect. This introduces an undocumented -requirement that those directory roots contain exclusively valid managed -symlinks. The selected contract requires protecting Narratio's latest-attempt -targets and rejecting conflicts at a view being installed; it does not require -rejecting unrelated operator content across the entire directory. - -**Reproduction:** a temporary Go-overlay test created a valid extraction result -and managed attempt views, added `logs/README.txt`, and evaluated -`cleanRunWithRetainedBundle(..., false)`. It failed with -`managed logs view "README.txt" conflicts with existing content`, before any -deletion. The test changed no repository files. - -**Required change:** identify and validate Narratio-managed views narrowly when -computing protected run targets. Leave unrelated entries untouched and do not -make them prerequisites for cleanup. Preserve confinement, avoid following -arbitrary links, and retain conflict rejection when an actual managed stage view -is created or replaced. Do not fix this by documenting or enforcing a new -exclusive-directory prohibition. - -**Verification:** cover unrelated regular files/directories in both roots, -correct protection of valid latest links, and unchanged rejection of unsafe or -conflicting owned views. Exercise cleanup and its resume check; unrelated files -must remain untouched and eligible run cleanup must still complete. - -## 3. Replace obsolete commands in runtime recovery guidance - -**Priority:** P2 - -**Status:** Complete - -Active input-recovery diagnostics now use the native `run SESSION --stage STAGE ---force` route. Corresponding missing/corrupt-input tests were updated; retired -command rejection tests remain intact. Verified stage and application tests. - -**Stages:** 9, 12, 16, and the integration/documentation reconciliation in 21–23. - -**Evidence:** [extract_references.go](../../internal/stage/extract_references.go), -line 278; [analyze_input_identity.go](../../internal/stage/analyze_input_identity.go), -lines 131, 137, 187, and 193; the built-in source recovery helpers in -[analyze.go](../../internal/stage/analyze.go) and -[render.go](../../internal/stage/render.go). - -Missing or invalid prepared inputs, extraction outputs, and transcript inputs -still produce commands of the form `narratio run-stage prepare SESSION --force`. -The native CLI has no `run-stage` route. Running that recommended command exits -with status 2; running it without the flag confirms the unknown-command error. -The current CLI reference correctly documents `run SESSION --stage STAGE`. - -This guidance predates the sprint, but remains active in the newly integrated -prepared-reference, analysis, and render workflows. Several existing tests assert -the obsolete command substring, so the green suite perpetuates the mismatch. -This is an inherited operator-recovery gap, not a regression introduced by the -Notarius protocol migration. - -**Required change:** use `narratio run SESSION --stage STAGE --force` in active -recovery messages and reconcile the corresponding tests. Preserve useful source -and stage context. Historical release notes and migration tables may correctly -name retired commands and should not be rewritten. No compatibility alias is -needed. - -**Verification:** exercise missing/corrupt prepared references, required analysis -inputs, and render inputs, and check that the suggested command has a supported -native route and flags. Test semantic recovery guidance rather than snapshotting -whole diagnostic strings. No generation or paid provider is needed to establish -CLI syntax compatibility. - -## 4. Reconcile accepted absolute analysis destinations with artifact identity - -**Priority:** P2 - -**Status:** Complete - -Shared session-relative identity now covers fingerprints, checkpoints, catalog -evidence, publication defaults, and restore fallback mapping. Configuration -remains unchanged. Verified equivalent-path reuse, forced generation with a -dependent artifact, portable records, publication mapping, confined paths, and -committed restore with focused stage/artifact/policy/application tests. - -**Stages:** 10 and 16; analysis reuse and lifecycle integration in 18–19 and 21. - -**Evidence:** [product_destinations.go](../../internal/config/product_destinations.go), -`validateProductDestinations`, lines 19–35 and 63–65, accepts an absolute -destination directly under the selected session's `artifacts/` directory. -[analyze_fingerprint.go](../../internal/stage/analyze_fingerprint.go), -`normalizedAnalyzeOutputIdentity`, lines 251–260, instead passes the configured -value to a relative-only normalizer. Analysis checkpoint creation uses that same -helper. [analyze_evidence.go](../../internal/artifacts/analyze_evidence.go), -`InspectAnalyzeEvidence`, lines 77–82, independently rejects the absolute form. - -An operator can therefore supply a valid flat destination, pass configuration -validation, and then fail analysis with `relative path must not be absolute`. -Selecting the equivalent absolute path for an already completed artifact also -makes it non-resumable. Catalog hydration consequently cannot advertise that -artifact as current for dependent analysis or publication. This is an existing -relative-only assumption left unreconciled with the Stage 10 decision to retain -both absolute and relative syntax for valid canonical destinations, rather than -a new regression in the fingerprint helper itself. - -**Reproduction:** temporary Go-overlay tests confirmed that concrete-artifact -and product-destination validation accept an absolute canonical path. Separate -tests using `currentAnalyzeFixture` confirmed that changing only -`artifacts/session_recap.md` to its absolute equivalent makes resume return -non-resumable and makes forced analysis fail during fingerprint computation. -The probes changed no repository code and used no real subprocess or provider. - -**Required change:** derive one consistent session-relative product identity -from either supported syntax using the selected session root, and use it for -analysis fingerprints, checkpoint records, and evidence/catalog resolution. -Keep the ConfigKit result unchanged and retain the existing flat-placement and -confinement rules. Reconcile publication and restore consumers of configured -output paths as necessary. Do not resolve the mismatch by imposing a new ban -on valid absolute destinations. - -**Verification:** cover successful analysis and unchanged resume for equivalent -absolute/relative canonical paths, current artifact resolution and dependent -inputs, and publication/restore with that configuration. Manifest product -identities remain portable and session-relative; paths outside the permitted -product directory remain invalid under the existing placement contract. - -## 5. Index committed product paths once per restore plan - -**Priority:** P3 - -**Status:** Complete - -Restore builds one source-path index and lazily constructs one fallback catalog -per plan. Duplicate evidence remains available for agreement checks; unrelated -paths are validated only when selected. Verified committed restore, fallback, -conflict, and path-agreement tests in `internal/app`. - -**Stages:** 19 and 21. - -In [restore_plan.go](../../internal/app/restore_plan.go), -`buildCommittedRestoreActions` calls `restoreProductRelativePath` for each -published product. Each call scans every stage output and every per-artifact -analysis record. With P published products and A manifest output records, this -mapping costs O(P × A), quadratic when P grows with A. This is new cutover code. -Missing evidence also rebuilds the configured artifact catalog on each lookup. - -Build a source-ID-to-paths index once per restore plan, then resolve each selected -source from that index. Mapping becomes expected O(A + P), plus the paths -actually checked. Build the fallback catalog at most once, lazily. Retain both -aggregate and per-artifact evidence and the existing disagreement checks; -last-write-wins indexing would hide conflicts. Validate paths for the requested -sources as today, without adding rejection rules for unrelated records. - -Verification should preserve nested-remote/flat-local mappings, carried locked -objects, duplicate agreeing evidence, conflicting paths, and missing-source -fallbacks. The complexity finding follows directly from the nested call/scan; -no timing or production-size assumption is required. - -## 6. Index prior audio records before S3 materialization - -**Priority:** P3 - -**Status:** Complete - -Prior audio records are indexed once by cleaned destination, retaining the first -audio match. Existing identity/hash/download checks remain unchanged. Verified -S3 reuse, missing-file replacement, unrelated kinds, and duplicate-record -precedence with `go test ./internal/stage ./internal/audio`. - -**Stage:** 17. - -In [prepare.go](../../internal/stage/prepare.go), `materializeS3AudioInputs` -scans `m.Inputs` for every selected S3 object (lines 436–444). For F objects and -R recorded inputs, prior-record selection is O(F × R), becoming O(F²) when -the manifest contains the same F audio inputs. This loop was introduced with -the simplified single-copy materialization path. It repeatedly cleans the same -recorded paths as well. - -Index audio records by cleaned destination path once, then perform expected -constant-time lookup per object: O(R + F) selection time and O(R) auxiliary -space, treating path length separately. Preserve current first-match behavior -if duplicate records are encountered, and keep all source-identity, checksum, -size, cancellation, and download verification in `MaterializeS3Audio` unchanged. -Audio-byte hashing and transfer costs remain linear in the bytes processed; -this opportunity concerns metadata lookup, not those required checks. - -Verify reuse and replacement with reordered records, unrelated input kinds, -missing records, and changed remote identities. The loop structure establishes -the complexity without a benchmark. - -## 7. Replace repeated roster ambiguity scans with indexed membership - -**Priority:** P3 - -**Status:** Complete - -Names, aliases, and classes use indexed Unicode simple-fold membership; sorted -character traversal and forwarded strings are unchanged. Verified existing -roster/family checks plus Unicode ambiguity across aliases, characters, and -classes with `go test ./internal/config`. - -**Stage:** 4. - -In [party.go](../../internal/config/party.go), `firstPartyDomainError` and -`partyNameAmbiguous` compare each character name/alias against all earlier names -and copy the accumulated list for each character (lines 150–195 and 212–218). -N distinct names/aliases require N(N−1)/2 string comparisons. Per-character -class validation likewise takes O(K²) comparisons for K classes. String lengths -multiply these comparison costs; cumulative name-list copying can also be -quadratic. This algorithm predates the migration and remains in the newly -adopted shared-roster path; it is not a new regression. Ordinary parties are -small, so practical benefit may be modest. - -Retain sorted character traversal and the selected ambiguity rules, but use -one membership set for names/aliases and one per-character class set. With -appropriate fold keys, membership becomes expected linear in total name bytes, -plus the existing O(C log C) ordering of C character IDs. Preserve exactly -`strings.EqualFold` equivalence, including Unicode simple-fold classes; plain -`strings.ToLower` is not an equivalent key function. A small canonical -simple-fold key helper is one option. Preserve original forwarded strings. - -Verify within/across-character ambiguity, repeated player names, duplicate -classes, and Unicode pairs such as sigma/final-sigma and ASCII K/Kelvin sign. -This changes lookup machinery, not the agreed Narratio roster requirements. - -## 8. Avoid repeatedly sorting the analysis ready queue - -**Priority:** P3 - -**Status:** Complete - -Analysis fingerprint ordering uses a standard-library lexical min-heap and no -longer sorts the ready queue on insertion. Dependency validation and the -smallest-ready-key order remain intact. Verified fingerprint, planning, and -execution graph tests with `go test ./internal/stage`. - -**Stages:** 16 and 21; inherited analysis scheduling used by the cutover. - -In [analyze_fingerprint.go](../../internal/stage/analyze_fingerprint.go), -`orderConfiguredAnalyzeArtifacts` sorts the entire ready slice whenever a -dependent becomes ready. A root with V−1 independent dependents causes sorts -of queues of lengths 1 through V−1. Even already sorted queues require -quadratic aggregate inspection; a general upper bound is O(V² log V), apart -from edge processing and dependency normalization. The implementation predates -this sprint; character-expanded artifact families increase its input size. -The roadmap selects deterministic dependency ordering, not this queue algorithm. - -Use the standard library's `container/heap` with a lexical min-heap. Each vertex -is inserted and removed once, yielding O(E + V log V) queue/edge work for E -dependency edges, plus any retained dependency-list normalization. It preserves -the same smallest-ready-key choice; a FIFO queue would change that ordering. -Keep unknown-dependency and cycle errors. Verify wide fan-out, chains, shared -prerequisites, and map-insertion independence against the same observable order. - -## 9. Prevent generated audio names from colliding with original names - -**Priority:** P2 - -**Status:** Complete - -Destination assignment reserves all original basenames and checks generated -names globally in deterministic source order, adding suffixes only on conflict. -Verified distinct prepared bytes, original-name preservation, input-order -independence, and existing duplicate-basename behavior with stage tests. - -**Stage:** 17; retained local-audio acquisition behavior. - -In [prepare.go](../../internal/stage/prepare.go), `localAudioDestinations` -(lines 381–401) disambiguates equal basenames independently of other basename -groups. For `/a/one.flac` and `/b/one.flac`, it generates names containing a -source-path hash. A third recording can already have exactly one of those -generated basenames. The two distinct sources then share a destination. -`materializeLocalAudioInputs` sequentially copies both to that path, so the -later recording replaces the earlier prepared copy. Original recordings remain -untouched, but prepared membership/evidence can no longer represent both. -This is an inherited correctness defect, not a newly introduced naming scheme. - -A temporary offline Go-overlay test constructed the third basename from the -first source's actual digest and confirmed duplicate destinations. No hash -collision, race, real audio, or external service was required. - -Resolve destination ownership across the complete selected audio set. Reserve -unmodified names and check generated candidates against a global occupied-name -set, using deterministic conflict resolution while retaining ordinary existing -names. At minimum, detect an unresolved conflict before copying either source; -do not permit silent replacement or ban ordinary duplicate-basename inputs. -The existing assignment is expected O(F) in F paths; global membership checks -can remain expected O(F), with O(F log F) if deterministic ordering is needed. -No new persistence or compatibility machinery is required. - -Verify a generated-versus-original collision, ordinary duplicate basenames, -unchanged noncolliding names, and materialization of distinct bytes to distinct -destinations. Check destination uniqueness before performing file writes. - -## Review coverage and verification - -| Implementation stages | Inspected boundaries | -| --- | --- | -| 1–3 | Offline schema compilation/resources, new-state rejection before execution/restore, and canonical workspace paths. | -| 4–6 | Shared roster profile and forwarding, campaign/session resolution and presence semantics, native inspection, initialization and template selection. | -| 7 | Catalog source migration, local validator/CI, schema provenance, and independent validation. | -| 8–10 | Standalone inputs and autocorrection, four individual and combined envelopes, reference snapshots, output naming/collisions and native controls. | -| 11–14 | Native completion/required products, fallback/reuse evidence, Audita inputs/destinations, and shared pipeline-aware readiness. | -| 15–17 | Managed views, producer log/debug/product routing, and single-copy audio acquisition. | -| 18–20 | Publication declarations, canonical restore/previous inputs and diagnostics, role-aware cleanup/retention. | -| 21–23 | Reuse and bounded workflows, maintained examples, controlled real consumers, canonical documentation, and attribution. | - -Passing checks during review used Go 1.27.4: - -- Narratio: `go test ./...`, `go test -race ./...`, `go vet ./...`, and - `go build ./...`; CGO-disabled CLI cross-builds for Linux amd64/arm64 and - darwin arm64. The macOS result establishes compilation, not native execution. -- Catalog: `go test ./...` and `go run ./cmd/validate`. -- The catalog compatibility script against the pinned Audita v4.3.0 and - Notarius v0.10.0 source builds with local HTTP provider fixtures. All ten - Notarius lanes passed; initial, cached, and forced runs used 9, 0, and 9 - provider calls respectively. No paid provider was used. -- All six vendored schema/semantic files matched the released schema checkout - byte for byte. Consumer binary VCS revisions matched the roadmap baselines. - -The two temporary regression probes reproduced findings 1 and 2 despite the -green existing suites. Finding 3 was confirmed against the built native CLI -and its existing diagnostic assertions. These expose coverage gaps, not flaky -default tests. No further required remediation was identified in the initial -reviewed scope. - -### Integration follow-up - -A second review used Narratio commit -`d3d7728f1f3809d65ab8256cd6973700bca31d93` (the implementation source is unchanged -from the reviewed commit above), following the implementation stages in order. -It examined new behavior against existing consumers and lifecycle machinery: - -| Stage | Integration boundary reviewed | -| --- | --- | -| 1 | Shared structural/semantic validation consumes native resolved values; schema loading stays offline. | -| 2 | The v2 marker flows through local execution, remote discovery, previous-session acquisition, and restore. | -| 3 | Canonical path changes flow into stage staging, prepared references, previous inputs, and manifest resolution. | -| 4 | Shared roster acquisition and forwarding agree with the existing players projection and character-family derivation. | -| 5 | Campaign defaults and session clearing/replacement preserve independent field and resource-origin semantics. | -| 6 | Native acquisition/inspection and session initialization retain separate configuration results and template precedence. | -| 7 | The catalog's indexed shared sources retain consumer selectors and pass its independent validation. | -| 8 | Prepared snapshots and generated autocorrection feed existing Seriatim inputs and prepare resume checks. | -| 9 | Individual/combined vocabulary, prepared-source IDs, verified references, and content-change evidence agree. | -| 10 | Flat destination validation was compared with existing analysis identity code; finding 4 records the mismatch. | -| 11 | Native completion parsing retains exit-status authority and shares runtime argument construction with readiness. | -| 12 | Canonical extraction evidence feeds catalog, analysis, and reuse independently of the retained bundle; finding 1 still applies. | -| 13 | Audita execution/readiness use the same saved inputs and preserve existing transcript/report acceptance. | -| 14 | Selected-work projection controls readiness, real/synthetic input choice, lazy adapters, and isolated probe diagnostics. | -| 15 | Attempt transitions, failed attempts, self-skips, reuse, and latest-view ownership agree with runner lifecycle. | -| 16 | Transcript/product promotion and producer diagnostic routing remain distinct; finding 4 also affects analysis execution. | -| 17 | Audio acquisition and restore retain one verified copy while per-speaker checkpoints remain manifest-backed. | -| 18 | Prepared-file enumeration, product discovery, immutable declarations, lock carry, and current-run diagnostics preserve their roles. | -| 19 | Committed product mapping, rebased session references, previous inputs, audio verification, and restore conflict/recovery paths were inspected. | -| 20 | Cleanup authorization and role-based retention preserve latest targets and durable bundles; finding 2 still applies. | -| 21 | Semantic resume, bounded selection, artifact evidence, and operator recovery were checked; findings 3–4 remain applicable. | -| 22 | Assembled campaign/consumer workflows and controlled compatibility evidence were checked against the pinned releases. | -| 23 | Canonical documents, examples, recorded verification, and scope/ownership boundaries were reconciled with the implemented interfaces. | - -The follow-up reran `go test ./...`, `go vet ./...`, `go build ./...`, documentation -checks, and focused configuration, stage, application, and managed-view -regressions with Go 1.27.4. Catalog `go test ./...` and `go run ./cmd/validate` -also passed at `016473fd16b15847f3e913670c423faa7c35720b`. Existing tests passed; -the temporary absolute-path probes exposed finding 4. Findings 1–3 remain -pending. No fixes, compatibility shims, new product restrictions, or upstream -changes were made. - -### Algorithmic follow-up - -Reviewed commit `4ee706bfb676ba2d0cf24be7aaf8472e778a6696`, in implementation -stage order. Findings 5–8 are optimization candidates for consideration; -finding 9 is a correctness remediation. Prior findings retain their statuses. -Complexities are analytical, with ordinary expected-time Go map operations; -no measured performance improvement is claimed. - -| Stage | Algorithmic review | -| --- | --- | -| 1 | Schema compilation is cached with `sync.Once`; glossary uniqueness uses per-collection sets. | -| 2 | Version checks are constant-time after manifest decoding; shared remote verification remains authoritative. | -| 3 | Canonical path construction scales with path length rather than session file count. | -| 4 | Shared validation/projection was inspected; repeated ambiguity scans are finding 7. | -| 5 | Field defaulting is bounded by the fixed interface; native ConfigKit resolution remains upstream-owned. | -| 6 | Initialization and standalone rendering scale with selected document size; independent native inspections remain intentional. | -| 7 | Catalog checking compiles its schema once and uses collection-ID sets and deterministic index traversal. | -| 8 | Input reconciliation indexes kind/destination pairs; snapshots and checksum passes scale with input bytes. | -| 9 | Four individual envelopes plus one combined projection add fixed-factor serialization/validation work selected by the plan. | -| 10 | Destination collision checks use a destination-owner map after existing deterministic ordering. | -| 11 | Completion decoding is bounded and linear in report size; command/reference construction has no all-pairs scan. | -| 12 | Required-lane mapping uses owner maps and stages one payload at a time; whole-file checks and promotion remain selected behavior. | -| 13 | Audita receives the fixed four prepared files; no new variable-size matching algorithm was introduced. | -| 14 | Required-lane/readiness matching uses sets; native provider checks and ConfigKit internals are outside this audit. | -| 15 | Latest-view operations handle two categories and validate paths; managed-target enumeration is linear in view entries. | -| 16 | Producer routing is path/byte proportional; reused analysis ordering is considered in finding 8. | -| 17 | S3 prior-record lookup is finding 6; retained local destination assignment has the correctness defect in finding 9. | -| 18 | Publication enumerates declared records and indexes source/lock/destination ownership; file verification remains byte-proportional. | -| 19 | Per-product whole-manifest scans and repeated fallback catalogs are finding 5. | -| 20 | Cleanup prefix checks scan a protection set bounded by the fixed stage inventory plus bundle markers; this is not quadratic in run file count. | -| 21 | Analysis fingerprint ordering re-sorts growing ready queues (finding 8); map-backed prepare reconciliation is already linear. | -| 22 | Workflow fixtures and controlled consumer checks protect behavior, without asserting unmeasured scalability. | -| 23 | Documentation/verification adds no runtime algorithm; the recorded opportunities preserve the selected contracts. | - -Explicit planning choices were left intact: native configuration composition, -deterministic ordering, five glossary documents, whole-file content evidence, -per-file staged promotion, and the retained content/lifecycle boundaries. -Nested traversal of distinct entries/classes/lanes is not by itself quadratic; -findings identify repeated traversal of the same growing collections. - -Existing tests passed for configuration, stages, application, artifacts, audio, -shared validation, glossaries, file operations, and previous inputs using Go -1.27.4; documentation checks and `git diff --check` also passed. The separate -temporary audio-name probe failed as expected, reproducing finding 9. No -implementation or upstream files were changed, and no live provider or -real-world performance measurements were used.