Settle dynamic value traversal using existing type rules

This commit is contained in:
2026-11-21 03:12:59 +00:00
parent 41622c54e0
commit 4c2620c68b

View File

@@ -87,8 +87,19 @@ pointer targets, including nil inline embeddings, to satisfy a lookup.
Return `(nil, false)` for malformed paths, missing keys, out-of-range indices,
incompatible segments, or traversal through nil or a scalar. Declared schema
validity alone does not make a runtime descendant available. Dynamic values
supplied by callers, including changes after loading, are addressed in OD-2.
validity alone does not make a runtime descendant available.
**OD-2 settled:** navigate current values inside `any` using ConfigKit's existing
supported types and field-binding rules, including supported structs and their
YAML field names. Apply the same rules to values supplied during loading,
post-load replacements, and manually constructed results. Reuse existing runtime
type-description machinery as appropriate; do not restrict navigation to
YAML-decoded maps and slices or introduce a second Go-object navigation model.
Intermediate pointers and interfaces follow the rules above, and scalar types
remain leaves. Return `(nil, false)` when continued traversal requires an
unsupported shape. At a reached terminal, return the actual current value
without conversion or revalidation. Lookup does not invoke application codecs
or establish new secret-classification semantics.
### Subtree-focused inspection
@@ -186,8 +197,9 @@ presence-state handling, resource capture, and settings ownership refactoring.
logic for typed traversal. Keep any supporting implementation private. Do not
route through inspection projection or add another complete load-time snapshot.
3. Add focused public tests for root/nested lookup, named and pointer types,
inline fields/maps, dynamic containers, numeric keys versus indices, bounds,
missing/nil values, scalar leaves, and the selected receiver/mutation rules.
inline fields/maps, dynamic containers and supported structs inside `any`,
numeric keys versus indices, bounds, missing/nil values, scalar leaves, and
the settled receiver/mutation rules, including manually constructed results.
Verify ordinary aliasing and unchanged frozen inspection without promising
concurrent mutation safety. Check trusted secret access and existing redaction
with disposable values.
@@ -222,22 +234,6 @@ loading and inspection callers need not adopt either new capability.
## Open Decisions
### OD-2: Traversal of caller-supplied values inside `any`
This decision covers both post-load mutations and values in manually constructed
results permitted by settled OD-1.
**Recommendation:** navigate current dynamic values using ConfigKit's supported
dynamic container shapes. Return false if further traversal needs an unsupported
shape. At a reached terminal, return the current value without revalidating it;
lookup is not a new configuration validation pass. This follows current-value
ownership while reusing ConfigKit's existing navigation model.
**Alternative:** reflect through arbitrary Go shapes inserted into `any` after
loading, including new struct types. This offers more flexibility for mutated
results, but requires additional runtime binding and failure rules for values
the load never supported. Neither demonstrated consumer needs that expansion.
### OD-3: Inspection view and comparison API
**Recommendation:** expose a non-generic `Inspection` view through