Files
ansible-collection-dnd/README.md
Eric Rakestraw c53076c12a Squashed 'roles/pipeline/' changes from 0f841fd..63f1dd4
63f1dd4 Use explicit prompt variants for previous-session context
12cdc04 Support optional Narratio reference catalogs
76aec69 Remove generated Python bytecode
e4f0c8f Integrate the native D&D application suite

git-subtree-dir: roles/pipeline
git-subtree-split: 63f1dd4fb43744c4df3f06c0f909c843f6eb68d0
2026-12-04 03:40:26 +00:00

141 lines
7.8 KiB
Markdown

# D&D pipeline Ansible role
This standalone role composes Narratio v4.0.0, Audita v4.3.0, Notarius
v0.10.0, Scriptorium v0.16.0 and Seriatim v1.5.0 for the D&D workflow. It
installs the applications from selected source revisions, configures their
native interfaces, and deploys campaign and prompt assets. Gather facts and
supply `dnd_pipeline_whisperx_transcribe_url` when invoking it. The collection
and deployment consumer are distributed separately.
## Inventory and native inputs
See [defaults/main.yml](defaults/main.yml) and
[meta/argument_specs.yml](meta/argument_specs.yml) for the complete interface.
Application versions, Git origins, revisions, and toolchain are configurable.
The role selects immutable commits on the assets' `native-v4` compatibility
branches; their legacy `main` branches remain available to older consumers.
The native prompt checkout defaults to `/usr/local/etc/scriptorium/prompt-library`.
A custom prompt root must be inside `/usr/local/etc/scriptorium` so that the
native relative import remains contained by the main configuration directory.
The former shared prompt checkout is left untouched.
Audita stages and PromptKit backends/profiles are complete inventory-composable
lists, and glossary collections are a map. The selected four empty collections
are replaced by Narratio's prepared shared glossaries at runtime. Notarius
pipelines are a complete inventory-composable map. Scriptorium and Notarius
PromptKit backends, profiles and collections are optional native resources;
null delegates to the applications. Their role defaults do not merge caller
records. Audita repair and supported retry/timeout settings are nullable.
The suite manages `/usr/local/etc/narratio/narratio.yml` with required native
imports and `config.secrets_dir: secrets`. The `dnd_pipeline_secrets` map can
manage credential files; inventory must provide encrypted values as appropriate.
Credential lists and the S3 fields contain environment/secret reference names,
not raw keys. Environment delivery remains available. Existing configuration
fragments, legacy profiles, spool and cache roots are not removed.
```yaml
- hosts: pipeline_hosts
roles:
- role: rakestraw.dnd_pipeline
vars:
dnd_pipeline_whisperx_transcribe_url: https://whisperx.example.test/transcribe
dnd_pipeline_secrets: "{{ vault_pipeline_secrets }}"
```
The runtime account owns managed configuration and the shared workspace;
`dnd_pipeline_operator_users` enrolls existing users in its group. Shared
workspace and Notarius cache access use group permissions and default ACLs.
Campaign, party and glossary documents use the shared v4 formats. Source paths
resolve relative to the file that declares them; the optional character family
uses flat artifact paths. No sample reference catalog is selected for the default campaigns.
A caller can opt in to a managed catalog by setting
`dnd_pipeline_reference_catalog_repository_url` and a nonempty
`dnd_pipeline_reference_catalog_revision`. The default checkout is
`/usr/local/etc/narratio/reference-catalog`; a custom root must remain inside
`/usr/local/etc/narratio` for the required source-relative `catalog.yml` import.
Alternatively or additionally, supply disjoint caller-owned vocabulary paths
through `dnd_pipeline_narratio_reference_catalog_settings` and
`dnd_pipeline_narratio_reference_catalog_systems`. Native composition resolves
these maps and reports conflicts. Campaigns select a setting or system by ID;
the supplied campaigns select neither. Catalog content is authored and updated
independently, with no runtime fetch service.
## Migration and operation
Session recap and character analysis default to `dnd.session_recap` and
`dnd.character_meta_analysis`, using current-session inputs only. Their default
bindings do not request a previous recap, so a first session needs no predecessor.
Player and party context comes from Narratio's prepared campaign roster.
To include a previous recap, explicitly select `dnd.session_recap_with_previous`
in `dnd_pipeline_narratio_session_recap_artifact`, or
`dnd.character_meta_analysis_with_previous` in
`dnd_pipeline_narratio_character_analysis_family`. Also add this binding to that
mapping's `inputs`, retaining its other fields and inputs from
[defaults/main.yml](defaults/main.yml):
```yaml
recap:
source: narratio.previous_session.artifact.session_recap
required: true
```
Keep the existing artifact key and output path. Previous-aware selections need
an available published previous recap; there is no automatic fallback. The
testing overlay still changes the selected model without changing the prompt
variant. This is a configuration-only workaround pending upstream optional-input
support, and does not require application changes.
| Retired suite inputs | Native replacement |
| --- | --- |
| `dnd_pipeline_audita_pipeline_modules` | `dnd_pipeline_audita_pipeline_stages` |
| `dnd_pipeline_audita_backends`, `dnd_pipeline_audita_profiles` | `dnd_pipeline_audita_promptkit_backends`, `dnd_pipeline_audita_promptkit_profiles` |
| Audita confidence thresholds and `dnd_pipeline_audita_llm_repair_attempts` | Native glossary selection and nullable correction-repair inputs; no automatic conversion |
| Notarius chunk-plan/checkpoint cache controls and PromptKit retry wrapper | Native pipeline cache and producer controls; `dnd_pipeline_notarius_cache_root` remains the cache location |
| `dnd_pipeline_narratio_notarius_resume`, `dnd_pipeline_narratio_cache_s3_audio` | Optional `dnd_pipeline_narratio_notarius_cache`; no Narratio audio cache |
The testing Narratio overlay selects an independent Notarius testing overlay
and Scriptorium test profile for bounds, artifacts and family. A model or overlay
change does not itself invalidate completed Narratio products or accepted
Notarius results; explicitly force extraction or select refresh/bypass for a
fresh experiment. The production pipeline uses native cache `auto`.
Narratio accepts only `narratio.session-manifest.v2` local state. Preserve old
authored sources and workspaces separately; regenerate or import compatible
published products into a new baseline. Publication and restore transfer
products, not the old execution ledger. Automatic cleanup defaults to false;
if explicitly enabled, it removes the entire session run history, including
logs and debug captures. The role does not run cleanup or migrate old state.
Use explicit configuration paths and flags after the complete command path:
```sh
narratio config validate --config /usr/local/etc/narratio/narratio.yml --scope app
narratio config show --config /usr/local/etc/narratio/narratio.yml --scope app --overlay testing
narratio artifacts list --config /usr/local/etc/narratio/narratio.yml --campaign centaurs
notarius pipeline validate dnd-session --config /usr/local/etc/notarius/config.yml --overlay testing
scriptorium config validate --config /usr/local/etc/scriptorium/config.yml
```
See the tagged [Narratio release](https://gitea.maximumdirect.net/eric/narratio/src/tag/v4.0.0/docs/releases/v4.0.0.md),
[Notarius D&D integration](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/consumers/dnd-pipeline.md),
[Audita configuration](https://gitea.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md), and
[Scriptorium migration](https://gitea.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/consumers/upgrading-promptkit.md)
for the application contracts.
## Offline validation
`tests/integration` installs pinned dependencies into temporary paths and
selects the local compatible asset commits. It runs syntax and production-profile
lint, native validation/inspection and supplied configuration cases, with a clean
repeat after each role application. It uses synthetic credentials and the local
Ubuntu test host; it does not run preflight, inference, S3 operations or an
end-to-end session.
```sh
bash -n tests/integration
tests/integration
```