diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 70db04a..efd1435 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -18,9 +18,9 @@ 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 automatic-companion acquisition choice in **Open Questions** must be resolved -before Stage 4. Do not silently replace that part of the roadmap with a different -workflow. Stages 1–3 have independent, concrete scope. +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 @@ -32,6 +32,11 @@ workflow. Stages 1–3 have independent, concrete scope. 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 @@ -91,7 +96,7 @@ the native-loading tests in Stage 2, not a new handwritten validator here. 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 so the helper can be reused for other acquired file groups. + `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. @@ -148,38 +153,37 @@ 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: Adapt Automatic Glossary Companions +## Stage 4: Retire Automatic Glossary Companion Discovery **Work** -Implement the approach approved in Open Questions, retaining the roadmap's -automatic-companion outcome unless the user explicitly revises it. - -1. Handle optional `glossary.yml` and recursive `glossary/` YAML companions beside - the selected main source. With no selected main, do not discover companions - from the invocation directory. Preserve native main selection and failure - behavior; do not implement a parallel configuration search algorithm. -2. Load complete companion envelopes using the Stage 2 adapter as native ordered - inputs, not strict peers. Use `glossary.yml` first, followed by recursive YAML - files in deterministic relative-path order. Imports remain relative to their - declaring files. Missing optional locations are allowed; acquired-file failures - remain failures. -3. Validate the completed companion contribution, then project entries with the - same helper as Stage 3. Apply it below main/overlay vocabulary and runtime CLI - vocabulary. Main/overlay composition remains native, including identified-list - operations; do not hand-merge glossary records. -4. Remove the old wrapperless `glossaryImports` mounting once replacement loading - is wired. Retain original companion/import paths for output collision checks. - Keep native source/explanation evidence truthful; do not invent per-file native - provenance where a preliminary result is represented by a synthetic source. +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** -Update `internal/appconfig/glossary_test.go` and source/discovery tests. Exercise -several complete companion documents, main and overlay overrides, absent main, -relative imports, extensions and invalid shared inputs. Verify source protection -and useful inspection evidence. Do not add a custom filesystem sandbox or a -universal source-snapshot guarantee. +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 @@ -213,20 +217,26 @@ format-validation matrices at every CLI boundary. **Work** -1. Convert maintained runtime and companion glossary files, including - `examples/local/glossary.yml`, to shared envelopes. 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 +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 companion order. Link upstream for shared fields - and ConfigKit behavior rather than reproduce their manuals. + 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, - companion changes and any explicitly approved configuration changes. Include - no legacy reader, automatic converter, or glossary-instruction migration. + 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. @@ -259,38 +269,3 @@ before running the offline suite; dependency upgrades are not part of adoption. 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. - -## Open Questions - -### Automatic companion acquisition before typed application binding - -The runtime path is straightforward: it already has explicit ordered file paths. -Automatic companions currently use `MainRelative` imports in the final native -load. Multiple complete envelopes cannot simply replace those peer imports: -their equal scalar markers conflict. ConfigKit v1.4.0's prepared source retains -the selected main context privately, but its public bootstrap report does not -expose that context for independent directory enumeration before loading. -Duplicating configuration discovery or flattening the whole application through -a generic map would add risk to source-relative PromptKit resources and metadata. - -**Recommendation:** Retain automatic companions and use native sequence-item -placement to acquire complete envelopes as separate records in an additive -acquisition field, with `MainRelative` retaining native source discovery and -relative-import context. Resolve/validate the documents through the common -adapter and integrate their projected contribution at native underlay priority. -Before committing to the sprint's concrete implementation, confirm a small -public-API prototype can preserve main/overlay priority, omission semantics and -native inspection without a serialization round trip or a duplicate merge -engine. If that integration needs substantial machinery, revisit this choice -with the user rather than silently weakening Stage 4. This preserves the existing -operator workflow, at the cost of a more involved acquisition integration than -the explicit runtime path. - -**Viable alternative:** For this release, use explicit shared glossary paths as -the file-loading mechanism and retire automatic glossary companion discovery, -with operator configuration/launch commands supplying those paths. This gives -one small native ordered-file loader and avoids acquisition-only fields or a -new upstream API. It requires a deliberate revision of the roadmap and migration -guidance because automatic companions are currently supported and used by -maintained examples. The user's fixed v4.3.0 release choice permits deliberate -workflow changes, but does not itself approve removing this workflow. diff --git a/docs/roadmap/shared-glossary.md b/docs/roadmap/shared-glossary.md index ed44fd0..d1317f1 100644 --- a/docs/roadmap/shared-glossary.md +++ b/docs/roadmap/shared-glossary.md @@ -11,10 +11,10 @@ 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 and outstanding integration question. -The user's subsequent direction governs +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 files, and spend no effort preserving glossary-file +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. @@ -124,6 +124,15 @@ 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. @@ -135,9 +144,8 @@ 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. Automatic glossary companions should also use the shared -envelope; adapt their acquisition to complete-document layering rather than -preserve the current import grouping mechanically. +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 @@ -252,8 +260,8 @@ not part of adoption. 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 shared application acquisition, companion loading, runtime composition, - and native sequence-identity selectors to the shared file envelope. Add +- 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. @@ -316,6 +324,10 @@ Evidence should establish that: 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 @@ -336,8 +348,12 @@ 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, companion file changes, composition/selection behavior, -and the selected contract's native loading boundary. No glossary-file instruction +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.