Skip to content
Merged
Show file tree
Hide file tree
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
48 changes: 48 additions & 0 deletions .changeset/38150-studio-org-entry-retired.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
'@object-ui/app-shell': patch
'@object-ui/console': patch
'@object-ui/i18n': patch
---

feat(app-shell)!: Studio's package-less scope (`/studio/~org`) is retired and its addresses land on the Loose list of flows; in the App Studio list an item of a package you can write reads "New"

Clause-②: no (narrowing)
Metadata-protocol: none

<!-- adr-0087: not-required (no-migration-prescription) The removed operands are translation keys in the published i18n catalogues and two exports of a private package: no packages/spec schema, registered node type, stored metadata row or ADR-0087 conversion surface names them, and nothing a metadata author writes changes, so there is nothing for objectstack migrate meta to rewrite -->

Two changes to App Studio, both carrying out ADR-0084's amendment of 2026-11-26.

**Studio's package-less scope is retired.** The scope listed the flows that belong to no package ("Organization flows", 「组织流程」) at `/studio/~org`. The amendment retires it once the door that moves a selection of loose items into a package has shipped. It has: the door is the "Loose" source value of Studio's cross-package list (`/studio/~all/metadata/TYPE?source=loose`), where a person selects loose items of any type and moves them into a package. The same amendment retired the all-at-once adoption of loose items; that went in a change of its own (objectstack#38545), with its own entry. With the scope gone too, an item that belongs to no package is listed, and moved into a package, on the Loose list.

- Every `/studio/~org/…` address still opens. It lands on the Loose list of flows, `/studio/~all/metadata/flow?source=loose`. That is one target for the scope's list, a flow's own address and its `/history`, the old `/studio/~org/automations` deep links, and a `?package=~org` link on another address. The list's search (`q`) and sort (`sort`) are kept and every other query key is dropped. A flow's old address lands on the list, not on the flow.
- A flow that belongs to no package is found on that list, and its row opens the flow's page at `/studio/~all/metadata/flow/NAME`. It no longer opens in the flow designer; move it into a package to design it there. A package's address that names such a flow opens the same page.
- Studio's left menu has no "Organization flows" row any more (it sat under Automation, inside the Advanced fold on a package), and Studio's command palette no longer lists it. A package-less flow that the app's command palette finds opens its page.
- The scope's "Changes" row and the batch publish behind it are gone. A draft that belongs to no package is published by Home's "Publish all", or published or discarded on its own page.
- A person who can enter Studio but cannot open Setup → Packages, and has no recent package, lands on the Loose list of flows. They landed on the package-less scope before. Home's "New blank app" leads the same person to the same list.
- On the "package not found" page, the way out for a person who cannot open Setup → Packages reads "Open loose flows" (「打开散落的流程」) and opens that list. It read "Open organization flows" (「打开「组织流程」」).

**In the App Studio list, an item of a package you can write reads "New" (「新建」).** The list's Source column drew an item of a package authored in Studio as "System-shipped" (「系统自带」), because such an item is served under its package's id, as an item a code package ships is. The list now also reads the package list's `writable` verdict, which the server computes: an item of a writable package reads "New". The source filter and its counts, and the previous / next order of an item's page, read the same classification, so "Modified and new" holds those items and "System-shipped" does not. An item of a read-only package still reads "System-shipped", and a customized one still reads "Modified". Setup's metadata list is unchanged: it shows the source as served.

**BREAKING**: nine keys leave the `studio` namespace of `@object-ui/i18n`, in `en` and `zh`. The retired scope was their only reader.

- `engine.studio.menu.orgFlows`
- `engine.studio.pkg.orgScope`
- `engine.studio.org.name`
- `engine.studio.org.hint`
- `engine.studio.org.description`
- `engine.studio.org.none`
- `engine.studio.publishedAllFlows`
- `engine.studio.publishedAllFlowsOne`
- `engine.studio.changes`

If a deployment overrides one of these keys (in its own i18next resources, or a Studio catalogue it registers), the override no longer applies: nothing in the console or Studio asks for the key. Remove the override. `engine.studio.notFound.allMetadata` keeps its key and changes its text, as above; an override of it still applies, and now names the link to the Loose list.

For a host that declares the `/studio` routes itself, the two names `@object-ui/app-shell` exported for the scope are replaced:

| before | after |
|:--|:--|
| `STUDIO_ORG_SCOPE_SEGMENT` | `RETIRED_ORG_SCOPE_SEGMENT`. The segment `~org` stays reserved: it can name no package |
| `studioOrgScopePath()` | `retiredOrgScopeTarget(search)`, the one address every `/studio/~org/…` address lands on |

The fix in one line: link to `/studio/~all/metadata/flow?source=loose` where a link opened `/studio/~org/…`. Old links keep working through the redirect.
6 changes: 4 additions & 2 deletions docs/adr/0070-package-first-authoring.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ADR-0070: Package-first authoring — every runtime-authored item lives in a writable package (base); no orphans

**Status**: Accepted (2026-06-24) — P1–P3 implemented, merged & live-verified (see *Implementation status*); D4–D6 remaining · **Superseded in part by [ADR-0146](./0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md)** (2026-10-31) — D3's prompt to create a base, for the paired case only: a customer's first customization of an installed base lands in the auto-created `<base>.custom` package without a prompt (ADR-0146 D3); D5's destination for a package-less overlay row of a packaged item: the base's `<base>.custom`, as a declared override, after which the package-less write closes (ADR-0146 D11). D1, D2, D4 and D6 stand; D3's prompt stands everywhere else. · **Amended** (2026-10-31, [#28117](https://github.com/objectstack-ai/objectstack/issues/28117) — the maintainer's ruling of 2026-10-30, 「大包 + 设置里启用模块」, then 「同意」: a `type: module` sub-package of an installed app may be **disabled**, not authored into, by an admin, on the tie PR [#28308](https://github.com/objectstack-ai/objectstack/pull/28308) shipped; see the amendment note under D2. D2's two kinds and its writability predicate stand.)
**Status**: Accepted (2026-06-24) — P1–P3 implemented, merged & live-verified (see *Implementation status*); D4–D6 remaining · **Superseded in part by [ADR-0146](./0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md)** (2026-10-31) — D3's prompt to create a base, for the paired case only: a customer's first customization of an installed base lands in the auto-created `<base>.custom` package without a prompt (ADR-0146 D3); D5's destination for a package-less overlay row of a packaged item: the base's `<base>.custom`, as a declared override, after which the package-less write closes (ADR-0146 D11). D1, D2, D4 and D6 stand; D3's prompt stands everywhere else. · **Amended** (2026-10-31, [#28117](https://github.com/objectstack-ai/objectstack/issues/28117) — the maintainer's ruling of 2026-10-30, 「大包 + 设置里启用模块」, then 「同意」: a `type: module` sub-package of an installed app may be **disabled**, not authored into, by an admin, on the tie PR [#28308](https://github.com/objectstack-ai/objectstack/pull/28308) shipped; see the amendment note under D2. D2's two kinds and its writability predicate stand.) · **Amended** (2026-11-29, [#38150](https://github.com/objectstack-ai/objectstack/issues/38150) — ruling record [comment 7184753035](https://github.com/objectstack-ai/objectstack/issues/37424#issuecomment-7184753035), question 3, ruled C, as [ADR-0084](./0084-application-builder-information-architecture.md#amendment-2026-11-26-org) records it: D5's "move into a base" is the move-in door, and D5's bulk assignment to a default base is superseded; see the amendment note under D5. D1 and D6 stand.)
**Deciders**: ObjectStack Protocol Architects
**Builds on**: [ADR-0005](./0005-metadata-customization-overlay.md) (`allowOrgOverride` / runtime overlay model; one Zod source per type), [ADR-0048](./0048-cross-package-metadata-collision.md) (one app per package; package id is the addressing unit), [ADR-0033](./0033-ai-assisted-metadata-authoring.md) (AI authors metadata as drafts), [ADR-0067](./0067-commit-history-and-rollback-for-ai-authoring.md) (commit history & rollback for AI authoring)
**Consumers**: `@objectstack/objectql` (`protocol.saveMetaItem` write path), `@objectstack/spec` (metadata-type registry), `../objectui` (Studio create flow, package scope selector, `PackagesPage`), `../cloud` (`service-ai-studio` — `create_metadata` / `resolvePackageId` / `apply_blueprint`)
Expand Down Expand Up @@ -30,7 +30,7 @@ Built across the three surfaces and verified end-to-end in a real environment vi
2. **[existing->ruled] Two package kinds.** *Code/installed* packages (manifest `source: 'filesystem'` / installed via marketplace) are **read-only** — you may org-overlay an item where `allowOrgOverride` (ADR-0005), but you may **not** author *new* items into them. *Writable* packages (DB-backed, user/AI-created "bases") are the only authoring targets.
3. **[new] Create-flow contract — "pick or create a base first".** Before any create, all three surfaces (Studio UI, the AI authoring tools, the kernel write path) resolve to a writable package or **prompt to create one** — no silent default. This is enforced in code, not just prompt guidance.
4. **[new] The package is the lifecycle unit.** Delete (cascade all its items + data), export, snapshot/version, and duplicate operate on a whole package. This is the answer to "how do I delete the mess."
5. **[ruled] Retire the stopgaps.** #2252's null-coercion evolves into *redirect-to-a-writable-package*; #1946's "Local / Custom" scope becomes a **migration affordance** ("move these loose items into a base") and is then removed.
5. **[ruled] Retire the stopgaps.** #2252's null-coercion evolves into *redirect-to-a-writable-package*; #1946's "Local / Custom" scope becomes a **migration affordance** ("move these loose items into a base") and is then removed. *(Amended 2026-11-29, [#38150](https://github.com/objectstack-ai/objectstack/issues/38150): "move these loose items into a base" is the move-in door — the amendment note under D5.)*

---

Expand Down Expand Up @@ -87,6 +87,8 @@ Operating on a *base* operates on all of its contents — this is the direct ans
- The objectui #1946 *"Local / Custom"* scope is repurposed as a **one-time migration surface**: it lists the legacy package-less items and offers "move into a base" (assign them a writable `package_id`). Once an environment has no orphans, the scope is removed from the selector.
- A small migration (or admin action) can bulk-assign legacy orphans to a default base named for the environment.

> **Amended 2026-11-29 ([#38150](https://github.com/objectstack-ai/objectstack/issues/38150), ruling record [comment 7184753035](https://github.com/objectstack-ai/objectstack/issues/37424#issuecomment-7184753035), question 3, ruled C; written into [ADR-0084's amendment of 2026-11-26](./0084-application-builder-information-architecture.md#amendment-2026-11-26-org)) — "move into a base" is the move-in door, and the bulk assignment to a default base is superseded.** TL;DR item 5's "move these loose items into a base" and this decision's `offers "move into a base"` are one door, and it shipped: `POST /api/v1/packages/:id/move-in` moves a selection of loose items — one, several, or all — into a writable package, each through the judges a save runs. The third bullet above, "A small migration (or admin action) can bulk-assign legacy orphans to a default base named for the environment", is superseded by that ruling: nothing is renamed or migrated, and there is no catch-all package. A row that is never moved stays legal: it belongs to the implicit environment package ([ADR-0150](./0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md) D1, the fourth bucket).

### D6 — Single-tenant framing; no "org" dumping ground [ruled]

A metadata-customizable deployment is **single-tenant** (an *environment*; `project -> environment`); there is no per-org overlay dimension here. The relevant axis is **code package vs writable base**, not "org". The earlier instinct to make a package-less "org/local" scope the *default* is explicitly rejected: it reproduces the orphan pile. (Multi-tenant hosting keeps `package_id = null` overlays as a *tenant-overlay* mechanism; that is orthogonal and out of scope for this ADR.)
Expand Down
Loading
Loading