Document and benchmark sibling inheritance
This commit is contained in:
@@ -17,6 +17,7 @@ sanitized shapes using only ConfigKit and the Go standard library:
|
||||
| Seriatim-like | Independent strict ordered speaker and autocorrect rule files | First-match and ordered replacement algorithms; no central application configuration file |
|
||||
| Bundled file | Simple native `fs.FS` source through ordinary `Load` | Selection and lifetime of the application-owned embedded filesystem |
|
||||
| Layered catalog | Embedded defaults with an import, a mapping underlay, an independent host main file, explicit false/zero input, and source-relative resource access | Domain validation and opening/interpreting the template resource |
|
||||
| Named presets | One-load sibling inheritance, explicit false, nested destination resolution, and source/derivation inspection | Choosing and executing a preset |
|
||||
|
||||
The YAML under [`testdata`](../../examples/consumers/testdata) is loaded by the
|
||||
executable examples and ordinary tests. It contains no private application data,
|
||||
@@ -50,6 +51,22 @@ both without redefining their syntax. ConfigKit overlays are configuration overl
|
||||
they do not select or replace an application's LLM, model, pipeline, report, or
|
||||
execution profile concepts.
|
||||
|
||||
## Named sibling inheritance
|
||||
|
||||
[`LoadPresets`](../../examples/consumers/inheritance.go) loads the maintained
|
||||
[`presets.yml`](../../examples/consumers/testdata/inheritance/presets.yml) in one
|
||||
call. `custom` inherits `enabled: false` from `base`, while its nested
|
||||
`settings.primary` changes the inherited `settings.secondary` result at the
|
||||
custom destination. The application struct has no `extends` field; ConfigKit
|
||||
consumes the relationship before strict typed decoding.
|
||||
|
||||
The [executable example](../../examples/consumers/consumers_test.go) reads
|
||||
`Metadata.IsExplicit` for the inherited false value, then follows
|
||||
`Origin.Inheritance` back to the parent path while `Origin.Locations` identifies
|
||||
the declaring source. Applications still choose which preset to execute and
|
||||
validate domain meaning. The [configuration contract](../config.md#sibling-inheritance)
|
||||
owns exact lookup, precedence, cancellation, and migration rules.
|
||||
|
||||
## Native filesystem and layered input
|
||||
|
||||
[`LoadBundled`](../../examples/consumers/layered.go) keeps the simple `Load` shape:
|
||||
@@ -150,6 +167,7 @@ focused behavioral owner:
|
||||
| Canonical module objects and dynamic option handling | WeatherReporter- and Notarius-shaped examples and migration tests |
|
||||
| `LoadSecretsDir`, bootstrap reporting, typed lookup, CLI explanation | `Example_weatherStartup` |
|
||||
| Native filesystem, grouped underlays, programmatic mapping, retained resource context | `Example_nativeFilesystem`, `Example_layeredCatalog`, and their focused consumer tests |
|
||||
| Named sibling inheritance, presence, and derivation | `Example_inheritedPresets` and `TestPresetCatalogOneLoadAndDerivation` |
|
||||
| Results, metadata, diagnostics, effective output, and writer failures | Focused root-package load, provenance, rendering, and explanation tests |
|
||||
|
||||
The package-level import-boundary test covers the consumer examples too: supported
|
||||
|
||||
Reference in New Issue
Block a user