Skip to content

Commit f61e8ab

Browse files
committed
Merge origin/main into claude/project-thread-y90728 (#32812)
Lands after #32999 (#32986). metadata-manager.ts: keep #32986's storedEnvironmentRows and its non-slotted datasource: branch in loadMany; drop the slotted branch with the #32791 filing this PR removes. DELIBERATE CORRECTION of two pending notes this change falsified: .changeset/32791-stored-row-one-holder-bare-action-read.md (title, the stamping paragraph, the filing paragraph, the after-the-pass table row, the Unchanged list, the Scope paragraph) and .changeset/32986-host-unregister-keeps-environment-rows.md (the boot pass stamps only rows of types not stored per (package, name)). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVHhRMN8oWxaL4Ph3X
2 parents 65ab9b2 + 994c7d6 commit f61e8ab

123 files changed

Lines changed: 7007 additions & 500 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/32072-dataset-resolve-by-package.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The query door also accepts an optional `?package=PACKAGE_ID`, the same exact qu
1818

1919
A publish's build probes read a dashboard widget's dataset by name, so a name several packages hold has no dataset to probe: the widget now gets one warning-tier `widget_not_probed` issue naming every holder, where it was skipped without a word.
2020

21-
**BREAKING** for answers that served one package's dataset for an address that does not name it, and for the failure answers around them (first-party count for each: 0 — no first-party package ships a dataset name another package also ships, no first-party package reads a dataset by bare name with a package caller, and nothing first-party sends `?package=` to the query door or reads a dataset at a package that does not hold it):
21+
**BREAKING** for answers that served one package's dataset for an address that does not name it, and for the failure answers around them (first-party count for each, read in this repository: 0 — no first-party package ships a dataset name another package also ships, no first-party package reads a dataset by bare name with a package caller, and nothing first-party sends `?package=` to the query door or reads a dataset at a package that does not hold it; **corrected by #32929:** one first-party app outside this repository moves with the reader's package — HotCRM's CRM Overview dashboard, in its app package `app.objectstack.hotcrm`, binds the dataset `product_metrics` that its module package `app.objectstack.hotcrm.revenue` holds; the module depends on the app, not the app on the module, so once the console sends the reader's package the tile answers `409 RESOURCE_CONFLICT` (`outside-closure`) where it drew on 18.3.0, and declaring the module from the app would be a dependency cycle the kernel refuses at boot. HotCRM fixes it in its own release, by moving the dashboard into the module or the dataset into the app package; the HotCRM lane chooses (#32929). Other first-party apps outside this repository: not measured.):
2222

2323
1. A bare `datasetName` two packages hold, on the query door and on `query_dataset`, ran the first listed. It is now `409 RESOURCE_CONFLICT` naming both, and nothing runs. Phase 1's install door already refuses the second holder, so only a deployment that booted with the clash (and was warned at boot) holds one. Fix: `?package=ID` on the query door; on `query_dataset`, rename one of the two datasets, since the tool takes no package.
2424
2. A bare by-name read of a dataset two packages hold — `GET /meta/dataset/:name`, and the protocol's `getMetaItem({ type: 'dataset', name })` it answers from — served the first registered. It is now `409 RESOURCE_CONFLICT` naming both. Fix: `/meta/dataset/NAMESPACE/:name` or `?package=ID`.

‎.changeset/32077-dataset-query-package.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ Metadata-protocol: none
2121

2222
An item authored in the environment (no `_packageId`, or the package-less `sys_metadata` sentinel) sends no `?package=`, so its read stays caller-less exactly as before. An inline dataset (the dashboard filter bar's option query, the Studio dataset preview) names no saved item and sends none. A `409` is shown as the server's sentence, naming every candidate, and is never retried with the bare name.
2323

24-
**BREAKING** (the dataset query of a package item, interim under the epic's ruling A): `?package=` is the exact qualifier (ADR-0150 D5), not the dependency-closure read of D3. **FROM:** a dashboard, report or list-view chart in package P, whose dataset only a dependency of P holds, is served by the bare read. **TO:** it is refused `409 RESOURCE_CONFLICT` (`not-held-by-qualifier`), naming the holder, and the item's widget or block shows that sentence. **The interim fix:** ship the dataset in the item's own package. No first-party package references a dataset across packages. Follow-ups #32310 (a caller-package arm on the dataset query door, with closure semantics) and #32311 (the console switches to it) restore the dependency case.
24+
**BREAKING** (the dataset query of a package item, interim under the epic's ruling A): `?package=` is the exact qualifier (ADR-0150 D5), not the dependency-closure read of D3. **FROM:** a dashboard, report or list-view chart in package P, whose dataset only a dependency of P holds, is served by the bare read. **TO:** it is refused `409 RESOURCE_CONFLICT` (`not-held-by-qualifier`), naming the holder, and the item's widget or block shows that sentence. **The interim fix:** ship the dataset in the item's own package. No first-party package references a dataset across packages (read in this repository; **corrected by #32929:** one first-party app outside this repository does — HotCRM's CRM Overview dashboard, in its app package `app.objectstack.hotcrm`, binds the dataset `product_metrics` that its module package `app.objectstack.hotcrm.revenue` holds, so once the console sends the item's package the tile is refused where it drew on 18.3.0; the module depends on the app, so declaring the module from the app is a cycle the kernel refuses at boot. Other first-party apps outside this repository: not measured). Follow-ups #32310 (a caller-package arm on the dataset query door, with closure semantics) and #32311 (the console switches to it) restore the dependency case.

‎.changeset/32310-dataset-caller-package.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ On the batch door the arm is read once, from the batch URL, for every query: a m
2828
2. `?callerPackage=` beside `?package=`, blank, `all`, repeated, or not a string (`?callerPackage[x]=`) is `400 VALIDATION_ERROR`, and nothing runs (on the batch, the whole request).
2929
3. A package id that is not installed gets the `?package=` answer for that id: `409` naming the holders, `404` when nothing holds the name.
3030
4. A deployment whose composed metadata protocol has a by-name read (`getMetaItem`) but no caller resolution (`resolveCallerPackageAddress`), or whose engine registry lacks the package-scoped reads the exact qualifier judges with, answers a `datasetName` sent with the arm `503 SERVICE_UNAVAILABLE` (on the batch, that query's entry), and runs nothing, where it answered `200` with the bare read. `@objectstack/metadata-protocol`'s protocol on an ObjectQL engine has both.
31-
- **Who moves.** Nothing first-party sent the parameter to either door. A script that sent it and relied on the bare read gets the reader's resolution.
31+
- **Who moves.** Nothing first-party sent the parameter to either door. A script that sent it and relied on the bare read gets the reader's resolution. **Corrected by #32929:** once the console sends it (`32311-dataset-caller-package-ui`), one first-party app is refused — HotCRM's CRM Overview dashboard, in its app package `app.objectstack.hotcrm`, binds the dataset `product_metrics` that its module package `app.objectstack.hotcrm.revenue` holds; the module depends on the app, not the app on the module, so once the console sends the reader's package the tile answers `409 RESOURCE_CONFLICT` (`outside-closure`) where it drew on 18.3.0, and declaring the module from the app would be a dependency cycle the kernel refuses at boot. HotCRM fixes it in its own release, by moving the dashboard into the module or the dataset into the app package; the HotCRM lane chooses (#32929). Other first-party apps outside this repository: not measured.
3232

3333
**The remedy.** Drop `?callerPackage=` for the bare read, send `?package=HOLDER` to read one holder's dataset, or add the holder to the reading package's `dependencies`.

‎.changeset/32311-dataset-caller-package-ui.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ A saved dataset is read for the package of the item that references it, sent as
1818

1919
The package stays part of each query's signature, so a cached answer never crosses packages. An item authored in the environment (no `_packageId`, or the `sys_metadata` and `__runtime__` sentinels) sends no package, and its read stays caller-less exactly as before. An inline dataset names no saved item and sends none. A `409` is shown as the server's sentence on the widget and the report block, and as its status (`HTTP 409`) on the date range; the option-colour read keeps the theme palette. None of them is retried with the bare name. The `packageId` option (`?package=`) stays on both adapter methods for a caller that means the holder.
2020

21-
**What this does to the BREAKING note of the `?package=` change** (`32077-dataset-query-package`, the interim this follows up). That note refuses a dashboard, report or list-view chart in package P whose dataset only a dependency of P holds, with `409 RESOURCE_CONFLICT` (`not-held-by-qualifier`). After this change such an item is served again: the dependency's dataset, resolved for P. Two cases stay refused, now as `outside-closure`: a dataset held only by a package P does not declare in its `dependencies` (transitively), and a dataset authored in the environment rather than in a package. **The fix for those:** add the holder to P's `dependencies`, or ship the dataset in P.
21+
**What this does to the BREAKING note of the `?package=` change** (`32077-dataset-query-package`, the interim this follows up). That note refuses a dashboard, report or list-view chart in package P whose dataset only a dependency of P holds, with `409 RESOURCE_CONFLICT` (`not-held-by-qualifier`). After this change such an item is served again: the dependency's dataset, resolved for P. Two cases stay refused, now as `outside-closure`: a dataset held only by a package P does not declare in its `dependencies` (transitively), and a dataset authored in the environment rather than in a package. **The fix for those:** add the holder to P's `dependencies`, or ship the dataset in P. When the holder already depends on P (a module of the app that reads it), that dependency is a cycle: move the reading item into the holder instead. **First-party (corrected by #32929):** HotCRM's CRM Overview dashboard, in its app package `app.objectstack.hotcrm`, binds the dataset `product_metrics` that its module package `app.objectstack.hotcrm.revenue` holds; the module depends on the app, not the app on the module, so once the console sends the reader's package the tile answers `409 RESOURCE_CONFLICT` (`outside-closure`) where it drew on 18.3.0, and declaring the module from the app would be a dependency cycle the kernel refuses at boot. HotCRM fixes it in its own release, by moving the dashboard into the module or the dataset into the app package; the HotCRM lane chooses (#32929). Other first-party apps outside this repository: not measured.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
'@objectstack/objectql': minor
3+
---
4+
5+
fix(objectql)!: every reader of the registry's overlay slot binds a row of an App's customization pair by the exact read's owner rule (ADR-0150 D4)
6+
7+
Clause-②: yes (narrowing) — two refusals where a registration was admitted before. First, with the bare-name holders sealed, a package whose only members of an email template's name are locales the App ships none of, while the App's pair stores a row of that locale declaring another package of the App as its base (`overrides.package`), is refused `422 NAMESPACE_CONFLICT` naming the App as an addition to the App's template (#28802), where it was admitted because the pair's row counted as the App's own member. First-party packages in that position: 0. Second, with the holders sealed, a package of another namespace whose dependencies reach a package X that holds an email template's name alone (or that X's dependencies reach), shipping only a locale X ships none of, while a package-less row of that locale (a legacy overlay in the environment's slot) customizes X's template, is refused `422 NAMESPACE_CONFLICT` naming X as an addition to X's template, where it was admitted because that row counted as X's member; once admitted, the row bound to neither package and the cold boot's seal reported the package. The doors now count the arriving package as the seal counts it (listed below). First-party packages in that position: 0. The bare-name gate does not move the other way: where a row of the App's pair now binds to X, it lends X no locale at the doors or the seal, so a package of another namespace on X shipping only that locale is still refused and reported, in either registration order (listed below; admitting it is #32899). Beside them, a read withholds a row it served: with every package of the App that holds the name disabled, a row of the App's pair is that disabled holder's, so the bare read and an addition's address withhold it as they withhold any name only disabled packages hold (listed below).
8+
Metadata-protocol: narrowed
9+
10+
<!-- adr-0087: registered pair-row-locale-addition-refused -->
11+
12+
**BREAKING** for two registrations. A package that ships only a locale of an email template the App does not ship, while the App's pair overrides that locale for another package of the App, is now refused as an addition to the App's template. A package of another namespace on a package X that holds a template alone (or that X depends on), shipping only a locale X does not ship while a package-less row of that locale customizes X's template, is now refused as an addition to X's template. For either: ship a locale the holder ships too (declared in the manifest, or registered first), or rename the template. Nothing in the workspace is in either position.
13+
14+
`SchemaRegistry`'s per-package overlay slot (`overlaySlotBinding`) read a row stored in a customization pair (`<app>.custom`) by the pair's per-package base only, never by the App whose pair it is (ADR-0146 D3: one pair per App, shared by every package of the App) and never by the base the row declares (`overrides.package`, ADR-0146 D2). The exact read (`?package=`, `pairRowOnAddress` in `@objectstack/metadata-protocol`) has read both since the epic's ruling on #31699 F2; its other readers now bind the row the same way: the holder the row declares, when the pair customizes it; else the App whose own pair it is (#28390 ruling A); else the one package of the App holding the name, counted as the exact read counts holders: over every holder of the name, each with the rows bound to it, so a bundle addition to another holder (of the App or outside it) holds no name (#28802) unless it ships the row's own locale, which the row may customize, and a package a row of the pair is declared for holds that row's locale; else, with two or more, no package. A row whose count would read an undeclared row of another shared pair (whose binding waits on that pair's own count) binds to no package. A declaration naming a package the pair does not customize, or one that holds no item of the name, binds it to no package. A row of a pair no holder of the name is customized by keeps its per-package reading.
15+
16+
What each reader answers now, with a package X of App A holding the name and a row of `A.custom` (each line says what moves FROM what TO what):
17+
18+
- `SchemaRegistry#packageScopedHoldersOf`: FROM the pair counted as a holder of its own when the App holds no item of the name TO the pair never a holder. A bare read (`GET /meta/TYPE/NAME`, `resolvePackageScopedName`) of a name one package of the App holds moves FROM `409 RESOURCE_CONFLICT` (`ambiguous-in-environment`, naming X and the pair) TO the row, X's customization (widening), except that, with the row (of locale L) declared for X and a package W of the App holding the name through L and a locale X ships too, W disabled, the bare read of L moves FROM `409` TO withheld (no loosening); with two packages of the App holding it, the bare read and `?package=A` still refuse `409`, now naming the two packages without the pair.
19+
- `SchemaRegistry#getPackageScopedItem` naming X: FROM X's own shipped item (none, for an added locale) TO the row, when the row declares X or X is the one package of the App holding the name — what `?package=X` already served. Naming the pair: FROM the row TO none (the pair is no holder; `?package=A.custom` serves the row as before).
20+
- A holder's bundle members (`bundleMembersHeldBy`, read by the bundle-addition rule of the bare read): FROM the row's locale counted as the App's when the row declares X, and as the pair's when the App holds no item of the name, TO counted as X's (declared, or the one package holding it) or as no holder's (two).
21+
- The bare-name gate (the item door, the package door and the cold boot's seal) reads a holder's members its own way: a row of a customization pair counts for a holder only where the per-package reading counts it for that holder too (the pair's base when it holds the name, else the pair itself). Where the binding moved the row (to X, from the App or the pair), the gate counts it for no holder. The App no longer holds a locale it ships none of through a row declared for X: the first refusal above. X does not gain the row's locale at the gate either, so nothing moves for a package of another namespace whose dependencies reach X and that ships only L, with the App holding no item of the name: it is refused `422 NAMESPACE_CONFLICT` naming X at both doors and reported by the seal against X, as before, whether the row declares X or X is its one owner and whether the package is of the App or outside it; with that package holding L first, X arriving is refused naming it and the seal reports X against it, as before. Admitting that package waits on the by-name read following the binding (#32899).
22+
- A package-less row (no package stamp, or `sys_metadata`) of locale L over a name X alone holds: it binds to X only while X is the one package holding the name, and the doors now count the arriving package as a holder. A package of another namespace whose dependencies reach X (or that X's dependencies reach) and that ships only L moves FROM admitted at the item door and the package door (after which the row bound to neither package, X's address no longer served it, and the cold boot's seal reported the package against X) TO refused `422 NAMESPACE_CONFLICT` naming X, an addition to X's template, with X keeping the row (narrowing). The seal's answer over the same state is unchanged: it reports the package against X before and after.
23+
- A row declaring a package the pair's holders do not include (one that holds no item of the name, or one the pair does not customize): FROM bound to the App (or to the pair, when the App holds no item of the name) TO no package. `?package=A` moves FROM the row TO the App's own item: the exact read had already judged the row no member of A's address and fallen back to A's registry item, which was the row again. A bare read of a name one package of the App holds moves FROM `409` naming that package and the pair TO that package's own item.
24+
- With a disabled holder (a disabled package holds no name, ADR-0150 D3): the binding counts every holder, disabled or not, so a disable never moves it. With every package of the App that holds the name disabled, the bare read of the row's member moves FROM the row (the pair, an enabled holder of its own) TO the disabled holder's withheld item, as for any name only disabled packages hold; so does the address of a package of the App whose holding is an addition to the disabled one (`?package=Z`).
25+
- `SchemaRegistry#getEnvironmentScopedItem`: unchanged. A pair's row is never the environment's item, before or after (measured on every case above).
26+
27+
One shape still reads apart, and the registry is the side that does not guess: an undeclared row of the very locale a bundle addition of another package of the App ships binds to no package here (it may customize that addition's member), while `?package=X` serves it, because the exact read's holder count leaves the addition out. So does a row of a pair while another shared pair stores an undeclared row of the name: the registry binds it to no package, where the exact read may serve it or refuse it. And so does an undeclared row of a pair two holders share while one of them is disabled: the registry binds it to no package, while `?package=X` of the enabled one serves it, because the exact read counts the served holders. The exact read adopting these counts is #32561.
28+
29+
Unchanged: apart from the `?package=A` move above, the exact read of every address (`?package=X`, `?package=Y`, `?package=A`, `?package=A.custom`) serves or refuses as before, measured on the protocol for the same cases; the App's own address keeps an undeclared row of its pair (#28390 ruling A); a row stored under a package that holds the name in its own slot, or under a pair whose holders include none it customizes, binds as before.

0 commit comments

Comments
 (0)