Skip to content

Commit 6095e74

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-f3xzh7
2 parents 9540d33 + 3d5933a commit 6095e74

55 files changed

Lines changed: 2459 additions & 184 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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): the layered read of a form view naming a field its object lacks now carries the form-field-unknown warning
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`GET /api/v1/meta/view/NAME?layers=true` judged its `_diagnostics` with the schema alone, so a published form view whose section names a missing field (or an undeclared field group) read `{ valid: true }` there, while `GET /api/v1/meta/view/NAME` of the same view carried the lint's warning. Studio's item editor reads the layered answer when no draft is pending, so the author of a published form view saw no warning.
11+
12+
The layered read now runs the same form-layout pass on its `effective` body that the single-item read runs, against the object the registry serves for each name the view spells. The warnings land at the same paths, and `valid` stays the schema's answer. A form naming only real fields still reads `{ valid: true }`.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/data-objectstack': patch
3+
---
4+
5+
perf(data-objectstack)!: an object route reads that object's saved views (`GET /meta/view?object=`), not every view of every object (#29550)
6+
7+
Clause-②: no (narrowing) — `listViews` and `listViewOverrides` no longer list a stored `view` row that carries no `viewKind` or no top-level `object` (a legacy bare spec, a `{ list }` wrapper, a row bound only through `data.object`). The draft-preview read applies the same rule. Nothing is widened.
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export, signature or answer shape changes. The adapter's two view readers now apply the rule the server's one-object view read (ADR-0017 section 3.5) and the view write door (#7741) already apply: a row is bound to an object by `object` plus `viewKind`. There is no key for a migration to rewrite; a row stored before the write door refused unbound rows is re-bound by saving the view again. -->
11+
12+
**BREAKING** read narrowing in `@object-ui/data-objectstack` (`ObjectStackAdapter.listViews`, `ObjectStackAdapter.listViewOverrides`), which feed the Console's saved-view tabs and per-view settings.
13+
14+
- **Before.** On every object route, both readers downloaded the whole published view list (`GET /api/v1/meta/view`, every view of every object; 7 KB on app-crm) and kept one object's rows in the browser, matching a row on `data.object` or `object`, with or without `viewKind`.
15+
- **Now.** While nothing on the page has loaded the whole list, they read `GET /api/v1/meta/view?object=OBJECT`, the read ADR-0017 declares for the view switcher, once for both readers. Once something has loaded the whole list, or while its read is on the wire (Studio, the MetadataProvider, a packaged app's object scope), they answer from it with no request of their own. Both paths keep the same rows in the same order: `viewKind` set, `object` naming the object, sorted by `order` and then `name`. The draft-preview read (`listViews` with `previewDrafts`) keeps its own `?preview=draft` request and narrows its rows by the same rule.
16+
- **Order.** Saved-view tabs follow the contract's order (`order`, then `name`). Before, they followed the order of the server's whole list, so tabs with no `order` could appear in a different order.
17+
- **Who sees it.** A deployment holding a `view` row stored before the write door refused rows without `object` and `viewKind` (#7741). That row was a saved-view tab and a per-view setting before, and is neither now. The server's one-object read never served it. Views the Console saves today carry both fields, and none of the rows on a fresh app-crm or showcase deployment were affected.
18+
19+
**The remedy.** Open the view in the Console and save it again: the save writes `object` and `viewKind`, and the view is listed again.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
fix(lint): `connector-credential-literal` now also warns when a stdio MCP server's credential goes nowhere, or when a credential is typed into `transport.credentialEnv`
9+
10+
Two new findings on the existing advisory. Both are warnings, so nothing is refused and every save still lands. They reach `os validate`, `os build`, `os lint` and the connector save door (`PUT /meta/connector/:name`), the same doors the rule already runs on.
11+
12+
- **A stdio `auth` that reaches nothing.** Take a `provider: 'mcp'` entry with a stdio transport and a `bearer`, `api-key` or `basic` `auth`, but no `providerConfig.transport.credentialEnv`. Its reference is still resolved, and a missing one still degrades the instance. But the provider hands the credential to a stdio server only in the variable `credentialEnv` names, so the credential was dropped and nothing said so. The finding sits at `auth` and names the fix. Add `credentialEnv`, or drop `auth` if the server takes no credential:
13+
14+
```ts
15+
providerConfig: { transport: { kind: 'stdio', command: 'repo-mcp-server', credentialEnv: 'REPO_MCP_TOKEN' } },
16+
auth: { type: 'bearer', credentialRef: 'REPO_MCP_TOKEN' },
17+
```
18+
19+
- **A credential in `transport.credentialEnv`.** That key holds the name of an environment variable, and it is served on every metadata read. The rule now warns when the value reads as a credential instead of a name. That means it opens with an auth scheme (`Bearer …`), or it has a run of 16 or more letters and digits that switches between the two at least four times, the way a generated token does. A conventional name such as `REPO_MCP_TOKEN`, or a long capital name, never draws. The finding names the key and never echoes the value.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/driver-sql': patch
3+
---
4+
5+
refactor(driver-sql): the comparand bind test reads the list operators from the spec
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The SQL driver bind-tests each member of a `$in`, `$nin` or `$between` list as a comparand in its own right. It now asks `isListComparandOperator` from `@objectstack/spec/data` which operators take a list, instead of keeping its own copy of `$in` / `$nin` / `$between`. The set is the same, so no filter compiles or is refused differently. A later change to the spec's list operators now reaches this driver without a second edit.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/plugin-security': patch
3+
---
4+
5+
refactor(plugin-security): the RLS stored-form check reads the list operators from the spec
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The RLS check puts a value comparand into its column's storage form, and a `$in`, `$nin` or `$between` list member by member. It now asks `isListComparandOperator` from `@objectstack/spec/data` which operators take a list, instead of keeping its own copy of `$in` / `$nin` / `$between`. The set is the same, so no policy filter is judged differently. A later change to the spec's list operators now reaches this check without a second edit.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/runtime': minor
4+
---
5+
6+
feat(spec,runtime): a package export carries its namespace and its dependencies, so a reinstalled `.custom` pair keeps both
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: added
10+
11+
`GET /packages/:id/export` answered a package's items and its `id`, `name`, `version` and `label`, and nothing of the two install-manifest keys an install of the export decides by. A `.custom` pair exported and reinstalled through `POST /api/v1/marketplace/install-local` therefore lost its namespace (the install door derives one from the id, so the pair landed under `custom` instead of, for example, `showcase_custom`) and its edge to its base, which orders the pair's install after the base (ADR-0141 D5) and admits its `overrides` declarations at the managed install (ADR-0146 D2).
12+
13+
- **Spec.** `PackageExportManifestSchema` declares two more optional fixed keys, `namespace` and `dependencies`, each the install manifest's own declaration (`ManifestSchema.shape.namespace` / `.dependencies`), so an export refuses exactly what an install would. The schema stays open for the per-type collections.
14+
- **Runtime.** The export writes both from the package's registry row, as the row's manifest declares them, and writes neither when the row declares none.
15+
16+
Nothing to do for existing exports: an export taken before this change still installs as before. Export the package again to carry both keys. `type` is still not written, and `POST /api/v1/packages` still refuses an export; the install-local door is the one that reinstalls an export.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
feat(app-shell): the Studio field panel can turn on a lookup's or user field's `referenceNameVisible`
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The object designer's field panel (`ObjectFieldInspector`) now offers a "Show Name When Unreadable" checkbox on `lookup` and `user` fields, the two types `FieldSchema` accepts `referenceNameVisible` on. Checking it saves `referenceNameVisible: true`, so a reader of the record sees the referenced record's name as plain text when they cannot open that record; clearing it removes the key. On a `lookup` it sits after the picker config; a `user` field, whose target is always `sys_user`, shows the checkbox alone. A retype to any other type removes the key, since the spec refuses it there (`false` included); `lookup` to `user` keeps it. The label and help text match the generic `field` metadata form's row for the same key, in the studio namespace's `en` and `zh` tables. Other field types are unchanged.

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ ruling (`RULED_CEILING_RAISES`); a test file over 10 s of wall, unless the file
143143
measured budget with its class (ruling record 6181973363), is its lane's card, fixed and ⛔
144144
never deleted; a test is deleted only when its PR names a duplicate pinning that assertion at a
145145
layer at least as close to the code (ruling record 6120820653).
146+
A new pin for a component that already has a shared harness file goes into that file as a
147+
top-level `describe`, not a new file (ruling record 6583487846).
146148

147149
### Running the dev server
148150

@@ -633,8 +635,6 @@ Root also exports: `defineStack`, `composeStacks`, `defineView`, `defineApp`, `d
633635
| `ObjectKernel` | Default production runtime. Full DI / EventBus / Plugin lifecycle. |
634636
| `LiteKernel` | Tests (vitest), serverless, edge (Workers). |
635637

636-
`EnhancedObjectKernel` is deprecated — do not use.
637-
638638
---
639639

640640
## Documentation Guardrails
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* A keyset walk by `id` visits every row once, in the driver's own order
5+
* (#29398 item 1) — the query shape of the organization-membership completion
6+
* read in `@objectstack/core` (`readOrganizationMembersToCompletion`): pages
7+
* of `{ organization_id, id: { $gt: after } }`, `orderBy id asc`, a `limit`,
8+
* the columns `id` and `user_id`, resuming after each full page's last id.
9+
*
10+
* The resolver cannot check the order itself, because the order is the
11+
* driver's (a SQL database's collation, not JavaScript's code points); the
12+
* walk is correct exactly when the cursor and the order share one comparison.
13+
* This pins that for this driver: the pages, joined, are the sequence of one
14+
* unpaged ordered read, holding every row of the organization once and no row
15+
* of another. The ids are mixed-case nanoid-alphabet values, no two equal
16+
* after case folding. The same pin lives in driver-sql (per dialect cell),
17+
* driver-sqlite-wasm, driver-turso and driver-mongodb; the drivers' shared
18+
* conformance cases live in `@objectstack/spec/data`, which this change does
19+
* not edit.
20+
*/
21+
22+
import { describe, it, expect, beforeAll } from 'vitest';
23+
import { InMemoryDriver } from './memory-driver.js';
24+
25+
const TABLE = 'sys_member';
26+
const ORG = 'org_walked';
27+
const OTHER_ORG = 'org_other';
28+
29+
/** The organization walked: sixteen ids, no two equal after case folding. */
30+
const MEMBER_IDS = [
31+
'AC', 'Ab9', 'B-2', 'a-c', 'aB3', 'ab', 'b_1', '0Zz',
32+
'Z0', 'z_9', '_x', '-y', 'Mm', 'mN1', 'n', 'Q-q',
33+
] as const;
34+
/** Another organization's rows, interleaved with the walked ones. */
35+
const OTHER_IDS = ['Aa', 'b', 'zZ'] as const;
36+
37+
/** Page sizes: one row, a mid-run boundary, an exact multiple (16 = 4 x 4), the whole set. */
38+
const PAGE_SIZES = [1, 3, 4, 16] as const;
39+
40+
const userIdOf = (id: string) => `user_${id}`;
41+
42+
describe("InMemoryDriver — a keyset walk by id visits every member once, in the driver's order (#29398)", () => {
43+
let driver: InMemoryDriver;
44+
45+
beforeAll(async () => {
46+
driver = new InMemoryDriver({ persistence: false });
47+
await driver.connect();
48+
const rows = [
49+
...MEMBER_IDS.map((id) => ({ id, organization_id: ORG, user_id: userIdOf(id) })),
50+
...OTHER_IDS.map((id) => ({ id, organization_id: OTHER_ORG, user_id: userIdOf(id) })),
51+
];
52+
for (const row of rows) await driver.create(TABLE, row);
53+
});
54+
55+
/** The completion read's loop: resume after the last id of each full page. */
56+
const walk = async (pageSize: number) => {
57+
const visited: Array<Record<string, unknown>> = [];
58+
let after: unknown;
59+
let reads = 0;
60+
for (;;) {
61+
const where = after === undefined
62+
? { organization_id: ORG }
63+
: { organization_id: ORG, id: { $gt: after } };
64+
const page: Array<Record<string, unknown>> = await driver.find(
65+
TABLE,
66+
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] },
67+
);
68+
reads += 1;
69+
// A driver that ignores the cursor would page forever: fail instead of hanging.
70+
expect(reads, 'the walk did not end; the cursor is not narrowing the read').toBeLessThanOrEqual(MEMBER_IDS.length + 1);
71+
visited.push(...page);
72+
if (page.length < pageSize) break;
73+
after = page[page.length - 1]!.id;
74+
}
75+
return { visited, reads };
76+
};
77+
78+
/** The driver's own order, read once without a page boundary to cross. */
79+
const ordered = async () => {
80+
const rows: Array<Record<string, unknown>> = await driver.find(
81+
TABLE,
82+
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] },
83+
);
84+
return rows.map((r) => String(r.id));
85+
};
86+
87+
for (const pageSize of PAGE_SIZES) {
88+
it(`pages of ${pageSize}: every member once, no other organization's row, in one ordered read's sequence`, async () => {
89+
const { visited, reads } = await walk(pageSize);
90+
const ids = visited.map((r) => String(r.id));
91+
92+
expect(ids).toEqual(await ordered());
93+
expect([...ids].sort()).toEqual([...MEMBER_IDS].sort());
94+
expect(new Set(ids).size).toBe(MEMBER_IDS.length);
95+
for (const row of visited) expect(row.user_id).toBe(userIdOf(String(row.id)));
96+
expect(reads).toBe(Math.floor(MEMBER_IDS.length / pageSize) + 1);
97+
});
98+
}
99+
});
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* A keyset walk by `id` visits every row once, in the driver's own order
5+
* (#29398 item 1) — the query shape of the organization-membership completion
6+
* read in `@objectstack/core` (`readOrganizationMembersToCompletion`): pages
7+
* of `{ organization_id, id: { $gt: after } }`, `orderBy id asc`, a `limit`,
8+
* the columns `id` and `user_id`, resuming after each full page's last id.
9+
*
10+
* The resolver cannot check the order itself, because the order is the
11+
* driver's (a SQL database's collation, not JavaScript's code points); the
12+
* walk is correct exactly when the cursor and the order share one comparison.
13+
* This pins that for this driver: the pages, joined, are the sequence of one
14+
* unpaged ordered read, holding every row of the organization once and no row
15+
* of another. The ids are mixed-case nanoid-alphabet values, no two equal
16+
* after case folding. The same pin lives in driver-memory, driver-sql (per dialect cell),
17+
* driver-sqlite-wasm and driver-turso; the drivers' shared
18+
* conformance cases live in `@objectstack/spec/data`, which this change does
19+
* not edit.
20+
*
21+
* Like this package's other live suites it needs a real mongod and is opt-in
22+
* (`test-mongod.ts`): without one it is a named skip.
23+
*/
24+
25+
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
26+
import type { MongoMemoryServer } from 'mongodb-memory-server';
27+
import { MongoDBDriver } from './mongodb-driver.js';
28+
import { createTestMongod } from './test-mongod.js';
29+
30+
const TABLE = 'sys_member';
31+
const ORG = 'org_walked';
32+
const OTHER_ORG = 'org_other';
33+
34+
/** The organization walked: sixteen ids, no two equal after case folding. */
35+
const MEMBER_IDS = [
36+
'AC', 'Ab9', 'B-2', 'a-c', 'aB3', 'ab', 'b_1', '0Zz',
37+
'Z0', 'z_9', '_x', '-y', 'Mm', 'mN1', 'n', 'Q-q',
38+
] as const;
39+
/** Another organization's rows, interleaved with the walked ones. */
40+
const OTHER_IDS = ['Aa', 'b', 'zZ'] as const;
41+
42+
/** Page sizes: one row, a mid-run boundary, an exact multiple (16 = 4 x 4), the whole set. */
43+
const PAGE_SIZES = [1, 3, 4, 16] as const;
44+
45+
const userIdOf = (id: string) => `user_${id}`;
46+
47+
const sharedMongod: MongoMemoryServer | undefined = await createTestMongod('member keyset walk conformance');
48+
49+
describe.skipIf(!sharedMongod)("driver-mongodb — a keyset walk by id visits every member once, in the driver's order (#29398)", () => {
50+
const mongod = sharedMongod as MongoMemoryServer;
51+
let driver: MongoDBDriver;
52+
53+
beforeAll(async () => {
54+
driver = new MongoDBDriver({ url: mongod.getUri(), database: 'member_keyset_walk_conformance' });
55+
await driver.connect();
56+
const rows = [
57+
...MEMBER_IDS.map((id) => ({ id, organization_id: ORG, user_id: userIdOf(id) })),
58+
...OTHER_IDS.map((id) => ({ id, organization_id: OTHER_ORG, user_id: userIdOf(id) })),
59+
];
60+
for (const row of rows) await driver.create(TABLE, row);
61+
}, 90_000);
62+
63+
afterAll(async () => {
64+
if (driver) await driver.disconnect();
65+
if (sharedMongod) await sharedMongod.stop();
66+
});
67+
68+
/** The completion read's loop: resume after the last id of each full page. */
69+
const walk = async (pageSize: number) => {
70+
const visited: Array<Record<string, unknown>> = [];
71+
let after: unknown;
72+
let reads = 0;
73+
for (;;) {
74+
const where = after === undefined
75+
? { organization_id: ORG }
76+
: { organization_id: ORG, id: { $gt: after } };
77+
const page: Array<Record<string, unknown>> = await driver.find(
78+
TABLE,
79+
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] },
80+
);
81+
reads += 1;
82+
// A driver that ignores the cursor would page forever: fail instead of hanging.
83+
expect(reads, 'the walk did not end; the cursor is not narrowing the read').toBeLessThanOrEqual(MEMBER_IDS.length + 1);
84+
visited.push(...page);
85+
if (page.length < pageSize) break;
86+
after = page[page.length - 1]!.id;
87+
}
88+
return { visited, reads };
89+
};
90+
91+
/** The driver's own order, read once without a page boundary to cross. */
92+
const ordered = async () => {
93+
const rows: Array<Record<string, unknown>> = await driver.find(
94+
TABLE,
95+
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] },
96+
);
97+
return rows.map((r) => String(r.id));
98+
};
99+
100+
for (const pageSize of PAGE_SIZES) {
101+
it(`pages of ${pageSize}: every member once, no other organization's row, in one ordered read's sequence`, async () => {
102+
const { visited, reads } = await walk(pageSize);
103+
const ids = visited.map((r) => String(r.id));
104+
105+
expect(ids).toEqual(await ordered());
106+
expect([...ids].sort()).toEqual([...MEMBER_IDS].sort());
107+
expect(new Set(ids).size).toBe(MEMBER_IDS.length);
108+
for (const row of visited) expect(row.user_id).toBe(userIdOf(String(row.id)));
109+
expect(reads).toBe(Math.floor(MEMBER_IDS.length / pageSize) + 1);
110+
});
111+
}
112+
});

0 commit comments

Comments
 (0)