# Implementation Plan 0028: Integrate the Native Suite and D&D Assets Status: ready Approved: 2026-12-03, including the config-local import layout. Target executor: GPT-5.6-Terra Feature roadmap: [Feature 0028](features/0028-coordinated-native-suite-integration.md), approved 2026-12-03. Its target state and acceptance criteria govern this plan. Active plan location: `docs/roadmap/implementation.md` ## Objective Deliver compatible campaign and prompt refs, migrate the standalone pipeline role to the four reviewed native application interfaces, and support optional reference-catalog deployment. Preserve old distributed consumers while leaving the new integration ready for independent review and later collection assembly. ## Execution Rules - This plan is approved for implementation. Execute Stage 1 through Stage 5 in order. Immediately before each stage, reread its Required Policy Review and check its preconditions and owning repository's state. - Preserve unrelated changes. Commit each validated unit in its owning repo with the stated intent; update plan progress. Do not merge native asset work into legacy `main`, push, tag a release, update the collection/consumer or deploy to an operational controller/host during execution. - Keep direct declarative Ansible. No production version/configuration probes, automatic data migration, cleanup of old files, fingerprinting, assembly facts, custom modules or compatibility loaders. Existing Git/build behavior remains in the reviewed application roles. Trust modules to converge their state. - Validation uses the real applications offline. Preflight, inference, S3 I/O, a fake processing pipeline, real credentials and upstream release suites are not gates. Use synthetic credentials only when native loading needs values. - `.venv/bin` contains the local Ansible tooling; absence from PATH is not a controller blocker. Follow workspace README/`requirements-dev.txt` for setup. Reuse installed compatible binaries for asset validation. If missing, prepare the selected released binary locally using the reviewed source-build contract, without modifying upstream tracked files or deploying to another host. - Stop dependent work on a real validation failure; report its actual command and result. Do not invent prerequisites such as public delivery of unreviewed asset commits before their local integration can be tested. ## Starting State and Preconditions - Roadmap approval includes cleanup false, `gpt-terra-latest` replacing removed rumor/scene-map profiles, `native-v4` compatibility branches with immutable asset selections, and config-local prompt/catalog checkouts. The roadmap and this implementation plan are approved. - Pipeline: `ansible-role-dnd-pipeline` on clean `main` at `0f841fd91ffc533aeec0ec688e81c24bd187a845`. - Campaigns: `assets/campaigns`, clean `main` at `d1193e8be4163c2742baa2517c9a048b6873622d`. - Prompts: `assets/narratio-prompts`, clean `main` at `c7e18454e5f02aedb0657d522f7c550f82d874ed`. - Native asset branches do not exist at planning time. Recheck all starting states; if a branch already exists, inspect and preserve it rather than reset it. - All reviewed standalone-role commits in the roadmap are public. Update only the standalone pipeline's requirements to those commits. Preserve Seriatim's role pin and application v1.5.0, plus current pinned native collections. - Planning verified `/usr/local/bin` has Narratio v4.0.0, Audita v4.3.0, Notarius v0.10.0 and Scriptorium v0.16.0. Go is 1.27.4 and `sudo -n true` succeeds. Recheck before using the authorized local Ubuntu 26.04 test host. - Pipeline convergence can update installed binaries/source, suite configuration, service-account state, managed roots, ACLs, and Git-managed asset destinations on this test host. Do not open existing sessions or run processing/cleanup. ## Repository Scope Campaign and prompt compatibility commits belong in their `assets/` repositories, not the duplicate sibling prompt checkout. Pipeline code and integration coverage belong in `ansible-role-dnd-pipeline`. The workspace owns tracking and evidence. Application/framework/schema sources, standalone roles and `../narratio-reference-catalog` are read-only references. The catalog example has no configured origin and is not a mandatory dependency. The collection and deployment consumer remain unchanged throughout this feature. ## Stage 1: Author the Native Campaign Assets — Complete ### Objective Leave both real campaigns usable by Narratio v4 on a separate compatible ref, preserving the legacy asset surface. ### Required Policy Review Immediately read workspace `AGENTS.md`, orientation, conventions, `docs/ansible.md`, `docs/testing.md`, and the approved roadmap. Check asset-local instructions. Read `../narratio/AGENTS.md`, its development/agent reading guide, tagged v4 configuration and party contracts. Use its embedded shared schemas as the versioned reference; do not modify the schemas or upstream implementation. ### Preconditions Plan approval and asset starting state are confirmed. Inspect both campaigns' campaign, roster, glossary, speakers, players and autocorrection files. ### Owning Repository `assets/campaigns` ### Required Changes 1. Create/switch to `native-v4` based on the stated campaign commit. Leave legacy `main` configuration unchanged. Do not publish during this stage. 2. Convert `centaurs/campaign.yml` and `dilfs/campaign.yml` to the shared marker and stable `id`. Bind `references.party`, and put speakers/glossary paths and the existing ordered `target`/`match` autocorrection rules under `narratio.inputs`. Retain relative paths within each campaign directory. 3. Convert both rosters to the shared marker. Preserve authored IDs, players, names, aliases, class names and levels. Do not invent roster entries from the legacy player list. Narratio derives players from the canonical roster; retain legacy files inert if useful, but remove their obsolete runtime bindings. 4. Convert both glossary lists to a shared `collections.campaign.entries` envelope, preserving facts and mapping summaries to descriptions. Author readable stable entry IDs once; resolve any collisions explicitly. Do not add a runtime generator or unrelated factual corrections. Leave setting and system selectors absent: no production sample vocabulary is selected. 5. Explain the compatible branch/layout and native validation in README. ### Validation From the workspace root, create a temporary main containing only a synthetic WhisperX URL and use the installed v4 binary for each campaign: ```sh narratio config validate --config "$fixture_config" --scope campaign --campaign-file "$campaign_file" narratio config validate --config "$fixture_config" --scope party --party-file "$party_file" git -C assets/campaigns diff --check ``` Set each file variable explicitly to the current campaign's absolute path. Validate each glossary using `.venv/bin/python`, PyYAML and `jsonschema.Draft202012Validator` against Narratio v4's `internal/domaininput/resources/glossary/v0.2.0/schema.json` (read it from the selected release, using `git show v4.0.0:...` if the checkout has advanced). No network schema resolution or custom validator is needed. Review the authored diff for preserved content and record results; do not freeze current row counts or names in a new snapshot test. Remove temporary fixtures. ### Completion Criteria Both campaign/party documents pass native offline validation; both glossaries conform to the selected schema. Content and legacy compatibility are preserved. Record the new compatible commit for Stage 3's asset pin. ### Commit Commit intent: `Migrate campaigns to shared Narratio inputs`. ## Stage 2: Author and Prepare the Native Prompt Library — Complete ### Objective Leave all six D&D prompts and their resources loadable and preparable by Scriptorium v0.16.0 on the compatible asset ref. ### Required Policy Review Immediately reread workspace `AGENTS.md`, orientation, conventions, `docs/ansible.md`, `docs/testing.md` and the roadmap. Check asset instructions. Read Scriptorium's agent/development guidance and tagged native PromptKit migration/format documentation linked from its v0.16.0 release. ### Preconditions Stage 1 is committed. Confirm the prompt starting commit and inspect every definition plus its shared message bodies and schemas before editing. ### Owning Repository `assets/narratio-prompts` ### Required Changes 1. Create/switch to `native-v4` from the stated prompt commit. Preserve legacy `main` and all six logical prompt IDs. 2. Add root `promptkit.yml`, a wrapperless native settings entry point with `schema_root: schemas`. Explicitly import the six ID-first definitions as sequence items at `[prompts]`, with required imports. Retain source-relative resource paths; no recursive discovery dependency or copied model catalog. 3. Migrate unsupported definition syntax as needed for native loading. Preserve instructions, output contracts, explicit repair budgets, supported `session_id` templates and current template-variable names. Selection is by native ID, not version. The approved profile replacements are `gpt-terra-latest` for both rumors and scene map; retain the other model selections specified by the roadmap. 4. Check existing shared bodies' `input` calls against declared inputs. Preserve optional context, including players/party where referenced; declare those existing body inputs as optional if needed for native preparation. Do not make additional files mandatory or rewrite the prompt's editorial purpose. 5. Document the entry point, compatible ref, model choices and native offline validation/preparation in README. ### Validation Copy the selected asset tree into a temporary fixture's `prompt-library/` directory. Create the main beside that directory, importing `prompt-library/promptkit.yml` with `destination: [promptkit]` and `required: true`. Imports must be relative and contained by the main's directory. Run: ```sh scriptorium config validate --config "$fixture_config" scriptorium promptkit show prompt "$prompt_id" --config "$fixture_config" --format json scriptorium promptkit show prepared "$prompt_id" --config "$fixture_config" --input-text transcript='{"segments":[]}' --var session_id=fixture-session --format json git -C assets/narratio-prompts diff --check ``` Inspect each of the six IDs and prepare each with its declared inputs. Adapt the shown preparation arguments to that definition: rumors need recap; transcript-based prompts need transcript and any optional context consumed by their bodies; character analysis additionally needs synthetic `character_name` and `character_class`. `--input-text`/`--var` are native aliases confirmed by installed help. Use synthetic text only and native profile selection. Supply synthetic environment values if preparation requires them; never generate or contact a provider. This proves message/schema resource resolution, not model output quality. Remove temporary fixtures and record the compatible commit. ### Completion Criteria All six definitions and preparations resolve on the selected released contract, with schemas/message files found from the deployed source layout. Legacy consumers' content remains available on `main`. ### Commit Commit intent: `Migrate the D&D prompts to native PromptKit resources`. ## Stage 3: Integrate the Core Native Suite and Existing Behavioral Cases — Complete ### Objective Leave a valid core pipeline role using the reviewed applications and compatible assets, with its existing integration coverage migrated to native commands. ### Required Policy Review Immediately reread workspace `AGENTS.md`, orientation, conventions, `docs/ansible.md`, `docs/testing.md` and the approved roadmap. Check role-local instructions. Read each upstream application's agent reading guide and the roadmap's tagged configuration, CLI, integration and cache/migration references. Review the standalone roles' actual variable interfaces, not legacy suite docs. ### Preconditions Stages 1 and 2 are committed; capture their full commit IDs. Inspect current pipeline defaults, argument specs, dependencies, tasks, all templates, README and integration harness. Native binaries and local test permissions are available. Use the approved config-local import layout below; no upstream release change or duplicate asset tree is required. ### Owning Repository `ansible-role-dnd-pipeline` ### Required Changes 1. Pin the four roles exactly as listed in the roadmap; select its application versions, Go `1.27/stable` and the Stage 1/2 full asset commits. Preserve existing asset origins and Seriatim selection. Set the native prompt checkout default to `/usr/local/etc/scriptorium/prompt-library`, leaving the old shared checkout unmanaged and untouched. Keep version/revision overrides; no promise of older-schema compatibility or new release tags. 2. Replace retired suite inputs and bindings with this public interface, aligning defaults, specs, template use and README: | Suite variable | Default / application binding | | --- | --- | | `dnd_pipeline_audita_pipeline_stages` | ordered native records for the existing five-module sequence; `audita_pipeline_stages` | | `dnd_pipeline_audita_promptkit_backends` | native list retaining dnd endpoint/key/capacity; `audita_promptkit_backends` | | `dnd_pipeline_audita_promptkit_profiles` | native proposal/validation list retaining IDs, model and 900-second timeout; `audita_promptkit_profiles` | | `dnd_pipeline_audita_glossary_collections` | four named collections with empty entries for runtime replacement; `audita_glossary_collections` | | `dnd_pipeline_audita_glossaries` | `[party, campaign, setting, spells]`; `audita_glossaries` | | `dnd_pipeline_audita_protected_terms` | null; `audita_protected_terms` | | `dnd_pipeline_audita_llm_correction_repair_profile` | null; matching Audita input | | `dnd_pipeline_audita_llm_correction_repair_attempts` | null; matching Audita input | | `dnd_pipeline_notarius_promptkit_backends`, `dnd_pipeline_notarius_promptkit_profiles`, `dnd_pipeline_notarius_promptkit_collections` | null; matching native Notarius inputs | | `dnd_pipeline_scriptorium_promptkit_backends`, `dnd_pipeline_scriptorium_promptkit_profiles`, `dnd_pipeline_scriptorium_promptkit_collections` | null; matching native Scriptorium inputs | | `dnd_pipeline_narratio_notarius_cache` | null; `narratio_notarius_cache` | New native lists/maps are inventory-composable, not role-merged. Retire the old Audita modules/backends/profile-map/repair/threshold inputs, split Notarius cache controls and PromptKit retry wrapper, Narratio resume and S3-audio-cache inputs. Keep the existing Notarius cache-root variable, testing selector, nullable supported retry settings, and other tuning/context defaults. Do not infer a provider kind or queue policy for Audita's endpoint. 3. Wire Narratio to `/usr/local/etc/narratio/narratio.yml`, root `config.imports` with all six current suite fragments required, and `config.secrets_dir: secrets`. Leave overwrite unspecified. Keep exact downstream paths and credential lists, S3/publication settings and output handoffs. Set cleanup default false. Replace the character-family output pattern with the approved flat path. Add bindings for optional players/party inputs already consumed by prompt bodies where needed, using prepared Narratio source IDs; do not introduce separate roster files or require new authored context. 4. Pass native Audita fields to the reviewed role. Preserve D&D processing and numeric tuning. Delete active legacy profile-directory/template deployment and its unused template; do not delete old installed profiles. Leave semantic correction repair, operation deadline and transport defaults upstream-owned unless explicitly supplied through the nullable interface. 5. Migrate the existing Notarius pipeline map in place using the tagged complete D&D example's native structure. Preserve all three phases, ten lanes, generated references, chunk-map and evidence options. Remove producer/chunk retry wrappers; omit mode/turn-budget overrides. Keep explicit production `gpt-terra-latest` and pipeline `cache: auto`. Do not import sample paths or the example's fallback model. Native references arrive from Narratio's party and combined-glossary bindings, including `spell_catalog`; no sample file reference or separate player binding is required. 6. Use `notarius_config_imports` for the required suite pipeline file and `notarius_cache_directory` for the shared FHS root. Keep the testing overlay as a partial override of only the suite-selected pipeline ID, choosing `gpt-luna-latest`. Narratio testing selects that independent overlay, retains Notarius enabled, and selects the Scriptorium testing profile for trim bounds as well as every artifact/family. No testing cache refresh is implicit. 7. Wire Scriptorium's required native import of `prompt-library/promptkit.yml` at `[promptkit]`. Derive the relative import from any caller-selected checkout root and the fixed Scriptorium config directory; it must remain within that directory tree under the native contract. Document this constraint without adding a new validation framework. Do not use absolute imports, escaping symlinks, or retired prompt/profile/schema-directory inputs. Preserve the suite's profile override path through the native resource inputs. 8. Limit access/default ACL loops to the workspace and Notarius cache root. Preserve account, enrollment, ordinary modes, secret map/files and shared access semantics. Do not clean up retired roots, caches or fragments. 9. Migrate `tests/integration` and existing fixtures together with the role. Install public pinned role/collection dependencies into temporary paths. Select the Stage 1/2 asset commits explicitly through local Git source overrides while they are unpublished. Do not weaken production origins/pins or require pushing unreviewed content to run tests. Retain and migrate these existing useful scenarios, each with an immediate identical convergence reporting no changes: - **Composed suite:** supply synthetic WhisperX/S3 settings, credential values, cleanup false, and testing profiles explicitly. Inspect native app and both testing configurations, both campaign/party files, complete Notarius pipeline, supplied outputs/credential names and expanded artifact family. Use a supplied native test profile instead of the retired `--profile-dir` fixture. - **Selected application:** retain the existing explicit Seriatim v1.4.0 override/version check and clean repeat. Do not assert default app versions. - **Composed pipelines:** supply two valid native pipeline maps using inventory `combine`, select one for Narratio, and assert only that pipeline's explicitly supplied testing-profile change. Use native shapes from the migrated map, not the old pipeline fixture syntax. - **Native overrides:** supply synthetic Audita backend/profile lists and selectors, supported retry/timeout overrides, Scriptorium native resources, custom credential references and useful falsey choices. Confirm those supplied values in authored YAML or native selected-path inspection. Retain one representative service-account/human-group invocation and shared write exercise. Remove obsolete default-model/field-presence snapshots and module metadata assertions, plus the self-evident invalid-key guard's negative case. Keep useful synthetic-value leak checks without expanding a security matrix. Default smoke checks may load/inspect defaults but cannot freeze their catalog IDs. Test setup owns disposable users, files and cleanup. 10. Rewrite README around the native interface and approved migration choices. Include all roadmap handoff topics and a concise removal/replacement table. Document the core suite and pending optional-catalog stage accurately; do not claim this whole feature complete after Stage 3. ### Validation From the pipeline repository run: ```sh bash -n tests/integration git diff --check tests/integration ``` The harness must run syntax and `ansible-lint --profile production --offline` after dependency setup, then native offline validation/inspection, supplied-value scenarios and immediate clean repeats. Use these current command families: ```sh audita config validate --config /usr/local/etc/audita/config.yml notarius pipeline validate dnd-session --config /usr/local/etc/notarius/config.yml notarius pipeline validate dnd-session --config /usr/local/etc/notarius/config.yml --overlay testing scriptorium config validate --config /usr/local/etc/scriptorium/config.yml narratio config validate --config /usr/local/etc/narratio/narratio.yml --scope app --overlay testing narratio artifacts list --config /usr/local/etc/narratio/narratio.yml --campaign centaurs --format json ``` Also validate Notarius base/testing configs, Narratio base app and campaign/party scopes, and resolve the six deployed prompts through native inspection/preparation. Run Narratio inspection as the service account or enrolled test operator with synthetic bootstrap credentials. Domain listing may expand declarations using the roster; it must not initialize a session, run a provider or inspect S3. Parse only relevant supplied fields, not whole native report snapshots. ### Completion Criteria The core role and all migrated scenarios pass before committing. Public variables, defaults/specs/templates/README agree. Record exact results, asset commits, repeat counts and test-host effects. Optional catalog installation is next; collection, consumer and legacy asset refs remain unchanged. ### Commit Commit intent: `Integrate the native D&D application suite`. ## Stage 4: Add Optional Catalog Deployment and Its Composition Case — Complete ### Objective Add the approved optional catalog boundary to the valid core suite without making any sample vocabulary a production default. ### Required Policy Review Immediately reread workspace `AGENTS.md`, orientation, conventions, `docs/ansible.md`, `docs/testing.md`, the roadmap and native Narratio catalog contract. Read the local catalog example's README/FORMAT as reference only; do not require it to have a remote or adopt its sample IDs in the real campaigns. ### Preconditions Stage 3 is committed and its complete integration suite passes. ### Owning Repository `ansible-role-dnd-pipeline` ### Required Changes 1. Add nullable string inputs `dnd_pipeline_reference_catalog_repository_url` and `dnd_pipeline_reference_catalog_revision`, and path input `dnd_pipeline_reference_catalog_root` defaulting to `/usr/local/etc/narratio/reference-catalog`. Add nullable dictionary inputs `dnd_pipeline_narratio_reference_catalog_settings` and `dnd_pipeline_narratio_reference_catalog_systems`, bound to the matching Narratio role inputs. Align defaults, specs and README. 2. Repository null means no managed checkout or catalog import. When selected, require a supplied nonempty revision with one simple conditional assertion, create the root as root/runtime-group `0755`, and use an ordinary become/Git task for that repository/revision/destination. Do not guess a public URL, validate Git state manually or add mirroring/removal behavior. 3. Append its relative `reference-catalog/catalog.yml` to Narratio's required native import records when checkout is selected, using one direct Jinja list expression in the dependency binding. Derive a contained relative path for a caller-selected checkout root. Pass nullable caller maps unchanged. Native map composition owns disjoint additions and conflict handling. No assembly facts or second raw-config interface is needed. Application-role dependencies may write references before checkout tasks run; there is no production validation command requiring those files prematurely. 4. Add one explicitly selected synthetic catalog Git fixture to the integration harness. Use a local repository, recorded fixture revision, source-relative `catalog.yml` and valid `setting`/`spells` envelopes. Supply an additional disjoint caller map and inspect both contributions' resolved paths. Check fixture vocabulary against the shared schema, without preparing a session. Apply the identical role configuration immediately again and require no changes. Reuse the existing synthetic credential setup. 5. Document opt-in repository/revision, inventory-managed map alternatives, native campaign setting/system selection and its absence in the default campaigns. No optional checkout gets a runtime fetch service or sample default. ### Validation From the pipeline repository run `bash -n tests/integration`, `git diff --check` and the complete `tests/integration` harness. The Stage 3 cases and clean repeats must still pass, plus the new selected-catalog case and its clean repeat. Default repository-null convergence must succeed without the example checkout or a catalog origin. Check README links and record exact results. ### Completion Criteria Both optional checkout and caller-map composition work, while default suite convergence has no reference-catalog dependency. Every roadmap acceptance criterion is covered by focused evidence, without online processing or module postcondition tests. Leave the pipeline repository clean after its commit. ### Commit Commit intent: `Support optional Narratio reference catalogs`. ## Stage 5: Record the Cross-Repository Review Handoff — Complete ### Objective Leave the compatible assets and pipeline ready for independent review with clear revision, validation and later distribution boundaries. ### Required Policy Review Immediately reread workspace `AGENTS.md`, orientation, conventions, `docs/planning.md`, `docs/testing.md` and the approved roadmap/plan. ### Preconditions Stages 1–4 are committed and validations pass. Inspect actual revisions, branches, changed files and aggregate workspace state. ### Owning Repository Workspace root. ### Required Changes 1. Record both asset commits/branches, pipeline commits, public role pins, exact checks and results, clean-repeat evidence, fixture adjustments and local host effects in the feature roadmap. State limits: no provider, operational deployment, old-state migration or live processing validation. 2. Mark execution stages complete here and feature state `in_progress` in status/upgrade tracking. Independent review is pending; do not mark the feature done, retire the plan or write speculative remediation. 3. Update orientation to identify the compatible asset refs and canonical authoring checkouts. Note optional catalog examples are read-only and not mandatory public dependencies. Preserve unrelated work and existing inventory. 4. Identify the commits that need publication after review, and the pipeline revision for future collection subtree/dependency/consumer work. Do not publish those changes or claim that the collection already contains them. ### Validation From the workspace root run `git diff --check` and `scripts/status`; check edited Markdown links. Compare evidence and the actual diffs to every roadmap criterion. Confirm legacy asset `main` refs, collection, consumer and standalone roles are unchanged. Reuse successful prior checks for unchanged code rather than rerunning upstream or unrelated suites. Ahead/untracked-upstream states on newly created compatibility branches are expected, not deployment blockers. ### Completion Criteria All three implementation repositories are clean on their intended branches, and the workspace is clean after its handoff commit. Evidence identifies each tested revision and deferred distribution step without claiming feature closeout. ### Commit Commit intent: `Record the native suite integration for review`. ## Final Validation and Handoff Report all stage commits, asset branch names, pipeline dependency/asset pins, commands/results and repeat counts, deviations, test-host changes and any unresolved failures. Explain any complexity beyond the planned module flow and its requirement. Keep Feature 0028 in progress until independent review; leave collection assembly, consumer updates, publication and operational deployment for their authorized follow-up. ## Progress Notes Stage 1 complete: `assets/campaigns` branch `native-v4` commit `488c2eb97b5c62efe51aa7af35a5ec9cb8b7a747`; both campaign and party scopes validated with Narratio v4, both glossaries passed the tagged schema, and migrated entries and autocorrection rules match the legacy content. Stage 2 complete: `assets/narratio-prompts` branch `native-v4` commit `60e73a836aca48029dc1082ca1daa70749f60ca9`; Scriptorium v0.16.0 validated the library and inspected and prepared all six prompts using synthetic inputs. Stage 3 complete: pipeline commit `e4f0c8fc492f5210eaeacd46ef91d747de094557` with bytecode cleanup `76aec69`. Shell syntax, whitespace, Ansible syntax, production lint and the complete offline integration harness passed; all four scenarios had clean repeats. Local host application/configuration state was converged using synthetic credentials and local asset sources. Stage 4 complete: pipeline commit `12cdc04b7387cefcd0fe8d0402914c89d4c2f9f4`. The complete offline suite passed with five clean repeats, including a synthetic catalog and disjoint caller map. The no-catalog configuration was restored and natively validated after temporary catalog cleanup; the harness now restores it before removing the fixture checkout. Stage 5 complete: cross-repository implementation evidence and the pending independent-review handoff are recorded in Feature 0028. ## Open Questions None. The approved roadmap resolves the native import layout and other policy choices; all five stages have concrete implementation boundaries.