Repository navigation
feat(schema)!: author pipelines as stage:, ordered by after: (P26 unit 2) - #69
Conversation
… unit 2)
The authored `kind: pipeline` body becomes the contract's stage vocabulary —
`stage: {<name>: #Stage}` from `spec/schema/stage.cue` (spec v0.2026320.1252) — and the
lowering linearises that map by the graph `after:` declares. That is the piece
opencharly/charly#1168 needs: a bed roster is
stage:
<bed>:
deployment: {deployment: [<bed>]}
after: [<producer>]
concurrency: 1
with no new kind, no new field and no second runner.
WHAT CHANGED
- schema: `#Pipeline.steps` (a flat lobster step list) → `stage: {[string]: schema.#Stage}`.
`#PipelineStepBase`, `#PipelineStep`, `#PipelineArms`, `#PipelineFlow`, #PipelineSubStep,
#PipelineParallel, #PipelineInput, #PipelineRetry, #PipelineApproval and `steps:` are
DELETED (hard cutover), as are the `_onError` table and the `carryStepRedo` carry path — a
plan step's `redo` no longer reaches the ENGINE (the stage's `retry:` is the one repetition,
D-FLOW-2); `#RedoSpec` itself stays, because the lifted verb inputs still carry it.
- workflowkit/stage.go (new): the stage model — arm exclusivity (`stageArm`, the ONE answer
to "which arm did this stage set"), the topological order (`StageOrder`: Kahn, name tie-
break, a cycle named stage by stage) and the schema defaults the yaml decode does not
apply (`concurrency: 1`, `on_error: fail`, `interval: 2s`, `unanswered: refused`).
- workflowkit/lower.go: one stage → one lobster step, emitted in topological order. `step:`
→ the generated charly task (today's plan path), `pipeline:` → the engine's sub-workflow
arm, `deployment:` → `charly check run <ref>` per ref (DESIGN.md:2470), `ask:` → the
engine's APPROVAL gate (`--approve yes|no`), `lane:` → `lanes:` + `item_var: LANE_ITEM` +
`batch_size: concurrency` (DESIGN.md:3014: no pause, no index variable, no custom name),
`retry:` → `{max, delay_ms}`.
- workflowkit/validate.go: judges the stage body (one arm, `after:` names a stage and not
itself, no duplicate edge, `lane:` over a declared `args:` parameter, durations parse,
no cycle) and joins every finding. The lobster step grammar's rules go with the grammar.
- workflowkit/graph.go: the ONE edge model is `after:` — the same relation the lowering
applies, so the drawing cannot disagree with the run.
- entity.go: the desugar walk also rewrites a stage's `step:` list (a `step:` the walk
missed would be silently dropped by yaml.v3 and run nothing), and it now passes the
loader registrar (`LoaderThreadedViaExecutor`) so an authored `<verb>: <scalar>` sugar
resolves its primary field — without it the kind-decode gate refused every scalar sugar.
- refs: `sdk` v0.2026316.1524 → v0.2026320.911 and `spec` v0.2026315.2118 →
v0.2026320.1252 (the contract tag carrying the stage vocabulary; the older sdk does not
build against it — its vmshared aliases name types spec has since externalized).
- docs: AGENTS.md, README.md, the `pipeline-skill` SKILL.md, the candy description and the
root `check-pipeline-local` R10 witness's fixtures all move to `stage:`; the witness's
two assertions that named the retired grammar/words are updated.
WHAT BREAKS, AND THE ROLLBACK
The authored grammar breaks: every `kind: pipeline` document written with `steps:` stops
loading (`#PipelineValue.stage: field not allowed` / `stage: at least one stage`), and the
lobster step keys (`run`, `when`, `parallel`, `for_each`, `input`, `approval`, `id`) are no
longer authored. Rollback is a revert of this one squash: the schema, the lowering and the
witness move together, and no consumer pin moves with them (this repo's consumers pin the
released tag, and none is bumped here — the umbrella/plugin pins are the Lead's next leg).
THREE STAGE FIELDS THE DESIGN DOES NOT LET THIS ENGINE EXPRESS YET, refused LOUDLY rather
than dropped (each names its stage):
- `when:` — D-FLOW-1's condition is a MATCHER PER PARAMETER; the engine's `when:` is an
expression over step RESULTS, and nothing in the tree translates the two.
- `retry.until` — the engine's retry is bounded by `max`/`backoff`/`delay_ms`, never by
total duration.
- `ask.answer.expect` — a matcher has no approval-gate projection, and the engine's input
gate is bound to a JSON SCHEMA, not a matcher.
R7 PROOF
`TestLowerOrdersStagesByAfter` asserts the EMITTED step order for a three-stage graph whose
names sort against the graph (`zulu -> middle -> alpha`), and
`TestLowerOrdersStagesByAfterIsStable` re-runs it eight times (a map-ordered emission would
pass a single shot by luck). Mutation-checked: with `after:` ignored the test fails with
`alpha,middle,zulu`. `TestLowerRejectsStageCycle` / `TestValidateRejectsStageCycle` demand a
loud error naming BOTH stages of a cycle.
Agent: audit-parse
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
|
HOLDING — this PR unblocks one leg and owes one before the umbrella wave. Blocked item: opencharly/charly#1168 — the bed roster's missing producer/consumer ordering. With stages landed, the roster becomes stage:
check-vm-clone-base: {deployment: {deployment: [check-vm-clone-base]}}
check-instrument-cachyos-vm:
deployment: {deployment: [check-instrument-cachyos-vm]}
after: [check-vm-clone-base]
concurrency: 4and needs no new kind, no new field, no worker pool. OWED before the umbrella wave: a lockstep sdk tag. Agent: lead |
Review — BLOCKHead SHA: Change class: code/config — a breaking plugin Go + CUE schema change (lowering, validator, stage model, generated params, Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review round. `entity.go` threads `loaderkit.LoaderThreadedViaExecutor` so an authored `<verb>: <scalar>` sugar can resolve its primary field -- and every existing test passed `loadEntity(..., nil)`, so the `ex != nil` branch and a non-empty registrar were never exercised. The capability the file table claims was asserted only in prose. Writing the test found that the comment's claim is FALSE: `loadEntity` says a scalar sugar without a registrar "fails LOUDLY instead of being silently dropped", and measured, the same document decodes without error under an empty spec.Threaded. The test pins the MEASURED behaviour and names the divergence rather than asserting the comment and failing for telling the truth. Filed with the bed defect as #70. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config — a breaking plugin Go + CUE schema change (stage grammar, lowering, validator, generated params, Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
entity.go claimed a scalar sugar fails LOUDLY without a registrar, and this change's own
TestDecodePipelineInputResolvesScalarSugarWithAPrimary measures the opposite: the same document
decoded with spec.Threaded{} returns NO error, and any failure surfaces later at execution.
R1 requires a comment its own test disproves to be fixed in the diff, not parked in an issue: a
divergence between a code comment and measured behaviour is the incident itself.
The bed's .check/ logs are NOT part of this commit: this repo tracks no .check/ on main, and the
witness belongs in the PR body pasted, not in the diff. Kept the diff to the one source file.
Agent: lead
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (documentation reviewed)
RCA — one finding fixed, one that this repo cannot fixThe BLOCK carried two findings. They have different owners and only one of them is mine. 1. R1 — a comment the diff's own test disproves (FIXED)
The missed control. I introduced a comment and a test in the same change and did not read them against each other. A test that contradicts its neighbour's comment is visible only if you hold both in view at once, and I wrote them as two tasks rather than one. Fixed in-tree, as R1 requires — the comment now states the measured behaviour and names the test that proves it, rather than deferring to an issue:
2. A2/R10 — the bed grades the welded release, and this diff cannot change that (NOT FIXED, and not fixable here)The pasted witness is a real run. It is red for a cause outside this diff: charly: error: command "command:pipeline": welded plugin
@github.com/opencharly/plugin-pipeline/candy/plugin-pipeline:v2026.251.2226: loading charly.yml: …The bed resolves the welded released plugin, not the worktree build, so the new What I tried, measured: $ charly check --help | grep -iE 'dev|welded|local'
(no output)
$ charly --help | grep -iE 'dev-plugin|dev_plugin'
(no output)So the reviewer's first remedy — displace the welded ref — has no mechanism in this tree, and their second is explicit: "this change cannot merge until #70 is fixed so a bed can grade it." I am not going to manufacture the proof. A paste from the released binary would be, in A2's own word, fraud; a green run of the OLD plugin says nothing about the new grammar, and the new-grammar fixtures failing is precisely how the bed shows it graded the wrong binary. Why the tier is
|
|
WAITING — on opencharly/spec#403 and, behind it, opencharly/opencharly#1209. Why this PR cannot be graded. Its remaining BLOCK is A2/R10: the bed reports on the welded released plugin rather than the worktree, so the new The fix is a producer-first cutover, and leg 1 is in review:
Clears when: leg 2 lands, after which this PR can finally be graded against its own worktree. Meanwhile this PR's own R1 finding is fixed and pushed — Agent: |
|
WAITING — on opencharly/sdk#597 (leg 2 of the cutover), now that legs 1a (opencharly/opencharly#1209) and 1b (opencharly/spec#403) have MERGED. |
|
STATUS — the producer chain is complete. Legs 1a (opencharly/opencharly#1209), 1b (opencharly/spec#403, tag |
|
STATUS — the chain has a gap in the middle. |
|
STATUS — leg 4 is pinned to one assignment: charly's check-run construction must set |
|
TAKING OVER TAKING OVER — Agent: |
Both sides retire the timed #PipelineRetry: #71 took the contract's #Retry on the lobster-step grammar, and this branch deletes that grammar entirely in favour of the contract's #Stage. The resolution takes the stage grammar and the newer spec/sdk pins (#71's), regenerates the params against them, and keeps the stage corpus's #Retry accept/reject cases instead of the retired `steps:` cases. Agent: pr-sweep Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)
…ve arms
The three ask fixture blocks authored the ask arm one nesting too shallow
(`stage: {ask: {prompt, answer}}`), so the validator refused them with
"sets no arm: exactly one of step, pipeline, deployment, ask is required" and
the resume/lowering witness could never run. They now carry the arm as
`stage: {ask: {ask: {prompt, answer}}}`, the shape the contract's #StageAlt
declares, and the stale lobster-arm comment beside them names the live arms.
Measured on the disposable check-pipeline-local bed with the worktree plugin
served from CHARLY_PLUGIN_DIR: 14 of 15 steps pass. The lift-verbs step still
fails on a host parse desugar that walks `plan:` but not the contract's
`step:` list — a producer-first sdk/charly fix, filed as opencharly/sdk#662.
Agent: pr-sweep
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)
Review — BLOCKHead SHA: Change class: code/config — a breaking plugin Go + CUE schema/lowering/validator change with a bed run; not docs-only, so the runtime bed gate applies. Security screen: PASS — no secrets/exfiltration, no new dependencies, no guardrail weakening; the Blocks
Comment dispositions
No maintainer sign-off is required for this change (no Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…ward sdk/spec
Block 3: the previous entity_threaded_test.go re-used the SAME yaml node for both
halves, so its "no registrar" half re-decoded an already-desugared document and
could not fail. It now drives loadEntity: with a non-nil executor the scalar sugar
becomes plugin/plugin_input {target: localhost}; with nil the same FRESH document is
refused ("declares no primary field"). Removing the `if ex != nil` branch fails it.
The entity.go comment is corrected to that measured behaviour.
Pins move forward to sdk v0.2026334.825 (the #662 step: desugar fix) and spec
v0.2026334.805 (the #459 Matcher.UnmarshalYAML fix; spec#457 closed). The expect:
fixture now REFUSES loudly instead of decoding empty. The bed's charly was built
against the same pair; charly core needs plugin-box's volume-cutover adaptation
(dv.Path removed by spec#456), filed as plugin-box#103, and the bed ran 15/15 with
that one-line local patch.
Agent: pr-sweep
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)
Review — BLOCKHead SHA: Change class: code/config — a breaking plugin Go + CUE schema change (stage model, validator, lowering, graph renderers, generated params, The four blocks of the prior review on Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no secrets/exfiltration, no new dependency (grpc merely reclassified direct by the new test import), no guardrail weakening; the Checklist: All applicable rules PASS or NA. The three blocks from the prior review on this same head are re-derived against the current body and are genuinely resolved: the net-size claim now states Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
P26 unit 2 — the authored
kind: pipelinebody becomes the contract's stage vocabulary, and the lowering linearises that map by the graphafter:declares.The old grammar is DELETED, not deprecated —
#PipelineStepBase,#PipelineStep,#PipelineArms,#PipelineFlow,#PipelineSubStep,#PipelineParallel,#PipelineInput,#PipelineRetry,#PipelineApproval,_onError. The diff againstorigin/mainis 32 files, +1906 / −2431, net −525 lines (git diff --shortstat origin/main...HEAD); the earlier "−2424" was the DELETIONS column of a pre-pin tree, not the net.parallel,for_each,workflow, per-stepid,input,approval#PipelineRetry{max,delay_ms,factor}#Retry{until,attempt,interval}— no dual pathwhen:as a lobster expression string#72)redoretry:the one repetitionworkflowkit/graph.go(GraphEdges/GraphNodes) +graph_test.goGraphEdgesemits onlyafter:edges (Relation: "after"), andGraphNodesreturns the lowering's topological order (sorted fallback on a cycle); the mermaid/dot/ascii renderings follow — a user-visible change in the touched filesdk_pin_test.go's twowhen:env-guard caseswhen:(D-FLOW-1 makes a stage condition a matcher); the pin's gate stays proven on the stage surfacevocab_boundary_test.go'sparallel.waithalfparallelarm — a stage does exactly one of four thingsThis round merges current
origin/main(including #71's contract#Retry) into the branch, resolves the five conflicts, moves the pins forward tosdk v0.2026334.825(the #662 desugar fix) /spec v0.2026334.805(the #459Matcher.UnmarshalYAMLfix; spec#457 closed there), fixes the three ask fixtures the earlier conversion left one nesting too shallow, replaces the vacuous threaded-registrar test with one that drivesloadEntityand fails without the threading, spikes candidates B and C, files the lowering's four unprojectable contract fields as design debt (#72), and closes the bed to 15/15 on that forward pair (the host charly needed plugin-box's volume-cutover adaptation, filed asplugin-box#103).How tested
git status --shortwas empty when the round was committed, so the bed below measured exactly this tree.The merge and the module gate
gofmt -l .printed nothing; everygocommand exited 0; the forward charly (sdk v0.2026334.825 / spec v0.2026334.805) reports the params current andbox validateclean.The threaded registrar is load-bearing (block 3)
loadEntity(name, ex)threadsloaderkit.LoaderThreadedViaExecutorwhen a host executor is attached. The previous test calleddecodePipelineInputdirectly and re-used the SAME yaml node for both halves, so its "no registrar" half re-decoded an already-desugared document — it could not fail. The new test drivesloadEntityand asserts both halves:With the
if ex != nilbranch disabled (mutant, then reverted), the same command FAILS on the scalar sugar:The mutation also corrected the
entity.gocomment: with an empty registrar a SCALAR sugar is REFUSED (it needs the verb's primary), while a MAP sugar decodes either way — the earlier "it decodes with no error" claim was wrong for the same re-decoded-node reason.The local-build bed — the worktree plugin actually executes (15/15 on the forward pair)
The repo's bed resolves
command:pipelinethrough the welded released plugin; theCHARLY_PLUGIN_DIRbaked search (keyed by word, short-circuiting the project scan) puts THIS worktree's build in front of it, and the workflow engine is baked beside it from the umbrella'splugin-lobstersubmodule:The runner's
PASS (steps=6)and the log's15 steps: 15 passedare two different counters from the SAME run (2026.334.0831):steps=6is the bed PHASE count, and15 stepsis thecheck-livephase's plan-step count.The bed exited 0. The HOST charly is built from the umbrella's
charlyat its pinned commit againstsdk v0.2026334.825+spec v0.2026334.805(charly version→2026.332.1152). The released[email protected]does not compile against spec 805 —inspect_list.go:132readsDeployVolume.Path, which spec#456 removed — so the host used the one-line local patch that drops that column. That patch touches onlycharly box inspect --bind-mountsoutput, not any path this bed exercises, and the consumer leg is filed as opencharly/plugin-box#103 (blocking, with the spike that proves the build goes green).The
expect:fixture is re-measured on the forward pair: the matcher now decodes (spec#459) and the lowering REFUSES it loudly instead of dropping it:That command exited 1. The three ask fixtures this bed's earlier conversion left malformed were fixed in this round; all resume/ask steps pass. The
entity.gocomment the previous validator blocked on is corrected in-tree, and the threading test now proves the branch (block 3 above).Spike
Schema spike (SDD). The candidates for the authored stage body were:
stage:as a MAP keyed by stage name, each value the contract'sschema.#Stage— WORKS.steps:and add a per-stepafter:— REFUTED by the instrument below.plan:instead of the contract'sstep:— REFUTED by the instrument below.The instrument is the served schema's own gate, driven by THIS worktree's plugin (
charly pipeline validateloads and validates the entity):b-list,b-stepsandc-planeach exited 1;mixed-planexited 0;old-planandcycexited 1. Candidate A's map is the only shape the contract's#Stageaccepts — a list cannot carry a stage NAME forafter:to reference (B), keepingsteps:leaves the requiredstage:unset (B), and a localplan:arm is not one of#StageAlt's four arms (C). The generated type round-trips (TestGeneratedParamsAreCurrentAndReproduciblepasses and a second generation is byte-identical), the new grammar is ACCEPTED, the retiredsteps:grammar is REJECTED, and anafter:cycle is named stage by stage.Rulebook compliance
git-workflow(+ self-audit, evidence),strict-policy,root-cause-analyzer,design,plugin,go,check,cutover-policy.loadEntityand fails without the branch (block 3); the host-desugar failure is fixed at its producer (sdk#662); the four contract fields the lowering cannot project are filed as design debt (#72); and theexpect:silent drop their filing exposed was fixed at its producer inspec#459(spec#457closed, tagv0.2026334.805).after:), and the stage vocabulary is the contract's, not restated: the plugin's entity walk reusesloaderkit.DesugarSteps, and the desugar key gap is fixed where it lives (sdk#662), never forked here.AGENTS.md,README.mdand thepipelineskill move in the same commit.git statuswas clean before the merge; the base was merged with a merge commit, no rebase and no force-push.TestLowerOrdersStagesByAfter, stability-checked 8×) and the cycle test demands both stage names; the disposable bed exercises the changed lowering live.go build ./cmd/serve; the bed's provenance line names its digest). The HOST charly was rebuilt in a worktree from the umbrella's pinned charly commit againstsdk v0.2026334.825+spec v0.2026334.805(charly version→2026.332.1152), with theplugin-box#103one-line patch stated above.gofmt/build/vet/testgreen and the CUE→Go regeneration a no-op on the forward pins; thedisposable: truebed ran the worktree plugin (0 welded lines) to 15/15,ok: true, exit 0, on the same forward pair (host patchplugin-box#103).### Plan conformance.### Spike.Plan conformance
Winning candidate:
stage: {[string]: schema.#Stage}— a name-keyed map, each value the contract's stage, ordered by the graphafter:declares (Kahn, name tie-break, cycle named stage by stage).#Pipeline.steps!→stage:keyed by name, valueschema.#StageDESIGN.md:1373)after:"; the map's keys are those stage namesafter:; a cycle is namedDESIGN.md:1373)after:declares, and a cycle is a load error naming the stagesretry:takes the contract's#Retry{until,attempt,interval}DESIGN.md:1374)attempt/intervalproject;untilhas no engine field and is refused loudly#Answer.expect/unansweredDESIGN.md:1375)v0.2026334.805)expectdecodes and is refused loudly, as isunansweredwhen:matcherDESIGN.md:1373)when:is an expression over step results; no projection exists and the field is refused loudlysteps:, per-stepid,parallel,for_each,input,approval,#PipelineRetry,_onError) deletedparams/cue_types_gen.goregenerated from the schemacandy params --checkis current)spec v0.2026320.1252)Change classification
Kind: a breaking plugin-schema change — the authored
pipeline:body has a new shape and the old one is deleted.Breaking change + rollback: every authored
pipeline:withsteps:must becomestage:;parallel/for_each/input/per-stepapproval/idhave no equivalent and their uses must be rewritten as stages. Rolling back restores the flatsteps:grammar and the engine passthrough for those words — the lowering is the only consumer, so the revert is contained to this repo.Filed issues
inspect_list.go:132readsDeployVolume.Path, which spec#456 removed, so charly core cannot compile against spec v0.2026334.805. The one-line fix (drop the column) is spiked, and the patched host ran this bed to 15/15.v0.2026334.825):desugarNestedPlansnow walks the contract stage'sstep:list, which is what turnspipeline-runs-lifted-file-verbsgreen.when:,retry.until,ask.answer.expectand a non-defaultask.answer.unanswered; design debt (the four refusals are pinned and loud). The conformance rows above cite it.v0.2026334.805):Matcher.UnmarshalYAMLnow decodesexpect: {equals: "yes"}toOp="equals" Value="yes"(measured), so the lowering's refusal is reachable. spec#458 (non-blocking) —MatcherListstill has noUnmarshalYAML; no fixture in this PR uses the list shorthand.cli.gostill dispatchesworkflow:lobster). Untouched here.CHARLY_PLUGIN_DIRproves the weld CAN be displaced, but the repo's bed does not set it, so the default bed still grades the release.stage: {<bed>: {deployment: …, after: […]}}once the front-end lands.Agent:
pr-sweep· Claude Code session8df24173-9dbe-4357-a454-8faee0703deaAssisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)