Skip to content

Commit 1863f63

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-l0sg2o
2 parents f77171a + 05c3f32 commit 1863f63

330 files changed

Lines changed: 13887 additions & 2754 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/rest': patch
3+
---
4+
5+
fix(rest): `GET /api/v1/meta/form?object=X` now lists only object X's forms
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Who sees it: any client that lists one object's forms through the metadata read, on protocol 19 where an object's forms are `form` items named `OBJECT.KEY`.
11+
12+
- **`?object=` now narrows the form list** to the forms bound to that object (the item's `object`), the way it narrows the view list. Before, the filter was ignored and every form came back with `200`.
13+
- **An object no form names answers an empty list**, as the view list does.
14+
- **Unchanged:** the form list with no `object` filter still lists every form you can see, and `?object=` on the view list answers as before.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
'@objectstack/formula': minor
3+
'@objectstack/spec': minor
4+
---
5+
6+
fix(formula)!: a flow condition that orders a `date` or `datetime` field against a number is now refused, in every spelling
7+
8+
Clause-②: no (narrowing)
9+
Metadata-protocol: narrowed
10+
Skills-docs: none — `skills/objectstack-formula/SKILL.md` already teaches a date field as its ISO text and prescribes `daysBetween(today(), record.due)` for days remaining and `daysFromNow(n)` for a date ahead, and no skill teaches ordering a date against a number
11+
12+
<!-- adr-0087: registered flow-condition-date-number-ordering-refused -->
13+
14+
**BREAKING** accept-set narrowing. In a flow condition (a start, edge or `decision` branch condition) a `date` or `datetime` field reaches the run as its text (`YYYY-MM-DD`, or an ISO-8601 instant), and no overload orders that text against a number. So `due_date > 5` faults on every run, and the flow stops at the condition after the write that fired it has landed. The type check saw the fault and dropped it, so the condition passed `os validate` and the publish door with no finding, in all four spellings: the bare name (`due_date > 5`), `record.FIELD` / `previous.FIELD` (`record.due_date > 5`), an index read (`record['due_date'] > 5`) and a macro variable ranging over the field (`[due_date].exists(d, d > 5)`).
15+
16+
- **The verdict.** Two new codes, graded as date arithmetic is (an error at every flow condition): `date-number-ordering-run-fails` on a record-triggered flow or a sweep of the typed object, `date-number-ordering-run-may-fail` elsewhere. A `record.FIELD` / `previous.FIELD` read keeps the row's arm where bare names are unproven; a bare name a flow variable holds is not judged. Params: `operands`, `operator`, and `reference` (the field as written; an index read is named by its member spelling). The message prescribes `daysBetween(a, b)` or a date-to-date comparison with `daysFromNow(n)` / `addDays(d, n)`.
17+
- **Masking.** A text or boolean mismatch graded a warning no longer hides the ordering behind it: `title > 5 && due_date > 5` gets the error. A mismatch graded an error keeps its code and words.
18+
- **Where.** `os validate` / `os build` (`validateStackExpressions`) report an `error`, and the flow publish door refuses the publish with `INVALID_METADATA` (422). `registerFlow` logs it as an advisory and still registers the flow, so a stored flow keeps its run-time behaviour until it is next published.
19+
- **Not refused.** An ordering against a date or a date text (`due_date > today()`, `due_date > '2026-01-01'`), equality, `daysBetween` / `addDays` / `daysFromNow` over the field. Record-scoped sites (formula fields, validation rules, `visibleWhen` / `requiredWhen`) are not judged by this change. The run-time evaluator is unchanged.
20+
21+
## FROM → TO
22+
23+
| FROM | TO |
24+
|:---|:---|
25+
| `due_date > 5` (more than five days past due) | `daysBetween(due_date, today()) > 5` |
26+
| `record.due_date < 7` (due within the week) | `record.due_date < daysFromNow(7)` |
27+
| `[due_date].exists(d, d > 5)` | `[due_date].exists(d, daysBetween(d, today()) > 5)` |
28+
29+
One-line fix: in a flow condition, never compare a date field with a number; compare a span from `daysBetween(a, b)` with the number, or compare the date with a date from `daysFromNow(n)` / `addDays(d, n)`.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
fix(spec)!: a field whose inline `options` declare one value twice is refused at every author door, as a shared picklist with a repeated value already was
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: narrowed
9+
Skills-docs: none — `skills/objectstack-data/references/examples-objects.md` teaches inline select options and already declares each value once; the refusal names the value, both entries and the fix
10+
11+
<!-- adr-0087: registered field-option-value-repeated-refused -->
12+
13+
**BREAKING** accept-set narrowing. FROM a field (on an object or an object extension, any type that takes `options`) whose `options` declare the same `value` in two entries saving, publishing and passing `os validate` / `os build`, TO that field refused by the field schema at every door: the metadata save (draft or active) and publish answer `422 INVALID_METADATA` with an issue at `fields.NAME.options.INDEX.value`, and `os validate` / `os build` report the same issue. The message reads `This field's \`options\` would carry the value 'a' twice: it is declared by option 0 and again by option 1.`, worded as the shared-picklist refusal is.
14+
15+
Why. A record stores an option's value, and every reader that shows the record maps the stored value back to one option, so a repeated value left its label and colour ambiguous in lists, chips and reports. A shared `picklist` whose options repeat a value was refused at registration; the same list written inline on the field passed every door silently. The `Field.select(['In Progress', 'in progress'])` string form, whose two labels derive one value, is refused the same way.
16+
17+
A stored object whose body carries the repeat still registers at boot and is served badged invalid; it is refused at its next save or publish until the repeat is removed. A stored object extension row carrying the repeat is not registered at boot (the loader logs and skips it), so the fields it adds are absent until the row is fixed: before upgrading, run `os validate` for packaged extensions and read each runtime-authored extension's `_diagnostics` on the metadata read. No conversion rewrites it (which label the author meant is not recorded); the ADR-0087 semantic entry `field-option-value-repeated-refused` carries the rewrite to the upgrade guide.
18+
19+
## FROM → TO
20+
21+
| FROM | TO |
22+
|:---|:---|
23+
| `options: [{ value: 'a', label: 'A' }, { value: 'a', label: 'A2' }]` | `options: [{ value: 'a', label: 'A' }, { value: 'a2', label: 'A2' }]` |
24+
25+
One-line fix: declare each option value once; remove the repeated entry, or give it a value of its own.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
'@object-ui/plugin-report': patch
5+
---
6+
7+
feat(console): reports are designed in place inside design mode, gated like dashboards
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
A report no longer has an edit state of its own beside the design mode; it is designed inside it, as a dashboard is:
13+
14+
- while the mode is on, the report on screen is drawn in its editor: the report builder for a report it can hold, the report panel beside the report for a joined or pre-dataset one. Neither has a 「Save」, 「Discard」 or close button of its own: the bar's 「Save」 publishes the report and its 「Cancel」 drops the edit and returns the page read-only;
15+
- the edited report is staged with the mode under its item key, so moving to another page and back keeps the edit, one 「Save」 publishes every report and dashboard edited, and the app menu's entries that open the report commit after it;
16+
- a report that cannot be saved (a draft already pending where the save would land, a walled customization door, no installed version to customize, no package to save into, nothing authored to read) is drawn read-only with the reason when it is selected, and nothing can be staged for it;
17+
- outside the mode, the report header's 「Edit」 enters the mode with that report selected, and so does a report opened from a Studio list; the 「×」 back to that list stays on the page and in the builder;
18+
- who may design a report is now who may design a dashboard: a workspace admin holding metadata authoring (`manage_metadata`). The report's 「Edit」, the reports index's 「New report」 and the new-report page follow it; an admin without metadata authoring gets none of them;
19+
- a new report is still made from the reports index, with the builder's own Save and Close, outside the mode;
20+
- the save's result list calls a report 「Report: NAME」 in every language pack.
21+
22+
`ReportBuilder` (`@object-ui/plugin-report`) takes `onSave`, `onDiscard` and `onClose` as optional: a host that saves the report elsewhere hands none, and the header draws none of the three.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
feat(console): a Studio list click on a dashboard opens its app in design mode with that dashboard selected, and the design bar's × goes back to the list
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Opening a dashboard from an App Studio list no longer swaps into a separate edit state of the dashboard:
11+
12+
- the click opens the dashboard's app (the same app as before) in design mode with that dashboard selected and editable in place; the bar's 「Save」 and 「Cancel」 are its only Save/Cancel. The click carries the selection by item type and name, and the page that draws the item takes it, so another designable kind joins by its page taking the selection;
13+
- the design bar draws a × after 「Save」 that goes back to the App Studio list the click came from, wherever in the app the mode has moved since. While anything is staged it asks first; staying keeps every staged change, going drops them and returns to the list. The 「New dashboard」 entry from a Studio list draws the same ×;
14+
- while the bar draws its ×, the page header's own × back to App Studio is not drawn; once the mode is off (after 「Save」, 「Cancel」 or a reload) the page's × is back and still returns to the list, because the page address keeps it (`?studio=`);
15+
- a dashboard with no published version still opens App Studio's own item page, and a report still opens in its builder;
16+
- the app route `design/dashboard/NAME`, which nothing in the console linked to, is removed; a dashboard is designed in place in design mode.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@object-ui/app-shell": patch
3+
"@object-ui/i18n": patch
4+
---
5+
6+
A shared list view's structure is now changed through the design mode; outside it, a shared view offers only 「Reset」 and 「Save as my view」 (objectstack#39377).
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
Who sees it: an administrator on a list page whose open view is a shared (saved) view.
12+
13+
- **Before:** the list's 「Update view」 → 「Save to this view」 asked for confirmation and saved and published the shared view at once, and the view settings panel saved it with its own Save.
14+
- **Now, outside the design mode:** the list's draft offers 「Reset」 and 「Save as my view」 only, and the view settings open read-only with a line saying the view is changed in the design mode. Nothing is written to the shared view.
15+
- **Now, inside the design mode:** 「Update view」 → 「Apply to this view」 stages the list (columns, their order, grouping, the default filter and sort) for the bar's 「Save」, and each edit in the view settings is staged the same way. The bar's 「Save」 saves and publishes the view; 「Cancel」 drops it unwritten. A view whose package is read-only, or that has unpublished changes in App Studio, is refused when it is selected, and the view settings say why.
16+
- An ad-hoc filter or sort, column widths and the row height stay the reader's own and never light the bar's 「Save」. The reader's own views save at once, as before. Creating, deleting, renaming, pinning and sharing a view are unchanged.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@object-ui/app-shell": patch
3+
"@object-ui/i18n": patch
4+
---
5+
6+
feat(app-shell): a custom page selected in design mode offers "Design this page in Studio"
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
Who sees it: an administrator who may author metadata, in an app's design mode, on a custom app page.
12+
13+
- **The page shows a strip with 「Design this page in Studio」.** It opens the page's item in Studio; Studio's back button returns to the page. The page itself stays read-only: custom pages are designed in Studio, not in place (objectstack#39378, epic objectstack#39368).
14+
- **With changes staged it asks first.** It uses the mode's own question, 「Leave Design mode? Your unsaved changes will be lost.」; with nothing staged it opens at once.
15+
- **Absent** outside design mode, for a caller the Studio design gate refuses, and for a package Studio cannot write.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): a stored 18.x form overlay row that holds the protocol-19 switch now says how to clear it
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Who sees it: an administrator upgrading a deployment whose 18.x database holds a form saved over the API as a flattened view row (`{ object, viewKind: 'form', type, sections }`, no `config`).
11+
12+
- **The switch still refuses the row, and now names the way out.** The upgrade reads no form out of such a row, so it holds the switch. `os migrate stored-forms` (and the preview of `os migrate protocol --to 19`) and the line the server logs when a public form door meets the row both told the administrator to repair "a `form` or `formViews` entry that is an object", which such a row does not have, and saving the row again keeps it as it is. Both now name the remedy that clears it: on the 18.x release you are running, delete the row (`DELETE /api/v1/meta/view/NAME`, with `?package=PACKAGE` where it is saved in a package), re-create its form as a form item named `OBJECT.KEY` whose `config` carries the form body (in Studio, a new form on the object), point anything that opened the old name at the new one, and run the upgrade again: the new item moves. A row already named `OBJECT.KEY` is re-created under the same name.
13+
- Other unreadable rows (a container whose `form` or `formViews` is not an object) keep the fix they had.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@object-ui/app-shell": patch
3+
"@object-ui/plugin-report": patch
4+
---
5+
6+
fix(app-shell, plugin-report): dataset pickers put a real match before the typed text, member names follow the picked field, and a member with no label reads as its source field
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
Who sees it: a Studio author building a dataset, a report or a dashboard card, and anyone reading a saved dataset report.
12+
13+
- **The searchable pickers rank a real match first.** In the dataset designer's base-object and field pickers, the dashboard card's data-source picker and every other designer combo, an option whose label or name is what you typed comes first, then one that starts with it, then one that contains it. The "Use «text»" row is now last, so pressing Enter after typing a field's label (for example 紧急) picks that field instead of storing the typed text as a field name. With no match the row is the only one, and Enter still uses the typed text.
14+
- **A member name filled in by a field pick follows the next pick.** Picking a field for a dimension or measure whose name is empty, or still the name the previous field filled in, now names it after the newly picked field. A name you typed yourself is kept.
15+
- **A dimension or measure with no label of its own shows its source field's label** — 紧急程度 rather than `jinji_chengdu` — in the report and dashboard-widget member pickers, as the dataset designer's Label placeholder, and as the saved report's table, matrix and chart header. A label you wrote still wins, a row `count` keeps its caption, and nothing is written into the dataset. A member reading a field through a relationship (`account.region`) keeps its name in the saved report's headers.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/plugin-sharing': patch
3+
---
4+
5+
fix(plugin-sharing): an assignment rule created from Setup is stamped with the administrator's organization instead of being refused with "Organization is required"
6+
7+
Clause-②: yes (narrowing)
8+
Metadata-protocol: none
9+
10+
Who sees it: an organization administrator creating an assignment rule in Setup → Assignment Rules, or through `POST /api/v1/data/sys_assignment_rule`.
11+
12+
- **Creating a rule no longer needs an organization in the request.** The form has no organization field, so every create was refused with `400 VALIDATION_FAILED` on `organization_id`. The rule now lands in the caller's active organization, the way a queue does.
13+
- **A stored rule still always belongs to one organization.** The column is the platform's tenant column, created NOT NULL, and a create that would land in no organization is still refused naming `organization_id`. A create that names its organization is stored under it, and on a walled deployment the tenant wall still refuses one outside the caller's organizations.
14+
- `organization_id` on `sys_assignment_rule` is now the platform-provided tenant column, the one `sys_queue` carries: hidden in forms, with no label or help text of its own, and read-only.
15+
- **A create that names an `organization_id` is no longer checked as a reference.** The tenant column is read-only, so the engine's reference check skips it. Where the tenant wall does not judge the column (the `single` posture), a value naming no organization is stored as sent, and that rule routes nothing. `sys_queue` behaves the same today; the platform-wide fix is tracked in #39482.
16+
- **BREAKING:** an update through the data API that names a different `organization_id` no longer moves an assignment rule to that organization. On a walled deployment, a value outside the caller's organizations is refused by the tenant wall first. Anywhere else the value is dropped as read-only, with a warning in the server log, the update succeeds without it, and the rule stays in the organization it was created in, as a queue does. Create the rule in the organization it belongs to instead.
17+
18+
<!-- adr-0087: not-required (no-migration-prescription) a runtime data-API narrowing on a platform table: no metadata key, schema or stored declaration changes, so `objectstack migrate meta` has nothing to rewrite; an affected caller creates the rule in the organization it belongs to -->

0 commit comments

Comments
 (0)