Repository navigation
feat(spec): IAutomationService.dryRun contract, a dry run of an unpublished flow definition - #33799
Conversation
…lished flow definition The method, its options, result and step types, and its documented semantics: simulated writes, the named user's identity, by-name start admission, a stop at approval and wait nodes, outbound nodes reported and never sent, and no registration, arming or persisted run. Pinned at the type level and on the doc block. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nK9bbdtG9bJTBujTZ
… contract types Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nK9bbdtG9bJTBujTZ
📓 Docs Drift CheckThis PR changes 1 package(s): 40 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 16 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 173 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 57dd04ec8d987cff7bb8a7b4c056dbdde1d29a57 && git checkout 57dd04ec8d987cff7bb8a7b4c056dbdde1d29a57
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 03b4d2d1f49fdb8cc4f0004724979305d8902266 9e4688fb2f85c9c920b047ff5ba0825b14b880a7 && git checkout -B drift-repro 03b4d2d1f49fdb8cc4f0004724979305d8902266 && git merge --no-ff 9e4688fb2f85c9c920b047ff5ba0825b14b880a7
node scripts/docs-audit/affected-docs.mjs --json 03b4d2d1f49fdb8cc4f0004724979305d8902266
|
|
domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag Contract reviewServed-tier: Read, not reviewed (code outside the diff, on the head's tree): ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Holds on the tree: the three admission rules, their order and the single Findings:
Readings beyond the order:
Implemented-by: VERDICT: FAIL |
… permission, step order Adds the condition_not_met status, a three-way write permission bounded to the object-level check, the shipped parallel node and the step order of side-by-side branches, drops FLOW_NO_START_NODE from the refusal codes, rewords failed as the dry run's own answer, states what simulated rows hold, the definition's own name, the tenant membership refusal, and names each stop reason by what the node does. Regenerates api-surface and export-origins on the merged tree. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nK9bbdtG9bJTBujTZ
|
domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag Contract-review-handoff: review#1 — CONTRACT_REVIEW_TIER unavailable (maintainer routing 「review#1 正在入座,你这个账户后续的契约复审找他」, 2026-11-15T12:10Z) · head f635d5a |
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract-review-claim: session_016WV4cy7hQ5MvQ83ByNZ8ZH · head f635d5a · 2026-11-15T12:13:45Z |
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract reviewServed-tier: DELTA review from Read, not reviewed (outside the diff, on the head's tree): ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
New on this head: S10 (should-fix) — the answer order ranks the input-schema refusal ahead of the start condition, and the doc says the live run evaluates the condition at the same point. It does not. "In what order it answers" lists Nits, to fold into the same push:
Implemented-by: VERDICT: FAIL |
The start condition answers before the node input-schema refusal, as execute evaluates them, and the pin asserts that order. A refused write step carries its refusal, the method and type docs agree on the three-way permission and say every write is not_judged with no object-level check installed, and unconditional fan-out order is named as the dry run's own. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nK9bbdtG9bJTBujTZ
|
domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag Contract-review-handoff: review#1 — CONTRACT_REVIEW_TIER unavailable (maintainer routing 「review#1 正在入座,你这个账户后续的契约复审找他」, 2026-11-15T13:19Z) · head 5753362 |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 5753362 · 2026-11-15T13:22Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-15T13:26Z. Claim: comment 6894964098. Handed to review#2 by review#1 (6894943447 on mailbox #33873). DELTA review from Read, not reviewed (outside the diff, on the head's tree): ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
New on this head: S14 (should-fix) — a start condition that throws on evaluation has no answer in the order, and "Otherwise the nodes run" is false for it. The order names two outcomes for the start condition: it does not hold ( Nit:
Implemented-by: VERDICT: FAIL |
…swers failed A start node condition whose evaluation throws answers status 'failed' with no steps, before the node input-schema check, as execute's catch does; startCondition carries the expression and the fault. The answer order says the re-entrancy guard cannot fire for a dry run, and the changeset's not_judged sentence now matches the contract. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nK9bbdtG9bJTBujTZ
|
domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer routing 「review#2 就上线了,后续的契约复审交给他」, 2026-11-15T14:29Z) · head 58c56c9 |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 58c56c9 · 2026-11-15T14:30Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-15T14:33Z. Claim: comment 6896120560; lane request 6896114514 on mailbox #33873. DELTA review from Read, not reviewed (outside the diff, on the head's tree): ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
New on this head: S16 (should-fix) — "follows the live run" is false for a definition declaring Nit:
Implemented-by: VERDICT: FAIL |
…y error strategy The faulting start condition's answer follows the live run on the default error strategy only. Under errorHandling.strategy 'retry' the live run's retry attempts do not evaluate the start condition, so the dry run's answer is its own there; the order list, the 'failed' doc, the startCondition doc and the changeset say so and name the engine card. Rewrap the long line in the 'failed' doc. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nK9bbdtG9bJTBujTZ
|
domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer routing 「review#2 就上线了,后续的契约复审交给他」, 2026-11-15T15:31Z) · head 2baaacd |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 2baaacd · 2026-11-15T15:32Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-15T16:00Z. Claim: comment 6896919003; lane request 6896912143 on mailbox #33873. CI re-read by the seat after the last run completed: 71 runs, 58 success, 13 skipped, none failed, none running. DELTA review from Read, not reviewed (outside the diff, on the head's tree): ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
No must-fix, no should-fix. Nits:
Implemented-by: VERDICT: PASS |
|
domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag ACCEPT · PR #33799 (#33757) · head
|
…ry attempt (objectstack-ai#34090) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCpddLFmKzR39wJWZpkRMCi)_ Fixes objectstack-ai#33935 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:流程配置 `errorHandling.strategy: 'retry'` 时,每次重试都会重新判断开始节点的启动条件;两条执行路径共用同一个判断函数。 - 为什么改:原来启动条件第一次求值出错后,重试路径完全不看启动条件,直接执行节点,作者设置的"是否运行"闸门被一次故障打开,可能写数据或发外部请求。 - 风险与回滚:只影响"启动条件求值出错 + retry 策略"这一错误路径;以前会无条件执行节点的运行,现在会失败或被跳过。回滚即撤销本 PR。 - 先看:`packages/services/service-automation/src/dag-traversal.ts` 的 `startConditionHolds` 与 `executeWithoutRetry` 里新增的闸门;其次 `engine.ts` 的 `execute` 闸门改为调用同一函数。 - 两分钟验证:`pnpm --filter @objectstack/service-automation exec vitest run src/start-condition-retry-33935.test.ts`,预期 5 个用例全部通过。 - 需要你做的:无,席位落地。 ## What changes - `dag-traversal.ts` gains `startConditionHolds`, the one start-node trigger-condition evaluator. No condition authored means the run proceeds. A condition that does not hold returns `false`. A condition that cannot be evaluated throws, as `evaluateCondition` already does (ADR-0032 §1c). - `execute()` (attempt 1) calls it instead of its inline copy, and its behaviour is unchanged. - `executeWithoutRetry` (every retry attempt) now calls the same gate in the same place, after the start-node lookup and before the input-schema guard and any node. Before, it went straight to the nodes, so a condition that faulted on attempt 1 let attempts 2 and later run the nodes ungated. - Result under `strategy: 'retry'`: a condition that faults on every attempt is retried as a fault, and the run ends `failed` with no node executed. A condition that faults once and then holds runs the nodes once. A condition that faults once and then does not hold answers the same `condition_not_met` skip that attempt 1 gives. The default strategy is unchanged. - The dry-run contract's retry qualifier (the divergence that the contract for objectstack-ai#33757, in PR objectstack-ai#33799, names) can be dropped once this lands. That follow-up belongs to the spec owner. - A patch changeset for `@objectstack/service-automation`. ## Tests New file `packages/services/service-automation/src/start-condition-retry-33935.test.ts`, with five pins written against an executor that counts real node executions: 1. A condition that faults on every attempt (a real CEL fault, `'abc' > 10`) with `retry` and `maxRetries: 2`: no node runs, the result is `success: false`, `status: 'failed'`, the gate is evaluated 3 times, and 3 failed rows are written. 2. Faults on attempt 1, then holds: the nodes run once and the gate is evaluated twice. 3. Faults on attempt 1, then does not hold: the `condition_not_met` skip envelope, no node, and the gate is evaluated twice. 4. CONTROL, default strategy: `failed` on the first fault, one evaluation, one failed row. 5. CONTROL, `retry` with a condition that holds or does not hold on attempt 1: answered on attempt 1, as before. Ablation (the fix was committed first; `scripts/ablation-replace.mjs`, mutation proven on disk, restore proven): the re-evaluation in `executeWithoutRetry` was replaced with `if (false ...)`. Pins 1–3 went red and the two controls stayed green. Pin 1's red was `expected 1 to be +0` at `expect(runs.count).toBe(0)`: the node ran on a retry attempt, which is the defect reproduced. Restore: blob back to the HEAD blob, and `git diff HEAD` empty. ## Acceptance notes - `retryExecution` treats a skipped attempt (`success: true`) as a successful attempt and returns it, so a skip on attempt 2 ends the retry loop. That matches attempt 1's skip answer. Attempt 1's fault still left its one `failed` row. - The sibling objectstack-ai#33893/objectstack-ai#33905 fold (branch `claude/area-A5b-33893` at 75b2f32) also edits `engine.ts`. `git merge-tree` against it and against `origin/main` is clean, and its hunks do not touch the start-condition gate or the `executeWithoutRetry` host. ## Verification Final head b55412e, after merging `origin/main`, with install and the closure rebuilt: <details><summary>Touched package and direct dependents</summary> - `pnpm --filter @objectstack/service-automation typecheck`: exit 0 (tsc plus `check:test-typecheck` OK) - `pnpm --filter @objectstack/service-automation test`: exit 0, Test Files 283 passed (283), Tests 4006 passed (4006) - `@objectstack/trigger-record-change` test: exit 0, 12/12 files, 122/122 tests - `@objectstack/trigger-schedule` test: exit 0, 13/13 files, 256/256 tests - `@objectstack/plugin-approvals` test: exit 0, 120/120 files, 1652/1652 tests - eslint on the three touched source files: exit 0 </details> <details><summary>Derived gate families</summary> dispatch-gates --commands derived 71 families for this diff at b55412e. 70 ran locally, all exit 0 (each exit captured before any pipe; check:type-check-debt ran under the verify lock: re-measure OK, 0 raw tsc errors). 1 not run locally: check:dual-build-cjs-loads, left to CI. The --ran reconciliation reads 71 derived, 70 run, 1 UNRUN (that one). </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jUZKdq3PK2Sab53cT3)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
domain:spec#1 · os-project-manager · session_01FEkQ5nK9bbdtG9bJTBujTZ
Fixes #33757
Clause-②: yes (widening)
Metadata-protocol: none
Refs #33661 (the implementation in
@objectstack/service-automationand@objectstack/runtime, which waits on this contract). objectstack-ai/cloud#3309 item 5, option A, ruled by the account owner.维护者速读
IAutomationService新增可选方法dryRun(definition, { userId, record, … }),以及它的入参、结果和步骤类型;方法注释写明试跑规则。只改接口与说明,不改任何运行时行为。第二至五轮按契约复审补上:开始条件不成立或求值出错时的结果(判定顺序与已发布流程的运行一致;流程声明重试策略时,求值出错的答复是试跑自己的,引擎侧见 service-automation: a retried run skips the flow's start condition (errorHandling.strategy 'retry') #33935)、写入权限的三态答复(允许 / 拒绝 / 未判定)、并行分支的步骤顺序。packages/spec/src/contracts/automation-service.ts的dryRun?(注释块(L1787–L1952,试跑规则,L1797 起是判定顺序);同文件 L1440–L1709 的新类型(L1594 写入权限三态,L1701startCondition);automation-dry-run.pin.test.ts。pnpm --filter @objectstack/spec exec vitest run src/contracts/automation-dry-run.pin.test.ts,预期 5 条全绿。What changes
packages/spec/src/contracts/automation-service.ts:IAutomationService.dryRun?(definition: unknown, options: FlowDryRunOptions): Promise<FlowDryRunResult>(L1953), optional. Measured: everyIAutomationServicemember pastexecuteandlistFlowsis optional, andcanonicalizeStoredFlow?is optional for the same reason this is ("only the implementation that registers flows can offer this"). A caller that finds it absent says a dry run is not available.FlowDryRunOptions(L1450): a requireduserId;record,previous,object,event,paramsandlocalepicked fromAutomationContext(the keysexecutereads); andtenantId, which must be an organization the named user is a member of. No grants slot: positions, permission sets, posture and email are resolved by the engine for the named user.FlowDryRunStatus(L1504):'completed' | 'condition_not_met' | 'stopped' | 'failed' | 'refused', each defined in its doc.FlowDryRunResult(L1672):status, one orderedstepslist,refusal({ code, message }, set exactly on'refused'),startCondition({ expression, result: false }on'condition_not_met', or{ expression, fault }on a'failed'whose start condition threw; never both),error(set exactly on'failed'). NorunId.FlowDryRunRefusalCode(L1513):Extractof two existingAutomationResult.codemembers (PERMISSION_DENIED,FLOW_INPUT_SCHEMA_INVALID). No code minted.FlowDryRunWritePermission(L1594):'allowed' | 'refused' | 'not_judged': an insert or update is'allowed'or'refused'from the object-level check, a delete is'not_judged', and every write is'not_judged'when no object-level check is installed.FlowDryRunStep(L1662): a union discriminated onkind, overroute(start,end,loop,parallel,try_catch; anendwithoutcome: 'refused'carriesrefusalMessage),assignment(values set),decision(branch,expressions,next: which branch, and every expression that held),read(object,recordIds),write(operation,object,recordIds,values,permission),outbound(payload) andstop(reason:'approval' | 'wait' | 'screen' | 'starts_flow' | 'suspends' | 'not_simulated', withapprovers/wait/screen/flowName). Every step carriesnodeId,nodeType, andrefusal(FlowInnerRefusal) orerrorwhen the node met one.userIdthrowsTypeError; a definitionregisterFlowwould refuse under its ownnamethrows whatregisterFlowthrows; then a non-membertenantIdand admission (status: 'refused',PERMISSION_DENIED); then a start condition that does not hold (status: 'condition_not_met', mirroringexecute's skip exit) or whose evaluation throws (status: 'failed', no steps, the fault instartConditionanderror, mirroringexecute's catch on the default error strategy; undererrorHandling.strategy: 'retry'the dry run's own answer, service-automation: a retried run skips the flow's start condition (errorHandling.strategy 'retry') #33935);execute's re-entrancy guard cannot fire for a dry run; then the node input-schema check (status: 'refused',FLOW_INPUT_SCHEMA_INVALID), the orderexecuteevaluates the last two in; no steps on any of these; then the nodes.nameis the one registration judges and nodes read theirflows.<flow>.…keys under; a registered flow of that name is neither read nor touched.listFlows/getFlow), trigger never armed, one pass with no retry, no run persisted.userIdwith that user's own resolved grants, never elevated (arunAs: 'system'definition included); a door serving a person passes that person's id.flowStartRefusal's three rules judged on the supplied definition against the named user, no system-principal bypass, each refusalPERMISSION_DENIEDwith the by-name start's message.permission('not_judged'never means allowed), and a'refused'write's step carriesrefusal(PERMISSION_DENIED).faultedge or out of atry_catch, or ends'failed', the dry run's own answer in both directions.notify,http,connector_action,script,save_notice): never sent, payload reported, no output bound.supportsPause: truestops the run and is reported by what it would do; no approval request, no resume, no child run. Any node type outside the named classes stops asnot_simulated.Generated:
packages/spec/api-surface/contracts.jsonandpackages/spec/export-origins/contracts.json(the 14 new exported types), regenerated on the tree merged withmainat1e65a389. Changeset:.changeset/33757-flow-dry-run-contract.md,@objectstack/specpatch (Metadata-protocol: none; AGENTS.md §3, every entrypatch).Round 2
Answers contract review 6893425750 (FAIL at
0695d5ce) under the seat's ruling 6893433747. Headf635d5af;mainmerged first (bd969ec5, no text conflict, the two generated files regenerated after).'condition_not_met'andFlowDryRunResult.startCondition: { expression; result: false }. Its place in the answer order was wrong atf635d5af(after the input-schema refusal) and is corrected in round 3 (S10, below): after admission and before the input-schema check, asexecuteevaluates them (engine.tsL7711–L7731 on the merged tree: the start node'scondition, a plain string routed through CEL, evaluated before the re-entrancy guard; the skip answersoutput: { skipped: true, reason: 'condition_not_met' }).FlowDryRunWritePermissionand a requiredpermissionon every write step:'allowed'/'refused'fromcanWriteObject(insert / update) as the named user,'allowed'never meaning the write would succeed;'not_judged'for every delete and for everythingcanWriteObject's own doc disclaims (row-level and post-image rules, controlled-by-parent, the tenant post-image, provenance gates, theowner_idforge). The doc says once that'not_judged'never means allowed. The round-1 sentence that promised arefusalfor any permission refusal is gone;FlowDryRunStepBase.refusal's example is now a read refused in the user's scope.parallel_gateway/join_gateway(no executor on the tree) replaced by the shippedparallel(builtin/parallel-node.ts). Measured order: aparallelnode's run record lists each branch's steps together inconfig.branchesorder (branchSteps.flat()overPromise.all, which keeps input order); an inclusive decision takes its branches one at a time, depth-first, in out-edge order (dag-traversal.tsL726–L752, "neverPromise.all"); several unconditional out-edges run underPromise.alland the live log interleaves them (L786–L793). The contract lists every side-by-side case branch by branch in declaration order, each branch's steps together, so the dry run's list is deterministic; for unconditional fan-out that is the dry run's own order, not the live log's.FLOW_NO_START_NODEremoved fromFlowDryRunRefusalCode(registration refuses that definition, so the throw answers first), with a one-line note in the type's doc and an@ts-expect-errorpin.'failed'now reads "the dry run could not continue past a step", the equivalence claim is gone, and both directions are named: unset outbound output, a never-elevatedrunAs: 'system'draft and a filtered read missing a simulated write (fails where the live run would not); validation, uniqueness, required fields and unjudged refusals (passes where the live run would fail).namestands whereregisterFlowtakes one: the name registration judges and the per-flow key nodes read; no registered flow is read or touched.tenantIdtoday.resolveUserAuthzGrantsapplies positions and permission sets only in their own organization, so a non-member resolves none of them there, but it still lists that organization's members inorg_user_ids(resolve-authz-context.tsL2494–L2504). The contract therefore makes the membership refusal the dry run's own:status: 'refused',PERMISSION_DENIED, before admission.'approval','wait','screen','starts_flow','suspends','not_simulated');FlowDryRunDecisionStep.expressionsis a list of every expression that held, in declaration order (empty on the default branch).startCondition,expressions, and the new doc sentences); both ablations re-run on the new head.Round 3
Answers delta review 6894214508 (FAIL at
f635d5afon S10; F1–F6 and N7–N9 closed) under the seat's ruling 6894244795. Head5753362e.mainhas moved since1e65a389but touches none of the PR's files, so no merge this round.execute: a non-membertenantIdand admission (PERMISSION_DENIED), then the start condition ('condition_not_met'), then the node input-schema check (FLOW_INPUT_SCHEMA_INVALID). The start-condition bullet names that order ("executeevaluates the start condition before its node input-schema check, so a condition that does not hold answers first";engine.tsL7724, thenvalidateNodeInputSchemas~L7787, as the review measured). The pin gains one assertion on the three bullets' order, and the round-2 F1 line above is corrected.failedOnPermissionfixture's'refused'write step carriesrefusal: { code: 'PERMISSION_DENIED', … }, and the method doc now says so: a'refused'write's step carriesrefusal(code: 'PERMISSION_DENIED').'allowed'or'refused', a delete answers'not_judged', and the refusals the check does not judge are never reported for any operation. Measured for "no object-level check installed":canWriteObjectis a method of@objectstack/plugin-security's service (security-plugin.tsL3747) and is not onISecurityService(contracts/security-service.tsdeclares onlycanReadObject?); no other package calls it. So a kernel without that plugin has no such check, and both docs say every write step then answers'not_judged'.FlowDryRunResult.steps) says that for a node's unconditional out-edges the list is the dry run's own order: the live run runs them underPromise.all, and its step log can interleave them.Round 4
Answers delta review 6895013488 (FAIL at
5753362eon S14; S10 and N11–N13 closed) under the seat's ruling 6895023324. Head58c56c95. No type is added or renamed, so both generated baselines are unchanged (regenerated, no diff).evaluateConditionthrows when the CEL result is not ok, and on a structural ortemplate/flowdialect refusal (dag-traversal.tsL1118–L1188: L1129, L1142, L1173, L1184). Inexecutethat throw happens at the start-condition gate (engine.tsL7724), before the re-entrancy guard (L7762) andvalidateNodeInputSchemas(L7787); the catch setserrorMessage = err.message(L8020) and, not being anInputSchemaViolationError, answerssuccess: false,status: 'failed',error: errorMessagewith no node executed (or hands it to the retry strategy, which a dry run never uses: "one pass with no retry"). The contract now says the same in three places:conditionwhose evaluation throws answersstatus: 'failed'and no steps, the condition and the thrown message instartCondition(fault) and the same message inerror, before the input-schema check;'failed'status doc (L1481–L1495): "could not continue past a step, or could not evaluate the start condition", with its own sentence for the condition case (no steps; this one follows the live run);FlowDryRunResult(L1667–L1701):stepsis empty on that'failed';startConditionis{ expression; result: false; fault?: never } | { expression; fault: string; result?: never }, set exactly when the run ended on the condition,faultbeing the textexecuteanswers aserror.execute's re-entrancy guard (reentrancy_loop_guard), which sits between the two checks, cannot fire for a dry run, since a dry run holds no active-run key and writes nothing.allowedorrefusedfrom the object-level write check, a delete answersnot_judged, every write answersnot_judgedwhen no object-level check is installed,not_judgednever means allowed, and row-level refusals are never reported. The start-condition bullet gains the faulting case.StartConditionShapepins the two-arm shape;bothResultAndFault(@ts-expect-error) refusesresultandfaulttogether; aconditionFaultedfixture ('failed', no steps,startCondition.fault,error); three new pinned sentences (the faulting-condition sentence, itsstartCondition(fault) clause, the re-entrancy clause); the order assertion now also requires the faulting-condition sentence between "Then the start condition." and "Then the node input-schema check".Round 5
Answers delta review 6896167662 (FAIL at
58c56c95on S16; S14 and N15 closed) under the seat's ruling 6896183344. Head2baaacd9. No type or export changes, so both generated baselines are unchanged (regenerated, no diff).execute's catch the strategy branch (engine.tsL8166) comes before the'failed'return, andretryExecution's attempts go throughexecuteWithoutRetry(dag-traversal.tsL1232), which finds the start node, runsvalidateNodeInputSchemasand thenexecuteNodewith no start-condition evaluation. So the round-4 "follows the live run" holds on the default error strategy only. The dry run's answer is unchanged ('failed', no steps,startCondition.fault, the same text inerror; "runs once per call, with no retry"), and each of the three sentences now carries the qualifier. On the default strategy it is the live run's answer. UndererrorHandling.strategy: 'retry'it is the dry run's own, because the live run hands the throw toretryExecution, whose attempts skip the start condition and run the nodes. Each names service-automation: a retried run skips the flow's start condition (errorHandling.strategy 'retry') #33935, the engine card, so the clause can go when it lands:'failed'status doc (L1490–L1498), which now says "it is the dry run's own answer, not a prediction" for that case;startConditiondoc (L1694–L1699).'failed'status doc's first paragraph is rewrapped to the block's 80 columns (L1481–L1489). No pinned string crossed it.errorHandling.strategy: 'retry'the answer is the dry run's own"). A new test requires "On the default error strategy", "errorHandling.strategy: 'retry'" and "service-automation: a retried run skips the flow's start condition (errorHandling.strategy 'retry') #33935" in each of the three docs. It also requires the'failed'doc's "it is the dry run's own answer, not a prediction", and the round-4 unqualified sentence ("This one follows the live run, whose") is gone from the file.Tests
packages/spec/src/contracts/automation-dry-run.pin.test.ts(theautomation-toggle-flow-callerpin's form, compiled bycheck:test-typecheck):Eq), plus a service class withoutdryRunthat still implementsPick<IAutomationService, 'execute' | 'listFlows' | 'dryRun'>.userIdrequired; no grants and no run-as channel (@ts-expect-erroronpositions,permissions,posture,email,runAs).AutomationResult.codemember;FLOW_NO_START_NODErefused by@ts-expect-error), the seven step kinds, the write operations, the three write permissions (required on every write step), the six stop reasons,expressions: string[], thestartConditionshape (two arms since round 4, never both); norunIdon the result.dryRundoc block must hold each ruled heading (including The name. and Step order.) and the key sentences ('condition_not_met','not_judged'never means allowed, the no-check-installed sentence, the refused-writerefusalsentence, the overlay and created-row sentences, the step-order sentences, "could not continue past this").conditionFaultedfixture, the doc sentences named above, and one test that the three docs qualify the live-run claim by the error strategy and name service-automation: a retried run skips the flow's start condition (errorHandling.strategy 'retry') #33935.Ablations (each red, then restored with
git diff HEADempty)All through
node scripts/ablation-replace.mjs(anchor hit 1 → 0; restore blob == HEAD each time). Nodist/is involved: the pin imports./automation-serviceby relative path. Round 2, onf635d5af(restore blobd6385572f811):'not_judged'never means allowed." from the method doc →AssertionError: \'not_judged'` never means allowed.: expected '/**\n * Dry-run a flow definition…' to contain …,Tests 1 failed | 2 passed (3)`.'FLOW_NO_START_NODE'back intoFlowDryRunRefusalCode→tsc -p tsconfig.test.json:automation-dry-run.pin.test.ts(97,50): error TS2344: Type 'false' does not satisfy the constraint 'true'.and(98,1): error TS2578: Unused '@ts-expect-error' directive.Round 3, on
5753362e(restore blob347e545f59f7):× answers in the live run's order: admission, then the start condition, then the input-schema check,AssertionError: answer order at 991, 1274, 1096: expected false to be true,Tests 1 failed | 3 passed (4).Round 4, on
58c56c95(restore blob223d130181b1):× the method's doc block states each ruled point(AssertionError: A \condition` whose evaluation throws: expected '/**\n * Dry-run a flow definition…' to contain …) and× answers in the live run's order …(answer order at 991, 1096, -1, 1901),Tests 2 failed | 2 passed (4)`.startConditionback to{ expression: string; result: false }→tsc -p tsconfig.test.json:automation-dry-run.pin.test.ts(100,43): error TS2344: Type 'false' does not satisfy the constraint 'true'.and(167,9): error TS2353: Object literal may only specify known properties, and 'fault' does not exist in type '{ expression: string; result: false; }'.Round 5, on
2baaacd9(restore blobda99c730352e):'failed'doc →× a faulting start condition follows the live run only on the default error strategy (#33935),AssertionError: the 'failed' status doc: expected '/**\n * The overall answer of {@link …' to contain 'On the default error strategy',Tests 1 failed | 4 passed (5).× the method's doc block states each ruled pointand the strategy test (the dryRun doc block: … to contain '\errorHandling.strategy: 'retry'`'),Tests 2 failed | 3 passed (5)`.Acceptance notes
scriptas outbound;subflow/mapstop (viasupportsPause: true, now reason'starts_flow'); thenot_simulatedstop; the'failed'status (reworded per F5); simulated writes not judged by validation.runAs: 'system'question (review ③): unchanged here, per the ruling. Rule 1 still refuses arunAs: 'system'definition of typeautolaunched,record_changeorschedulefor every named user; the seat takes it to the maintainer on Automation: run an unpublished flow definition once, unarmed, as a named acting user against a supplied record (a dry run before publish) #33661. Admitting it later, still never elevated, would be a widening of this contract.flowStartRefusallives in@objectstack/runtimeand reads the caller'sExecutionContext;@objectstack/service-automationdoes not depend on runtime. The named user'ssystemPermissionsandprincipalKind: 'agent'are both resolvable from a user id throughresolveUserAuthzGrants, so the rules can be judged in the service without a second copy of the predicate, provided Automation: run an unpublished flow definition once, unarmed, as a named acting user against a supplied record (a dry run before publish) #33661 moves it where both packages reach it. The permission answer needscanWriteObject(plugin-security, not onISecurityService) reachable from the run, with'not_judged'where it is not; the tenant membership read is new.Verification
All on head
2baaacd9(the round-2 merge withmainat1e65a389plus the round-3, round-4 and round-5 commits; latermaincommits touch none of this PR's files).pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2(whole spec suite, under the verify lock):Test Files 934 passed (934),Tests 28511 passed | 1 todo (28512),VERDICT command-exit 0.pnpm --filter @objectstack/spec typecheck(tsc --noEmit,check:scripts-typecheck,check:test-typecheckundertsconfig.test.json, 8 GB heap):VERDICT command-exit 0. The pin file adds no diagnostic and no debt-ledger entry.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat2baaacd9→ the same 88 families, each run with its exit code captured before any pipe, after building@objectstack/lint...,@objectstack/objectql...and@objectstack/spec(each exit 0).check:generatedandcheck:api-surfaceamong them, exit 0 (rounds 4 and 5 change no exported name, so both baselines regenerate with no diff).--ran:88 derived famil(ies) accounted for — 87 run, 1 NOT-MEASURED.pnpm check:dual-build-cjs-loads, reason: exit 3, PREREQUISITE NOT MET (it reads every package'sdist/). CI runs it.pnpm lint,test:repo, the dogfood battery (no!in the title and no(narrowing)arm).Human Minimum
packages/specholds no runtime logic. (Interface and types only; the contract members are TypeScript interfaces like the rest of the file.)pnpm lintpasses. (Repo-wide lint is CI's run.)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code