Skip to content

Commit db65090

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-r2ii08
2 parents b767211 + fe97d85 commit db65090

54 files changed

Lines changed: 1383 additions & 173 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+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
'@objectstack/mcp': patch
5+
'@objectstack/platform-objects': patch
6+
---
7+
8+
feat(console): Connect an AI Assistant names the connected assistant and its last call; plain-words page subtitle
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
- **`@object-ui/app-shell`**: once the signed-in person has connected, the line under the example requests on Connect an AI Assistant names what is connected and when it last made a call, the most recent call first: an authorized assistant by its name, with its last call "in the hour from" the recorded hour, or an API key by its name, with its last call as a moment; "no call yet" when none is recorded, and a pointer to the list at the bottom when more than one is connected. With nothing connected (or when it cannot be read) the line stays the try-first hint. It reads the records the "What can act as you" list reads (`oauth.authorizedClients.list()` and the person's own `sys_api_key` rows; a revoked or expired key is not a connection) through one hook, `useConnectedAccess`, and follows a Revoke made on the page.
14+
- **`@object-ui/i18n`**: `connectAgent.capabilities.connected`, `connectedKey`, `lastCallHour`, `lastCallAt`, `noCallYet` and `moreConnected` added in all eleven packs.
15+
- **`@objectstack/mcp`**: the Connect an AI Assistant page header no longer speaks of MCP-capable clients or row-level security: "Work in this system from Claude, Doubao and other AI assistants. Each one acts as you: it sees and changes only what your own permissions allow."
16+
- **`@objectstack/platform-objects`**: `pages.connect_agent.subtitle` follows in en, es-ES, ja-JP, zh-CN and zh-Hant, with the source digests re-recorded.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/plugin-hono-server': patch
3+
---
4+
5+
fix(plugin-hono-server): a graceful `close()` now finishes when the last in-flight request ends, not a keep-alive window later
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`HonoHttpServer.close()` released idle keep-alive sockets only once, at the start of the drain. A connection whose request was still running at that moment became an idle keep-alive socket after its response ended, and `close()` then waited for the client to drop it: about 3 s with `fetch` and 4 s with the `node:http` / `node:https` agent, or the server's own keep-alive timeout. During a drain, a response that has not written its headers yet now goes out with `Connection: close`, and a response that had already sent keep-alive headers closes its own connection once every byte of it has been flushed. Other connections are not touched when one response ends. The drain window still force-closes whatever outlasts it.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(studio): Studio shows, keeps and authors the optional master of a controlled-by-parent object (#30974)
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
Since ADR-0055 §1 as amended (#30905, ruling A), a `controlled_by_parent` object's ONLY `master_detail` may be declared `required: false`: an optional master, whose records may name no master and are then visible only to their owner and to View All Records on the object. Studio still treated every master as required. It now follows the spec:
12+
13+
- **Display.** The package OWD overview names the master the spec's `controlledByParentMasterOf` names, so an optional master is shown as the master instead of "no master". An omitted `required` on the object's only `master_detail` is shown as the master too, the way the builder and stored data read it.
14+
- **Save.** Switching an object to Controlled by parent (in the OWD overview or the object's Settings tab) still sets `required: true` on each `master_detail` that writes no `required`, and now keeps an explicit `required: false`. A Studio save no longer turns an optional master required.
15+
- **Authoring.** On the object's only `master_detail`, the field inspector's Required box is no longer locked on: clearing it writes `required: false`, and the help text under it explains the optional master and who can see a record that names none. Beside another `master_detail` the lock stands, since the spec admits no optional master there.
16+
- **New string.** `@object-ui/i18n`'s studio namespace gains `designer.field.requiredCbpOptionalMaster` (en, zh).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli): `os diff` now says what a replay does to a seed dataset in mode `insert`, as it already did for `replace`: a replay inserts its records again, and a row the database refuses is that row's error. The loader's `insert` arm inserts every record without looking for a match, so the plan no longer reads an `insert` dataset as harmless.
6+
7+
Clause-②: no
8+
Metadata-protocol: none

‎docs/qa/platform-checklist/areas/platform-core.json‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3053,10 +3053,10 @@
30533053
},
30543054
{
30553055
"id": "platform-core.seed-mode-matrix",
3056-
"title": "Seed mode matrix (insert/update/upsert/replace/ignore): each mode does exactly its verb through the ONE SeedLoaderService, no-op replays skip instead of churning, ignore reports skips — and `replace` is DECLARED delete-all-then-insert but IMPLEMENTED as bare insert (no caller clears the table): the posture is recorded, never ticked as scoped deletion",
3056+
"title": "Seed mode matrix (insert/update/upsert/replace/ignore): each mode does exactly its verb through the ONE SeedLoaderService, no-op replays skip instead of churning, ignore reports skips — and `replace` inserts and deletes nothing, DECLARED and IMPLEMENTED alike (no caller clears the table): its posture is scored as bare insert, never ticked as scoped deletion",
30573057
"since": "v15",
30583058
"status": "active",
3059-
"revision": 6,
3059+
"revision": 7,
30603060
"priority": "P1",
30613061
"surface": "api",
30623062
"personas": ["seeded admin (admin@objectos.ai / admin123)"],
@@ -3078,7 +3078,7 @@
30783078
"UPDATE: seed draft (mode update) touching A (changed value) and a nonexistent D → A updates, D is SKIPPED (update never creates); row count unchanged",
30793079
"IGNORE: seed draft (mode ignore) with A (changed value) and new E → A untouched (still the update-mode value; existing rows are never rewritten), E inserted; the skip is visible as A's unchanged value + count",
30803080
"INSERT: seed draft (mode insert) re-declaring A → a SECOND A-named row appears (no matching in insert mode); record the duplication; if the object declares a unique key on the natural key instead, record the refusal — either shape is the mode's real contract",
3081-
"REPLACE (expected-posture probe): add one row F by hand through /api/v1/data (a row the seed does NOT declare); publish a seed draft (mode replace) declaring only G → capture what happens to F. At head: F SURVIVES and G is inserted — the loader's replace case is bare insert with the comment 'caller should have cleared the table', and NO caller in the tree clears anything. Record the declared-vs-implemented gap; do NOT tick 'replace scoped to its own object' (there is no deletion to scope) and do NOT file F's survival as data loss (it is the opposite)",
3081+
"REPLACE (expected-posture probe): add one row F by hand through /api/v1/data (a row the seed does NOT declare); publish a seed draft (mode replace) declaring only G → capture what happens to F. At head: F SURVIVES and G is inserted — the loader's replace case is bare insert with the comment 'caller should have cleared the table', and NO caller in the tree clears anything, which is what SeedMode now declares for replace ('deleting nothing: for a cache table the caller cleared'). Score F's survival as the declared posture; do NOT tick 'replace scoped to its own object' (there is no deletion to scope) and do NOT file F's survival as data loss (it is the opposite)",
30823082
"idempotence tie-in: re-publish the upsert draft unchanged TWICE. The first replay may legitimately write, because steps 2–4 rewrote A's rows (update mode set A to a2, insert mode added a second A-named row), so it re-converges them to the seed; the SECOND replay is the idempotence probe — zero inserts and zero updates (all no-op skips), every row's updated_at untouched (the churn-avoidance isNoOpReplay exists for exactly this)",
30833083
"teardown: the writable package's own delete, or discard the run's own DB"
30843084
],
@@ -3108,7 +3108,7 @@
31083108
"evidence": "the post-insert row listing (or the refusal body)"
31093109
},
31103110
{
3111-
"clause": "EXPECTED POSTURE (declared ≠ implemented): `replace` is documented 'Delete ALL records in object then insert (Dangerous)' but the implementation is bare insert — writeRecord's replace arm inserts with the comment 'caller should have cleared the table' and NO caller anywhere clears it, so pre-existing rows SURVIVE a replace-mode publish. The run records this gap (a checklist-accuracy/product finding routed through the sweep's anchor, not re-filed per run); it must NOT tick a 'replace deletes only its own object's rows' claim — no deletion exists to scope. If a future head implements the clear, this clause is stale: revise, and then ALSO prove the deletion is scoped to the seed's own object before trusting it",
3111+
"clause": "EXPECTED POSTURE (declared = implemented): `replace` inserts every record with no match and deletes nothing. SeedMode's replace member declares 'Insert every record, no match, deleting nothing: for a cache table the caller cleared', SeedSchema's mode description says replace 'does the same and deletes nothing: it is for a table the caller cleared', and writeRecord's replace arm is that bare insert (its comment 'caller should have cleared the table'; NO caller anywhere clears it), so pre-existing rows SURVIVE a replace-mode publish. F's survival is the declared behaviour: neither a gap to record nor data loss to file; the run must NOT tick a 'replace deletes only its own object's rows' claim — no deletion exists to scope. If a future head implements a clear (in the loader or in a caller), this clause is stale: revise, and then ALSO prove the deletion is scoped to the seed's own object before trusting it",
31123112
"oracle": "api",
31133113
"verify": "F (undeclared, hand-inserted) still present after the replace publish; G inserted; grep evidence: the only 'replace' write arm is the insert in seed-loader.ts's writeRecord, and decideWriteAction (the batched mirror) routes replace to insert — cite the symbols, never a line number",
31143114
"evidence": "F's surviving read + G's read + the source excerpt"
@@ -3128,7 +3128,7 @@
31283128
"mode insert — no matching, always writes (duplicates on replay unless the object's own unique constraint refuses)",
31293129
"mode update — matched rows only; unmatched skipped, never created",
31303130
"mode upsert — create-or-update on externalId with no-op-replay skip (the default)",
3131-
"mode replace — DECLARED clear-then-insert, IMPLEMENTED bare insert (the expected-posture clause)",
3131+
"mode replace — bare insert, no matching, nothing deleted: DECLARED and IMPLEMENTED alike (the expected-posture clause)",
31323132
"mode ignore — insert-if-absent; existing rows never rewritten"
31333133
],
31343134
"enumSource": {
@@ -3138,7 +3138,7 @@
31383138
},
31393139
"traps": ["destructive-in-place", "seed-data-thin", "silent-coercion"],
31403140
"source": [
3141-
"packages/spec/src/data/seed.zod.ts#SeedMode (SeedMode — the five modes with their declared semantics, incl. replace's 'Delete ALL records … Dangerous' claim)",
3141+
"packages/spec/src/data/seed.zod.ts#SeedMode (SeedMode — the five modes with their declared semantics, incl. replace's 'Insert every record, no match, deleting nothing: for a cache table the caller cleared'), (SeedSchema's mode description — replace 'does the same and deletes nothing: it is for a table the caller cleared')",
31423142
"packages/metadata-protocol/src/seed-loader.ts#writeRecord (mode = dataset.mode || config.defaultMode), (existing-records preload for upsert/update/ignore ONLY — insert/replace never match), (writeRecord per-mode switch; the replace arm's bare insert + 'caller should have cleared the table' comment), (decideWriteAction — the batched mirror, replace → insert),+ (isNoOpReplay — seed-declared fields only, conservative on doubt)",
31433143
"packages/spec/src/data/seed-loader.zod.ts#defaultMode (defaultMode default 'upsert')",
31443144
"packages/metadata-protocol/src/protocol.ts#applySeedBodies+ (applySeedBodies — published seed bodies materialize through the same loader; failures returned, never thrown, surfaced as seedApplied)",
@@ -3182,6 +3182,12 @@
31823182
"date": "2026-10-28",
31833183
"change": "fixtures.requires[0] names the earlier refusal. Checklist-accuracy finding of the 18.2.0 wave 2 (QA run #26476, manual api set, at 756220c4; wave anchor #25807, slice B): a body name that mismatches the URL answered 400 VALIDATION_ERROR before the strict schema's 422 unrecognized_keys could. Measured live by that run; the requirement (no body name) is unchanged. No clause changed",
31843184
"ref": "#25807"
3185+
},
3186+
{
3187+
"revision": 7,
3188+
"date": "2026-11-07",
3189+
"change": "title, steps[5], acceptance[4].clause, variants[3] and source[0] re-worded: replace is now declared = implemented. #31099 (PR #31135) rewrote SeedMode's replace member and SeedSchema's mode description to what the loader does (insert every record, no match, deleting nothing), so the clause's 'declared ≠ implemented' posture went false and source[0] quoted the old delete-all-then-insert wording, which seed.zod.ts no longer holds. Read at base 658d84f5: seed.zod.ts SeedMode and SeedSchema mode describe text (no delete-all wording left), seed-loader.ts writeRecord's replace arm (bare insert, comment 'caller should have cleared the table') and decideWriteAction (replace routes to insert), and no other replace arm on the seed path (packages/cli/src/commands/diff.ts only words a plan line). The probe and its verdicts are unchanged: F survives, G is inserted, nothing is ticked as scoped deletion",
3190+
"ref": "#31140"
31853191
}
31863192
]
31873193
},

‎packages/cli/src/commands/diff.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ function diffNamedArrays(
7979
function seedModeNote(mode: string): string {
8080
if (seedModeOverwritesMatchedRows(mode)) return '; a replay writes its columns over the rows it matches';
8181
if (mode === 'replace') return '; a replay deletes nothing and inserts these again, so rows already in the table stay';
82+
if (mode === 'insert') return "; a replay inserts these again, and a row the database refuses is that row's error";
8283
return '';
8384
}
8485

‎packages/cli/test/diff-upgrade-plan.test.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,28 @@ describe('os diff — what the upgrade plan adds', () => {
153153
{ type: 'modified', category: 'data', name: 'acme_region', breaking: false, detail: 'seed dataset changed: records; mode ignore' },
154154
]);
155155
});
156+
157+
it('an insert dataset, added or changed, says a replay inserts its records again; ignore stays silent', () => {
158+
const before = lead({}, [
159+
{ object: 'acme_source', mode: 'insert', records: [{ name: 'web' }] },
160+
{ object: 'acme_region', mode: 'ignore', records: [{ name: 'emea' }] },
161+
]);
162+
const after = lead({}, [
163+
{ object: 'acme_source', mode: 'insert', records: [{ name: 'web' }, { name: 'event' }] },
164+
{ object: 'acme_region', mode: 'ignore', records: [{ name: 'apac' }] },
165+
{ object: 'acme_channel', mode: 'insert', records: [{ name: 'email' }] },
166+
]);
167+
const insertNote = "a replay inserts these again, and a row the database refuses is that row's error";
168+
expect(diffStacks(before, after)).toEqual([
169+
{
170+
type: 'added', category: 'data', name: 'acme_channel', breaking: false,
171+
detail: `seed dataset added: 1 record(s); mode insert; ${insertNote}`,
172+
},
173+
{
174+
type: 'modified', category: 'data', name: 'acme_source', breaking: false,
175+
detail: `seed dataset changed: records; mode insert; ${insertNote}`,
176+
},
177+
{ type: 'modified', category: 'data', name: 'acme_region', breaking: false, detail: 'seed dataset changed: records; mode ignore' },
178+
]);
179+
});
156180
});

‎packages/cli/test/released-port-production-spawn.pin.test.ts‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,22 @@ describe('#24295 / #24342: no file that spawns the CLI draws a released port', (
338338
}
339339
});
340340

341+
/**
342+
* An explicit budget, sized to the measured work. The case reads and parses
343+
* every `.ts` file under `test/` (`liveTree()`). Reaching the whole live
344+
* tree is what the case claims, so the walk is not cut. The case is
345+
* synchronous, so vitest judges it after the body returns.
346+
*
347+
* Readings: the slowest `Test Core` reading is 2629 ms (`main` push and merge
348+
* group runs, 2026-11-03..06, n=6); local idle, 1102-1291 ms.
349+
*
350+
* The rule is 3x the slowest reading, rounded up to the next second (the rule
351+
* and why 3x: plugin-sharing's `share-link-password-webcontainer.test.ts`):
352+
* 3 x 2629 = 7887, so the budget is 8000. If `test/` grows much, re-measure
353+
* and re-size.
354+
*/
355+
const LIVE_TREE_BUDGET_MS = 8_000;
356+
341357
it('the census reaches the live tree: every way of spawning the CLI, and the draw, are found', () => {
342358
const tree = liveTree();
343359
const population = cliSpawners(tree);
@@ -359,7 +375,7 @@ describe('#24295 / #24342: no file that spawns the CLI draws a released port', (
359375
const instrument = tree.get('serve-port-bind-probe.test.ts');
360376
expect(instrument?.drawLines.length ?? 0, 'the draw census finds no draw in the bind-probe instrument').toBeGreaterThan(0);
361377
expect(instrument?.spawnsCli).toBe(false);
362-
});
378+
}, LIVE_TREE_BUDGET_MS);
363379

364380
it('every file that spawns the CLI draws exactly what its ledger entry allows — zero without one', () => {
365381
const offenders: string[] = [];

‎packages/client/src/auth-rotated-session-token.test.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ const arrangeServer = async () => {
214214
};
215215

216216
/**
217-
* [#23181] The file's ONE server, built by the first case that signs in and
218-
* shared by every later one. Each case still signs a user of its own up on it,
217+
* [#23181] The file's ONE server, shared by every case. It is built at module
218+
* scope right after the warm-up (below), so no case's clock carries its
219+
* engine, schema sync and better-auth instance: before, the first case to
220+
* sign in built it inside its own window. Each case still signs a user of its own up on it,
219221
* through a client of its own, and every assertion here is about that user's
220222
* credential: a rotation revokes only the rotating user's sessions, and a
221223
* case reads its own user by address. So no case reads another case's writes,
@@ -357,6 +359,10 @@ const closeEngines = async (): Promise<void> => {
357359
// and `④` below pins that.
358360
await signedIn();
359361
await closeEngines();
362+
// The cases' shared server, built here for the same reason: it is
363+
// arrangement, not behaviour, and the first case used to pay it. Its
364+
// better-auth instance is built on first use, so that is asked for here too.
365+
await (await fileServer()).manager.getAuthInstance();
360366

361367
beforeEach(() => {
362368
vi.spyOn(console, 'warn').mockImplementation(() => {});

0 commit comments

Comments
 (0)