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
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
from the invocation working directory. This flag does not select collections:
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`.
Operator sources may use ConfigKit imports. The selected main file provides the
base for an optional `overlays/<name>.yml`, optional `glossary.yml`, and recursive
`glossary/` YAML files. Without a main source, automatic companion files are not
loaded from the working directory. ConfigKit composes sources, resolves native
inheritance, applies explicit overrides, records derived defaults, and validates
the result. Its [configuration reference](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md)
base for an optional `overlays/<name>.yml` and automatic prompt companions.
Without a main source, automatic companions are not loaded from the working
directory. ConfigKit composes sources, resolves native inheritance, applies
explicit overrides, records derived defaults, and validates the result. Its
[configuration reference](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md)
owns native composition and provenance semantics.
Runtime files supplied with `--glossary-file` are first composed separately in
argument order using native imports and entry identities. Imports are resolved
beside their declaring files. The resolved wrapperless mapping is then assigned
to `glossary_collections` as one CLI override in the application load. Supplied
entry lists replace configured lists at that boundary; unrelated configured
collections remain. Omitted fields retain configured values, while explicit
empty and null values follow native assignment and decoding. Application and
overlay parsing and validation still apply. Final explanation records the CLI
assignment, while original runtime file and import source records belong to the
preliminary load rather than final provenance. See the [runtime file contract](integrations/transcript-glossary-files.md).
Explicit `--glossary-file` inputs use the shared `glossary@0.2.0` contract from
schemas distribution `2026.11.1` and the `maximumdirect.glossary.v1` marker.
The files are ordered native layers; imports within a file are native peers and
resolve beside their declaring file. Audita validates the completed envelope,
then projects collection entries as one CLI assignment to
`glossary_collections`. Supplied entry lists replace configured lists at that
boundary; unrelated configured collections remain. ConfigKit governs native
composition and assignment. Final explanation records the CLI assignment;
runtime files and imports remain recorded for collision protection. See the
[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
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;
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
configuration and overlay that define the desired pipeline and collection
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.
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
parent controls who can write those sources and which report destinations and
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 definitions are composed as application configuration, including the
optional companion inputs described by the [configuration reference](../config.md).
The [local example](../../examples/local/glossary.yml) provides a complete
collection. Configuration may contain empty collections; processing preflight
requires every glossary-correction entry to select at least one glossary entry.
The previous standalone `glossary` file format is not a processing input.
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:
Runtime glossary files supplied with `--glossary-file PATH` use the shared
`glossary@0.2.0` contract from schemas distribution `2026.11.1`, with marker
`maximumdirect.glossary.v1`. Audita bundles the selected schema and validates
completed inputs offline. The upstream [schema](https://schemas.maximumdirect.net/glossary/v0.2.0/schema.json)
and [semantics](https://schemas.maximumdirect.net/glossary/v0.2.0/semantics.md)
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).
```yaml
people:
instruction: Prefer the speaker's stated name when supported by context.
entries:
- id: speaker
name: Mira Chen
category: person
aliases: [Mira]
source_note: Prepared for this recording
schema_version: maximumdirect.glossary.v1
collections:
people:
entries:
- id: speaker
name: Mira Chen
category: person
aliases: [Mira]
```
See the [complete runtime glossary example](../../examples/README.md#runtime-glossary-input)
and [composition and selection rules](../config.md#loading-and-composition).
Files and their imports are protected by the existing output collision checks.
Each path is relative to the invocation working directory. A file can hold one
or many collections; repeated flags compose files in order. Native imports are
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
without running processing readiness checks.
Runtime glossary files use a preliminary ConfigKit load before the shared
application load. Processing retains its acquired source paths for output
collision checks; inspection receives the final native result and CLI origin.
Both sides of a native comparison use the same invocation file list.
Explicit shared glossary files use a preliminary ConfigKit load with ordered
layers, native imports, and entry identities. The shared-glossary adapter
validates the completed envelope against the bundled offline schema before
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
@@ -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
project's directory. `internal/cli/examples_integration_test.go` exercises the
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.
## 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
Treat the selected main file, imports, overlay, and automatically loaded
glossary and prompt companions as one trusted bundle. Choose the working
Treat the selected main file, imports, overlay, explicit glossary files, and
automatically loaded prompt companions as one trusted bundle. Choose the working
directory deliberately when using automatic discovery. A bundle can select
the provider, prompt content, and local files consumed by processing. Review
these sources before running with sensitive transcript data. Native inspection

View File

@@ -1,5 +1,6 @@
# Release Notes
- [Audita v4.3.0](v4.3.0.md)
- [Audita v4.2.0](v4.2.0.md)
- [Audita v4.1.0](v4.1.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
Audita's runtime glossary feature and the production/testing overlays in the
separate `audita-pipelines-dnd` repository are implemented. Recipe roles, stage
selections, profile aliases, installation and examples now belong to that
repository's [README](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),
and [input contracts](../integrations/transcript-glossary-files.md).
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.
Audita's shared glossary boundary accepts explicit `glossary@0.2.0` inputs;
see the [input contract](../integrations/transcript-glossary-files.md) and
[v4.3 migration guide](../migrations/v4.3.md). Narratio's adapter migration and
updates to the separate [audita-pipelines-dnd recipes](https://forge.maximumdirect.net/eric/audita-pipelines-dnd/src/branch/main/README.md)
remain separate work. They can pass prepared shared documents, choose explicit
files and selections, and review their CLI and output assumptions. Publishing
recipes and selecting an Audita release remain separate from implementation.

View File

@@ -225,6 +225,8 @@ format-validation matrices at every CLI boundary.
## Stage 6: Update Examples and Canonical Documentation
**Completed.** Integrated acceptance validation remains outstanding.
**Work**
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
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.
## 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:
```sh
audita config validate --config config.yml
audita preflight --smoke=false --config config.yml --output corrected.json transcript.json
audita process --config config.yml --output corrected.json transcript.json
audita config validate --config config.yml --glossary-file glossary.yml
audita preflight --smoke=false --config config.yml --glossary-file glossary.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
@@ -24,7 +24,7 @@ unless disabled. For an offline validator preview, from the same directory:
```sh
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 'TranscriptDescriptionBlock='
```
@@ -33,7 +33,7 @@ To preview the repair instruction and its output schema without inference:
```sh
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)"
```
@@ -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
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
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:
```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
--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;
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
@@ -92,20 +92,28 @@ and [ckprompt guide](https://forge.maximumdirect.net/base-layer/commandkit/src/t
## Shared glossary library
From `examples/campaigns`, `first.yml` and `second.yml` each consume the common
`shared.yml` through the companion `glossary.yml`. Inspect each configuration:
From `examples/campaigns`, `first.yml` and `second.yml` explicitly select the
[shared multi-collection file](campaigns/glossary.yml), which imports the
[synthetic party and spell data](campaigns/shared.yml). Inspect each configuration:
```sh
audita config validate --config first.yml
audita config validate --config second.yml
audita config validate --config first.yml --glossary-file glossary.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:
```sh
audita process --config first.yml --output first-output.json transcript.json
audita process --config second.yml --output second-output.json transcript.json
audita process --config first.yml --glossary-file glossary.yml --output first-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
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:
- path: shared.yml
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:
entries:
- id: lyra
name: Lyra
category: character
description: A fictional adventurer.
spells:
entries:
- id: shield
name: Shield
category: spell
aliases: [Ward]
collections:
party:
entries:
- id: lyra
name: Lyra
category: character
description: A fictional adventurer.
spells:
entries:
- id: shield
name: Shield
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:
entries:
- id: jesters
name: Jesters
category: faction
description: A traveling group of performers.
aliases: [Jester]
schema_version: maximumdirect.glossary.v1
collections:
party:
entries:
- id: jesters
name: Jesters
category: faction
description: A traveling group of performers.
aliases: [Jester]

View File

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

View File

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

View File

@@ -9,6 +9,7 @@ import (
"net/http/httptest"
"os"
"path/filepath"
"reflect"
"runtime"
"strings"
"sync"
@@ -63,7 +64,11 @@ func TestMaintainedProjectsWithControlledProvider(t *testing.T) {
t.Setenv("AUDITA_EXAMPLE_KEY", "")
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 {
t.Fatal(err)
}
@@ -159,7 +164,7 @@ func TestExamplePromptEditIsCapturedOnNextLoad(t *testing.T) {
}
}
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 {
t.Fatal(err)
}
@@ -258,3 +263,29 @@ func TestRuntimeGlossaryExampleWorkflow(t *testing.T) {
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)
}
}