Repository navigation
fix(plugin-email)!: the email template send judges the served holders, so a disabled package holds no name at the send (ADR-0150 D3) - #33361
Conversation
When a holder of a template name is disabled, the send resolves the name over the served holders, so a disabled package is never the answer and a refusal names only the packages that serve the name. The answer is only ever an address whose list holds no member of a disabled holder's side: the resolved served holder's own address, the environment-wide list for the environment's own item, or no template when the caller's own holding is the disabled one or no served holder answers it. With no holder disabled, every read is the one it was. Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude <noreply@anthropic.com>
…r a real stored pair row Replaces the parity pin (a disabled holder still counted at the send) with the declared answers: two holders with each set disabled, a dependent's addition enabled and disabled, one holder beside the environment's item (registered first or last) or a package-less stored row, and an auth name one package overrides, every caller class, en-US and fr-FR, both reads and both registration orders, over the protocol's execution list with a real stored customization-pair row. CONTROLs: nothing disabled; one holder. Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude <noreply@anthropic.com>
… the closure re-resolve The first check repeated what the re-resolve answers: a send resolved to the built-ins is resolved again over the served holders and read at the built-ins' own address. Ablating it moved no answer of the pins or of the probe matrix. Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude <noreply@anthropic.com>
…36-38) Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude <noreply@anthropic.com>
…ocol to source, and answer the ADR-0087 question The engine double the send pins read stored rows through opens findOne with assertEngineFindOnePredicate, and the pinned ledger records it. The protocol the pins read through resolves to this checkout's source. The changeset says why no ADR-0087 entry is owed: every moved answer follows a package's enabled state. Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check6 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 7 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 04d65c18570b5d951f535bc4b833a2c0f7690528 && git checkout 04d65c18570b5d951f535bc4b833a2c0f7690528
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e3f0cfd422d69100448ccd4f6a329c90a25715f7 019a4f028dfde8b27a1fe504404b492bbb5cf29f && git checkout -B drift-repro e3f0cfd422d69100448ccd4f6a329c90a25715f7 && git merge --no-ff 019a4f028dfde8b27a1fe504404b492bbb5cf29f
node scripts/docs-audit/affected-docs.mjs --json e3f0cfd422d69100448ccd4f6a329c90a25715f7 |
|
domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw |
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 4419624 · 2026-11-14T18:12:36Z review#3. |
Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentRow 37, as asked: accepted as declared (no template). Under ADR-0150 D4, an environment item or package-less row for a name a package holds is that package's customization. The registry already answers it that way ( The rest holds: judging the send over the served holders completes D3 at the last door #32183 left at main (R4-A). Choosing the address over filtering is forced by what the execution list carries, and it keeps the member rule. Implemented-by: VERDICT: PASS |
|
domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw
|
…s what it sends when only the enabled one holds it (objectstack-ai#33678) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D3DpgJLtDkE1fR76z3bz5Xm)_ Part of objectstack-ai#32670 Clause-②: no Metadata-protocol: none The card stays open: its `_env` half is objectstack-ai#33385 (area E1, still open). This PR is the "separate, declared move" that objectstack-ai#33361's acceptance notes and its contract review (record 6882047833, item ③) left owed once objectstack-ai#32354 landed. objectstack-ai#32354 landed in objectstack-ai#33405 (merged 2026-11-14T22:08Z, before objectstack-ai#33361). ## 维护者速读 - 改了什么:邮件模板名有一个持有包被停用、只剩一个在服务的持有包时,发送(经元数据协议的执行列表)改为读环境级列表,与"只有这一个包持有该名"时完全一致;另把 `servedBundleAddressOf` 中不可达的环境项分支改为"找不到模板"(复审 nit N1)。 - 为什么改:ADR-0150 D3「停用的包不持有任何名字」。objectstack-ai#32354(objectstack-ai#33405)落地后,环境级列表已不再列出停用包一侧的成员(自身项、定制对行、依赖包追加的语言),所以地址可以只按在服务持有包数量来选;此前读该包自己的地址,会漏掉依赖它的包追加的语言。 - 风险与回滚:只在有持有包被停用、且只剩一个在服务持有包时生效。实测唯一变化:该持有包的定制对行与依赖包追加语言落在同一语言时,答案从定制对行变为依赖包的语言,与停用包根本不持有该名时的答案相同。没有包停用时、或无协议只读注册表时,答案不变。回滚即 revert 本 PR。 - 先看:`packages/plugins/plugin-email/src/template-loader.ts` 的 `servedBundleAddressOf`(`onServedCount` 与 `servedCountDecides` 参数)以及 `readBundle` 中 `viaProtocol` 的传入;`template-loader.test.ts` 中 `two holders, BETA disabled` 一例的期望与新的 `one holder` CONTROL。 - 两分钟验证:`pnpm --filter @objectstack/plugin-email exec vitest run src/template-loader.test.ts`,预期 80 个测试全部通过。 - 需要你做的:无,席位落地 ## What changes `packages/plugins/plugin-email/src/template-loader.ts`, `servedBundleAddressOf` (the branch taken only while a holder of the name is disabled): - **The address is chosen on the served count when the bundle is read from the protocol's execution list.** One served holder ⇒ the environment-wide list (`undefined`), two or more ⇒ the answering holder's own address, exactly as `bundleAddressOf` chooses on the holder count when nothing is disabled. This applies to both answers that read a package's bundle: the name resolving to a served holder, and the closure re-resolve (a caller holding an addition only, or the built-ins for an `auth.*` name). - **Why it is safe now:** since objectstack-ai#33405 (objectstack-ai#32354) the environment-wide execution list holds no member of a disabled holder's side: its own items were already filtered, and the list naming no package now withholds its customization pair's rows and a dependent's added bundle members. So the read beside a disabled holder answers what it answers when that holder holds nothing of the name. - **The registry's own list keeps the per-holder address.** `registry.listItems` (read only when no protocol is registered) withholds neither, so there the move would leak a dependent's addition to the disabled holder (measured, see the second ablation). `readBundle` passes `viaProtocol` into `bundleAddressOf` as `servedCountDecides`. - **Nit N1:** the environment-item branch (`resolved.holder.kind` other than `package`) now answers `NO_BUNDLE` instead of the environment-wide read. It is unreachable while a holder is disabled (a name a package holds resolves to no environment item), so no answer moves; "no read is made beside a disabled holder for it" now holds by construction. - Doc comments on `bundleAddressOf` and `servedBundleAddressOf` restate the rule. Changeset: `@objectstack/plugin-email` patch. ### Moved answers Probe: the objectstack-ai#33361 world (a real `SchemaRegistry` and the protocol's real `getMetaItemsForExecution` over stored rows), 8 disabled states × 2 registration orders × 2 reads × 9 callers × 2 locales = 1,152 answers, on `babd5d4a` (FROM, `main`) and on this branch (TO), plus the same worlds with the disabled package's side removed instead of disabled (ABSENT: it ships nothing of the name; for ALPHA also no pair row and no dependent's addition). | Read | State | Caller | Locale | FROM | TO | ABSENT | |:--|:--|:--|:--|:--|:--|:--| | protocol | two holders, BETA disabled (ALPHA carries a pair row and a dependent's addition, both fr-FR) | omitted, null, ALPHA, BOTH, VIA_ALPHA, ADDER | fr-FR | the pair's row (`PAIR fr-FR`) | the dependent's addition (`ADDER fr-FR`) | `ADDER fr-FR` | 12 answers move (6 callers × 2 orders), all toward the ABSENT answer; 0 of the 1,152 move away from it. The answers that still differ from ABSENT number 204 (216 on FROM), and every one is a declared row of objectstack-ai#33361: the disabled package's own send (row 36), the environment's item or a package-less stored row beside a name only a disabled package holds (row 37), and the registry-only read (below). With nothing disabled the code path is unchanged (`bundleAddressOf`'s first branch), and the pinned CONTROLs hold. ## Tests `packages/plugins/plugin-email/src/template-loader.test.ts`, describe `a disabled package holds no name at the send (ADR-0150 D3, objectstack-ai#32670)`: - The `two holders, BETA disabled` case's protocol expectations move fr-FR from `PAIR fr-FR` to `ADDER fr-FR` for the six callers above (its registry-read override is unchanged: `no template`). - A new CONTROL, state `one holder` (ALPHA alone holds the name, nothing disabled), pins the answers the BETA-disabled case must equal for every caller but BETA itself. 1 case × 2 orders × 2 reads = 4 new tests; the file runs 80 (76 on `main`). ## Acceptance notes - **The registry-only read keeps a disabled-vs-absent difference.** With no protocol registered and BETA disabled, a fr-FR send for ALPHA's callers answers `no template` (ALPHA's own address, which the registry list narrows by `_packageId`), where ABSENT answers `ADDER fr-FR`. The move cannot be applied there because `registry.listItems` still lists a dependent's addition to a disabled holder (ablation 2 measures the leak). A host with no protocol has no metadata door; noted, not filed. - **The moved answer prefers the dependent's addition over the holder's pair row at the same locale.** That is `main`'s answer for a name one package holds with nothing disabled (the new CONTROL, both orders, and objectstack-ai#33361's R4-F note), not a rule this PR adds: the move only makes the disabled case equal to it. - **Not in this PR:** the `_env` cell of objectstack-ai#32183 row 17 (objectstack-ai#33385, area E1, `packages/metadata-protocol/src/**`) and the R4-G flow doors, as objectstack-ai#33361 recorded. So `Part of objectstack-ai#32670`, not a closing line. - The probe files were temporary and are not committed. ## Verification Read at `7612a59d` (the change). The head `9754555c` adds one merge of `origin/main` (`dd291b83` era, no conflict); the incoming commits touch no file of `plugin-email` and nothing in the list reads or the package-scoped resolver the loader calls (they change `objectql` engine-update, search and validation files and `metadata-protocol`'s seed loader and registry question), so the readings below are not re-run on the merge; CI reads the head. <details><summary>Tests, typecheck and lint (plugin-email), at 7612a59</summary> ``` pnpm --filter @objectstack/plugin-email test Test Files 53 passed (53) · Tests 1018 passed (1018) pnpm --filter @objectstack/plugin-email typecheck exit 0 · check:test-typecheck OK (0 errors) pnpm exec eslint (the two changed source files) exit 0 os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Ablation 1: the pins against main's loader (template-loader.ts restored from babd5d4)</summary> ``` on-disk mutation: servedCountDecides count=0 (HEAD has 6) × read: protocol > registered as listed > two holders, BETA disabled × read: protocol > registered reversed > two holders, BETA disabled Tests 2 failed | 78 passed (80) VERDICT command-exit 1 restored: git checkout HEAD -- the file; blob hash equals HEAD's; git status clean ``` </details> <details><summary>Ablation 2: the move forced onto the registry read (servedCountDecides passed as true)</summary> ``` anchor before: 1 · after: 0 · injected: 1 × read: registry > two holders, ALPHA disabled (both orders: ADDER fr-FR leaks) × read: registry > two holders, BETA disabled (both orders) × read: registry > an auth name one package overrides, ALPHA disabled (both orders: ADDER fr-FR leaks) Tests 6 failed | 74 passed (80) VERDICT command-exit 1 restored: blob hash equals HEAD's; git status clean ``` </details> <details><summary>Gate families</summary> Derived with `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at 7612a59 (64 commands), each run locally with its exit code captured before any pipe: ``` 61 of 64 exit 0 (check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, check-issue-citations, check:engine-double-contract, check:test-source-alias, check:registry-log-declared, check:cross-package-test-inputs, check:nul-bytes, check:published-files, check:type-check-coverage, the comment-mask corpus and the rest) NOT MEASURED, 3 (prerequisites of this checkout, not readings of the diff; CI runs each): check-plugin-teardown-shape --self-test exit 3: shallow clone, positive control commit unreachable check:dual-build-cjs-loads exit 3: PREREQUISITE NOT MET, reads every package's dist/ check:type-check-debt exit 3 under the 4096 MB heap cap; re-run uncapped, it began a whole-closure build under the shared lock, stopped (not read) ``` </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cx5ZPCyTk8ckTsx4ut)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
…ders, so a disabled holder's slot answers no bare name (ADR-0150 D3) (objectstack-ai#33646) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D3DpgJLtDkE1fR76z3bz5Xm)_ Fixes objectstack-ai#33386 Clause-②: yes (narrowing) — widened: a bare flow or connector name an enabled and a disabled package hold, read with no package or from a caller whose closure holds both, is served the enabled holder's slot or instance where it was refused naming both. Narrowed: the disabled holder's own callers, a caller reaching the name only through it, its address and its runs find no flow; refusals name only the packages that serve the name. With no holder of the name disabled, every answer is unchanged. Metadata-protocol: none ## 维护者速读 - 改了什么:一个流程名(或连接器名)被两个包持有、其中一个包被停用时,`/automation` 的按名门(裸名、命名空间地址、`_env`)、连接器连接门、流程动作/端点、启动准入的记录读取走查、MCP 恢复门,以及引擎的裸入口(`execute` / `getFlow` / `toggleFlow`)和运行中的子流程调用,改为只按"仍在服务的持有包"判断:剩一个就走它自己的槽位,剩两个以上 409 只点名在服务的包,一个不剩就是"没有该流程"。停用包自己的调用方拿不到流程,也绝不会被换成别的包的流程。 - 为什么改:座席裁决 6884403301(含 9 条修正)与 Q2 裁决 6888807772;此前这些门按 R4-G 保持 main 的答案(把停用包也算作持有者)。形状与邮件模板发送(objectstack-ai#33361)相同。 - 风险与回滚:收窄一侧:停用包自己的流程动作和子流程调用、只经停用包可达的闭包调用方、指向停用包的地址、停用包槽位里的运行(含 MCP 恢复),都不再拿到流程。持久坐标(槽位键、运行键、调度键、凭据作用域、子流程守卫的武装判定)仍按全部持有者判断,停用是可逆的,不移动任何键,无需迁移。定义写入(PUT/DELETE/克隆)在指向停用包、`_env` 或第三命名空间的地址上,409 只点名在服务的包,两个都停用时地址答 404;在服务包自己的地址上仍点名全部持有者。停用包的触发器仍会触发它的槽位(与 main 相同),延后到 objectstack-ai#33748。回滚即还原本 PR。 - 先看:`packages/services/service-automation/src/engine.ts` 的 `resolveFlowKey` / `servedBareFlowKey`(引擎裸入口与子流程调用);`packages/runtime/src/flow-slot-view.ts` 的 `servedFlowResolution` 与 `absentFlowView`(修正 4:停用包自己的调用方);`packages/runtime/src/domains/automation-address.ts` 的 `bareNameAdmission` 与 `admitAutomationAddress`。 - 两分钟验证:`pnpm --filter @objectstack/runtime exec vitest run src/flow-caller-package.test.ts src/domains/automation-addressed-route.test.ts`,预期全部通过;其中 `[objectstack-ai#33386]` 两个 describe 按两种注册顺序逐行断言下表。 - 需要你做的:无,席位落地。 ## What changes A flow name two packages hold has one engine slot per holder (ADR-0150 D4/D9, objectstack-ai#31696), and a connector name one instance per holder (objectstack-ai#31699). Every door that reads such a name now judges the **served** holders (a disabled package holds no name, ADR-0150 D3), under seat ruling 6884403301 and its nine amendments, and the Q2 ruling 6888807772 for the connector address: - `packages/runtime/src/domains/automation-address.ts`: `bareNameAdmission` (new) judges a bare by-name door. It answers the one served holder's slot, or a 409 naming the served holders, or nothing (the bare path, which answers its own 404). `admitAutomationAddress` judges the qualifier over the served holders. The slot is still chosen when the name is held by two or more packages over every holder, because the slots are keyed that way (amendment 7). `bareNameRefusal` (over every holder) is unchanged and still read by the MCP resume door to tell a run row's slot. - `packages/runtime/src/domains/automation.ts`: the admission arm serves a bare name's single served holder from its slot (`flowSlotView`) or instance (`ConnectorConnectionRequest.package`), the same way its address is served. A bare flow name on an engine with no slot entries keeps the bare service, whose bare entries judge the served holders themselves. - `packages/runtime/src/flow-slot-view.ts`: `flowServiceForCaller`, `flowWalkReads` (`rootPackage`, `callee`) and `flowHolderForCaller` judge a name two packages hold over the served holders. A caller whose own holding is the disabled one gets no flow (`absentFlowView`, new), never a closure holder's (amendment 4). `runSlotPackage` no longer answers a key's own package when that package is not among the holders the caller judges by (amendment 3). `endpointPackageOf` stays judged over every holder: it names the package an endpoint belongs to, and the flow is then resolved for that package. - `packages/services/service-automation/src/engine.ts`: `resolveFlowKey` judges a name two slots hold over the served holders (`servedCaller`). One served holder gives its slot, two or more are refused naming them, and none is `absent` (no flow). `execute`, `getFlow` and `toggleFlow` read it (`servedBareFlowKey`, amendment 9). The removal and history entries (`unregisterFlow`, `withdrawFlow`, `rollbackFlow`, `getFlowVersionHistory`) keep `bareFlowKey`, over every holder. The subflow guards' recorded arming verdicts (`flowCallKey`) ask `{ durable: true }`, over every holder, as before. - `packages/services/service-automation/src/plugin.ts`: `flowNameResolver` takes `servedCaller`. A caller whose own holding answers, inside a disabled package, gets `not-found`. Without that option the resolver answers as before, so the activation ledger's `stillHolds` still finds a disabled package's own flow. ### Clause-② table CRM and HR each hold the flow `convert` (one engine slot each) and the connector `mail` (one instance each). OPS depends on CRM, BOTH depends on both, NONE on neither. Every row is pinned in both registration orders, and with HR disabled too (symmetric). With nothing disabled, every row answers as `main` does (the CONTROLs). | Row | Door / caller | State | FROM (`main`) | TO | Arm | Ruling | |:---|:---|:---|:---|:---|:---|:---| | F1 | bare name, no package: `/automation/convert` read, trigger, toggle, runs; `/automation/trigger/convert`; engine `execute` / `getFlow` / `toggleFlow`; a flow action with no package | CRM disabled | 409 naming CRM and HR | HR's slot | widening | (2), am. 1, 9 | | F2 | a caller whose closure holds both (BOTH's action, a subflow call from BOTH's flow, the walk's callee) | CRM disabled | 409 `ambiguous-in-closure` naming both | HR's slot | widening | am. 5 | | F3 | CRM's own caller (its flow action, a subflow call from CRM's flow, the walk's callee) | CRM disabled | CRM's slot ran | no flow (not found), never HR's | narrowing | am. 4 | | F4 | a caller reaching the name only through CRM (OPS) | CRM disabled | CRM's slot ran | 409 `outside-closure` naming HR | narrowing | am. 4, 6 | | F5 | a caller reaching neither (NONE) | CRM disabled | 409 naming both | 409 naming HR | names fewer | am. 6 | | F6 | address naming CRM: `/automation/crm/convert/…`, `/automation/trigger/crm/convert` | CRM disabled | CRM's slot | 409 `not-held-by-qualifier` naming HR | narrowing | am. 2 | | F7 | address naming HR | CRM disabled | HR's slot | HR's slot | none | am. 1 | | F8 | `/automation/_env/convert/…`, a third namespace | CRM disabled | 409 naming both | 409 naming HR | names fewer | am. 6 | | F9 | bare run door (`/automation/convert/runs/:runId[/…]`), a run filed under CRM's slot key | CRM disabled | served from CRM's slot (the run's own) | answered as a run nobody holds; no verb called | narrowing | am. 3 | | F10 | bare run door, a run of HR's slot; HR's address | CRM disabled | served | served (HR's slot) | none | am. 3, 8 | | F11 | MCP `resume_run` of a run filed under CRM's slot key, through CRM's or HR's flow action | CRM disabled | CRM's own action resumed it | refused (403), stays parked | narrowing | am. 3, 4 | | F12 | start admission's walk: the started flow's package (`rootPackage`) for the bare name | CRM disabled | `null` | HR | widening (the slot that executes) | am. 8 | | F13 | every caller, every door, the engine's bare entries | both disabled | 409 naming both, or a slot ran | no flow; an address answers 404; the bare name and `_env` take the bare path, which answers not found | narrowing | (1) | | F14 | durable coordinates: slot keys (`flowSlotKey`), run keys, `flowDispatchHolder`, the credential channel's `at()` / `isShared`, the subflow guards' verdicts, `bareNameRefusal` | any | judged over every holder | unchanged | none | am. 7 | | F15 | definition writes (`PUT` / `DELETE /automation/:ns/convert`, `POST …/convert/clone`) at an address naming CRM, at `_env`, at a third namespace | CRM disabled | 409 naming CRM and HR | 409 naming HR | names fewer | am. 2, 6 | | F15b | the same writes at HR's address | CRM disabled | 409 naming CRM and HR | unchanged | none | am. 7 | | F15c | the same writes at CRM's or HR's address | both disabled | 409 naming both | 404 | narrowing | (1) | | F16 | MCP `resume_run` of HR's parked run through a package-less flow action, or through BOTH's (depends on CRM and HR) | CRM disabled | refused (403) | resumed, once | widening | am. 1, 5 | | C1 | `/automation/connectors/crm/mail/connection` (names the disabled holder) | CRM disabled | the service answered 404 | 409 `not-held-by-qualifier` naming HR; the service is not asked | refusal shape | Q2 (1) | | C2 | `/automation/connectors/hr/mail/connection` (names the served holder) | CRM disabled | HR's instance (`package: HR`) | unchanged | none | Q2 (1), (2) | | C3 | `/automation/connectors/mail/connection` (bare) | CRM disabled | 409 naming both | HR's instance (`package: HR`) | widening | Q2 (1) | | C4 | `/automation/connectors/_env/mail/connection`, a third namespace | CRM disabled | 409 naming both | 409 naming HR | names fewer | Q2 (1) | | C5 | every connector address; the bare name and `_env` | both disabled | the slot (then the service's 404), or 409 naming both | an address answers 404; the bare name and `_env` reach the service with no package | narrowing | Q2 (1) | **Q2 condition 2 (legacy package-less row).** C2 was checked against a legacy connection row that names no package (`connector-connection-door.test.ts`, the case "a package-less row a second (disabled) holder makes no one package's"). Through the served holder's package, the service answers that state with the same 409 ("stored-references bind") as it answers the bare read, and the row stays. The address names the served holder's slot before and after this PR, so C2 does not move. The new case pins that answer, and it is the answer C3 now hands the bare door in that state (before: the door's own 409 naming both). Condition 3: the service's address case for the disabled holder (404) is kept as it is. A name one package holds, or none, is judged as before (CONTROLs). First-party count: no first-party composition ships a flow or connector name two packages hold and disables one of them. **Deferred:** amendment 3's trigger binding (a runtime-disabled holder's trigger still fires its slot, as on main) → objectstack-ai#33748. **No migration.** No schema key, stored row, slot key, run key or dispatch key changes, so there is nothing to rewrite: the answers that move follow a reversible package state. The changeset says the same in visible text. ## Tests - `packages/runtime/src/flow-caller-package.test.ts`: the R4-G parity describe, whose premise this card reverses, is replaced by `the objectstack-ai#31696 flow doors judge the served holders (ADR-0150 D3, objectstack-ai#33386)`. It runs over a real `SchemaRegistry` (`disablePackage`, the served filter), with an engine double whose bare entries judge the served holders. Per registration order it has a CONTROL with nothing disabled, CRM disabled and HR disabled (each a full answer table over six callers, four namespaces and `_env`: rows F1 to F8 and F12 to F14), both disabled (F13), one disabled holder (CONTROL), and no holder (CONTROL). - `packages/runtime/src/domains/automation-addressed-route.test.ts`: `[objectstack-ai#33386] the by-name doors judge the served holders…`, through the real `HttpDispatcher` over a real `SchemaRegistry`, in both orders. It covers the flow rows F1, F6, F7 and F8, the definition writes F15 to F15c, and the connector rows C1 to C5. - `packages/runtime/src/domains/automation-run-doors-per-slot.test.ts`: `[objectstack-ai#33386] the run doors while a holder is disabled` covers rows F9 and F10 at all five run doors, with both disabled. - `packages/runtime/src/mcp-resume-run.test.ts`: rows F11 and F16, and the CONTROL (HR's run through HR's action). - `packages/services/service-automation/src/flow-slots-per-package.test.ts`: the engine's R4-G parity describe is replaced by `[objectstack-ai#33386] a run of a name two slots hold judges the served holders`. It runs on the real engine and the real `flowNameResolver` over a real `SchemaRegistry`, with a runtime disable (both slots armed) and a boot disable (one armed), in both orders. It covers F1 to F5, the slot keys and dispatch key unmoved (F14), and both disabled (`execute` / `getFlow` / `toggleFlow`: not found). - `packages/services/service-automation/src/connector-connection-door.test.ts`: the Q2 condition 2 case (above). - Refusals are asserted by envelope (`code` `RESOURCE_CONFLICT`, status 409) and candidates. ## Acceptance notes - **The definition writes (amendments 2, 6, 7).** `PUT` / `DELETE /automation/:ns/:name` and the clone, at the served holder's own address, keep their 409 naming every holder (F15b). At an address naming the disabled holder, at `_env` or at a third namespace, the address admission now refuses them 409 naming the served holder only (F15), and with both holders disabled an address answers 404 (F15c). An earlier draft of this note and of the changeset said every such write keeps its 409 naming every holder; that was wrong and is corrected. A bare definition write (`PUT /automation/convert`) is refused by the metadata store over its stored rows (`flowWriteRefusal`), which this PR does not touch; it is not pinned here. - **Deferred: amendment 3's trigger binding.** A runtime-disabled holder's trigger still fires its own slot (the engine's `triggerRun` executes the armed slot key with no served check), as on `main`; nothing is substituted. Deferred by the seat to objectstack-ai#33748. - **Not moved: the anonymous inbound hook** (`inboundHookSlot`, `/automation/hooks/:name`). Its bare form for a name two slots hold stays refused, and its log names every holder. The ruling's nine amendments do not name it. It is an anonymous door whose refusal is logged, not answered. A design question, raised in the report. - **Not moved: `endpointPackageOf`.** An endpoint's own package is read over every holder of its `api` name, and the endpoint's flow is then resolved for that package (served, F3/F4). An `api` name two packages hold, one disabled, still names no package there. Raised in the report. - **Not moved: a name one package holds, disabled.** Read from the code, not pinned here: the bare doors and the engine's bare entries still serve the one disabled holder's flow (a not-shared name is outside R4-G; its address already answers 404, pinned). Raised in the report as a separate question. - The subflow guards (`flowCallKey`: arming verdicts recorded at registration) keep reading over every holder. A disable re-judges nothing, so a served reading there would record a verdict the next enable contradicts (AGENTS.md, startup registry reads). ## Verification **At head `99fca269`** (review#3 should-fixes, on top of a merge of `origin/main` at `9bb45bb9`). Since `4a3db01c` only tests and text changed: `.changeset/33386-flow-doors-served-holders.md` (+6/-1), `automation-addressed-route.test.ts` (+31/-2: one pin, F15 to F15c, and a body argument for its call helper), `mcp-resume-run.test.ts` (+19: F16). No source file changed, so the dependents and the dogfood battery were not re-run. - `pnpm --filter @objectstack/runtime test`: Test Files 603 passed (603), Tests 10902 passed, 19 skipped (10921). VERDICT command-exit 0. - `pnpm --filter @objectstack/service-automation test`: Test Files 282 passed (282), Tests 3977 passed (3977). VERDICT command-exit 0. - `pnpm --filter @objectstack/service-automation --filter @objectstack/runtime typecheck`: VERDICT command-exit 0 (both `check:test-typecheck: OK`). - `check-adr-0087-registration --base origin/main`, `check-changeset-no-major`, `check-empty-changeset`, `check-changeset-fixed`, `check-nul-bytes`, `eslint --no-inline-config` on the two touched tests: each exit 0. The readings below are at `4a3db01c` (after merging `origin/main` at `dd291b83`), unless named. **Status: done.** All nine amendments of ruling 6884403301 and the three Q2 conditions are implemented and pinned, except amendment 3's trigger binding, deferred to objectstack-ai#33748 (table rows above; amendment 9's engine bare entries `execute` / `getFlow` / `toggleFlow` move in this PR). Not done: see the last list. <details><summary>Tests (lock VERDICT per step, every step exit 0)</summary> - `pnpm --filter @objectstack/runtime test`: Test Files 603 passed (603), Tests 10857 passed, 19 skipped (10876). - `pnpm --filter @objectstack/service-automation test`: Test Files 282 passed (282), Tests 3977 passed (3977). - `pnpm --filter @objectstack/service-automation --filter @objectstack/runtime typecheck`: exit 0 (both `check:test-typecheck: OK`). - `src/mcp-resume-run.test.ts`: 45 passed. - Direct dependents of runtime and service-automation, `test`: hono 258, example-crm 51, connector-mcp 119, connector-openapi 111, connector-rest 57, connector-slack 10, plugin-dev 89, cloud-connection 1211, trigger-record-change 122, trigger-schedule 256, client 812, plugin-approvals 1652, example-todo 249, example-showcase 545, http-conformance 292, verify 437: all passed. `@objectstack/cli` unit layer: Test Files 421 passed (421), Tests 5979 passed (integration layer declared to CI). `objectstack-blank`: NOT MEASURED, reason: not a workspace project (the filter matches nothing). - Full dogfood battery (owed by the narrowing arm), `pnpm --filter @objectstack/dogfood test` at `4a3db01c`: Test Files 467 passed, 3 skipped (470); Tests 3958 passed, 42 skipped (4000). - `eslint --no-inline-config` on the touched files: exit 0. </details> <details><summary>Ablations (each through `scripts/ablation-replace.mjs`, restored to the HEAD blob; `git diff HEAD` empty after)</summary> Run at `e4729b39` (pre-merge; the four source files are identical at the head): - A1, the engine's `resolveFlowKey` asks over every holder (`{ includeDisabledPackages: true }` for the run): `flow-slots-per-package.test.ts` 10 of 51 red. - A2, `admitAutomationAddress` judges a shared name over every holder: runtime 3 files, 22 of 158 red. - A3, `servedFlowResolution` without the disabled-own-caller branch (amendment 4): 6 of 158 red. - A4, the plugin resolver's `servedCaller` branch disabled: `flow-slots-per-package.test.ts` 6 of 51 red. - A5, `bareNameAdmission` reads the served resolution over every holder: 22 of 158 red. </details> <details><summary>Gates</summary> - Derived local families (`dispatch-gates.mjs --commands`, 74 at `4a3db01c`): 71 exit 0. `check-adr-0087-registration --base origin/main` exit 0 (`not-required (no-migration-prescription)` read). `node scripts/check-plugin-teardown-shape.mjs --self-test`: NOT MEASURED, exit 3 PREREQUISITE (the shallow clone cannot reach its pinned positive control). `pnpm check:dual-build-cjs-loads`: NOT MEASURED, it reads every package's `dist/`; CI runs it. `pnpm check:type-check-debt`: exit 0 at `e4729b39`; NOT MEASURED at `4a3db01c` (its closure build lost the lock to the dogfood run, then the re-run was stopped at hand-over). - The CI families: in progress at hand-over; the seat reads the PR's check-runs. </details> ### Not done - `check:type-check-debt` re-run at the head (exit 0 at `e4729b39`; NOT MEASURED since). The CI families at `99fca269`: the seat reads the PR's check-runs. - Amendment 3's trigger binding: deferred to objectstack-ai#33748 (see above). - The PR body is still the draft's: this text is for the seat to post (the dev does not PATCH a PR body). - Raised for decision (not changed here): the anonymous inbound hook's bare refusal, `endpointPackageOf` for an `api` name two packages hold, and a one-holder disabled name at the bare doors (Acceptance notes). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cx5ZPCyTk8ckTsx4ut <!-- signed: domain:server#5 · os-elon-musk · session_016WV4cx5ZPCyTk8ckTsx4ut --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Part of #32670
Clause-②: yes (narrowing) — widened: a send of a template name an enabled and a disabled package hold, made with no package or from a caller whose closure holds both, is served the enabled holder's template where it was refused naming both. Narrowed: a send that only a disabled holder's side answered (its customization pair's row, a dependent's added locale, the environment's item or a package-less stored row beside a name only it holds) finds no template; a send of an auth name whose one overriding package is disabled is served the built-in copy. Refusals name only the packages that serve the name. With no holder of the name disabled, every answer is unchanged.
Metadata-protocol: none
Skills-docs: none — no skill under
skills/**and no page undercontent/docs/**teaches what an email template send answers when a package holding the name is disabled.维护者速读
template-loader.ts的bundleAddressOf)在模板名有持有包被停用时,只按"仍在服务的持有包"解析名字,并且只从不含停用包成员的地址读取模板(解析出的持有包自己的地址,或内置模板的地址);停用包自己发送、或没有任何在服务持有包能回答的发送,一律"找不到模板"。没有持有包被停用时,行为与 main 完全相同。template-loader.ts一个文件。_env单元格与 R4-G 流程门不在本 PR(见 Acceptance notes)。packages/plugins/plugin-email/src/template-loader.ts(servedBundleAddressOf,尤其"读哪个地址"的分支);packages/plugins/plugin-email/src/template-loader.test.ts(新 describe 的期望表);.changeset/32670-email-send-served-holders.md(逐行 FROM → TO)。pnpm --filter @objectstack/plugin-email exec vitest run src/template-loader.test.ts,预期 76 个测试全部通过。_env单元格(需要改packages/metadata-protocol,属 E1 区域)与 R4-G 流程门的去向;本 PR 落地须等 metadata-protocol: a name held only by stored rows of two packages, one disabled, answers by save order, and /layers takes the first composite when the environment holds its own item (ADR-0150 D3) #32354。What changes
createRegistryEmailTemplateLoader'sbundleAddressOf(packages/plugins/plugin-email/src/template-loader.ts):main's, unchanged (resolve, count and the shared view over every holder, which are the served holders here). Measured: 0 moved answers with nothing disabled, across the probe matrix below.servedBundleAddressOf): the name is resolved over the served holders, so a disabled package is never the answer and a refusal names only the packages that serve the name. The bundle is read only where no member of a disabled holder's side is listed:mainalready read a name two packages hold);NO_BUNDLE, no list is read);_packageIdthere is the slot it fills, not the package that stores it. A pair row filling a locale a dependent also adds wears the dependent's id; the environment's item over a disabled holder's slot wears the disabled holder's id. So the member rule of contract review 6819947096 (a send returns only members stored under the resolved holder, its pair, a dependent whose closure holds it, or no package) is met by choosing the address, never by filtering_packageId.The card's rows 27 to 31 (PR #32497's round-3 table, withdrawn under R4-A) are restored, and rows 36 to 38 are declared. Numbering: 27 to 31 follow the round-3 changeset's order (rows 29 and 30 are the two refusals naming the enabled holder, per the red-line read 6819956008); 32 to 35 stay #32497's.
main)null)outside-closurenaming the enabled holderoutside-closurenaming bothoutside-closurenaming the enabled holderoutside-closurenaming it for a caller with no pathauth.*) whose one overriding package is disabledFirst-party count 0 on every row: no first-party composition ships an email template name two packages hold, or disables a package that holds one.
Tests
packages/plugins/plugin-email/src/template-loader.test.ts: the R4-A parity describe (a disabled holder still counts at the send), whose premise this card reverses, is replaced bya disabled package holds no name at the send (ADR-0150 D3, #32670):SchemaRegistryand the protocol's realgetMetaItemsForExecution(ObjectStackProtocolImplementation, aliased to this checkout's source) over storedsys_metadatarows: ALPHA's customization pairALPHA.customstores an fr-FR member row; ADDER depends on ALPHA only and adds fr-FR. No double overregistry.listItems. The engine double opensfindOnewithassertEngineFindOnePredicate, and carries no write verb.null, ALPHA, BETA, a closure holding both, a closure through ALPHA only, neither, the dependent, the built-in package.codeRESOURCE_CONFLICT,status409) and its candidates.Acceptance notes
_envcell of objectql + metadata-protocol + runtime: by-name doors judge a name's holders over the served list, so a disabled package neither refuses nor is named (ADR-0150 D3; #32101 F4 class) #32183's row 17 (ruling R4-B2). Moving_envof a name only disabled packages hold frommain's 409 to row 17's 404 needspackages/metadata-protocol/src/**, which this lane may not edit (area E1):admitEnvironmentQualifier(protocol-exact-qualifier.ts) admits the read when no package serves the name, and the_envmark has to reach the item face (protocol-meta-item-face.ts,disabledOnlyHolderOf) through both transports (packages/runtime/src/domains/meta.tsat itsadmitEnvironmentQualifiercall, andpackages/rest/src/meta-qualified-item-route.ts), so the face answers the withheld 404 and never the disabled holder's pair row. Raised for decision in the report; the card stays open (Part of).mainand carries their served judgment to this card (flowServiceForCaller,endpointPackageOf,flowWalkReads,flowHolderForCallerin runtimeflow-slot-view.ts;bareNameRefusalandadmitAutomationAddress's shared branch in runtimeautomation-address.ts;heldByMany,sharedFlowNameRefusalandresolveFlowKey's shared branch in service-automationengine.ts; and the dispatch keyflowDispatchHolder). A runtime disable keeps a disabled package's engine slot armed, so a served read there moves those doors both ways; that is a design question, raised for decision in the report.getEnvironmentScopedItemis undefined), and the execution list stamps the item with the disabled holder's slot. Sending nothing is the conservative answer (red line: resolution is never loosened); the reviewer may rule otherwise.servedBundleAddressOf(a resolve to the environment's own item, read environment-wide as before) is unreachable in the probe matrix: replaced by no template, 0 of 31,104 answers move. It is kept asmain's answer for that resolve.mainanswers some one-holder sends beside the environment's item in an order-dependent way (the en-US slot answers the holder's template in one registration order and the environment's item in the other), the same on both trees with nothing disabled. Not moved here; the pins use no such CONTROL.auth.*names) answers like any other package holder; measured in the matrix, not pinned.Verification
All at
4419624c1aunless named.Probe matrix (FROM = `main`'s loader, TO = this head's, one process, same registry per answer)
31,104 answers: one or two holders with every subset disabled; beside nothing, the environment's item registered first or last, or a package-less stored row; with and without the pair's stored fr-FR row; no dependent, the dependent enabled or disabled; no built-in, the built-in holding a non-auth name, or an auth name; 9 callers; en-US and fr-FR; both reads; both orders.
main1,127; this head 107, all 107 unmoved frommainand all in nothing-disabled states (the built-in package as caller of a one-holder non-auth name, R4-F's shape); new ones: 0.Ablations (each through `scripts/ablation-replace.mjs`, restored to the HEAD blob)
bundleAddressOfnever callsservedBundleAddressOf): 32 of 76 red, every disabled case in both orders and both reads; the 12 CONTROL tests and the other 32 stay green.26768975c). A2, A4 and A5 ran atb82d77303, whosetemplate-loader.tsdiffers from the head's only by that deleted line; A1 ran again at the head.Tests and gates
pnpm --filter @objectstack/plugin-email test: Test Files 53 passed (53), Tests 1010 passed (1010) (lock VERDICT command-exit 0).pnpm --filter @objectstack/plugin-email typecheck(tsc, thencheck:test-typecheck): exit 0,check:test-typecheck: OK.eslint --no-inline-configon the two touched source files: exit 0.dispatch-gates.mjs --commands, 79 commands): 75 exit 0 on the first run;check-adr-0087-registration,check:engine-double-contractandcheck:test-source-aliaswere red on the first run and are exit 0 after4419624c1a(the ADR-0087 disposition, the pinnedfindOneand its ledger line, the protocol's source alias).check:dual-build-cjs-loads: NOT MEASURED, reason: PREREQUISITE NOT MET (it reads every package'sdist/; CI runs it).@objectstack/plugin-email(60 downstream packages, throughrestandclient): not run locally; the public surface is byte-unchanged (no export, type or signature moves; the change is module-internal), and Test Core runs the affected set. The full dogfood battery is owed by the narrowing arm and is reported with the dev report.Generated by Claude Code