Skip to content

Commit 664f51c

Browse files
committed
feat(objectql)!: a flow, a webhook, a connector and an email template hold one name per package (bare-name phase 1, 3/4)
The flow family of maintainer ruling C on #30798, phase 1: `flow`, `webhook`, `connector` and `email_template` join the bare-name registry types. Measured on a booted showcase with two packages sharing one name per type, in both orders: the automation engine arms one flow per name (lexicographically-first package, with a warning) while `/meta/flow/NAME` serves the first-registered declaration; the webhook dispatcher's declared reader keeps the first-registered webhook and never subscribes the other; `/meta/connector/NAME` serves the first-registered descriptor (two provider-bound instances already refuse the boot, ADR-0097); a send's `template` resolves the first-registered email template. A third package installed after the boot under any of those names installed (200) and was shadowed. - `bare-name-one-holder.ts`: the four types, in family order, with their collection keys, labels, consumer clauses and nouns; the holder reading excludes a type's OVERRIDABLE BASELINE (the email service's built-in templates, which an app's same-named template overrides by contract, ADR-0131 D6): that package neither holds a template name nor is refused one. - `registry.ts`: the holder reading and the cold-boot seal strip a bundled type's registry-key member (`pkg:name@locale`), so an email template's NAME holds its bundle; the item seam skips the baseline. - New `registry-bare-name-one-holder-flow-family.test.ts` (52 cells) and the booted dogfood pin `bare-name-one-holder-flow-family.dogfood.test.ts`. - ADR-0048: header, §3.4 note, P1.5, P1.6 and the new P1.8; the anchor's invariant names the third family and the baseline; one changeset. Claude-Session: https://claude.ai/code/session_017xRBcTJTE7kSbcMoJQ4Txf Co-authored-by: Claude <noreply@anthropic.com>
1 parent 24bc259 commit 664f51c

8 files changed

Lines changed: 935 additions & 65 deletions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/objectql': minor
3+
---
4+
5+
feat(objectql)!: a flow, a webhook, a connector and an email template hold one name per package — once the cold boot has sealed the registry, a package declaring one under a name another installed package holds is refused at install and registration, naming both holders and the rename; a boot that already holds such a clash warns
6+
7+
Clause-②: no (narrowing) — the engine's package door (`SchemaRegistry.installPackage`) and item seam (`SchemaRegistry.registerItem`) refuse, after the cold boot, a package registration they accepted before: one whose flow, webhook, connector or email template bears a name another installed package holds. Nothing is widened.
8+
Metadata-protocol: narrowed
9+
Skills-docs: none — `skills/**` does not teach that two packages may share a flow, webhook, connector or email template name, and the naming rule itself is phase 2's (#30805); the prescription ships in the refusal and warning text and in ADR-0048's 2026-11-06 addendum (P1.8).
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) the refusal removes no key, export or field and changes the shape of no stored body; what an author does about a refused name is pick a different one, which no conversion can choose for them -->
12+
13+
**BREAKING** accept-set narrowing at the package registration door, the third family of maintainer ruling C on #30798, phase 1 (the first was picklists, mappings and datasets; the second APIs, object-less actions and functions): managed install (`install-local`, a post-start `manifest.register`, a hot reload) and package registration (`ObjectQL.registerApp` and every package-bound `registerItem`), for flows, webhooks, connectors and email templates. ADR-0048 §3.4 narrowed (addendum 2026-11-06, P1.8).
14+
15+
- **Why.** Measured on a booted showcase with two packages sharing one bare name per type, in both registration orders: the automation engine armed ONE flow per name — the lexicographically-first package's, whichever registered first, with a warning — while `/meta/flow/NAME` served the first-registered package's declaration; the webhook dispatcher's declared reader kept the first-registered package's webhook and never subscribed the other; `/meta/connector/NAME` (the connector picker's read) served the first-registered package's descriptor, and two provider-bound instances under one name already refused the boot (ADR-0097); a send's `template: NAME` resolved the first-registered package's email template. Each answer flipped with registration order; only the flow precedence warned, and it armed one of them all the same. A third package installed after the boot under any of those names installed (`200`) and was shadowed.
16+
- **Before.** Two installed packages could each ship a flow, webhook, connector or email template under one name, at boot or by a later install; every caller was served one of them, chosen by registration order.
17+
- **Now.** After the cold boot (the engine plugin seals the registry at `kernel:bootstrapped`, once every package of the boot has registered), a package registration declaring a flow, webhook, connector or email template under a name another installed package holds is refused ahead of every mutation, so it leaves no record behind. The envelope is the first family's: `code: 'NAMESPACE_CONFLICT'`, `status: 422`, `install-local` answering `422 PLUGIN_REGISTER_FAILED`, every conflicting name in one refusal, both holders named, the rename (the incoming package's namespace prefixed) carried, `conflicts[]` structured. An email template's name holds its whole `(name, locale)` bundle: two members of one package's bundle are one holder, and another package's member of that name — another locale included — is refused on the name.
18+
- **The overridable baseline.** The platform's built-in auth templates are declared under the email service's own package (`com.objectstack.service.email`), and an app's same-named template overrides them by contract (ADR-0131 D6). That package is an overridable baseline for `email_template` (`OVERRIDABLE_BASELINE_PACKAGES`, exported): it neither holds a template name nor is refused one, so an app overriding `auth.password_reset` still installs; the first OTHER package to take a built-in name holds it, and a second is refused naming the first.
19+
- **The cold boot.** A deployment whose installed packages already share such a name still boots: the one warning line names every such name, both holders and the rename, and changes nothing about which holder each caller is served; the flow precedence warning keeps naming both packages and arming one. The maintainer ruled this on 2026-11-06: the boot warns, and only a new holder is refused (`BARE_NAME_COLD_BOOT_MODE` stays `'warn'`).
20+
- **Who moves.** An author whose package declares a flow, webhook, connector or email template under a name another package installed beside it already ships, at the next install or upgrade into a running deployment. **The one-line fix: rename the item in one of the two packages — the refusal names the namespace-prefixed name — or uninstall one of them.** A flow, trigger, picker binding, activation row or send that named the old name must name the new one; nothing rewrites stored references.
21+
- **Unchanged.** The same package registering its own name again. An environment item under a package's name (never judged, never a holder: the ADR-0005 overlay), a paired `.custom` package's declared override of a base flow among them (ADR-0146 D9: a stored row). The email service's built-in templates (above). The automation service's own duplicate refusal of two provider-bound connector instances in one boot (ADR-0097). A job keyed `appId:jobName`, an action bound to an object, every type the rule does not list (ADR-0048 §3.4 as written). `OS_METADATA_COLLISION=warn` does not downgrade the refusal.
22+
23+
**Measured producers.** On objectstack `24bc2593`, the importable examples carry 33 flows (`app-showcase` 32, `app-crm` 1), 1 webhook, 4 connectors and 1 email template (all `app-showcase`; `app-multi-package` none), and no name has more than one holder; `app-todo`'s three flows are `todo_`-prefixed. The platform's own packages declare one email template bundle each of the four built-in auth templates under the email service's package — the baseline — and no flow, webhook or connector. HotCRM is not checked out in this container and is NOT MEASURED here; its five packages share one namespace family, so a same-name clash among them would be a Who-moves case above. Deployed and marketplace packages NOT MEASURED.

‎docs/adr/0048-cross-package-metadata-collision.md‎

Lines changed: 91 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**Builds on**: [ADR-0003](./0003-package-as-first-class-citizen.md) (package as first-class citizen), [ADR-0005](./0005-metadata-customization-overlay.md) (artifact vs runtime overlay precedence), [ADR-0008](./0008-metadata-repository-and-change-log.md) (metadata repository, `MetaRef` identity), [ADR-0010](./0010-metadata-protection-model.md) (package provenance / `_packageId` stamping)
66
**Consumers**: `@objectstack/objectql` (`SchemaRegistry.registerItem`, `ObjectQL.registerApp`, install path), `@objectstack/console` / `objectui` (routing + metadata resolution), package authors, CLI/CI install path, the app marketplace registry.
77
**Surfaced by**: ADR-0046 review (doc naming) → generalised to all bare-named metadata → re-examined through the app-marketplace install lens.
8-
**Addenda**: [2026-08-08 — publish-time / marketplace namespace exclusivity](#addendum-2026-08-08-publish-time--marketplace-namespace-exclusivity) (**Accepted** 2026-08-08 — maintainer ruling on #1825, [acceptance comment 5226411687](https://github.com/objectstack-ai/objectstack/issues/1825#issuecomment-5226411687), landed by PR #6671; additive to §3.2, supersedes nothing); [2026-11-06 — bare names resolved without a package hold one package](#addendum-2026-11-06-bare-names-resolved-without-a-package-hold-one-package--34-narrowed) (**Accepted**, ruling C on #30798, phase 1; narrows §3.4 for picklists, mappings, datasets, APIs, object-less actions and engine functions, supersedes nothing).
8+
**Addenda**: [2026-08-08 — publish-time / marketplace namespace exclusivity](#addendum-2026-08-08-publish-time--marketplace-namespace-exclusivity) (**Accepted** 2026-08-08 — maintainer ruling on #1825, [acceptance comment 5226411687](https://github.com/objectstack-ai/objectstack/issues/1825#issuecomment-5226411687), landed by PR #6671; additive to §3.2, supersedes nothing); [2026-11-06 — bare names resolved without a package hold one package](#addendum-2026-11-06-bare-names-resolved-without-a-package-hold-one-package--34-narrowed) (**Accepted**, ruling C on #30798, phase 1; narrows §3.4 for picklists, mappings, datasets, APIs, object-less actions, engine functions, flows, webhooks, connectors and email templates, supersedes nothing).
99

1010
---
1111

@@ -267,22 +267,28 @@ package — stays covered by the `naming/namespace-prefix` lint in `os lint`.
267267
> [Addendum (2026-10-08)](#addendum-2026-10-08-the-security-catalog-holds-one-name-per-deployment--34-narrowed).
268268
269269
> **Narrowed (2026-11-06) — picklists, mappings, datasets, APIs, object-less
270-
> actions and engine functions are out of §3.4.** Their consumers resolve the
271-
> name with no package — a field's `picklist`, an import's `mappingName`, a
272-
> dashboard's `datasetName`, the endpoint matcher's one API per name,
273-
> `/actions/global/NAME`, a flow `script` node's function — so with two holders
274-
> every caller is served one of them, chosen by registration order, measured on a
275-
> booted two-package deployment (#30803). Once the cold boot has sealed the
276-
> registry, a package whose picklist, mapping, dataset, API or object-less action
277-
> bears a name another installed package holds is refused at managed install and
278-
> at package registration (a built-in's name, at managed install), and a package
279-
> whose handlers bring a function another package holds is refused at the hook
280-
> binder's bind, each naming both holders and the rename. ⛔ The environment
281-
> catalog is never a holder: an environment item under a package's name is the
282-
> ADR-0005 overlay. The other types the measurement found resolving without a
283-
> package context — `email_template`, `webhook`, `connector`, `flow`, `agent` and
284-
> `skill` — are to follow, each family in its own change. Every other type,
285-
> an action bound to an object among them, keeps §3.4 as written. See
270+
> actions, engine functions, flows, webhooks, connectors and email templates are
271+
> out of §3.4.** Their consumers resolve the name with no package — a field's
272+
> `picklist`, an import's `mappingName`, a dashboard's `datasetName`, the
273+
> endpoint matcher's one API per name, `/actions/global/NAME`, a flow `script`
274+
> node's function, the automation engine's one armed flow per name, the
275+
> dispatcher's one declared webhook per name, the connector picker's one
276+
> connector per name, a send's `template` — so with two holders every caller is
277+
> served one of them, chosen by registration order, measured on a booted
278+
> two-package deployment (#30803). Once the cold boot has sealed the registry, a
279+
> package whose picklist, mapping, dataset, API, object-less action, flow,
280+
> webhook, connector or email template bears a name another installed package
281+
> holds is refused at managed install and at package registration (a built-in's
282+
> name, at managed install), and a package whose handlers bring a function
283+
> another package holds is refused at the hook binder's bind, each naming both
284+
> holders and the rename. ⛔ The environment catalog is never a holder: an
285+
> environment item under a package's name is the ADR-0005 overlay. ⛔ Nor is the
286+
> email service's built-in template bundle: an app's same-named template
287+
> overrides it by contract (ADR-0131 D6), so that package holds no template name
288+
> and is refused none. The remaining types the measurement found resolving
289+
> without a package context — `agent` and `skill` — are to follow in the series'
290+
> last change. Every other type, an action bound to an object among them, keeps
291+
> §3.4 as written. See
286292
> [Addendum (2026-11-06)](#addendum-2026-11-06-bare-names-resolved-without-a-package-hold-one-package--34-narrowed).
287293
288294
### 3.5 Namespace rename-on-install is deferred (non-goal)
@@ -911,8 +917,8 @@ first phase.
911917

912918
> **Status of this addendum: Accepted** — it records phase 1 of a maintainer
913919
> ruling. It **narrows §3.4 for more metadata types, one family per change (P1.2,
914-
> P1.7), and supersedes no other text**: §§1–6, the 2026-08-08 addendum and the
915-
> 2026-10-08 addendum stand verbatim.
920+
> P1.7, P1.8), and supersedes no other text**: §§1–6, the 2026-08-08 addendum and
921+
> the 2026-10-08 addendum stand verbatim.
916922
>
917923
> **Ruling this addendum records** — #30798, answered by the maintainer
918924
> 「同意 c」 (ruling record 6676670839, 2026-11-06). The ruled option's text,
@@ -1020,18 +1026,17 @@ the doors never refuse.
10201026

10211027
### P1.5 To follow
10221028

1023-
The same measurement found these types resolving without a package context too:
1024-
`email_template`, `webhook` (the second package's webhook is never subscribed),
1025-
`connector`, `flow`, `agent` and `skill`. Each family joins P1.2's list in its own
1026-
change under #30803 — `flow`, `webhook`, `connector` and `email_template`; then
1027-
`agent` and `skill` — with its own pins, narrowing §3.4 the same way (the
1028-
maintainer kept all of them in #30803 on 2026-11-06). `tool` and `rag_pipeline`
1029-
share a reader with `agent` and were not measured. The request family that was
1030-
listed here is P1.7.
1029+
The same measurement found `agent` and `skill` resolving without a package
1030+
context too. They join P1.2's list in the series' last change under #30803, with
1031+
their own pins, narrowing §3.4 the same way (the maintainer kept all of them in
1032+
#30803 on 2026-11-06). `tool` and `rag_pipeline` share a reader with `agent` and
1033+
were not measured. The request family that was listed here is P1.7; the flow
1034+
family — `flow`, `webhook`, `connector` and `email_template` — is P1.8.
10311035

10321036
### P1.6 Where it is implemented
10331037

1034-
`@objectstack/objectql`: the rule, the holders and the switch in
1038+
`@objectstack/objectql`: the rule, the holders, the overridable baseline
1039+
(`OVERRIDABLE_BASELINE_PACKAGES`, P1.8) and the switch in
10351040
`bare-name-one-holder.ts`; the package door in `SchemaRegistry.installPackage` and
10361041
the item seam in `SchemaRegistry.registerItem`; the function door in
10371042
`bindHooksToEngine`, through `SchemaRegistry.claimBareNameFunctions`; the seal in
@@ -1076,3 +1081,61 @@ ambiguous: the binder resolves it among its own package's functions only.
10761081
**The cold boot** reads the bind claims with the registry's holders, under P1.3's
10771082
switch: two packages of one boot binding one function name are named in the same
10781083
warning line, as packages, never as their handler owners.
1084+
1085+
### P1.8 The flow family: `flow`, `webhook`, `connector`, `email_template`
1086+
1087+
Measured with P1.1's two packages, in both orders (#30803, PR 3):
1088+
1089+
- **`flow`** — the automation engine keys its flow map by the bare name and
1090+
arms ONE flow per name: the lexicographically-first package's
1091+
(`resolveFlowPrecedence`), whichever registered first, with a warning naming
1092+
both — the one type of the nine that warns; `/meta/flow/NAME` serves the
1093+
FIRST-registered package's declaration, so in one order the body the designer
1094+
opens and the body that runs come from two packages. A third package installed
1095+
after the boot under that name installs (`200`) and is shadowed.
1096+
- **`webhook`** — the dispatcher's declared-webhook reader keeps the
1097+
FIRST-registered package's declaration per name and never subscribes the
1098+
other, silently; `/meta/webhook/NAME` serves the same one.
1099+
- **`connector`** — `/meta/connector/NAME` (the by-name door the designer's
1100+
connector picker reads) serves the FIRST-registered package's descriptor,
1101+
silently. Two provider-bound instances under one name at boot are already
1102+
refused by the automation service (ADR-0097's duplicate, fatal at boot); after
1103+
the boot the second is logged at `error` and skipped, its install answering
1104+
`200`.
1105+
- **`email_template`** — a send's `template: NAME` resolves the
1106+
FIRST-registered package's bundle, silently; `/meta/email_template/NAME` serves
1107+
the same one.
1108+
1109+
**What is refused.** All four join P1.2's list: the same two doors, the same
1110+
holders, the same envelope and rename. A provider-bound connector instance and a
1111+
catalog descriptor hold the name alike — it is the connector's identity in the
1112+
engine's registry and the picker both. An email template's NAME holds its
1113+
bundle: the registry keys the type by `(name, locale)` (`pkg:name@locale`), the
1114+
holder reading strips the member, two members of one package's bundle are one
1115+
holder, and another package's member of that name — another locale included — is
1116+
one conflict, on the name.
1117+
1118+
**The overridable baseline.** The platform's built-in auth templates are
1119+
code-declared under the email service's own package
1120+
(`EmailServicePlugin.init`, `@objectstack/plugin-email`), and the template loader
1121+
serves any OTHER package's `(name, locale)` member over them by contract
1122+
(ADR-0131 D6/D10: an app declaring `auth.password_reset` overrides the
1123+
platform's copy). So that package is an overridable baseline for
1124+
`email_template` (`OVERRIDABLE_BASELINE_PACKAGES`): it neither holds a template
1125+
name nor is refused one, at the package door, the item seam and the cold boot
1126+
alike. The first other package to take a built-in name holds it; a second is
1127+
refused naming the first, never the baseline. No other type has a baseline today.
1128+
1129+
**Not judged.** A paired `.custom` package's declared override of a base
1130+
package's flow (ADR-0146 D9 item 1) is a stored row bound to its pair, hydrated
1131+
into the bare slot — the environment catalog, never a package holder, so the
1132+
override path stays open. The automation service's own duplicate refusal of two
1133+
provider-bound instances in ONE boot (ADR-0097) runs before the seal and stands;
1134+
the doors here judge the install that follows a boot. The kernel `metadata`
1135+
service's `(type, name)` overwrite is not a consumer of these four on a
1136+
composed runtime (the webhook reader falls back to it only with no registry),
1137+
and is not judged.
1138+
1139+
**The cold boot** reads the four with the registry's other holders, under
1140+
P1.3's switch: the flow precedence warning keeps naming both packages and arming
1141+
one, as before; the bare-name warning names every clash once with its rename.

0 commit comments

Comments
 (0)