Remove completed shared glossary planning documents
This commit is contained in:
@@ -1,290 +0,0 @@
|
||||
# Shared Glossary Implementation Plan
|
||||
|
||||
**Status:** Complete. Target release: Audita v4.3.0.
|
||||
|
||||
Implement the [shared glossary roadmap](shared-glossary.md). It owns the desired
|
||||
behavior and user decisions. This plan owns implementation order and validation.
|
||||
The source baseline is `1ded570`; subsequent planning commits contain no
|
||||
application changes.
|
||||
|
||||
Read `docs/development.md` and the applicable policies before implementation.
|
||||
Follow the agent, architecture, testing, documentation, OSS, and release policies;
|
||||
the user's explicit selection of v4.3.0 takes precedence over ordinary version
|
||||
selection. Keep application configuration version 3 and the `/v4` module path.
|
||||
|
||||
The stages are sized for sequential Luna prompts in one end-to-end sprint.
|
||||
Intermediate stages need not compile or pass the suite. Do not introduce temporary
|
||||
readers, compatibility wrappers, feature switches, or duplicate implementations
|
||||
to make intermediate commits independently runnable. Run focused checks when
|
||||
their dependencies are ready, then validate the integrated end state once.
|
||||
|
||||
The user selected explicit-file loading and retirement of automatic glossary
|
||||
companion discovery. No companion-acquisition prototype or open product decision
|
||||
remains. Stage 4 removes the old discovery path.
|
||||
|
||||
## Implementation Decisions
|
||||
|
||||
- Pin `glossary@0.2.0` from schemas distribution `2026.11.1`, commit
|
||||
`f7e3cedeca11ed903311cdf29ca4d81fb1f216b7`. The marker remains
|
||||
`maximumdirect.glossary.v1`. No schema discovery, old-format reader, upstream
|
||||
validator executable, or dependency upgrade is needed.
|
||||
- Keep the public runtime interface: repeated `--glossary-file PATH`, with paths
|
||||
relative to the invocation working directory. Each complete document can
|
||||
contain any number of collections permitted by the contract. Loading does not
|
||||
select collections. Existing root/stage selections and protection behavior stay.
|
||||
- Retire automatic `glossary.yml` and recursive `glossary/` discovery. Callers use
|
||||
explicit `--glossary-file` arguments, including for files at those locations.
|
||||
Keep native main configuration discovery, inline application vocabulary, and
|
||||
automatic prompt companions. No glossary acquisition-only configuration field,
|
||||
replacement scan, or new file-list configuration API is needed.
|
||||
- Use ConfigKit v1.4.0 for acquisition, imports, inheritance, layers, and identity
|
||||
checks. Use the existing jsonschema/v6 dependency for structural validation.
|
||||
Audita supplies processing-readiness checks, not another native parser or
|
||||
duplicate ID validator.
|
||||
- Validate completed shared inputs before projecting away fields or distinctions.
|
||||
Imported authoring fragments need not independently satisfy the root schema.
|
||||
Complete runtime arguments are ordered native layers; imports within each
|
||||
argument remain native peers. Repeated schema markers therefore do not collide.
|
||||
- Preserve runtime CLI precedence: supplied collection entry lists replace
|
||||
configured lists at the assignment boundary; unrelated configured collections
|
||||
remain. ConfigKit governs omitted/null/empty assignments and record composition.
|
||||
Do not introduce cross-source inheritance beyond the existing supported model.
|
||||
- Keep a small one-way projection into application vocabulary: project `entries`
|
||||
from shared collections. Collection provenance and unrelated extensions need
|
||||
not enter prompts. In particular, a collection extension named `instruction`
|
||||
must not be copied into the application's executable instruction setting.
|
||||
Entry extensions remain inert. No replacement instruction API or preservation
|
||||
workflow is part of this sprint.
|
||||
- Preserve ordinary native inspection, diagnostics, secrets bootstrap, source
|
||||
collision protection, and preflight responsibilities. Do not redesign the
|
||||
runner, providers, reports, transcript formats, or correction validators.
|
||||
|
||||
## Stage 1: Bundle and Validate the Selected Contract
|
||||
|
||||
**Completed.**
|
||||
|
||||
**Work**
|
||||
|
||||
1. Add an internal `internal/appconfig/sharedglossary` package for the file-boundary
|
||||
adapter. Keep ConfigKit and schema-library details out of modules and the runner.
|
||||
2. Copy the unmodified `glossary/v0.2.0/` directory from the pinned distribution
|
||||
into its `assets/glossary/v0.2.0/` tree, including the semantic document and
|
||||
synthetic examples. Embed the schema and register it under its canonical ID.
|
||||
Retain copied documents' relative references through source-distribution links
|
||||
or supporting upstream documents as appropriate; do not rewrite the contract.
|
||||
3. Compile the selected schema once per adapter instance and reuse it within an
|
||||
acquisition. Register local resources and disable unresolved network resource
|
||||
loading. Follow the repository's existing response-schema compiler patterns
|
||||
where useful, without combining glossary and LLM-response registries.
|
||||
4. Expose validation of a resolved `map[string]any` envelope. Preserve the original
|
||||
map; schema validation must not coerce, default, or mutate values. Return errors
|
||||
retaining useful field locations and caller-supplied file/source context.
|
||||
5. Add the schema component to `docs/oss/attribution.md`, with pinned source,
|
||||
material scope, copyright and CC0-1.0 identification, and the verbatim license
|
||||
text under `docs/oss/licenses/`, following the OSS House Format. Review the
|
||||
project third-party statement for any required reference update.
|
||||
|
||||
**Evidence**
|
||||
|
||||
At the adapter boundary, test an ordinary valid envelope, missing/wrong marker,
|
||||
missing entries, invalid known field types, nullable aliases/plural, and permitted
|
||||
extensions. Include upstream synthetic examples without copying its complete
|
||||
test suite. Demonstrate offline compilation/validation. ID uniqueness belongs to
|
||||
the native-loading tests in Stage 2, not a new handwritten validator here.
|
||||
|
||||
## Stage 2: Compose Runtime Shared Documents Natively
|
||||
|
||||
**Completed.**
|
||||
|
||||
**Work**
|
||||
|
||||
1. Move the runtime-file composition block from `internal/appconfig.Load` into the
|
||||
shared-glossary adapter. Accept `context.Context` and an ordered list of
|
||||
`ck.Input` sources for explicitly supplied glossary files.
|
||||
2. Keep imports enabled. Load earlier arguments as separate underlay groups and
|
||||
the final argument as the main input through `ck.LoadLayered[map[string]any]`,
|
||||
preserving existing relative-import behavior and native ordered precedence.
|
||||
3. Register entry identities at `collections/<any mapping key>/entries` using
|
||||
`SequenceIdentityMatching` with identity field `id`. Do not register at the
|
||||
old wrapperless root. Reuse/adapt `config.GlossaryEntryIdentity` rather than
|
||||
writing a second identity algorithm.
|
||||
4. Apply Stage 1 structural validation to the completed native result. Keep the
|
||||
distinction between legal layering of an identity and duplicate identities
|
||||
within a final collection. Do not require each imported contribution to carry
|
||||
a marker, and do not synthesize missing markers to repair supplied data.
|
||||
5. Return the completed envelope plus native source records needed by acquisition
|
||||
and collision protection. Propagate cancellation and native errors. No files
|
||||
means no shared input contribution; it does not mean an invalid empty document.
|
||||
|
||||
**Evidence**
|
||||
|
||||
Use real temporary files and native loading. Cover one multi-collection document,
|
||||
multiple single-collection documents, mixed arrangements, ordered identity
|
||||
updates, relative imported fragments, duplicate IDs, and repeated equal markers
|
||||
across layers. One focused failure case is enough to establish propagation of a
|
||||
native unsupported input; do not reproduce upstream parser tests or freeze its
|
||||
current restrictions as permanent Audita behavior.
|
||||
|
||||
## Stage 3: Integrate Runtime Vocabulary with Application Loading
|
||||
|
||||
**Completed.**
|
||||
|
||||
**Work**
|
||||
|
||||
1. Replace the old wrapperless runtime-load block in `internal/appconfig.Load`
|
||||
with Stage 2 acquisition. Retain the existing secrets-bootstrap ordering and
|
||||
prepared main source, embedded PromptKit resources, overlay, and CLI overrides.
|
||||
2. Project each validated shared collection to an application contribution
|
||||
containing its `entries` only. Preserve entry values accepted by the contract;
|
||||
the existing native typed binding can produce `config.GlossaryEntry` records.
|
||||
Do not YAML/JSON round-trip maps to obtain a typed projection.
|
||||
3. Assign projected collections through the existing native
|
||||
`ck.Override{Path: ck.Keys("glossary_collections"), Flag: "--glossary-file"}`
|
||||
boundary. This preserves list replacement, unrelated configured collections,
|
||||
and the current effective-config CLI origin without recreating precedence.
|
||||
4. Keep `GlossarySources` evidence for runtime files and imports. Preserve
|
||||
`GlossaryInputError` wrapping and `errors.As`/cancellation behavior so the CLI
|
||||
continues to use native error formatting and existing input/runtime outcomes.
|
||||
5. Use the same acquisition from `acquireApplication`, `loadApplication`,
|
||||
`loadPromptEngine`, and `loadProcessInputs`. Do not add per-command parsers.
|
||||
Configuration comparison continues to apply the same files to both sides.
|
||||
|
||||
**Evidence**
|
||||
|
||||
Update `internal/appconfig/runtime_glossary_test.go` and its error/presence cases
|
||||
for shared envelopes. Verify effective selected vocabulary and native origins,
|
||||
runtime replacement of configured entry lists, retention of unrelated collections,
|
||||
and source paths for imports. A shared collection's `instruction` extension must
|
||||
be accepted even when its value is not an application instruction string, and
|
||||
must not be bound as executable guidance. No legacy instruction-preservation
|
||||
assertions are required.
|
||||
|
||||
## Stage 4: Retire Automatic Glossary Companion Discovery
|
||||
|
||||
**Completed.**
|
||||
|
||||
**Work**
|
||||
|
||||
1. Delete the `glossaryImports` synthetic import manifest and its underlay input
|
||||
from `internal/appconfig/config.go`. Remove glossary-discovery-only helpers or
|
||||
wiring that become unused. Do not replace them with another scan or discovery
|
||||
mechanism.
|
||||
2. Retain the automatic PromptKit import manifest and its native `MainRelative`
|
||||
binding, embedded resources, configuration search/selection, secrets bootstrap,
|
||||
overlays, and normal application imports. Inline `glossary_collections` remain
|
||||
supported. Removing glossary discovery does not remove other companion types.
|
||||
3. Files named `glossary.yml` or located in `glossary/` are ordinary explicit
|
||||
inputs when supplied with `--glossary-file`. Native imports from those selected
|
||||
inputs still work, and all selected/imported source paths stay protected
|
||||
against output collisions.
|
||||
4. Keep runtime precedence unchanged. There is no remaining automatic glossary
|
||||
underlay: callers migrating to explicit files now receive CLI assignment
|
||||
priority over main/overlay vocabulary and whole-list replacement at that
|
||||
boundary. No lower-priority compatibility mode or precedence switch is needed.
|
||||
|
||||
**Evidence**
|
||||
|
||||
Retire assertions that require automatic glossary discovery in
|
||||
`internal/appconfig/glossary_test.go` and source/discovery tests; retain coverage
|
||||
of ordinary inline/imported application vocabulary and unrelated acquisition.
|
||||
Add a focused regression showing that invalid nearby `glossary.yml` and nested
|
||||
`glossary/` content do not affect loading when unselected. Show that the same
|
||||
locations work as explicit shared inputs, and selected imports remain protected.
|
||||
Retain automatic-prompt and main-discovery checks. No filesystem access trace or
|
||||
custom sandbox is needed to establish removal of the discovery path.
|
||||
|
||||
## Stage 5: Verify Selection, Preflight, and CLI Integration
|
||||
|
||||
**Completed.**
|
||||
|
||||
**Work**
|
||||
|
||||
1. Keep `glossary.Select`, protected vocabulary, root/stage selection resolution,
|
||||
and `framework/preflight.ProcessingPlan` on their current semantics. Change
|
||||
types or helper boundaries only where needed to consume the adopted data.
|
||||
2. Preserve empty-schema-data versus processing-readiness distinctions: inspection
|
||||
can accept empty collections; glossary correction needs at least one selected
|
||||
entry; nonexistent selected collections fail. Loading never selects everything.
|
||||
3. Update CLI help for the shared file format while retaining argument grammar.
|
||||
Adapt fixtures across CLI acquisition, native inspection/comparison, subprocess
|
||||
processing, and example integration tests. Preserve existing exit/stream rules.
|
||||
4. Retain ordinary preflight local planning and optional provider smoke checks.
|
||||
Use controlled HTTP responses for representative processing verification;
|
||||
real providers, Narratio installations, and external recipe repositories are
|
||||
not required to complete the sprint.
|
||||
|
||||
**Evidence**
|
||||
|
||||
Prove a representative shared multi-collection file reaches the intended
|
||||
correction/protection views, and repeated files work through native inspection
|
||||
and comparison. Verify preflight and processing reject malformed data or missing
|
||||
required selections before correction requests. Retain a local-only preflight
|
||||
case using real glossary inputs and a synthetic transcript. Existing collision
|
||||
tests should cover a glossary import as a protected source. Avoid duplicating
|
||||
format-validation matrices at every CLI boundary.
|
||||
|
||||
## Stage 6: Update Examples and Canonical Documentation
|
||||
|
||||
**Completed.**
|
||||
|
||||
**Work**
|
||||
|
||||
1. Convert maintained runtime and former companion glossary files, including
|
||||
`examples/local/glossary.yml`, to shared envelopes. Update example commands
|
||||
and integration fixtures to pass those files explicitly with `--glossary-file`.
|
||||
Keep inline application `glossary_collections` examples in the application
|
||||
format. Include a generic domain and a synthetic Narratio-style
|
||||
multi-collection/spell example, plus an
|
||||
equivalent separate-file invocation. No application-specific vocabulary copy
|
||||
should be needed to use a shared spell input.
|
||||
2. Update `docs/integrations/transcript-glossary-files.md`, `docs/config.md`,
|
||||
`docs/cli.md`, `examples/README.md`, and affected internal acquisition guides.
|
||||
Identify the exact selected contract, marker, native composition and assignment
|
||||
boundaries, selections, and retirement of automatic glossary discovery.
|
||||
Distinguish retained automatic prompt companions. Link upstream for shared
|
||||
fields and ConfigKit behavior rather than reproduce their manuals.
|
||||
3. Add `docs/migrations/v4.3.md` explaining the envelope cutover, file arrangements,
|
||||
explicit arguments replacing automatic companion discovery, and the move from
|
||||
companion underlay priority to runtime CLI priority. Explain list replacement
|
||||
and retained collection selection. Include no legacy reader, automatic
|
||||
converter, glossary-instruction migration, or new configuration field for
|
||||
file selection.
|
||||
4. Draft `docs/releases/v4.3.0.md` and update the release index with the exact
|
||||
release title, migration impact, and required tag-specific licensing footer.
|
||||
This is preparation only; do not push or publish a release.
|
||||
5. Update the deferred Narratio adoption entry in `docs/roadmap/future.md` to
|
||||
reference the delivered shared boundary. Do not implement Narratio or modify
|
||||
its adapter/recipe repositories in this sprint.
|
||||
|
||||
**Evidence**
|
||||
|
||||
Validate maintained examples through the application integration tests and check
|
||||
affected links and `git diff --check`. Preserve upstream contract assets verbatim
|
||||
and verify their selected source/licensing record. Do not retire this plan as
|
||||
completed until the integrated sprint has actually passed its acceptance checks.
|
||||
|
||||
## Stage 7: Complete Integrated Validation and Cleanup
|
||||
|
||||
**Completed.** The integrated offline suite and build passed with Go 1.27.4,
|
||||
`GOWORK=off GOTOOLCHAIN=local GOPROXY=off GOSUMDB=off`. Focused tests cover
|
||||
native composition, schema validation, selection and protection, inspection,
|
||||
preflight, processing, collisions, and maintained examples. The bundled schema
|
||||
assets and license match the pinned source. Local documentation links and
|
||||
`git diff --check` passed. No real provider or external application was used.
|
||||
|
||||
Use Go 1.27.4 as documented in `docs/release.md`. Prepare dependencies if needed
|
||||
before running the offline suite; dependency upgrades are not part of adoption.
|
||||
|
||||
1. Run focused tests for `internal/appconfig/...`, `internal/core/config`,
|
||||
`internal/core/glossary`, `internal/framework/preflight`, and `internal/cli`
|
||||
after their respective implementations become runnable. Reuse unchanged
|
||||
passing checks rather than repeat them at each stage.
|
||||
2. Run `go test ./...` and `go build -o ./bin/audita ./cmd/audita` with
|
||||
`GOWORK=off GOTOOLCHAIN=local GOPROXY=off GOSUMDB=off` for the final integrated
|
||||
implementation. Keep inference/network boundaries controlled by existing tests.
|
||||
3. Review the final diff for wrapperless file readers, redundant validators,
|
||||
instruction compatibility work, serialization round trips, or temporary
|
||||
scaffolding. Remove only obsolete code and assertions belonging to this change.
|
||||
4. Check all feature-roadmap acceptance outcomes against evidence. Record any
|
||||
remaining gap rather than changing tests to conceal it. Follow ordinary agent
|
||||
commit discipline; publication remains a separate authorized task.
|
||||
@@ -1,156 +0,0 @@
|
||||
# Shared Glossary Remediation
|
||||
|
||||
**Status:** Complete.
|
||||
|
||||
Review covers all seven stages of [the implementation plan](implementation.md),
|
||||
including the pinned assets, native composition, application projection, retired
|
||||
discovery, CLI/preflight integration, examples, and documentation. The reviewed
|
||||
implementation is commit `00a36284516b7d87730430beffb07df8fd13f6a3`
|
||||
("Clarify completed glossary roadmap markers").
|
||||
No application code was changed during review.
|
||||
|
||||
The Go 1.27.4 offline test suite and build passed. The copied glossary directory
|
||||
and CC0 license match the selected upstream source byte for byte. Changed
|
||||
documents' local links and representative documented validation commands passed.
|
||||
The initial review identified R1 and no unintended requirement strengthening.
|
||||
A follow-up integration audit at commit
|
||||
`8699ec442ab9d4747d1244ad7b6980d5f13fefda` identified R2. That audit traced the
|
||||
new adapter through native inspection/comparison, processing and preflight,
|
||||
selection/protection, bootstrap, and output source checks. Targeted CLI integration
|
||||
tests passed; executable probes confirmed extension acceptance and imported-file
|
||||
hardlink collision protection. The application code is unchanged from the initial
|
||||
review. Completion status for each finding is recorded below.
|
||||
|
||||
## R1: Schema errors lose field-level source attribution
|
||||
|
||||
**Priority:** P3. **Status:** Complete. **Plan stage:** 2, surfaced through Stage 3.
|
||||
|
||||
**Completion:** Report leaf schema failures through their instance paths so native
|
||||
metadata identifies the contributing source, with root/parent fallback for absent
|
||||
fields. Regression coverage verifies an earlier input's invalid value and missing
|
||||
field, including escaped collection names. Go 1.27.4 offline appconfig and CLI
|
||||
tests passed.
|
||||
|
||||
**Location:** [shared glossary loading](../../internal/appconfig/sharedglossary/load.go),
|
||||
lines 34–36.
|
||||
|
||||
### Finding
|
||||
|
||||
The native validation callback submits every JSON Schema error with
|
||||
`validation.Error(ck.Keys(), err.Error())`. The error text contains the JSON
|
||||
instance path, but the native diagnostic path is always the root. For layered
|
||||
inputs, ConfigKit consequently associates the diagnostic with the main input
|
||||
(the last supplied file), even when the invalid field came from an earlier file.
|
||||
|
||||
Reproduced with two explicit glossary inputs:
|
||||
|
||||
```yaml
|
||||
# first.yml
|
||||
schema_version: maximumdirect.glossary.v1
|
||||
collections:
|
||||
first:
|
||||
entries: [{id: a, name: 17, category: person}]
|
||||
```
|
||||
|
||||
```yaml
|
||||
# last.yml
|
||||
schema_version: maximumdirect.glossary.v1
|
||||
collections:
|
||||
last:
|
||||
entries: []
|
||||
```
|
||||
|
||||
Passing `first.yml` and then `last.yml` to `config show --scope=app` correctly
|
||||
fails with status 2. Its diagnostic identifies `/collections/first/entries/0/name`
|
||||
inside the message, but attaches the native location `<root> (source-1:1:1)`;
|
||||
the source inventory identifies `source-1` as `last.yml`, not `first.yml`.
|
||||
|
||||
Input rejection is correct. The issue is misleading file attribution when
|
||||
operators diagnose a composed glossary, contrary to the plan's useful
|
||||
field/source-context objective.
|
||||
|
||||
### Recommended change
|
||||
|
||||
Use the structured JSON Schema validation error's offending instance location
|
||||
when reporting through ConfigKit, so its existing nearest-source metadata can
|
||||
locate the contributing field. Traverse nested schema errors as needed without
|
||||
emitting redundant wrapper diagnostics. Retain root/nearest-parent fallback for
|
||||
errors that genuinely concern the root or an absent field; no universal exact
|
||||
source-location guarantee is required.
|
||||
|
||||
Keep native `LoadError` classification and CLI presentation. Do not introduce a
|
||||
separate provenance tracker, error taxonomy, or custom diagnostic renderer.
|
||||
|
||||
### Acceptance
|
||||
|
||||
Add one regression at the native loading or CLI boundary with an invalid field
|
||||
in an earlier input and a valid last input. Verify that the diagnostic points to
|
||||
the affected collection/entry field and its contributing source rather than
|
||||
the last document's root. Preserve the existing failure outcome; avoid assertions
|
||||
on complete diagnostic wording or generated source IDs.
|
||||
|
||||
## R2: Shared-file assignment conflicts with disjoint native glossary overrides
|
||||
|
||||
**Priority:** P2. **Status:** Complete. **Plan stages:** 3 and 5.
|
||||
|
||||
**Completion:** File contributions use entry-level native assignments when caller
|
||||
overrides share the glossary namespace; empty collection maps add no assignment.
|
||||
Ordinary loads retain one batch assignment to avoid consuming an override record
|
||||
per collection. Regression coverage verifies disjoint populated/empty inputs,
|
||||
native CLI origins, genuine overlap rejection, and a large collection batch.
|
||||
Existing list-replacement tests, the full Go 1.27.4 offline suite, and the
|
||||
application build passed.
|
||||
|
||||
**Locations:** [application acquisition](../../internal/appconfig/config.go),
|
||||
lines 94 and 116–122; [native command wiring](../../internal/cli/app_wiring.go).
|
||||
|
||||
### Finding
|
||||
|
||||
The native application scope supports `--set` overrides. Application acquisition
|
||||
copies those overrides, then appends the shared-file projection as another CLI
|
||||
override at the whole `/glossary_collections` path. ConfigKit correctly rejects
|
||||
ancestor/descendant override records, so the file assignment conflicts with every
|
||||
user override beneath that path, including an entirely different collection.
|
||||
|
||||
For a shared file defining only `people`, this invocation fails with status 2 and
|
||||
`override.overlap` at `/glossary_collections`:
|
||||
|
||||
```sh
|
||||
audita config show --scope=app --config config.yml \
|
||||
--glossary-file shared.yml \
|
||||
--set '/glossary_collections/other/entries=[{"id":"b","name":"Bob","category":"person"}]'
|
||||
```
|
||||
|
||||
The `--set` succeeds without the file. A disjoint `/context/description` override
|
||||
also succeeds with the file. Even an empty shared envelope with `collections: {}`
|
||||
causes the glossary override conflict, despite contributing no vocabulary.
|
||||
|
||||
This is an inherited integration gap in the runtime-file assignment strategy,
|
||||
not a regression introduced by the shared-schema adapter: the parent override
|
||||
was already present before this sprint. It still prevents ordinary native
|
||||
configuration controls from working alongside the adopted shared-file interface
|
||||
when their logical contributions are disjoint.
|
||||
|
||||
### Recommended change
|
||||
|
||||
Represent disjoint file-derived and caller-supplied glossary contributions as
|
||||
non-overlapping native assignments. Scope file contributions to the data they
|
||||
actually assign rather than claiming the entire glossary mapping, and avoid a
|
||||
parent assignment for an empty collection map. Keep ConfigKit responsible for
|
||||
binding, recorded origins, and native overlap checks for genuinely overlapping
|
||||
assignments.
|
||||
|
||||
Preserve supplied entry-list replacement, unrelated configured vocabulary, and
|
||||
native value semantics. Consider the native override-record budget when choosing
|
||||
assignment granularity; do not introduce a separate application collection cap
|
||||
or a custom override parser/merge framework. This finding does not require
|
||||
defining a new precedence rule for two flags assigning the same field.
|
||||
|
||||
### Acceptance
|
||||
|
||||
Add a native-command regression combining a shared `people` collection with
|
||||
`--set` for `other`; both must appear in effective configuration. Also cover an
|
||||
empty shared envelope with a valid glossary override. Preserve native CLI origins
|
||||
and existing file-to-configuration list replacement. Test resulting values and
|
||||
failure classifications rather than complete diagnostic snapshots or internal
|
||||
override-record counts.
|
||||
@@ -1,365 +0,0 @@
|
||||
# Shared Glossary Adoption
|
||||
|
||||
**Status:** Implemented for Audita v4.3.0; publication is separate.
|
||||
|
||||
## Purpose
|
||||
|
||||
Adopt the Maximum Direct shared glossary contract so Narratio can pass prepared
|
||||
vocabulary directly to Audita, and operators can reuse that vocabulary with
|
||||
Notarius and relevant Scriptorium prompts without requiring duplicate vocabulary
|
||||
files.
|
||||
|
||||
This roadmap responds to the [Narratio feature request](narratio-shared-glossary-feature-request.md).
|
||||
It defines the target and work areas; the [implementation plan](implementation.md)
|
||||
owns the ordered implementation steps. The user's subsequent direction governs
|
||||
release selection and scope: release as v4.3.0, expect standard-schema glossary
|
||||
files, support one or multiple explicitly supplied files, retire automatic
|
||||
glossary companion discovery, and spend no effort preserving glossary-file
|
||||
instruction workflows. Adopt the released ConfigKit-aligned glossary contract
|
||||
through its defined native loading boundary.
|
||||
|
||||
## Current Baseline
|
||||
|
||||
The baseline is Audita v4.2.0, with the feature request recorded at repository
|
||||
commit `4c2b11aa45579d89f04ac2ab4903c7cb036bef72`.
|
||||
|
||||
- Application configuration uses version 3. `glossary_collections` contains named
|
||||
collections with `entries` and an optional executable `instruction` string.
|
||||
Automatic `glossary.yml` and recursive `glossary/` YAML companions supply
|
||||
wrapperless collections through ConfigKit imports.
|
||||
- Repeated `--glossary-file` arguments compose wrapperless YAML mappings in a
|
||||
preliminary ConfigKit load, in argument order, using native imports,
|
||||
inheritance, and entry identities. The resolved mapping becomes one CLI
|
||||
assignment to `glossary_collections` in the application load. Supplied entry
|
||||
lists replace configured lists at that boundary; unrelated configured
|
||||
collections and omitted fields remain subject to native assignment semantics.
|
||||
- Runtime collection instructions currently reach proposal prompts and remain
|
||||
in correction-repair conversations. Entry extensions are accepted, but the
|
||||
collection type does not represent arbitrary collection extensions or defined
|
||||
provenance. There is no shared envelope or shared-schema validation boundary.
|
||||
- Typed validation checks several glossary values, but does not fully express
|
||||
shared required-field and null distinctions. Selection also deduplicates
|
||||
collection/entry identities; that is not a substitute for validating completed
|
||||
shared inputs.
|
||||
- Root and per-stage `glossaries` and `protected_terms` select vocabulary
|
||||
independently. Loading collections does not select them. Glossary correction
|
||||
requires at least one selected entry at processing readiness; empty collections
|
||||
remain valid configuration.
|
||||
- Processing, standalone preflight, and native configuration-consuming commands
|
||||
share application acquisition. Preflight and processing share local readiness
|
||||
planning; native inspection does not require a processing-ready pipeline.
|
||||
|
||||
The current [input](../integrations/transcript-glossary-files.md),
|
||||
[configuration](../config.md), and [CLI](../cli.md) documents own the implemented
|
||||
contracts. Main implementation boundaries are `internal/appconfig`,
|
||||
`internal/core/config`, `internal/core/glossary`, framework preflight and prompt
|
||||
context, and CLI acquisition.
|
||||
|
||||
## Target Upstream Contract
|
||||
|
||||
Adopt `glossary@0.2.0` from schemas distribution `2026.11.1`, whose tagged source
|
||||
is commit `f7e3cedeca11ed903311cdf29ca4d81fb1f216b7`. Its operator document marker
|
||||
remains `maximumdirect.glossary.v1`; it is distinct from both version numbers and
|
||||
from Audita's application configuration version. The marker alone does not
|
||||
identify the exact schema revision, so retain the explicit schema and distribution
|
||||
pins.
|
||||
|
||||
Use the versioned schema and semantics together:
|
||||
|
||||
- [Canonical schema](https://schemas.maximumdirect.net/glossary/v0.2.0/schema.json)
|
||||
and [semantics](https://schemas.maximumdirect.net/glossary/v0.2.0/semantics.md).
|
||||
- [Published source](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.1/glossary/v0.2.0),
|
||||
[inventory](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.1/catalog.json),
|
||||
[validation guide](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.1/docs/validation.md),
|
||||
and [compatibility guidance](https://forge.maximumdirect.net/eric/schemas/src/tag/2026.11.1/docs/compatibility.md).
|
||||
|
||||
The released semantics define ConfigKit v1.4.0's public mapping-root handoff as
|
||||
part of full conformance. Native acquisition and resolution precede JSON Schema
|
||||
validation and the applicable semantic checks. ConfigKit owns syntax, reserved
|
||||
controls, numeric binding, and resource limits; supported resolved values are
|
||||
preserved. Those rules are part of the selected contract, rather than exceptions
|
||||
to Audita's support. Audita already uses this ConfigKit version.
|
||||
|
||||
Use this one selected published contract. Supporting older schema revisions is
|
||||
not required. The upstream developer validator's selection of the highest version
|
||||
in its local catalog does not change Audita's exact bundled pin or introduce
|
||||
runtime catalog discovery.
|
||||
|
||||
Bundle the selected glossary schema and adjacent semantic document from that
|
||||
distribution, with their provenance and applicable licensing material. Register
|
||||
the schema locally so ordinary validation works offline. No schema-registry
|
||||
lookup, moving latest inventory, or dependency on the schemas repository's
|
||||
internal Go validation harness is needed. Audita already imports JSON Schema
|
||||
and YAML libraries; assess their use at the existing adapter boundary before
|
||||
adding a dependency. Party and campaign schema adoption is outside this work.
|
||||
|
||||
## Targeted End State
|
||||
|
||||
### Three separate boundaries
|
||||
|
||||
- **Operator-provided glossary files:** Use the shared envelope and its collection
|
||||
and entry definitions. There is no legacy glossary-file compatibility
|
||||
requirement. Native loading follows the ConfigKit boundary defined by the
|
||||
selected shared contract.
|
||||
- **Application configuration:** Plan additive changes where needed. Existing
|
||||
collection-selection settings already refer to names independently of how
|
||||
collections are distributed across files. Supporting the shared file format
|
||||
does not require a new application configuration namespace or version.
|
||||
- **Internal representation:** Choose the simplest maintainable representation,
|
||||
acquisition flow, and module-facing views. Existing Go types and loading phases
|
||||
have no compatibility requirement. A one-way projection into processing views
|
||||
is appropriate when useful; there is no need to retain a legacy vocabulary
|
||||
model or build conversion machinery to preserve it.
|
||||
|
||||
### Shared documents and native composition
|
||||
|
||||
`--glossary-file PATH` accepts the shared `schema_version` and `collections`
|
||||
envelope in ConfigKit-supported YAML or equivalent JSON. Support one file with
|
||||
one or multiple collections, several files each containing one collection, and
|
||||
mixtures of files containing different numbers of collections. One flag occurrence
|
||||
supplies a single file; repeated occurrences supply files composed in argument
|
||||
order. Preserve paths relative to the invocation working directory and separate
|
||||
collection-selection controls. Narratio's prepared document needs no envelope
|
||||
removal or field renaming.
|
||||
Replace the standalone wrapperless file format directly; a legacy reader or
|
||||
conversion mode is not required.
|
||||
|
||||
Explicit `--glossary-file` arguments are the glossary-file loading interface.
|
||||
Retire automatic discovery of `glossary.yml` and recursive `glossary/` files
|
||||
beside the main configuration. File names and locations remain the caller's
|
||||
choice; those former companion paths can still be supplied explicitly. Operators,
|
||||
launch scripts, and Narratio list the intended files. No replacement automatic
|
||||
scan or application configuration file-list field is needed for this scope.
|
||||
Inline application `glossary_collections`, native configuration imports, automatic
|
||||
prompt companions, and main configuration discovery retain their existing roles.
|
||||
|
||||
ConfigKit continues to own imports, layering, inheritance, entry identities,
|
||||
presence, overrides, and source evidence. Authoring fragments can contribute to
|
||||
a completed document without independently satisfying the complete schema.
|
||||
Validate completed shared documents at the composition boundary, before a typed
|
||||
projection can erase invalid field types or presence distinctions. Do not fill
|
||||
missing required shared fields merely to make a supplied document pass.
|
||||
|
||||
Use ConfigKit's ordered layers for complete selected documents. Their repeated
|
||||
`schema_version` values must not be forced into a strict peer-import group,
|
||||
where ConfigKit would reject overlapping scalar definitions even when equal.
|
||||
Authoring fragments can still use native imports and their normal strict
|
||||
composition rules. Imports within an explicitly selected shared file remain
|
||||
supported; retiring automatic discovery does not disable those imports.
|
||||
|
||||
Preserve the runtime vocabulary's CLI priority over configured vocabulary,
|
||||
native entry-list replacement at the CLI assignment boundary, unrelated
|
||||
configured collections, and native handling of omitted, empty, and null values,
|
||||
subject to validity of the resulting shared data. No additional cross-source
|
||||
inheritance behavior or Narratio-specific merge policy is required. The current
|
||||
preliminary-load/final-load arrangement is an implementation starting point,
|
||||
not a required sequence of internal operations.
|
||||
|
||||
File ordering, collection selection, and documented precedence are the
|
||||
operator-facing requirements. The particular ConfigKit calls used to achieve
|
||||
them are implementation choices. Reuse the two-load arrangement if it remains
|
||||
straightforward, or restructure it where that reduces complexity; forcing all
|
||||
inputs into one load is not an objective.
|
||||
|
||||
Application configuration version 3 and its `glossary_collections` namespace
|
||||
remain the public starting point. Refactor the internal representation freely
|
||||
to avoid duplicate glossary models or awkward adapters. Use shared acquisition
|
||||
for all commands accepting runtime glossary files, and retain shared data where
|
||||
needed for validation or forwarding. Module-facing views may project only the
|
||||
fields they use.
|
||||
|
||||
Shared inputs are domain data. An extension named `instruction` has no executable
|
||||
meaning. No consumers rely on instructions supplied through glossary files, so
|
||||
this work includes no instruction-compatibility machinery, replacement instruction
|
||||
map, or instruction-migration project. Ordinary application prompt configuration
|
||||
continues to own task instructions.
|
||||
|
||||
### Contract conformance and task readiness
|
||||
|
||||
Apply the pinned contract's native loading, structural schema, and semantic rules
|
||||
to completed shared data. In particular:
|
||||
|
||||
- Preserve the contract's required-field, omitted, null, and empty distinctions,
|
||||
including nullable aliases and plural forms. Do not trim, case-fold, coerce,
|
||||
or default shared values as a schema-repair step.
|
||||
- Accept permitted extensions at envelope, collection, provenance, and entry
|
||||
levels when their values are supported by ConfigKit. Retain those extensions
|
||||
when forwarding a shared document, subject to native value representation;
|
||||
internal task views can select only the fields they use. Acceptance does not
|
||||
imply interpretation, and serialization formatting need not be preserved.
|
||||
- Reject duplicate entry IDs within a completed collection using exact string
|
||||
comparison. IDs can repeat across different collections. Do not add uniqueness
|
||||
requirements for display names, aliases, or categories, or confuse legitimate
|
||||
native layering of an identity with duplicate final entries.
|
||||
- Use ConfigKit's parsing and decoding behavior, including its native failure
|
||||
diagnostics. Structural schema validity alone does not establish full
|
||||
conformance; native loading and semantic checks are also part of the contract.
|
||||
|
||||
Reuse the existing validation owners. ConfigKit's registered sequence identities
|
||||
provide exact string-ID uniqueness, including final-result checks; JSON Schema
|
||||
validation owns shared structural requirements. Audita owns processing readiness
|
||||
and any domain rule not already enforced by those mechanisms. Adapt native
|
||||
registrations to the selected paths and rely on them where they enforce the
|
||||
required semantics. Do not add a second handwritten glossary validator or repeat
|
||||
native uniqueness checks merely to give each requirement a local implementation.
|
||||
|
||||
Extension retention applies wherever Audita actually exposes or forwards a shared
|
||||
document. It does not require an archive of loaded documents, a round-trip
|
||||
serializer, a new export interface, or a parallel representation retained solely
|
||||
for hypothetical forwarding. Module views can remain focused on useful vocabulary.
|
||||
|
||||
The adopted
|
||||
[ConfigKit configuration reference](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md)
|
||||
owns native behavior, including reserved controls and numeric representation.
|
||||
Link to that contract rather than reproduce its parser rules or introduce a
|
||||
custom parser, normalization workaround, arbitrary-precision codec, or fallback
|
||||
loader. Review future schema and ConfigKit updates deliberately against the
|
||||
selected contract.
|
||||
|
||||
Keep schema validity separate from Audita task readiness. Empty collections and
|
||||
an empty collection map are valid shared data. A selected glossary-correction
|
||||
stage still requires at least one selected entry; a selected missing collection
|
||||
still fails. Loading vocabulary does not select all collections. Preserve root
|
||||
and stage selection resolution, default protection derivation, and the glossary
|
||||
stage's active-spelling exemption.
|
||||
|
||||
Collections and categories remain domain-defined strings. `party`, `campaign`,
|
||||
`setting`, and `spells` are Narratio conventions, not mandatory names or a fixed
|
||||
enumeration. Provenance is source metadata, not transcript evidence or processing
|
||||
guidance. Notarius-specific spell extensions can be accepted without being used.
|
||||
|
||||
Shared-data identity and correction matching have different purposes. Exact ID
|
||||
validation does not require replacing Audita's existing spelling matching,
|
||||
protection, or editorial acceptance behavior with exact-string matching.
|
||||
|
||||
### Preflight and inspection
|
||||
|
||||
Preflight and processing accept the same effective vocabulary, apply the same
|
||||
collection selections, and detect malformed shared documents, unsupported markers,
|
||||
missing selections, and determinable task-input failures before correction calls.
|
||||
Processing still checks its actual transcript and inputs.
|
||||
|
||||
Narratio can continue to preflight its real prepared glossary files with a
|
||||
known-good synthetic transcript through the ordinary command. This adds no
|
||||
fixture mode or guarantee about a later transcript. Preserve existing provider
|
||||
smoke checks, local-only preflight, output-readiness behavior, and reporting scope.
|
||||
|
||||
Native effective configuration, explanation, comparison, and other commands that
|
||||
accept glossary files use the shared acquisition semantics. Comparison continues
|
||||
to apply the same runtime file list to both sides. Inspection validates shared
|
||||
data but need not meet processing-only readiness requirements or contact a model.
|
||||
Preserve source paths needed for output collision checks, including imports.
|
||||
Diagnostics should identify an affected file, collection, or field where practical
|
||||
through existing native reporting; a new error taxonomy or report protocol is
|
||||
not part of adoption.
|
||||
|
||||
## Work Required
|
||||
|
||||
- Incorporate the pinned contract assets and provenance. Add the appropriate
|
||||
component entry and license material under the [OSS policy](../policy/oss.md)
|
||||
when copying the upstream assets; the selected original material is CC0-1.0.
|
||||
Bundle the selected `glossary/v0.2.0/` assets from `2026.11.1` and use that
|
||||
version in maintained examples and references.
|
||||
- Adapt runtime acquisition and native sequence-identity selectors to the shared
|
||||
file envelope, and remove automatic glossary companion loading. Add
|
||||
schema validation at completed-document boundaries, reuse native identity
|
||||
checks, and derive consumer views after those checks.
|
||||
Refactor internal types and loading flow where that simplifies implementation.
|
||||
- Retain shared acquisition for processing, preflight, and configuration-consuming
|
||||
native commands. Treat glossary-file extensions as data without adding an
|
||||
instruction-preservation workflow.
|
||||
- Update glossary selection and protection integration for the new representation
|
||||
while preserving their existing behavior. Preserve source evidence and output
|
||||
collision protection across the adapted load path.
|
||||
- Replace maintained wrapperless glossary-file examples with shared inputs.
|
||||
Include a generic-domain example and a Narratio-style composition without
|
||||
requiring access to another application's installation. Cover single-file
|
||||
multi-collection and multiple-file arrangements.
|
||||
- Update the canonical [input contract](../integrations/transcript-glossary-files.md),
|
||||
[configuration](../config.md), [CLI](../cli.md), affected internal guides, and
|
||||
examples. Link upstream for schema and library definitions; document locally
|
||||
the Audita-specific mounting, precedence, selection, and readiness behavior.
|
||||
Identify the selected contract and link its native ConfigKit boundary. Update
|
||||
the deferred Narratio adoption description when this work lands.
|
||||
- Write migration guidance and release documentation for the intentional cutover.
|
||||
Retire superseded glossary-file format handling rather than adding compatibility
|
||||
shims, automatic legacy conversion, or a second operator-maintained vocabulary.
|
||||
|
||||
Concrete implementation steps belong in the [implementation plan](implementation.md).
|
||||
|
||||
## Verification and Acceptance
|
||||
|
||||
Use focused offline tests at the owning boundaries and representative assembled
|
||||
workflows under the [testing policy](../policy/testing.md). Control any model
|
||||
boundary; real Narratio, Notarius, or paid providers are not prerequisites.
|
||||
Evidence should establish that:
|
||||
|
||||
1. ConfigKit-supported shared YAML and equivalent JSON are accepted directly for
|
||||
one file with one collection, one file with multiple collections, multiple
|
||||
single-collection files, and mixed arrangements. Selected entries reach
|
||||
correction and protection views. Generic collections work, and unrelated
|
||||
collections need not exist or be selected.
|
||||
2. A representative shared spell document can be consumed without an Audita-only
|
||||
vocabulary copy. Defined provenance and irrelevant permitted extensions are
|
||||
accepted within ConfigKit's value support. This demonstrates Audita's boundary,
|
||||
not completion of another application's adoption.
|
||||
3. Required fields, nullable and empty cases, malformed known fields, unsupported
|
||||
markers, and exact final entry-ID uniqueness follow the adopted contract.
|
||||
Verify that ordinary validation needs no network access and that native load
|
||||
failures use normal ConfigKit diagnostics. Tests should exercise the selected
|
||||
contract without adding broader parsing or numeric guarantees or turning
|
||||
upstream implementation details into permanent application behavior.
|
||||
4. Repeated files, imports, inheritance, application vocabulary, overlays, and
|
||||
CLI assignment follow native composition. Partial contributions can produce
|
||||
a valid final document. Multiple complete files do not fail merely because
|
||||
they repeat the shared marker. Identity layering and invalid duplicate final
|
||||
entries are tested as distinct cases.
|
||||
5. Permitted shared extensions remain data, including an extension named
|
||||
`instruction`; accepting a shared document does not promote them to executable
|
||||
prompt guidance. No legacy glossary-instruction behavior is a test requirement.
|
||||
6. Empty shared data can be inspected; processing-only missing or empty glossary
|
||||
selections fail before correction calls in both preflight and processing.
|
||||
Native inspection and comparison expose consistent effective inputs, with
|
||||
supported extensions retained when exposing a shared document.
|
||||
7. Maintained examples, supported-contract identification, migration guidance,
|
||||
and source/attribution records match the delivered interface. Existing
|
||||
transcript and corrected-output formats remain unchanged by this adoption.
|
||||
8. Nearby `glossary.yml` and `glossary/` files are not automatically read or loaded.
|
||||
Explicitly supplied files and their imports still load and participate in
|
||||
output collision protection. Native main configuration discovery and automatic
|
||||
prompt companions continue to work.
|
||||
|
||||
Consolidate coverage where one behavioral test protects multiple cases. Tests
|
||||
should not freeze incidental loader call order, private Go types, diagnostic
|
||||
wording, or formatting of preserved data. Verify Audita's registration and schema
|
||||
integration at their boundaries without copying ConfigKit's parser or identity
|
||||
test suites, and retain distinct task-readiness coverage.
|
||||
|
||||
## Compatibility and Scope
|
||||
|
||||
The next release is **Audita v4.3.0**, by the user's explicit decision, regardless
|
||||
of compatibility changes or the existing SemVer policy. That direction takes
|
||||
precedence over the usual version-selection rules for this release. Document the
|
||||
glossary-file cutover and required consumer changes in its release notes; this
|
||||
decision does not establish a general exception for later releases.
|
||||
|
||||
Retain the `/v4` Go module path. Expect additive application configuration changes
|
||||
where needed; the shared file format does not by itself require replacing
|
||||
existing public configuration fields or advancing configuration version 3.
|
||||
Internal representations and module interfaces can change freely as part of
|
||||
adoption. Migration guidance should explain the shared envelope, single and
|
||||
repeated runtime files, removal of automatic glossary discovery, and the selected
|
||||
contract's native loading boundary. Former companion users must name their files
|
||||
explicitly. These inputs have runtime CLI priority over main/overlay vocabulary,
|
||||
rather than the former automatic companions' underlay priority; supplied entry
|
||||
lists replace configured lists at that boundary. Document that precedence change
|
||||
alongside retained collection selection behavior. No glossary-file instruction
|
||||
migration is required.
|
||||
Narratio's adapter migration and the separate `audita-pipelines-dnd` recipe updates
|
||||
belong to their own repositories and can target the resulting released interface.
|
||||
|
||||
This work does not change transcript schemas, correction strategy, validator
|
||||
acceptance, retry or repair budgets, chunk scheduling, report formats, or provider
|
||||
readiness responsibilities. Forwarding extensions does not require adding a new
|
||||
export command. These boundaries keep adoption focused; they are not permanent
|
||||
prohibitions on later features.
|
||||
Reference in New Issue
Block a user