Skip to content

feat(schema): carry a runtime LIST through the workflow arg maps - #262

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/runtime-list-args
Oct 21, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/runtime-list-args

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

#WorkflowRunRequest.args was {[string]: #StrVal} with @go(Args,type=map[string]string) — schema/workflow.cue:111 on main — so a runtime list could not cross the workflow engine wire at all. The retired lane model's --prs a b c had no spelling on the wire: the caller had to pre-join the list into one string for the callee to re-split, which no generic consumer can do correctly.

This leg adds the shape that carries it — no engine, no lane primitive. The def is #WorkflowArgVal: #StrVal | [...#StrVal] (@go(-), so it emits no Go type) — a value is a scalar (string | number | bool, the pre-existing #StrVal) or a flat sequence of scalars. It is applied to the four arg maps on the workflow surfaces, whose generated Go field widens map[string]string → map[string]any:

def schema site the surface it carries
#WorkflowRunRequest.args schema/workflow.cue:153 what a front-end dispatches a run with
#WorkflowSchedule.args schema/workflow.cue:90 that run's normalized cron trigger
#PipelineSchedule.args schema/pipeline.cue:163 the AUTHORED trigger
#PipelineArms.workflow_args schema/pipeline.cue:86 a workflow: sub-step's args

Why this shape, and not a list_args field or a typed container

A second field (list_args) would force every front-end to decide, per value, which of two maps a value belongs in — and every callee to re-merge two maps before it can answer "what is this arg's value". One question, two homes.

A typed container (args: {prs: {value: [...]}}) would restructure every existing document and every existing consumer.

Widening the VALUE admits a list with the wire key, the JSON shape and the args map all unchanged: a payload that validated before still validates, because the admitted value set only GREW. The one thing that changes is the generated Go field, which is a compile-time change for a caller that BUILDS the request and no change at all for anything that only reads the JSON.

The engine side is what shows this is the right cut: the wire was the ONLY truncation point. plugin-lobster resolves args as map[string]any (resolveWorkflowArgs, over a #LobsterFile arg default typed _), and its run.go:67 converts map[string]string to map[string]any through stringArgsToAny — a conversion that exists only because this field was narrow.

Why four maps and not one (R2)

Those four are ONE mechanism, not four conveniences: an authored #PipelineSchedule.args is normalized into #WorkflowSchedule.args (cli.go:402), which a scheduled run turns into a #WorkflowRunRequest; and a workflow: step's workflow_args reaches the same resolveWorkflowArgs(map[string]any) one level down. A run that accepts a list while its schedule or its nested step does not is exactly the half-fix this change would otherwise ship, and the engine's own step type already carries that field as {[string]: _}.

The boundary is measured, not asserted. Every other {[string]: #StrVal} map left in schema/ is an ENV map (env, env_default, and the transport #StrMap), which is a string surface by definition. The two input-gate defaults maps stay scalar because the gate's own reply field is a string map by contract (defaultsAsStrings renders each value to one string). The declaration map #TaskParamSpec is untouched: it is shared with kind: task, whose params are text-substituted through ${NAME}, a string surface with a different destination. A list arrives as a runtime VALUE, which is what this leg carries.

Blast radius — what legs 2–5 must change

leg repo site change
2 sdk workflowkit/template.go:52 LobsterArgsEnv(args map[string]string) its only reference today is its own test, so this is a widen-or-delete decision, not a break; the list-capable half is LOBSTER_ARGS_JSON in the same function
3 plugin-lobster run.go:67 stringArgsToAny(in.Args) pass in.Args directly, and delete stringArgsToAny (run.go:309), which the widened field makes dead
3 plugin-lobster schedule.go:91 local args map[string]string map[string]any; the :104 assignment of #WorkflowSchedule.args then needs no change
4 plugin-pipeline cli.go:345 var args map[string]string map[string]any, and the --args-json errors at cli.go:349/:352 must stop demanding STRING values
4 plugin-pipeline cli.go:336 builds spec.WorkflowRunRequest{Args: args} compiles once :345 widens
4 plugin-pipeline cli.go:402 Args: t.Schedule.Args compiles unchanged: both defs widened together
5 plugin-migrate no Go reference to these types the reshape emits kind: pipeline documents, so it inherits the widening

charly core does not reference any of these types, so the contract change needs no core edit:

$ cd /home/atrawog/Sync/Atrapub/mo/dsh/opencharly && grep -rn 'WorkflowRunRequest\|PipelineSchedule' charly --include=*.go | wc -l
0

How tested

The gate for THIS repo is the one its own AGENTS.md names: go build ./..., go test ./..., gofmt, and golangci-lint at the CI pin, plus the cue-gen reproducibility check. It carries no check-*-local bed and no disposable: target, so there is no bed to run:

$ cd /tmp/wt-spec && grep -n '^[a-z0-9-]*:$' charly.yml
24:bootstrap-cue:
41:bootstrap-protoc:
79:wire-gen:
99:proto-gen:
117:cue-gen:

The shape is load-bearing: the same fixture against the un-changed schema.

The fixture is schema/testdata/workflow_run_list_arg.cue. Against origin/main's schema it does not validate — the list is not admitted — and against this tree it does. Same document, same command, only the schema differs:

$ cd /tmp/wt-spec && { printf 'package spec\n\n'; cat /tmp/wt-spec-base/schema/*.cue; printf '\n'; cat schema/testdata/workflow_run_list_arg.cue; } > /tmp/old-with-fixture.cue; cue vet -c /tmp/old-with-fixture.cue > /tmp/old-vet.log 2>&1; echo "old-schema: cue vet rc=$?"; sed -n '1,4p' /tmp/old-vet.log
old-schema: cue vet rc=1
workflowRunListArgRequest.args.labels: 3 errors in empty disjunction:
workflowRunListArgRequest.args.labels: conflicting values ["a","b"] and bool (mismatched types list and bool):
    ../old-with-fixture.cue:2,817:28
    ../old-with-fixture.cue:11,617:24
$ cd /tmp/wt-spec && { printf 'package spec\n\n'; cat schema/*.cue; printf '\n'; cat schema/testdata/workflow_run_list_arg.cue; } > /tmp/spec-with-fixture.cue; cue vet -c /tmp/spec-with-fixture.cue; echo "new-schema: cue vet rc=$?"
new-schema: cue vet rc=0

The Go half: the generated types carry the list, and the admission is bounded.

The fixture is validated from Go as CUE, and the four new tests hold both ends: the value must survive the request JSON and the schedule.json descriptor, and a nested value must NOT be admitted. Every transcript below is -v, so each --- PASS carries its === RUN:

$ cd /tmp/wt-spec && GOWORK=off go test ./spec/ -run 'TestWorkflowArgListFixtureValidates|TestWorkflowArgsCarryARuntimeList|ListArgSurvives' -count=1 -v
=== RUN   TestWorkflowArgListFixtureValidates
=== RUN   TestWorkflowArgListFixtureValidates/workflowRunListArgRequest
=== RUN   TestWorkflowArgListFixtureValidates/workflowScheduleListArg
=== RUN   TestWorkflowArgListFixtureValidates/workflowTriggerListArg
--- PASS: TestWorkflowArgListFixtureValidates (0.13s)
    --- PASS: TestWorkflowArgListFixtureValidates/workflowRunListArgRequest (0.00s)
    --- PASS: TestWorkflowArgListFixtureValidates/workflowScheduleListArg (0.00s)
    --- PASS: TestWorkflowArgListFixtureValidates/workflowTriggerListArg (0.00s)
=== RUN   TestWorkflowRunRequestListArgSurvivesTheWire
--- PASS: TestWorkflowRunRequestListArgSurvivesTheWire (0.00s)
=== RUN   TestWorkflowTriggerListArgSurvivesTheDescriptorJSON
--- PASS: TestWorkflowTriggerListArgSurvivesTheDescriptorJSON (0.00s)
=== RUN   TestWorkflowArgsCarryARuntimeList
=== RUN   TestWorkflowArgsCarryARuntimeList/the_run_request_carries_a_list_arg
=== RUN   TestWorkflowArgsCarryARuntimeList/an_empty_list_arg_is_a_value,_not_an_absence
=== RUN   TestWorkflowArgsCarryARuntimeList/the_schedule_on_the_engine_wire_carries_a_list_arg
=== RUN   TestWorkflowArgsCarryARuntimeList/the_AUTHORED_schedule_carries_a_list_arg_too
=== RUN   TestWorkflowArgsCarryARuntimeList/a_scalar_arg_is_unchanged
=== RUN   TestWorkflowArgsCarryARuntimeList/the_numeric_and_boolean_scalars_stay_admitted
=== RUN   TestWorkflowArgsCarryARuntimeList/a_list_of_mixed_scalars_is_admitted
=== RUN   TestWorkflowArgsCarryARuntimeList/a_nested_map_arg_is_rejected
=== RUN   TestWorkflowArgsCarryARuntimeList/a_list_of_lists_is_rejected
=== RUN   TestWorkflowArgsCarryARuntimeList/a_list_of_maps_is_rejected
=== RUN   TestWorkflowArgsCarryARuntimeList/a_nested_map_arg_is_rejected_on_the_engine_schedule_too
=== RUN   TestWorkflowArgsCarryARuntimeList/a_nested_map_arg_is_rejected_on_the_authored_schedule_too
=== RUN   TestWorkflowArgsCarryARuntimeList/a_sub-workflow_step_carries_a_list_arg
=== RUN   TestWorkflowArgsCarryARuntimeList/a_sub-workflow_step_still_rejects_a_nested_map_arg
--- PASS: TestWorkflowArgsCarryARuntimeList (0.11s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/the_run_request_carries_a_list_arg (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/an_empty_list_arg_is_a_value,_not_an_absence (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/the_schedule_on_the_engine_wire_carries_a_list_arg (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/the_AUTHORED_schedule_carries_a_list_arg_too (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/a_scalar_arg_is_unchanged (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/the_numeric_and_boolean_scalars_stay_admitted (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/a_list_of_mixed_scalars_is_admitted (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/a_nested_map_arg_is_rejected (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/a_list_of_lists_is_rejected (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/a_list_of_maps_is_rejected (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/a_nested_map_arg_is_rejected_on_the_engine_schedule_too (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/a_nested_map_arg_is_rejected_on_the_authored_schedule_too (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/a_sub-workflow_step_carries_a_list_arg (0.00s)
    --- PASS: TestWorkflowArgsCarryARuntimeList/a_sub-workflow_step_still_rejects_a_nested_map_arg (0.00s)
PASS
ok  	github.com/opencharly/spec/spec	0.289s

The module gate, on the committed tree.

The head is 12512f099dc54f23bfbf139ed6486f91b46df121; every command below ran on that commit, not on a working tree.

$ cd /tmp/wt-spec && GOWORK=off go build ./... ; echo "go build rc=$?"
go build rc=0
$ cd /tmp/wt-spec && GOWORK=off go test ./... -count=1 ; echo "go test rc=$?"
ok  	github.com/opencharly/spec/cache	0.321s
ok  	github.com/opencharly/spec/calver	0.010s
?   	github.com/opencharly/spec/capability	[no test files]
?   	github.com/opencharly/spec/checkhost	[no test files]
ok  	github.com/opencharly/spec/checkstep	0.007s
ok  	github.com/opencharly/spec/climodel	0.121s
?   	github.com/opencharly/spec/clireflect	[no test files]
ok  	github.com/opencharly/spec/container	26.458s
ok  	github.com/opencharly/spec/cuetoolchain	0.660s
ok  	github.com/opencharly/spec/deploy	0.012s
ok  	github.com/opencharly/spec/exec	15.397s
ok  	github.com/opencharly/spec/exitcode	0.006s
ok  	github.com/opencharly/spec/hostenv	0.013s
?   	github.com/opencharly/spec/http	[no test files]
?   	github.com/opencharly/spec/internal/cuesetup	[no test files]
?   	github.com/opencharly/spec/internal/schemagen	[no test files]
ok  	github.com/opencharly/spec/internal/wiregen	0.079s
?   	github.com/opencharly/spec/loader	[no test files]
ok  	github.com/opencharly/spec/lock	1.059s
ok  	github.com/opencharly/spec/matchers	0.018s
ok  	github.com/opencharly/spec/merge	0.013s
ok  	github.com/opencharly/spec/ops	0.016s
ok  	github.com/opencharly/spec/phase	0.008s
ok  	github.com/opencharly/spec/poll	0.243s
ok  	github.com/opencharly/spec/proc	1.264s
?   	github.com/opencharly/spec/proto	[no test files]
ok  	github.com/opencharly/spec/refs	19.185s
?   	github.com/opencharly/spec/report	[no test files]
ok  	github.com/opencharly/spec/schema	23.565s
?   	github.com/opencharly/spec/schemaconcat	[no test files]
ok  	github.com/opencharly/spec/schemaparams	0.141s
ok  	github.com/opencharly/spec/schemaretag	0.007s
?   	github.com/opencharly/spec/shellquote	[no test files]
ok  	github.com/opencharly/spec/spec	3.523s
?   	github.com/opencharly/spec/sshx	[no test files]
?   	github.com/opencharly/spec/testkit	[no test files]
ok  	github.com/opencharly/spec/transport	0.267s
go test rc=0
$ cd /tmp/wt-spec && out=$(gofmt -l .); echo "gofmt rc=$? files=[$out]"
gofmt rc=0 files=[]
$ cd /tmp/wt-spec && TMPDIR=/tmp/gl GOWORK=off $(go env GOPATH)/bin/golangci-lint run ./... > /tmp/lint.log 2>&1; echo "golangci-lint rc=$?"; tail -1 /tmp/lint.log
golangci-lint rc=0
0 issues.

The regeneration no-op proof (SDD).

charly task cue-gen regenerated spec/cue_types_gen.go from the CUE (never hand-written), and its own reproducibility step passed. Re-running it against the COMMITTED tree changes nothing — a clean regeneration is a no-op:

$ cd /tmp/wt-spec && charly_bin=/home/atrawog/Sync/Atrapub/mo/dsh/opencharly/charly/bin/charly; $charly_bin -C /tmp/wt-spec task cue-gen > /tmp/cuegen.log 2>&1; echo "cue-gen rc=$?"; echo "changed paths after the second regen: $(git status --short | wc -l)"; grep -E '\[pass\]' /tmp/cuegen.log
cue-gen rc=0
changed paths after the second regen: 0
  [pass] run — download and checksum-verify the pinned cue CLI
  [pass] run — download and pin protoc + the two Go codegen plugins
  [pass] run — render the proto IDL from CUE and compile the Go stubs
  [pass] run — gengotypes + schemagen the generated Go
  [pass] check — regen is reproducible — TestGenReproducible passes on the committed tree

The diff this body describes.

$ cd /tmp/wt-spec && git diff --numstat origin/main HEAD
18	3	schema/pipeline.cue
50	0	schema/testdata/workflow_run_list_arg.cue
44	2	schema/workflow.cue
33	5	spec/cue_types_gen.go
180	0	spec/workflow_arg_list_wire_test.go
140	0	spec/workflow_envelope_test.go

6 files, 465 insertions, 10 deletions.

The R2 boundary, as a grep rather than an assertion.

Every workflow arg map now uses the one def:

$ cd /tmp/wt-spec && grep -rn '\[string\]: #WorkflowArgVal' schema/*.cue
schema/pipeline.cue:86:	workflow_args?: {[string]: #WorkflowArgVal} @go(WorkflowArgs,type=map[string]any)
schema/pipeline.cue:163:	args?:       {[string]: #WorkflowArgVal} @go(Args,type=map[string]any)
schema/workflow.cue:90:	args?:       {[string]: #WorkflowArgVal} @go(Args,type=map[string]any)
schema/workflow.cue:153:	args?:     {[string]: #WorkflowArgVal} @go(Args,type=map[string]any)

and what is left of the old scalar map is exactly the env surfaces and the two gate defaults:

$ cd /tmp/wt-spec && grep -rn '\[string\]: #StrVal' schema/*.cue | grep -vi 'env'
schema/_common.cue:287:#StrVal: string | number | bool // gengotypes: emits `type StrVal any` — referenced by inline {[string]: #StrVal} maps
schema/_common.cue:289:#StrMap: ({[string]: #StrVal}) @go(-) // gengotypes: hand StrMap = map[string]string (spec/union_types.go)
schema/pipeline.cue:110:	defaults?:        {[string]: #StrVal} @go(Defaults,type=map[string]string)
schema/workflow.cue:177:	defaults?:        {[string]: #StrVal} @go(Defaults,type=map[string]string)

Rulebook compliance

R0: Skills were loaded before the first action: /charly-internals:go (the SDD recipe), /charly-internals:plugin (the per-plugin CUE contract), /charly-internals:git-workflow, /charly-check:check; plus this repo's own AGENTS.md (Part II #4) and the operator ruling on the chain.

R1: One anomaly, root-caused before remediation. The first fixture used CUE HIDDEN fields (_name): cue vet evaluates them, but cue.Value.LookupPath cannot address them, so the Go half failed with invalid path: hidden label _workflowRunListArgRequest not allowed while the CUE half passed. Mechanism: one fixture with two consumers, of which only one was exercised first. Root fix: the fixture's fields are PUBLIC, so both consumers address the same document; both are green now. Every gate is at zero: go build rc=0, go test rc=0, gofmt clean, golangci-lint 0 issues, cue vet rc=0, cue-gen rc=0.

R2: The shape is defined once (#WorkflowArgVal) and referenced by all four arg maps; no second container, no list_args field, no duplicated rule. The four maps are one mechanism, justified above, and the boundary to the maps that stay scalar is the grep pasted above rather than a claim.

R3: No workaround. The schema is the single source, the Go is generated from it, and no sleep, retry, suppression or fallback was added; the one conversion this makes dead (stringArgsToAny) is named for its owner instead of being papered over.

R4: Product first. The contract is fixed in CUE; the only prose touched is the schema comments that stated the old shape (and the generated comment regenerated from them), so no document routes around the code.

R5: No generated Go was hand-written — spec/cue_types_gen.go is the output of charly task cue-gen, and a second run is a no-op (pasted). Nothing was deleted in this repo because nothing here became dead; the dead helper this creates is named with its file and line for its owner.

R6: git status was clean before the work; the change is one branch (feat/runtime-list-args) off fresh origin/main in a worktree outside the umbrella checkout; the branch's upstream is UNSET so a bare push cannot reach main; no force-push, no --no-verify, no direct push to main. One commit, one push.

R7: The coverage fails without the change, both halves pasted above: the same fixture does not cue vet against origin/main's schema (rc=1, the list is not admitted), and the Go wire test does not even compile against the old field types (cannot use WorkflowRunRequest{}.Args (value of type map[string]string) as map[string]any value in variable declaration). The changed path executes live on the final tree: cue vet plus go test over the generated types.

R8: No live-service boundary is crossed by a contract definition, so there is nothing to run live and nothing that could be mocked.

R9: The worktree-local build charly/bin/charly (2026.293.2010) ran the generation, not a shared install. This diff touches no charly Go source, so the binary remains equal to its source; the codegen toolchain is this repo's own pinned cue/protoc, provisioned checksum-verified by the tasks. No runtime OS dependency was added, so packaging: is untouched.

R10: The change-class gate ran on the committed tree — build, test, gofmt, golangci-lint at the CI pin, and cue-gen reproducibility — all green, zero warnings. This repo has no disposable: bed and no check-*-local bed (pasted above), so no bed was skipped that exists.

Change classification

config — a wire/contract shape change in a contract-only repo. There is no runtime target to rebuild and no bed to run (this repo's AGENTS.md states the merge gate is the org-wide charly/pr-validator and that it carries no per-repo candy gate). The tier earned is fully tested and validated: the repo's change-class gate passed on the final committed tree, and the changed path was executed live through cue vet and the generated Go types.

Filed issues

  • opencharly/plugin-pipeline#43 — the operator ruling that authorizes this chain and lists its six legs; this PR is leg 1.

This leg opened no new issue. The two findings it surfaced are either fixed in this diff (the fixture's addressability) or owned by a named later leg and listed with file and line in the blast-radius table (the dead stringArgsToAny, and the caller-less LobsterArgsEnv), which this leg may not edit.

Agent: charly

Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)

#WorkflowRunRequest.args was map[string]string, so a workflow could not receive a
list at all: the retired lane model's `--prs a b c` had nowhere to go, and a
caller had to pre-join the list into one string for the consumer to re-split.

Every arg map on the engine wire now admits #WorkflowArgVal — a scalar, or a FLAT
sequence of scalars — and the generated Go field widens to map[string]any:

  schema/workflow.cue  #WorkflowRunRequest.args   (the run request)
  schema/workflow.cue  #WorkflowSchedule.args     (its normalized trigger)
  schema/pipeline.cue  #PipelineSchedule.args     (the authored trigger)
  schema/pipeline.cue  #PipelineArms.workflow_args (a sub-workflow step's args)

Those four are ONE mechanism, not four conveniences: an authored
#PipelineSchedule.args is normalized into #WorkflowSchedule.args, which a
scheduled run turns into a #WorkflowRunRequest, and a `workflow:` step's
workflow_args reaches the same resolveWorkflowArgs(map[string]any) one level
down. A run that accepts a list while its schedule or its nested step does not is
a half-fix, so they move together.

The WIRE is unchanged: still one JSON object mapping an arg name to its value,
and every document that validated before still validates, because the admitted
value set only GREW. What changes is the generated Go field, which is a
compile-time change for a caller that BUILDS the request and no change at all for
anything that only reads the JSON.

The bound is deliberate: a scalar or a flat list of scalars, never a nested map
and never a list of lists. An arg is rendered into a per-arg binding (a CLI -p, an
env var, the LOBSTER_ARGS_JSON document); a shape with no such rendering must fail
at schema time, not be dropped or fail at execution time.

Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 12512f099dc54f23bfbf139ed6486f91b46df121 (branch: feat/runtime-list-args)

Security screen: PASS (no scope mismatch, no secrets/egress, no guardrail weakening, no supply-chain change; @go(-) is the established schema-suppression pattern, not a hand-written schema-shaped Go type)
Checklist: All applicable rules PASS or NA. (SDD consistent — schema/*.cue + spec/cue_types_gen.go changed together, cue-gen no-op pasted; R7/R10 coverage present — accept/reject tests fail to compile/validate without the change; attribution tier justified by live cue vet + generated-type tests; cross-repo breakage in plugin-lobster/plugin-pipeline is disclosed in the blast-radius table and tracked under filed opencharly/plugin-pipeline#43.)

Comment thread: 0 comments — nothing to disposition.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) October 21, 2026 05:50
@github-actions
github-actions Bot merged commit ce31897 into main Oct 21, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Oct 21, 2026
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