Skip to content

Commit 2f344f7

Browse files
committed
Merge origin/main (2fba834) into the approvals trunk (#38497 refresh)
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmPpwJymVUdp5AnRPBq
2 parents 77e9486 + 2fba834 commit 2f344f7

77 files changed

Lines changed: 2548 additions & 638 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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
fix(metadata-protocol)!: the writes, the restart and the action doors that name no package give the answer the read names
7+
8+
Clause-②: no (narrowing)
9+
Metadata-protocol: none
10+
11+
<!-- adr-0087: registered bare-write-beside-disabled-row-refused-naming-shippers, hydrated-doc-row-wears-no-holder-envelope, environment-action-on-another-object-answers-first, package-less-action-row-judged-at-its-key -->
12+
13+
**BREAKING** for a caller that writes or reads a shared name without naming a package, shipped as `patch`: no key an author writes changes (`Metadata-protocol: none`). Four doors that name no package answered by save or registration order, or disagreed with the read of the same name; each now gives the read's answer. Naming the package (`?package=ID`, or `packageId` in process) writes or reads that package's item exactly as before.
14+
15+
- **A bare write beside a disabled package's row** (#34346). Two enabled packages ship the name and its stored rows are bound to a disabled package and to one shipper, with no package-less row of the name. FROM the bare publish save answering 200 and writing that shipper's row, and the bare draft save and delete refusing naming that shipper and the disabled package, TO all three refusing `409 RESOURCE_CONFLICT` naming the two shippers, as the bare read does, never the disabled package, and writing or removing nothing.
16+
- **A doc row hydrated after a restart beside two holders, a disabled one counted** (#34417, ruling 6942962369). FROM the row wearing the first registered holder's envelope, so `?package=FIRST` served the environment's row and every read naming no package refused 409, TO every read naming no package serving the environment's row and `?package=FIRST` serving that holder's own doc.
17+
- **The environment's own action on another object** (#33904, ADR-0150 D4). A package holds an action name on one object (or object-less) and the environment stores its own package-less action of the name on another. FROM the plain read, `/layers` and `/published` naming no package serving the package's action, the merged list naming only it, and the bare delete removing the package's row, TO those reads serving the environment's action, the list naming both, and the bare delete removing the environment's row.
18+
- **The merged action list where a package binds the object** (#33904, ADR-0150 D4). The list now slots an action at its `(package, objectName, name)` key wherever a package's action of the name binds the object, object-less being a key of its own. Three cells move with no environment-own action. Two packages hold the name on two objects and a package-less row is stored on one: FROM the row listed under both packages and the second package's own action dropped, TO the row listed under its object's package and the second package's own action listed. A list scoped to a package whose action is bound to one object, beside the environment's row on another: FROM that package's slot serving the environment's row, TO its own action. A platform action of the name (no package, no stored row) on one object, or object-less, beside a package's action on another object, or object-less: FROM the platform action dropped, TO both listed. Where no package holds the name, the list slots by name as before.
19+
- **A package-less action row beside an enabled and a disabled holder on its object** (#34258). FROM the read naming no package answering 404 when the disabled holder registered first, TO 200 serving the row as the enabled holder's customization in both orders. And where every holder on the row's object is disabled while an enabled package holds the name on another object: FROM 200 serving the row (the name, not the key, was judged, and it had an enabled holder) TO 404, as a key whose every holder is disabled answers with no other holder of the name.
20+
21+
The registry's heal for a package-less overlay row whose every holder is disabled (#33127) now keeps it recorded with no holder, so enabling one holder rebuilds it under that holder's envelope; no door's answer moves.
22+
23+
The fix for a caller that relied on the old answer: name the package it means. `os migrate meta --from 18` lists the four entries.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the objectstack-formula entry file becomes a router
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-formula/SKILL.md` goes from 24.4 KB to 9.0 KB (485 lines to 135). It now holds five things: four first checks (the installed version wins over the `compatibility` line; read the object's declared fields and the contract of the key that takes the expression; bare CEL under the `F`, `P` or `cel` tag, never braces round a field reference; verify with `os validate`, `os build` or the `validate_expression` agent tool), one type-checked block that shows each tag once, the roots and the advertised function names as one list, eight traps, and a table that says where to go for the rest. No rule's teaching changes. This skill has no hand-written reference file, so no text moved: what left the entry was cut, and this entry says what now answers it.
11+
12+
**What the entry keeps.** Every name of `CEL_STDLIB_FUNCTIONS`, as a call form with its parameters and without the per-function notes. The eight traps, each an expression that parses and then fails, or reads wrong, at run time or at the build: `has()` is not a null check on a server-evaluated predicate, where the guard is `!= null` and the build refuses an ordering or arithmetic operator on a nullable field without it, a flow condition's bare name included; action `visible` / `disabled` are client-side and sparse, so their guard is `has(record.x) && record.x != null`; a transition compares `previous`, which is per row on a bulk write and `null` on insert, and a hook `condition` that cannot evaluate aborts the write; a list field is never compared with a scalar (`list-equality`), with the membership form for a CEL site, a flow condition and a `SharingRule` `condition`; a `date` / `datetime` field is its ISO text (`date-text-call`), with the helpers that replace date arithmetic; `label()` and the working-day functions belong to a formula or a stored field's `expression`; a dynamic seed value is the `cel` tag, never a JavaScript date; a `template` is not CEL, and only an email template reads a currency code from the send's data. The routing table keeps three more facts beside the rows that send them elsewhere: a `formula` field is virtual, so a filter, a sort and a search refuse it; a view filter is a structured rule or a date macro, not CEL; a form-view `visibleWhen` is client-side and faults open, so it is never access control.
13+
14+
**What left, and what answers it now.**
15+
16+
- The per-function tables (what each function returns, `today()` as a calendar day at UTC midnight, `addMonths` clamping to the month end, `floor` and `ceil` rounding toward the infinities, the `rmbUpper` example, what `isBlank` and `isEmpty` count as empty), the date recipe for an inclusive span, and the working-day counting rules (the start day is not counted, the end day is): https://objectstack.ai/docs/data-modeling/formulas. An unknown or misspelled function fails `os build`, with a did-you-mean when an advertised name is close.
17+
- The legacy translation table beyond the rows first check 3 keeps (`IF`, `CONCAT`, `TODAY()` / `NOW()`, `IN (…)`, `ISCHANGED`, the functions with no CEL counterpart): the same page, "Migration from the legacy formula DSL". Each legacy spelling fails the build.
18+
- The table of surfaces that take an expression, the carriers of the `cron` and `template` dialects, the cron grammar and the refused `Object.titleFormat`: the contract, `node_modules/@objectstack/spec/src/shared/expression.zod.ts` and the schema of the key in hand. A save and `os validate` refuse the retired key.
19+
- The table of where `previous` is bound, the rule that a `before*` handler's per-row rewrite must assign one key set on every row (`MULTI_UPDATE_HOOK_KEY_DIVERGENCE`): `skills/objectstack-data/references/data-hooks.md`, which the routing table names.
20+
- The skill-boundary table: the frontmatter description and the routing table.
21+
- Cut with no pointer, because nothing an author writes depends on them: the engine named behind each dialect, the receiver-method note and the four withheld primitives, the tenure-in-years recipe (a `daysBetween` divided by 365), and the sentence that a `SharingRule` whose condition does not lower is skipped at run time (the build fails first).
22+
23+
**Anchors that no longer exist in `SKILL.md`.** Every section heading of the old file below its title: `#skill-boundaries`, `#core-contract`, `#cel-syntax-cheat-sheet`, `#has-is-not-a-null-check`, `#objectstack-cel-standard-library`, `#mandatory-patterns-for-ai-emission`, `#1-computed-text-formula--always-coalesce-nullable-operands`, `#2-conditional-numeric-formula--guard-divisor`, `#3-predicate-field-rules--visibility--validation`, `#4-dynamic-seed-value--use-cel-not-new-date`, `#5-update-hook-condition--previous-vs-record`, `#mechanical-translation-table-legacy--cel`, `#surfaces-that-take-an-expression`, `#cel-surfaces-predicates--computed-values`, `#cron-and-template-surfaces`, `#verify-your-work`, `#see-also`. The new ones are `#first-checks`, `#scope-and-functions`, `#traps` and `#where-to-go`; the title's anchor is unchanged. No file in this repository linked an anchor of the old entry.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/skills': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
docs(skills): the objectstack-data validation rules teach a rule message's `{{ }}` holes
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`skills/objectstack-data/rules/validation.md` gains § Messages — Record Values in Holes, teaching what the refusal sentence does since validation rule messages were rendered at run time: a hole names one of the object's own fields under `record` (the judged record) or `previous` (the stored row before an update, empty on insert), with at most one whitelisted formatter; a bare `| currency` formats in the organization's default currency, and with none set that hole renders empty while the server log names the setting (Setup → Localization); a field holding its own currency names the code (`| currency:EUR`) or uses `| number:2`; a field the person whose write was refused cannot read, or sees masked, renders empty, `default:` included; a translation at `objects.<object>._validations.<rule>.message` takes the same holes and is filled first; the sentence is plain text.
12+
13+
§ Incorrect vs Correct is gone: its one example (a rule with no `events` runs on insert and update; scope it with `events: ['update']`) restated § Events.
14+
15+
The upgrade entry `validation-rule-message-template-holes` (`@objectstack/spec`) names the same field before and after in its example: `Total {total_price} is below {received_amount}` becomes `Total {{ record.total_price | currency }} is below {{ record.received_amount | currency }}`.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@objectstack/cli': patch
3+
'@objectstack/service-settings': patch
4+
---
5+
6+
Clause-②: no
7+
Metadata-protocol: none
8+
9+
`os knowledge status` prints the knowledge service's state first when the server's `index_status` answer carries an `enablement` (the boot read the service as not enabled, so every source is held): the not-enabled line, the number of held sources, and the reason with its remedy. An answer without it prints exactly as before. The Settings → AI embedder section's help text now says that once a provider is saved and the server restarted, the content fields each knowledge source lists are sent to that provider for every row the source matches, and the provider bills for them (all shipped locales).

‎.changeset/38369-held-status.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/service-knowledge': patch
3+
'@objectstack/objectql': patch
4+
---
5+
6+
feat(service-knowledge): index_status and rebuild say when the knowledge service is held
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
While the boot read a knowledge service the runtime composed as not enabled (no embedder, or the deployment's store not mounted), the `knowledge` settings actions say so. `index_status` answers each source's index as the new state `held` (not due) without asking its store, adds `enablement` — `state: 'not-enabled'`, the `reason` naming each missing half and its remedy, `embedder` / `store` for the missing halves, and `heldSources` — and its message leads with the reason and the held count. `rebuild` is refused (`ok: false`, which the settings door answers 400) with the service's own sentence: "Rebuild of source 'X' is refused: … To enable it, save an embedder provider, then restart." `os knowledge rebuild` exits 1 with that sentence. A service a host mounts itself, and an enabled one, answer exactly as before.
12+
13+
The boot line of a deployment that holds `knowledge_source` items and runs no knowledge service now names the embedder step its save refusal already names: declare `requires: ['knowledge']`, restart, then save an embedder provider and restart again.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/lint': minor
3+
'@objectstack/spec': patch
4+
---
5+
6+
fix(lint)!: refuse a grid list view grouped by a dotted path
7+
8+
Clause-②: no (narrowing)
9+
Metadata-protocol: narrowed
10+
Skills-docs: follow-up #38655
11+
12+
<!-- adr-0087: registered publish-refuses-list-view-grouping-by-a-dotted-path -->
13+
14+
**BREAKING** for a `grid` list view (or one with no `type`, which defaults to `grid`) whose `grouping.fields[].field` is a dotted path such as `account.name`: it was accepted before and is refused now, with the fix named in the finding. The schema is unchanged and stored metadata is not rewritten or refused at boot; the refusal comes at the next publish of the view (a `view` write, or an `object` write through the object's own `listViews`), and from `os validate` / `lint` / `compile` / `build`.
15+
16+
- `list-view-field-dotted` (error) now also judges a grid list view's grouping level. A grid sends its grouping as the group header query, and the engine groups by the object's own fields by their bare names, 0 hops deep: it refuses a dotted name the object does not declare, whatever its head or leaf (`400 INVALID_FIELD`), so the view saved, then opened on that error and rendered no group. The verdict asks the engine's own condition, so `account.name` and `account.tags` are refused alike. A head that names no field stays `list-view-field-unknown`. Not judged: any other list-view kind (`kanban`, `gallery`, `calendar`, `timeline`, `gantt`, `map`, `chart`, `tree`, `timesheet`), where no door fails the view: a board's one grouped count read is refused and absorbed, and the board and the gallery read the name as a flat key of the row, so a dotted name there groups nothing.
17+
18+
## FROM → TO
19+
20+
- FROM: a `grid` list view with `grouping: { fields: [{ field: 'account.name' }] }` — saved, then the grid opened on `400 INVALID_FIELD`.
21+
- TO: group by the relation itself when it is a single-valued lookup (`grouping: { fields: [{ field: 'account' }] }`, one group per related record), or store the value on the object (a field written when the source changes) and group by that field.
22+
23+
`os explain list-view-field-dotted` and `os explain list-view-group-field-ungroupable` carry the new position. `@objectstack/spec` adds only the upgrade-guide entry `publish-refuses-list-view-grouping-by-a-dotted-path`.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/lint': minor
4+
---
5+
6+
fix(lint): a translation keyed to a platform app the runtime serves is no longer refused
7+
8+
Clause-②: yes
9+
Metadata-protocol: added
10+
Skills-docs: follow-up #38793
11+
12+
`os validate`, `os compile` and every other author-time door refused, with `translation-target-unknown` at `error`, an `apps.setup` or `apps.account` key in a stack's translation bundle: the rule knew only the apps the stack declares or contributes into. The runtime serves the platform's Setup and Account apps beside the stack's own and folds the stack's key over them, so the stack's label is the one the menu shows; a bundle the server boots and applies failed validation with exit 1.
13+
14+
An `apps.APP` key now resolves when `APP` is a platform app a stock runtime serves and the stack does not declare it itself. The navigation ids under it are not judged: that app's menu is assembled from the capability plugins the deployment composes, which a static check cannot see, the same reason a platform object's fields are not judged. `apps.studio` is still an orphan, because a stock boot does not serve the Studio app. A stack that declares its own app under one of these names is judged against its own declaration, as before. At the metadata save door nothing changes: there the served apps themselves are judged.
15+
16+
`@objectstack/spec/system` gains `PLATFORM_PROVIDED_APP_NAMES`, the set of app names a stock boot serves (`account`, `setup`), held equal to what the app packages of both stock boot loops register by a pin in `@objectstack/cli` (`os serve`, which `os dev` runs) and one in `@objectstack/plugin-dev`.
17+
18+
Nothing to migrate: a bundle that validated before still validates.

‎content/docs/ai/knowledge-rag.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ os knowledge status # each source: built, never built or due
426426
os knowledge rebuild support_articles # start a complete build and follow its progress
427427
```
428428

429-
`os knowledge rebuild` starts the build on the server and prints its progress — rows read, documents written, unchanged, purged, and those that cannot be indexed — until it ends; `--no-wait` returns once it has started. Both commands call the `knowledge` settings actions `rebuild` and `index_status` (`POST /api/settings/knowledge/rebuild` with `{ "source": "ID" }`). The server logs each build's start, its progress every ten seconds, and its result. The progress the commands read is the source's sync state (below), so behind a load balancer any node answers it. On the `memory` adapter the index itself lives in each server process: a rebuild fills the index of the node that ran it only, and the command says so when it ends.
429+
`os knowledge rebuild` starts the build on the server and prints its progress — rows read, documents written, unchanged, purged, and those that cannot be indexed — until it ends; `--no-wait` returns once it has started. Both commands call the `knowledge` settings actions `rebuild` and `index_status` (`POST /api/settings/knowledge/rebuild` with `{ "source": "ID" }`). The server logs each build's start, its progress every ten seconds, and its result. The progress the commands read is the source's sync state (below), so behind a load balancer any node answers it. On the `memory` adapter the index itself lives in each server process: a rebuild fills the index of the node that ran it only, and the command says so when it ends. Where the service is held ([Mounted is not enabled](#turning-it-on-requires-knowledge)), `os knowledge rebuild` starts nothing and exits 1 with the server's sentence, which names what is missing and the fix; `os knowledge status` prints the service's state first — not enabled, how many sources are held, and why — whenever the `index_status` answer carries it (its `enablement`).
430430

431431
### Each source's sync state
432432

0 commit comments

Comments
 (0)