Repository navigation
feat(schema): add the generic task kind (#Task/#TaskValue) - #153
Conversation
Add schema/task.cue defining the reusable, host-native task kind: a named plan using the existing #Step/#Op grammar plus task-level execution config (dir/env/vars/depends_on/sources/generates/status/preconditions/silent/ interactive/platforms/timeout/continue_on_error/params). #Task references the base #Step grammar, so it is validated host-side against #TaskValue — the same pattern #Candy/#Local/#Vm use. schemagen auto-derives KindValueDefs["task"] = "#TaskValue" with no hand-maintained map. Purely additive: no #SchemaVersion bump and no migration entry (a new kind removes nothing from any existing config). Includes schema/task_test.go: a valid task passes the concrete gate; an unknown task field, an unknown step #Op field, and a missing required description are all rejected; KindValueDefs carries the derived task entry.
Review — PASSHead SHA: Security screen: PASS — additive CUE def + regenerated Go; no secrets, no new deps, no guardrail/validator/rulebook edits (T1–T4 NA). Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Add the generic
taskkind to the spec schema:schema/task.cuedefines#Task/#TaskValue, andtask cue:genregenerates the derived Go(
spec.Task,spec.TaskParamSpec) and the vocab (KindValueDefs["task"]).A task is a named, host-native, reusable plan — the same
#Step/#Opgrammar a candy's
plan:uses — plus task-level execution config(
dir/env/vars/depends_on/sources/generates/status/preconditions/silent/interactive/platforms/timeout/continue_on_error/params). It is the declarative replacement for aTaskfile entry, to be served by the new
opencharly/plugin-task.#Taskreferences the base#Stepgrammar, so it is validated HOST-SIDEagainst
#TaskValue— the same pattern#Candy/#Local/#Vmalready use(a self-contained plugin schema cannot carry
plan: [...#Step]).schemagenauto-derives
KindValueDefs["task"] = "#TaskValue"— no hand-maintained map.Purely additive: a new kind removes nothing from any existing config, so
there is no
#SchemaVersionbump and no migration-table entry (per/charly-build:migrate"Purely additive changes").How tested
Schema regeneration is reproducible (two consecutive
cue:genruns producebyte-identical output), and the new schema tests pass:
Generated
spec.Task(excerpt):Rulebook compliance
#Step/#Opgrammar and the#Candy/#Vmhost-value-gate pattern; no new grammar.
schema/task_test.gofails without the new def (valid/reject/missing-required cases + the derived
KindValueDefsentry).cue:genreproducible (second run is a no-op).Change classification
go test ./...(unit) +cue:genreproducibility — thespec repo carries no runtime beds.
fully tested and validated.Assisted-by: opencode DeepSeek-V4.1-Flash (fully tested and validated)