Repository navigation
fix(workflow-code): staging QA fixes for runtime, promote, workspace and CLI source - #10262
waleedlatif1 wants to merge 52 commits into
Conversation
… in sync runs findChildSpanOutput compared the normalized span name with the caller's raw block ref, so a capitalised or spaced child block name was silently omitted while the parent and streaming paths matched it.
…an this iteration resolveSourceBlockId took the first incoming block whose state said executed, and a block state keeps that flag across loop iterations, so the edge drawn first won. It now reads executedBlocks, which the loop clears between iterations.
…to the block The ops path (Copilot, API, sim workflows operations apply) only set block.name, leaving <oldname.field> references dangling, so runs emitted the raw template. The reference rewrite moves to lib/workflows/references/block-rename.ts and the editor rename, workflow import, and ops rename all use it; the editor store's inline copy (unescaped regex, stateful global test) is gone.
…ount on the ops path An operations batch stored iterations: "3" or count: "2" as a string, which the loader then reset to its default (1 iterations, 5 branches) with no error. A numeric string is now stored as its number, as slider inputs coerce; any other value is an input validation error that keeps the current count, so --atomic refuses it.
…ink the explicit-any baseline
… since the last one A resource the promotion record holds that the directory no longer declares stays in the base, so the apply plans its delete and refuses it without --allow-delete, as an apply to the directory's own workspace does. Only resources no promotion left in the target are named W_PROMOTE_DELETES_TARGET_ONLY.
…e record Deleting .sim/targets/<id>.json made the next promotion overwrite every change made in the target since, rows its workflows wrote included, while the hint read as keeping the target's version. The hint now offers only the flows that keep the target's data and says what deleting the record does.
…wn transaction The strip ran after commit in the background and moved the managed rows' version after the apply recorded it, so the next status reported server row drift and a delete of the table was refused as stale. For a managed table the strip now commits with the reshape, so the recorded version holds it.
…gs say what to do A workflow create refused for a taken name gets its file and a hint, without the use case's 'or in another folder', which a directory cannot express; the workspace guide's exit table names E_NAME_TAKEN. E_TABLE_FOLDER and E_KB_FOLDER name the folders create command, and the credential finding no longer reads 'has no a slack credential'.
…drift hints the target The plan line of a resource refused as stale said 'kept as the server has it'; it now says the edit is refused as stale. A promotion's W_SERVER_CHANGED pointed at a get of the directory's own workspace; it now names a get of the target.
…orkflow once A workflow's commit runs its pipeline again and re-reported every finding its plan had found, so a real apply listed each warning twice. A write's finding now replaces the plan's (matched without the block id the commit gave it).
A table over 10,000 rows (or any resource the get cannot read as source) was only counted in the result, with the reason in .sim/skipped.json. The get now prints each skipped resource with its reason.
…her kind's stale finding has The workflow pipeline's E_APPLY_STALE carried its single-directory advice in the message and no hint; a workspace plan now reports it as staleFinding does for every other kind, naming the folder and the get to run.
…d drops the stale plan line
…ock in check and apply alike
…s E_CODE_FILE_PATH
…t keeps the id already follows
… version already matches
…file that crosses it
…lete; delete them only with --delete-target-only Plain --allow-delete on a promotion now deletes only what the promotion record proves the directory deleted. Resources only the target holds stay out of the base, so the server keeps them and names each (W_UNDECLARED, with a promotion hint). --delete-target-only, which needs --to and --allow-delete, opts into deleting them. A target-only delete the apply held back is no longer written into the promotion record, where it read as a directory delete on the next promotion.
…r a row-scaled timeout The in-transaction strip ran once per dropped column under withLockedTable's 10 s default statement timeout. reshape now collects the dropped column ids and strips them in one pass with stripDroppedColumnData, which scales the statement and idle timeouts per row as the sibling column rewrites do. The carried-over non-null assertion on the row filter is gone.
…codeFile() names readWorkspaceDir drops each file under a workflow folder's functions/ that neither its workflow.ts nor its lock names, through the same codeFilePaths rule the workflow directory status uses. A workspace status no longer reports such a file as a local change (exit 11 forever), names it on the 'Not named by any codeFile()' line, and an apply no longer sends that folder whole for it.
… the edit sets, and not on deployment-shaped options offline The server now passes the fields its value gate judges (changedSubBlockFields) into the shared refusal rule, so a stored out-of-options value written bare again on an edited block is no longer refused. The catalog marks options a registry function derives from deployment settings (optionsVary); the CLI's offline check keeps a value outside them a warning, since its cached catalog may have been built under other settings, and leaves the verdict to the server.
…ing the block id when it names no key The write-time finding dedup dropped blockId from the key outright, so two findings that differed only in the block they named by id merged into one.
… of at least 1 on the ops path containerCount took whatever Number() accepted, so "1e3", "0x10", "2.5", "-1" and "0" (and the numbers -1 and 2.5) were stored silently. They are now refused as input validation errors, the bound source compile holds a count to.
…y per code and block Reporter.omitted kept one object per warning past the caps. It now counts them per code and block, so what a compile keeps stays bounded by the blocks it reads; the CLI check sums the counts.
…kspace and tool The spy edited its tool on any delete authorize call, so a test that timed out with the spy still installed could edit the tool of whichever test ran next.
… not the write budget A workspace apply with ?dryRun=true writes nothing and runs what a plan runs, yet drew one write unit per workflow folder from the 40-token bucket real applies share, so the preview of a 61-workflow apply left the apply waiting about two minutes. The route's new sourceApply policy charges a dry run to the source-plan bucket the status plan route uses and a real apply to the write bucket, each still per folder sent with its files and capped at the smaller bucket.
…f a workflow finding
…n strip lost its `!`
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[High impact] The changes reach workflow runs and source applies across workflow and workspace workflows. Fix the offline option check, falsy count refusals, and combined variable renames before merging. Findings
SummaryThis PR fixes workflow execution and editing, makes workspace promotions safer, and improves CLI checks and source-directory handling.
|
There was a problem hiding this comment.
All reported issues were addressed across 86 files
This PR changes a public API contract. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
…the default strict mode The optionsVary exemption skipped the edit refusal but the strict raise still turned W_UNKNOWN_OPTION into an error on a new block. Listed, withheld and omitted findings now all skip the strict raise when the option varies by deployment.
…dd and nested edit The add and nested-edit paths guarded on a truthy value, so 0, false, null and '' skipped containerCount and saved the default. They now check presence, as the top-level edit does.
…d block, so a reader renamed in the same edit still ties the rename
…mes out of deletions while it is on disk
…rally, not as a replace pattern
… hint a taken file name be renamed locally
…lue after apply, and the strip without polling
Summary
Fixes from end-to-end QA of workflows and workspace as code on staging, after #10237 and #10238. Five QA lanes ran (CLI workflow, workspace, editor and non-code, stress and safety, maintainability), plus an independent review of the fixes. No P0s were found. Every behaviour fix has a test that was seen to fail with the fix reverted.
Runtime and editing
rewriteBlockNameReferences. This also removes the editor store's copy, which had an unescaped regex and a stateful global regex.iterationsor parallelcountto a number. Any other value is refused; before, it was silently reset.Workspace source and promote
--allow-delete. Resources that exist only in the target are kept and listed. Deleting them needs the new--delete-target-onlyflag, which is accepted only together with--toand--allow-delete. The promotion record no longer records target-only entries.Compiler and CLI
statusand apply ignore function files that nocodeFile()names, in both workflow and workspace directories.checkand the server agree on an unknown dropdown option on a changed field. Option lists that depend on the deployment stay a warning in the offline check.E_CODE_FILE_PATH.apply --deploydoes not redeploy.paths:patterns now cover the folders from wave 2.Contract changes
--delete-target-onlyflag for promotions.optionsVarymarker. The OpenAPI spec and the CLI types are regenerated.apply --deployskips the deploy when the live version already matches. To re-register webhooks or schedules, usesim workflows deploy.Testing
check:audits,check:test-types, migrations, docs compatibility, lint and the root type-check.