Repository navigation
feat(schema): carry a runtime LIST through the workflow arg maps - #262
Conversation
#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)
Review — PASSHead SHA: Security screen: PASS (no scope mismatch, no secrets/egress, no guardrail weakening, no supply-chain change; Comment thread: 0 comments — nothing to disposition. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
#WorkflowRunRequest.argswas{[string]: #StrVal}with@go(Args,type=map[string]string)—schema/workflow.cue:111onmain— so a runtime list could not cross the workflow engine wire at all. The retired lane model's--prs a b chad 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 widensmap[string]string→map[string]any:#WorkflowRunRequest.argsschema/workflow.cue:153#WorkflowSchedule.argsschema/workflow.cue:90#PipelineSchedule.argsschema/pipeline.cue:163#PipelineArms.workflow_argsschema/pipeline.cue:86workflow:sub-step's argsWhy this shape, and not a
list_argsfield or a typed containerA 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
argsmap 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-lobsterresolves args asmap[string]any(resolveWorkflowArgs, over a#LobsterFilearg default typed_), and itsrun.go:67convertsmap[string]stringtomap[string]anythroughstringArgsToAny— 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.argsis normalized into#WorkflowSchedule.args(cli.go:402), which a scheduled run turns into a#WorkflowRunRequest; and aworkflow:step'sworkflow_argsreaches the sameresolveWorkflowArgs(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 inschema/is an ENV map (env,env_default, and the transport#StrMap), which is a string surface by definition. The two input-gatedefaultsmaps stay scalar because the gate's own reply field is a string map by contract (defaultsAsStringsrenders each value to one string). The declaration map#TaskParamSpecis untouched: it is shared withkind: 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
workflowkit/template.go:52LobsterArgsEnv(args map[string]string)LOBSTER_ARGS_JSONin the same functionrun.go:67stringArgsToAny(in.Args)in.Argsdirectly, and deletestringArgsToAny(run.go:309), which the widened field makes deadschedule.go:91localargs map[string]stringmap[string]any; the:104assignment of#WorkflowSchedule.argsthen needs no changecli.go:345var args map[string]stringmap[string]any, and the--args-jsonerrors atcli.go:349/:352must stop demanding STRING valuescli.go:336buildsspec.WorkflowRunRequest{Args: args}:345widenscli.go:402Args: t.Schedule.Argskind: pipelinedocuments, so it inherits the wideningcharlycore does not reference any of these types, so the contract change needs no core edit:How tested
The gate for THIS repo is the one its own
AGENTS.mdnames:go build ./...,go test ./...,gofmt, andgolangci-lintat the CI pin, plus thecue-genreproducibility check. It carries nocheck-*-localbed and nodisposable:target, so there is no bed to run:The shape is load-bearing: the same fixture against the un-changed schema.
The fixture is
schema/testdata/workflow_run_list_arg.cue. Againstorigin/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: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.jsondescriptor, and a nested value must NOT be admitted. Every transcript below is-v, so each--- PASScarries its=== RUN:The module gate, on the committed tree.
The head is
12512f099dc54f23bfbf139ed6486f91b46df121; every command below ran on that commit, not on a working tree.The regeneration no-op proof (SDD).
charly task cue-genregeneratedspec/cue_types_gen.gofrom 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:The diff this body describes.
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:
and what is left of the old scalar map is exactly the env surfaces and the two gate defaults:
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 ownAGENTS.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 vetevaluates them, butcue.Value.LookupPathcannot address them, so the Go half failed withinvalid path: hidden label _workflowRunListArgRequest not allowedwhile 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 buildrc=0,go testrc=0,gofmtclean,golangci-lint0 issues,cue vetrc=0,cue-genrc=0.R2: The shape is defined once (
#WorkflowArgVal) and referenced by all four arg maps; no second container, nolist_argsfield, 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.gois the output ofcharly 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 statuswas clean before the work; the change is one branch (feat/runtime-list-args) off freshorigin/mainin a worktree outside the umbrella checkout; the branch's upstream is UNSET so a bare push cannot reachmain; no force-push, no--no-verify, no direct push tomain. One commit, one push.R7: The coverage fails without the change, both halves pasted above: the same fixture does not
cue vetagainstorigin/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 vetplusgo testover 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 nocharlyGo source, so the binary remains equal to its source; the codegen toolchain is this repo's own pinnedcue/protoc, provisioned checksum-verified by the tasks. No runtime OS dependency was added, sopackaging:is untouched.R10: The change-class gate ran on the committed tree — build, test, gofmt, golangci-lint at the CI pin, and
cue-genreproducibility — all green, zero warnings. This repo has nodisposable:bed and nocheck-*-localbed (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'sAGENTS.mdstates the merge gate is the org-widecharly/pr-validatorand that it carries no per-repo candy gate). The tier earned isfully tested and validated: the repo's change-class gate passed on the final committed tree, and the changed path was executed live throughcue vetand 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-lessLobsterArgsEnv), which this leg may not edit.Agent: charly
Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)