100 Commits
Author SHA1 Message Date
Waleed 689f8a8fd8 fix(api): accept the pre-v0.9.66 v2 names as deprecated aliases (#10472)
#10418 renamed public v2 names with no alias, and the v2 schemas reject
unknown keys and values, so clients written against the earlier names now
get 400s. Restore them as deprecated aliases at the contract layer:

- execute: run.source "manual" (now "draft") and run.entry.useMockPayload
  (now sample) are accepted and folded into the current names
- PUT state, POST operations, and the workflow/workspace source applies:
  ?dryRun (now ?dry) is accepted, and dryRun is sent beside dry in the
  response; the source-apply rate bucket honours it too, so a ?dryRun
  request is charged as a dry run

A request that sends both names with different values is refused. The
OpenAPI spec marks the old names deprecated, and the CLI generates no flag
for them.
2026-11-28 03:24:15 -08:00
Waleed 75dc6c3f46 fix(workflow-code): final pre-release audit of workflows as code (#10461)
* fix(workflow-code): final pre-release audit of workflows as code

- runnable next for an untested publish; no {…} in any next.command
- check --output json stays one document outside Mothership
- side effects before the result; no repeated deployments-write findings
- workspace apply prints no human plan in machine output
- editLoop follows the surface's primer; quoted --dir and root
  --profile/--endpoint in suggestions
- a refused --run input maps like a failed run; noop and period wording
- key-less --run, missing --folder, swallowed --allow/--mock, batch-delete
  ids and operation_type refusals say what to type
- source find names the reading line
- W_CODE_FILE_REF_QUOTED for a quoted tag in a Python function file
- primer, help and docs: --allow/--draft, columns update, sandboxed code
  runs for real in a dry run, GUIDE-advanced in workflow directories
- one isMachineFormat, readRunInput/testRunDraft, renameWarningOptions,
  heldAction; drop assertNoReservedFlags and the never-shipped stubbed-call compat

* fix(workflow-code): review round 1 — plan in machine results, one error document, file-path refs, find matcher

- workspace apply: a machine result carries the planned changes it no longer prints
- a bulk total miss carries owed rename warnings as the refusal's note; an all-failed
  invitation batch is one document too
- W_CODE_FILE_REF_QUOTED skips a file's .path, which the run splices raw; the predicate is
  shared with the resolver (isFilePathReference)
- createCommand quotes its directory
- find: a property access is no reader; <key[0]> reads its line
- batch-delete counts the parsed --row list

* fix(workflow-code): review round 2 — invocation in reader hints, full create line, @@ literal ids

- every action runs as its command (runInvoked), so a starter's create hint from the
  directory readers keeps the root --profile/--endpoint the caller typed
- a starter's create next keeps --name and --folder
- the batch-delete count reads @@id as a literal, by the rule readArgumentSource uses
2026-11-27 03:10:15 -08:00
Waleed a49b69b656 improvement(workflows): one short name per run concept, and a deploy that never suggests a live run (#10418) 2026-11-26 01:45:12 -08:00
Waleed c10cdb216b feat(workflows): allow and mock child-workflow blocks, and mock from a recorded run (#10413) 2026-11-26 01:00:23 -08:00
Waleed fd27857c44 feat(workflows): dry runs stub reads that depend on a stubbed write, and flag MCP tools servers call read-only (#10416) 2026-11-25 13:46:50 -08:00
Waleed db3bced54c feat(workflows): dry runs stub code's network writes instead of listing code unchecked (#10412) 2026-11-25 12:53:17 -08:00
Waleed 0a0febbf02 improvement(cli): say what is live after a deploy, and run a pinned deployment version (#10411) 2026-11-25 12:19:36 -08:00
Waleed 579c7cca3f improvement(workflows): dry-run placeholders echo the writes they stand in for (#10404)
* improvement(workflows): dry-run placeholders echo the writes they stand in for

A stubbed write was answered with a generic sample of the tool's outputs, so a
Function reading a dry-run table upsert's row.data.<field> got null and an
agent testing its workflow concluded its logic was wrong.

A tool may now declare a pure dryRunOutput(params) on its config: the outputs
the request alone determines. It receives the params with every secret masked
(as sideEffects.stubbed[].request is built), its result is redacted like that
request, and the sample of the declared outputs fills whatever it leaves out
(ids, nested fields, each array item from the sample's first). Tools without
it keep the sample.

Declared for table insert/upsert/update row (row.data echoes the written data;
update keeps the named row id) and batch insert (rows and insertedCount), file
write (requested name, text byte size), and knowledge create document (the
document name as stored). Filter updates and deletes are left out: their
outputs depend on stored state.

* improvement(workflows): placeholders follow the declared output schema and redact once

A dry-run echo was merged into the sample by the sample's value shape, so a
table row declared as bare json came back with the generic sample keys
(name: 'Sample Object', status: 'active') beside its data, and every batch row
shared the id 'item_1'. The echo is now laid over the sample by the declared
schema: field by field where an output declares properties, item by item where
it declares array items, and whole anywhere else (an undeclared field is
dropped). The table hooks return the row as the routes emit it (data, and
placeholder id, position and timestamps, distinct per batch row) with no
ignored columns; update's row holds only the fields it patches. Knowledge
create echoes only the document name, and file write sizes its text with
utf8ByteLength.

Value-based masking replaced every occurrence of any string under a
secret-named field, however short, so a one-letter reset_token column turned
'a@b.co' into '[REDACTED]@b.co' in the request and in what downstream blocks
read; worse, a value masked inside a run secret left the rest of that secret
unmatched by the registry. Values shorter than the repo's identifying-literal
floor (isNonIdentifyingSecretLiteral) are now masked only by their field,
password fields are masked by name like credential-named ones, and the
registry projection runs before key and value masking.

A stubbed write's request and echo are redacted in one pass, one PII call per
write; when that pass cannot vouch for the pair, both are null.

* docs(skills): describe the placeholder overlay for arrays and requested file names
2026-11-25 06:24:06 -08:00
Waleed 16add2e814 feat(workflows): side-effect-free dry runs (#10402)
* feat(workflows): side-effect-free dry runs

`sim workflows run --dry` (v2 execute `run.dry`, manual runs only) runs the
saved draft without sending its writes. Every tool call not declared `read`
(table writes, sends, HTTP calls, custom tools, and every MCP tool, which
declares no effect) is answered with a placeholder shaped like the tool's
outputs and listed in the run result's `sideEffects.stubbed` with the request
it would have sent: an in-process operation's input or an HTTP call's method,
URL and body, with the credentials the call resolved and the run's resolved
secrets redacted. Reads, model calls, conditions and credential resolution run
for real. Function blocks run their code and are listed in
`sideEffects.unchecked`. Mothership and Pi blocks, which act outside the tool
seam, and Human in the loop and Wait blocks, whose paused run would resume
without the dry run, are answered whole. Dry runs are logged under the `test`
trigger and are synchronous only (no stream, async or waitTimeoutSeconds).

The interception is one check in `executeToolImplementation`, after
credentials resolve and before dispatch, so block and Agent tool calls are
covered alike. The policy rides on the execution context as `sideEffects`,
which every child inherits: Workflow blocks, custom blocks, and workflows or
custom blocks an Agent calls as tools, so a child's writes stay stubbed.

`run.allowBlocks` (`--allow <block>`) sends one block's writes for real and
lists them in `sideEffects.allowed`; `run.mocks` (`--mock <block>=<json|@file>`)
answers a block with a fixed output through the existing mock seam, with or
without `--dry`. Both resolve blocks by id, name or key like `--stop-after`.
Workflow tests now answer the writes their mocks do not with the same
placeholders. A failed dry run's `next` rerun keeps `--dry`.

The source primers, `sim workflows source --help`, `run --help`, the CLI,
build-and-run and coding-agent docs, and the integration skills now test with
`--dry`.

* fix(workflows): close dry-run escapes and secret exposure found in review

A dry run now sends no externally visible write and keeps nothing beyond its
own `test`-trigger log:

- Test runs raise no workspace event (emitExecutionCompletedEvent) and are
  left out of alert-rule statistics (excludeEventlessExecutionsCondition), so
  a dry run never starts a Sim-trigger subscriber.
- Test runs do not bump workflow.runCount or lastRunAt.
- Agents read memory but write none under a side-effect policy (no turn
  session, no appended messages).
- The policy decides a write before a hosted key is drawn, so a stubbed write
  spends no rate-limit slot; credential resolution still runs.
- Files a dry run uploads to a provider Files API are deleted once the model
  call settles.
- Custom blocks, on a canvas or called by an Agent (deployed_block_executor),
  are answered whole and never run, so nothing lands in the publisher's
  workspace and none of its internals reach the consumer.
- Code (function_execute) runs for real for a Function block or an Agent and
  is listed unchecked with a reason naming the caller; Condition evaluation is
  not listed.
- run.mocks requires run.dry. Allowed and mocked blocks are keyed by the run's
  own workflow and block; --allow on a Workflow or custom block is refused.
- A tool's nested executeTool calls (postProcess) run in the caller's
  _context, so an allowed block's follow-up writes are allowed too; Pi's Sim
  tools carry the Pi block id.
- A test run is refused as the source of a non-dry from-block run.
- A failed dry run keeps its sideEffects, compacted inside the result's own
  error mapping; the run result and `runs get` report the dry run's allowed and
  mocked blocks (`dryRun`), so every `next` rerun keeps --dry, --allow and
  --mock (a workflow test's run keeps --dry).
- sideEffects requests: MCP and custom tool calls are recorded by their
  arguments only (never envVars or other run context), password-field values
  are masked whatever the field is called, and the workspace's PII redaction
  is applied; a request that cannot be vouched for is null.

Contract and CLI: mocks are typed as objects, `omitted` is counted per list,
`allowed` is deduped per block and tool, blockId/block are null instead of
empty, the policy is WriteStubPolicy with decideWrite/answerBlock and mocks
live on it (block-mocks.ts and the service's testHooks param are gone),
`--dry --async` says to drop --async, and the CLI's repeated-option collector
and plain-object check are shared. The workflow-dir guide names `apply
--dry-run` and `run --dry` apart, and the primer's run line is reworded; its
other rewordings from the previous commit stay because the 4096-byte primer
budget forces them.

* fix(workflows): enforce dry-run guarantees at the state layer and stop persisting mocks

- A test run (trigger test: dry runs and workflow tests) is never the source of a run that sends
  its writes: getExecutionStateForWorkflow refuses one unless the caller passes allowTestRun (only
  a dry run from a block does), and getLatestExecutionStateWithExecutionId skips them. This
  covers the v2 use case, the editor execute route (named and latest) and Copilot
  run_from_block/run_block, and replaces the per-surface check.
- A test run is never resumed: resume admission refuses an execution logged under test, the CLI
  names no resume command for one, and workflow tests answer Human in the loop and Wait blocks
  whole like dry runs, so the pausingBlocks option is gone.
- run.mocks are data: a field starting with _ (_pauseMetadata and other executor control fields)
  is refused, and so is a mock of a locked block or one inside a locked container.
- Mock outputs are no longer persisted: the log records only allowed and mocked block ids.
  readWorkflowRun reads them from the execution data the status read already materialized (so
  they survive externalization), validated with the contract schema and gated like other
  execution data. The CLI rerun keeps --dry and --allow; --mock values are passed again.
- Provider Files API uploads register their removal as soon as the provider names the file, the
  caller owns the list, and the try/finally starts before the first upload, so a dry or test run
  deletes every file that landed, including on a partial or Gemini processing failure.
- A dry run never rejects a large inline response, so its result always carries sideEffects.
- Nested tool calls inherit the caller's _context only under a side-effect policy.
- Cleanups: one response-too-large mapping, request passed directly to answerUnsentWrite, one
  run-context param set, one log lookup for the source run, recordSettledRun reads the trigger
  from the LoggingSession, a TEST_TRIGGER constant, tool special cases in one declarative map,
  password fields indexed once from the registry, agent memory decided once, and toArray in the
  CLI. Allowing an Agent covers only its own tool calls (documented; the CLI notes when an
  allowed block sent nothing).

* fix(workflows): treat mocks as data only and list every code execution in a dry run

- One rule for mocks (run.mocks and workflow-test mockBlock): refuse any _ field and the
  output fields the trace span and bill are built from (cost, tokens, model, providerTiming,
  toolCalls, executionData, childTraceSpans, child workflow ids); block samples omit them too
- List Condition expressions and While/Do While loop conditions under sideEffects.unchecked,
  once per block, via a new SideEffectPolicy.ranCode
- Upload provider Files API attachments only after the cached-final early return
- Keep a failed dry run's sideEffects when compacting its error output fails
- Read the paused run's trigger in the same locked query; memoize getBlockByToolName and
  password params lazily; drop the test-only removals default; simplify answered-block and
  tool decisions; narrow the editor route try
- Tests: durable-state check instead of sleep, specific refusals, positive controls, transport
  guard on the hosted-key test, success-path upload cleanup

* test(mothership): record the run status's dryRun field in the content-delivery baseline

* fix(workflows): redact before describing dry-run writes and keep memory reads

- Build a stubbed write's request from params whose secrets are already masked
  (credential fields and password fields by field and value, collected at any
  depth, then the run's resolved secrets by its registry), so no builder
  transformation such as base64 document content can carry a secret; the
  payload pass and registry projection stay as defense in depth.
- Authorize and check an MCP write against the server's tools (checkOnly) before
  answering it, so an unusable one fails in a dry run as it would live.
- Let a dry run's Agent read its stored conversation (rich history and the memory
  retrieval tool) without opening a turn or writing memory.
- CLI: refuse --mock __proto__, and count omitted entries in the dry-run summary.
- Contract: run.mocks emits maxProperties 50; texts now say the rerun record keeps
  only mocked block ids while the log shows a mocked output redacted like any
  other block's.
- Primer and guide name sideEffects.unchecked and warn that live runs write real
  data; integration skills mention the 50-entry cap and null requests.

* fix(cli): keep the primer retry example compilable

* fix(workflows): keep dry-run describe failures and MCP checks side-effect free

* fix(mcp): a read-only discovery preserves the OAuth grant

* fix(mcp): read-only discovery takes every shared-state guard best-effort discovery takes
2026-11-25 04:57:51 -08:00
Waleed 43d2b8c5c3 improvement(workflows): agent-benchmark fixes for JSON refs, export, subflow moves and rerun-from-block (#10399)
* fix(workflow-code): print an inferred-text JSON ref as a template so upstream code edits cannot flip its storage

A stored quoted token in a JSON field printed as the bare reference whenever refValueKind typed it
a string, including when that type was only inferred from a Function's code or a child workflow's
Response data. The printed source then left the field's storage to code in another block: an edit
there that made the type unreadable compiled every unedited reader bare, so a string value broke
the JSON at run time. The printer now prints a quoted token bare only when a declaration types it a
string (refDeclaresString), and as t`${ref}` otherwise, which stores quoted whatever the code returns.

The local check scoped W_JSON_REF_UNTYPED to blocks the lock does not bind, while the server reports
it for any field that compiles differently than stored; it now reports it on any block the edit
changed, including one an edit elsewhere makes compile differently.

* fix(executor): a bare string reference in a JSON field splices as a JSON string

A reference outside any string literal in JSON text (a Response body, table row data, an api
body) spliced a string value raw, so `{"error": <check.message>}` produced invalid JSON for any
message that was not itself JSON. Such a string now lands JSON-encoded; a string that already
reads as one JSON value (an agent's JSON answer, a numeric env var) still splices as written,
and a reference inside a string literal keeps its existing escaping.

The api block's request retry params now say what they retry (timeouts, connection resets, 429
and 5xx, for GET/HEAD/PUT/DELETE unless non-idempotent retries are on), what fails at once (an
unresolvable or refusing host, other 4xx), and that the block retry setting is separate and
reruns the whole block after any failure. Their titles read "Request retries", "Request retry
delay (ms)" and "Max request retry delay (ms)".

* improvement(cli): self-sufficient workflow export, atomic subflow moves, documented table columns

- `sim workflows export` keeps workspace bindings (table, knowledge base, child workflow ids) by default, so a table block prints its tableId; `--no-include-workspace-bindings` clears them for a copy to share. The stderr note pointing at `workflows outline` is gone.
- Moving a block into or out of a loop or parallel removes the stored edges the move leaves crossing the boundary and names them in `warnings`, instead of recording them as skipped items that made `atomic` refuse the batch. Edges the batch itself asks for across a boundary are still refused. Operations help states this.
- `tables create --schema` and `tables columns create --column` list every column field (required, unique, options, multiple, currencyCode, id, position) generated from the shape the server validates.

* improvement(cli): make rerun-from-block a first-class run loop

- A failed run (workflows run, runs get, runs wait) whose failure names a block now carries
  `next`: `sim workflows run <workflowId> --from-block <blockId> --source-run <runId>`, so an
  agent fixes the block, applies, and reruns only the failing part on that run's upstream outputs.
  Parallel-branch ids and ids outside the issued format get no command.
- The raw hidden `--run` JSON flag is gone; the run selection is built only from --manual,
  --trigger, --mock-payload, --from-block, --source-run and --stop-after.
- `workflows run --help` and the --from-block/--source-run descriptions say what the rerun reuses;
  both source primers name the rerun flags in Run and debug, within the 4096-byte budget.
- paused-run.ts becomes run-next.ts now that it names the next command for failed runs too.

* docs(workflow-code): describe the bare-reference splice rule the executor now applies

* improvement(workflows): reuse the shared block label, drop the dead flag-hidden option, and align the splice docs

* fix(workflows): address review on rerun hints, removed-edge warnings, retry delays and docs

- A failed run's error carries rerunFromBlockId: the failed block, or the outermost loop or
  parallel holding it, since a run cannot start inside one. Execute reads it from the graph the
  run executed, Get workflow run from the saved draft. The CLI prints next from it instead of
  the failed block id, so a failure inside a loop no longer prints a rerun the server refuses.
- Edge validation names why it dropped an edge (missing block, annotation-only, trigger target,
  scope); the removed-edge warning adds loop and parallel wiring advice only for a scope crossing.
- backoffWithJitter never waits longer than maxMs: jitter at the cap only shortens the wait, so
  an api block's max request retry delay is a real maximum.
- source check help: W_JSON_REF_UNTYPED scope sentence rewritten.
- cross-kind integration expects a child-result text ref printed as t`${...}`.
- Docs baseline hashes for the operations apply edge help fence.

* test(utils): drop the retry test's redundant mock-restore hook

* fix(api): keep rerunFromBlockId out of the resume response's error schema
2026-11-24 21:01:05 -08:00
Waleed 0e0d09cbfe improvement(workflow-code): source check type-checks with the pinned TypeScript (#10345) 2026-11-23 14:33:54 -08:00
Waleed b627a8bb14 improvement(workflow-code): clean slate for workflows and workspace as code (#10344) 2026-11-23 13:23:19 -08:00
Waleed bf6bc31a0b improvement(workflow-code): agent DX and check/server parity from the v6 benchmark (#10305)
Agent DX fixes from the A/B v6 benchmark: --stop-after output, destructive counting, status/dry-run parity, dry-run exit 15, canonical param names on ops, ops/run help and cookbook docs; check and lint parity for child result paths, lock caps and loop conditions; clearer undeployed-child and unknown-type errors.
2026-11-22 08:17:39 -08:00
Waleed 293ec1b7e1 improvement(workflow-code): server hardening, flaky test root causes, and agent DX across the source loop (#10287)
Server: dry runs charged to the plan budget and slot, create-from-source answers 429 when slots are full, the Code tab has its own slot lane, staged blobs count against the payer's storage quota (consumed on apply, never renewed by reads), file deletes carry a revision precondition, row limits refuse only growth, joined table transactions keep their timeouts, and blocks/edges/subflows load in a stable created_at,ctid order. DX: group help for the source loop, a primer covering renames, failures and test runs, JSON-only output, run errors mapped back to source file and line, --stop-after/--from-block by name, webhook URLs after deploy, GitHub Actions annotations and step summary, exit 15 for a partial write, table names on every table route, status that agrees with the dry run, and quieter output. Flaky tests fixed at the root (keep-alive races, sleep-based waits). Migration 0469 adds a nullable staged_blob.consumed_at.
2026-11-21 07:05:36 -08:00
Waleed 93555ff909 fix(workflow-code): bound lock parsing and rename inference, and close check/server parity gaps (#10285)
Lock parsing checks parent cycles in linear time and caps blocks and variables (one SOURCE_LIMITS source, counted before any entry is read, in the parser and the contract). Rename inference uses indexed candidates instead of every pair (200 renamed blocks: 103 s to 5 ms). Did-you-mean hints are computed lazily. Offline check now refuses dangling refs, unknown block types and non-addable types the way the server does. Managed table rows read under a streaming byte cap, and a committed table edit over capped rows still reports success. Deployment plans read only declared or recorded workflows. One shared canonicalJson in @sim/utils/object.
2026-11-21 03:24:58 -08:00
Waleed 825a419194 chore(cleanup): simplify what the Redis, config and removal changes left behind (#10286)
* chore(cleanup): simplify what the Redis, config and removal changes left behind

* docs: name every Search and Redis requirement precisely
2026-11-21 02:07:26 -08:00
Waleed 26caf900ca refactor(workflow-code): source pipeline plan/commit split, one findings bound, CLI source-dir split (#10238)
Wave 2 of the workflows and workspace as code cleanup: plan/preview/commit stages bound to the planning principal, one diagnostics module and answer bound, CLI source-dir split with typed refusals and a command lock, @sim/table-cells, plus review fixes (plan writes nothing, functions/ pruning limited to lock-named code files, local refusals never read as unreachable).
2026-11-20 11:10:20 -08:00
Waleed 02fb744393 fix(workflow-code): correctness, safety and speed for workflows and workspace as code (#10237)
Wave 1 from the staging evaluation of workflows/workspace as code, audited by 5 lenses and re-audited. Deploy/drift safety (no out-of-band draft publishes; expected-draft fingerprints on deploy and chat writes; drift warnings by default), adopt/promote/partial-apply safety, one shared refusal decision for server and offline check, compiler and CLI correctness, feature gate after authorization, read-cost plan routes, realtime flush lost-update fixes, deterministic edge/block load order, and diff-based normalized saves with restored workflow_edges block FK indexes (migration 0467).
2026-11-20 04:58:57 -08:00
Waleed 5929764d10 fix(workflow-code): DX fixes from the staging A/B runs (#10229)
Dangling $ref in an edited function file is an error (E_APPLY_UNRESOLVED_REF); no W_JSON_REF_UNTYPED for a rename's reference rewrite; source status prints the findings it counts; operations edit params.parentId moves blocks (with cycle, same-batch id and nested-offset handling); deploy accepts -y; condition branch handles documented; renames rewrite restored values in one pass.
2026-11-19 22:34:14 -08:00
Waleed 6856efa50c fix(workflow-code): staging QA fixes for workflows and workspace as code (#10220)
Fixes from the staging end-to-end QA of workflows and workspace as code: check and catalog fixes, visibility gate on source apply, CLI exit and interrupt handling, apply DX (binding, findings, created ids, deploy), workspace batching under the body ceiling, params reference and slim primer, diagnostics and rename identity, plus the review fixes.
2026-11-19 20:01:21 -08:00
Waleed bc8f09ccb1 feat(workflow-code): workflows and workspace as code (#10129)
* test: type the MCP base address the concealment check compares

* fix(workspace-code): check file path collisions on a segment tree, not a map of every prefix

Keeping every folder prefix of every path still held about a million prefix strings for
20,000 deep paths. A tree of folded segments costs one fold per segment and holds each
segment once, so the depth cap is no longer needed.

* refactor: drop the exports of isSuspiciousCharacter and readFolderWritten, used only in their files

* docs(workflow-code): CI needs a personal key; document workspace-key E_APPLY_FORBIDDEN and --only

workflows.source.apply and create deny workspace API keys, so the CI guidance now asks for a
personal API key or an OAuth login. Workspace as code names the kinds a workspace key cannot
write (workflows, skills, secrets, deployments), the E_APPLY_FORBIDDEN refusal, and narrowing
an apply with --only.

* docs(workflow-code): link the code pages from workflows, CLI, getting started, API and MCP

Adds a For coding agents section to Workflows as code (get, edit, check, status, apply, starting
from .sim/AGENTS.md), a prefer-source note on the API build guide, and an MCP section on editing
a whole workflow with getWorkflowSource and applyWorkflowSource.

* docs(self-hosting): document the WORKFLOW_CODE preview flag

Adds a Preview features section with WORKFLOW_CODE and links it from the in-preview callouts on
the workflows and workspace as code pages.

* feat(workflow-code): Code tab header with Preview label, CLI copy and docs; Download as code

The Code tab gets a title row: a Preview badge, a button copying
sim workflows source get <workflowId> --dir ./<workflow-name-slug>, and a link to the docs.
The workflow menu gains Download as code beside Export workflow, saving the draft as the
single TypeScript file the Code tab shows (function code inline). The download revalidates the
cached source by ETag first, so an edit since the tab last read is never missed.

* chore(rules): load the workflow-code rule for the v2 source routes, contracts and staging cleanup

* feat(llms): list workflows as code in llms.txt

* docs(cli): workflows and workspaces as code in the README, help epilogue and source group descriptions

Adds a README section (get, check, status, diff, apply and the coding-agent loop), a source get
example to the root help, and describes both source groups as read and apply, marked (preview)
while the server flag gates them. Regenerating the CLI docs changes nothing: the pages list each
command, not group descriptions or the root epilogue.

* test(workspace-source): a re-run adopting a stopped MCP replace with stored() headers still needs an admin

A workspace key re-running an interrupted replace is refused with E_APPLY_FORBIDDEN, the
owner's re-run finishes it, and a read-only member's get prints the adopted server's
literal headers as stored().

* feat(workflow-code): roll the workflow-code flag out by organization, workspace or user

Every source use case, the Code tab layout and useFeatureFlag now evaluate
workflow-code against the workspace, its organization and the acting user,
so AppConfig orgIds/workspaceIds/userIds allowlists take effect. Adds the
rollout plan to the workflow-code design doc.

* feat(mothership): grant the workflow-code entitlement where the source commands run

computeEntitlements now sends workflow-code to the worker for a workspace or
organization chat whose rollout has the flag on, ahead of the worker's
ENTITLEMENTS enum (the wire accepts any name). The CLI inventory marks every
workflows source and workspaces source command with entitlement: workflow-code
so the worker can hide them once it reads the field.

* docs(api): say how workspace source blobs are staged, and that dryRun previews

The applyWorkspaceSource description pointed MCP readers at Stage Workspace
Source Blobs, a multipart route MCP does not expose; it now names the CLI and
the blob upload route. The MCP write tool no longer claims no write can be
previewed: the source applies take dryRun.

* feat(analytics): record workflow source reads and dry runs, and workspace source applies

Adds workflow_source_read, workflow_source_dry_run and workspace_source_applied
beside workflow_source_applied: same attribution, kinds and counts only. A
refused dry run is now a dry-run event, never an apply.

* docs(workflows): commit written.json and point workspace CI to its own section

* test: read the MCP server URL as nullable in the stopped-replace check

* test(workflow-code): resolve the workspace before the flag in the HEAD 403 check

The flag now needs the workspace's organization, so the read routes resolve
the workspace first; the test gives them one to resolve.

* test(analytics): one workspace_source_applied per apply, refused, partial or committed

Busy, rejected and partial applies each record exactly one event with their
outcome, the committed retry one more, and a dry run none.

* fix(cli): resend a rate-limited GET even when its response body is lost

Cancelling an errored body rejects, so a 429 whose body was lost threw the raw
stream error instead of resending.

* fix(tests): order the workspace source "nothing was written" snapshots by id

The snapshots compared before and after a refused apply selected rows with no
ORDER BY, so their order was whichever index the planner chose: on the
workflow table the sort, unique-name and workspace_id indexes each return a
workspace's rows in a different order. Once autovacuum analyzed the table
between the two reads the plan could change, and the cross-kind test failed
with equal rows in a different order. Forcing the second read off index scans
reproduced the exact failure; ordering by id makes the comparison
plan-independent.

* refactor(source): one vocabulary for the fingerprint of what the server stores

PlannedChange.serverFingerprint is storedFingerprint and KindAdapter.fingerprintNow is
storedFingerprintNow; the workflow adapter's currentFingerprint() is readStoredFingerprint;
the sf1: helper in print-stored is storedSourceFingerprint, beside the kinds' rf1:
storedFingerprint; the workflow apply's local and EvaluatedSource field are storedFingerprint,
as source-commit already named it. The 409 wire field currentFingerprint is unchanged.

* fix(workflow-sdk): the workspace runtime exports defineSecrets and defineCredentials

secrets.d.ts and credentials.d.ts declare them and the cookbook imports them, but the
runtime entry did not export them, so running such a file failed with 'export not found'
instead of SimSdkNotExecutable. codeFile now re-exports core's stub, as tool.d.ts declares.
A test keeps the runtime's exports equal to every value the declarations declare.

* fix(workspace-source): re-scan deletes for new users under the apply lease

The plan's in-use scan ran before the lease, so an apply that saved a workflow
using a resource another apply was about to delete went unseen: the deleting
apply took the lease and deleted anyway. The apply now scans its deletes again
once it holds the lease and refuses (E_APPLY_STALE, nothing written) a delete
that a workflow the plan did not find now uses; a scan timeout still fails
closed.

* fix(cli): take a stale source-directory lock over safely, never through a link

Two commands that found one lock stale could both remove it: the later one's
removal deleted the live lock the first had taken, admitting two writers. A
takeover now claims the stale lock folder it removes (only one command can) and
checks it is still stale first, so a lock that replaced it is left alone.

The lock path also bypassed the source directory's symlink checks: a .sim or
command.lock that is a link was followed. Both are now refused
(SOURCE_SYMLINK) before the lock is created, read or removed.

* fix(cli): workflow commands in a workspace folder hold the workspace directory lock

A single-workflow apply, create or get inside workflows/<key>/ of a workspace
directory rewrites the workspace's written record and base, but took no lock, so
it could interleave with a workspace command (or another folder's) and lose a
record. These commands now hold the workspace directory's command lock for the
whole command, refused like a workspace command (SOURCE_DIR_BUSY, exit 10)
with nothing read or written.

* fix(cli): status recommends commands in its own scope, with --allow-delete for dropped data

The command workspaces source status recommended dropped the scope it was asked
for: status --only tables suggested an apply of every kind, and a status pointed
at a workspace with --workspace suggested one at the profile's. Every
recommended command now carries --only and, when the target is not the
profile's default, --workspace.

It also asked for --allow-delete only for whole-resource deletes, so an update
that drops a column was suggested without it and refused. It now uses the same
destructive count the apply prints.

* fix(cli): an apply that reprints a tool as stored() removes its old code file

When the server keeps a tool's code as stored() (it holds a credential), the
apply reprints tools/<key>.ts without tools/<key>.js, but saving the answer
left the old .js and its digest behind, so the next apply failed with
E_TOOL_CODE. Saving an apply now removes, from disk and the written record,
every text file the directory sent for a reprinted resource that the reprint no
longer holds (workflow folders keep pruning by lock).

* refactor(table): move cell value rules into @sim/workspace-code/table-cells

The per-type coerce/validate/salvage/equality rules, the row loops (required
cells, coercion policy, batch unique scan) and the pure date, currency, ttl and
select helpers move from apps/sim/lib/table into the workspace-code package
(timezone helpers into @sim/utils/timezone). The column-type registry spreads
CELL_RULES into each definition and validation.ts delegates, so there is one
implementation. The workspace source table adapter refuses declared rows with
refusedTableRows, which the CLI can now run offline.

* feat(sim-cli): workspaces source check validates table rows files offline

Each tables/<key>.rows.jsonl (managed or seed) is read against its declaration
and checked with the write's own rules (refusedTableRows): a malformed line, an
undeclared column, a managed key two lines share, an empty required cell, a
unique value two rows share, a value its column's type or options cannot hold.
Each is an E_TABLE_ROWS error at its line.

* fix(workspace-source): credential adoption never takes a credential from a key bound outside source

* test(workspace-code): assert linear growth, not a wall-clock budget, for hostile inputs

The file-grouping test asserted 20,000 deep paths group within 6 s and took 7.2 s
on a CI runner. It now counts the characters case folding reads at depth 100 and
400 (about 4x linear, 15x for the per-prefix fold it guards against), which no
machine load changes. The two compile tests with a 3 s budget (JWT pattern,
numeric precision) now compare the fastest of three runs at n and 4n: reverting
either fix gives about 15x against a bound of 9.

* fix(table): a seed reshape refuses a table that gained rows since the plan saw it empty

* fix(table): a keyed row write inside a reshape runs at the bulk-write statement timeout

* fix(workspace-source): hold the apply lease from before the plan, not only the writes

An apply planned before taking the lease, so another apply could write between
its plan and its writes: the first then wrote half of itself and failed
(E_NAME_TAKEN, E_APPLY_STALE), or deleted a resource a workflow had just
started using, because its in-use check had run before the other apply's save.
A non-dry-run apply now takes the lease first and plans and writes under it, so
a second apply is refused SOURCE_BUSY before it reads anything. This replaces
the post-lease in-use re-scan, which covered only deletes. Dry runs still take
no lease; the per-write lease confirm and stored-fingerprint re-checks stay for
UI edits, which the lease does not order.

* fix(workspace-code): literal-secret findings carry a span but no code frame

E_MCP_LITERAL_SECRET, E_DEPLOY_SECRET, W_TOOL_LITERAL_SECRET and the workflow
W_LITERAL_SECRET framed the line holding the secret, echoing it over v2 and MCP.
They keep their span; the finding cap and the server locator drop the frame too.

* fix(workspace-source): a secret declared without a description records no base entry, so it is never falsely stale

* test(workflow-code): time hostile inputs with Date.now, repeated past the clock's resolution

The package has no Node or DOM types, so performance is not declared. Each
growth timing now repeats the work until it spans 25 ms, so millisecond steps
do not swing the ratio.

* fix(workspace-code): an env reference or helper call is never read as an object

headers: env.TOKEN parsed with no finding into a header named $env, and
defineTable(column.string()) reported the encoding's $call/args fields. Both
now get one finding that names the value and how to write the object.

* feat(workflow-code): mixed-script block names, workflow inputs, env hint target

- E_LOOKALIKE_NAME also refuses a block name with a word mixing Latin with
  Cyrillic, Greek, Armenian or Cherokee letters (Unicode script property, no
  confusables table), naming the code point; W_ when the block is stored.
- startInputs and INPUT_TRIGGER_TYPES (shared with apps/sim) read a workflow's
  Start trigger inputs; W_CHILD_INPUT_UNKNOWN and W_CHILD_NO_START join the
  vocabulary for the CLI's offline child-call check.
- CompileInput.envDeclaredIn points a W_ENV_UNKNOWN hint at secrets.ts.

* feat(sim-cli): workspaces source check covers skills, child inputs and workspace.d.ts

- skill('<key>') is checked against skills/ like every other kind; a key with
  a non-ASCII letter names its code point and script.
- A child workflow call is checked against the child's Start trigger in the
  same directory (W_CHILD_INPUT_UNKNOWN, raised on new blocks; W_CHILD_NO_START).
- A get keeps the server's resource manifest beside workspace.d.ts, and check
  regenerates workspace.d.ts from it and the directory's declarations, typing
  new keys and each workflow's inputs without a request.
- Did-you-mean hints on E_MAT_UNKNOWN_RESOURCE, W_TABLE_UNKNOWN_COLUMN and
  W_ENV_UNKNOWN (which points at secrets.ts); a warning raised to an error no
  longer says it is kept as written.
- check --help lists every kind it checks.

* fix(workspace-code): check the option cap before a linear duplicate scan; pin a duplicate column to itself

A select's repeated-option scan was quadratic and ran before the maxOptions cap:
80k options took 7 s per parse (now ~0.1 s). E_TABLE_DUPLICATE_COLUMN spanned the
whole defineTable argument instead of the second column.

* perf(workspace-code): group a status's changed files in linear time; key server findings by code

localResourceChanges copied the kind's array per file: 40k files took 3.3 s.
SERVER_FINDINGS is now checked against WorkspaceDiagnosticCode.

* perf(workflow-code): print a fill in linear time by advancing an offset

printFill re-spread the remaining parts for every content/separator pair, so a
number-only array printed in quadratic time (40k numbers took 17.5 s). The rest
of the fill is now queued as the same parts from a later offset.

* fix(workflow-code): refuse a tool param or operation option the builder pins

A tool builder's fixed params and the operation option overwrote the method's
pin silently, so the tool stored an operation the method contradicts and printed
back as raw(). Report E_FIXED_PARAM, as the block path does.

* refactor(workflow-code): look a tool's builder up once

toolBuilderPath found the builder, returned its path, and compileToolCall looked
it up again behind an early return that could not fire.

* fix(workspace-code): cap knowledge document findings apart from knowledge.ts's own

Document findings were uncapped and counted against the field reporter's
100-finding budget, so the declaration's own findings became E_LIMIT_EXCEEDED.
The field reporter now counts only what it appends.

* fix(workspace-source): a workflow delete is fingerprinted only once its live triggers are counted

* fix(workflow-code): exclude a retyped block from rename inference by its own id

A retype matched by lock ident (or against a prev block the canvas renamed)
excluded the prev block under the new key, not the one it retyped, so another
new block of the old type could inherit the old id, its run history and its
webhook. Record the retyped prev id and exclude that.

* fix(workspaces): a key claim that loses a concurrent race refuses with 409 or retries, never a raw 23505

claimResourceKey read the key with select-for-update, but an unheld key has no row to lock, so a
concurrent get (allocation) or claim could insert first and the plain insert failed with a unique
violation on either index, surfacing as a 500. The insert now skips on conflict and the claim
re-reads the committed winner: kept, ResourceKeyTakenError, or a retry that replaces a key the
resource was allocated meanwhile. Rebinding deletes and re-inserts so it shares the same path.

* perf(workflow-code): push identity group keys instead of re-spreading the group

Each push copied the whole group, quadratic when many unmatched blocks share a
type and parent.

* fix(workflow-sdk): new on a runtime export throws SimSdkNotExecutable; one stub for both entries

The Proxy target was an arrow function, which has no [[Construct]], so the
construct trap never ran and new t() threw a TypeError. The workspace runtime
re-declared notExecutable and seven identical functions; both entries now share
the stub in not-executable.ts.

* feat(workflow-code): x.error compiles in the handler of an onError edge

The executor returns { error: <message> } as a failed block's output when an
error edge leaves it (BlockExecutor errorOutput, block-executor.ts:738-740,
returned at :868-877). Compile accepted no such path, so the INDEX promise of
${x.error} failed with W_UNKNOWN_OUTPUT_PATH. Now x.error checks once the edges
are known: accepted with an error edge, refused with a hint to wire onError
without one. Block<O> types error in the SDK, INDEX says how the handler reads
it, and the integrations cookbook shows it.

* fix(workflow-code): compile stored() in a loop or parallel's meta.extra

The printer writes a container param holding a detected credential as stored()
under meta.extra, but compileContainer passed no keep callback, so the print
failed to compile. Keep the stored value as a regular block's extra does.

* fix(workflow-sdk): never embed a dotfile from the cookbook

WORKSPACE_COOKBOOK embedded every file on disk under cookbook/workspace, so a
.DS_Store or editor swap file would be written into every user's example
directory. The listing now lives in embedded-files.ts, shared with the drift test.

* docs(knowledge): say why an upload's processing relay is safe on every surface

* perf(workflow-code): read each node's successors once in the cycle check

stronglyConnected called successors on every step of a frame, and the caller
maps the node's whole outgoing list each time, so a block wired to many targets
cost O(deg^2). Read them once when the frame is pushed.

* perf(workflow-code): test a restored inactive value with withStoredValue

staysInactiveWithPrev rebuilt the block's whole activity inputs (every param,
the modes, the ids deploy reads) for each inactive id on each pass. Build them
once per pass and swap the one value in, tracking the pass's restores.

* fix(workflow-code): keep collapsed on inputFormat fields whose id stays inline

Canonicalize drops the editor's collapsed flag from every field, but materialize
restored it only for fields whose id moved to the lock, so a field with a shared
or missing name lost it whenever the list changed.

* feat(sim-cli): no login exits 13 with AUTH_REQUIRED

Not logged in, an OAuth login that expired and cannot refresh, and a 401 from
the server exited 1 with CLI_ERROR, the same as a source with errors. They now
exit 13 (AUTH_REQUIRED_EXIT_CODE) with the code AUTH_REQUIRED (a 401 keeps the
server's code when it sends one). A status still falls back to the local view
without a login, and its note now reads as sentences.

* fix(workflow-code): write a subflow collection holding a $sim object back unwrapped

Canonicalize and compile wrap an object with its own $sim key as a literal node,
but materialize wrote forEachItems and distribution raw into block.data and the
loops and parallels maps, so after any config change the executor iterated the
wrappers. Unwrap literal nodes there, and say so in jsonField's TSDoc.

* fix(sim-cli): source diff filters resolve against --dir; cancellation and 413 keep their exit

- diff ./, an absolute path or a path from the current directory selected
  nothing and printed "No local changes."; filters now resolve against --dir and
  one that selects no file is refused (SOURCE_PATH_UNMATCHED).
- A cancelled request carries REQUEST_CANCELLED, so status no longer reports it
  as an unreachable server; noAnswer() is the one copy of that predicate.
- workflows/workspaces source status and diff map a 413 to exit 7, as get does.

* fix(workspace-source): holding a change for one credential key keeps another key's unreachable refusal

* fix(sim-cli): an apply drops the written.json entries of the resources it deleted

The record kept every deleted resource's files, so status reported the delete
forever (exit 11) and recreating the key made get refuse with SOURCE_LOCAL_EDITS.
An entry is dropped only when its file is gone and the returned base no longer
holds the resource or blob, so a held or failed delete stays retryable.

* fix(workspace-source): a chat auth type source cannot name leaves the deployment out instead of reading as public

* perf(workflow-code): bucket wiring and order dependencies by scope once per print

Each scope's wiring rescanned the members of every enclosing scope and refiltered
their edges by edgeScope, and each scope's declaration order was handed every
dependency in the workflow: O(scopes x blocks). Bucket edges by the scope they
print in, and dependencies by the scope they order, in one pass.

* fix(workspace-source): file creates of one name check every key they may take, and a lost key claim refuses the create

* perf(workflow-code): memoize buildFieldIndex and group pair members in one pass

The index was rebuilt for every block in print and compile and for every tool,
and each canonical pair rescanned every subBlock for its members: O(pairs x
subBlocks) per call. Group the members once, and memoize the read-only index by
block, trigger mode and pinned ids.

* refactor(workflow-code): sort compiled edges with canonicalize's compareEdges

Compile kept its own copy of the comparator, and the CWM edge order is hashed
(canonicalHash), so two copies could drift.

* chore(workspace-source): unexport WorkspaceSourceChange, used only in its own file

* docs(workflow-code): move compileRegularBlock's TSDoc onto it

It sat above BlockShape's own TSDoc, documenting nothing.

* fix(workspace-source): the staging sweep removes objects before their rows, keeping a row whose object survived

* docs(workflow-code): describe LoopSpec as canonicalize reads it

The TSDoc said the spec is the loops map's config and that canonicalize never
fills defaults; loopSpec reads block.data first, never takes the map's count,
and falls back to a for loop of 5.

* refactor(workflow-code): stop exporting ConfigItem

Nothing imports it; it is only printedConfig's item type.

* refactor(workflow-code): read pinned values and the catalog block once

compileMetaParams rebuilt the map of every stored value once per pinned id, and
needsTodo looked the catalog block up twice though collectParams already holds it.

* fix(table): a reshape resolves each column update to its id, so a by-name swap renames both

* fix(workspace-source): a get leaves out a secret named __proto__ instead of printing an unapplyable secrets.ts

secrets.ts printed every stored secret, but the declaration reader refuses a
__proto__ key, so after a get the whole file stopped applying. The secret is
now listed in skipped.json with the reason; MCP header names the reader refuses
already round-trip-fail into skipped.

* perf(sim-cli): a status past one dry run prunes its whole read instead of walking the directory again

When the workflow folders exceed one dry run, status read the directory a
second time: a second walk, read and hash of every file. It now prunes the
unchanged folders from the read it already made.

* perf(sim-cli): workspaces source apply walks the directory once, inside its lock

assertWorkspaceDir walked every kind folder outside the lock before
readWorkspaceDir walked it again; the apply now checks the read it made and
runs the full check only to refuse. orphanedWorkflowFiles groups the answer's
paths by folder once instead of per lock, assertBaseWorkspace reuses
baseWorkspaceOf, and printPlan no longer shadows counts.

* fix(sim-cli): --only reads past an empty segment instead of refusing an unnamed kind

* refactor(workspace-code): un-export four unused types, name the skill locator apart from a line's offset, fix two TSDocs

* feat(workspace-source): an existing column becomes required in the same apply as the managed rows that fill it

* perf(workspace-source): list MCP servers' tools concurrently while planning tool references

* perf(workflows): a batched source read prints its workflows concurrently

* fix(workflow-types): hold a container's edges to the handle they leave from

A loop or parallel's start handle connects only into the container, and any other
handle never does. The shared scope rule ignored the handle, so the editing engine
kept a start edge to a block extracted from the loop (and an end edge to a block
moved into it): edges the canvas never draws and workflow source refuses
(E_EDGE_SCOPE), so such a workflow could not be applied back from its own source.

* fix(editing): refuse an error edge from a block with no error output

The engine accepted an 'error' handle on any block, so a trigger or a loop or
parallel container could store an error edge the canvas has no port for and
source cannot write (E_ERROR_PORT_UNSUPPORTED). It now follows the source
catalog's errorPort rule.

* fix(editing): normalize row ids only on fields declared as row lists

Row-id normalization keyed on the subblock id alone, so any field that shares an
id with a table field (supabase's JSON code 'params', 'metrics', 'headers',
'variables') was coerced to a row list: a JSON object or code text was replaced
by [] and the value lost. It now applies only where the block declares the id as
a row-list type.

* fix(workflow-code): keep the pair member a trigger-mode pair's mode does not select

Deploy reads every member of a trigger-mode pair, so the inactive-param restore
never brought back the member the mode does not select. An unchanged apply of a
block toggled into trigger mode dropped that member's stored value, and editing
the selected member dropped the other one. The pair's value is now its
mode-selected member's, and the other members keep their stored values, as on
the canvas.

* fix(workflow-code): write only the subflow config fields an edit changes

Canonicalize fills a loop's count (5) and the collection and conditions the
subflow map holds when block.data omits them; a changed config wrote all of them
back, so renaming the block a loop condition reads also stored count, collection
and condition fields nobody edited. Fields equal to the stored config keep their
stored spelling, absence included.

* fix(workflow-source): compile a block renamed in source against the block it continues

Compile matched the stored block by key, while materialize keeps a renamed
block's id through its ident (lock-ident). Renaming a block in source therefore
refused its stored() secret (E_STORED_VALUE_MISSING), turned a stored cycle into
E_EDGE_CYCLE, and reset fields source never writes (a note's color) to their
defaults. compileSource re-keys the stored model to the source's renames and
compiles again.

* refactor(sim-cli): name what source helpers do and fix their docs

- mergedGitattributes merges .gitignore too: withMissingLines.
- isMissing reads the code through errorCode, not a cast.
- workflows source check calls workspaceFolderOf directly.
- Exit codes 5, 6 and 7 document workspaces source as well.
- workflows source resources lists MCP servers; any source get writes it.
- Two TSDocs a reflow mangled.

* perf(workflow-persistence): read only live in-workspace graph rows in a batch load

loadWorkflowsFromNormalizedTablesRaw read every block, edge and subflow row of every requested id,
then dropped the ones outside the workspace, and kept archived workflows the read snapshot
discarded afterwards. Each graph query now filters by the live in-workspace ids as a subquery.
Measured on 100 live + 300 archived workflows of 30 blocks: loadWorkflowReadSnapshots median
579ms -> 151ms.

* perf(workflows): one credential lookup for a batch load's block migrations

loadWorkflowsFromNormalizedTables ran each workflow's block migrations serially inside the
REPEATABLE READ snapshot, and the credential-id migration queried once per workflow holding a
legacy account id. The batch now prefetches the credential ids for every workflow's legacy ids in
one query, and only queries again for an id a migration surfaces that the prefetch did not ask
about, so the result is unchanged: N serial round trips become one.

* fix(api): one ETag revalidation path; tagged v2 bodies are revalidated, and cached per request

- ifNoneMatchSatisfied was copied in the internal and v2 JSON builders; definition.ts now owns
  entityTagMatches and notModifiedResponse.
- The v2 builder answered a tagged 200 and its 304 with private, no-store, which forbids keeping
  the body the ETag exists to revalidate. Both now say private, no-cache, as the internal one did.
- The v2 validated-body LRU was keyed by the tag alone and served across principals and inputs,
  though present() reads the parsed request. It is keyed by tag and parsed request now, and
  entityTag documents that it must be a strong validator of the result for every caller.
- The internal builder's HEAD branch re-checked a missing authorize() that definition-time
  validation already refuses; it captures the authorize phase once instead.

* fix(workflow-sdk): codegen uses its layout helpers; INDEX.md lists legacy builders only when there are some

- generate.ts builds block, models and index paths from layout.ts; blockTypesFile
  leaves the barrel; layout.ts reads TOOL_NAMESPACE.
- @when names both fields of an and clause.
- typecheckSdkDirectory spreads SOURCE_COMPILER_OPTIONS.
- The cookbook declares ORDERS_API_KEY, which its tool reads, and says a new
  query string updates an MCP server in place; column.ttl() says one per table.
- Doc fixes: arrayOf, declaredBlockTypes order, core.d.ts names tsc.

* fix(schedules): a written zero is an invalid schedule field, not a missing one

The reason classifier read fields through getSubBlockValue (value || ''), so a numeric 0 counted
as empty. It now checks undefined, null and '' explicitly.

* docs(environment): state the non-empty invariant both env paths share

* chore(scripts): name the pure package an offender is in, not always workflow-code

* refactor(chat-deployments): one identifier-ownership check, and one live-chat read per replace pre-check

* refactor(workflows): the code tab names its directory with the shared slugify

* refactor: keep types no other module imports private

* refactor(workflows): drop the field-by-field source apply presenter

The response schema already strips the result's internal fields, so both routes present the
result as it is.

* refactor(workspace): the workflow-code flag is required of every flags producer

* refactor(utils): one mapWithConcurrency, with documented failure semantics

apps/sim had its own mapWithConcurrency next to @sim/utils/concurrency's, with different failure
semantics: it rejected through Promise.all as soon as one item failed while its other workers kept
starting items nobody awaited. Every caller now uses the @sim/utils one: after a failure no item
starts, and the first failure is thrown once the running items settle, so nothing the batch began
is still running when the caller handles it. mapSettledWithConcurrency (attempt every item, keep
each outcome) moves alongside it. createConcurrencyLimit, MATERIALIZE_CONCURRENCY and
waitWithAbort stay in apps/sim.

* perf(workspace-source): a knowledge plan never downloads a document named in neither the base nor the directory

* docs(workspace-code): CI commits back what apply rewrote, tsc step, Gmail provider

- The scripting.mdx CI job runs tsc after check (which regenerates
  workspace.d.ts), and on merge commits back the files the apply rewrote, with
  [skip ci] and contents: write; a protected branch opens a pull request instead.
- workspace-code.mdx says what check now covers (skills, child inputs, rows,
  workspace.d.ts).
- The cookbook credentials.ts shows Gmail's provider id, google-email (the id
  apps/sim/lib/oauth/oauth.ts registers for Gmail).
- The docs baseline records the changed CI fence.

* docs(cli): regenerate the CLI reference for the check help and exit 13

* test(api): the source catalog's tagged 200 is private, no-cache

* fix(workspace-source): a renamed or name-taken stored() tool reports only that, not a missing stored tool

* fix(workspace-source): a deleted chat's base no longer records its password variable

* fix(table): reshape audit entries name columns, never their ids

* refactor(workflows): drop the never-filled SourcePlan.notes, share the stale message, and read a rename's folder from the loaded workflow

* refactor(source): one managed-row key, one tool-input field list, and no unreachable fallbacks

* docs(source): gated manifest sections, the required-column 400, carried tags and the manifest limit

* chore(source): regenerate the v2 OpenAPI and MCP operations for the documentation changes

* test(workspace-code): bound the option-cap and status-grouping fixes by n vs 4n growth, not wall clock

The ratio helper is exported from @sim/workflow-code/scaling.test-helpers so
other packages' scaling tests share it.

* fix(workflow-code): x.error is a string in a JSON field

The executor's error output is the failure message, so a reference to it in a
JSON body (response, API body) is stored quoted, as compile and print decide
through refValueKind; bare, a message would break the JSON.

* refactor(workspace-code): rowKeyText reads any cell value, so the table row writer shares it

* chore: drop the apply wire type no module reads, and shrink the non-null baseline the batch load cleared

* test(workspace-source): the cookbook apply test holds the Gmail credential the cookbook declares

* fix(workflow-code): keep a stored field the printer left out as inactive

Compile fills an omitted param with its default, then keeps the stored value only
when the field is inactive, judged with the default in place. A standalone
advanced field runs once non-empty, so a stored '' choice (cloudflare's 'Active
only' certificate filter) read as active under the default and every apply
replaced it with 'all'. Inactivity is now judged with the stored value.

* refactor(utils): point the merged mapWithConcurrency callers at @sim/utils

* test(workflow-source): prove canvas, JSON API and source stay in lockstep

A seeded fuzz applies random sequences of real editing-engine operations (add,
delete, move, edit fields, connect, disconnect, insert into and extract from
loops and parallels, rename, enable, retype, trigger and advanced mode, loop
config, variables) to corpus workflows, then asserts the source of the result
applies back as a no-op and one random source edit changes exactly that field.
Failures shrink to a one-minimal edit list. Every registry block type is added
(or, for legacy and single-instance types, edited) with non-default values in
each subblock kind it has. Each divergence fixed on this branch keeps a minimal
regression. The integration suite runs the full stack on Postgres: JSON write,
editing operations, source get and apply, JSON read, and a canvas-built workflow
against the one created from its source.

* chore: drop exports the cell-rule move left unused; move the timezone baseline entry

* chore(audits): count staging's new integration double-cast in the merged ratchet

* test(workflow-source): satisfy the audits in the fidelity suites

* test(workspaces): wait with the shared sleep helper

* fix(cli): recover a command lock abandoned before its owner was recorded

The takeover claim inside the lock refreshed the lock folder's mtime before
the staleness re-check, so a lock with no owner.json never read as stale and
every command returned SOURCE_DIR_BUSY. Judge an unrecorded lock's age from
the sighting taken before the claim, and guard against a replacement lock by
checking the folder is still the one seen (dev/ino) and still stale.

* chore(helm): bump chart to 1.11.22 for the source-staging cleanup cron

* fix(workspace-source): match managed row keys after their column's coercion

planRows compared declared key cells with stored ones before coercing them,
so a number key written as "007" counted the stored row 7 as removed and the
apply refused without --allow-delete, though the keyed write coerces "007"
to 7 and matches it. Coerce the declared key with the key column's cell rule
(the reject policy a keyed write uses) before matching.

* fix(workflow-code): print a JSON code field in meta.extra as its stored text

An advanced JSON code field the serializer still forwards under an operation that
hides it prints under meta.extra, which compile reads verbatim. It printed as an
object literal, so compile stored a native object and an unchanged apply rewrote
the stored text (minified, or not at all equal when it held references). It now
prints as text there; only a builder param takes the literal form.

* fix(workflow-source): keep a block keyed __proto__ in the lock and hints

buildLockFromState, hintsFromSourceMeta and printStoredSource assigned by bracket,
so a block whose name normalizes to __proto__ set the prototype instead of an
entry: it vanished from the lock, and renaming it in source lost its identity
(compile treated it as new and reset its unwritten fields).

* test(workflow-source): regressions from the long fidelity run

A JSON field forwarded under a hiding operation, a block keyed __proto__, and the
by-design collision-key refusal the fuzz now leaves out.

* fix(cli): workspaces source status and diff refuse a directory holding no workspace source

A mistyped --dir, an empty directory, the wrong working directory (--dir
defaults to .) or a workflow folder read as clean: status exited 0 after a
dry run of no kinds, and diff printed "No local changes.". They now refuse
it with the reason and the get to run, as apply and check do.

* fix(cli): status recommends the get that restores a removed kind folder, not an apply

Removing a managed kind's folder or root file (tables/, secrets.ts) stops
managing the kind: an apply leaves its resources alone. status reported its
recorded files as deleted and recommended apply --yes, which wrote nothing, so
the next status said the same thing again (exit 11 forever) while get refused
to write the files back. When every local change is in such a kind, status now
recommends get --only <folders> --force, which restores them, and says how to
delete the resources instead.

* fix(utils): mapWithConcurrency throws the first failure in time

The shared helper threw the failure of the lowest-numbered slot, so a slow
slot-0 error masked an earlier one from another slot. The apps/sim helper it
replaced (Promise.all) threw the first failure, and the TSDoc still promises
that.

* fix(cli): workspace source commands handle a directory no one may write

Every workspace source command takes the directory's lock by creating
.sim/command.lock, so in a read-only checkout status, diff and apply --dry-run
crashed with a raw EACCES stack trace. Commands that only read (status, diff,
a dry run) now run without the lock there, since nothing can rewrite the
directory; get, check and apply are refused as SOURCE_DIR_UNWRITABLE with the
reason.

* fix(cli): status refuses a broken .sim/written.json instead of calling every file created

A merge conflict that leaves markers in .sim/written.json (two branches that
each applied) made status read every file as created and recommend an apply.
It now refuses with SOURCE_WRITTEN_INVALID and names the get that rewrites the
record. A broken .sim/base.json names its way out too (SOURCE_BASE_INVALID).

* docs(cli): status and diff help name exit 7, and the workflow guide exit 13

status and diff exit 7 when the server refuses the source as too large (413),
as exit-codes.ts documents, but their help listed only 0, 11, 12 and 1. The
workflow directory's .sim/AGENTS.md now names exit 13 (not logged in) as the
workspace guide does. CLI docs regenerated.

* fix(executor): splice already-escaped values into JSON strings as written

Escaping every reference landing inside a JSON string literal fixed values that
broke the JSON (quotes, newlines, stray backslashes), but it also re-escaped
values that were already valid string content. A deployed workflow whose env
var holds a key with literal \n escapes, or that escaped a value in a Function
block to work around the old bug, now sent backslash-n instead of a newline.
Only a value that would break the literal is escaped now; one that is already
valid string content splices raw, exactly as before.

* fix(table): write every row's cancellation when one write fails

cancelWorkflowGroupRuns cancels every row's queued jobs, then writes each row's
cancelled status. The shared mapWithConcurrency starts nothing after a failure,
so one failed write left the later rows of the page 'running' with no job behind
them; the apps/sim helper it replaced still wrote them. The writes now all
settle before the first failure is thrown.

* fix(cli): count a workflow changed only on the server as unchanged in workspace status

The status dry run sends every workflow folder whole to detect drift, so the server plans an
update for a folder edited only in Sim. An apply sends that folder by its base and leaves it
unchanged, so the status plan line said 'Applying would: 1 update' for an apply that changes
nothing.

* fix(cli): an interrupted source command releases the directory lock

Ctrl-C during a workspace source command left .sim/command.lock behind. A
later command takes a lock over only when its owner ran on the same host, so
one left in a folder shared with a dev container or another machine stayed
until removed by hand (exit 10 every time). The lock is now removed on
SIGINT/SIGTERM before the signal ends the process, as a staged write's folder
already is.

* test(workspace-source): a key-claim failure trigger left by a killed run no longer breaks the next one

* fix(e2e): expire the workflow source e2e session in UTC

session.expires_at is a timestamp without a zone that the app reads as UTC. now() writes the
database's local time, so on a Postgres west of UTC the one-hour session was already expired
and the canvas-route check got 401.

* fix(cli): get keeps a directory bound to its workspace when its base does not parse

get decided which workspace a directory belongs to only from a base that
parsed cleanly, so one this CLI refuses (a field a later CLI added, a bad
fingerprint) read as no base: get then used the profile's workspace, and
--workspace naming another one was not refused (SOURCE_OTHER_WORKSPACE). It now
reads workspaceId as leniently as apply and status do.

* fix(cli): print nested source apply results as JSON in text output

`sim workflows source apply --output text` printed the modified blocks as
`modified	[object Object]`.

* test(workflow-code): alternate small and large runs in the growth check so machine load slows both sides

* fix(workspace-source): in-use scan reads the live deployment version

A delete of a resource that a deployed workflow's live version still uses,
while its draft no longer does, now warns W_RESOURCE_IN_USE naming the
live version, unless the same apply publishes the draft or undeploys it.

* fix(workspace-source): class a refused apply by the errors that refuse it

The rejected error counted and classed every error, including those of
changes the plan holds back, which refuse nothing. The plan now returns
the refusing errors (plan-level plus non-held changes) and the error
classes from those.

* fix(workspace-source): a key taken after a committed write reports the write

A key claim that found the key held by another live resource after the
write committed threw, dropping the written resource from applied. write()
now returns it with E_NAME_TAKEN; the apply records it as applied, keeps
the base entry unchanged, and stops so no later write resolves the key to
the other resource.

* test(workspace-source): per-process source slot refuses past its cap with 429

* fix(cli): check table row columns when the row holds a non-string reference

Compiled row data stores a non-string reference bare ("n": <score.value>), which JSON.parse
refuses, so check skipped the whole row: an unknown column or select option in any row writing a
number, boolean or object output went unreported. Parse it as a JSON field instead.

* feat(workflow-code): hint api for http.request and fn for javascript.* builders

An agent guessing the HTTP request block as http.request got E_UNKNOWN_BUILDER with no hint:
no edit distance reaches api.

* docs(workflow-code): correct workspace-key, rows, written.json and create claims; fill agent-guide gaps

- credentials bind with a workspace API key; secrets and deployments do not (guide, CI docs, API description)
- table rows are source when a table opts in; list rows.jsonl and the limits
- .sim/written.json is committed, not gitignored; drop stale tsc sizes; exit 9
- a created-not-yet directory has no base: create --dry-run, not status
- guide: api is the HTTP block, W_* print as error in check, self-hosted apiKey, promote setup

* test(workspace-source): a key-claim failure trigger left by a killed run no longer breaks the next one

* test(workflow-code): alternate small and large runs in the growth check so machine load slows both sides

* test(workflow-code): time the block-cap round trip by thread CPU, so machine load cannot fail it

* fix(workflow-code): never print a credential through the response body form

The response(name, { body, status, headers }) form printed its fields'
stored values verbatim, so a response block holding a detected credential
(an Authorization header, a token in the body) printed the secret into the
file while W_LITERAL_SECRET claimed it printed as stored(). Such a block now
keeps its own params, where the field prints as stored(), and compile warns
W_LITERAL_SECRET when source writes one in the form.

* fix(workflow-code): check agent tool calls the way blocks are checked

compileToolCall accepted any builder as a tool (api.tool, condition.tool,
trigger.gmail.tool.poller), stored any param key unchecked, and never warned
about a literal secret, though print writes these tools as raw(tool) and
warns W_LITERAL_SECRET. A tool call now needs a builder with a tool form
(E_UNKNOWN_BUILDER), each param must be one its tool type declares
(E_UNKNOWN_PARAM with a did-you-mean, W_FIELD_NOT_APPLICABLE for another
operation's), and a literal secret warns as on a block.

SYNTAX.md and core.d.ts no longer document agent.tool() or
runWorkflow.tool(): neither is typed, and print writes such tools as
raw(tool).

* fix(workflow-code): refuse stored() and codeFile() in a loop or parallel config

compileConfig dropped any config value that was not a plain value, so
loop.forEach('L', { collection: stored() }) or a codeFile() condition
compiled silently to a loop with no collection or condition. Both are now
E_UNSUPPORTED_SYNTAX with the form to write instead.

* fix(workflow-code): give every compile finding a hint that names its fix

E_TARGET_TRIGGER, E_ERROR_PORT_UNSUPPORTED (a loop or parallel has none:
wire onError from its children), E_UNKNOWN_BRANCH in meta.branches (lists
the branches), W_VALUE_KIND (the literal form the field takes) and
E_UNKNOWN_IDENTIFIER for undefined, NaN and Infinity had no hint. The test
catalog's loop and parallel now have no error port, like the real catalog.

* fix(table): keep batch rows that keep a unique value in the DB check

batchUpdateRows excluded every batch row from each unique column's DB check and
compared the rest by the values it read before taking the value locks. A row the
batch leaves alone could take the value from a concurrent edit after that read,
so both it and the batch's writer stored the same unique value. Each column's DB
check now skips only the batch rows that rewrite that column.

* docs(tables): say add-column refuses a required column rows leave empty

* fix(cli): Ctrl-C during an apply write names what it may have done

An interrupt while the apply request was in flight exited 130 silently, so
nobody learned the write may have landed. The lock's interrupt handler (which
already releases the lock) now prints the same next step a lost answer gets,
then ends with the signal.

* fix(cli): a status without a login recommends sim login

With no login on the profile, status shows the local view (the server is
treated as unreachable) and its note says to log in, but next was
apply --dry-run, which only exits 13. next is now the login, then status again,
for workflows and workspaces alike.

* fix(cli): check offline with no cached catalog names the get that caches it

A fresh clone checked while the server could not be reached failed with the
raw "Could not reach …" and no next step. It is now CATALOG_NOT_CACHED (exit
1) naming sim workspaces source get, as a check with no credentials already
is; no login keeps its AUTH_REQUIRED refusal (exit 13, naming sim login).

* fix(workflow-code): keep meta.retry within the bounds the loader pins it to

Persistence saves a retry policy verbatim but loads it clamped (2-5 tries,
0-5000 ms, whole numbers), and canonicalize kept a well-formed policy raw.
A file writing maxTries: 10 stored 10, read back as 5, and every re-apply
of the unchanged file showed a retry change. Compile now refuses an
out-of-range policy with a hint naming the bounds, and canonicalize pins
the numbers as the loader does, so a printed policy always compiles back
unchanged.

* Revert "fix(workflow-types): hold a container's edges to the handle they leave from"

This reverts commit 62872bd29b.

* chore: regenerate the OpenAPI spec and MCP operations for the workspace-key description

* docs(cli): document exit 13 (AUTH_REQUIRED), exit 9 and the 429 resend policy

Both exited 1 before this branch. State which requests are resent (every GET and the
all-or-nothing source writes), the 6-retry count and the one-minute wait cap, in the
scripting exit-code section, troubleshooting, the CLI reference preamble, the README and the
source agent guides.

* fix(workspace-source): managed table rows guard a delete and a column renamed on the server

An --allow-delete of an undeclared managed table whose rows were written
since the base deleted those unseen edits; it is now E_APPLY_STALE. A rows
edit on a table whose declaration is unchanged while the server renamed or
removed one of its columns wrote the cells by names the table no longer
has, silently dropping them; it is now E_APPLY_STALE.

* fix(workspace-source): a stored() tool or MCP server deleted on the server stays deleted

An unchanged directory whose tool code or MCP header is stored() was
refused (E_APPLY_STALE / E_TOOL_STORED_MISSING / E_MCP_STORED_MISSING)
once the resource was deleted on the server, blocking every other kind.
It now reads as I_SERVER_DELETED like any other deleted resource.

* docs(workflow-sdk): document a child workflow's output shape

runWorkflow's result is the child's first response block output ({ data, status, headers }),
else its last block's output, so a response body field is result.data.field; a deployed parent
runs the child's deployed version. Stated in INDEX.md's How it runs, the runWorkflow TSDoc, the
agents example and the agent guide.

* fix(workflow-code): round-trip stored container edges source cannot draw

Stored workflows hold container edges the canvas never draws: a loop or
parallel start edge to a block outside it (the editing engine keeps one when it
extracts a block, and the executor runs it as the container's exit), an end edge
into the container's own child, and an error edge from a container. Source
printed the first two through p.to()/x.to() and every one through onError, and
compile refused them (E_EDGE_SCOPE, E_ERROR_PORT_UNSUPPORTED), so such a workflow
could not apply its own source back.

The printer now writes a mismatched container edge as edge() with its stored
handle, compiled with W_SUBFLOW_HANDLE_SCOPE (the warning names the exit form),
and compile keeps an error edge from a block with no error port when the stored
workflow holds it (W_ERROR_PORT_STORED). The corpus gains both edge shapes.

* fix(editing): keep a stored error edge the engine no longer adds

Since the engine refuses new error edges from loops and parallels, an edit that
re-sends a container's connections dropped the error edge it already stored.
Error edges the graph held before the batch are kept; only new ones are
refused.

* test(workflow-source): stored mismatched container edges survive every write path

The extract and move-into-loop regressions now assert the engine keeps the
edge and source round-trips it; a stored container error edge survives an
engine edit that re-sends its connections; and an integration check writes a
loop start edge to an outside block through PUT /state, edits through the
engine, and applies the source back unchanged.

* fix(workspace-source): type the in-use scan rows for the query builder

* fix(tables): accept a required column on a table with rows again outside workspace source

facb1c4f4d made every surface refuse adding a required column that existing rows
leave empty, which turned a call third-party integrations make on the v1 and v2
table APIs into a 400. The refusal is now an addTableColumn option only
workspace-source apply sets, so its plan and apply agree while the table APIs,
Copilot and undo keep staging's behaviour. Restores staging's undo hook,
OpenAPI description and contract comment.

* fix: attempt every independent side effect of a fan-out after one fails

The shared mapWithConcurrency starts nothing after a failure, where the apps/sim
helper it replaced kept starting the rest. For fan-outs of independent side
effects that left Slack targets undispatched, tombstones and cancellation
writes unwritten, stale-dispatch cancel events unsent, project file retirements
and chat image sweeps unrun. mapEachWithConcurrency attempts every item, then
throws the first failure; those callers use it.

* chore(e2e): name the workspace source e2e report variable like its siblings

WORKSPACE_SOURCE_REPORT_PATH becomes WORKSPACE_SOURCE_E2E_REPORT_PATH, matching every other
source e2e's <SUITE>_E2E_* variables; the CI http-e2e script passes the new name.

* feat(workflow-code): warn on a condition or router branch no edge leaves

W_BRANCH_UNWIRED names the branch and the wiring that fixes it. A branch the stored workflow
already leaves unwired is not reported, and check fails on it only for a block the lock does not
bind, so existing workflows keep checking clean.

* fix(workflow-code): read a Start block's untouched blank input row as no fields

Every new workflow's Start block is seeded with one unnamed string field, which execution skips,
so `get` on a fresh workflow printed `inputFormat: { '': 'string' }`. A list holding only that
starter field now canonicalizes as empty and prints `inputFormat: {}`; an unchanged apply keeps
the stored field byte for byte, and a blank field beside named ones still prints as stored.

* fix(workflow-source): fingerprint a stored workflow the same for every reader

The sf1 fingerprint hashed the reader's canonical model, which names a
credential the reader may see by key and one they may not see by id, so a
member applying source a teammate read got a false 409. It now hashes every
credential by its stored id. A credential key the reader cannot resolve,
standing where the stored workflow holds a credential they cannot see, keeps
the stored credential whatever the key (W_APPLY_CREDENTIAL_KEPT), so an
unchanged or edited teammate source applies without confirming any key.

* fix(workflow-source): refuse workflow names and descriptions v2 refuses

Source could set an empty or whitespace name, a name over 255 characters or
a description over 50,000, which v2 create and update refuse. The plan now
refuses the fields a write sets with E_WORKFLOW_META_INVALID at the header,
reading the limits from the v2 workflow contract.

* fix(workspace-source): keep unkeyed managed rows out of source, and check required fills at plan

A row the table grid's "add row" makes has an empty key cell, so a get printed it as a line the
apply refuses (E_TABLE_ROWS): get -> apply of an unchanged directory failed. Such a row has nothing
a line can match it by, so it is no longer managed: a get leaves it out of the rows file with
I_TABLE_ROWS_UNKEYED, neither rows fingerprint counts it, and the keyed write never removes it.

Making a column required trusted the declared rows to fill it even when no rows write was planned,
so a row added in the UI made the apply fail mid-reshape. The declared rows now stand for the
table only when a managed rows write is planned, and the rows that write keeps (unkeyed ones) are
checked too.

* fix(workspace-source): compare managed rows with the base under the key it recorded

Changing a managed table's rows key and editing a row in one apply was a false E_APPLY_STALE: the
server's rows were fingerprinted under the new key and compared with a base fingerprinted under
the old one. The staleness check now reads the server under the key the table is still marked by.

* fix(workspace-source): a reader's concealed MCP get applies back unchanged

A get by a member who may not rewrite headers prints every literal header value as stored(); the
plan resolved each stored() to a keyed hash, while a value that is not a credential prints (and
fingerprints) as its text, so a writer applying that directory unchanged always planned a header
update. stored() now resolves to the value as a get prints it.

* fix(workflow-source): answer a racing source rename with SOURCE_NAME_TAKEN

Two source renames onto one name in one folder both passed the name SELECT;
the second hit the unique index and answered 500. The commit now maps that
unique violation to WorkflowSourceNameTakenError, and the apply route answers
it, like the create route, with 409 SOURCE_NAME_TAKEN.

* fix(workspace-source): an unchanged file the server can no longer hand to source is a no-op

A declared file edited past the blob cap in the Files tab, or one an older file moved beside it
now takes the path of by letter case, refused the whole apply of an unchanged directory
(E_FILE_TOO_LARGE / E_FILE_PATH_COLLISION). Unchanged since the get that read it, the declaration
now leaves the file as the server has it (I_SERVER_CHANGED); a directory that changes it is still
refused.

* fix(workflow-source): report a dry run's needsRedeployment for the draft it would write

A dry run answered needsRedeployment for the draft as stored, so an edit of a
draft in step with its deployment said false and a revert said true. A dry run
that would change the draft now compares the draft it would write with the
active deployment; a no-op or refused dry run still reports the stored draft.

* fix(workflow-source): record no refused apply for a plan-only evaluation

A workspace plan or dry run evaluates each workflow planOnly, so planning a
locked workflow recorded workflow_source_applied ok:false although nothing was
applied. A planOnly run records nothing; the commit that follows records its
own outcome.

* fix(workspace-source): a knowledge document replace that stops partway resumes without losing tags

A replace uploaded the replacement under the document's own name, then carried the old one's tags
and deleted it. Stopped after the upload, the next apply deleted the old document without
carrying its tags; stopped and then edited again, the two same-named documents read as a server
change (E_APPLY_STALE) until deduplicated by hand, since nothing told the replacement from a
document uploaded twice in the UI.

The replacement is now uploaded under a name that names the old document, takes its tags, the old
one is deleted, and the replacement is renamed. The next apply finishes a stopped replace whose
replacement holds the declared bytes (tags carried, old deleted, renamed), or removes the
replacement and replaces again; a replacement left before its rename stands for its name. The
duplicate-by-hash rule this replaces is gone: an unmarked duplicate is ambiguous, as any other.

* test(workflow-code): compare n with 8n in the growth check, so allocation noise on a slow runner stays far from the quadratic bound

* fix(workflow-source): never keep a hidden credential over a key the apply binds

A credential key the enclosing workspace apply binds in the same run is not an
unknown key, so it resolves to that credential rather than keeping the stored
one.

* test(workflow-code): read and write input-format rows through their real shape in the API-built round trip

* fix(workflow-code): keep a hidden credential on a block the source renames

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.

* fix(sim-cli): offline check passes stored container error edges, cycles 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.

* fix(serializer): never evaluate a viewer-scoped default on the server

* fix(sim-cli): keep a downloaded workflow's stored inputs typed in workspace.d.ts

* fix(sim-cli): exit 13 when the server refuses a stored login's refresh token

* fix(workflow-code): offline check binds a block renamed in source through 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.

* fix(sim-cli): regenerate workspace.d.ts from local workflow inputs on 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.

* fix(workflows): refuse new edge cycles in the editing engine as edge_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.

* fix(workflow-code): declare lock and base as type aliases so they fit the open generated API types

* feat(mothership): sync the workflow-code entitlement into the generated protocol

* test(workflow-source): stamp updatedAt on direct block writes so a migrate-on-read save cannot undo them
2026-11-19 12:51:01 -08:00
Waleed 77ce46129a fix(resume): capture pause block names and keep the resume page off the execution snapshot (#10104)
* fix(resume): stop shipping the execution snapshot to the resume page

* improvement(resume): capture pause block names at pause time and keep display reads off the snapshot
2026-11-16 17:44:28 -08:00
Waleed d87daa7103 fix(api): report a finished run's real status once its pauses have settled; show the request id in the CLI (#9924)
* fix(cli): show the server's request id on API errors

* fix(api): report a finished run's status once none of its pauses can be resumed

* fix(cli): keep the request id on every error built from a response

* fix(cli): read an internal route's request id beside the error
2026-11-11 21:25:53 -08:00
Waleed 222ba079f9 fix(api): attribute a polled run's failure only to the block that caused it (#9916)
* fix(api): attribute a polled run's failure only to the block that caused it

A run's stored error was paired with any failed block in its trace when the
message classified as a generic failure, so a run-level fault or a branch that
failed after the settling error reported an unrelated block. The trace read now
names a block only when its name heads the run error or its recorded error is
exactly it, which keeps unprefixed loop and parallel failures attributed.

* fix(cli-auth): say when a requested key never expires
2026-11-11 16:47:28 -08:00
Waleed f947d95a8f feat(credentials): audit fixes and non-OAuth auth for CrowdStrike, Datadog, Gong, PlanetScale, SailPoint, ServiceNow, Zendesk, ZoomInfo, Shopify, Atlassian, Linear and Twilio (#9911)
* fix(credentials): accept permission-scoped AgentMail keys at connect

A valid AgentMail key that lacks inbox_read or is scoped to a pod or inbox
gets a 403 coded missing_permission or forbidden on the inbox listing, and
was refused as invalid. Accept a coded 403 as proof of the key, and keep
rejecting the gateway's bare Forbidden and the key-naming 401 codes.

* fix(credentials): offer Atlassian API tokens for the Bitbucket saved credential

Bitbucket takes an Atlassian API token created for Bitbucket as a Bearer
token, so the existing repository read already verifies one. Say so in the
connect copy and setup guide, and note that app passwords no longer work.

* fix(credentials): ask for a reconnect when a Microsoft app certificate can no longer sign

An expired or unreadable stored certificate failed before any request reached
Entra, carried no status, and was reported at run time as the provider being
temporarily unavailable (502). Local configuration failures now classify as
invalid_credentials, and only an unreachable Entra keeps provider_unavailable.
Saving also refuses a certificate that is not valid yet.

* fix(credentials): warn that saved Infisical access tokens expire

Sim stores the machine identity access token as pasted and never renews
it, so it stops at its Access Token TTL (30 days by default). Tell users
to set a long TTL and Max TTL, and not an Access Token Period, which needs
renewal each period.

* fix(credentials): retry keyless Microsoft token requests while a federated credential propagates

Entra can refuse a new federated identity credential with AADSTS70021 for
several minutes after it is added, even after a token was issued, and
Microsoft asks callers to retry. A run now retries that refusal (and
AADSTS700213) twice with jittered backoff before reporting it; the save-time
subject-pin probe, which expects the refusal, is unchanged.

* fix(infisical): keep the instance URL out of the model's reach and normalize it like a saved credential

The legacy Infisical tools let the model set baseUrl, so a prompt-injected
agent call could send the inline Infisical token to any public host. baseUrl
is now user-only (matching Grafana and Upstash), and inline instance URLs go
through the same normalizer the saved-credential validator stores, which moves
from the validator module into input-validation so tools can share it.

* feat(credentials): accept HubSpot service keys for the saved HubSpot credential

HubSpot stopped new legacy private apps on October 26, 2026 and points
direct integrations at service keys, which are Bearer tokens for the same
REST APIs. The connect copy now asks for a service key or an existing
private app token. The token-info route covers only private apps, so a
non-transient refusal there defers to the Account Information API, and that
fallback accepts a 403 only with a JSON body, so a firewall page never
passes as a live token. Both checks refuse redirects.

* feat(credentials): accept Microsoft app credentials for Intune

Every Intune operation the block offers (managed devices, detected apps,
compliance policies and their device statuses, device configurations, and the
sync, restart, remote lock, and retire actions) documents application
permissions in Microsoft Graph v1.0, so the Intune picker now lists Microsoft
app credentials and the resolver mints a Graph token for them. OAuth Intune
connections are unchanged. The setup docs name the application permissions
each operation needs.

* fix(credentials): refuse rotating Slack tokens for custom bot credentials

A Slack app with token rotation on issues xoxe.-prefixed tokens that expire
in 12 hours and can only be refreshed with the app's client ID and secret,
which Sim never holds. Such a token passed auth.test at connect and failed
every run after. Refuse xoxe tokens up front with a message that asks for
the xoxb- token of an app with rotation off.

* docs(credentials): correct the Devin key check comment to match Devin's docs

Devin documents 401 for an invalid key and one 403 for both a key outside
the organization and a key without ViewOrgSessions. Behavior is unchanged:
nothing documented separates the two 403s, so a 403 still rejects.

* fix(credentials): refuse redirects in every per-vendor saved-key check

The shared token-check engine already refuses redirects, but the per-vendor
validators followed them. Fetch keeps custom headers such as x-api-key and
X-Shopify-Access-Token on a cross-origin redirect, so a redirected check
would hand the key to another host. Every per-vendor check now refuses a
redirect, which surfaces as the provider being unavailable.

* fix(credentials): treat a Webflow token that reaches no site as the user's error

GET /v2/sites lists every site the token can access, so an empty list is a
token the user must replace, not a retryable outage. A token that reaches
several sites is no longer pinned to whichever site the list returns first.

* feat(credentials): pick and connect Google service accounts for Vertex AI

The Vertex AI runtime already resolves Google service account credentials,
keyless or JSON key, but the Google Cloud Account picker on model blocks only
listed OAuth accounts, so a saved service account could be used only by
pasting its ID in advanced mode. Vertex AI now names google-service-account
as its service-account provider, and its picker lists both kinds with a
connect action for each, so the keyless option is offered for Vertex.
Existing OAuth selections and the advanced credential ID field are unchanged.

* fix(copilot): let Copilot pass a saved credential to hybrid tools

Copilot's integration schema only offered credentialId for tools that require
OAuth, so a tool that takes an inline key or an optional saved credential always
demanded the inline secret and the gateway never forwarded a saved credential.
On the copilot surface those tools now declare an optional credentialId and stop
requiring the params a saved credential supplies; the workflow surface and
OAuth-required tools are unchanged. The executor now rejects a Copilot call to
such a tool that sends neither, instead of calling the provider without a key.

* fix(credentials): report a NerdGraph error answer as New Relic being unavailable

New Relic refuses an unknown or wrong-region User key with a 401, so a 200
whose errors array left the fixed actor query unanswered is NerdGraph
failing, not a verdict on the key. Report it as provider_unavailable
instead of telling the user their key is wrong. A 200 with no user and no
errors still rejects.

* fix(aws): refuse S3 presigned URLs that outlive the saved role session signing them

A presigned URL signed with STS credentials stops working when the role session
ends, whatever expiry it asks for, but the S3 tool reported the requested expiry.
Resolved sessions now carry the STS expiration, and presigning with a saved
assume_role or oidc_role credential refuses an expiry past the session's end
with a 400 that names the remaining time and the session duration. Long-lived
access keys and inline keys are unchanged.

* fix(guardrails): resolve the hallucination check's Vertex credential like every other model call

The hallucination check looked the Vertex credential up as a raw account ID,
so a saved credential (whose ID is a credential row, OAuth or Google service
account) resolved no token and the scoring call ran without one. It now uses
the shared Vertex resolver, which handles credential rows, Google service
accounts, and the legacy account IDs the old lookup accepted, and fails the
check instead of calling the model when the credential cannot be resolved.

* fix(aws): report transient STS failures on a saved credential as 503, not a denial

Every failure to resolve a saved AWS credential came back as a 403, so an STS
outage, throttling, or STS failing to reach Sim's OIDC issuer (IDPCommunicationError)
read as a permission problem and was never retried. Failures STS models as
retryable, throttling, STS 5xx, and network errors now return 503; real denials
(AccessDenied, invalid or expired identity tokens, rejected claims) stay 403.
No extra retry loop is added: the pinned STS client already retries
IDPCommunicationError and throttling up to three times with backoff.

* fix(databricks): report an unreachable workspace at token mint as provider_unavailable

A connection failure, timeout, or refused redirect while minting a run's
Databricks token escaped as a raw fetch error, which the executor reported as a
generic 401 and whose cause can carry connection details. It is now a 502
DatabricksCredentialError, which resolves to provider_unavailable; a cancelled
run still rethrows its abort, and personal access tokens are unaffected.

* feat(credentials): connect Shopify Dev Dashboard apps with client credentials

Shopify Dev Dashboard apps never reveal an Admin API token, so the Shopify
saved credential gains a client-credentials mode beside the pasted shpat_
token. A credential saved with authMethod client_credentials stores the
client ID, secret, and store domain; execution mints the 24-hour token at
the store's /admin/oauth/access_token endpoint.

Shopify does not document whether a new token retires earlier ones, so
every saved credential for one app and store shares a single token kept
under an advisory lock in client_credential_token, instead of minting per
worker. shop_not_permitted surfaces as grant_not_permitted with copy that
names the same-organization requirement.

Pasted-token credentials, their blob, and their resolution are unchanged;
the minted-token cache in the credential service is factored out so the
client-credential providers and this mode share it.

* fix(credentials): keep keyless off when a pinned workload identity issuer has an unserved path

Sim serves workload identity discovery and keys only under /oidc/workload, and
clouds fetch <issuer>/.well-known/openid-configuration, so a WORKLOAD_IDENTITY_ISSUER
with any other path advertised keyless credentials that no cloud could verify. A
pinned issuer must now have the /oidc/workload path (its host may differ), or
keyless stays off with a log line naming the requirement. The default issuer
derived from the app URL is unchanged, and the self-hosting and AWS credential
docs state the requirement.

* feat(credentials): saved CrowdStrike API client credential and credential-only block

A CrowdStrike credential holds a Falcon API client id and secret, the cloud
(from the existing Falcon cloud allowlist), and an optional MSSP member CID.
The minter posts them to the cloud's /oauth2/token with redirects refused and
returns the token with its expires_in lifetime (30 minutes when unusable)
and the cloud, which the credential cache keys by credential id and secret
fingerprint, so changing the cloud or secret re-mints.

- clientCredentialOAuth: a policy for tools that mint their own token from
  inline client credentials. The credential fills the hidden accessToken and
  the region param; tokenReplacesParams names the inline secrets the token
  replaces, and the saved-credential contract check accepts exactly those.
- crowdstrike_v2 is the credential-only successor; the legacy block keeps
  its inline client id, secret, and cloud and is hidden from the toolbar.
- The operation uses a credential's token as is. Inline credentials now
  reuse a cached token (keyed by cloud, client id, and secret hash) until a
  minute before it expires, and a 401 drops it so the next run re-mints.
- Client-credential mints can bind a domain (the cloud), carried through
  the token cache to tools.

* fix(credentials): accept only documented scoped-key answers from AgentMail and New Relic

AgentMail now proves a key only on the two 403 codes its docs give for a
valid key with the wrong scope (missing_permission, forbidden); a suspended
account, a gateway deny, and any other refusal reject the key.

New Relic reports an outage only for NerdGraph errors in the server classes
its own client retries; BAD_API_KEY and unclassified errors reject the key.

* fix(credentials): settle HubSpot service keys on the account-info route

A token-info 200 without a portal now falls back to account-info instead of
failing as an outage, and a token-info 401 falls back only for pat- keys, so
other tokens keep being rejected there as before. The vendor-JSON 403 check
moves to one shared helper.

* docs(credentials): align HubSpot, Infisical, and Bitbucket saved-key copy with vendor docs

* feat(credentials): saved Zendesk credentials with client credentials or an API token

Zendesk gets a zendesk-service-account credential with two sign-ins: a
confidential OAuth client exchanged through the client-credentials grant
(POST /oauth/tokens, JSON, an explicit read or read write scope, a one-hour
expires_in), or an agent email and API token sent as the documented
email/token Basic credential. The subdomain is normalized and must match
^[a-z0-9][a-z0-9-]*$ before any request, and connecting requires
users/me to answer with a real (non-anonymous) agent or admin.

The credential resolves to its token, its subdomain as domain, and
authStyle basic for the API-token sign-in. zendesk_v2 is the
credential-only successor; every Zendesk tool reads the token through one
header helper and takes its subdomain from the credential. The legacy
zendesk block and its inline email, API token, and subdomain keep signing
in exactly as before.

* feat(credentials): PlanetScale saved service token credential

A PlanetScale credential holds a service token and its ID, verified by
listing the organizations the token reaches with the same ID:token
Authorization the tools send; a JSON 403 is a valid token without that
read. Every PlanetScale tool accepts it, the selectors gain saved-credential
twins that read the pair from the credential, and planetscale_v2 is the
credential-only successor. The legacy block keeps its inline inputs.

* feat(credentials): Gong saved access key credential

A Gong credential holds an access key and its secret, verified by listing
workspaces on api.gong.io with the Basic key:secret the tools send. Gong
documents its 403 for this read without telling a bad key from a missing
permission, so any refusal rejects. Every Gong tool accepts the credential
and gong_v2 is the credential-only successor; the legacy block keeps its
inline inputs.

* feat(credentials): ServiceNow saved username and password credential

A ServiceNow credential holds an instance, a username, and its password,
verified by reading one user id from the Table API with the Basic auth the
tools send. The instance is reduced to the https origin of a
ServiceNow-owned host before anything is sent, and the check goes through
the guarded egress; 401 rejects, a JSON 403 is a login its ACLs limit, and
only a Table API result list proves the login. Every ServiceNow tool
accepts the credential, servicenow_v3 is the credential-only successor, and
servicenow and servicenow_v2 keep their inline inputs as legacy blocks.

* feat(credentials): Twilio API key mode for the saved Twilio credential

The Twilio credential and every Twilio tool now also take an API key, as
the key SID and secret joined by a colon (SKxxx:secret), the exact Basic
username and password Twilio documents for a key, while the URL keeps the
Account SID. A key is verified by listing one of the account's phone
numbers, a read a Standard key may make, since only Main keys and auth
tokens may read the Accounts resource. Stored auth-token credentials and
inline auth tokens keep their shape and their account-resource check; a
value with a colon that is not a key pair is refused before any request.

* fix(credentials): retry only the documented Entra propagation refusal, within the shared mint deadline

AADSTS700213 is Microsoft's documented case-sensitive federated credential
mismatch, not a propagation refusal, so a mismatched keyless credential no
longer makes three token requests per run. The AADSTS70021 retries now stop
when a slow answer would push the run past the 30 s deadline that concurrent
runs sharing the mint wait for. The Microsoft app service list is declared
once for both its type and the resolver's check, and the Intune and Vertex
copy names the app credential and the Google service account.

* feat(credentials): Atlassian service-account OAuth 2.0 credentials

An Atlassian service account can now connect with its OAuth 2.0
credential (client ID and secret) as well as a scoped API token. Saved
with authMethod client_credentials, the credential stores the client
credentials, the site, its cloudId from tenant_info, and the product;
execution mints a 60-minute token at auth.atlassian.com with the client
credentials grant and calls api.atlassian.com/ex/{product}/{cloudId}
exactly as a scoped token does. Connecting proves the minted token
against the product's current-user endpoint.

Atlassian documents these credentials for Jira and Confluence only, so
other products are refused. It does not say whether a new token retires
earlier ones, so every saved credential for one OAuth client shares one
coordinated token. Scoped-token credentials, their blob, and their
resolution are unchanged; the identity request now refuses redirects.

* feat(credentials): saved Datadog API and application key credential and credential-only block

A Datadog credential holds the site (from the DATADOG_SITES allowlist), the
API key, and the application key. Datadog authenticates every request with
the two static headers, so the "mint" resolves the API key as the token, the
application key beside it, and the site as the credential's domain.

- Save verifies the API key with GET https://api.{site}/api/v1/validate,
  sending DD-API-KEY alone, redirects refused: 403 is invalid_credentials,
  and a 200 must report valid: true. The application key is not probed:
  Datadog publishes no reference for an application-key check, and any other
  read would reject a correctly scoped key with a permission 403. Keys with
  control characters or whitespace are refused before any request.
- Credential resolution carries a new applicationKey field (credential
  cache, token payload contract, executor credentialParams source), and the
  Assistant registers it as a resolved secret beside the token.
- Every Datadog tool takes the saved credential: the credential fills apiKey,
  applicationKey (where the tool sends it), and site, overriding caller values.
- datadog_v2 is the credential-only successor; the legacy block keeps its
  inline keys and site and is hidden from the toolbar. withSavedCredential
  accepts condition: null for a picker shown in every operation when the
  replaced fields show differently.

* fix(aws): bound S3 presigned URLs by the role session's duration, not its time left

The presign guard compared the requested expiry with the seconds left before the
STS session ended, floored. A session is minted for each call, so by the time the
guard runs the STS round trip has used part of it and a default 3600s session
reports 3599s left, which refused the default 3600s expiry for every saved
assume_role or oidc_role credential on default settings.

Resolved sessions now carry the duration Sim requested from STS, and the guard
refuses only an expiry longer than that duration. The reported expiresAt is
clamped to the session's end, so it is never later than the time the URL stops
working. The session lookup that the signer and the guard share is one helper.

* fix(aws): classify wrapped STS socket failures as transient with the shared network-error helper

isTransientAwsFailure kept its own list of socket codes and checked only the top-level code, so a socket failure the SDK request handler wrapped in a cause, or an undici code, was reported as a 403 denial instead of a 503. It now uses isRetryableNetworkError, which walks the cause chain and errno.

* feat(credentials): connect Linear OAuth apps with client credentials

The Linear saved credential gains a client-credentials mode beside the
personal API key. Saved with authMethod client_credentials, it stores the
app's client ID and secret and mints an app-actor token at
api.linear.app/oauth/token with the fixed scope read,write, so two
credentials for one app never request different scopes (which Linear
treats as replacing the app's tokens). Linear documents that tokens with
the same scopes coexist, so each worker caches its own, and a token is
reused for at most an hour so one revoked early is replaced quickly.

A client-credentials token acts as the app, so connecting falls back to
the workspace (organization.id) as the principal when Linear returns no
viewer. The connect copy warns that requesting a token replaces an
existing authorization-code installation of the app and that rotating
the secret invalidates its tokens. Personal API keys and Linear OAuth
credentials are unchanged.

* fix(credentials): warn instead of turning keyless off for a pinned issuer on another path

Refusing a pinned WORKLOAD_IDENTITY_ISSUER whose path was not exactly
/oidc/workload turned keyless off on upgrade for a deployment that routes a
different issuer path to Sim through a proxy, and it also refused pinning the
default issuer of a path-prefixed app URL, which the default itself accepts.
Trust policies name the issuer, so those operators could only recover by
recreating the identity provider and every trust policy.

A pinned issuer whose path ends in /oidc/workload is now accepted the same way
the default is. Any other path logs a warning that clouds can verify its tokens
only if a proxy routes it to /oidc/workload; saving a keyless credential still
proves the route end to end. The https, port, query, and fragment refusals are
unchanged, and the docs describe the rule.

* fix(copilot): exempt a hybrid tool's key only when the hosted key applies to the call

The Copilot credential check waived a hybrid tool's hosted key param whenever the deployment was hosted, but injectHostedKeyIfNeeded skips the hosted key when the tool's hosting.enabled predicate rejects the params, so such a call could reach the provider with neither a key nor a saved credential. Both now use one hostedKeyMayFill predicate. No hybrid tool declares hosting today, so this is latent.

* fix(databricks): stop repeating 'Try again' when the save-time probe cannot reach the workspace

The unreachable-workspace error ended in 'Try again.', and the federation-policy check that wraps it adds its own, so a save showed 'Try again. Try again.'. The low-level message now only names the failure.

* fix(credentials): refuse redirects by default in fetchProvider

Every fetchProvider caller sends a secret, and fetch replays custom headers
and 307/308 bodies to whatever host a redirect names. Default the helper to
redirect: 'error' so validators and client-credential mints inherit it, and
drop the per-call copies this branch had added.

* fix(credentials): settle a HubSpot key account-info refuses with a contacts read

HubSpot documents service keys only against its CRM REST routes, not the
token-info or account-info routes. When account-info answers 401, confirm
on a one-contact read, where a 200 or JSON 403 proves the key is live and a
401 rejects it.

* test(security): move the typed base URL normalizer test next to input-validation

normalizeHttpBaseUrl and refuseUnsafeTypedUrl moved from the token validator module into input-validation; their test now lives with them.

* feat(credentials): saved SailPoint API client credential and credential-only block

A SailPoint credential holds a tenant plus an API client or personal access
token client id and secret. The minter shares the legacy block's token
exchange (now requestSailPointToken in lib/internal/sailpoint/client: the
client_credentials grant at the tenant's /oauth/token, redirects refused,
bounded 429 retries, and a SailPointAuthError carrying the status), so 4xx
maps to invalid_credentials and 5xx, throttling, or network failures to
provider_unavailable. The token lifetime comes from expires_in.

- The tenant is normalized to {tenant}.api.identitynow.com, the host
  SailPoint documents for API and token calls, from a tenant name, the API
  host, or the tenant's UI URL. Anything else (other domains, credentials,
  ports, more than one tenant label) is refused before the secret is sent.
  The legacy block's inline tenants, including identitynowgov.com hosts,
  are unchanged.
- The credential fills the hidden accessToken and the tenant (its API host);
  the operation sends that token as is and never re-mints it on a 401.
  Inline credentials keep their cached token and single 401 refresh.
- sailpoint_v2 is the credential-only successor; the legacy block keeps its
  inline tenant, client id, and secret and is hidden from the toolbar.

* feat(credentials): saved ZoomInfo client credentials and credential-only block

A ZoomInfo credential holds a client credentials app's client id and secret.
The tools already authenticate with that grant (Basic auth at
api.zoominfo.com/gtm/oauth/v1/token), so the minter shares the legacy
block's exchange, now requestZoomInfoToken: a refusal throws
ZoomInfoTokenError, which the operation answers exactly as before (HTTP 500
naming the provider status) and the minter maps to invalid_credentials for a
4xx or provider_unavailable for throttling, 5xx, or network failures.

- Save verifies by minting a token only; the token endpoint uses no credits
  and no data endpoint is called. Granted scopes are recorded as metadata.
- A client id with a colon or control characters is refused before any
  request, since it would corrupt the Basic credential.
- The token exchange and API calls refuse redirects (maxRedirects: 0); both
  go only to the fixed api.zoominfo.com host.
- The credential fills the tools' hidden accessToken, which replaces the
  inline client id and secret; zoominfo_v2 is the credential-only successor,
  and the legacy block keeps its inline credentials and is hidden from the
  toolbar. Search filters named like hosts are recorded as request data in
  the saved-credential contract check.

* refactor(gong): share one Basic auth header builder between the tools and the credential check

* fix(credentials): stop accepting an undocumented PlanetScale 403 as proof of a service token

PlanetScale documents 401 for a bad token and 404 for missing access, but gives no meaning to a 403 from listing organizations, so a JSON 403 now rejects like any other refusal. The token ID is checked in the account-id normalizer with the same printable, colon-free rule the tools' header builder applies.

* test(credentials): prove refused saved-credential hosts never reach the guarded egress fetch

The steer cases asserted only on the global fetch stub, but ServiceNow sends through the guarded egress transport, so its 'before sending the key' half never ran. Both transports now answer, so only the refusal can keep the key unsent.

* fix(credentials): tell ServiceNow and Gong users which hosts the saved credential supports

ServiceNow custom URLs are aliases of the instance's original service-now.com address, so the help text points custom-URL tenants there; on-premises instances are named as unsupported. Gong's help text names the fixed api.gong.io host the tools call.

* docs(credentials): document the in-band Twilio API key form and hint a half-entered key pair

The saved Twilio credential keeps an API key in the auth-token field as SKxxx:secret, Twilio's documented Basic username and password for a key. The provider id now records that choice and warns that a consumer needing the account auth token itself, such as webhook signature validation, must refuse a key pair. The connect form shows a hint while an SK value is not a complete SID:secret pair.

* fix(credentials): share the CrowdStrike token exchange and report a wrong Falcon cloud

- Legacy inline tokens are also dropped on a 403, so a scope granted after a
  failed run applies on the next one, as it did before tokens were cached.
- The saved-credential minter and the legacy path call one exchange,
  requestCrowdStrikeToken; the legacy path keeps following redirects.
- The minter never follows a redirect and reports one as invalid_credentials
  naming the API client's cloud from X-Cs-Region, instead of a provider outage.
- Drop the unused instanceUrl param and cap a saved-credential accessToken.

* fix(credentials): expire shared client-credentials tokens the provider rejects

A token served from the shared client_credential_token row was never expired
early, so a Shopify or Atlassian token revoked before its stated expiry kept
being served, and reconnecting with the same secret got the same dead token.

- invalidateCoordinatedClientToken expires exactly the rejected token
- saving or reconnecting re-mints once when the provider rejects the served token
- a 401 from a tool call on a service-account credential expires the token
- expired failure memos are swept by the shared coordinator, which Vanta now reuses
- drop the Atlassian product check that could never refuse anything

* fix(credentials): report a mistyped SailPoint tenant as not found and share site lists

- A SailPoint tenant host that does not resolve (ENOTFOUND) is site_not_found,
  not a provider outage; a transient resolver failure stays provider_unavailable.
- The tenant normalizer refuses `api`, SailPoint's own API domain, in every
  input form instead of minting at api.api.identitynow.com.
- Datadog site labels and the isDatadogSite guard live once in tools/datadog and
  serve the block, the connect modal, and the minter; CrowdStrike cloud labels
  derive from the cloud ids.

* fix(credentials): drop the unverified ZoomInfo token-credits claim and cap saved tokens

ZoomInfo's client-credentials docs do not say whether a token request uses
credits, so the docs and comments describe only what Sim does: connecting
requests a token and calls no data endpoint. A saved-credential accessToken is
capped at 16 KiB like SailPoint's.

* fix(credentials): share one Linear client-credentials token per app

Linear asks clients to reuse a token until shortly before it expires and to
request a new one after a 401, and caps an app at 1,000 tokens per workspace
through cleanup. Each worker minted a new 30-day token every hour instead.
Linear now goes through the coordinated token for its full lifetime, and the
401 path replaces it early; every token grant now coordinates, so the grant
registry maps providers straight to minters.

* fix(credentials): keep a credential's client-credentials mode on reconnect

A reconnect that sent only a new client secret for a Shopify, Linear, or
Atlassian client-credentials credential was routed to the pasted-token
builder and failed. The stored mode now carries forward unless the reconnect
sends a token. The connect modals no longer preselect a mode on reconnect, so
the admin restates it instead of silently switching modes.

* docs(credentials): align Zendesk, Linear, and Shopify copy with vendor docs

- mark Zendesk API tokens as deprecated by Zendesk in the picker, hint, and docs
- warn that a Linear client-credentials request with other scopes revokes tokens
- say where Shopify's 24-hour token is kept instead of claiming it is never stored
- reword comments that stated undocumented Linear and Zendesk behavior as fact

* fix(credentials): drop exports that only their own module uses

* fix(credentials): keep shared tokens on scope 401s and rate-limit tool-call expiry

A 401 whose body reports a scope mismatch (Atlassian's 'Unauthorized; scope
does not match', RFC 6750 insufficient_scope) comes with a valid token, so it
no longer expires the application's shared token. A tool-call rejection also
leaves a token minted within the last minute in service, so a call that keeps
failing re-mints at most once a minute. Connect-time identity proofs still
expire a rejected token unconditionally.

* fix(credentials): replace the shared Linear client-credentials token daily

Linear tokens live 30 days, but a revocation that does not surface as a 401
would otherwise keep a dead token in service until then. Same-scope tokens
coexist, so a daily replacement leaves in-flight calls valid.

* chore(credentials): regenerate block successors, tool metadata, deployment config, integration docs, OpenAPI and CLI API for credential auth wave 2

* test(credentials): drive the slow Entra answer from the propagation suite's fake clock

* fix(credentials): declare the Zendesk email and API token as replaced by the saved credential's token

* test(credentials): wait for the slow Entra answer with the shared sleep helper

* fix(crowdstrike): mint a new token for each legacy inline request again

The inline token cache held a Falcon token for up to 29 minutes, so a token
Falcon had since revoked or rescoped failed the next run. Legacy blocks mint
per request as they did before the saved credential.

* fix(credentials): drop a saved client-credential token a provider refuses

Internal operations such as CrowdStrike and SailPoint answer 401 or 403
when the provider refuses a saved credential's token. The executor now
drops that token from the per-instance cache so the next call mints a
replacement instead of reusing it until it nears expiry.

* test(credentials): serve the stored coordinated token until it is invalidated

The coordinated-token mock minted on every call, so the revoked Atlassian
token test passed with the invalidation removed. The mock now keeps one
token per application until invalidated.

* refactor(credentials): share one client-credentials token exchange

Atlassian, Linear, and Shopify each carried the same form POST, refusal
mapping, payload check, and lifetime cap. They now call one
exchangeClientCredentialsGrant, tested once, and keep only their URL,
extra fields, lifetime cap, and Shopify's refusal classifier.

* fix(credentials): read and decrypt a client-credentials secret once per resolution

Token providers and Atlassian read and decrypted the stored secret to pick
its mode, then read and decrypted it again to mint. The mode read now
carries into the mint, and both blob parsers share one mode check.

* refactor(credentials): share the credential-text check across minters

Fivetran, ZoomInfo, and Datadog each carried the same empty, control
character, and size check. They now call one assertCredentialText, with
Datadog also refusing spaces.

* refactor(zendesk): encode the API-token Basic credential in one place

The saved-credential minter and the tools each built the
{email}/token:{apiToken} Basic value. Both now call
zendeskApiTokenCredential, so the saved and inline sign-ins cannot differ.

* refactor(tools): declare the saved-credential token param once

CrowdStrike, ZoomInfo, and SailPoint tools each repeated the hidden
accessToken param a saved credential fills. They now use
savedCredentialTokenParam, with the same descriptions.

* fix(tools): name a missing credential field without naming Datadog

The generic credential-field labels named Datadog for applicationKey, so
any other tool mapping it would blame a Datadog key. Labels now carry
their article and stay provider-neutral.

* fix(security): redact Datadog application keys in logged inputs

No key-name pattern matched applicationKey, so a key typed into the
legacy Datadog block showed in plaintext in execution input logs.

* fix(credentials): match the Atlassian OAuth 2.0 hints to what Atlassian supports

In client-credentials mode the Jira client ID hint said one credential
covers Jira Service Management, which Atlassian does not list for OAuth
2.0 credentials. It now points Service Management at a scoped API token.
Also corrects the reconnect note on clientCredentials.preferred.

* refactor(credentials): share the client ID and secret fields across connect forms

The Atlassian and token-provider forms each built the client-credentials
fields, and only one labelled its secret input for assistive tech. Both
now render ClientCredentialsFields.

* docs(credentials): describe the saved credentials on their setup-guide pages

The PlanetScale, ServiceNow, Gong, and Twilio pages are the connect
modal's setup guides but still described only the legacy inline inputs.
Each now says how to add the credential, the hosts it accepts, and that
earlier blocks keep their inline values. SailPoint v2 names both the PAT
and the client-credentials API client.

* test(credentials): mock credential-service through the central @sim/testing mock

* fix(sailpoint): accept government tenant hosts on the saved credential, as the earlier block does

* fix(servicenow): accept custom and self-hosted https instance URLs on the saved credential, as the earlier block does

* fix(credentials): type the new test fixtures, unexport file-local types, and regenerate CLI docs

* fix(credentials): drop refused local tokens, keep exact ServiceNow passwords, and refuse non-http URL forms

- Forget a client-credential token cached on this instance when an external
  request answers 401, alongside expiring the coordinated token.
- Add preserveWhitespace to token descriptor fields; ServiceNow passwords keep
  their surrounding spaces through the connect form, contracts, and builder.
  Contracts no longer trim apiToken; Atlassian and GitLab builders trim it.
- Refuse any scheme other than http(s), and protocol-relative or backslash
  authorities, in the shared typed-URL helpers while bare host:port still works.
- Refuse client-credentials extra fields that would replace grant_type,
  client_id, or client_secret.
- Report a Datadog validate answer without a boolean valid field as a provider
  fault rather than invalid credentials.

* fix(credentials): report an aborted grant refusal as the abort, and keep the CrowdStrike cloud required

* fix(credentials): name a dropped connection separately from a malformed token response
2026-11-11 16:21:17 -08:00
Waleed 5bbf4e748b feat(api): failing block on polled runs, deployed input schema, paused-runs list, and applied limits (#9906)
* feat(api): attribute polled run failures, deployed input schema, paused-run list, and applied run limits

- GET /v2/workflows/{id}/runs/{runId} reads the failing block back from the run's
  recorded trace, withheld when the viewer's permission group hides execution data
- GET /v2/workflows/{id} adds inputSchema for the active deployment's API run input
- GET /v2/workflows/runs/paused lists a workspace's runs waiting on human input,
  projecting pause points exactly as the run detail does
- Execute responses report executionTimeoutSeconds; GET /v2/billing/status adds plan limits

* fix(api): respect the paused-run page cap in the CLI and keep waiting pause points under the cap

- CLI generator carries a numeric field's contract maximum; the pager never requests
  a page above it while still paging to the caller's total --limit
- Pause point cap keeps points not yet resumed before resumed history, so a run that
  paused again is never listed without its waiting point (run detail and paused list)

* improvement(api): reuse FailedTraceBlock and sort pause points once when capping

* fix(api): custom-block trace boundary, legacy pause point arrays, and list point selection

- A custom block is an opaque trace boundary for failing-block attribution
- The paused-run list reads object and legacy array pause_points
- The list selects waiting human points before the per-run cap, reads points in
  waves that stop once the page budget is spent, and shares one waiting predicate
- Resume response schemas omit executionTimeoutSeconds
- Drop a non-null assertion from the CLI page cap test

* fix(api): attribute concurrent failures to the stored error's block and never fail a workflow read on its deployment

- Failing-block attribution prefers the span the stored error names, else the
  failure that ended first, else none; the block error prefix has one owner
- The workflow read degrades inputSchema to null when the deployment cannot be
  read or its schema has an unexpected shape
- Integration cases for time-only, archived, and cross-workspace exclusion

* fix(api): consistent trace walk, block-named error attribution, required applied timeout, and ungated input schema

- Failing-block attribution walks spans as hasUnhandledError does, through
  successful blocks, with one shared successful-boundary rule
- An error message headed by the failing block's name is attributed to it even
  when the name reads as a run-level failure
- executionTimeoutSeconds is required (nullable) on Execute workflow responses
- The workflow read takes inputSchema from the active version row, not isDeployed
- Pause cap wording: unresolved points are kept in preference, listed earliest first
- Regenerate the CLI API the previous contract wording left stale

* fix(api): parse resume responses with the resume schema in e2e scripts and regenerate the CLI API on staging

- Stop-after and pinned-execute e2e scripts parse resume responses with
  v2ResumeWorkflowDataSchema, which omits executionTimeoutSeconds
- Regenerate the CLI API against the merged staging contracts

* fix(api): parse the stop-after e2e resume helper's response with the resume schema
2026-11-11 15:52:59 -08:00
Waleed 9b58238790 fix(api): release-audit follow-ups for the agent API work (#9910)
* fix(api): name the failing field once in v2 validation errors

A message that already leads with its field label no longer repeats it after
the location prefix, and the CLI restates the prefix as the flag the caller
typed instead of rewriting it to query.--flag.

* fix(api): call the v2 error id requestId

The id in error bodies is the request id that x-request-id carries and logs
store as requestId; traceId already means the OTel trace id in logs, so a
search by the published value found nothing.

* fix(api): describe what the workflow outline actually omits

Only null values are dropped, every sub-block hidden from agents is dropped
(some are real configuration), and blocks whose parent container is gone are
left out, so point readers at Get workflow state for the full configuration.

* fix(api): prove the workspace schedules list against Postgres

Adds an integration suite for listWorkspaceLiveSchedulesPage: it returns the
rows the per-workflow live list reports, leaves out archived, undeployed and
other-workspace workflows, and pages through createdAt ties without repeats or
gaps. sortBy=createdAt now says that each deploy creates new schedule rows.

* chore(skills): include the optional requestId in the v2 error shape

* fix(cli): pick the handoff for --expires-in and name a refused key

sim login --expires-in without --method failed on servers that offer OAuth,
because OAuth was chosen and then refused the flag; a lifetime now selects the
API-key handoff. A refused handoff key no longer says nothing was stored: it
already exists on the account, so the CLI points at how to revoke it.

* fix(api): publish the workspace logoUrl pattern without a lookahead

RE2-based validators (Go, Rust, many gateways) reject lookaheads, so the
OpenAPI pattern for logoUrl could not be compiled there. The rewrite accepts
and refuses exactly the same values.

* chore(cli-auth): drop the poll-body half of a test that could not fail

The poll contract strips unknown keys and the route never reads them, so
sending access and expiresInDays in the body proved nothing. The test keeps
checking that the approval's access and lifetime reach the mint.

* fix(workflows): refuse withheld blocks before the operations lock

applyWorkflowOperations now hands the persistence primitive a reader, which
skipped its pre-lock withheld-block check, so a refused batch took the row lock
and re-read the graph first. The use case checks the graph it composed before
writing. A failed re-read under the lock is now an internal error instead of a
400 saying the workflow has no state.

* chore(api): document the CONFLICT 409 from Apply workflow operations

* improvement(workflows): prove the operations conflict guard against Postgres

Holds the workflow row lock to force each interleaving: an unchanged workflow
with containers and a migrated legacy block commits, a write that lands after
the base read is refused as a conflict, and of two concurrent applies one
commits and the other is refused with nothing lost.

* chore(api): tighten comments and the field-label check from review

* fix(cli): name a refused handoff key exactly

The poll response now carries the minted key's name (an additive, optional
field), so the CLI tells the caller exactly which key in Settings → API keys
to revoke, falling back to the key id for an older server. Restores the route
context argument the trimmed poll test dropped.

* fix(workflows): run the conflict-guard races on their own connections

The applies and the lock-wait poll started inside the lock holder's
transaction callback, so the transaction tripwire refused them. They now leave
that context, the applies run in a permission-group scope as routes do, and an
apply that settles early is reported without awaiting the ones queued on the
held lock.

* chore(cli-auth): declare the poll key name the server always sends

* fix(workflows): count lock waiters queued behind another waiter

A second FOR UPDATE waiter queues on the first waiter's tuple lock, so
pg_blocking_pids names that waiter rather than the holder; the barrier now
walks the chain.

* fix(cli): probe the endpoint before an --expires-in handoff

--expires-in without --method chose the handoff before the reachability
probe, so a mistyped endpoint printed a pairing code and polled instead of
failing fast. The probe now runs first. A refused key from a server that does
not report its name is described by the name pattern and time it was made.
2026-11-11 15:39:23 -08:00
Waleed 3d8996f0e6 feat(api): workflow outline, workspace schedules list, clearer v2 errors, and catalog value types (#9905)
* feat(api): add traceId and field paths to v2 errors, name the read-only key remedy

* feat(api): publish declared value types on block catalog fields

* feat(api): add workflow outline and workspace schedules reads to v2

* fix(api): type declared catalog inputs as block params and regenerate the docs manifest

* fix(api): compare member responses without their per-request traceId

* improvement(api): tidy catalog field projection default and integration test comment

* docs(api): say the outline's derived fields come from values state already returns
2026-11-11 14:26:20 -08:00
Waleed 1b1639c9b0 fix(release): host_not_allowed for refused hosts, internal-JWT-only secret release, and final release-audit cleanups (#9870)
* fix(api): tell a missing key owner from an owner whose ban state is null

user.banned is nullable, so a real owner with banned = NULL had every
personal key refused as orphaned. Select the joined user id and test that
instead; the ban and suspension checks are unchanged.

* fix(credentials): report a refused connection host as host_not_allowed

- egress validation names its refusal (dns or policy) instead of callers
  inferring it from a missing cause; an empty DNS answer is ENOTFOUND
- the token check judges every DNS record when an environment proxy will
  carry the request, so a mixed public/private host is refused up front
  rather than failing in the transport as a retryable 502; the transport's
  own refusal is a typed EgressRefusedError and maps the same way
- new host_not_allowed code (400) with its own connect-modal message
- Flow and GitLab personal-token verification classify a refused or
  missing host the same way
- the typed-URL scheme guard is shared and ignores the tabs and newlines
  the URL parser drops

* fix(credentials): report an oversized Databricks token success as a 502

An oversized 2xx token reply carried status 200 into provider_unavailable
and its logs. A refusal keeps its own status.

* docs(api): say v2 execute options need a full-access key or api:write

run.version, async and waitTimeoutSeconds refuse read-only keys; the meta
example lists search:read with the full-access scopes.

* chore(scripts): scope the payload-param allowlist to internal operations

Every listed tool is an internal operation, so the probed-request fallback
no longer builds or consults it.

* fix(redaction): keep Infisical secret names visible; redact only deployKey

* docs(networking): the SSRF guard matches NO_PROXY like curl, not like Bun

* fix(api-keys): never echo an internal key-creation failure to the caller

The unauthenticated CLI poll route and the settings routes returned the
raw error message for an internal failure. Return a fixed message and keep
the cause in the server log; a conflict still names the existing key. The
CLI's comment now says a 400 can also be a refused key creation.

* chore: log a failed route-cache clear and spell out the read-only key rollback

The route-cache clear stays non-fatal but warns when it fails for any
reason other than a missing build id or cache. The api-key-read-only flag
says to revoke or replace read-only keys before rolling back.

* fix(credentials): release saved secrets only to internal-JWT callers

The token route refused only session callers; any other auth type would
have been handed a saved secret. Allow internal JWT and refuse the rest.

Tools never execute in the browser (the registry boundary keeps the tool
registry out of every workspace client graph, and nothing else imports the
executor), so the browser-only token fetch through the route is deleted.

* fix(firecrawl): treat a blank maxDiscoveryDepth as unset

A cleared field arrived as '' and was sent as 0, a crawl of the start page
only. It now follows the blank maxDepth handling.

* chore(credentials): log a broken JWKS and keep the successor map out of credential display

The JWKS route still answers 404 when the signing key is broken, but warns
with the error. The GitLab personal-token display reads its block type
from the catalog entry instead of importing the generated successor map
into a client-imported module.

* test: drop or tighten assertions that could not fail

- delegation: the read-only replacement case decided its filter by
  scanning bound params in a fake DB; no real-boundary check exists, so
  it is dropped with the fake's filter
- Twilio: assert how many recordings requests were sent, so an empty
  loop cannot pass
- Pi: the removed-model case restated the absent-from-catalog case

* fix(security): ignore a malformed CIDR NO_PROXY entry

10.0.0.0/8/junk parsed as /8. An entry with extra segments is dropped like
any other unparseable entry, and the TSDoc says IP entries match within
their address family.

* chore(workflows): scope the paused-row read to its workflow and reuse the mutability guard

- the execution-status paused-row read filters by workflowId as well
- delete-workflow uses requireMutableWorkflow instead of an inline copy
- polling webhook logs carry the webhook id in metadata

* fix(credentials): never name a sibling credential in a trust-setup refusal

The caller may not be able to see the credential that holds or blocks the
subject, so both refusals name only the workspace or organization. The
uniqueness check documents its limits.

* docs: correct the Helm readOnlyRootFilesystem note and the deployed-run variables TSDoc

* test(credentials): rely on the shared env reset in the proxy validator tests

* chore(helm): bump the chart version for the README correction

* fix(redaction): keep prefixed secret keys masked while leaving Infisical's bare secretKey visible

* fix(release): keep bare secretKey redacted, leave the proxy every-address rule to the transport, and report unknown GitLab hosts as input errors
2026-11-10 17:20:09 -08:00
Waleed 9b10389a2f fix(release): keyless subject uniqueness, NO_PROXY IPv6/CIDR, proxied boot secret, and remaining audit follow-ups (#9866)
* docs(api-keys): add rollback guidance to the api-key-read-only flag

* docs(api): say v2 workflow execution needs a full-access API key

* chore(api): regenerate MCP operations for the execute scope wording

* fix(hitl): stop duplicating input fields across listed pause points

* fix(api): refuse a personal v2 key with a missing owner as invalid, not a 500

* fix(credentials): refuse a keyless subject another live credential already holds

A keyless subject proof stays valid for 24 hours and is not bound to one
credential, so a member removed from a keyless AWS or Databricks credential
could save a second credential with the same subject and proof and keep
assuming the customer's role.

Creating or reconnecting a credential onto a subject it did not already hold
now refuses (409 conflict) when another non-revoked credential of the same
owner holds it. The subject lives only in the encrypted secret, so the check
decrypts the owner's keyless credentials inside the write transaction, under a
per-subject advisory lock so concurrent saves serialize. A reconnect keeping
its stored subject binds nothing new and skips the check.

* refactor(tools): detect the saved-credential picker with isSavedCredentialPicker

credentialSuppliedParamsFor matched any oauth-input feeding oauthCredential,
without the credentialKind === 'service-account' check isSavedCredentialPicker
applies. It now uses that predicate. No registered block changes: every block
whose loose-match picker lacks the service-account kind has no tool that
declares credentialSuppliedParams.

* fix(runtime-secrets): fetch the boot secret through the configured proxy

The Secrets Manager client used the SDK's Node handler, which ignores
HTTPS_PROXY, so a container whose only egress is a proxy could not load its
env and never booted. Under Bun with a proxy set, send through Bun's fetch,
which honors HTTPS_PROXY/HTTP_PROXY/NO_PROXY. apps/sim's awsRequestHandler
is out of reach for packages and the realtime bootstrap needs the same path.

* fix(models): mark NVIDIA Nemotron 3 Super retired and move the NVIDIA default

NVIDIA's model page states the nvidia/nemotron-3-super-120b-a12b API is no
longer supported after 2026-10-19, and Pi 1.0.1 dropped it as its NVIDIA
default for the same reason. Mark it deprecated (hidden from pickers, still a
known id for pinned workflows) and default the NVIDIA provider to Nemotron 3
Ultra, which the Pi catalog also serves.

The Mistral IDs Pi 1.5 dropped (mistral-large-2411, devstral-small-2507,
devstral-medium-2507) were retired by Mistral on 2026-05-31 and are already
deprecated here, so saved Pi blocks fail before credentials with the
choose-a-model error instead of being mapped onto a different model.

* fix(credentials): lock keyless subject checks through the advisory-lock helper and refuse on unreadable siblings

assertWorkloadIdentitySubjectUnclaimed now takes a DbTransaction and locks
through acquireAdvisoryXactLock, so the lock carries its SQLCommenter tag and
cannot be taken on the pool by mistake. A sibling keyless credential whose
secret does not decrypt or parse used to throw a generic error, failing every
keyless create or rotation for the owner with a 500. Since it might hold the
subject, the save is now refused as a conflict naming that credential, with a
warning logged, and stored subjects are read with a schema safeParse.

* fix(network): match NO_PROXY entries like curl, including bare IPv6 and CIDR

A bare IPv6 entry such as ::1 was read as host ':' port 1 and never matched,
IP entries only matched their exact spelling, and CIDR ranges were ignored.
Entries now follow curl: domains cover their subdomains, bracketed IPv6 may
carry a port, IP entries match any spelling, and CIDR ranges match IP-literal
destinations. NO_PROXY is parsed once per distinct value. The comments and
the self-hosting networking page describe these rules, and note that Bun's
default fetch applies its own.

* docs(network): note the boot secret fetch follows Bun's NO_PROXY rules

* fix(credentials): decide subject reuse under the lock on every keyless reconnect

A reconnect that kept its subject skipped the uniqueness check, but whether
it kept the subject was decided from the secret read before provider
verification. If another reconnect moved the credential to a new subject and a
second credential claimed the old one meanwhile, the stale reconnect wrote the
old subject back unchecked and two credentials held it.

Every keyless reconnect now locks the subject it is writing, then the
credential row (FOR UPDATE), re-reads the row's current subject, and runs the
sibling check whenever the two differ, with the decision and the write in one
transaction.

* fix(runtime-secrets): pick the boot fetch's proxy with the app's rules

Bun's fetch picks a proxy by scheme only, so with just HTTP_PROXY set the
https Secrets Manager request went direct and a proxy-only container still
could not boot. Move proxy selection (HTTPS_PROXY falling back to HTTP_PROXY,
curl-style NO_PROXY) from apps/sim into @sim/security/environment-proxy, and
have runtime-secrets pass the selected proxy to Bun's fetch explicitly, or
send through the Node handler when NO_PROXY excludes the endpoint.

* docs(api): state the credential and role a manual v2 run requires

Manual runs need api:write, which read-only personal keys lack, workspace
write access, and a personal key or OAuth token; workspace API keys are
refused. Regenerate the OpenAPI document and the MCP operation catalog.
2026-11-10 16:22:59 -08:00
Waleed 24aab3f280 feat(api): run a pinned deployment version and expose paused run points in v2 (#9854) 2026-11-10 14:25:20 -08:00
Waleed 02293a9372 feat(api-keys): read-only API keys and expiry at creation (#9855) 2026-11-10 14:10:07 -08:00
Waleed 4711852316 feat(api): workflow trigger health and enablement through the v2 API (#9853) 2026-11-10 13:51:22 -08:00
Waleed bf575fe3fa feat(credentials): saved credentials and credential-only block versions, with keyless AWS/Databricks OIDC (#9763)
* feat(credentials): saved AWS and Databricks credentials with keyless OIDC

Adds an optional saved credential to every AWS block and the Databricks
block, alongside the existing inline key fields, plus Sim's own
workload-identity (OIDC) issuer so a credential can assume a customer's
AWS role or federate into a Databricks service principal without any
stored secret.

Existing workflows are unchanged: the inline fields stay, show, and
validate exactly as before until someone selects a saved credential.

- Issuer at /oidc/workload (discovery + JWKS), signing key from
  WORKLOAD_IDENTITY_SIGNING_KEY; 404 and keyless option off when unset
- Credential-scoped subjects, HMAC-bound to the preparing user and
  workspace, so a member cannot reuse another credential's subject
- aws-service-account: access keys, keys + AssumeRole (external ID), or
  keyless AssumeRoleWithWebIdentity; resolved server-side per call
- databricks-service-account: PAT, service principal M2M secret, or
  keyless RFC 8693 token federation
- AWS families accept the executor-authorized credential through trusted
  operation context; clients add the session token only for that pair
- S3 get_object signs x-amz-security-token for temporary credentials;
  inline signatures are byte-identical to before
- Tool credential binding honors optional (required: false) policies

* fix(credentials): close review findings on saved AWS/Databricks credentials

- Models can no longer inject a credential selector (or the token, session
  token, or host derived from one) into a hybrid tool call, which would
  have swapped an agent tool's inline keys for another workspace credential
- Databricks connections own the workspace host (authoritative `domain`)
- Drop the advanced credential-ID input: with a single picker, "is a
  credential selected" can no longer disagree with the active canonical mode
- OIDC subject proofs are bound to their provider
- Databricks token and identity fetches refuse redirects
- Correct the AWS module doc on presigned URLs carrying a session token

* chore(credentials): satisfy test-pattern, unused-export, and test-type audits

* fix(credentials): keyless reconnect, availability, and shared credential plumbing

- Reconnecting a keyless AWS role or Databricks principal keeps its trusted
  subject by default instead of issuing a new one that breaks the
  customer's trust policy
- The connect dialogs offer the keyless mode only where the deployment can
  sign tokens; the prepare endpoint reports availability instead of failing
- Register AWS (all 19 block types) and Databricks as stored-credential
  integrations, so org settings, the v2 credentials API, and Copilot can
  create and see them
- Optional STS region for GovCloud and China access keys
- One subject binder and config parser shared by both providers (neutral
  copy), one modal core for submit/errors/trust display
- Generic `authorizedServiceAccountCredential` operation context instead of
  an AWS-specific field; Databricks resolver checks credential type and
  honors cancellation
- Model-blocked params derive from each tool's authoritative params

* test(credentials): type the handler mock in the AWS credential seam test

* feat(credentials): credential-only block versions instead of hybrid inline keys

Existing AWS and Databricks blocks are left exactly as on staging, only
marked legacy and hidden from the toolbar; placed instances keep running
and show an upgrade badge. Each gets a credential-only successor
(s3_v2 ... databricks_v2, textract_v3) built by spreading the legacy block
and swapping its secret fields for a required saved-credential picker.

- withSavedCredential derives the successor's fields, inputs, and params
  builder; S3 and Textract split their builders so legacy key checks stay
- tools declare credentialSuppliedParams so serializer validation and the
  canonical-id check stop asking credential-only blocks for inline keys
- CloudWatch gets saved-credential log group/stream selectors that sign
  inside the credential's STS session
- docs generator resolves multi-level spreads and same-file param builders
- the AWS/Databricks providers are derived from the catalog again, so the
  hand-maintained token-credential mapping is reverted

* docs(credentials): document credential-only blocks by their credential, not inline keys

The generator omits a tool's credential-supplied params on pages for
blocks that sign in with a saved credential, as it already omits
accessToken. Intros now point at the AWS/Databricks credential guides.
Regenerates OpenAPI, CLI API, and CLI docs for the new selector keys.

* fix(blocks): never replace trigger fields that share a secret's id

A webhook trigger can register with a field named like the block's
secret (PagerDuty, Fathom, EmailBison, GitLab). withSavedCredential now
leaves trigger-mode fields, and their dependencies, exactly as they are.

* feat(credentials): generic saved-token plumbing for credential-only blocks

Wave 0 of moving inline-secret blocks onto saved credentials.

- tokenCredentialOAuth(provider, credentialParams) declares which tool
  params a saved token fills; credentialSuppliedParams is derived from it
- the executor fills those params after authorization, overriding any
  caller value, and fails closed when the credential lacks a field
- hosted keys are never injected when a saved credential supplies the key
- v2 tool execute no longer demands credential-supplied params when a
  credentialId is passed (fixes AWS/Databricks direct calls)
- withSavedCredential accepts an optional/conditional requirement
- check-block-registry verifies every credential-only successor's tools
  authorize the picker's provider and actually fill what they declare
- redact secretAccessKey/awsSecretAccessKey keys in logs
- serializer contract test covers every operation of each successor

* feat(credentials): Tavily saved credential and credential-only tavily_v2

Reference migration for wave 1. A generic tokenCheckValidator verifies a
token with one documented authenticated request (no redirects); Tavily
uses GET /usage. Legacy tavily is unchanged apart from its legacy marker.

* fix(credentials): close wave-0 audit findings

- agent tool-input no longer synthesizes inline secret fields a block's
  saved-credential picker supplies; one shared rule
  (credentialSuppliedParamsFor) now drives tool-input, serializer
  validation, and the canonical-id check
- the picker inherits the replaced secret's condition and requirement, so
  sts_v2's unsigned calls (web identity, SAML) need no credential
- withSavedCredential replaces both halves of a canonical secret pair and
  refuses options that would silently do nothing
- Databricks fills its inline apiKey/host through credentialParams, so its
  tools are byte-identical to staging apart from the policy line
- AWS operation families record their tool ids; a test and an executor
  guard ensure every AWS-credential tool resolves the credential
- the registry contract check fails on unpinned host params, optional
  credentials over required params, malformed pickers, and kind mismatch
- hosted-key admission (v2) and pre-resolution validation honor a selected
  saved credential; credential errors name fields in plain words

* feat(credentials): wave 1 — saved token credentials for 48 single-token blocks

Each block keeps its legacy definition (only hideFromToolbar + sunset) and
gains a credential-only <type>_v2. Every service gets a token-paste
provider with a one-request validator against a documented, read-only,
credit-free endpoint, and its tools fill the inline key from the saved
credential via tokenCredentialOAuth.

Blocks: affinity, agentmail, agentphone, ahrefs, apify, apollo, brex,
brightdata, browser_use, buffer, circleback, clerk, cloudflare,
crunchbase, daytona, elevenlabs, enrich, gamma, hex, huggingface,
incidentio, instantly, langsmith, launchdarkly, linq, loops, luma,
mailchimp, otter, persona, pinecone, profound, quartr, rb2b, rippling,
rocketlane, semrush, sendgrid, similarweb, sixtyfour, smartlead,
sportmonks, square, tailscale, trigger_dev, uptimerobot, youcom, youtube.

The registry contract check now probes each request tool's real URL
builder to find params that steer the host, and requires the saved
credential to fill them.

* fix(credentials): close wave-1 audit findings

- Pinecone and Semrush leave wave 1: Pinecone's per-call indexHost would
  let a shared key reach any host, and Semrush has no credit-free check
  that rejects a wrong key. Both are back to staging exactly.
- tokenCheckValidator: forbiddenMeansScoped accepts a valid key that lacks
  the check endpoint's scope (Apollo, Brex, Bright Data, Apify, Rippling,
  Persona); acceptsBody proves keys whose rejection arrives in a 200 body
  (Buffer GraphQL)
- the host-steering probe lives in scripts/saved-credential-contract.ts:
  typed placeholders for required params only, id/host shapes, bare and
  scheme probes, and a broad destination-name fallback where the URL
  cannot be built; covered by a fixture test
- S3 refuses a bucket or region that would move the signed request's host
- spread-inheriting docs keep their base block's outputs (restores the
  Smartlead, Trigger.dev, and Instantly output tables)
- incident.io's credential is optional for alert events, which use their
  own alert source token
- withSavedCredential refuses replaced secrets that show or require
  differently; copy, intro, and hint fixes from the audit

* fix(credentials): close wave-1 re-audit findings

- host probe also defeats unparsed suffix checks and finds hosts behind
  optional switches, probing every placeholder shape; broader destination
  names where a URL cannot be built; the contract check fails when a
  successor's tool is missing from the executable registry
- the optional-credential rule evaluates a conditional picker per
  operation; incident.io hides its picker on alert events instead
- withSavedCredential takes an explicit picker condition and refuses one
  that depends on a replaced secret at any nesting depth
- a scoped 403 counts only when it is the vendor's JSON response, never a
  firewall or CDN page
- S3 names a bad bucket or region in its error
- pinecone/semrush catalog dates restored to staging

* feat(credentials): wave 1b — Mem0, Zep, and Discord saved credentials

Their legacy params builders throw without an inline secret, so each is
extracted into a module function with a requireKey flag: the legacy block
keeps identical validation and messages, the credential-only v2 skips only
the key check. discord_v2 hides its picker for webhook posts, which never
use the bot token. BlockToolParams is now a shared type for extracted
builders (S3, Textract, Discord).

* feat(credentials): wave 1b — v3 credential-only versions and Flint

Blocks that already had a v2 get a credential-only v3 that spreads it:
cursor, dub, extend, fireflies, intercom, pulse, quiver, reducto. The v2
becomes legacy and every older version's replacedBy points at v3. Extend,
Pulse, and Reducto's v2 builders trimmed the key inline, so each is
extracted into a builder that takes the key as an argument; the legacy v2
passes the trimmed key exactly as before.

Flint gets flint_v2 with a dedicated validator: its API has no read
endpoint, so an unknown task id answering 404 proves the key.

tokenCheckValidator gains rejectsKey for vendors that answer a bad key
with a server error (Fireflies returns 500 auth_failed), so the user is
told the key is wrong rather than the vendor down.

* fix(credentials): close wave-1b audit findings and CI boundary failures

- token checks for the 59 new providers live in one module
  (validators/token-checks.ts) and their tool policies in
  tools/shared/saved-credentials.ts, so the tool-registry boundary stays
  within its baselines instead of adding ~60 modules to every graph
- the host-steering probe builds URLs through the shared transport
  (new prepareToolRequestUrl) and also flags a host validated against a
  vendor allowlist when two accepted values reach different tenants
- the AWS routing test reads typed metadata through getToolMetadata
- Flint accepts only its documented JSON 'Task not found' 404; Intercom no
  longer treats a 403 (suspended workspace, plan without API) as valid;
  Fireflies keeps its error text in logs when a 5xx isn't auth_failed
- Cursor help text, placeholder wording, Pulse intro, sorted secret fields

* fix(credentials): address pre-ship verification findings

- Refuse a keyless AWS role whose trust policy doesn't pin the credential's
  subject, so no other workspace can assume it
- Treat a malformed workload-identity signing key as not configured
- Brex: reject an unknown token's scope-style 403; the token-check factory
  now runs rejectsKey before accepting a scoped 403
- Flint: probe with a docs-shaped task id and a size-capped body read
- Drop the versioned BlockMeta entries that doubled templates; alias bare
  block types in the app icon map so template icon clusters resolve
- Widen the host-probe fallback names and rotate digits in alternates
- Copy: picker placeholder casing, Databricks v2 description, Pulse and
  Tailscale skills, AWS/Persona/Rippling intros, AWS credential docs
- Tests: AWS executor signing, AWS/Databricks credential setup, legacy
  params builders, serializer coverage for blocks without operations

* refactor(credentials): one saved-credential table and shared helpers

- withSavedCredential reads the replaced fields from SAVED_CREDENTIAL_OAUTH,
  so blocks and tools share one table instead of two hand-kept copies
- Reuse isTriggerModeSubBlock, getDependsOnFields, and a shared
  isSavedCredentialPicker; build the replacedBy map once in the registry check
- newWorkloadIdentitySubject owns the subject format; the AWS trust-pin probe
  runs alongside verification
- The issuer parses a bad signing key once instead of per request
- Token checks share the accepted result and the capped JSON reader

* chore(credentials): cleanup pass

- Keyless setup query gets its own key root, so broad credential
  invalidations can't refetch an open setup and mint a new subject
- Named staleTime constant for the setup query
- Correct stale comments (relying parties, Databricks param names)
- Tighten tests: assert the refusal reason, make the BYOK guard reachable,
  drop a duplicate and a test that could not fail

* fix(credentials): address review round 1

- A scoped 403 whose body can't be read is provider_unavailable, never accepted
- Provider error snippets read through the bounded reader
- Props interfaces for KeylessTrustFields and useWorkloadIdentitySetup; TSDoc on issuer responses

* fix(credentials): never cache the issuer's not-configured 404
2026-11-10 08:25:14 -08:00
Waleed de6e53c752 fix(docs): polish code rendering and keyboard navigation (#9827)
* fix(docs): polish code rendering and keyboard navigation

* fix(docs): give API samples one keyboard entry
2026-11-09 21:18:18 -08:00
Waleed 09742f1f5c feat(gauge): add Gauge Chat integration (#9733)
Add all 27 Gauge Chat operations with saved organization API-key credentials, six resource pickers, the Gauge icon, setup documentation, and generated catalog metadata.

Keep operation-specific inputs scoped across workflows, agent tools, and notification tools using optional mapper context. Preserve model arguments, clear incompatible topic selections on operation changes, and reject blank identifier entries.

Validate provider contracts and live requests, including mutation readbacks, report datasets, permission denials, selectors, and real executor/agent calls. All local gates passed with 43,187 tests passing and eight existing skips.
2026-11-06 00:14:40 -08:00
Waleed 7ee2814366 feat(integrations): add Jama and Flow workflows and live Search (#9723)
Add Jama Connect and Flow Engineering actions, selectors, and live Search using existing credential and permission boundaries. Preserve account limits, identity checks, and bounded provider reads.
2026-11-05 19:06:33 -08:00
Waleed e5621b6f93 fix(workflows): keep the Run-button lint finding advisory and point at lint from apply warnings (#9645) 2026-11-03 15:39:45 -08:00
Waleed ecd9263d0f improvement(workflows): lint the manual-run entry check and surface lint findings in apply warnings (#9638)
* improvement(workflows): lint the manual-run entry check and surface lint findings in apply warnings

* improvement(workflows): describe every case where manualRunIssue is null

* docs(workflows): make the apply-operations response example a wired graph
2026-11-03 14:10:16 -08:00
Waleed 9fffbcc90d fix(mcp): honor json schema openness in mcp output shapes (#9476)
* fix(mcp): honor json schema openness in mcp output shapes

Objects without additionalProperties: false now keep their declared fields and
record that others are allowed, so references to undeclared fields lint clean
and resolve empty when missing. Arrays without items accept element paths.
Also documents the v2 execute 202 receipt returned after waitTimeoutSeconds.

* fix(mcp): keep openness flag out of field lookup and close empty objects

A declared field named open on an open object resolved to the flag instead of
the field. Open nodes now look fields up in their properties only. A closed
object declaring no properties now rejects every field instead of saving as
untyped. Documents the NDJSON detached frame for waitTimeoutSeconds.

* fix(workflows): offer no child fields for arrays of typed elements

The connection panel listed an items child for an array whose elements are a
typed node without properties, such as an MCP array of strings or of untyped
elements, offering an invalid reference.

* fix(workflows): scope the typed-elements check to arrays and type the field helper

* chore(lint): shrink the explicit-any baseline for the output fields hook
2026-10-30 13:53:23 -07:00
Waleed 075c4ffac3 feat(workflows): let a synchronous run continue in the background after a wait timeout (#9464)
* feat(workflows): let a synchronous run continue in the background after a wait timeout

A synchronous run, including a manual draft run (--manual, --trigger,
--from-block, --stop-after), could only be waited on until it settled or hit
the sync execution limit. Manual runs refuse async, so a caller had no way to
get the run id back from a long or stuck draft run and decide to keep waiting,
watch it, or cancel it.

The v2 execute body takes waitTimeoutSeconds. Past it the response answers
202 with the run receipt (NDJSON: a `detached` frame) and the run keeps going
in this process exactly as it started: same captured draft state, entry point
and pause persistence. Such a run is admitted like an async one (async rate
bucket, reservation and timeout), takes no request abort signal so a dropped
connection never cancels it, and registers an in-process aborter so runs
cancel reaches it without Redis. Without the field nothing changes.

The CLI exposes it as `workflows run --wait-timeout <seconds>`. A run that
outlasts it is read back once and reported the way `workflows runs wait`
reports an elapsed bound: the run record on stdout and exit 4 while it is
still moving, so `workflows runs wait <runId>` continues it.

* fix(workflows): hand out a detached run's receipt only once the run can be read

A detach could fire before the run's log row existed, so the runs resource answered 404 for the receipt just handed out. The response now waits for the logging session to start before detaching, and the wait timeout docs say how each transport carries the receipt.

* feat(mothership): declare that workflows run outlasts --wait-timeout to the worker

Sim now sends the workflow-run-wait-timeout client capability on chat turns, so the worker waits on a synchronous workflows run in slices only on a Sim whose CLI takes --wait-timeout there; an older Sim keeps its held run. The protocol copy is synced from the mothership contract that defines the token.
2026-10-29 23:11:49 -07:00
Waleed fd4323a7ae improvement(docs): refine screenshots, copy, and API interactions (#9269)
* improvement(docs): refine screenshots, copy, and API interactions

* fix(docs): preserve icon gradients and refresh generation inputs

* fix(docs): keep OAuth setup prerequisites visible
2026-10-20 20:52:28 -07:00
Waleed 4bd6871ddb feat(helpscout): knowledge base connector, auto-registered triggers, 12 more tools, and validation fixes (#9253)
* fix(helpscout): explain empty-body 404 responses in the error extractor

* feat(helpscout): add knowledge base connector and auto-registered webhook triggers

* feat(helpscout): add 12 tools, team assignees, and validation fixes for triggers, connector, and errors

* fix(helpscout): switch default and unexported contact type sets

* fix(helpscout): strict custom field and snooze input, unsafe connector reconciliation, safe inbox IDs

* fix(helpscout): serialize the connector change marker structurally

* fix(helpscout): keep team assignee names in connector metadata and tool outputs

* fix(helpscout): separate connector scan budget and full organization property fields

* fix(helpscout): let cleanup finish for triggers without a managed webhook
2026-10-20 17:07:29 -07:00
Waleed 4b3adfe4db feat(helpscout): add Help Scout integration with OAuth and app credentials, selectors, and webhook triggers (#9252)
* feat(helpscout): add Help Scout integration with OAuth and app credentials, selectors, and webhook triggers

* fix(helpscout): publish triggers in the catalog, reject unsafe IDs, and address review findings

* fix(helpscout): mark nullable trigger output fields
2026-10-20 13:55:40 -07:00
Waleed 2676575f21 improvement(docs): standardize copy and responsive navigation (#9020)
* docs: standardize copy and page organization

* docs: preserve tab spacing and qualify output limits

* docs: align responsive navigation and preserve readable content

* docs: link the scoped tab component in agent guidance

* docs: preserve procedural details and correct reference examples

* docs: record final review and preserve accessible provider bookmarks

* chore(docs): finish ship review and update audit evidence

* fix(docs): correct review findings and tablet header alignment

* fix(docs): polish API controls and inline code

* fix(docs): announce API picker selections

* fix(docs): expose checked API picker choices

* test(ui): align single-choice picker locators
2026-10-14 12:29:33 -07:00
Waleed de95f24e55 improvement(api): declare OAuth scopes in OpenAPI, JSON 404s for unknown API paths, and root MCP resource metadata (#9026)
* improvement(api): declare OAuth scopes in OpenAPI, JSON 404s for unknown API paths, and root MCP resource metadata

* fix(api): shrink the unused-exports baseline and keep rewrite checks out of the dev-server e2e
2026-10-14 10:52:25 -07:00
Waleed a643776bb8 feat(fivetran): add Fivetran integration with saved credential, selectors, and webhook triggers (#8983)
* feat(fivetran): add Fivetran integration with saved credential, selectors, and webhook triggers

* fix(fivetran): list catch-all trigger in catalog, mask API key, regenerate selector contracts

* fix(fivetran): run signed events during activation, hash full event for retry keys, isolate pause/resume
2026-10-13 13:27:26 -07:00
Waleed 56ad17c093 fix(deploy): return deployed-version lint as its own field, opt-in and time-bounded (#8863)
* fix(deploy): return deployed-version lint as its own field, opt-in and time-bounded

* test(deploy): pin that an unrequested lint is never awaited, by behavior
2026-10-09 17:23:58 -07:00
Waleed c3c3d56dc8 fix(lint): describe unquoted JSON references as failing only when the text is not itself JSON (#8854) 2026-10-09 10:15:04 -07:00
Waleed 33dfef28a8 fix(workflows): lint unquoted string references in JSON fields and surface lint on deploy (#8803)
* fix(workflows): lint unquoted string references in JSON fields and surface lint on deploy

* fix(workflows): lint only the JSON fields the operation sends, and lint deploys as the acting user

* fix(workflows): check JSON editors sent under a canonical param
2026-10-08 09:48:22 -07:00