Skip to content

Commit 05ea9bb

Browse files
committed
docs(adr): ADR-0146 D3 round 1 — membership reading, pre-amendment pairs, engines key, isSystem anchor
Contract review record 6692724375 on PR #31027, four should-fixes: - S1: the next-version prerequisite names an object-level `isSystem` as the declared reading to add; `hasPlatformObjectPrefix` is named as the old `startsWith` heuristic to retire (it answers true for `sys_custom_<short>`). - S2: the platform pair carries `engines.platform` as its only `engines` key, and the ensure door's existing-pair check reads that key for it. - S3: D11 and Decided-here 12 — a pair created under the per-package unit is folded into its App's pair by the migration ceremony, served until moved. - S4: Decided-here 11 — the App of a package is read from the declarations the registry holds (the `dependency` co-ownership arm), a package that declares no App is its own unit; "every package its artifact delivers". docs/adr/README.md regenerated, byte-identical. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxn8FPvL85i9w26qoq
1 parent e2cc08e commit 05ea9bb

1 file changed

Lines changed: 56 additions & 12 deletions

File tree

‎docs/adr/0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md‎

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ displacement cost. The amendment lands as the rewrite did — by the maintainer'
2424
· **Amended in place** (2026-11-06, decision D2 on epic [objectstack-ai/cloud#3652](https://github.com/objectstack-ai/cloud/issues/3652), ruling record [`6681380041`](https://github.com/objectstack-ai/cloud/issues/3652#issuecomment-6681380041), maintainer, verbatim: 「修订为允许只提示(推荐)」):
2525
a base's upgrade plan may report, as advice, each `.custom` override that hides a vendor change; `basedOn` still never gates, and nothing is refused, merged or rebased on the finding ([D2](#d2), [D6](#d6), the [Supersede table](#supersede-table)'s §9 row, [Consequences](#consequences), merge question 2).
2626
It lands by the maintainer's hand-merge of the PR cut from #30881.
27-
· **Amended in place** (2026-11-06, ruling record [`6691022506`](https://github.com/objectstack-ai/objectstack/issues/29594#issuecomment-6691022506) on [#29594](https://github.com/objectstack-ai/objectstack/issues/29594), maintainer, verbatim: 「① 定制单位 = App;同意」, and the second ruling record [`6691217245`](https://github.com/objectstack-ai/objectstack/issues/29594#issuecomment-6691217245) there, verbatim: 「内核白名单,可以下一版本再处理,首批名单建议:Users、Organizations;其他同意。」): the customization unit is the App, so there is one pair per App, `<app id>.custom`, shared by every package its artifact delivers and never one per module; the kernel is one platform suite with one platform pair, `com.objectstack.kernel.custom`, whose range is the platform version; no kernel object is customizable in this version, and the kernel whitelist (Users, Organizations) belongs to the next one ([D3](#d3), [D11](#d11), Q4, [Consequences](#consequences), merge questions 8, 9 and 10). It lands by the maintainer's hand-merge of the PR cut from #31014.
27+
· **Amended in place** (2026-11-06, ruling record [`6691022506`](https://github.com/objectstack-ai/objectstack/issues/29594#issuecomment-6691022506) on [#29594](https://github.com/objectstack-ai/objectstack/issues/29594), maintainer, verbatim: 「① 定制单位 = App;同意」, and the second ruling record [`6691217245`](https://github.com/objectstack-ai/objectstack/issues/29594#issuecomment-6691217245) there, verbatim: 「内核白名单,可以下一版本再处理,首批名单建议:Users、Organizations;其他同意。」): the customization unit is the App, so there is one pair per App, `<app id>.custom`, shared by every package its artifact delivers and never one per module; the kernel is one platform suite with one platform pair, `com.objectstack.kernel.custom`, whose range is the platform version; no kernel object is customizable in this version, and the kernel whitelist (Users, Organizations) belongs to the next one ([D3](#d3), [D11](#d11), Q4, [Consequences](#consequences), merge questions 8 to 12); the App of a package is read from the declarations the registry holds, a package that declares no App is its own unit, and a pair created under the old per-package unit is folded into its App's pair by the migration ceremony (merge questions 11 and 12). It lands by the maintainer's hand-merge of the PR cut from #31014.
2828
**Decided by**: the maintainer, 2026-10-30, in the desktop session that re-planned the epic, verbatim and
2929
untranslated as epic #28236 records them — the direction 「方向定为包级覆盖:代码和 Studio 用同一机制,定制都进 .custom。」; the suffix 「同意 后缀改成 .custom」; the eight questions 「等我拍板的 8 个问题,全部同意」; the extension
3030
fields 「扩展字段用 __c 后缀,只有 .custom 包能用。」; the item toolbar 「同意新增 2h「Studio 项工具栏」并放在 2a 之前」;
@@ -293,8 +293,9 @@ is the maintainer's from the 2026-10-30 thread: 「假设未来客户安装了
293293
the quote; the suffix was later ruled `.custom`).
294294
295295
**The unit is the App** (amended 2026-11-06, ruling record 6691022506 on #29594). An App is what a consumer installs
296-
and sees: the `type: 'app'` package and the `type: 'module'` and `type: 'plugin'` packages its artifact delivers
297-
(ADR-0019 D1–D4), one artifact at one version (ADR-0130 D1/D6). Its customer's changes are therefore one package too.
296+
and sees: the `type: 'app'` package and every package its artifact delivers, whatever its type — `module`, `plugin`
297+
or any other internal contribution of ADR-0019 D2 (ADR-0019 D1–D4) — one artifact at one version (ADR-0130 D1/D6).
298+
Its customer's changes are therefore one package too.
298299
HotCRM at `objectstack-ai/hotcrm` `6961ab1` is the App `app.objectstack.hotcrm` and four modules,
299300
`app.objectstack.hotcrm.service`, `app.objectstack.hotcrm.revenue`, `app.objectstack.hotcrm.marketing` and
300301
`app.objectstack.hotcrm.o2c`, all `namespace: 'crm'` and all `6.1.0`, so it has one pair,
@@ -303,6 +304,8 @@ HotCRM at `objectstack-ai/hotcrm` `6961ab1` is the App `app.objectstack.hotcrm`
303304
- **A module never owns a pair.** A customization of any item or object of any package of the App lands in the App's
304305
pair. Asked for any package of the App, the ensure door answers the App's pair: it creates the pair on the first ask
305306
(`201`) and answers the existing pair after (`200`), and it never answers `422` for a package of the same App.
307+
Which App a package belongs to is read from the declarations the registry holds, and a package that declares no
308+
App is its own unit (*decided here where the rulings were silent; merge question 11*).
306309
- **`422 NAMESPACE_CONFLICT` stays** for a pair namespace held by a package outside the App's artifact; the registry's
307310
co-ownership arms (`packages/objectql/src/registry.ts#coOwnersOf`) are unchanged.
308311
- **What the rest of this record means by the pair.** Elsewhere in this record, "the base's `<base>.custom`", "the
@@ -365,8 +368,10 @@ Studio's package list leaves out — form one suite, and the suite has one pair,
365368
changeset `fixed` group (`.changeset/config.json`) is one group of 109 packages, at 18.3.0 on `origin/main`
366369
`33bc8ae5`, while the kernel manifests' own `version` fields (0.1.0 to 3.x) are unrelated to that release. The range
367370
is `^<major>` of the platform version at creation (`^18` today). It is declared in `engines.platform`, never as a
368-
`manifest.dependencies` entry, because no package holds `com.objectstack.kernel`. *Decided here where the rulings
369-
were silent; merge question 9.*
371+
`manifest.dependencies` entry, because no package holds `com.objectstack.kernel`. The platform pair's manifest
372+
carries `engines.platform` as its only `engines` key — no `engines.protocol`, which the install handshake reads
373+
first — and the ensure door reads that key, not `manifest.dependencies`, when it checks an existing platform pair.
374+
*Decided here where the rulings were silent; merge question 9.*
370375
- **A kernel package may be absent, and its overrides stay.** "The kernel always installed in full" is a goal, not
371376
today's behaviour (ruling record 6691022506, ②): `serve` mounts by tier preset, by the stack's `requires`
372377
capabilities and by the always-on slate
@@ -381,10 +386,13 @@ Studio's package list leaves out — form one suite, and the suite has one pair,
381386
version** opens the first kernel whitelist, Users and Organizations only (plugin-auth's user object and the
382387
organizations plugin's organization object): `__c` fields, forms, views and page layouts; never deleting or retyping
383388
a vendor field, never an identity flow, never permission or sharing semantics. Two prerequisites travel with it: the
384-
"system object" heuristics that test a `sys_` prefix are replaced by a declared reading (`isSystem`,
385-
`packages/spec/src/system/constants/platform-object-names.ts#hasPlatformObjectPrefix`), so a customer's
386-
`sys_custom_<short>` object inherits none of them; and `customizable` is judged at every write into the platform
387-
pair, by the package of the overridden object, not only at the ensure door.
389+
"system object" heuristics that test a `sys_` prefix are replaced by a declared reading — an object-level
390+
`isSystem` the next version adds to the object schema, which no spec key carries today — so a customer's
391+
`sys_custom_<short>` object inherits none of them; ⛔ that reading is not
392+
`packages/spec/src/system/constants/platform-object-names.ts#hasPlatformObjectPrefix`, the old `startsWith`
393+
heuristic over `sys_`, `cloud_` and `ai_`, which answers true for `sys_custom_<short>` and is one of the
394+
heuristics to retire; and `customizable` is judged at every write into the platform pair, by the package of the
395+
overridden object, not only at the ensure door.
388396
389397
**On top, one surface.** Studio opens HotCRM and the designer sees **one** HotCRM: the pillar rails list the base's
390398
items (read-only, viewable with the [D1](#d1) tools) and the pair's items (writable) **in the same list**, the latter
@@ -609,9 +617,13 @@ name suffixed, the base untouched (N-23c).
609617
while the ensure door refuses a kernel package ([D3](#d3), amended 2026-11-06): like the row of any base whose pair
610618
that door refuses (`packages/metadata-protocol/src/protocol-customization-package.ts#customizationPairEnsureRefusal`),
611619
it stays as it is, served as [D8](#d8) item 1 says, and its package-less write stays open until the kernel whitelist
612-
admits the item into the platform pair (*decided here where the rulings were silent; merge question 10*). The
613-
migration is idempotent and reports per base what it
614-
moved; it runs as a CLI ceremony the administrator invokes, in the shape ADR-0131 D10 set.
620+
admits the item into the platform pair (*decided here where the rulings were silent; merge question 10*). A pair
621+
created under the per-package unit before 2026-11-06 — a module's `<module id>.custom`, or the one kernel
622+
package's pair that today's door creates before it answers `422` to the next — is folded by the same ceremony: its
623+
items and declared overrides move into its App's pair, re-declared against the same base, and the emptied package
624+
is uninstalled; until moved it is served as it is, and a kernel one waits for the whitelist with the rows above
625+
(*decided here where the rulings were silent; merge question 12*). The migration is idempotent and reports per
626+
base what it moved; it runs as a CLI ceremony the administrator invokes, in the shape ADR-0131 D10 set.
615627
- **Close** (N-16). After the migration, a package-less write onto a packaged item (`PUT /api/v1/meta/:type/:name` with
616628
no `?package`, the "Customize with an overlay" path Setup offers) is refused with a prescription naming the pair:
617629
`packagelessAddress` stops answering an unbound binding for a packaged name, and the five-type
@@ -813,6 +825,38 @@ of Q1's refusal and `action` — were ruled by the maintainer on 2026-10-31 (dec
813825
so the row is not migrated: it stays as it is, served as [D8](#d8) item 1 says, and its package-less write stays
814826
open, as for any base whose pair that door refuses today. Closing that write with no pair to name would leave an
815827
administrator no way to change an existing kernel customization until the next version.
828+
11. **The App of a package is read from the declarations the registry holds, and a package that declares no App is
829+
its own unit** ([D3](#d3), amended 2026-11-06). Nothing in the tree persists which artifact delivered a package:
830+
`packages/spec/src/kernel/package-registry.zod.ts#InstalledPackageSourceSchema` records `code`, `marketplace` or
831+
`authored`, and the artifact's package list (`packages/objectql/src/registry.ts#ArtifactInstallScope`) exists
832+
only while the artifact installs. So the ensure door reads the App of a package the way the registry already
833+
reads a module's co-ownership of its App's namespace (ADR-0141 D1/D5; the `dependency` arm of
834+
`packages/objectql/src/registry.ts#coOwnersOf`): a `type: 'app'` package is its own App; any other package's App
835+
is the `type: 'app'` package it directly declares in `manifest.dependencies` — where it declares more than one,
836+
the one that holds its namespace, and where that leaves none or several, the door serves the readable verdict
837+
(not customizable: no single App), never a guess and never an id prefix. HotCRM's four modules each declare
838+
`app.objectstack.hotcrm` `^6.1.0`. The reading decides ADR-0141 D3's standalone module too: it declares its App
839+
and holds its namespace, so for customization it is a member and its overrides land in the App's pair — a
840+
second pair in `crm_custom` is (c), not taken, and the namespace gate would refuse it — while it stays an App in
841+
its own right for install, open and uninstall (ADR-0141 D3 unchanged); uninstalling it alone keeps and marks its
842+
overrides, as for a module a later App version drops, and the uninstall refusal that names the pair is the
843+
App's. A package that declares no `type: 'app'` package — an operator-provisioned internal contribution
844+
(ADR-0019 D2), a `type: 'plugin'` installed on its own, a code-registered package outside any App — is its own
845+
unit: its pair is `<its id>.custom` with namespace `<its namespace>_custom`, the rule this amendment retires for
846+
the members of an App; a kernel package is never such a unit, its pair is the platform pair. The lookup the
847+
server lane landed first (`pairOf(base)` = `customizationPackageId(appOf(base))`, PR #31026) carries this
848+
reading in `appOf`, which is the identity until the ensure door's change.
849+
12. **A pair created under the per-package unit is folded into its App's pair by the migration ceremony, and served
850+
until moved** ([D11](#d11), amended 2026-11-06). This decision has been in force since 2026-10-31 and the ensure
851+
door is landed, so an environment may already hold `app.objectstack.hotcrm.service.custom`, or the one kernel
852+
pair today's door creates before its `422`s. After this amendment such a package is the pair of nothing (the
853+
pair predicate answers false for the module, and its declared overrides would fall under [D2](#d2) Q1 with no
854+
place under this record), so [D11](#d11)'s ceremony moves its items and declared overrides into the App's pair,
855+
re-declared against the same base with the same `basedOn`, and uninstalls the emptied package; until the
856+
ceremony runs it is served as it is, its declared overrides honoured as today, so nothing a customer built goes
857+
dark on upgrade. A kernel one waits with [D11](#d11)'s kernel rows: served as it is until the whitelist version
858+
folds its admitted rows into the platform pair and lists the rest. Refusing or deleting such a pair would discard
859+
customer work this record's earlier text invited.
816860
817861
## Refs
818862

0 commit comments

Comments
 (0)