Skip to content

feat(cli): webhook trigger selection, repeatable --run, and multi-block source find - #10524

Merged
waleedlatif1 merged 5 commits into
stagingfrom
feat/wac-cli-webhook-friction
Dec 1, 2026
Merged

waleedlatif1 merged 5 commits into
stagingfrom
feat/wac-cli-webhook-friction

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Two workflows-as-code CLI changes, both benchmarked against agents doing real edit tasks.

Webhook-trigger friction (apply and check)

  • --run '<trigger>=<input>' enters a test run through the trigger it names (its const, key or id, resolved from the saved lock). A run that names no trigger on a workflow with several is refused with the corrected command (--run 'api={…}' (or hook=<its input>)).
  • --run is repeatable: every run is made and reported (runs[]), and --deploy deploys only if every run completed.
  • A check no longer fails with E_TYPE on an env.NAME the types the last get wrote lack (a secret set since): it reports W_ENV_UNKNOWN naming sim workflows source status to refresh them. A near miss (TS2551, "Did you mean") stays an error.
  • An unwired condition/router branch (W_BRANCH_UNWIRED) stays a warning on new blocks too: the executor ends that path cleanly, so an else that should do nothing may stay unwired.
  • W_LITERAL_SECRET on a password field carries the CLI's secrets flow in its hint (sim secrets set NAME --scope workspace --value @-, then env.NAME).

Large workflows

  • sim workflows source find takes several block names (at most 20 blocks printed), adds each block's declaration and a short function file's codeText (≤30 lines) to the JSON, and prints the blocks it found before refusing an unknown name with a did-you-mean.
  • .sim/AGENTS.md gains a "A long source" section only when workflow.ts has 300+ lines, pointing at one find naming every block a change touches.
  • workflows source --help gains the large-workflow find chain hint; CLI docs regenerated.
  • The primer's Failure pattern now says .error works on any block, and a Function's adds the line (.errorMessage doesn't).

Why

Agents editing webhook-triggered workflows burned rounds on trigger selection, stale env types, unwired else branches and literal-secret fixes; on long workflows they spent turns grepping workflow.ts for the blocks a change names.

Benchmarks (aggregated)

  • Webhook task, code path vs regular path on Opus: +21% → −19% tokens (p=0.03).
  • Fixed vs old CLI on the webhook task: −39% tokens (Opus), −29% (Sonnet).
  • Large-workflow task: −4% vs old CLI (not significant); small tasks flat (±6%).
  • Every graded run passed (100%).

Primer bytes (budget 4096)

Variant Bytes
workflow / cli 4068
workflow / chat 4094
workspace / cli, chat 3983

The workflow/chat primer text changes (the Failure line). Mothership preloads the chat primer verbatim, so its copy needs a grammar re-sync after this merges.

Type of Change

  • New feature

Testing

Each new test fails on the pre-change code and passes now (verified by restoring the staging sources):

  • apply: trigger refusal with the corrected command; each --run enters its named trigger then deploys; every run is made and nothing deploys when one fails.
  • check: new unwired else branch passes with the hint; literal webhook token gets the secrets-flow hint and still fails.
  • get (real tsc): an env name set since the get passes with W_ENV_UNKNOWN; a near miss stays E_TYPE. A long source's AGENTS.md names find, a short one doesn't.
  • find: several names in one call (deduped), declaration/codeText, found blocks printed before an unknown name is refused.

Local gate: bun run generate, bun run lint, bun run type-check, bun run check:audits (73 audits), bun run test, block-registry check against origin/staging — all green.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…d check

- apply --run takes <trigger>=<input> and repeats: each run enters through the
  trigger it names (resolved through the saved lock), every run is made and
  reported (runs[]), and --deploy needs all to complete. A run refused for
  several triggers names them and the corrected --run command.
- check downgrades a type error on an env name the written types lack (set
  since, e.g. sim secrets set) to W_ENV_UNKNOWN with the refresh command; a
  near-miss typo (TS2551) stays an error.
- W_BRANCH_UNWIRED is no longer a strict finding: the executor ends a routed
  dead-end branch cleanly, so an unwired else needs no no-op block.
- W_LITERAL_SECRET on a password field names the secrets set flow and env.NAME.
- primer (cli workflow variant) names multi-trigger --run and the secret flow.
… at it

source find takes several block names, prints each block's declaration and a short function
file's text, and refuses an unknown name after printing the blocks it found. The guide of a
workflow.ts of 300+ lines gains a note to read it by block, the primer's Failure pattern names
.error on any block, and --run parses the saved lock once.
@vercel

vercel Bot commented Nov 30, 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 1:09am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds trigger selection and repeatable --run tests to workflow source writes, plus multi-block find output.

  • Source writes can test named trigger paths and repeat runs before deployment.
  • One source find call can gather several workflow blocks and their short function files.
  • Workflow checks explain stale environment names, unwired branches, and literal secrets more clearly.

Reviews (3) · Last reviewed commit: "fix(sim-cli): name a --run trigger by an..." · 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 24 files

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

Turn on auto-fix | Re-trigger cubic

A --run may name its trigger by block id (a UUID); a refused non-trigger points the next command
at a runnable one with the same input; runs that finished stay reported when a later one cannot
be sent; a 30-line function file with a trailing newline prints with its block; the literal
secret hint keeps the value out of the command line; and the docs baseline records the changed
source find usage fence.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@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 25 files

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

Turn on auto-fix | Re-trigger cubic

…tifier

JSON or @file is a --run's input; anything else names its trigger before the first =, so a block
key of any characters (a collision suffix such as shopwebhook~2) or a UUID id is named as written.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@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 25 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 4059854 into staging Dec 1, 2026
87 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/wac-cli-webhook-friction branch December 1, 2026 04:30

This branch was previously deployed

1 inactive deployment
Preview — 04163607 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