You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c0500c6
Browse filesBrowse the repository at this point in the historyBrowse files
test(objectql): the webhook's package-less item is declined at each holder's exact and layered reads, as main's #32741 rules for a sealed type
The merge of main brought #32741: a package-less row at a holder's exact
address is declined for a sealed type, on every read and in every
hydration state. Seven of this PR's webhook pins went red on the merged
tree:
- two holders: the plain exact reads of the environment's item (three
stamps) and the layered read of a package-less stored row answered 409
ambiguous-in-closure here; each now answers the holder's own
declaration, the package-less item declined, nothing picked between the
holders. That FROM was never released (two holders are refused at
install on main).
- one holder: the exact read of the environment's item, the layered
read's overlay, and the boot hydration of a package-less row. Measured
on the merged tree with `webhook` out of the three type sets (core,
metadata and objectql dists rebuilt, each set read back without it):
the same declines, so they are #32741's own answers, not this PR's,
and no Clause-② entry is added.
The pins now pin those answers, each title naming its FROM. The changeset
drops the exact/layered 409 it no longer answers, and says the boot
hydration declines the package-less row too, while a row naming a package
that does not declare the name still grafts onto the first-registered
holder and of two holder-named rows only the last loaded applies (#32692).
No source change.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUJAvdCcvoqdsFGVz8
Copy file name to clipboardExpand all lines: .changeset/31699-webhook-names-per-namespace.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,14 @@ Metadata-protocol: added
20
20
The bare-name one-holder rule (`bare-name-one-holder.ts`) has narrowed for `webhook` from one package holder per deployment to one per namespace (ADR-0150 D2, D9): `webhook` joins `NAMESPACE_SCOPED_BARE_NAME_TYPES` (`@objectstack/core`), `PACKAGE_SCOPED_READ_TYPES` (`@objectstack/objectql`) and `PACKAGE_SLOTTED_STORE_TYPES` (`@objectstack/metadata`). Every reader of a declared webhook answers by `(package, name)`:
21
21
22
22
-**Install** (`SchemaRegistry.installPackage`, `registerItem`, `sealBareNameHolders`): a package declaring a webhook name a package of another namespace holds, FROM `422 NAMESPACE_CONFLICT` TO admitted. Still refused, with the same envelope and sentence: a co-owner of the holder's namespace, a package that declares no namespace beside any other holder, two packages of one shareable namespace (`base`, `system`, `sys`), and a built-in name (none for webhooks).
23
-
- **Dispatch** (`DeclaredWebhookSource.list`, `AutoEnqueuer`): a name two packages hold, FROM neither subscribed (refused, warned once) TO each holder's own declaration subscribed in its own slot, with its own URL, signing secret, headers and switch. A clash inside one namespace that the cold boot sealed with a warning (install still refuses it) is dispatched the same way, FROM neither subscribed TO both, each in its own slot: the dispatcher picks no holder and adds no warning to the seal's, which names both, and as neither door reaches either holder (the bare and namespace addresses answer `409` naming both), only a package disable or a `sys_metadata_activation` row written directly for one holder's `(package, name)` stops that holder (ADR-0150 D4). The subscription id, which is the delivery's `ref_id` and partition key, is `declared:PKG/NAME` for a package's declaration and stays `declared:NAME` for the environment's own (`declaredWebhookRefId(name, packageId?)`). A package-less row customizing a name two packages hold says no holder (ADR-0150 D4), so as the registry binds it at run time it is no slot's and is not dispatched; each holder's own declaration is. Not yet after a restart: the boot hydration grafts a stored row of that shape (or one naming a package that does not declare the name) onto the first-registered holder's slot, which then dispatches with it, and of two stored rows each naming a holder only the last loaded applies. Such rows are residue, as a declared webhook is read-only, and #32692 keys the hydration by `(package, name)` before this family closes. A host with no registry slots the metadata service's items by `_packageId`: two packages' items of one name, FROM refused TO one slot each; one holder listed twice, or the environment beside a package, is still refused, never first-picked. `MetadataManager` keeps one slot per `(package, name)` for a webhook, where the second package's item overwrote the first's.
23
+
- **Dispatch** (`DeclaredWebhookSource.list`, `AutoEnqueuer`): a name two packages hold, FROM neither subscribed (refused, warned once) TO each holder's own declaration subscribed in its own slot, with its own URL, signing secret, headers and switch. A clash inside one namespace that the cold boot sealed with a warning (install still refuses it) is dispatched the same way, FROM neither subscribed TO both, each in its own slot: the dispatcher picks no holder and adds no warning to the seal's, which names both, and as neither door reaches either holder (the bare and namespace addresses answer `409` naming both), only a package disable or a `sys_metadata_activation` row written directly for one holder's `(package, name)` stops that holder (ADR-0150 D4). The subscription id, which is the delivery's `ref_id` and partition key, is `declared:PKG/NAME` for a package's declaration and stays `declared:NAME` for the environment's own (`declaredWebhookRefId(name, packageId?)`). A package-less row customizing a name two packages hold says no holder (ADR-0150 D4), so as the registry binds it at run time it is no slot's and is not dispatched; each holder's own declaration is. After a restart the boot hydration declines a stored row of that shape too, as `main` declines a package-less row at a holder's address for a sealed type (#32741); not yet a stored row naming a package that does not declare the name, which it grafts onto the first-registered holder's slot, which then dispatches with it, and of two stored rows each naming a holder only the last loaded applies. Such rows are residue, as a declared webhook is read-only, and #32692 keys the hydration by `(package, name)` before this family closes. A host with no registry slots the metadata service's items by `_packageId`: two packages' items of one name, FROM refused TO one slot each; one holder listed twice, or the environment beside a package, is still refused, never first-picked. `MetadataManager` keeps one slot per `(package, name)` for a webhook, where the second package's item overwrote the first's.
24
24
-**The switch** (`sys_metadata_activation`, type `webhook`): each slot reads its own row, `(package_id, name)`, FROM the name's rows read by name alone. A slot with no row of its own reads the name's other rows (naming no package while the environment declares nothing of the name, or naming a package that no longer declares it) as before while the name has one holder (ADR-0150 D8; the boot backfill binds a package-less one). Under two holders such a row is no holder's own: switched off it keeps every holder with no row of its own off, switched on it turns none on, and the reader says so once per name naming both (epic ruling Q1 = A, the flow engine's rule).
25
25
- **The activation door** (`POST /api/v1/security/_activation/webhook/:name`): the webhook store is addressed by `(package, name)`, so a write for one holder never re-attributes another holder's row. A name two packages declare, FROM `503 SERVICE_UNAVAILABLE` (the reader's refusal carried no `refusal`) TO `409 RESOURCE_CONFLICT` with every candidate, nothing written. With one holder and no row of its own the answer is as before, and its row naming no package becomes the holder's own (`adoptPackageless`), the end state the name-addressed store wrote. With one holder whose own row sits beside a row naming no package, FROM `409 RESOURCE_CONFLICT` naming both rows, nothing written (the name-addressed store could mean either), TO the holder's own row written and the row naming no package left as it is. A row naming a package that no longer declares the name, FROM re-addressed to the holder TO left as it is with the holder's own row written beside it; the reader reads the holder's own row first, so the switch thrown is the one that applies.
26
26
-**New door**`POST /api/v1/security/_activation/webhook/:ns/:name` (mounted by the dispatcher plugin; route-ledger row, server-only): the holder among the packages of namespace `:ns`. Two co-owners holding the name answer `409``ambiguous-in-namespace`; a namespace none of whose packages declares it answers `409``not-held-by-qualifier` naming the holders; an unknown namespace, or a name nothing declares, `404`. Same body, gates and caller as the bare door; the answer names the package switched (`packageId`).
27
27
-**Redelivery** (`createWebhookRedeliverGuard`): a `declared:PKG/NAME` delivery is judged by exactly that package's declaration, never another holder's. A `declared:NAME` delivery (the environment's own, one written before this release, or one the 18.x ownership ceremony re-sourced, which keeps that shape) is judged by the declaration a caller with no package resolves: with one holder exactly as before; with two, refused `409 DELIVERY_NOT_ELIGIBLE` naming both, and sent to neither. A malformed reference (`declared:/NAME`, `declared:PKG/A/B`) addresses no slot and is refused as no longer declared.
28
28
-**The name guard** (`bindDeclaredWebhookNameGuard`): a `sys_webhook` write taking a name two packages declare, FROM the ambiguity refusal TO the declared-name conflict (`DeclaredWebhookNameConflictError`), both `409 RESOURCE_CONFLICT`.
29
29
-**`os migrate stored-references`** reads `webhook` with the other `PACKAGE_SCOPED_READ_TYPES`.
30
-
-**The exact and layered reads** of a name two packages declare (`GET /meta/webhook/NAME?package=ID`, the qualified path, `?layers=true&package=ID`): a package-less item (the environment's, or a stored row hydrated into the registry) is no holder's own, so both holders' exact reads answer `409 RESOURCE_CONFLICT` (`ambiguous-in-closure`) naming both, and so does the layered read of a package-less stored row (#32407's judgement, which reaches every narrowed type). One holder, or a row bound to a holder, is served as before; a package-less stored row is still declined at the plain exact read (ADR-0126 Regime C), each holder serving its own.
30
+
-**The exact and layered reads** of a name two packages declare (`GET /meta/webhook/NAME?package=ID`, the qualified path, `?layers=true&package=ID`): a package-less item (the environment's, or a stored row hydrated into the registry) is no holder's own, and as `main` declines such an item at a holder's exact address for a sealed type (#32741), each holder's exact and layered reads answer its own declaration, the package-less item declined, so nothing is picked between the holders. A row bound to a holder is served as that holder's. One holder answers as `main` does.
31
31
- **The metadata store** (`DatabaseLoader`): a webhook keeps a row per `(package, name)` with `package_id` filled, where a second package's save wrote over the one row of the name. Its history follows #32351: each history row names its package, where it named none; naming no package, a name two packages hold is refused `409` as in (3); naming a package reads, diffs and restores that package's own versions and row; after a package is removed, a rollback to its version, FROM writing its body into the remaining holder's row TO `409 RESOURCE_CONFLICT` (`not-held-by-qualifier`) naming it, nothing written. `migrateDatabaseLoaderRowPackages` (`@objectstack/metadata/migrations`) now also binds a webhook loader row to the package its body names. The unscoped plural reads (`MemoryLoader` and `MetadataManager` `loadMany` / `loadManyKeyed`) of a webhook name two packages saved answer both, in the order first saved, where they answered the one saved last (#32687's rule, now reaching `webhook`); the by-name read still answers the one saved last. A webhook name stored as one package's row and a package-less row, read by name naming no package, FROM the row saved first TO the package's row in either order (7); the boot pass registers no webhook row, so, unlike the types it reads (#32791), it does not decide that read. No first-party door reaches `DatabaseLoader` history: the REST history, rollback and diff doors go through the protocol's own repository.
32
32
- **A disabled co-holder** (epic red line 1). The baseline of this bullet is the last release, read from the tree at `badf24dff` (`main` of 2026-11-05, at 18.3.0, before #31677; read, not booted); the by-name read's FROM is measured on `main`, where #32497 had not reached `webhook`. What serves or dispatches judges the served set, where a DISABLED package is no holder, as the registry's merged listing withholds its items (#25308). A name one enabled and one disabled package declare: the enabled holder's declaration is dispatched alone, as the last release dispatched it (its dispatcher read that listing), and the activation door's bare address and the name guard answer the enabled holder; `main` between #31677 and #32497 dispatched neither (it counted the disabled holder and refused the name naming both), and since #32497 dispatches the enabled holder, as here. The disabled one's is not dispatched, and a redelivery of a `declared:PKG/NAME` delivery of it is refused naming the disabled package, until the package is enabled again. A durable read counts every holder: under two holders, one of them disabled, a ledger row naming no package is still no holder's own (off keeps the enabled one off, on turns it on only by its own row), a disabled holder's own row stays its own, and the activation door's write for the enabled holder writes its own row beside the row naming no package, never takes it over (`adoptPackageless` reads the reader's new `holdersOf`). The boot backfill already read every holder. A namespace whose packages are all disabled answers its address `404` only when nothing else serves the name, as a name nothing declares; beside an enabled holder of another namespace it answers `409 RESOURCE_CONFLICT` (`not-held-by-qualifier`) naming that holder. The protocol's by-name item read judges the same served set (#32497): under one enabled and one disabled holder, `GET /meta/webhook/NAME`, FROM the first registered holder's declaration when that holder is the enabled one and `404` when it is the disabled one, TO the enabled holder's declaration in either order (`MetadataFacade.get` the same), the `/published` read answering as for that holder alone; enabled again, FROM the first registered holder's declaration TO `409` naming both. A lone disabled holder answers `404` as before, as a name nothing declares, and `MetadataFacade.get`, FROM the disabled package's declaration TO `undefined` (4). A redelivery of a `declared:NAME` delivery is a durable read too: under two holders it is refused naming both, whichever of them is disabled, where an enabled holder beside a disabled one answered it as the enabled one's (6).
33
33
- **Delivery references** (`sys_http_delivery`, epic red line 3): every webhook name whose `declared:NAME` fitted the old `ref_id` cap still delivers as `declared:PKG/NAME`. `ref_id`'s cap, FROM 128 TO 384: `declared:`, the longest package id the metadata store holds (255), `/`, and the longest name that fitted 128 (119). Measured first: the `dedup_key` cap (191, the `(source, dedup_key)` unique index's key part) binds before it, so a webhook dedup key past 191 is, FROM refused at insert (the event lost) TO a fixed-length `sha256:` digest of the same `<subscription id>:<event id>` string, still at-most-once; a key that fits is unchanged (`webhookDedupKey`). On an existing PostgreSQL or MySQL database the wider column is the `safe` drift op `widen_varchar`, which `os migrate apply` performs (development boots reconcile it, production never alters a schema at boot). Until it runs there, a one-holder webhook whose package id and name together pass 118 characters moves FROM delivered as `declared:NAME` TO refused at insert as `declared:PKG/NAME` (the event lost, logged once); after it, delivered. No stored row changes.
0 commit comments