Repository navigation
feat(cli): webhook trigger selection, repeatable --run, and multi-block source find - #10524
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryAdds trigger selection and repeatable
Reviews (3) · Last reviewed commit: "fix(sim-cli): name a --run trigger by an..." · Reviewed by Greptile |
There was a problem hiding this comment.
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.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
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.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
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>)).--runis repeatable: every run is made and reported (runs[]), and--deploydeploys only if every run completed.E_TYPEon anenv.NAMEthe types the last get wrote lack (a secret set since): it reportsW_ENV_UNKNOWNnamingsim workflows source statusto refresh them. A near miss (TS2551, "Did you mean") stays an error.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_SECRETon a password field carries the CLI's secrets flow in its hint (sim secrets set NAME --scope workspace --value @-, thenenv.NAME).Large workflows
sim workflows source findtakes several block names (at most 20 blocks printed), adds each block'sdeclarationand a short function file'scodeText(≤30 lines) to the JSON, and prints the blocks it found before refusing an unknown name with a did-you-mean..sim/AGENTS.mdgains a "A long source" section only whenworkflow.tshas 300+ lines, pointing at onefindnaming every block a change touches.workflows source --helpgains the large-workflowfindchain hint; CLI docs regenerated..errorworks on any block, and a Function's adds the line (.errorMessagedoesn'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.tsfor the blocks a change names.Benchmarks (aggregated)
Primer bytes (budget 4096)
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
Testing
Each new test fails on the pre-change code and passes now (verified by restoring the staging sources):
--runenters its named trigger then deploys; every run is made and nothing deploys when one fails.W_ENV_UNKNOWN; a near miss staysE_TYPE. A long source's AGENTS.md namesfind, a short one doesn't.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
test-auditauthoring gate)