Skip to content

Commit a5f3362

Browse files
chore(approvals): merge main into the approvals trunk again (#38497 refresh 2) (#38797)
1 parent fe50943 commit a5f3362

157 files changed

Lines changed: 6863 additions & 487 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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/cli': patch
4+
---
5+
6+
feat(metadata-protocol): the stored-form ceremony's write half, the `--apply` the next major's upgrade command runs (ADR-0159 D7)
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
`applyStoredFormsOf(protocol, { actor })` runs the census `os migrate stored-forms` prints and acts on it, all or nothing with the switch: when the precheck counts any row, it writes nothing and every stored row stays byte-equal. Otherwise it ensures the `.custom` pairs the moves land in (they stay if the run fails; an empty pair changes no answer and the next run reuses it), then, in one transaction, writes each form that is kept with a carried withdrawal or moved as a `form` row at its destination, with its body as stored (a folded row's withdrawal switches the kept form off, its link kept; a declared override is written as its pair's own row), reads each one back, and only then deletes or re-saves the old rows: a view item row is deleted, a stored container is re-saved without the forms that left it (its lists and the forms it keeps byte-equal), and a container left with nothing is deleted. Internal record forms are removed the same way, with their bodies in the result. Forms left in place and drafts are not touched; a second run moves nothing. On a database whose default driver cannot roll a transaction back, a run that would write or take a row is refused before anything is written, naming the driver and what to do (run against a database whose driver supports transactions, or stay on the current release). It is exported for the major's upgrade command only; `os migrate stored-forms` stays read-only.
12+
13+
The census gains three readings: a withdrawal in a `view` row a `form` row outranks at its place, and one in a second pair's declared override, are read today, so the fold does not name the form newly closed; a row bound to a package that ships no form of the name moves into the pair as its own item where the base records no version (that item declares no `basedOn`); and where no pair id can be derived from a base, the refusal names why in words. Two more keep the census and `--apply` in step: a move, or a kept row that carries a withdrawal, whose destination row the store seals (a managed package ships the form's name as a `form` item, and the destination is not a declared override) holds the upgrade, naming that package, instead of failing the run; and a form no door serves today is left in place by the upgrade, whatever package its row is bound to (`served_by_no_door`, a new member of the exported `StoredFormLeftReason`), which `os migrate stored-forms` prints; such a form does not hold the upgrade at the pair door or at a sealed destination either. On a database that cannot roll back, `os migrate stored-forms` says the upgrade's run will be refused (`runRefused` in `--json`).
14+
15+
The operations page `content/docs/deployment/stored-forms-upgrade.mdx` says what the upgrade command writes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@object-ui/plugin-detail': minor
4+
'@object-ui/app-shell': minor
5+
'@object-ui/types': minor
6+
'@objectstack/platform-objects': minor
7+
'@objectstack/metadata-core': minor
8+
'@objectstack/lint': minor
9+
---
10+
11+
feat: an object can draw field groups as tabs of its record page, with `fieldTabs`
12+
13+
Clause-②: yes (widening) — `ObjectSchema` gains the optional `fieldTabs: [{ key, groups }]`; `@object-ui/plugin-detail` exports `fieldTabIdOfField` and the type `RecordPageFieldTab`, and `DefaultPageColumns` gains the optional `fieldTabs`
14+
Metadata-protocol: added
15+
16+
`fieldTabs: [{ key: 'content', groups: ['content', 'import'] }]` takes the named field groups out of the standard record page's overview and draws them as a tab right after it (`?related=fields:content`), before the related lists and the built-in tabs, in declared order; on a pinned page the first field tab is the one open beside the overview. The tab's title and icon are its first group's, and a one-group tab draws no second heading. The overview keeps the groups no tab names, the ungrouped fields, the body tables and the approval band. Each tab has its own "show empty fields" row; a tab whose groups are all hidden (`visibleWhen`) or missing on the served object is not drawn; the reader cannot move or hide these tabs; a cited `?section=` inside a tab opens that tab first. The entry form, print pages and authored pages are unchanged.
17+
18+
The parse refuses a group the object does not declare, a group two tabs name, a group with `relatedList`, a repeated `key`, and the form-level keys (`fields`, `label`, `icon`, `visibleWhen`); the undeclared-group refusal and the `fields` refusal name the form-level `FormSchema.fieldTabs`, which lists field names. `FormSchema.fieldTabs` in `@object-ui/types` refuses a missing `fields` with a message naming `ObjectSchema.fieldTabs`. An object extension cannot write the key. `composeStacks` with `objectConflict: 'merge'` refuses two declarations of one object whose `fieldTabs` differ, as it does every other object-level collection. The object metadata form offers it as a repeater. `os lint` warns (`object/field-tabs-empty-overview`) when the tabs take every field out of the overview.
19+
20+
Absent: unchanged. Nothing to migrate.

‎.changeset/37815-body-capabilities-every-gate.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Skills-docs: follow-up #38655
1111

1212
<!-- adr-0087: registered hook-and-action-bodies-calling-an-ungranted-gate-refused -->
1313

14-
**BREAKING** for the publish of an action, an object or a hook whose authored L2 body calls a member the QuickJS sandbox gates without that member's token in `body.capabilities`. Such a body saved and published before; the sandbox refused the call with `403 INSUFFICIENT_PRIVILEGES` every time the body reached it, so it never worked. It is refused now, at the runtime publish door and in `os validate` / `lint` / `compile` / `build`, with the token named. The schema is unchanged and stored metadata is not rewritten or refused at boot; the refusal comes at the next publish.
14+
**BREAKING** for the publish of an action, an object or a hook whose L2 body calls a member the QuickJS sandbox gates without that member's token in `body.capabilities`. Such a body saved and published before; the sandbox refused the call with `403 INSUFFICIENT_PRIVILEGES` every time the body reached it, so it never worked. It is refused now, at the runtime publish door and in `os validate` / `lint` / `compile` / `build`, with the token named. The schema is unchanged and stored metadata is not rewritten or refused at boot; the refusal comes at the next publish.
1515

1616
The gates are the sandbox runner's own, token by token, and the rule's list is pinned to the runner's source: the `ctx.api.object(…)` read leaves (`find`, `findOne`, `count`, `aggregate`) behind `api.read`, the write leaves behind `api.write`, `ctx.api.transaction(…)` behind `api.transaction`, `ctx.log.debug|info|warn|error(…)` behind `log`, `ctx.crypto.randomUUID()` behind `crypto.uuid`, `ctx.email.send(…)` behind `email.send`, `ctx.activity.append(…)` behind `activity.append`, and on a hook body `ctx.title(FIELD)` with an argument behind `api.read` (`ctx.title()` needs no token).
1717

18-
- `hook-body-capability-undeclared` (new): an authored L2 hook body that calls any of those gates without its token. A hook body is never granted `email.send`, so its `ctx.email.send(…)` call is refused with the remedy that works: remove the call and send the mail from an action, a job or a flow. Only a body the author wrote is judged: a hook body `os build` / `os verify` lowered from an inline `handler` is not, since its grant is the build's inference (the lowered reading is #38653). Runs on the runtime `hook` door.
19-
- `action-body-capability-undeclared` (new): an authored L2 action body that calls a gate other than the writes without its token. An action body `os build` / `os verify` lowered from an inline `target` function is not judged for these tokens, since its grant is the build's inference (the lowered reading is #38653); its writes are still judged under `action-body-write-capability-undeclared`. Runs on the runtime `action` and `object` doors.
18+
- `hook-body-capability-undeclared` (new): an L2 hook body that calls any of those gates without its token. A hook body is never granted `email.send`, so its `ctx.email.send(…)` call is refused with the remedy that works: remove the call and send the mail from an action, a job or a flow. A hook body `os build` / `os verify` lowered from an inline `handler` is judged the same way: its grant is the one the build inferred from its calls, and the build reads each gated call in each spelling the rule reads. Runs on the runtime `hook` door.
19+
- `action-body-capability-undeclared` (new): an L2 action body that calls a gate other than the writes without its token. An action body `os build` / `os verify` lowered from an inline `target` function is judged the same way, against the grant the build inferred from its calls. Runs on the runtime `action` and `object` doors.
2020
- `action-body-write-capability-undeclared` is unchanged: an action body's write without `api.write` keeps its id and its words.
2121

2222
## FROM → TO
@@ -25,6 +25,6 @@ The gates are the sandbox runner's own, token by token, and the rule's list is p
2525
- Authored action body, other tokens (arm b). FROM: `body: { language: 'js', source: 'await ctx.api.transaction(async () => { … })', capabilities: ['api.write'] }` saved and threw at every run. TO: declare the token, `capabilities: ['api.write', 'api.transaction']` (likewise `log`, `crypto.uuid`, `email.send`, `activity.append`, `api.read` for the call the finding names).
2626
- Authored hook body calling `ctx.email.send(…)`. FROM: saved and threw at every run. TO: remove the call and send the mail from an action, a job or a flow.
2727

28-
A hook whose body was lowered from an inline `handler` is unchanged: FROM and TO alike, it is not judged by this rule. So is an action whose body was lowered from an inline `target` function, for every token but `api.write`: FROM, `actions: [{ …, target: async (ctx) => { await ctx.api.transaction(…) } }]` built clean; TO, it still builds clean, and its writes are judged as before.
28+
A hook written as an inline `handler`, and an action written as an inline `target` function, need no change: the build infers the grant from each gated call in each spelling the rule reads (`?.`, whitespace or a comment between steps, the optional call), so the body it lowers carries the token. FROM, `actions: [{ …, target: async (ctx) => { await ctx.api.transaction(…) } }]` built clean; TO, it still builds clean, its lowered body granted `api.transaction`.
2929

3030
`os explain hook-body-capability-undeclared` and `os explain action-body-capability-undeclared` carry an entry for each. `@objectstack/lint` exports the two rule id constants, `ACTION_BODY_CAPABILITY_UNDECLARED` and `HOOK_BODY_CAPABILITY_UNDECLARED`. `@objectstack/spec` adds only the upgrade-guide entry `hook-and-action-bodies-calling-an-ungranted-gate-refused`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the `objectstack-platform` always-on capabilities eval no longer fails an answer for showing the `--preset minimal` form
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-platform/evals/config-plugins-ops.json`, eval 20 (must `storage` and `settings` be listed in `requires:`?): the expected answer says the two are always-on and that under `--preset minimal` "they must be listed", while `must_not_contain` forbade `requires: ['storage', 'settings']`, the spelling of exactly that listing. An answer that got the question right and showed the minimal-preset form was graded a fail. The forbidden literal is dropped; `must_contain: ["--preset minimal"]` still requires the answer to scope the listing to that preset. The case has a new case hash, so `skill-evals --regrade` sets it apart from a round recorded before this change: compare it across rounds only after a re-run. The prompt, the expected answer and every other eval are unchanged.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): Studio's record page ‹ › under the "Loose" source filter no longer ask for the package list or wait on it
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The record page's ‹ › on an item opened from the Studio list filtered to "Loose" (`source=loose`) asked for the package list and waited for its answer before they were ready, though the Loose filter reads only whether a row names a package. They now ask for it, and wait on it, only under the two source values that read a row's package verdict ("modified and new", "system-shipped"). The order ‹ › walk is unchanged.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/lint': minor
3+
'@objectstack/cli': patch
4+
'@objectstack/spec': patch
5+
---
6+
7+
feat(lint)!: a hook or action body beside a string `handler` or `target` is judged for every capability it calls, like any other body
8+
9+
Clause-②: no (narrowing)
10+
Metadata-protocol: narrowed
11+
12+
<!-- adr-0087: registered lowered-hook-and-action-bodies-capabilities-judged -->
13+
14+
**BREAKING** for the publish of a hook or action whose body sits beside a string `handler` or `target`, lowered by the build or written by hand, when that body calls a member the QuickJS sandbox gates without the member's token in `body.capabilities`. The rules took such a body for one the build lowered and skipped it: `hook-body-capability-undeclared` did not judge a hook body the build lowered, nor any hook body beside a string `handler` at the runtime publish doors, and `action-body-capability-undeclared` did not judge an action body beside a string `target` (its writes were judged, under `action-body-write-capability-undeclared`). Both judge it now, at the runtime publish doors and in `os validate` / `lint` / `compile` / `build`, with the token named. Such a body never worked: the sandbox refused the call with `403 INSUFFICIENT_PRIVILEGES` every time the body reached it. A body written by hand declares the token in `body.capabilities`; a build artifact is rebuilt.
15+
16+
An inline `handler` or `target` function needs no change: `os build` infers the grant from each gated call the rule reads, in each spelling the rule reads. That is every gate of the rule's census through `ctx.MEMBER`, a local bound once to it, a destructure off `ctx`, a handle bound once to `ctx.api.object(…)` and a hook handler's destructured context parameter (and, past the rule, a renamed one), with `?.` or whitespace on either side of a step, the optional call `LEAF?.(…)`, and a comment between steps. Before this release `os build` read `ctx.log?.info(…)`, `ctx?.crypto.randomUUID()`, `ctx.activity?.append(…)`, `ctx.email?.send(…)`, `ctx.title?.(field)`, the same calls with whitespace or a comment between steps, and their rebound siblings as no call at all, so the handler lowered without the token and failed at the call; it now lowers with it. A hook handler that calls `ctx.email.send` in any of those spellings is refused by the hook parse at build, as `ctx.email.send(…)` already was: a hook body is never granted `email.send`. The build's reading is pinned against the rule's, spelling by spelling, by judging each one both ungranted (a finding) and lowered (none); it is a superset of the rule's reading by that enumeration, not by proof. Measured over the first-party example and connector apps, loaded, normalized and lowered as `os validate` does: no body newly refused.
17+
18+
## FROM → TO
19+
20+
- A hook body beside a string `handler`, written by hand or left by a build artifact. FROM: `hooks: [{ …, handler: 'my_hook_fn', body: { language: 'js', source: "const l = ctx.log; l.info('x')", capabilities: [] } }]` published clean and threw at every run. TO: refused with `hook-body-capability-undeclared` naming `log`; declare `capabilities: ['log']`, or rebuild the artifact (the build grants `log`).
21+
- An action body beside a string `target`, written by hand or left by a build artifact. FROM: `actions: [{ …, target: 'my_action_fn', body: { language: 'js', source: 'await ctx.api.transaction(async () => { … })', capabilities: ['api.write'] } }]` published clean and threw at every run. TO: refused with `action-body-capability-undeclared` naming `api.transaction`; declare `capabilities: ['api.write', 'api.transaction']`, or rebuild it.
22+
- An inline handler that spells a gated call with `?.`. FROM: `handler: async (ctx) => { ctx.log?.info('x'); }` lowered to `capabilities: []` and failed at the call. TO: it lowers to `capabilities: ['log']` and runs.
23+
24+
`os explain hook-body-capability-undeclared` and `os explain action-body-capability-undeclared` no longer say a lowered body is exempt. `@objectstack/lint` now exports `SANDBOX_CAPABILITY_GATES` and its `SandboxCapabilityGate` type, the sandbox's gate census the rule judges by. `@objectstack/spec` adds only the upgrade-guide entry `lowered-hook-and-action-bodies-capabilities-judged`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/knowledge-pgvector': patch
3+
---
4+
5+
feat(knowledge-pgvector): the store runs the vector leg alone, the keyword leg alone, or both, as a source's retrieval mode says
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
`knowledge-pgvector` now reports the retrieval modes it runs (`capabilities.retrieval`: `vector`, `keyword` and `hybrid`, with `hybrid` by default) and honours the mode the knowledge service hands it on each search (`AdapterSearchOptions.retrieval`). `hybrid`, and a search that carries no mode, run exactly as before: both legs, merged by reciprocal rank fusion, with every score unchanged to the last bit. `vector` runs the cosine scan alone and `keyword` the keyword match alone; the other leg is not written into the statement, and a hit's score is `61 / (60 + rank)`, so the first is 1. `keyword` does not embed the question, ranks passages of equal keyword score by chunk id, and answers nothing for a question with no term to match. A mode it does not list is refused (`400 VALIDATION_ERROR`), never run. The keyword index is kept whatever the mode, so changing a source's mode rebuilds nothing.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/service-knowledge': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
feat(service-knowledge): the knowledge service reads a source's retrieval mode
7+
8+
A search of a knowledge source now runs in its effective retrieval mode: the
9+
mode the source declares (`source.retrieval.mode`), else its store's default
10+
(`capabilities.retrieval.default`). The mode is handed to the store on every
11+
search and logged at `debug` with where it came from; it is not in what a
12+
search answers the caller. `index_status` carries each source's `retrieval`
13+
(the mode, its origin, the store's modes, a refusal) and each mounted store's
14+
modes.
15+
16+
A source that declares a mode its store does not run is never searched
17+
another way. It is refused at its save (`400 VALIDATION_ERROR`, listing the
18+
modes the store runs), at registration in code (`registerSource`) when its
19+
store is already registered,
20+
once after boot at `error` (`reportUnsupportedRetrieval`), and on every search,
21+
where it is listed in `refused` with `SERVICE_UNAVAILABLE` (503). It still
22+
builds and syncs its index: a published item (a package install, the stack's
23+
`knowledgeSources`) meets no save and is registered and indexed as usual, and
24+
the boot's reading and every search refuse it. A store that reports no modes (knowledge-memory)
25+
takes only a source that leaves the mode out.
26+
27+
Clause-②: no
28+
Metadata-protocol: none

0 commit comments

Comments
 (0)