28 KiB
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, 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/bincontains the local Ansible tooling; absence from PATH is not a controller blocker. Follow workspace README/requirements-dev.txtfor 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-latestreplacing removed rumor/scene-map profiles,native-v4compatibility branches with immutable asset selections, and config-local prompt/catalog checkouts. The roadmap and this implementation plan are approved. - Pipeline:
ansible-role-dnd-pipelineon cleanmainat0f841fd91ffc533aeec0ec688e81c24bd187a845. - Campaigns:
assets/campaigns, cleanmainatd1193e8be4163c2742baa2517c9a048b6873622d. - Prompts:
assets/narratio-prompts, cleanmainatc7e18454e5f02aedb0657d522f7c550f82d874ed. - 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/binhas Narratio v4.0.0, Audita v4.3.0, Notarius v0.10.0 and Scriptorium v0.16.0. Go is 1.27.4 andsudo -n truesucceeds. 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
- Create/switch to
native-v4based on the stated campaign commit. Leave legacymainconfiguration unchanged. Do not publish during this stage. - Convert
centaurs/campaign.ymlanddilfs/campaign.ymlto the shared marker and stableid. Bindreferences.party, and put speakers/glossary paths and the existing orderedtarget/matchautocorrection rules undernarratio.inputs. Retain relative paths within each campaign directory. - 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.
- Convert both glossary lists to a shared
collections.campaign.entriesenvelope, 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. - 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:
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
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
- Create/switch to
native-v4from the stated prompt commit. Preserve legacymainand all six logical prompt IDs. - Add root
promptkit.yml, a wrapperless native settings entry point withschema_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. - Migrate unsupported definition syntax as needed for native loading. Preserve
instructions, output contracts, explicit repair budgets, supported
session_idtemplates and current template-variable names. Selection is by native ID, not version. The approved profile replacements aregpt-terra-latestfor both rumors and scene map; retain the other model selections specified by the roadmap. - Check existing shared bodies'
inputcalls 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. - 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:
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
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
-
Pin the four roles exactly as listed in the roadmap; select its application versions, Go
1.27/stableand 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. -
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_stagesordered native records for the existing five-module sequence; audita_pipeline_stagesdnd_pipeline_audita_promptkit_backendsnative list retaining dnd endpoint/key/capacity; audita_promptkit_backendsdnd_pipeline_audita_promptkit_profilesnative proposal/validation list retaining IDs, model and 900-second timeout; audita_promptkit_profilesdnd_pipeline_audita_glossary_collectionsfour named collections with empty entries for runtime replacement; audita_glossary_collectionsdnd_pipeline_audita_glossaries[party, campaign, setting, spells];audita_glossariesdnd_pipeline_audita_protected_termsnull; audita_protected_termsdnd_pipeline_audita_llm_correction_repair_profilenull; matching Audita input dnd_pipeline_audita_llm_correction_repair_attemptsnull; matching Audita input dnd_pipeline_notarius_promptkit_backends,dnd_pipeline_notarius_promptkit_profiles,dnd_pipeline_notarius_promptkit_collectionsnull; matching native Notarius inputs dnd_pipeline_scriptorium_promptkit_backends,dnd_pipeline_scriptorium_promptkit_profiles,dnd_pipeline_scriptorium_promptkit_collectionsnull; matching native Scriptorium inputs dnd_pipeline_narratio_notarius_cachenull; narratio_notarius_cacheNew 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.
-
Wire Narratio to
/usr/local/etc/narratio/narratio.yml, rootconfig.importswith all six current suite fragments required, andconfig.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. -
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.
-
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-latestand pipelinecache: auto. Do not import sample paths or the example's fallback model. Native references arrive from Narratio's party and combined-glossary bindings, includingspell_catalog; no sample file reference or separate player binding is required. -
Use
notarius_config_importsfor the required suite pipeline file andnotarius_cache_directoryfor the shared FHS root. Keep the testing overlay as a partial override of only the suite-selected pipeline ID, choosinggpt-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. -
Wire Scriptorium's required native import of
prompt-library/promptkit.ymlat[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. -
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.
-
Migrate
tests/integrationand 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-dirfixture. - 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.
- 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
-
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:
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:
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
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
- Add nullable string inputs
dnd_pipeline_reference_catalog_repository_urlanddnd_pipeline_reference_catalog_revision, and path inputdnd_pipeline_reference_catalog_rootdefaulting to/usr/local/etc/narratio/reference-catalog. Add nullable dictionary inputsdnd_pipeline_narratio_reference_catalog_settingsanddnd_pipeline_narratio_reference_catalog_systems, bound to the matching Narratio role inputs. Align defaults, specs and README. - 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. - Append its relative
reference-catalog/catalog.ymlto 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. - Add one explicitly selected synthetic catalog Git fixture to the integration
harness. Use a local repository, recorded fixture revision, source-relative
catalog.ymland validsetting/spellsenvelopes. 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. - 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
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
- 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.
- Mark execution stages complete here and feature state
in_progressin status/upgrade tracking. Independent review is pending; do not mark the feature done, retire the plan or write speculative remediation. - 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.
- 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.
Open Questions
None. The approved roadmap resolves the native import layout and other policy choices; all five stages have concrete implementation boundaries.