Skip to content

spec: the released #Workflow IR is documented as the engine wire, but nothing produces or consumes it #192

Closed

Description

@aitrawog

Problem

spec v0.2026276.0 (the W0 leg of the workflow-IR wave) released the IR family
#Workflow, #WorkflowStep, #WorkflowTrigger, #WorkflowStepResult,
#WorkflowApproval, #WorkflowSchedule, and documents the root as the engine wire:

// #Workflow — the normalized, engine-agnostic IR. entities: is carried verbatim
// from the authored form so a lowerer can emit the generated charly.yml.

and, in the NOTE below it:

// The IR is the ENGINE WIRE, not a kind: it is produced by lowering and consumed by
// an engine, never authored in a charly.yml.

The implemented lowering never produces it, and no engine consumes it. The shipped
seam is the pipeline NAME + gen_dir in #WorkflowRunRequest; the front-end lowers the
authored entity straight to the file pair and the engine reads those files.

Evidence

Signatures on the implementation branch (sdk/workflowkit):

$ grep -nE 'func (Lower|ValidatePipeline)\(' sdk/workflowkit/*.go
workflowkit/validate.go:34:func ValidatePipeline(p *spec.Pipeline) error {
workflowkit/lower.go:45:func Lower(p *spec.Pipeline, projectDir, genDir, charlyBin string) ([]byte, []byte, error) {

Lower takes the authored *spec.Pipeline (not *spec.Workflow) and returns the two
lowered files — it does not build the IR.

Grep for a constructor or consumer of the bare IR type across every wave leg
(sdk, spec, plugin-pipeline, plugin-lobster, plugin-task, plugin-migrate,
plugin-command, charly), excluding the op envelopes:

$ grep -rnE 'spec\.Workflow[^A-Za-z]|spec\.Workflow$' <leg> --include='*.go' | grep -v _test.go
--- spec ---
ops/ops.go:108:	// req.GetOp() against these, decoding the matching spec.Workflow*Request and returning
--- plugin-lobster ---
plugin.go:12:// `spec.Workflow*Request` from `ParamsJson` and answering the matching

Every hit is a *Request/*Reply envelope — the wire contract, which is legitimately
used. Nothing constructs #Workflow; nothing reads it. Its constituent types are only
reachable through it.

Why it matters

spec is the contract repo. A released doc comment states the lowering produces an IR that
the engine consumes; the implementation bypasses it entirely. Two consequences:

  1. Doc-vs-reality divergence in a released tag (R1) — a reader of the schema is told the
    engine wire is #Workflow, but the actual wire is #WorkflowRunRequest (name + files).
  2. The plan's "one IR, many consumers" story (a future GitHub-Actions consumer lowering the
    same IR) is not implementable as documented: there is no IR to lower from, so a second
    consumer would have to duplicate the *spec.Pipeline → files lowering rather than share it.

Scope — a decision, not a code change yet

Retire the IR family, or route lowering through it. Either way the schema's own comment
must be made true:

  • Retire: delete #Workflow/#WorkflowStep/#WorkflowTrigger/#WorkflowStepResult/
    #WorkflowApproval/#WorkflowSchedule and the NOTE's IR claim; keep the op envelopes.
    (A spec change + tag + pin bumps — its own leg, not part of the current cutover.)
  • Wire it: Lower builds a spec.Workflow and serializes it, so a second consumer can
    lower from the IR.

This issue is filed as the coordination point; it is referenced from the plugin-pipeline
cutover PR. Not to be fixed inside that PR — the types live in spec, whose W0 leg is
already merged and tagged.

Agent: workflow-ir · session 7e17b5cf-c349-4032-8da5-2e4e03612780
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)

Activity

  1. self-assigned this
    on Oct 3, 2026
  2. aitrawog commented on Oct 3, 2026

    @aitrawog
    ContributorAuthor

    CLAIM — I filed this from the workflow-IR wave and own it.

    It is a follow-up on the wave's own W0 leg (spec v0.2026276.0), which is already merged and
    tagged. It is not in scope for the plugin-pipeline cutover PR, which will reference it.

    Sequence: the IR decision (retire vs wire) lands as its own spec change + tag + pin bumps,
    after the wave's remaining local legs land. No consumer is broken by it today — the point is
    that the schema's own comment is currently false, and a second workflow consumer would have
    nothing to share.

    Agent: workflow-ir · session 7e17b5cf-c349-4032-8da5-2e4e03612780
    Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)

  3. aitrawog commented on Oct 5, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the divergence this issue reports now stands on landed artifacts, not on branch code; the decision it asks for is the operator's, and nothing in the wave contradicts the issue.

    What changed since the issue was filed (2026-10-03T15:16:45Z). The issue's evidence was taken from wave branches. Both legs it cites have since converged:

    • The producer landed. opencharly/plugin-pipeline#32 merged (2026-10-04T21:04:52Z, squash 3d2aee8), tagged candy/plugin-pipeline/v0.2026277.2104. Its Lower still takes the authored *spec.Pipeline and returns the two lowered files.
    • The consumer is in validation on its final head. opencharly/plugin-lobster#2 (head 043a702) — the engine leg. Its plugin.go still references only spec.Workflow*Request/*Reply envelopes; nothing in it constructs or reads the bare #Workflow IR.

    So the issue's two consequences are unchanged and now reproducible against released/merged code rather than a branch:

    1. Doc-vs-reality in a released tag (R1). spec v0.2026276.0's comment calls #Workflow "the ENGINE WIRE … produced by lowering and consumed by an engine", while the wire actually in use is the pipeline name + gen_dir in #WorkflowRunRequest. A reader of the released schema is still told something the implementation does not do.
    2. The "one IR, many consumers" story is not implementable as documented. A second consumer (the designed-but-not-built github-actions emit) would have to duplicate the *spec.Pipeline → files lowering rather than share it through the IR.

    What this is not. It is not a defect in either landed leg — both do what their own contracts say, and Lower taking the authored *spec.Pipeline is a coherent design. It is the released doc comment that overstates the seam, which is why this is a scope decision, not a code change: either the comment is corrected to describe the actual wire (name + files), or the IR is promoted to a real intermediate — a *spec.Pipeline → *spec.Workflow lowering step that the file-pair lowering then consumes — so a future consumer can share it.

    No new work is claimed here and no comment of mine is left unanswered on this thread. Flagging the state so the decision is made on landed artifacts. If the operator rules for promoting the IR, that is a spec/sdk change with its own legs, and it would land the same way as the rest of the wave: producer-first.

    Agent: workflow-ir · session 7e17b5cf-c349-4032-8da5-2e4e03612780
    Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)

  4. aitrawog commented on Oct 7, 2026

    @aitrawog
    ContributorAuthor

    STATUS — a RETIRE ruling for this issue was relayed to me today (from the operator, through the team Lead), and I was about to execute it as an R5 deletion of the released IR. Before touching anything I re-derived the issue's premise line by line on today's origin/main, and the premise as written does not hold: the #Workflow family is no longer unconsumed. I am not deleting anything until the ruling is re-made on the corrected facts. Evidence below, per type.

    1. Three defs ARE dead — exactly the "IR document" triple. No live (non-test, non-comment) spec. reference anywhere outside CHANGELOG/:

    • #Workflow, #WorkflowStep, #WorkflowStepResult.

    2. The rest of the family is LIVE wire code in two engine plugins (per-type live reference sites; grep -rn --include=*.go "spec\.<Type>" . excluding .worktrees/, CHANGELOG/, _test.go and line-leading comments):

    • #WorkflowApproval → plugin-lobster/candy/plugin-lobster/run.go:214 (reply.RequiresApproval = spec.WorkflowApproval{...}).
    • #WorkflowTrigger, #WorkflowSchedule → plugin-lobster/.../schedule.go, plugin-pipeline/.../cli.go.
    • #WorkflowRunRequest / #WorkflowRunReply / #WorkflowResumeRequest / #WorkflowInputRequest / #WorkflowEmitRequest / #WorkflowEmitReply → plugin-lobster/.../plugin.go, run.go (the engine decodes the request envelope from ParamsJson and answers with the matching reply — its own wire contract).
    • #WorkflowScheduleRequest / #WorkflowScheduleEntry / #WorkflowScheduleReply → plugin-lobster/.../schedule.go, plugin-pipeline/.../cli.go.
    • #WorkflowEngineCapability → plugin-lobster/.../plugin.go.

    3. When that consumer landed. plugin-pipeline PR #32 (3d2aee8, 2026-10-04, "the resume + schedule legs") and plugin-lobster PR #3 (4aee2f2, 2026-10-05, "the native lobster workflow engine — run, resume, gates, scheduler, CLI") — i.e. the consumer appeared around this issue's own STATUS (2026-10-05T01:27:59Z) and after this issue was filed (2026-10-03). The IR's own comment in schema/workflow.cue — "the engine-agnostic IR every consumer lowers from" — is therefore no longer aspirational for the envelope half: plugin-lobster is the workflow provider class's engine and consumes those envelopes as its wire contract.

    What this means for the decision

    • "Retire the whole family" is not a one-repo R5 deletion. It would compile-break plugin-lobster and plugin-pipeline (two further repos, each its own PR/migration), and it would remove the wire contract of a shipped engine — a capability regression, not a doc cleanup.
    • "Retire exactly the dead triple" (#Workflow, #WorkflowStep, #WorkflowStepResult) is executable in the contract module — but it is still a deletion of released CUE defs, so it carries the version/migration coupling the release rule requires, and it removes the normalized-IR concept the engine may still adopt (the defs are the declared lowering target).
    • "The doc claim is now true" is the third reading: an engine does consume the IR family, so the divergence this issue reported has been overtaken by the lobster cutover.

    I am leaving this issue and its text untouched and escalating for a re-ruling on the corrected premise (wire-types, session 80a2525e-6107-4143-94c4-795f317c71d3).

    Agent: wire-types · session 80a2525e-6107-4143-94c4-795f317c71d3
    Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)

  5. aitrawog commented on Oct 7, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — the dead engine-wire IR is gone from the contract, and the claim that made it read as live is gone with it.

    What landed: #206 — merged 2026-10-07T22:14:39Z as 882807e52ebae94fe376deb7b69619206a2f8512, tagged v0.2026280.2214.

    • Deleted: #Workflow and #WorkflowStep from schema/workflow.cue, the header narrative that framed them as "the engine-agnostic IR every consumer lowers from" (with its lobster/GitHub-Actions consumer table), and the three #WorkflowStep comparisons in schema/pipeline.cue — each re-anchored to what is true: an engine normalizes a pipeline into its own form; #PipelineArms is embedded by #PipelineStepBase, with #PipelineSubStep re-declaring its own non-recursive subset.
    • Generated surface: charly task cue-gen regenerated spec/cue_types_gen.go (the two declarations gone) and its own reproducibility step passes — the header comment does not reach the generated file, so a second run is a no-op.

    The correction that must stay on the record. The operator's ruling said retire the dead triple (#Workflow, #WorkflowStep, #WorkflowStepResult). The truth is a pair. charly task cue-gen refused the triple:

      [fail] run — gengotypes + schemagen the generated Go
          exit=1, want 0 (stderr: #WorkflowRunReply.steps: reference "#WorkflowStepResult" not found:
              ./schema_spec.cue:10581:26)
    

    #WorkflowStepResult is live wire — the reply envelope of the engine that is running today carries it (#WorkflowRunReply.steps) — and a Go-only reference grep cannot see that CUE edge, because nothing in Go names the type. It therefore survives, with a comment in schema/workflow.cue stating exactly why it survives, so no future reader retires it by the same mistake. Everything else an engine actually consumes is untouched and unchanged: #WorkflowApproval (plugin-lobster/run.go:214 builds it), #WorkflowSchedule, #WorkflowTrigger, the six request/reply envelopes, #WorkflowScheduleRequest / #WorkflowScheduleEntry / #WorkflowScheduleReply, #WorkflowEngineCapability.

    Claim-keyed sweep on the merged head — bare-\b patterns plus an exact-type grep, tests included, so the surviving #Workflow* names are not false positives:

    $ git -C spec grep -n "#Workflow\b" v0.2026280.2214 -- 'schema/*.cue' 'spec/cue_types_gen.go' | grep -v "CHANGELOG"
    $ echo "exit=$?"
    exit=1
    $ git -C spec grep -n "#WorkflowStep\b" v0.2026280.2214 -- 'schema/*.cue' 'spec/cue_types_gen.go' | grep -v "CHANGELOG"
    $ echo "exit=$?"
    exit=1
    $ git -C spec show v0.2026280.2214:spec/cue_types_gen.go | grep -c "^type WorkflowStep struct\|^type Workflow struct"
    0
    $ echo "exit=$?"
    exit=1
    

    Zero live hits outside CHANGELOG/, which is the only permitted survivor here. Nothing migrates: the deleted defs were engine-wire IR, never authored keys in a charly.yml, and charly migrate's four ops rewrite authored keys only — so no migration entry is owed, and that is stated rather than assumed.

    Two prose surfaces elsewhere are routed, not fixed here (a cross-repo cutover lands one PR per repo): plugin-lobster/README.md:34 and plugin-pipeline/candy/plugin-pipeline/cli.go:373 still call the surviving envelopes "the IR" — not false (the envelopes survive), but they name a term this contract no longer defines. The source of truth is now schema/workflow.cue's header.

    Provenance of this scope narrowing: the original premise ("nothing produces or consumes the IR") was falsified on the live tree before any edit — plugin-pipeline (PR #32, 2026-10-04, 3d2aee8) and plugin-lobster (PR #3, 2026-10-05, 4aee2f2) consume most of the family — corrected on this thread (comment 6047419903) before remediation, and re-ruled by the operator to the dead defs only.

    Agent: wire-types · session 80a2525e-6107-4143-94c4-795f317c71d3
    Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions