Integrate the native D&D application suite
This commit is contained in:
536
README.md
536
README.md
@@ -1,483 +1,105 @@
|
||||
# rakestraw.dnd_pipeline
|
||||
# D&D pipeline Ansible role
|
||||
|
||||
Installs the D&D transcript-processing application suite by composing the
|
||||
standalone Seriatim, Audita, Notarius, Scriptorium, and Narratio roles. It
|
||||
supports Ubuntu 26.04 and Ansible Core 2.18 or newer. Downstream roles perform
|
||||
their own task-level privilege escalation, so a play does not need `become`.
|
||||
Supported host architectures are `amd64` and `arm64`.
|
||||
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.
|
||||
|
||||
## Installation
|
||||
## Inventory and native inputs
|
||||
|
||||
Install the role dependencies and their collection before applying this role:
|
||||
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.
|
||||
|
||||
```sh
|
||||
ansible-galaxy role install -r requirements.yml
|
||||
ansible-galaxy collection install -r collections/requirements.yml
|
||||
```
|
||||
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 dependency manifest installs the roles under their canonical names:
|
||||
`rakestraw.seriatim`, `rakestraw.audita`, `rakestraw.notarius`,
|
||||
`rakestraw.scriptorium`, and `rakestraw.narratio`. It selects the compatible
|
||||
`v0.1.0` releases where compatible and public commit pins for Narratio and
|
||||
Notarius when the suite needs newer interfaces. This standalone role is named
|
||||
`rakestraw.dnd_pipeline`.
|
||||
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
|
||||
---
|
||||
- name: Install the D&D pipeline foundation
|
||||
hosts: pipeline_hosts
|
||||
gather_facts: true
|
||||
- hosts: pipeline_hosts
|
||||
roles:
|
||||
- role: rakestraw.dnd_pipeline
|
||||
vars:
|
||||
dnd_pipeline_whisperx_transcribe_url: https://whisperx.example/transcribe
|
||||
dnd_pipeline_whisperx_transcribe_url: https://whisperx.example.test/transcribe
|
||||
dnd_pipeline_secrets: "{{ vault_pipeline_secrets }}"
|
||||
```
|
||||
|
||||
The collection source exposes a reviewed snapshot of this role as
|
||||
`rakestraw.dnd.pipeline`:
|
||||
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 installed by this core
|
||||
role; optional catalog deployment is a separate planned addition.
|
||||
|
||||
```yaml
|
||||
---
|
||||
- name: Install the D&D pipeline from the collection
|
||||
hosts: pipeline_hosts
|
||||
gather_facts: true
|
||||
roles:
|
||||
- role: rakestraw.dnd.pipeline
|
||||
vars:
|
||||
dnd_pipeline_whisperx_transcribe_url: https://whisperx.example/transcribe
|
||||
```
|
||||
## Migration and operation
|
||||
|
||||
Collection consumers should follow the unified bootstrap instructions in the
|
||||
[`rakestraw.dnd` collection repository](https://gitea.maximumdirect.net/eric/ansible-collection-dnd).
|
||||
This standalone repository remains authoritative for role changes; collection
|
||||
maintainers import a reviewed, pushed commit or immutable tag as a snapshot.
|
||||
Collection releases are published independently and are listed in the
|
||||
collection repository.
|
||||
|
||||
## Variables
|
||||
|
||||
`dnd_pipeline_whisperx_transcribe_url` is required and is passed to Narratio.
|
||||
The compatible application versions are selected through these variables:
|
||||
|
||||
| Variable | Default |
|
||||
| Retired suite inputs | Native replacement |
|
||||
| --- | --- |
|
||||
| `dnd_pipeline_audita_version` | `v2.0.1` |
|
||||
| `dnd_pipeline_narratio_version` | `v3.1.0` |
|
||||
| `dnd_pipeline_notarius_version` | `v0.8.1` |
|
||||
| `dnd_pipeline_seriatim_version` | `v1.5.0` |
|
||||
| `dnd_pipeline_scriptorium_version` | `v0.15.0` |
|
||||
| `dnd_pipeline_manage_build_dependencies` | `true` |
|
||||
| `dnd_pipeline_go_snap_channel` | `1.26/stable` |
|
||||
| `dnd_pipeline_go_binary` | `/snap/bin/go` |
|
||||
| `dnd_pipeline_campaigns_repository_url` | `https://gitea.maximumdirect.net/eric/campaigns.git` |
|
||||
| `dnd_pipeline_campaigns_revision` | `main` |
|
||||
| `dnd_pipeline_campaigns_root` | `/usr/local/share/narratio/campaigns` |
|
||||
| `dnd_pipeline_prompt_library_repository_url` | `https://gitea.maximumdirect.net/eric/narratio-prompts.git` |
|
||||
| `dnd_pipeline_prompt_library_revision` | `main` |
|
||||
| `dnd_pipeline_prompt_library_root` | `/usr/local/share/narratio/prompt-library` |
|
||||
| `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 common dependency-management switch controls whether every application
|
||||
role installs Git and Go. Callers that disable it must provide both Git and Go.
|
||||
The Go channel and executable are likewise passed to all five roles. Advanced
|
||||
callers may supply unmapped standalone-role variables directly through normal
|
||||
Ansible variable precedence.
|
||||
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`.
|
||||
|
||||
The following values are deliberate D&D suite policy passed through the
|
||||
standalone roles' generic configuration interfaces; they are not standalone
|
||||
defaults. Narratio runs first and establishes the selected runtime user and
|
||||
group before the remaining configuration-bearing dependencies run.
|
||||
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.
|
||||
|
||||
| Variable | Default policy |
|
||||
| --- | --- |
|
||||
| `dnd_pipeline_runtime_user` | `narratio` |
|
||||
| `dnd_pipeline_runtime_group` | `narratio` |
|
||||
| `dnd_pipeline_operator_users` | `[]` |
|
||||
| `dnd_pipeline_config_directory_mode` | `0755` |
|
||||
| `dnd_pipeline_config_file_mode` | `0644` |
|
||||
|
||||
All application configuration, including pipeline-owned Narratio fragments,
|
||||
is therefore `narratio:narratio`, world-readable, and Ansible-managed. It is
|
||||
not an operator-editable configuration surface.
|
||||
|
||||
Narratio receives the standard Seriatim, Audita, Notarius, and Scriptorium
|
||||
binary and configuration paths managed by the composed roles. Notarius is
|
||||
enabled with the suite-owned `dnd-session` extraction pipeline.
|
||||
|
||||
The role deploys the campaign repository directly at the campaign root and
|
||||
the prompt library directly at the prompt-library root. By default both follow
|
||||
their `main` branches; callers can select an immutable commit, tag, or another
|
||||
branch through the revision variables. Narratio receives the deployed campaign
|
||||
root, while Scriptorium receives its `prompts/` and `schemas/` children.
|
||||
|
||||
### D&D processing policy
|
||||
|
||||
The variables below are deliberate D&D suite policy, not a copy of application
|
||||
defaults. They remain ordinary inventory variables, so callers can replace a
|
||||
chosen policy value when their deployment requires it.
|
||||
|
||||
| Variable group | Default policy |
|
||||
| --- | --- |
|
||||
| `dnd_pipeline_audita_pipeline_modules` | `glossary`, `homophones`, `glossary`, `spoken_word`, `grammar` |
|
||||
| `dnd_pipeline_audita_output_schema` | `audita-v1` |
|
||||
| `dnd_pipeline_audita_backends` | Native `dnd` backend at `https://inference.ai.rakestrawhome.com/v1`, credential `AUDITA_LLM_API_KEY`, shared concurrency `4` |
|
||||
| `dnd_pipeline_audita_profiles` | Complete native `dnd-proposal` and `dnd-validation` mappings using `google/gemma-4-31b-it` and 900-second attempt timeouts |
|
||||
| `dnd_pipeline_audita_llm_proposal_profile` | `dnd-proposal` |
|
||||
| `dnd_pipeline_audita_llm_validation_profile` | `dnd-validation` |
|
||||
| `dnd_pipeline_audita_llm_transient_retries`, `dnd_pipeline_audita_llm_repair_attempts`, `dnd_pipeline_audita_llm_operation_timeout` | `null`; omit overrides and use native defaults |
|
||||
| `dnd_pipeline_audita_chunking_*` | `8` target sections, `6144` maximum and `2048` minimum section tokens |
|
||||
| `dnd_pipeline_audita_normalization_*` | `3.0` maximum and ellipsis gaps, `240.0` maximum duration, `2048` maximum tokens |
|
||||
| `dnd_pipeline_audita_thresholds_*` | `0.8` for glossary, homophones, spoken word, and grammar |
|
||||
| `dnd_pipeline_audita_context_description` | D&D-game transcript context, including possible pre- and post-session banter |
|
||||
| `dnd_pipeline_audita_diagnostics_work_dir` | `/tmp/audita` |
|
||||
|
||||
Audita owns its backend and LLM policy. The suite writes each complete profile
|
||||
mapping to `/usr/local/etc/audita/profiles/<key>.yml`; keys must be filename-safe
|
||||
IDs matching each mapping's `id`. Inventory may replace the mappings and selected
|
||||
IDs. Narratio forwards the configured credential names, while Audita's native
|
||||
configuration resolves them. The role does not remove old profile files.
|
||||
|
||||
For inventories upgrading from the prior suite, replace the separate Audita
|
||||
proposal/validation endpoint, model, key, timeout, and concurrency variables
|
||||
with `dnd_pipeline_audita_backends` and `dnd_pipeline_audita_profiles`, then
|
||||
select profile IDs with the two `dnd_pipeline_audita_llm_*_profile` variables.
|
||||
Replace `dnd_pipeline_narratio_notarius_llm_api_key` with
|
||||
`dnd_pipeline_narratio_notarius_credentials`, and use
|
||||
`dnd_pipeline_narratio_audita_credentials` for Audita's backend credential
|
||||
names. The old diagnostics retention variable is no longer forwarded.
|
||||
|
||||
The old per-purpose Audita endpoint and API-key names now belong to the
|
||||
backend map; both default profiles share the `dnd` backend and its one
|
||||
concurrency limit. Old proposal and validation models and per-attempt timeouts
|
||||
belong in complete profile mappings. The default 900-second value is retained
|
||||
per attempt; `dnd_pipeline_audita_llm_operation_timeout` is an independent
|
||||
whole-operation deadline and defaults to `null`, leaving Audita's native
|
||||
policy in charge. The former `*_max_retries` variables do not have a direct
|
||||
one-to-one replacement: use the optional Audita transient retry and repair
|
||||
attempt settings according to the desired native behavior. Optional retry
|
||||
pass-throughs for Notarius PromptKit and Scriptorium likewise default to
|
||||
`null`; an explicit `0` is forwarded, not treated as omission.
|
||||
|
||||
Include each backend credential name in
|
||||
`dnd_pipeline_narratio_audita_credentials` and make its value available to
|
||||
Narratio through its process environment or supported secret files.
|
||||
`dnd_pipeline_secrets` is the suite's optional file-provisioning interface,
|
||||
not a requirement to store credentials on disk. Narratio forwards only names in
|
||||
that list and does not discover them from Audita's configuration. The
|
||||
Notarius list is independent. For profile overrides, use filename-safe map
|
||||
keys equal to each profile's native `id`; the suite writes each map value
|
||||
unchanged and does not merge individual fields. See [Audita's v2 configuration
|
||||
migration](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.1/docs/migrations/v2.md)
|
||||
for backend and profile migration; this role does not convert caller-owned
|
||||
configuration.
|
||||
|
||||
Existing Narratio session manifests need a separate migration before opening
|
||||
affected sessions with v3. Stop activity for the session and back up its local
|
||||
manifest. Follow [Narratio's manifest overlay-provenance migration](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.0.0/docs/operations.md#migrating-manifest-overlay-provenance)
|
||||
to rename `effective_config.selected_profile` to `selected_overlay`, or remove
|
||||
the retired informational member as upstream permits. Preserve stage records,
|
||||
checkpoints, and other progress; do not edit immutable remote snapshots or
|
||||
force all stages to rerun. The role performs no session migration.
|
||||
|
||||
| Variable | Default |
|
||||
| --- | --- |
|
||||
| `dnd_pipeline_narratio_seriatim_output_schema` | `seriatim-intermediate` |
|
||||
| `dnd_pipeline_narratio_normalize_output_path` | `transcripts/final.json` |
|
||||
| `dnd_pipeline_narratio_normalize_output_schema` | `seriatim-intermediate` |
|
||||
| `dnd_pipeline_narratio_trim_enabled` | `true` |
|
||||
| `dnd_pipeline_narratio_trim_output_path` | `transcripts/final.trimmed.json` |
|
||||
| `dnd_pipeline_narratio_trim_bounds_prompt_id` | `dnd.session_bounds` |
|
||||
| `dnd_pipeline_narratio_trim_bounds_transcript_input_name` | `transcript` |
|
||||
| `dnd_pipeline_narratio_trim_bounds_output_path` | `artifacts/session_bounds.json` |
|
||||
| `dnd_pipeline_narratio_render_enabled` | `true` |
|
||||
| `dnd_pipeline_narratio_render_format` | `markdown` |
|
||||
| `dnd_pipeline_narratio_testing_scriptorium_profile` | `gemini-flash-latest` |
|
||||
| `dnd_pipeline_notarius_testing_llm_profile` | `gpt-luna-latest` |
|
||||
| `dnd_pipeline_notarius_promptkit_transient_retries` | `null`; native default |
|
||||
| `dnd_pipeline_scriptorium_transient_retries` | `null`; native default |
|
||||
| `dnd_pipeline_narratio_audita_credentials` | `[AUDITA_LLM_API_KEY]` |
|
||||
| `dnd_pipeline_narratio_notarius_credentials` | `[OPENROUTER_API_KEY]` |
|
||||
| `dnd_pipeline_narratio_scriptorium_credentials` | `[OPENROUTER_API_KEY]` |
|
||||
|
||||
`dnd_pipeline_audita_output_schema` is also the Narratio Audita-adapter schema;
|
||||
it is the shared cross-application boundary. Other Narratio-local controls,
|
||||
including reports, timeouts, debug rendering, presentation, and bounds prompt
|
||||
profile selection, remain Narratio defaults.
|
||||
|
||||
Narratio v3.1.0 forwards the selected Scriptorium credential names for trim,
|
||||
analysis, character families, and render-debug calls. The Scriptorium and
|
||||
Notarius lists independently default to the existing `OPENROUTER_API_KEY` name;
|
||||
using the same provisioned value does not couple their selections. Inventory
|
||||
may replace the Scriptorium list, set `[]` to forward nothing, or set `null` to
|
||||
omit the field. Each selected name must resolve to a nonempty value when
|
||||
Narratio loads configuration, even for inspection commands. Values may come
|
||||
from Narratio's process environment or its existing secrets directory;
|
||||
`dnd_pipeline_secrets` is optional file provisioning, not the only source.
|
||||
After upgrading and provisioning the selected key, retry a failed trim or
|
||||
analysis normally. Do not force already successful work solely because a
|
||||
credential was added or rotated.
|
||||
|
||||
### Storage and publication policy
|
||||
|
||||
The suite selects Narratio's S3 backend and the established Backblaze-compatible
|
||||
archive. These are ordinary inventory variables, so deployments may replace
|
||||
the selected policy through the role's public interface.
|
||||
|
||||
| Variable | Default policy |
|
||||
| --- | --- |
|
||||
| `dnd_pipeline_narratio_workspace_cleanup_after_publish` | `true` |
|
||||
| `dnd_pipeline_narratio_storage_backend` | `s3` |
|
||||
| `dnd_pipeline_narratio_storage_s3_bucket` | `rakestraw-assets` |
|
||||
| `dnd_pipeline_narratio_storage_s3_root_prefix` | `dnd` |
|
||||
| `dnd_pipeline_narratio_storage_s3_region` | `us-east-1` |
|
||||
| `dnd_pipeline_narratio_storage_s3_endpoint` | `https://s3.us-east-005.backblazeb2.com` |
|
||||
| `dnd_pipeline_narratio_storage_s3_force_path_style` | `true` |
|
||||
| `dnd_pipeline_narratio_storage_s3_access_key_id` | `OBJECT_STORAGE_KEY_ID` |
|
||||
| `dnd_pipeline_narratio_storage_s3_secret_access_key` | `OBJECT_STORAGE_KEY` |
|
||||
| `dnd_pipeline_narratio_cache_s3_audio` | `true` |
|
||||
| `dnd_pipeline_narratio_publish_enabled` | `true` |
|
||||
| `dnd_pipeline_narratio_publish_upload_run` | `true` |
|
||||
|
||||
`dnd_pipeline_narratio_publish_outputs` is a complete native list, not a list
|
||||
merged with the suite default. It publishes final and trimmed JSON, final and
|
||||
trimmed Markdown, session recap, hostile rumors, and optional deranged rumors.
|
||||
Every rule omits `dest`: Narratio derives transcript destinations from its
|
||||
built-in sources and artifact destinations from the configured artifact output
|
||||
paths.
|
||||
|
||||
S3 session audio uses the maximum available native cache beneath
|
||||
`/var/cache/narratio`. After successful run publication, Narratio cleans the
|
||||
published workspace target while preserving that cache. The suite deliberately
|
||||
does not set `narratio_spool_delete_audio_after_publish`; spool-audio retention
|
||||
continues to use Narratio's application default.
|
||||
|
||||
### Artifacts and profiles
|
||||
|
||||
The role owns these complete native mapping variables. Replacing one mapping
|
||||
changes that source's configuration as a whole; it does not change the fixed
|
||||
file name, import, or source key. Set `enabled: false` to retain an available
|
||||
source while excluding it from normal analysis.
|
||||
|
||||
| Variable | Fixed source | Default state | Output |
|
||||
| --- | --- | --- | --- |
|
||||
| `dnd_pipeline_narratio_session_recap_artifact` | `session_recap` | enabled | `artifacts/session_recap.md` |
|
||||
| `dnd_pipeline_narratio_hostile_rumors_artifact` | `hostile_rumors` | enabled | `artifacts/hostile_rumors.md` |
|
||||
| `dnd_pipeline_narratio_deranged_rumors_artifact` | `deranged_rumors` | enabled | `artifacts/deranged_rumors.md` |
|
||||
| `dnd_pipeline_narratio_scene_map_artifact` | `scene_map` | disabled | `artifacts/scene_map.json` |
|
||||
| `dnd_pipeline_narratio_character_analysis_family` | `character_meta_analysis` | disabled | `artifacts/character_meta_analysis/{character_id}.md` |
|
||||
|
||||
The character-analysis family expands over campaign `party.characters` and
|
||||
passes each member's name and class summary to its prompt. Recap and both rumor
|
||||
sources are enabled; the rumor input derives its recap dependency without a
|
||||
redundant explicit ordering edge. Production artifacts inherit each prompt's
|
||||
declared profile.
|
||||
|
||||
Narratio's root file remains owned by the standalone role. It imports the
|
||||
suite-owned base fragments in this fixed order:
|
||||
|
||||
```text
|
||||
/usr/local/etc/narratio/
|
||||
├── pipeline.yml
|
||||
├── conf.d/processing.yml
|
||||
├── artifacts/session-recap.yml
|
||||
├── artifacts/hostile-rumors.yml
|
||||
├── artifacts/deranged-rumors.yml
|
||||
├── artifacts/scene-map.yml
|
||||
├── artifact-families/character-meta-analysis.yml
|
||||
└── overlays/testing.yml
|
||||
```
|
||||
|
||||
Notarius follows the corresponding base-and-overlay layout:
|
||||
|
||||
```text
|
||||
/usr/local/etc/notarius/
|
||||
├── config.yml
|
||||
├── pipelines/dnd-session.yml
|
||||
└── overlays/testing.yml
|
||||
```
|
||||
|
||||
The `testing` overlay is not a second configuration tree. It sets
|
||||
the Scriptorium `profile_id` for the four artifact sources and the one family,
|
||||
and explicitly selects Notarius's separately managed `testing` overlay. The
|
||||
Scriptorium default, `gemini-flash-latest`, is an inexpensive development
|
||||
choice, not a compatibility guarantee. Replace it through inventory when a
|
||||
different testing profile is appropriate:
|
||||
|
||||
```yaml
|
||||
dnd_pipeline_narratio_testing_scriptorium_profile: endpoint-profile
|
||||
dnd_pipeline_notarius_testing_llm_profile: alternate-economy-profile
|
||||
```
|
||||
|
||||
Narratio selects it with `--overlay testing`, and direct Notarius commands
|
||||
use `--config-overlay testing`; the former `--profile` and
|
||||
`--config-profile` selectors are retired. Previously deployed
|
||||
`profiles/testing.yml` files are ignored, not pruned. Renaming the selected
|
||||
overlay normally changes configuration identity, so cached work tied to the
|
||||
old named selection may not be reused.
|
||||
|
||||
### Notarius extraction policy
|
||||
|
||||
The Notarius root configuration imports the fixed
|
||||
`pipelines/dnd-session.yml` fragment. The suite owns that fragment at
|
||||
`/usr/local/etc/notarius/pipelines/dnd-session.yml`; callers do not edit it.
|
||||
The separate `/usr/local/etc/notarius/overlays/testing.yml` overlay changes only
|
||||
the selected suite pipeline's LLM profile.
|
||||
|
||||
| Variable | Default policy |
|
||||
| --- | --- |
|
||||
| `dnd_pipeline_notarius_pipelines` | Complete native map containing `dnd-session` |
|
||||
| `dnd_pipeline_notarius_cache_root` | `/var/cache/notarius` |
|
||||
| `dnd_pipeline_notarius_cache_chunk_plans_mode` | `auto` |
|
||||
| `dnd_pipeline_notarius_cache_checkpoints_enabled` | `true` |
|
||||
| `dnd_pipeline_notarius_testing_llm_profile` | `gpt-luna-latest` |
|
||||
| `dnd_pipeline_narratio_notarius_pipeline_id` | `dnd-session` |
|
||||
| `dnd_pipeline_narratio_notarius_credentials` | `[OPENROUTER_API_KEY]` |
|
||||
| `dnd_pipeline_narratio_notarius_resume` | `true` |
|
||||
| `dnd_pipeline_narratio_notarius_references` | `party`, `players`, and `glossary` prepared sources |
|
||||
| `dnd_pipeline_narratio_notarius_outputs` | Complete native map of ten accepted D&D lanes |
|
||||
|
||||
The pipeline, reference, and output values are complete native mappings.
|
||||
Inventory can replace them or compose additions with Jinja's `combine` filter;
|
||||
a replacement pipeline map requires a matching selected pipeline ID. The base
|
||||
`dnd-session` pipeline selects `gpt-terra-latest`, while the testing overlay
|
||||
selects `gpt-luna-latest`. Both are moving catalog IDs rather than immutable
|
||||
model promises. Pipeline and binding-level overrides retain Notarius's native
|
||||
precedence; the suite does not rewrite caller-supplied bindings.
|
||||
|
||||
Narratio materializes the `party`, `players`, and `glossary` references for each
|
||||
invocation. No campaign filesystem path appears in Notarius configuration. The
|
||||
optional `spell_catalog` reference remains absent until a campaign supplies
|
||||
that input. The accepted sources are
|
||||
`narratio.extraction.item_registry`, `npc_registry`, `location_registry`,
|
||||
`scene_descriptions`, `item_occurrences`, `spells`, `combat_turns`,
|
||||
`npc_occurrences`, `location_occurrences`, and `enemy_events`.
|
||||
They remain available as `narratio.extraction.<output_key>` inputs for future
|
||||
analyze artifacts whether or not a source has a stable publication rule;
|
||||
accepted extraction and published output selection are independent interfaces.
|
||||
|
||||
Narratio forwards the typed `OPENROUTER_API_KEY` reference to the selected
|
||||
Notarius profile and ordinary extraction requests checkpoint reuse with
|
||||
`resume: true`. Chunk plans use Notarius's root-owned `auto` policy; the
|
||||
pipeline deliberately leaves Narratio's optional `chunk_cache` override unset.
|
||||
The `chunk-plans` and `checkpoints` paths derive from the cache root and are
|
||||
created by Notarius during use. See the [Notarius v0.8.1 release notes](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/releases/v0.8.1.md)
|
||||
for its PromptKit dependency and profile-source identity changes.
|
||||
Existing checkpoints with the previous profile-source identity are not reused;
|
||||
source-keyed chunk plans and output artifacts remain compatible. No cache
|
||||
deletion or forced extraction is performed by this role. A real testing run may
|
||||
invoke Notarius; the integration suite performs offline configuration inspection
|
||||
only and makes no provider request.
|
||||
|
||||
### Inspecting configuration
|
||||
|
||||
The following native Narratio commands resolve configuration without running
|
||||
transcription or requesting a model provider. Select a deployed campaign for
|
||||
the party-driven character family:
|
||||
Use explicit configuration paths and flags after the complete command path:
|
||||
|
||||
```sh
|
||||
sudo -u narratio narratio config validate \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs
|
||||
sudo -u narratio narratio config validate \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs --overlay testing
|
||||
sudo -u narratio narratio config artifacts \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs
|
||||
sudo -u narratio narratio config diff default testing \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs
|
||||
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
|
||||
```
|
||||
|
||||
The first two commands validate production and testing resolution. Artifact
|
||||
inspection shows enabled sources, inferred dependencies, and generated family
|
||||
members; the diff shows the overlay's profile selections without modifying
|
||||
managed files.
|
||||
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.
|
||||
|
||||
With valid object-storage credentials, the selected policy enables Narratio's
|
||||
native [S3 session-audio](https://gitea.maximumdirect.net/eric/narratio/src/tag/v2.1.1/docs/config.md#session),
|
||||
[publication](https://gitea.maximumdirect.net/eric/narratio/src/tag/v2.1.1/docs/operations.md#publish-workflow),
|
||||
[restore](https://gitea.maximumdirect.net/eric/narratio/src/tag/v2.1.1/docs/operations.md#restore-workflow),
|
||||
[publication locks](https://gitea.maximumdirect.net/eric/narratio/src/tag/v2.1.1/docs/operations.md#publish-locks),
|
||||
[session status](https://gitea.maximumdirect.net/eric/narratio/src/tag/v2.1.1/docs/operations.md#standard-session-workflow),
|
||||
and [cleanup](https://gitea.maximumdirect.net/eric/narratio/src/tag/v2.1.1/docs/operations.md#cleanup)
|
||||
workflows. These remain application commands and lifecycle rules; scheduling
|
||||
and real end-to-end execution remain deployment concerns.
|
||||
## Offline validation
|
||||
|
||||
### Shared execution filesystem
|
||||
`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.
|
||||
|
||||
`/var/lib/narratio`, `/var/spool/narratio`, `/var/cache/narratio`, and
|
||||
`/var/cache/notarius` are
|
||||
`narratio:narratio` mode `2775` **setgid** directories. Their access and
|
||||
default ACLs retain owner and group write access plus world read/traverse access
|
||||
for newly created content. The pipeline may run as `narratio` or as a human
|
||||
account in the selected runtime group. Consumers can enroll selected existing
|
||||
human accounts through the role interface:
|
||||
|
||||
```yaml
|
||||
dnd_pipeline_operator_users:
|
||||
- eric
|
||||
- alice
|
||||
```sh
|
||||
bash -n tests/integration
|
||||
tests/integration
|
||||
```
|
||||
|
||||
Every selected account must already exist; the role does not create human
|
||||
accounts or manage their identity and login policy. Enrollment adds the
|
||||
selected runtime group without replacing other supplementary groups. Removing
|
||||
or omitting a name later does not revoke membership. A newly enrolled operator
|
||||
must begin a new login session before the operating system exposes the added
|
||||
supplementary group to that session.
|
||||
|
||||
Configuration, transcripts, caches, generated artifacts, campaign data,
|
||||
prompts, and logs are non-secret D&D content. Credentials use the restricted
|
||||
`/usr/local/etc/narratio/secrets` subtree, owned by the selected runtime user
|
||||
and group with mode `0750`; managed files use mode `0640`. Runtime-group
|
||||
membership, including enrollment through `dnd_pipeline_operator_users`,
|
||||
authorizes use of these shared credentials, while the subtree grants no world
|
||||
access. Ordinary configuration remains world-readable and contains only
|
||||
reference names.
|
||||
|
||||
### Managed credentials
|
||||
|
||||
`dnd_pipeline_secrets` defaults to `{}`. Its keys must be valid environment
|
||||
variable names, and each string value is managed as the exact named credential
|
||||
file. Omitted names are unmanaged: the role neither mirrors nor purges the
|
||||
directory. Narratio loads this conventional sibling directory before
|
||||
configuration resolution; an already-set process environment value takes
|
||||
precedence. The role adds no wrapper, service, or parallel credential loader.
|
||||
|
||||
Keep values in encrypted inventory, for example with Ansible Vault; Vault is a
|
||||
consumer workflow, not role functionality:
|
||||
|
||||
```yaml
|
||||
dnd_pipeline_secrets:
|
||||
AUDITA_LLM_API_KEY: "{{ vault_dnd_audita_llm_api_key }}"
|
||||
OPENROUTER_API_KEY: "{{ vault_dnd_openrouter_api_key }}"
|
||||
OBJECT_STORAGE_KEY_ID: "{{ vault_dnd_object_storage_key_id }}"
|
||||
OBJECT_STORAGE_KEY: "{{ vault_dnd_object_storage_key }}"
|
||||
```
|
||||
|
||||
Only the reference names enter ordinary Narratio configuration; credential
|
||||
values remain in encrypted inventory and the restricted managed secrets
|
||||
directory. A deployment using Narratio's ambient AWS SDK provider chain can
|
||||
set both `dnd_pipeline_narratio_storage_s3_access_key_id` and
|
||||
`dnd_pipeline_narratio_storage_s3_secret_access_key` to `null`. The pair must
|
||||
be omitted together.
|
||||
|
||||
Scriptorium profiles continue to own their `api_key_env` selection. To supply
|
||||
that credential through the suite, add a `dnd_pipeline_secrets` entry whose
|
||||
name matches the selected profile's `api_key_env`. Narratio's secrets bootstrap
|
||||
loads the value, and its existing Scriptorium adapter forwards only the
|
||||
profile-selected credential.
|
||||
|
||||
## Validation
|
||||
|
||||
`tests/integration` installs the pinned Git dependencies and collection into
|
||||
private temporary paths, runs syntax and production-profile lint checks, then
|
||||
applies the suite with a local syntactically valid WhisperX URL and explicit
|
||||
immutable `file://` asset inputs. It uses native application
|
||||
smoke/configuration commands, validates Notarius's imported pipeline and
|
||||
effective cache policy, and validates Narratio for both deployed campaigns and
|
||||
the testing overlay. It inspects enabled Notarius wiring through Narratio's
|
||||
native effective configuration, validates the same imported Notarius pipeline
|
||||
as a temporary existing-group-member fixture, exercises representative shared
|
||||
cache access across the service and fixture identities, and confirms that
|
||||
`nobody` can read ordinary configuration. It also composes an alternate pair of
|
||||
version-5 pipeline maps through the public interface and requires clean repeats
|
||||
for the baseline and override cases. Cleanup reapplies the asset-enabled
|
||||
baseline suite and removes only the fixture account, its named test content,
|
||||
and the driver's private temporary directory.
|
||||
|
||||
@@ -1,51 +1,28 @@
|
||||
---
|
||||
dnd_pipeline_audita_version: v2.0.1
|
||||
dnd_pipeline_narratio_version: v3.1.0
|
||||
dnd_pipeline_notarius_version: v0.8.1
|
||||
dnd_pipeline_audita_version: v4.3.0
|
||||
dnd_pipeline_narratio_version: v4.0.0
|
||||
dnd_pipeline_notarius_version: v0.10.0
|
||||
dnd_pipeline_seriatim_version: v1.5.0
|
||||
dnd_pipeline_scriptorium_version: v0.15.0
|
||||
dnd_pipeline_scriptorium_version: v0.16.0
|
||||
dnd_pipeline_manage_build_dependencies: true
|
||||
dnd_pipeline_go_snap_channel: 1.26/stable
|
||||
dnd_pipeline_go_snap_channel: 1.27/stable
|
||||
dnd_pipeline_go_binary: /snap/bin/go
|
||||
dnd_pipeline_runtime_user: narratio
|
||||
dnd_pipeline_runtime_group: narratio
|
||||
dnd_pipeline_operator_users: []
|
||||
dnd_pipeline_secrets: {}
|
||||
dnd_pipeline_config_directory_mode: "0755"
|
||||
dnd_pipeline_config_file_mode: "0644"
|
||||
dnd_pipeline_config_directory_mode: '0755'
|
||||
dnd_pipeline_config_file_mode: '0644'
|
||||
dnd_pipeline_campaigns_repository_url: https://gitea.maximumdirect.net/eric/campaigns.git
|
||||
dnd_pipeline_campaigns_revision: main
|
||||
dnd_pipeline_campaigns_revision: 488c2eb97b5c62efe51aa7af35a5ec9cb8b7a747
|
||||
dnd_pipeline_campaigns_root: /usr/local/share/narratio/campaigns
|
||||
dnd_pipeline_prompt_library_repository_url: https://gitea.maximumdirect.net/eric/narratio-prompts.git
|
||||
dnd_pipeline_prompt_library_revision: main
|
||||
dnd_pipeline_prompt_library_root: /usr/local/share/narratio/prompt-library
|
||||
dnd_pipeline_audita_pipeline_modules:
|
||||
- glossary
|
||||
- homophones
|
||||
- glossary
|
||||
- spoken_word
|
||||
- grammar
|
||||
dnd_pipeline_prompt_library_revision: 60e73a836aca48029dc1082ca1daa70749f60ca9
|
||||
dnd_pipeline_prompt_library_root: /usr/local/etc/scriptorium/prompt-library
|
||||
dnd_pipeline_audita_output_schema: audita-v1
|
||||
dnd_pipeline_audita_backends:
|
||||
dnd:
|
||||
endpoint: https://inference.ai.rakestrawhome.com/v1
|
||||
credential: AUDITA_LLM_API_KEY
|
||||
concurrency: 4
|
||||
dnd_pipeline_audita_profiles:
|
||||
dnd-proposal:
|
||||
id: dnd-proposal
|
||||
backend: dnd
|
||||
model: google/gemma-4-31b-it
|
||||
timeout_seconds: 900
|
||||
dnd-validation:
|
||||
id: dnd-validation
|
||||
backend: dnd
|
||||
model: google/gemma-4-31b-it
|
||||
timeout_seconds: 900
|
||||
dnd_pipeline_audita_llm_proposal_profile: dnd-proposal
|
||||
dnd_pipeline_audita_llm_validation_profile: dnd-validation
|
||||
dnd_pipeline_audita_llm_transient_retries: null
|
||||
dnd_pipeline_audita_llm_repair_attempts: null
|
||||
dnd_pipeline_audita_llm_operation_timeout: null
|
||||
dnd_pipeline_audita_chunking_target_sections: 8
|
||||
dnd_pipeline_audita_chunking_max_section_tokens: 6144
|
||||
@@ -54,14 +31,8 @@ dnd_pipeline_audita_normalization_max_segment_gap: 3.0
|
||||
dnd_pipeline_audita_normalization_ellipsis_gap: 3.0
|
||||
dnd_pipeline_audita_normalization_max_segment_duration: 240.0
|
||||
dnd_pipeline_audita_normalization_max_segment_tokens: 2048
|
||||
dnd_pipeline_audita_thresholds_glossary: 0.8
|
||||
dnd_pipeline_audita_thresholds_homophones: 0.8
|
||||
dnd_pipeline_audita_thresholds_spoken_word: 0.8
|
||||
dnd_pipeline_audita_thresholds_grammar: 0.8
|
||||
dnd_pipeline_audita_context_description: >-
|
||||
The following transcript was recorded during a Dungeons & Dragons game session.
|
||||
It may contain some unrelated pre-session or post-session banter, in addition
|
||||
to actual D&D gameplay.
|
||||
dnd_pipeline_audita_context_description: The following transcript was recorded during a Dungeons & Dragons game
|
||||
session. It may contain some unrelated pre-session or post-session banter, in addition to actual D&D gameplay.
|
||||
dnd_pipeline_audita_diagnostics_work_dir: /tmp/audita
|
||||
dnd_pipeline_notarius_pipelines:
|
||||
dnd-session:
|
||||
@@ -70,7 +41,6 @@ dnd_pipeline_notarius_pipelines:
|
||||
module: seriatim
|
||||
chunk:
|
||||
module: dnd/scenes
|
||||
retries: 2
|
||||
output:
|
||||
module: json
|
||||
options:
|
||||
@@ -94,7 +64,6 @@ dnd_pipeline_notarius_pipelines:
|
||||
item-registry:
|
||||
extract:
|
||||
module: dnd/item-registry
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
@@ -102,25 +71,20 @@ dnd_pipeline_notarius_pipelines:
|
||||
npc-registry:
|
||||
extract:
|
||||
module: dnd/npc-registry
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
module: dnd/npc-registry
|
||||
retries: 2
|
||||
location-registry:
|
||||
extract:
|
||||
module: dnd/location-registry
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
module: dnd/location-registry
|
||||
retries: 2
|
||||
scene-descriptions:
|
||||
extract:
|
||||
module: dnd/scene-descriptions
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
@@ -147,7 +111,6 @@ dnd_pipeline_notarius_pipelines:
|
||||
item-occurrences:
|
||||
extract:
|
||||
module: dnd/item-occurrences
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
@@ -155,7 +118,6 @@ dnd_pipeline_notarius_pipelines:
|
||||
spells:
|
||||
extract:
|
||||
module: dnd/spells
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
@@ -163,7 +125,6 @@ dnd_pipeline_notarius_pipelines:
|
||||
combat-turns:
|
||||
extract:
|
||||
module: dnd/combat-turns
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
@@ -171,7 +132,6 @@ dnd_pipeline_notarius_pipelines:
|
||||
npc-occurrences:
|
||||
extract:
|
||||
module: dnd/npc-occurrences
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
@@ -179,7 +139,6 @@ dnd_pipeline_notarius_pipelines:
|
||||
location-occurrences:
|
||||
extract:
|
||||
module: dnd/location-occurrences
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
@@ -206,18 +165,15 @@ dnd_pipeline_notarius_pipelines:
|
||||
enemy-events:
|
||||
extract:
|
||||
module: dnd/enemy-events
|
||||
retries: 2
|
||||
merge:
|
||||
module: appendorder
|
||||
normalize:
|
||||
module: dnd/enemy-events
|
||||
cache: auto
|
||||
dnd_pipeline_notarius_cache_root: /var/cache/notarius
|
||||
dnd_pipeline_notarius_cache_chunk_plans_mode: auto
|
||||
dnd_pipeline_notarius_cache_checkpoints_enabled: true
|
||||
dnd_pipeline_notarius_testing_llm_profile: gpt-luna-latest
|
||||
dnd_pipeline_notarius_promptkit_transient_retries: null
|
||||
dnd_pipeline_scriptorium_transient_retries: null
|
||||
dnd_pipeline_narratio_workspace_cleanup_after_publish: true
|
||||
dnd_pipeline_narratio_workspace_cleanup_after_publish: false
|
||||
dnd_pipeline_narratio_storage_backend: s3
|
||||
dnd_pipeline_narratio_storage_s3_bucket: rakestraw-assets
|
||||
dnd_pipeline_narratio_storage_s3_root_prefix: dnd
|
||||
@@ -226,7 +182,6 @@ dnd_pipeline_narratio_storage_s3_endpoint: https://s3.us-east-005.backblazeb2.co
|
||||
dnd_pipeline_narratio_storage_s3_force_path_style: true
|
||||
dnd_pipeline_narratio_storage_s3_access_key_id: OBJECT_STORAGE_KEY_ID
|
||||
dnd_pipeline_narratio_storage_s3_secret_access_key: OBJECT_STORAGE_KEY
|
||||
dnd_pipeline_narratio_cache_s3_audio: true
|
||||
dnd_pipeline_narratio_publish_enabled: true
|
||||
dnd_pipeline_narratio_publish_upload_run: true
|
||||
dnd_pipeline_narratio_publish_outputs:
|
||||
@@ -259,72 +214,31 @@ dnd_pipeline_narratio_notarius_credentials:
|
||||
- OPENROUTER_API_KEY
|
||||
dnd_pipeline_narratio_scriptorium_credentials:
|
||||
- OPENROUTER_API_KEY
|
||||
dnd_pipeline_narratio_notarius_resume: true
|
||||
dnd_pipeline_narratio_notarius_references:
|
||||
party: narratio.input.party
|
||||
players: narratio.input.players
|
||||
glossary: narratio.input.glossary
|
||||
glossary: narratio.input.glossary.combined
|
||||
spell_catalog: narratio.input.glossary.combined
|
||||
dnd_pipeline_narratio_notarius_outputs:
|
||||
item_registry:
|
||||
lane_id: item-registry
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.item_registry
|
||||
schema_version: v1
|
||||
module_key: dnd/item-registry
|
||||
npc_registry:
|
||||
lane_id: npc-registry
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.npc_registry
|
||||
schema_version: v1
|
||||
module_key: dnd/npc-registry
|
||||
location_registry:
|
||||
lane_id: location-registry
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.location_registry
|
||||
schema_version: v1
|
||||
module_key: dnd/location-registry
|
||||
scene_descriptions:
|
||||
lane_id: scene-descriptions
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.scene_descriptions
|
||||
schema_version: v1
|
||||
module_key: dnd/scene-descriptions
|
||||
item_occurrences:
|
||||
lane_id: item-occurrences
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.item_occurrences
|
||||
schema_version: v1
|
||||
module_key: dnd/item-occurrences
|
||||
spells:
|
||||
lane_id: spells
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.spells
|
||||
schema_version: v1
|
||||
module_key: dnd/spells
|
||||
combat_turns:
|
||||
lane_id: combat-turns
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.combat_turns
|
||||
schema_version: v1
|
||||
module_key: dnd/combat-turns
|
||||
npc_occurrences:
|
||||
lane_id: npc-occurrences
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.npc_occurrences
|
||||
schema_version: v1
|
||||
module_key: dnd/npc-occurrences
|
||||
location_occurrences:
|
||||
lane_id: location-occurrences
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.location_occurrences
|
||||
schema_version: v1
|
||||
module_key: dnd/location-occurrences
|
||||
enemy_events:
|
||||
lane_id: enemy-events
|
||||
media_type: application/json
|
||||
schema_id: notarius.dnd.enemy_events
|
||||
schema_version: v1
|
||||
module_key: dnd/enemy-events
|
||||
dnd_pipeline_narratio_render_enabled: true
|
||||
dnd_pipeline_narratio_render_format: markdown
|
||||
dnd_pipeline_narratio_session_recap_artifact:
|
||||
@@ -338,6 +252,12 @@ dnd_pipeline_narratio_session_recap_artifact:
|
||||
recap:
|
||||
source: narratio.previous_session.artifact.session_recap
|
||||
required: false
|
||||
players:
|
||||
source: narratio.input.players
|
||||
required: false
|
||||
party:
|
||||
source: narratio.input.party
|
||||
required: false
|
||||
dnd_pipeline_narratio_hostile_rumors_artifact:
|
||||
enabled: true
|
||||
prompt_id: dnd.hostile_rumors
|
||||
@@ -362,11 +282,17 @@ dnd_pipeline_narratio_scene_map_artifact:
|
||||
transcript:
|
||||
source: narratio.transcript.final_trimmed
|
||||
required: true
|
||||
players:
|
||||
source: narratio.input.players
|
||||
required: false
|
||||
party:
|
||||
source: narratio.input.party
|
||||
required: false
|
||||
dnd_pipeline_narratio_character_analysis_family:
|
||||
enabled: false
|
||||
for_each: party.characters
|
||||
prompt_id: dnd.character_meta_analysis
|
||||
output_path_pattern: artifacts/character_meta_analysis/{character_id}.md
|
||||
output_path_pattern: artifacts/character_meta_analysis_{character_id}.md
|
||||
inputs:
|
||||
transcript:
|
||||
source: narratio.transcript.final_trimmed
|
||||
@@ -374,7 +300,57 @@ dnd_pipeline_narratio_character_analysis_family:
|
||||
recap:
|
||||
source: narratio.previous_session.artifact.session_recap
|
||||
required: false
|
||||
players:
|
||||
source: narratio.input.players
|
||||
required: false
|
||||
party:
|
||||
source: narratio.input.party
|
||||
required: false
|
||||
member_vars:
|
||||
character_name: character.name
|
||||
character_class: character.class_summary
|
||||
dnd_pipeline_narratio_testing_scriptorium_profile: gemini-flash-latest
|
||||
dnd_pipeline_audita_pipeline_stages:
|
||||
- module: glossary
|
||||
- module: homophones
|
||||
- module: glossary
|
||||
- module: spoken_word
|
||||
- module: grammar
|
||||
dnd_pipeline_audita_promptkit_backends:
|
||||
- id: dnd
|
||||
endpoint: https://inference.ai.rakestrawhome.com/v1
|
||||
api_key_env: AUDITA_LLM_API_KEY
|
||||
concurrency_limit: 4
|
||||
dnd_pipeline_audita_promptkit_profiles:
|
||||
- id: dnd-proposal
|
||||
backend: dnd
|
||||
model: google/gemma-4-31b-it
|
||||
timeout_seconds: 900
|
||||
- id: dnd-validation
|
||||
backend: dnd
|
||||
model: google/gemma-4-31b-it
|
||||
timeout_seconds: 900
|
||||
dnd_pipeline_audita_glossary_collections:
|
||||
party:
|
||||
entries: []
|
||||
campaign:
|
||||
entries: []
|
||||
setting:
|
||||
entries: []
|
||||
spells:
|
||||
entries: []
|
||||
dnd_pipeline_audita_glossaries:
|
||||
- party
|
||||
- campaign
|
||||
- setting
|
||||
- spells
|
||||
dnd_pipeline_audita_protected_terms: null
|
||||
dnd_pipeline_audita_llm_correction_repair_profile: null
|
||||
dnd_pipeline_audita_llm_correction_repair_attempts: null
|
||||
dnd_pipeline_notarius_promptkit_backends: null
|
||||
dnd_pipeline_notarius_promptkit_profiles: null
|
||||
dnd_pipeline_notarius_promptkit_collections: null
|
||||
dnd_pipeline_scriptorium_promptkit_backends: null
|
||||
dnd_pipeline_scriptorium_promptkit_profiles: null
|
||||
dnd_pipeline_scriptorium_promptkit_collections: null
|
||||
dnd_pipeline_narratio_notarius_cache: null
|
||||
|
||||
@@ -88,23 +88,10 @@ argument_specs:
|
||||
type: path
|
||||
required: true
|
||||
description: Prompt-library checkout root.
|
||||
dnd_pipeline_audita_pipeline_modules:
|
||||
type: list
|
||||
elements: str
|
||||
required: true
|
||||
description: Ordered Audita processing modules.
|
||||
dnd_pipeline_audita_output_schema:
|
||||
type: str
|
||||
required: true
|
||||
description: Audita output schema shared with Narratio.
|
||||
dnd_pipeline_audita_backends:
|
||||
type: dict
|
||||
required: true
|
||||
description: Native Audita backend definitions.
|
||||
dnd_pipeline_audita_profiles:
|
||||
type: dict
|
||||
required: true
|
||||
description: Native Audita profiles keyed by filename-safe IDs matching each mapping's id.
|
||||
dnd_pipeline_audita_llm_proposal_profile:
|
||||
type: str
|
||||
required: true
|
||||
@@ -117,10 +104,6 @@ argument_specs:
|
||||
type: int
|
||||
required: false
|
||||
description: Optional Audita transient retry override.
|
||||
dnd_pipeline_audita_llm_repair_attempts:
|
||||
type: int
|
||||
required: false
|
||||
description: Optional Audita repair attempt override.
|
||||
dnd_pipeline_audita_llm_operation_timeout:
|
||||
type: str
|
||||
required: false
|
||||
@@ -153,22 +136,6 @@ argument_specs:
|
||||
type: int
|
||||
required: true
|
||||
description: Audita maximum segment tokens.
|
||||
dnd_pipeline_audita_thresholds_glossary:
|
||||
type: float
|
||||
required: true
|
||||
description: Audita glossary confidence threshold.
|
||||
dnd_pipeline_audita_thresholds_homophones:
|
||||
type: float
|
||||
required: true
|
||||
description: Audita homophone confidence threshold.
|
||||
dnd_pipeline_audita_thresholds_spoken_word:
|
||||
type: float
|
||||
required: true
|
||||
description: Audita spoken-word confidence threshold.
|
||||
dnd_pipeline_audita_thresholds_grammar:
|
||||
type: float
|
||||
required: true
|
||||
description: Audita grammar confidence threshold.
|
||||
dnd_pipeline_audita_context_description:
|
||||
type: str
|
||||
required: true
|
||||
@@ -185,22 +152,10 @@ argument_specs:
|
||||
type: path
|
||||
required: true
|
||||
description: Shared root for Notarius cache state.
|
||||
dnd_pipeline_notarius_cache_chunk_plans_mode:
|
||||
type: str
|
||||
required: true
|
||||
description: Notarius chunk-plan cache policy.
|
||||
dnd_pipeline_notarius_cache_checkpoints_enabled:
|
||||
type: bool
|
||||
required: true
|
||||
description: Whether Notarius records checkpoints.
|
||||
dnd_pipeline_notarius_testing_llm_profile:
|
||||
type: str
|
||||
required: true
|
||||
description: Notarius LLM profile selected by the testing overlay.
|
||||
dnd_pipeline_notarius_promptkit_transient_retries:
|
||||
type: int
|
||||
required: false
|
||||
description: Optional Notarius PromptKit transient retry override.
|
||||
dnd_pipeline_scriptorium_transient_retries:
|
||||
type: int
|
||||
required: false
|
||||
@@ -241,10 +196,6 @@ argument_specs:
|
||||
type: str
|
||||
required: false
|
||||
description: Nullable secret-key environment-variable reference.
|
||||
dnd_pipeline_narratio_cache_s3_audio:
|
||||
type: bool
|
||||
required: true
|
||||
description: Whether Narratio caches downloaded S3 audio.
|
||||
dnd_pipeline_narratio_publish_enabled:
|
||||
type: bool
|
||||
required: true
|
||||
@@ -308,10 +259,6 @@ argument_specs:
|
||||
elements: str
|
||||
required: false
|
||||
description: Optional credential names forwarded by Narratio to Scriptorium.
|
||||
dnd_pipeline_narratio_notarius_resume:
|
||||
type: bool
|
||||
required: true
|
||||
description: Whether ordinary Narratio extraction requests Notarius checkpoint reuse.
|
||||
dnd_pipeline_narratio_notarius_references:
|
||||
type: dict
|
||||
required: true
|
||||
@@ -352,3 +299,72 @@ argument_specs:
|
||||
type: str
|
||||
required: true
|
||||
description: Scriptorium profile selected by the testing overlay.
|
||||
dnd_pipeline_audita_pipeline_stages:
|
||||
type: list
|
||||
elements: dict
|
||||
required: true
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_audita_promptkit_backends:
|
||||
type: list
|
||||
elements: dict
|
||||
required: true
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_audita_promptkit_profiles:
|
||||
type: list
|
||||
elements: dict
|
||||
required: true
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_audita_glossary_collections:
|
||||
type: dict
|
||||
required: true
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_audita_glossaries:
|
||||
type: list
|
||||
elements: str
|
||||
required: true
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_audita_protected_terms:
|
||||
type: list
|
||||
elements: str
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_audita_llm_correction_repair_profile:
|
||||
type: str
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_audita_llm_correction_repair_attempts:
|
||||
type: int
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_notarius_promptkit_backends:
|
||||
type: list
|
||||
elements: dict
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_notarius_promptkit_profiles:
|
||||
type: list
|
||||
elements: dict
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_notarius_promptkit_collections:
|
||||
type: dict
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_scriptorium_promptkit_backends:
|
||||
type: list
|
||||
elements: dict
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_scriptorium_promptkit_profiles:
|
||||
type: list
|
||||
elements: dict
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_scriptorium_promptkit_collections:
|
||||
type: dict
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
dnd_pipeline_narratio_notarius_cache:
|
||||
type: str
|
||||
required: false
|
||||
description: Native suite configuration input.
|
||||
|
||||
@@ -25,20 +25,27 @@ dependencies:
|
||||
narratio_go_binary: "{{ dnd_pipeline_go_binary }}"
|
||||
narratio_user: "{{ dnd_pipeline_runtime_user }}"
|
||||
narratio_group: "{{ dnd_pipeline_runtime_group }}"
|
||||
narratio_config_path: /usr/local/etc/narratio/pipeline.yml
|
||||
narratio_config_path: /usr/local/etc/narratio/narratio.yml
|
||||
narratio_config_owner: "{{ dnd_pipeline_runtime_user }}"
|
||||
narratio_config_group: "{{ dnd_pipeline_runtime_group }}"
|
||||
narratio_config_directory_mode: "{{ dnd_pipeline_config_directory_mode }}"
|
||||
narratio_config_file_mode: "{{ dnd_pipeline_config_file_mode }}"
|
||||
narratio_whisperx_transcribe_url: "{{ dnd_pipeline_whisperx_transcribe_url }}"
|
||||
narratio_campaigns_root: "{{ dnd_pipeline_campaigns_root }}"
|
||||
narratio_configkit_imports:
|
||||
narratio_config_imports:
|
||||
- path: conf.d/processing.yml
|
||||
required: true
|
||||
- path: artifacts/session-recap.yml
|
||||
required: true
|
||||
- path: artifacts/hostile-rumors.yml
|
||||
required: true
|
||||
- path: artifacts/deranged-rumors.yml
|
||||
required: true
|
||||
- path: artifacts/scene-map.yml
|
||||
required: true
|
||||
- path: artifact-families/character-meta-analysis.yml
|
||||
required: true
|
||||
narratio_config_secrets_dir: secrets
|
||||
narratio_workspace_cleanup_after_publish: "{{ dnd_pipeline_narratio_workspace_cleanup_after_publish }}"
|
||||
narratio_storage_backend: "{{ dnd_pipeline_narratio_storage_backend }}"
|
||||
narratio_storage_s3_bucket: "{{ dnd_pipeline_narratio_storage_s3_bucket }}"
|
||||
@@ -48,7 +55,6 @@ dependencies:
|
||||
narratio_storage_s3_force_path_style: "{{ dnd_pipeline_narratio_storage_s3_force_path_style }}"
|
||||
narratio_storage_s3_access_key_id: "{{ dnd_pipeline_narratio_storage_s3_access_key_id }}"
|
||||
narratio_storage_s3_secret_access_key: "{{ dnd_pipeline_narratio_storage_s3_secret_access_key }}"
|
||||
narratio_cache_s3_audio: "{{ dnd_pipeline_narratio_cache_s3_audio }}"
|
||||
narratio_publish_enabled: "{{ dnd_pipeline_narratio_publish_enabled }}"
|
||||
narratio_publish_upload_run: "{{ dnd_pipeline_narratio_publish_upload_run }}"
|
||||
narratio_publish_outputs: "{{ dnd_pipeline_narratio_publish_outputs }}"
|
||||
@@ -62,7 +68,7 @@ dependencies:
|
||||
narratio_notarius_pipeline_id: "{{ dnd_pipeline_narratio_notarius_pipeline_id }}"
|
||||
narratio_notarius_working_directory: /usr/local/etc/notarius
|
||||
narratio_notarius_credentials: "{{ dnd_pipeline_narratio_notarius_credentials }}"
|
||||
narratio_notarius_resume: "{{ dnd_pipeline_narratio_notarius_resume }}"
|
||||
narratio_notarius_cache: "{{ dnd_pipeline_narratio_notarius_cache }}"
|
||||
narratio_notarius_references: "{{ dnd_pipeline_narratio_notarius_references }}"
|
||||
narratio_notarius_outputs: "{{ dnd_pipeline_narratio_notarius_outputs }}"
|
||||
narratio_scriptorium_binary: /usr/local/bin/scriptorium
|
||||
@@ -84,14 +90,18 @@ dependencies:
|
||||
audita_config_group: "{{ dnd_pipeline_runtime_group }}"
|
||||
audita_config_directory_mode: "{{ dnd_pipeline_config_directory_mode }}"
|
||||
audita_config_file_mode: "{{ dnd_pipeline_config_file_mode }}"
|
||||
audita_pipeline_modules: "{{ dnd_pipeline_audita_pipeline_modules }}"
|
||||
audita_pipeline_stages: "{{ dnd_pipeline_audita_pipeline_stages }}"
|
||||
audita_promptkit_backends: "{{ dnd_pipeline_audita_promptkit_backends }}"
|
||||
audita_promptkit_profiles: "{{ dnd_pipeline_audita_promptkit_profiles }}"
|
||||
audita_glossary_collections: "{{ dnd_pipeline_audita_glossary_collections }}"
|
||||
audita_glossaries: "{{ dnd_pipeline_audita_glossaries }}"
|
||||
audita_protected_terms: "{{ dnd_pipeline_audita_protected_terms }}"
|
||||
audita_llm_correction_repair_profile: "{{ dnd_pipeline_audita_llm_correction_repair_profile }}"
|
||||
audita_llm_correction_repair_attempts: "{{ dnd_pipeline_audita_llm_correction_repair_attempts }}"
|
||||
audita_output_schema: "{{ dnd_pipeline_audita_output_schema }}"
|
||||
audita_backends: "{{ dnd_pipeline_audita_backends }}"
|
||||
audita_profiles_dir: /usr/local/etc/audita/profiles
|
||||
audita_llm_proposal_profile: "{{ dnd_pipeline_audita_llm_proposal_profile }}"
|
||||
audita_llm_validation_profile: "{{ dnd_pipeline_audita_llm_validation_profile }}"
|
||||
audita_llm_transient_retries: "{{ dnd_pipeline_audita_llm_transient_retries }}"
|
||||
audita_llm_repair_attempts: "{{ dnd_pipeline_audita_llm_repair_attempts }}"
|
||||
audita_llm_operation_timeout: "{{ dnd_pipeline_audita_llm_operation_timeout }}"
|
||||
audita_chunking_target_sections: "{{ dnd_pipeline_audita_chunking_target_sections }}"
|
||||
audita_chunking_max_section_tokens: "{{ dnd_pipeline_audita_chunking_max_section_tokens }}"
|
||||
@@ -100,10 +110,6 @@ dependencies:
|
||||
audita_normalization_ellipsis_gap: "{{ dnd_pipeline_audita_normalization_ellipsis_gap }}"
|
||||
audita_normalization_max_segment_duration: "{{ dnd_pipeline_audita_normalization_max_segment_duration }}"
|
||||
audita_normalization_max_segment_tokens: "{{ dnd_pipeline_audita_normalization_max_segment_tokens }}"
|
||||
audita_thresholds_glossary: "{{ dnd_pipeline_audita_thresholds_glossary }}"
|
||||
audita_thresholds_homophones: "{{ dnd_pipeline_audita_thresholds_homophones }}"
|
||||
audita_thresholds_spoken_word: "{{ dnd_pipeline_audita_thresholds_spoken_word }}"
|
||||
audita_thresholds_grammar: "{{ dnd_pipeline_audita_thresholds_grammar }}"
|
||||
audita_context_description: "{{ dnd_pipeline_audita_context_description }}"
|
||||
audita_diagnostics_work_dir: "{{ dnd_pipeline_audita_diagnostics_work_dir }}"
|
||||
- role: rakestraw.notarius
|
||||
@@ -116,13 +122,13 @@ dependencies:
|
||||
notarius_config_group: "{{ dnd_pipeline_runtime_group }}"
|
||||
notarius_config_directory_mode: "{{ dnd_pipeline_config_directory_mode }}"
|
||||
notarius_config_file_mode: "{{ dnd_pipeline_config_file_mode }}"
|
||||
notarius_configkit_imports:
|
||||
notarius_config_imports:
|
||||
- path: pipelines/dnd-session.yml
|
||||
notarius_cache_chunk_plans_mode: "{{ dnd_pipeline_notarius_cache_chunk_plans_mode }}"
|
||||
notarius_cache_chunk_plans_directory: "{{ dnd_pipeline_notarius_cache_root ~ '/chunk-plans' }}"
|
||||
notarius_cache_checkpoints_enabled: "{{ dnd_pipeline_notarius_cache_checkpoints_enabled }}"
|
||||
notarius_cache_checkpoints_directory: "{{ dnd_pipeline_notarius_cache_root ~ '/checkpoints' }}"
|
||||
notarius_promptkit_transient_retries: "{{ dnd_pipeline_notarius_promptkit_transient_retries }}"
|
||||
required: true
|
||||
notarius_cache_directory: "{{ dnd_pipeline_notarius_cache_root }}"
|
||||
notarius_promptkit_backends: "{{ dnd_pipeline_notarius_promptkit_backends }}"
|
||||
notarius_promptkit_profiles: "{{ dnd_pipeline_notarius_promptkit_profiles }}"
|
||||
notarius_promptkit_collections: "{{ dnd_pipeline_notarius_promptkit_collections }}"
|
||||
- role: rakestraw.scriptorium
|
||||
vars:
|
||||
scriptorium_version: "{{ dnd_pipeline_scriptorium_version }}"
|
||||
@@ -133,6 +139,11 @@ dependencies:
|
||||
scriptorium_config_group: "{{ dnd_pipeline_runtime_group }}"
|
||||
scriptorium_config_directory_mode: "{{ dnd_pipeline_config_directory_mode }}"
|
||||
scriptorium_config_file_mode: "{{ dnd_pipeline_config_file_mode }}"
|
||||
scriptorium_prompt_dir: "{{ dnd_pipeline_prompt_library_root ~ '/prompts' }}"
|
||||
scriptorium_schema_dir: "{{ dnd_pipeline_prompt_library_root ~ '/schemas' }}"
|
||||
scriptorium_config_imports:
|
||||
- path: "{{ (dnd_pipeline_prompt_library_root ~ '/promptkit.yml') | relpath('/usr/local/etc/scriptorium') }}"
|
||||
destination: [promptkit]
|
||||
required: true
|
||||
scriptorium_promptkit_backends: "{{ dnd_pipeline_scriptorium_promptkit_backends }}"
|
||||
scriptorium_promptkit_profiles: "{{ dnd_pipeline_scriptorium_promptkit_profiles }}"
|
||||
scriptorium_promptkit_collections: "{{ dnd_pipeline_scriptorium_promptkit_collections }}"
|
||||
scriptorium_transient_retries: "{{ dnd_pipeline_scriptorium_transient_retries }}"
|
||||
|
||||
@@ -7,16 +7,16 @@ roles:
|
||||
- name: rakestraw.audita
|
||||
src: https://gitea.maximumdirect.net/eric/ansible-role-audita.git
|
||||
scm: git
|
||||
version: c3dd59f5ac9b942306ffe540ae9e71d493998137
|
||||
version: b818f6067789d7fdd09a8a4a54134452089811c8
|
||||
- name: rakestraw.notarius
|
||||
src: https://gitea.maximumdirect.net/eric/ansible-role-notarius.git
|
||||
scm: git
|
||||
version: 6aef48b7e12e3651971444b8c224d96ff1879e6c
|
||||
version: 85cd3a397f63342df8309aa4f36d9900ff610e41
|
||||
- name: rakestraw.scriptorium
|
||||
src: https://gitea.maximumdirect.net/eric/ansible-role-scriptorium.git
|
||||
scm: git
|
||||
version: b174c8c2990bb79f8149d8f288c5e06ccb42bd73
|
||||
version: e936d5200df675feeb53be235a175b608c0afc7c
|
||||
- name: rakestraw.narratio
|
||||
src: https://gitea.maximumdirect.net/eric/ansible-role-narratio.git
|
||||
scm: git
|
||||
version: 758aed7a74c9a64ad02e13ff551b4f7aea16b3af
|
||||
version: 2a4e82c734a256a02281dbb6e63b348a7171f808
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
state: present
|
||||
loop: >-
|
||||
{{
|
||||
['/var/lib/narratio', '/var/spool/narratio', '/var/cache/narratio', dnd_pipeline_notarius_cache_root] |
|
||||
['/var/lib/narratio', dnd_pipeline_notarius_cache_root] |
|
||||
product([
|
||||
{'etype': 'user', 'permissions': 'rwx'},
|
||||
{'etype': 'group', 'permissions': 'rwx'},
|
||||
@@ -94,7 +94,7 @@
|
||||
state: present
|
||||
loop: >-
|
||||
{{
|
||||
['/var/lib/narratio', '/var/spool/narratio', '/var/cache/narratio', dnd_pipeline_notarius_cache_root] |
|
||||
['/var/lib/narratio', dnd_pipeline_notarius_cache_root] |
|
||||
product([
|
||||
{'etype': 'user', 'permissions': 'rwx'},
|
||||
{'etype': 'group', 'permissions': 'rwx'},
|
||||
@@ -158,25 +158,6 @@
|
||||
- pipelines
|
||||
- overlays
|
||||
|
||||
- name: Create the Audita profile directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: /usr/local/etc/audita/profiles
|
||||
state: directory
|
||||
owner: "{{ dnd_pipeline_runtime_user }}"
|
||||
group: "{{ dnd_pipeline_runtime_group }}"
|
||||
mode: "{{ dnd_pipeline_config_directory_mode }}"
|
||||
|
||||
- name: Deploy Audita profiles
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: audita-profile.yml.j2
|
||||
dest: "/usr/local/etc/audita/profiles/{{ item.key }}.yml"
|
||||
owner: "{{ dnd_pipeline_runtime_user }}"
|
||||
group: "{{ dnd_pipeline_runtime_group }}"
|
||||
mode: "{{ dnd_pipeline_config_file_mode }}"
|
||||
loop: "{{ dnd_pipeline_audita_profiles | dict2items }}"
|
||||
|
||||
- name: Deploy the Notarius D&D pipeline configuration
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{{ item.value | to_nice_yaml }}
|
||||
@@ -1,3 +1,6 @@
|
||||
trim:
|
||||
bounds:
|
||||
profile_id: {{ dnd_pipeline_narratio_testing_scriptorium_profile | to_json }}
|
||||
notarius:
|
||||
config_overlay: testing
|
||||
scriptorium:
|
||||
|
||||
BIN
tests/__pycache__/verify.cpython-314.pyc
Normal file
BIN
tests/__pycache__/verify.cpython-314.pyc
Normal file
Binary file not shown.
@@ -1,391 +1,125 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repository_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
workspace_venv="$repository_root/../.venv"
|
||||
test_tmp=$(mktemp -d)
|
||||
chmod 0700 "$test_tmp"
|
||||
|
||||
export ANSIBLE_COLLECTIONS_PATH="$test_tmp/collections"
|
||||
export ANSIBLE_ROLES_PATH="$test_tmp/roles:$(dirname "$repository_root")"
|
||||
|
||||
export ANSIBLE_PIPELINING=true
|
||||
export ANSIBLE_REMOTE_TMP=/tmp
|
||||
inventory="$repository_root/tests/inventory"
|
||||
converge="$repository_root/tests/converge.yml"
|
||||
ansible_playbook="$workspace_venv/bin/ansible-playbook"
|
||||
profile_dir="$test_tmp/profiles"
|
||||
campaigns_repository=$(cd "$repository_root/../assets/campaigns" && pwd)
|
||||
prompt_library_repository=$(cd "$repository_root/../assets/narratio-prompts" && pwd)
|
||||
prompt_library_root=/usr/local/share/narratio/prompt-library
|
||||
campaigns_revision=$(git -C "$campaigns_repository" rev-parse HEAD)
|
||||
prompt_library_revision=$(git -C "$prompt_library_repository" rev-parse HEAD)
|
||||
operator_user="dnd_f0009_${$}"
|
||||
shared_fixture_root="/var/cache/notarius/${operator_user}"
|
||||
service_fixture_file="$shared_fixture_root/service.txt"
|
||||
operator_fixture_file="$shared_fixture_root/operator.txt"
|
||||
synthetic_audita_api_key='audita-pipeline-synthetic-value'
|
||||
synthetic_notarius_api_key='notarius-pipeline-synthetic-value'
|
||||
synthetic_object_storage_key_id='object-storage-key-id-pipeline-synthetic-value'
|
||||
synthetic_object_storage_key='object-storage-key-pipeline-synthetic-value'
|
||||
baseline_args=(
|
||||
-e 'dnd_pipeline_whisperx_transcribe_url=http://127.0.0.1:8000/transcribe'
|
||||
-e "dnd_pipeline_campaigns_repository_url=file://$campaigns_repository"
|
||||
-e "dnd_pipeline_campaigns_revision=$campaigns_revision"
|
||||
-e "dnd_pipeline_prompt_library_repository_url=file://$prompt_library_repository"
|
||||
-e "dnd_pipeline_prompt_library_revision=$prompt_library_revision"
|
||||
-e "dnd_pipeline_prompt_library_root=$prompt_library_root"
|
||||
-e "{\"dnd_pipeline_operator_users\":[\"$operator_user\"]}"
|
||||
-e "{\"dnd_pipeline_secrets\":{\"AUDITA_LLM_API_KEY\":\"$synthetic_audita_api_key\",\"OPENROUTER_API_KEY\":\"$synthetic_notarius_api_key\",\"OBJECT_STORAGE_KEY_ID\":\"$synthetic_object_storage_key_id\",\"OBJECT_STORAGE_KEY\":\"$synthetic_object_storage_key\"}}"
|
||||
-e 'dnd_pipeline_narratio_storage_backend=s3'
|
||||
-e 'dnd_pipeline_narratio_storage_s3_bucket=dnd-pipeline-fixture'
|
||||
-e 'dnd_pipeline_narratio_storage_s3_root_prefix=fixture/dnd'
|
||||
-e 'dnd_pipeline_narratio_storage_s3_region=fixture-1'
|
||||
-e 'dnd_pipeline_narratio_storage_s3_endpoint=https://storage.fixture.invalid'
|
||||
-e 'dnd_pipeline_narratio_storage_s3_access_key_id=OBJECT_STORAGE_KEY_ID'
|
||||
-e 'dnd_pipeline_narratio_storage_s3_secret_access_key=OBJECT_STORAGE_KEY'
|
||||
-e '{"dnd_pipeline_narratio_workspace_cleanup_after_publish":false,"dnd_pipeline_narratio_storage_s3_force_path_style":false,"dnd_pipeline_narratio_cache_s3_audio":false,"dnd_pipeline_narratio_publish_enabled":true,"dnd_pipeline_narratio_publish_upload_run":true}'
|
||||
-e '{"dnd_pipeline_narratio_publish_outputs":[{"source":"narratio.transcript.final","required":true},{"source":"narratio.artifact.session_recap","required":true}]}'
|
||||
-e 'dnd_pipeline_narratio_testing_scriptorium_profile=endpoint-profile'
|
||||
-e 'dnd_pipeline_notarius_testing_llm_profile=gpt-terra-latest'
|
||||
-e '{"dnd_pipeline_audita_llm_transient_retries":null,"dnd_pipeline_audita_llm_repair_attempts":null,"dnd_pipeline_audita_llm_operation_timeout":null,"dnd_pipeline_notarius_promptkit_transient_retries":null,"dnd_pipeline_scriptorium_transient_retries":null}'
|
||||
)
|
||||
|
||||
prompt_repository=$(cd "$repository_root/../assets/narratio-prompts" && pwd)
|
||||
operator_user="dnd_test_${$}"
|
||||
shared_fixture_root="/var/cache/notarius/$operator_user"
|
||||
cleanup() {
|
||||
exit_status=$?
|
||||
trap - EXIT
|
||||
/usr/bin/sudo /bin/rm -rf -- "$shared_fixture_root" || true
|
||||
"$ansible_playbook" -i "$inventory" "${baseline_args[@]}" "$converge" >/dev/null 2>&1 || true
|
||||
/usr/bin/sudo /usr/sbin/userdel --remove "$operator_user" 2>/dev/null || true
|
||||
sudo rm -rf -- "$shared_fixture_root" || true
|
||||
sudo userdel --remove "$operator_user" 2>/dev/null || true
|
||||
rm -rf -- "$test_tmp"
|
||||
exit "$exit_status"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
require_clean_recap() {
|
||||
grep -Eq 'changed=0 .*failed=0' "$1"
|
||||
}
|
||||
|
||||
require_clean_recap() { grep -Eq 'changed=0 .*failed=0' "$1"; }
|
||||
run_converge() {
|
||||
output_file=$1
|
||||
local output_file=$1
|
||||
shift
|
||||
env -u AUDITA_LLM_API_KEY -u OPENROUTER_API_KEY \
|
||||
-u OBJECT_STORAGE_KEY_ID -u OBJECT_STORAGE_KEY \
|
||||
"$ansible_playbook" -i "$inventory" "$@" "$converge" | tee "$output_file"
|
||||
env -u AUDITA_LLM_API_KEY -u OPENROUTER_API_KEY -u OBJECT_STORAGE_KEY_ID -u OBJECT_STORAGE_KEY \
|
||||
"$ansible_playbook" -i "$inventory" -e "@$test_tmp/base.json" "$@" "$converge" | tee "$output_file"
|
||||
}
|
||||
repeat_case() {
|
||||
local case_name=$1
|
||||
shift
|
||||
run_converge "$test_tmp/$case_name.log" "$@"
|
||||
run_converge "$test_tmp/$case_name-repeat.log" "$@"
|
||||
require_clean_recap "$test_tmp/$case_name-repeat.log"
|
||||
}
|
||||
|
||||
cd "$repository_root"
|
||||
mkdir -p "$profile_dir"
|
||||
printf '%s\n' \
|
||||
'id: endpoint-profile' \
|
||||
'endpoint: http://127.0.0.1:8000/v1' \
|
||||
'model: offline-fixture' > "$profile_dir/endpoint-profile.yml"
|
||||
"$workspace_venv/bin/ansible-galaxy" collection install \
|
||||
-r collections/requirements.yml \
|
||||
-p "$ANSIBLE_COLLECTIONS_PATH"
|
||||
"$workspace_venv/bin/ansible-galaxy" role install \
|
||||
-r requirements.yml \
|
||||
-p "$test_tmp/roles"
|
||||
"$workspace_venv/bin/python" - "$test_tmp/base.json" "$campaigns_repository" "$prompt_repository" "$operator_user" <<'PY'
|
||||
import json,sys
|
||||
config={
|
||||
'dnd_pipeline_whisperx_transcribe_url':'http://127.0.0.1:8000/transcribe',
|
||||
'dnd_pipeline_campaigns_repository_url':'file://'+sys.argv[2],
|
||||
'dnd_pipeline_campaigns_revision':'488c2eb97b5c62efe51aa7af35a5ec9cb8b7a747',
|
||||
'dnd_pipeline_prompt_library_repository_url':'file://'+sys.argv[3],
|
||||
'dnd_pipeline_prompt_library_revision':'60e73a836aca48029dc1082ca1daa70749f60ca9',
|
||||
'dnd_pipeline_operator_users':[sys.argv[4]],
|
||||
'dnd_pipeline_secrets':{'AUDITA_LLM_API_KEY':'synthetic-audita','OPENROUTER_API_KEY':'synthetic-openrouter','OBJECT_STORAGE_KEY_ID':'synthetic-storage-id','OBJECT_STORAGE_KEY':'synthetic-storage-key'},
|
||||
'dnd_pipeline_narratio_storage_s3_bucket':'fixture-bucket',
|
||||
'dnd_pipeline_narratio_storage_s3_endpoint':'https://storage.fixture.invalid',
|
||||
'dnd_pipeline_narratio_storage_s3_force_path_style':False,
|
||||
'dnd_pipeline_narratio_workspace_cleanup_after_publish':False,
|
||||
'dnd_pipeline_narratio_publish_outputs':[{'source':'narratio.transcript.final','required':True},{'source':'narratio.artifact.session_recap','required':True}],
|
||||
'dnd_pipeline_narratio_notarius_references':{'party':'narratio.input.party','glossary':'narratio.input.glossary.combined','spell_catalog':'narratio.input.glossary.combined'},
|
||||
'dnd_pipeline_narratio_notarius_outputs':{'enemy_events':{'lane_id':'enemy-events'},'spells':{'lane_id':'spells'}},
|
||||
'dnd_pipeline_narratio_testing_scriptorium_profile':'fixture-test',
|
||||
'dnd_pipeline_notarius_testing_llm_profile':'gpt-luna-latest',
|
||||
'dnd_pipeline_scriptorium_promptkit_profiles':[{'id':'fixture-test','endpoint':'http://127.0.0.1:8000/v1','model':'fixture/model'}],
|
||||
}
|
||||
with open(sys.argv[1],'w',encoding='utf-8') as f: json.dump(config,f)
|
||||
PY
|
||||
"$workspace_venv/bin/ansible-galaxy" collection install -r collections/requirements.yml -p "$ANSIBLE_COLLECTIONS_PATH"
|
||||
"$workspace_venv/bin/ansible-galaxy" role install -r requirements.yml -p "$test_tmp/roles"
|
||||
"$ansible_playbook" -i "$inventory" --syntax-check "$converge"
|
||||
"$workspace_venv/bin/ansible-lint" --offline --profile production "$converge"
|
||||
/usr/bin/sudo /usr/sbin/useradd --create-home --shell /usr/sbin/nologin "$operator_user"
|
||||
|
||||
baseline_log="$test_tmp/baseline.log"
|
||||
run_converge "$baseline_log" "${baseline_args[@]}"
|
||||
/usr/local/bin/seriatim --version
|
||||
AUDITA_LLM_API_KEY="$synthetic_audita_api_key" \
|
||||
/usr/local/bin/audita config validate --config /usr/local/etc/audita/config.yml
|
||||
"$workspace_venv/bin/python" - <<'PY'
|
||||
import yaml
|
||||
|
||||
with open("/usr/local/etc/audita/config.yml", encoding="utf-8") as config_file:
|
||||
audita = yaml.safe_load(config_file)
|
||||
with open("/usr/local/etc/notarius/config.yml", encoding="utf-8") as config_file:
|
||||
notarius = yaml.safe_load(config_file)
|
||||
with open("/usr/local/etc/scriptorium/config.yml", encoding="utf-8") as config_file:
|
||||
scriptorium = yaml.safe_load(config_file)
|
||||
|
||||
assert "transient_retries" not in audita["llm"]
|
||||
assert "repair_attempts" not in audita["llm"]
|
||||
assert "operation_timeout" not in audita["llm"]
|
||||
assert "transient_retries" not in notarius.get("promptkit", {})
|
||||
assert "transient_retries" not in scriptorium
|
||||
PY
|
||||
/usr/local/bin/notarius config validate --config /usr/local/etc/notarius/config.yml \
|
||||
--pipeline dnd-session
|
||||
/usr/local/bin/notarius config validate --config /usr/local/etc/notarius/config.yml \
|
||||
--config-overlay testing --pipeline dnd-session
|
||||
notarius_effective_config="$test_tmp/notarius-effective.yml"
|
||||
/usr/local/bin/notarius config effective --config /usr/local/etc/notarius/config.yml \
|
||||
> "$notarius_effective_config"
|
||||
notarius_testing_effective_config="$test_tmp/notarius-testing-effective.yml"
|
||||
/usr/local/bin/notarius config effective --config /usr/local/etc/notarius/config.yml \
|
||||
--config-overlay testing > "$notarius_testing_effective_config"
|
||||
grep -Fq 'mode: auto' "$notarius_effective_config"
|
||||
grep -Fq 'step: describe-session' "$notarius_effective_config"
|
||||
sudo useradd --create-home --shell /usr/sbin/nologin "$operator_user"
|
||||
repeat_case composed
|
||||
/usr/local/bin/audita config validate --config /usr/local/etc/audita/config.yml
|
||||
/usr/local/bin/notarius config validate --config /usr/local/etc/notarius/config.yml
|
||||
/usr/local/bin/notarius config validate --config /usr/local/etc/notarius/config.yml --overlay testing
|
||||
/usr/local/bin/notarius pipeline validate dnd-session --config /usr/local/etc/notarius/config.yml
|
||||
/usr/local/bin/notarius pipeline validate dnd-session --config /usr/local/etc/notarius/config.yml --overlay testing
|
||||
/usr/local/bin/scriptorium config validate --config /usr/local/etc/scriptorium/config.yml
|
||||
/usr/local/bin/scriptorium inspect profile --config /usr/local/etc/scriptorium/config.yml \
|
||||
--profile-dir "$profile_dir" --profile endpoint-profile
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config validate \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config validate \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign dilfs
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config validate \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs --overlay testing
|
||||
narratio_effective_config="$test_tmp/narratio-effective.yml"
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config show \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs \
|
||||
> "$narratio_effective_config"
|
||||
narratio_testing_effective_config="$test_tmp/narratio-testing-effective.yml"
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config show \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs --overlay testing \
|
||||
> "$narratio_testing_effective_config"
|
||||
grep -Fq 'enabled: true' "$narratio_effective_config"
|
||||
grep -Fq 'pipeline_id: dnd-session' "$narratio_effective_config"
|
||||
grep -Fq 'resume: true' "$narratio_effective_config"
|
||||
! grep -Fq 'chunk_cache:' "$narratio_effective_config"
|
||||
grep -Fq 'party: narratio.input.party' "$narratio_effective_config"
|
||||
grep -Fq 'lane_id: item-registry' "$narratio_effective_config"
|
||||
"$workspace_venv/bin/python" - \
|
||||
"$narratio_effective_config" "$narratio_testing_effective_config" <<'PY'
|
||||
import sys
|
||||
|
||||
import yaml
|
||||
|
||||
with open(sys.argv[1], encoding="utf-8") as config_file:
|
||||
config = yaml.safe_load(config_file)
|
||||
with open(sys.argv[2], encoding="utf-8") as config_file:
|
||||
testing_config = yaml.safe_load(config_file)
|
||||
|
||||
assert config["workspace"]["cleanup_after_publish"] is False
|
||||
assert config["storage"] == {
|
||||
"backend": "s3",
|
||||
"s3": {
|
||||
"bucket": "dnd-pipeline-fixture",
|
||||
"root_prefix": "fixture/dnd",
|
||||
"region": "fixture-1",
|
||||
"endpoint": "https://storage.fixture.invalid",
|
||||
"force_path_style": False,
|
||||
"access_key_id": "OBJECT_STORAGE_KEY_ID",
|
||||
"secret_access_key": "OBJECT_STORAGE_KEY",
|
||||
},
|
||||
}
|
||||
assert config["cache"]["s3_audio"] is False
|
||||
assert config["publish"] == {
|
||||
"enabled": True,
|
||||
"upload_run": True,
|
||||
"outputs": [
|
||||
{
|
||||
"source": "narratio.transcript.final",
|
||||
"dest": "transcripts/final.json",
|
||||
"required": True,
|
||||
},
|
||||
{
|
||||
"source": "narratio.artifact.session_recap",
|
||||
"dest": "artifacts/session_recap.md",
|
||||
"required": True,
|
||||
},
|
||||
],
|
||||
}
|
||||
assert "config_overlay" not in config["notarius"]
|
||||
assert testing_config["notarius"]["config_overlay"] == "testing"
|
||||
assert all(
|
||||
artifact["profile_id"] == "endpoint-profile"
|
||||
for artifact in testing_config["scriptorium"]["artifacts"].values()
|
||||
)
|
||||
assert any(
|
||||
artifact_id.startswith("character_meta_analysis_")
|
||||
for artifact_id in testing_config["scriptorium"]["artifacts"]
|
||||
)
|
||||
PY
|
||||
! grep -Fq "$synthetic_audita_api_key" "$baseline_log" "$narratio_effective_config" "$narratio_testing_effective_config" "$notarius_effective_config" "$notarius_testing_effective_config"
|
||||
! grep -Fq "$synthetic_notarius_api_key" "$baseline_log" "$narratio_effective_config" "$narratio_testing_effective_config" "$notarius_effective_config" "$notarius_testing_effective_config"
|
||||
! grep -Fq "$synthetic_object_storage_key_id" "$baseline_log" "$narratio_effective_config" "$narratio_testing_effective_config" "$notarius_effective_config" "$notarius_testing_effective_config"
|
||||
! grep -Fq "$synthetic_object_storage_key" "$baseline_log" "$narratio_effective_config" "$narratio_testing_effective_config" "$notarius_effective_config" "$notarius_testing_effective_config"
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config artifacts \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs | \
|
||||
awk -F '\t' '$1 == "session_recap" && $4 == "true" { found = 1 } END { exit !found }'
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config artifacts \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs | \
|
||||
awk -F '\t' '$1 == "hostile_rumors" && $6 == "session_recap" { found = 1 } END { exit !found }'
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config artifacts \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs | \
|
||||
awk -F '\t' 'index($1, "character_meta_analysis_") == 1 && $4 == "false" && $7 == "character_meta_analysis" { found = 1 } END { exit !found }'
|
||||
/usr/bin/sudo -u "$operator_user" /usr/local/bin/narratio config validate \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs
|
||||
/usr/bin/sudo -u "$operator_user" /usr/local/bin/notarius config validate \
|
||||
--config /usr/local/etc/notarius/config.yml --pipeline dnd-session
|
||||
/usr/bin/sudo -u nobody /bin/cat /usr/local/etc/narratio/pipeline.yml >/dev/null
|
||||
if /usr/bin/sudo -u nobody /usr/local/bin/narratio config validate \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs; then
|
||||
exit 1
|
||||
fi
|
||||
/usr/bin/sudo -u narratio /bin/sh -c \
|
||||
"umask 077; mkdir '$shared_fixture_root'; printf '%s\\n' service-created > '$service_fixture_file'"
|
||||
/usr/bin/sudo -u "$operator_user" /bin/sh -c \
|
||||
"grep -Fx service-created '$service_fixture_file'; printf '%s\\n' operator-appended >> '$service_fixture_file'"
|
||||
/usr/bin/sudo -u narratio /bin/grep -Fx operator-appended "$service_fixture_file"
|
||||
/usr/bin/sudo -u "$operator_user" /bin/sh -c \
|
||||
"umask 077; printf '%s\\n' operator-created > '$operator_fixture_file'"
|
||||
/usr/bin/sudo -u narratio /bin/grep -Fx operator-created "$operator_fixture_file"
|
||||
session_recap_prompt_json=$(/usr/local/bin/scriptorium inspect prompt \
|
||||
--config /usr/local/etc/scriptorium/config.yml \
|
||||
--prompt dnd.session_recap --prompt-version 2.0.0 --format json)
|
||||
session_recap_profile=$(printf '%s\n' "$session_recap_prompt_json" | \
|
||||
"$workspace_venv/bin/python" -c 'import json, sys; print(json.load(sys.stdin)["default_profile_id"])')
|
||||
/usr/local/bin/scriptorium inspect profile --config /usr/local/etc/scriptorium/config.yml \
|
||||
--profile "$session_recap_profile"
|
||||
/usr/local/bin/scriptorium inspect prompt --config /usr/local/etc/scriptorium/config.yml \
|
||||
--prompt dnd.scene_map --prompt-version 1.0.0 --format json | \
|
||||
"$workspace_venv/bin/python" -c '
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
schema_root = Path(sys.argv[1]).resolve()
|
||||
schema_path = json.load(sys.stdin)["output_contract"]["schema_path"]
|
||||
schema = (schema_root / schema_path).resolve()
|
||||
if not schema.is_relative_to(schema_root) or not schema.is_file():
|
||||
raise SystemExit(f"invalid deployed schema path: {schema}")
|
||||
' "$prompt_library_root/schemas"
|
||||
baseline_repeat_log="$test_tmp/baseline-repeat.log"
|
||||
run_converge "$baseline_repeat_log" "${baseline_args[@]}"
|
||||
require_clean_recap "$baseline_repeat_log"
|
||||
|
||||
invalid_key_log="$test_tmp/invalid-key.log"
|
||||
if run_converge "$invalid_key_log" "${baseline_args[@]}" \
|
||||
-e '{"dnd_pipeline_secrets":{"INVALID-KEY":"invalid-key-synthetic-value"}}'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
selected_version_log="$test_tmp/selected-version.log"
|
||||
run_converge "$selected_version_log" "${baseline_args[@]}" \
|
||||
-e 'dnd_pipeline_seriatim_version=v1.4.0'
|
||||
for campaign in centaurs dilfs; do
|
||||
sudo -u narratio /usr/local/bin/narratio config validate --config /usr/local/etc/narratio/narratio.yml --scope campaign --campaign "$campaign"
|
||||
sudo -u narratio /usr/local/bin/narratio config validate --config /usr/local/etc/narratio/narratio.yml --scope party --campaign "$campaign"
|
||||
done
|
||||
sudo -u narratio /usr/local/bin/narratio config validate --config /usr/local/etc/narratio/narratio.yml --scope app
|
||||
sudo -u narratio /usr/local/bin/narratio config validate --config /usr/local/etc/narratio/narratio.yml --scope app --overlay testing
|
||||
sudo -u "$operator_user" /usr/local/bin/narratio config validate --config /usr/local/etc/narratio/narratio.yml --scope app
|
||||
sudo -u narratio /usr/local/bin/narratio config show --config /usr/local/etc/narratio/narratio.yml --scope app --overlay testing --format json > "$test_tmp/narratio.json"
|
||||
sudo -u narratio /usr/local/bin/narratio artifacts list --config /usr/local/etc/narratio/narratio.yml --campaign centaurs --format json > "$test_tmp/artifacts.json"
|
||||
/usr/local/bin/notarius config show --config /usr/local/etc/notarius/config.yml --overlay testing --format json > "$test_tmp/notarius.json"
|
||||
"$workspace_venv/bin/python" tests/verify.py composed "$test_tmp"
|
||||
for prompt in dnd.session_bounds dnd.session_recap dnd.hostile_rumors dnd.deranged_rumors dnd.scene_map dnd.character_meta_analysis; do
|
||||
/usr/local/bin/scriptorium promptkit show prompt "$prompt" --config /usr/local/etc/scriptorium/config.yml --format json > /dev/null
|
||||
args=(--var session_id=fixture-session)
|
||||
case "$prompt" in
|
||||
dnd.*rumors) args+=(--input-text 'recap=synthetic recap') ;;
|
||||
dnd.session_bounds) args+=(--input-text 'transcript={"segments":[]}') ;;
|
||||
dnd.scene_map) args+=(--input-text 'transcript={"segments":[]}' --input-text 'players=synthetic players' --input-text 'party=synthetic party') ;;
|
||||
*) args+=(--input-text 'transcript={"segments":[]}' --input-text 'recap=synthetic recap' --input-text 'players=synthetic players' --input-text 'party=synthetic party') ;;
|
||||
esac
|
||||
if [[ "$prompt" == dnd.character_meta_analysis ]]; then args+=(--var character_name=Example --var character_class=Cleric); fi
|
||||
/usr/local/bin/scriptorium promptkit show prepared "$prompt" --config /usr/local/etc/scriptorium/config.yml "${args[@]}" --format json > /dev/null
|
||||
done
|
||||
sudo -u narratio /bin/sh -c "umask 077; mkdir '$shared_fixture_root'; printf '%s\n' service > '$shared_fixture_root/service'"
|
||||
sudo -u "$operator_user" /bin/sh -c "grep -Fx service '$shared_fixture_root/service'; printf '%s\n' operator >> '$shared_fixture_root/service'; umask 077; printf '%s\n' operator > '$shared_fixture_root/operator'"
|
||||
sudo -u narratio grep -Fx operator "$shared_fixture_root/service" "$shared_fixture_root/operator"
|
||||
! grep -Eq 'synthetic-(audita|openrouter|storage)' "$test_tmp/composed.log" "$test_tmp/narratio.json" "$test_tmp/notarius.json"
|
||||
repeat_case selected -e 'dnd_pipeline_seriatim_version=v1.4.0'
|
||||
/usr/local/bin/seriatim --version | grep -Fx 'seriatim version v1.4.0'
|
||||
selected_version_repeat_log="$test_tmp/selected-version-repeat.log"
|
||||
run_converge "$selected_version_repeat_log" "${baseline_args[@]}" \
|
||||
-e 'dnd_pipeline_seriatim_version=v1.4.0'
|
||||
require_clean_recap "$selected_version_repeat_log"
|
||||
|
||||
pipeline_group_one='{"archive-session":{"llm_profile":"gpt-luna-latest","input":{"module":"seriatim"},"artifacts":{"spells":{"extract":{"module":"dnd/spells"},"normalize":{"module":"dnd/spells"}}}}}'
|
||||
pipeline_group_two='{"research-session":{"llm_profile":"gpt-luna-latest","input":{"module":"seriatim"},"artifacts":{"spells":{"extract":{"module":"dnd/spells"},"normalize":{"module":"dnd/spells"}}}}}'
|
||||
alternate_config="{\"notarius_pipeline_group_one\":$pipeline_group_one,\"notarius_pipeline_group_two\":$pipeline_group_two,\"dnd_pipeline_notarius_pipelines\":\"{{ notarius_pipeline_group_one | combine(notarius_pipeline_group_two) }}\",\"dnd_pipeline_narratio_notarius_pipeline_id\":\"archive-session\",\"dnd_pipeline_notarius_testing_llm_profile\":\"gpt-terra-latest\",\"dnd_pipeline_notarius_cache_chunk_plans_mode\":\"bypass\"}"
|
||||
alternate_log="$test_tmp/alternate.log"
|
||||
run_converge "$alternate_log" "${baseline_args[@]}" -e "$alternate_config"
|
||||
/usr/local/bin/notarius config validate --config /usr/local/etc/notarius/config.yml \
|
||||
--pipeline archive-session
|
||||
/usr/local/bin/notarius config validate --config /usr/local/etc/notarius/config.yml \
|
||||
--config-overlay testing --pipeline archive-session
|
||||
alternate_narratio_config="$test_tmp/alternate-narratio.yml"
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config show \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs \
|
||||
> "$alternate_narratio_config"
|
||||
grep -Fq 'pipeline_id: archive-session' "$alternate_narratio_config"
|
||||
alternate_testing_narratio_config="$test_tmp/alternate-testing-narratio.yml"
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config show \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs --overlay testing \
|
||||
> "$alternate_testing_narratio_config"
|
||||
alternate_effective_config="$test_tmp/alternate-effective.yml"
|
||||
/usr/local/bin/notarius config effective --config /usr/local/etc/notarius/config.yml \
|
||||
> "$alternate_effective_config"
|
||||
alternate_testing_effective_config="$test_tmp/alternate-testing-effective.yml"
|
||||
/usr/local/bin/notarius config effective --config /usr/local/etc/notarius/config.yml \
|
||||
--config-overlay testing > "$alternate_testing_effective_config"
|
||||
"$workspace_venv/bin/python" - \
|
||||
"$alternate_narratio_config" "$alternate_testing_narratio_config" \
|
||||
"$alternate_effective_config" "$alternate_testing_effective_config" <<'PY'
|
||||
import sys
|
||||
|
||||
import yaml
|
||||
|
||||
with open(sys.argv[1], encoding="utf-8") as config_file:
|
||||
narratio_base = yaml.safe_load(config_file)
|
||||
with open(sys.argv[2], encoding="utf-8") as config_file:
|
||||
narratio_testing = yaml.safe_load(config_file)
|
||||
with open(sys.argv[3], encoding="utf-8") as config_file:
|
||||
notarius_base = yaml.safe_load(config_file)
|
||||
with open(sys.argv[4], encoding="utf-8") as config_file:
|
||||
notarius_testing = yaml.safe_load(config_file)
|
||||
|
||||
assert narratio_base["notarius"]["pipeline_id"] == "archive-session"
|
||||
assert "config_overlay" not in narratio_base["notarius"]
|
||||
assert narratio_testing["notarius"]["pipeline_id"] == "archive-session"
|
||||
assert narratio_testing["notarius"]["config_overlay"] == "testing"
|
||||
assert notarius_base["pipelines"]["archive-session"]["llm_profile"] == "gpt-luna-latest"
|
||||
assert notarius_testing["pipelines"]["archive-session"]["llm_profile"] == "gpt-terra-latest"
|
||||
assert notarius_testing["pipelines"]["research-session"]["llm_profile"] == "gpt-luna-latest"
|
||||
assert notarius_base["cache"]["chunk_plans"]["mode"] == "bypass"
|
||||
"$workspace_venv/bin/python" - "$test_tmp/composed-pipelines.json" <<'PY'
|
||||
import json,sys
|
||||
pipeline=lambda:{'llm_profile':'gpt-terra-latest','input':{'module':'seriatim'},'artifacts':{'spells':{'extract':{'module':'dnd/spells'},'normalize':{'module':'dnd/spells'}}}}
|
||||
config={'group_one':{'archive-session':pipeline()},'group_two':{'research-session':pipeline()},'dnd_pipeline_notarius_pipelines':'{{ group_one | combine(group_two) }}','dnd_pipeline_narratio_notarius_pipeline_id':'archive-session','dnd_pipeline_notarius_testing_llm_profile':'gpt-luna-latest'}
|
||||
with open(sys.argv[1],'w',encoding='utf-8') as f:json.dump(config,f)
|
||||
PY
|
||||
alternate_repeat_log="$test_tmp/alternate-repeat.log"
|
||||
run_converge "$alternate_repeat_log" "${baseline_args[@]}" -e "$alternate_config"
|
||||
require_clean_recap "$alternate_repeat_log"
|
||||
|
||||
synthetic_fixture_audita_key='audita-override-synthetic-value'
|
||||
synthetic_fixture_notarius_key='notarius-override-synthetic-value'
|
||||
override_config="{\"dnd_pipeline_audita_backends\":{\"fixture\":{\"endpoint\":\"https://inference.fixture.invalid/v1\",\"credential\":\"FIXTURE_AUDITA_KEY\",\"concurrency\":2}},"\
|
||||
"\"dnd_pipeline_audita_profiles\":{\"fixture-proposal\":{\"id\":\"fixture-proposal\",\"backend\":\"fixture\",\"model\":\"fixture/proposal\",\"timeout_seconds\":900},"\
|
||||
"\"fixture-validation\":{\"id\":\"fixture-validation\",\"backend\":\"fixture\",\"model\":\"fixture/validation\",\"timeout_seconds\":900}},"\
|
||||
"\"dnd_pipeline_audita_llm_proposal_profile\":\"fixture-proposal\",\"dnd_pipeline_audita_llm_validation_profile\":\"fixture-validation\","\
|
||||
"\"dnd_pipeline_narratio_audita_credentials\":[\"FIXTURE_AUDITA_KEY\"],\"dnd_pipeline_narratio_notarius_credentials\":[\"FIXTURE_NOTARIUS_KEY\"],"\
|
||||
"\"dnd_pipeline_narratio_scriptorium_credentials\":[\"FIXTURE_AUDITA_KEY\",\"FIXTURE_NOTARIUS_KEY\"],"\
|
||||
"\"dnd_pipeline_audita_llm_transient_retries\":0,\"dnd_pipeline_audita_llm_repair_attempts\":0,\"dnd_pipeline_audita_llm_operation_timeout\":\"20m\","\
|
||||
"\"dnd_pipeline_notarius_promptkit_transient_retries\":0,\"dnd_pipeline_scriptorium_transient_retries\":0,"\
|
||||
"\"dnd_pipeline_secrets\":{\"AUDITA_LLM_API_KEY\":\"$synthetic_audita_api_key\",\"OPENROUTER_API_KEY\":\"$synthetic_notarius_api_key\","\
|
||||
"\"FIXTURE_AUDITA_KEY\":\"$synthetic_fixture_audita_key\",\"FIXTURE_NOTARIUS_KEY\":\"$synthetic_fixture_notarius_key\","\
|
||||
"\"OBJECT_STORAGE_KEY_ID\":\"$synthetic_object_storage_key_id\",\"OBJECT_STORAGE_KEY\":\"$synthetic_object_storage_key\"}}"
|
||||
override_log="$test_tmp/override.log"
|
||||
run_converge "$override_log" "${baseline_args[@]}" -e "$override_config"
|
||||
FIXTURE_AUDITA_KEY="$synthetic_fixture_audita_key" \
|
||||
/usr/local/bin/audita config validate --config /usr/local/etc/audita/config.yml
|
||||
audita_override_settings="$test_tmp/audita-override-settings.yml"
|
||||
audita_override_profiles="$test_tmp/audita-override-profiles.yml"
|
||||
FIXTURE_AUDITA_KEY="$synthetic_fixture_audita_key" \
|
||||
/usr/local/bin/audita config print-effective --config /usr/local/etc/audita/config.yml \
|
||||
--view settings > "$audita_override_settings"
|
||||
FIXTURE_AUDITA_KEY="$synthetic_fixture_audita_key" \
|
||||
/usr/local/bin/audita config print-effective --config /usr/local/etc/audita/config.yml \
|
||||
--view profiles > "$audita_override_profiles"
|
||||
notarius_override_config="$test_tmp/notarius-override.yml"
|
||||
scriptorium_override_config="$test_tmp/scriptorium-override.yml"
|
||||
narratio_override_config="$test_tmp/narratio-override.yml"
|
||||
narratio_testing_override_config="$test_tmp/narratio-testing-override.yml"
|
||||
/usr/local/bin/notarius config effective --config /usr/local/etc/notarius/config.yml \
|
||||
> "$notarius_override_config"
|
||||
/usr/local/bin/scriptorium config show --config /usr/local/etc/scriptorium/config.yml \
|
||||
> "$scriptorium_override_config"
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config show \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs \
|
||||
> "$narratio_override_config"
|
||||
/usr/bin/sudo -u narratio /usr/local/bin/narratio config show \
|
||||
--config /usr/local/etc/narratio/pipeline.yml --campaign centaurs --overlay testing \
|
||||
> "$narratio_testing_override_config"
|
||||
"$workspace_venv/bin/python" - \
|
||||
"$audita_override_settings" "$audita_override_profiles" \
|
||||
"$notarius_override_config" "$scriptorium_override_config" \
|
||||
"$narratio_override_config" "$narratio_testing_override_config" <<'PY'
|
||||
import sys
|
||||
|
||||
import yaml
|
||||
|
||||
settings, profiles, notarius, scriptorium, narratio, narratio_testing = (
|
||||
yaml.safe_load(open(path, encoding="utf-8")) for path in sys.argv[1:]
|
||||
)
|
||||
assert settings["backends"]["fixture"]["endpoint"] == "https://inference.fixture.invalid/v1"
|
||||
assert settings["backends"]["fixture"]["concurrency"] == 2
|
||||
assert settings["llm"]["proposal_profile"] == "fixture-proposal"
|
||||
assert settings["llm"]["validation_profile"] == "fixture-validation"
|
||||
assert settings["llm"]["transient_retries"] == 0
|
||||
assert settings["llm"]["repair_attempts"] == 0
|
||||
assert settings["llm"]["operation_timeout"] == "20m0s"
|
||||
assert profiles["proposal"]["model"] == "fixture/proposal"
|
||||
assert profiles["validation"]["model"] == "fixture/validation"
|
||||
assert notarius["promptkit"]["transient_retries"] == 0
|
||||
assert scriptorium["transient_retries"] == 0
|
||||
assert narratio["audita"]["credentials"] == ["FIXTURE_AUDITA_KEY"]
|
||||
assert narratio["notarius"]["credentials"] == ["FIXTURE_NOTARIUS_KEY"]
|
||||
assert narratio["scriptorium"]["credentials"] == ["FIXTURE_AUDITA_KEY", "FIXTURE_NOTARIUS_KEY"]
|
||||
assert narratio_testing["scriptorium"]["credentials"] == ["FIXTURE_AUDITA_KEY", "FIXTURE_NOTARIUS_KEY"]
|
||||
repeat_case pipelines -e "@$test_tmp/composed-pipelines.json"
|
||||
/usr/local/bin/notarius pipeline validate archive-session --config /usr/local/etc/notarius/config.yml --overlay testing
|
||||
/usr/local/bin/notarius config show --config /usr/local/etc/notarius/config.yml --overlay testing --format json > "$test_tmp/pipelines.json"
|
||||
"$workspace_venv/bin/python" tests/verify.py pipelines "$test_tmp"
|
||||
"$workspace_venv/bin/python" - "$test_tmp/overrides.json" <<'PY'
|
||||
import json,sys
|
||||
config={'dnd_pipeline_audita_promptkit_backends':[{'id':'fixture','endpoint':'https://inference.fixture.invalid/v1','api_key_env':'FIXTURE_AUDITA_KEY','concurrency_limit':2}], 'dnd_pipeline_audita_promptkit_profiles':[{'id':'fixture-proposal','backend':'fixture','model':'fixture/proposal','timeout_seconds':900},{'id':'fixture-validation','backend':'fixture','model':'fixture/validation','timeout_seconds':900}], 'dnd_pipeline_audita_llm_proposal_profile':'fixture-proposal','dnd_pipeline_audita_llm_validation_profile':'fixture-validation','dnd_pipeline_audita_llm_transient_retries':0,'dnd_pipeline_audita_llm_correction_repair_attempts':0,'dnd_pipeline_audita_llm_operation_timeout':'20m','dnd_pipeline_scriptorium_transient_retries':0,'dnd_pipeline_narratio_audita_credentials':['FIXTURE_AUDITA_KEY'],'dnd_pipeline_narratio_notarius_credentials':['FIXTURE_NOTARIUS_KEY'],'dnd_pipeline_narratio_scriptorium_credentials':['FIXTURE_AUDITA_KEY','FIXTURE_NOTARIUS_KEY'],'dnd_pipeline_secrets':{'FIXTURE_AUDITA_KEY':'synthetic-fixture-audita','FIXTURE_NOTARIUS_KEY':'synthetic-fixture-notarius','OBJECT_STORAGE_KEY_ID':'synthetic-storage-id','OBJECT_STORAGE_KEY':'synthetic-storage-key'}}
|
||||
with open(sys.argv[1],'w',encoding='utf-8') as f:json.dump(config,f)
|
||||
PY
|
||||
! grep -Fq "$synthetic_fixture_audita_key" "$override_log" "$narratio_override_config"
|
||||
! grep -Fq "$synthetic_fixture_notarius_key" "$override_log" "$narratio_override_config"
|
||||
override_repeat_log="$test_tmp/override-repeat.log"
|
||||
run_converge "$override_repeat_log" "${baseline_args[@]}" -e "$override_config"
|
||||
require_clean_recap "$override_repeat_log"
|
||||
repeat_case overrides -e "@$test_tmp/overrides.json"
|
||||
/usr/local/bin/audita config validate --config /usr/local/etc/audita/config.yml
|
||||
sudo -u narratio /usr/local/bin/narratio config validate --config /usr/local/etc/narratio/narratio.yml --scope app
|
||||
"$workspace_venv/bin/python" tests/verify.py overrides "$test_tmp"
|
||||
! grep -Eq 'synthetic-fixture-(audita|notarius)' "$test_tmp/overrides.log"
|
||||
|
||||
57
tests/verify.py
Normal file
57
tests/verify.py
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inspect supplied suite configuration outcomes from the offline integration run."""
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
case, directory = sys.argv[1:]
|
||||
tmp = Path(directory)
|
||||
|
||||
def read_json(name):
|
||||
return json.loads((tmp / name).read_text(encoding="utf-8"))
|
||||
|
||||
def read_yaml(name):
|
||||
return yaml.safe_load(Path(name).read_text(encoding="utf-8"))
|
||||
|
||||
if case == "composed":
|
||||
config = read_json("narratio.json")
|
||||
assert config["workspace"]["cleanup_after_publish"] is False
|
||||
assert config["storage"]["s3"]["bucket"] == "fixture-bucket"
|
||||
assert config["storage"]["s3"]["force_path_style"] is False
|
||||
assert [item["source"] for item in config["publish"]["outputs"]] == ["narratio.transcript.final", "narratio.artifact.session_recap"]
|
||||
assert config["notarius"]["config_overlay"] == "testing"
|
||||
assert config["notarius"]["enabled"] is True
|
||||
assert config["notarius"]["references"]["party"] == "narratio.input.party"
|
||||
assert config["notarius"]["references"]["spell_catalog"] == "narratio.input.glossary.combined"
|
||||
assert config["notarius"]["outputs"]["enemy_events"]["lane_id"] == "enemy-events"
|
||||
assert config["trim"]["bounds"]["profile_id"] == "fixture-test"
|
||||
assert all(item["profile_id"] == "fixture-test" for item in config["scriptorium"]["artifacts"].values())
|
||||
assert config["scriptorium"]["artifact_families"]["character_meta_analysis"]["profile_id"] == "fixture-test"
|
||||
artifacts = read_json("artifacts.json")["artifacts"]
|
||||
assert any(item.get("family") == "character_meta_analysis" and item["output"].startswith("artifacts/character_meta_analysis_") for item in artifacts)
|
||||
assert any(item["key"] == "hostile_rumors" and "session_recap" in item["dependencies"] for item in artifacts)
|
||||
pipeline = read_json("notarius.json")["pipelines"]["dnd-session"]
|
||||
assert pipeline["llm_profile"] == "gpt-luna-latest"
|
||||
elif case == "pipelines":
|
||||
pipelines = read_json("pipelines.json")["pipelines"]
|
||||
assert pipelines["archive-session"]["llm_profile"] == "gpt-luna-latest"
|
||||
assert pipelines["research-session"]["llm_profile"] == "gpt-terra-latest"
|
||||
elif case == "overrides":
|
||||
audita = read_yaml("/usr/local/etc/audita/config.yml")
|
||||
assert audita["promptkit"]["backends"][0]["endpoint"] == "https://inference.fixture.invalid/v1"
|
||||
assert audita["promptkit"]["backends"][0]["concurrency_limit"] == 2
|
||||
assert audita["llm"]["proposal_profile"] == "fixture-proposal"
|
||||
assert audita["llm"]["validation_profile"] == "fixture-validation"
|
||||
assert audita["llm"]["transient_retries"] == 0
|
||||
assert audita["llm"]["correction_repair_attempts"] == 0
|
||||
assert audita["llm"]["operation_timeout"] == "20m"
|
||||
scriptorium = read_yaml("/usr/local/etc/scriptorium/config.yml")
|
||||
assert scriptorium["transient_retries"] == 0
|
||||
narratio = read_yaml("/usr/local/etc/narratio/narratio.yml")
|
||||
assert narratio["audita"]["credentials"] == ["FIXTURE_AUDITA_KEY"]
|
||||
assert narratio["notarius"]["credentials"] == ["FIXTURE_NOTARIUS_KEY"]
|
||||
assert narratio["scriptorium"]["credentials"] == ["FIXTURE_AUDITA_KEY", "FIXTURE_NOTARIUS_KEY"]
|
||||
else:
|
||||
raise ValueError(case)
|
||||
Reference in New Issue
Block a user