Ship toolbelt KCL fragments; reshape the example to compose them; validate at runtime #17
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#17
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?
Parent
#14 — Spec: Per-package KCL config fragments — service-owned defaults (db, embeddednats, embeddedfga)
What to build
The platform owns its config defaults in exactly one place. Each service package ships its own KCL fragment declaring that service's schema and its service-neutral defaults (
db/schema.k,embeddednats/schema.k,embeddedfga/schema.k), and a toolbelt-owned core fragment (app/schema.k) owns app identity (name),Log,Session,Rebuild, andaddr. The FGAFile/Tupletuple-sync schemas and the FGA-URI validate directive ride the embeddedfga fragment. Schema names (NATS,DB,FGA,Log) are preserved.An app author composes a service's config with a one-line KCL import and never re-declares its fields: the example's schema becomes a composition under the canonical keys (
nats: embeddednats.NATS = embeddednats.NATS {},db: DB = DB { path = "data/sqlite/kanban.db" }for the app-owned filename, and so on), resolved through the example's kcl.mod. The generated field registry and typed config struct are field-for-field identical to today's, so existing app wiring keeps working, and thecheck-kcldrift guard stays green.Runtime validation resolves the composed schema through the same kcl.mod path as codegen, so the schema the app authors is the schema that is validated when a
.kconfig loads — proven by a test driving a config file → schema → fragment-import chain at runtime load.Acceptance criteria
Log(the universal schema),Session,Rebuild,addr, and app identity.task check-kclpasses unchanged.File/Tupleschemas and the#@kcl:validateFGA-URI directive ride the embeddedfga fragment.go test ./...passes from the repo root, the tools module, and the example.Blocked by
Implemented, verified (go test green in root/tools/example, task check-kcl green), and reviewed via /code-review. Landed in commit
f3cbcd0on master.