kcl.mod stays in sync with go.mod via a Taskfile stamp step #18

Closed
opened 2026-08-06 21:34:15 +00:00 by ginjiruu · 1 comment
Owner

Parent

#14 — Spec: Per-package KCL config fragments — service-owned defaults (db, embeddednats, embeddedfga)

What to build

Fragment discovery needs no flag list — the app declares its fragments via KCL import + kcl.mod — and the kcl.mod's reference to the toolbelt fragments cannot drift from the Go module. A Taskfile stamp step derives the toolbelt reference from go list -m and rewrites the toolbelt entry in the kcl.mod, so the fragments always resolve at the same revision as the Go module. For the example a static relative reference suffices today; this is the mechanism that keeps published pseudo-version consumers resolving fragments correctly.

Acceptance criteria

  • A Taskfile step derives the toolbelt module reference via go list -m and rewrites the kcl.mod toolbelt entry.
  • The step is wired so that bumping the Go module reference updates the kcl.mod reference automatically.
  • A drift run against a deliberately stale kcl.mod entry fails loudly (or regenerates it).

Blocked by

  • #17 — Ship toolbelt KCL fragments; reshape the example to compose them; validate at runtime
## Parent #14 — Spec: Per-package KCL config fragments — service-owned defaults (db, embeddednats, embeddedfga) ## What to build Fragment discovery needs no flag list — the app declares its fragments via KCL `import` + `kcl.mod` — and the kcl.mod's reference to the toolbelt fragments cannot drift from the Go module. A Taskfile stamp step derives the toolbelt reference from `go list -m` and rewrites the toolbelt entry in the kcl.mod, so the fragments always resolve at the same revision as the Go module. For the example a static relative reference suffices today; this is the mechanism that keeps published pseudo-version consumers resolving fragments correctly. ## Acceptance criteria - [ ] A Taskfile step derives the toolbelt module reference via `go list -m` and rewrites the kcl.mod toolbelt entry. - [ ] The step is wired so that bumping the Go module reference updates the kcl.mod reference automatically. - [ ] A drift run against a deliberately stale kcl.mod entry fails loudly (or regenerates it). ## Blocked by - #17 — Ship toolbelt KCL fragments; reshape the example to compose them; validate at runtime
Author
Owner

Implemented, verified (go test green in root/tools/example, task check-kcl green), and reviewed via /code-review. Landed in commit f3cbcd0 on master.

Implemented, verified (go test green in root/tools/example, task check-kcl green), and reviewed via /code-review. Landed in commit f3cbcd0 on master.
ginjiruu 2026-08-06 22:42:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ginjiruu/toolbelt#18
No description provided.