Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a42a05c
feat(metadata-protocol): refuse a package-less create at the kernel s…
claude Dec 3, 2026
1c030f0
feat: notify-channel refusal at the /meta flow save; retire POST /aut…
claude Dec 3, 2026
b237a7e
test+fix: retire CreateFlow schemas from the contract, clone door's p…
claude Dec 3, 2026
8f7ad03
docs: changeset, checklist follow-up, generated references, notify-ch…
claude Dec 3, 2026
c5add45
feat: the ceremony's loose conversions (fifth exemption, ruling 73809…
claude Dec 3, 2026
ae48182
docs(changeset): the fifth exemption and the draft-held name (#38174)
claude Dec 3, 2026
f85efae
test: migrate the save-path suites to name a package or seed the loos…
claude Dec 3, 2026
d2baee5
test(dogfood): migrate to name a package or seed the loose row; the p…
claude Dec 3, 2026
05e408a
chore(spec): api-surface baseline without the CreateFlow schemas (#38…
claude Dec 3, 2026
4c536e4
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Dec 3, 2026
2111e52
chore: gate fixes after merging main — regenerated spec artifacts, ru…
claude Dec 3, 2026
f5a901e
fix: L2 findings, first part — the package-less create judgment drops…
claude Dec 3, 2026
d2a08c2
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Dec 3, 2026
13df4a6
fix: L2 findings — no package-duplicate skip; migration entry and cal…
claude Dec 3, 2026
90c84ed
test: the duplicate face's server-face pins name their target package…
claude Dec 3, 2026
ecacc0a
test: CI fixes — collection-time loads for the migrated suites, ledge…
claude Dec 3, 2026
a9a0cae
test(verify): the metadata-door case saves into an authored package
claude Dec 3, 2026
7abd69a
test: migrate plugin-security, service-automation and verify saves to…
claude Dec 3, 2026
f7514c5
test(verify): pay the automation service's first load at collection
claude Dec 3, 2026
b42848c
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Dec 3, 2026
c913c4a
feat(app-shell): clone dialog offers the writable packages when the c…
claude Dec 3, 2026
a012c08
fix(runtime): a kernel source's clone lands in a named package that d…
claude Dec 3, 2026
60124b4
test(dogfood): the two-holder history battery suites seed their envir…
claude Dec 3, 2026
b83303a
fix(metadata-protocol): package-less create — action key and publish-…
claude Dec 4, 2026
b7ad57b
test(metadata-protocol): drop unused seedRow bindings (#38174)
claude Dec 4, 2026
bb318a3
test: cite contract review 7396202327 by record id (#38174)
claude Dec 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 36 additions & 0 deletions .changeset/38174-packageless-create-refused.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
'@objectstack/metadata-protocol': minor
'@objectstack/runtime': minor
'@objectstack/client': minor
'@objectstack/spec': minor
'@objectstack/cli': minor
'@objectstack/lint': minor
'@objectstack/plugin-sharing': patch
---

feat(metadata-protocol)!: the kernel refuses a package-less create; `POST /api/v1/automation` is retired; a flow saved through `/meta` is refused for a `notify` channel no plugin registers

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: updated here — content/docs/permissions/permission-sets.mdx (a clone with no package to land in is refused, and the Console's "New similar" offers the writable packages; skills/** teach no package-less create, `POST /api/v1/automation` or `client.automation.create`)

<!-- adr-0087: registered packageless-create-refused -->

**BREAKING** accept-set narrowing (ADR-0070 D1; ruling 7184753035; Q-g C, ruling 7234518908).

- **A package-less create is refused.** FROM a metadata save naming no package, of an item no package holds and no stored loose row carries, answering `200` and storing a new package-less ("loose") row, TO `422 WRITABLE_PACKAGE_REQUIRED` naming the writable packages, nothing stored. It holds on every door that reaches the kernel save: `PUT /api/v1/meta/{type}/{name}` publish and `?mode=draft`, `os meta register` (non-zero exit, the server's sentence printed), `client.meta.saveItem`, the MCP and AI authoring doors, the automation definition door, and the permission-set clone door (a copy with no package to land in; its sentence names the body's `package`). An `action` is keyed by its object (ADR-0150 D4): a package-less save of an action whose holders all bind other objects is the environment's new item and is refused the same way. In publish mode a package's draft of the name does not hold it, so a publish-mode save of a name only a package's draft carries is refused too.
- **Not reached.** An in-place save, draft save, delete and per-item publish of an existing package-less item; a package-less save of an item a package holds (ADR-0150 D4: for an action, a holder at the body's object), and a draft-mode save of a name a package's draft holds (the draft address binds it into that package, as before); the five named exemptions: the kernel-item overlay, the external-datasource import, the binding-preserving migrations (`os migrate meta --stored`, the flow-credential move), platform registration at boot, and (ruling 7380917604) `os migrate organization-ownership --apply`'s conversions of rows stored before the upgrade (an organization's authored positions and permission sets, a promoted email template), which land loose under a server-stated provenance only the create judgment reads, every other save gate still judging them, and the ceremony's report lists them and names the move door (`POST /api/v1/packages/:id/move-in`). There is no flag or environment switch. Sharing rules, queues and assignment rules are data rows (Q-d A) and are not reached.
- **`POST /api/v1/automation` is retired** with `client.automation.create`, `AutomationApiContracts.createFlow`, `CreateFlowRequestSchema` and `CreateFlowResponseSchema`. The door held no package, so it is retired rather than given one. `PUT /api/v1/automation/{name}` still updates a flow that exists; for a new name it answers `422 WRITABLE_PACKAGE_REQUIRED` naming the metadata door.
- **The clone door lands a kernel source's copy in a named package (widening).** `POST /api/v1/security/permission-sets/{name}/clone` with `package` naming a writable package, for a set a kernel package ships (`member_default`), was refused `409 RESOURCE_CONFLICT` because no such package declares a dependency on the kernel package; it now lands there (a kernel package is in every resolution closure, ADR-0150 D3), and the objects the set grants on are still judged against the target's closure.
- **One notify-channel judge on both flow doors.** A flow written through the metadata save (`PUT /api/v1/meta/flow/{name}`, and every other caller of the runtime publish gate: a runtime package install, the MCP and AI doors) whose `notify` node names a channel no plugin registers was stored and armed (the `/automation` door refused it). The runtime publish gate now refuses it too (rule `flow-notify-channel-unregistered`), once the boot has settled; both doors ask the one predicate `unregisteredNotifyChannels` (`@objectstack/lint`).

## FROM → TO

| FROM | TO |
|:---|:---|
| `PUT /api/v1/meta/view/my_grid` (new name, no package) | `PUT /api/v1/meta/view/my_grid?package=my_pkg` |
| `os meta register view --data v.json` (new item) | `os meta register view --data v.json --package my_pkg` |
| `client.meta.saveItem('view', 'my_grid', body)` (new item) | `client.meta.saveItem('view', 'my_grid', body, { packageId: 'my_pkg' })` |
| `POST /api/v1/automation` / `client.automation.create('f', def)` | `PUT /api/v1/meta/flow/f?package=my_pkg` / `client.meta.saveItem('flow', 'f', def, { packageId: 'my_pkg' })` |

One-line fix: name the package a new item belongs to. A flow triggered on an object another package ships needs a package that declares that package as a dependency. Existing package-less items keep saving in place, and Studio's "move into package" moves them.
12 changes: 12 additions & 0 deletions content/docs/api/metadata-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ D11), so a `manage_metadata` holder inside one organization is refused
`POST /meta/_migrate-stored`, the install-wide rewrite of the stored metadata,
preview included.

**A new item is saved into a writable package**
([ADR-0070](https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0070-package-first-authoring.md)
D1). A `PUT` (publish or `?mode=draft`) of a name no package holds and no stored
item carries, naming no package, is refused `422 WRITABLE_PACKAGE_REQUIRED` before
anything is written; the sentence lists the writable packages you may name. Add
`?package=PKG` (`os meta register --package PKG`, or choose a package in Studio).
Saving an item that already exists with no package stays open: a package-less item
stored earlier is saved in place, and an item a package holds is saved into that
package's row. Only the platform's own writes keep a named exemption: customizing an
item a kernel package ships, the external-datasource import, the stored-metadata
migrations, and platform registration at boot.

Creates are gated per type: `MetadataTypeRegistryEntry.allowRuntimeCreate` decides
whether a **brand-new** name may be minted under that type at all, separately from
whether an item that already exists may be overlaid (`allowEnvironmentOverlay`). A type that
Expand Down
4 changes: 2 additions & 2 deletions content/docs/api/plugin-endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ Approve/reject were never workflow routes (ADR-0019): approval is a flow node, a
|:-------|:---------|:------------|
| POST | `/automation/:name/trigger` | Trigger an automation flow by name (legacy alias: `/automation/trigger/:name`). Failures answer real status codes, not a `200` wrapping an inner failure: **404** unknown flow (a stored flow with no `start` node is never armed, so it answers here), **409** `FLOW_DISABLED`, **422** `FLOW_INPUT_SCHEMA_INVALID`, **400** `FLOW_FAILED` for a run that ran and was rejected — see [Run a flow via API](/docs/automation/flows#run-a-flow-via-api) |

The automation dispatcher also exposes flow CRUD (`POST /automation`, `GET`/`PUT`/`DELETE /automation/:name`) and run observability/resume routes — see [Durable pause & resume](/docs/automation/flows#durable-pause--resume-adr-0019).
The automation dispatcher also exposes flow reads and edits (`GET`/`PUT`/`DELETE /automation/:name`; `PUT` updates a flow that exists) and run observability/resume routes — see [Durable pause & resume](/docs/automation/flows#durable-pause--resume-adr-0019).

To **list** flows, read the metadata plane: `GET /meta/flow` (`client.meta.getItems('flow')`) — flows are metadata (ADR-0106). There is no `GET /automation` list route; it was retired, and a `GET` to that path gets the host's method-mismatch answer (`405` with `Allow: POST` on the default server), because only `POST` lives there. Per-flow runtime enablement and trigger binding is `GET /automation/_status` (`client.automation.getRuntimeStatus()`).
To **list** flows, read the metadata plane: `GET /meta/flow` (`client.meta.getItems('flow')`) — flows are metadata (ADR-0106). There is no `GET /automation` list route and no `POST /automation` create route; both were retired, and nothing is mounted at that path. To **create** a flow, save it into a package through the metadata door: `PUT /meta/flow/:name?package=PKG` (`client.meta.saveItem('flow', name, definition, { packageId })`), which registers and arms it at once. Per-flow runtime enablement and trigger binding is `GET /automation/_status` (`client.automation.getRuntimeStatus()`).

### Views (`/ui`) — Plugin Required

Expand Down
19 changes: 11 additions & 8 deletions content/docs/automation/flows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,19 @@ organization's flows notify its own.
**A `notify` node's `channels` must name channels the deployment registers.**
A channel is code: the messaging service registers `inbox`, and `email`, `sms`
and `push` (each sends once its transport service is configured), and a plugin
can register more. The `/automation` write doors (`POST /`, `PUT /:name` and the
copy door `POST /:name/clone`) refuse a flow whose `notify` node, at any depth,
names any other channel: `400 VALIDATION_FAILED`, naming the node and the channel
at `nodes.N.config.channels`, with a did-you-mean, and listing the channels the
deployment registers. Nothing is registered or stored. A channel whose transport
can register more. Every flow write door refuses a flow whose `notify` node, at
any depth, names any other channel, naming the node and the channel at
`nodes.N.config.channels`, with a did-you-mean, and listing the channels the
deployment registers: the metadata door (`PUT /api/v1/meta/flow/:name`, publish)
answers `422 INVALID_METADATA` (rule `flow-notify-channel-unregistered`), and the
`/automation` doors (`PUT /:name` and the copy door `POST /:name/clone`) answer
`400 VALIDATION_FAILED`. Nothing is registered or stored. A channel whose transport
is not configured yet is listed and accepted, because it starts sending once
the transport is configured, with no flow edit. With no messaging service
installed, a `notify` node delivers nothing whatever it names, and its channels
are not judged. The check is the save's: a flow a package ships, and a flow
stored through the metadata door, register as before, and a delivery on a
are not judged. The check is the save's, judged on the channels the deployment knows once its
boot has settled: a flow a package ships, and a stored flow re-saved with a
channel it already named, register as before, and a delivery on a
channel nothing registers fails at run time with `channel 'NAME' not
registered` and a step warning. **Positions and queues are not checked when a
flow is saved.** An approval node's `position` or `queue` names runtime data
Expand Down Expand Up @@ -3007,7 +3010,7 @@ door's own admission check, made before anything is dispatched:
| `403` | `PERMISSION_DENIED` | The flow declares `requiredPermissions` and the caller, not the system principal, does not hold every capability it names. Checked after the two rows above, at the same doors; the message names the declared and the missing capabilities | Grant the capability through a permission set's `systemPermissions`, or start the flow as someone who holds it |
| `404` | `RECORD_NOT_FOUND` | The start names a record (`recordId`, or the object's id alias such as `crmLeadId`) that the caller, not the system principal, cannot read in its own scope, or that does not exist: the two get one answer, the one the action door gives. Checked after the three rows above, at the same doors. A record key that is not one id, or a record named with no `objectName` for a flow declared `runAs: 'system'`, is refused `400` `VALIDATION_FAILED` naming the key. Where the flow's own definition reads a start input as the id of a record of a fixed object (a `get_record`, `update_record` or `delete_record` node with a literal `objectName` whose `filter.id` or `filter.id.$eq` is the input, or whose `filter.id.$in` is; a `screen` node with a literal `objectName` whose `recordId` is the input; a `subflow` or `map` node that hands the input to a callee input the callee reads so), that input is also loaded in the caller's own scope from THAT object, whatever object the start names, or none, and whatever the flow runs as: a value the caller cannot read there gets this `404`, and a value that is not one id (or a list of ids, where the definition reads a list) is refused `400` `VALIDATION_FAILED` naming the input. An input the flow declares a record id (`objectName` on the variable, [above](#a-start-input-that-is-a-record-id)) is loaded from the declared object the same way, whether or not the definition reads it | Start the flow on a record the caller can read, and name the record's object (`objectName`) beside `recordId`. Hand an input the flow reads as a record id the id of a record the caller can read in the object the flow reads it from, in the shape the flow reads (one id, or a list of ids) |
| `409` | `FLOW_DISABLED` | The flow exists but is switched off | Enable it — the identical request then succeeds |
| `422` | `FLOW_NO_START_NODE` | A defensive exit of the engine that no door reaches today. A flow with no `start` node is refused at registration (`POST` / `PUT /api/v1/automation` answer `400` `VALIDATION_FAILED`), and a stored one is not armed, so its trigger answers `404` above, not `422` | Add a `start` node to the flow; its metadata read shows `registration: refused` until then |
| `422` | `FLOW_NO_START_NODE` | A defensive exit of the engine that no door reaches today. A flow with no `start` node is refused at registration (`PUT /api/v1/automation/:name` answers `400` `VALIDATION_FAILED`, the metadata door `422` `INVALID_METADATA`), and a stored one is not armed, so its trigger answers `404` above, not `422` | Add a `start` node to the flow; its metadata read shows `registration: refused` until then |
| `422` | `FLOW_INPUT_SCHEMA_INVALID` | A node's `config` violates the `inputSchema` its own definition declares | Fix the flow; the refusal is non-retryable — even under `errorHandling.strategy: 'retry'` the engine refuses once and never enters the retry loop |
| `400` | `FLOW_FAILED` | The flow **ran** and was rejected | Read `error.details.summary` for the failing node |

Expand Down
2 changes: 1 addition & 1 deletion content/docs/concepts/metadata-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ document **whole** for every read that serves the base's name

> **ADR-0131 D6 — the per-organization overlay axis is retired.** The `/meta` doors (REST and the runtime dispatcher) carry no organization into a metadata write or read: a Studio or `PUT /api/v1/meta/...` write of the five ✅ types below lands **environment-wide** (since ADR-0131 D7 the `sys_metadata` family declares no organization column) and is served to every organization, and an organization admin holding only the retired `manage_org_presentation` capability is refused (`403`). The protocol itself refuses every organization-scoped write, and every read — item, list, layers, cached, history, diff, audit, drafts and the commit timeline — is environment → code, whatever organization a caller names. An overlay row an earlier release stored under an organization — under the `single` posture, every Studio save of these types, filed under the Default Organization — is served by no read, and on a SQL database (SQLite, PostgreSQL, MySQL) still holding one a v18 `os serve` refuses to start until the v18 migration ceremony (ADR-0131 C7: `os migrate organization-ownership --out PLAN`, then `--apply --plan-file PLAN`) has carried such a row to the environment layer and dropped the column; nothing deletes or rewrites it before then. The anonymous form doors read the environment alone too: the ceremony carries every organization-layer public-form withdrawal onto the environment, fail-closed. The table still records which types take an overlay of a shipped item.

> **ADR-0146 D11 — the tier no longer opens a write door onto a packaged item.** A write naming no package — a save, a publish, a reset (`DELETE`) or a rollback — onto a ✅-type item that one installed read-only package ships is refused `403 NOT_OVERRIDABLE`, and the sentence names the base's pair: save it into `?package=<base>.custom`, declaring `overrides` ([above](#customizing-an-installed-package-the-paired-custom-override-adr-0146)); for an item a kernel package (scope `system` or `cloud`) ships, the same write is refused with a sentence that names no pair, because kernel objects are not customizable in this version and a kernel package has no pair. A package-less row stored before the close is still served until `os migrate packageless-overlays` moves it into the pair as a declared override; the ✅ row is now the set that ceremony moves and the read path honours for an unmoved row. A package-less write of a name no package ships is environment metadata, and stays open. So does the package-less write of a view container (`list` and `listViews`; since protocol 19 a write that carries a `form` or `formViews` member is refused `422 INVALID_METADATA` with a prescription naming `forms:`, and the members a row stored before it still holds are moved to `form` rows by `os migrate protocol --to 19 --apply`): only a single view declares an override, so the ceremony lists the container and leaves it, and its views move into the pair one by one, each as a single view.
> **ADR-0146 D11 — the tier no longer opens a write door onto a packaged item.** A write naming no package — a save, a publish, a reset (`DELETE`) or a rollback — onto a ✅-type item that one installed read-only package ships is refused `403 NOT_OVERRIDABLE`, and the sentence names the base's pair: save it into `?package=<base>.custom`, declaring `overrides` ([above](#customizing-an-installed-package-the-paired-custom-override-adr-0146)); for an item a kernel package (scope `system` or `cloud`) ships, the same write is refused with a sentence that names no pair, because kernel objects are not customizable in this version and a kernel package has no pair. A package-less row stored before the close is still served until `os migrate packageless-overlays` moves it into the pair as a declared override; the ✅ row is now the set that ceremony moves and the read path honours for an unmoved row. A package-less save of a name no package ships stays open only for an item already stored that way, saved in place; a new item is saved into a writable package, and the kernel refuses a package-less create `422 WRITABLE_PACKAGE_REQUIRED` (ADR-0070 D1). So does the package-less write of a view container (`list` and `listViews`; since protocol 19 a write that carries a `form` or `formViews` member is refused `422 INVALID_METADATA` with a prescription naming `forms:`, and the members a row stored before it still holds are moved to `form` rows by `os migrate protocol --to 19 --apply`): only a single view declares an override, so the ceremony lists the container and leaves it, and its views move into the pair one by one, each as a single view.

| Type | `allowEnvironmentOverlay` | Rationale |
| :--- | :---: | :--- |
Expand Down
2 changes: 1 addition & 1 deletion content/docs/deployment/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ os compile --json # JSON output for CI pipelines
→ Normalizing stack definition...
→ Lowering inline handlers...
→ Validating protocol compliance...
→ Running author-time rules (89)...
→ Running author-time rules (90)...
→ Checking that every required capability has a provider installable in this edition...
→ Collecting package docs (ADR-0046)... 0 collected
→ Writing artifact...
Expand Down
2 changes: 1 addition & 1 deletion content/docs/deployment/validating-metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ A clean run walks the registry and reports timing:
Config: /path/to/support-desk/objectstack.config.ts
Load time: 21ms
→ Validating against ObjectStack Protocol...
→ Running author-time rules (89)...
→ Running author-time rules (90)...
→ Checking that every required capability has a provider installable in this edition...
→ Checking package docs (ADR-0046)...

Expand Down
Loading
Loading