Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/adr/0070-package-first-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ A runtime **create** (`intent = runtime-only`, i.e. not an overlay of an artifac

> **Amended 2026-12-03 ([#38174](https://github.com/objectstack-ai/objectstack/issues/38174), ruling record [comment 7184753035](https://github.com/objectstack-ai/objectstack/issues/37424#issuecomment-7184753035), question 2, ruled A, written into [ADR-0084's amendment of 2026-11-26](./0084-application-builder-information-architecture.md#amendment-2026-11-26-org); and ruling record [comment 7380917604](https://github.com/objectstack-ai/objectstack/issues/38174#issuecomment-7380917604), ruled A) — the kernel refuses a create that names no package; five writers keep a named exemption, and a loose row that exists is still saved in place.** This note records the implementation status of the decision above, with the exemptions the two rulings name. Before [PR #39386](https://github.com/objectstack-ai/objectstack/pull/39386), the kernel enforced one half of it: it refused a runtime create that named a read-only package, and it accepted one that named no package and stored a loose row. That PR closes the second half, in the same phase as the interface's ask and after it, with no flag.
>
> - **What is refused.** A save through `protocol.saveMetaItem`, draft or publish, that names no package is a create when no package holds the name, as an item or as a draft, and no package-less row or draft of it is stored. It is refused before anything is written, with `422 WRITABLE_PACKAGE_REQUIRED`, D1's own code, in a sentence that names the type and the name and lists, up to a cap, the writable packages the caller may name. `os meta register` is closed with the rest: a new item needs its `--package`. The permission-set clone door is closed with it too: a copy with no package to land in (a loose source, or a set a kernel package ships) is refused, and Setup's clone dialog asks for the landing package, offering the writable packages (claim amendment [7389333883](https://github.com/objectstack-ai/objectstack/issues/38174#issuecomment-7389333883), ruled A on 2026-12-03, with no new exemption).
> - **What is refused.** A save through `protocol.saveMetaItem`, draft or publish, that names no package is a create when no package-less row or draft of the name is stored and no package holds the item: no package's active row holds it (an `action` is keyed by its object, ADR-0150 D4, so an action whose holders all bind other objects is the environment's new item, and a package's draft does not bind that save either), and, for a draft-mode save of a name no package's active row holds, no package's draft holds the name (a publish-mode save is not bound by a draft, so a package's draft does not keep it from being a create). It is refused before anything is written, with `422 WRITABLE_PACKAGE_REQUIRED`, D1's own code, in a sentence that names the type and the name and lists, up to a cap, the writable packages the caller may name. `os meta register` is closed with the rest: a new item needs its `--package`. The permission-set clone door is closed with it too: a copy with no package to land in (a loose source, or a set a kernel package ships) is refused, and Setup's clone dialog asks for the landing package, offering the writable packages (claim amendment [7389333883](https://github.com/objectstack-ai/objectstack/issues/38174#issuecomment-7389333883), ruled A on 2026-12-03, with no new exemption).
> - **Five writers keep a named exemption.** The ruling of 2026-11-26 names four. An overlay of a kernel item, until the platform pair's whitelist exists: an overlay is `intent = override-artifact`, which the third bullet above leaves unchanged. The ruled import of an external datasource, which the server stamps `writeFace: 'external-import'`. A migration that preserves a binding, which re-saves a stored row under a server-stated `source`. Platform registration, which writes the metadata service's own store and does not pass the kernel save. The ruling of 2026-12-03 names the fifth, which the next bullet gives with its bound. A remote caller can state none of the marks these exemptions are read by. Decisions Q-a, answered A, and Q-b, answered C, add no metadata type and no case to the five (ADR-0084's first note of 2026-12-03 gives them).
> - **The fifth: the organization-ownership ceremony's conversions of rows stored before the upgrade** (ruling record [comment 7380917604](https://github.com/objectstack-ai/objectstack/issues/38174#issuecomment-7380917604): on the decision card the maintainer chose the option 「A 迁移照旧落为散落项」, and the record is the maintainer's word for "four writers, and no other" becoming five). `os migrate organization-ownership --apply` makes two creates that name no package (`packages/cli/src/utils/organization-ownership-apply.ts`): it converts an organization's authored positions and permission sets into environment metadata, and it promotes an email template. Both state one server-side provenance, the request field `packagelessCreateProvenance: 'organization-ownership-ceremony'`, on the precedent of the external import's `writeFace`, and no wire body can state it. Only the create judgment reads it. `source` is not set, so every other gate still judges these saves: a permission set that grants on an object that does not exist is still refused, and the ceremony reports it as a blocker. That is the exemption's bound: the ceremony's conversions of rows stored before the upgrade, and no other save. The converted items land loose. The ceremony's report lists what it left loose and names the door that moves it into a package, `POST /api/v1/packages/:id/move-in` (the amendment note under D5).
> - **What stays open.** A loose row that exists is saved in place, as a draft or as a published item, and it is deleted and its draft published as before. A save that names no package for a name a package holds is unchanged too: the name is not new, and [ADR-0150](./0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md) D4 judges the save as before ("A package-less row that bears a package-held name is a customization, never a second item"). A name whose only stored row is a draft that a package holds is not new either: a save of it that names no package is no create, and the draft address judges it as before (`packages/metadata-protocol/src/sys-metadata-repository.ts#unboundItemDraftAddress`).
> - **What stays open.** A loose row that exists is saved in place, as a draft or as a published item, and it is deleted and its draft published as before. A save that names no package for an item a package holds is unchanged too: the item is not new, and [ADR-0150](./0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md) D4 judges the save as before ("A package-less row that bears a package-held name is a customization, never a second item"). For an `action`, the item is keyed `(package, objectName, name)`: a holder at the body's object makes the save a customization, and a holder only on other objects does not (D4's amendment of 2026-11-16, ruling 6902014292, the environment's own item, which is new when no package-less row or draft of the name is stored). A name whose only stored row is a draft that a package holds is not new to a draft-mode save: a draft-mode save of it that names no package is no create, and the draft address judges it as before (`packages/metadata-protocol/src/sys-metadata-repository.ts#unboundItemDraftAddress`); a publish-mode save of it is a create and is refused (ruling 7184753035 and the card's What 1; the gap was found by [the contract review of PR #39386](https://github.com/objectstack-ai/objectstack/pull/39386#issuecomment-7396202327), M1).
> - **The automation definition doors.** `POST /api/v1/automation` and `PUT /api/v1/automation/:name` created flows that belong to no package. The first is retired, and the second updates a flow that exists and refuses a new name (decision Q-g, answered C: [comment 7234518908](https://github.com/objectstack-ai/objectstack/issues/37424#issuecomment-7234518908)). A flow is created with `PUT /api/v1/meta/flow/NAME?package=PKG`, which registers the flow and arms it at once. The refusal of a notify node that names an unregistered channel, which the automation doors ran and that save did not, moves onto it ([comment 7378011450](https://github.com/objectstack-ai/objectstack/issues/38174#issuecomment-7378011450)).
> - **One open door outside the kernel save.** Setup's `POST /api/v1/datasources` creates a runtime `datasource` and inserts its row into `sys_metadata` with no package, directly (`persistDatasourceRow`), so the write never reaches `protocol.saveMetaItem` and the close does not meet it. It is none of the five exemptions, the census that ruling record [comment 7184753035](https://github.com/objectstack-ai/objectstack/issues/37424#issuecomment-7184753035) ruled on did not list it, and no ruling covers it. Until [#39398](https://github.com/objectstack-ai/objectstack/issues/39398) closes it (or a ruling exempts it), D1 is not complete for that door.
> - **Not reached.** Sharing rules, queues and assignment rules that an organization authors in Setup are data rows, and no metadata save writes them; ADR-0084's first note of 2026-12-03 corrects the sentence that bound them to a package.
Expand Down
Loading