Skip to content

improvement(workflow-code): agent DX and check/server parity from the v6 benchmark - #10305

Merged
waleedlatif1 merged 37 commits into
stagingfrom
improvement/workflow-code-agent-dx
Nov 22, 2026
Merged

waleedlatif1 merged 37 commits into
stagingfrom
improvement/workflow-code-agent-dx

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Follow-ups from the v6 agent benchmark and QA7: agent DX on the CLI and docs, check and lint parity with the server and the run, and clearer server and executor messages.

CLI/docs

  • Contract: a workspace dry run that would hold changes back exits 15, as the apply does, so a script can tell beforehand that the apply would write only part. If every change would be held, it exits 1, again as the apply does.
  • Contract: --stop-after sets selectedOutputs to the stop block when --select-output is not given. blockOutputs then holds what that block produced, under its key or id. output stays empty.
  • workflows run --help says what the result holds (status, not success), how the command exits, and that draft runs need --manual.
  • source params takes a block type: function prints fn, and table_v2 lists the table.* builders. It also prints a core builder's doc.
  • The operations path documents the error output, a Workflow block's result (result.data.x), the conditions and inputFormat shapes, retry, and canonical names.
  • -w and SIM_WORKSPACE, and the trap of putting --workspace <id> in one shell variable, are in the top-level and source group help.
  • workflows create help says the draft holds a Start block. workflows export help says workspace bindings print as null unless --include-workspace-bindings.
  • The cookbook and primer cover table.upsertRow, Response dataMode: 'json', what a reference to a block that did not run resolves to, and loop results.
  • Contract: a workspace status's JSON plan.errors and plan.warnings count what its dry run reports. A conflict counts as an error.
  • Contract: a workflow update that removes blocks or variables is marked destructive and counted in the plan summary. It already needed --allow-delete. A workflow status names --allow-delete when the edit removes a variable.

Check and lint parity

  • Contract: canonical param names are accepted on the operations path (for example tableId on a Table block), as blocks get and source name them. A string goes to the advanced member and anything else to the basic one, and the block's mode follows the member written. A canonical name set beside one of its own members is refused, and the refusal names every field that shares the name, with its mode.
  • New codes:
    • W_LOOP_CONDITION_SYNTAX: a while or do-while condition the run cannot parse. On an edited loop it is refused as E_APPLY_LOOP_CONDITION_SYNTAX.
    • W_CHILD_RESULT_PATH: an offline check of result.<key> on a child that responds, where the value is at result.data.<key>.
    • The lint kind child-result: the same finding on the server. A source apply reports it as W_APPLY_LINT.
    • A loop reading its own index by name in its condition is W_REF_OUT_OF_SCOPE.
  • check fails on a lock every apply refuses (over the block or variable cap, or invalid JSON), and says how to recover.

Server/executor messages

  • A deployed run calling an undeployed child names the child and says to deploy it. A deploy's lint reports such a child.
  • A new block of an unknown type is one error at its source line, not three.
  • The outline shows a block's error output as on when an error edge leaves it, since the executor takes that edge whatever the stored flag says.
  • The CLI reference keeps its #create-workflow and #print-a-workflow-as-a-portable-json-document anchors. The content baseline records the CLI code examples the new help rewrote.

Recorded product decisions (not changed here)

  • A Function block's .error keeps its Line N: \code` -` prefix.
  • The CLI's default output does not follow the terminal.
  • No three-way merge.
  • workflows export keeps nulling workspace bindings by default. This is documented, not changed.
  • workflows run keeps a result with status and no success field. This is documented, not changed.
  • The --stop-after default lives in the CLI. A server-side default (in executeManualWorkflowOperation) would cover API and MCP callers too, but it changes the v2 contract for every caller.
  • On the operations path, a string canonical value always goes to the advanced member. Source apply keeps a plain id in a picker on a block already in basic mode.

…on the operations path, and what export clears
…ookbook, and print a core builder's doc in source params
…n an error edge leaves it

The executor takes an error edge whatever the stored errorEnabled flag says, and an
operations edit that wires one leaves the flag false, so the outline reported the
error output off while the path fired. The outline now reads the flag as the editor
draws the port (flag or error edge).
…nd say to deploy it

A deployed parent calling a child with no active deployment failed with
"<child id>" failed: Child workflow is not deployed. The failure now carries the
child's name and id and says a deployed run calls each child's deployed version.
…n operations edit writes beside one of them

An operations edit now writes a canonical name (tableId) into its member field, so the
only refusal left is a canonical name set beside one of its own members. That refusal
now names every field sharing the name, with its mode, and the one the edit also set.
…tions, locks and child results

- A while or do-while condition that is not a JavaScript expression once its
  references stand in as values is W_LOOP_CONDITION_SYNTAX, refused on an edited
  loop as E_APPLY_LOOP_CONDITION_SYNTAX: the run fails evaluating it.
- A loop reading its own index by name in its condition is W_REF_OUT_OF_SCOPE with
  a <loop.index> hint: the condition is evaluated outside the loop's body.
- check fails on a lock every apply and status refuses (a cap over its limit, bad
  JSON), and the lock refusal now says how to recover.
- In a workspace directory, a reference to a child call's result.<key> whose child
  responds is W_CHILD_RESULT_PATH, with result.data.<key> as the hint.
The source apply reported a new block of an unregistered type three times: the
compile's E_APPLY_INVALID_BLOCK_TYPE at its line, the placement gate's in other
words, and the state check's E_APPLY_INVALID_STATE. A gate refusal the compile
already made for the same block, and the state check's repeat of it, are dropped.
…g and an undeployed child at deploy

- A reference to a Workflow block's result.<key> whose child holds an enabled
  Response block, where <key> is not data, status or headers, is a child-result lint
  finding naming result.data.<key>. The source apply reports it as a W_APPLY_LINT
  warning, never a refusal.
- A deploy's lint reports a called child with no deployment, which a deployed run
  of the parent cannot call.
… new checks use

- The offline child-result check finds references with the shared tokenizer and
  splits paths with parseStoredPath, reads the response block type and outputs from
  @sim/workflow-code, and shares calledWorkflowKey with the child input check.
- The loop condition check reuses the canonicalizer's reference pattern.
- The lint reads a response block's outputs from the registry, looks children up
  alongside the reference collectors, and renders value findings with one helper.
- check reads the workspace declarations and compiles its workflows at once.
… Response-output helpers in the new checks

The child lint reads the called workflow through getWorkflowInvocationTarget and the
Response outputs through RESPONSE_OUTPUTS. collectStringLeaves moves to @sim/utils so
the CLI check stops carrying a copy, and both source checks read their workspace
declarations through one helper.
…eir detail into help

The longer summaries renamed the CLI reference headings, so the #create-workflow and
#print-a-workflow-as-a-portable-json-document anchors broke. The Start block and the
cleared workspace bindings are now said in each command's help instead.
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 22, 2026 2:44pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no new actionable issues remain.

Summary

This PR improves CLI guidance and brings offline checks closer to server and run behavior.

  • Runs stopped with --stop-after now return that block’s output by default.
  • Source checks and workspace previews now report the same plan results as apply.
  • Workflow checks now catch invalid loop conditions and child result paths before runs.
  • Workflow operations accept canonical parameter names and keep the right block mode.
  • Workspace plans now show when workflow edits remove blocks or variables.
  • The workflow SDK reference and examples now explain more run and block behavior.
  • The unused-export baseline drops a helper that is now used.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Source[Workflow source] --> Check[CLI check]
  Stored[Stored child graph] --> Lint[Server lint]
  Check --> Shared[Shared Response graph check]
  Lint --> Shared
  Shared --> Result[Warn about result paths only when the child always responds]
Loading

Reviews (4) · Last reviewed commit: "docs: make the cookbook's order writes r..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 67 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread packages/sim-cli/src/program.ts Resolved
Comment thread packages/sim-cli/src/program.ts Resolved
…member access after one parses

A reference replaced by a bare 0 turned <start.text>.length into 0.length, which is not JavaScript, so check warned (and apply refused) a condition the run evaluates fine.
…ild ends at a Response block

A child with a Response on one branch returns another block's output on the others, so W_CHILD_RESULT_PATH and the server's child-result lint now require every run to end at a root Response (alwaysEndsAtResponse in workflow-types, shared by the CLI check and the server). A deploy judges the child's active deployment, a draft write its draft, read in narrow batched queries; a failed child lookup no longer leaves an unhandled rejection. isElseConditionTitle and RESPONSE_BLOCK_TYPE move to workflow-types so every reader shares one rule.
The CLI guessed from each finding's kind/key whether it belonged to a held change, and E_PLAN_REF_DELETED names the held workflow while the server records it on the delete, so a dry run exited 15 for an apply that refuses. The dry run now carries refuses from the plan's own refusing list; the CLI falls back to the guess, minus that code, for older servers.
…rface

On a trigger-mode block, a name shared by action and trigger fields (siteId) was written to the dormant action member.
…e error's line

The cookbook wrote a status option and a column the orders table lacks and upserted on a column not declared unique; a check of the example against the cookbook workspace now guards it. The help says a source directory keeps its recorded workspace and what -w does with a variable holding the whole option.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 88 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread packages/workflow-types/src/workflow.ts Resolved
Comment thread packages/workflow-code/src/responds.ts Resolved
Comment thread packages/sim-cli/src/program.ts Resolved
…y display name

The run resolves <W.index> to loop w by normalized name, so the self-reference check compares normalized names too.
…root cycle, and for a __proto__ key

Rows after a condition's first else never run, so only those up to it must be wired; a root cycle never runs to the Response block; and the canonical graph is built with own properties so a block keyed __proto__ is kept.
…source directory takes its workspace

The orders table's orderId is unique, so the cookbook and the Support workflow upsert on it instead of inserting a second row for the same order.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 90 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
waleedlatif1 merged commit bf6bc31 into staging Nov 22, 2026
95 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/workflow-code-agent-dx branch November 23, 2026 00:04
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.

1 participant