Skip to content

feat(verify): run a flow locally and report its node trace before it is submitted - #35243

Merged
objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/issue-34779-verify-flow-run
Nov 18, 2026
Merged

objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/issue-34779-verify-flow-run

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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 a FlowRunReport. formatFlowRunReport prints it.

    • The report carries each step's status as the engine's run log records it (listRuns), any node whose type no installed plugin runs (getUnknownNodeTypeAudit, mapped to node ids through collectFlowGraphs, reached or not), the first failure with its kind, code and node, and every write the run made.
    • Engine members used: getFlow, getFlowRuntimeStates, getUnknownNodeTypeAudit, listRuns, execute, and (for the outbound stand-in) getRegisteredNodeTypes, getActionDescriptor and registerNodeExecutor, called on the verify stack's own engine. Nothing under packages/services/service-automation changed.
  • The run starts the way production starts it.

    • A record-change flow is fired by its own trigger. The run writes the --flow-record row 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.
    • An API-triggered flow is started with no caller and the context the inbound hook builds: the body (--flow-input) as both record and params, with event: 'api' (packages/triggers/trigger-api/src/api-trigger.ts, the queue consumer in arm).
    • A time-relative flow is started with no caller and the context the sweep builds for each row: the --flow-record row, seeded first so it is in the table, as record and as params, with the watched object and event: '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 is record_required.
    • A schedule, or another flow declared runAs: 'system', starts with no caller and --flow-input as its params. A real tick's own jobId / flowName / schedule params and a binding's acting organization are not reproduced.
    • Any other flow goes through the trigger route as the dev admin, with --flow-input as 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 is deployment_policy, which FLOW_UNBOUND_CAUSES calls 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, notify and script executor on the verify stack's engine is replaced, once per engine, by a stand-in that executes nothing. Every connector a plugin contributes runs behind connector_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 no fault edge on the node is followed. Production paths are untouched, because the stand-in only exists on the engine os verify --flow boots for this run.

    • Each failing step is classified. A stop is the stopped node's own step, or a step whose failure carries the stand-in's sentence: a container around it, or a subflow / map node whose child run was stopped.
    • The first failure is the first failing step that is not a stop. Only when the run failed and no other step failed is the stop why it ended: then the verdict is stopped and the first failure is outbound_not_run, naming the outbound node. For a child flow that is the child's node, and a fault edge on the calling node is still followed, because the subflow arm does not carry the guard class (service-automation is not edited).
    • A stop the run goes on past (a try_catch region's catch, a parallel branch) is a note, and a later node that fails is still the first failure and still fails os verify.
    • Every stood-in node the run reached is listed in outboundStops. A run that ends at a stop is reported and does not fail os verify.
  • os verify --flow NAME [--flow-record JSON] [--flow-input JSON] boots a fresh stack for the flow run and prints the report.

    • These outcomes fail the command: a failed run, a missing executor, an unbound trigger (other than by policy), a record-change or time-relative flow given no record, and a write refused outside the stack.
    • These are reported but do not fail it: a run its start condition skipped, a run that paused at a screen, wait or approval, a run that ended at an outbound stop, and a trigger left unarmed by the deployment's switch.
    • The --flow help text names the four stood-in types and says a plugin's own outbound node type runs for real. --json carries the report as flowRun.
    • The JSON flag parser lives in packages/cli/src/utils/flow-json-flag.ts.
  • Docs. content/docs/deployment/cli.mdx documents the flag next to the other os verify runtime checks, and adds flowRun to 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.ts holds thirteen pins against a real bootStack with service-automation, service-datasource and the triggers:

  1. CONTROL. A healthy record-change flow, fired by a real insert, reports each node as success and the one fr_ledger row it wrote. The triggering write and the run-history rows are excluded.
  2. No executor. A node of type fr_missing_node is reported with node id mystery named, and the run fails with kind no_executor.
  3. Unbound trigger. Kind trigger_unbound, with the trigger named as 'record_change' on 'fr_watch' and cause missing_trigger. No steps run and nothing is written.
  4. Confinement. A create_record into fr_remote, an object on datasource fr_remote_ds backed by a recording driver double, fails with kind confined_write. The node is named, the refused write is listed, and the remote driver's call log is unchanged.
  5. Outbound not run. An http node aimed at a local server the test owns (loopback allowlisted for the egress guard) is stopped: the server receives no request, the report says stopped and outbound_not_run naming node call (http), the log shows only start and call, and the Ledger write after it never ran.
  6. Caught stop, later failure. A try_catch around an http node, then a Ledger write with no name. The server receives nothing, the verdict is failed, the first failure is node_failed at boom, the stop is listed in outboundStops, and there is one hard failure.
  7. Parallel. One branch calls out and the other branch's write fails. The verdict is failed, the first failure names fork_boom, and the stop is listed.
  8. Child flow. A parent calls a child whose http node is stopped. The verdict is stopped, the first failure is outbound_not_run naming the child's node child_call, the Ledger write after the call never ran, and there are no hard failures.
  9. Policy-unarmed schedule. With the scheduled-work switch off, a schedule flow reports cause deployment_policy, no failure, a no-caller start, completed, and its Ledger row.
  10. API record. An API-triggered flow whose node reads record.name writes hook for zeta from --flow-input {"name":"zeta"}.
  11. Time-relative record. A time-relative flow whose node reads record.name and record.id writes a row naming the seeded contract's id. The seed is not reported as the flow's write.
  12. Update leg. The seed-then-save fires a record-after-update flow.
  13. Delete leg. The seed-then-delete fires a record-after-delete flow, and the row is gone.

packages/cli/src/utils/flow-json-flag.test.ts has 7 tests: it parses objects, and refuses arrays, scalars and bad JSON, naming the flag.

Each changed behaviour was ablated with scripts/ablation-replace.mjs and turned red. Each restore was proven by the tool: blob equals HEAD and git diff HEAD is 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
Pin Mutation Result
no executor report.missingExecutors = []; expected [] to deeply equal [ { nodeId: 'mystery', ... } ], 1 failed / 3 passed
unbound trigger if (report.trigger && !report.trigger.bound) → if (false) expected { kind: 'not_started', ... } to match object { kind: 'trigger_unbound', ... }, 1 failed / 3 passed
CONTROL trigger-write exclusion removed expected [ { object: 'fr_watch', ... } ] to deeply equal [], 1 failed / 3 passed
confinement if (ql.getDriverForObject(op.object) === ephemeral) return next(); → return next(); run completed and wrote insert fr_remote remote_1 (datasource fr_remote_ds) into the remote driver; expected failed, 1 failed / 3 passed
outbound stand-in not installed (report.confinement.outbound = [];) run COMPLETED, 3 steps, and the local server received /ping: expected [ '/ping' ] to deeply equal [], 1 failed / 9 passed
policy const policyUnarmed = false; the schedule pin got not_run instead of completed, and the time-relative pin failed too (its trigger is policy-unarmed as well), 2 failed / 8 passed
api record record dropped from the API context expected "completed", received "failed", 1 failed / 9 passed
time-relative record record dropped from the sweep context expected "completed", received "failed", 1 failed / 9 passed
caught stop (round 3) a stop first in the log masks the rest (the round-2 behaviour) caught and parallel pins: expected "failed", received "stopped", 2 failed / 11 passed
child flow (round 3) the stand-in's sentence no longer recognised child pin expected "stopped", received "failed"; the parallel pin also went red, because its container step carries the sentence; 2 failed / 11 passed

The first round's first CONTROL and confinement attempts were no-ops: ablation-replace refused 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
Run Result
flow-run.test.ts at 17561e0f98 (the last commit that changes code; 3d4db25136 changes only prose) 13/13 passed
@objectstack/verify full suite at 3d4db25136 53 files, 458 tests passed
@objectstack/verify typecheck exit 0 (tsc plus check:test-typecheck)
@objectstack/cli typecheck at 3d4db25136 exit 0
flow-json-flag.test.ts 7/7 passed
os verify --flow todo_task_reminder on examples/app-todo, at 3d4db25136 exit 0. The schedule was not armed by policy and the run completed. send_reminder (notify) was not executed: it was caught in its try_catch and is listed with the went-on-past note. 0 hard failures.

Round 1 also ran the @objectstack/cli unit tier: 427 of 429 files passed, and the two that failed passed with 29 tests once the CLI was built (the published-subpath pins read dist). Rounds 2 and 3 changed only help text in the cli, so the tier was not re-run. The cli integration tier and test:repo are left to CI. The diff touches no integration-tier file and no spawn entry point.

Acceptance notes

  • Boundary. The confinement covers row writes through ObjectQL, the only write path the flow's data nodes use. Outbound calls are covered by not executing the four named node types. A plugin's own node type that calls out under a name other than http, connector_action, notify or script is 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).
  • Not covered: running outbound nodes locally (an opt-in would be a separate Feature).
  • Scope. scripts/check-verify-stand-in-erasure.mjs is outside the claimed file surface. check:verify-stand-in requires every new @objectstack/verify export to be classified, so runFlowProof and formatFlowRunReport are recorded there as not stand-ins.
  • Smoke on examples/app-todo. os verify --flow todo_task_reminder in a default environment now reports the schedule as not armed on this deployment, runs it with no caller, and stops the notify node send_reminder inside its try_catch. The catch region ran, the run completed, and os verify passed with 0 hard failures.

Verification

Gates

Generated by Claude Code

@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/cli, @objectstack/verify, touching 74 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/verify/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

29 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json b02484e13a2e43f12d2c942e9a8966ece9cfa31e.

⛔ 16 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/verify/src/index.ts) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: PERMISSION_DENIED (literal, 56 pages)
  • 31 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 44 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json b02484e13a2e43f12d2c942e9a8966ece9cfa31e → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 93b117015de8edc439dc2bf48963e07cc4db34ee — the merge of head 3d4db25136b66d721c89967d9658172c76dfb8a6 into base b02484e13a2e43f12d2c942e9a8966ece9cfa31e, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs b02484e13a2e43f12d2c942e9a8966ece9cfa31e → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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 @ 348cc18de61c582bcb961b0f23aca34cc01bf160 (card #34779)

You review at TIER_DEFAULT. Render ONE ## Contract review record on this head (shape: node scripts/pm/record-recognisers.mjs --template --face declaration) with a PASS or FAIL verdict.

  • Face: the Clause-②: yes (widening) declaration. Confirm from the committed file list that no packages/spec/src/** or governed path is touched; if one is, stop and say so.
  • Read: card verify: run a flow locally and report the node trace, before it is submitted #34779 and its comments (claim 6983783896, os-dev report 6987214963, the area note on it), the PR body, the full diff against its merge-base, the changeset, and the head's check-runs. Code outside the diff is read at origin/main only.
  • ① Judge os verify --flow NAME with --flow-record / --flow-input: that os verify without --flow is unchanged; per-node status from the engine's run log; the no-executor node and the unbound trigger each reported with the node or trigger named (the card's "Done when"); the first failure's kind, code and node; the reported writes; that a record-change flow fires through the production trigger path; that only service-automation's read seams are used; the write confinement (a write to an object on a non-default driver refused before that driver is called) and its error code; the new @objectstack/verify exports and what the built cli reaches; anything removed, renamed or narrowed.
  • ② Changeset level (patch, Metadata-protocol: none) and the line-initial Clause-② / Metadata-protocol lines in PR body and changeset; changeset and content/docs/deployment/cli.mdx prose against the diff.
  • ③ Every dev deviation and the NOT-MEASURED gate (check:dual-build-cjs-loads) answered or escalated; the boundary that outbound nodes (http, connector_action, notify, script) are not confined, judged against the card's "a flow that would write runs against the ephemeral stack only" and the docs that state it.
  • Implemented-by: claude/issue-34779-verify-flow-run · Reviewed-by: session_01JQwxbYRqkDAGuse5Wqbohi.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 348cc18de61c582bcb961b0f23aca34cc01bf160
Local-runs: none

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 ec227fc7b1 (9 files, +1161/−6, 5 commits); the changeset; and the check-runs on this head. Code outside the diff was read at origin/main only. origin/main (3e4d531d8f) has 3 commits since the merge-base, and none touches packages/verify, packages/cli/src/commands/verify.ts, packages/services/service-automation/src, packages/objectql/src or content/docs/deployment/cli.mdx.

Face: the committed file list is .changeset/34779-verify-flow-run.md, content/docs/deployment/cli.mdx, packages/cli/src/commands/verify.ts, packages/cli/src/utils/flow-json-flag.ts and its test, packages/verify/src/flow-run.ts and its test, packages/verify/src/index.ts and scripts/check-verify-stand-in-erasure.mjs. It touches no packages/spec/src/** path and no governed path. reviewFace over these paths returns empty schema and rules hits and defers to the changeset's Clause-②: line, which carries yes (widening: ...). Governed Surface Queue Guard succeeded on this head. So this is the declaration face at TIER_DEFAULT, with no ④. Every file is inside the claim's file surface except the stand-in gate script, which is an accepted deviation (③).

① Derived judgments

  • CI on this head is still running. 54 check-runs: 33 success, 15 skipped, 6 in progress, 0 failure. Still running: Test Core shards 1, 2, 3, 4, 6 and 7 of 10. Complete and green: Build Core (its step Every published require entry point actually loads is check:dual-build-cjs-loads, and it succeeded), Check Changeset, Governed Surface Queue Guard, PR-body guards, Check PR Size, every Type Check · lane, every Lint · lane, Lint & Repo Gates, Test Core shards 5, 8, 9 and 10, Test UI, Live E2E UI, Dogfood Regression Gate and Flag docs affected by code changes. Dogfood Verify CLI was skipped by its path filter. I judge on what is complete. The seat must see the 6 running shards finish green on this head before landing.
  • os verify without --flow: unchanged. Both JSON flags parse to undefined when absent. The flow stack is booted only under if (flags.flow). The exit count adds flowRun?.summary.hardFailures ?? 0, which is 0. emitJson gets flowRun: undefined, which JSON drops, so the document is byte for byte the same. The text face prints the flow block only when there is a report. The only other changes are the command description and two new examples. A malformed --flow-record or --flow-input is refused before .env loading or any boot, and the error goes through the command's existing error path (JSON or text).
  • Per-node status from the engine's run log: right. Steps come from listRuns(flow), filtered to the run ids that were not in the log before the start, and mapped field for field (nodeId, nodeType, label, status, region, error code and message). The verdict is the run's own status. Nothing re-derives an engine decision.
  • No-executor node, named: right, and it meets the card's Done-when. The node types come from the engine's getUnknownNodeTypeAudit for this flow. They are mapped onto node ids through collectFlowGraphs (exported from @objectstack/spec/automation), so a node inside a loop, a parallel branch or a try region is named with its region, whether or not the run reached it. A reached one becomes the first failure with kind no_executor and the node id. An unreached one counts as one more hard failure and gets its own NO EXECUTOR line. The pin asserts node mystery by id.
  • Unbound trigger, named: right for a defect cause, wrong for the policy cause (S1). The trigger comes from getFlowRuntimeStates (type, object, bound, reason, unboundCause). An unbound trigger stops the run before anything is written, with the trigger named in the form 'record_change' on 'fr_watch' and the engine's reason sentence. A record-change trigger on an object the stack does not register gets the same kind. This meets the card's Done-when. The deployment_policy cause is handled the same way, which the spec says it must not be (S1).
  • First failure, with kind, code and node: right. It is the first step whose status is failure. The kind is confined_write when the confinement refused a write and the step's message carries its sentence, no_executor when the node is in the missing list, and node_failed otherwise. The code is the step's error code. A failed run with no failing step gives run_failed. A start that throws gives start_refused with the error's code, or confined_write when the start itself was refused by the confinement. A start that returns success: false gives start_refused with the engine's code. Twelve kinds are named, and each has one branch that produces it.
  • The writes reported: right. Every write observed through the stack's own observeWrites is listed, except the triggering write and the engine's own sys_automation_run rows. Each entry gives its datasource as the engine resolves it. Writes the confinement refused are added from the confinement's own list, with confined: true. The CONTROL pin asserts exactly one fr_ledger insert, that its id is the row in the table, and no fr_watch entry.
  • A record-change flow fires through the production trigger path: right. The triggering record is written through hooks.run as the signed-in dev admin. That is an ObjectQL write, so the record-change trigger the boot bound fires the flow as a save does. A create or write leg inserts the record. An update leg seeds it through seed (which sets skipTriggers, so the seed fires nothing) and then saves it unchanged. A delete leg seeds it and then deletes it. An array-form triggerType falls back to an insert, which fires its create leg. The CONTROL pin proves the real path: verdict is completed and the ledger row exists.
  • Only read seams of service-automation: right. FlowRunAutomation is Pick of getFlow, listRuns, getFlowRuntimeStates and getUnknownNodeTypeAudit. The start goes through the verify handle's existing doors (hooks.run, flows.run). Nothing under packages/services/service-automation changes.
  • Write confinement, refused before the other driver is called: right. confineToEphemeral registers one global ObjectQL middleware for each engine. For insert, update, delete, purge and restore on an object whose getDriverForObject is not the default driver instance, it throws PERMISSION_DENIED with status 403 before next(). The middleware chain runs ahead of the executor, and each of those five verbs is dispatched through executeWithMiddleware at origin/main. So the other driver is never reached. The registration comes before the seed and the start, so the seed of an update or delete leg is confined too. With no default driver, the run is not started (confinement_unavailable). The pin uses a recording driver on an external, writable datasource. It asserts the refusal, the node, the datasource named, exactly one confined entry in writes and an unchanged call log. The dev's ablation of the one guarding line turned it red, and the remote driver received the insert.
  • The new @objectstack/verify exports, and what the built cli reaches: right. index.ts adds runFlowProof and formatFlowRunReport, and nine types. The runtime imports of flow-run.ts are @objectstack/core (isServiceNotRegisteredError, on its root entry) and @objectstack/spec/automation (collectFlowGraphs, through export * of control-flow.zod). Both are already runtime dependencies of the package. The objectql and service-automation imports are type-only. The cli reaches the two functions through its existing @objectstack/verify import. Build Core, including the require-entry load step, succeeded.
  • Anything removed, renamed or narrowed: nothing. No existing export, flag, JSON member or exit condition changes. The flowRun member is present only with --flow. The NOT_A_STAND_IN entries add two names to a gate list and remove none.
  • SQL push-down: no finding. The diff adds no data query. The run-log diff is a set difference over at most 100 ids per call on the engine's own history, on a fresh stack, and it is not a join over records.

Findings:

  • S1 (should-fix): a flow that the deployment's scheduled-work policy keeps unarmed is reported as a defect and fails os verify. FLOW_UNBOUND_CAUSES at origin/main (packages/spec/src/contracts/automation-service.ts) says that deployment_policy is an operator setting and "Not a defect", and the engine's describeUnboundReason must never call it a binding failure. runFlowProof treats every bound: false the same way. It reports kind trigger_unbound with "the flow's trigger ... never binds, so nothing ever starts it", and that counts as a hard failure. The PR's own smoke shows the effect: todo_task_reminder in examples/app-todo gives trigger_unbound because the policy is off by default. So in a default environment, every schedule or time-relative flow fails os verify --flow, including the --flow nightly_cleanup --json form the PR adds to the command's examples, and the reader is told the flow is broken. To close it, branch on report.trigger.cause. For deployment_policy, either start the run through the no-caller path anyway (the graph is still what is under test) with a note naming the switch, or report not_run with that note and leave it out of the hard-failure count. Add one pin for that cause. The original reviewer reads the delta.
  • S2 (should-fix): the no-caller start does not give the flow the record that its trigger would give it. The docs and the changeset say a schedule or API-triggered flow "is started the way that trigger starts it". The code sends every flow whose trigger is not record-change through flows.run(..., { system: true }), which passes --flow-input as params only. At origin/main, the API trigger passes the request body as both record and params (trigger-api/src/api-trigger.ts), and a time_relative sweep passes each swept row as record (trigger-schedule/src/time-relative-trigger.ts; flow-cel-root-scope.ts lists both as entry points that pass a record). Here those flows run with no record, so a node that reads record.* fails or takes the wrong branch, even though the flow works in production. That gives a false node_failed and a non-zero exit. --flow-record is ignored for these flows ("only a record-change flow starts from a record"). To close it, either pass the record these two triggers pass (--flow-input as record and params for api, and --flow-record as record for time_relative), or narrow the sentence in the docs, the changeset and the flag help to what the code does. Either fix needs a pin.
  • S3 (should-fix, escalated to the seat): outbound nodes run for real, and the flag help does not say so. Every data write is confined (①). Nodes of type http, connector_action, notify and script that call out are not, and os verify loads the project's .env* files first, so they run with whatever credentials the project holds. The card's scope line reads "A flow that would write runs against the ephemeral stack only". A connector_action that creates a record in an external system is a write outside the stack under a plain reading. The PR states the boundary clearly in cli.mdx and the changeset, and area note 6987264675 hands the judgment here. I judge that it does not fully meet the card's line, but that it is not a must-fix: the card's Done-when is met, the confinement covers every write path a data node has, and the gap is disclosed. Two parts. (a) The --flow flag description, which is the text os verify --help shows, says only "Every write outside the in-memory database this run boots is refused before its datasource is called". It does not have the docs' "a node that calls out runs for real". Add that sentence. (b) The seat takes a ruling on whether the card's "write" covers outbound calls. If it does, a guard is cheap in this diff: refuse to start a flow whose definition holds one of those node types unless an explicit opt-in flag is given, and name the nodes in the report.
  • N1 (nit): the reported writes depend on the order the middleware was registered. writes adds the confinement's refusals after the observer's entries. That gives one entry per refused write only because the confinement middleware is registered before observeWrites installs the observer, which makes it the outer middleware, so the observer never sees the refused write. That holds for the cli's fresh stack and for the test suite. A caller of the exported runFlowProof on a stack that has already used observeWrites gets each refused write listed twice. Dropping observed writes whose error is the confinement's would make this independent of order. The cli path is not affected.
  • N2 (nit): the update leg, the delete leg and the no-caller start have no pin. The four pins cover an insert leg, the missing executor, the unbound trigger and the confinement. The seed-then-save and seed-then-delete legs, the system start, and the skipped and paused verdicts are read but not pinned. The code is right where it is read, apart from S1 and S2.

② Semver level

  • Changeset .changeset/34779-verify-flow-run.md: right. It bumps @objectstack/verify and @objectstack/cli at patch. Those are exactly the two published packages whose source changes. The gate script, the docs page and the tests are not published. AGENTS.md Post-Task Checklist item 3 says Metadata-protocol: none takes patch, and a widening outside the protocol ships patch. CI Check Changeset succeeded on this head.
  • Clause-②: yes (widening): right. It starts its line in the PR body (yes (widening)) and in the changeset (yes (widening: a new ...)). The annotated form of the arm has precedent on main, and the checks that read it are green. A new option and new exports, with nothing removed, renamed or newly refused, are a widening. Claim 6983783896 declared Clause-②: yes.
  • Metadata-protocol: none: right. No spec key, accepted value or metadata type is added. The flow, trigger and node vocabulary is read as it already stands.
  • Changeset and cli.mdx prose against the diff: right, except for S1, S2 and S3(a).
    • "each node's status as the run's log records it, the first failure with its code and the node named, and every write the run made": true (①).
    • "A record-change flow is fired by its own trigger ... inserted for a create or write leg; seeded and saved unchanged for an update leg; seeded and deleted for a delete leg": true.
    • "A schedule, an API-triggered flow or a flow declared runAs: 'system' is started with no caller, as its trigger starts it": the no-caller part is true. "As its trigger starts it" is not true for api and time_relative (S2).
    • "A node whose type no installed plugin runs is named, whether the run reached it or not. A flow whose trigger never binds is reported with the trigger and the engine's reason, and is not run": true. It also catches a flow that is only switched off by policy (S1).
    • "a write to an object bound to any other datasource is refused before that datasource's driver is called, and the node that made it fails naming the object and the datasource. Nodes that call out ... run for real": true (①, S3).
    • The failure list and the not-counted list (skipped, paused): true as coded, with S1's policy case on the failure side.
    • "--json carries the report as flowRun", and the JSON section's member list: true.
    • New exports listed: true, and complete.

③ Boundary flags

  • Open questions: none in the report.
  • Deviation, the two NOT_A_STAND_IN entries in scripts/check-verify-stand-in-erasure.mjs: answered and right. The gate requires every new export to be classified, both functions take the same VerifyStack handle as the families already listed, and the edit only adds to the list. Accepted in 6987264675.
  • Deviation, the sibling flow-json-flag.ts helper: answered and right. It keeps the test from importing the command module. The seven cases cover absent, object, unparseable, array, string, null and number.
  • Deviation, test:repo and the cli integration tier left to CI: answered. No integration-tier file or spawn entry is touched. CI Test Core carries them, and 6 of its shards are still running (①).
  • NOT-MEASURED check:dual-build-cjs-loads: answered. The Build Core step that runs it succeeded on this head.
  • Deviation, the PR body footer form: process only.
  • Port provenance from cloud c21b372: accepted in 6987264675. Only behaviour moved, and the diff holds no key, endpoint or tenant material.
  • The boundary for outbound nodes, judged against the card's "a flow that would write runs against the ephemeral stack only" and the docs that state it: S3. Escalated to the seat for the ruling in S3(b). S3(a) is a one-sentence help-text change.
  • Out-of-scope note, the existing CRUD phase may admit writable objects on a declared external datasource: this diff does not change it. The flow run boots its own stack, and its confinement does not reach the CRUD phase that runs earlier in the same os verify --flow command. It is the seat's to decide, as area note 6987264675 says. It is not judged here.
  • security_findings: none: I agree for this diff.
  • Ablations: four mutations, one for each pin, each turned red and was restored to the HEAD blob. The first CONTROL and confinement attempts were no-ops that the tool refused, and the re-runs with markers landed. No ablation covers the policy cause (S1), the no-caller record (S2) or the update and delete legs (N2).
  • Process notes: the PR is a draft. Author: objectstack-fleet[bot] (relay), assignee os-warren, so no extra author note is owed. S1 and S2 need a new head, and the original reviewer reads the delta. S3(a) can ride on that head, and S3(b) waits on the seat's ruling. Before landing, the seat must also see the 6 running Test Core shards finish green on the final head (①).

Implemented-by: claude/issue-34779-verify-flow-run
Reviewed-by: session_01JQwxbYRqkDAGuse5Wqbohi

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Contract review

Served-tier: TIER_DEFAULT
Head-sha: f1b566279d8b071c0363ed2b4cb2a6a90c624fd5
Local-runs: none

Round 2. It reads the delta from 348cc18de6 (record 6987485237) to this head.

Inputs: the seat's S3 ruling A, as the coordinator relayed it (outbound nodes are not executed under os verify --flow; the run stops at the first one with a named outbound_not_run result; no opt-in flag); os-dev round-2 report 6989017033 on #34779; the PR body as the seat rewrote it at 19:21Z; and git diff 348cc18de6 f1b566279d. The diff holds four PR commits (ffa765fe85, 97bd03bdec, 07a5495f11, f1b566279d) and the merge of origin/main f2078e3674 (22bb6ff090). I judged only the four PR commits. The merge changes none of this PR's files: between 348cc18de6 and 22bb6ff090 the diff of those files is empty. I also read the check-runs on this head. Code outside the diff was read at origin/main only.

Face: unchanged. The PR's file list against its new merge-base f2078e3674 is the same nine files as in round 1, with no packages/spec/src/** path and no governed path. Governed Surface Queue Guard succeeded on this head. This is still the declaration face at TIER_DEFAULT, with no ④.

① Derived judgments

  • CI on this head is still running. 56 check-runs: 23 success, 17 skipped, 16 in progress, 0 failure. Still running: all 10 Test Core shards, Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Lint · CI, release & engine gates, Lint · PM dispatch-gates and Lint · scoped · query-options erasure. Complete and green: Build Core (its step Every published require entry point actually loads, the check:dual-build-cjs-loads gate, succeeded), Check Changeset, Governed Surface Queue Guard, PR-body guards, Check PR Size, Type Check · source gates, Lint · ESLint, Lint · docs & code guards, Lint · repo & tooling gates, Test UI, Live E2E UI, Dogfood Regression Gate and Flag docs affected by code changes. I judge on what is complete. The seat must see every run finish green on the final head before landing.
  • Round-1 S1 (a policy-unarmed trigger counted as a defect): closed. When bound is false and cause is deployment_policy, the report adds a note with the engine's sentence and does not fail. The flow then starts with no caller: a schedule through flows.run(..., { system: true }), and a time-relative flow through its own branch. Every other unbound cause still stops the run as trigger_unbound. The text face prints "not armed on this deployment" instead of "NOT BOUND". Pin 6 covers it, and ablating it (policyUnarmed = false) turned the schedule and time-relative pins red.
  • Round-1 S2 (the no-caller start dropped the record): closed. An API-triggered flow goes to automation.execute with record set to the body, params set to a copy of it, and event: 'api'. That is the context the queue consumer in trigger-api/src/api-trigger.ts builds at origin/main. A time-relative flow seeds --flow-record (with no trigger fired) and gets record and params set to the seeded row, the watched object, and event: 'time_relative'. That matches the per-row context in time-relative-trigger.ts, apart from tenantId (N2). The engine's own trigger callback (triggerRun) also ends in execute(name, ctx). With no record, a time-relative flow gets record_required, which is counted. Pins 7 and 8 read record.name and record.id, and removing the record from either context turned them red.
  • Round-1 S3(a) (the flag help): closed. The --flow description now says outbound nodes are not executed and that the run stops at the first one and names it. The sentence that follows overclaims (S2 below).
  • Round-1 S3(b), judged against ruling A: met for a node in the flow itself, with two gaps (M1, S1 below). Before the run, standInOutbound replaces each registered executor of http, connector_action, notify and script with a stand-in. The stand-in keeps the type's descriptor, calls nothing, and returns success: false with errorClass: 'guard'. At origin/main, dag-traversal.ts follows a fault edge only when errorClass is not 'guard', so the run stops at that node. The report names it with kind outbound_not_run, and verdict failed becomes stopped. No opt-in flag is added. Pin 5 aims an http node at a loopback server the test owns, with the egress guard allowing loopback. It asserts that the server gets no request, that the log has only start and call, and that the ledger write after the call never ran. Removing the stand-in turned the pin red, and the server received /ping.
  • The stand-in exists only on the verify stack's engine: right. At origin/main, nodeExecutors is a private Map on each AutomationEngine instance, and registerNodeExecutor replaces an entry for its type and logs a warning. There is no module-level registry. The stand-in is put on stack.kernel.getService('automation'), the engine of the stack os verify --flow boots for this run and stops afterwards, and it is put there once for each engine (a WeakMap, swapping the list as the confinement does). Nothing under packages/services/service-automation changes. The engine members used now include execute, the call a trigger makes, and registerNodeExecutor on that engine. The PR body's list of members says so.
  • Dev deviation 1, the outbound stop is reported and not counted: accepted. Ruling A asks for a named result, not a failure. The stop proves nothing about the nodes after it, and the report says that. This matches how the PR treats skipped and paused runs, and summarize is the one place to change it if the seat wants a count. It is right only once M1 is closed.
  • Dev deviation 2, a try_catch region catches the stop: accepted as engine behaviour. A try region catches a guard-class failure like any other failure, nothing leaves the process, and cli.mdx says so. The app-todo smoke shows it: the notify node send_reminder was caught and the run completed. No pin covers it, and the report then gets the run wrong when a later node fails (M1).
  • The boundary for plugin-defined outbound types: meets ruling A, but the prose overclaims. Ruling A names four types, and the stand-in covers exactly those four (only the ones the boot registered, through getRegisteredNodeTypes). In this repo, the outbound executors registered at origin/main are http, notify and connector_action. Any connector that a plugin contributes through registerConnector runs behind connector_action, so it is stood in. A plugin's own node type that calls out under another name runs for real. The PR body's Acceptance notes say so. The help text, the changeset and cli.mdx say the opposite (S2).
  • Round-1 N2 (no pins for the update and delete legs): closed. Pins 9 and 10 fire record-after-update and record-after-delete flows through the seed-then-save and seed-then-delete legs. They cover behaviour this round did not change and were not ablated, which is acceptable for pins of existing behaviour.
  • Round-1 N1 (the reported writes depend on the order the middleware was registered): not addressed. The dev skipped it. It stays a nit, and the cli path is not affected.
  • New exported type members: right. FlowRunVerdict gains stopped, FlowRunFailureKind gains outbound_not_run, and confinement gains outbound. All three were first published in this PR, so no shipped surface is narrowed. os verify without --flow is still unchanged: the delta touches only the flow branch, the help text and a comment.
  • SQL push-down: no finding. The delta adds no data query. The time-relative seed is one fixture insert.

Findings:

  • M1 (must-fix): a stand-in stop that a try region catches hides a later real failure, and os verify passes a failed run. firstFailure is taken from the first failing step in the run log. When that step is a stand-in stop, the code sets kind outbound_not_run, changes verdict failed to stopped, adds the note "it stopped there, and no node after it is proven", and counts no hard failure. With deviation 2 that first failing step is often not why the run failed. If an outbound node inside a try_catch is stopped and caught, the run goes on, and a later node fails for a real reason, the run log says failed. The report then says stopped at the outbound node and claims nothing after it ran. The real failing node is never named, and the command exits 0. The same happens when a parallel branch is stopped at an outbound node and another branch fails, if the stopped branch is first in the log. The changeset, cli.mdx and the PR body all say "a run that fails ... fail os verify", and finding that failure is what the card is for. The app-todo flow shows the start of this path (a caught notify and a run that goes on). To close it, keep the outbound classification for each step. Take firstFailure from the first failing step that is not a stand-in stop, when there is one, and keep the stop as a note or in its own field. Use stopped only when the run's failure is the stop itself. Add a pin: a try_catch around an http node, followed by a node that fails. It should assert verdict failed, the failing node named, and one hard failure. The same pin then covers deviation 2.
  • S1 (should-fix): an outbound node inside a child flow is not handled as ruling A says. The stand-in stops the child run. But at origin/main, subflow-node.ts returns the child's failure as a plain success: false with no errorClass, and carriedRefusalOfResult carries only userMessage and innerRefusal. So on the parent, the subflow (or map) node fails as a runtime failure. Its fault edge is followed into the author's handler, which the stand-in exists to prevent. The report gives node_failed at the subflow node and counts one hard failure. The stop is recorded in the run's list but never named, because the match needs the failing step's id to be the stopped node's id. So a correct parent flow that calls a child with an outbound node fails os verify, and the cause is hidden. The child's sentence does reach the parent's error text (subflow 'X' failed: verify --flow does not execute outbound nodes ...). To close it, recognise a failing step whose error carries the stand-in's sentence, or any stop recorded during the run, as outbound_not_run naming the child node, and say in the docs that a fault edge on the calling node is still followed. Or make the subflow arm carry the guard class, but that edits service-automation, so it needs the seat. Add one pin.
  • S2 (should-fix): the help text, the changeset and cli.mdx say nothing calls out, which is wider than what the code does. The --flow help ends "so nothing calls out of this machine". The changeset says "Nothing calls out of the machine", cli.mdx says "Nothing calls out of the machine either", and the PR body's 维护者速读 says the same. The code stands in four named types, and a plugin-defined node type that calls out under another name runs for real, which the PR body's Acceptance notes admit. Ruling A is met, but these sentences are what a user relies on before running a flow locally. To close it, say that the four node types are not executed, and name the boundary for plugin-defined types in the docs. No code change is needed.
  • N1 (nit, carried from round 1): the reported writes still depend on the order the middleware was registered. This is unchanged. A caller of the exported runFlowProof on a stack that has already used observeWrites gets each refused write listed twice.
  • N2 (nit): the time-relative start does not reproduce the acting organization. The sweep adds tenantId from the binding or, under the group posture with per-record ownership, from the row. The run does not. The docs say so for a schedule but not for a time-relative flow. Under the default single-organization posture the key is absent in production too, so the run is the same there. Prose only.

② Semver level

  • Changeset: right, unchanged level. It still bumps @objectstack/verify and @objectstack/cli at patch. Metadata-protocol: none takes patch (AGENTS.md Post-Task Checklist item 3). The two other changesets in the delta come from the merge of main and are not this PR's. CI Check Changeset succeeded on this head.
  • Clause-②: yes (widening) and Metadata-protocol: none: right, unchanged. Both still start their lines in the PR body and the changeset. The delta adds report members, verdict and kind values, and start behaviour, and removes nothing from shipped surface. No spec key, value or metadata type is added.
  • Changeset and cli.mdx prose against the diff: right, except for M1 and S2.
    • The start sentences for record-change, API-triggered, time-relative, schedule and runAs: 'system' flows: true (①).
    • "left unarmed by the deployment's scheduled-work switch ... is reported as not armed and the flow is still run": true.
    • "an outbound node (http, connector_action, notify, script) is not executed. The run stops at the first one and the report names it": true for a node in the flow itself. Inside a try region the run goes on (cli.mdx says so, the changeset does not), and inside a child flow it is not named (S1).
    • "Nothing calls out of the machine": wider than the code (S2).
    • "A failed run ... each fail os verify": false on the path in M1.
    • "one stopped at an outbound node [is] reported and do[es] not [fail]": true, and it is the deviation accepted above.

③ Boundary flags

  • Ruling A: met for outbound nodes in the flow itself, with M1 and S1 to close. No opt-in flag is added, as the ruling says.
  • Dev deviation, the outbound stop is not a hard failure: accepted (①), subject to M1.
  • Dev deviation, a try_catch catches the stop: accepted as engine behaviour (①). It is the path M1 opens, and M1's pin covers it.
  • Dev deviation, the stand-in uses the engine's public registerNodeExecutor on the verify stack's engine: accepted. Production is untouched (①).
  • Dev deviation, origin/main merged at f2078e3674 and not again: process only. None of the four commits since then touches this PR's files.
  • NOT-MEASURED check:dual-build-cjs-loads: answered. CI Build Core ran it and it succeeded on this head.
  • Deviation, the cli unit tier was not re-run: accepted. The round's cli change is help text and a comment. Type Check · workspace and Test Core are still running (①).
  • The boundary for plugin-defined outbound types: within ruling A, with the prose fix in S2.
  • Not measured: an object's declared webhooks fire on record events, not through flow nodes, so they fall outside ruling A and outside the stand-in. I did not measure whether the verify boot delivers them.
  • Out-of-scope note, the existing CRUD phase on a writable external datasource: unchanged. It is the seat's to decide.
  • security_findings: none: I agree for this diff.
  • Ablations: four new mutations (outbound, policy, API record, time-relative record), each turned a pin red and was restored to the HEAD blob. The outbound pin was reordered so it reads the server log first, and was re-ablated. No ablation or pin covers the try-region path (M1) or the child-flow path (S1).
  • Process notes: the PR is a draft. Author: objectstack-fleet[bot] (relay), assignee os-warren, so no extra author note is owed. M1 and S1 need a new head. S2 is prose and can ride on the same head. The original reviewer reads that delta. Before landing, the seat must also see every running check finish green on the final head (①).

Implemented-by: claude/issue-34779-verify-flow-run
Reviewed-by: session_01JQwxbYRqkDAGuse5Wqbohi

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 3d4db25136b66d721c89967d9658172c76dfb8a6
Local-runs: none

Round 3. It reads the delta from f1b566279d (round-2 record 6989190390, FAIL on M1) to this head.

Inputs: round-2 record 6989190390; os-dev round-3 report 6990155397 on #34779; the PR body as the seat rewrote it for this head; git diff f1b566279d 3d4db25136, which is two PR commits (17561e0f98 for the code and the pins, 3d4db25136 for prose only) and no merge; and the check-runs on this head and on f1b566279d. Code outside the diff was read at origin/main only.

Face: unchanged. The delta touches 5 of the PR's 9 files and adds no path. There is no packages/spec/src/** path and no governed path, and Governed Surface Queue Guard succeeded on this head. This is still the declaration face at TIER_DEFAULT, with no ④.

① Derived judgments

  • CI on this head has only started. 56 check-runs: 13 success, 17 skipped, 26 in progress, 0 failure. Still running: Build Core (which hosts check:dual-build-cjs-loads), all 10 Test Core shards, every Type Check · lane except the debt ledger, every Lint · lane, Build Docs and Live E2E UI. Complete and green: Check Changeset, Governed Surface Queue Guard, PR-body guards, Check PR Size, Check Documentation Links, Spec property liveness, Type Check · debt ledger, Test UI, Dogfood Regression Gate and Flag docs affected by code changes. The previous head f1b566279d finished green: 42 success, 17 skipped, 0 failure. This round changes only flow-run.ts, its test, the cli help text and prose. I judge on what is complete. The seat must see every run finish green on this head before landing.
  • M1 (a caught stop hid a later failure): closed. Each failing step is now classified as a stop or not. A step is a stop when its node and type are in the stand-in's list, or when its error text carries the stand-in's sentence. firstFailure is taken from the first failing step that is not a stop. The verdict becomes stopped with outbound_not_run only when the run failed and no other step failed. A stop the run went on past becomes a note, and no hard failure is added for it. A real failure after a caught stop now reads failed, names its node, and counts one hard failure, which matches "a run that fails ... fail os verify". New pins cover the try_catch case (boom, node_failed, one hard failure, the stop listed) and the parallel case (fork_boom named). Ablating the classification turned both pins red with "expected failed, received stopped". The same try_catch pin also covers round-2 deviation 2, which had no pin.
  • S1 (a child flow's stop): closed, and the dev's choice is accepted.
    • Matching the sentence. The stand-in's error text reaches the parent's subflow or map step through subflow 'X' failed: ... at origin/main, but its guard class and any structured cause do not. So the verify layer is the only place the stop can be recognised without editing service-automation, which this card's file surface does not cover and ruling A did not ask for. The match is against this file's own sentence, built in the same file as OUTBOUND_SENTENCE. It is anchored on the stand-in's opening words and captures the node id and type. A change to one without the other is caught: the child pin and the parallel pin both went red when the match was turned off. If the id or type cannot be parsed, the report falls back to the step's own node. Another failure is unlikely to carry this sentence by accident.
    • The pin. The parent calls a child whose http node is stood in. It reads stopped with outbound_not_run at child_call (the child's node, not call_child), the ledger write after the call does not run, and there are no hard failures.
    • The fault-edge caveat: accepted. A fault edge on the calling subflow or map node is still followed, because the guard class is lost across the child boundary. cli.mdx and the PR body say so. When it is followed, the run goes on past the stop, the stop is listed with a note, and only a real later failure counts. The handler runs on the confined stack, and its own outbound nodes are stood in too, so nothing leaves the process. No pin covers this path (N2).
  • S2 (the docs said nothing calls out): closed. The help text, the changeset, cli.mdx and the command's jsdoc now say four node types are not executed, that every connector a plugin contributes runs behind connector_action, and that a plugin's own node type that calls out under another name is not stood in and runs for real. The PR body's 维护者速读 no longer makes the wider claim. This is now the same boundary that ruling A sets.
  • N2 (the acting organization on a time-relative start): closed. cli.mdx, the changeset and the help text say a time-relative start sets no acting organization (tenantId).
  • The new outboundStops field: right, with N3. It is an inline array member of FlowRunReport, a type first published in this PR, so no new export and no narrowing. It is filled from the stand-in's list in the order the nodes were reached, child flows included, and it is present (possibly empty) on every report. cli.mdx's JSON section names it. Every new pin asserts it exactly. The text face shows the stops through the notes and the step lines.
  • Round-1 N1 (the reported writes depend on the order the middleware was registered): not addressed. The dev skipped it again. It stays a nit (N1), and the cli path is not affected.
  • What did not change. os verify without --flow, the confinement, the start paths, the deployment-policy branch and the exit wiring are not in this delta, apart from help text. The cli change this round is help text and a jsdoc comment.
  • SQL push-down: no finding. The delta adds no data query.

Findings:

  • N1 (nit, carried from rounds 1 and 2): the reported writes still depend on the order the middleware was registered. This is unchanged. A caller of the exported runFlowProof on a stack that has already used observeWrites gets each refused write listed twice. The cli boots a fresh stack, so it is not affected.
  • N2 (nit): no pin for the fault-edge caveat on a calling node. The docs state the behaviour. The code handles it: the stop becomes a note, and only a real failure after it counts. But no test puts a fault edge on a subflow node whose child is stopped. A pin would hold the stated caveat.
  • N3 (nit): outboundStops also lists stops from other flows the run triggers. The stand-in's list is shared by the engine while the run is open. So an outbound node in another record-change flow, fired by a write this run makes, is listed as well, by node id only, without its flow. The jsdoc says "every outbound node the run reached ... in a child flow too". Showing a cascaded flow's stop is arguably useful, but the field does not say which flow it came from. Adding the flow name to each entry, or saying so in the jsdoc, would close it. It does not change the verdict or the count, so this has no effect on correctness or the contract.

② Semver level

  • Changeset: right, unchanged level. It still bumps @objectstack/verify and @objectstack/cli at patch, under Metadata-protocol: none (AGENTS.md Post-Task Checklist item 3). CI Check Changeset succeeded on this head.
  • Clause-②: yes (widening) and Metadata-protocol: none: right, unchanged. Both still start their lines in the PR body and the changeset. The delta adds one report member to a type first published in this PR, and removes nothing from shipped surface. No spec key, value or metadata type is added.
  • Changeset and cli.mdx prose against the diff: right.
    • "Four outbound node types are not executed ... a plugin's own node type that calls out under another name is not stood in and runs for real": true (S2 closed).
    • "A run that ends at one of them stops there and the report names it (outbound_not_run), in a child flow too": true, and pinned.
    • "A stop a try_catch catches is listed in outboundStops, and a later node that fails is still the first failure": true, and pinned.
    • cli.mdx, "a fault edge on the calling subflow or map node is still followed": true, and read at origin/main, but not pinned (N2).
    • "the acting organization a sweep can set is not reproduced": true.
    • "A failed run ... fail os verify", and "one stopped at an outbound node [is] reported and [does] not": both true now.

③ Boundary flags

  • Ruling A: met. The four types are not executed, a run that ends at one is named outbound_not_run (also through a child flow), and no opt-in flag is added. The stand-in still exists only on the engine the verify run boots (round-2 ①).
  • Dev deviation, outboundStops as an inline field with no new export: accepted (①).
  • Dev deviation, a child-flow stop recognised by the stand-in's own sentence rather than an engine field: accepted (①, S1). Carrying the guard class through the subflow arm would need a service-automation change and the seat's say, and nothing here asks for one.
  • Dev deviation, the cli unit tier was not re-run: accepted. This round's cli change is help text. Test Core and the Type Check · lanes are still running (①).
  • NOT-MEASURED check:dual-build-cjs-loads: CI Build Core is still running on this head. It succeeded on f1b566279d, and this round adds no import. The seat reads it green on this head before landing.
  • Not measured, carried: an object's declared webhooks fire on record events, outside the stand-in. The PR body now says so.
  • Out-of-scope note, the existing CRUD phase on a writable external datasource: unchanged. It is the seat's to decide.
  • security_findings: none: I agree for this diff.
  • Ablations: two new mutations (the classification, and the sentence match), each turned its pins red and was restored to the HEAD blob 835d69e8caba. The prose commit 3d4db25136 changes no code, and the verify suite was re-run on it (53 files, 458 tests).
  • Process notes: the PR is a draft. Author: objectstack-fleet[bot] (relay), assignee os-warren, so no extra author note is owed. No must-fix or should-fix is open, so this is the final round. The three nits are accepted as they stand, or go to a follow-up card if the seat wants them. Before landing, the seat must see every running check finish green on this head (①).

Implemented-by: claude/issue-34779-verify-flow-run
Reviewed-by: session_01JQwxbYRqkDAGuse5Wqbohi

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Final head for L1 · 2026-11-18T20:28Z

Head-sha: 3d4db25136 · all check-runs success or skipped (42 success, 17 skipped, 0 red; all ten Test Core shards green, and Build Core carries the locally NOT-MEASURED check:dual-build-cjs-loads) · NOT governed (0 of 9 paths on the register), +1758 / −6. Delivers #34779: os verify --flow NAME runs one flow once on a fresh in-memory boot, then reports each node's status, a node with no executor, an unbound trigger, the first failure and every write. Writes stay on the ephemeral default driver. The four outbound node types (http, connector_action, notify, script) are not executed, per the seat's ruling A. The PR says Fixes #34779.
Owed: L1 (first read; area o1-B requests it from L1-a). Clause-②: yes (widening), Metadata-protocol: none, patch. The TIER_DEFAULT record of record is 6990247650 at this head, PASS (declaration face). The earlier rounds were 6987485237 (PASS with S1 to S3), 6989190390 (FAIL on M1) and this one, which closes M1, S1, S2 and N2. Nits N1 to N3 stay nits. Inputs: claim 6983783896, area note 6987264675, dev reports 6987214963, 6989017033 and 6990155397, and brief 6987283704. The PR body was rewritten by the seat for this head. Not covered, and not filed during the wind-down: running outbound nodes locally (an opt-in would be a separate Feature), a plugin's own outbound node type, and the existing CRUD phase's handling of external datasources (dev note on 6987214963).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9

L1 review · ACCEPT · 2026-11-18T20:31Z

Head: 3d4db25136b66d721c89967d9658172c76dfb8a6 (merge base f2078e3674). Read: the whole net diff (9 files), the PR body, the card body, claim 6983783896, area note 6987264675, dev reports 6987214963, 6989017033 and 6990155397, contract records 6987485237, 6989190390 and 6990247650, and the final-head note 6990702806.

  • Closing keyword: Fixes #34779. The Done-when is pinned: the no-executor node (mystery) and the unbound trigger ('record_change' on 'fr_watch', cause missing_trigger) are each reported with the node or trigger named, against a real bootStack. The Scope line "a flow that would write runs against the ephemeral stack only" is met: the confinement middleware refuses every write operation OperationContext names (insert, update, delete, purge, restore) on an object whose driver is not the ephemeral default, before that driver is called. The four outbound types are stood in on the verify engine only (seat ruling A).

  • File surface: everything is inside claim 6983783896 (packages/verify/src/**, verify.ts and its sibling helper flow-json-flag.ts, tests, one changeset), except two files:

    • scripts/check-verify-stand-in-erasure.mjs: two NOT_A_STAND_IN lines the gate demands for the new exports. The area accepted this deviation in 6987264675.
    • content/docs/deployment/cli.mdx: the new flag's own docs, which the same-PR docs rule asks for.

    service-automation is not edited. Only its existing members are called on the verify stack's engine.

  • Changeset and docs, sentence by sentence:

    • patch for both packages, Clause-②: yes (widening …) and Metadata-protocol: none. That fits a new CLI option and new exports with no authorable change. The PR body carries the same two lines at line start.
    • Start modes. Record-change: insert for a create or write leg; seed and an unchanged save for an update leg; seed and delete for a delete leg. API: --flow-input as record and params. Time-relative: the row is seeded first, there is no acting organization, and no record gives record_required. Schedule or runAs: 'system': --flow-input as params. Any other flow: the trigger route. Each matches runFlowProof and a named pin.
    • "A schedule … left unarmed … is reported as not armed and the flow is still run": policyUnarmed (unboundCause: 'deployment_policy'), pinned.
    • Exit contract: summarize() counts a non-outbound_not_run first failure, every missing executor not already the first failure, and a confined write the flow swallowed. verify.ts adds flowRun.summary.hardFailures to the total. Skipped, paused and outbound-stopped runs are not counted. This matches both lists.
    • The four outbound types, the try_catch and parallel stops listed in outboundStops without hiding a later failure, and the child-flow stop named at the child's node with the caller's fault edge still followed: these match standInOutbound, the step classification and the three round-3 pins.
    • "A plugin's own node type … runs for real": OUTBOUND_NODE_TYPES is the closed list of four. The help text, cli.mdx and the changeset all say it.
    • The new exports named are the ones index.ts adds. --json carries flowRun, and cli.mdx names its members. "Nothing that ran before changes": with no --flow, flowRun is undefined, it adds 0 to the count, nothing is printed, and the JSON parse of an absent flag returns undefined.
  • Contract review: 6990247650, PASS at TIER_DEFAULT on this head (declaration face, round 3). It closes M1, S1, S2 and N2. N1–N3 stay nits.

  • CI on this head: 59 check-runs, 42 success and 17 skipped. None failed, none pending, including with filter=all.

  • Main since the merge base: no commit on main touches any file of this diff.

  • Governed check: check-governed-merges --pr 35243: not governed (0 of 9 paths), 1,764 changed lines.

Before landing (no head move)

  • C1: the final-head note names three items "not covered, and not filed during the wind-down". The wind-down stops the area from filing, not the seat. Per filing-gate.md (「已落地工作欠的后续照立卡」):

    • File the existing CRUD phase's possible write to a declared external datasource as a card. It is a suspected defect in os verify itself, and nobody holds it now.
    • Either file the other two (running outbound nodes locally as an opt-in Feature; a plugin's own outbound node type) or record in one line why they are not owed.

    Name each #N on the PR.

Notes (non-blocking)

  • N1: runFlowProof's own doc says the stack should be booted for this run alone because the confinement middleware stays on its engine. The outbound stand-in stays too: the replaced http, connector_action, notify and script executors are never restored. The CLI boots and stops a fresh stack, so it is unaffected. One more clause in that doc would tell a library caller.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Landing · 2026-11-18T20:34Z

Probe Reading
check-governed-merges.mjs --pr 35243 NOT governed · +1758 / −6, 0 of 9 paths on the register, Clause-②: yes (widening), Metadata-protocol: none, patch (claim 6983783896)
Contract review (条款②) TIER_DEFAULT (declaration face): 6987485237 PASS with S1 to S3 at 348cc18de6; the seat's ruling A on S3 (outbound nodes not executed); 6989190390 FAIL on M1 at f1b566279d; 6990247650 PASS at 3d4db25136 closing M1, S1, S2 and N2; N1 to N3 nits
Head / review 3d4db25136 · L1-a ACCEPT 6990771676 at this head, the review of record · all check-runs success or skipped (42 success, 17 skipped, 0 red)
Freshness K = 5, merges cleanly into origin/main b02484e13a, so no main merge was taken and the L1 head stands. overlap-check.mjs: VERDICT clean against origin/main, #35244 and #34717

L1 C1, settled by the seat:

  • Filed as verify: the os verify CRUD phase may write into an app's declared external datasource #35255: the existing os verify CRUD phase may write into an app's declared external datasource (Bug, p2, area:build).
  • Not owed as a card: running outbound nodes locally as an opt-in, and a plugin's own outbound node type. Both belong to one prospective fleet Feature, which waits on the maintainer's weekly pick list (2026-11-18 16:58Z) and was ruled out of this PR by the seat's ruling A.

Open findings: contract nits N1 to N3; L1 note N1 (the runFlowProof doc could add that the outbound stand-in stays on the engine; the CLI boots a fresh stack, so it is unaffected).

State: ready + auto-merge armed by area o1-B (lease o1-B, claim 6983783896). The PR says Fixes #34779; the card is closed out once the merge lands.

Dev-effort: high · Rounds: 3

Merged via the queue into main with commit 00110fd Nov 18, 2026
60 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34779-verify-flow-run branch November 18, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

verify: run a flow locally and report the node trace, before it is submitted

2 participants