Skip to content

Commit d830f5a

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-2a7f43-wt
2 parents 7ddcc64 + 5b8ca36 commit d830f5a

843 files changed

Lines changed: 13964 additions & 2254 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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/formula': patch
3+
---
4+
5+
fix(formula): `inferFormulaReturn` answers `number` for a proven plain number whose CEL type is `dyn`, so Studio withdraws a stale `currency` on a field-over-field quantity edit
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A field read is `dyn` to cel-js, so an operator over two field reads types `dyn`. `inferFormulaReturn` answered such an expression `{}` (unproven) even when its unit proof had read every operand as a declared number. Studio's formula inspector withdraws a declared `currency` only on a `number` answer, so an author who edited `record.amount * 0.1` into `record.quantity * record.hours` kept `returnType: 'currency'` and its `currencyConfig`, and the value was still drawn as money.
11+
12+
FROM `inferFormulaReturn('record.quantity * record.hours', fields)` → `{}` TO → `{ returnType: 'number' }`, over a field map that declares both as plain numeric fields. The same holds for every expression the unit proof proves a plain number whose CEL type is `dyn`: `record.quantity / record.hours`, `record.quantity + record.hours`, `quantity * hours`, a ternary or `max` over two quantities, and a ratio of two amounts in one currency (`record.amount / record.tax`). Money over two field reads (`record.amount * record.quantity`) still answers `currency`. What the proof cannot follow still answers `{}`: a ratio across two currencies, anything divided by an amount, an amount times an amount, an operand whose unit cannot be read.
13+
14+
A quantity read through a relationship (`record.account.employee_count * 2`) still answers `{}`: the related object's fields are not an input to `inferFormulaReturn`, so the leaf's unit cannot be read, and a declared `currency` is kept on that edit. The function's header now records this as an accepted limit.
15+
16+
Nothing to migrate. A caller that read `{}` for these shapes as "keep the declaration" now gets `number`, which means proved not money.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
'@objectstack/spec': major
3+
'@object-ui/types': major
4+
'@objectstack/lint': minor
5+
'@objectstack/runtime': minor
6+
'@objectstack/platform-objects': minor
7+
'@object-ui/core': minor
8+
'@object-ui/components': minor
9+
'@object-ui/plugin-detail': minor
10+
'@object-ui/app-shell': minor
11+
'@object-ui/i18n': minor
12+
'@objectstack/cli': patch
13+
'@objectstack/cloud-connection': patch
14+
'@objectstack/objectql': patch
15+
'@objectstack/metadata-protocol': patch
16+
'@objectstack/plugin-approvals': patch
17+
'@objectstack/scenarios': patch
18+
'@objectstack/service-datasource': patch
19+
'@objectstack/service-messaging': patch
20+
'@objectstack/verify': patch
21+
'@object-ui/console': patch
22+
'@object-ui/fields': patch
23+
'@object-ui/layout': patch
24+
'@object-ui/plugin-grid': patch
25+
'@object-ui/plugin-list': patch
26+
'@object-ui/react': patch
27+
---
28+
29+
feat(spec)!: an action's `locations` say what it acts on, not the part of the page it sits in
30+
31+
**BREAKING** (19.0.0): `ACTION_LOCATIONS` is `list`, `record`, `record_page`, `record_row`, `record_related`, `record_section`. The four words that named a part of a page are retired: `list_toolbar`, `list_item`, `record_header` and `record_more`. `record` is new: the action acts on one record, so it is drawn on the record page's header and in each list row's menu. Which actions are buttons and in what order stays the object's `actionLayout`.
32+
33+
Clause-②: yes (narrowing)
34+
Metadata-protocol: narrowed
35+
Skills-docs: follow-up #37895
36+
37+
<!-- adr-0087: registered action-locations-acted-on -->
38+
39+
A replacement with a registered conversion, so `yes (narrowing)` as on main's precedents (`.changeset/pre/37086-define-metadata-form-rename.md`, `.changeset/pre/37304-knowledge-source-governed-type.md`). Narrowed: the four retired words are refused wherever a location is read. Widened in the same change: the four newly accepted values `list`, `record`, `record_page` and `record_row` at the same positions; the new `@object-ui/types` export `actionFoldedIntoMenu`; and eight new `@object-ui/i18n` Studio keys for the location labels (en, zh), which replace the eight keys of the retired words.
40+
41+
FROM → TO (each action is drawn in exactly the places it was drawn before):
42+
43+
- `locations: ['list_toolbar']` → `locations: ['list']`.
44+
- `locations: ['list_item']` → `locations: ['record_row']`.
45+
- `locations: ['record_header']` or `['record_more']` → `locations: ['record_page']`.
46+
- `record_header` or `record_more` beside `list_item` → `locations: ['record']`.
47+
- `locations: ['record_more']` without `record_header` (the action lived only in the record header's ⋯ menu) → `locations: ['record_page'], component: 'action:menu'`. The fold is the action's `component`, the key that already sends an action into an action bar's overflow menu.
48+
- A component's single `location` (`record:quick_actions`, `action:group`, `action:bar`): `list_toolbar` → `list`, `list_item` → `record_row`, `record_header` → `record_page`.
49+
50+
An old word is refused at authoring with the word to write instead. `os migrate meta --from 18 --write` rewrites sources (ADR-0087 conversion `action-locations-acted-on`, retired from the load path from day one, as every protocol-19 entry). Stored items (`applyConversionsToStoredItem`, `os migrate meta --stored`) and built artifacts replay the same conversion. It leaves a TODO, and changes nothing, where no lossless rewrite exists: a `record_more`-only action also on `list_toolbar` that does not already carry `component: 'action:menu'` (the list toolbar folds `action:menu` too); an action at `record_header` with an authored `component: 'action:menu'` (the record page header folded it into its ⋯ menu while a `record:quick_actions` bar at `record_header` drew it as a button, and `record_page` has one state for both); a component whose `location` is `record_more`; and an `action:group` at `record_header` with a `record_more`-only member. A site left as stored keeps its old word, which a protocol-19 runtime matches to no surface: that action or block is drawn nowhere until it is rewritten by hand. The protocol-19 upgrade guide carries the same step as the semantic entry `action-locations-page-parts-retired`.
51+
52+
Also in this change:
53+
54+
- `@object-ui/types`: `actionRendersAt` reads `record` as covering `record_page` and `record_row`. The new `actionFoldedIntoMenu(action)` answers whether an action is folded into the ⋯ (`component: 'action:menu'`). `arrangedHeaderActions` pins and unpins through `component` and no longer writes locations.
55+
- `@object-ui/components`: the record `page:header` routes every folded action to its ⋯ menu, and every other `record_page` action takes the inline budget, as `record_header` actions did.
56+
- `@object-ui/plugin-detail`: `record:quick_actions` defaults to `record_page` and leaves folded actions out at that location, as it left out `record_more`-only ones. The related list reads `record` as a row action.
57+
- `@object-ui/core`, `@objectstack/runtime`: the record-scoped checks (`isRecordScopedAction`, `requiresRecord`) accept `record`.
58+
- `@objectstack/lint`: the record-page header, related-list and action-layout rules read the new words.
59+
- Studio: the action inspector, the `record:quick_actions` location dropdown and the action preview offer `record` and draw the fold as "record_page · ⋯".
60+
- `@objectstack/platform-objects`, the examples and every other package: declarations and prose rewritten to the new words. The packages listed as `patch` change comments, test fixtures or authoring copy, except three that ship rewritten words: `@objectstack/plugin-approvals` and `@objectstack/service-datasource` (their declared actions' `locations`) and `@object-ui/layout` (a location literal it passes at runtime).
61+
62+
Not moved: #37895 (the `skills/**` teaching of the new words; Blocked-by this change).
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+
fix(spec): the Studio hook form offers `refusals` and `texts` only where a hook may declare them
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`hookForm` offered the `refusals` and `texts` rows on every hook. `HookSchema` refuses both keys on an `expression` body, so an author writing an expression hook was offered two sections that could only make the save fail. Both rows now carry a `visibleWhen` that is the schema's own test: they are shown for a `js` body, and for a hook with no body and a non-empty `handler`, and hidden on an `expression` body. What a hook may declare does not change. Nothing to migrate.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
'@objectstack/lint': minor
3+
'@objectstack/spec': patch
4+
---
5+
6+
fix(lint)!: a knowledge source is checked for its object, its fields and the search gates that need no caller, in `os validate` and at publish
7+
8+
Clause-②: yes (narrowing)
9+
Metadata-protocol: narrowed
10+
Skills-docs: follow-up owed — skills/objectstack-ai/SKILL.md
11+
12+
<!-- adr-0087: registered knowledge-source-publish-refuses-missing-references-and-gated-objects -->
13+
14+
ADR-0161 K4, row 4.
15+
16+
**BREAKING** for the publish of a knowledge source that carries one of the four errors below: it was accepted before and is refused now (422, the finding's rule id, path, message and fix), and `os validate` / `lint` / `compile` / `build` refuse the same source. The schema is unchanged, and stored sources are not rewritten or refused at boot.
17+
18+
A new rule, `validateKnowledgeSource`, exported from `@objectstack/lint` with its five rule id constants. It runs on all three CLI commands and on the runtime publish gate for a `knowledge_source` write, with one set of rule ids and messages. Four errors: a source over a missing object has nothing to index, a missing field indexes no text for that member, and a gated object is never searched for a caller the service judges:
19+
20+
- `knowledge-source-object-unknown`: `source.object` names an object that the stack, a package of its artifact, or (at the publish gate) the host does not define. Under the package closure the publish gate states, an object outside it is worded for the closure with the remedy to declare the dependency. On the CLI, while the manifest declares a dependency the artifact does not carry, the build cannot see that package's objects, so the finding is a warning that clears when the dependency defines the object (the publish gate judges it against the closure, which holds them); with no such dependency it is an error. A platform object a known package registers is not judged when the stack does not carry it; a platform-prefixed name no known package registers is a warning.
21+
- `knowledge-source-field-unknown`: a `source.content` or `source.metadataFields` member names no field of the object, declared (the stack's own object extensions included) or addressable without a declaration (`id`, which the driver provisions, and the injected system columns `owner_id`, `created_at`, …).
22+
- `knowledge-source-object-not-searchable`: the object's API exposure does not serve `search` (`canServeApiOperation(enable, 'search')`): `enable.apiEnabled: false`, an `enable.apiMethods` list that does not grant `list` (search derives from it; `search` itself is a retired list value the parse strips), or a list that grants `list` beside `enable.searchable: false`. With no `apiMethods` list, `searchable: false` does not refuse it.
23+
- `knowledge-source-system-object-not-ai-readable`: a `sys_` object that does not declare `enable.aiReadable: true` (`isAiReadExposed`).
24+
25+
One warning, which refuses nothing:
26+
27+
- `knowledge-source-field-never-indexed`: a member names a credential-class field or a field declared `internal: true`; the index never carries either, even when named, so the member is skipped.
28+
29+
The two gates are the knowledge service's own search-time gates that need no caller, asked through the same spec predicates. The disabled-package gate and the field-queryable gate need an environment or a caller and stay at save, judged for the author. `os explain` answers each of the five ids.
30+
31+
## FROM → TO
32+
33+
- `source: { object: 'kb_artcle', … }` → `source: { object: 'kb_article', … }`, an object the stack defines. An object a dependency defines clears at publish once the package's manifest declares that dependency in `dependencies`; on the CLI it stays a warning while the artifact does not carry the dependency.
34+
- `content: ['title', 'bdy']` → `content: ['title', 'body']`.
35+
- a source over an object with `enable: { apiEnabled: false }` → serve the object (`apiEnabled: true` and, where it declares `apiMethods`, a list that includes `list`, with `searchable` not false), or index another object.
36+
- a source over `sys_audit_note` → index a business object, or declare `enable.aiReadable: true` on the system object's own definition.
37+
38+
`@objectstack/spec` adds only the upgrade-guide entry `knowledge-source-publish-refuses-missing-references-and-gated-objects`.
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): `objectstack-ai` names the `os validate` rules for a `knowledge_source`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-ai` § Knowledge Sources (RAG) now lists what `os validate` and publish report for a knowledge source, by rule id, with the fix for each. `knowledge-source-object-unknown`: `source.object` is no object of the stack or its packages; on the CLI it is a warning while the manifest declares a dependency that `packages[]` does not carry. `knowledge-source-field-unknown`: a `content` or `metadataFields` member is no field of the object (`id` and the injected system columns resolve). `knowledge-source-object-not-searchable`: the API does not serve the object for `search`. `knowledge-source-system-object-not-ai-readable`: a `sys_` object without `enable.aiReadable: true`. `knowledge-source-field-never-indexed` is a warning for a credential-class or `internal: true` member, which the index never carries. An error refuses the publish. The section's example passes `os validate` with no knowledge-source finding.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
feat(lint): warn when a select option `color` renders neutral on the option badge
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A new warning, `field/option-color-renders-neutral`. An option is coloured only by the colour its author declares, and the option badge paints exactly two spellings: one of the nine palette families (`gray`, `red`, `orange`, `yellow`, `green`, `blue`, `indigo`, `purple`, `pink`, lowercase) or a `#rgb` / `#rrggbb` hex. Any other declared colour (`teal`, `amber`, `Red`, `rgb(…)`, `#rrggbbaa`, a hex with no `#`) rendered neutral grey with no signal. It now draws a warning naming the option and a fix line: the lowercase family or the `#`-prefixed / alpha-free hex when the value points at one, otherwise the families and the hex form.
11+
12+
It runs on `os validate`, `os build` and `os lint` over object fields, object-extension fields, picklists and picklist extensions, and at the metadata save door on `object` and `object_extension` writes, where it rides back as an advisory. Nothing is refused: `SelectOption.color` still accepts any string, and charts and gantt bars still paint a CSS colour name. `os lint --strict` fails on it, as on every warning. `os explain field/option-color-renders-neutral` gives the per-surface reading. Published from the root entry: `FIELD_OPTION_COLOR_RENDERS_NEUTRAL`, `OPTION_COLOR_FAMILIES`, `isBadgePaintableOptionColor`, `lintOptionColors` and the type `OptionColorPicklist`.

0 commit comments

Comments
 (0)