From 3b1718c44fcd893dc8c91a9bfe3950653ed7f19e Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Thu, 26 Nov 2026 14:25:43 +0000 Subject: [PATCH] Retarget Audita adoption roadmap to version 4.1 --- docs/roadmap/audita.md | 377 +++++++++++++++++++++++++++-------------- 1 file changed, 247 insertions(+), 130 deletions(-) diff --git a/docs/roadmap/audita.md b/docs/roadmap/audita.md index d4d0ab4..4b54208 100644 --- a/docs/roadmap/audita.md +++ b/docs/roadmap/audita.md @@ -1,175 +1,292 @@ -# Adopt Audita v3 and independent diagnostic destinations +# Adopt Audita v4.1 and independent diagnostic destinations ## Purpose -Adopt Audita v3.0.0 for transcript polishing and use its independent output -destinations to implement the Audita portion of the -[session workspace roadmap](workspace.md). Operators should find the completed -transcript, ordinary reports, and optional debug evidence in their respective -Narratio locations. +Adopt Audita v4.1.0 directly for transcript polishing. Preserve Narratio's +orchestration and output validation while using Audita's native configuration, +processing, and reporting contracts. Place the corrected transcript, ordinary +reports, and optional debug evidence in their Narratio-selected destinations. -This document defines the Audita adoption scope and target. The workspace -roadmap owns shared layout, latest-attempt views, and retention behavior. Its -referenced ADRs remain Proposed. Implementation sequencing belongs in a -subsequent implementation plan. +This roadmap replaces the earlier v3 adoption proposal. It defines the target +and required changes; implementation stages belong in a subsequent plan. +The [workspace roadmap](workspace.md) owns shared layout, latest-attempt views, +and retention behavior. Its referenced ADRs remain Proposed. -## Reviewed Upstream Release +## Reviewed Baseline and Upstream -The reviewed Audita v3.0.0 tag identifies commit -`3b4933256eff84327b812e7ae12babf743bc04a6`. Its -[release notes](https://gitea.maximumdirect.net/eric/audita/src/tag/v3.0.0/docs/releases/v3.0.0.md), -[CLI reference](https://gitea.maximumdirect.net/eric/audita/src/tag/v3.0.0/docs/cli.md), -[configuration reference](https://gitea.maximumdirect.net/eric/audita/src/tag/v3.0.0/docs/config.md), -and [operations guide](https://gitea.maximumdirect.net/eric/audita/src/tag/v3.0.0/docs/operations.md) -own the downstream contracts. +Narratio baseline: `c9828b2`. The reviewed Audita v4.1.0 tag identifies commit +`bdeac85e8efa0273e63e9b098d5e13cdd6df3576`. -Audita now honors an explicit `--report-dir` alongside file transcript output. -Its existing `--work-dir` selects the parent of retained debug captures, with -capture enabled separately through configuration or `--debug`. These controls -satisfy Narratio's requested destination separation. Further upstream changes -are unnecessary for this scope. +Canonical upstream references: -## Current Baseline +- [v4.0 release notes][v4] and [v4.1 release notes][v41]. +- [CLI][cli], [configuration][config], and [operations][operations]. +- [Application schema v3 migration][schema-migration] and + [v4.1 migration][migration]. +- [Subprocess integration][subprocess], [input contract][inputs], and + [output/report contract][outputs]. -Narratio's [Audita integration](../integrations/audita.md) and -[polish stage](../internal/stage-polish.md) describe the implemented behavior: +Audita remains a separately installed executable. Its current library versions +require no Narratio dependency upgrade for this adoption. Narratio's maintained +Go toolchain already meets Audita's source-build minimum. -- The adapter invokes `process` with a transcript, glossary, and staged transcript - destination. It supports independent downstream configuration, overlay, - profile, module, description, and output-schema selectors. -- The adapter supplies no reporting, debug, or work-directory flags. Audita - controls debug capture and placement through its own configuration. -- Ordinary reports are discovered beside the staged transcript. The polish - stage validates returned report paths against those adjacent filenames. -- Only the validated polished transcript becomes a canonical stage output. - Reports, captured streams, and the generated invocation record are diagnostics. -- Selected credential references use Narratio's shared exact-name forwarding and - captured-stream redaction boundary. +## Current Narratio Behavior -The existing invocation remains usable with Audita v3 after deployment-side -profile migration. Narratio changes are needed to request and consume the -new destination separation. +The [Audita integration](../integrations/audita.md), +[polish internals](../internal/stage-polish.md), and +[configuration reference](../config.md#audita-selection-and-credentials) +describe implemented behavior: + +- The adapter invokes `process` with the base transcript, `--glossary` pointing + to prepared `inputs/glossary.yml`, and a run-local transcript destination. +- Optional module selection uses `--modules`; omission, an empty list, order, + and repeated modules have distinct existing meanings. +- Config, overlay, proposal/validation profile, description, and transcript + output-schema selectors are forwarded when selected. +- The adapter supplies no debug, work-directory, or reporting flags. Ordinary + reports are discovered beside the staged transcript. +- Only a successful validated transcript becomes canonical. Available reports, + captured streams, and the invocation record are diagnostics. +- Configured credential references use shared exact-name forwarding and + captured-stream redaction. + +Audita v4.1 rejects the current glossary and module flags. The old adapter and +new executable therefore require a coordinated cutover. The prior roadmap's +v3-only profile migration is insufficient. ## Targeted End State +### Native processing and configuration ownership + +Narratio invokes Audita v4.1's `process` command with explicit transcript input +and output paths, its existing supervisor timeout, and selected supported +resource/configuration overrides. Audita owns its application schema v3, +`pipeline.stages`, glossary collections, PromptKit resources, and processing +preflight. Narratio owns stage selection, input handoff, result validation, +manifest evidence, and promotion. + +Retain independent downstream config and overlay selection. Narratio's pipeline +overlay does not imply an Audita overlay. Retain supported profile, description, +and transcript output-schema overrides with their upstream meanings: process +flags affect root settings, while explicit Audita per-entry settings retain +their native precedence. + +The removed `--glossary` and `--modules` interfaces are retired. The Open +Decisions below determine how glossary material reaches native collections and +whether Narratio retains a module-selection convenience surface. The target is +not an automatic reproduction of Audita's richer pipeline model in Narratio. + +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. + +### Glossary handoff + +Audita consumes named `glossary_collections` through configuration. The supported +`--glossaries` and `--protected-terms` flags select collection names, rather than +external YAML files. The old standalone glossary format is not a v4 processing +input. The handoff decision must be resolved before implementation planning. + +Keep Narratio's campaign/session glossary input available to its other consumers. +An Audita migration does not authorize removing the shared `glossary_file`, +changing Notarius references, or changing preparation for unrelated stages. +Any change to polish's prepared-glossary prerequisite follows the selected +handoff design explicitly. + +Prefer native downstream configuration and overlays for glossary/protection +selections. If the selected design exposes those selections through Narratio, +forward the native distinctions between omission, null, and an explicit empty +list. Encode collection selections as the required JSON values; a comma-joined +file path is not a replacement for the removed glossary flag. + ### Products and diagnostics -Narratio supplies separate destinations for each actual polish attempt: +Narratio supplies destinations for each actual polish attempt: -| Content | Destination and control | +| Content | Target destination and control | | --- | --- | -| Corrected transcript | Run-local staging via `--output`; validated and promoted to `transcripts/polished.json` on success. | +| Corrected transcript | Run-local staging via `--output`, followed by existing validation and promotion to `transcripts/polished.json`. | | Ordinary reports | `runs//polish/logs/` via `--report-dir`. | -| Captured stdout, stderr, and Narratio invocation record | The same run-local polish log directory. | -| Optional debug evidence | `runs//polish/debug/` via `--work-dir`; Audita may create its own `run-*` subdirectory beneath it. | +| Captured stdout/stderr and Narratio invocation record | The same run-local polish log directory. | +| Optional debug evidence | `runs//polish/debug/` via `--work-dir`; Audita may create its own nested run directory. | -The workspace roadmap's `logs/polish` and `debug/polish` links expose the latest -attempt. Narratio supplies actual run destinations to Audita and records those -paths in manifest diagnostics. Shared link updates and cleanup protection are -implemented by the workspace work rather than separately inside the adapter. +Use the shared workspace path owner and create required destination parents +before invocation, as required by Audita's output contract. The workspace work +adds `logs/polish` and `debug/polish` latest-attempt views and retention protection. +The adapter uses actual run paths rather than maintaining its own link scheme. +Native adoption and explicit destinations can land before those shared views. -### Capture selection +Discover `errors.yml`, `recoveries.yml`, and `report.md` in the requested report +directory, including available failure reports. Keep the existing transcript and +report bounds, path validation, and declared diagnostic publication behavior. +Reports remain optional diagnostics. A successful invocation can contain +recoverable model errors; a nonzero outcome, including a late report failure, +does not authorize transcript promotion merely because output bytes exist. -Add an optional `pipeline.audita.debug` boolean, defaulting to false. A true -value passes `--debug`. False or omission supplies no capture override and -preserves Audita configuration and overlay behavior; it does not disable debug -enabled downstream. +### Debug selection and ordinary production behavior -Supply `--work-dir` for each executing attempt so downstream-enabled capture -also lands in the Narratio-selected debug directory. Selecting that destination -alone does not enable capture. Ordinary production operation retains Audita's -default reporting and debug settings. Narratio adds no reporting enable/disable -flag or debug-disable flag. +Add optional `pipeline.audita.debug`, defaulting to false. True requests +`--debug`; false or omission supplies no debug override. Supply `--work-dir` +to select the diagnostic destination without implicitly enabling capture. +Audita v4.1 enables retained capture through its debug CLI/reporting mode; this +roadmap adds no downstream YAML debug-enable setting. -Debug selection affects diagnostics for an executing stage. Changing it alone -does not invalidate a completed transcript. Operators use the existing force -workflow when fresh polish or debug evidence is needed. +Ordinary production operation supplies neither `--debug` nor `--reporting=false`. +Keep Audita's default reporting behavior and explicit downstream configuration +choices. No new Narratio reporting toggle or debug-disable override is needed. +Audita's new token-summary and live-progress flags need no Narratio controls for +this adoption. -### Ownership and compatibility +Debug selection and destination changes alone do not invalidate a completed +transcript. Operators use the existing force workflow to obtain fresh evidence. +Keep full debug bundles local under the workspace roadmap's agreed behavior; +Narratio supplies the root and does not parse, repackage, or implicitly publish +their contents. Existing declared diagnostics retain their publication behavior. -Use a clean adoption of Audita v3's CLI contract, without version-dependent -adapter branches or legacy profile conversion. Audita continues to own its -configuration, profiles, prompts, runtime State, and diagnostic contents. -Narratio owns supplied destinations and transcript promotion. +### Credentials, failure handling, and compatibility -Keep existing selectors and shared credentials such as `OPENROUTER_API_KEY` and -`RAKESTRAWHOME_API_KEY` under their configured exact names. Audita's examples -do not require Narratio to adopt application-specific credential aliases. -Operators continue to list the credential references required by all configured -Audita backends. +Retain Narratio's configured secret-reference resolution and exact-name +forwarding, including shared keys such as `OPENROUTER_API_KEY` and +`RAKESTRAWHOME_API_KEY`. Audita/PromptKit own backend credential selection; +Narratio does not enumerate private backend definitions or invent key aliases. +Audita's native ConfigKit bootstrap may supply child credentials according to +its own configuration. Preserve Narratio's captured-stream redaction; Audita +v4 does not provide application-wide credential substitution in arbitrary +diagnostic artifacts. -Audita is a separately installed executable. Its adoption of ConfigKit v0.5.0 -and PromptKit v0.12.0 does not require changing Narratio's own library -dependencies as part of this feature. +Use a clean v4.1 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. +Current treatment of older completed files after invalidation or failed +replacement remains unchanged. ## Required Changes -### Deployment configuration migration +### Deployment migration -Document the manual migration of Audita-owned PromptKit files: +Replace Audita application schema v2 with schema v3 and native resource +definitions using the upstream guides. Move module order to `pipeline.stages` +and glossary definitions/selections to native collections under the chosen +handoff design. Preserve intended campaign terminology, including migration of +legacy `summary` context to `description` where applicable. -- Wrap profile definitions under keyed `profiles:` mappings, remove inner `id` - fields, and replace `base_profile` with `extends`. Preserve selected profile - IDs when appropriate. -- Review explicit zeros, omitted values, and nulls against the new generation - control semantics. Validate the final configuration root, including unused - definitions and backend references. -- Rename any backend literally named `extends` and update its references. -- Validate production configuration and each used testing overlay with Audita's - offline `config validate` command. Audita application configuration continues - to use `version: 2`. +Remove obsolete confidence settings and prompt fields. Remove root and per-entry +`llm.repair_attempts`; selected prompts now own structural output contracts and +repair budgets. Audita's semantic correction-repair budget remains separate. +Its new semantic repair behavior and changed structural-repair default can +change model-call counts. Document budget review without imposing new Narratio +limits or silently overriding Audita's settings. -Keep the detailed downstream format owned by the pinned Audita documentation. -Narratio does not inspect, rewrite, or automatically migrate these files. -Deployment can migrate Audita before the workspace changes land. +Operators maintain native prompts/profiles, production settings, and testing +overlays. Link upstream for formats, whole-record prompt replacement, bootstrap, +and validation commands. Narratio does not parse and rewrite private Audita +configuration. Explicit downstream paths remain useful for predictable selection. -### Adapter and polish stage +### Narratio configuration, adapter, and polish integration -Carry explicit report and debug destinations through the Audita request and -construct the supported flags inside the adapter. Wire the debug selector -through configuration and runner composition. +Remove obsolete argument construction and resolve the module and glossary +surfaces according to the decisions below. Update request types, composition, +configuration validation/defaults, examples, and the polish stage's required +inputs together. Preserve supported selectors and their omission semantics. -Discover the existing three report filenames in the requested report directory. -Update polish's expected-path validation to the same location. Update invocation -records and safe result metadata to describe the selected destinations and -capture request. Preserve available failure evidence and the original subprocess -error. +Carry report/debug destinations and the enable-only debug choice through the +adapter boundary. Align report discovery and polish's expected-path checks with +the selected report directory. Update generated invocation records and safe +result metadata to reflect actual arguments, destinations, and credential names. -Keep existing transcript validation, report read bounds, timeouts, credential -forwarding, and captured-stream redaction. Reports remain optional diagnostics; -early failures or downstream-disabled reporting may produce none. Exit-zero -runs with recoverable model errors remain successful. A nonzero exit, including -a late report-write failure, never authorizes transcript promotion. Narratio -does not add report-schema parsing or report-status success gates. +Update polish semantic evidence for result-affecting selector changes and any +changed input handoff. Obsolete evidence is reconsidered when polish executes +or is resume-checked under existing rules. Operational diagnostics and credential +rotation remain outside substantive result identity. Stable downstream selectors +do not expose private prompt/configuration edits to Narratio; forcing polish +remains the operator workflow for those edits. -### Workspace integration and lifecycle +### Workspace integration and documentation -Use the shared workspace path owner for run-local log/debug destinations and -the agreed latest-attempt behavior. Preserve previous views on skipped stages; -actual attempts refresh both views, including on failure. An attempt without -debug capture exposes an empty current debug directory. +Keep link rotation, cleanup protection, physical layout cutover, and restore +changes in the workspace scope. Skipped stages preserve previous views; actual +attempts advance them even on failure. An attempt without capture exposes its +own empty debug directory under that scope's design. -Keep full Audita debug bundles local in this feature. Preserve existing declared -diagnostic publication and apply the workspace roadmap's retention protection -to latest link targets. This feature inherits that roadmap's clean session -cutover and unchanged treatment of older completed outputs after invalidation -or failed replacement. +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 +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. -### Documentation and verification +### Verification -When implemented, update the configuration reference and examples, Audita -integration contract, polish internals, and operator guide. Reference Audita v3's -profile migration and explain the shared Audita/Notarius overlay development -workflow. Downstream configuration edits behind unchanged selectors still -require explicitly forcing the affected stage to replace reused outputs. +Use focused offline tests for native invocation, the selected glossary handoff, +module-surface removal or projection, 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. -Revise the workspace roadmap's upstream-request description when this adoption -is incorporated; Audita v3.0.0 supplies the previously missing capability. +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 +and cleanup tests belong to workspace work. -Use focused offline tests for separate transcript/report/debug destinations, -enable-only debug selection, capture enabled by downstream configuration, -available failure reports, and preservation of nonzero-exit behavior. Verify -that reports remain diagnostics and only a successful validated transcript is -promoted. Shared latest-view and cleanup tests belong to the workspace change. -Default Narratio tests use subprocess doubles and temporary filesystems and -remain independent of sibling checkouts, real credentials, and paid providers. +Default Narratio tests use subprocess doubles and temporary filesystems, with +no dependency on sibling checkouts, real credentials, or paid providers. An +optional controlled Audita v4.1 compatibility check can supplement them. + +[v4]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/releases/v4.0.0.md +[v41]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/releases/v4.1.0.md +[cli]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/cli.md +[config]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/config.md +[operations]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/operations.md +[schema-migration]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/migrations/v3.md +[migration]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/migrations/v4.1.md +[subprocess]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/integrations/subprocess.md +[inputs]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/integrations/transcript-glossary-files.md +[outputs]: https://forge.maximumdirect.net/eric/audita/src/tag/v4.1.0/docs/integrations/output-files.md + +## Open Decisions + +### Glossary ownership and prepared-session handoff + +**Recommendation:** Define campaign collections in operator-maintained Audita +configuration/companions and compose campaign-owned material through native +imports. Narratio selects the appropriate Audita configuration/overlay. This +uses v4.1 as shipped and keeps downstream configuration management with Audita. +It changes polish's current prepared-snapshot handoff: polish no longer receives +`inputs/glossary.yml` directly, and private imported content behind a stable +selection follows the documented force workflow. Keep Narratio's shared glossary +input for its other consumers. This ownership/input change requires approval. + +**Alternative:** Preserve the prepared glossary handoff by projecting it into a +native collection fragment and supplying a narrowly generated Audita entry file +that imports it and operator-maintained settings. This can work with v4.1 and +retains session-snapshot control, but adds format projection and generated-input +ownership to Narratio. The design must explicitly account for the selected +main's companion discovery, overlay bases, and bootstrap; importing a former +main file alone does not preserve those main-source semantics. Operator settings +would need an explicit importable structure. Avoid reading and reconstructing +the effective private configuration. + +**Alternative:** Request a supported runtime glossary-file/import control from +Audita and defer this part of adoption until it is available. This preserves +the snapshot boundary with a smaller Narratio adapter, but v4.1 itself lacks the +needed file flag and the work would depend on a later upstream release. It is +not a capability this roadmap claims v4.1 already has. + +### 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 an entry-file/projection mechanism +such as the glossary alternative above and must distinguish Narratio-selected +ordering from Audita's per-entry settings. The additional schema and composition +surface weighs against this option.