Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
91d7741
wip(#39536): picklist_extension stored item — spec row, registry repl…
claude Dec 4, 2026
5081b69
wip(#39536): runtime item test, pair-planner test, changeset (unrun d…
claude Dec 4, 2026
3623916
fix(#39536): picklist_extension copy keeps its list name; regenerate …
claude Dec 4, 2026
025c955
refactor(#39536): one SchemaRegistry door for a stored picklist_exten…
claude Dec 4, 2026
48cdfc7
fix(#39576): PATCH /packages/:id refuses a body key it does not read;…
claude Dec 4, 2026
6c0e52a
fix(#39576): register the PATCH /packages body-key narrowing as an AD…
claude Dec 4, 2026
947f6e2
test(#39536): the exact-qualifier enumerations list picklist_extensio…
claude Dec 4, 2026
6aefd3f
i18n(#39536): picklist_extension type label and description in every …
claude Dec 4, 2026
f2871f7
fix(#39536): the __c refusal says what the ruling says; Studio menu r…
claude Dec 4, 2026
dadcac4
fix(#39576): declare the body-key module to check:route-envelope; the…
claude Dec 4, 2026
eeba9e5
Merge origin/main into claude/project-thread-x8vem3 (#39099 landed)
claude Dec 4, 2026
ff21eef
Merge origin/main into claude/project-thread-x8vem3 (#39636 landed)
claude Dec 4, 2026
1448448
docs(adr-0084), changesets(#39536): picklist_extension's type-to-grou…
claude Dec 4, 2026
4142335
test(showcase): KIND_COVERAGE accounts for picklist_extension, waived…
claude Dec 4, 2026
e08b890
changeset(#39536): platform-objects ships the picklist_extension type…
claude Dec 4, 2026
0c3c0d1
fix(#39536): the item door asks the caller-less target judgement; a t…
claude Dec 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .changeset/39536-picklist-extension-item.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
'@objectstack/spec': minor
'@objectstack/objectql': minor
'@objectstack/metadata-protocol': minor
'@objectstack/runtime': minor
'@objectstack/cloud-connection': minor
'@objectstack/platform-objects': patch
'@object-ui/app-shell': patch
'@object-ui/i18n': patch
---

feat(spec, metadata-protocol, objectql, runtime, cloud-connection): a customer adds values to an installed package's picklist as a stored `picklist_extension` item of the customization pair

Clause-②: yes (narrowing)
Metadata-protocol: narrowed

Who sees it: an administrator of an installed app (for example a CRM) who needs one more value in the vendor's shared option list, such as a new lead source. Until now nothing they could reach stored it: the list belongs to the vendor's package, and the `.custom` pair had no door for `picklistExtensions`.

**BREAKING** for the same pull request's `PATCH /api/v1/packages/<id>` door only (see `.changeset/39576-patch-packages-unread-body-key.md`): this half adds a type and refuses nothing an author already writes.

- New metadata type `picklist_extension`, the twin of `object_extension`: values a package adds to a picklist another package owns, stored as an item of the writing package under the list's name (one item per package per list). The body is `PicklistExtensionSchema` unchanged (`extend`, `options`). It is saved as a draft, published, versioned, rolled back and deleted through `/api/v1/meta/picklist_extension/<list>?package=<pair>` like any item, and classified `excluded` in the override table (a list is extended, never replaced). The type takes no `package` selector on history or rollback, so while two packages each hold a row of a list's name a rollback of it is refused with `409 RESOURCE_CONFLICT`, naming both; re-publish the wanted values instead.
- Every value such an item adds must end in `__c` (the suffix reserved for a customer's extension fields). A value without it is refused at the save, publish and restore doors with `VALIDATION_ERROR` / 400 located at `options.<i>.value`; the option `label` stays free text. The reason: a vendor version that later ships the same value is refused at upgrade while a customer's extension holds it, so with the suffix the vendor's next version may ship `trade_show` beside the customer's `trade_show__c`. The rule is asked of these items only: a list's own values and a code package's `picklistExtensions` are not judged for it.
- The doors also refuse, with `VALIDATION_ERROR` / 400: a write naming no package, a row filed under a name other than its `extend`, a list the package cannot reach (not its own and not declared by a package in its `dependencies`), a list name two installed packages each hold (the registry's own sentence: an extension's target is resolved environment-wide, so such an item could never be served), and a value the list or another package's extension already carries.
- A published item is served at once on every field bound to the list, re-registered at boot, replaced on re-publish (a value dropped from the item leaves the list), and withdrawn when the item is deleted or the package uninstalled.
- `GET /api/v1/packages/<pair>/export` carries the items as `picklistExtensions`, and `POST /api/v1/marketplace/install-local` of such a pair writes each entry back as a `picklist_extension` item (before, it refused the key).
- `SchemaRegistry` (`@objectstack/objectql`) gains `storedPicklistExtension(request)`, one door for a stored row's `replace`, `refusal`, `withdraw` and `extenders` requests of its package's contribution to a list.
- Studio lists the type in its left menu under 数据 Data, in the 高级 fold, last in the group, and the pending-changes summary reads a count of these items as "N picklist extensions" in every console language instead of the raw type name. No editor or 「添加选项」 control ships in this change.

Migration: none for this half. `picklist_extension` is a new type, so nothing an author already writes is refused by it; the `__c` rule applies only to items of the new type. The narrowing this pull request declares is the `PATCH /api/v1/packages/<id>` body-key refusal, described with its migration in `.changeset/39576-patch-packages-unread-body-key.md` and registered there.

<!-- adr-0087: registered package-patch-unread-body-key-refused -->
17 changes: 17 additions & 0 deletions .changeset/39576-patch-packages-unread-body-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@objectstack/runtime': minor
---

fix(runtime): `PATCH /api/v1/packages/:id` refuses a body key it does not read

Clause-②: yes (narrowing)
Metadata-protocol: narrowed

Who sees it: an administrator or an agent who edits a package through `PATCH /api/v1/packages/<id>` and sends a key the door does not read, such as `picklistExtensions`. Until now the door answered `200`, saved `name` / `description` / `version` / `dependencies` if present, and dropped the rest without a word, so the caller believed the extra key was stored.

**BREAKING** for a caller of `PATCH /api/v1/packages/<id>` that sends a body key the door does not read: it answered 200 and saved the keys it reads; it answers 400 `VALIDATION_ERROR` and saves nothing.

- The door reads the `manifest` wrapper and, flat or inside it, `name`, `description`, `version` and `dependencies`. Any other key is now refused with `400 VALIDATION_ERROR`, naming every unread key (`manifest.<key>` inside the wrapper; beside an object wrapper every other top-level key is unread) and the keys the door reads, in the sentence closed query-parameter doors already answer. Nothing is written: not a valid `name` sent beside it.
- Migration: send only the four keys. A package's metadata (a picklist extension, an object extension, any item) is saved as an item through `/api/v1/meta/<type>/<name>?package=<id>`, never on this door. Studio's package dialog sends only the four keys and is unaffected.

<!-- adr-0087: registered package-patch-unread-body-key-refused -->
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ Every type the spec registers, enumerated at `origin/main` `151e8123` from `pack
| **数据 Data** | `data` | 5 | `mapping` 字段映射 | 高级 |
| **数据 Data** | `data` | 6 | `object_extension` | 高级 |
| **数据 Data** | `data` | 7 | `seed` | 高级 |
| **数据 Data** | `data` | 8 | `picklist_extension` *(registered after the ruling — [item 6](#amendment-2026-11-25-silent))* | 高级 |
| **数据 Data** | `data` | — | `field` | — |
| **界面 UI** | `ui` | 1 | `app` 应用 | 常用 |
| **界面 UI** | `ui` | 2 | `page` 页面 | 常用 |
Expand Down Expand Up @@ -218,6 +219,8 @@ Every type the spec registers, enumerated at `origin/main` `151e8123` from `pack

*(Rewritten 2026-11-29, card [#37087](https://github.com/objectstack-ai/objectstack/issues/37087), which carries out [Amendment (2026-11-26)](#amendment-2026-11-26-moves) for one row and decides nothing: `form`. The same change takes the type off the directory's hidden types and brings its designer, so Studio lists it and its row is written: 界面 UI, fifth, directly after `report` ([item 11](#amendment-2026-11-26-silent)), and its tier is 常用; `view` and `action`, the two types behind it, are each one place later. Read again at `origin/main` `3014176695`: the registry holds the same 35 entries, and the table now has a row for each — 35 rows, counting 数据 Data 8 · 界面 UI 7 · 自动化 Automation 2 · 平台 Platform 7 · 访问 Access 6 · AI 5. The four rows that amendment left to their changes are now each rewritten or written: `dataset`'s, `position`'s, `datasource`'s and `form`'s.)*

*(Amended 2026-12-04, pull request [#39668](https://github.com/objectstack-ai/objectstack/pull/39668), on claim amendment [7413299417](https://github.com/objectstack-ai/objectstack/issues/39536#issuecomment-7413299417), which writes one row and decides nothing: `picklist_extension`, registered `data` by ruling [7406020670](https://github.com/objectstack-ai/objectstack/issues/39536#issuecomment-7406020670), eighth in 数据 Data after `seed`, 高级, under [item 6](#amendment-2026-11-25-silent). Read again on that change: the registry holds 36 entries, and the table has a row for each — 36 rows, counting 数据 Data 9 · 界面 UI 7 · 自动化 Automation 2 · 平台 Platform 7 · 访问 Access 6 · AI 5. No type changed group.)*

*(Amended 2026-11-30, card [#38438](https://github.com/objectstack-ai/objectstack/issues/38438), from the contract review of the change that wrote the note above ([comment 7258340131](https://github.com/objectstack-ai/objectstack/pull/38619#issuecomment-7258340131), N1), which decides nothing: that note's "The same change takes the type off the directory's hidden types and brings its designer" is true of card #37087 and loose for the change. The card landed in two pull requests. The first ([#38484](https://github.com/objectstack-ai/objectstack/pull/38484)) brought the designer (`ui/packages/app-shell/src/views/studio-design/publicForm/PublicFormsDesigner.tsx`). The second ([#38619](https://github.com/objectstack-ai/objectstack/pull/38619)), the change that wrote the row, lists the type: it takes `form` off the directory's hidden types (`ui/packages/app-shell/src/views/metadata-admin/directoryScope.ts#HIDDEN_DIRECTORY_TYPES`) and gives it its place in the menu (`ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts#STUDIO_MENU_PLACEMENT`). The row, its order and its tier stand as that note gives them, and that note is left as written.)*

The rows are in the menu's order: by group, then by **Order**, which counts inside a group. **Tier** is 常用 Common or 高级 Advanced. The Chinese word beside a registered name is the one the ruling or its proposal uses for that type; a type neither names in Chinese has none. `field` carries no order and no tier because it draws no row (the second reading below).
Expand Down Expand Up @@ -339,7 +342,7 @@ Merging accepts them; an objection names the number.
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.)*
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` and `picklist_extension`.** *(Heading reworded 2026-11-27, for the second row that points here, and again 2026-12-04, for the third; the notes that end this item say 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.)* *(Amended 2026-12-04, pull request [#39668](https://github.com/objectstack-ai/objectstack/pull/39668) (card [#39536](https://github.com/objectstack-ai/objectstack/issues/39536), step 2), on claim amendment [7413299417](https://github.com/objectstack-ai/objectstack/issues/39536#issuecomment-7413299417), which decides nothing: a third type has been registered since the ruling — `picklist_extension`, registered `data` by ruling [7406020670](https://github.com/objectstack-ai/objectstack/issues/39536#issuecomment-7406020670) ([ADR-0146](./0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md) D2 / D10), the values a package adds to a shared option list another package owns — and the change that registered it wrote its row under this item: eighth in 数据 Data, after `seed`, 高级. No ruling names it, and the same sentences place it: its body requires one list to extend (the `extend` key of `packages/spec/src/data/picklist.zod.ts#PicklistExtensionSchema`), so it is authored from that list, which is itself 高级 by name (「选项列表 5也放到高级」); 高级 holds every type the ruling does not list as 常用; and a type with no row is drawn at the end of its group. If it is meant to sit beside `picklist` or `object_extension` instead, its Order is the word to change.)*

The ruling also carries, as proposed and not restated here: the menu's visual hierarchy (§3.3), the placement list and its two pins (§3.4), how the fold is opened, remembered and searched (§3.5), and that no address changes (§3.9). Those are the work of #37200 and #37201.

Expand Down
8 changes: 8 additions & 0 deletions examples/app-showcase/src/coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ export const KIND_COVERAGE: Record<MetadataType, KindCoverage> = {
'The kind is declared ahead of its runtime reader: until the server resolves a picklist reference, a picklist-bound field is served with no options, so a demo would draw a select with nothing to choose. Demonstrate it (one list on two objects, an extension, a translated option) with the runtime layer.',
issue: 'https://github.com/objectstack-ai/objectstack/issues/19519',
},
// [#39536] The stored twin of `objectExtensions` for a shared list: a
// writable package's item adding values to a picklist another package owns.
picklist_extension: {
status: 'waived',
reason:
'An item of this kind adds values to a picklist another package owns, and the showcase ships no picklist and depends on no package that does (`picklist` and `picklistExtensions` are waived above), so there is no list to extend. Its code half is `picklistExtensions`; the item itself is written at runtime through `/api/v1/meta/picklist_extension/<list>?package=<pkg>`. Demonstrate it with the picklist kind.',
issue: 'https://github.com/objectstack-ai/objectstack/issues/39699',
},

// ── ui ──
view: { status: 'demonstrated', files: ['src/ui/views/task.view.ts', 'src/ui/views/project.view.ts'] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,29 @@ describe('planCustomizationPairInstall — the items of an exported pair', () =>
if (plan.ok) return;
expect(plan.problems).toEqual(['`objectExtensions[0]` has no name']);
});

// [#39536] The pair's `picklist_extension` items travel as its
// `picklistExtensions`; the install writes each one back as that item,
// named by the list it extends, before the objects whose fields resolve it.
it('reads a picklist extension as a `picklist_extension` item named by its list', () => {
const entry = { extend: 'lead_source', options: [{ label: 'Trade show', value: 'trade_show__c' }] };
const plan = planCustomizationPairInstall(exportedPair({
picklistExtensions: [entry],
objectExtensions: [{ extend: 'showcase_task', fields: { showcase_custom_flag: { type: 'boolean' } } }],
}));
expect(plan.ok, JSON.stringify(plan)).toBe(true);
if (!plan.ok) return;
expect(plan.items.map((i) => [i.type, i.name, i.path]).slice(0, 2)).toEqual([
['picklist_extension', 'lead_source', 'picklistExtensions[0]'],
['object_extension', 'showcase_task', 'objectExtensions[0]'],
]);
expect(plan.items[0]!.item).toEqual(entry);
});

it('refuses a picklist extension that names no list', () => {
const plan = planCustomizationPairInstall(exportedPair({ picklistExtensions: [{ options: [{ label: 'X', value: 'x__c' }] }] }));
expect(plan.ok).toBe(false);
if (plan.ok) return;
expect(plan.problems).toEqual(['`picklistExtensions[0]` has no name']);
});
});
Loading
Loading