Use explicit files for glossary adoption
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user