diff --git a/docs/roadmap/audita.md b/docs/roadmap/audita.md index 6eae5dd..6f8931e 100644 --- a/docs/roadmap/audita.md +++ b/docs/roadmap/audita.md @@ -38,7 +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. The Open Decisions below concern Narratio's input surface and migration. +handoff or synthetic-transcript preflight. The Open Decisions below concern the +reference catalog's distribution and selection model. ## Current Narratio Behavior @@ -81,37 +82,50 @@ and transcript output-schema overrides with their upstream meanings: process flags affect root settings, while explicit Audita per-entry settings retain their native precedence. -Replace the removed `--glossary` interface with native runtime inputs. The Open -Decisions below settle source selection, preparation, and retirement of the -module-selection surface. Operator-maintained Audita configuration owns the -processing pipeline; Narratio prepares its inputs and selects the configuration. +Replace the removed `--glossary` interface with native runtime inputs. Retire +`pipeline.audita.modules` and its request/runner plumbing. Operator-maintained +Audita configuration owns `pipeline.stages`, including ordering, repetitions, +and normalization-only processing; Narratio prepares inputs and selects the +configuration. Do not translate the retired module list into generated config. Audita checks selected profiles and glossary-correction entries before preparing processing outputs or making model calls. Consume its ordinary outcomes and -diagnostics; this adoption does not require a second Audita processing-readiness -engine or extending Narratio's Scriptorium-specific discovery checks to Audita. +diagnostics through Narratio's preflight orchestration rather than implementing +a second Audita processing-readiness engine. ### Runtime glossary handoff and ownership -The operator owns party rosters, campaign vocabulary, and reusable reference -libraries. Narratio owns selecting and preparing session inputs and deriving -Audita-specific projections from structured inputs it understands. Audita owns -loading and composing the supplied native collections, interpreting their -content, and executing the selected processing pipeline. +Narratio owns domain-specific glossary selection, projection, and preparation. +ConfigKit owns generic resolution, imports, inheritance, and composition through +its native workflow. Audita owns final composition with its configuration, +interpretation of the supplied collections, and processing. + +Narratio supplies four separate logical collections: + +| Collection | Source and preparation | +| --- | --- | +| `party` | Project character IDs, names, and aliases from the required canonical party roster into Audita entries. | +| `campaign` | Prepare the operator's campaign glossary terms using Audita's native entry structure. | +| `setting` | Select and prepare reference vocabulary from a catalog using a setting ID, such as `forgotten_realms`. | +| `spells` | Select and prepare spell vocabulary from a catalog using a system ID, such as `5e`. | + +Setting and system catalogs are configuration data mapping identifiers to +reference sources, extensible without Go changes or a custom loader. Their +distribution and single-source versus ordered-source selection remain open. Narratio supplies prepared collection files with repeatable `--glossary-file` arguments. Files use Audita's wrapperless native collection shape. A file may contain multiple collections; input order is significant under the upstream -composition rules. The existing canonical party roster supplies character IDs, -names, and aliases for a derived `party` collection. Additional campaign and -reference vocabulary remains operator-provided. Source selection and import -snapshot treatment require the decisions below before implementation planning. +composition rules. Resolve selected vocabulary and imports with ConfigKit and +capture fully resolved, standalone glossary projections as prepared inputs. +Preserve collection boundaries, instructions, extensions, and native presence +semantics. Do not add Narratio-specific collision or merge rules. -Preserve separate logical collections rather than flattening all vocabulary. -The D&D recipes use `party`, `campaign`, `setting`, and `spells`. These are recipe -roles, not mandatory Narratio-wide inputs or a closed list of allowed names. -Operators can provide prepared session collections alongside reusable references -configured in Audita, or supply all collections at runtime. +Record prepared content evidence and supply the same prepared vocabulary to +preflight and processing. Preparation and resume use shared production paths; +polish consumes the prepared data rather than reopening live vocabulary sources. +Audita's private configuration and references remain downstream-owned. These +snapshots do not promise identical future model results. Audita's runtime files preserve the selected main's companion discovery, overlay context, and bootstrap. Supplying definitions does not select them; native root @@ -145,13 +159,34 @@ their own Audita configurations and overlays. Preserve Narratio's independent downstream selectors; choosing a Narratio overlay does not automatically select a D&D recipe. Narratio does not bundle or regenerate the upstream pipeline. -Keep standalone `audita preflight` an optional operator diagnostic in this scope. -Its default provider smoke checks may contact services and consume usage; -`--smoke=false` selects local readiness, including temporary destination probes. -Processing already performs local preparation and does not automatically run -smoke checks. This adoption adds no automatic preflight subprocess, provider -smoke gate, or Narratio readiness-report parser. Link upstream for invocation, -side effects, and limits rather than duplicating the preflight manual. +### Early Audita preflight + +Run full native `audita preflight` through `internal/preflight` before expensive +pipeline work when polish is projected to execute. Use the same checking path +for `session validate` when polish is enabled. Retain the native provider smoke +checks: exercising selected profiles and credentials early is part of this +adoption, even though the checks may contact services and consume usage. + +Maintain one representative synthetic transcript as a Narratio-owned integration +asset. Supply it with the actual prepared glossaries, selected configuration, +overlay, profiles, credentials, processing settings, and intended destinations. +Share glossary preparation and adapter invocation construction with production +execution. Create destination parents required for Audita's native probes. +Preflight must not promote outputs, mark processing complete, invalidate prior +completed results, or advance latest-attempt views. + +Any unsuccessful preflight stops the invocation with Audita's diagnostic +explanation. Consume native outcomes and captured diagnostics without parsing +human-readable reports into a second readiness model. No upstream extension or +relaxation of Audita's required processing inputs is needed. + +Report the scope accurately: configuration and provider readiness were exercised +using synthetic transcript content. Audita still checks the actual transcript +when processing begins, and provider readiness can change afterward. A known-good +fixture is not compatible with every possible configuration; for example, a +requested section count may be infeasible for it. Such failures remain errors. +Address concrete fixture conflicts when encountered rather than adding +speculative fixture-generation or configuration-rewriting machinery. ### Products and diagnostics @@ -209,9 +244,11 @@ v4 does not provide application-wide credential substitution in arbitrary diagnostic artifacts. Use a clean v4.2 cutover with manual deployment configuration migration. -Version-dependent adapter branches and legacy CLI/configuration conversion -shims are outside scope. Narratio continues to accept success with recoverable -model errors and preserves the original causes and available evidence on failure. +Do not add legacy parsers, automatic conversions, compatibility shims, or +version-dependent adapter branches anywhere in this adoption. Migration guidance +describes operator changes to the new contracts. Narratio continues to accept +success with recoverable model errors and preserves the original causes and +available evidence on failure. Current treatment of older completed files after invalidation or failed replacement remains unchanged. @@ -244,18 +281,26 @@ contract and installation instructions. ### Narratio configuration, adapter, and polish integration -Replace obsolete glossary argument construction with the ordered native runtime -file handoff and resolve the remaining surfaces according to the decisions below. +Replace obsolete glossary argument construction with the native prepared-file +handoff and remove the module-selection surface. Update request types, composition, configuration validation/defaults, examples, and the polish stage's required inputs together. Preserve supported selectors and their omission semantics. -Prepare and record the derived party glossary and selected runtime vocabulary -under the shared input/path owners. Bind polish's required inputs and semantic +Prepare and record all four glossary collections under the shared input/path +owners. Bind polish's required inputs and semantic evidence to the prepared content it actually consumes. Keep generated glossary data separate from immutable resolved Narratio configuration. Final filenames, projection details, and schema fields belong in the implementation plan once -the open source/preparation choices are resolved. +the remaining catalog choices are resolved. Use shared resolution/projection +helpers and reuse prepared content between preflight and execution rather than +independently rebuilding it for each path. + +Extend `internal/preflight` and the Audita adapter for native preflight with the +maintained synthetic transcript. Reuse execution selection and validation target +selection, subprocess supervision, credential forwarding, and diagnostics. +Integrate early glossary preparation and destination-parent creation with the +shared input/workspace owners while preserving stage and manifest lifecycle. Carry report/debug destinations and the enable-only debug choice through the adapter boundary. Align report discovery and polish's expected-path checks with @@ -283,31 +328,41 @@ attempts advance them even on failure. An attempt without capture exposes its own empty debug directory under that scope's design. When implemented, update the Audita integration contract, polish internals, -configuration/examples, and operator guidance. Describe the shared Audita and -Notarius configuration/overlay development workflow with upstream links rather +configuration/examples, preflight internals, and operator guidance. Describe the +shared Audita and Notarius configuration/overlay development workflow with upstream links rather than duplicating library manuals. Update the workspace roadmap's outdated upstream-request description when the coordinated work lands: v4.1 already supports independent report and debug destinations. Link to the external recipe contract for its roles and model choices and to Audita's native inspection/preflight documentation for diagnostics. Document -Narratio-specific projection, prepared-input, and force behavior locally. +Narratio-specific projection, catalog selection, prepared-input, and force behavior +locally. Explain automatic provider checks, synthetic-transcript scope, and early +failure recovery in validation and execution guidance. ### Verification Use focused offline tests for native invocation, the selected glossary handoff, -module-surface removal or projection, independent destinations, enable-only +module-surface removal, independent destinations, enable-only debug selection, and shared credential forwarding. Cover empty selections, ordered/repeated processing where applicable, and native root/per-entry selector precedence without inventing a Narratio precedence rule. Cover party IDs/names/aliases in the native projection, separate collection -preservation, ordered file forwarding, preparation failures, and the selected -import/snapshot behavior. Verify that unrelated shared glossary consumers retain -their existing inputs. Upstream owns the full native merge, instruction, and +preservation, setting/system selection, preparation failures, and standalone +snapshots from native imports and composition. Verify that preflight and polish +consume the same prepared vocabulary and unrelated shared glossary consumers +retain their existing inputs. Upstream owns the full native merge, instruction, and inspection behavior; a representative controlled compatibility check is enough at Narratio's boundary. +Verify early full-preflight invocation, provider checks remaining enabled, +shared execution/validation paths, and error propagation before expensive work +or invalidation of completed results. Exercise the maintained synthetic +transcript against a controlled Audita invocation and cover a fixture-dependent +configuration failure without suppressing it. Default tests simulate provider +outcomes; they do not make paid smoke calls. + Verify optional and failed reports, failed output delivery, and transcript validation/promotion. Preserve existing resume/force behavior and demonstrate the semantic-evidence cutover for affected polish selections. Shared latest-view @@ -336,66 +391,17 @@ quality or live-provider readiness. ## Open Decisions -### 1. Source selection for campaign and reference vocabulary +### 1. Reference catalog distribution -**Recommendation:** Add an optional ordered list of Audita-native glossary -sources to campaign inputs, with a session-level replacement override using -Narratio's normal source-relative path behavior. Derive `party` from the existing -roster; allow the list to supply any other named collections. Keep reusable -references in Audita configuration when operators prefer that arrangement. -This keeps campaign-specific content outside pipeline definitions, supports all -four D&D roles without requiring them, and limits Narratio's format translation -to its known party model. Exact field names remain to be finalized in planning. +**Recommendation:** Maintain setting and system vocabulary in a separately +versioned data bundle installed alongside the application's configuration. +Narratio owns catalog selection and preparation; vocabulary updates need not +require a Narratio release. Confirm the bundle's location and maintenance owner +before implementation planning. -The existing shared `glossary_file` remains available to Notarius and other -consumers. This recommendation does not automatically turn that legacy-format -file or the separate spell catalog into Audita collections; operators provide -native vocabulary explicitly for those roles. +### 2. Reference catalog selection model -**Alternative:** Project the existing shared glossary and spell catalog into -`campaign` and `spells` as well as deriving `party`, with optional native sources -for additional material. This reduces duplicate operator-maintained vocabulary, -but adds format mappings Narratio must own and requires agreement on how source -fields map to Audita entries. Choose this if reuse of those existing primitives -outweighs the extra translation surface. It is a deliberate domain projection, -not a requirement to restore Audita's removed legacy parser. - -### 2. Preparation of native files that use imports or inheritance - -**Recommendation:** Resolve Narratio-selected native vocabulary sources and -their imports with ConfigKit during preparation and retain standalone prepared -native collection data, preserving the selected ordering/composition semantics. -Pass the prepared data to Audita's runtime interface. This keeps selected session -vocabulary stable across polish attempts and avoids copying an import-bearing -file whose relative dependencies still point to live campaign data. Audita still -owns the final composition with its private configuration and processing -validation. Only Narratio-selected runtime data is prepared; private Audita -references remain downstream-owned and follow the force workflow. - -This adds a native input-resolution/projection step in Narratio. It does not -require reproducing Audita's private configuration or promising identical future -model results. The implementation plan must make the ConfigKit handoff and -prepared-content evidence explicit rather than inventing another merge engine. - -**Alternative:** Forward original native file paths and let Audita resolve their -imports on each invocation. This is the smallest Narratio integration and fully -uses Audita's loader, but those inputs remain live references rather than session -snapshots. Accepting it would relax the prepared-session boundary for those files -and require clear operator guidance about edits and regeneration. - -### 3. Narratio module-selection surface - -**Recommendation:** Retire `pipeline.audita.modules` and its request/runner -plumbing. Operators author `pipeline.stages` in Audita and use its configuration -or overlays to select production, testing, or normalization-only pipelines. -This avoids maintaining two representations as Audita adds per-entry settings. -Manual migration preserves ordering, repetitions, and the intent of an explicit -empty list; Narratio does not silently discard a configured selection. - -**Alternative:** Keep a simple Narratio module-list convenience and translate it -to native ordered stage records through generated configuration. This preserves -the current shorthand, including empty and repeated selections, but the removed -CLI flag cannot implement it. It requires a generated configuration entry file -or another supported upstream configuration interface, and must distinguish -Narratio-selected ordering from Audita's per-entry settings. The additional -schema and composition surface weighs against this option. +Decide whether each setting/system identifier selects one collection source or +an ordered group of sources. In either case, catalog definitions are configuration +data and use native ConfigKit resolution and composition. Exact schema fields +and prepared filenames belong in the implementation plan.