Expand description
CLI-facing value construction for set/add (cli-shell-config-todo.md
§3, which supersedes the earlier cli-design-review-todo.md D3): a bare
VALUE/FIELD=VALUE is always Value::String with zero coercion — no
shape-guessing, no type prefixes. An exact type is requested explicitly
via ValueType (set’s --value-type flag); guard_bare_overwrite
implements the “异型覆盖守卫” (heterogeneous-overwrite guard) that turns a
bare VALUE silently changing an existing scalar’s type into an argument
error instead.
Enums§
- Scalar
Kind - The four AFDATA scalar “kinds” the heterogeneous-overwrite guard
distinguishes.
NumbercoversInteger/Unsigned/Float/Value::Number— the guard cares whether VALUE would change a scalar from one of these kinds to a bare string, not which numeric representation was in play. - Value
Type - The exact type an explicit
--value-typerequests for asetVALUE.
Functions§
- guard_
bare_ overwrite - The §3 “异型覆盖守卫” (heterogeneous-overwrite guard, closing design rule
4 — “no silent type rewrites”): a bare VALUE (implicit
--value-type string) is always a string, so overwriting an existing scalar of a different kind would silently change its type. That is an argument error, not a coercion decision. Returns the existing kind so the caller can build a message with the two escape hatches (--value-type <kind>to keep the type, or--value-type stringto convert explicitly). - scalar_
kind - The scalar kind of
value, orNonefor an array/object (the guard does not apply to containers — seecli-shell-config-todo.md§3). - value_
from_ type - Construct a
Valuefrom a CLI string per an explicitValueType.