Repository navigation
feat(workflow-code): workflows and workspace as code - #10129
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@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 152 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
[High impact] The PR appears safe to merge, with two non-blocking CLI fixes recommended. FindingsSummaryAdds typed workflow and workspace source files, CLI editing commands, guarded API writes, and a read-only Code tab.
Earlier declaration-test feedback was withdrawn after waleedlatif1 explained that these tests cover generated SDK files outside the normal repository type-check. Reviews (23) · Last reviewed commit: "Merge branch 'fix/wc-thr7' into feat/wor..." · Reviewed by Greptile |
|
@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.
1 issue found and verified against the latest diff
Confidence score: 3/5
table.tsaccepts declarations with more than 100 options, so they parse successfully but fail when applied. EnforceMAX_SELECT_OPTIONSduring parsing.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/workspace-code/src/kinds/table.ts">
<violation number="1" location="packages/workspace-code/src/kinds/table.ts:168">
P2: The codec accepts more than the server's 100-option limit, so declarations with 101+ options parse successfully and only fail during apply. Enforce `MAX_SELECT_OPTIONS` while parsing the declaration.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@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 171 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@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 173 files
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
|
@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.
No issues found across 173 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
…eal shape in the API-built round trip
…names compileSource now returns the stored model it compiled against, re-keyed by the source's renames, and keptCredentials pairs compiled blocks with it, so a member who cannot see a credential can rename the block holding it.
…es and branches on bound blocks The offline check compiles without the stored workflow, so it refused an onError on a loop or parallel and a cycle that a get printed and the server keeps, and told the agent to delete them. compileWorkflow takes storedUnread: an edge between two lock-bound blocks may be stored, so it reports W_ERROR_PORT_STORED / W_EDGE_CYCLE saying an apply keeps it only if the stored workflow holds it, and the error stays for a new block. E_ERROR_PORT_UNSUPPORTED hints no longer say to remove the edge. W_BRANCH_UNWIRED never fails the check on a bound block, --strict included, matching its stored exemption.
# Conflicts: # packages/db/migrations/meta/0465_snapshot.json # packages/db/migrations/meta/_journal.json
…ough its lock ident storedUnread now takes the lock, and compile counts a source block whose ident is one vacated lock entry's as bound (lockIdentRenames, materialize's lock-ident rule, shared with compileSource), so a renamed block's stored container error edge or stored cycle warns offline as the server accepts it.
… a workflows check A per-folder `sim workflows source check` in a workspace directory already compiled every workflow's Start inputs for its child-call findings but left workspace.d.ts on the stored inputs, so a parent mapping an input added to the child since the get failed tsc with an excess-property error. It now refreshes workspace.d.ts the way `sim workspaces source check` does.
…cycle skips The edit engine (Copilot edits, v2 operations) could create an edge that closes a cycle, which the canvas and realtime refuse and the executor cannot run. createValidatedEdge now runs the shared wouldCreateCycle check and reports a refused edge as an edge_cycle skipped item. Edges the workflow already stored are exempt, so a stored cycle survives unrelated edits and restated connections. Publishes edge_cycle in the v2 skipped-item enum and regenerates the OpenAPI document and CLI types.
# Conflicts: # apps/docs/content/docs/mcp/tools.mdx
… the open generated API types
|
…grate-on-read save cannot undo them
Supersedes #10128: this PR now carries workflows as code and workspace as code together, both already reviewed.
Summary
Workflows as code
sim workflows source get | create | applywith--dry-run, a generated.sim/AGENTS.mdand cookbook, and stable exit codes.@sim/workflow-code: compiler (TypeScript → canonical model), printer, materializer (canonical model → stored graph, keeping block ids through a lock file), diagnostics withfile:lineframes and hints, size and depth limits.@sim/workflow-sdk: the typed SDK generated from the block catalog (agent,condition,table.queryRows,trigger.schedule, …) with workspace resources by stable key (table('tickets'),credential('slack'),skill('tone'),customTool('lookup')).GET/POST /api/v2/workflows/{id}/source, create, the source catalog and resources manifest. Every route goes through an authorized application use case; writes are rate limited, refuse workspace API keys, and answer 409 when the draft changed since the read.Workspace as code
tables/,knowledge/<key>/(settings +docs/),files/,tools/,skills/,workflows/<key>/— andsim workspaces source get | apply --dirreads it back or applies it in one run, including a workflow and the table, knowledge base, tool or skill it uses.@sim/workspace-code: one codec per kind, a statically parsed declaration reader (never executed), the base file, limits and diagnostics in the same shape. SDK subpath@sim/workflow-sdk/workspace(defineTable,column.*,defineKnowledgeBase,defineTool).GET/POST /api/v2/workspaces/{id}/sourceand a knowledge document download route; every write goes through the existing domain use case and its authorization.--allow-delete, show what they lose, re-check the resource right before writing, and are refused while a stored workflow still uses it; binary files and documents travel in bounded, resumable rounds with hashes checked before anything is written; a partial apply converges on re-run.Changes outside the feature flag
{"summary": "<agent.content>"}in a Response block or table row data) are now JSON-escaped when the value would break the literal (a raw quote, newline or control character). A value that is already valid JSON string content, such as a PEM key with\nescapes, is spliced unchanged, as before.edit_workflowandPOST /api/v2/workflows/{id}/operations):edge_cycle, matching the canvas. Cycles already stored are kept.erroredge from a trigger or a loop/parallel container is skipped (invalid_source_handle). Stored ones are kept.params) with[].BLOCK_GATES, so nested children get the same placement checks as top-level blocks.simCLI: auth failures exit 13 and rate limits exit 9 (both were 1); GETs retry a 429 up to 6 times, waiting at most 60s each.Everything else is behind the global
workflow-codeflag (off by default). Migration 0466 adds the new tables and a nullabledocument.file_sha256; additive only.Companion: simstudioai/mothership#986 gates the
workflows source/workspaces sourcecommands on theworkflow-codeentitlement. This PR merges first.Type of Change
Testing
Checklist
test-auditauthoring gate)