kcl-generate: emit Go validation for check/rule blocks — drop the startup KCL runtime dependency #23
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ginjiruu/toolbelt#23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Graduated from wayfinding ticket #9 (toolbelt/cmd design grilling, Q2b).
The toolbelt's config story is KCL-as-spec:
schema.kis the single source of truth,kcl-generateemits the field registry + bootstrap (var App = config.New(...)). Field-level validation is already generated Go (Field.ValidValues,ValidateTag,#@kcl:validatehooks) and runs without the KCL runtime.What is NOT codegen'd is schema-level validation:
check/ruleblocks. Those are enforced at startup by the KCL runtime (cfg.Validate()→kcl.ValidateConfigagainst the schema path).Consequence
kcl-lang.io/kcl-go+ the 206 MBkcl-lang.io/lib) even though its field-level validation is already generated..kschema file must be shipped next to the binary at runtime (SchemaPath), and path deps resolved — a deployment smell.Question
Can
kcl-generateemit Go validation for the KCLcheck/ruleblocks that are expressible (types, literal unions, ranges, cross-field constraints), and keep the runtime only as a fallback for inexpressible blocks? KCL is a full language, so full translation is a compiler project — the ticket should scope what fraction of real-world schemas are expressible.Not
Not part of issue #9 (toolbelt/cmd). Candidate for a future triage decision; labeled
needs-triage. Per the map's deliverable shape, resolving this ticket writes a plan todocs/plans/only — no code lands until the post-map clean rewrite.