Skip to content

Commit ad2bfc9

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-i6gtvk
2 parents d9ae50b + 706ac52 commit ad2bfc9

66 files changed

Lines changed: 4054 additions & 178 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/metadata-protocol': minor
3+
'@objectstack/service-automation': minor
4+
---
5+
6+
feat(service-automation, metadata-protocol): a flow override declared in the shipping package's paired `<base>.custom` is the packaged flow — saved, served and armed in place of the base, and deleting it restores the base (#28412)
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: semantic
10+
11+
ADR-0146 D9 item 1 for `flow`. A flow a code package ships could be changed only by cloning it under a new name, so the clone and the base both ran on every record change. Now the base package's paired `.custom` package can override it in place:
12+
13+
- **The save door admits it.** A flow saved into `<base>.custom` under the base flow's name, declaring `overrides: { package: '<base>', basedOn }`, passes the ADR-0146 D2 override write gate (`flow` is open there now; `action` still answers "not yet available"). The draft save, the per-item publish, `publishPackageDrafts`, `os validate` and the install-local gate admit it as they admit a declared view override.
14+
- **Every read serves it as the base.** The flow view (`getMetaItems` / `getMetaItemsForExecution`), the by-name read, the layered read (`code` = the base's flow, `effective` = the override) and the per-package customization list serve the override in the base's slot, under the base's `_packageId`, once per name. The one predicate is N-10's `isServedOverrideRowOf`, judged on the row's stored `package_id` — never on the body's `_packageId`.
15+
- **The automation engine arms it in place of the base.** The boot pull, the `kernel:ready` sync, the `metadata:reloaded` re-sync and the metadata-mutation sync each arm the override. One record change runs one body. The boot pull ranks it above the loader's body (a new `override` contender rank), reading the row's stored binding, which the protocol's registry hydration now records on the hydrated flow body as a non-enumerable symbol (`bindStoredRow` / `storedRowBindingOf`, newly exported). That symbol cannot be authored in JSON and never leaves the process.
16+
- **The ledger identity stays the base's.** The override keeps the base flow's name and owner, so the activation toggle, the ledger row, `FLOW_DISABLED` and the §7.3 subflow guard treat it as the base. Switched off, it is silent. Switched on, it is armed again.
17+
- **Deleting it restores the base.** A `/meta` delete naming the pair removes its row (admitted past the sealed-removal refusal, as the narrowing direction), and each arming step re-arms the base with one registration, never a withdraw first. A run suspended on the base finishes on the base (N-12), while new runs start on the override.
18+
- **Every other stored row stays shadowed.** A dependent package's declaration, a package-less row whose body names the pair, and the pair's undeclared row are not armed. The shadowing warning's remedy is now "declare it as an override in '<base>.custom' (overrides: { package, basedOn }), or save it under a new name". It no longer says "clone".
19+
- **The sealed save sentence for a packaged flow** names the declaration in place of the clone route: "… Declare an override from '<base>.custom' or rename it to customize it, or switch it off (…). See docs/adr/0126-packaged-metadata-customization-model.md." A delete still names the clone and the switch.
20+
21+
No spec key is added or reshaped. A flow item's existing `overrides` declaration, refused before, now takes effect.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
'@objectstack/objectql': minor
3+
'@objectstack/metadata-core': minor
4+
'@objectstack/cloud-connection': minor
5+
'@objectstack/cli': minor
6+
'@objectstack/spec': minor
7+
---
8+
9+
feat(objectql): an object extension's `fieldPatches` is applied on every object read; a patch naming a field or option its target lacks is refused at install and by `os validate`
10+
11+
Clause-②: no
12+
Metadata-protocol: semantic
13+
14+
ADR-0146 D10's second rule, live. The per-field display patch an object extension declares (`objectExtensions[].fieldPatches`, added unenforced in the previous release) now reaches the screen:
15+
16+
```ts
17+
objectExtensions: [{
18+
extend: 'crm_account',
19+
fieldPatches: {
20+
industry: { label: 'Sector', inlineHelpText: 'The market the account sells into', options: { tech: { label: 'Technology' } } },
21+
},
22+
}]
23+
```
24+
25+
- **Applied, never carried.** The engine's extension registration carries the slot, and the registry merge (`mergeObjectDefinitions`) applies it after the additive merges: the `BASE_FIELD_DISPLAY_WHITELIST` keys (`label`, `description`, `inlineHelpText`, `placeholder`) onto the named field, and `label` onto each option addressed by its stored `value`. The field's type, requiredness, options and values stay the owner's. The list read, the by-name read and the layered view serve the same text, and uninstalling the extension serves the owner's text again.
26+
- **Precedence.** A key the tenant has edited keeps the tenant's text (ADR-0029 D9.2a, as for an extension's object `label`). Two extensions patching one key: the higher `priority` wins.
27+
- **Refused when it names nothing.** A patch naming a field the target does not have, an option value its field does not have, or an option of a picklist-bound field is refused at `POST /api/v1/marketplace/install-local` (`400 VALIDATION_ERROR`, every refusal located in `error.details.refusals`, nothing installed) and by `os validate` when the target is in the same stack. At boot such a patch is not applied and is named once in the log; the boot carries on.
28+
- **New export.** `@objectstack/metadata-core` exports the one judge the three readers share: `fieldPatchTargetMisses`, `fieldPatchTargetRefusals`, `fieldPatchTargetRefusalMessage`.
29+
30+
What changes for an existing package: a package that declared `fieldPatches` since the slot landed now sees them applied, and one whose patch names a missing field or option is now refused at install. An extension without `fieldPatches` folds exactly as before.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/data-objectstack': patch
4+
---
5+
6+
perf(console): an app page reads its views, its page and its nav dashboards from the app bundle, and reads the `/meta/view`, `/meta/page` and `/meta/dashboard` lists only for what the bundle does not hold
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
Since the app metadata bundle landed, entering an app downloads the app, its objects and their views, pages and dashboards in one request. The console still read the per-type lists beside it. Now:
12+
13+
- **`view` is no longer read at mount.** An object the bundle holds is composed with the bundle's views. A route's object scope reads the `/meta/view` list only when a name it asks is outside the bundle, and then only for the objects the bundle does not hold; such a scope waits for the list before it answers. The whole object registry still reads the list beside it.
14+
- **The console enters the app's bundle once, at its root**, as soon as the app list names the app, and `AppContent` reuses that entry instead of asking the bundle again. Leaving the app ends the entry, so coming back revalidates it.
15+
- **Whether an object exists** (the presence check of the bell and activity surfaces) is asked without views, so it never reads the `/meta/view` list.
16+
- **The page a page route opens** (`/apps/APP/page/NAME`), the phone bar's page or dashboard title, a dashboard nav entry's label and a recent page's label are read from the bundle first. A name the bundle does not hold, or a same-named item another package owns, is read from the list as before, prefer-local resolution included. The page route no longer waits for the page list to load.
17+
- **The app bar reads views only on an object's view route**, the one title that labels a view.
18+
- **New in `@object-ui/data-objectstack`:** `ObjectStackAdapter.peekAppBundle()` reads the active app bundle without waiting (`none` before an app is entered, `pending` while its first answer is on the wire, `ready` with its items), and the types `AppBundlePeek`, `AppBundleItems` and `AppBundleEntry` are exported. A stale bundle is revalidated with `If-None-Match` and keeps answering from what it holds until the revalidation lands.
19+
20+
Navigation sync still reads the page and dashboard lists after the first paint; that read is not changed here.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): `ActionSchema.params` states the same-name param rule
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `params` member's description now says what the params check already does when an action declares one param name more than once: a name may repeat only for per-gate variants of one input (declarations that differ in `visible` / `requiresFeature`), the name is required only when every declaration of it requires it, and its value is judged by the first declaration's shape (`type`, `multiple`, `options`). Until now this rule was stated only on `validateActionParams`, where an author writing an action does not read. Description text only: no key, no accepted value and no refusal changes, and the generated JSON Schema and reference pages carry the same sentence.

‎content/docs/data-modeling/object-extensions.mdx‎

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Object extensions — extend without forking
33
navTitle: Object Extensions
4-
description: Add fields, validations and indexes to an object another package owns, without forking it — declaration, merge order, and what an extension may not contribute.
4+
description: Add fields, validations and indexes to an object another package owns, or relabel its fields, without forking it — declaration, merge order, and what an extension may not contribute.
55
---
66

77
Every object has exactly **one owning package**. That package defines the table, the
@@ -63,6 +63,7 @@ check that spelling first.
6363
| Key | Merge behaviour |
6464
|:---|:---|
6565
| `fields` | **Additive.** Merged into the target's field map. A name the target already has is **replaced**, not merged. |
66+
| `fieldPatches` | **Applied, field by field.** Changes the *display* of one of the target's own fields without replacing it — [below](#relabelling-a-vendor-field). |
6667
| `validations` | **Concatenated.** Your rules run alongside the owner's; neither replaces the other. |
6768
| `indexes` | **Concatenated**, same as validations. |
6869
| `label` | Replaces the target's label — with one exception, [below](#extensions-and-tenant-customization). |
@@ -76,7 +77,7 @@ Added fields are ordinary fields, so everything on the
7677

7778
### What an extension may **not** contribute
7879

79-
The merge carries the seven keys above and nothing else. These four are not
80+
The merge carries the eight keys above and nothing else. These four are not
8081
"unsupported yet" — there is no slot for them to arrive through, and the schema rejects
8182
each one by name with the alternative to use instead:
8283

@@ -92,6 +93,50 @@ fails at authoring time with a prescription rather than being dropped in silence
9293

9394
---
9495

96+
## Relabelling a vendor field
97+
98+
Replacing a field through `fields` takes it over whole: its type, its options and its
99+
rules become yours, and the owner's next version no longer reaches it. To change only
100+
what a person *reads* — "Industry" shown as "Sector", a better help text — patch the
101+
field instead:
102+
103+
{/* os:check */}
104+
```typescript
105+
import { defineObjectExtension } from '@objectstack/spec/data';
106+
107+
export const AccountWordingExtension = defineObjectExtension({
108+
extend: 'crm_account',
109+
fieldPatches: {
110+
industry: {
111+
label: 'Sector',
112+
inlineHelpText: 'The market the account sells into.',
113+
options: { tech: { label: 'Technology' } }, // addressed by the stored value
114+
},
115+
},
116+
});
117+
```
118+
119+
A patch sets `label`, `description`, `inlineHelpText` and `placeholder` on the field, and
120+
the `label` of an option it addresses by its stored `value` — the display whitelist
121+
(`BASE_FIELD_DISPLAY_WHITELIST`), and nothing else. The field's type, requiredness,
122+
default, formula and which options exist stay the owner's, so the owner's upgrades keep
123+
applying and stored values never change; any other key is refused by name with that
124+
reason.
125+
126+
- **Every read serves it.** The patch is applied in the same merge as the other keys,
127+
after the additive ones — so it can also reach a field a lower-priority extension
128+
added — and the list, the by-name read and the layered view agree. Uninstalling the
129+
extension serves the owner's text again.
130+
- **Conflicts resolve like `label`.** Two extensions patching the same key: the higher
131+
`priority` wins. A tenant who has edited that text keeps their own, [below](#extensions-and-tenant-customization).
132+
- **A patch must name something real.** A field the target does not have, or an option
133+
value its field does not have, is refused when the package installs and by
134+
`os validate` when the target is in the same stack. A field whose options come from a
135+
shared picklist has no option labels of its own to patch. At boot, an unmatched patch
136+
is not applied and is named once in the log; the boot carries on.
137+
138+
---
139+
95140
## Naming the fields you add
96141

97142
Field names in an extension are **not** namespace-prefixed by the platform. The
@@ -140,7 +185,8 @@ survive a customized object rather than being dropped by it.
140185
One deliberate asymmetry, ruled 2026-08-13: an extension's `label`, `pluralLabel` and
141186
`description` apply only while the base still carries the **packaged owner's** value.
142187
Once a tenant has renamed the object, the extension's packaged default yields and the
143-
tenant's name stands. Fields, validations and indexes are unaffected — they merge
188+
tenant's name stands. A `fieldPatches` key yields the same way, one field (and option)
189+
at a time: a field label the tenant edited keeps the tenant's text. Fields, validations and indexes are unaffected — they merge
144190
either way. There is no escape hatch: a package cannot relabel an object a tenant has
145191
deliberately renamed.
146192
</Callout>

‎content/docs/references/data/object.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ const result = ApiMethod.parse(data);
489489
| **operation** | `Enum<'update'>` | optional | The declarative single-record field write, mirroring a list view's `bulkActionDefs`: `'update'` applies `patch` (merged under the collected `params`) to the current record on the data plane AS THE CALLER — never system-elevated — so the caller's permissions, the object's hooks and its validations fire as for a user edit. `type` stays at its default `'script'` (the platform action route the write is performed on); `target`/`body`/`method`/`bodyExtra` are refused beside it. `'delete'` and `'custom'` have no row-level form. |
490490
| **patch** | `Record<string, any>` | optional | For `operation: 'update'` — static field values written to the current record, merged UNDER the user-supplied `params` so a fixed value can be declared without exposing it in the dialog. Written on the data plane as the caller: object permissions, hooks and validations fire as for a user edit. Refused on an action without `operation: 'update'` (it would be silently dropped). |
491491
| **execution** | `Enum<'perRecord' \| 'aggregate'>` | optional | The bulk dispatch contract this action's BODY is written for, in `bulkActionDefs`' own vocabulary: 'perRecord' = one dispatch per selected row carrying that row's `recordId` (the view's `bulkActions: ['<name>']` bare-string form); 'aggregate' = ONE dispatch for the whole selection carrying every id in `params._selectedIds` (a `bulkActionDefs` entry with `execution: 'aggregate'`). Optional with NO default — omit it only when the body genuinely serves both. A list view wiring a declared action under the other contract is refused by `@objectstack/lint` (`action-dispatch-contract-mismatch`). |
492-
| **params** | `{ name?: string; field?: string; objectOverride?: string; label?: string \| Record<string, string>; … }[]` | optional | Input parameters required from user — an ActionParam[] DEFINITION array, never a payload map (a static request body goes in `bodyExtra`). |
492+
| **params** | `{ name?: string; field?: string; objectOverride?: string; label?: string \| Record<string, string>; … }[]` | optional | Input parameters required from user — an ActionParam[] DEFINITION array, never a payload map (a static request body goes in `bodyExtra`). A param name (its `name`, or the `field` a field-backed param reads) may repeat only for per-gate variants of ONE input (declarations that differ in `visible` / `requiresFeature`, e.g. one optional and one required); the params check treats the name as `required` only when EVERY declaration of it requires it, and judges its value by the FIRST declaration's shape (`type`, `multiple`, `options`), so keep that shape identical across them. |
493493
| **submitText** | `string \| Record<string, string>` | optional | Label of the submit button in the action's param dialog, the verb the button performs (e.g. "Send", "Log Call"), in place of the default "Confirm" — the default-language string, or an inline locale map; translated at `objects.OBJECT._actions.ACTION.submitText` (`globalActions.ACTION.submitText` for an object-less action). Only on an action with a non-empty `params`: without one no param dialog opens, so it is refused. Not `confirmText`, which is the message of a param-less action's confirm dialog. A blank label is refused. |
494494
| **variant** | `Enum<'primary' \| 'secondary' \| 'danger' \| 'ghost' \| 'link'>` | optional | Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent) |
495495
| **order** | `number` | optional | Sort order within a location group (lower = higher). Promotes/demotes an action toward the record_header primary button; stable, so actions without `order` keep their registration order. |
@@ -576,7 +576,7 @@ const result = ApiMethod.parse(data);
576576
| :--- | :--- | :--- | :--- |
577577
| **extend** | `string` | ✅ | Target object name (FQN) to extend |
578578
| **fields** | `Record<string, { name?: string; label?: string; type: Enum<'text' \| 'textarea' \| 'email' \| 'url' \| 'phone' \| 'password' \| 'secret' \| …>; description?: string; … }>` | optional | Fields to add/override |
579-
| **fieldPatches** | `Record<string, { label?: string; description?: string; inlineHelpText?: string; placeholder?: string; … }>` | optional | [EXPERIMENTAL — not enforced] Display patches of the target object's own fields, keyed by field name: change a vendor field's display properties (BASE_FIELD_DISPLAY_WHITELIST: label, description, help text, placeholder, option labels) without taking the field over, so its type, values and rules stay the vendor's and its upgrades still apply (ADR-0146 D10). Nothing applies a patch yet: the registry merge that does is rollout card N-23d, and until it lands the engine drops this slot at registration. Example: `fieldPatches: { industry: { label: 'Sector', inlineHelpText: 'The market the account sells into', options: { tech: { label: 'Technology' } } } }`. |
579+
| **fieldPatches** | `Record<string, { label?: string; description?: string; inlineHelpText?: string; placeholder?: string; … }>` | optional | Display patches of the target object's own fields, keyed by field name: change a vendor field's display properties (BASE_FIELD_DISPLAY_WHITELIST: label, description, help text, placeholder, option labels) without taking the field over, so its type, values and rules stay the vendor's and its upgrades still apply (ADR-0146 D10). Applied by the registry merge (`mergeObjectDefinitions`) after the additive merges, on every object read: a tenant's own text keeps winning, and between two extensions the higher `priority` wins. A patch naming a field or option value the target does not have is refused at install and by `os validate`. Example: `fieldPatches: { industry: { label: 'Sector', inlineHelpText: 'The market the account sells into', options: { tech: { label: 'Technology' } } } }`. |
580580
| **label** | `string` | optional | Override label for the extended object |
581581
| **pluralLabel** | `string` | optional | Override plural label for the extended object |
582582
| **description** | `string` | optional | Override description for the extended object |

0 commit comments

Comments
 (0)