Skip to content

Commit 0540349

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-24452-default-row-scope-lint
2 parents ed2d826 + e11ae4b commit 0540349

11 files changed

Lines changed: 817 additions & 28 deletions

File tree

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/objectql': minor
4+
---
5+
6+
feat(spec,objectql)!: a top-level action bound by `objectName` to an object another package owns is listed on that object wherever it is served, and a bound action whose object no loaded package registers fails the boot
7+
8+
Clause-②: yes (narrowing)
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No spec key, option, error code or stored shape is added, removed or renamed: `defineStack` accepts two more target kinds for an action's existing `objectName`, the served object gains entries in its existing `actions` array, and the boot refusal answers the existing `INVALID_METADATA` code. Nothing stored changes shape, so `objectstack migrate meta` has nothing to rewrite. The other categories are closed on facts: both packages publish (not unpublished); no ADR-0087 id is named or touched (not registered or already-registered); no Zod schema shape in packages/spec changes (not runtime-interface-only or type-surface-only); and nothing exported is retired (not runtime-export-retired). -->
11+
12+
**BREAKING** (one narrowing beside a widening), shipped as `minor` under the launch-window convention for breaking changes.
13+
14+
- **Widening** (`@objectstack/spec`, `@objectstack/objectql`): an action declared in a stack's top-level `actions` with `objectName` naming an object that another package owns now reaches that object. `defineStack()` accepts the action when the stack extends the object through `objectExtensions`, or when the object is a known platform object (`sys_organization` and the rest of the platform's named list). It keeps the action in the top-level `actions`. The engine's schema registry then attaches it to the object at the one step every object read ends in. That covers `GET /api/v1/meta/object/<name>` (stored-row, MetadataService and registry layers alike), `engine.getSchema()` and the action router's object lookup, in whichever order the two packages register. The attached entry is the action's own declaration, so its `requiredPermissions`, `requiresMembershipReach` and execution identity are unchanged. An action the object already declares under the same name keeps the object's declaration. A disabled package's bound actions are not attached. Before this, such an action was refused by `defineStack()` whenever the stack declared an object of its own. Where it got through (an object-less stack, or `strict: false`), it registered but was listed on no object, so no client rendered it.
15+
- **FROM** (`@objectstack/objectql`): a top-level action bound by `objectName` to an object no loaded package registers was registered and listed nowhere, and the boot succeeded. **TO:** the boot fails at `kernel:ready` with `INVALID_METADATA` (422), naming each such action, its package and the object. An artifact registered through the `manifest` service after the boot is refused before any of it registers. **Fix:** register the object (in the package or in one it depends on), or correct the action's `objectName`.
16+
- **Unchanged:** a name `defineStack()` cannot attribute (an object this stack neither defines nor extends, and not a known platform object) is still refused at build with `STACK_CROSS_REFERENCE_INVALID`. A same-stack bound action is still merged into its object by `defineStack()` and is attached once.
17+
18+
The `ObjectExtensionSchema` refusal for `actions` now says exactly this: declare a top-level action with `objectName: '<target>'` in the same stack; the schema registry attaches it to the object wherever the object is served; a target no loaded package registers fails the boot.

‎.github/workflows/ci.yml‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@ jobs:
305305
# ⛔ Not packages/spec/**: the rest of the spec is bundled CONTENT, and
306306
# its lag behind a cached dist is the ruled cache design (#9667, #9706;
307307
# see scripts/check-console-injection.mjs).
308+
# The six other manifests are what build-console.sh packs into objectui's
309+
# install on a pin carrying .objectstack-sha; objectui's objectstack-pin.mjs
310+
# refuses one whose dependency names its lockfile does not record. All seven
311+
# are changesets fixed group 0: of the 2727 first-parent commits on main in the
312+
# 30 days to ec951e29e, 11 moved one of the six, 10 with spec's: 54 key moves -> 55.
308313
console:
309314
- '.objectui-sha'
310315
- 'scripts/build-console.sh'
@@ -314,6 +319,12 @@ jobs:
314319
- 'scripts/assert-console-spec-injection.mjs'
315320
- 'packages/spec/package.json'
316321
- 'packages/spec/tsup.config.ts'
322+
- 'packages/core/package.json'
323+
- 'packages/types/package.json'
324+
- 'packages/client/package.json'
325+
- 'packages/formula/package.json'
326+
- 'packages/sdui-parser/package.json'
327+
- 'packages/lint/package.json'
317328
- '.github/workflows/ci.yml'
318329
# Test inputs that live OUTSIDE every package (#9829, #10015). Packages
319330
# whose suites read across their own boundary declare that radius in
@@ -2983,7 +2994,7 @@ jobs:
29832994

29842995
# Keyed on every BUILD INPUT the `filter` job's `console` list names (the
29852996
# pin, the build script, the two scripts that derive and stamp the injection
2986-
# probes, and the spec's entry layout) and on nothing else.
2997+
# probes, the spec's entry layout, the six other packed manifests) and on nothing else.
29872998
# scripts/check-ci-filter-parity.mjs holds this key and that list in step
29882999
# (#20765). A head that moves a build input MISSES, so the build and the
29893000
# assertion inside it judge the change on the PR head, not first in the
@@ -3008,7 +3019,7 @@ jobs:
30083019
uses: actions/cache/restore@v6
30093020
with:
30103021
path: packages/console/dist
3011-
key: ${{ runner.os }}-console-dist-${{ hashFiles('.objectui-sha', 'scripts/build-console.sh', 'scripts/assert-console-spec-injection.mjs', 'scripts/console-spec-probes.mjs', 'packages/spec/package.json', 'packages/spec/tsup.config.ts') }}
3022+
key: ${{ runner.os }}-console-dist-${{ hashFiles('.objectui-sha', 'scripts/build-console.sh', 'scripts/assert-console-spec-injection.mjs', 'scripts/console-spec-probes.mjs', 'packages/spec/package.json', 'packages/spec/tsup.config.ts', 'packages/core/package.json', 'packages/types/package.json', 'packages/client/package.json', 'packages/formula/package.json', 'packages/sdui-parser/package.json', 'packages/lint/package.json') }}
30123023

30133024
# The gate. Shallow-clones objectui at the pinned SHA, builds
30143025
# @object-ui/console against this tree's client, copies the dist into
@@ -3072,7 +3083,7 @@ jobs:
30723083
# a poisoned entry is reachable from here and must not pass quietly.
30733084
- name: Verify the restored Console dist bundles this tree's spec
30743085
env:
3075-
CONSOLE_DIST_CACHE_KEY: ${{ runner.os }}-console-dist-${{ hashFiles('.objectui-sha', 'scripts/build-console.sh', 'scripts/assert-console-spec-injection.mjs', 'scripts/console-spec-probes.mjs', 'packages/spec/package.json', 'packages/spec/tsup.config.ts') }}
3086+
CONSOLE_DIST_CACHE_KEY: ${{ runner.os }}-console-dist-${{ hashFiles('.objectui-sha', 'scripts/build-console.sh', 'scripts/assert-console-spec-injection.mjs', 'scripts/console-spec-probes.mjs', 'packages/spec/package.json', 'packages/spec/tsup.config.ts', 'packages/core/package.json', 'packages/types/package.json', 'packages/client/package.json', 'packages/formula/package.json', 'packages/sdui-parser/package.json', 'packages/lint/package.json') }}
30763087
run: pnpm check:console-injection --require-stamp
30773088

30783089
# Reached only with every assertion above green (see the split-restore note).
@@ -3085,4 +3096,4 @@ jobs:
30853096
uses: actions/cache/save@v6
30863097
with:
30873098
path: packages/console/dist
3088-
key: ${{ runner.os }}-console-dist-${{ hashFiles('.objectui-sha', 'scripts/build-console.sh', 'scripts/assert-console-spec-injection.mjs', 'scripts/console-spec-probes.mjs', 'packages/spec/package.json', 'packages/spec/tsup.config.ts') }}
3099+
key: ${{ runner.os }}-console-dist-${{ hashFiles('.objectui-sha', 'scripts/build-console.sh', 'scripts/assert-console-spec-injection.mjs', 'scripts/console-spec-probes.mjs', 'packages/spec/package.json', 'packages/spec/tsup.config.ts', 'packages/core/package.json', 'packages/types/package.json', 'packages/client/package.json', 'packages/formula/package.json', 'packages/sdui-parser/package.json', 'packages/lint/package.json') }}

‎.github/workflows/spec-shape-gate.yml‎

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Spec Shape Gate
22

33
# Compile the downstream consumer -- objectstack-ai/objectui at `main` -- against
4-
# `@objectstack/spec` built from THIS commit, and name the objectui file, the
5-
# objectstack commit and the owning lane when it does not compile.
4+
# `@objectstack/spec` (and every other `@objectstack/*` package it installs)
5+
# built from THIS commit, and name the objectui file, the objectstack commit and
6+
# the owning lane when it does not compile.
67
#
78
# ## The ruling this executes
89
#
@@ -205,16 +206,30 @@ jobs:
205206
- name: Self-test the gate script
206207
run: pnpm check:spec-shape-gate
207208

208-
# ── Build the spec from THIS commit, and PACK it ──────────────────────
209-
# `--filter @objectstack/spec...` installs the spec and its dependencies
210-
# only; `inject` later reads the dependencies this install resolved
209+
# ── Build what objectui installs, from THIS commit, and PACK the spec ──
210+
# objectui consumes every `@objectstack/*` package BY COMMIT: its root
211+
# `package.json` overrides each to `file:node_modules/.cache/objectstack/
212+
# <name>`, which its `scripts/objectstack-pin.mjs build` fills (below, with
213+
# OBJECTSTACK_ROOT naming this checkout). The names are read from those
214+
# overrides, the list the pin script packs; `--filter-prod` keeps the
215+
# closure to runtime edges as that script's own build does (`...` alone
216+
# would pull in the client's dev closure). The install brings the root's
217+
# toolchain too, and `inject` later reads the dependencies it resolved
211218
# (`packages/spec/node_modules`) to re-point a store sibling the packed
212219
# manifest's range refuses.
213-
- name: Install the spec's dependency closure
214-
run: pnpm install --frozen-lockfile --filter @objectstack/spec...
220+
- name: Install the closure of the @objectstack/* packages objectui installs by commit
221+
run: |
222+
set -euo pipefail
223+
filters=$(node -e '
224+
const m = JSON.parse(require("fs").readFileSync("objectui/package.json", "utf8"));
225+
const names = Object.keys(m.pnpm?.overrides ?? {}).filter((n) => n.startsWith("@objectstack/")).sort();
226+
if (names.length === 0) { console.error("objectui/package.json overrides no @objectstack/* package"); process.exit(2); }
227+
process.stdout.write(names.map((n) => `--filter-prod=${n}...`).join(" "));')
228+
echo "PINNED_FILTERS=$filters" >> "$GITHUB_ENV"
229+
pnpm install --frozen-lockfile $filters
215230
216-
- name: Build @objectstack/spec from this commit
217-
run: pnpm --filter @objectstack/spec build
231+
- name: Build them from this commit
232+
run: pnpm $PINNED_FILTERS run build
218233

219234
# What gets injected is what a RELEASE from this commit would ship -- the
220235
# `files` field's file set, not a working tree. `--ignore-scripts`
@@ -238,6 +253,22 @@ jobs:
238253
working-directory: objectui
239254
run: pnpm --version
240255

256+
# objectui's `objectstack:build` script (its pin script's `build`) packs
257+
# every package built above into the directories its overrides name;
258+
# without it the frozen install dies on ENOENT there. Called by objectui's
259+
# script NAME: a path here would read as one in this repository. It
260+
# refuses (exit 1, its own `objectstack-pin` annotation) when a packed
261+
# manifest's dependency NAMES differ from what objectui's lockfile records:
262+
# the downstream owes a pin bump with its lockfile, and the report reads the
263+
# missing compile as exit 2. A changed peer, engines or dependency range is
264+
# not refused there -- a frozen install links it and exits 0 -- and the
265+
# spec's ranges stay `inject`'s to judge.
266+
- name: Pack this commit's @objectstack/* into objectui's pinned-build directories
267+
working-directory: objectui
268+
env:
269+
OBJECTSTACK_ROOT: ${{ github.workspace }}
270+
run: pnpm run objectstack:build
271+
241272
- name: Install objectui dependencies
242273
working-directory: objectui
243274
run: pnpm install --frozen-lockfile
@@ -254,7 +285,10 @@ jobs:
254285
# re-points a store sibling the packed manifest's range refuses at the
255286
# copy this tree's spec build resolved, and proves every workspace
256287
# consumer resolves the injected copy before returning. Nothing tracked
257-
# by git is touched in either checkout.
288+
# by git is touched in either checkout. The pinned build above already
289+
# installed this commit's spec (the same declaration files); what this
290+
# step still adds is that range judgement and the consumer proof, which
291+
# the pin script does not make (it compares dependency names only).
258292
- name: Inject the source-built spec into objectui's install
259293
env:
260294
UPSTREAM_SHA: ${{ steps.subjects.outputs.upstream }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ each one by name with the alternative to use instead:
8282

8383
| Key you might reach for | Declare this instead |
8484
|:---|:---|
85-
| `actions` | A top-level action with `objectName: '<target>'` — `defineStack()` attaches it to the object |
85+
| `actions` | A top-level action with `objectName: '<target>'` in the same stack — it stays in the stack's top-level `actions`, and the engine's schema registry attaches it to the target object wherever the object is served, whichever package registers first; a target no loaded package registers fails the boot |
8686
| `hooks` | A top-level hook bound to the target object |
8787
| `listViews` | A top-level `view` bound to the target object |
8888
| `fieldGroups` | Add the fields here and declare the groups on the owning object, or assign a Page for the layout |

0 commit comments

Comments
 (0)