Skip to content

feat(schema): add the generic task kind (#Task/#TaskValue) - #153

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/task-runner-spec
Sep 24, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/task-runner-spec

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

Add the generic task kind to the spec schema: schema/task.cue defines
#Task/#TaskValue, and task cue:gen regenerates the derived Go
(spec.Task, spec.TaskParamSpec) and the vocab (KindValueDefs["task"]).

A task is a named, host-native, reusable plan — the same #Step/#Op
grammar 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 a
Taskfile entry, to be served by the new opencharly/plugin-task.

#Task references the base #Step grammar, so it is validated HOST-SIDE
against #TaskValue — the same pattern #Candy/#Local/#Vm already use
(a self-contained plugin schema cannot carry plan: [...#Step]). schemagen
auto-derives KindValueDefs["task"] = "#TaskValue" — no hand-maintained map.

Purely additive: a new kind removes nothing from any existing config, so
there is no #SchemaVersion bump and no migration-table entry (per
/charly-build:migrate "Purely additive changes").

How tested

Schema regeneration is reproducible (two consecutive cue:gen runs produce
byte-identical output), and the new schema tests pass:

$ go test ./schema/ -run 'TestTaskValue|TestKindValueDefs' -v
--- PASS: TestTaskValue_ValidTask
--- PASS: TestTaskValue_RejectsUnknownField
--- PASS: TestTaskValue_RejectsUnknownStepField
--- PASS: TestTaskValue_RequiresDescription
--- PASS: TestKindValueDefs_HasTask
ok  	github.com/opencharly/spec/schema

$ go test ./...
ok  	github.com/opencharly/spec/<every package>      (full suite green)

Generated spec.Task (excerpt):

type Task struct {
	Description string   `yaml:"description,omitempty" json:"description"`
	Dir         string   `yaml:"dir,omitempty" json:"dir,omitempty"`
	Env         map[string]string `...`
	Vars        map[string]string `...`
	DependsOn   []EntityRef `...`
	Sources     []string `...`
	Generates   []string `...`
	Status      []string `...`
	Preconditions []string `...`
	Silent, Interactive bool
	Platforms, ExcludePlatforms []string
	Timeout Duration
	ContinueOnError bool
	Params map[string]TaskParamSpec
	Plan   []Step
}

Rulebook compliance

  • R3 — reuses the existing #Step/#Op grammar and the #Candy/#Vm
    host-value-gate pattern; no new grammar.
  • R5 — additive only; nothing deleted.
  • R7 — schema/task_test.go fails without the new def (valid/reject/missing-
    required cases + the derived KindValueDefs entry).
  • R8 — cue:gen reproducible (second run is a no-op).
  • SDD — CUE is the single source; Go is generated, never hand-written.

Change classification

  • Change class: additive schema + generated artifacts (no schema-version bump).
  • Verification gate: go test ./... (unit) + cue:gen reproducibility — the
    spec repo carries no runtime beds.
  • Attribution tier: fully tested and validated.

Assisted-by: opencode DeepSeek-V4.1-Flash (fully tested and validated)

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.
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 2821dc52fb97185f6b6c30e879cb56b0a353f99e (branch: feat/task-runner-spec)

Security screen: PASS — additive CUE def + regenerated Go; no secrets, no new deps, no guardrail/validator/rulebook edits (T1–T4 NA).
Checklist: All applicable rules PASS or NA — CUE→generated-Go derivation verified field-by-field (#Task/#TaskParamSpec ↔ spec.Task/spec.TaskParamSpec, all 17+3 fields match; vocab entry alphabetically placed), SDD source↔generated pairing present, R7/R10 coverage shipped in schema/task_test.go (would fail without the new def), R1 clean (all-PASS output, no warnings), R2/R4/R15/R16 (atomic single commit, no parking, wire-shape in spec + capability in plugin-task = correct placement), no forbidden framing. Bed/cue:gen reproducibility and model-name claims are tool-limited and internally consistent with the diff.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants