diff --git a/docs/roadmap/audita.md b/docs/roadmap/audita.md index b67a3a3..e7c3dc0 100644 --- a/docs/roadmap/audita.md +++ b/docs/roadmap/audita.md @@ -9,7 +9,7 @@ reports, and optional debug evidence in their Narratio-selected destinations. This roadmap supersedes the v4.1 adoption proposal and records the agreed runtime-glossary ownership boundary. It defines the target and required changes; -implementation stages belong in a subsequent plan. +the [implementation plan](implementation.md) owns staged execution. The [workspace roadmap](workspace.md) owns shared layout, latest-attempt views, and retention behavior. Its referenced ADRs remain Proposed. @@ -38,8 +38,8 @@ The separate [D&D recipe repository][recipes] was also reviewed at commit against v4.2.0. Its README still describes the runtime interface as unreleased; updating that upstream statement is a documentation follow-up, not an adapter dependency. There is no remaining upstream feature blocker for the glossary -handoff or synthetic-transcript preflight. The final section identifies remaining -implementation-planning work. +handoff or synthetic-transcript preflight. The implementation plan records the +remaining catalog licensing question and implementation details. ## Current Narratio Behavior @@ -195,6 +195,11 @@ catalog IDs and files must resolve successfully and supply the expected named collection. Do not turn a missing or invalid selected source into an empty result. Empty collections are valid; Audita owns processing sufficiency checks. +All four entry lists are authoritative runtime inputs, including empty lists. +An omitted Narratio setting or system selection therefore replaces any +same-named Audita-configured entry list with an empty list. Other Audita +collections remain available under native composition. + Resolve catalog paths and `glossary_file` relative to their defining sources, including imported fragments. External files use the canonical named-collection document shape, not a bare collection or a legacy glossary. Their native imports @@ -678,13 +683,12 @@ development. Local development configuration can import the sibling catalog; maintained production examples must not depend on developer checkout paths. No submodule or Go workspace is required for the data repository. -Develop the configuration contract and a minimal bundle together. The bundle -should contain its catalog fragment, one setting entry, one system entry, and -representative vocabulary demonstrating native imports, and the format schema -with validation examples. Then exercise one -complete production path: selection, party/campaign preparation, all four -prepared collections, and full Audita preflight. Expand reference content once -that handoff works. Implementation stages belong in the subsequent plan. +The initial bundle contains its catalog fragment, one setting entry, one system +entry, representative vocabulary demonstrating native imports, and the format +schema with validation examples. Its compatibility checks cover the complete +production handoff: selection, party/campaign preparation, all four prepared +collections, and full Audita preflight. Larger vocabulary coverage can evolve +independently of this initial integration. Narratio's default tests use checked-in synthetic fixtures without sibling checkout dependencies. The catalog should have an offline compatibility check @@ -696,15 +700,12 @@ calls remain explicit integration runs, not ordinary catalog tests. [catalog]: https://forge.maximumdirect.net/eric/narratio-reference-catalog -## Remaining Implementation-Planning Work +## Implementation Coordination The catalog model, authoring fields, native file/inline composition, session -selection behavior, and shared input cutover are settled. The minimal catalog -bundle and canonical schema still need to be authored and checked against the -contract above. Exercise Narratio's complete acquisition path with the authoring -examples; the focused ConfigKit probe establishes the layering primitives only. -Specify validation's destination probes when no execution run exists, using the -relevant workspace location without creating a processing attempt or advancing -latest-attempt views. Package mechanics, schema packaging, and any demonstrated -consumer-specific projections belong in implementation planning, not further -product-scope decisions. +selection behavior, and shared input cutover are settled. The +[implementation plan](implementation.md) owns stage ordering, schema packaging, +the minimal catalog bundle, validation probe placement, and verification through +Narratio's complete acquisition path. Validation probes use the relevant +workspace location without creating a processing attempt or advancing +latest-attempt views. The canonical schema and bundle are pending implementation. diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md new file mode 100644 index 0000000..4ba1190 --- /dev/null +++ b/docs/roadmap/implementation.md @@ -0,0 +1,620 @@ +# Audita v4.2 and shared glossary implementation plan + +## Scope and execution + +Implement [the feature roadmap](audita.md) in the numbered order below. The +audience is a Luna coding agent handling one stage per implementation prompt. +Every stage starts pending. Record completed work and its verification when a +stage is finished; distinguish implemented work from checks awaiting a later +stage. Follow `AGENTS.md`, [development guidance](../development.md), and its +applicable policy-reading guide for every stage. + +This is one end-to-end sprint. Intermediate changes may temporarily fail to +compile or leave dependent tests awaiting the cutover. Make the direct changes +needed for the final design; temporary compatibility readers, dual source IDs, +module translators, and provisional configuration formats are unnecessary. +Commit focused completed units under the agent policy. Report deferred checks +truthfully, and make the final repository-wide checks pass before completion. + +Planning baseline: Narratio `4f68fb2`. Audita v4.2.0 is +`973b24e46618dc785751fa7c803e7c16c900353f`; the reviewed D&D recipes are +`6d5e66dcfca4bb5971a8423332a19ce884b846c0`. Canonical upstream links and the +full intent belong in the feature roadmap. Inspect current sources before +editing: the file names below identify owners, not immutable private APIs. +Prefer the codebase graph for code discovery. + +The sprint covers Narratio and the new local `../narratio-reference-catalog` +data repository. That sibling directory was absent at planning time. Stage 1 +establishes its schema and minimal bundle. Commit each repository independently; +record the catalog commit used by Narratio. Creating a remote repository, +pushing, tagging, releasing, updating Audita code, and adopting Notarius v0.9.0 +are separate actions requiring authorization. Default tests must work without +any sibling checkout, installed downstream executable, real credentials, or +external provider. + +Read the Open Questions before Stage 1. The catalog's new-material license +requires an author choice before finalizing its licensing or incorporating its +schema. The application design decisions recorded in the roadmap are settled. + +## Implementation boundaries + +- ConfigKit owns source composition, imports, inheritance, presence, and native + inspection. Use its supported definitions, resolution, and layered inputs. + Narratio consumes completed results and derives separate glossary objects; + it does not replace effective configuration with those objects. +- Use a small `internal/glossary` owner for the shared glossary model, native + vocabulary acquisition, schema validation, deterministic projections, and + serialization. Keep selection/defaulting and source-context adaptation in + `internal/config`; keep subprocess flags in the Audita adapter. No general + projection framework or second composition implementation is needed. +- Preserve native entry extensions and collection instructions. Party projection + uses stable character IDs, character names, aliases, and category `person`; + order entries by stable character ID. Player/class enrichment is not required. + Preserve supported field-presence distinctions during projection/serialization; + do not erase an explicitly empty instruction through an `omitempty` shortcut. +- Prepare the four named documents and identities in the roadmap. Use distinct + manifest input kinds `glossary_party`, `glossary_campaign`, `glossary_setting`, + and `glossary_spells`, through the existing prepared-input descriptor mechanism. + Their content digests and existing input records establish authority. +- All four collections are supplied to Audita, even when empty. Thus Narratio + owns those four runtime entry lists: an empty list replaces a same-named + Audita-configured list. Other collections and omitted instruction fields + retain native downstream composition. Do not silently omit an empty role to + preserve privately configured entries. +- Preserve richer party/player inputs and the existing Notarius spell-overlay + input. Retire only the monolithic glossary source and its old prepared path. + Update authored bindings explicitly; never redirect an old source ID. +- Preflight follows completed/reused preparation and precedes selected + processing. It remains an invocation check. Retain Audita's provider checks, + use a synthetic transcript, and report that scope accurately. Scriptorium + keeps its current target-selection and error/warning policy at the new boundary. +- Preserve canonical stage order, output validation/promotion, ordinary force + and invalidation, credential forwarding/redaction, publication commitment, + workspace modes, and restore guards. Apply the pending workspace roadmap only + to its stated coordination points; this sprint does not implement that entire + independent feature. + +## Stage 1. Establish the catalog format and minimal data bundle + +Status: Pending + +Read roadmap sections “Canonical glossary format” and “Reference Catalog +Distribution and Development,” and the OSS/documentation policies. + +In the local catalog repository, create the format contract, `catalog.yml`, +`schemas/glossary-v1.schema.json`, small valid/invalid examples, and one setting +and system entry demonstrating native relative imports. Use a deliberately small +representative vocabulary, not an encyclopedia or an unreviewed third-party dump. +Describe content sources and attribution. Apply the resolved license choice. + +Define a JSON Schema with reusable entry, partial-authoring collection, complete +collection, and named-document definitions. Base the fields on Audita v4.2's +native glossary model. Keep extension fields on entries; allow general collection +names. Complete collections require an `entries` list, including `[]`. +Partial authoring definitions allow instruction-only contributions. Do not add +nonempty-collection, global entry-ID uniqueness, or Narratio-role restrictions. +Keep format identity in the schema and contract, outside the glossary root. + +The catalog fragment maps IDs to source-relative entry files under +`reference_catalog.settings` and `.systems`. Document local installation and +native imports, independently selected vocabulary revisions, and compatibility +targets. Give minimal entries truthful names/IDs; do not label synthetic content +as a complete Forgotten Realms or 5e reference. + +Check examples against the schema and Audita's documented shape. Commit this +unit locally and record its full revision for Stage 2. Executable consumer +compatibility checking is completed in Stage 17. + +## Stage 2. Add the shared glossary model and pinned schema validation + +Status: Pending + +Read roadmap “Canonical glossary format” and Audita's native input contract. +Create `internal/glossary` with native collection/entry representations retaining +extensions, and an embedded, verbatim copy of the catalog's versioned schema. +Record the catalog revision and maintain schema ownership upstream. Use +`github.com/santhosh-tekuri/jsonschema/v6` v6.0.3, the engine already used by +Audita, for JSON Schema evaluation; ConfigKit remains the YAML/configuration +loader. Add the dependency and OSS notices using the selected module's actual +license and commit. Review notices for the incorporated schema as well. + +Compile the pinned schema locally; runtime validation must not fetch a schema. +Validate resolved decoded data and complete prepared documents, preserving the +native types supported by the loader. Keep partial and complete validation +entry points distinct. Preserve useful collection/field context in errors. +Apply semantic validation for within-collection ID uniqueness where +schema evaluation alone cannot express it. Avoid unrelated spelling restrictions. + +Test empty complete collections, missing required structure, instruction-only +partial input, ordinary optional fields, retained entry extensions, and duplicate +IDs within one collection. Identical IDs in different collections remain valid. +Add synthetic local fixtures so tests do not read the catalog checkout. + +## Stage 3. Add catalog selections to native pipeline acquisition + +Status: Pending + +Read `docs/internal/configuration.md` and the roadmap's authoring field table. +Update `internal/config/config.go`, pipeline definitions/defaults/validation, +resource-base adaptation, and projections/rendering as applicable. + +Add `reference_catalog.settings` and `.systems` mappings to the pipeline model. +Resolve each selected catalog path from its effective field's native origin and +source context, including paths contributed by an imported catalog fragment. +Reuse `resource_base.go` and ConfigKit metadata. Keep catalog data and selections +visible in actual native inspection rather than substituting a derived view. + +Catalog absence is valid. Validate selected IDs against the effective catalog; +an explicitly selected unknown ID is an error. Do not require unused catalog +entries to be installed/readable or inspect unselected vocabulary files. + +Use a real ConfigKit imported-fragment fixture to test source-relative paths, +operator catalog extensions through ordinary native configuration, missing IDs, +and native inspection/digest behavior. Equivalent layouts should not gain an +extra all-configuration cache invalidation key. + +## Stage 4. Implement campaign/session glossary authoring and field selection + +Status: Pending + +Start with `document_configkit.go`, `config.go`, `document_render.go`, +`resource_base.go`, and their session-default/presence tests. Implement the +roadmap's `inputs.setting`, `.system`, `.glossary_file`, and inline `.glossary`. +The file becomes optional and uses the new named-collection format. Keep the +canonical party roster required; retain existing spell-overlay fields. + +Use ConfigKit presence/default callbacks to inherit each omitted campaign field +independently. A supplied session inline collection replaces the campaign's +inline selection as a whole; its file selection changes only that field. +Perform later file-plus-inline composition separately in Stage 5. Record truthful +default provenance. Resolve selected file paths from their defining sources. + +For optional setting/system/file selectors, null or empty effective selections +mean no selected source, without falling back to campaign values. For inline +data, explicit null removes that contribution; an empty collection mapping is +an explicit contribution. Validate incompatible value types normally. Preserve +native list/control behavior inside the glossary load rather than interpreting +`entries: []` as a custom clear operation. + +Render authored/effective campaign and session snapshots with their selections +and inline values intact. Do not replace inline authoring data with composed +vocabulary in native results. Test the roadmap's two independent session override +examples, omitted versus supplied selections, partial inline data, and imported +source bases. Update current tests that require a monolithic glossary file. + +## Stage 5. Resolve native vocabulary and derive the four domain collections + +Status: Pending + +Read roadmap “Glossary authoring and precedence” in full. Implement one production +resolution path shared by preparation and prepare-resume comparison. Configuration +acquisition supplies finalized selections/contexts; vocabulary resolution returns +separate domain values and serialized standalone named-collection documents. + +Use native ConfigKit layered loading for the selected campaign file below the +selected inline contribution mounted at `campaign`. Enable imports and register +entry identity by `id` using the supported sequence API, matching Audita. Resolve +complete external files before selecting the requested collection, so sibling +inheritance works. The setting/system files supply `setting`/`spells` respectively. +Do not reduce the file to a hand-parsed YAML subtree before native resolution. + +Preserve whole-record upsert, native lower-tier explicit replacement policy, +instructions, extensions, and errors. Validate the completed selected collection +after the file/inline contributions compose; incomplete individual contributions +are valid inputs to that composition. Do not normalize a native composition +error into an empty collection. Missing selected files or required named roles +fail with selection/source context. Omitted sources produce complete empty roles. + +Derive `party` from the resolved canonical roster and serialize all four documents +deterministically. Reuse these functions rather than independently composing +vocabulary for preflight, validation, and stage execution. Basic acquisition +selects resources; validation against prepared inputs must not resolve live +files into candidate glossary projections. + +Test the roadmap's Silver Watch/Old Watch and native `replace` clearing examples +through the actual pipeline/campaign/session acquisition path, including imported +catalog paths. Also cover retained instructions/extensions, sibling inheritance, +omitted roles, invalid selected sources, and nonmutation of native configuration. + +## Stage 6. Register shared glossary identities and canonical paths + +Status: Pending + +Read roadmap “Shared input identities and cutover,” `artifactpolicy/policy.go`, +`artifacts/prepared_input.go`, and the existing prepared-input tests. + +Add the four exact source IDs and paths from the roadmap to the shared prepared +descriptor and path owners. Extend descriptor handling to support nested +`inputs/glossaries/` destinations without assuming every filename is a basename. +Use those same descriptors for resolution, artifact classification, supported +source validation, and configured Scriptorium/Notarius bindings. + +Remove the old `narratio.input.glossary` registration and resolution paths. Do not +alias it to `campaign`, infer new roles from old bytes, or change `party`, +`players`, and `spell_catalog` identities. A stale old file can remain incidental +under existing lifecycle behavior; its presence is never new input authority. + +Test all four descriptors and resolution against manifest checksums/sizes, +missing/tampered files, and nested path handling under existing guards. Verify +old configured source references fail with actionable migration guidance. + +## Stage 7. Materialize shared collections in prepare + +Status: Pending + +Start with `stage/prepare.go`, `prepare_party.go`, and configuration rendering. +Call Stage 5's resolver as part of ordinary preparation and fail on invalid +selected vocabulary before downstream processing. Materialize four standalone +documents using shared paths and ordinary workspace file operations/modes. +Write all four, including empty collections, and record their distinct manifest +inputs with digest, size, and non-secret provenance. Use the existing manifest +input model; this feature does not need another progress manifest. + +Remove the monolithic glossary copy/manifest input from the current preparation +set. Preserve party/player generation, speakers/autocorrect, optional structured +spell overlay, previous-session inputs, and audio behavior. Resolve vocabulary +before expensive preparation work where practical without moving native +downstream preflight ahead of completed preparation. + +Verify deterministic prepared bytes and manifest ordering, nested workspace +modes, empty roles, failure without false preparation success, and retention of +unrelated stable input contracts. Leave stage transitions with the existing +runner, not the glossary helper. + +## Stage 8. Make preparation reuse and invalidation glossary-aware + +Status: Pending + +Read `prepare_resume.go`, `semantic_contracts_initial.go`, and their focused +tests. Extend the prepare semantic contract and durable-input checks for the +new selection/projection contract. Compare current resolved vocabulary using +the same resolver and serializer as Stage 7; include imported effective content, +inline overrides, catalog selections, and the party projection. + +Changes to effective prepared vocabulary invalidate through existing prepare +rules. Equivalent source relocation/formatting with equivalent effective bytes +does not gain a new path-only invalidation requirement. Unchanged prepared +inputs remain reusable. An installed catalog update during processing never +reopens or replaces the invocation's prepared vocabulary. + +Require new input records when prepare is selected or reuse-checked. Prior +monolithic records cannot satisfy them; use normal reprepare behavior and a +versioned semantic contract rather than an old-session converter. A bounded +run excluding prepare verifies the prepared sources it needs and reports +prepare guidance when they are unavailable. + +Test an imported vocabulary change, equivalent layout relocation, selected ID +change, empty-role preparation, missing/corrupt prepared files, and old evidence. +Retain existing per-speaker and per-artifact resume behavior. + +## Stage 9. Carry the new prepared inputs through publish and restore + +Status: Pending + +Read `stage/publish_sources.go`, prepared publication tests, artifact current +state mapping, and app restore planning/execution tests. Register the four input +kinds and nested paths wherever publication, remote descriptors, status, and +restore enumerate prepared inputs. Prefer the shared descriptors over four +new independent path switches. + +Publish the actual verified prepared documents; do not reopen campaign/catalog +sources during upload. Restore the committed documents and manifest evidence +at their canonical nested paths, retaining manifest-last installation and all +current path/conflict/lock checks. New vocabulary inputs are neither run-local +debug evidence nor subprocess cache. Retire the old glossary mapping in current +output generation without introducing a compatibility reader for it. + +Test a prepared-input publish/restore round trip containing all four documents, +empty roles, changed local bytes, and unchanged party/player/spell-overlay +behavior. Preserve the existing immutable commit/pointer ordering and force +conflict policy; no new remote protocol is needed. + +## Stage 10. Cut the Audita processing adapter over to v4.2 + +Status: Pending + +Read Audita v4.2 CLI/subprocess/output contracts, then `adapters/audita` and +its current subprocess tests. Replace the single legacy glossary request with +an ordered native glossary-file request. Pass one argument pair per file. +Continue using `process` and explicit output. Keep main/overlay/profile, +description, output-schema, timeout, credential, and cancellation behavior. + +Remove `--modules` and its configuration, validation, projection, request, and +composition plumbing. Add optional `pipeline.audita.debug`: true requests debug; +false/omission adds no debug override. Add independent report/work-directory +request destinations. Normal production omits `--debug` and `--reporting=false`. +Selecting the work directory alone must not enable capture. + +Use a shared processing-settings argument builder suitable for preflight in +Stage 12. Keep native CLI semantics; no version probe, generated Audita entry +configuration, legacy flag fallback, or module-list translator is needed. +Update the safe generated invocation record to the actual new request contract. + +Test exact argument boundaries/order for runtime files, supported selectors, +independent destinations, debug omission/enablement, and removed fields. Retain +shared sensitive credential forwarding/redaction and failure evidence coverage. + +## Stage 11. Integrate prepared glossaries and diagnostics into polish + +Status: Pending + +Read `stage/polish.go`, `run_local.go`, and +`semantic_contracts_refinement.go`. Resolve all four glossary inputs through +the shared prepared-input resolver. Use a stable role order: party, campaign, +setting, spells. Resolve the base transcript through its existing output evidence. +Stage logic receives domain paths and settings; the adapter owns CLI construction. + +Use a shared polish invocation/context builder for both execution and preflight: +execution supplies the real transcript, preflight later substitutes its fixture. +Supply `runs//polish/logs/` for reports, captured streams, and invocation +records, and `runs//polish/debug/` as the debug root. Create required +parents through the shared workspace owner. Do not add latest-attempt links here; +that work remains in the workspace roadmap. + +Discover only the existing fixed optional report names in the selected report +directory. Validate reported paths there rather than beside the staged transcript. +Keep bounds and original failure causes. Nonzero exit never promotes transcript +bytes; recoverable model errors on exit zero remain accepted. Early failures may +have no reports. Keep the existing `segments` output validation contract and +explicit output-schema choice where needed. + +Version affected polish semantic evidence; remove modules and include actual +prepared input identity through the existing input-evidence mechanism. Debug, +credential rotation, and destination-only changes remain operational. Test +missing/changed vocabulary, nonzero-with-output, optional reports, independent +paths, successful promotion, and force/reuse semantics. + +## Stage 12. Add native Audita preflight and the embedded transcript asset + +Status: Pending + +Extend the Audita adapter with a narrow preflight operation using the same +processing settings/argument builder as Stage 10. Use `preflight` and retain +native default smoke checks; do not pass `--smoke=false` in production orchestration. +Return native exit outcome and safe diagnostic context without parsing its +human-readable progress or inventing a readiness schema. Reuse supervision, +timeouts, cancellation, and credential redaction. Preflight does not discover +or promote processing outputs or expect ordinary report files. + +Keep preflight's own captured streams and invocation diagnostics in its temporary +invocation context, separate from the intended processing/report/debug paths +being probed. Preserve useful bounded diagnostic details in its returned error +before temporary cleanup. Do not clear or overwrite earlier stage diagnostics. + +Embed a small representative synthetic transcript in the Narratio-owned +integration boundary, using `go:embed`. Give it multiple valid timed utterances +and speakers, and materialize it in invocation-scoped temporary storage. Remove +temporary material on every outcome. It is not a prepared session input or a +transcript artifact. It need not satisfy every possible chunk/section setting; +native fixture-dependent failures remain errors. + +Test shared flags/destinations/vocabulary/credentials between preflight and +processing, absence of any smoke-disabling override, exit/error propagation, +temporary cleanup, and cancellation. Use the subprocess seam, not paid providers. + +## Stage 13. Extend the shared preflight checker and target model + +Status: Pending + +Read `internal/preflight`, `app/preflight_targets.go`, and current Scriptorium +finding-policy tests. Add a narrow Audita check contract and a selected polish +target alongside the existing Scriptorium targets. Keep tool-specific invocation +in adapters and tool-specific findings interpretable through their own contracts. +A sequential composition of the existing checks is sufficient; no plugin registry +or generic workflow engine is required. + +Use verified prepared vocabulary and Stage 11's invocation/context construction. +Execution selects Audita only when polish is projected to run. Validation selects +it when polish is enabled, independently of completed output reuse. Existing +Scriptorium target closure, required/optional binding treatment, and warning/error +policy remain intact. Empty target sets invoke no tool. Native Audita failure is +an error with its original diagnostic explanation; cancellation stops checks. + +Test selected/unselected polish, reusable work, Scriptorium warnings versus errors, +Audita failure, and cancellation at the shared checker/selection boundaries. +Do not duplicate adapter command tests or parse Audita's stderr into findings. + +## Stage 14. Move execution preflight after preparation + +Status: Pending + +Start with `app/runner.go`, `runner_preflight.go`, `runner_composition.go`, +`runner_stage_execution.go`, `plan.go`, and the current runner/preflight tests. +Remove the old unconditional pre-stage hook. Run ordinary selected `prepare` +through its existing lifecycle, including reuse, durable saves, and invalidation. +Then run downstream preflight once before the first selected post-prepare stage. +For a bounded range omitting prepare, check at that same logical boundary using +existing prepared inputs, without inserting prepare into the range. + +Reproject remaining selected work against the post-preparation manifest. Do not +reuse a projection made before preparation could invalidate polish or analysis. +Include force/range/artifact selection exactly as the normal work planner does. +Only relevant downstream targets initialize their adapters, and invocation-owned +instances can be reused by execution. A prepare-only invocation has no remaining +processing target and makes no downstream calls. Fully reused and cleanup-only +invocations also avoid irrelevant preflight and empty run directories. + +A failed check stops before subsequent stage attempts or their force invalidation. +Retain completed preparation and any invalidation it already caused. Finalize +the invocation/summary with prepare completed or reused and processing not +attempted; do not mark polish failed or succeeded when it never ran. Reuse the +existing session lock and finalization machinery. + +Test preparation success/reuse/failure, preparation-induced invalidation exposing +new targets, bounded runs, prepare-only/full reuse/cleanup-only, force after +failure, and retry reusing completed preparation. `session plan` remains +subprocess-free; neither preflight nor fixture storage advances latest views. + +## Stage 15. Use the shared downstream checks in session validation + +Status: Pending + +Read `app/session_inspection_command.go`, `operator_inspection.go`, invocation +acquisition, and their validation tests. Retain basic configuration findings. +Resolve the existing local manifest and prepared vocabulary required by enabled +polish through the same resolver/checker used for execution. Missing or invalid +evidence produces actionable prepare guidance. Do not run prepare, fetch audio, +resolve candidate live vocabulary, or manufacture manifest authority. + +Use the shared embedded transcript and actual selected Audita settings. Validation +has no execution run: probe intended polish destinations beneath the session's +workspace root in `runs/.validation/polish/`, with the normal transcript filename +under `outputs/`, and separate `logs/` and `debug/` roots. This is a validation +probe namespace, never a run identity, processing attempt, report, or latest view. +Use the workspace path owner and existing directory modes. Remove temporary +probe files through native preflight; empty parent directories may remain. Keep +these probe paths out of publication/restore and stage authority. Real execution +still checks its actual run destinations. + +Native preflight performs provider calls and temporary destination probes; +report these side effects and synthetic-transcript scope. Preserve current +validation result/exit presentation and safe errors. No new durable validation +manifest or session lock policy is required merely for this check. + +Test missing prepared inputs, valid prepared reuse, unchanged source bytes and +manifest, native destination failure, provider failure, cancellation, and existing +Scriptorium findings. Verify no audio transfer, processing artifact, run ID, +stage transition, or latest-view rotation occurs. + +## Stage 16. Cut maintained consumer bindings and examples over explicitly + +Status: Pending + +Update maintained pipelines, campaign/session examples, and synthetic fixtures +to the new fields and source IDs. Replace the old Notarius text `glossary` +binding with `narratio.input.glossary.campaign`. Keep its binding name and current +Notarius v0.8.1 reference mechanism; preserve party/player/spell-overlay bindings. +Change Scriptorium source IDs explicitly while preserving prompt binding names. +Update prompt input-shape examples where the old glossary format was assumed. + +Remove `pipeline.audita.modules`; show pipeline ordering in Audita-owned +configuration or link to the independently selected external recipes. Include +one minimal checked-in synthetic reference catalog, an import-relative example, +inline-only/file-only/combined campaign authoring, and omitted optional roles. +Production installation examples point to an operator-installed catalog location, +not a developer sibling directory. Do not bundle a full production vocabulary. + +Retarget tests that protected retired glossary behavior to the deliberate new +contract. Remove obsolete expectations rather than keeping old code for fixtures. +Run example loading/validation and targeted extract/analyze/preflight tests. + +## Stage 17. Check the real catalog and Audita boundaries offline + +Status: Pending + +Add opt-in Narratio compatibility tests accepting absolute paths through +`NARRATIO_TEST_REFERENCE_CATALOG_DIR` and `NARRATIO_TEST_AUDITA_BINARY`. Unset +variables skip those external checks; do not search PATH or sibling directories. +The ordinary suite continues to use local synthetic fixtures and doubles. + +The catalog test loads its actual fragment through Narratio's normal pipeline, +campaign, and session acquisition, then the production glossary resolver and +preparation path. Validate the four prepared documents against the pinned schema. +Check the imported paths and combined file/inline fixture, not just isolated +ConfigKit layering primitives. Compare the schema copy with its recorded catalog +revision when the checkout is that revision; format-compatible newer vocabulary +need not share the same vocabulary release number. + +With a supplied Audita v4.2 executable, exercise native inspection and a full +preflight using controlled local provider responses, synthetic inputs, and +temporary destinations. Keep smoke enabled to test production behavior while +avoiding real credentials/services. Include one fixture-dependent failure. +Check that the prepared named collections and instructions reach the native +configuration, and preserve exit classifications. + +Add a short catalog-owned offline check script accepting explicit Narratio +checkout and Audita binary paths, invoking these compatibility tests with its +own bundle. No Go workspace/submodule, remote downloads, or new public Narratio +debug command is needed. Document exact local commands and tested revisions in +the catalog README. Do not make real paid smoke calls a routine test gate. + +## Stage 18. Update canonical documentation and migration guidance + +Status: Pending + +Update `docs/config.md`, `cli.md`, `operations.md`, `troubleshooting.md`, +`integrations/audita.md`, `integrations/notarius.md`, applicable Scriptorium/input +contracts, and focused internal documents for configuration, prepare, polish, +preflight, adapters, manifests, publish, restore, and workspace paths. Update the +overview inventory for the new glossary owner. Update architecture statements +about preflight timing/validation side effects where affected; preserve ADR 0003. + +Explain the explicit source/format cutover, four prepared identities, independent +session fields, shared roster/spell-overlay retention, preparation/reuse and force +workflow, catalog installation, downstream configuration/overlay selection, and +diagnostic destinations. State that empty prepared roles replace same-named +Audita entry lists. Document automatic provider checks and validation's probe +namespace and side effects; distinguish synthetic readiness from real-transcript +feasibility and editorial quality. Native library/Audita behavior stays linked +upstream rather than becoming another local manual. + +The catalog owns schema/format details, vocabulary organization, attribution, +and release history. Update it and its notices when incorporated content changes. +Record an upstream D&D README compatibility follow-up if it still calls the +feature unreleased; changing that separate repository is not this sprint's gate. +Keep the independent workspace roadmap pending, updating its upstream-capability +references as needed without implementing its latest-view/retention work. + +Run documentation and example checks. Review prose for accidental extra invariants, +legacy conversion promises, duplicated upstream reference material, or an implied +guarantee that successful preflight ensures later processing succeeds. + +## Stage 19. Verify the complete sprint and remove retired machinery + +Status: Pending + +Run focused checks during earlier stages as they become buildable. At this final +stage use the maintained Go 1.27.4 toolchain and run: + +```sh +go test ./... +go test -race ./... +go vet ./... +go build ./... +``` + +Run Stage 17's controlled external compatibility checks against the actual +catalog and Audita v4.2. Keep live-provider experiments separately authorized +and reported; offline controlled-provider coverage satisfies this sprint's +verification requirement. Review a representative full workflow using subprocess +doubles: preparation, full native-style preflight, polishing, and downstream +binding resolution; then failure/retry and publish/restore of the same inputs. + +Audit the cutover: no live legacy glossary/module request fields, aliases, +automatic format detection/conversion, generated Audita pipeline, custom native +merge engine, runtime schema/catalog download, or paid-call default test remains. +Retired source/flag names can remain in migration documentation, rejection tests, +planning records, and Git history; they must not retain live compatibility behavior. +Confirm snapshots, extensions, native presence semantics, publication guards, +diagnostic-only debug behavior, and latest-view separation against the roadmap. + +Keep successful per-speaker and per-artifact work reusable under existing rules. +Ensure no preflight success is cached as a stage, and no check failure advertises +unattempted processing as complete. Resolve genuine regressions; remove redundant +or retired-behavior tests rather than preserving obsolete implementation. + +Commit final focused units in each affected repository, report tested revisions +and any outstanding checks, and leave a clean workspace. Do not push, tag, release, +or delete planning documents as part of this implementation plan. + +## Open Questions + +### License for the new reference catalog's original material + +The local catalog repository does not yet exist and the roadmap does not select +a license for its new schema, examples, vocabulary, and documentation. This is +an author decision, separate from applying notices to any incorporated sources. +Resolve it before Stage 1 finalizes licensing and Stage 2 embeds the schema. + +**Recommendation:** Use CC0-1.0 for the catalog's original data, schema, and +documentation, following the nearby D&D recipe repository's chosen convention. +The catalog is intended as reusable shared reference material across consumers; +a single explicit material scope keeps its distribution and schema reuse simple. +Preserve separately applicable terms and attribution for incorporated content. + +**Alternative:** Use Narratio's GPL-3.0-or-later grant for original catalog +material. This follows the parent project's existing licensing choice and can +be appropriate if that is the author's preferred distribution policy. It makes +the catalog's license choice different from the adjacent CC0 recipe bundle and +should be stated explicitly wherever its schema is incorporated. Do not infer +either grant for third-party vocabulary from the repository's overall license.