Document shared glossary inputs and migration

This commit is contained in:
2026-11-29 18:16:18 +00:00
parent 04546acee0
commit 3b7baed65e
20 changed files with 248 additions and 112 deletions

View File

@@ -44,7 +44,7 @@ work directory. `audita process --help` lists the available flags. An omitted fl
does not contribute an override. [Configuration](config.md) defines their values does not contribute an override. [Configuration](config.md) defines their values
and inheritance. and inheritance.
`--glossary-file PATH` supplies a wrapperless runtime glossary file. Repeat it `--glossary-file PATH` supplies a shared glossary YAML or JSON file. Repeat it
to compose files in argument order. Each occurrence is a single path resolved to compose files in argument order. Each occurrence is a single path resolved
from the invocation working directory. This flag does not select collections: from the invocation working directory. This flag does not select collections:
use configured selections or `--glossaries`. It is also accepted by configuration use configured selections or `--glossaries`. It is also accepted by configuration

View File

@@ -15,23 +15,28 @@ not continue after a selected file fails. An omitted version uses the v3 schema;
a supplied version must be `3`. a supplied version must be `3`.
Operator sources may use ConfigKit imports. The selected main file provides the Operator sources may use ConfigKit imports. The selected main file provides the
base for an optional `overlays/<name>.yml`, optional `glossary.yml`, and recursive base for an optional `overlays/<name>.yml` and automatic prompt companions.
`glossary/` YAML files. Without a main source, automatic companion files are not Without a main source, automatic companions are not loaded from the working
loaded from the working directory. ConfigKit composes sources, resolves native directory. ConfigKit composes sources, resolves native inheritance, applies
inheritance, applies explicit overrides, records derived defaults, and validates explicit overrides, records derived defaults, and validates the result. Its
the result. Its [configuration reference](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md) [configuration reference](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md)
owns native composition and provenance semantics. owns native composition and provenance semantics.
Runtime files supplied with `--glossary-file` are first composed separately in Explicit `--glossary-file` inputs use the shared `glossary@0.2.0` contract from
argument order using native imports and entry identities. Imports are resolved schemas distribution `2026.11.1` and the `maximumdirect.glossary.v1` marker.
beside their declaring files. The resolved wrapperless mapping is then assigned The files are ordered native layers; imports within a file are native peers and
to `glossary_collections` as one CLI override in the application load. Supplied resolve beside their declaring file. Audita validates the completed envelope,
entry lists replace configured lists at that boundary; unrelated configured then projects collection entries as one CLI assignment to
collections remain. Omitted fields retain configured values, while explicit `glossary_collections`. Supplied entry lists replace configured lists at that
empty and null values follow native assignment and decoding. Application and boundary; unrelated configured collections remain. ConfigKit governs native
overlay parsing and validation still apply. Final explanation records the CLI composition and assignment. Final explanation records the CLI assignment;
assignment, while original runtime file and import source records belong to the runtime files and imports remain recorded for collision protection. See the
preliminary load rather than final provenance. See the [runtime file contract](integrations/transcript-glossary-files.md). [shared file contract](integrations/transcript-glossary-files.md#glossary-collections).
Audita does not automatically discover `glossary.yml` or files under `glossary/`.
Pass desired files explicitly. An extension named `instruction` in a shared
collection is data and is not application instruction guidance. Inline application
`glossary_collections` may still define `instruction`.
Runtime glossary inheritance resolves only among the supplied files and their Runtime glossary inheritance resolves only among the supplied files and their
imports; it cannot name a parent defined only in application configuration. imports; it cannot name a parent defined only in application configuration.

View File

@@ -19,7 +19,7 @@ Supplying a configuration path also makes file selection predictable. Configured
secrets bootstrap can populate the child environment before the shared load; secrets bootstrap can populate the child environment before the shared load;
see [configuration](../config.md#loading-and-composition). see [configuration](../config.md#loading-and-composition).
For prepared vocabulary, write one or more wrapperless collection files and For prepared vocabulary, write one or more shared glossary files and
pass each path as a separate `--glossary-file` argument. Select the main pass each path as a separate `--glossary-file` argument. Select the main
configuration and overlay that define the desired pipeline and collection configuration and overlay that define the desired pipeline and collection
selections; supplying files does not select them. The same arguments can be selections; supplying files does not select them. The same arguments can be
@@ -28,7 +28,7 @@ used to inspect the effective configuration before processing. See the
[CLI reference](../cli.md#processing) for composition and error outcomes. [CLI reference](../cli.md#processing) for composition and error outcomes.
Choose a trusted configuration bundle. An explicit main path still allows Choose a trusted configuration bundle. An explicit main path still allows
its configured imports and automatic overlay, glossary, and prompt companions. its configured imports, selected overlay, and automatic prompt companions.
Without a main path, Audita uses the configured discovery locations. The Without a main path, Audita uses the configured discovery locations. The
parent controls who can write those sources and which report destinations and parent controls who can write those sources and which report destinations and
retained debug directories the invocation will use. Native inspection is retained debug directories the invocation will use. Native inspection is

View File

@@ -30,29 +30,36 @@ types, duplicate supplied IDs, and the validation failures above are rejected.
## Glossary collections ## Glossary collections
Glossary definitions are composed as application configuration, including the Runtime glossary files supplied with `--glossary-file PATH` use the shared
optional companion inputs described by the [configuration reference](../config.md). `glossary@0.2.0` contract from schemas distribution `2026.11.1`, with marker
The [local example](../../examples/local/glossary.yml) provides a complete `maximumdirect.glossary.v1`. Audita bundles the selected schema and validates
collection. Configuration may contain empty collections; processing preflight completed inputs offline. The upstream [schema](https://schemas.maximumdirect.net/glossary/v0.2.0/schema.json)
requires every glossary-correction entry to select at least one glossary entry. and [semantics](https://schemas.maximumdirect.net/glossary/v0.2.0/semantics.md)
The previous standalone `glossary` file format is not a processing input. define its fields and extensions. Full conformance includes the
[ConfigKit v1.4.0 loading boundary](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md).
Runtime files supplied with `--glossary-file` are YAML mappings keyed directly
by collection name, without a `glossary_collections` wrapper. Each collection
may contain `instruction` and `entries`; entries retain additional fields as
extensions. For example:
```yaml ```yaml
people: schema_version: maximumdirect.glossary.v1
instruction: Prefer the speaker's stated name when supported by context. collections:
entries: people:
- id: speaker entries:
name: Mira Chen - id: speaker
category: person name: Mira Chen
aliases: [Mira] category: person
source_note: Prepared for this recording aliases: [Mira]
``` ```
See the [complete runtime glossary example](../../examples/README.md#runtime-glossary-input) Each path is relative to the invocation working directory. A file can hold one
and [composition and selection rules](../config.md#loading-and-composition). or many collections; repeated flags compose files in order. Native imports are
Files and their imports are protected by the existing output collision checks. resolved relative to their declaring file, and imported fragments can contribute
to a completed envelope. All selected and imported paths are protected from
output collisions. Loading does not select collections. Configure selections or
use the CLI selection flags; empty collections are valid for inspection, while
glossary correction needs at least one selected entry.
Audita no longer automatically loads `glossary.yml` or files in `glossary/`;
pass those paths explicitly if needed. Automatic prompt companions remain.
Collection extensions, including `instruction`, are data and do not become
prompt guidance. See [configuration and composition](../config.md#loading-and-composition),
[examples](../../examples/README.md#runtime-glossary-input), and the
[v4.3 migration guide](../migrations/v4.3.md).

View File

@@ -42,10 +42,13 @@ profile and backend inspections and equivalent glossary views within the
invocation. Native inspection commands continue to inspect configuration invocation. Native inspection commands continue to inspect configuration
without running processing readiness checks. without running processing readiness checks.
Runtime glossary files use a preliminary ConfigKit load before the shared Explicit shared glossary files use a preliminary ConfigKit load with ordered
application load. Processing retains its acquired source paths for output layers, native imports, and entry identities. The shared-glossary adapter
collision checks; inspection receives the final native result and CLI origin. validates the completed envelope against the bundled offline schema before
Both sides of a native comparison use the same invocation file list. projecting entries into the application load. Processing retains acquired source
paths for output collision checks; inspection receives the final native result
and CLI origin. Both sides of comparison use the same invocation file list.
Automatic prompt companions remain; glossary companions are not discovered.
## Validating Examples ## Validating Examples
@@ -54,7 +57,7 @@ their canonical contract documentation. Keep them valid and secret-free.
Run the commands in the [example guide](../../examples/README.md) from each Run the commands in the [example guide](../../examples/README.md) from each
project's directory. `internal/cli/examples_integration_test.go` exercises the project's directory. `internal/cli/examples_integration_test.go` exercises the
maintained projects with a controlled provider, and the preview fixture can be maintained projects with a controlled provider, and the preview fixture can be
prepared without inference. Review automatic companion sources and overlays in prepared without inference. Review automatic prompt sources and overlays in
their actual project directories. Keep service credentials synthetic in tests. their actual project directories. Keep service credentials synthetic in tests.
## Runtime Change Checks ## Runtime Change Checks

43
docs/migrations/v4.3.md Normal file
View File

@@ -0,0 +1,43 @@
# Migrating to Audita v4.3
Audita v4.3.0 adopts the shared `glossary@0.2.0` contract from schemas
distribution `2026.11.1`. Runtime glossary files now require the
`maximumdirect.glossary.v1` marker and a `collections` mapping. The former
wrapperless runtime format is no longer accepted. See the
[shared input contract](../integrations/transcript-glossary-files.md#glossary-collections)
and [upstream semantics](https://schemas.maximumdirect.net/glossary/v0.2.0/semantics.md).
```yaml
schema_version: maximumdirect.glossary.v1
collections:
people:
entries:
- {id: speaker, name: Mira Chen, category: person}
```
Pass files explicitly to every configuration-consuming invocation:
```sh
audita preflight --smoke=false --config config.yml --glossary-file glossary.yml --output corrected.json transcript.json
audita process --config config.yml --glossary-file party.yml --glossary-file spells.yml --output corrected.json transcript.json
```
One file can contain multiple collections, or repeated arguments can supply
separate files or a mixture. Paths are relative to the invocation directory;
native imports are relative to their declaring file. Formerly discovered
`glossary.yml` and `glossary/` files must now be named explicitly. Automatic
prompt companions, inline application vocabulary, and main configuration
discovery remain available.
Explicit files have CLI assignment priority over main and overlay vocabulary,
whereas automatic glossary companions previously acted as an underlay. Supplied
entry lists replace configured lists at that boundary; unrelated configured
collections remain. Files compose as ordered native layers before the completed
envelope is validated and projected. Inheritance and value presence follow the
[ConfigKit reference](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md),
within the boundaries described in [configuration](../config.md#loading-and-composition).
Loading does not select collections. Keep root or per-pipeline selections, or
supply the applicable CLI overrides. Empty collections can be inspected, but
glossary correction requires a selected entry. Application configuration remains
version 3 and the Go module path remains `/v4`.

View File

@@ -37,8 +37,8 @@ for native diagnostic behavior.
## Configuration trust ## Configuration trust
Treat the selected main file, imports, overlay, and automatically loaded Treat the selected main file, imports, overlay, explicit glossary files, and
glossary and prompt companions as one trusted bundle. Choose the working automatically loaded prompt companions as one trusted bundle. Choose the working
directory deliberately when using automatic discovery. A bundle can select directory deliberately when using automatic discovery. A bundle can select
the provider, prompt content, and local files consumed by processing. Review the provider, prompt content, and local files consumed by processing. Review
these sources before running with sensitive transcript data. Native inspection these sources before running with sensitive transcript data. Native inspection

View File

@@ -1,5 +1,6 @@
# Release Notes # Release Notes
- [Audita v4.3.0](v4.3.0.md)
- [Audita v4.2.0](v4.2.0.md) - [Audita v4.2.0](v4.2.0.md)
- [Audita v4.1.0](v4.1.0.md) - [Audita v4.1.0](v4.1.0.md)
- [Audita v4.0.0](v4.0.0.md) - [Audita v4.0.0](v4.0.0.md)

20
docs/releases/v4.3.0.md Normal file
View File

@@ -0,0 +1,20 @@
# Audita v4.3.0
Audita v4.3.0 adopts the Maximum Direct shared glossary contract for explicit
runtime files. Prepared shared vocabulary, including multi-collection spell
inputs, can be used directly for correction and protection.
## Compatibility and migration
`--glossary-file` now expects the `glossary@0.2.0` envelope with marker
`maximumdirect.glossary.v1`. Wrapperless glossary files are no longer accepted.
Automatic `glossary.yml` and `glossary/` discovery has been removed; callers
must pass desired files explicitly. Those files now have CLI assignment priority,
and supplied entry lists replace configured lists at that boundary. Collection
selection remains separate. Automatic prompt companions and inline application
vocabulary remain supported. See the [migration guide](../migrations/v4.3.md)
and [input contract](../integrations/transcript-glossary-files.md#glossary-collections).
Application configuration remains version 3 and the Go module path remains `/v4`.
[COPYRIGHT](https://gitea.maximumdirect.net/eric/audita/src/tag/v4.3.0/COPYRIGHT) | [LICENSE](https://gitea.maximumdirect.net/eric/audita/src/tag/v4.3.0/LICENSE) | [ATTRIBUTION](https://gitea.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/oss/attribution.md)

View File

@@ -99,17 +99,10 @@ See the [current validator context](../internal/validators.md#supplemental-valid
## Narratio Runtime Glossary Adoption ## Narratio Runtime Glossary Adoption
Audita's runtime glossary feature and the production/testing overlays in the Audita's shared glossary boundary accepts explicit `glossary@0.2.0` inputs;
separate `audita-pipelines-dnd` repository are implemented. Recipe roles, stage see the [input contract](../integrations/transcript-glossary-files.md) and
selections, profile aliases, installation and examples now belong to that [v4.3 migration guide](../migrations/v4.3.md). Narratio's adapter migration and
repository's [README](https://forge.maximumdirect.net/eric/audita-pipelines-dnd/src/branch/main/README.md). updates to the separate [audita-pipelines-dnd recipes](https://forge.maximumdirect.net/eric/audita-pipelines-dnd/src/branch/main/README.md)
Audita's interface belongs in the [CLI](../cli.md), [configuration](../config.md), remain separate work. They can pass prepared shared documents, choose explicit
and [input contracts](../integrations/transcript-glossary-files.md). files and selections, and review their CLI and output assumptions. Publishing
recipes and selecting an Audita release remain separate from implementation.
Narratio's adapter migration remains separate work: supply native runtime
glossary files, select the operator's configuration/overlay, and review remaining
CLI/output assumptions, including legacy `--modules`. Narratio owns projecting
campaign/session content such as party rosters into native collections. It can
pin a recipe revision without encoding the processing sequence. This work does
not restore legacy Audita flags or formats. Publishing recipes and selecting
an Audita release remain separate from their implementation.

View File

@@ -225,6 +225,8 @@ format-validation matrices at every CLI boundary.
## Stage 6: Update Examples and Canonical Documentation ## Stage 6: Update Examples and Canonical Documentation
**Completed.** Integrated acceptance validation remains outstanding.
**Work** **Work**
1. Convert maintained runtime and former companion glossary files, including 1. Convert maintained runtime and former companion glossary files, including

View File

@@ -2,7 +2,7 @@
Build Audita from the repository root with Go 1.27 or newer. The commands below Build Audita from the repository root with Go 1.27 or newer. The commands below
assume the executable is on `PATH`. Each project selects its main file from its assume the executable is on `PATH`. Each project selects its main file from its
own directory, which also determines companion resources and overlay context. own directory, which also determines prompt companions and overlay context.
All models, credentials, names, and endpoints are illustrative. All models, credentials, names, and endpoints are illustrative.
## Local processing ## Local processing
@@ -11,9 +11,9 @@ From `examples/local`, edit `prompts.yml` to match a reachable OpenAI-compatible
local service and its model. Then run: local service and its model. Then run:
```sh ```sh
audita config validate --config config.yml audita config validate --config config.yml --glossary-file glossary.yml
audita preflight --smoke=false --config config.yml --output corrected.json transcript.json audita preflight --smoke=false --config config.yml --glossary-file glossary.yml --output corrected.json transcript.json
audita process --config config.yml --output corrected.json transcript.json audita process --config config.yml --glossary-file glossary.yml --output corrected.json transcript.json
``` ```
The local-only preflight checks the intended destination without contacting the The local-only preflight checks the intended destination without contacting the
@@ -24,7 +24,7 @@ unless disabled. For an offline validator preview, from the same directory:
```sh ```sh
audita promptkit show prepared audita/validators.meaning_reversal_review \ audita promptkit show prepared audita/validators.meaning_reversal_review \
--config config.yml --profile local \ --config config.yml --glossary-file glossary.yml --profile local \
--var "PayloadJSON=$(cat validation-candidate.json)" \ --var "PayloadJSON=$(cat validation-candidate.json)" \
--var 'TranscriptDescriptionBlock=' --var 'TranscriptDescriptionBlock='
``` ```
@@ -33,7 +33,7 @@ To preview the repair instruction and its output schema without inference:
```sh ```sh
audita promptkit show prepared audita/modules.grammar.repair \ audita promptkit show prepared audita/modules.grammar.repair \
--config config.yml --profile local \ --config config.yml --glossary-file glossary.yml --profile local \
--var "RepairRequestJSON=$(cat repair-candidate.json)" --var "RepairRequestJSON=$(cat repair-candidate.json)"
``` ```
@@ -57,7 +57,7 @@ The example does not promise a provider's model availability, price, or quality.
From `examples/service`, the `runtime-glossary` overlay selects a configured From `examples/service`, the `runtime-glossary` overlay selects a configured
reference collection and an incoming collection. The runtime file replaces the reference collection and an incoming collection. The runtime file replaces the
incoming entries and supplies its instruction. Inspect the combined settings: incoming entries. Inspect the combined settings:
```sh ```sh
audita config show --scope app --config config.yml --overlay runtime-glossary \ audita config show --scope app --config config.yml --overlay runtime-glossary \
@@ -79,11 +79,11 @@ The [runtime file](service/runtime-glossary.yml) and
From `examples/prompt-edit`, inspect the operator replacement: From `examples/prompt-edit`, inspect the operator replacement:
```sh ```sh
audita promptkit show prompt audita/modules.grammar.proposal --config config.yml audita promptkit show prompt audita/modules.grammar.proposal --config config.yml --glossary-file glossary.yml
``` ```
Edit its message in `prompts.yml`, repeat the inspection, and run `audita process Edit its message in `prompts.yml`, repeat the inspection, and run `audita process
--config config.yml --output corrected.json transcript.json` against a configured --config config.yml --glossary-file glossary.yml --output corrected.json transcript.json` against a configured
local service. Its complete replacement also selects a structural-repair budget; local service. Its complete replacement also selects a structural-repair budget;
see the [v4.1 migration guide](../docs/migrations/v4.1.md). Each invocation captures see the [v4.1 migration guide](../docs/migrations/v4.1.md). Each invocation captures
the files anew. For native resource formats and commands, see the the files anew. For native resource formats and commands, see the
@@ -92,20 +92,28 @@ and [ckprompt guide](https://forge.maximumdirect.net/base-layer/commandkit/src/t
## Shared glossary library ## Shared glossary library
From `examples/campaigns`, `first.yml` and `second.yml` each consume the common From `examples/campaigns`, `first.yml` and `second.yml` explicitly select the
`shared.yml` through the companion `glossary.yml`. Inspect each configuration: [shared multi-collection file](campaigns/glossary.yml), which imports the
[synthetic party and spell data](campaigns/shared.yml). Inspect each configuration:
```sh ```sh
audita config validate --config first.yml audita config validate --config first.yml --glossary-file glossary.yml
audita config validate --config second.yml audita config validate --config second.yml --glossary-file glossary.yml
```
The equivalent arrangement uses separate complete files:
```sh
audita config validate --config first.yml --glossary-file party.yml --glossary-file spells.yml
``` ```
With a local service configured, process either campaign: With a local service configured, process either campaign:
```sh ```sh
audita process --config first.yml --output first-output.json transcript.json audita process --config first.yml --glossary-file glossary.yml --output first-output.json transcript.json
audita process --config second.yml --output second-output.json transcript.json audita process --config second.yml --glossary-file glossary.yml --output second-output.json transcript.json
``` ```
Edit `prompts.yml` for a local service before processing either campaign. The Edit `prompts.yml` for a local service before processing either campaign. The
first uses separate party and spell corrections; the second selects only party. first uses separate party and spell corrections; the second selects only party.
The spell input is a shared document and needs no Audita-specific vocabulary copy.

View File

@@ -2,3 +2,4 @@ config:
imports: imports:
- path: shared.yml - path: shared.yml
required: true required: true
schema_version: maximumdirect.glossary.v1

View File

@@ -0,0 +1,8 @@
schema_version: maximumdirect.glossary.v1
collections:
party:
entries:
- id: lyra
name: Lyra
category: character
description: A fictional adventurer.

View File

@@ -1,12 +1,13 @@
party: collections:
entries: party:
- id: lyra entries:
name: Lyra - id: lyra
category: character name: Lyra
description: A fictional adventurer. category: character
spells: description: A fictional adventurer.
entries: spells:
- id: shield entries:
name: Shield - id: shield
category: spell name: Shield
aliases: [Ward] category: spell
aliases: [Ward]

View File

@@ -0,0 +1,8 @@
schema_version: maximumdirect.glossary.v1
collections:
spells:
entries:
- id: shield
name: Shield
category: spell
aliases: [Ward]

View File

@@ -1,7 +1,9 @@
party: schema_version: maximumdirect.glossary.v1
entries: collections:
- id: jesters party:
name: Jesters entries:
category: faction - id: jesters
description: A traveling group of performers. name: Jesters
aliases: [Jester] category: faction
description: A traveling group of performers.
aliases: [Jester]

View File

@@ -1,7 +1,9 @@
party: schema_version: maximumdirect.glossary.v1
entries: collections:
- id: jesters party:
name: Jesters entries:
category: faction - id: jesters
description: A traveling group of performers. name: Jesters
aliases: [Jester] category: faction
description: A traveling group of performers.
aliases: [Jester]

View File

@@ -1,8 +1,9 @@
incoming: schema_version: maximumdirect.glossary.v1
instruction: Use the speaker's preferred spelling when supported by context. collections:
entries: incoming:
- id: speaker entries:
name: Mira Chen - id: speaker
category: person name: Mira Chen
aliases: [Mira] category: person
source_note: Prepared for this recording aliases: [Mira]
source_note: Prepared for this recording

View File

@@ -9,6 +9,7 @@ import (
"net/http/httptest" "net/http/httptest"
"os" "os"
"path/filepath" "path/filepath"
"reflect"
"runtime" "runtime"
"strings" "strings"
"sync" "sync"
@@ -63,7 +64,11 @@ func TestMaintainedProjectsWithControlledProvider(t *testing.T) {
t.Setenv("AUDITA_EXAMPLE_KEY", "") t.Setenv("AUDITA_EXAMPLE_KEY", "")
main = filepath.Join(dir, "config.yml") main = filepath.Join(dir, "config.yml")
} }
loaded, _, err := appconfig.Load(context.Background(), ck.Input{Source: ck.File(main)}, appconfig.Options{Overlay: tc.overlay}) var glossaryFiles []string
if tc.dir != "service" {
glossaryFiles = []string{filepath.Join(root, tc.dir, "glossary.yml")}
}
loaded, _, err := appconfig.Load(context.Background(), ck.Input{Source: ck.File(main)}, appconfig.Options{Overlay: tc.overlay, GlossaryFiles: glossaryFiles})
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -159,7 +164,7 @@ func TestExamplePromptEditIsCapturedOnNextLoad(t *testing.T) {
} }
} }
inspect := func() string { inspect := func() string {
loaded, _, err := appconfig.Load(context.Background(), ck.Input{Source: ck.File(filepath.Join(dir, "config.yml"))}, appconfig.Options{}) loaded, _, err := appconfig.Load(context.Background(), ck.Input{Source: ck.File(filepath.Join(dir, "config.yml"))}, appconfig.Options{GlossaryFiles: []string{filepath.Join(dir, "glossary.yml")}})
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -258,3 +263,29 @@ func TestRuntimeGlossaryExampleWorkflow(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
} }
func TestCampaignGlossaryArrangementsAgree(t *testing.T) {
_, file, _, ok := runtime.Caller(0)
if !ok {
t.Fatal("cannot locate examples")
}
dir := filepath.Join(filepath.Dir(file), "..", "..", "examples", "campaigns")
input := ck.Input{Source: ck.File(filepath.Join(dir, "first.yml"))}
load := func(names ...string) *appconfig.Acquisition {
t.Helper()
var files []string
for _, name := range names {
files = append(files, filepath.Join(dir, name))
}
result, _, err := appconfig.Load(context.Background(), input, appconfig.Options{GlossaryFiles: files})
if err != nil {
t.Fatal(err)
}
return result
}
combined := load("glossary.yml").Config.Application.GlossaryCollections
separate := load("party.yml", "spells.yml").Config.Application.GlossaryCollections
if !reflect.DeepEqual(combined, separate) {
t.Fatalf("combined=%+v separate=%+v", combined, separate)
}
}