Skip to content

fix(workflow-code): warn on unwired container bodies and unhandled guardrails - #10554

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/wac-qa-b8-wiring-diagnostics
Dec 1, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/wac-qa-b8-wiring-diagnostics

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Wiring diagnostics for workflow code that compiled clean but failed or ended silently at run time:

  • W_BODY_UNWIRED: a loop or parallel with blocks inside but no edge from its start passed check, and the run then failed with "has no executable blocks inside". Compile now warns on the container, with the hint p.to(<block>) (named after the callback parameter and the first body block nothing enters).
  • W_GUARDRAILS_UNHANDLED: a guardrails block with no error edge. A failed check leaves only through the error port, so the run ends there with no output, and a Condition on .passed never runs. The hint is check.onError(<block>). Like W_BRANCH_UNWIRED, a block the stored workflow already holds without an error edge stays quiet, so canvas-built workflows do not pick up new warnings.
  • Nested member wiring source: known.route.yes.to(a) got the unrelated "move this inside the workflow body" hint. It now gets "Wire a branch as known.<branch>.to(...), e.g. known.yes.to(...)." A block without branches gets "Wire the block itself: a.to(...)."
  • Executor message: an unreached loop or parallel body now reports "Loop has no block wired from its start. Add or enable a block in the loop and connect the loop start to it." (same for Parallel).
  • Cleanup: child-results.ts drops its private recursive Tarjan and uses the iterative stronglyConnected exported from compile/edges.ts. branchKeys is extracted so branchPort and the new hint share one branch-key read.

The diagnostic tables in SYNTAX.md and diagnostics.mdx list both new codes. The OpenAPI spec and the CLI types are regenerated.

Tests

  • compile/checks.test.ts: tests for an unwired body, an unhandled guardrails block and the nested-member hints. All 4 positive cases fail on the pre-fix edges.ts/index.ts and pass after the fix. Quiet cases: a wired start, an arrow-expression body, an empty body, an onError edge, and a stored block with no error edge.
  • workflow-code suite (831), apps/sim lib/workflows/code (including the corpus), executor/orchestrators and executor/dag, and the sim-cli protocol suites all pass.
  • type-check (workflow-code, sim-cli), check:api-validation:strict, check:cli-docs, check:workflow-code-docs, check:workflow-code-golden and check:workflow-sdk-embedded-text all pass.

…ardrails

- W_BODY_UNWIRED: a loop or parallel with blocks inside but no edge from its start; hint p.to(<block>)
- W_GUARDRAILS_UNHANDLED: a guardrails block with no error edge; hint check.onError(<block>)
- a nested member wiring source (known.route.yes.to) hints the branch form instead of the top-level-statement hint
- executor: an unreached loop/parallel body reports no block wired from its start
- child-results reuses the iterative stronglyConnected from compile/edges
@vercel

vercel Bot commented Dec 1, 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 Skipped Skipped Dec 1, 2026 8:18am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Adds warnings for unwired container bodies and guardrails without error handlers.

  • Loops and parallels warn when their body has no start connection.
  • Guardrails checks warn when failed checks have no enabled handler.
  • Nested wiring mistakes now point to the block or branch to wire.
  • Child workflow results use the compiler’s shared workflow-grouping helper.

Both previous, unnumbered findings are addressed by the current code and regression cases. No new actionable issues were found.

Reviews (2) · Last reviewed commit: "fix(workflow-code): count only enabled t..." · 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 12 files

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

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile-apps review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 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 12 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
waleedlatif1 merged commit 5b518c2 into staging Dec 1, 2026
87 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 60b5e2ed Deployed Dec 1, 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