Repository navigation
feat(verify): run a flow locally and report its node trace before it is submitted - #35243
Conversation
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…orts; collection imports Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 29 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 — 44 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 93b117015de8edc439dc2bf48963e07cc4db34ee && git checkout 93b117015de8edc439dc2bf48963e07cc4db34ee
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b02484e13a2e43f12d2c942e9a8966ece9cfa31e 3d4db25136b66d721c89967d9658172c76dfb8a6 && git checkout -B drift-repro b02484e13a2e43f12d2c942e9a8966ece9cfa31e && git merge --no-ff 3d4db25136b66d721c89967d9658172c76dfb8a6
node scripts/docs-audit/affected-docs.mjs --json b02484e13a2e43f12d2c942e9a8966ece9cfa31e
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract review brief handed to the isolated reviewer (TIER_DEFAULT, declaration face), posted beside its record: Contract review brief — PR #35243 @
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract reviewServed-tier: Inputs: brief 6987283704; card #34779 (its body, the release 6963643452, claim 6983783896, os-dev report 6987214963 and area note 6987264675); the PR #35243 body; the full diff against merge-base Face: the committed file list is ① Derived judgments
Findings:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
…le still runs; api and time-relative starts get their record Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract reviewServed-tier: Round 2. It reads the delta from Inputs: the seat's S3 ruling A, as the coordinator relayed it (outbound nodes are not executed under Face: unchanged. The PR's file list against its new merge-base ① Derived judgments
Findings:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: FAIL |
…child flow's stop is named Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…pe boundary; the time-relative start sets no acting organization Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract reviewServed-tier: Round 3. It reads the delta from Inputs: round-2 record 6989190390; os-dev round-3 report 6990155397 on #34779; the PR body as the seat rewrote it for this head; Face: unchanged. The delta touches 5 of the PR's 9 files and adds no path. There is no ① Derived judgments
Findings:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Final head for L1 · 2026-11-18T20:28ZHead-sha: |
|
repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9 L1 review · ACCEPT · 2026-11-18T20:31ZHead:
Before landing (no head move)
Notes (non-blocking)
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Landing · 2026-11-18T20:34Z
L1 C1, settled by the seat:
Open findings: contract nits N1 to N3; L1 note N1 (the State: ready + auto-merge armed by area o1-B (lease Dev-effort: high · Rounds: 3 |
Requested by Warren · project thread
Fixes #34779
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
os verify新增--flow NAME(配--flow-record/--flow-input),在一次全新的内存启动里把一个流程真实跑一遍,逐节点报告状态、第一个失败(错误码与节点名)以及这次运行写了什么。--flow时os verify行为字节不变;回滚即 revert 本 PR。运行只写本次启动的内存库,写到其它数据源的对象在驱动被调用前就被拒;http、connector_action(含插件经它贡献的连接器)、notify、script这四种外呼节点在本地不执行,运行停在第一个并点名它;插件自定义的其它外呼节点类型不在替身之列,仍会真实执行。被 try_catch 捕获的停止只列出,不会掩盖之后真实失败的节点。packages/verify/src/flow-run.ts的standInOutbound(外呼节点替身,只装在本次 verify 启动的引擎上)与confineToEphemeral(隔离中间件);同文件runFlowProof第 6 步的启动分支(记录触发走真实写入,api 与 time_relative 按各自触发器的上下文启动);packages/cli/src/commands/verify.ts中失败计数的接线。pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2 src/flow-run.test.ts,预期 13 个测试全绿。What changes
@objectstack/verify:runFlowProof(stack, config, { flow, record?, input? })runs one flow once on a booted verify stack and returns aFlowRunReport.formatFlowRunReportprints it.listRuns), any node whose type no installed plugin runs (getUnknownNodeTypeAudit, mapped to node ids throughcollectFlowGraphs, reached or not), the first failure with its kind, code and node, and every write the run made.getFlow,getFlowRuntimeStates,getUnknownNodeTypeAudit,listRuns,execute, and (for the outbound stand-in)getRegisteredNodeTypes,getActionDescriptorandregisterNodeExecutor, called on the verify stack's own engine. Nothing underpackages/services/service-automationchanged.The run starts the way production starts it.
--flow-recordrow as the dev admin: an insert for a create or write leg; seed, then an unchanged save, for an update leg; seed, then delete, for a delete leg.--flow-input) as bothrecordandparams, withevent: 'api'(packages/triggers/trigger-api/src/api-trigger.ts, the queue consumer inarm).--flow-recordrow, seeded first so it is in the table, asrecordand asparams, with the watchedobjectandevent: 'time_relative'(packages/triggers/trigger-schedule/src/time-relative-trigger.ts, the per-row context in the sweep). The acting organization a sweep can set (tenantId) is not reproduced. A time-relative flow given no record isrecord_required.runAs: 'system', starts with no caller and--flow-inputas itsparams. A real tick's ownjobId/flowName/scheduleparams and a binding's acting organization are not reproduced.--flow-inputas its params.The trigger is checked before anything runs. A flow whose trigger never binds is reported with the trigger named and the engine's reason (
unboundCause), and nothing is run. The one exception isdeployment_policy, whichFLOW_UNBOUND_CAUSEScalls an operator setting and not a defect: a schedule or time-relative trigger the scheduled-work switch keeps unarmed (the default) is reported as not armed, with the engine's sentence, and the flow still runs through the no-caller start.Confinement. The run registers an ObjectQL middleware, once per engine. It refuses insert, update, delete, purge and restore on any object whose driver is not the ephemeral default driver the boot created. The refusal is
PERMISSION_DENIED/403 and fires before the other datasource's driver is called. The node that made the write fails, naming the object and the datasource, and the refused write is listed.Four outbound node types are not executed. Before the run starts, each registered
http,connector_action,notifyandscriptexecutor on the verify stack's engine is replaced, once per engine, by a stand-in that executes nothing. Every connector a plugin contributes runs behindconnector_action, so it is covered. A plugin's own node type that calls out under another name is not stood in, and runs for real. The stand-in keeps the type's own descriptor and returns a guard-class failure, so nofaultedge on the node is followed. Production paths are untouched, because the stand-in only exists on the engineos verify --flowboots for this run.subflow/mapnode whose child run was stopped.stoppedand the first failure isoutbound_not_run, naming the outbound node. For a child flow that is the child's node, and afaultedge on the calling node is still followed, because the subflow arm does not carry the guard class (service-automation is not edited).try_catchregion's catch, a parallel branch) is a note, and a later node that fails is still the first failure and still failsos verify.outboundStops. A run that ends at a stop is reported and does not failos verify.os verify --flow NAME [--flow-record JSON] [--flow-input JSON]boots a fresh stack for the flow run and prints the report.--flowhelp text names the four stood-in types and says a plugin's own outbound node type runs for real.--jsoncarries the report asflowRun.packages/cli/src/utils/flow-json-flag.ts.Docs.
content/docs/deployment/cli.mdxdocuments the flag next to the otheros verifyruntime checks, and addsflowRunto the JSON section.Ported from cloud (read only, at
c21b372). The semantics of the studio flow tools were ported and adapted to the framework's shapes. Cloud hand-builds a trigger context; here the real trigger fires, or the trigger's own context is built from the trigger's source. Sources:packages/service-ai-studio/src/tools/flow-tools.ts: the shape of the node trace and first failure.packages/service-ai-studio/src/tools/flow-trigger-words.ts: start mode chosen per trigger type.Nothing hosted, tenant-scoped or secret was moved.
Tests
packages/verify/src/flow-run.test.tsholds thirteen pins against a realbootStackwith service-automation, service-datasource and the triggers:fr_ledgerrow it wrote. The triggering write and the run-history rows are excluded.fr_missing_nodeis reported with node idmysterynamed, and the run fails with kindno_executor.trigger_unbound, with the trigger named as'record_change' on 'fr_watch'and causemissing_trigger. No steps run and nothing is written.create_recordintofr_remote, an object on datasourcefr_remote_dsbacked by a recording driver double, fails with kindconfined_write. The node is named, the refused write is listed, and the remote driver's call log is unchanged.httpnode aimed at a local server the test owns (loopback allowlisted for the egress guard) is stopped: the server receives no request, the report saysstoppedandoutbound_not_runnaming nodecall(http), the log shows onlystartandcall, and the Ledger write after it never ran.try_catcharound anhttpnode, then a Ledger write with no name. The server receives nothing, the verdict isfailed, the first failure isnode_failedatboom, the stop is listed inoutboundStops, and there is one hard failure.failed, the first failure namesfork_boom, and the stop is listed.httpnode is stopped. The verdict isstopped, the first failure isoutbound_not_runnaming the child's nodechild_call, the Ledger write after the call never ran, and there are no hard failures.deployment_policy, no failure, a no-caller start,completed, and its Ledger row.record.namewriteshook for zetafrom--flow-input {"name":"zeta"}.record.nameandrecord.idwrites a row naming the seeded contract's id. The seed is not reported as the flow's write.record-after-updateflow.record-after-deleteflow, and the row is gone.packages/cli/src/utils/flow-json-flag.test.tshas 7 tests: it parses objects, and refuses arrays, scalars and bad JSON, naming the flag.Each changed behaviour was ablated with
scripts/ablation-replace.mjsand turned red. Each restore was proven by the tool: blob equals HEAD andgit diff HEADis empty. The verify sources are imported relatively by the test, so no build sits between the mutation and the run. Pins 12 and 13 cover behaviour this PR already had and that this round did not change, so they were not ablated.Ablation readings
report.missingExecutors = [];expected [] to deeply equal [ { nodeId: 'mystery', ... } ], 1 failed / 3 passedif (report.trigger && !report.trigger.bound)→if (false)expected { kind: 'not_started', ... } to match object { kind: 'trigger_unbound', ... }, 1 failed / 3 passedexpected [ { object: 'fr_watch', ... } ] to deeply equal [], 1 failed / 3 passedif (ql.getDriverForObject(op.object) === ephemeral) return next();→return next();completedand wroteinsert fr_remote remote_1 (datasource fr_remote_ds)into the remote driver; expectedfailed, 1 failed / 3 passedreport.confinement.outbound = [];)COMPLETED, 3 steps, and the local server received/ping:expected [ '/ping' ] to deeply equal [], 1 failed / 9 passedconst policyUnarmed = false;not_runinstead ofcompleted, and the time-relative pin failed too (its trigger is policy-unarmed as well), 2 failed / 8 passedrecorddropped from the API contextexpected "completed", received "failed", 1 failed / 9 passedrecorddropped from the sweep contextexpected "completed", received "failed", 1 failed / 9 passedexpected "failed", received "stopped", 2 failed / 11 passedexpected "stopped", received "failed"; the parallel pin also went red, because its container step carries the sentence; 2 failed / 11 passedThe first round's first CONTROL and confinement attempts were no-ops:
ablation-replacerefused them because the replacement count did not rise. Both were re-run with a marker comment in the replacement. The first four rows were measured against 4 pins, the next four against 10, and the last two against the current 13.Suite and typecheck readings
flow-run.test.tsat17561e0f98(the last commit that changes code;3d4db25136changes only prose)@objectstack/verifyfull suite at3d4db25136@objectstack/verifytypecheckcheck:test-typecheck)@objectstack/clitypecheck at3d4db25136flow-json-flag.test.tsos verify --flow todo_task_reminderonexamples/app-todo, at3d4db25136send_reminder(notify) was not executed: it was caught in itstry_catchand is listed with the went-on-past note. 0 hard failures.Round 1 also ran the
@objectstack/cliunit tier: 427 of 429 files passed, and the two that failed passed with 29 tests once the CLI was built (the published-subpath pins readdist). Rounds 2 and 3 changed only help text in the cli, so the tier was not re-run. The cli integration tier andtest:repoare left to CI. The diff touches no integration-tier file and no spawn entry point.Acceptance notes
http,connector_action,notifyorscriptis not stood in and runs for real. An object's declared webhooks fire on record events, not through flow nodes, and are outside the stand-in (not measured).scripts/check-verify-stand-in-erasure.mjsis outside the claimed file surface.check:verify-stand-inrequires every new@objectstack/verifyexport to be classified, sorunFlowProofandformatFlowRunReportare recorded there as not stand-ins.examples/app-todo.os verify --flow todo_task_reminderin a default environment now reports the schedule as not armed on this deployment, runs it with no caller, and stops thenotifynodesend_reminderinside itstry_catch. The catch region ran, the run completed, andos verifypassed with 0 hard failures.Verification
Gates
node scripts/pm/dispatch-gates.mjs --ran, each exit code recorded) gives 122 families: 121 run with exit 0, and 1 NOT MEASURED. The NOT MEASURED family ischeck:dual-build-cjs-loads, which needs a fullpnpm build. CI'sBuild Corestep runs it.3d4db25136, and all exited 0.overlap-check:VERDICT clean exit 0. The branch merges cleanly with origin/mainb02484e13a, with feat(lint): five publish-time checks for metadata the runtime ignores, and four build probes over what landed #35244 and with fix(auth)!: a server outside development mode refuses a development seed credential #34717 (both sharecli.mdx).f2078e3674. The commits on main since then touch none of this PR's files, and nothing underpackages/verify,packages/services/service-automation,packages/objectqlorpackages/triggers.Generated by Claude Code