Repository navigation
fix(workflow-code): warn on unwired container bodies and unhandled guardrails - #10554
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge. SummaryAdds warnings for unwired container bodies and guardrails without error handlers.
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 |
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…lock in wiring warnings
|
@greptile-apps review |
|
@cubic-dev-ai review |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
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 passedcheck, and the run then failed with "has no executable blocks inside". Compile now warns on the container, with the hintp.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.passednever runs. The hint ischeck.onError(<block>). LikeW_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.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(...)."child-results.tsdrops its private recursive Tarjan and uses the iterativestronglyConnectedexported fromcompile/edges.ts.branchKeysis extracted sobranchPortand 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-fixedges.ts/index.tsand pass after the fix. Quiet cases: a wired start, an arrow-expression body, an empty body, anonErroredge, and a stored block with no error edge.apps/simlib/workflows/code(including the corpus),executor/orchestratorsandexecutor/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-goldenandcheck:workflow-sdk-embedded-textall pass.