diff --git a/.changeset/38150-studio-org-entry-retired.md b/.changeset/38150-studio-org-entry-retired.md
new file mode 100644
index 00000000000..55e051e814f
--- /dev/null
+++ b/.changeset/38150-studio-org-entry-retired.md
@@ -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
+
+
+
+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.
diff --git a/docs/adr/0070-package-first-authoring.md b/docs/adr/0070-package-first-authoring.md
index 2c7c8ff30ef..92cbda4ff9f 100644
--- a/docs/adr/0070-package-first-authoring.md
+++ b/docs/adr/0070-package-first-authoring.md
@@ -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 `.custom` package without a prompt (ADR-0146 D3); D5's destination for a package-less overlay row of a packaged item: the base's `.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 `.custom` package without a prompt (ADR-0146 D3); D5's destination for a package-less overlay row of a packaged item: the base's `.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`)
@@ -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.)*
---
@@ -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.)
diff --git a/docs/adr/0084-application-builder-information-architecture.md b/docs/adr/0084-application-builder-information-architecture.md
index 6a0b8913c50..f9cfd10691a 100644
--- a/docs/adr/0084-application-builder-information-architecture.md
+++ b/docs/adr/0084-application-builder-information-architecture.md
@@ -234,7 +234,7 @@ The menu also holds four entries that open no type's list. Each sits in the grou
| Entry | Group | Source |
|---|---|---|
-| **The organization's own flows** — the flows that belong to no package (the `~org` scope) | 自动化 Automation | decision 11 |
+| ~~**The organization's own flows** — the flows that belong to no package (the `~org` scope)~~ | ~~自动化 Automation~~ | ~~decision 11~~ |
| **The organization-wide default sharing overview** — a page with a route of its own, not a metadata item | 访问 Access | decision 11 |
| **Diagnostics** | 平台 Platform | decision 11 |
| **The cross-package environment directory** (the `~all` leg) | 访问 Access | **drafted here, not ruled** — [item 1](#amendment-silent) below |
@@ -243,6 +243,8 @@ The menu also holds four entries that open no type's list. Each sits in the grou
*(Amended 2026-11-26, card [#37451](https://github.com/objectstack-ai/objectstack/issues/37451): on a package the menu holds one more entry that opens no type's list — **概览 Overview**, the open package's own page, the menu's first row, above the groups, under no group and in no tier ([Amendment (2026-11-26)](#amendment-2026-11-26-overview)). One row of the table above leaves the menu for Setup: the cross-package environment directory, for a Setup group that holds access pages. Diagnostics stays, and on a package it reads that package. The organization's own flows keep their entry until the door that moves loose items into a package ships, and retire with it. The default sharing overview and 全部类型 All types stay ([Amendment (2026-11-26)](#amendment-2026-11-26-moves)).)*
+*(Amended 2026-11-29, card [#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: the table's first row is struck. The door that moves loose items into a package shipped, and the organization's own flows retired with it, the entry and the scope it opened alike ([Organization-level content](#amendment-2026-11-26-org)). Items that belong to no package are listed under the "Loose" value of the cross-package list's source filter, and a flow among them opens on its own page there.)*
+
### What stands, and what the amendment replaces {#amendment-stands}
| The 2026-07-01 text | Since the amendment |
@@ -298,7 +300,7 @@ A group's label is drawn in a tier only where the group has an entry in that tie
The four [entries that are not a type](#entries-not-a-type) are 高级 on a package. Each is drawn after the types of its group, the default sharing overview before the cross-package directory — where the menu adds them today (§3.4).
-The tiers belong to a package's menu. The package-less scope (`~org`) and the cross-package leg (`~all`) draw no fold: the same labels and the same order, flat (§3.8).
+The tiers belong to a package's menu. ~~The package-less scope (`~org`) and the cross-package leg (`~all`) draw no fold~~ The cross-package leg (`~all`) draws no fold: the same labels and the same order, flat (§3.8). *(Amended 2026-11-29, card [#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: the sentence named two scopes that draw no fold. The package-less scope retired with its entry ([Organization-level content](#amendment-2026-11-26-org)), so it names one.)*
*(Amended 2026-11-26: the two tiers and the rule below stand, and the ten 常用 types keep their places. Three types join them, each placed by name: `dataset` and `position`, and `form`, a type not yet registered, once Studio lists it — thirteen in all. 概览 Overview is drawn above the tiers and belongs to neither. Of the four entries that are not a type, the cross-package directory is to leave the menu. See [Amendment (2026-11-26)](#amendment-2026-11-26-moves).)*
@@ -308,7 +310,7 @@ The rule is the proposal's (§3.1), ruled as proposed. A type is **常用** only
1. **It has no parent object.** Its schema does not require one object. A type bound to one object is authored from that object.
2. **A builder makes it directly, as a step of building an app.** It is not reference content, and not developer or operator work.
-3. **It stays inside the open package.** An entry that leaves the package's scope — the organization's own flows, the cross-package directory — is 高级 on a package.
+3. **It stays inside the open package.** An entry that leaves the package's scope — ~~the organization's own flows,~~ the cross-package directory — is 高级 on a package. *(Amended 2026-11-29, card [#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: the first of the sentence's two examples is struck. The organization's own flows retired with their scope ([Organization-level content](#amendment-2026-11-26-org)), so the menu draws no such entry. The other example, the cross-package directory, is the entry the 2026-11-26 amendment moved to Setup ([Amendment (2026-11-26)](#amendment-2026-11-26-moves)). The test stands as ruled.)*
**A type with no row in the table is drawn in 高级, at the end of its group. It is never invisible.**
@@ -332,7 +334,7 @@ Merging accepts them; an objection names the number.
1. **The order of the types the proposal's list does not write out.** Its ordered list (§3.4) is written out for the 数据 Data and 界面 UI types and stops there. The Order column takes the rest from the proposal's drawing of the open fold (§3.2) and, for a type that drawing does not show, from the row order of its per-type table (§2), reading a row that names several types left to right. That places `job` after `flow`; `translation` · `api` · `datasource` · `external_catalog`, in that order, after `email_template`; and `sharing_rule` · `queue` · `capability`, in that order, after `assignment_rule`.
2. **Where `picklist` sits inside 高级.** The maintainer moved it between the tiers and named no place. It keeps the place the proposal's list gave it, second in 数据 Data, which makes it the first 高级 entry of that group.
-3. **Where the four entries that are not a type sit.** After the types of their group, as §3.4 leaves them. The proposal's per-type table (§2) lists the organization's own flows between `flow` and `job`; this record follows §3.4, so on a package that holds a `job`, that type's entry is drawn above the organization's flows.
+3. **Where the four entries that are not a type sit.** After the types of their group, as §3.4 leaves them. ~~The proposal's per-type table (§2) lists the organization's own flows between `flow` and `job`; this record follows §3.4, so on a package that holds a `job`, that type's entry is drawn above the organization's flows.~~ *(Amended 2026-11-29, card [#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: the second sentence is struck. It placed the organization's own flows, which retired with their scope ([Organization-level content](#amendment-2026-11-26-org)). Of the four entries this item counts, a package's menu draws two since: the default sharing overview and diagnostics. The cross-package directory is the one the 2026-11-26 amendment moved to Setup ([Amendment (2026-11-26)](#amendment-2026-11-26-moves)). The first sentence stands for those two.)*
4. **The tiers' English names.** The ruling names the tiers in Chinese. This record writes Common and Advanced, after the two values of the proposal's list (§3.4).
5. **The table's shape.** One row per type, so that each type carries its own order and tier. Order counts inside a group, because the order of the groups is the six-group table's.
6. **~~A type registered after the ruling was written: `ai_context`.~~ Types registered after the ruling was written: `ai_context`, and since then `knowledge_source`.** *(Heading reworded 2026-11-27, for the second row that points here; the note that ends this item says what changed.)* The proposal and the ruling were made on a registry of 32 types. `ai_context`, the context pack of [ADR-0160](./0160-record-scoped-ai-inquiry.md) D1, was registered under `ai` the same day, after both. The maintainer's words on AI are 「AI 应该提到第一层分类,放在最下面」, and the ruling record lists the group's 常用 types as 智能体 · 工具 · 技能: three types, and not this one. Three ruled sentences place it, and they agree: its schema requires one root object, so the first test of the rule sorts it 高级; 高级 holds every type the ruling does not list as 常用; and a type with no row is drawn at the end of its group. The table writes that down as a row — last in AI, 高级 — so that the placement list has a row to mirror. If every AI type is meant to be 常用, the tier of this one row is the word to change. *(Amended 2026-11-27, card [#37740](https://github.com/objectstack-ai/objectstack/issues/37740), which decides nothing: a second type has been registered under `ai` since the ruling — `knowledge_source`, on 2026-11-27 ([ADR-0161](./0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md) K4) — and the change that registered it wrote its row under this item: fifth in AI, 高级. So `ai_context`'s row is the fourth, and no longer the last in AI. The ruling record's list of the group's 常用 types, 智能体 · 工具 · 技能, does not name this type either, and the same three sentences place it: its schema requires one object (the `object` key of its `source`, `packages/spec/src/ai/knowledge-source.zod.ts#ObjectKnowledgeSourceSchema`), so the first test of the rule sorts it 高级; 高级 holds every type the ruling does not list as 常用; and a type with no row is drawn at the end of its group. The sentence before this note holds for each of the two rows: if every AI type is meant to be 常用, the tier of that row is the word to change.)*
@@ -414,13 +416,15 @@ The top bar is drawn by `ui/packages/app-shell/src/views/studio-design/StudioDes
| The way back to the app, with the app's name | The first control of the package row; the name is shown by the switcher beside it | the pick |
| The ⋯ package menu (`ui/packages/app-shell/src/views/studio-design/StudioPackageMenu.tsx#STUDIO_PACKAGE_MENU_ITEMS`) | The header of 概览 Overview, moved as it is | the pick |
| The pending-changes button with its count, and Publish | The Pending tab of 概览 Overview. The count is a badge on the menu's 概览 row, and one click on it opens that tab | the pick |
-| The same button and Publish on the package-less scope (`~org`), which draws no 概览 | A 变更 Changes row with its count, in the left column under the package row (`ui/packages/app-shell/src/views/studio-design/StudioTopLeft.tsx#StudioScopePendingRow`), drawn only while that scope has something pending. It opens the changes sheet that exists, and Publish is in that sheet | not ruled — the note below |
+| ~~The same button and Publish on the package-less scope (`~org`), which draws no 概览~~ | ~~A 变更 Changes row with its count, in the left column under the package row (`ui/packages/app-shell/src/views/studio-design/StudioTopLeft.tsx`), drawn only while that scope has something pending. It opens the changes sheet that exists, and Publish is in that sheet~~ | ~~not ruled — the note below~~ |
| Save and Cancel, drawn while a page has unsaved edits | The action slot of the item's header (`ui/packages/app-shell/src/views/studio-design/StudioItemHeader.tsx#StudioItemHeader`) | the pick |
| The AI assistant button, and the toggle of the right-hand panel | The right end of each page's title row — a list's title row, an item's header — where an app's page carries its own (`ui/packages/app-shell/src/layout/ShellPageActions.tsx#ShellPageActions`) | the pick |
| The control that shows and hides the menu | Studio's row | decision 3 |
| For a package with no app: the "create app" button, or the label that says its app waits for a publish | None — [item 5](#amendment-2026-11-26-silent) | not ruled |
-*(Amended 2026-11-27, card [#37685](https://github.com/objectstack-ai/objectstack/issues/37685): the table gains its fourth row — where Changes and Publish live on the package-less scope. The pick sends them to 概览, and `~org` draws no 概览 ([item 1](#amendment-2026-11-26-silent)), so card [#37456](https://github.com/objectstack-ai/objectstack/issues/37456), which removed the top bar, gave that scope a row of its own. The row is written from the code, read at `origin/main` `73d5e347`: it is drawn on `~org` alone, it counts the drafts of the organization's own flows, the rail keeps it as an icon, and the sheet it opens is `ui/packages/app-shell/src/preview/DraftChangesPanel.tsx#DraftChangesPanel`. No ruling gives this home: it was built first and is recorded after the fact, as that change's contract review asked ([comment 7202356468](https://github.com/objectstack-ai/objectstack/pull/37579#issuecomment-7202356468), finding S3). Merging this note accepts it. The top bar still held seven things: the row is a second home for the third, on a scope where its first is not drawn. No other row changes.)*
+~~*(Amended 2026-11-27, card [#37685](https://github.com/objectstack-ai/objectstack/issues/37685): the table gains its fourth row — where Changes and Publish live on the package-less scope. The pick sends them to 概览, and `~org` draws no 概览 ([item 1](#amendment-2026-11-26-silent)), so card [#37456](https://github.com/objectstack-ai/objectstack/issues/37456), which removed the top bar, gave that scope a row of its own. The row is written from the code, read at `origin/main` `73d5e347`: it is drawn on `~org` alone, it counts the drafts of the organization's own flows, the rail keeps it as an icon, and the sheet it opens is `ui/packages/app-shell/src/preview/DraftChangesPanel.tsx#DraftChangesPanel`. No ruling gives this home: it was built first and is recorded after the fact, as that change's contract review asked ([comment 7202356468](https://github.com/objectstack-ai/objectstack/pull/37579#issuecomment-7202356468), finding S3). Merging this note accepts it. The top bar still held seven things: the row is a second home for the third, on a scope where its first is not drawn. No other row changes.)*~~
+
+*(Amended 2026-11-29, card [#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: the fourth row and the note above are struck. The package-less scope retired with its entry ([Organization-level content](#amendment-2026-11-26-org)), and its 变更 Changes row and the batch publish behind that row retired with it. The row's component, `StudioScopePendingRow`, is deleted, so the struck row names its file alone. A draft that belongs to no package is still published from Home's Publish all, and is published or discarded on its own item page. The first three rows stand.)*
Decision 3 says the ⋯ menu "is removed". It is read with decision 9 and the pick: the menu leaves the top left, and its rows live on in 概览's header.
@@ -458,7 +462,7 @@ Decision 12 draws the line: **Studio develops one package; Setup runs the organi
**The rule of 2026-11-25 is not reworded.** It says that where the maintainer places a type by name, the name decides, and it carried two such placements: `picklist` in 高级, and the three AI types in 常用. `dataset`, `position` and `form` are three more, each in 常用. The three tests still sort every type that no ruling names.
-Of the four entries that are not a type, then, one leaves. Diagnostics stays. The organization's own flows (`~org`) keep their entry in 自动化 Automation until the door that moves loose items into a package ships, and retire with it ([Organization-level content](#amendment-2026-11-26-org)). The organization-wide default sharing overview stays in 访问 Access.
+Of the four entries that are not a type, then, one leaves. Diagnostics stays. ~~The organization's own flows (`~org`) keep their entry in 自动化 Automation until the door that moves loose items into a package ships, and retire with it ([Organization-level content](#amendment-2026-11-26-org)).~~ *(Amended 2026-11-29, card [#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: the door shipped, and the organization's own flows retired with it — [Organization-level content](#amendment-2026-11-26-org).)* The organization-wide default sharing overview stays in 访问 Access.
Decision 12 also says how the two surfaces speak of each other: whose sharing rules, queues and assignment rules each side shows; a position defined in Studio and assigned in Setup, linked both ways; one vocabulary for a package's source and state. None of that changes a place in the menu, and it is left to its cards.
@@ -481,6 +485,8 @@ Decision 11 of the epic, as ruled on its questions 2 and 3 (maintainer: 「同
- **Loose items stay where they are, and one door moves them** (question 3, ruled C). An item that belongs to no package stays legal: it belongs to the implicit environment package (ADR-0150 D1, the fourth bucket), and nothing is renamed or migrated. One new door moves a selection — one item, several, or all — into a package, and runs each through the judges a save runs, judging the selection as a set for the cross-boundary rule of ADR-0150 D3 (a). It reuses the list page that exists. When that door ships, the bulk adopt and Studio's `~org` entry retire together. This replaces the page that sorts loose items one by one, which decisions 11 and 12 planned. Where the new door is opened from is its card's to say.
- **What this changes in the menu.** The organization's own flows keep their entry in 自动化 Automation until the door ships. The ⋯ menu keeps "adopt loose items" until then, and loses it then.
+*(Amended 2026-11-29, card [#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: the door shipped, and the bullets above are left as the ruling wrote them. The door is `POST /api/v1/packages/:id/move-in`. Its card opened it from the cross-package list: the "Loose" value of that list's source filter, `/studio/~all/metadata/TYPE?source=loose`, which a banner on Setup's Packages page links to for each type that holds a loose item. Studio's `~org` entry retired with the door, and the scope with it: the menu row, the scope's list, the scope's flow page (the flow designer, which opened a flow of no package full-screen), its 变更 Changes row and the batch publish behind that row. A flow that belongs to no package opens on its item page on the cross-package leg, `/studio/~all/metadata/flow/NAME`, and is still saved in place there; the flow designer opens on a package's flow. Every `/studio/~org/…` address lands on the Loose list of flows, `/studio/~all/metadata/flow?source=loose`. The bulk adopt is retired by a change of its own under that card ([#38545](https://github.com/objectstack-ai/objectstack/pull/38545)), not by the one that retired this entry. ADR-0070's D5 carries its mark of the same date, as the paragraph below asks.)*
+
ADR-0070 is not edited by this amendment. Where the ruling restates its D1 and D5, the phase-4 cards that carry the ruling out owe that record its marks.
### What the amendment replaces, and what stands {#amendment-2026-11-26-stands}
@@ -507,9 +513,9 @@ ADR-0070 is not edited by this amendment. Where the ruling restates its D1 and D
Merging accepts them; an objection names the number.
-1. **Where 概览 sits.** Decision 6 says it is the first entry. Written here: above the six groups, under no group and in no tier, drawn on every package and never folded. The package-less scope (`~org`) and the cross-package leg (`~all`) open no package and draw no 概览.
+1. **Where 概览 sits.** Decision 6 says it is the first entry. Written here: above the six groups, under no group and in no tier, drawn on every package and never folded. ~~The package-less scope (`~org`) and the cross-package leg (`~all`) open no package and draw no 概览.~~ The cross-package leg (`~all`) opens no package and draws no 概览. *(Amended 2026-11-29, card [#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: the sentence named two scopes. The package-less scope retired with its entry ([Organization-level content](#amendment-2026-11-26-org)), so it names one.)*
2. **What the package row names.** The 2026-11-24 ruling stands: the open package is named by its app where it publishes one, and by its own name where it does not. The switcher's rows are named the same way. Decision 8 speaks of "the app name in the switcher row", which agrees.
-3. **What the switcher lists, and where it lands.** It lists packages and nothing else: a pair is folded under its base, and `~org` and `~all` are not rows of it. Picking a package opens that package's 概览. Weighed and not taken: the list of the type the person was on, which the other package may not hold.
+3. **What the switcher lists, and where it lands.** It lists packages and nothing else: a pair is folded under its base, and ~~`~org` and `~all` are not rows of it~~ `~all` is not a row of it. *(Amended 2026-11-29, card [#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: the package-less scope retired with its entry ([Organization-level content](#amendment-2026-11-26-org)), so one scope is left that is not a row.)* Picking a package opens that package's 概览. Weighed and not taken: the list of the type the person was on, which the other package may not hold.
4. **Below 768 px.** The menu is a drawer there, and something must open it. "No top bar" is read as from 768 px up, the way ADR-0146 D5's note reads the app's shell. Below that width the frame keeps what the app's shell keeps: a strip that holds the control which opens the drawer.
5. **The top bar's seventh tenant.** For a package with no app, the bar draws a "create app" button, or a label that says the app waits for a publish. No ruling gives them a home, and this record gives them none. 应用 `app` is a 常用 row, drawn "whether the package holds one or not, so a package without one still shows where the first is made" (2026-11-25), and an app that waits for a publish is counted on Pending. They go with the bar.
6. **Save and Cancel on a page that saves and is not an item.** The pick puts them in the item's header. A page with unsaved edits and no item header — the default sharing overview is one — carries them at the right end of its own title row.
diff --git a/docs/qa/platform-checklist/FOLLOW-UPS.md b/docs/qa/platform-checklist/FOLLOW-UPS.md
index 22cb11170e6..feead8af512 100644
--- a/docs/qa/platform-checklist/FOLLOW-UPS.md
+++ b/docs/qa/platform-checklist/FOLLOW-UPS.md
@@ -1441,3 +1441,7 @@ listed in `releaseSweeps` with why.
### 19d. Security note
No security finding was made, and none is withheld.
+
+## 20. Checklist drift 2026-11-29 — Studio's package-less scope is retired (#38150)
+
+Not a sweep: one follow-up, recorded by the change that retired the scope (ADR-0084's amendment of 2026-11-26, `#amendment-2026-11-26-org`), which edited no item. Every `/studio/~org/…` address now lands on `/studio/~all/metadata/flow?source=loose`, a flow that belongs to no package opens on its item page on the cross-package leg and not in the flow designer, and the scope's Changes row and batch publish are gone, so the live text of five items no longer describes the product: `studio-authoring.org-scope-flows` (the whole item: its title, steps[0], [4] and [5] and its three acceptance clauses describe the retired scope, so it is re-authored against the Loose list or retired), `automation.flow-run-step-nesting` steps[4], `automation.flow-error-handling` fixtures.requires[1], `automation.packaged-flow-clone-contract` steps[7], acceptance[6].verify and negative[4], and `integration-system.flow-connector-picker` steps[1]; `automation.flow-node-type-matrix` names the scope in a history row only and needs nothing. Each is re-measured with the product running before its text is changed.
diff --git a/ui/apps/console/src/components/StudioRoute.lazyBuilder-11798.test.tsx b/ui/apps/console/src/components/StudioRoute.lazyBuilder-11798.test.tsx
index a727a667d39..6f62194f661 100644
--- a/ui/apps/console/src/components/StudioRoute.lazyBuilder-11798.test.tsx
+++ b/ui/apps/console/src/components/StudioRoute.lazyBuilder-11798.test.tsx
@@ -87,7 +87,6 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
RedirectWithSplash: () =>
,
LoadingFallback: () => ,
LoadingScreen: () => ,
- STUDIO_ORG_SCOPE_SEGMENT: '~org',
getProductName: () => 'ObjectOS',
useHomePath: () => '/home',
}));
diff --git a/ui/apps/console/src/components/StudioRoute.metadataArea-28561.test.tsx b/ui/apps/console/src/components/StudioRoute.metadataArea-28561.test.tsx
index 6c17ff90218..0e46ab55275 100644
--- a/ui/apps/console/src/components/StudioRoute.metadataArea-28561.test.tsx
+++ b/ui/apps/console/src/components/StudioRoute.metadataArea-28561.test.tsx
@@ -204,8 +204,9 @@ describe('/studio — the "All metadata" area\'s routes (objectstack#28561)', ()
it.each([
'/studio/~all/metadata',
'/studio/com.example.crm/metadata',
- // objectstack#36899 — the left menu's targets that are not an area list.
+ // objectstack#38150 — the retired package-less scope's addresses redirect, and only past the gate.
'/studio/~org/automations',
+ '/studio/~org/metadata/flow?source=runtime',
// objectstack#36905 — the sharing overview's own route, and the old address that redirects to it.
'/studio/com.example.crm/owd',
'/studio/com.example.crm/access?surface=owd%3Aoverview',
@@ -255,10 +256,21 @@ describe('/studio — every retired pillar address redirects once, to its new ad
[`/studio/${PAIR}/access`, `/studio/${PKG}/metadata/permission?package=${PKG}`],
[`/studio/${PKG}/interfaces?surface=page%3Ahome`, `/studio/${PKG}/metadata/object?package=${PKG}`],
[`/studio/${PAIR}/interfaces`, `/studio/${PKG}/metadata/object?package=${PKG}`],
- // The package-less scope: its bare leg and its one pillar.
- ['/studio/~org', '/studio/~org/metadata/flow?source=runtime'],
- ['/studio/~org/automations', '/studio/~org/metadata/flow?source=runtime'],
- ['/studio/~org/automations?surface=flow%3Aclone_1', '/studio/~org/metadata/flow/clone_1?source=runtime'],
+ // objectstack#38150 — the retired package-less scope: its bare leg, the pillar it had, a
+ // flow that pillar named, its leg of the area (the list, a flow, a flow's history), and an
+ // address with other query keys. One target, the Loose list of flows; the list's search kept.
+ ['/studio/~org', '/studio/~all/metadata/flow?source=loose'],
+ ['/studio/~org/automations', '/studio/~all/metadata/flow?source=loose'],
+ ['/studio/~org/automations?surface=flow%3Aclone_1', '/studio/~all/metadata/flow?source=loose'],
+ ['/studio/~org/data', '/studio/~all/metadata/flow?source=loose'],
+ ['/studio/~org/metadata', '/studio/~all/metadata/flow?source=loose'],
+ ['/studio/~org/metadata/flow?source=runtime', '/studio/~all/metadata/flow?source=loose'],
+ ['/studio/~org/metadata/flow/clone_1?source=runtime', '/studio/~all/metadata/flow?source=loose'],
+ ['/studio/~org/metadata/flow/clone_1/history?source=runtime', '/studio/~all/metadata/flow?source=loose'],
+ [
+ '/studio/~org/metadata/flow?source=runtime&q=clone&sort=label.desc&changes=review&package=~org',
+ '/studio/~all/metadata/flow?source=loose&q=clone&sort=label.desc',
+ ],
])('%s → %s, in one redirect', async (from, to) => {
renderStudio(from);
await waitFor(() => expect(location()).toBe(to));
diff --git a/ui/apps/console/src/components/StudioRoute.recentPackage-11863.test.tsx b/ui/apps/console/src/components/StudioRoute.recentPackage-11863.test.tsx
index b6ffba0a0f5..cda401b6792 100644
--- a/ui/apps/console/src/components/StudioRoute.recentPackage-11863.test.tsx
+++ b/ui/apps/console/src/components/StudioRoute.recentPackage-11863.test.tsx
@@ -193,9 +193,12 @@ describe('/studio/PKG/TAB records the package as a recent entry (objectui#11863)
expect(recent()).toEqual(JSON.parse(before ?? '[]'));
});
- it("the package-less scope is not a package, and Studio's entry is not a visit: neither records anything", async () => {
+ // objectstack#38150 — the package-less scope is retired: its address redirects to the Loose
+ // list of flows on the cross-package leg, which is no package either and records nothing.
+ it("the retired package-less scope's address is not a package, and Studio's entry is not a visit: neither records anything", async () => {
renderStudio('/studio/~org/automations');
await screen.findByTestId('studio-pillar-builder');
+ expect(screen.getByTestId('pathname').textContent).toBe('/studio/~all/metadata/flow');
cleanup();
renderStudio('/studio');
diff --git a/ui/apps/console/src/components/StudioRoute.test.tsx b/ui/apps/console/src/components/StudioRoute.test.tsx
index d6eb4391b5c..ee509e21a9d 100644
--- a/ui/apps/console/src/components/StudioRoute.test.tsx
+++ b/ui/apps/console/src/components/StudioRoute.test.tsx
@@ -379,20 +379,21 @@ describe('/studio/* — the entry decision, both ways', () => {
expect(screen.queryByText(NOTICE)).not.toBeInTheDocument();
});
- it('the package-less scope\'s bare leg lands on its flow list, the builder mounted (objectui#11553)', async () => {
- // `~org` is the reserved segment for the organization's own, package-less
- // flows. Without its own leg it falls to `:packageId`, whose redirect
- // targets an object list that scope does not have. objectstack#36909 — in
- // one hop, not through the retired Automations pillar's address.
+ // objectstack#38150 — rewritten on purpose: the package-less scope is retired. It landed on
+ // `/studio/~org/metadata/flow?source=runtime`, that scope's own flow list.
+ it('the retired package-less scope\'s bare leg lands on the Loose list of flows, the builder mounted (objectui#11553)', async () => {
+ // `~org` was the segment of the organization's own, package-less flows and
+ // stays reserved. Without its own leg it falls to `:packageId`, which would
+ // read it as a package id and open that package's overview.
answerWith(OPERATOR_CAPS);
renderStudioDeepLink('/studio/~org');
- await waitFor(() => expect(pathname()).toBe('/studio/~org/metadata/flow?source=runtime'));
+ await waitFor(() => expect(pathname()).toBe('/studio/~all/metadata/flow?source=loose'));
await waitFor(() => expect(screen.getByTestId('studio-pillar-builder')).toBeInTheDocument());
expect(designSurface).toHaveBeenCalled();
});
- it('the package-less scope is behind the same entry gate (objectui#11553)', async () => {
+ it('the retired package-less scope\'s addresses are behind the same entry gate (objectui#11553)', async () => {
renderStudioDeepLink('/studio/~org/automations');
await expectRefusedAt('/studio/~org/automations', '/home');
diff --git a/ui/apps/console/src/components/StudioRoute.tsx b/ui/apps/console/src/components/StudioRoute.tsx
index 290cfbfcbe3..bb6fec0339c 100644
--- a/ui/apps/console/src/components/StudioRoute.tsx
+++ b/ui/apps/console/src/components/StudioRoute.tsx
@@ -35,20 +35,20 @@
*/
import { lazy, Suspense, useEffect, type ReactNode } from 'react';
-import { Link, Navigate, Outlet, Route, useParams } from 'react-router-dom';
+import { Link, Navigate, Outlet, Route, useLocation, useParams } from 'react-router-dom';
import { Lock } from 'lucide-react';
import { Button, Empty, EmptyTitle } from '@object-ui/components';
import {
ACCESS_DIRECTORY_PATH,
LoadingFallback,
LoadingScreen,
+ RETIRED_ORG_SCOPE_SEGMENT,
STUDIO_ALL_PACKAGES_SEGMENT,
STUDIO_METADATA_AREA,
- STUDIO_ORG_SCOPE_SEGMENT,
StudioEntryPermissionsProvider,
holdsSetupAccess,
+ retiredOrgScopeTarget,
studioMetadataAreaPath,
- studioOrgScopePath,
studioPackagePath,
useHomePath,
usePhoneViewport,
@@ -194,8 +194,8 @@ export function StudioRoute() {
/**
* Bare `/studio` (objectstack#36908, epic #36890 decision 9): Studio's entry,
* which draws no page. It opens the package the author was last in, else the
- * package list: Setup → Packages for a principal who may open it, the "All
- * metadata" area across packages otherwise (`StudioEntryRedirect` in
+ * package list: Setup → Packages for a principal who may open it, the Loose
+ * list of flows on the cross-package leg otherwise (`StudioEntryRedirect` in
* app-shell). The package-card home it used to draw was removed; Studio is
* entered from an app or from Setup → Packages.
*/
@@ -219,14 +219,15 @@ function StudioEntry() {
* which lands on its 概览 Overview (`/studio/PKG/overview`) — and no label: a reader labels it from the
* package list it loads (objectui#11678's shape). Keyed on the package, not the
* page, so moving between pages of one package leaves the list as it is,
- * and the provider writes nothing. The package-less scope (`~org`) and the
- * cross-package leg (`~all`) are not packages and record nothing.
+ * and the provider writes nothing. The cross-package leg (`~all`) is not a
+ * package and records nothing; the retired `~org` segment never reaches this
+ * element (`StudioOrgScopeRetired`).
*/
function StudioPackageBuilder({ area }: { area?: typeof STUDIO_METADATA_AREA }) {
const { packageId } = useParams();
const { addRecentItem } = useRecentItems();
useEffect(() => {
- if (!packageId || packageId === STUDIO_ORG_SCOPE_SEGMENT || packageId === STUDIO_ALL_PACKAGES_SEGMENT) return;
+ if (!packageId || packageId === STUDIO_ALL_PACKAGES_SEGMENT) return;
addRecentItem({
id: `package:${packageId}`,
type: 'package',
@@ -261,6 +262,17 @@ function StudioAllLegAddress() {
return ;
}
+/**
+ * objectstack#38150 — the retired package-less scope (`/studio/~org/...`):
+ * every address of it lands on the Loose list of flows on the cross-package
+ * leg, keeping its search and sort (`retiredOrgScopeTarget` in app-shell).
+ * Decided here, before the builder's chunk is requested.
+ */
+function StudioOrgScopeRetired() {
+ const { search } = useLocation();
+ return ;
+}
+
function StudioPillarAddress({ children }: { children?: ReactNode }) {
return (
}>
@@ -279,7 +291,8 @@ function StudioPillarAddress({ children }: { children?: ReactNode }) {
* agree with itself while `App.tsx` quietly mounted the builder ungated.
*
* `/studio` Studio's entry: the last package, else the package list
- * `/studio/~org` the package-less scope lands on its flow list
+ * `/studio/~org/*` the retired package-less scope: every address of it lands
+ * on the Loose list of flows (objectstack#38150)
* `/studio/~all/*` lands on Setup's environment directory (objectstack#37565),
* or the cross-package area for one who may not open Setup
* `/studio/:packageId` a package lands on its 概览 Overview (a pair's, its base's)
@@ -288,19 +301,21 @@ function StudioPillarAddress({ children }: { children?: ReactNode }) {
* the builder (the sharing overview, `owd`, or
* the not-found state)
*
- * `~org` is the reserved segment for the organization's own, package-less
- * flows (objectui#11553; `studioScope.ts` in app-shell says why `~` can never
- * name a package). A static segment outranks `:packageId`, so its bare leg
- * needs a route of its own; its other addresses reach `:packageId/:tab` and
- * redirect to its flow list (objectstack#36903).
+ * `~org` was the segment of the organization's own, package-less flows
+ * (objectui#11553), retired by objectstack#38150; it stays reserved
+ * (`studioOrgScopeRetired.ts` in app-shell says why `~` can never name a
+ * package). It has two routes on one element, because the router ranks a
+ * route by its segments: `~org/*` outranks `:packageId` and `:packageId/:tab`,
+ * and only `~org/metadata/*` outranks `:packageId/metadata/*`, which would
+ * otherwise hand an old area address to the builder as a package id.
*
* objectstack#28561 — the "All metadata" area (ADR-0146 D1) has routes of its
* own because its pages nest below it (`StudioMetadataArea` declares them), and
* `:packageId/:tab` matches one segment: an area URL such as
* `/studio/crm/metadata/flow` would match no route at all. The static
* `metadata` segment outranks `:tab`. `~all` is the area's reserved
- * cross-package segment (`metadataArea.ts` in app-shell says why it is not
- * `~org`); every `~all` URL outside the area lands on Setup's environment
+ * cross-package segment (`metadataArea.ts` in app-shell says why it is
+ * reserved); every `~all` URL outside the area lands on Setup's environment
* directory, the leg's root's page since it moved out of Studio
* (objectstack#37565), so none reaches the builder as a package id.
*
@@ -321,7 +336,8 @@ function StudioPillarAddress({ children }: { children?: ReactNode }) {
export const studioRoutes = (
}>
} />
- } />
+ } />
+ } />
}
diff --git a/ui/e2e/studio-left-menu-36899.spec.ts b/ui/e2e/studio-left-menu-36899.spec.ts
index aabfa96b913..b8c872fb7d2 100644
--- a/ui/e2e/studio-left-menu-36899.spec.ts
+++ b/ui/e2e/studio-left-menu-36899.spec.ts
@@ -221,9 +221,12 @@ test.describe('Studio left menu (objectstack#36899)', () => {
await fold.click();
await expect(fold).toHaveAttribute('aria-expanded', 'true');
- for (const g of ['automation', 'system', 'security']) {
+ for (const g of ['system', 'security']) {
await expect(page.getByTestId(`studio-menu-advanced-group-${g}`)).toBeVisible();
}
+ // objectstack#38150 — the fold's Automation group held one row, the organization's own flows;
+ // it retired with the package-less scope, and a group is drawn only where it holds an entry.
+ await expect(page.getByTestId('studio-menu-advanced-group-automation')).toHaveCount(0);
await expect(page.getByTestId('studio-menu-entry-diagnostics')).toBeVisible();
// Below the 常用 entries, inside the docked panel.
const below = await page.getByTestId('studio-menu-entry-diagnostics').evaluate((el) => el.getBoundingClientRect().top);
diff --git a/ui/packages/app-shell/README.md b/ui/packages/app-shell/README.md
index 16ace9c028c..cdc4ecfb11c 100644
--- a/ui/packages/app-shell/README.md
+++ b/ui/packages/app-shell/README.md
@@ -793,26 +793,29 @@ On the declared page:
rule already switched off has no served projection, so its clone continues
in the pre-filled New form, which asks for the criteria.
-### Package-less flows (`/studio/~org/metadata/flow`)
-
-A flow that belongs to no package — a clone of a packaged flow is one, by
-ADR-0126 §7.1 — matches no package scope, so Studio gives it one scope of its
-own, segment `STUDIO_ORG_SCOPE_SEGMENT` (`~org`): its own leg of the "All
-metadata" area. The list is `/studio/~org/metadata/flow?source=runtime` and a
-flow opens full-screen in the flow designer at
-`/studio/~org/metadata/flow/?source=runtime` (`studioOrgScopePath()`,
-`orgScopeFlowOf()`). It is the same `StudioDesignSurface` with no package under
-it, reached from the Studio home and the left menu. The list holds every flow
-whose served `_packageId` names no package and offers no create; each flow opens
-editable and saves package-less drafts. An empty list says how a packaged flow
-is changed instead (in its package, with New similar). Publish promotes the
-scope's drafts one by one through the single-item publish door, because the
-package batch publish cannot reach a draft bound to no package. `~` is outside
-every package-id alphabet, so the segment can never name a package. A package's
-address naming a package-less flow opens it in this scope; one naming a flow
-nowhere held says so and opens no other flow. The retired
-`/studio/~org/automations` addresses (with or without `?surface=flow:`)
-redirect to the list or the flow (objectstack#36903).
+### Items that belong to no package (the "Loose" list)
+
+A metadata item that belongs to no package — a clone of a packaged flow is one,
+by ADR-0126 §7.1 — is in no package's list. A type's list on the "All metadata"
+area's cross-package leg holds every package's items and those of none, and its
+source filter's "Loose" value narrows it to the latter
+(`/studio/~all/metadata/?source=loose`, `looseListPath()`). There a
+person who may author metadata selects loose items and moves them into a
+package (objectstack#38150). A loose row opens the item's page on the same leg
+(`/studio/~all/metadata//`, `packageLessItemPath()`), where its
+draft is published or discarded; Home's Publish all publishes it too. A
+package's address naming a flow that belongs to no package opens that flow's
+page there; one naming a flow nowhere held says so and opens no other flow. The
+flow designer opens a package's flows only.
+
+Studio's package-less scope, which listed the flows among these items at
+`/studio/~org/metadata/flow`, is retired. Every `/studio/~org/...` address —
+the list, a flow, the old `/studio/~org/automations` deep links, and a
+`?package=~org` link — lands on the Loose list of flows,
+`/studio/~all/metadata/flow?source=loose`, keeping the address's search (`q`)
+and sort (`sort`) (`retiredOrgScopeTarget()`, segment
+`RETIRED_ORG_SCOPE_SEGMENT`). `~` is outside every package-id alphabet, so the
+segment can never name a package.
### Access matrix (package-scoped)
diff --git a/ui/packages/app-shell/src/chrome/CommandPalette.studioScope-11863.test.tsx b/ui/packages/app-shell/src/chrome/CommandPalette.studioScope-11863.test.tsx
index 47f5374bf95..c56998cacc2 100644
--- a/ui/packages/app-shell/src/chrome/CommandPalette.studioScope-11863.test.tsx
+++ b/ui/packages/app-shell/src/chrome/CommandPalette.studioScope-11863.test.tsx
@@ -218,11 +218,14 @@ describe('the palette in the `studio` scope lists the Studio, not an app (object
);
});
- it('opens a package-less flow in the package-less scope (objectui#11553)', async () => {
+ // objectstack#38150 — rewritten on purpose: the package-less scope is retired, so the flow opens
+ // on its item page on the cross-package leg, the page its row of the Loose list opens. It opened
+ // `/studio/~org/metadata/flow/org_cleanup?source=runtime`.
+ it('opens a package-less flow on its item page on the cross-package leg (objectui#11553)', async () => {
mountStudio();
await studioListed();
pick('studio-flow Nightly Cleanup ');
- await waitFor(() => expect(locationNow()).toBe('/studio/~org/metadata/flow/org_cleanup?source=runtime'));
+ await waitFor(() => expect(locationNow()).toBe('/studio/~all/metadata/flow/org_cleanup'));
});
it('matches an entry by its label or its machine name', async () => {
diff --git a/ui/packages/app-shell/src/chrome/CommandPalette.tsx b/ui/packages/app-shell/src/chrome/CommandPalette.tsx
index e928315fac4..503cd7b0e53 100644
--- a/ui/packages/app-shell/src/chrome/CommandPalette.tsx
+++ b/ui/packages/app-shell/src/chrome/CommandPalette.tsx
@@ -83,7 +83,7 @@ import { useNavTargetColor } from '../hooks/useNavTargetIcon.js';
import { useAuth } from '@object-ui/auth';
import { matchesPaletteQuery } from './paletteMatch.js';
import { fetchPackages, type PkgEntry } from '../views/studio-design/packages-io.js';
-import { isPackageLessItem, studioOrgScopePath } from '../views/studio-design/studioScope.js';
+import { isPackageLessItem, packageLessItemPath } from '../views/studio-design/studioScope.js';
import { studioItemPath } from '../views/studio-design/studioAddress.js';
import { studioPackageOverviewPath } from '../views/studio-design/studioOverviewAddress.js';
import { flattenNavigation, useAppReportEntries } from '../views/appReportIndex.js';
@@ -154,7 +154,7 @@ export interface StudioPaletteSurface {
/**
* Whether the page is one package's. Its groups then list that package's
* items, so the palette does not also list every package's objects and
- * flows; the package-less scope and the cross-package leg keep them.
+ * flows; the cross-package leg keeps them.
*/
packageScope: boolean;
/** The page's groups for the query, drawn above the packages; mounted only while the palette is open. */
@@ -1101,10 +1101,10 @@ const NO_STUDIO_ENTRIES: StudioPaletteEntries = { packages: [], objects: [], flo
* package's Data pillar. One whose package is not in the list has no Studio
* page to open, and is left out.
* - **Flows** come from the same cache's `flow` list, the unscoped read that
- * carries every package's flows (the read the package-less scope narrows,
- * see `loadPackageLessSurfaces`). A packaged flow opens in its package's
- * Automations pillar; a flow that belongs to no package opens in the
- * package-less scope (objectui#11553).
+ * carries every package's flows and the flows of none. A packaged flow
+ * opens in its package's flow designer; a flow that belongs to no package
+ * opens its item page on the cross-package leg (`packageLessItemPath`,
+ * objectui#11553, objectstack#38150).
*
* The published items only: an item that is still a draft is not in either
* cache list. Until the package list answers nothing is listed, so no entry
@@ -1175,10 +1175,11 @@ function useStudioPaletteEntries(enabled: boolean, crossPackageItems = true): St
const label = resolveKeyedI18nLabel(item.label, t) || item.name;
if (isPackageLessItem(item)) {
flows.push({
- key: `~org:${item.name}`,
+ // `~` is outside every package-id alphabet, so the key meets no packaged entry's.
+ key: `~loose:${item.name}`,
label,
name: item.name,
- href: studioOrgScopePath({ type: 'flow', name: item.name }),
+ href: packageLessItemPath({ type: 'flow', name: item.name }),
});
continue;
}
diff --git a/ui/packages/app-shell/src/console/home/__tests__/HomePage.noAgentsBuildChip-26614.test.tsx b/ui/packages/app-shell/src/console/home/__tests__/HomePage.noAgentsBuildChip-26614.test.tsx
index 01b82477f44..b50e700b22b 100644
--- a/ui/packages/app-shell/src/console/home/__tests__/HomePage.noAgentsBuildChip-26614.test.tsx
+++ b/ui/packages/app-shell/src/console/home/__tests__/HomePage.noAgentsBuildChip-26614.test.tsx
@@ -249,13 +249,15 @@ describe('with no agent in the catalog (objectstack#26614)', () => {
expect(SETUP_NEW_PACKAGE_PATH).toBe('/apps/setup/component/developer/packages?face=admin&new=package');
});
- // objectstack#37565 — the package-less scope: the "All metadata" area across packages it went to is Setup's now.
- it('an author who may enter Studio but not Setup → Packages is sent to the package-less scope, never Setup (objectstack#36908)', async () => {
+ // objectstack#37565 — the "All metadata" area across packages it went to is Setup's now.
+ // objectstack#38150 — and the package-less scope it went to next is retired: the Loose list of
+ // flows, where that scope's addresses land.
+ it('an author who may enter Studio but not Setup → Packages is sent to the Loose list of flows, never Setup (objectstack#36908)', async () => {
state.setupPair = false;
const user = userEvent.setup();
render();
await user.click(await screen.findByTestId('home-build-in-studio'));
- expect(navigateMock).toHaveBeenCalledWith('/studio/~org/metadata/flow?source=runtime');
+ expect(navigateMock).toHaveBeenCalledWith('/studio/~all/metadata/flow?source=loose');
expect(navigateMock).not.toHaveBeenCalledWith(SETUP_NEW_PACKAGE_PATH);
});
@@ -269,7 +271,7 @@ describe('with no agent in the catalog (objectstack#26614)', () => {
*/
it.each([
['an unreported set (no `systemPermissions`) fails open, to Setup\'s New Package', undefined, SETUP_NEW_PACKAGE_PATH],
- ['control: a reported set without the pair goes to the package-less scope', ['manage_metadata'], '/studio/~org/metadata/flow?source=runtime'],
+ ['control: a reported set without the pair goes to the Loose list of flows', ['manage_metadata'], '/studio/~all/metadata/flow?source=loose'],
])('%s', async (_case, systemPermissions, to) => {
state.setupPair = 'unreported';
const answer: MePermissionsAuthenticatedResponse = {
diff --git a/ui/packages/app-shell/src/index.ts b/ui/packages/app-shell/src/index.ts
index 7bb4bf78f63..a0820b13e6d 100644
--- a/ui/packages/app-shell/src/index.ts
+++ b/ui/packages/app-shell/src/index.ts
@@ -617,8 +617,8 @@ export {
// `/studio` routes mounts it as their index.
export { StudioEntryRedirect } from './views/studio-design/StudioEntryRedirect.js';
// objectstack#36909 — a retired pillar address (`/studio/`,
-// `/studio//data`, `/automations`, `/access`, `/interfaces`,
-// `/studio/~org/...`) lands on the page that replaced it in one redirect. A
+// `/studio//data`, `/automations`, `/access`, `/interfaces`, and
+// every `/studio/~org/...`) lands on the page that replaced it in one redirect. A
// host that declares the `/studio` routes mounts it on `:packageId` and
// `:packageId/:tab`, with the builder as its children.
export { StudioPillarRedirect } from './views/studio-design/StudioPillarRedirect.js';
@@ -629,15 +629,16 @@ export {
StudioEntryPermissionsProvider,
useStudioEntryPermissions,
} from './views/studio-design/studioEntryPermissions.js';
-// The one Studio scope that is not a package (objectui#11553): the
-// organization's own package-less flows, listed at
-// `/studio/~org/metadata/flow?source=runtime` (objectstack#36903; the old
-// `/studio/~org/automations` redirects there). A host that declares the
-// `/studio` routes reads the reserved segment from here.
+// objectstack#38150 — Studio's package-less scope (`/studio/~org/...`) is
+// retired: every address of it lands on the Loose list of flows on the
+// cross-package leg, `/studio/~all/metadata/flow?source=loose`. The surface
+// and `StudioPillarRedirect` redirect the addresses they mount on; a host
+// that declares the `/studio` routes reads the reserved segment and the
+// target from here, to answer those addresses on a route of its own.
export {
- STUDIO_ORG_SCOPE_SEGMENT,
- studioOrgScopePath,
-} from './views/studio-design/studioScope.js';
+ RETIRED_ORG_SCOPE_SEGMENT,
+ retiredOrgScopeTarget,
+} from './views/studio-design/studioOrgScopeRetired.js';
// Studio's "All metadata" area (objectstack ADR-0146 D1): per package, at
// `/studio//metadata/*`, and across packages at the
// reserved `/studio/~all/metadata/*`. A host that declares the `/studio` routes
diff --git a/ui/packages/app-shell/src/layout/__tests__/SidebarAppMenu-36112.test.tsx b/ui/packages/app-shell/src/layout/__tests__/SidebarAppMenu-36112.test.tsx
index 503b4862f60..76dab385653 100644
--- a/ui/packages/app-shell/src/layout/__tests__/SidebarAppMenu-36112.test.tsx
+++ b/ui/packages/app-shell/src/layout/__tests__/SidebarAppMenu-36112.test.tsx
@@ -318,11 +318,13 @@ describe('「Add app」 offers 「New blank app」 whatever the catalog serves,
]);
});
- // objectstack#37565 — the cross-package directory moved to Setup; the door is Studio's package-less scope, for now.
- it('an author who may enter Studio but not Setup → Packages is sent to Studio\'s package-less scope, never Setup (objectstack#36908)', () => {
+ // objectstack#37565 — the cross-package directory moved to Setup. objectstack#38150 — the
+ // package-less scope the door opened next is retired: Studio's Loose list of flows, where
+ // that scope's addresses land.
+ it('an author who may enter Studio but not Setup → Packages is sent to Studio\'s Loose list of flows, never Setup (objectstack#36908)', () => {
setupPair = false;
const choices = addChoices();
- expect(choices.getByTestId('sidebar-app-menu-add-new-in-studio')).toHaveAttribute('href', '/studio/~org/metadata/flow?source=runtime');
+ expect(choices.getByTestId('sidebar-app-menu-add-new-in-studio')).toHaveAttribute('href', '/studio/~all/metadata/flow?source=loose');
});
it.each([
@@ -686,14 +688,14 @@ describe('the docs portal\'s head names no app and only switches apps (objectsta
expect(choices.queryByText('Build with AI')).toBeNull();
});
- it('an author who may not open Setup → Packages gets 「New blank app」 to Studio\'s package-less scope (objectstack#37565)', () => {
+ it('an author who may not open Setup → Packages gets 「New blank app」 to Studio\'s Loose list of flows (objectstack#37565, objectstack#38150)', () => {
setupPair = false;
apps = [CRM];
admin = true;
renderPortalMenu();
expect(
within(screen.getByTestId('add-app-choices')).getByTestId('sidebar-app-menu-add-new-in-studio'),
- ).toHaveAttribute('href', '/studio/~org/metadata/flow?source=runtime');
+ ).toHaveAttribute('href', '/studio/~all/metadata/flow?source=loose');
});
it('guard: handed no entries, it draws no 「Add app」 and no separator for it', () => {
diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.authoredPackageSource-38150.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.authoredPackageSource-38150.test.tsx
new file mode 100644
index 00000000000..ef6e26b005b
--- /dev/null
+++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.authoredPackageSource-38150.test.tsx
@@ -0,0 +1,342 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * objectstack#38150 (the ruling on objectstack#38061) — in the App Studio
+ * list, an item of a package the author can write reads "New" (新建), and an
+ * item a code package ships still reads "System-shipped" (系统自带). The fact
+ * is the listed package's `writable` verdict, read by `studioListSource.ts`.
+ *
+ * It is the classification that changed, not the badge alone, so the three
+ * readers are pinned against one fixture on `/studio/~all/metadata/flow`:
+ *
+ * - the Source badge of each row, and the words it draws in both locales;
+ * - the source filter: "modified and new" holds the authored package's flow,
+ * "system-shipped" does not, and the dropdown's counts say the same;
+ * - the detail's ‹ › order (`useListOrderedNames`), which walks the names the
+ * filtered list drew.
+ *
+ * Controls: a package the list reads as read-only, a package the list does
+ * not name, a package list that cannot be read, and Setup's list, which reads
+ * the provenance as served and asks for no verdict.
+ */
+
+// Paid at collection, not inside a case's clock (check:test-source-alias).
+import '@objectstack/lint';
+import '@testing-library/jest-dom/vitest';
+import * as React from 'react';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { cleanup, render, renderHook, screen, waitFor, within } from '@testing-library/react';
+import { MemoryRouter, Route, Routes } from 'react-router-dom';
+import '@objectstack/spec/identity';
+import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
+import { MetadataAreaHostContext, type MetadataAreaHost } from './metadataAreaHost';
+
+// The Chinese catalogue is read at collection: the mocked locale hook starts no fetch of it.
+await loadStudioCatalogue('zh');
+
+const TYPE = 'flow';
+/** A package authored in Studio: the list reads it as writable. */
+const AUTHORED = 'com.acme.app';
+/** A package shipped in code: the list reads it as read-only. */
+const SHIPPED = 'com.example.showcase';
+/** A package id no row of the package list names. */
+const UNLISTED = 'com.gone.pkg';
+
+type Item = Record;
+const ITEMS: Item[] = [
+ { name: 'authored_flow', label: 'Authored', _packageId: AUTHORED },
+ { name: 'loose_flow', label: 'Loose' },
+ { name: 'shipped_flow', label: 'Shipped', _packageId: SHIPPED },
+ { name: 'unlisted_flow', label: 'Unlisted', _packageId: UNLISTED },
+];
+
+const fixture = vi.hoisted(() => ({
+ locale: 'en-US',
+ /** The `/api/v1/packages` answer's status: 200 serves the two packages. */
+ packagesStatus: 200,
+ /** How many times the package list was asked for. */
+ packagesReads: 0,
+}));
+
+const CLIENT = {
+ list: async (type: string) => (type === TYPE ? ITEMS : []),
+ listResponse: async (type: string) => ({ items: type === TYPE ? ITEMS : [] }),
+ listDrafts: async () => [],
+};
+const ENTRY = { type: TYPE, label: 'Flow', allowEnvironmentOverlay: false, allowRuntimeCreate: true };
+
+vi.mock('./useMetadata', async (importOriginal) => ({
+ ...(await importOriginal>()),
+ useMetadataClient: () => CLIENT,
+ useMetadataTypes: () => ({ loading: false, error: null, entries: [ENTRY] }),
+}));
+vi.mock('./i18n', async (importOriginal) => ({
+ ...(await importOriginal>()),
+ useMetadataLocale: () => fixture.locale,
+}));
+vi.mock('../../hooks/useCanAuthorMetadata', async (importOriginal) => ({
+ ...(await importOriginal>()),
+ useCanAuthorMetadata: () => true,
+}));
+
+import { MetadataResourceListPage } from './ResourceListPage';
+import { useListOrderedNames } from './useListOrderedNames';
+import { registerDefaultMetadataSchemas } from './default-schemas';
+import { t, tFormat } from './i18n';
+import {
+ isWritablePackageItem,
+ studioListSource,
+ studioSourceKind,
+ type WritablePackageIds,
+} from './studioListSource';
+
+registerDefaultMetadataSchemas();
+
+const json = (status: number, body: unknown) =>
+ new Response(JSON.stringify(body), { status, headers: { 'Content-Type': 'application/json' } });
+
+const fetchMock = vi.fn(async (url: string) => {
+ const u = String(url);
+ if (u === '/api/v1/packages') {
+ fixture.packagesReads += 1;
+ if (fixture.packagesStatus !== 200) return json(fixture.packagesStatus, { success: false });
+ return json(200, {
+ success: true,
+ data: {
+ packages: [
+ // The verdict is the server's, on each row: an authored package's manifest names no scope.
+ { manifest: { id: AUTHORED, name: 'Acme' }, writable: true },
+ { manifest: { id: SHIPPED, name: 'Showcase', scope: 'project' }, writable: false },
+ ],
+ },
+ });
+ }
+ if (u.endsWith('/customizations')) {
+ return json(200, {
+ success: true,
+ data: {
+ packageId: AUTHORED,
+ overrides: [],
+ extensions: [],
+ switchedOff: [],
+ arrangements: [],
+ contributions: [],
+ counts: { overrides: 0, extensions: 0, switchedOff: 0, arrangements: 0, contributions: 0 },
+ },
+ });
+ }
+ return json(404, { success: false });
+});
+
+beforeEach(() => {
+ fetchMock.mockClear();
+ vi.stubGlobal('fetch', fetchMock);
+ fixture.locale = 'en-US';
+ fixture.packagesStatus = 200;
+ fixture.packagesReads = 0;
+});
+afterEach(() => {
+ cleanup();
+ vi.unstubAllGlobals();
+});
+
+/** The area's cross-package leg. */
+const ALL: MetadataAreaHost = { packageId: null, readOnly: false, basePath: '/studio/~all/metadata' };
+/** The authored package's own leg. */
+const ON_AUTHORED: MetadataAreaHost = { packageId: AUTHORED, readOnly: false, basePath: `/studio/${AUTHORED}/metadata` };
+
+/** The flow list in the area (a host), or in Setup (`/apps/setup`, no host). */
+const SETUP_EVERY_PACKAGE = '?scope=environment';
+function mount(host: MetadataAreaHost | null, search = '') {
+ const base = host?.basePath ?? '/apps/setup/metadata';
+ const tree = (
+
+
+ } />
+
+
+
+ );
+ return render(host ? {tree} : tree);
+}
+
+const rowOf = (name: string) => screen.getByTestId(`metadata-row-${name}`).closest('tr') as HTMLElement;
+const badge = (name: string) => within(rowOf(name)).getByTestId('metadata-row-source');
+const rowOrder = () =>
+ screen
+ .getAllByTestId(/^metadata-row-(?!api-name$|source$|lock$)/)
+ .map((cell) => cell.getAttribute('data-testid')!.slice('metadata-row-'.length));
+/** The package list has answered and the authored package's row reads it. */
+const settled = async () => {
+ await screen.findByTestId('metadata-row-authored_flow');
+ await waitFor(() => expect(badge('authored_flow')).toHaveAttribute('data-source-kind', 'new'));
+};
+/** The names ‹ › walk on the cross-package leg, for a detail opened from the list at `search`. */
+async function orderedNames(search: string): Promise {
+ const hook = renderHook(() => useListOrderedNames(TYPE), {
+ wrapper: ({ children }: { children: React.ReactNode }) => (
+
+ {children}
+
+ ),
+ });
+ await waitFor(() => expect(hook.result.current.status).toBe('ready'));
+ const names = hook.result.current.names;
+ hook.unmount();
+ return names;
+}
+
+describe('the classification: a row of a package the author can write is new', () => {
+ const read = (...ids: string[]): WritablePackageIds => ({ status: 'read', ids: new Set(ids) });
+
+ it('the package verdict makes an artifact row new, after the mark and before the provenance', () => {
+ expect(studioSourceKind('artifact', null, true)).toBe('new');
+ // CONTROL: without the verdict the same row is system-shipped.
+ expect(studioSourceKind('artifact', null, false)).toBe('system');
+ // The mark is read first: a served override stays "modified".
+ expect(studioSourceKind('artifact', 'customized', true)).toBe('modified');
+ expect(studioSourceKind('artifact', 'added', false)).toBe('new');
+ expect(studioSourceKind('runtime', null, false)).toBe('new');
+ expect(studioListSource(studioSourceKind('artifact', null, true))).toBe('runtime');
+ expect(studioListSource(studioSourceKind('artifact', null, false))).toBe('artifact');
+ });
+
+ it('only a package list that was read names a writable package', () => {
+ const item = { name: 'authored_flow', _packageId: AUTHORED };
+ expect(isWritablePackageItem(item, read(AUTHORED))).toBe(true);
+ expect(isWritablePackageItem(item, read(SHIPPED))).toBe(false);
+ expect(isWritablePackageItem({ name: 'loose_flow' }, read(AUTHORED))).toBe(false);
+ expect(isWritablePackageItem(item, { status: 'off' })).toBe(false);
+ expect(isWritablePackageItem(item, { status: 'loading' })).toBe(false);
+ expect(isWritablePackageItem(item, { status: 'failed' })).toBe(false);
+ });
+});
+
+describe('on /studio/~all/metadata/flow, the Source badge', () => {
+ it("the authored package's flow reads New; the code-shipped flow still reads System-shipped", async () => {
+ mount(ALL);
+ await settled();
+ expect(badge('authored_flow')).toHaveTextContent(t('engine.list.source.new', 'en-US'));
+ expect(badge('shipped_flow')).toHaveAttribute('data-source-kind', 'system');
+ expect(badge('shipped_flow')).toHaveTextContent(t('engine.list.source.system', 'en-US'));
+ });
+
+ it('draws the Chinese words for the two: the catalogue’s 新建 and 系统自带 entries', async () => {
+ fixture.locale = 'zh-CN';
+ mount(ALL);
+ await settled();
+ const fresh = t('engine.list.source.new', 'zh-CN');
+ const system = t('engine.list.source.system', 'zh-CN');
+ // The locale reached the badge: the two words are not the English ones.
+ expect(fresh).not.toBe(t('engine.list.source.new', 'en-US'));
+ expect(system).not.toBe(t('engine.list.source.system', 'en-US'));
+ expect(badge('authored_flow')).toHaveTextContent(fresh);
+ expect(badge('shipped_flow')).toHaveTextContent(system);
+ });
+
+ it('CONTROL — a package the list does not name, and no package at all, read as before', async () => {
+ mount(ALL);
+ await settled();
+ expect(badge('unlisted_flow')).toHaveAttribute('data-source-kind', 'system');
+ // A loose flow was authored at runtime: new by its provenance, as it was.
+ expect(badge('loose_flow')).toHaveAttribute('data-source-kind', 'new');
+ });
+
+ it('explains the badge as authored here, naming the package, never as shipped by a code package', async () => {
+ mount(ALL);
+ await settled();
+ expect(badge('authored_flow')).toHaveAttribute('title', `${t('engine.list.source.runtimeDesc', 'en-US')} (${AUTHORED})`);
+ expect(badge('shipped_flow')).toHaveAttribute('title', `${t('engine.list.source.artifactDesc', 'en-US')} (${SHIPPED})`);
+ });
+
+ it('CONTROL — a package list that cannot be read names no writable package: the row reads its provenance', async () => {
+ fixture.packagesStatus = 500;
+ mount(ALL);
+ await screen.findByTestId('metadata-row-authored_flow');
+ await waitFor(() => expect(fixture.packagesReads).toBeGreaterThan(0));
+ await new Promise((resolve) => setTimeout(resolve, 20));
+ expect(badge('authored_flow')).toHaveAttribute('data-source-kind', 'system');
+ expect(badge('loose_flow')).toHaveAttribute('data-source-kind', 'new');
+ });
+});
+
+describe('on /studio/~all/metadata/flow, the source filter and ‹ › agree with the badge', () => {
+ const CHANGED = ['authored_flow', 'loose_flow'];
+ const SYSTEM = ['shipped_flow', 'unlisted_flow'];
+
+ it('"modified and new" holds the authored package’s flow, and its count says so', async () => {
+ mount(ALL, '?source=runtime');
+ await screen.findByTestId('metadata-row-authored_flow');
+ await waitFor(() => expect(rowOrder()).toEqual(CHANGED));
+ expect(screen.getByTestId('metadata-source-filter')).toHaveTextContent(
+ tFormat('engine.list.sourceFilter.changed', 'en-US', { count: CHANGED.length }),
+ );
+ // Every row the filter kept draws a badge the filter's name covers.
+ for (const name of CHANGED) expect(badge(name)).toHaveAttribute('data-source-kind', 'new');
+ });
+
+ it('"system-shipped" holds the code-shipped flow and not the authored package’s', async () => {
+ mount(ALL, '?source=artifact');
+ await screen.findByTestId('metadata-row-shipped_flow');
+ await waitFor(() => expect(rowOrder()).toEqual(SYSTEM));
+ expect(screen.getByTestId('metadata-source-filter')).toHaveTextContent(
+ tFormat('engine.list.sourceFilter.system', 'en-US', { count: SYSTEM.length }),
+ );
+ expect(screen.queryByTestId('metadata-row-authored_flow')).toBeNull();
+ });
+
+ it("the detail's ‹ › walk the names the filtered list drew, under each of the two values", async () => {
+ expect(await orderedNames('?source=runtime')).toEqual(CHANGED);
+ expect(await orderedNames('?source=artifact')).toEqual(SYSTEM);
+ // CONTROL: with no narrowing the order is every flow, and no verdict is asked for.
+ fixture.packagesReads = 0;
+ expect(await orderedNames('')).toEqual([...CHANGED, ...SYSTEM].sort());
+ expect(fixture.packagesReads).toBe(0);
+ });
+
+ it('CONTROL — with the package list unreadable, ‹ › still agree with the badge: the flow is system-shipped in both', async () => {
+ fixture.packagesStatus = 500;
+ expect(await orderedNames('?source=artifact')).toEqual(['authored_flow', ...SYSTEM]);
+ expect(await orderedNames('?source=runtime')).toEqual(['loose_flow']);
+ });
+});
+
+describe("on the authored package's own leg", () => {
+ it('its flow is under "modified and new", and "system-shipped" is empty', async () => {
+ mount(ON_AUTHORED, '?source=runtime');
+ await screen.findByTestId('metadata-row-authored_flow');
+ await waitFor(() =>
+ expect(screen.getByTestId('metadata-source-filter')).toHaveTextContent(
+ tFormat('engine.list.sourceFilter.changed', 'en-US', { count: 1 }),
+ ),
+ );
+ expect(rowOrder()).toEqual(['authored_flow']);
+ cleanup();
+ mount(ON_AUTHORED, '?source=artifact');
+ await waitFor(() =>
+ expect(screen.getByTestId('metadata-source-filter')).toHaveTextContent(
+ tFormat('engine.list.sourceFilter.system', 'en-US', { count: 0 }),
+ ),
+ );
+ expect(screen.queryByTestId('metadata-row-authored_flow')).toBeNull();
+ });
+});
+
+describe("CONTROL — Setup's list is left alone: it reads the provenance as served", () => {
+ it("the authored package's flow reads as an artifact there, and the package list is not asked for a verdict", async () => {
+ mount(null, SETUP_EVERY_PACKAGE);
+ await screen.findByTestId('metadata-row-authored_flow');
+ await new Promise((resolve) => setTimeout(resolve, 20));
+ expect(badge('authored_flow')).toHaveTextContent(t('engine.list.source.artifact', 'en-US'));
+ expect(badge('authored_flow')).not.toHaveAttribute('data-source-kind');
+ expect(badge('loose_flow')).toHaveTextContent(t('engine.list.source.runtime', 'en-US'));
+ expect(fixture.packagesReads).toBe(0);
+ });
+
+ it('its "runtime" filter does not hold the authored package’s flow', async () => {
+ mount(null, `${SETUP_EVERY_PACKAGE}&source=runtime`);
+ await screen.findByTestId('metadata-row-loose_flow');
+ await new Promise((resolve) => setTimeout(resolve, 20));
+ expect(screen.queryByTestId('metadata-row-authored_flow')).toBeNull();
+ });
+});
diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
index 90937804f35..b9245768dc7 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
+++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
@@ -143,7 +143,14 @@ import { useListDraftMarks } from './listDraftMarks.js';
import { ListChangedCell } from './ListChangedCell.js';
import { StudioListHeader } from './StudioListHeader.js';
import { STUDIO_MENU_TYPE_ICONS } from '../studio-design/StudioMenu.js';
-import { STUDIO_SOURCE_KEY, studioListSource, studioSourceKind, type StudioSourceKind } from './studioListSource.js';
+import {
+ STUDIO_SOURCE_KEY,
+ isWritablePackageItem,
+ studioListSource,
+ studioSourceKind,
+ useWritablePackageIds,
+ type StudioSourceKind,
+} from './studioListSource.js';
/**
* objectui#12982 — the Clone dialog of a declaration-only catalog
@@ -322,6 +329,9 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
// override, "added" for the rest), filterable to those alone. A pending or
// failed read draws no mark; Setup (no host) reads nothing.
const customizations = usePackageCustomizations(host?.packageId ?? null);
+ // objectstack#38150 — the packages the author can write, which the Studio
+ // list's Source reads (`studioListSource.ts`). Setup's list asks nothing.
+ const writablePackages = useWritablePackageIds(studioList);
const pairId = React.useMemo(() => {
if (!host?.packageId) return null;
const pair = customizationPackageId(host.packageId);
@@ -786,12 +796,14 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
customizations.status === 'read' && (markedCount > 0 || customizationTotal(customizations.read) > 0);
const filteringCustomized = onlyCustomized && showCustomizedFilter;
// objectstack#37918 — what the Studio list's Source says of a row
- // (`studioListSource.ts`): its mark first, then its provenance. Its source
+ // (`studioListSource.ts`): its mark first, then whether its package is one
+ // the author can write (objectstack#38150), then its provenance. Its source
// filter's "modified and new" and "system-shipped" are this, so "only
// customizations" is folded into it there and not offered beside it.
const studioKindOf = React.useCallback(
- (row: ItemRow): StudioSourceKind => studioSourceKind(row.source, markOf(row)),
- [markOf],
+ (row: ItemRow): StudioSourceKind =>
+ studioSourceKind(row.source, markOf(row), isWritablePackageItem(row.item, writablePackages)),
+ [markOf, writablePackages],
);
const sourceOf = React.useCallback(
(row: ItemRow): 'artifact' | 'runtime' => (studioList ? studioListSource(studioKindOf(row)) : row.source),
@@ -841,10 +853,8 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
) : null;
- // objectstack#36903 — a host that says what its empty list means (the
- // package-less scope, whose list is its source filter's narrowing of the
- // environment's rows) reads an unsearched, empty list as empty, not as a
- // search with no match.
+ // objectstack#36903 — a host that says what its empty list means reads an
+ // unsearched, empty list as empty, not as a search with no match.
const hintedEmpty = !!host?.emptyListHint && !query.trim() && filtered.length === 0;
// The list context every row link carries to its detail (decision 10).
const listContext = listContextQuery(listState);
@@ -1264,6 +1274,11 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
pair: customizations.index.pairId,
});
}
+ // objectstack#38150 — a row its writable package makes "new" was authored
+ // here: its badge is not explained as shipped by a code package.
+ if (row.source === 'artifact' && isWritablePackageItem(row.item, writablePackages)) {
+ return `${t('engine.list.source.runtimeDesc', locale)} (${String(row.item._packageId)})`;
+ }
return provenanceDesc(row);
};
const rowLock = (row: ItemRow): React.ReactNode => {
diff --git a/ui/packages/app-shell/src/views/metadata-admin/studio-locale.i18n.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/studio-locale.i18n.test.tsx
index 1f9971c49a0..8213d724824 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/studio-locale.i18n.test.tsx
+++ b/ui/packages/app-shell/src/views/metadata-admin/studio-locale.i18n.test.tsx
@@ -37,7 +37,8 @@ const SAMPLE_KEYS = [
'engine.studio.publish',
'engine.studio.saveDraft',
'engine.studio.cancel',
- 'engine.studio.menu.orgFlows',
+ // objectstack#38150 — `engine.studio.menu.orgFlows` stood here; it retired with the package-less scope.
+ 'engine.studio.menu.allTypes',
'engine.studio.menu.owd',
'engine.studio.app.create',
'engine.studio.pkg.new',
diff --git a/ui/packages/app-shell/src/views/metadata-admin/studioListSource.ts b/ui/packages/app-shell/src/views/metadata-admin/studioListSource.ts
index 8b2fe18fb3a..187ff2023a0 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/studioListSource.ts
+++ b/ui/packages/app-shell/src/views/metadata-admin/studioListSource.ts
@@ -5,35 +5,54 @@
* (objectstack#37918, the maintainer's decision 7 on epic objectstack#37424):
* 系统自带 / 已修改 / 新建 — system-shipped, modified, new.
*
- * Read from two facts the list already has, and only those:
+ * Read from three facts, and only those:
*
* - the row's customization mark (`customizationMarks.ts`), from the base's
* served customization read: a served override is "customized", any other
* item of the base's `.custom` pair is "added" (ADR-0146 D3);
+ * - whether the row's package is one the author can write (objectstack#38150,
+ * the ruling on objectstack#38061): the listed package's `writable` verdict,
+ * the server's own ({@link useWritablePackageIds}). An item of such a
+ * package was made here, so it reads "new" whatever its provenance says;
* - the row's provenance (`classifyProvenance` in `ResourceListPage`): a row
* authored at runtime, or in a customization package, is `runtime`.
*
* A served override is served under the BASE's id, so its provenance reads
- * `artifact`; the mark is what says it was modified. That is why the Studio
- * list's source filter cannot read the provenance alone: its two narrowings
- * — "modified and new", "system-shipped" — are {@link studioListSource}'s two
- * values, written to the list's address as the existing `source` values
- * (`metadataListState.ts`, unchanged), and the detail's ‹ › order reads the
- * same function (`useListOrderedNames.ts`), so the two cannot disagree.
+ * `artifact`; the mark is what says it was modified. An item of a package
+ * authored in Studio is served under that package's id, so its provenance
+ * reads `artifact` too; the package's verdict is what says it is new. That is
+ * why the Studio list's source filter cannot read the provenance alone: its
+ * two narrowings — "modified and new", "system-shipped" — are
+ * {@link studioListSource}'s two values, written to the list's address as the
+ * existing `source` values (`metadataListState.ts`, unchanged), and the
+ * detail's ‹ › order reads the same function (`useListOrderedNames.ts`), so
+ * the two cannot disagree.
+ *
+ * Setup's list is not this: it reads the provenance as served, and neither
+ * the mark nor the package's verdict.
*/
+import * as React from 'react';
import type { CustomizationMarkKind } from '../studio-design/customizationMarks.js';
+import { fetchListedPackageManifests } from '../studio-design/packages-io.js';
/** What the Studio list's Source column says of a row. */
export type StudioSourceKind = 'system' | 'modified' | 'new';
-/** The kind of a row: its mark first, then its provenance. */
+/**
+ * The kind of a row: its mark first, then its package's verdict, then its
+ * provenance. `inWritablePackage` is required, never defaulted: a caller that
+ * left it out would read an authored package's item as system-shipped while
+ * the caller beside it read "new".
+ */
export function studioSourceKind(
provenance: 'artifact' | 'runtime',
mark: CustomizationMarkKind | null,
+ inWritablePackage: boolean,
): StudioSourceKind {
if (mark === 'customized') return 'modified';
if (mark === 'added') return 'new';
+ if (inWritablePackage) return 'new';
return provenance === 'runtime' ? 'new' : 'system';
}
@@ -51,3 +70,65 @@ export const STUDIO_SOURCE_KEY: Readonly> = Obj
modified: 'engine.list.source.modified',
new: 'engine.list.source.new',
});
+
+/**
+ * The packages the author can write, as the Studio list holds them:
+ *
+ * - `off`: the list is not Studio's, and nothing was asked;
+ * - `loading`: the package list has not answered yet;
+ * - `read`: the ids whose listed verdict is `writable`;
+ * - `failed`: the package list could not be read.
+ *
+ * Only `read` names a package. In every other state no row is in a writable
+ * package, and a row reads as its mark and its provenance say.
+ */
+export type WritablePackageIds =
+ | { status: 'off' }
+ | { status: 'loading' }
+ | { status: 'read'; ids: ReadonlySet }
+ | { status: 'failed' };
+
+const OFF: WritablePackageIds = Object.freeze({ status: 'off' });
+const LOADING: WritablePackageIds = Object.freeze({ status: 'loading' });
+const FAILED: WritablePackageIds = Object.freeze({ status: 'failed' });
+
+/**
+ * The ids of the listed packages the author can write, read once per mount
+ * while `enabled`. The verdict is the package list's own `writable`, which
+ * the server computes per read (`packages-io.ts`), and the request is the one
+ * the other readers of that list share.
+ *
+ * A failed read is not reported here: the Studio surface reports its package
+ * list once, and the list page still draws, each row read from its mark and
+ * its provenance.
+ */
+export function useWritablePackageIds(enabled: boolean): WritablePackageIds {
+ const [answer, setAnswer] = React.useState(null);
+ React.useEffect(() => {
+ if (!enabled) return;
+ let cancelled = false;
+ fetchListedPackageManifests().then(
+ (manifests) => {
+ if (cancelled) return;
+ const ids = new Set();
+ for (const listed of manifests.values()) if (listed.writable) ids.add(listed.id);
+ setAnswer({ status: 'read', ids });
+ },
+ () => {
+ if (!cancelled) setAnswer(FAILED);
+ },
+ );
+ return () => {
+ cancelled = true;
+ };
+ }, [enabled]);
+ if (!enabled) return OFF;
+ return answer ?? LOADING;
+}
+
+/** Whether a served item belongs to a package the author can write. */
+export function isWritablePackageItem(item: Record, writable: WritablePackageIds): boolean {
+ if (writable.status !== 'read') return false;
+ const packageId = item._packageId;
+ return typeof packageId === 'string' && writable.ids.has(packageId);
+}
diff --git a/ui/packages/app-shell/src/views/metadata-admin/useListOrderedNames.ts b/ui/packages/app-shell/src/views/metadata-admin/useListOrderedNames.ts
index 172f911b891..ecc3de8d342 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/useListOrderedNames.ts
+++ b/ui/packages/app-shell/src/views/metadata-admin/useListOrderedNames.ts
@@ -37,7 +37,7 @@ import { classifyProvenance } from './ResourceListPage.js';
import { isPackageLessItem } from '../studio-design/studioScope.js';
import { useListChangedAt } from './listChangedAt.js';
import { useInSetupApp } from '../../console/setupApp.js';
-import { studioListSource, studioSourceKind } from './studioListSource.js';
+import { isWritablePackageItem, studioListSource, studioSourceKind, useWritablePackageIds } from './studioListSource.js';
import {
decodeListState,
hasListContext,
@@ -50,8 +50,8 @@ import {
export interface ListOrderedNames {
/**
* `loading` until the list — and any read its filters need (the
- * customization read, the activation ledger) — has answered; `error` when
- * the list read failed.
+ * customization read, the package list, the activation ledger) — has
+ * answered; `error` when the list read failed.
*/
status: 'loading' | 'ready' | 'error';
/** The names in list order; empty until `ready`. */
@@ -110,6 +110,10 @@ export function useListOrderedNames(type: string): ListOrderedNames {
return pair.ok ? pair.value : null;
}, [host?.packageId, envScope]);
const customizations = usePackageCustomizations(host?.packageId ?? null);
+ // objectstack#38150 — the Studio list's Source reads whether a row's package
+ // is one the author can write; asked only when the order is narrowed by it.
+ const sourceNarrowed = studioList && state.source !== 'all';
+ const writablePackages = useWritablePackageIds(sourceNarrowed);
const [rows, setRows] = React.useState<{ type: string; rows: Row[] } | 'error' | null>(null);
React.useEffect(() => {
@@ -158,9 +162,10 @@ export function useListOrderedNames(type: string): ListOrderedNames {
return React.useMemo((): ListOrderedNames => {
if (rows === 'error') return { status: 'error', names: EMPTY, fromList };
if (rows === null || rows.type !== type) return { status: 'loading', names: EMPTY, fromList };
- if ((state.customizedOnly || (studioList && state.source !== 'all')) && customizations.status === 'loading') {
+ if ((state.customizedOnly || sourceNarrowed) && customizations.status === 'loading') {
return { status: 'loading', names: EMPTY, fromList };
}
+ if (writablePackages.status === 'loading') return { status: 'loading', names: EMPTY, fromList };
if (needsLedger && ledger === null) return { status: 'loading', names: EMPTY, fromList };
if (state.sort.key === 'changed' && changedAt === null) return { status: 'loading', names: EMPTY, fromList };
@@ -187,7 +192,10 @@ export function useListOrderedNames(type: string): ListOrderedNames {
name: (row) => String(row.item[primaryKey] ?? ''),
label: (row) => (typeof row.item.label === 'string' ? row.item.label : undefined),
matches: (row, query) => matchesQuery(row.item, query, searchKey.split('\n')),
- source: (row) => (studioList ? studioListSource(studioSourceKind(row.source, markOf(row))) : row.source),
+ source: (row) =>
+ studioList
+ ? studioListSource(studioSourceKind(row.source, markOf(row), isWritablePackageItem(row.item, writablePackages)))
+ : row.source,
// objectstack#38150 — the list offers "Loose" on the area's cross-package leg alone.
...(looseOffered ? { loose: (row: Row) => isPackageLessItem(row.item) } : {}),
changedAt: (row) => changedAt?.[String(row.item[primaryKey] ?? '')],
@@ -206,5 +214,5 @@ export function useListOrderedNames(type: string): ListOrderedNames {
};
return { status: 'ready', names: orderedListNames(scoped, state, read, locale), fromList };
// Keyed on the config members read, never on `config`, rebuilt every render.
- }, [rows, changedAt, type, locale, state, fromList, customizations, needsLedger, ledger, envScope, unscoped, activePackage, pairId, primaryKey, listFilter, bundleMemberField, searchKey, studioList, looseOffered]);
+ }, [rows, changedAt, type, locale, state, fromList, customizations, needsLedger, ledger, envScope, unscoped, activePackage, pairId, primaryKey, listFilter, bundleMemberField, searchKey, studioList, looseOffered, sourceNarrowed, writablePackages]);
}
diff --git a/ui/packages/app-shell/src/views/setup/accessDirectory.test.ts b/ui/packages/app-shell/src/views/setup/accessDirectory.test.ts
index 384168d9ed7..7595150d3ee 100644
--- a/ui/packages/app-shell/src/views/setup/accessDirectory.test.ts
+++ b/ui/packages/app-shell/src/views/setup/accessDirectory.test.ts
@@ -102,6 +102,9 @@ describe("a Studio cross-package address (studioAllLegSetupRedirect)", () => {
'/studio/~all/metadata/flow?package=all',
'/studio/crm/metadata',
'/studio/~allx/metadata',
+ // objectstack#38150 — the Loose list of flows stays in Studio; so does a retired `~org`
+ // address, which is not this mapping's to move (`studioOrgScopeRetired.ts` redirects it).
+ '/studio/~all/metadata/flow?source=loose',
'/studio/~org/metadata/flow?source=runtime',
]) {
expect(studioAddressAfterSetupMove(address), address).toBe(address);
diff --git a/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.newSimilar-28567.test.tsx b/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.newSimilar-28567.test.tsx
index ab5129dca12..c140f9abc76 100644
--- a/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.newSimilar-28567.test.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.newSimilar-28567.test.tsx
@@ -14,8 +14,7 @@
* - a `409` (name taken) is the server's sentence, verbatim, the dialog stays
* open on the names typed, and nothing opens;
* - an answer that names no package opens nothing and says so;
- * - without `manage_metadata` the item draws disabled, and nothing is sent;
- * - the package-less scope draws no menu (no pair, no package to name).
+ * - without `manage_metadata` the item draws disabled, and nothing is sent.
*
* The harness is `AutomationsPillar.deleteFlow-27356`'s: the metadata server
* doubled at the client, the `/automation` doors doubled at `fetch`, and the
@@ -324,22 +323,9 @@ describe('Automations — New similar on a flow (#28567)', () => {
expect(cloneCalls()).toHaveLength(0);
});
- it('the package-less scope draws no menu', async () => {
- mockClient.list.mockImplementation(async () => [{ name: 'approval', label: 'Approval' }]);
- try {
- render(
-
-
- ,
- );
- expect(await screen.findByTestId('auto-canvas-caption', undefined, { timeout: 8000 })).toHaveTextContent('Approval');
- expect(screen.queryByTestId('studio-detail-more')).toBeNull();
- } finally {
- mockClient.list.mockImplementation(async (_type: string, opts?: { packageId?: string }) =>
- opts?.packageId ? server.flows[opts.packageId] ?? [] : [],
- );
- }
- });
+ // objectstack#38150 — "the package-less scope draws no menu" is removed: the flow designer is a
+ // package's now (`packageId` is a string), and the retired scope draws no page. That its
+ // addresses redirect is pinned in `StudioDesignSurface.packageLessFlows-11553.test.tsx`.
});
/**
diff --git a/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.tsx b/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.tsx
index 7608a4d6174..adc8b166fbf 100644
--- a/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.tsx
@@ -1,9 +1,8 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
/**
- * The flow designer — one flow, full-screen on its metadata address
- * (`/studio//metadata/flow/`, or the package-less scope's
- * `/studio/~org/metadata/flow/`; objectstack#36903, epic
+ * The flow designer — one flow of a package, full-screen on its metadata
+ * address (`/studio//metadata/flow/`; objectstack#36903, epic
* objectstack#36890; ADR-0146 D1 as amended): the item header (× back to the
* flow list, ‹ › through it), the designer's tabs with the item tools after
* them (`flowDesignerTabs.ts`), the flow canvas and its inspectors — with the
@@ -104,7 +103,7 @@ import {
loadPackageLessSurfaces,
loadPackageSurfaces,
} from './packageSurfaces.js';
-import { studioOrgScopePath } from './studioScope.js';
+import { packageLessItemPath } from './studioScope.js';
import { studioItemPath } from './studioAddress.js';
import { useCanAuthorMetadata, useCanReadAuthoringTrail } from '../../hooks/useCanAuthorMetadata.js';
import { useMetadataRefreshNonce } from './useMetadataRefreshNonce.js';
@@ -152,11 +151,11 @@ function authFetch(input: RequestInfo | URL, init?: RequestInit): Promise,
- scopes: ReadonlyArray,
+ scopes: ReadonlyArray,
): Promise | null> {
try {
const answers = await Promise.all(
- scopes.map((packageId) => client.listResponse>('flow', packageId === null ? {} : { packageId })),
+ scopes.map((packageId) => client.listResponse>('flow', { packageId })),
);
const names = new Set();
for (const answer of answers) {
@@ -172,7 +171,7 @@ async function readPublishedFlowNames(
/**
* The flow designer (objectstack#36903): one flow, named by its address, read
- * at its package (or the package-less scope), drawn full-screen.
+ * at its package, drawn full-screen.
*/
export function AutomationsPillar({
packageId: scopePackageId,
@@ -184,11 +183,11 @@ export function AutomationsPillar({
onHeldEditChange,
}: {
/**
- * The package whose flow this is, or `null` for the package-less scope
- * (objectui#11553, `studioScope.ts`): a flow that belongs to no package,
- * saved as a package-less draft.
+ * The package whose flow this is. The designer is a package's: a flow that
+ * belongs to no package opens on its item page on the cross-package leg
+ * (`packageLessItemPath`), never here.
*/
- packageId: string | null;
+ packageId: string;
/** objectstack#36903 — the one flow this page designs: the name in its metadata address. */
flowName: string;
publishNonce?: number;
@@ -208,7 +207,7 @@ export function AutomationsPillar({
// objectstack#28572 (ADR-0146 D3) — on a read-only base its pair is read
// too: a flow the pair adds opens here writable, at the pair.
const railPackageId = scopePackageId;
- const railPairId = packageReadOnly && railPackageId !== null && customization ? customization.pairId : null;
+ const railPairId = packageReadOnly && customization ? customization.pairId : null;
// objectstack#28567 — "New similar" (`FlowItemMoreMenu`): the strip that
// shows the copy the clone door saved, with the door's sentence that it is
// switched off, as sent. The copy opens on its own address (objectstack#36903),
@@ -219,7 +218,7 @@ export function AutomationsPillar({
readFlowCopiedArrival(location.state, railPackageId) ??
// objectstack#28572 — a copy that landed in the base's pair. Matched by
// the spec's pairing rule: a read of where the copy went, never a write target.
- (railPackageId !== null ? readFlowCopiedArrival(location.state, pairIdOf(railPackageId)) : null),
+ readFlowCopiedArrival(location.state, pairIdOf(railPackageId)),
);
const canAuthorFlows = useCanAuthorMetadata();
// objectui#11795 — on a row too narrow for the Configuration aside to sit
@@ -237,12 +236,10 @@ export function AutomationsPillar({
// objectstack#28572 — a flow the pair adds (`current.addedIn`) opens
// writable, read and saved at the pair: every read and write of the OPEN
// flow below names `packageId` and asks `readOnly`, the open flow's own.
- const packageId: string | null = current?.addedIn ?? railPackageId;
+ const packageId: string = current?.addedIn ?? railPackageId;
const readOnly = packageReadOnly && !current?.addedIn;
- // The draft writes' package binding (objectui#11553): none in the
- // package-less scope, so the draft row stays as package-less as the flow it
- // edits. The client sends no `package=` for an absent id.
- const draftPackageId = packageId ?? undefined;
+ // The draft writes' package binding: the open flow's own package.
+ const draftPackageId: string = packageId;
// objectstack#28570 (ADR-0146 D9 items 1–3, D2) — Customize a flow. On a
// read-only base its flow is edited in the base's paired customization
// package under the flow's own name, as a declared override of the base's
@@ -467,8 +464,8 @@ export function AutomationsPillar({
}, [publishNonce, statusNonce]);
// objectstack#36903 — the scope's read: the flows of the package (with its
- // pair's, on a read-only base) or of the package-less scope, the engine's
- // registrations, and the published names. It names the open flow (its label,
+ // pair's, on a read-only base), the engine's registrations, and the
+ // published names. It names the open flow (its label,
// and on a read-only base whether the pair adds it); the flow's own body is
// the load below. Re-read on a publish and on the live pulse (the copilot's
// edits): the open flow keeps its identity across those reads, so a re-read
@@ -493,7 +490,7 @@ export function AutomationsPillar({
? null
: Promise.all([loadPackageSurfaces(client, 'flow', pairId, locale), readFlowRegistrations(client, pairId)]);
const [baseItems, registrations, pair, publishedNames] = await Promise.all([
- scope === null ? loadPackageLessSurfaces(client, 'flow', locale) : loadPackageSurfaces(client, 'flow', scope, locale),
+ loadPackageSurfaces(client, 'flow', scope, locale),
readFlowRegistrations(client, scope),
readPair().catch(() => null),
readPublishedFlowNames(client, [scope, ...(pairId === null ? [] : [pairId])]),
@@ -503,14 +500,15 @@ export function AutomationsPillar({
setPublishedFlowNames(publishedNames);
setFlowRegistrations(pair ? { ...pair[1], ...registrations } : registrations);
const named = items.find((f) => f.name === flowName) ?? null;
- // objectui#11553 — a package's address naming a package-less flow
- // opens it in the package-less scope, once per mount.
- if (!named && scope !== null && !deepLinkProbedRef.current) {
+ // objectui#11553 — a package's address naming a flow that belongs to
+ // no package opens that flow where such a flow opens: its item page on
+ // the cross-package leg (objectstack#38150). Once per mount.
+ if (!named && !deepLinkProbedRef.current) {
deepLinkProbedRef.current = true;
const packageLess = await loadPackageLessSurfaces(client, 'flow', locale).catch(() => []);
if (cancelled) return;
if (packageLess.some((f) => f.name === flowName)) {
- navigate(studioOrgScopePath({ type: 'flow', name: flowName }), { replace: true });
+ navigate(packageLessItemPath({ type: 'flow', name: flowName }), { replace: true });
return;
}
}
@@ -879,7 +877,7 @@ export function AutomationsPillar({
{
type: 'flow',
name: flowName,
- packageId: draftPackageId ?? null,
+ packageId: draftPackageId,
// objectstack#37440 — and to the draft the flip just wrote (its receipt).
draftVersion: heldFlowDraftVersion('flow', flowName, draftPackageId),
},
@@ -919,7 +917,7 @@ export function AutomationsPillar({
// × opens it (the list's filters kept). A refusal shows the door's sentence
// and keeps the flow open.
const deleteOpenFlow = React.useCallback(async () => {
- if (!current || packageId === null) return;
+ if (!current) return;
const flow = current;
setAutoDirty(false);
setError(null);
@@ -1016,7 +1014,7 @@ export function AutomationsPillar({
// door is pre-judged from the served posture facts; after any attempt the
// server's refusal is shown as sent.
const ledgerRow =
- readOnly && packageId !== null && current && flowStatusRead ? flowStatus[current.name] : undefined;
+ readOnly && current && flowStatusRead ? flowStatus[current.name] : undefined;
const ledgerOn = ledgerRow?.enabled;
const ledgerWalled = useFlowLedgerWalledReadOnly();
const ledgerWalledReason = ledgerWalled ? t('engine.studio.auto.ledger.walled', locale) : undefined;
@@ -1048,8 +1046,8 @@ export function AutomationsPillar({
);
}, [current, ledgerOn, ledgerWalled, locale]);
// objectui#12725 — the surface's right slot hosts the Configuration
- // (`useStudioRightSlot`); `null` in the package-less scope and under an
- // injected `aiSlot`, where the aside beside the canvas (or, on a folded
+ // (`useStudioRightSlot`); `null` under an injected `aiSlot`, where the
+ // aside beside the canvas (or, on a folded
// row, the drawer over it) stays. Held while there is a flow to select, as
// the aside is drawn. A selection asks for the properties, keyed on its
// identity; Esc drops it (the canvas's own background press already does),
@@ -1274,11 +1272,11 @@ export function AutomationsPillar({
// link there truncated the flow's label; it sits at the tab row's right
// end, the slot objectui#12456 gave the Access note for the same reason.
const autoReadOnlyLinkEl =
- editLocked && packageId !== null ? (
+ editLocked ? (
) : null;
/** The flow's ⋯ menu is drawn (objectstack#28567): the header folds into it (objectstack#29693). */
- const flowMoreShown = !!current && flowLoaded && packageId !== null;
+ const flowMoreShown = !!current && flowLoaded;
// objectstack#36903 — the tool tabs need the flow's own buffer (Source edits
// it), so the row waits for the load, as the switch does; the designer's
// sections need its canvas too.
@@ -1330,9 +1328,9 @@ export function AutomationsPillar({
) : undefined;
// objectstack#28567 — New similar on a read-only package's flow and on a
// writable one's (the door picks the pair for a read-only base; a writable
- // package is the target); Delete on a writable package's flow only. The
- // package-less scope has no pair and no package to name. objectstack#36903 —
- // in the header's ⋯, which also takes what a narrow header folds.
+ // package is the target); Delete on a writable package's flow only.
+ // objectstack#36903 — in the header's ⋯, which also takes what a narrow
+ // header folds.
const flowMenu = useFlowItemMenu({
name: current?.name ?? flowName,
label: current?.label ?? flowName,
@@ -1340,7 +1338,7 @@ export function AutomationsPillar({
disabled: !!saving,
onDelete: readOnly ? undefined : () => void deleteOpenFlow(),
newSimilar: {
- target: readOnly ? undefined : (packageId ?? undefined),
+ target: readOnly ? undefined : packageId,
blocked: canAuthorFlows ? null : t('engine.edit.capabilityReadOnly', locale),
// The copy opens in place of this flow, which drops a held edit; asked
// before the dialog.
@@ -1386,7 +1384,7 @@ export function AutomationsPillar({
}
apiName={flowName}
typeLabel={translateMetadataType('flow', locale, 'Flow')}
- packageLabel={packageId ?? undefined}
+ packageLabel={packageId}
// Esc with a node selected deselects it first (the slot's own Esc, the aside's ✕).
closeOnEscape={!selection}
// objectstack#29691 (ADR-0146 D3) — a flow the pair adds, overrides
diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.tsx
index 61e7a3251d8..e6e567cfd14 100644
--- a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.tsx
@@ -96,7 +96,6 @@ import { StudioEmptyState, StudioEmptyStateAction } from './StudioEmptyState.js'
import type { PairActionsDoor, PairObjectActions } from './pairObjectActions.js';
import { RailCustomizationFilter, RailCustomizationMark, useRailCustomizationsOnly } from './StudioRailCustomizations.js';
import { FlowLedgerSwitch } from './FlowLedgerSwitch.js';
-import { isStudioOrgScope } from './studioScope.js';
import { StudioAiDraftNotice } from './StudioAiDraftNotice.js';
import { useActionLedger } from '../setup/packagedActionLedger.js';
@@ -255,8 +254,7 @@ export function ObjectActionsPanel({
// the draft's: the console draws no ledger switch there (the card's item 1
// offers it on a read-only app's vendor actions only), so nothing is read.
const routePackage = useParams<{ packageId?: string }>().packageId ?? null;
- const ledgerPackage =
- disabled && routePackage && !isStudioOrgScope(routePackage) ? routePackage : null;
+ const ledgerPackage = disabled && routePackage ? routePackage : null;
const ledger = useActionLedger(ledgerPackage);
const vendorNames = React.useMemo(() => new Set(actions.map((a) => String(a.name ?? ''))), [actions]);
// A listed action the switch is for: one of the vendor's, once the ledger answered.
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioBackToApp.tsx b/ui/packages/app-shell/src/views/studio-design/StudioBackToApp.tsx
index 372803e8ecb..cbbcf50f9c5 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioBackToApp.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioBackToApp.tsx
@@ -17,10 +17,9 @@
* navigation, and `ConsoleLayout` records every app page
* (`utils/appReturnPage.ts`);
* 2. otherwise the package's own published app, on its first screen;
- * 3. a package with no published app, the package-less scope (`~org`) and
- * the cross-package leg (`~all`): the console's apps home
- * (`useHomePath`), with no app name. A draft app has no running
- * front-end yet, so it counts as none.
+ * 3. a package with no published app, and the cross-package leg (`~all`):
+ * the console's apps home (`useHomePath`), with no app name. A draft app
+ * has no running front-end yet, so it counts as none.
*
* Leaving asks first when a pillar holds unsaved work (`beforeNavigate`).
*/
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.backToApp-36501.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.backToApp-36501.test.tsx
index 8d4e8d61c64..ec84ea73ec8 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.backToApp-36501.test.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.backToApp-36501.test.tsx
@@ -262,7 +262,7 @@ describe('studioBackTarget — the order of the three answers (objectstack#36501
appLabel: 'Service',
});
});
- it('no app, or the package-less scope: the apps home, unnamed, whatever is recorded', () => {
+ it('no app, or no package open: the apps home, unnamed, whatever is recorded', () => {
const foreign = { path: '/apps/x/y', app: 'x', label: 'X app' };
expect(studioBackTarget({ ...base, remembered: foreign, apps: [] })).toEqual({ path: '/landing', appLabel: null });
expect(studioBackTarget({ ...base, remembered: null, apps: [] })).toEqual({ path: '/landing', appLabel: null });
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.designerRegistryMissing.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.designerRegistryMissing.test.tsx
index 7b616c9febd..55cd4dc99de 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.designerRegistryMissing.test.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.designerRegistryMissing.test.tsx
@@ -287,8 +287,8 @@ describe('Automations pillar — the fourth site, found by sweeping (#6795 C, si
mockClient.layered.mockClear();
render(
-
-
+
+ ,
);
@@ -297,7 +297,9 @@ describe('Automations pillar — the fourth site, found by sweeping (#6795 C, si
'No metadata designers are registered in this session, so this flow cannot be designed here.',
);
// The header's chip; objectstack#36903 — no Configuration aside is drawn
- // beside a flow the scope does not hold, so the chip is the one site.
+ // beside a flow the package does not hold, so the chip is the one site.
+ // objectstack#38150 — mounted on a package: the designer is a package's
+ // now (it was the retired package-less scope's here).
expect(hits.length).toBe(1);
expect(mockClient.layered).not.toHaveBeenCalledWith('flow', expect.anything());
});
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.homeLoop-12513.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.homeLoop-12513.test.tsx
index 8968e49466d..12c96ae0355 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.homeLoop-12513.test.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.homeLoop-12513.test.tsx
@@ -4,15 +4,12 @@
* objectui#12513 — the Studio home loop. Inside a package the header's first
* button and the package switcher's first row both returned to the Studio
* landing (`/studio`); objectstack#36501 replaced both with 「‹ Back to app」 (since objectstack#36899 right after the menu toggle),
- * and the first case below now says so. The Organization flows empty block's way out to
- * Setup › Packaged automation retired with that page's flows half (objectstack
- * ADR-0146 D11, N-28): the block now says where a packaged flow is changed,
- * and links nowhere.
+ * and the first case below now says so. The Organization flows empty block went with the
+ * package-less scope it was drawn on, which is retired (objectstack#38150).
*
* Rendered through the REAL `StudioDesignSurface` on the REAL route shape, on
* the server double objectui#11553's file uses: a read-only showcase package
- * with two packaged flows, and no package-less flow (so the Organization
- * flows scope is empty).
+ * with two packaged flows, and no package-less flow.
*/
import '@testing-library/jest-dom/vitest';
@@ -134,7 +131,7 @@ const dataSource = createEmptyDataSource();
failOnAbsorbedFetchError();
// The two global-`fetch` reads on this surface: the pending-drafts feed
-// (`/meta/_drafts`, the header count and the package-less publish) and the
+// (`/meta/_drafts`, the header count) and the
// rail's `/automation/_status` probe (answered "absent", so no dots).
vi.stubGlobal(
'fetch',
@@ -224,6 +221,5 @@ describe('Studio home loop (objectui#12513)', () => {
expect(within(screen.getByTestId('studio-brand-row')).getByTestId('studio-menu-toggle')).toBeTruthy();
expect(screen.queryByRole('button', { name: 'App Studio home' })).toBeNull();
});
- // objectstack#36903 — the Automations rail's empty blocks went with the rail:
- // the package-less scope's list offers no create (StudioDesignSurface.packageLessFlows-11553).
+ // objectstack#36903 — the Automations rail's empty blocks went with the rail.
});
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.metadataArea-28561.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.metadataArea-28561.test.tsx
index 7ab3846727c..271785e235c 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.metadataArea-28561.test.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.metadataArea-28561.test.tsx
@@ -306,7 +306,9 @@ describe('⌘K on the builder (objectstack#36900)', () => {
await waitFor(() => expect(overlay()).not.toBeNull());
expect(new URL(where(), 'http://x').searchParams.get('palette')).toBe('1');
await waitFor(() => expect(paletteItem('studio-entry type:flow')).not.toBeNull());
- expect(paletteItem('studio-entry orgFlows')).not.toBeNull();
+ // objectstack#38150 — the organization's flows left the menu with their scope: no entry for them.
+ expect(paletteItem('studio-entry owd')).not.toBeNull();
+ expect(paletteItem('studio-entry orgFlows')).toBeNull();
fireEvent.click(paletteItem('studio-entry type:flow')!);
expect((await areaPage()).page).toBe('list');
@@ -324,7 +326,10 @@ describe('⌘K on the builder (objectstack#36900)', () => {
fireEvent.keyDown(document, { key: 'k', ctrlKey: true });
await waitFor(() => expect(overlay()).not.toBeNull());
- await waitFor(() => expect(paletteItem('studio-entry orgFlows')).not.toBeNull());
+ // The environment's menu is the environment catalog's types; objectstack#38150 — the
+ // organization's flows, the entry this waited on, retired with the package-less scope.
+ await waitFor(() => expect(paletteItem('studio-entry type:permission')).not.toBeNull());
+ expect(paletteItem('studio-entry orgFlows')).toBeNull();
expect(paletteItem('studio-entry environment')).toBeNull();
expect(paletteItem('studio-entry diagnostics')).toBeNull();
});
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.notFound-26708.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.notFound-26708.test.tsx
index 6d01cf11141..e93abe87fa5 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.notFound-26708.test.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.notFound-26708.test.tsx
@@ -114,10 +114,10 @@ function SetupPackages() {
return
{search}
;
}
-/** Studio's package-less scope (`~org`), with the address it was opened at. */
-function OrgScope() {
+/** Studio's cross-package leg (`~all`), with the address it was opened at. */
+function CrossPackageLeg() {
const { pathname, search } = useLocation();
- return
{`${pathname}${search}`}
;
+ return
{`${pathname}${search}`}
;
}
/** Holds the two capabilities Setup → Packages is shown under. */
@@ -139,7 +139,7 @@ function renderAt(
} />
- } />
+ } />
{/* objectstack#36904, objectstack#36903 — `/data` and `/automations` land on the area's object and flow lists. */}
, { area: 'metadata' })} />
{surface}} />
@@ -204,7 +204,9 @@ describe('Studio: a package id no package has renders "package not found" (objec
expect(screen.queryByTestId('studio-menu-toggle')).toBeNull();
expect(screen.queryByTestId('studio-mobile-strip')).toBeNull();
expect(screen.queryByRole('button', { name: new RegExp(t('engine.studio.publish', 'en')) })).toBeNull();
- expect(screen.queryByRole('button', { name: new RegExp(t('engine.studio.changes', 'en')) })).toBeNull();
+ // objectstack#38150 — the Changes row retired with the package-less scope; none is drawn here either.
+ expect(screen.queryByRole('button', { name: /^Changes/ })).toBeNull();
+ expect(screen.queryByTestId('studio-scope-changes')).toBeNull();
expect(screen.queryByTitle(t('engine.studio.app.noneTitle', 'en'))).toBeNull();
// The one list read the builder already makes — no second request.
expect(packageListReads(fetchMock)).toBe(1);
@@ -218,14 +220,16 @@ describe('Studio: a package id no package has renders "package not found" (objec
expect(await screen.findByTestId('setup-packages')).toHaveTextContent('?face=admin');
});
- // objectstack#37565 — the cross-package directory moved to Setup; the way out is the package-less scope, for now.
- it('for a principal who may enter Studio but not Setup → Packages, it opens the package-less scope, never Setup (objectstack#36908)', async () => {
+ // objectstack#37565 — the cross-package directory moved to Setup. objectstack#38150 — the
+ // package-less scope the way out opened next is retired: it opens the Loose list of flows,
+ // where that scope's addresses land.
+ it('for a principal who may enter Studio but not Setup → Packages, it opens the Loose list of flows, never Setup (objectstack#36908)', async () => {
servePackages();
renderAt(`/studio/${PHANTOM}/data`, , STUDIO_ONLY);
const notFound = await screen.findByTestId('studio-package-not-found');
expect(within(notFound).queryByRole('button', { name: t('engine.studio.notFound.packageList', 'en') })).toBeNull();
within(notFound).getByRole('button', { name: t('engine.studio.notFound.allMetadata', 'en') }).click();
- expect(await screen.findByTestId('org-scope')).toHaveTextContent('/studio/~org/metadata/flow?source=runtime');
+ expect((await screen.findByTestId('cross-package-leg')).textContent).toBe('/studio/~all/metadata/flow?source=loose');
expect(screen.queryByTestId('setup-packages')).toBeNull();
});
@@ -235,13 +239,17 @@ describe('Studio: a package id no package has renders "package not found" (objec
await listAnswered(fetchMock);
expect(screen.queryByTestId('studio-package-not-found')).toBeNull();
// objectstack#36899 — the left menu drawn. objectstack#37201 — the 常用 groups of the served
- // types (object, flow, permission), and the 「高级」 fold holding the four entries that are not a type.
+ // types (object, flow, permission), and the 「高级」 fold holding the entries that are not a type.
+ // objectstack#38150 — two of them now, diagnostics and the sharing overview: the organization's
+ // flows retired with the package-less scope, and the fold's 自动化 Automation group with it.
for (const group of ['data', 'automation', 'security']) {
expect(within(menu()).getByTestId(`studio-menu-group-${group}`)).toBeInTheDocument();
}
- for (const group of ['automation', 'system', 'security']) {
+ for (const group of ['system', 'security']) {
expect(within(menu()).getByTestId(`studio-menu-advanced-group-${group}`)).toBeInTheDocument();
}
+ expect(within(menu()).queryByTestId('studio-menu-advanced-group-automation')).toBeNull();
+ expect(within(menu()).queryByTestId('studio-menu-entry-orgFlows')).toBeNull();
});
it('CONTROL — a kernel package the Studio landing hides is installed, never "not found"', async () => {
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.packageLessFlows-11553.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.packageLessFlows-11553.test.tsx
index 0ee71e12e92..22ead62b97a 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.packageLessFlows-11553.test.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.packageLessFlows-11553.test.tsx
@@ -3,7 +3,7 @@
/**
* objectui#11553 — a package-less flow (a clone of a packaged flow, which
* ADR-0126 §7.1 makes "an ordinary org/install-owned flow") is reachable in
- * Studio, editable, and its deep link opens it and no other flow.
+ * Studio, and a deep link naming it opens it and no other flow.
*
* Measured on objectstack 17.6.0 with the console at the pin: the clone's row
* names no package; the package-scoped flow list omits it and the bare list
@@ -11,25 +11,35 @@
* rail read the package-scoped list, and a deep link naming the clone as the
* surface opened the package's first flow instead.
*
- * Rendered through the REAL `StudioDesignSurface` on the REAL route shape, with
- * the real registered `FlowPreview` / `FlowInspector`, so "opens editable" is
- * what the canvas and the switch actually offer. The server double answers the
- * metadata reads the way the platform does: a `packageId` list keeps only rows
- * whose `_packageId` equals it, and the unscoped list returns every row. Each
- * package-less case has its packaged control (the read-only package below
- * stays read-only, as objectui#11124 pins at the pillar).
+ * objectstack#38150 — the package-less scope that answered this
+ * (`/studio/~org/…`) is retired (ADR-0084, amended 2026-11-26,
+ * `#amendment-2026-11-26-org`). What this file pins now:
+ *
+ * - every address of the retired scope lands on the Loose list of flows on
+ * the cross-package leg, `/studio/~all/metadata/flow?source=loose`, which
+ * lists the clone and none of a package's flows;
+ * - the clone's row there opens its item page on that leg; a package's
+ * address that names the clone lands on that page too, and still opens no
+ * other flow;
+ * - that item page opens writable, and an edit saved there writes a draft
+ * naming no package; a draft of the clone is published, or discarded, from
+ * that page;
+ * - no menu row, no Changes row and no changes sheet is drawn for the
+ * retired scope; a package keeps its own.
*
- * objectstack#36903 — the scope's flows live in its own leg of the "All
- * metadata" area: the list at `/studio/~org/metadata/flow?source=runtime`, a
- * flow full-screen at `/studio/~org/metadata/flow/?source=runtime`; the
- * old `/studio/~org/automations` addresses redirect there.
+ * Rendered through the REAL `StudioDesignSurface` on the REAL route shape, with
+ * the real registered `FlowPreview` / `FlowInspector`. The server double
+ * answers the metadata reads the way the platform does: a `packageId` list
+ * keeps only rows whose `_packageId` equals it, and the unscoped list returns
+ * every row. The packaged control (the read-only package below stays
+ * read-only, as objectui#11124 pins at the pillar) is unchanged.
*/
import '@testing-library/jest-dom/vitest';
import * as React from 'react';
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { render, screen, fireEvent, cleanup, waitFor, within } from '@testing-library/react';
-import { MemoryRouter, Route, Routes, useLocation, useNavigate } from 'react-router-dom';
+import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom';
const SHOWCASE = 'com.example.showcase';
/** objectstack#36903 — the showcase's paired customization package, listed only where a case says so. */
@@ -55,6 +65,9 @@ const server = vi.hoisted(() => ({
saves: [] as Array<{ type: string; name: string; options: Record | undefined; body: Record }>,
publishedByRef: [] as Array<{ type: string; name: string }>,
packageBatches: [] as string[],
+ /** The item page's own publish and discard, as the client was called. */
+ itemPublishes: [] as Array<{ type: string; name: string; options: Record | undefined }>,
+ itemResets: [] as Array<{ type: string; name: string; options: Record | undefined }>,
}));
const mockClient = vi.hoisted(() => ({
@@ -78,6 +91,12 @@ const mockClient = vi.hoisted(() => ({
return { code: null, overlay: row ? eff : null, overlayScope: row ? 'env' : null, effective: row ? eff : null };
}),
getDraft: vi.fn(async (type: string, name: string) => {
+ // A pending draft's stored body, where the ledger holds a row for the item.
+ const row = server.active.get(`${type}/${name}`);
+ if (row && server.drafts.some((d) => d.type === type && d.name === name)) {
+ const { __type: _t, ...item } = row;
+ return { item: { ...item, label: `${String(item.label)} (draft)` } };
+ }
throw Object.assign(new Error(`No pending draft exists for ${type}/${name}.`), { code: 'NO_DRAFT', status: 404 });
}),
save: vi.fn(async (type: string, name: string, item: unknown, options?: Record) => {
@@ -92,8 +111,16 @@ const mockClient = vi.hoisted(() => ({
server.packageBatches.push(packageId);
return { success: true, failed: [] };
}),
- publish: vi.fn(async () => ({ success: true })),
- reset: vi.fn(async () => ({})),
+ publish: vi.fn(async (type: string, name: string, options?: Record) => {
+ server.itemPublishes.push({ type, name, options });
+ server.drafts = server.drafts.filter((d) => !(d.type === type && d.name === name));
+ return { success: true, version: 2 };
+ }),
+ reset: vi.fn(async (type: string, name: string, options?: Record) => {
+ server.itemResets.push({ type, name, options });
+ server.drafts = server.drafts.filter((d) => !(d.type === type && d.name === name));
+ return {};
+ }),
}));
/** Whether the package list serves the showcase's pair (objectstack#36903, the pair's bookmarks). */
@@ -104,9 +131,16 @@ const panel = vi.hoisted(() => ({ props: null as null | Record
/** Read through a call, so a reset between renders does not narrow it away. */
const panelProps = (): Record | null => panel.props;
+/**
+ * The type registry the surface is served. Empty by default, as this file has
+ * always run; the item-page cases serve the platform's own `flow` row, because
+ * the item page's Publish and Discard are offered by that row's flags.
+ */
+const registry = vi.hoisted(() => ({ entries: [] as Array> }));
+
vi.mock('../metadata-admin/useMetadata', async (importOriginal) => {
const mod = await importOriginal();
- return { ...mod, useMetadataClient: () => mockClient, useMetadataTypes: () => ({ entries: [] }) };
+ return { ...mod, useMetadataClient: () => mockClient, useMetadataTypes: () => ({ entries: registry.entries }) };
});
vi.mock('./packages-io', async (importOriginal) => {
@@ -156,8 +190,11 @@ vi.mock('sonner', () => ({ toast: { success: vi.fn(), error: vi.fn(), info: vi.f
// The console's preview and authoring code loads `@objectstack/lint` lazily;
// warmed here so its first load is paid at import, not inside a test's clock.
import '@objectstack/lint';
+import { DEFAULT_METADATA_TYPE_REGISTRY } from '@objectstack/spec/kernel';
import { StudioDesignSurface } from './StudioDesignSurface';
import { StudioPillarRedirect } from './StudioPillarRedirect';
+import { StudioEntryPermissionsProvider, studioEntryFallbackPath } from './studioEntryPermissions';
+import { packageLessItemPath } from './studioScope';
import { createEmptyDataSource, failOnAbsorbedFetchError } from './__tests__/emptyDataSource';
import { getMetadataPreview, registerMetadataPreview } from '../metadata-admin/preview-registry';
import { registerMetadataInspector } from '../metadata-admin/inspector-registry';
@@ -219,7 +256,10 @@ beforeEach(() => {
server.saves.length = 0;
server.publishedByRef.length = 0;
server.packageBatches.length = 0;
+ server.itemPublishes.length = 0;
+ server.itemResets.length = 0;
panel.props = null;
+ registry.entries = [];
listing.pair = false;
for (const fn of Object.values(mockClient)) (fn as unknown as { mockClear: () => void }).mockClear();
// Two packaged flows on the read-only showcase, and the clone, which names no package.
@@ -235,30 +275,34 @@ function LocationProbe() {
return
{`${pathname}${search}`}
;
}
-/** A route change into the package-less scope, the surface left mounted. */
-function OrgScopeDoor() {
- const navigate = useNavigate();
- return