Repository navigation
feat(service-automation): the connector connection store, the connect door and the OAuth callback read and write one instance by its package and name - #33218
Conversation
… door and the OAuth callback read and write one instance by its package and name The store reads, connects, revokes and lists by (organization, package, name). A package-less row answers a package's instance only where the name's durable resolution binds it there (or no registry can judge), and that package's connect adopts it in place. Two answering rows are refused 409 at the door and 503 at a dispatch, never one used; an organization whose read is refused is still counted. The door resolves the name to one declared instance; the begin records its package in the pending authorization and the callback completes exactly that package's entry. An unstamped entry is the instance of the package its name's durable resolution holds it under, for the door and the dispatch alike. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
📓 Docs Drift CheckThis PR changes 1 package(s): 46 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 17 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 11 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 1e977dd8bf0d607fa0176fa1ca2583318ff945b4 && git checkout 1e977dd8bf0d607fa0176fa1ca2583318ff945b4
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e540baf8873c22642ce191b99e7e5ce1fd3b4620 0704ffc0478e381ff0eaf59b5c75324bf8eb790c && git checkout -B drift-repro e540baf8873c22642ce191b99e7e5ce1fd3b4620 && git merge --no-ff 0704ffc0478e381ff0eaf59b5c75324bf8eb790c
node scripts/docs-audit/affected-docs.mjs --json e540baf8873c22642ce191b99e7e5ce1fd3b4620
|
|
domain:server#7 · os-tesla · session_01L9qibzKCovWpJoMZD6U3NT Contract-review-claim: session_01L9qibzKCovWpJoMZD6U3NT · head e72a245 · 2026-11-14T14:19Z The maintainer lifted the review pause at 14:17Z. An isolated reviewer sub-agent of the card thread is reviewing this head at |
|
domain:server#7 · os-tesla · session_01L9qibzKCovWpJoMZD6U3NT Posted 2026-11-14T14:33Z. The brief the card thread handed its isolated reviewer sub-agent for the record below, verbatim. Contract review brief — PR #33218 @
|
|
domain:server#7 · os-tesla · session_01L9qibzKCovWpJoMZD6U3NT Posted 2026-11-14T14:34Z. An isolated reviewer sub-agent of the card thread produced this record from the brief alone (card #31699 with all 37 comments, PR #33218's body, file list and net diff, and the check-runs on the head). Contract reviewServed-tier: ① Derived judgmentsRead: 11 files, +866 / -72, all under
② Semver level
③ Boundary flags
Implemented-by: VERDICT: FAIL |
…connection row of the name answers its instance, so a declaration that moves keeps its connection The contract review found that a declaration moving to another package (or to the environment) read "not connected" under one holder, and its old row could be neither read nor revoked. Under one holder, or with no registry to judge, the store now answers every row of the name, as the read by name did; a connect adopts and restamps the row, null included, and a revoke removes it. Under two holders a package reads its own rows, and a row naming none of the holders is no package's. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
…lared entry the door serves where the name resolves to another package Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
|
domain:server#7 · os-tesla · session_01L9qibzKCovWpJoMZD6U3NT Posted 2026-11-14T14:37Z. This is the same isolated reviewer's delta review of the fix for FAIL record 6878911246, under brief 6878905826, read as Contract reviewServed-tier: ① Derived judgmentsDelta: 5 files, +148 / -67. The new rule (
New in the delta, all nits:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:server#7 · os-tesla · session_01L9qibzuZJBQY4wUQFJbkfx 维护者速读 · PR #33218 @
|
…tance by its package and name, and a dispatch addresses the one its caller's name resolves to (objectstack-ai#33281) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao3aDjoEUznHeGMZJaoMEKa5)_ Part of objectstack-ai#31699 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 改了什么:自动化引擎按「包 + 名字」持有连接器实例(`ConnectorInstances`)。`connector_action` 按调用方 flow 的包解析出那个实例,并从它读取处理器、`effect` 和 `inputSchema`。只按名字读时,只有一个实例才回答,两个时不回答,绝不挑一个。 - 为什么改:ADR-0150 D4,objectstack-ai#31699 PR 3b。3a-ii 让连接存储、连接门和回调按包读写;本 PR 让引擎也按包持有和派发。 - 不变:一持有者兜底仍在,协调器每个名字只保留一个实例(`soleOfName`)。因此除下面一个过渡状态外,所有派发、连接门和 HTTP 答复照旧。 - 答复变化(changeset 的 "What answers differently"):一个没有包戳的声明条目,启动后名字多出第二个持有者时,派发不再继续用启动时那个包的连接(200),改为 503。连接门从 3a-ii 起就拒绝这种名字(409),现在派发与它一致。持有者被卸载或替换、仍只有一个持有者时,答复不变(objectstack-ai#33218 的单持有者规则),下一次协调按新包重新注册实例。 - 范围:认领修订 6870521528,按交接 6871869590 收窄。objectstack-ai#33218 审查的 N3(授权句柄的包在创建时固定)在本 PR 解决,改为每次读取时取包;N6(换包后旧行保留旧包戳,直到重新连接)转到收窄 PR。 - 从文件清单移出的一项:认领修订(objectstack-ai#31699 comment 6870521528)里 "`plugin.ts`: the materializer state and `grantHandles` are keyed by instance" 这一行移到收窄兜底的 PR。原因见下文 "Moved to the narrowing PR"。 - 先看:`packages/services/service-automation/src/connector-instances.ts`、`src/engine.ts`(`resolveConnectorInstanceFor`)、`src/plugin.ts`(`declaredInstance`、期望签名里的包)、`src/oauth2-grant/grant-handle.ts`(每次读取时取包;令牌绑定连接行)。 ## What changes - **Instances** (`ConnectorInstances`, `engine.ts`): the registered connectors are held by `(package, name)`. - A declarative instance is held by the package the connection door addresses it by (`connectorInstancePackage` from 3a-ii). - A plugin's connector is held by no package. - A bare-name read (`resolveConnectorAction`, `getConnectorOrigin`, the degraded reads, …) answers the one instance of the name, and none when there are two. - `getRegisteredConnectors` lists each name once; `getConnectorDescriptors` lists every instance. - **Registration** (`plugin-extension-api.ts`): - `registerConnector` and `registerDegradedConnector` take an optional `{ packageId, soleOfName }`, and `unregisterConnector` takes an optional package. - A plugin connector and a declarative instance still never share a name (ADR-0097 §4). - With `soleOfName`, a declarative registration drops any other declarative instance of the name. The reconcile always passes it. - **Dispatch** (`connector-nodes.ts`, `connector-input-schema.ts`): `connector_action` resolves its `connectorId` for the calling flow's package (`resolveConnectorInstance`). The cases: - A refused name is refused as before. - A resolved holder dispatches its own instance, and its `effect` and `inputSchema` are read from that instance. - Otherwise, the one instance of the name answers, and two answer nothing. - **Reconcile** (`plugin.ts`): - Every declarative registration passes `declaredInstance(ctx, entry)`. - The instance package is part of the desired signature, so an unstamped entry whose holder changes is registered again under the package it resolves to now. - A dropped instance is unregistered by name. - **Grant handle** (`grant-handle.ts`): - The instance's package is read on every connection read, not fixed when the handle is made. - A cached access token is served only for the connection row it was obtained for. - A dispatch that joins a refresh in flight for another row is refused 503. ## Moved to the narrowing PR (deviations from the file list) - **The materializer's own state and `grantHandles` stay keyed by name.** This is the amended file list's `plugin.ts` line, items 1, 3 and 5. The maps in question are `desired`, the materialized, degraded and credential-refusal maps, the retry bookkeeping and `grantHandles`. Under the one-holder backstop the reconcile cannot hold two instances of one name, so re-keying these maps changes nothing anyone can observe until the duplicate-name refusal is lifted. It lands with that lift and with a test of two live instances. The registrations already carry the instance package, and the grant handle already reads its package per read (item 4), so the re-key is bookkeeping only. Agreed with the lane seat before coding. - **The connector pull keeps reading by bare name** (the `connector-pull.ts` line). Resolving a mapping's connector for the job's package changes an answer where that name is refused, so it is decided with the narrowing. - **The fallback arm.** In `resolveConnectorInstanceFor`, a resolved holder with no instance registered under it is answered by the one instance of the name. That is right only while one instance per name is kept. The narrowing PR makes it `none`. - `ConnectorDescriptor.packageId`, `?package=` on the connection door, and connector in the namespace-scoped type sets were already listed for the narrowing PR. ## Verification - `flow-package-scoped-resolution.test.ts`, 8 engine pins: - two packages' instances are both held, and each flow dispatches its own; - `inputSchema` is read per instance; - two instances and no package: no dispatch; - a closure holding both is refused, naming both; - `soleOfName`; - plugin vs declarative name conflict; - unregister; - the fallback arm. - `connector-connection-door.test.ts`: - the handle reads its package per read (200, then 503 after a second holder); - package drift re-registers under the new package, and a removed entry leaves no instance, with no ghost husk (2 tests). - `connector-connection-door.test.ts` also pins that replacing the holder of an unstamped entry, leaving one holder, keeps the dispatch at 200; and the store's two-holder refusal names the uninstall remedy for a row that already names a package (objectstack-ai#33218 review N4). - `grant-handle.test.ts`: - a cached token is served only for its row; - an in-flight refresh of another row is refused. - Ablations: C1–C8 (first round) and R1–R7 (review fixes), each red on its pins. They cover the signature package, unregister by name at both drop sites, the row-id check, the seeded row id, the fallback arm and the in-flight check. - `@objectstack/service-automation` full suite, rebased on `main` after objectstack-ai#33218: 281 files, 3890 tests passed. `tsc --noEmit`, ESLint on touched files, `check-engine-double-contract`, `tenant-audit-census` and `system-context-census` are green. ## Red-line read Run in this thread by a separate review pass (maintainer's instruction: 「你自己有fable,自己审就可以了吧?」). - **Round 1: PASS-WITH-CHANGES.** All findings were taken: - M1: a degraded husk was left registered when the instance package drifted. - S1: the token cache was keyed by organization while the row is chosen per read. - S2: the changeset denied the one dispatch answer that changes. - S3: the engine's package was fixed at registration. - **Round 2: PASS-WITH-CHANGES**, changeset only (name every holder change). Taken, together with the optional in-flight refresh check. - **Round 3: PASS.** - These red-line reads ran before the 2026-11-14 04:37Z review pause. After objectstack-ai#33218 merged, the commit was rebased onto `main` and adapted to objectstack-ai#33218's one-holder store rule (its contract review F1): the tightened answer now covers only a second holder appearing after boot, and the store's refusal for a row already naming a non-holder package names the uninstall remedy (objectstack-ai#33218 review N4). This PR is opened as a draft and owes its contract review at **TIER_DEFAULT** from an isolated reviewer, as objectstack-ai#33218 had. - **Clause-②.** The review judged `yes (widening)` right. No surface is removed and every API change is additive. The one tightened answer is a dispatch in a transitional state that the connection door has refused since 3a-ii, and the next reconcile re-registers or tears it down. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT --------- Co-authored-by: Claude <noreply@anthropic.com>
…clare a connector of the same name (ADR-0150 child B, the narrowing) (objectstack-ai#33431) domain:server#7 · os-tesla · session_01L9qibzKCovWpJoMZD6U3NT <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao3aDjoEUznHeGMZJaoMEKa5)_ Fixes objectstack-ai#31699 Clause-②: yes (narrowing) Metadata-protocol: added ## 维护者速读 - 改了什么:连接器(objectstack-ai#31699 的最后一个类型)把「一个名字一个包」收窄到「一个命名空间一个」。两个不同命名空间的包可以各自声明同名连接器,各自物化、连接、派发。 - 怎么做到的:connector 加入 core / objectql / metadata 三个命名空间类型集合;协调器拆掉一持有者兜底,物化器的各个表和 OAuth 授权句柄按 (包, 名) 建键;引擎对每个调用方(包括无包的调用方)都问解析器,解析到的持有者没有实例时回答 `none`,只有插件代码注册的连接器例外;拉取按映射所在的包解析连接器;带命名空间地址的连接门(`/automation/connectors/:ns/:name/connection`)连接该命名空间那个包的实例。 - 仍然拒绝:同一命名空间的共有者、没有命名空间的包与他包同名、一个包内重名、两个持有者下没有自己包戳的条目(点名两个持有者,谁都不物化)。没有包作用域注册表的组合仍然一个名字一个实例。 - 答复变化:changeset 的 Clause-② 列了十条 FROM → TO,标为 BREAKING。单持有者部署只变三处:3b 的回退分支(解析到的包没有实例时不再用名字的唯一实例,插件代码注册的除外)、只有停用包持有的名字(停用包以外的调用方不再派发;停用包自己的流程照旧读自己的实例)、无包戳条目换持有者后到下次协调之间不派发。凭据列表、重载合并、惰性描述符审计在单持有者下都与 main 相同。 - 与交接清单的偏差:交接 6871869590 写的是裸连接门和 `GET /connectors` 加 `?package=`。本 PR 用已有的命名空间地址代替第二种写法,`GET /connectors` 不加过滤,每个描述符带 `packageId`。认领修订 6882996364 事先说明了这一点。 - 先看:`packages/services/service-automation/src/engine.ts`(`resolveConnectorInstanceFor`)、`src/plugin.ts`(协调器的期望集合与 `judgedByPackage`、`connectionDoorSubject`)、`src/connector-pull.ts`(第 2 步)、`packages/runtime/src/domains/automation.ts`(准入块)。 ## What changes - **Type sets.** `connector` joins `NAMESPACE_SCOPED_BARE_NAME_TYPES` (core), `PACKAGE_SCOPED_READ_TYPES` (objectql) and `PACKAGE_SLOTTED_STORE_TYPES` (metadata). Every covered type has now narrowed. - **Reconcile** (`plugin.ts`): - The backstop is gone (`refusedDeclaredConnectorNames`, and `refusedConnectorNames` in `connector-package-scope.ts`). - Each entry is the instance of its own package. An entry with no package of its own is the instance of the package its name resolves to over every holder. Under two holders it is refused naming both and materialized as neither (`connectorInstanceRefusal`). - `desired`, the materialized, degraded and credential-refusal maps, retry, dematerialize and `grantHandles` are keyed by instance (`connectorInstanceKey`: `name`, or `PACKAGE/NAME`). - A name repeated within one package is a duplicate naming the package. A composition with no package-scoped registry keeps one instance per name (`judgedByPackage`, red line 1). - A reloaded artifact (objectstack-ai#7742) supersedes the registry's entries by `(package, name)`: an unstamped artifact item is stamped with its manifest id at capture, so a reload of one package leaves the other package's instance of the name live. With no manifest id, or no package-scoped registry, it supersedes by name, as before. - An OAuth2 grant handle reads its instance's fixed package. The inert-descriptor audit judges each entry by the instance a caller of its package would be served. Instance log lines name the package. - **Dispatch** (`engine.ts`, `resolveConnectorInstanceFor`): - Every caller asks the resolver over the served holders, a caller with no package included, so a two-holder name is refused naming both rather than answered `none`. - A resolved holder with no instance answers `none`, unless the name has a connector a plugin registers in code (package `null`, origin `plugin`), which is served as before. That keeps a package's catalog descriptor plus a plugin's connector working. - A name only disabled packages hold answers the same way (notes 6816295828 and 6820178514). - `getConnectorDescriptors` sets `packageId`. - **Pull** (`connector-pull.ts`): the mapping's connector is resolved from the mapping's holder package through the registry's optional `resolveConnectorInstanceFor`, and its origin, degraded state, provider (`materializedProviderOf`), action and `inputSchema` are read from that instance. New reason `connector_name_refused` (409). - **Connection door**: `ConnectorConnectionRequest.package` (spec, optional). The runtime admits a namespace address of a two-holder connector name to the addressed holder (`admitAutomationAddress` answers a slot, as for a flow) and passes the package. The bare door keeps its 409. - **Credential listing**: each declaring entry is matched to its own instance's state, by the instance's package (an environment row or a compatibility entry is its holder's instance); the reported `packageId` is the entry's stamp, as on main. - **objectstack-ai#33218 review N6**: judged, not restamped. A row a moved declaration left stamped with its old package is that package's own again once it declares the name beside the new holder. Pinned. - **Docs**: `content/docs/automation/connectors.mdx` gains "Two packages, one connector name" and two failure-mode rows. The objectql, core and metadata module docs say the connector narrowed. ## Verification - New pins: - `connector-connection-door.test.ts` (7): both instances materialize; the bare door 409 and the addressed begin, read and revoke per package, each with its own row and token; revoke one, the other keeps serving; an unowned entry under two holders refused; a duplicate within a package; the no-registry CONTROL; N6. - `flow-package-scoped-resolution.test.ts`: the narrowing `none` pin (FROM the fallback arm); the plugin catalog CONTROL; the disabled holder in both registration orders (A's caller never served B's or A's instance; a caller with no package served B; CONTROL both enabled) and a lone disabled holder; the null caller refused naming both; the no-registry CONTROL. - `connector-pull.test.ts` (4) and `connector-pull-service-door.test.ts` (1): each package's mapping pulls its own instance; the provider read per instance; holder with no instance is `connector_not_registered`; an environment mapping over two holders is `409 connector_name_refused`. - `connector-materialization.test.ts`: two holders of different namespaces both materialize (FROM the boot refused); a reload of one holder's artifact leaves the other's instance live; the credential listing reports each of two instances' states, and a `sys_metadata` or `__runtime__` entry over a one-holder name reads the holder's state. - `connector-connection-door.test.ts` (review round): a disabled holder at the bare door and at its own namespace address (404, nothing written), both orders; a revoked instance is held degraded; the unstamped entry's handle reads its fixed package. - `flow-package-scoped-resolution.test.ts` (review round): a caller inside the disabled package reads its own instance (both orders, and alone); two catalog holders beside a plugin connector (each package served the plugin's, the null caller refused naming both). - `connector-pull.test.ts` (review round): one of two holders disabled, the environment's mapping pulls through the served holder. - `connector-descriptor-audit.test.ts`: a package's catalog entry is not silenced by another package's live instance of its name. - runtime `automation-addressed-route.test.ts`: each namespace address reads its own package's instance (FROM 409). - `marketplace-install-local-bare-name-conflict.test.ts`: the refusal case is now a same-namespace co-owner; a cross-namespace connector install is admitted (FROM 422). - Updated pins: the one-holder type-set pins in core, objectql and metadata; the CLI stored-references report (no sealed clash left). - Ablations A1 to A14 (`scripts/ablation-replace.mjs`, each restored with an empty `git diff HEAD`), each red on its pins: the fallback arm back (3), the disabled branch off (1), the null caller not asking the resolver (8), no plugin instance (1), the unowned entry not refused (1), no registry judged (6), grant handles by name (5), the pull by bare name (4), the door ignoring the package (3), the provider by name (1), no connector slot at the runtime address (1); the reload merge by bare name (1, A12); the credential listing by stamp (1, A13); the inert audit by name (1, A14). Record: `server-seat-7/r2026-11-14/31699-narrow-ablations.txt`. - Full suites before the rebase: service-automation 3923, core 3480, objectql 12967, metadata 2479, metadata-protocol 22848 (43 skipped), cloud-connection 1207. After the rebase on `df9fe946`: service-automation 3941, runtime 12060 (19 skipped), core 3480, objectql 12976, metadata 2479, metadata-protocol 22848 (43 skipped), cloud-connection 1210, CLI stored-references 13. All passed. Rebased again on `4ace1fa9` over objectstack-ai#33193 (head `1530146d`): metadata 2490, metadata-protocol 22865 (43 skipped), service-automation 3941, runtime 12074 (19 skipped), spec 28422 (1 todo), spec `check:generated` green. - Gates: `tsc --noEmit` (service-automation, runtime), ESLint on every changed file, tenant-audit, system-context, route-ledger and engine-double censuses, changeset no-major / empty / fixed, doc-authoring, doc-anchors, spec `check:generated` (its test-typecheck leg needs a larger Node heap here: `NODE_OPTIONS=--max-old-space-size=12288`; then OK, no debt moved). `dispatch-gates --ran`: 124 derived families accounted for, 122 run green, 2 NOT-MEASURED for prerequisites this checkout lacks and the diff does not touch: `check:dual-build-cjs-loads` (no `studio` / `embedder-openai` dist) and the `check-plugin-teardown-shape` self-test (shallow clone). `check:dts-closure` was red once in the sweep and green when re-run alone (311/311 declaration files present). ## Contract review An isolated contract reviewer read the card, ADR-0150, the handoff and the diff with no anchor on mine. - r1 on `4a9d32b9`: PASS-WITH-CHANGES. Two must-fix items: M1, the credential listing lost an environment row's state; M2, a reload of one package's artifact tore down the other package's instance. Five should-fix items (S1 to S5) and four nits. - Every item was taken: fixed in code (M1, M2, the nits), or declared in the changeset and docs with FROM and TO (S1 to S4), with pins for S5. The ablations were extended to A12 to A14. - delta-1 on `de90aedb`: PASS. Three notes; I acted on all three: no-registry reloads supersede by name as on main, a changeset clause, and a `__runtime__` pin. - delta-2 on `510a8400`: PASS. - delta-3 on `e467615b`, the rebase over objectstack-ai#33193: PASS. `connector` joins `PACKAGE_SLOTTED_METADATA_TYPES` (`@objectstack/spec`), the one list the history and rollback doors and the metadata store read; the changeset says what moves on those doors. The brief, the r1 record and the delta record are posted as comments on this PR. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (Two optional members on TypeScript interfaces; no schema.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes on the changed files. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: `check:generated` is green for its artifacts. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Tesla · project thread
Part of #31699
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
?package=,地址化的门随收窄兜底的 PR 一起落,不晚于它)、M6(无持有者时用条目自己的包)、S3(两个持有者时包自己的行优先)。三条都经红线审读接受。packages/services/service-automation/src/connector-connections.ts(answering)、src/plugin.ts(connectorInstancePackage、connectionDoorInstance)、src/oauth2-grant/grant-handle.ts。What changes
ConnectorConnectionStore):connect,read,readOrRefuse,revoke,listFortake the instance's package. One rule (answering) decides which rows answer: the package's own rows, plus a package-less row only where the name's durable resolution (the boot backfill's question) binds it to that package or no registry can judge; a connect adopts that row in place (M2). Two answering rows are refused, never picked. A package-less row of a name two packages hold is no package's: the read and the revoke are refused 409 namingos migrate stored-references bind.listForstill counts a conflicted organization, carrying the refusal. The post-insert take-back from feat(service-automation, metadata-protocol, driver-mongodb, cli): a connector connection is unique per organization and instance (package, name) #33199 now counts by package.connectorInstancePackage): a real stamp; none for the environment's stored entry; for an unstamped or compatibility-default entry, the durable holder's package. Door, dispatch handle, materializer and reconnect mark all use it.connectionDoorInstance): resolves the name; two holders 409; no registry or no holder serves the one declared entry (two declared entries 409).packageId(explicitnullfor no package). The callback completes exactly that package's entry; a record from before this change (no key, TTL ten minutes) resolves the name.createOAuth2GrantHandle): reads by package; a conflict is 503 on both the selection and the refresh read; an org-less dispatch never takes a conflicted organization's row.content/docs/automation/connectors.mdx.Declared deviations from the design review
?package=on the HTTP door and no spec change here. The addressed door lands with the PR that narrows the one-holder backstop, and no later. Until then a name with two holders (a package installed after boot) is refused at every leg of the door, revoke included.null.Verification
connector-connection-package.test.ts(new, real ObjectQL over SQLite): 10 pins on the store rule, adoption, two holders, two rows, revoke,listFor.connector-connection-door.test.ts: 13 new pins through the booted plugin and a realSchemaRegistry: stamping, the 409s, the callback completing the recorded package (includingnull) after the declarations change, refusal before the code is used, M2 adoption, two rows refused with and without the run's organization, a conflicted organization still counted (422), revoke 409 under a disabled second holder, unstamped and__runtime__entries keeping their row across the backfill bind.listForskips a conflicted organization; revoke answers not-connected under conflict; door fallback removed; the resolver arm of the instance package removed.@objectstack/service-automationfull suite, rebased onmainafter feat(service-automation, metadata-protocol, driver-mongodb, cli): a connector connection is unique per organization and instance (package, name) #33199: 281 files, 3871 tests passed.tsc --noEmit, ESLint on touched files,tenant-audit-census,check-engine-double-contractgreen.Red-line read
Run in this thread by a separate review pass (maintainer's instruction: 「你自己有fable,自己审就可以了吧?」). Round 1: PASS-WITH-CHANGES, one must-fix (an org-less dispatch could take the first of two answering rows) and five should-fix (a conflicted organization skipped turning a 422 into a dispatch; the door's holder-to-entry match; revoke 404 vs read 409; revoke under two holders; the changeset's "as before"), all taken; M5, M6 and S3 accepted. Round 2: PASS-WITH-CHANGES, one should-fix (an unstamped entry must be its durable holder's instance, or the backfill bind loses its row), taken. Round 3: PASS. Carried to 3b: re-key the grant handles by
(package, name)and evaluate the handle's package per read, before any PR lets two instances of one name live.These red-line reads ran before the 2026-11-14 04:37Z pause of seat-run contract reviews. This PR is opened as a draft and owes a contract review at TIER_DEFAULT (widening) from the new review agent before it is marked ready.
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT