Skip to content

Commit 5839005

Browse files
committed
Merge origin/main (#35225 expand and related reads) into the aggregate order and cut
One conflict, in packages/mcp/src/stdio-data-bridge.ts, resolved keeping both sides: the two Symbol.for read-option constants (this branch's STDIO_AGGREGATE_ORDER_CUT and #35199's STDIO_LATEST_PER), each under its own docblock, then #35225's stdioExpandMap byte-identical to main, then unwrapRows under its own docblock. mcp-http-tools.ts and runtime domains/mcp.ts merged without conflict. Claude-Session: https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8 Co-authored-by: Claude <noreply@anthropic.com>
2 parents 3eca623 + dbb2f68 commit 5839005

83 files changed

Lines changed: 7550 additions & 436 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/scenarios': patch
3+
---
4+
5+
feat(scenarios): `--modes door` builds a card through the MCP draft door with no project, then publishes it as a person would
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The runner gains a fourth mode. A door mode turn is given the booted app's MCP draft door (an OAuth token scoped `openid metadata:write`, in a 0600 config outside its directory), an empty directory of its own outside the host project, and nothing else: file and command tools are denied. The runner then does what a person does in Studio: it creates a writable package in the card's namespace before the turn, and lists and publishes that package's drafts after it (`POST /api/v1/packages/:id/publish-drafts`). It grades what the environment then serves exactly as a scratch build is graded, Build half then Run half. A publish that does not answer `published` is a finding naming each refused draft, since a refusal answers on a 200.
11+
12+
A round measures what instruction text is worth by arms. `--door-skills DIR` (less `--door-skill-omit`) gives the client Claude Code skills. `--door-rules FILE` or `OS_SCENARIOS_DOOR_RULES` (less `--door-rules-omit`) gives it rule texts the maintainer supplies from outside the repository, in a documented `{ rules: [{ id, text }], sets }` format that is refused loudly when malformed. The record states the arm (skills with sha256, the rules file's name and sha256, the ids active and omitted, never a text), and `summary` never sums two arms. A replay re-sends the recorded draft saves through the replay's own door. Codex and external drivers are refused for door mode.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/plugin-dashboard': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(plugin-dashboard): the dashboard table widget no longer offers an "Export CSV" download
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The dataset table and cross-tab widgets drew a download button that built a CSV in the browser. That file skipped the export grant and the export audit entry that list export enforces. The button, its CSV helpers and the `dashboard.exportCsv` label in every locale pack are removed. To take rows out, use list export, which checks the export grant and writes the audit entry. Report exports are unchanged.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
'@objectstack/spec': minor
4+
'@object-ui/auth': patch
5+
---
6+
7+
feat(auth): `directSignIn.afterSignOut` lets an explicit sign-out return through the identity provider's sign-in page
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: added
11+
12+
A deployment with direct sign-in on can now choose where an explicit sign-out returns once the identity provider has ended its own session. The default keeps today's behaviour, so nothing changes until a deployment sets the new value.
13+
14+
- The auth plugin's `directSignIn` option takes `afterSignOut: 'hold' | 'identity-provider'`, and the environment variable `OS_AUTH_DIRECT_SIGN_IN_AFTER_SIGN_OUT` wins over it, like the other direct sign-in settings. `hold` is the default. Any other value refuses to boot, naming the variable and both values.
15+
- `GET /api/v1/auth/config` serves `features.afterSignOut` while the direct sign-in setting is on, on the same terms as `features.localSignIn`, and leaves it out otherwise. `AuthFeaturesConfigSchema` in `@objectstack/spec` gains the optional `afterSignOut` enum, and `PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS` gains `'afterSignOut'`.
16+
- `hold`: the Console's sign-out sends the sign-in page as the provider's return address, and the page holds with a button to sign in again, as before.
17+
- `identity-provider`: while `features.directSignIn` reads `true`, the Console's sign-out sends `{basePath}/sign-in/direct` instead, so after the provider's logout the browser goes through the direct sign-in door to the provider's own sign-in page. The door starts a fresh sign-in without the browser's cookies, and the provider has just ended its session, so it asks for credentials; it does not loop. Register the door's absolute address as a post-logout redirect URI at the provider.
18+
- `@object-ui/auth`: `AuthPublicConfig.features` gains the optional `afterSignOut`. When the tab holds no auth config at sign-out, the client reads it once (3 seconds at most) and keeps the sign-in page if it cannot.
19+
- Module exports on the `@objectstack/plugin-auth` entry: the type `DirectSignInAfterSignOut`. In `direct-sign-in.ts` (not on the package entry): `DIRECT_SIGN_IN_AFTER_SIGN_OUT`, and `DIRECT_SIGN_IN_ENV.afterSignOut`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
fix(plugin-auth): an invitation mail sent outside a better-auth endpoint still carries the mailbox proof
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A host that calls the organization plugin's `sendInvitationEmail` from its own code, outside any better-auth endpoint, now sends the same mail the console's invite sends: its link carries the invitation's mailbox proof, so the invitee can use the one-step acceptance from it. The proof is minted through the auth manager's own context when no endpoint context exists. Nothing else changes: the proof is still delivered only in the mail and never stored in clear, and a send inside an endpoint mints exactly as before.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/mcp': patch
3+
'@objectstack/runtime': patch
4+
---
5+
6+
feat(mcp): a record with its related records in one call — `expand` on `query_records`, `related` on `get_record`
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
`query_records` takes `expand`: up to 3 of the queried object's lookup, master-detail, user or tree fields, each answered as the record it names, one level deep. `get_record` takes `related`: up to 3 child objects that point at the record, each answered as a list of at most 20 rows (never above the tool's `maxQueryLimit`), as `{ record, related: [{ object, field, records, total, hasMore }] }`.
12+
13+
- Every object a new read shape reaches is judged by the MCP read guard exactly as the object the call names. A target the guard refuses refuses the whole call with `PERMISSION_DENIED` / 403 before any record is read. A related object whose definition is not served to the caller refuses it with `OBJECT_NOT_FOUND` / 404, also before any read.
14+
- An `expand` name that is not a relationship field of the object as the caller is served it, and a `related` link `field` that does not point at the record, are refused with `INVALID_FIELD` / 400 before any read. A child that points at the record through several fields needs `field`.
15+
- `expand` runs through the engine's one expansion path: one batched `id IN (...)` read per field, under the target's own permissions, row-level security and field masking. It combines with `latestPer`. Only the read guard's refusal refuses the call: a record the caller may not read on an admitted target object is not expanded, and the field keeps its stored id.
16+
- A related list is one `query_records` read of the child, filtered only by the link to the record, with the child's own `fields` and `orderBy` and no caller filter. It is read only after the record itself. A list with more rows than its cap carries `truncated: true`.
17+
- Each related list carries the delegation notice `query_records` carries (`delegationNarrowed`, `warning`) when the agent ceiling narrowed the read.
18+
- The record and each related list carry `withheldFields` exactly as a plain `get_record` and a plain `query_records` of that object do.
19+
- The stdio bridge serves `expand` too, built as the data door builds it (a target that does not serve `get` keeps its stored id). `McpDataBridge.query` gains an optional `expand` member.
20+
21+
Without `expand` or `related`, both tools answer exactly as before. `@objectstack/spec` is unchanged.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/plugin-detail': patch
3+
---
4+
5+
fix(plugin-detail): a record page's empty-sections line follows the reader's remembered "show empty fields" choice
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A reader who chose "show empty fields" for an object found the record page's closing empty-sections line ("Deal Narrative · Notes & Next Steps · 2 empty sections · Expand") folded again on every visit, on the default record page and on an authored one alike, and expanding the line was forgotten as soon as the page closed.
11+
12+
The line now reads and writes the same remembered choice each section's own "Show N empty fields" row already uses, kept per user and object. With "show empty fields" remembered, the line opens on its own, on both page kinds. Expanding or collapsing the line is that choice: it is remembered for every record of the object, after a reload and on another device, and it also opens or folds each section's own empty fields, since it is one choice.
13+
14+
What does not change: with no signed-in user or no host preference store, the line keeps its own state, forgotten when the page closes, as before. Edit mode and a print page still draw every section. No metadata key, value or default changes.

‎.claude/skills/scenario-eval/SKILL.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ metadata:
5050
- 规划写成一张表再动手:卡 × 配置 × 重复 → 命令条数 × 预计墙钟;超出 2 小时的一条拆开。
5151
- **问数日轮的卡** = 带数据集的卡:`grep -l '"datasetQuestions"' docs/qa/scenarios/*.json` 读出名单(写本技能时是
5252
`order_to_cash`、`travel_expense`),⛔ 不凭记忆列。只跑 `--modes ask --template F`:不搭建、不评 Build、不 iterate。
53-
`F` 是该卡已验证的构建,命名空间与卡不符的会被跳过,所以一卡一条命令(`--only ID`);同一份构建跨轮复用,
54-
换了构建,Reading 点名这一变量。
53+
`F` 是该卡入库的已验证构建 `docs/qa/scenarios/builds/ID.json`(卡库 README〈Verified builds〉),命名空间与卡不符的
54+
会被跳过,所以一卡一条命令(`--only ID`);同一份构建跨轮复用,换了构建(只经 PR),Reading 点名这一变量。
5555
- **问数日轮的节奏**:每天一轮 `--ask-repeats 1`,每周一轮 `--ask-repeats 5`;操作回合不重复,只跑一次(README〈Repeats〉)。
5656
- **问数日轮的开跑条件**:日轮在 #34911(ask 模式遇 `422 UNMANAGED_INSTALL_UNCOPYABLE` 改走托管安装)与 #34882
5757
(`asked-back` 不把候选个数、单写的年份算作数字)都合并之后开跑;开跑前查一次两者已合并,未合并就不开跑。
@@ -103,10 +103,11 @@ nohup pnpm --filter @objectstack/scenarios run-scenarios \
103103
--model haiku --effort medium --create-version VERSION \
104104
--out "$OUT" --record "$OUT/run.rec.json" > "$OUT/run.log" 2>&1 &
105105

106-
# 问数日轮:一卡一条;卡名照 §1 从卡文件重读,F 是该卡已验证构建的绝对路径(先查 §1 的开跑条件)
107-
OUT=/abs/path/eval-runs/DATE-ask/haiku-medium/order_to_cash && mkdir -p "$OUT"
106+
# 问数日轮:一卡一条;卡名照 §1 从卡文件重读,--template 是该卡入库构建的绝对路径(先查 §1 的开跑条件;
107+
# order_to_cash 的构建等 #34986,入库前只有 travel_expense 可跑)
108+
OUT=/abs/path/eval-runs/DATE-ask/haiku-medium/travel_expense && mkdir -p "$OUT"
108109
nohup pnpm --filter @objectstack/scenarios run-scenarios \
109-
--only order_to_cash --modes ask --template /abs/path/F.json \
110+
--only travel_expense --modes ask --template "$(git rev-parse --show-toplevel)/docs/qa/scenarios/builds/travel_expense.json" \
110111
--ask-model haiku --ask-effort medium --ask-repeats 1 --create-version VERSION \
111112
--out "$OUT" --record "$OUT/run.rec.json" > "$OUT/run.log" 2>&1 &
112113
```
@@ -115,7 +116,8 @@ nohup pnpm --filter @objectstack/scenarios run-scenarios \
115116

116117
维护者令(原话):"objectstack 公开仓,像 qa-run"。据此场景卡评测记录立在本仓、带全分(问数基线 ② 的
117118
数字仍不对外,见 `lanes/eval.md`)。运行产物 ⛔ 不进仓库树:run 记录 JSON、录音、日志留在 git-ignore 的默认
118-
`--out` 目录或本席的项目文件里;issue 就是报告,纯文本,⛔ 不放图。
119+
`--out` 目录或本席的项目文件里;issue 就是报告,纯文本,⛔ 不放图。轮所装的已验证构建不是运行产物而是 fixture,
120+
在树里(`docs/qa/scenarios/builds/`),只随 PR 改,⛔ 轮不写它。
119121

120122
- **写入门**:立单、评论、关单全走 pm-dispatch 写入门,照 `checklist-test` §4 那一段;⛔ MCP `issue_write`。
121123
- **标题**:`Eval run · SCOPE × N configs × R reps · SHA8 · DATE`,如

‎content/docs/ai/connect-mcp.mdx‎

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ service is installed:
269269
|:---|:---|
270270
| `list_objects` / `describe_object` | Discover which objects exist and their fields |
271271
| `validate_expression` | Check a CEL expression against an object's schema before authoring it into a formula, validation, or flow condition |
272-
| `query_records` / `get_record` | Read data (list queries are capped at 50 rows per page by default) |
272+
| `query_records` / `get_record` | Read data (list queries are capped at 50 rows per page by default); `expand` and `related` read related records in the same call |
273273
| `aggregate_records` | Grouped aggregation (registered when the active driver supports it) |
274274
| `create_record` / `update_record` / `delete_record` | Write data |
275275
| `delete_records` | Delete many records of one object, by a filter or an id list, at most 200 per call (an OAuth token needs both `data:read` and `data:write`) |
@@ -313,6 +313,55 @@ names the groups and the order that picks each group's row:
313313
is read, as it is for an object with an `afterFind` hook or object-scoped read
314314
middleware.
315315

316+
### A record with its related records: `expand` and `related`
317+
318+
`query_records` takes `expand`: up to 3 of the object's lookup, master-detail,
319+
user or tree fields. Each one comes back as the record it names, one level
320+
deep:
321+
322+
```json
323+
{ "objectName": "crm_opportunity", "expand": ["account", "owner_id"] }
324+
```
325+
326+
`get_record` takes `related`: up to 3 child objects that point at the record,
327+
each answered as a list of at most 20 rows (`limit` lowers it):
328+
329+
```json
330+
{
331+
"objectName": "crm_account",
332+
"recordId": "acc_1",
333+
"related": [
334+
{ "object": "crm_opportunity", "orderBy": [{ "field": "close_date", "order": "desc" }] },
335+
{ "object": "crm_activity", "field": "account", "limit": 5 }
336+
]
337+
}
338+
```
339+
340+
- The answer is then `{ record, related: [{ object, field, records, total, hasMore }] }`.
341+
A list with more rows than came back also carries `truncated: true`.
342+
- `field` is the child's field that points at the record. It can be left out
343+
when the child has exactly one such field.
344+
- A related list is filtered only by the link to the record. It takes the
345+
child's own `fields` and `orderBy`, and no other filter.
346+
- Every expanded or related object is read as you, under that object's
347+
permissions, row-level security and field masking. A field you may not read is
348+
not offered for `expand` or as a link.
349+
- The record and each related list name the fields withheld from them in
350+
`withheldFields`, as a plain `get_record` and `query_records` do.
351+
- Every object a new read shape reaches is judged by the MCP read guard exactly
352+
as the object the call names. An object the guard refuses (a system object
353+
that is not opted into AI reads) refuses the whole call with
354+
`PERMISSION_DENIED` before anything is read. A related object that is not
355+
served to you refuses it too. An expanded field is different: when the guard
356+
admits its object but you may not read the record it names (no permission on
357+
that object, or a row it hides from you), the call is answered and the field
358+
keeps its stored id.
359+
- Each related list carries the delegation notice (`delegationNarrowed`,
360+
`warning`) that `query_records` carries when the agent ceiling narrowed the
361+
read.
362+
- A name that is not a relationship field, or a `field` that does not point at
363+
the record, is refused with `INVALID_FIELD`.
364+
316365
### Governed metrics and the `initialize` instructions
317366

318367
`list_datasets` and `query_dataset` are registered with the `data:read` scope,

‎content/docs/deployment/environment-variables.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ Read by `@objectstack/service-print` when `PrintServicePlugin` is composed; see
105105
| `OS_AUTH_DIRECT_SIGN_IN_ENABLED` | boolean | `false` | Send a signed-out visitor to the Console sign-in page straight to the identity provider, and back to the page they asked for. Wins over the auth plugin's `directSignIn` option. The sign-in page is still shown when no single provider can be started, after an identity-provider error, and for an OAuth client's hand-off. See [Skip the sign-in page](/docs/permissions/sso#skip-the-sign-in-page-direct-sign-in). |
106106
| `OS_AUTH_DIRECT_SIGN_IN_PROVIDER` | string | the one configured provider | The `providerId` direct sign-in uses: an `oidcProviders` entry or a registered SSO provider. Unset, the only configured provider is used; with none or several, the sign-in page is shown. |
107107
| `OS_AUTH_DIRECT_SIGN_IN_LOCAL_PATH` | `hidden` \| `off` | `hidden` | With direct sign-in on, whether the Console sign-in form keeps the password form at `/login?local=1` (`hidden`) or offers no local way in (`off`). Server-side password sign-in is unchanged either way. Any other value refuses to boot. |
108+
| `OS_AUTH_DIRECT_SIGN_IN_AFTER_SIGN_OUT` | `hold` \| `identity-provider` | `hold` | With direct sign-in on, where an explicit sign-out returns when the identity provider ends its own session: the Console sign-in page, which holds (`hold`), or the direct sign-in door, so the identity provider's own sign-in page is shown (`identity-provider`). Wins over `directSignIn.afterSignOut`. Any other value refuses to boot. |
108109
| `OS_TENANCY_POSTURE` | `single` \| `group` \| `isolated` | derived from `OS_MULTI_ORG_ENABLED` | Which organization wall the authorization kernel enforces (ADR-0105 D1). `single` = no wall. `group` = `organization_id IN accessible_org_ids` — organizations are membership boundaries over one shared dataset, with union read access across every organization the caller belongs to. `isolated` = `organization_id = <active organization>`, the hard legal-entity wall (formerly spelled `multi`). Unset derives from `OS_MULTI_ORG_ENABLED` (`true` ⇒ `isolated`, else `single`), so existing deployments are unchanged. An unrecognized value **refuses to boot** rather than silently falling back to a posture with no wall. Both walled postures require the enterprise `@objectstack/organizations` runtime — without it the request resolves to `single` and boot is refused unless `OS_ALLOW_DEGRADED_TENANCY=1`. |
109110
| `OS_MULTI_ORG_ENABLED` | boolean | `false` | Superseded by `OS_TENANCY_POSTURE`, and still honoured: `true` selects the `isolated` posture. When `true`, organization creation/switching UI is exposed. |
110111
| `OS_AUTOMATION_SCHEDULED_WORK_ENABLED` | boolean | `false` | Whether this deployment runs **package-authored scheduled work**: time-triggered flows (a `type: 'schedule'` flow with a `config.schedule` cadence, and the `timeRelative` sweep) and packaged `defineJob` cron jobs. **OFF by default in every posture and every kernel** — a clock-driven workload's cost is a fact about the deployment, not about the flow, so an author cannot decide it and no metadata key asks them to. Accepts `true`/`1`/`on`/`yes` (case-insensitive); anything else, including unset, is off. While it is off nothing arms, and every such flow is listed by `getTriggerBindingAudit()` and the CLI startup summary as **disabled by deployment policy** — never as a binding failure, and nothing about the flow needs fixing. While it is on, what a time-triggered flow owes depends on the posture: under `isolated` it must declare `config.organization` on its start node or it is not armed; under `group` the declaration is optional and an undeclared sweep reads group-wide with each run acting as its own swept record's organization (a record-less cron there carries none, and its tenant-scoped writes are refused — declare one if it writes); under `single` it needs no declaration and its runs carry no organization. ⛔ Platform-internal scheduled work — approvals escalation, the lifecycle Reaper, the messaging dispatch loop, membership backfill — is **not** gated by this: the boundary is *authored by a package*, not *runs on the job service*. `os doctor` prints the effective value. |

0 commit comments

Comments
 (0)