Skip to content

feat(automation): IAutomationService.dryRun runs an unpublished flow once, unarmed, as a named user - #34477

Merged
os-zhuang merged 13 commits into
mainfrom
claude/project-thread-high4j
Nov 17, 2026
Merged

os-zhuang merged 13 commits into
mainfrom
claude/project-thread-high4j

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #33661

Clause-②: yes (widening) — AutomationEngine.dryRun admits a runAs: 'system' self-triggered draft for the named user (ruling B); @objectstack/core exports the shared flow-start rules (aiAccountElevatedStartRefusal, requiredPermissionsStartRefusal, requiredPermissionsRefusal, missingCapabilities, isAiServiceAccount, AI_ACCOUNT_ELEVATED_START_REFUSAL, FlowStartPermissionRefusal); plugin-security's registered security service serves canWriteObject
Metadata-protocol: none

维护者速读

  • 改了什么:自动化服务新增「试跑」:把一份未发布的流程定义,以指定用户的身份、针对一条给定记录跑一次;写记录只模拟不落库,外发(HTTP、邮件等)只展示载荷不发送,遇到审批、等待、屏幕节点就停下并说明原因。
  • 为什么改:让作者在发布前看到流程每一步会做什么、会写哪些值、会不会被权限拒绝,而不必真的触发或改数据;同时落实维护者裁决 B(以 runAs: 'system' 声明的自触发草稿可以试跑,但只按试跑人的权限,绝不提权)。
  • 风险与回滚:风险集中在试跑把写操作拦在门外这一层,漏拦就会真写数据;测试逐类断言了「零写入」。准入规则从 runtime 下沉到 core 共用一份,按名启动的行为不变(runtime 609 个测试文件全绿)。回滚即 revert 本 PR,无数据迁移。
  • 先看:packages/services/service-automation/src/dry-run.ts(写拦截的数据引擎代理 dryRunDataEngine 与 dryRun 准入顺序);packages/core/src/security/flow-start-rules.ts(两条共用准入规则);packages/plugins/plugin-security/src/security-plugin-security-service.ts(security 服务新暴露 canWriteObject)。
  • 两分钟验证:pnpm --filter @objectstack/service-automation exec vitest run src/dry-run.test.ts,预期 30 个测试全过,其中包括「审批节点停下且从未被调用」和「零写入」的断言。
  • 需要你做的:批准本 PR 里的契约改动(packages/spec/src/contracts/automation-service.ts 中 dryRun 准入那一条,按裁决 B 改写)。裁决记录 6917953931 写明契约改动在实现落地前欠契约评审和你的批准;L1 与契约评审在同一 head 通过后,席位会请你批准,批准后由席位落地。

What changes

AutomationEngine.dryRun(definition, options) implements the IAutomationService.dryRun contract. The run is unarmed and unregistered. It runs as the named user against the supplied record, and it writes, sends and pauses nothing.

  • Admission, in the contract's order.
    1. A missing userId throws a TypeError.
    2. The definition goes through registerFlow's own checks, now one private judgeFlowRegistration that both call, so a dry run throws exactly what registerFlow throws.
    3. Tenant membership comes from the grants resolver's accessible_org_ids.
    4. The by-name start rules: the AI service account rule, then the flow's requiredPermissions.
    5. The start condition: condition_not_met, or failed with the fault.
    6. The input schema.
  • Ruling B (record 6917953931). A self-triggered runAs: 'system' draft is admitted for the named user, and its run context always resolves as runAs: 'user', so it is never elevated. The contract bullet now says so, and its pin test holds the new sentences and the absence of the old one.
  • One spelling of the shared rules. The AI service account rule and the requiredPermissions rule moved down to @objectstack/core (security/flow-start-rules.ts), because service-automation does not depend on runtime. flowStartRefusal in runtime and dryRun both call aiAccountElevatedStartRefusal and requiredPermissionsStartRefusal. Runtime re-exports every moved symbol under its old name (AI_ACCOUNT_ELEVATED_START_REFUSAL, isAiServiceAccount, requiredPermissionsRefusal, FlowStartPermissionRefusal, missingCapabilities). The elevated self-triggered rule stays in runtime, since only the by-name doors ask it.
  • Traversal reuses the engine's own executeNode and traverseNext bodies on a dry host, so routing and compute nodes run on the real executors: assignment, decision, gateways, loop, parallel and try/catch. Region bodies (loop, parallel, try/catch) are diverted into the dry run through activeDryRunExecuteNode(), so a write inside a loop is simulated too.
  • Writes. The CRUD nodes' data engine is wrapped by dryRunDataEngine while a dry run is active.
    • Insert, update and delete are simulated. A new record gets a dry-run:UUID:N placeholder id.
    • An update or delete targets exactly the rows the engine's own dispatch picks: the one id it names (from the filter, or an update's own id value), the filter's rows under multi, or none when it refuses the call (the engine's own error).
    • A read by id sees the simulated row laid over the live one. A filtered read answers the live rows only, as the contract says.
    • An insert or update is judged by canWriteObject for the named user (allowed or refused). A delete, or a kernel with no check installed, answers not_judged.
    • A check that throws is a denial (refused). An update or delete by predicate without multi fails with the engine's own error and targets no row.
    • A refused write's step carries PERMISSION_DENIED. The run goes on along a fault edge or out of a try_catch region that contains it, and otherwise ends failed with that write as the last step.
  • Outbound nodes never execute and bind no output. Their step reports the payload, built from the spec's expression and text-slot ledgers.
  • Stops. A node whose descriptor supportsPause stops the run with a class: approval, wait, screen (its ScreenSpec is built by the real screen executor), starts_flow or suspends. A type no class covers stops the run as not_simulated.
  • security service. The registered service now serves canWriteObject, so the dry run can judge a write without performing it.

Tests

  • packages/services/service-automation/src/dry-run.test.ts, 30 tests:
    • Each node class the in-app v2-narrow tier offers: create_record (placeholder id, computed values, zero writes, a read by id sees the simulated row), update_record (live target, overlay read, the write check asked with the non-system named user), assignment, decision (branch, expressions, next; also a gateway decision), and approval (stops, and the executor is never called).
    • Admission refusals: the requiredPermissions refusal equals requiredPermissionsRefusal from core, the AI account refusal equals AI_ACCOUNT_ELEVATED_START_REFUSAL, a non-member organization is refused, ruling B admits without elevating, plus the TypeError, the registerFlow throw, condition_not_met and a faulted condition.
    • Also: a refused write, not_simulated, a write inside a loop, and an outbound http payload with nothing sent.
    • Review round: a save_notice payload and a refusing end node in zh-CN through their translation keys; a refused write going on along its fault edge; a write check that throws is refused; unread grants (a failed read, an empty answer, no resolver) refuse a runAs: 'system' draft; an update or delete by predicate without multi fails with the engine's own message, with a multi control; an update whose fields name the id, with no filter, targets that one row, with a multi control targeting every readable row.
  • The automation-dry-run.pin.test.ts contract pin was updated for ruling B.
  • registered-security-service-members.pin.test.ts ledgers canWriteObject with its reason (see Acceptance notes).

Acceptance notes

  • canWriteObject stays off ISecurityService: settled by the published contract. The dryRun contract of Contract: IAutomationService gains a dry run of an unpublished flow definition, once, unarmed, as a named acting user against a supplied record (spec half of #33661) #33757 (FlowDryRunWritePermission, contract-reviewed) names it "a method of @objectstack/plugin-security's service, not of ISecurityService". On main the registered service did not serve it; this PR serves it and ledgers it in SERVED_NOT_DECLARED, citing that contract. That pin's header now states the exception: a member a published contract places off ISecurityService stays off it, and its entry cites that contract. Declaring it on ISecurityService would be a separate contract change and is not part of this PR.
  • Surface beyond the claim. The claim named service-automation and spec. This PR also touches:
    • @objectstack/core: the shared rules.
    • @objectstack/runtime: re-exports only.
    • @objectstack/plugin-security: canWriteObject on the service.
    • scripts/engine-double-contract.pinned.json: the gate's own --write for the new pinned test double.
  • Text slots in an outbound payload render as their live executor renders them, in options.locale. save_notice's message reads its flows.FLOW.notices.NODE.message translation through that executor's own renderer; a refusing end node's message reads its translation too. notify and http render the authored text, as their live executors do.
  • Known approximations, each inside the contract's words:
    • Approvers are omitted from an approval stop ("when the run can resolve them").
    • An unconditional fan-out still runs its branches concurrently. Its steps are grouped per branch, depth-first.
    • A grants resolver that throws, answers nothing, or is not wired fails closed: refused for a tenant, for a declared requiredPermissions, and for a runAs: 'system' definition, because the AI service account rule cannot be asked without the grants. That last refusal carries the dry run's own message.
    • An update or delete by predicate with multi lists every row it targets, uncapped, since FlowDryRunWriteStep.recordIds is defined as the rows the write targets.
  • Not touched: cloud's test_flow, every HTTP or MCP door, the service-automation: a retried run skips the flow's start condition (errorHandling.strategy 'retry') #33935 retry clause, docs/adr/**, skills/**.

Verification

Readings are on head 3392bc4f0 for service-automation and the dry-run suite, and on 4889de397 for spec, plugin-security, core and runtime, which the last round did not touch. The first ablation below was run on 2e47ef291.

  • Tests (under os-verify-lock, VERDICT command-exit 0 for each):
    • @objectstack/service-automation: 286/286 files, 4082/4082 tests (3392bc4f0).
    • @objectstack/runtime: 609/609 files, 11271 passed, 19 skipped.
    • @objectstack/core: 149/149 files, 3595/3595 tests.
    • @objectstack/spec: 845/845 files, 27059 passed, 1 todo.
    • @objectstack/plugin-security: 273/273 files, 6824 passed, 45 skipped.
    • dry-run.test.ts 30/30 (3392bc4f0); the member pin 4/4 and the spec dry-run pin 5/5 (4889de397).
  • Typecheck: core, runtime, plugin-security and service-automation are green, check:test-typecheck included. Runtime's first attempt was red only because @objectstack/driver-turso had no dist. Building the dependency closure fixed it.
  • Ablations. On 2e47ef291, the dry run's admission call was replaced with null through scripts/ablation-replace.mjs.
    • Mutation landed: anchor count 1 to 0, blob bd40dedf94bb to ced6b2f7de22.
    • dry-run.test.ts went to 2 failed, 16 passed: the requiredPermissions refusal and the AI account refusal.
    • Restore proven: blob equals HEAD and git diff HEAD is empty. The tests import the engine from source, so no dist was involved.
    • On 4889de397, one each for the translation read, the unread-grants refusal and the throwing write check, through scripts/ablation-replace.mjs: each turned exactly its own pin red (1 failed, 25 passed) and was restored to a blob equal to HEAD with an empty git diff HEAD.
    • On 3392bc4f0, the by-id targeting branch disabled: exactly the id-targeting pin went red (1 failed, 29 passed), restored to a blob equal to HEAD.
  • Gates: node scripts/pm/dispatch-gates.mjs --commands derived 108 for this diff.
    • On 4889de397: 108 derived, 108 ran, all exit 0, check:i18n and check:dual-build-cjs-loads included. --ran reconciliation: 108 derived, 108 run, 0 NOT-MEASURED, 0 UNRUN. On 3392bc4f0, for the two files that round touched: 60 derived, 60 ran, all exit 0.
    • node scripts/check-platform-checklist.mjs --changed-from origin/main: OK, 29 anchors judged, 0 lost.
The ablation run
ablation-replace: ok mutation landed: anchor 1 -> 0, blob bd40dedf94bb -> ced6b2f7de22
     × refuses a named user missing a capability requiredPermissions names, with the by-name message, and runs nothing
     × refuses an AI service account a runAs system definition with the account rule's message
      Tests  2 failed | 16 passed (18)
ablation-replace: ok restored: blob == HEAD (bd40dedf94bb) and `git diff HEAD` is empty
Suite totals
packages/services/service-automation test:  Test Files  286 passed (286)
packages/services/service-automation test:       Tests  4082 passed (4082)
packages/runtime test:  Test Files  609 passed (609)
packages/runtime test:       Tests  11271 passed | 19 skipped (11290)
packages/core test:  Test Files  149 passed (149)
packages/core test:       Tests  3595 passed (3595)
packages/spec test:  Test Files  845 passed (845)
packages/spec test:       Tests  27059 passed | 1 todo (27060)

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe

…o a dry run for the named user (ruling B)

Replaces the dryRun admission bullet that refused such a draft for every
named user. The run is never elevated; a by-name start of a published flow
keeps its refusal.

Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
…s can place its delete

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
…citing the dryRun contract

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
…engine dispatch asserts, bounds after the filter and refuses combinators

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
@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 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 5 package(s): @objectstack/core, @objectstack/plugin-security, @objectstack/runtime, @objectstack/service-automation, @objectstack/spec, touching 138 documentable anchor(s).

68 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 ec6b5fd3464ce5413691a7cab810d1c19db50182.

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

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: PERMISSION_DENIED (literal, 54 pages)
  • 28 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 — 187 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 ec6b5fd3464ce5413691a7cab810d1c19db50182 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from c895ef1c05c7bd22683dea6b68782d53f25cf841 — the merge of head 3392bc4f047537a787c930266530a8e72c757196 into base ec6b5fd3464ce5413691a7cab810d1c19db50182, 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 c895ef1c05c7bd22683dea6b68782d53f25cf841 && git checkout c895ef1c05c7bd22683dea6b68782d53f25cf841
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ec6b5fd3464ce5413691a7cab810d1c19db50182 3392bc4f047537a787c930266530a8e72c757196 && git checkout -B drift-repro ec6b5fd3464ce5413691a7cab810d1c19db50182 && git merge --no-ff 3392bc4f047537a787c930266530a8e72c757196

node scripts/docs-audit/affected-docs.mjs --json ec6b5fd3464ce5413691a7cab810d1c19db50182

⚠️ 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 ec6b5fd3464ce5413691a7cab810d1c19db50182 → 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-project-manager · session_01FEkQ5kYk6G1CvandwWbbhe

Final green head: 2e47ef29108ed254b2288d3061c0d2c746c104a6


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR

Contract-review-claim: session_01FEkQ5mjfxPu5HKjUtuveBR · head 2e47ef2 · 2026-11-16T22:14Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn

席位核对 · PR #34477 · L1-b · 2026-11-16T22:17Z

Head-sha: 2e47ef2(merge-base 152cd1f;16 个文件,+1525/−109;终版声明 6930971431,dev 报告 6930288123,认领面扩展 6930318716)

结论:REWORK(3 项,另有 2 条 nit)

已核对、没有问题的部分

  • PR 形态:Fixes #33661。认领面的扩展(core、runtime、plugin-security、engine-double 基线)已在 6930318716 写明,并且与 diff 一致。
  • spec 改动:只替换了 dryRun 准入的那一条,新文字与裁决 6917953931 的 B 一致:允许试跑、只按试跑人身份、绝不提权、按名启动照旧拒绝。pin 测试新增了这几句,也断言旧的拒绝句已经不在。
  • 规则下沉到 core:
    • flowStartRefusal 里三处调用在下沉前后行为相同:AI 账户规则在 flow 存在时才问;requiredPermissions 在 !flow 之后才问。
    • runtime 原有的五个名字都还从原路径导出,missingCapabilities 也照旧可以从 required-capabilities.ts 导入。
  • plugin.ts 新增的 systemPermissions:注释说"真实运行不会带上它",属实。run-resume.ts:254 起逐个字段显式复制,没有复制 systemPermissions。
  • 写入拦截:
    • 用的是 AsyncLocalStorage 帧,同时在跑的真实运行看不到这个帧。
    • CRUD 节点对数据引擎只调用 find、findOne、insert、update、delete(crud-nodes.ts 已逐个 grep),其中三个写方法都被拦下。
    • 节点分类是白名单:不在任何一类里的节点类型停下,标为 not_simulated,不会被执行。
    • 屏幕节点的执行器只构造 ScreenSpec,不落库。
    • 测试替身的写方法一被调用就抛错,所以"零写入"有真实断言撑着。
  • 契约允许的差异:live 引擎会拒绝没有 multi 的谓词更新,dry run 照常放行。这在契约"数据引擎不判断模拟写入"那一条之内。
  • 拒绝断言:都比较了 code(PERMISSION_DENIED)和 message。dry run 返回的 refusal 按契约本来就不带 status。
  • 门禁和 CI:
    • dispatch-gates 推导出 108 族,跑了 106 族,2 族(check:i18n、check:dual-build-cjs-loads)标为 NOT MEASURED 并写了原因,由 CI 覆盖。
    • 这个 head 上 CI 56 项成功、11 项跳过、0 红,已读。
  • 消融:消融了准入调用,2 条测试变红,恢复后 blob 与 HEAD 一致,已核对。

R1 · 欠维护者对契约改动的批准,正文和声明都没写

裁决记录 6917953931 的 State 节原文是:"The contract change is a spec-surface PR and owes the contract review and the maintainer's approval before the implementation lands on it."(契约改动属于 spec 面的 PR,要先经过契约评审和维护者批准,实现才能落在它上面。)

这个 PR 把 spec 改动和实现合在了一起,但是:

  • 「需要你做的」只写了 canWriteObject 一项;
  • 终版声明 6930971431 的欠单里只有 L1 和契约评审。

二选一:

  • 把"维护者批准契约改动"写进欠单和「需要你做的」;
  • 或者给出可以核对的理由,说明这一项已经满足。例如引用他的原话或记录,表明选 B(选项原文含「契约加一条放宽」)即是对这句契约文字的批准。

R2 · canWriteObject 的开放问题没有 #N,也没有走决策路线

Acceptance notes 第一条和「需要你做的」直接请维护者裁定。按常设规则,需要他裁决的问题要走 Fable 决策线程,不能在 PR 正文里直接问他。另外,按 L1 规则,正文里点名的遗留要么给 #N,要么给可以核对的"不是缺陷"的理由。

二选一:

R3 · "按作者原文语言渲染、不套流程翻译"不在契约之内

Acceptance notes 说这几条已知近似"each inside the contract's words"(每条都在契约文字之内)。但契约的 The name. 段写的是:definition 的 name 就是节点读取每流程翻译键(flows.<flow>.…)时用的名字。也就是说,dry run 中节点读取翻译是契约的一部分。而且 FlowDryRunOptions 本身带 locale。

outboundPayload 用的是 renderTextSlot(slot.source, variables, context.currency),只按原文渲染,不读翻译,也不传 locale。结果是:在中文环境里,试跑展示的外发载荷会和真实运行发出的不一样。

二选一:

  • 补上翻译;
  • 或者把这一条从"契约之内"里拿出来,另立一张卡并引用 #N。

Nit(不阻塞)

  • N1:正文 Writes 段写"A refused write ends the run failed… and that write is the last step"(被拒的写会让运行以 failed 结束,且这次写是最后一步)。按契约,被拒之后运行会先走 fault 边或 try_catch 区域,都没有时才以 failed 结束。实现是抛错、交给 executeNode 处理,路径没问题,但正文这句写成了无条件。建议改写;如果方便,加一条测试:被拒的写走 fault 边之后继续运行。
  • N2:正文和 changeset 都只写了 Clause-②: yes,没写臂。按惯例应写 yes (widening) — 加上放宽了什么,例如 dryRun 的准入放宽、core 新增的导出、security 服务新暴露的成员。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 2e47ef29108ed254b2288d3061c0d2c746c104a6
Local-runs: none
Scope: packages/spec/src/contracts/automation-service.ts + packages/spec/src/contracts/automation-dry-run.pin.test.ts, packages/services/service-automation/src/dry-run.ts, packages/services/service-automation/src/dry-run.test.ts, packages/services/service-automation/src/engine.ts, packages/services/service-automation/src/plugin.ts, packages/services/service-automation/src/builtin/crud-nodes.ts, packages/core/src/security/flow-start-rules.ts, packages/core/src/security/index.ts, packages/runtime/src/flow-start-admission.ts, packages/runtime/src/required-capabilities.ts, packages/plugins/plugin-security/src/security-plugin-security-service.ts, packages/plugins/plugin-security/src/security-plugin.ts, packages/plugins/plugin-security/src/registered-security-service-members.pin.test.ts, scripts/engine-double-contract.pinned.json, .changeset/33661-automation-dry-run.md
Security-touching: yes

First record on this PR; no earlier findings. Card #33661 read through 6930318716 (ruling 6917953931, dev report 6930288123, announcement 6930971431).

① Derived judgments

  • Newly admitted, right: a runAs: 'system' draft of type autolaunched, record_change or schedule dry-runs for the named user. The run context is built from { ...flow, runAs: 'user' }, so resolveRunDataContext takes the user arm (isSystem: false, the user's own grants) for every read, every id lookup and every canWriteObject question. No node reads flow.runAs after setup. This is ruling B, unchanged.
  • Still refused, right: an AI service account on any runAs: 'system' definition (asked with aiExposed: false), and a user missing a requiredPermissions capability; both answer the by-name constant or message from the one copy in core. See S2 for the one case the account rule does not reach.
  • By-name starts unchanged: flowStartRefusal keeps rule 1 (ELEVATED_START_REFUSAL) and rule 2b in runtime and asks rules 2 and 3 in the same order with the same operands (door.aiExposed, flow.requiredPermissions); refusal objects, messages and missingCapabilities are moved verbatim. No refusal is weakened.
  • Never writes, right: only the four CRUD executors reach the data engine, through getData(), and inside a dry-run frame that is the stand-in, whose insert / update / delete touch no live method. Region bodies (loop, parallel, try_catch) all go through runRegion, which takes the dry executeNode. Outbound types are never called; every type outside the named classes stops the run before its executor runs.
  • A write the user may not make: canWriteObject false gives permission: 'refused', a thrown 403 PERMISSION_DENIED that refusalCarriedBy puts on the step, then a fault edge or failed. As published.
  • No check served (no plugin, or a service without the member): 'not_judged', nothing written, the run goes on. That is the published text ("With no object-level check installed, every write step answers 'not_judged'"), not a silent allow.
  • Public surface: @objectstack/core gains seven exports (additive). @objectstack/runtime's package entry exported none of the moved names before or after; the two module files keep every name as a re-export, so no entry export is dropped. FlowUserGrants.systemPermissions is optional. The spec hunk is docblock text only; no type moves.

② Semver level

Right. Clause-②: yes holds (the method's accepted set widens); Metadata-protocol: none (nothing an author writes changes) takes patch on the five packages the diff moves. Both lines are in the PR body and the changeset; Check Changeset is green. The changeset sentences match the code, with one loose spot: "re-exports every symbol under the name it had" is true of the two runtime modules, which is where the names lived.

③ Boundary flags

  • Open question (declare canWriteObject on ISecurityService): not this PR's. Judged as option A: the PR follows the published FlowDryRunWritePermission sentence. See N1.
  • File surface beyond the claim (core, runtime, plugin-security, the pinned JSON): amended on the card in 6930318716; accepted, service-automation cannot import runtime.
  • Governed reading: I agree with check-governed-merges. packages/spec/src/** is not a GOVERNED_SURFACES row, so the register gives this PR no Tier H. See S1 for what the ruling record says beside that.
  • Checks at the read: 67 check-runs, 56 success, 11 skipped (opt-in and queue-only jobs), none red, none pending.
  • SQL push-down: the stand-in reads the ids an update / delete filter matches (targets), with no limit. The contract's recordIds requires those ids, so the materialisation has its reason; see N3.
  • The PR is a draft; the WIP commit subject goes away at squash.

④ Design judgment

  • automation-service.ts (hit): holds against the ruling. The replaced bullet says what record 6917953931 says, sentence by sentence (admitted for the named user; never elevated; every read and permission judgement the named user's; by-name start unchanged), and the identity, AI-account and requiredPermissions text is untouched. The pin test holds the three new sentences and the absence of the old one.
  • dry-run.ts: agrees with the answer order (TypeError, the registerFlow throw through the shared judgeFlowRegistration, tenant, admission, start condition, input schema), the overlay read rules, placeholder ids, stops and step order. Two sentences it does not meet are S2 and S3.
  • Tests are not tautological. The live double throws on any write and the tests read the calls it never got; the ruling B test fails if the draft is refused or if any context is elevated; the refused-write test pins refused + PERMISSION_DENIED; the AI-account and requiredPermissions tests compare against core's constants and went red under the dev's ablation. Not pinned: delete_record, and the two cases in S2 and S3.

S1 (should-fix) — the ruling record's State section says the contract change "owes the contract review and the maintainer's approval before the implementation lands on it". The register does not govern the path, and this PR carries both the spec hunk and the implementation. The spec hunk is a contract change (a widening of one admission bullet). Whether ruling B is itself that approval, or a separate maintainer approval of this text is owed, is not mine to decide: the seat puts it to the maintainer, or records on the card why none is owed, before landing.

S2 (should-fix) — dryRun admission in dry-run.ts: when the named user's grants cannot be read, a runAs: 'system' definition is admitted, so the AI service account rule is not asked closed. The tenant and requiredPermissions arms do fail closed, and the code comment and PR body claim that for all three. Required: refuse when the definition declares runAs: 'system' and the grants read failed, with a pin. Nothing is written or elevated in that case.

S3 (should-fix) — judge in dryRunDataEngine: a canWriteObject that throws is reported 'not_judged' and the run goes on. The method's own contract says callers must treat a throw as a denial, and the published text lists two 'not_judged' cases, neither of them this. Required: report 'refused', with a pin.

N1 (nit) — SERVED_NOT_DECLARED's header still says a member another package calls belongs on ISecurityService; the new row is exactly that. It waits on the open question above.

N2 (nit) — the admission paragraph still says the rules are judged on the definition's type; after ruling B no dry-run rule reads it.

N3 (nit) — targets has no cap, and a predicate update without multi lists every match where the live engine would refuse. Outbound text renders untranslated although options.locale is taken (disclosed in the PR body).

No must-fix.

Implemented-by: claude/project-thread-high4j
Reviewed-by: session_01FEkQ5mjfxPu5HKjUtuveBR

VERDICT: PASS

… unread grants refuse a runAs system draft, a throwing write check is a denial, and predicate writes ask the engine's dispatch

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
…s after ruling B

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
…s the canWriteObject exception

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
@objectstack-fleet

objectstack-fleet Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR

Claim withdrawn: head 4889de3 is a mid-round push (lane note); review#2 reads the final head of the fix round when the lane names it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5kYk6G1CvandwWbbhe

Final green head of fix round 1: 4889de3970ee0c82f57bc1bb32bd7910aa1de246


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR

Contract-review-claim: session_01FEkQ5mjfxPu5HKjUtuveBR · head 4889de3 · 2026-11-16T23:55Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5kYk6G1CvandwWbbhe

Addendum to 6933072738 · the three code items of fix round 1, each by its pin on head 4889de3970ee0c82f57bc1bb32bd7910aa1de246

Item Code Pin Ablation on this head
L1 R3: dry-run text slots take the flows.<flow> translation keys in options.locale packages/services/service-automation/src/dry-run.ts:638-642 (the save_notice message through the live executor's renderSaveNoticeMessage, flow name from the definition at :791) dry-run.test.ts:437 (save_notice payload, zh-CN and plain), :448 (a refusing end node's zh-CN message) translation read removed: 1 failed, 25 passed; restored to blob equality
review#2 S2: admission fails closed when the named user's grants cannot be read, for a runAs: 'system' definition dry-run.ts:745-747 dry-run.test.ts:323 (a rejecting grants resolver, a schedule runAs: 'system' draft with no requiredPermissions, so only this arm can refuse) refusal disabled: 1 failed, 25 passed; restored
review#2 S3: a canWriteObject that throws reads 'refused' dry-run.ts:267-270 dry-run.test.ts:491 throw read as not_judged: 1 failed, 25 passed; restored

Source for every line: dev report #33661 comment 6933008472. The two choices left as they are, both named in the PR body under Acceptance notes: the unread-grants refusal carries the dry run's own message, and update/delete targets by a multi predicate are listed uncapped.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn

席位核对 · PR #34477 · L1-b · delta · 2026-11-16T23:56Z

Head-sha: 4889de3(对比 REWORK 6931060667 时的 2e47ef2;中间 4 个提交;终版声明 6933072738,dev 报告 6933008472)

结论:delta ACCEPT

R1 已闭合
「需要你做的」现在写的是:请维护者批准本 PR 中 dryRun 准入那一条契约改动,并引用了裁决 6917953931。终版声明的欠单顺序是:L1 → 本 head 的契约评审 → 维护者批准。

R2 已闭合,采用方案 (b)

R3 已闭合
作者逐个量了真实执行器,我在 head 上核对过:

  • notify-node.ts:1081/1082/1110 渲染 title、message、actionUrl 用的都是 renderTextSlot,不套翻译;http 节点同样如此。所以 dry run 用原文渲染,和真实运行一致。
  • save_notice 会翻译。它的渲染被抽成 renderSaveNoticeMessage,真实执行器和 dry run 都调用这同一个函数,并且使用 definition 自己的 name,与契约 The name. 段一致。
  • 新增测试钉住了 zh-CN 译文和无 locale 时回落原文两种情况;拒绝型 end 节点也钉了 zh-CN。
  • 「Known approximations」里已删掉"作者原文语言"那一条。

N1、N2 都已处理

  • N1:新增测试钉住了被拒的写入走 fault 边之后,后面的处理节点照常运行。正文那句也改了。
  • N2:changeset 和正文都改为 Clause-②: yes (widening) — …,逐项列出了 dryRun 准入的放宽、core 新导出的符号,以及 security 服务新暴露的成员。

一并改进来的 review#2 项,逐条读过

  • grants 读不到时,runAs: 'system' 拒绝:属于失败即关闭。理由是读不到 grants 就判断不了是不是 AI 账户,这个理由成立。这是相对本 PR 上一个 head 的收窄,dryRun 在 main 上没有实现,所以不构成对已发布行为的 narrowing。有测试钉住。
  • canWriteObject 抛错按 refused 处理:比原来的 not_judged 更保守。有测试钉住,同时保留了"未安装检查即 not_judged"。
  • 谓词更新、删除没有 multi 时:现在问的是引擎自己的 dispatch 判定(@objectstack/metadata-core 的 resolveEngine{Update,Delete}Dispatch,service-automation 本来就依赖这个包)。删除抛出的 new Error(dispatch.message) 与 live 引擎 engine-delete-and-aggregate.ts:435 一致。有带 multi 的对照组测试。
  • spec docblock:准入首句去掉了 type,因为裁决 B 之后,dry run 的准入不再按 type 判断。pin 测试同步更新了。

CI
本 head 上 57 项成功、13 项跳过、0 红。我读的时候只有 Check Changeset 还在跑,看起来是正文编辑触发的重跑。落地前要它也是绿。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4889de3970ee0c82f57bc1bb32bd7910aa1de246
Local-runs: none
Scope: packages/spec/src/contracts/automation-service.ts + packages/spec/src/contracts/automation-dry-run.pin.test.ts, packages/services/service-automation/src/dry-run.ts, packages/services/service-automation/src/dry-run.test.ts, packages/services/service-automation/src/engine.ts, packages/services/service-automation/src/plugin.ts, packages/services/service-automation/src/builtin/crud-nodes.ts, packages/services/service-automation/src/builtin/save-notice-node.ts, packages/core/src/security/flow-start-rules.ts, packages/core/src/security/index.ts, packages/runtime/src/flow-start-admission.ts, packages/runtime/src/required-capabilities.ts, packages/plugins/plugin-security/src/security-plugin-security-service.ts, packages/plugins/plugin-security/src/security-plugin.ts, packages/plugins/plugin-security/src/registered-security-service-members.pin.test.ts, scripts/engine-double-contract.pinned.json, .changeset/33661-automation-dry-run.md
Security-touching: yes

Delta review of 2e47ef29..4889de39 (a7fbb14, fade986, 7425632, 4889de3) over record 6931162967; the full head was re-read where the delta touches it. Read: final-head note 6933072738, dev report 6933008472 on the card, L1-b 6931060667 (R3), ruling 6917953931, the PR body.

Earlier findings

  • S1 (should-fix): closed.

    The PR body's 「需要你做的」 asks the maintainer, by name of the file and the bullet, to approve the dryRun admission hunk, cites ruling 6917953931's sentence, and says the seat lands only after that approval; 6933072738 lists the same order (L1, this review, then the approval). Spec hunk and implementation are in one PR, so the maintainer's approval of this PR before it lands is the ruling's sequence. The approval itself is still owed (see ③).

  • S2 (should-fix): closed.

    dryRun in dry-run.ts now refuses a runAs: 'system' definition whenever the named user's grants were needed and were not read (a failed read, an empty answer, no resolver). The pin (dry-run.test.ts, "grants cannot be read") uses a schedule draft with no requiredPermissions and no tenantId, so no other arm can refuse it; the lane's ablation turned exactly that test red.

  • S3 (should-fix): closed.

    judge in dryRunDataEngine answers 'refused' when the check throws; "no check served" still answers 'not_judged'. The pin asserts permission: 'refused', PERMISSION_DENIED and failed; ablation red on that test alone.

  • N1 (nit): closed.

    The SERVED_NOT_DECLARED header states the exception and names canWriteObject with the contract that places it.

  • N2 (nit): closed.

    The admission paragraph reads "judged on the supplied definition's runAs and requiredPermissions"; pinned present, old sentence pinned absent.

  • N3 (nit) — half closed, half carried as an accepted deviation. A predicate update / delete without multi now asks the engine's own dispatch (resolveEngineUpdateDispatch / resolveEngineDeleteDispatch), targets and reads no row, and fails with the engine's own error after the permission answer; pinned for both, with a multi control. The cap is not added, and that reasoning holds: FlowDryRunWriteStep.recordIds is "the rows the write targets … the live rows … it would change", so a truncated list would not be the published field.

  • L1-b R3 — met. The contract's The name. paragraph is about keys nodes read under flows.<flow>.…. Of the outbound types only save_notice reads one (renderFlowTextSlot has no caller in the notify, http or connector executors), and its message now goes through the executor's own renderSaveNoticeMessage under the definition's name in options.locale. Pinned in zh-CN and with no locale; a refusing end node's translated message is pinned too.

① Derived judgments

  • Newly refused relative to 2e47ef29, right: a runAs: 'system' definition with unread grants. dryRun has no implementation on main, so no published behaviour narrows; it is fail-closed under the account rule the contract already lists.
  • 'not_judged' to 'refused' for a throwing check: right, and inside the published two-case list for 'not_judged'.
  • fade986 is docblock text only: one clause loses the word type. No rule the dry run asks reads type after ruling B, the three rule bullets below it are untouched, and no accepted set narrows. It adds nothing beyond ruling B.
  • save-notice-node.ts (live executor): the message expression moved into renderSaveNoticeMessage with the same two arms, the same key, subject and shownAs, and the same render context (the writer's locale). The live path is unchanged; the full suite is green on it.
  • Public surface: renderSaveNoticeMessage is a module export, not re-exported from the package entry. DryRunHost gains one member, internal.

② Semver level

Right. patch on five packages, Metadata-protocol: none. The changeset line now reads Clause-②: yes (widening) — … and names the three widenings (the ruling B admission, the seven @objectstack/core exports, canWriteObject on the served security service); each matches the diff, and the PR body carries the same line. No narrowing arm is owed.

③ Boundary flags

  • Checks on this head: 71 check-runs, 58 success, 13 skipped (opt-in, queue-only and matrix-placeholder jobs), none red, none pending.
  • Open question 1 of 6933008472 (the unread-grants refusal carries the dry run's own message; the contract names no such refusal): accepted as option A. It is disclosed in the PR body; see N4.
  • Open question 2 (cap): option A, as N3 above.
  • Owed before landing: the maintainer's approval of the spec hunk (S1's hand-off). The PR is a draft.
  • SQL push-down: no new id materialisation in the delta; the one in targets keeps its contract reason.

④ Design judgment

  • automation-service.ts (hit): the paragraph now agrees with its own bullets and with the code's admission call, which reads runAs and requiredPermissions only.
  • dry-run.ts delta: agrees with the contract sentence by sentence, except S4.
  • Pins are not tautological: each new test fails on the prior head's behaviour for a stated reason, and the lane's three ablations each turned one pin red.

S4 (should-fix) — update in dryRunDataEngine asks the engine's dispatch but reads only reject from it. When the dispatch answers by-id on an id carried in the write's values (an update_record whose fields name id, with no filter), the live engine writes that one row, while the stand-in still derives its targets from the filter alone and reports, and lays the values over, every row the named user can read. recordIds is then not "the rows the write targets". Nothing is written or elevated. Required: target the dispatch's own id on its by-id answer, with a pin.

N4 (nit) — the published admission text names no unread-grants refusal and says each refusal carries the by-name message; this one carries the dry run's own. Accepted as disclosed; a contract sentence can follow on its own card. The pin covers a failing read only, not an empty answer or an unwired resolver.

No must-fix.

Implemented-by: claude/project-thread-high4j
Reviewed-by: session_01FEkQ5mjfxPu5HKjUtuveBR

VERDICT: PASS

…the engine dispatch picks

An update_record whose fields carry the row's id, with no filter, is a by-id
write to that one row; the stand-in now reads its targets off the dispatch's
own answer (by-id, multi, reject) instead of the filter alone. Pins the two
unread-grants arms the admission code already covers (an empty answer, no
resolver wired).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kYk6G1CvandwWbbhe
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5kYk6G1CvandwWbbhe

Final head of fix round 2: 3392bc4f047537a787c930266530a8e72c757196 (one commit over 4889de39)

  • review#2 S4 (6933178058): a dry-run update or delete targets exactly the rows the engine dispatch picks; a by-id answer, including an update's own id value with no filter, targets that one row. Code packages/services/service-automation/src/dry-run.ts:293-313, used at :339 and :357. Pin dry-run.test.ts:568 (red before the fix with ['d1','d2']), multi control :583. Ablation of the by-id branch turned exactly :568 red; restored to blob equality.
  • review#2 N4: the unread-grants refusal is pinned on all three arms (resolver rejects, answers null, not wired), dry-run.test.ts:329-339. Pins only; no contract text.
  • Tests: dry-run.test.ts 30/30; service-automation 286/286 files, 4082/4082, typecheck OK. Gates derived for the two touched files: 60 of 60 exit 0. Dev report: Automation: run an unpublished flow definition once, unarmed, as a named acting user against a supplied record (a dry run before publish) #33661 comment 6933797549.
  • CI on this head at writing: 56 success, 13 skipped, 0 red, 2 still running (rerun after the PR-body edit). PR body updated to this head.
  • No further dev rounds (maintainer, 00:28Z). Owed before landing: L1-b and review#2 on the delta 4889de39..3392bc4f, green CI, then the maintainer's approval of the spec hunk (ruling 6917953931), handed over by the seat as Tier H. Option B (canWriteObject on ISecurityService) and a contract sentence for the unread-grants refusal (review#2 N4) stay follow-ups for the seat, not this PR.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR

Contract-review-claim: session_01FEkQ5mjfxPu5HKjUtuveBR · head 3392bc4 · 2026-11-17T00:32Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 3392bc4f047537a787c930266530a8e72c757196
Local-runs: none
Scope: packages/spec/src/contracts/automation-service.ts + packages/spec/src/contracts/automation-dry-run.pin.test.ts, packages/services/service-automation/src/dry-run.ts, packages/services/service-automation/src/dry-run.test.ts, packages/services/service-automation/src/engine.ts, packages/services/service-automation/src/plugin.ts, packages/services/service-automation/src/builtin/crud-nodes.ts, packages/services/service-automation/src/builtin/save-notice-node.ts, packages/core/src/security/flow-start-rules.ts, packages/core/src/security/index.ts, packages/runtime/src/flow-start-admission.ts, packages/runtime/src/required-capabilities.ts, packages/plugins/plugin-security/src/security-plugin-security-service.ts, packages/plugins/plugin-security/src/security-plugin.ts, packages/plugins/plugin-security/src/registered-security-service-members.pin.test.ts, scripts/engine-double-contract.pinned.json, .changeset/33661-automation-dry-run.md
Security-touching: yes

Delta review of 4889de39..3392bc4f (one commit, dry-run.ts and dry-run.test.ts only) over record 6933178058. Read: lane note 6933829719, dev report 6933797549 on the card, the PR body. The spec hunk, the changeset and every other file are byte-identical to the head 6933178058 judged; its ①②④ readings of them stand.

Earlier findings

  • S4 (should-fix): closed.

    targets in dryRunDataEngine now takes the engine dispatch's own answer. A by-id answer targets the one id the dispatch picked, whether it came from the filter or from an update's own id value; a multi answer keeps the filter read unchanged; a reject targets and reads no row. update and delete both call it. The by-id arm reads that one id in the context the node handed over, which is the named user's, and a row that user cannot read answers no target: the step lists no id and nothing is laid over the run's view, as the live write would change no row. The pin (two live rows, fields naming d2, no filter) asserts recordIds: ['d2'] and that a later read of the other row is untouched; the prior head answered both rows. The multi control lists both. The lane's ablation of the by-id arm turned that pin alone red.

  • N4 (nit) — pins done, text carried. The unread-grants refusal is now pinned on all three arms (a failing read, an empty answer, no resolver wired). The published admission text still names no such refusal, and this one carries the dry run's own message; disclosed in the PR body, accepted, and named in 6933829719 as a follow-up for the seat.

  • N3 (nit) — unchanged: no cap on a multi write's targets, an accepted deviation, since recordIds is defined as the rows the write targets.

  • S1, S2, S3, N1, N2 and L1-b R3 stay closed as recorded in 6933178058; nothing in this commit touches them.

① Derived judgments

  • A by-id write now reports one row where the prior head reported the filter's rows: right, it is the published meaning of recordIds.
  • Filter writes under multi, and refused calls, answer as on the prior head.
  • No public surface moves: targets is a closure inside dryRunDataEngine.

② Semver level

Right, unchanged: patch on five packages, Metadata-protocol: none, Clause-②: yes (widening) — … on the PR body and the changeset. The commit publishes nothing new.

③ Boundary flags

  • Checks on this head at the read: 71 check-runs, 57 success, 13 skipped, none red, one pending (Check Changeset, re-run after the PR-body edit). It must be green before landing; the changeset file is unchanged from the head where it was green.
  • Owed before landing: the maintainer's approval of the spec hunk (ruling 6917953931), asked for in the PR body. The PR is a draft.
  • SQL push-down: the by-id arm reads one row by key; no new id materialisation.

④ Design judgment

  • automation-service.ts (hit): untouched by this commit; holds as judged in 6933178058.
  • dry-run.ts: the write paths now agree with FlowDryRunWriteStep.recordIds on every dispatch answer, and the target read stays in the named user's scope.
  • The new pins are not tautological: the id pin fails on the prior head, and the three unread-grants cases use a draft no other admission arm can refuse.

No must-fix. No open should-fix.

Implemented-by: claude/project-thread-high4j
Reviewed-by: session_01FEkQ5mjfxPu5HKjUtuveBR

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn

席位核对 · PR #34477 · L1-b · delta · 2026-11-17T00:33Z

Head-sha: 3392bc4(只读 delta 4889de39..3392bc4f,一个提交,两个文件;终版声明 6933829719,dev 报告 6933797549)

结论:delta ACCEPT

review#2 S4:写入的目标行改为直接读引擎 dispatch 的答案

  • dry-run.ts 的 targets() 现在接收 resolveEngineUpdateDispatch / resolveEngineDeleteDispatch 的结果:reject 不读任何行;by-id 只用 dispatch 选中的那个 id;multi 按 filter 在被代表用户的范围内读。
  • 我对照了 packages/metadata-core/src/engine-update-dispatch.ts:428 起的实现:更新先取 data.id(经过同一个标量判定),再退到 where.id。所以"fields 里写了 id、没有 filter"的更新,在真实引擎里就是按 id 改那一行。dry run 现在与之一致;旧实现按 where 去读,会把所有可读行都当成目标。
  • 删除的 by-id 只读 where.id,代码注释写明了,与删除 dispatch 一致。
  • 钉子 dry-run.test.ts:568:两行数据,只改 d2,recordIds 为 ['d2'],后续读到 open/won,说明叠加只落在 d2 上。:583 是带 multi 的对照组,两行都被改,读到 won/won。正文写明修复前 :568 是红的(得到 ['d1','d2']),by-id 分支的消融只让这一条变红,并已还原到与 HEAD 相同的 blob。

review#2 N4:读不到 grants 的三种情况都钉住了
:329-339 的 it.each 覆盖了 resolver 抛错、resolver 返回空、没有接 resolver 三种情况,runAs: 'system' 的 draft 都被拒,且步骤为空。这一轮只加了钉子,没有改契约文字。

正文

  • 测试段补写了"fields 里写 id、无 filter 只改那一行,并有 multi 对照组"。
  • 读数说明了两个 head:service-automation 和 dry-run 套件是在 3392bc4f0 上量的;spec、plugin-security、core、runtime 是在 4889de397 上量的。这一轮没有改后面这几个包,所以沿用成立。
  • 这一轮两个文件派生出的门禁共 60 项,全部 exit 0。

CI
本 head 上 58 项成功、13 项跳过、没有红,也没有还在跑的。

N1(不阻塞,交席位处理)
声明 6933829719 把"读不到 grants 时拒绝"这条补一句契约文字(review#2 N4)列为席位的后续,但正文和声明里都没有 #N。请席位开卡后在 PR 上写出卡号,或者写明不开卡的理由。

剩余欠单不变:review#2 读这一轮 delta,然后由维护者批准 spec 那一段(裁决 6917953931),属于 Tier H。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5pmEYLVFDcQ1Z1CS8H

维护者速读

Head-sha: 3392bc4f047537a787c930266530a8e72c757196

  • 改了什么:流程的 dryRun(试运行)按卡 Automation: run an unpublished flow definition once, unarmed, as a named acting user against a supplied record (a dry run before publish) #33661 的写权限契约来判:以指定用户的身份判断能否写,什么都不真正写入。AI 账号和 requiredPermissions 的准入规则下沉到 @objectstack/core,runtime 与 service-automation 共用同一套写法。plugin-security 的服务提供 canWriteObject(已登记为"已提供、未声明")。
  • 为什么要你看:裁决 6917953931 规定,契约改动要先过契约评审并经你批准,实现才能落在上面。本 PR 带 spec 契约改动(Clause-② yes),所以需要你批准。
  • 风险:两轮修复已补齐失败即拒(读不到授权就拒绝)、canWriteObject 抛错按拒绝处理、外发内容走 flows.<flow> 翻译。安全相关的部分 review#2 已按 Security-touching 审过。
  • 后续(不在本 PR):spec: flow dry-run follow-ups from #34477 (canWriteObject on ISecurityService; unread-grants refusal sentence) #34555,包括 canWriteObject 是否写进 ISecurityService(方案 B),以及"读不到授权"时拒绝消息的契约句。
  • 需要你做的:批准本 head 上的 spec 改动,点 Approve 或直接合并。批准后由席位落地。

席位意见:建议批准。

席位核对

  1. 形态:1600 多行,16 个以上文件,Clause-② yes。check-governed-merges 判为不受管,因为它是按裁决 6917953931 由你批准,所以走 Tier H。
  2. 审核:L1-b 在本 head 上 delta ACCEPT 6933872644;review#2 在本 head 上 PASS 6933871763,没有 must-fix,也没有未结的 should-fix。之前各轮:L1-b REWORK 6931060667 → 已修;review#2 PASS 6931162967 及 6933178058 提的 S 项 → 已修。
  3. 门禁:CI 58 条 success、13 条 skipped,没有失败,没有在跑。
  4. 落地条款:等 GOVERNED_APPROVERS 在本 head 上 APPROVED。落地前席位重读 head 和 check-runs;head 一动就摘掉挂签,回到等待。之后清 pm:awaiting-merge、标 ready、开 auto-merge。席位 Add metamodel interfaces for ObjectQL/ObjectUI contract #1 正在收尾,如果到时它已下班,由座位 2(pm:mailbox — repo:objectstack#2 · os-steve #34479)落地。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 17, 2026 02:13
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit f7b2d02 Nov 17, 2026
77 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-high4j branch November 17, 2026 03:02
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA

Merged as f7b2d02101, written at 2026-11-17T03:12Z. The approval is on record and the PR landed through the queue. pm:awaiting-merge comes off in this stroke.

@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
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.

Automation: run an unpublished flow definition once, unarmed, as a named acting user against a supplied record (a dry run before publish)

3 participants