Skip to content

fix(workflow-code): DX fixes from the staging A/B runs - #10229

Merged
waleedlatif1 merged 16 commits into
stagingfrom
fix/workflow-code-ab2-dx
Nov 20, 2026
Merged

waleedlatif1 merged 16 commits into
stagingfrom
fix/workflow-code-ab2-dx

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Fixes for what agents hit in the staging A/B runs of workflows as code (#10220 live).

  • Dangling $ref in an edited function file is an error (E_APPLY_UNRESOLVED_REF, server and offline check). A rename already rewrites $ref keys; code the stored workflow already holds keeps the warning. New hint names the renamed block. Primer says what a rename does.
  • No W_JSON_REF_UNTYPED for a rename's reference rewrite: the unchanged-field comparison reads the stored workflow through the rename map.
  • source status prints the findings it counts (stderr, and diagnostics in JSON), workflow and workspace.
  • Operations edit with params.parentId moves the block into/out of a loop or parallel keeping its id (was a silent no-op); a non-container parent is skipped with a reason.
  • workflows deploy accepts -y/--yes as a no-op, like the other write commands.
  • Condition branch handles documented (if, else-if-N, else) in the block's best practices.

Each fix has a test that fails without it. Generated OpenAPI, CLI v2-api.ts, MCP operations and CLI docs regenerated.

🤖 Generated with Claude Code

…N_REF_UNTYPED

After a block rename, every JSON field reading the renamed block holds the new key while the
stored field still holds the old one, so the compile's stored-value comparison treated each as
edited and reported W_JSON_REF_UNTYPED on blocks nobody touched. The comparison now reads the
stored workflow through the apply's renames (looking a block up under its new or stored key and
rewriting the stored text's references as the apply does), and the server's recompile for
renames materialize infers (name and const both changed) also settles these findings.
`sim workflows source status` and `sim workspaces source status` counted the dry run's
errors and warnings in the plan line but never showed them, in any output format. Both now
print them as an apply does (stderr frames in a display format, `diagnostics` in the JSON
document), from the same filter that counts them.
Agents pass --yes to every write after `workflows source apply --yes`, and `workflows deploy`
refused it as an unknown option. A command contract can now accept the flag without a confirm
gate (acceptsYes), and deploy does.
`sim blocks get condition` never said what an operation's connection handle for an else-if
row is (`else-if-0`, …); agents learned it from a refusal. The block's best practices, which
blocks get prints, now list `if`, `else-if-<n>` and `else`.
… of a container

`workflows operations apply` accepted an edit carrying params.parentId, answered applied, and
left the block where it was: the edit handler never read the key. It now moves the block into
the loop or parallel parentId names (null moves it out), keeping its id, through the same
container checks and placement insert_into_subflow and extract_from_subflow use, and declines a
parentId that is no container with the reason. The contract and CLI help name the key.
…le is an error

A $ref in a function code file that names no block or variable was a warning everywhere, so
`source check` and the dry run passed it on a block the lock binds and the apply saved code
that fails at run time. The apply now refuses it as E_APPLY_UNRESOLVED_REF on a block whose code
the source changed, and an offline check does the same on a function file whose digest differs
from the one the get recorded, in every strict mode; code the stored workflow already holds keeps
the W_UNRESOLVED_REF warning, so a workflow saved with a dangling reference still applies. A head
that is a key the workflow had and source no longer declares gets a hint naming the one unbound
block as the probable rename.

A rename itself needs no hand edits: the apply rewrites $ref.<old key> to the new key (and the
lock-ident and inferred-rename paths already resolve it in check and dry run). The primer now
says so, and that an unresolved $ref in an edited file is an error.
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Nov 20, 2026 6:31am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[Medium impact] The changes affect workflow editing and the CLI workflows developers use to check and apply source.

Fix parent-cycle checks and batch parent references before merging.

Findings

  1. P1 Parent cycles hang edits ▶
  2. P1 Moves miss newly added containers ▶
  3. P2 File renames fail offline checks ▶

Summary

This PR improves workflow-source checks and CLI feedback.

  • Workflow source checks catch new broken function references and follow block renames.
  • Block edits move existing blocks into or out of loops and parallel blocks.
  • Workflow and workspace status commands show the findings behind their plan counts.
  • Workflow deploy accepts -y and --yes without requiring a confirmation.
  • Condition-block guidance names the branch handles callers use.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Edit["edit.params.parentId"] --> Move["moveToParent"]
  Move --> Lookup["Find loop or parallel"]
  Lookup --> Parent["Set parentId"]
  Parent --> Layout["Default targeted layout"]
  Layout --> Walk["Walk container parents"]
  Walk --> Cycle{"Parent cycle?"}
  Cycle -->|Yes| Hang["Request never finishes"]
  Cycle -->|No| Save["Continue to save"]
Loading

Reviews (1) · Last reviewed commit: "fix(workflow-code): a dangling $ref the ..." · 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 30 files

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

Turn on auto-fix | Re-trigger cubic

…self

params.parentId naming the block itself, or a container nested inside it, made a parent cycle
that default layout followed forever. The edit now declines it with the reason.
…h adds

A batch adding a loop under a readable id and moving a block into it left params.parentId
pointing at the pre-normalization id, so the move was declined as targeting no container. The
id normalization now rewrites parentId as it does subflowId.
…nvas position

Taking a block out of a container added only that container's offset, so a block leaving a loop
nested in another landed short by every outer container's offset. It now adds the offset of each
enclosing container, for an edit's null parentId and extract_from_subflow alike.
…runcated

The status listing kept only errors and warnings, so it dropped the info I_FINDINGS_TRUNCATED and
presented a cut list as complete. It now keeps that marker, counted as neither.
… at once

The rewriter applied renames one after another, so swapped or chained renames rewrote a token a
second time (a swap of a and b turned <a. back into <a.). It now rewrites every token in one pass.
…ited

Renaming a function file without changing its code made a stored dangling $ref an
E_APPLY_UNRESOLVED_REF in an offline check, because the new path had no recorded digest. The
check now compares a moved file against the digest of the path the lock bound its block to, as
the server compares the block's code.
…f renames at once

The apply rewrote references after restoring the stored block's inactive values, under the
source rule that skips a rename whose old key the source still declares. Restored text names
blocks by stored keys only, so a chain (fetch to report, report to summary) left <report.
on the wrong block and a swap rewrote nothing. A restored block now takes every rename in one
pass before it is restored; source text keeps the rule compile resolves it by.
…r inside itself

Inserting an existing loop or parallel into a container nested inside it made a parent cycle,
as an edit's parentId did. Both now share the guard that declines it with the reason.
@waleedlatif1
waleedlatif1 merged commit 5929764 into staging Nov 20, 2026
85 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/workflow-code-ab2-dx branch November 20, 2026 18:43

This branch was successfully deployed

1 active deployment
Preview — 77dde8a2 Deployed Nov 20, 2026 by vercel[bot]
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