Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
9e6598e
fix(db): declare and restore the workflow_edges block FK indexes
waleedlatif1 Nov 20, 2026
3a63bf0
perf(workflow-persistence): save the normalized graph as a diff
waleedlatif1 Nov 20, 2026
bde2ffb
fix(workflow-code): check the preview flag after authorization, with …
waleedlatif1 Nov 20, 2026
1e2320d
fix(realtime): a subblock flush can no longer be confirmed and then l…
waleedlatif1 Nov 20, 2026
0eb83c0
fix(realtime): a variable flush no longer writes stale variables over…
waleedlatif1 Nov 20, 2026
5e8471e
fix(workspace-code): an MCP credential header accepts the auth scheme…
waleedlatif1 Nov 20, 2026
29782df
fix(workflow-code): an iteration field read outside its container is …
waleedlatif1 Nov 20, 2026
ecdd05e
fix(workflow-code): a reference tag written in a code file is checked
waleedlatif1 Nov 20, 2026
09ba45e
fix(workflow-code): $ref in a Python or shell code file is diagnosed
waleedlatif1 Nov 20, 2026
10a8536
fix(workflow-code): the plan summary pairs swapped names and reports …
waleedlatif1 Nov 20, 2026
0f85398
fix(workflow-code): diagnostics name a missing import and stop flooding
waleedlatif1 Nov 20, 2026
fafc8ef
fix(workflow-code): a do-while count beside a condition is diagnosed
waleedlatif1 Nov 20, 2026
e96007f
fix(workflow-code): a const named like an unused builder namespace ke…
waleedlatif1 Nov 20, 2026
9da28cf
fix(workflow-code): renaming a branch key, input field or variable ke…
waleedlatif1 Nov 20, 2026
d089fc4
fix(workflows): deleting a workflow variable needs allowDelete, as de…
waleedlatif1 Nov 20, 2026
3069f3d
fix(sim-cli): a source get refuses a directory of the other kind
waleedlatif1 Nov 20, 2026
0011191
fix(workflow-code): one code file path rule for the compiler, printer…
waleedlatif1 Nov 20, 2026
9d18581
fix(workflow-code): check refuses an output typo the server refuses, …
waleedlatif1 Nov 20, 2026
050cdc0
fix(sim-cli): apply and create refresh a workflow directory's workspa…
waleedlatif1 Nov 20, 2026
4bed33b
fix(sim-cli): source get prints the server's findings and names unnam…
waleedlatif1 Nov 20, 2026
6e3049e
fix(workflow-code): an unknown resource hint names the command that c…
waleedlatif1 Nov 20, 2026
19498e2
fix(sim-cli): a table never clips the next command a result names
waleedlatif1 Nov 20, 2026
c5332fb
fix(sim-cli): apply defaults --dir to the current directory like the …
waleedlatif1 Nov 20, 2026
c216673
fix(sim-cli): the primer covers run, debug, credentials and promote; …
waleedlatif1 Nov 20, 2026
2b030fd
fix(sim-cli): say on stderr when a request waits out a rate limit
waleedlatif1 Nov 20, 2026
5bc3bba
fix(source): status reads a plan on the read budget instead of an app…
waleedlatif1 Nov 20, 2026
a7cc0ec
docs(cli): regenerate the CLI reference for the source command help c…
waleedlatif1 Nov 20, 2026
5764c4a
fix(workspace-source): an adopt never changes or removes what the dir…
waleedlatif1 Nov 20, 2026
3dc790f
fix(table): insert a large row batch in statements Postgres accepts
waleedlatif1 Nov 20, 2026
8405ff5
fix(workspace-source): a clean dry run no longer stops part-way on an…
waleedlatif1 Nov 20, 2026
5526a91
fix(workspace-source): a promotion reports what the target deleted an…
waleedlatif1 Nov 20, 2026
5502c50
fix(workflows): refuse at apply a table, workflow or knowledge base i…
waleedlatif1 Nov 20, 2026
a889844
fix(workflow-code): a deploy can name the draft it expects, and apply…
waleedlatif1 Nov 20, 2026
7919fd7
fix(workspace-source): live: 'draft' publishes only a draft the direc…
waleedlatif1 Nov 20, 2026
28f206e
fix(workspace-source): server drift is a warning, and the plan never …
waleedlatif1 Nov 20, 2026
867762f
fix(workspace-source): managed rows the server wrote are reported as …
waleedlatif1 Nov 20, 2026
033f50d
fix(sim-cli): keep machine-local blob stats out of the committed .sim…
waleedlatif1 Nov 20, 2026
398c4f3
fix(workflow-code): source applies carry the git commit and repositor…
waleedlatif1 Nov 20, 2026
1d94665
fix(workspace-source): a chat write publishes only the draft the plan…
waleedlatif1 Nov 20, 2026
1bc0a1a
fix(workflow-code): the source plan reads check the preview flag like…
waleedlatif1 Nov 20, 2026
a812a0e
chore(generated): regenerate OpenAPI, CLI API and CLI docs for the wa…
waleedlatif1 Nov 20, 2026
11813e5
style(sim-cli): format the written-record write list
waleedlatif1 Nov 20, 2026
66ccd74
test(workflow-code): code file tests name paths under functions/, the…
waleedlatif1 Nov 20, 2026
b4bb8e8
test(sim-cli): check refuses an out-of-scope iteration reference on a…
waleedlatif1 Nov 20, 2026
ec0638c
test(api): list the workspace source plan route among those Copilot i…
waleedlatif1 Nov 20, 2026
b47114c
style(workflow-code): format the code file path tests
waleedlatif1 Nov 20, 2026
502c049
style(db): format the 0467 migration snapshot and journal as biome does
waleedlatif1 Nov 20, 2026
1bf4d57
fix(workspace-source): judge an MCP header env-only with the shared a…
waleedlatif1 Nov 20, 2026
ebfa029
fix(workspace-source): never compare an MCP header value with one hid…
waleedlatif1 Nov 20, 2026
83a64b5
fix(workspace-source): check an MCP server URL only after the caller …
waleedlatif1 Nov 20, 2026
4e254bd
fix(api): give source plans their own budget and slots, charged per e…
waleedlatif1 Nov 20, 2026
69bbe90
fix(api): judge a provenance repo's credentials by parsing it
waleedlatif1 Nov 20, 2026
05b2fa7
fix(workflow-code): one refusal decision for the apply and the offlin…
waleedlatif1 Nov 20, 2026
75d6c34
fix(workflow-code): infer a variable or input rename only with eviden…
waleedlatif1 Nov 20, 2026
24193a7
fix(workflow-code): report $ref in a Python or shell file only when i…
waleedlatif1 Nov 20, 2026
cba4928
docs(sim-cli): say the primer's run command runs the deployed version…
waleedlatif1 Nov 20, 2026
bb6245c
fix(workspace-source): vouch a deployment's draft by fingerprint alon…
waleedlatif1 Nov 20, 2026
cae3e4d
fix(workflow-persistence): refuse an edge to a block the saved state …
waleedlatif1 Nov 20, 2026
d3dddcc
fix(workflow-code): keep the did-you-mean for a handle typo that name…
waleedlatif1 Nov 20, 2026
f8d024c
fix(sim-cli): never refresh workspace types on a dry run, nor wait on…
waleedlatif1 Nov 20, 2026
8f87795
refactor: settle the wave-1 cleanliness polish items
waleedlatif1 Nov 20, 2026
347aae3
refactor(workspace-source): tell an adopt's additive changes by a lis…
waleedlatif1 Nov 20, 2026
f363244
refactor(sim-cli): report a promotion's target deletes once, and re-h…
waleedlatif1 Nov 20, 2026
2c97f77
refactor: split planDeployment's live-draft branch and the variable d…
waleedlatif1 Nov 20, 2026
2bbf250
test(workflow-code): time hostile scans with the shared scaling helpe…
waleedlatif1 Nov 20, 2026
d2ba434
test(workflows): check the workflow-code gate on every source use case
waleedlatif1 Nov 20, 2026
236674e
test(realtime): assert each keystroke race exactly, against the real …
waleedlatif1 Nov 20, 2026
c231bdc
test(workflows): cover the other-workspace id check for every kind an…
waleedlatif1 Nov 20, 2026
7d5124e
test: keep one owner for each duplicated assertion
waleedlatif1 Nov 20, 2026
71e5baa
test(workflows): compare a fidelity snapshot's edges by id
waleedlatif1 Nov 20, 2026
50c49f7
refactor: drop the exports the refusal and slot moves left unused
waleedlatif1 Nov 20, 2026
55c689b
Merge remote-tracking branch 'origin/staging' into fix/workflow-code-…
waleedlatif1 Nov 20, 2026
52981e4
fix(workflow-code): cap refused withheld findings at the error budget
waleedlatif1 Nov 20, 2026
954a88c
fix(workspace-source): plan workflow folders and delete candidates wi…
waleedlatif1 Nov 20, 2026
0a4f04a
fix(workflow-persistence): load graph rows in creation order
waleedlatif1 Nov 20, 2026
c704e2e
fix(workflows): take rename-settled finding codes whole from the reco…
waleedlatif1 Nov 20, 2026
974bf64
fix(workspace-source): check hidden MCP headers against the server at…
waleedlatif1 Nov 20, 2026
d01b35d
fix(sim-cli): match the server's refusals for a repointed block and a…
waleedlatif1 Nov 20, 2026
452aa4e
fix(workflow-code): tie no rename on 0, false or true, and hint at re…
waleedlatif1 Nov 20, 2026
0c6d3d7
fix(workflows): run the v2 workflow source get and apply in source slots
waleedlatif1 Nov 20, 2026
ad3c83b
fix(workflows): refuse a provenance repo with a fragment or a single-…
waleedlatif1 Nov 20, 2026
19aea4d
docs(cli): regenerate the reference for the source check help
waleedlatif1 Nov 20, 2026
419b73e
fix(workflow-code): hint to inline a value const named like an SDK ex…
waleedlatif1 Nov 20, 2026
c3dfc98
fix(workflow-code): refuse a path no output has in an edited code file
waleedlatif1 Nov 20, 2026
89770d7
fix(sim-cli): send no git remote holding whitespace or a control char…
waleedlatif1 Nov 20, 2026
6b27abb
fix(executor): keep the authorization error as the cause of a child r…
waleedlatif1 Nov 20, 2026
4832ce0
fix(workflows): count renamed variables in the audit, analytics and p…
waleedlatif1 Nov 20, 2026
c0a44fd
fix(workflows): count a pending resource id as held only in a field o…
waleedlatif1 Nov 20, 2026
b0deb75
fix(workflow-code): keep the untyped-JSON warning on an undeclared st…
waleedlatif1 Nov 20, 2026
6b64e6e
fix(workflow-code): check a shared code file's iteration reads for ev…
waleedlatif1 Nov 20, 2026
5a2cb23
fix(workflow-code): check {{NAME}} env tokens in code files
waleedlatif1 Nov 20, 2026
622a930
docs(rules): name the source operations and isWorkflowCodeEnabled in …
waleedlatif1 Nov 20, 2026
784e6b4
fix(workflow-code): give the credential create hint the flags the com…
waleedlatif1 Nov 20, 2026
f11dfd2
fix(workflow-code): compute a withheld warning's hint only when it is…
waleedlatif1 Nov 20, 2026
1fdacb8
fix(sim-cli): clear the paging progress line before a 429 retry notic…
waleedlatif1 Nov 20, 2026
86f32e6
fix(sim-cli): refuse a workspace directory by its kind before an appl…
waleedlatif1 Nov 20, 2026
54fcfc0
fix(workflow-code): write a well-formed placeholder in the renamed-bl…
waleedlatif1 Nov 20, 2026
8113283
fix(sim-cli): name only the deletes a part-way promotion wrote as tar…
waleedlatif1 Nov 20, 2026
3107738
fix(workflows): type the scoped selector table with every field it holds
waleedlatif1 Nov 20, 2026
31a17e7
fix(workflow-code): list a diff's removed blocks by key
waleedlatif1 Nov 20, 2026
fa3269f
test(workflows): expect a delete refusal to name removed blocks by key
waleedlatif1 Nov 20, 2026
0cbcab3
fix(workflow-persistence): keep edges in the order the state lists them
waleedlatif1 Nov 20, 2026
6875c48
fix(sim-cli): exempt no possible-rename reference once a warning cap …
waleedlatif1 Nov 20, 2026
fa7711c
fix(workflow-persistence): build the edge load order lazily
waleedlatif1 Nov 20, 2026
a2b132d
fix(workflow-persistence): insert rewritten edges in bounded batches
waleedlatif1 Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .claude/rules/sim-workflow-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ and "The catalog".

One global flag, `workflow-code` (`lib/core/config/feature-flags.ts`, env fallback
`WORKFLOW_CODE`), gates workflow source, workspace source, the source catalog and resources, and
the Code tab. Every use case calls `requireWorkflowCodeEnabled()`
(`lib/workflows/code/feature-flag.ts`); the UI reads it from the workspace layout's flags. A new
surface gates through the same function, never its own check.
the Code tab. Every source operation (the workflow source ones in
`lib/workflows/application/operations.ts` and the workspace source ones in
`lib/workspace-source/application/operations.ts`) declares `feature: WORKFLOW_CODE_FEATURE`, which
the shared use-case wrapper checks after authorization (`FEATURE_NOT_ENABLED`); a new source
operation declares the same feature, never its own check. A surface outside an operation (the Code
tab, Copilot entitlements) calls `isWorkflowCodeEnabled()` (`lib/workflows/code/feature-flag.ts`);
the UI reads it from the workspace layout's flags.

## Adding things

Expand Down
10 changes: 7 additions & 3 deletions .cursor/rules/sim-workflow-code.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ and "The catalog".

One global flag, `workflow-code` (`lib/core/config/feature-flags.ts`, env fallback
`WORKFLOW_CODE`), gates workflow source, workspace source, the source catalog and resources, and
the Code tab. Every use case calls `requireWorkflowCodeEnabled()`
(`lib/workflows/code/feature-flag.ts`); the UI reads it from the workspace layout's flags. A new
surface gates through the same function, never its own check.
the Code tab. Every source operation (the workflow source ones in
`lib/workflows/application/operations.ts` and the workspace source ones in
`lib/workspace-source/application/operations.ts`) declares `feature: WORKFLOW_CODE_FEATURE`, which
the shared use-case wrapper checks after authorization (`FEATURE_NOT_ENABLED`); a new source
operation declares the same feature, never its own check. A surface outside an operation (the Code
tab, Copilot entitlements) calls `isWorkflowCodeEnabled()` (`lib/workflows/code/feature-flag.ts`);
the UI reads it from the workspace layout's flags.

## Adding things

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"getWorkflowOutline",
"getWorkflowSource",
"applyWorkflowSource",
"planWorkflowSource",
"createWorkflowFromSource",
"getSourceResources",
"getWorkspaceSource",
"applyWorkspaceSource",
"planWorkspaceSource",
"findMissingWorkspaceSourceBlobs",
"stageWorkspaceSourceBlobs",
"replaceWorkflowState",
Expand Down
25 changes: 13 additions & 12 deletions apps/docs/content/docs/cli/reference.mdx

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions apps/docs/content/docs/cli/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ sim workflows deploy <workflowId> [options]
| --- | --- | --- |
| `--name <value>` | No | Optional label for the deployment version. |
| `--description <value>` | No | Optional release note for the deployment version. |
| `--expected-draft-fingerprint <value>` | No | Deploy only this draft: the `sf1:` fingerprint a source apply answered with (`base.fingerprint`). When the draft changed since, the deploy answers `409` and publishes nothing. |
| `-y, --yes` | No | Accepted and ignored: this command needs no confirmation. |

</CommandTable>
Expand Down Expand Up @@ -1316,7 +1317,7 @@ sim workflows source get <workflowId> [options]

</CommandTable>

Exit codes with --dir: 0 written; 1 the command failed, or the directory holds another workflow's source (SOURCE_WORKFLOW_MISMATCH) or edits no apply has saved (SOURCE_LOCAL_EDITS: apply them, get into another directory, or pass --force); 7 the workflow is too large to print as source; 9 rate limited (HTTP 429) after the CLI's retries: wait a minute and run it again. Exit 10 (busy, retry): --dir is a workflow folder of a workspace directory another sim command is using (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.
Exit codes with --dir: 0 written; 1 the command failed, the directory is a workspace source directory (SOURCE_DIR_KIND_MISMATCH, even with --force), or it holds another workflow's source (SOURCE_WORKFLOW_MISMATCH) or edits no apply has saved (SOURCE_LOCAL_EDITS: apply them, get into another directory, or pass --force); 7 the workflow is too large to print as source; 9 rate limited (HTTP 429) after the CLI's retries: wait a minute and run it again. Exit 10 (busy, retry): --dir is a workflow folder of a workspace directory another sim command is using (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.

API request and response schemas: [getWorkflowSource](/api-reference/workflows/getWorkflowSource).

Expand All @@ -1340,7 +1341,7 @@ sim workflows source status [options]

Exit codes: 0 clean (nothing to apply, and the server changed nothing since the directory was read); 11 local changes only (applying writes them); 12 the server changed since the directory was read: drift (a resource edited, added or deleted there that the directory leaves alone) or a conflict (also changed here, so applying it is refused as stale), with or without local changes; 7 the source is too large for the server to read in one dry run; 1 the command failed; 13 not logged in (AUTH_REQUIRED) or the credential was refused: the status shows the local changes only, then run `sim login`. A server that cannot be reached is not a failure: the status shows the local changes only and says so (exit 0 or 11).

API request and response schemas: [applyWorkflowSource](/api-reference/workflows/applyWorkflowSource).
API request and response schemas: [planWorkflowSource](/api-reference/workflows/planWorkflowSource), [applyWorkflowSource](/api-reference/workflows/applyWorkflowSource), [getSourceResources](/api-reference/workflows/getSourceResources).

### Create a workflow from a workflow source directory

Expand Down Expand Up @@ -1391,17 +1392,17 @@ sim workflows source apply [workflowId] [options]
| Option | Required | Description |
| --- | --- | --- |
| `--verbose` | No | With --output json, also list info findings (such as blocks placed by autolayout). |
| `--dir <dir>` | Yes | Source directory: workflow.ts, functions/*, .sim/lock.json and .sim/base.json. |
| `--dir <dir>` | No | Source directory: workflow.ts, functions/*, .sim/lock.json and .sim/base.json. Defaults to `.`. |
| `--dry-run` | No | Check the source and show the outcome without saving or writing files. |
| `-y, --yes` | No | Apply without asking for confirmation. |
| `--deploy` | No | After the write is saved, deploy the workflow (as `sim workflows deploy <workflowId>` does). |
| `--allow-delete` | No | Delete blocks the source no longer declares; without it, an apply that deletes a block is refused. |
| `--allow-delete` | No | Delete blocks and variables the source no longer declares; without it, an apply that deletes one is refused. |

</CommandTable>

Exit codes: 0 applied (or a clean dry run); 1 the source has errors (each printed as file:line:column with its frame and hint) or the command failed; 5 the workflow changed since the directory was read (SOURCE_STALE, on a dry run too: get it again, reapply the edit, retry); 6 the workflow or its folder is locked (E_APPLY_LOCKED; a locked block exits 1, E_APPLY_LOCKED_BLOCK); 7 the source is too large; 9 rate limited (HTTP 429) after the CLI's retries, so nothing was written: wait a minute and run it again; 14 without --yes and with no terminal to ask: the plan was printed with no errors and nothing was written (run the same command with --yes to apply it). Exit 10 (busy, retry): --dir is a workflow folder of a workspace directory another sim command is using (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished. Exit 13: not logged in, or the server refused the credential (AUTH_REQUIRED); nothing was sent. Run `sim login`, or fix or unset SIM_API_KEY when the key comes from it. Exit 130: interrupted (Ctrl-C). A write already sent is finished and saved into the directory first, waiting up to 60s for its answer; a second Ctrl-C, or no answer by then, stops at once and prints that it may have been written and how to check.

API request and response schemas: [applyWorkflowSource](/api-reference/workflows/applyWorkflowSource), [deployWorkflow](/api-reference/workflows/deployWorkflow).
API request and response schemas: [applyWorkflowSource](/api-reference/workflows/applyWorkflowSource), [deployWorkflow](/api-reference/workflows/deployWorkflow), [getSourceResources](/api-reference/workflows/getSourceResources).

### Show the block catalog workflow source is checked against

Expand Down Expand Up @@ -1435,7 +1436,7 @@ sim workflows source check [options]
| --- | --- | --- |
| `--dir <dir>` | No | Source directory: workflow.ts, functions/* and .sim/. Defaults to `.`. |
| `--strict` | No | Fail on the warnings listed below in every block, not only new ones. |
| `--no-strict` | No | Never fail on a warning. |
| `--no-strict` | No | Never fail on a warning an apply saves. |
| `--verbose` | No | With --output json, also list info findings (such as blocks placed by autolayout). |

</CommandTable>
Expand All @@ -1444,7 +1445,7 @@ Compiles workflow.ts (and the function files it names) with the compiler the ser

Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics.

These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF, W_REF_OUT_OF_SCOPE. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In every mode, as the server refuses them: W_REF_OUT_OF_SCOPE is the error E_APPLY_REF_OUT_OF_SCOPE in any file of a block the edit added or changed; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in workflow.ts on a block the edit added or changed; W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_CODE_FILE_REF_SYNTAX is the error E_APPLY_CODE_FILE_REF_SYNTAX in a function file changed since the get. A block counts as changed when the lock does not bind it, when the source moved it into another container, or when it compiles differently than in the source the last get or apply printed (.sim/stored-edges.json records a digest of each block). That last comparison needs the catalog the source was printed with in the cache: without it, a bound block that did not move counts as unchanged, so the server may refuse what the check passes. A $ref in a function file to a block the lock binds that the source no longer declares stays a warning, unless a warning cap left findings out: the server may infer that block was renamed and rewrite the reference, and refuses it otherwise. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.

### Show the content of the changes in a workflow source directory

Expand Down
10 changes: 5 additions & 5 deletions apps/docs/content/docs/cli/workspaces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ sim workspaces source get [options]

A directory that already holds a .sim/base.json is refreshed from the workspace it was read from, whatever the profile's default workspace.

Exit codes: 0 written; 1 the command failed, the directory holds edits no apply has saved (SOURCE_LOCAL_EDITS: apply them, get into another directory, or pass --force), --workspace names another workspace than the one the directory was read from (SOURCE_OTHER_WORKSPACE), or a downloaded binary file does not match its listing (SOURCE_BLOB_MISMATCH: nothing was written); 7 the workspace has more resources of a kind than one directory holds; 9 rate limited (HTTP 429) after the CLI's retries: nothing was written, the binary files already downloaded are kept in .sim/downloads, and running the get again downloads only the rest.
Exit codes: 0 written; 1 the command failed, the directory holds edits no apply has saved (SOURCE_LOCAL_EDITS: apply them, get into another directory, or pass --force), --workspace names another workspace than the one the directory was read from (SOURCE_OTHER_WORKSPACE), the directory is a workflow source directory (SOURCE_DIR_KIND_MISMATCH, even with --force), or a downloaded binary file does not match its listing (SOURCE_BLOB_MISMATCH: nothing was written); 7 the workspace has more resources of a kind than one directory holds; 9 rate limited (HTTP 429) after the CLI's retries: nothing was written, the binary files already downloaded are kept in .sim/downloads, and running the get again downloads only the rest.

Exit 10 (busy, retry): another sim workspaces source command is using this directory (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.

Expand Down Expand Up @@ -737,7 +737,7 @@ Exit codes: 0 clean (nothing to apply, and the server changed nothing since the

Exit 10 (busy, retry): another sim workspaces source command is using this directory (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.

API request and response schemas: [applyWorkspaceSource](/api-reference/workflows/applyWorkspaceSource).
API request and response schemas: [planWorkspaceSource](/api-reference/workflows/planWorkspaceSource), [applyWorkspaceSource](/api-reference/workflows/applyWorkspaceSource).

### Apply a workspace source directory

Expand All @@ -752,7 +752,7 @@ sim workspaces source apply [options]
| Option | Required | Description |
| --- | --- | --- |
| `--verbose` | No | With --output json, also list info findings (such as blocks placed by autolayout). |
| `--dir <dir>` | Yes | Workspace source directory written by `workspaces source get`. |
| `--dir <dir>` | No | Workspace source directory written by `workspaces source get`. Defaults to `.`. |
| `--dry-run` | No | Plan and check without writing anything. |
| `-y, --yes` | No | Apply without asking for confirmation. |
| `--allow-delete` | No | Delete resources, columns and data the directory no longer declares. |
Expand All @@ -779,7 +779,7 @@ sim workspaces source check [options]
| --- | --- | --- |
| `--dir <dir>` | No | Workspace source directory: the kind folders and .sim/base.json. Defaults to `.`. |
| `--strict` | No | Fail on the warnings listed below in every block, not only new ones. |
| `--no-strict` | No | Never fail on a warning. |
| `--no-strict` | No | Never fail on a warning an apply saves. |
| `--verbose` | No | With --output json, also list info findings (such as blocks placed by autolayout). |

</CommandTable>
Expand All @@ -788,7 +788,7 @@ Compiles every workflows/&lt;key&gt;/workflow.ts (and the function files each na

Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics.

These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF, W_REF_OUT_OF_SCOPE. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In every mode, as the server refuses them: W_REF_OUT_OF_SCOPE is the error E_APPLY_REF_OUT_OF_SCOPE in any file of a block the edit added or changed; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in workflow.ts on a block the edit added or changed; W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_CODE_FILE_REF_SYNTAX is the error E_APPLY_CODE_FILE_REF_SYNTAX in a function file changed since the get. A block counts as changed when the lock does not bind it, when the source moved it into another container, or when it compiles differently than in the source the last get or apply printed (.sim/stored-edges.json records a digest of each block). That last comparison needs the catalog the source was printed with in the cache: without it, a bound block that did not move counts as unchanged, so the server may refuse what the check passes. A $ref in a function file to a block the lock binds that the source no longer declares stays a warning, unless a warning cap left findings out: the server may infer that block was renamed and rewrite the reference, and refuses it otherwise. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.

Exit 10 (busy, retry): another sim workspaces source command is using this directory (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.

Expand Down
Loading
Loading