Skip to content

chore: version packages (next) - #35129

Merged
os-zhuang merged 1 commit into
mainfrom
changeset-release/main
Nov 26, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

main is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on main.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

The changelog information of each package has been omitted from this message, as the content exceeds the size limit.

@objectstack/spec@19.0.0-next.0

@object-ui/i18n@19.0.0-next.0

@objectstack/cli@19.0.0-next.0

@objectstack/client@19.0.0-next.0

@objectstack/cloud-connection@19.0.0-next.0

@objectstack/core@19.0.0-next.0

create-objectstack@19.0.0-next.0

@objectstack/driver-sql@19.0.0-next.0

@objectstack/formula@19.0.0-next.0

@objectstack/lint@19.0.0-next.0

@objectstack/mcp@19.0.0-next.0

@objectstack/metadata@19.0.0-next.0

@objectstack/metadata-core@19.0.0-next.0

@objectstack/metadata-protocol@19.0.0-next.0

@objectstack/objectql@19.0.0-next.0

@objectstack/platform-objects@19.0.0-next.0

@objectstack/plugin-approvals@19.0.0-next.0

@objectstack/plugin-audit@19.0.0-next.0

@objectstack/plugin-security@19.0.0-next.0

@objectstack/scenarios@19.0.0-next.0

@objectstack/rest@19.0.0-next.0

@objectstack/runtime@19.0.0-next.0

@objectstack/service-automation@19.0.0-next.0

@objectstack/service-messaging@19.0.0-next.0

@objectstack/service-record-context@19.0.0-next.0

@objectstack/types@19.0.0-next.0

@objectstack/verify@19.0.0-next.0

@object-ui/console@19.0.0-next.0

@object-ui/components@19.0.0-next.0

@object-ui/core@19.0.0-next.0

@object-ui/data-objectstack@19.0.0-next.0

@object-ui/fields@19.0.0-next.0

@object-ui/layout@19.0.0-next.0

@object-ui/plugin-calendar@19.0.0-next.0

@object-ui/plugin-detail@19.0.0-next.0

@object-ui/plugin-form@19.0.0-next.0

@object-ui/plugin-gantt@19.0.0-next.0

@object-ui/plugin-grid@19.0.0-next.0

@object-ui/plugin-kanban@19.0.0-next.0

@object-ui/plugin-list@19.0.0-next.0

@object-ui/plugin-report@19.0.0-next.0

@object-ui/plugin-view@19.0.0-next.0

@object-ui/react@19.0.0-next.0

@object-ui/types@19.0.0-next.0

@objectstack/hono@19.0.0-next.0

@objectstack/account@19.0.0-next.0

@objectstack/setup@19.0.0-next.0

@objectstack/studio@19.0.0-next.0

@objectstack/client-react@19.0.0-next.0

@objectstack/connector-mcp@19.0.0-next.0

@objectstack/connector-openapi@19.0.0-next.0

@objectstack/connector-rest@19.0.0-next.0

@objectstack/connector-slack@19.0.0-next.0

@objectstack/console@19.0.0-next.0

@objectstack/driver-memory@19.0.0-next.0

@objectstack/driver-mongodb@19.0.0-next.0

@objectstack/driver-odata@19.0.0-next.0

@objectstack/driver-sqlite-wasm@19.0.0-next.0

@objectstack/driver-turso@19.0.0-next.0

@objectstack/metadata-fs@19.0.0-next.0

@objectstack/observability@19.0.0-next.0

@objectstack/embedder-openai@19.0.0-next.0

@objectstack/knowledge-memory@19.0.0-next.0

@objectstack/knowledge-pgvector@19.0.0-next.0

@objectstack/knowledge-turso@19.0.0-next.0

@objectstack/organizations@19.0.0-next.0

@objectstack/plugin-auth@19.0.0-next.0

@objectstack/plugin-dev@19.0.0-next.0

@objectstack/plugin-email@19.0.0-next.0

@objectstack/plugin-hono-server@19.0.0-next.0

@objectstack/plugin-pinyin-search@19.0.0-next.0

@objectstack/plugin-sharing@19.0.0-next.0

@objectstack/plugin-webhooks@19.0.0-next.0

@objectstack/service-analytics@19.0.0-next.0

@objectstack/service-cache@19.0.0-next.0

@objectstack/service-cluster@19.0.0-next.0

@objectstack/service-cluster-redis@19.0.0-next.0

@objectstack/service-datasource@19.0.0-next.0

@objectstack/service-i18n@19.0.0-next.0

@objectstack/service-job@19.0.0-next.0

@objectstack/service-knowledge@19.0.0-next.0

@objectstack/service-mailbox@19.0.0-next.0

@objectstack/service-package@19.0.0-next.0

@objectstack/service-print@19.0.0-next.0

@objectstack/service-push@19.0.0-next.0

@objectstack/service-queue@19.0.0-next.0

@objectstack/service-realtime@19.0.0-next.0

@objectstack/service-settings@19.0.0-next.0

@objectstack/service-sms@19.0.0-next.0

@objectstack/service-storage@19.0.0-next.0

@objectstack/skills@19.0.0-next.0

@objectstack/trigger-api@19.0.0-next.0

@objectstack/trigger-record-change@19.0.0-next.0

@objectstack/trigger-schedule@19.0.0-next.0

@object-ui/auth@19.0.0-next.0

@object-ui/cli@19.0.0-next.0

@object-ui/collaboration@19.0.0-next.0

@object-ui/mobile@19.0.0-next.0

@object-ui/permissions@19.0.0-next.0

@object-ui/plugin-charts@19.0.0-next.0

@object-ui/plugin-chatbot@19.0.0-next.0

@object-ui/plugin-dashboard@19.0.0-next.0

@object-ui/plugin-designer@19.0.0-next.0

@object-ui/plugin-editor@19.0.0-next.0

@object-ui/plugin-map@19.0.0-next.0

@object-ui/plugin-markdown@19.0.0-next.0

@object-ui/plugin-timeline@19.0.0-next.0

@object-ui/plugin-timesheet@19.0.0-next.0

@object-ui/plugin-tree@19.0.0-next.0

@objectstack/connector-imap@19.0.0-next.0

@objectstack/sdui-parser@19.0.0-next.0

@object-ui/create-plugin@19.0.0-next.0

@object-ui/react-runtime@19.0.0-next.0

@object-ui/app-shell@18.6.0-next.0

@objectstack/example-crm@4.0.107-next.0

@objectstack/example-multi-package@0.0.14-next.0

@objectstack/example-showcase@0.3.29-next.0

@objectstack/example-starter@0.1.1-next.0

@objectstack/example-todo@4.0.107-next.0

@objectstack/example-embed-objectql@0.0.47-next.0

@objectstack/connector-app-docusign@0.1.5-next.0

@objectstack/connector-app-github@0.1.5-next.0

@objectstack/connector-app-stripe@0.1.5-next.0

@objectstack/dogfood@0.0.55-next.0

@objectstack/downstream-contract@0.0.53-next.0

@objectstack/http-conformance@0.1.15-next.0

@github-actions
github-actions Bot force-pushed the changeset-release/main branch from 248c27e to 6287708 Compare November 18, 2026 12:09
@github-actions
github-actions Bot force-pushed the changeset-release/main branch 2 times, most recently from 4c945f2 to da8f073 Compare November 19, 2026 00:16
@github-actions
github-actions Bot force-pushed the changeset-release/main branch from da8f073 to 8a99c4b Compare November 19, 2026 06:11
@github-actions
github-actions Bot force-pushed the changeset-release/main branch from 8a99c4b to c1b2e5b Compare November 19, 2026 12:10
@github-actions
github-actions Bot force-pushed the changeset-release/main branch from c1b2e5b to 31fd9c9 Compare November 19, 2026 18:10
@github-actions
github-actions Bot force-pushed the changeset-release/main branch from 31fd9c9 to 98835e3 Compare November 20, 2026 00:17
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 33a31dc Nov 26, 2026
72 of 73 checks passed
@os-zhuang
os-zhuang deleted the changeset-release/main branch November 26, 2026 16:25
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… on a hosted tenant kernel instead of 404 (objectstack-ai#36690)

<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8HLrJyMR9mKwcN7row9NW91)_

Fixes objectstack-ai#36506

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

- 用户看到的变化:在托管云环境里,删除个人视图、删除或重命名记录附件,从“找不到”变为正常完成;自部署环境不变。
- 为什么:这三个操作原先只挂在自部署才有的网络入口上,托管租户没有这个入口,请求落空。
- 坏了会怎样:托管环境里这三个操作回到“找不到”或“未实现”;不会越权,身份和成员校验比自部署更严。
- 需要你做什么:合并即可;云端无需改代码,下次把云端依赖的平台版本升到包含本修复的版本后生效。

## What changes

Root cause: `DELETE /api/v1/personal-views/:id` (plugin-auth) and
`DELETE` / `PATCH /api/v1/attachments/:id` (service-storage) were
mounted only on the kernel's `http.server`. A hosted tenant kernel owns
no socket, registers no `http.server`, and runs `AuthPlugin` with
`registerRoutes: false`. The host's `createHonoApp` catch-all hands
every unclaimed `/api/v1/*` request to `HttpDispatcher.dispatch()`,
which had no domain for either prefix and answered `404
ROUTE_NOT_FOUND`. The cloud host's storage bridge covers only
`/api/v1/storage`, so it never reached them either.

The fix applies ruling A on objectstack-ai#22438 to these two members of the class,
the same shape objectstack-ai#36539 gave the comment doors:

- **Spec.** `IPersonalViewDoorsService.handlePersonalViewDoor(request):
Promise<Response>` types a new `personal-views` slot.
`IAttachmentDoorsService.handleAttachmentDoor` is implemented by the
existing `file-attachments` service beside `IFileAttachmentService`.
Both members are optional.
- **One body, two faces.** `createDoorTableMember(routes, mount)` (new
export of `@objectstack/plugin-hono-server`) runs the plugin's own
registrar on a private `HonoHttpServer` that never listens, built on
first request. So the caller resolution, every refusal and every answer
are the self-hosted mount's own bytes. The self-hosted mounts are
unchanged and no path is mounted twice.
- `AuthPlugin.init()` registers `personal-views` whatever
`registerRoutes` says; `mountPersonalViewDoor` and the member share one
`personalViewDoorDeps()`.
- `StorageServicePlugin` hands `FileAttachmentService` an
`attachmentDoors` member over `mountAttachmentRemovalDoor`.
- **Runtime.** A shared bridge (`domains/own-door-bridge.ts`) and two
domains, `/personal-views` and `/attachments`, claim exactly the door
shapes and forward the transport's request, body unread and re-addressed
to the wire path, to the member on the REQUEST kernel's slot
(`getRequestKernelService`, never the host's scoped fallback). Any other
shape under those prefixes keeps `404 ROUTE_NOT_FOUND`. No slot, or no
member: a typed `501 NOT_IMPLEMENTED` naming the package that registers
it. A member throw or a consumed body: a sanitised `500`, logged. No
auth-gate or membership exemption is added, so on the dispatcher the
doors are stricter than the self-hosted mount, never looser.
- **Ledgers.** Three `server-only` rows in `route-ledger.ts` (census 153
→ 156); a new `own-row-doors-session` row in the authz conformance
matrix; `check-route-envelope.mjs` audits the three new domain files.
- **Dependencies.** `@objectstack/plugin-auth` and
`@objectstack/service-storage` now depend on
`@objectstack/plugin-hono-server` at runtime (no manifest cycle;
`check:workspace-manifest-cycles` green).
- **Surface widening** (hence `Clause-②: yes`): two new contract
interfaces, a new typed slot name (`personal-views` is now taken, so a
composition registering its own service under that name beside
`AuthPlugin` fails to boot with a duplicate-service error), two new
exports from plugin-hono-server, and two new dispatcher domains.

No cloud code change and no cloud deploy is needed. Hosted gets the fix
when cloud's objectstack pin moves past this PR, as with objectstack-ai#36469.

## Tests

- `packages/runtime/src/domains/own-door-bridge.test.ts` (27):
`describe.each` over both families. Forwarding with the transport's own
request and body unread; exact claim and misses; the environment-scoped
spelling; 501 for an empty slot, a throwing lookup and a missing member;
per-request reads; request kernel only (the host kernel's member is
never used); member throw 500; consumed body 500; both preamble gates
(membership 403, owed-step gate) with a member control.
- `packages/plugins/plugin-hono-server/src/door-table-member.test.ts`
(4): byte parity against a `HonoHttpServer` mount; unmatched 404 without
building the table; built once; the matcher.
- `packages/plugins/plugin-auth/src/personal-view-door-member.test.ts`
(3): `AuthPlugin.init` with `registerRoutes: false` registers the slot
once; an anonymous request is byte-equal to the self-hosted mount's 401;
a non-door request is 404 `ENDPOINT_NOT_FOUND`.
-
`packages/services/service-storage/src/attachment-removal-routes.integration.test.ts`:
a new describe with no `http.server` (no routes mounted; the uploader
renames then removes, 200 each; another member 403; anonymous 401 on
both doors; a GET 404).
-
`packages/qa/http-conformance/src/hono-own-row-doors.conformance.test.ts`
(7), the wire half: `createHonoApp` over a kernel with no `http.server`,
the real `AuthPlugin` composed with `registerRoutes: false`, the real
`StorageServicePlugin`, platform objects, security and sharing, and real
better-auth sessions signed in through the same transport. No door
answers a route miss; the owner removes their own personal view (200,
row gone); another member 404 `RECORD_NOT_FOUND` and anonymous 401 (row
stays); the uploader renames then removes their own attachment (200
each, store follows); anonymous 401 on both attachment doors; the
refusals are byte-identical to the self-hosted mount over a real socket;
a kernel without service-storage answers 501 naming it. The subject
packages resolve from source (`vitest.config.ts` aliases).
- Dogfood, real composed stack, through `HttpDispatcher` alone
(`hosted-dispatcher.testkit.ts`): `personal-view-row-scope` gains a
`[hosted]` describe (owner removal 200, another user 404
`RECORD_NOT_FOUND`, anonymous 401); `member-attachment-baseline` gains a
`[hosted]` case (other member 403, anonymous 401, rename 200 trimmed,
removal 200 and the row is gone).

## Acceptance notes

- Red before the fix, each through `scripts/ablation-replace.mjs` with
the restore proved (`blob == HEAD`, `git diff HEAD` empty):
- the two domain registrations deleted from `http-dispatcher.ts`:
`own-door-bridge.test.ts` 21 of 27 red (the 6 that stay green are the
miss and gate cases, which hold without the domain);
- `ctx.registerService('personal-views', …)` deleted: the plugin-auth
member test 3 of 3 red;
- the `attachmentDoors:` dep renamed away: the storage integration file
3 red, 17 green (the new describe's door cases).
- The wire-half file, 7 tests: the two dispatcher domain registrations
deleted and runtime `dist` rebuilt: 7 of 7 red, each answering the
pre-fix `404 ROUTE_NOT_FOUND` (restored, rebuilt, green again);
`registerService('personal-views', …)` deleted: 4 red (every
personal-view case and the parity case); `attachmentDoors:` renamed
away: 4 red (every attachment case and the parity case).
- Overlap: `objectstack-ai#36311` conflicts in `auth-plugin.ts`, but `origin/main ×
objectstack-ai#36311` already has that one hunk (an import line). `HEAD × objectstack-ai#36311` has
the same single hunk, so it is not added by this branch. `objectstack-ai#35129` and
`objectstack-ai#34223` merge cleanly.

## Verification

- Typecheck green: spec, runtime, plugin-auth, service-storage,
plugin-hono-server, dogfood.
- Full suites green: http-conformance 22 files / 305 tests; runtime 641
files / 11872 tests; plugin-auth 294 / 6268; service-storage 88 / 1729;
plugin-hono-server 44 / 585.
- Dogfood: `personal-view-row-scope` + `member-attachment-baseline` 37 /
37.
- `dispatch-gates --ran`: 137 derived, 136 run green, 1 NOT MEASURED
(`check:dual-build-cjs-loads`, exit 3, needs every package's `dist/`;
left to CI). `check:undeclared-dep-imports` caught plugin-auth listing
plugin-hono-server as a dev dependency only; fixed and green.
- eslint on the 31 changed source files, with `--no-inline-config` as
`pnpm lint` runs it, green (the whole-tree `pnpm lint` is left to CI);
`check-nul-bytes` OK.

<details><summary>Gate reconciliation</summary>

```
Run reconciliation — 137 derived, 136 run, 1 NOT-MEASURED, 0 UNRUN.
  NOT-MEASURED · DERIVED (1):
    - pnpm check:dual-build-cjs-loads   [recorded exit 3 — PREREQUISITE NOT MET]
✓ dispatch-gates --ran: 137 derived famil(ies) accounted for — 136 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).
```

</details>

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

https://claude.ai/code/session_01JQwxbXs1Hrj1qNTkGdJbK1

---
_Generated by [Claude Code](https://claude.ai/code)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…s showOnCreate and drops the subforms pointer (objectstack-ai#36696)

<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ86Lu4u71hEUFsgZYL8QN9v8)_
Fixes objectstack-ai#36628
Fixes objectstack-ai#36611

Clause-②: no
Metadata-protocol: none
Skills-docs: updated here

## 维护者速读

- 用户能看到什么变化:照技能包搭应用的
AI,给对象挑图标底色时,会照平台自己的做法按业务分组上色(人员一色、审批与工作一色……),红色只留给真正的告警,没人打开的内部对象不上色;不再被要求「同一应用里颜色不能重复」。另外
AI 会知道「新建时不问某个字段」的写法,分步表单会被指到「由动作打开的具名分步表单」。
- 为什么做:平台自己的对象已按业务家族上色(你 11-23
定稿的配色表),技能还在教相反的规则;子表单那段是「内部新建/编辑表单退役」的第二阶段收尾,第一阶段已合并。
- 出错会怎样:只改技能文字,不碰数据、接口和运行时;撤回这一个合并就恢复原样。
- 要你做什么:技能包属受管文件,需要 os-zhuang 在 GitHub
上批准;另有一张大的技能改版草稿(objectstack-ai#36158)改同几份文件,两者会有文字冲突,后合的一方要合一下。

## What changes

One PR for two cards in the same files, by the seat's dispatch.

**objectstack-ai#36628, object colour (`skills/objectstack-data`).**
- `SKILL.md`, the `color` row of the object property table. Before:
"Give every object one; avoid repeats in one app". With nine palette
names any app past nine objects must repeat one, and the platform's own
objects are coloured by business family (PR objectstack-ai#36605). After: group the
app's objects into a few business families, one palette name each, as
the platform's own objects do (people `blue`, security `purple`,
approvals and work `orange`, messaging `pink`, integrations `teal`,
reference data and finance `green`, audit and settings `amber`); `red`
only for an object that is an alert; an object nobody opens gets none
(it draws the default `gray`). No card ids in the text.
- `references/examples-objects.md`, Quick-Start Template: the
`support_case` object declares `color: 'orange'` (work) beside its
`icon`.
- Evals: no case in `skills/objectstack-data/evals/` mentions `color`;
the object-authoring cases (ids 1 and the Chinese-labels case) ask for
`icon` and say nothing about colour, so they agree with the new guidance
and are unchanged.

**objectstack-ai#36611, stage 2 (stage 1 was PR objectstack-ai#36625, merged).**
1. `skills/objectstack-data/rules/relationships.md`: the pointer "The
rendering side, `subforms` overrides included: objectstack-ui →
Master-Detail Forms" drops the `subforms` clause. objectstack-ui's Form
Views now says a container's `subforms` steer nothing.
2. `skills/objectstack-data/SKILL.md`, Conditional Field Rules: a bullet
teaching `showOnCreate: false` (off every create surface; edit, the
record page and lists keep it; refused beside `required: true`). The
section's opening list of where field rules apply now reads "New and
Edit, named and public forms, inline master-detail grids, API writes"
instead of naming "default forms, Studio-authored forms".
3. `skills/objectstack-automation/SKILL.md`, after the Flow Types table:
a stepped form over one object that never branches is "an objectstack-ui
named form view (`type: 'wizard'`) a `type: 'form'` action opens",
matching `skills/README.md` since objectstack-ai#36625.
- Evals:
`skills/objectstack-automation/evals/flows-triggers-approvals.json` case
4 (a branching onboarding wizard is a `screen` flow, `must_not_contain:
"type: 'wizard'"`) and the trigger case still hold; no data eval teaches
`subforms` or `showOnCreate`. Unchanged.

- `.changeset/36628-36611-skills-object-colour-create-forms.md`:
`@objectstack/skills` patch.

### Paid for in the same files (no ceiling changes)

| File | Tokens before → after | Ceiling |
|:--|:--|:--|
| `skills/objectstack-data/SKILL.md` | 6710 → 6706 | 6710 |
| `skills/objectstack-automation/SKILL.md` | 7043 → 7045 | 7045 |
| `skills/objectstack-data/references/examples-objects.md` | 1719 → 1724
| 1728 |
| `skills/objectstack-data/rules/relationships.md` | 4188 → 4180 | 4203
|

Cuts that pay for the new text, each a restatement or a detail kept
elsewhere:
- data `SKILL.md`: `namespace`, `titleFormat`, `displayNameField` and
`enable` rows shortened (the `titleFormat` row keeps its refusal and
lint id and points to `nameField`, whose row carries the composite-title
rule; `enable` points to the next section, which lists the flags); the
`user` clause of Field Type Selection (the bullet below it says the
same; "Three to get right" becomes "Two"); the `multiple: true` note's
"≠ junction object … array of ids" (the table rows above say both);
"composite indexes" in the indexing pointer (the example above shows
one); the lifecycle class list in the Quick Reference line (in
`rules/lifecycle.md`); "`conditionalRequired` … REMOVED in protocol 17"
shortened to "the removed alias is a parse error".
- automation `SKILL.md`: "Interactive —" and "automatically" in two Flow
Types rows.

## Why

objectstack-ai#36628: the skill taught the opposite of the platform's approved family
table, and gave no reason to pick one hue over another. objectstack-ai#36611: the data
and automation skills still pointed agents at retired create/edit form
overrides and routed single-object step forms to a wizard with no door
named.

## Verification

Each taught sentence against `main` (`115d38788`):
- Palette names: `packages/spec/src/data/object-icon.ts:31`
(`OBJECT_COLORS`); default `gray` when absent: the `color` row's default
column, unchanged.
- Family colours on the platform's own objects: e.g.
`packages/platform-objects/src/identity/sys-user.object.ts:104`
(`blue`),
`packages/platform-objects/src/audit/sys-notification.object.ts:33`
(`pink`); no platform object declares `red`.
- `showOnCreate`: `packages/spec/src/data/field.zod.ts:2934` (meaning)
and `:3263` (refused beside `required: true`).
- Named wizard form an action opens; container `subforms` inert:
`skills/objectstack-ui/rules/list-views.md` § Form Views (code readings
in PR objectstack-ai#36625's Acceptance notes).

Local gates: see the Tests section below.

## Tests

No package source changed, so no package suite is owed. Prose only, no
ablation.

Local gates at `b6b84c501` (tree identical to `a2598f51`), against base
`115d38788`: the 51 commands `dispatch-gates.mjs --commands` derives,
each run with its exit code captured before any pipe. **46 exit 0**,
among them `check-skills-token-ratchet` (and `--self-test`),
`check:skill-links`, `check:skill-docs`, `check:skill-refs`,
`check:skill-served-sections`, `check:skill-identifier-liveness`,
`check:skill-compatibility`, `check:corpus-claim-drift`,
`check:nul-bytes`. **5 NOT MEASURED** (exit 3, PREREQUISITE NOT MET:
each reads built `dist/` of packages this diff does not touch, and no
workspace build was run for a prose diff; CI decides):
`check:doc-formula-expressions` (`@objectstack/lint`),
`check:dts-closure`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure`, `check:sourcemap-no-sources-content`. One
`os:check` block changed (the Quick-Start Template gains `color:
'orange'`, a member of `OBJECT_COLORS`); `check:skill-examples` is not
among the derived commands and needs client builds, so it is NOT
MEASURED locally; CI decides.

## Acceptance notes

- Overlap: `scripts/pm/overlap-check.mjs` merges cleanly with `main` and
with objectstack-ai#35129, and **conflicts with objectstack-ai#36158** (draft, router rewrite of the
same two `SKILL.md` files, last pushed 2026-11-21, waiting on a
maintainer decision). objectstack-ai#36611's triage asked to land after objectstack-ai#36158 if both
are open; this PR does not wait on it while drafting. Whichever lands
second carries the merge: the changes here are a handful of lines.
- The model-tier gate reads MANDATORY `claude-fable-5-2` for
`skills/**`. This thread ran on Opus; the seat decides whether a Fable
pass is owed before landing.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (two cards in the same files, by the seat's dispatch)
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English. (the 维护者速读 block is
the maintainer's brief, as on other fleet PRs)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

https://claude.ai/code/session_01JQwxba91GQhJ1mvAZFftiw

---
_Generated by [Claude Code](https://claude.ai/code)_

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…lation hop and for a system context too (objectstack-ai#36687)

<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ84PZdJ8CofK8zh94NDjoTSa)_

Fixes objectstack-ai#36393
Fixes objectstack-ai#35526
Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill or eval teaches a relation condition into a
disabled package's object or a system context through `callData`; the
change refuses reads, and no key, value or metadata type an author
writes moves

## 维护者速读

- 应用包停用后,通过统计或 AI 助手查数据时,隔两层、三层关联去做条件也会被拒绝,不能再用「1 还是 0」推出停用包里的字段内容。
- 按你 11-22 的裁决「系统身份也一律拒绝」,系统身份调用和普通成员一样被拒;没有停用任何包的环境不受影响。
- 没有协议服务的部署上,直接读停用包的对象现在也会被拒绝(以前会照常返回)。

## What changes

`packages/runtime/src/action-execution.ts` (`callData`) and
`packages/mcp/src/stdio-data-bridge.ts`, their pin files, two
changesets.

1. **Every hop (card item 1, S1).** `refuseUnservedRelationTargets`
walked the queried object's relation sites once. The engine lowers a
condition beneath a condition up to `RELATION_CONDITION_MAX_HOPS = 3`
relationships, so `aggregate dp_alpha where { c_ref: { b2_ref: {
secret_note: V } } }` with `dp_beta`'s package disabled still answered 1
/ 0. It now descends each site's own condition against its target's
field map, asking every target on the way, disabled package first and
then exposure, with the full position as `param` (`where.c_ref.b2_ref`).
The order and depth backstop match the protocol's twin walk
(`refuseUnservedRelationTargetsIn`). The same fix covers the exposure
question past hop 1, which had the same gap since objectstack-ai#22823.
2. **System context refused too (ruling on objectstack-ai#35526, option 0 「系统身份也一律拒绝」,
comment 7077381587).** The disabled-package question is no longer under
`exposureGated = !isSystem`. It is asked of every caller, for the
addressed object and for every relation target. The exposure question
for a system context is unchanged, and a pin holds that.
3. **No-protocol host, addressed object (card item 2, E3).** `callData`
now reads the engine registry's `isObjectPackageDisabled` once per call
(`packageDisabledPredicate`, through `@objectstack/core`'s
`registryObjectPackageDisabled`) and refuses a disabled package's
addressed object with the protocol's own `objectPackageDisabledError`
before any exposure verdict. Measured before the fix: on a host with no
protocol service, `aggregate dp_beta` and `query dp_beta` were served to
a member and to a system context. On a protocol host, `aggregate
dp_beta` was served to a system context. The same predicate decides the
relation targets, so the raw driver the MCP multi-env query fallback
threads through (no registry) no longer decides it.
4. **MCP stdio bridge.** `enforceRelationTargetExposure` descends every
hop the same way, asking `enforceApiExposure` (disabled package, then
exposure) at each target with its full position. A system context is
asked nothing, unchanged (the ruling binds `callData`); the walk leaves
that bypass to `enforceApiExposure` and adds no `isSystem` read of its
own (`check-system-context-census`). The stdio system principal and
no-protocol host are objectstack-ai#36689.
5. **Changeset correction (card item 3, S2).**
`.changeset/35526-calldata-relation-disabled-package.md` has not been
consumed by a release (it is still on `main`; the open version PR objectstack-ai#35129
has not merged). In this PR, its `Clause-②:` line reads `yes
(narrowing…)`, its TO line is narrowed to "a condition directly beneath
a lookup of the queried object", and its N5 sentence no longer glosses a
system context as a hook's `ctx.api`.
6. **Docs.** `content/docs/permissions/system-context.mdx` row 48
(`callData`, `refuseUnexposedDataAction`) gains one sentence: the system
bypass covers exposure only, and a disabled package's object is refused
to a system context too, addressed or as a relation target at any hop.

**DELIBERATE CORRECTION:**
`.changeset/35526-calldata-relation-disabled-package.md`. This PR makes
that pending release note's system-caller sentence and its one-hop TO
line incomplete, and the card asks for its `Clause-②` line to be
corrected. `check:empty-changeset` is red on it locally by design; the
seat confirms by its own record.

## Why

A disabled package's records are off the data plane: the protocol's data
route answers `404 OBJECT_PACKAGE_DISABLED` for its objects and for a
relation condition into them, at every hop and for every caller.
`callData`'s engine arms gave a second answer to the same question.

**Declaration note.** `Clause-②: yes (narrowing)`, as the seat's claim
declares (7099212652). The change narrows a published door (`callData`,
the MCP stdio bridge); it adds or removes no export. The narrowing is
BREAKING and gets a narrowing-face L2 at the contract-review tier.

Who changes: hosts that hand `callData` a system context
(`HttpDispatcher.handleMcp` / `buildMcpBridge`, `dispatchAction`). No
door in this repository does that, and `ctx.api` never passes through
`callData` (ruling analysis on objectstack-ai#35526).

## Verification

At head `9198e1cd47` (the code at `d6f70d698c` plus the stdio walk's
dropped `isSystem` return, behaviour-equivalent, and the row-48
sentence):

- Pin file
`packages/runtime/src/action-execution-calldata-relation-disabled-package-35526.test.ts`
(real `ObjectQL` + `SqlDriver` in-memory SQLite + the real protocol):
**46 passed**. With `action-execution.ts` reverted to `origin/main`
6a73185: **23 failed | 23 passed**. The red ones are the two-hop member
and system pins on both hosts, `$or` / `$not`, two-hop exposure, the
order pins, the flipped SYSTEM one-hop pins, and the addressed-object
pins (no-protocol host for both callers, the protocol host for system).
-
`packages/mcp/src/stdio-data-bridge.relation-condition-target-exposure.test.ts`:
**41 passed** at `9198e1cd47`. With `stdio-data-bridge.ts` reverted:
**10 failed | 31 passed** (two-hop exposure direct / `$or` / `$not`,
two-hop disabled package, order; for `query` and `aggregate`).
- Pins changed in place: the objectstack-ai#35526 SYSTEM pin flips from "the count is
served" to refused, per the ruling. The query-fallback "re-enabled"
control now actually disables, then re-enables (N1). Order (N3) and
`$or` / `$not` (N4) are pinned.
- `@objectstack/runtime` full local suite (at `d6f70d698c`; runtime
source unchanged since): Test Files 644 passed (644), Tests 13316 passed
| 25 skipped. `@objectstack/mcp` full suite (at `d6f70d698c`): 83 files,
1481 tests passed.
- **Dogfood battery at `9198e1cd47`**, under the verify lock (`pnpm
--workspace-concurrency=2 --filter '@objectstack/dogfood^...' build &&
pnpm --filter @objectstack/dogfood test`): `VERDICT command-exit 0`,
held the lock 36m18s on a shared box; Test Files 487 passed | 3 skipped
(490); Tests 4121 passed | 68 skipped (4189).
- `pnpm --filter @objectstack/runtime --filter @objectstack/mcp
typecheck`: exit 0. `eslint` on the changed source and test files: exit
0. `check-system-context-census` exit 0 at `9198e1cd47` (red at
`af5e5f8e10`: the walk's own `isSystem` read had no row).
- `check:adr-0087-registration` exit 0, `check:changeset-fixed` exit 0,
`check-changeset-no-major` no major. `check:empty-changeset` red on the
DELIBERATE CORRECTION above, as expected.
- `overlap-check --branch=claude/project-thread-rhdqay`: merges cleanly
against `origin/main`. Its only PR overlap is objectstack-ai#35129 (`chore: version
packages`, the Changesets bot PR, which deletes pending changesets on
every regeneration). With that PR excluded: `VERDICT clean exit 0`.
- CI at `9198e1cd47`: every run success or skipped, except Check
Changeset (red only on the declared DELIBERATE CORRECTION). Test Core
10/10, Lint & Repo Gates, TypeScript Type Check, Build Core, Build Docs,
Live E2E UI, PR-body guards, Governed Surface Queue Guard: success.
- Contract review at the contract-review tier, same head: PASS
(7100010264).
- NOT MEASURED: `dispatch-gates --commands` full derived list (left to
the seat's L1).

## Acceptance notes

- Not in scope, filed by the seat as objectstack-ai#36689: the MCP stdio bridge on a
host with no protocol service still serves a disabled package's object
(its package refusal lives only in the protocol's by-name read), and a
system context on the stdio bridge is still asked nothing; the ruling
names `callData` only.
- The walk reads `where` in object form, as before. The array
(FilterAST) form is not lowered here first, unlike the protocol's twin
walk. An aggregation's own `filter` is not walked either, because the
engine lowers relation conditions in `where` only.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (eslint on changed files).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (two cards ruled as one change)
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [ ] The *Before Submitting* list in CONTRIBUTING.md is done. (seat's
L1)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01JQwxbYSL1X4Mj36e8WtU7H

<!-- signed: repo:objectstack#1 · os-warren ·
session_01JQwxbYSL1X4Mj36e8WtU7H -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ent seed issued (objectstack-ai#36699)

<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8Nxmrq3P2eHj4WzMaPKLjA1)_

Fixes objectstack-ai#35184

Supersedes objectstack-ai#36311: this branch carries that PR's commits (head
`c1e7347cc1`, merged onto current `main`) and adds one hardening commit.
The card thread can push only its own branch, so the takeover lands
here.

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill states what a boot outside development mode
does to a seeded account's credentials. `skills/**` names the
development seed only as `os dev --seed-admin`
(`skills/objectstack-platform/references/operations.md`); checked at
`origin/main`.

## 维护者速读

- 用户能看到什么变化:不在开发模式的服务器每次启动、开始接请求之前,会结束开发种子建的管理员和演示账号在开发期拿到的会话、API key
和令牌,包括这些账号以别人身份开的会话;只针对仍是种子密码的这些账号,运维改过密码的账号和管理员自建的账号不受影响,开发模式下什么都不变。
- 为什么做:开发种子凭据加固的第三项(objectstack-ai#34717 裁决里留作跟进的那一项):离开开发模式后,开发种子签发的东西不再继续起作用。
- 出错会怎样:拿开发库直接上生产的部署,这些账号的旧会话和 key 会失效,需要运维改密后重新登录、重新发
key;结束不干净时服务器拒绝启动并说明是哪些账号。
- 要你做什么:收窄类改动,L1/L2 之后由你合并。

## What changes

**The rule (ruling item 3 on objectstack-ai#34717, the card's text): when a deployment
leaves development mode, nothing the development seed issued keeps
acting for an account that carries the development seed stamp.**
Development mode is `NODE_ENV=development` (`isDevelopmentMode`, the
predicate the objectstack-ai#34717 refusals use). No switch.

From objectstack-ai#36311 (unchanged, see that PR for the full account):

- `dev-seed-credential-retirement.ts` (new), `retireDevSeedCredentials`:
outside development mode, one indexed read for stamped accounts, the
in-force filter (`isDevSeedCredentialInForce`), then per account the
revocation `os user set-password` uses (`revokeSessionsAndApiKeys`:
sessions tombstoned, keys revoked, authorized apps, device sign-ins,
linked sign-in accounts, registered OAuth apps, SCIM credentials),
outstanding reset tokens (`endOutstandingResetTokens`), and sessions in
a host `secondaryStorage` (read back).
- Wiring: one `kernel:ready` hook in `auth-plugin.ts`, independent of
`registerRoutes`; it settles before `kernel:listening` opens the socket.
- Fail closed: anything that does not land fails the boot with one
sentence naming the accounts and the remedy.
- Docs (`content/docs/deployment/self-hosting.mdx`), changeset (`patch`,
`!`, BREAKING section, ADR-0087 `not-required`), census shard
regenerated.

New in this PR:

- **The sessions a seed account opened acting as another account are
retired too** (`retireSessionsOpenedAs`), tombstoned exactly as the
account's own (same reason, counted in `sessions`, same fail-closed
rule). A further security item is with the owner seat.
- `forced-reset-revocation.ts`: `isLiveSession` is exported for reuse
(no behaviour change).
- Docs and changeset name the new item; the self-hosting sentence about
`os user set-password` now says what that command ends (the account's
own sessions, keys and grants) instead of "the same credentials".
- Census shard regenerated on current `main` (`node
scripts/tenant-audit-census.mjs --write`).

**Read first (by risk):**
1. `packages/plugins/plugin-auth/src/dev-seed-credential-retirement.ts`:
`retireDevSeedCredentials` and `retireSessionsOpenedAs`.
2. `packages/plugins/plugin-auth/src/auth-plugin.ts`, the `kernel:ready`
hook: it runs on every boot outside development.
3.
`packages/plugins/plugin-auth/src/dev-seed-credential-retirement.test.ts`,
cases 1–3.

**Two-minute check:** `pnpm --filter @objectstack/plugin-auth exec
vitest run src/dev-seed-credential-retirement.test.ts` shows 6 cases
green.

## Why

objectstack-ai#35184 (p1): credentials the development seed issued kept acting after
the deployment left development mode.

## Verification

Branch `claude/project-thread-grxa1f`, head `fb3c2cc478`, on
`origin/main` `115d38788e`.

- **Red first.** The new assertion was added to case 1 before the fix
and run at the merged head (`035b1fdfe`): case 1 red, 5 others green.
After the fix: 6/6 green. Removing the new call is that same red.
- **Suites** (under `scripts/pm/os-verify-lock.sh`):
`dev-seed-credential-retirement`, `dev-seed-credential-production`,
`dev-seed-credential` (3 files, 26 passed) on the port before the fix;
then `dev-seed-credential-retirement`, `api-key-restore-guard`,
`forced-reset-revoke-reason-vocabulary`,
`scim-deactivation-reconcile-user`, `session-tombstone`,
`admin-impersonate-endpoint` (6 files, 128 passed) after it. `pnpm
--filter @objectstack/plugin-auth build && … typecheck`: exit 0,
`check:test-typecheck` OK.
- **Derived gates:** `node scripts/pm/dispatch-gates.mjs --commands`
derived 110, all run: 104 exit 0; `check-empty-changeset` exit 1 by
design (the DELIBERATE CORRECTION below); `check-tenant-audit-census`
and its self-test exit 1 on the first pass (shard drift from the new
write site), regenerated, both re-run exit 0; NOT MEASURED (exit 3,
prerequisite): `check-plugin-teardown-shape --self-test` (needs an
unshallow clone), `check:skill-examples`, `check:dual-build-cjs-loads`
(need packages built). CI carries those three.
- **Overlap:** see Acceptance notes.
- **Dogfood battery:** not run locally for this round; CI's Dogfood
Regression Gate reads it. objectstack-ai#36311's battery (484 files passed, 0 failed)
was on the code before the new commit.

## Acceptance notes

- **Which accounts.** The in-force reading from objectstack-ai#36311 stands: an
account whose password was set since the seed holds a credential the
seed did not issue and is untouched; retiring on the bare column would
end operator-era credentials at every restart.
- **Revoke reason.** `admin_password_reset`, as in objectstack-ai#36311; a dedicated
reason is follow-up objectstack-ai#36313.
- **`.changeset/dev-seed-credential-production-refusal.md`**
(unreleased, from objectstack-ai#34717) is corrected: see `## DELIBERATE CORRECTION`.
- **Test file weight.** The six two-boot cases read about 11.4 s of test
time locally (case 1 gained one sign-in and one request); objectstack-ai#36311 read
9.98 s. Over the 10 s file line; splitting the file would duplicate its
two-boot harness, so it is kept as one and declared here.
- **Overlap** (`overlap-check.mjs` at this head, objectstack-ai#36311 excluded):
`.changeset/dev-seed-credential-production-refusal.md` conflicts with
objectstack-ai#35129; the generated census shard conflicts with objectstack-ai#34738 (whoever lands
second regenerates it). `auth-plugin.ts` with objectstack-ai#36690 merges cleanly.
- The production-readiness page is not edited; the card names the
self-hosting checklist.

## DELIBERATE CORRECTION

This PR rewrites two lines in a pending release note it did not add:
`.changeset/dev-seed-credential-production-refusal.md`, in the note's
last paragraph. That paragraph's label and its last sentence named the
boot-time retirement as a follow-up. This PR ships it, so left unchanged
the note would publish two false lines. `check-empty-changeset` stays
red by design; the dispatching seat confirms by its own record.

1. The paragraph's bold label
   - Before: "**Not ended at boot:**"
   - After: "**Ended by `os user set-password`, and at boot:**"
2. The paragraph's last sentence
   - Before: "Ending them at boot is follow-up objectstack-ai#35184."
- After: "In the same release, a boot outside development mode also
retires them: see the note "a boot outside development mode retires what
the development seed issued" (objectstack-ai#36699)."

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No spec change.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` is read from CI's Lint job, not
run locally.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01JQwxbX8ecPYZVemPRBFSrY

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…t it does not run (objectstack-ai#36708)

<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ83ouv8C9ThpkfsQ5SAfyzjU)_

Fixes objectstack-ai#36647

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:应用用编译产物上线时,如果它带的代码插件没有跑起来,启动日志会逐个点名这些插件并说清怎么补上;以前一声不吭。
- 为什么做:BrightRule 评估里知识库、向量检索和条款索引三个插件全部没装上,后面检索为空、钩子找不到服务,没有任何提示,排查很难。
- 出错会怎样:只多一条警告,不加载、不拒绝、不改变任何插件,启动照常;改动可以直接撤回。
- 要你做什么:无(走的是已有裁决「产物只带元数据,插件由宿主装配」这条路,没有替你选「把插件塞进产物」)。

## What changes

- **`packages/runtime/src/artifact-declared-plugins.ts`** (new):
`warnUnmountedDeclaredPlugins` judges each entry of the app's `plugins`
by name against the kernel's own plugin table and warns **once**, naming
every listed plugin the kernel does not run, with the remedy: boot from
`objectstack.config.ts`, or from a host config that loads the artifact
and lists the plugins in its own `plugins`, or package them (`os plugin
build` → `os plugin install`). Structured fields `{ appId, plugins }`. A
host that assembles the app's plugins itself hears nothing about the
ones it runs. A bundle entry (no `init`) also counts as running under
the `plugin.app.ID` name a host wraps it into. A package-specifier
string is never judged: the name its plugin registers under is not in
the specifier, so nothing is said that the table could contradict.
- **`AppPlugin.start()`**: makes that call when the plugin was composed
with `securityMetadataRegistrar: 'artifact-door'`, the existing
declaration that its bundle IS the artifact the artifact door reads.
Only `createStandaloneStack` (the door every artifact boot goes through:
`createDefaultHostConfig` for `OS_ARTIFACT_URL` and for cloud's composed
boot, `os start` on a built app) and the `os dev` host-config artifact
door make it. A config boot (the CLI's `new AppPlugin(config)` wrap,
default registrar) is never judged, because its host materializes the
stack's `plugins` under names a descriptor cannot predict. Read in
`start()`: the kernel refuses `use()` once bootstrap has begun, so the
table is final. No option, export or artifact field is added.
- **`content/docs/deployment/self-hosting.mdx`**: one row in the
artifact-pinned boot table saying an artifact boot runs without the
app's code plugins, that the boot names them, and what to do.
- Changeset: `@objectstack/runtime` patch.

Level is `warn`: a capability is absent and its next caller finds out,
which AGENTS.md "Degradation log levels" grades functional, not
durability.

## Why: the route, and why it is not a fork

The card offers "carry them" or "refuse them, loudly" and leaves the
pick to the maintainer. Two existing rulings already make it:

- **objectstack-ai#15219, maintainer ruling A (2026-09-04, 「同意」)**: `plugins` /
`devPlugins` are artifact **envelope** keys, "runtime ASSEMBLY
instructions, not metadata … An artifact carries metadata; a host
assembles plugins" (`packages/spec/src/stack.zod.ts`, the envelope-key
docblock).
- **ADR-0025 (Accepted)** §3.10: an L2 code plugin (real npm deps + host
APIs) ships as a signed `.osplugin` with permission consent; the
environment artifact is the L0/L1 declarative channel.
`cwdConfigJoinsBoot` (`packages/cli/src/utils/artifact-precedence.ts`)
already says it: a host config's "own compiled output cannot carry that
code".

"Carry them" would put app code and its dependencies into the
environment artifact, against both. So this PR takes the other half of
the card's own Expected: the drop stays, the silence goes. Making `os
build` fail on a stack with `plugins` was not done: the same build feeds
config boots that do mount them (`os start` / `os dev` over the config's
own output), so a refusal there would break working apps; that would be
a narrowing and is not this card's call.

## Tests

`packages/cli/test/build-artifact-code-plugins-boot.test.ts` (new, 2
tests): a real `os build` (the `Compile` command in process) of a config
listing two live plugin instances, then a real boot of the artifact it
wrote through `createStandaloneStack` (reached through
`@objectstack/runtime`'s `exports`, so `dist/`).

- PREMISE: `objectstack.json` holds both plugins as descriptors with no
`init`;
- the boot runs neither (`kernel.hasPlugin` false for both) and warns
exactly once with `{ appId, plugins: [vector, indexer] }`.

`packages/runtime/src/artifact-declared-plugins.test.ts` (new, 9 tests):
real kernel boots of `createStandaloneStack` over an artifact file on
disk carrying two plugin descriptors exactly as `os build` writes them.

- neither mounted → exactly one warning, `{ appId, plugins: [vector,
indexer] }`, both names and the remedy in the line (CONTROL:
`kernel.hasPlugin` is false for both);
- CONTROL: host mounts one → the warning names only the other;
- CONTROL: host mounts both → silent;
- CONTROL: artifact lists no plugins → silent;
- CONTROL: config door (`new AppPlugin(config)`, default registrar) with
an unmounted descriptor → silent;
- four unit cases of `findUnmountedDeclaredPlugins` (order and dedupe,
wrapped bundle alias, live instance, strings / unnamed / non-array never
named).

**Ablation**: with the door's call switched off (the pre-fix behaviour),
the runtime file goes red (2 failed | 7 passed) and, with the runtime
rebuilt, the cli pin goes red on the boot test (1 failed | 1 passed, the
premise test stays green). Restored and rebuilt: 9/9 and 2/2.

## Acceptance notes

- `objectstack-ai/cloud`
`apps/objectos-ee/deploy/artifact-pinned-boot.md`, "What this mode does
and does not mount", says "The app's own plugins, flows and triggers
come from the artifact". For plugins that has not been true on this
tree; the doc fix is the cloud repo's (carrier: cloud).
- Not touched: the build summary's `Runtime: N plugins` count. It counts
what the stack lists, which is true; a build-time note that the artifact
does not carry them would print on every build of every app with
plugins, including the ones served from their config. Left as a possible
follow-up for the maintainer.

## Verification

At head `a5af61eea5` (heavy runs under `scripts/pm/os-verify-lock.sh`):

- `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2
src/artifact-declared-plugins.test.ts` → 9/9 passed.
- `pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2
test/build-artifact-code-plugins-boot.test.ts` → 2/2 passed (runtime
rebuilt first).
- Neighbours: runtime `src/app-plugin*.test.ts
src/standalone-stack*.test.ts src/default-host*.test.ts` → 41 files, 564
tests passed.
- `pnpm --filter @objectstack/runtime typecheck`, `pnpm --filter
@objectstack/cli typecheck` → exit 0; eslint `--no-inline-config` on
every touched source → exit 0; cli `test/vitest-tiers-partition.test.ts`
→ 22/22.
- `node scripts/pm/overlap-check.mjs` → clean (shares `self-hosting.mdx`
with objectstack-ai#36311 and objectstack-ai#35129, both merge cleanly).
- Derived gate families (`node scripts/pm/dispatch-gates.mjs
--commands`, 100 commands) at `3676b4f987`: 97 exit 0; `pnpm
check:test-source-alias` exit 1 (the new cli pin reached two lazy loads
inside a clocked window), fixed at `a5af61eea5` by two module-top
side-effect imports and re-run there: exit 0; `pnpm --filter
@objectstack/spec run check:skill-examples` and `pnpm
check:dual-build-cjs-loads` exit 3, PREREQUISITE NOT MET (they read
built output of packages this change does not build): NOT MEASURED
locally, CI runs them. CI at `3676b4f987` was red on the same
test-source-alias gate only.

## Two-minute check

`OS_ARTIFACT_URL=file://$PWD/dist/objectstack.json os start` on an app
whose config lists `plugins: [new SomePlugin()]`: the boot log carries
one `[AppPlugin] app '…' lists 1 plugin(s) that are not running on this
kernel: '…'` line. `os start` from the same app's config prints no such
line.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP

<!-- signed: repo:objectstack#1 · os-warren ·
session_01JQwxba17kw1B3myaWtd4wP -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…te the admission order the audience gate reads (objectstack-ai#36724)

Fixes objectstack-ai#36355
repo:objectstack#7 · os-alice · session_011y7As6FyXmJyGyHNKXUkV7
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:自托管运维者在启动日志里那条「无人能登录」报错,以及自托管部署文档,对邀请恢复路径的描述更准确;行为不变。
- 为什么做:上一轮受众策略调整后,文案仍说「邀请先于策略判断」,与代码实际顺序不符,属于其后续文字修正。
- 出错会怎样:只是文字,最坏是说法仍不够精确;可直接撤回,不影响任何准入结果。
- 要你做什么:无

## What changes

Prose only, no logic, no condition, no test change.

- `packages/plugins/plugin-auth/src/boot-sign-in-reachability.ts` (N1):
the module docblock no longer says `decideAudienceAdmission`
short-circuits on `hasPendingInvitation` before the posture switch. It
now states the order the function has at main: the posture's own rule is
read first (`isAdmittedByPostureRule`: `open`, and an on-allowlist
`email_domain` address), then the invitation branch (which admits under
`invite_only` and for an off-allowlist address). The
`no_sign_in_account_at_boot` message gets the same correction: the
verdict-level claim "that ONE creation is admitted under EVERY audience
posture" is kept (its pin stays green), and the mechanism now says which
branch admits it under which posture. The line-62 rider rule is
untouched: the no-mail-transport rider stays scoped to `invite_only`,
and nothing states the verification forcing for every non-`invite_only`
posture.
- `content/docs/deployment/self-hosting.mdx` (N3): "Under `open` every
address is admitted by the posture, invitation or not" gains the
half-clause the objectstack-ai#36312 changeset states: except a social-provider
sign-in whose address the provider did not verify while email
verification is in force, refused `403 SELF_REGISTRATION_CLOSED`
(`admissionRestsOnAddress` reads `open` as resting on the address
exactly while `resolveEmailVerificationRequirement('open', …)` is true).
- Same page, the recovery paragraph's "The invitation carve-out admits
that one creation under every posture" carried the same imprecision as
N1; the module docblock says that page and the message "must keep
agreeing", so it is reworded the same way in this PR (same file, inside
the claimed surface).
- `.changeset/36355-auth-boot-reachability-admission-order.md`: `patch`
for `@objectstack/plugin-auth`. The message string ships in `dist`
(`files: ["dist", "README.md", "CHANGELOG.md"]`).

## Tests

No test changes. No test pins the reworded sentence verbatim: the "under
EVERY audience posture" text appears only in a `describe`/`it` title,
and the pins under it assert the admission verdict for every posture,
which this PR does not move. Every `toContain` pin on the message still
holds.

Read first: `boot-sign-in-reachability.ts` message hunk (around the
"That ONE creation" line), the risk being a `toContain` pin that spans a
reworded line; then the docblock bullet; then the doc paragraph.

## Acceptance notes

- Verdict-level claims are unchanged in both files; only the mechanism
sentences move.
- `check:skill-examples`, `check:dual-build-cjs-loads` exited 3 locally
(PREREQUISITE NOT MET: they read built output of packages outside this
diff's closure) and `check-plugin-teardown-shape --self-test` exited 3
on a shallow checkout. NOT MEASURED locally; CI runs them on a full
build.

## Verification

Two-minute check: `pnpm --filter @objectstack/plugin-auth exec vitest
run src/boot-sign-in-reachability.test.ts` — expect 51 passed.

<details><summary>Local readings at d1105b6</summary>

- `pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2
src/boot-sign-in-reachability.test.ts`: Test Files 1 passed (1), Tests
51 passed (51).
- Under the verify lock, `pnpm --filter @objectstack/plugin-auth build
&& … typecheck && … test`: VERDICT command-exit 0; Test Files 293 passed
(293), Tests 6265 passed, 10 skipped (6275).
- `dispatch-gates --commands` derived 91 families; all run, 88 exit 0, 3
exit 3 (NOT MEASURED, above); `--ran` reconciliation: 91 accounted, 88
run, 3 NOT-MEASURED.
- `check-nul-bytes`: OK. `overlap-check`: VERDICT clean exit 0 (main,
objectstack-ai#36311, objectstack-ai#35129 merge cleanly).

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…old before a CJK letter (objectstack-ai#36968)

<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBDHJBvzScLgkhKgms97sNuU)_

repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v

Fixes objectstack-ai#36946

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:控制台帮助手册里,中文粗体以全角标点()。:结尾、后面紧跟中文字时,不再显示成带星号的原文,而是正常加粗;英文手册与聊天不变。
- 为什么做:聊天里同样的问题上周已修好,手册阅读器走的是另一条渲染链没跟上;这次让两处用同一条中日韩强调规则,HotCRM 中文手册里 17
处受影响的句子随之恢复。
- 出错会怎样:只影响手册正文的粗体与斜体识别,安全过滤照旧;若有误判,读者看到的是粗体范围不对,可直接撤回本改动。
- 要你做什么:无。

## What changes

- **Measured first: the manual reader renders through
`@object-ui/plugin-markdown`.** The docs page
(`ui/apps/console/src/pages/DocPage.tsx`) draws the article body with
`MarkdownRenderer` from `@object-ui/plugin-markdown`, which lazy-loads
`MarkdownImpl`. Its remark chain was `[remarkGfm, remarkAlert]`, so the
card's premise holds.
- `MarkdownImpl.tsx` now runs `remark-cjk-friendly/parseOnly` first:
`[remarkCjkFriendly, remarkGfm, remarkAlert]`. This is the rule the chat
surface already runs. It goes first, as in chat's `remarkPluginsBefore`
slot, so it owns the emphasis (attention) tokenizer. `parseOnly` because
this renderer never serializes markdown, the reason chat's docblock
gives.
- `@object-ui/plugin-markdown` adds the dependency `remark-cjk-friendly`
at `^2.3.4`, the same range plugin-chatbot pins. The lockfile gains one
importer entry and no new package: the version resolves to the snapshot
plugin-chatbot already uses.
- **One rule, two import sites, chosen on purpose.** plugin-chatbot does
not depend on plugin-markdown, and plugin-markdown does not depend on
plugin-chatbot (both depend only on `components`/`core`/`types`, plus
`i18n`/`react` for chatbot). One shared exported helper would mean a new
cross-package dependency: chatbot pulling in mermaid and the rehype
chain, or markdown pulling in streamdown. The config shapes also differ
(a streamdown `PluginConfig` against react-markdown `remarkPlugins`). So
each package imports the plugin once, and each site's comment names the
other. `chatMarkdownPlugins.ts` changes a comment only.
- **The sanitize schema is not widened.** The plugin swaps the micromark
attention construct and nothing else, so it can only produce mdast
`strong`/`emphasis` nodes. Those become the `strong`/`em` elements the
default schema already allows, and `rehypeSanitize` still runs last in
the rehype chain. A pin shows the rendered tag set for a CJK bold line
is exactly `div`, `p`, `strong`. A second pin shows raw HTML with an
event handler, and a `javascript:` link, stay stripped inside a CJK bold
run.
- One changeset (`.changeset/36946-manual-reader-cjk-bold.md`), patch,
lists both published packages the diff touches:
`@object-ui/plugin-markdown` (the fix) and `@object-ui/plugin-chatbot`
(comment only).

**Read first, by risk:**

1. `ui/packages/plugin-markdown/src/MarkdownImpl.tsx`: the
`remarkPlugins` line and its comment block. This is the only behaviour
change.
2. `ui/packages/plugin-markdown/src/markdown-render.test.tsx`: the new
`bold next to CJK full-width punctuation` describe.
3. `pnpm-lock.yaml`: add-only, one importer entry.

**Two-minute verification:** `pnpm --dir ui exec vitest run
packages/plugin-markdown/src/markdown-render.test.tsx`. Expect 24
passed. With the plugin removed from `remarkPlugins`, 7 of them go red,
as the ablation below shows.

## Tests

Tests: `@object-ui/plugin-markdown` `test` (6 files, 63 tests) and
`type-check` (`tsc --noEmit && tsc -p tsconfig.test.json`), plus `pnpm
--dir ui exec vitest run scripts/`, all run on the final head
`f0a46f212cf`.

New pins, as a top-level describe in the package's existing render
harness:

- `**关闭日期**和**解决耗时(小时)**会被清空` renders both runs as strong (the card's
main repro, from `crm_service_cases.zh.md`).
- `- **每个项目一张报销单。**每个项目的费用` renders strong (full-width full stop).
- `**它跳过和拒绝什么:**已经在活动中的人` renders strong (full-width colon).
- `**投资回报率(%)**是(收入 − 成本)` renders strong.
- Sanitizer: the rendered tag set is exactly `div`/`p`/`strong`. An
event-handler attribute and a `javascript:` link stay stripped inside a
CJK bold run.
- English controls, unchanged: `a **bold** word` and `foo**bar**baz` are
bold. A closer after whitespace, a code span and backslash escapes stay
literal with no `strong`.
- Composition: a CJK bold run inside a `> [!NOTE]` alert keeps the
`markdown-alert-note` callout, and one inside a GFM table cell keeps the
`table`. Both render strong.

<details><summary>Red on the base, green with the fix</summary>

Before the fix, on `62692b7f8b3` with only the test file added:

```
     × a closer after a full-width parenthesis, before a CJK letter renders strong
     × a closer after a full-width full stop, before a CJK letter renders strong
     × a closer after a full-width colon, before a CJK letter renders strong
     × a closer after a full-width parenthesis holding a percent sign renders strong
     × adds no element the sanitizer did not already allow
     × keeps raw HTML and javascript: links stripped inside a CJK bold run
     × still renders a CJK bold run inside an alert and a GFM table
      Tests  7 failed | 17 passed (24)
```

The fix, on `f0a46f212cf`:

```
> vitest run --root ../.. packages/plugin-markdown/
 Test Files  6 passed (6)
      Tests  63 passed (63)
> tsc --noEmit && tsc -p tsconfig.test.json
os-verify-lock: VERDICT command-exit 0
```

</details>

<details><summary>Ablation (scripts/ablation-replace.mjs, then
restored)</summary>

The test imports `./MarkdownImpl` from source, so there is no dist hop
to rebuild.

```
ablation-replace: anchor   "const remarkPlugins = [remarkCjkFriendly, remarkGfm, remarkAlert]"  x1 (before)
ablation-replace: ok mutation landed: anchor 1 -> 0, blob 2e6b55a -> 860686304aa7
      Tests  7 failed | 17 passed (24)
ablation-replace: command exited 1
ablation-replace:   blob after restore  2e6b55a
ablation-replace:   blob at HEAD        2e6b55a
ablation-replace: ok restored: blob == HEAD (2e6b55a) and `git diff HEAD` is empty
```

The same 7 go red, and the 17 controls stay green.

</details>

## Acceptance notes

- **The MCP `read_package_doc` / `search_package_docs` (card's last
line) do not render markdown.**
`packages/runtime/src/domains/mcp-package-docs.ts` returns the doc's
`content` verbatim (served locale or translation) and excerpts the raw
source for search hits. No emphasis parse runs there, so the CJK
flanking rule does not apply. The reading client parses the markdown
itself. Not changed.
- GFM strikethrough (`~~`) beside full-width punctuation is outside
`remark-cjk-friendly` by its own README, which points to a sibling
`remark-cjk-friendly-gfm-strikethrough` package. Chat has the same
scope. Not measured on any shipped manual: no reproduction, so no card.
Follow-up: none.
- `@object-ui/plugin-markdown` builds with every bare import external,
so `dist/index.js` imports `remark-cjk-friendly/parseOnly` and resolves
it through the new dependency. The console already bundles the same
version for chat.
- Local verification is scoped to the derived gate list (below). The
branch is not merged with the newer `origin/main`. `overlap-check`
reports clean merges with `origin/main` and with the three open PRs that
share a file (objectstack-ai#36845, objectstack-ai#35129, objectstack-ai#34223).

## Verification

<details><summary>Derived gate families (dispatch-gates, 60 derived: 59
run, 1 NOT MEASURED, 0 UNRUN)</summary>

`node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--ran ran.list` gives `✓ dispatch-gates --ran: 60 derived famil(ies)
accounted for — 59 run, 1 NOT-MEASURED`. The derivation names the tree
`objectstack-ai/objectstack` at `f0a46f212cf`.

- 58 families exit 0, `pnpm --dir ui exec vitest run scripts/` among
them (`Test Files 172 passed | 2 skipped`, `Tests 5126 passed | 2
skipped`). Exit codes were captured before any pipe.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: its self-test
passes (94 cases), but the scan answers `PREREQUISITE NOT MET` (exit 3).
It reads every `@objectstack/*` package's `dist`, and this worktree
built only the plugin-markdown closure. CI `Lint & Repo Gates` runs it.
- `node scripts/pm/overlap-check.mjs` before the push: `VERDICT clean
exit 0`.

</details>

`@object-ui/plugin-chatbot` is not tested locally: its diff is a comment
only. CI `Test UI` and `Type Check UI` run it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzhoBbwh8URjwQHde8v -->

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…tion keys (objectstack-ai#37072)

repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr

Fixes objectstack-ai#36401
Fixes objectstack-ai#36575
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:用户无感;读「多语言」和「数据建模」技能的 AI
助手现在知道,流程里每一步的名称、以及记录页上自定义的关联列表标签页标题,各自该写在哪个翻译位置。
-
为什么做:这两个翻译位置已经随平台发布,技能文字却没跟上,是「流程步骤名可翻译」和「关联列表标题可翻译」两项改动各自欠下的技能说明,这里一次补齐。
- 出错会怎样:只是技能里的几句说明和一条测评用例,不影响任何运行行为;写错的话 AI 助手会把翻译写到不生效的位置,可以直接撤回这一个合并。
- 要你做什么:批准合并。只改技能文字和一道评测题;因为一个 PR
同时关两张卡,工具无法判断走哪张卡的低风险通道,所以按需要人工批准处理。契约审核 PASS:记录 7141681211,Head-sha
`7523971c565c850e5183385030f0007e4ff08fd0`。

## What changes

One commit per card, then one merge of `main` and one fix commit after
the contract review.

**`76538fe36f`, the flow step-name key (objectstack-ai#36401, the follow-up owed by
the flows `nodes` group).** `skills/objectstack-i18n/SKILL.md`, the
paragraph on keys that sit deeper than their group's `label`, now names
a fourth key:

> any other step's name at `flows.{flow}.nodes.{node_id}.label` (a
screen is named by its heading, `flows.{flow}.screens.{node_id}.title`,
and takes a `nodes` key only beside a `title` of its own; `os i18n
check` asks for a flow's top-level steps, and for one of
`FLOW_TECHNICAL_NODE_TYPES` — `script`, `http`, `connector_action`,
`assignment`, `boundary_event`, the four `*_record` types — only where a
decision's branch leads to it)

"Three keys" and "all three keys included" become four. This is what the
readers do: the walk in `packages/lint/src/i18n-walk.ts` asks
`nodes.NODE_ID.label` for each top-level node, skips an `approval`
(keyed `approvals.NODE_ID.label`) and a screen whose label
`screens.NODE_ID.title` already covers, skips `isFlowTechnicalNodeType`
nodes, and adds back a technical step a drawn decision's branch names
(`decisionBranchTechnicalTargets`); `os i18n extract` reads the same
walk. The nine types are the literal list of `FLOW_TECHNICAL_NODE_TYPES`
in `packages/spec/src/automation/flow-altitude.ts`, whose source file
does not ship in the package, so the skill lists them.

**`cd690662c7`, the related-list title key (objectstack-ai#36575, the follow-up owed
by the related-list title translation).**

- `skills/objectstack-i18n/SKILL.md`, the object translation group
table, gains the `_relatedLists.{list}` row beside `_tabs`: the `label`
of an object-form `relatedLists` entry on the parent object, by the
entry's literal `list` (`event.related_to` is one key); an entry with no
`label` has no key and keeps the child field's `relatedListTitle`, else
the child's plural label; "Spelled `relatedLists`, the group is refused,
naming this one" (the alias table of `ObjectTranslationDataSchema` maps
the unprefixed spelling to `_relatedLists` as a refusal, never an
accepted second spelling).
- `skills/objectstack-data/rules/relationships.md`, the `relatedLists`
entry: "its `label` translates at
`objects.{parent}._relatedLists.{list}.label` (none: nothing to
translate)".
- `skills/objectstack-i18n/evals/bundles-locales-coverage.json`: one
case (id 16) covering both keys.

Precedence is stated as the contract has it
(`RelatedListEntryObjectSchema.label` in
`packages/spec/src/data/object.zod.ts`: the entry `label`, then the
child FK's `relatedListTitle`, then the child's plural label).

**`40f4e27ee0`, merge of `origin/main` `159113f4fe`** (plain merge, no
conflict; brings objectstack-ai#37044's edit to the same file).

**`7523971c56`, the contract review's S1 and N1** (record 7141134189),
`relationships.md` only:
- S1: the `'primary'` bullet ends "its tab stays unless `relatedLists`
omits it" again (the first round had cut the qualifier, leaving a
sentence that was false for a declared list that omits the child).
- N1: "override the derived title / columns (columns: the child's
`highlightFields`); an entry's `label` / `columns` win."

**Paid in the same files; no ceiling of the skills token ratchet
moves.** Restatement cut from `skills/objectstack-i18n/SKILL.md`: three
sentences repeating the heading above them; the "Use both gates"
paragraph keeps its one new fact; the `relatedListTitle` cell says
"likewise"; "Requires `--out`" loses its restating clause; the
per-namespace row loses "assembled by your own imports" (said above the
table for every layout); "Both shipped adapters" loses the parenthetical
the Service Contract section spells in full; the `translation` item
section loses its heading restated as a sentence; the Register step
folds a repeat of the authoring section.

Cut from `skills/objectstack-data/rules/relationships.md`, inside the
related-list section: "absent, nothing changes" (the section opens by
saying every child relationship shows by default, and objectstack-ui
Record Page says it too); the section's opening sentence loses "You
usually don't declare the related list on the parent's record detail
page" (it restated "by default"); "a self-referential FK (a hierarchy)"
loses the parenthetical. The "Catalog auto-fill" bullet and the Delete
Behaviors section are untouched.

Published-skill size against `main` `159113f4fe` (before) and
`7523971c56` (after):

| | lines | bytes | tokens (ceiling) |
|:--|:--|:--|:--|
| `skills/objectstack-i18n/SKILL.md` | 520 / 515 | 25215 / 25193 | 6299
/ 6294 (6333) |
| `skills/objectstack-data/rules/relationships.md` | 401 / 402 | 16805 /
16800 | 4202 / 4200 (4203) |
| `skills/objectstack-i18n/evals/bundles-locales-coverage.json` | 155 /
165 | 14511 / 15724 | 3628 / 3931 (eval fixture, not ratcheted) |

The two authored files are 27 bytes smaller together; the eval case is
the tree's only growth.

## Tests

Text only: no package source, test or behaviour changes, so there is no
ablation. The pins the text was written from were read, not edited:
`packages/cli/test/i18n-flow-node-coverage.test.ts` and
`packages/lint/src/i18n-related-lists-label-36528.test.ts`.

## Acceptance notes

- The body opens with the seat signature line; the closing lines follow
it.
- `check:dual-build-cjs-loads` and `check:lean-entry-closure` were NOT
MEASURED locally (exit 3, prerequisite: a whole-workspace build); the
diff touches no package and CI runs both.
- The flows `nodes` key is accepted by `os validate` at any depth and
for a titled screen; the skill teaches what `os i18n check` asks for and
the one screen rule an author can get wrong, not the full acceptance
set.
- Contract review nit N2 (the nine-type list is a hand copy of
`FLOW_TECHNICAL_NODE_TYPES` with no gate tying them) is accepted as is.

## Verification

Read first, by risk: the "Four keys sit deeper" paragraph and the
`_relatedLists.{list}` row of `skills/objectstack-i18n/SKILL.md`; the
three related-list bullets of
`skills/objectstack-data/rules/relationships.md`.

Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints
`60 authored bundle file(s) within their ceilings`, with
`skills/objectstack-data/rules/relationships.md is 4200 tokens (ceiling
4203; headroom 3)`. `overlap-check` at `7523971c56`: `VERDICT clean exit
0` against `origin/main`, objectstack-ai#36158 and objectstack-ai#35129.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr)_

<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYpEsWWE9Y5YtSsDgqZ -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…p shell from 768 px up (objectstack-ai#37241)

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Fixes objectstack-ai#37197
Part of objectstack-ai#37150 — this PR carries its last open item (item 2, the
standalone `/docs` portal's frame, ruled B in objectstack-ai#37150 comment
7151721568); items 1, 3 and 4 landed in objectstack-ai#37193.

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
电脑上打开独立文档门户(文档首页、书、文章)时,顶栏没有了,左侧是和应用页面同样的侧栏:顶部是中性的「文档」入口(点开是你的应用列表和「添加应用」),正文是按应用分组的全部文档目录,「全部文档」排第一行;应用内文档的侧栏也把「全部文档」挪到了「返回应用」下面、目录之上的第一行;手机不变。
- 属于「去掉顶栏和平台首页那一层」专题,是「文档页进应用外壳」那张卡的最后一项:两个文档入口从此是同一种外观,按你批准的设计图做的。
- 出错时电脑上的文档门户会少了目录或入口,打开门户不会改动「上次使用的应用」;改动只在前端,直接撤回这个改动即可恢复原样。
- 无。

## What changes

From 768 px up, `/docs…` now renders in an app-less variant of the app
shell, as designed in stage 1 and approved on objectstack-ai#37197 (comment
7153085446, the maintainer: 「5 处都按建议,批准设计」).

- **New `DocsPortalShell`** (`ui/packages/app-shell/src/console/docs/`,
exported from `@object-ui/app-shell`): on a phone it is `HomeLayout
variant="docs"`, unchanged; from 768 px up it mounts the real `AppShell`
with `showHeader={false}`, `UnifiedSidebar` in a new `docsPortal` mode,
the docs-navigation slot from objectstack-ai#37193, the page header's group and expand
button (`ShellPageActionsScope sidebarExpand appless`), Home's AI drawer
and Home's command palette (`HomeCommandPalette`, now exported from
`HomeLayout`). Like `ConsoleLayout`, it draws a non-shrinking box at the
top of the content holding `ChromeBannerHost` and `ConnectionBanner`, so
the standing banners (impersonation, read rate, storage) and a
lost-connection notice sit beside the fixed sidebar instead of over its
head (seat L1 S2). The connection state comes from the data adapter, as
`AppContent` reads it. It sets the navigation context to `home`, as
Home's frame does, and never sets the current app, remembers a last app
or applies an app's branding.
- **`UnifiedSidebar` `docsPortal`** (+ `docsPortalSearch`): the shell
head and foot as in an app, a neutral 「Documentation」 head
(`SidebarDocsPortalMenu`) instead of the app's name menu, and the
docs-navigation target as the body. The search field is drawn only when
a palette is mounted (Home's palette needs a host app).
- **`SidebarDocsPortalMenu`** (in `SidebarAppMenu.tsx`): the app menu's
list, extracted into `AppMenuList` and shared by both menus, under 「Your
apps」, with no row checked and no app-scoped row (「Design layout」, 「Edit
app」), plus 「Add app」 for the viewers who may build. Choosing an app
opens `/apps/APP`.
- **`ShellPageActionsScope appless`**: the page header's group without
an app: the assistant, and `HelpMenu inApp={false}` with no app package.
Without it the group resolves the app from the navigation context or the
URL's second segment, which on the portal would be the last app or a
book slug.
- **`PortalDocsNav`** (console `DocsNav.tsx`): every book the portal's
index lists, under its app's heading, in the index's order
(`groupBooksByApp`, the index's own grouping). Each book is named by its
index card's label, so an implicit platform book reads as its app does
(「系统设置」), not as its package id's last segment (「Setup」). `DocShell` and
`DocPage` hand it to the sidebar on `/docs…`.
- **「All documentation」 the first docs row in both docs sidebars** (seat
ruling on objectstack-ai#37241: the back link is shell navigation, not a docs row):
whenever the column is in the shell sidebar, `DocsNav` draws it as the
first docs entry, marked current on the portal index. In an app's docs
reader and in `AppDocsNav` it sits directly under 「← Back to APP」 and
above the filter and the books; on the portal, which has no back link,
it is the column's first row. The phone guard is the slot itself: a
phone mounts no docs sidebar, so the column the page draws keeps the
link at its foot, unchanged.
- **DELIBERATE CORRECTION** of objectstack-ai#37193's pending changeset
`.changeset/37150-docs-pages-in-app-shell.md` (seat ruling on objectstack-ai#37241).
One sentence. It was "The `/docs` portal is not changed by this
release." and now reads "The `/docs` portal draws in the same frame from
768 px up too, in a variant that belongs to no app (its own entry
describes it)." `check-empty-changeset` is red on this by design; the
dispatching seat's record confirms it.
- `content/docs/frontend/app-shell.mdx`: the stale line "the app bar …
on an app's docs pages, which mount no sidebar" is corrected. An app's
docs pages draw the shell from 768 px up, and the portal draws the same
frame with a neutral head.
- `App.tsx`: `DocsPortalRoute` mounts `DocsPortalShell` in place of
`DefaultHomeLayout variant="docs"`. No route, redirect or URL changes.

Files to read first, by risk:
1. `ui/packages/app-shell/src/console/docs/DocsPortalShell.tsx`: the
variant switch, and what it does not write.
2. `ui/packages/app-shell/src/layout/UnifiedSidebar.tsx`: the
`docsPortal` hunks (`shellChrome`, the head, the body condition,
`hasCommandPalette`).
3. `ui/apps/console/src/pages/DocsNav.tsx`: `inSidebar` (the first-row
move and its phone guard), and `PortalDocsNav`'s labels.

## Tests

- New `DocsPortalShell-37197.test.tsx`: real `DocsPortalShell`,
`AppShell`, `ShellPageActionsScope`, docs slot and `NavigationProvider`.
- `/docs`, `/docs/crm` and `/docs/crm/crm_intro` at 768 and 1440 px: no
`header` element, the sidebar in `docsPortal` mode with no
`activeAppName`, the page's tree drawn in the sidebar. PHONE CONTROL for
each path at 390 px: Home's docs frame, no sidebar.
- No app guessed: opened cold (1440 and 390), the context is `home`, no
current app, and no last-app key is in storage; that storage check
carries the pin. The `rememberApp` spy is only a tripwire for a future
frame that would remember an app. After an app was open, on a
package-named path, the head names no app, the help menu gets
`inApp=false` and no package, and the current app stays as it was.
- The app-less group, and the collapsed expand button in the docs header
with no corner fallback; phone control.
- Design point 5, the default accent (seat L1 S1): after an app whose
`branding.primaryColor` was open, with `--primary`/`--accent` left on
the root, the portal's root carries neither. Phone control.
- The banners (seat L1 S2): at 1440 px a standing banner mounted above
the routes (as `ConsoleShell` does) is drawn exactly once, inside the
portal's banner box at the top of the content. A disconnected adapter
shows the connection notice in that box; a connected one shows none.
PHONE CONTROL: the banner stays where the shell mounts it, drawn once,
with no box and no notice.
- `docs-portal.test.tsx`, new block `objectstack#37197`: the portal tree
in the shell (first row, `aria-current` on the index, sections in the
index's order, no back link, no in-page column). A book open in the tree
with the article current. The label fix (an app labelled `System
settings`, so not 「Setup」). Every portal URL form in the shell: index,
SLUG, book NAME, NAME/DOC, doc-name-is-also-a-book-name, canonical
SLUG/DOC, implicit package book, slug-that-is-another-book's-name. In an
app's reader and docs index, 「All documentation」 is the first docs row:
the back link stays the column's top row, and 「All documentation」
precedes the filter and the first book. PHONE CONTROL: the in-page
column of the portal and of an app keeps it last.
- `SidebarAppMenu-36112`, new block: the portal head reads
「Documentation」, lists the apps under 「Your apps」 with none checked,
opens any app by its address, gives 「Add app」 to an admin who may author
and no app-scoped row; member control.
- `UnifiedSidebar.footerSlot-36739`, new block: in Home's context with a
remembered app, `docsPortal` draws the portal head (not the app's), the
page's tree as the body and the account foot; no search field without a
palette; control without `docsPortal`.
- **objectstack-ai#37193's N1**, in `ConsoleLayout.noTopBar-36112`: a docs route with
`connectionState: 'disconnected'` shows `ConnectionBanner` in the
banners box at 1440 px. A collapsed docs route draws the expand button
in the docs header (a `DocShell` stand-in that reads the shell's expand
slot) and no corner fallback. Each has a phone control.

Ablations, each via `scripts/ablation-replace.mjs`: anchor 1 to 0 on
disk, restored blob equal to HEAD, `git diff HEAD` empty. The tests
import `src`, so there is no `dist` leg.
1. The variant switch, `DocsPortalShell` `if (phone) {` changed to `if
(phone || true) {`: `Tests 7 failed | 4 passed (11)`. Every desktop pin
went red; the four phone controls stayed green.
2. The first-row switch, `DocsNav` `inSidebar` forced false: `Tests 4
failed | 76 passed (80)`. The two portal-tree tests and the two
app-sidebar tests went red; the PHONE CONTROL stayed green. Re-run after
the reorder, at `2961b4a9`: the same 4 red, PHONE CONTROL green,
restored blob == HEAD.
3. The label fix, `{ ...resolved, label: card.label }` changed to
`resolved`: the label test went red (`1 failed`).
4. The app-less group, `appless` removed from the scope: the
no-guessed-app help test went red (`1 failed | 10 passed`).
5. S1, `AppShell` handed the host app's `branding` (anchor
`navbar={null}` replaced): `Tests 1 failed | 15 passed (16)`, the
default-accent pin red, its phone control green. A first attempt put the
anchor inside its own replacement; the tool refused it ("a drop of 0")
and restored the file, so it measured nothing and was re-run.
6. S2, `ChromeBannerHost` deleted: `1 failed | 15 passed (16)`, the 1440
banner pin red. `ConnectionBanner` deleted: `1 failed | 15 passed (16)`,
the notice pin red. The PHONE CONTROL stayed green in both.

Local runs. Each ran under `os-verify-lock` with `--maxWorkers=2`; every
one reports `VERDICT command-exit 0` unless it says otherwise.

<details><summary>Test readings</summary>

- At `95a165e3`, before the main merge, the five touched or new suites
with `--reporter=verbose` (every new block listed): `Test Files 5 passed
(5) / Tests 140 passed (140)`.
- After merging `origin/main` (`0a1b69c0`), the closure was rebuilt
(`turbo run build --filter='@object-ui/console^...'`, `Tasks: 75
successful, 75 total`). Then a NARROWED suite ran at `1ffad1a4`: 186
files, every app-shell and console test naming `ConsoleLayout`,
`UnifiedSidebar`, `SidebarAppMenu`, `ShellPageActions`, `HomeLayout`,
`DocsPortalShell`, `sidebarDocsNavSlot`, `DocsNav`, `DocShell` or
`DocPage`, plus every console `pages/` test. Result: `Test Files 3
failed | 183 passed (186) / Tests 3 failed | 1680 passed (1683)`. The
three reds were tests that count what this change adds:
- `App.docsPortalLazy` stubbed the old portal frame but not the new one,
so the real shell's bell and agent reads escaped to the network;
- `expressionUser.mountSites.ratchet` counts expression mount sites, and
`DocsPortalShell` is a new one;
- `unsavedEditsLeave.census-13253` counts `UnifiedSidebar`'s
`onAppChange` reads, and the portal head's wrapped read is a new one.
All three were fixed in `7977d28b`, which changes tests only, and
re-run: `Test Files 3 passed (3) / Tests 12 passed (12)`.
- DECLARED NARROWING: the full app-shell and console suites were not run
locally; CI `Test UI` runs them.
- `type-check` for `@object-ui/app-shell` and `@object-ui/console` at
`1ffad1a4`: `VERDICT command-exit 0` (the later commit changes tests
that the same programs compile). Lint on the changed files: 0 errors,
and no new warning after typing the shared list's props.

</details>

<details><summary>Rework 2 readings at fecd4e2 (seat L1 7155677032: S1
accent pin, S2 banner host, S3 + N1 note wording, N2)</summary>

- The closure was rebuilt (`Tasks: 75 successful, 75 total`). Then
`DocsPortalShell-37197`, `ConsoleLayout.noTopBar-36112`,
`App.docsPortalLazy` and `expressionUser.mountSites.ratchet` ran: `Test
Files 4 passed (4) / Tests 31 passed (31)`, `VERDICT command-exit 0`.
- `type-check` for app-shell and console at `e78f292d`: `VERDICT
command-exit 0`. For app-shell again at `fecd4e23`, after the hook was
moved to `useSyncExternalStore`: exit 0.
- Lint on the two changed source files: 0 errors and no warning. The
first spelling of the hook drew `react-hooks/set-state-in-effect`; that
is why it was rewritten.
- S3: the 37197 note now opens "was the one documentation page that
still drew a top bar on a desktop". `/organizations` and Home's
no-product-app state still draw one. N1: search is described "when there
is an app to search". The note also names the standing notices at the
top of the page's content.
- `app-shell.mdx` needed no edit: its portal sentence ("draws the same
frame there", the content area carrying the standing banners) is now
true at this head.
- The derived gate list at `fecd4e23` is unchanged (71). Of the 70 light
ones, 68 exited 0 at once. `check:skill-examples` exited 3
(`client-react` was not built in the fresh worktree); after building it,
exit 0. `check-empty-changeset` exited 1: the DELIBERATE CORRECTION,
confirmed by the seat's contract review. ui `vitest run scripts/`: `Test
Files 172 passed | 2 skipped (174)`. `--ran`: `71 derived, 71 run, 0
NOT-MEASURED (a DERIVED zero)`. overlap-check: clean against `main`,
objectstack-ai#37166, objectstack-ai#37168 and objectstack-ai#37169, and exit 1 against objectstack-ai#35129 only (accepted);
the push was gated on that.

</details>

<details><summary>Rework readings at 2961b4a (seat ruling: order,
changeset, app-shell doc)</summary>

- The closure was rebuilt (`Tasks: 75 successful, 75 total`, 74 cached).
Then `apps/console/src/pages/`, `packages/app-shell/src/console/docs/`,
`UnifiedSidebar.footerSlot-36739`, `SidebarAppMenu-36112` and
`ConsoleLayout.noTopBar-36112` ran: `Test Files 177 passed (177) / Tests
1656 passed (1656)`, `VERDICT command-exit 0`.
- `dispatch-gates --commands` at `2961b4a9` derived 71 commands (the
changeset and the doc add the docs families). Of the 70 light ones, 68
exited 0 at once.
- `check:skill-examples` exited 3: it refused for a missing
`@objectstack/client-react` build. After building that package it ran
with exit 0 (`350 prose examples type-check`).
- `check-empty-changeset` exited 1: the DELIBERATE CORRECTION above, red
by design.
- `pnpm --dir ui exec vitest run scripts/`: `Test Files 172 passed | 2
skipped (174)`.
- `--ran`: `71 derived, 71 run, 0 NOT-MEASURED (a DERIVED zero — all 71
recorded an exit code and none of them is 3)`.

</details>

## Acceptance notes

- **N2 and the stage-2 views** are real renders against the showcase
example on a fresh database: zh-CN browser locale, `deviceScaleFactor`
2, this branch's Console on Vite. They were committed at `672b06dd` and
removed in the next commit, so the PR's file list carries no binaries:
- [1 · /docs at
1440](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/1-portal-landing-1440.png):
the 「文档」 head, 「全部文档」 first and current, books under 「功能展示」 and 「系统设置」,
and the Setup book named 「系统设置」 as its card is. The page's one `header`
element is the index's own title block, not a bar.
- [2 · a doc
open](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/2-portal-doc-open-1440.png):
no `header` element on the page.
- [3 · the head menu
open](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/3-portal-head-menu-open-1440.png):
「你的应用」, the two apps and 「添加应用」; 0 checked rows; the URL is unchanged
(measured).
- [4 ·
collapsed](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/4-portal-sidebar-collapsed-1440.png):
one expand button, in the docs header, and no corner fallback
(measured).
- [5 · 768
px](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/5-portal-landing-768.png).
- Phone 390 px, unchanged: [6 ·
landing](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/6-phone-portal-landing-390-unchanged.png)
and [6b · a
doc](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/6b-phone-portal-doc-390-unchanged.png).
- [7 · an app's docs
reader](https://raw.githubusercontent.com/objectstack-ai/objectstack/0b9b82809015d40074d9aa71ea5a3528cd44b20d/design/37197/stage2/7-app-docs-reader-1440.png):
「← 返回功能展示」, then 「全部文档」 as the first docs row. Re-captured at `2961b4a9`
and committed at `0b9b8280`.
- **N2** · [8 · an app's docs page that is not the reader (not found),
the `AppDocsNav`
column](https://raw.githubusercontent.com/objectstack-ai/objectstack/0b9b82809015d40074d9aa71ea5a3528cd44b20d/design/37197/stage2/8-app-docs-not-found-appdocsnav-1440.png),
with the same order. Re-captured too.
- No last-app key was found in the browser's storage after any desktop
view (measured on each).
- Home's command palette keeps its scope: the host app it searches is
read the way Home reads it, as the portal's old frame did, and is never
written back. That is search scope, not a frame app: the sidebar head,
branding and help name no app.
- The portal's desktop sidebar carries the host's footer slot (the
administrator's 「开始使用」 checklist in the screenshots), as every shell
sidebar does.
- Book labels in an **app's** docs column (`usePackageDocsNavBooks`)
still read the book's own label. For an implicit book of an app's own
package that is the humanized package id. The approved scope was the
portal tree, so this is noted, not changed.
- `overlap-check` reports exit 1 against objectstack-ai#35129, the bot-maintained
Version Packages PR (`chore: version packages`). That PR deletes every
pending changeset, so the DELIBERATE CORRECTION above meets it as a
modify/delete conflict on `.changeset/37150-docs-pages-in-app-shell.md`.
Nothing was resolved by hand. `origin/main` and every sister PR (objectstack-ai#37166,
objectstack-ai#37168, objectstack-ai#37169) merge cleanly.

## Verification

Two-minute check: run `pnpm --dir ui exec vitest run
packages/app-shell/src/console/docs/__tests__/DocsPortalShell-37197.test.tsx`.
Expected: 16 passed, among them three per-path desktop pins and five
PHONE CONTROLs. Or open `/docs` at 1440 px: no top bar, a 「文档」 head, and
「全部文档」 first in the sidebar.

<details><summary>Gate readings</summary>

- `dispatch-gates --commands` (objectstack-ai/objectstack, 16 paths
against merge base `93bd45957`; the list is unchanged at the final head)
derived 38 commands. 37 ran at `e4db1f12`, and `pnpm --dir ui exec
vitest run scripts/` ran under the lock at `eea1765f`: `Test Files 172
passed | 2 skipped (174)`. All exited 0 except
`check:test-source-alias`. It asked for the palette's lazy
`@object-ui/plugin-detail` load to be paid at collection in the new
suite; fixed in `1ffad1a4` and green since.
- `--ran` reconciliation: `38 derived, 38 run, 0 NOT-MEASURED (a DERIVED
zero — all 38 recorded an exit code and none of them is 3)`.
- At the final head `7977d28b`, these re-ran and exited 0:
`check:test-source-alias`, `check:cross-package-test-inputs`,
`check:nul-bytes`, `check:type-check-debt`, `check:tier-file-adoption`,
`check-empty-changeset`, `check-changeset-no-major`, and under `ui/`
`check:new-line-citations` (`0 new citation(s)`).
- `overlap-check` before every push: `VERDICT clean exit 0`.
`origin/main` merges cleanly, as do objectstack-ai#37166, objectstack-ai#37168 and objectstack-ai#37169, which
share `app-shell/src/index.ts` or `SidebarAppMenu-36112.test.tsx`.
- Size at `fecd4e23`: 21 files, +1323 / -152. No governed path.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYo1Rb7aYhQiJdWshkL)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ant; trigger context is client-sent (objectstack-ai#37313)

Fixes objectstack-ai#37002

Delivers the card's items 1, 2 and 3. Item 4, the lint warning, is not
built, and the card does not require it: its text is "Optional, only if
the allow-set constant is published in spec by then", the acceptance
list does not name it, and no allow-set constant is published in
`packages/spec` on `main`.

Clause-②: no
Metadata-protocol: none

Landing: this diff touches `skills/**` and `docs/adr/**`, Tier H
surfaces, so the maintainer merges it. The card says to land it only
after objectstack-ai/cloud#4985 has merged. That gate is met: the cloud
seat's confirmation on the card (comment 7163165666) records the merge
on 2026-11-25 09:32Z as `d2c498192`. This session cannot read that
repository; the reading is the cloud seat's.

## 维护者速读

- 用户能看到什么变化:给应用写 AI 技能的作者和替他们写的
AI,在技能文档和协议参考页里读到实情:应用自带的技能在应用内问数助手里随所在应用生效、清单之外的工具会被丢弃并给出提示、触发条件能读哪几项界面信息,以及这些信息由界面上报、只能用来分流、不能当权限。
- 为什么做:替给应用写技能的作者解决——应用内问数助手的行为已经定下,发布给他们的说明还是旧说法。
- 出错会怎样:只动说明文字和一条评测的期望描述;写错了作者会学到错的做法,撤回这次合并即可恢复原文。
- 要你做什么:含受管面(技能文档和两份决策记录各一行指针),由你手工合并。

## What changes

- `skills/objectstack-ai/SKILL.md`, *Trigger Conditions*: one new
paragraph on the in-app `ask` assistant, marked as a cloud surface. Its
four statements are the card's:
- a package skill with `surface` `ask` or `both` loads for the app the
user is in, and the `build` side is not served while in-app build is
closed;
- a tool the skill names outside the allow-set is dropped with a
diagnostic;
- a condition can read `appName`, `objectName`, `recordId`,
`selectionKind` and `userRole`;
- the client sends all five, so a condition on any of them, `userRole`
included, is routing, never access control: the turn's tools still run
under the caller's own permissions.
- The same file, three deletions that pay for part of the paragraph.
Each one restates text the file keeps:
- under *Skill Configuration*: "A **Skill** is a named bundle of tools
with dedicated instructions and trigger conditions." The diagram above
it and the two tables below it say the same.
- under *Platform agents*: "You extend the platform with **skills**,
never by adding an agent." The frontmatter description and the "Skills
are your entry point" paragraph say the same.
- under the built-in skills table, three clauses of the open-edition
sentence: "All four are cloud-runtime skills", "authored for cloud", and
"their `instructions` are what MCP serves". The edition note at the top
and the `instructions` row say the same. The sentence keeps its three
facts: none of the built-ins is available on the open edition, `surface`
and `triggerConditions` are inert there, and `tools` binds nothing there
but is read.
- `skills/objectstack-ai/evals/skills-tools-knowledge.json`, eval 5: the
last sentence of `expected_output` was "The runtime's `ask` / `build`
agents pick the skill up by surface." It is now "The in-app `ask`
assistant picks the skill up by surface (`ask` or `both`) for the app
the user is in, and a tool the skill names outside the allow-set is
dropped with a diagnostic." `prompt`, `must_contain` and
`must_not_contain` are unchanged.
- `packages/spec/src/ai/skill.zod.ts`: the `.describe()` of
`triggerConditions` gains one sentence: "The context fields a condition
reads are reported by the client: a condition is routing, never access
control". Nothing else in the file changes.
- `content/docs/references/ai/skill.mdx`: regenerated with `gen:docs`.
The one `triggerConditions` row moves. No other generated artifact was
stale, and the JSON schemas are git-ignored.
-
`docs/adr/0063-two-kernel-agents-skills-are-the-extension-primitive.md`
and `docs/adr/0064-tool-scoping-to-agent.md`: one add-only header line
each, under `**Consumers**`. Both name the cloud record as `cloud
ADR-0118`, by its title "App-package skills load on `ask`; their tools
are intersected with an allow-set", with a link to its file on cloud
`main`. ADR-0063's line says the record implements §2 of that ADR on
`ask`; ADR-0064's line says it records the allow-set an app-package
skill's tools are intersected with on `ask`. No existing line changes,
neither line makes a status claim, and `docs/adr/README.md` stays
current (`adr-index --check` exit 0).
- `.changeset/37002-ask-skill-text.md`: `patch` on `@objectstack/skills`
and `@objectstack/spec`.

Read first, by risk:

1. `skills/objectstack-ai/SKILL.md`, the new paragraph. Every clause is
a cloud fact taken from the card body. None of them was checked against
cloud code from this session.
2. The same file's three deletions. Check that each is a restatement and
that the open-edition sentence still says what it said.
3. The two ADR lines. Check the record's number, title and file against
the cloud record: they are copied from the cloud seat's confirmation,
not read from cloud.

Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints
`skills/objectstack-ai/SKILL.md is 6801 tokens (ceiling 6801; headroom
0)` and exits 0.

## Skill size readings

Head f301512 against base dfdebfa. The readings are those of
7425db8: the later commit changes two ADR files only.

| Reading | Before | After |
|:---|---:|---:|
| `SKILL.md` lines | 464 | 467 |
| `SKILL.md` bytes | 26968 | 27221 |
| `SKILL.md` tokens (ceiling 6801) | 6737 | 6801 |
| all 14 `SKILL.md` files, lines | 4937 | 4940 |
| all 14 `SKILL.md` files, tokens | 65303 | 65367 |
| whole shipped tree, tokens | 296856 | 296948 |
| eval file tokens (measured, not ratcheted) | 2112 | 2140 |

The paragraph adds 509 bytes and the three deletions remove 256, a net
of 253 bytes or 64 tokens. That spends the file's whole headroom (64 to
0). No ceiling moves, and `scripts/check-skills-token-ratchet.mjs` is
not edited.

## Tests

- `pnpm --filter @objectstack/spec test`, under the verify lock, at
7425db8: `Test Files 891 passed (891)`, `Tests 28371 passed | 1 todo
(28372)`, `VERDICT command-exit 0`. The same suite gave the same counts
one commit earlier, at 20ede3d. It was not run again at f301512:
that commit changes two ADR files, and no test under `packages/` names
either.
- `pnpm --filter @objectstack/spec typecheck`, under the verify lock, at
20ede3d: `VERDICT command-exit 0`. The later commit changes
`SKILL.md` and the changeset only, which no `tsc` program reads.
- No ablation. The diff changes prose, one description string and one
generated page, and no behaviour a test pins.
- Importers of `@objectstack/spec` owe no test here: the public surface
is byte-identical apart from one description string, and
`check:api-surface` is green.

## Acceptance notes

- **Eval 5, the acceptance case: measured FAIL at one repetition; the
baseline is NOT MEASURED (quota).** One round of `skill-evals --skills
objectstack-ai` ran at head 20ede3d: 16 of 16 turns, 8 cases on both
arms, one repetition, 6.5 minutes. With-skill scored 5 of 8 and no-skill
0 of 8. The three with-skill misses:
- eval 5 lacks `aiExposed`, and its forbidden `knowledge:` matched
inside a code comment that reads `search_knowledge: platform knowledge
tool.` The answer did refuse the agent and write a `surface: 'ask'`
skill.
- eval 4: its forbidden `handler:` matched inside a comment that reads
"It has no handler:". The answer also authors a tool record, which the
expected answer does not.
- eval 7 says "Never retry the call" where the required token is `do not
retry`.

None of the three is on a token this diff touches: `aiExposed`,
`knowledge:`, `handler:` and `do not retry` appear on no added or
removed line. Eval 5's assertions are unchanged; only its
`expected_output` moved. Evals 1, 2, 3, 6 and 8 pass with the skill. No
baseline round ran on `main`'s text, so this round cannot say whether
eval 5 passed before this change: the login's seven-day window read 0.84
at the first turn and 0.85 at the last, status `allowed_warning`, and
the seat ruled that no baseline runs for this PR. Whether the card's
acceptance line needs a measured pass is the maintainer's call at
hand-off.
- The round ran one commit before the final head. The final commit moved
the skill text in two ways, and both leave more teaching in the file
than the measured text had: it restored the blueprint row's "agents are
platform-supplied, and `tools` is not the default path", which the
measured text had cut, and it shortened the new paragraph by 14 bytes of
wording ("In the in-app" to "In-app", "any of them" to "any"). The row
was restored because eval 4's miss is in the area that clause repeats.
- One deletion sits in a section eval 5 leans on: "You extend the
platform with **skills**, never by adding an agent." The file still says
it in the frontmatter description, in "Skills are your entry point", and
in the retired `agent.tools` row. Without a baseline its effect on eval
5 is not measured.
- The cloud record the two ADR lines point at: the cloud seat's
confirmation gives `cloud ADR-0118`, file
`docs/adr/0118-app-package-skills-on-ask-tool-allow-set.md`, on cloud
`main` as `e738843ba`, and says its own status line still reads
"Proposed (2026-11-24)". The two lines here name the record and say
nothing about its status.
- `check:dual-build-cjs-loads` is NOT MEASURED locally: it exits 3 until
every dual-build package in the workspace has a `dist/`, which is a
whole-workspace build this diff does not owe. CI runs it.
- The card names the allow-set and does not list its members or say
where the diagnostic appears, so the skill names it without listing it.
An author cannot yet check a tool against it before running. The card's
item 4 would answer that once the constant is published in the spec.
- The values `selectionKind` takes and what `appName` holds are given in
card comment 7152100136, not in the card body. The dispatch limited
cloud facts to the body, so the skill names the five fields and says no
more about them.
- `skill.zod.ts` keeps two comments this card does not reach: the one
above `field` gives `'channel'` as an example context field, which is
not among the five the card names, and the one above `triggerConditions`
says "object name, user role, etc.". The card limits the spec edit to
the description string.
- The skill's sentence "An agent's tool set is the union of its
surface-compatible skills' tools" is left as written. The new paragraph
is where the allow-set is stated.
- The forbidden tokens of evals 4 and 5 match inside comments of
otherwise acceptable answers, and eval 7 requires one wording of an
instruction. Those fixtures are not changed here: they are outside this
card.

## Verification

Two local readings, one per push.

- At 7425db8, before the ADR lines: the 114 commands `node
scripts/pm/dispatch-gates.mjs --commands` derived for the diff, 113 exit
0 and 1 exit 3. `--ran` reconciliation: `114 derived, 113 run, 1
NOT-MEASURED, 0 UNRUN`.
- At f301512, the head: the 21 commands the two ADR paths derive,
all exit 0. `--ran` reconciliation over those paths: `21 derived, 21
run, 0 NOT-MEASURED, 0 UNRUN`. The whole-diff derivation on this head is
115 commands: the 114 above plus `pnpm check:adr-index`, which is among
the 21. The other 94 were not run again on this head. `node
scripts/check-skills-token-ratchet.mjs` and `pnpm check:role-word` were,
and both exit 0.

<details>
<summary>What ran, and how the generated page was regenerated</summary>

- `pnpm --filter @objectstack/spec build`, under the verify lock:
`VERDICT command-exit 0`.
- `pnpm --filter @objectstack/spec check:generated` before regenerating:
`1 of 14 artifact(s) stale`, namely `content/docs/references/**`. After
`pnpm --filter @objectstack/spec gen:docs`: `All 14 generated artifacts
are up to date`.
- The first pass of the gate list, at 20ede3d, had six commands exit
3 for want of a build. `pnpm exec turbo run build --concurrency=2` over
the dependencies of `@objectstack/scenarios` and over
`@objectstack/client-react` with its dependencies (45 tasks, `VERDICT
command-exit 0`) cleared five of them. The whole list was then run again
at 7425db8, which is the first reading above.
- The 21 at f301512: `check-adr-links` and its self-test,
`check:adr-anchors`, `check:adr-index`, `check:adr-symbol-anchors`,
`check-closing-keyword-parity` and its self-test,
`check-comment-mask-corpus`, `plan-test-core-shards --self-test`, lint
`check:doc-formula-expressions`, `check:ci-filter-parity`,
`check:closed-ceremony-text`, `check:cross-package-test-inputs`,
`check:doc-authoring`, `check:driver-memory-census`,
`check:gitlink-declared`, `check:nul-bytes`, `check:pm-governed-merges`,
`check:pm-prior-rulings`, `check:refd-timer-probe`,
`check:watch-hint-literal`.
- Exit 0 on the families that read these files:
`check-skills-token-ratchet` and its self-test, spec `check:skill-docs`,
`check:skill-refs`, `check:skill-examples`, `check:docs`,
`check:generated`, `check:api-surface`, `check:authorable-surface`,
`check:liveness`, `check:llms-txt`, then `check:skill-links`,
`check:skill-identifier-liveness`, `check:skill-compatibility`,
`check:skill-frame-sync`, `check:role-word`, `check:doc-authoring`,
`check:nul-bytes`, `check:published-files`, `check-empty-changeset`,
`check-changeset-no-major`, `check-adr-0087-registration`, lint
`check:doc-formula-expressions` and `check:doc-security-posture`.
- NOT MEASURED locally: `pnpm check:dual-build-cjs-loads`, exit 3 at
7425db8, `PREREQUISITE NOT MET — this gate reads built output, and
some package has no dist/`. See the acceptance notes.
- `node scripts/pm/overlap-check.mjs` at f301512: `VERDICT clean
exit 0` against `origin/main` 1a62867 and the one open pull that
shares `SKILL.md`, the Version Packages pull (objectstack-ai#35129).

</details>

CI was not waited for. The type-check lanes, `Build Core`, the UI jobs
and the dogfood shards are CI's own runs and have no local reading here.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ)_
<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYpEsWWE9Y5YtSsDgqZ -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…tton on a record (objectstack-ai#37372)

<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg4dvHHXab6R7pwrYzfcBM1F)_
repo:objectstack#5 · os-bill · session_01Utp6CZfqUFGzpwvVwRfzYS

Fixes objectstack-ai#37217

Clause-②: no
Metadata-protocol: none
Skills-docs: this PR is the skills-docs half (`skills/objectstack-ai`)
owed by PR objectstack-ai#37215 (`Skills-docs: follow-up owed —
skills/objectstack-ai/SKILL.md`); the `ask_ai` action itself shipped in
PR objectstack-ai#37215

## 维护者速读

- 用户能看到什么变化:用 AI 搭建应用时,AI 读到的技能说明现在会教「问
AI」按钮怎么放:放在记录页标题栏或更多菜单,点开后助手钉在这条记录上;并说明它不能带目标、不能开放给 AI
当工具、不能放在仪表盘标题,且只在装了应用内助手的版本里出现。只有文字变化。
- 为什么做:属于「在一条记录上问 AI」专题,补上「问 AI」动作合并后欠下的技能说明。
- 出错会怎样:最坏是说明写得不准,AI 写出的动作仍会被校验拦住;撤回即恢复旧文字。
- 要你做什么:受治理的技能文件,需要你批准后合并。

## What changes

`skills/objectstack-ai/SKILL.md`, a new subsection *The Ask AI button —
`type: 'ask_ai'`* at the end of *Actions as AI Tools*:

- What the action does: it pins the assistant's conversation to the
record it runs on and opens the assistant, sending no message. It is
declared on the object, in `locations: ['record_header']` or
`['record_more']`, with a `defineAction` example marked `os:check`
(type-checked against the built spec by `check:skill-examples`).
- What the parse refuses beside it: a `target`, `ai.exposed: true`, and
`actionType: 'ask_ai'` on a dashboard header (a header runs on no
record).
- That nothing serves it headless: `list_actions` skips it, `run_action`
refuses it, and no `action_` tool exists for it.
- Where it is absent rather than disabled: the console draws it only
where the assistant surface is on **and** the AI service honours a
conversation focus.

Paid for by deleting restatement in the same file; the token ceiling is
unchanged (6801, the file measures 6787). Deleted: the *App AI
Blueprint* table (its first two rows restate *Skill Configuration* and
the `KnowledgeServicePlugin` wiring; its third row's claim that `agents`
/ `tools` / `skills` are the only AI stack collections was stale, since
`aiContexts` is a `defineStack` key too); the alias sentence under
*Platform agents* (`data_chat` / `metadata_assistant` for old bookmarks:
the agent type is closed to third parties, so no author writes either);
the pointer to `references/_index.md` for `AgentSchema` (the
*References* section already points there); the rung-2 sentence "Read
that file for the exact set" (the sentence before it names the file);
the two product-analogy parentheticals beside `ask` and `build`; and the
memory clause of pitfall 1, kept to its two facts (the required keys and
that there is no storage backend to choose).

`evals/skills-tools-knowledge.json`:

- New case 10: "Add an Ask AI button to the contract record page".
Expected: a `defineAction` with `type: 'ask_ai'`, `objectName:
'contract'`, `locations: ['record_header']`, no `target`, no
`ai.exposed: true`, with the headless and absent-not-disabled facts.
Assertions: must contain `ask_ai`, `record_header`, `locations`; must
not contain `target:` (only that token: a correct answer may well spell
`exposed: true` or `actionType` while stating the refusals, so neither
can be forbidden under the grader's literal-substring rule).
- Case 9 (declared extra item, same kind of edit in the same file, asked
for in the contract review): its reference answer no longer spells the
`chunkSize` token it forbids (it now says "no chunk-size key"); the
assertions are unchanged.

Changeset `.changeset/37217-skill-ask-ai-action.md`:
`@objectstack/skills` patch, carrying the two declaration lines.

Out of scope, left where it lives: the `objectstack-ui` action-type row
(landed in PR objectstack-ai#37215); the `ai_context` teaching (objectstack-ai#37177, same skill
tree, unclaimed until this lands).

## Why

PR objectstack-ai#37215 (objectstack-ai#37142) added the `ask_ai` action type and its console
executor, and declared `Skills-docs: follow-up owed —
skills/objectstack-ai/SKILL.md`. The UI skill's action-type table has
the row; the AI skill, the one an author reads when wiring the
assistant, did not mention the action, so an agent asked for an Ask AI
button would reach for `ai.exposed: true` or a `target`, both refused at
parse.

## Verification

Every claim in the new passage rests on `main` at 98bda0a:
`packages/spec/src/ui/action.zod.ts` (`ActionType` carries `ask_ai`;
`TARGETLESS_TYPES`; `refuseAskAiContradictions` refuses `target` and
`ai.exposed: true`), `packages/spec/src/ui/dashboard.zod.ts`
(`refuseRecordlessAskAi` on the header action),
`packages/runtime/src/action-execution.ts` (`isHeadlessInvokableAction`
answers `false`; the door's `ask_ai` sentence),
`ui/packages/app-shell/src/hooks/useAiSurface.ts` (`enabled` +
`focusServed`, `capabilities.focus`) and `useAskAiHandler.ts`,
`docs/adr/0160-record-scoped-ai-inquiry.md` D7, and
`examples/app-showcase/src/ui/actions/index.ts`
(`showcase_ask_about_task`, the same shape as the example).

Skills size readings (`node scripts/check-skills-token-ratchet.mjs`,
tokens = ceil(utf8 bytes / 4)):

| | main | this PR |
|---|---|---|
| `skills/objectstack-ai/SKILL.md` lines | 474 | 485 |
| `skills/objectstack-ai/SKILL.md` tokens (ceiling 6801) | 6800 | 6787 |
| All `skills/*/SKILL.md` lines | 4948 | 4959 |
| Bundle total tokens (whole shipped tree) | 297305 | 297523 |

The bundle grows by 218 tokens: +231 in the unratcheted eval fixture
(2444 to 2675), −13 in ratcheted authored text.

Rework at 05555e0 (contract review 7178774511, PASS with two
should-fixes and a nit): the changeset's token count reads 6787
(measured), the Blueprint-row reason says stale rather than restated,
case 10's `must_not_contain` keeps only `target:`, and case 9's
reference drops the literal `chunkSize`. The grader the cases declare
(`packages/qa/scenarios/src/skill-evals/grade.ts`, `gradeAnswer`) run
over each case's own `expected_output`:

```
== head e16ec49 (before the fix) ==
case 9: pass=false missing=[] forbidden=["chunkSize"]
case 10: pass=false missing=[] forbidden=["exposed: true"]
== head 05555e0 (after the fix) ==
case 9: pass=true missing=[] forbidden=[]
case 10: pass=true missing=[] forbidden=[]
```

Re-run on the new head: `check-skills-token-ratchet` (6787/6801),
`check-empty-changeset`, `check-changeset-no-major`, `check:nul-bytes`,
all exit 0; `check-commit-card-trailers --range origin/main..HEAD` exit
0 (2 commits); `overlap-check --branch=HEAD` VERDICT clean. The skill
file is byte-identical to e16ec49, so the gates below still describe
it.

<details><summary>Local gates at e16ec49</summary>

`node scripts/pm/dispatch-gates.mjs --commands` derived 49 commands (run
from the committed head, reconciled with `--ran`: 49 derived, 48 run, 1
NOT-MEASURED, 0 UNRUN). 48 ran locally, all exit 0, including
`check-skills-token-ratchet` (gate and `--self-test`),
`@objectstack/spec check:skill-docs`, `check:skill-links`,
`check:skill-identifier-liveness`, `check:skill-compatibility`,
`check:skill-frame-sync`, `check:doc-authoring`,
`check:corpus-claim-drift`, `check:nul-bytes`, `check:role-word`,
`check-empty-changeset`, `check-changeset-no-major`,
`check-adr-0087-registration`, `check:pm-governed-merges`,
`check:published-files`, `check:dts-closure`,
`check:lean-entry-closure`, `@objectstack/lint
check:doc-formula-expressions`.

NOT MEASURED locally, left to CI: `check:dual-build-cjs-loads` (exit 3,
prerequisite: reads every package's built `dist`; only `spec`, `client`,
`client-react` and their closure were built here). The diff touches no
package source.

Outside the derived set, run because the card's acceptance names it:
`@objectstack/spec check:skill-examples` exit 0 — 351 marked examples
across 3 surfaces type-check, the new `os:check` block included (`tsc`
ran the semantic pass on all of them, against the built
`@objectstack/spec`).

Pre-push: `check-commit-card-trailers --range origin/main..HEAD` exit 0;
`overlap-check --branch=HEAD` VERDICT clean (origin/main and the one
open PR sharing `skills/objectstack-ai/SKILL.md`, objectstack-ai#35129, both merge
cleanly).
</details>

No ablation: the change is docs and an eval fixture; no tested behaviour
moved.

Two-minute check: read *The Ask AI button* in
`skills/objectstack-ai/SKILL.md` beside `refuseAskAiContradictions` in
`packages/spec/src/ui/action.zod.ts` and D7 of ADR-0160.

## Acceptance notes

- Built by the card thread itself on claude-fable-5-1 under the
measured-unavailability exemption recorded in the claim (comment
7177961994: `dispatch-gates --tier` mandates claude-fable-5-2 for
`skills/**`; this account serves 5-1). The compensating control is the
contract review at CONTRACT_REVIEW_TIER, owed on the handoff.
- None filed.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (repo-wide lint is CI's
run; the diff touches only Markdown and JSON)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Utp6CZfqUFGzpwvVwRfzYS

<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CZfqUFGzpwvVwRfzYS -->

---------

Co-authored-by: os-bill <bill@objectstack.ai>
Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…owledge rebuild and status (objectstack-ai#37439)

<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ83sWXVVPC33q8uBsTDHaebw)_

Fixes objectstack-ai#37099

Clause-②: yes
Metadata-protocol: none

## 维护者速读

- 用户看到的:知识库数据源第一次部署、或换了嵌入模型 /
索引配方之后,服务启动后会在后台自动把它建好索引,不用再等每条记录被改一遍才能搜到;管理员也可以用命令行手动重建某个源、查看每个源的索引状态和进度。
- 为什么做:属于「知识检索平台化」专题,让知识源开箱即可检索;以前一个从没建过索引的源,搜索永远是空的。
-
出错会怎样:建索引会把匹配到的内容发给嵌入服务商并产生费用;默认的内存存储每次重启都会整源重建、每个节点各建一次,只有配置了共享集群锁才是一个节点建;可以用插件开关关掉开机自动建,回退就是撤掉这个改动。
- 要你做什么:无。

## What changes

**First build after boot** (`@objectstack/service-knowledge`)
- `KnowledgeService.readIndexState(source)` reads ADR-0161 K7's table
for one source: the adapter holds nothing, a different fingerprint, a
different recipe hash, no recipe hash, current, or (an adapter without
`indexStatus`) whether `listDocuments` lists anything. Each reading says
whether a build is due.
- `KnowledgeService.buildSourcesAtBoot()` runs from the plugin's
`kernel:bootstrapped` hook, after the embedder is provided, without
holding up the boot. It walks the sources one at a time and builds each
one a build is due for. A source with `refresh.onRecordChange: false`
(an external indexer owns it) is skipped. A state it cannot read, or an
adapter that cannot say, is logged at warn and left alone; the operator
rebuild is the way for those.
- **One node builds.** `rebuildSource` takes the cluster lock
`knowledge:build:SOURCE` (`ILock`, 60 s lease renewed every 20 s,
`waitMs: 0`). A node that finds the lock held records `not-run` and
builds nothing. A node that gets the lock re-reads the state first, so a
node arriving after another finished builds nothing either. If the lock
service errors, no build starts and the node warns. Without a `cluster`
service (single process) the build runs without a lock.
- Each build logs one cost line at its start (every row the source's
`where` matches is read, and its content fields are sent to the
embedding provider, which bills for them), progress at most every 10 s,
and its totals at the end (info) or why it did not finish (warn).
- New plugin option `buildAtBoot` (default `true`). `false` turns the
boot pass off; the operator rebuild still works.

**Operator rebuild**
- Two actions on the `knowledge` settings namespace, beside `test`:
`rebuild` (`{ source }`) starts a build and answers at once;
`index_status` (`{ source? }`) answers each source's index reading and
the last build record on this node, with its progress. Both go through
the settings action door, so both need `manage_platform_settings`. A
second rebuild of a source already building on this node is refused.
- `os knowledge rebuild SOURCE` starts one and follows it to its end by
polling `index_status` (`--no-wait` to return at once, `--interval`). It
exits 1 when the build failed or did not run, or when the answer comes
from a node that is not running this build.
- `os knowledge status [source]` prints each source, its index state and
its last build on the node that answered.

**Docs**: `content/docs/ai/knowledge-rag.mdx` gains "The first build,
and rebuilding a source": the K7 table, what one build costs (a warn
callout), how to turn the boot pass off, and the two commands.

**Rework round (seat L1 REWORK, contract record PASS with should-fix
findings)**
- **S3, the admin gate is pinned.**
`knowledge-settings-contribution.test.ts` gains "the rebuild and
index_status actions are administrator-only, at the HTTP door": a real
`LiteKernel` with `KnowledgeServicePlugin` and `SettingsServicePlugin`,
driven through `registerSettingsRoutes` and the real
`SettingsService.runAction`. A signed-in caller without
`manage_platform_settings` (an organization member holding `setup.read`
/ `setup.write`, or one with no capability) gets `403
SETTINGS_FORBIDDEN` for `rebuild` and `index_status`; an unauthenticated
one gets `401 UNAUTHENTICATED`. No refusal names the source (id or
label), and no handler method on the service (`listSources`,
`getSource`, `readIndexState`, `rebuildSource`, `buildRecord`) is
called. A control shows the same door lets an administrator through and
then names the source, and the in-process `runAction` with an enforced
member context rejects with `SETTINGS_FORBIDDEN`. The gate itself is
unchanged; it still lives in the `knowledge` manifest's
`writePermission`, and relaxing it now turns these pins red (ablation
below).
- **S4, the cost callout** in `content/docs/ai/knowledge-rag.mdx` now
says the default `memory` adapter holds nothing after a restart, so with
it every boot is a first build that re-embeds the whole source on every
node; and that "only one node builds a source" holds only with a shared
cluster lock driver, because the default `memory` cluster driver's lock
is a per-process mutex. The paragraph above the callout now qualifies
its "only one builds" sentence the same way and links the cluster page.
The changeset says both.
- **S6, the CLI reference.** `content/docs/deployment/cli.mdx` gains a
`### Knowledge` section after `### MCP`, in the shape of the other
command groups (overview table, one `####` per command with examples, a
flag table): `os knowledge status` and `os knowledge rebuild`, their
exit codes, the admin-only door, and the per-node build record.
- **Nits fixed:** N2 (`os knowledge rebuild --no-wait` now prints that
it reports no outcome and points at `os knowledge status`; the flag help
and the CLI reference say so), N3 (`buildSourcesAtBoot` lists the
sources inside a `try` and resolves with a warn when it cannot; the
plugin's `void` call carries a `.catch`), N5 (an adapter reporting `{
building: true }` with no active fingerprint, a first build that never
completed, now reads `nothing` with its own sentence instead of
`new-fingerprint`). N1 (the optional `protocol/knowledge.mdx` pointer)
stays an accepted deviation.
- **Carded, not fixed here:** S1 (a lease that lapses mid-build only
warns and the walk goes on unfenced; a build whose embed call never
returns renews forever) is objectstack-ai#37465. S2 (build records live in memory per
node, so behind a load balancer `os knowledge rebuild` can exit 1 on a
poll that lands elsewhere) is objectstack-ai#37466. S5 (retiring the field gate's
`title` arm) is objectstack-ai#37467.

## Why

A source that was never built had an empty index until each of its rows
was written again; search found nothing and nothing said why. After an
embedder or recipe change the index stayed stale the same way. ADR-0161
K7 says what starts a rebuild; nothing ran it.

## Tests

-
`packages/services/service-knowledge/src/__tests__/knowledge-build.test.ts`
(20 tests): every `readIndexState` reading; a fresh source is built at
boot and search finds its rows; a built source is not rebuilt; two nodes
sharing one lock build once (one `done`, one `not-run`, lock released);
a node arriving late re-reads and builds nothing; a lock error starts
nothing and warns; `onRecordChange: false` is skipped; a failed build is
logged at warn and stays due; the `rebuild` and `index_status` actions
(progress, result, an operator rebuild skipping unchanged documents, a
running build refused, bad payloads refused); the plugin's
`kernel:bootstrapped` pass and `buildAtBoot: false`.
- `packages/cli/src/commands/knowledge/knowledge.test.ts` (7 tests):
both commands against bodies written by `sendOk` / `sendError`: the
route and payload, following a build to its end, exit 1 on a failed
build, on a server refusal, and on an answer from a node not running
this build; `--no-wait`.
- Ablation: replacing `lock.acquire` with an always-granted handle fails
the two-node and lock-unreachable tests.
- Rework round: `knowledge-settings-contribution.test.ts` +10 tests (the
admin-gate pins above); `knowledge-build.test.ts` +2 (N3: a listing that
throws resolves and warns; N5: `{ building: true }` reads `nothing`);
`knowledge.test.ts`: the `--no-wait` case now also asserts the line
naming `os knowledge status` (N2).
- Rework ablations, each mutated through `scripts/ablation-replace.mjs`
(landing proved on disk, restore proved `git diff HEAD` empty):
- S3: the `knowledge` manifest's `writePermission` set to `setup.write`
in `@objectstack/service-settings`, package rebuilt (the pins read its
`dist/`): the four member cases, the admin control and the in-process
case turn red (6 failed, 4 passed); restored and rebuilt, 10/10 green,
and the built manifest reads `writePermission:
"manage_platform_settings"` again.
- N5: the new branch disabled: its test red. N3: the listing failure
rethrown: its test red. N2: the log line deleted: the `--no-wait` test
red. All three green again after restore.

## Acceptance notes

- **The `title` arm of the field gate is not retired here.** Per the
11-25 14:55Z comment it can go once a rebuild has run, but it is a
security gate and retiring it needs proof per source at search time that
the index was built under the current recipe. That is its own row,
objectstack-ai#37467; this PR only makes the rebuild happen.
- **Build records are per node.** `index_status` reports the build the
answering node ran. Behind a load balancer, `os knowledge status` may
reach a node that is not building; `os knowledge rebuild` says so and
exits 1 rather than guessing. The index state itself is read from the
adapter and is the same on every node. Sharing the record, or letting
the CLI fall back to the index state, is objectstack-ai#37466.
- **No Setup page button.** The rebuild entry is the CLI (and the action
route it calls). A button on the Knowledge settings page is a separate
UI row if wanted.
- The CLI reference `content/docs/deployment/cli.mdx` now lists both
commands (S6). `content/docs/frontend/cli.mdx` is not updated: it is
outside this card's file surface.
- A boot build runs sequentially per source and in the background; boot
does not wait for it.
- Lease fencing (stop the walk once the lease is lost, bound a build
whose embed call never returns) is objectstack-ai#37465.

## Verification

- `service-knowledge`: 14 test files / 436 tests pass; `tsc --noEmit`
and `check:test-typecheck` pass.
- CLI: the knowledge tests and the vitest tier partition test pass (29
tests). `eslint --no-inline-config` on every changed file passes.
- CLI `tsc --noEmit`: **not measured locally**. This container has no
built `dist/` for the CLI's workspace dependencies (563 TS2307-family
errors, none in a knowledge file); CI owns it.
- Real kernel run: two `LiteKernel`s sharing one `MemoryLock` over a
250-row source. Boot returned in 9 ms without waiting for the build.
Node A: `done`, 250 indexed; node B: `not-run` ("another node holds the
build"); `beginBuild` called once; search found row `r0007`; the state
afterwards read `current`. A non-admin
`runAction('knowledge','rebuild')` was refused ("requires the
'manage_platform_settings' capability"); an admin rebuild then showed
`done` with 250 skipped. The log carried the cost line.
- Derived gates: the local run's gates exit 0 except six that need a
full build or full history (`check:skill-examples`,
`check:dual-build-cjs-loads`, `check:i18n`, `check:i18n-coverage`,
`check:i18n-walk-parity`, `check-plugin-teardown-shape --self-test`;
that script's scan alone exits 0). Those six go to CI.
- Overlap check against objectstack-ai#37102 and objectstack-ai#37004 (both touch
`knowledge-rag.mdx`, objectstack-ai#37102 also `packages/cli`): clean at push time.
The second to land merges main.

<details><summary>Rework round readings, head 1061045</summary>

- `service-knowledge` (dependency closure rebuilt first, `turbo run
build --filter='@objectstack/service-knowledge^...'`, 18/18 tasks):
`pnpm test` 14 files / 448 tests pass; `typecheck` (`tsc --noEmit` and
`check:test-typecheck`, 0 files / 0 errors in the debt ledger) passes.
- CLI: `src/commands/knowledge/knowledge.test.ts` 7/7 pass (unit layer).
CLI `tsc --noEmit` not measured locally, for the reason above; CI's
`TypeScript Type Check` owns it.
- `eslint --no-inline-config` on the seven changed `.ts` files: exit 0.
- Derived gates (`dispatch-gates.mjs --commands`, 122 commands, run on
a753df9 with the changeset edit in the tree): 114 exit 0. Not measured
here, left to CI: six exit 3, PREREQUISITE NOT MET, the same six the
first round named (`check-plugin-teardown-shape --self-test`, whose
positive control is pinned to a commit a shallow clone cannot reach, its
scan exits 0; `spec check:skill-examples`, `check:dual-build-cjs-loads`,
`check:i18n`, `check:i18n-coverage`, `check:i18n-walk-parity`, which
read built output this container does not have); two whole-repo scans,
`check:query-options-erasure` (its self-test passed) and
`check:type-check-debt`, hit the 300 s per-command limit on the shared
box. Re-run on 1061045: the changeset family
(`check-adr-0087-registration`, `check-changeset-no-major`,
`check-empty-changeset`, `check:changeset-fixed`), `check:nul-bytes`,
`check:doc-anchors`, `check:cli-command-ids`,
`check:cli-examples-parity`, all exit 0.
- `overlap-check` before each push: clean against `origin/main`, objectstack-ai#37442,
objectstack-ai#37422 (shares `content/docs/deployment/cli.mdx`) and objectstack-ai#35129. objectstack-ai#37004 has
no PR open yet.

</details>

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01JQwxbXkQAmjg7Hf74xDKA6

<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6Cb4BAjgQ43tqy1DvVJ -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…'^19', the major the 19.x boot handshake accepts (objectstack-ai#37298)

<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgFiXLbrG7d8JVydkmtSf4Bt)_

Fixes objectstack-ai#37460

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 客户项目里的 AI 助手照着技能包写应用配置时,声明的协议大版本从 18 变成 19;技能包的考题也同步改成 19。
- 属于「19.0.0 大版本」这条线:运行时的协议版本升到 19 之后,技能包要教同一个数,否则照抄的配置启动就被拒。
- 若它早于协议升 19 的那个改动上线,照着技能写的新项目会在 18 版运行时上启动被拒;纯文字改动,可以直接撤回。
- 要你做一件事:「进入预发布阶段」和「协议升到 19」两个改动都已合入,请审批这个受管的技能包改动。

## What changes

PR 2 of 2 for the card (seat direction: option A on the shape of the v18
move). This is the `skills/**` half, split off because `skills/**` is a
governed surface. The sibling PR 1 moves `PROTOCOL_VERSION` to `19.0.0`
and every other tracked `'^18'` on branch
`claude/issue-37229-protocol-version-19` (PR objectstack-ai#37314). PR 1 and objectstack-ai#37230
(pre mode plus the pending `@objectstack/spec` major) are both on
`main`, so the landing order this PR waited on is met. It stays draft
because `skills/**` is Tier H.

Four lines in three files, each rewritten in place at equal byte length:

- `skills/objectstack-platform/SKILL.md` L111: the `defineStack`
manifest example declares `engines: { protocol: '^19' }` (was `'^18'`).
- `skills/objectstack-platform/evals/config-plugins-ops.json` L6 and L7:
eval 1's prompt asks for `protocol 19` and its expected output is
`'^19'`, so the eval stays consistent with the skill it scores.
- `skills/objectstack-upgrade/SKILL.md` L89: the sentence that says what
every scaffold and example writes now says `'^19'`.
- `.changeset/37229-skills-protocol-19.md`: `@objectstack/skills` patch.

`git grep -n "protocol: '\^18'" -- skills/` at head `3536f9ac1c` matches
nothing.

**Rework round (head `3536f9ac1c`).** Two commits on top of `c9ad209e`:
a merge of `origin/main` `a46efa8c62` (clean, no conflict, no generated
artifact deferred) and one sentence in the changeset. The changeset's
last sentence used to end "no conversion is registered at step 19, so
the chain an author replays still ends at 18"; with PR 1 on `main` the
chain ends at 19. It now ends: "step 19 carries no conversion and one
semantic entry (`protocol-18-range-refused`)." The entry id was read on
`origin/main` `a46efa8c62` at
`packages/spec/src/migrations/entries/semantic/19.protocol-18-range-refused.ts`,
the only `19.*` file under `entries/`. The changeset file is new in this
PR, so this is not an edit to a landed note. The PR's own hunks in the
three skill files are unchanged from `c9ad209e`. The eval file and the
upgrade skill keep the same blobs.
`skills/objectstack-platform/SKILL.md` changed blob only by main's
merged hunks (objectstack-ai#37409, objectstack-ai#37303).

**Declarations, judged from content.** The diff is skill prose and one
eval fixture. It changes nothing a metadata author can write and nothing
the runtime accepts or refuses; the refusal of `'^18'` is PR 1's. So
`Clause-②: no` and `Metadata-protocol: none`, the same pair the v18
skills move (objectstack-ai#25688) declared, and the changeset is `patch`. No
`Skills-docs:` line is owed for a `none` kind.

## Published-skills readings

Lines, and tokens as ceil(UTF-8 bytes / 4); `origin/main` `a46efa8c62`
to head `3536f9ac1c`.

| File | Before | After |
|---|---|---|
| `skills/objectstack-platform/SKILL.md` | 422 lines · 6154 tokens | 422
· 6154 |
| `skills/objectstack-platform/evals/config-plugins-ops.json` | 399 ·
6067 | 399 · 6067 |
| `skills/objectstack-upgrade/SKILL.md` | 481 · 6175 | 481 · 6175 |
| Whole bundle (sum of every `skills/*/SKILL.md`) | 4961 · 65472 | 4961
· 65472 |

Net for `skills/**`: 0 lines added, 0 removed.
`check-skills-token-ratchet` at head: `61 authored bundle file(s) within
their ceilings; 11 generator-owned file(s) and 42 eval fixture(s)
measured, not ratcheted.`

## Tests

No workspace package source is touched, so no package test is owed. The
marked `defineStack` example in `objectstack-platform/SKILL.md` is
type-checked by `check:skill-examples`: `350 prose examples type-check
across 3 surface(s)`, exit 0, after a full core build (121 of 121 turbo
tasks, lock `VERDICT command-exit 0`).

## Acceptance notes

- **No 18 → 19 step is added to `objectstack-upgrade`.** The skill does
not walk the majors one by one; it teaches one procedure (`os migrate
meta --from N`, then the residue). On `main` `a46efa8c62` step 19
carries no conversion and one semantic entry
(`protocol-18-range-refused`), whose own replacement text names `migrate
meta --from 18`, the procedure the skill already teaches, so no step-19
text is added.
- **Left unchanged on purpose in `objectstack-upgrade/SKILL.md`:**
- L74, `os migrate meta --from 16 --to 18 --json`. It names the last
ported hop, not the current major. The chain now has steps for 17, 18
and 19. Step 19 carries no conversion, so the `--to 18` replay gives the
same result as the default terminus 19 today. The skill's own eval pins
the same replay form.
- L91, the `'^17'` to `--from 17` worked example (it shows taking the
floor of a range).
- L122 ("not in the 18 catalog") and L178 to L183 ("18.3 drops", "on
18.2 or earlier"): statements about 18.x releases, still true.
- **Frontmatter is the version pass's.** `compatibility: Requires
@objectstack/spec 18.x` and `metadata.version: "18.6.0"` in the skill
frontmatter are stamped at release; `check:skill-compatibility` exits 0
at this head.
- **Order risk, now past.** Before PR 1 the skill would have taught
`'^19'` to an 18 runtime. PR 1 is on `main`.
- Noted, not filed (carrier: none): nothing cross-checks a `protocol:`
literal in skill prose against `PROTOCOL_VERSION`; the v18 skills move
noted the same.

## Verification

Two-minute check: `git diff origin/main...HEAD --stat -- skills/` shows
3 files, 4 insertions, 4 deletions; `node
scripts/check-skills-token-ratchet.mjs` exits 0.

Read first (by risk):
1. `skills/objectstack-platform/evals/config-plugins-ops.json` L6 and
L7: prompt and expected output must move together.
2. `skills/objectstack-platform/SKILL.md` L111: the block is
type-checked.
3. `skills/objectstack-upgrade/SKILL.md` L89, and L74 and L91 beside it,
which stay.

<details><summary>Local gates at 3536f9a (rework head): 50 derived
families, 47 exit 0, 3 NOT MEASURED</summary>

`node scripts/pm/dispatch-gates.mjs --ran` at `3536f9ac1c`: `50 derived
famil(ies) accounted for — 47 run, 3 NOT-MEASURED (3 DERIVED from a
recorded exit 3)`. The three answered `PREREQUISITE NOT MET` (exit 3)
because only `@objectstack/spec` was built in this worktree:
`check:doc-formula-expressions`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure`. This narrowing is declared; CI's `Lint &
Repo Gates` runs them and is `success` at this head. Also run, exit 0:
`check:skill-refs` (`10 generated files in sync with packages/spec`),
`check:skill-served-sections` (`24 served section(s), each heading
exactly once in its file`), `check-skills-token-ratchet` (`61 authored
bundle file(s) within their ceilings`), `check-nul-bytes` (OK).
`check:skill-examples` was not re-run at this head (it needs the full
core build); the PR's own hunks are unchanged from the head it passed
on, and CI's `Lint & Repo Gates` runs it at this head.

</details>

<details><summary>Earlier round, local gates at c9ad209 (main with
objectstack-ai#37230 merged in): 56 commands, all exit 0 (50 of 50 derived families
run)</summary>

`node scripts/pm/dispatch-gates.mjs --commands` derived 50 families for
this diff; `--ran`: `50 derived famil(ies) accounted for — 50 run, 0
NOT-MEASURED`. Exit codes were captured before any pipe. All exit 0,
among them `check-adr-0087-registration`, `check-changeset-no-major`,
`check-empty-changeset`, `check-skills-token-ratchet`,
`check:skill-docs`, `check:skill-examples`, `check:skill-refs`,
`check:skill-served-sections`, `check:skill-compatibility`,
`check:skill-frame-freshness`, `check:skill-frame-sync`,
`check:skill-identifier-liveness`, `check:skill-links`,
`check:skill-top-level-keys`, `check:pm-governed-merges`,
`check:test-source-alias`, `overlap-check` (`VERDICT clean exit 0`, also
clean with objectstack-ai#35129). `check:skill-examples` first answered exit 3
(PREREQUISITE NOT MET: `packages/client-react/dist` unbuilt in a fresh
worktree) and exit 0 after the full build.

</details>

## Provenance

Opened by seat repo:objectstack#4 on the maintainer's authorization in
the seat session (「objectstack-ai#37229 的两个 PR 开 PR 时被拦了:放行」). The dev session
(`session_01QSeKYnFjnB9bU95RVja6w5`, zone a4-S)'s own relay `pr_create`
and report comment were refused by its permission check and not retried;
it sent the prepared body and its os-dev report to the seat. The gate
list above is condensed from the dev's full list (all 56 exit 0). Branch
`claude/issue-37229-skills-protocol-19` @ `c9ad209e` at that point.

The card moved from objectstack-ai#37229 (closed when PR 1 merged) to its follow-up
card, and seat repo:objectstack#5 (zone o5-A) took the PR over on the
claim there. The rework round was done by a dev subagent of
`session_01Utp6CZmwqAVSYHM1nQUDTq`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CZmwqAVSYHM1nQUDTq)_

<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CYtTDvfPQDzMbZnN5X -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… package customizations read (objectstack-ai#37568)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuBUGgrNWoBUQKbyS4GaX5vM)_

Fixes objectstack-ai#36828

Clause-②: no (published prose only; names a list the read already
returns on main)
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:AI
助手照平台技能文档回答「我们在已安装的应用包上改了什么」时,现在知道答案里还有一份「整体编排」清单(字段分组、记录页标签页、操作布局),以前文档没提这份清单。
- 为什么做:属于「定制已安装应用包」专题的收尾。产品已经返回这份清单,说明文档也已更新,只有技能文档还停在旧说法。
- 出错会怎样:只改文档文字,不动产品。写错的话助手会漏读或误读这份清单,撤回这次改动即可。为了不让技能文档变长,同一文件里删了四处重复说法。
- 要你做什么:这是受管的技能文件,需要审批人批准后才能合并。

## What changes

`skills/objectstack-platform/SKILL.md`, the sentence that teaches `GET
/packages/hotcrm/customizations` (line 129), plus a `patch` changeset
for `@objectstack/skills`.

Before: "lists its overrides, extensions and switched-off items".

After: "lists its overrides, extensions, switched-off items and
`arrangements` (`{ object, key }` per `fieldGroups`, `relatedLists` or
`actionLayout` its object extension writes; no content, no diff)".

No paragraph is added. The file had 3 bytes of token headroom and the
new words cost 137 bytes, so four restatements in the same file are cut
to pay for them (136 bytes). Each fact keeps another home:

| Cut | Bytes | Where the fact still stands |
|:--|--:|:--|
| "— `createHonoApp({ kernel })` reaches better-auth at
`/api/v1/auth/*`" (HTTP Layer warning) | 71 | the same sentence:
"(`AuthPlugin` default `/api/v1/auth`)" |
| "with `create-objectstack`" in "Bundled with `create-objectstack` — no
network fetch" (The Template) | 25 | the line above: "the only template
`create-objectstack` offers" |
| ", and it is the default" (The Template) | 23 | the same sentence
("the only template") and `references/bootstrap.md` ("blank is the
default, and the only, template") |
| ", after AuthPlugin" on the platform-app plugins row (Runtime Boot
Sequence) | 17 | the list is headed "in this order" and the row sits
directly under `AuthPlugin` |

The ceiling row in the token ratchet is not moved.

## Why

PR objectstack-ai#36818 added the `arrangements` list to this read and corrected the
`content/docs/api/metadata-api.mdx` copy; the skill copy still named
three lists. A tab list, field-group or action-layout arrangement made
in the paired customization package appears only in `arrangements`, so
an agent taught from the skill missed it.

Shape checked against `main` (1af67b2), not the card text:

- `packages/spec/src/api/package-lifecycle.zod.ts`,
`GetPackageCustomizationsResponseSchema.arrangements`: a strict `{
object, key }`, `key` = `z.enum(CUSTOM_ARRANGEMENT_KEYS)`; its describe
says the entry "names it and nothing more: its content is the pair's
`object_extension` item, and nothing is compared with the base".
- `packages/spec/src/data/field-customization.ts`:
`CUSTOM_ARRANGEMENT_KEYS` = `fieldGroups`, `relatedLists`,
`actionLayout`.
- `packages/runtime/src/domains/packages.ts`, the customizations read
producer: `arrangements.push({ object: name, key })` for each key the
pair's extension body writes, sorted by object, then key.
- `content/docs/api/metadata-api.mdx`: "one `{ object, key }` entry per
object and key".

## Tests

Prose only: no behaviour a test pins changes, so no ablation. Skills
checks run on head `e00556f59b`:

<details><summary>Gate readings</summary>

- `node scripts/check-skills-token-ratchet.mjs` :: exit 0.
"skills/objectstack-platform/SKILL.md is 6148 tokens (ceiling 6149;
headroom 1)"; "61 authored bundle file(s) within their ceilings".
- `pnpm check:pm-skill-id-lint`, `check:skill-identifier-liveness`,
`check:skill-links`, `check:skill-top-level-keys`,
`check:skill-compatibility`, `check:skill-frame-sync`,
`check:doc-authoring`, `check:nul-bytes` :: exit 0 each.
- `pnpm --filter @objectstack/spec run check:skill-docs` :: exit 0
("Skill docs in sync"); `check:skill-refs` :: exit 0 ("10 generated
files in sync with packages/spec"), both after `pnpm --filter
@objectstack/spec build`.
- `node scripts/pm/dispatch-gates.mjs --commands` derives 50 commands
for this diff; reconciliation with `--ran`: 48 run with exit 0, 2 NOT
MEASURED (`check:dual-build-cjs-loads`, `check:lean-entry-closure`: they
need a whole-tree build and read no file of this diff; CI runs them).
- `node scripts/pm/overlap-check.mjs` :: "VERDICT clean exit 0".

</details>

Size readings for `skills/**` (lines / bytes, `wc`; tokens in the
ratchet's own convention):

| | Before (1af67b2) | After |
|:--|--:|--:|
| `skills/objectstack-platform/SKILL.md` | 422 lines / 24613 bytes /
6149 tokens | 421 lines / 24611 bytes / 6148 tokens |
| All 14 `skills/*/SKILL.md` together | 4961 lines / 261866 bytes | 4960
lines / 261864 bytes |

## Acceptance notes

- The four cuts sit outside the sentence the card names. They are the
only way to keep the token ratchet green without moving its ceiling;
each is listed above with the place its fact still stands.
- Open PRs objectstack-ai#37442, objectstack-ai#37422 and objectstack-ai#35129 also change
`skills/objectstack-platform/SKILL.md`. All three text-merge cleanly
with this branch, but the file is left with 1 token of headroom, so
whichever lands second re-measures against the ratchet.
- The skill sentence does not name `counts.arrangements`; the card asks
for the list only.

## Verification

Read first, by risk:

1. `skills/objectstack-platform/SKILL.md` line 129: the new clause.
2. The same file, HTTP Layer warning: the cut after "not `prefix`".
3. The same file, The Template and the boot-sequence row: the three
small cuts.

Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints
"skills/objectstack-platform/SKILL.md is 6148 tokens (ceiling 6149;
headroom 1)" and exits 0; `git grep -n "arrangements" --
skills/objectstack-platform/SKILL.md` prints one hit on line 129.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` is CI's run.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: not touched.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgWAbKPqt7vTgX5qgUn

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… regions, parse prerelease versions in the MCP save test, key the objectui pin claim on the spec major (objectstack-ai#37557)

Fixes objectstack-ai#37549

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户无感:发版流程里,版本号升到 19 之后,有三处会红,这里一起修掉:迁移登记表的生成不会再拒收第 19 版的下线条目;MCP
保存草稿的一条测试不再把预发布版本号(19.0.0-next.0)读坏;界面仓的版本说法检查不再写死 18。"版本发布"那个 PR
的核心测试和界面测试可以变绿。
- 为什么做:给发第一个 19 预发布版(next 渠道)清掉阻断。版本 PR 的必过检查一直是红的,现在没法合并。
- 出错会怎样:只给模板加了两个空区段,另外改了三份测试;不改任何已发布行为。出问题直接撤回这个 PR 即可。
- 要你做什么:无。

## What changes

- `packages/spec/src/migrations/registry.ts.template`: opens an empty
`retired-key:19` region in `RETIRED_KEYS_BY_MAJOR` and an empty
`retired-def:19` region in `RETIRED_DEFS_BY_MAJOR`, each placed and
shaped like its major-18 sibling. `semantic:19` and `step19` already
existed, so the migration-step side needed nothing.
- `retired-def:19` goes beyond the card's wording, as an in-place fix of
the same defect class. `build-schemas.ts` prescribes new retired-def
entry files under the same `CURRENT_MAJOR` (`renderNewEntryFiles`, used
for both kinds). So the first whole-def removal on the 19 tree would
have hit the same generator refusal. Same file, same gate family, same
mechanical fix.
- `scripts/build-migration-registry.ts` needs no change. Its lines
~422–441 are `--self-test` fixtures, not a region list: the generator
discovers regions from the template's markers.
- Pin (`packages/spec/scripts/build-migration-registry-entry.test.ts`,
new `describe`): every kind in `KINDS` has an open and close marker in
the template for each of two majors, the spec package's major (what
`build-schemas.ts` registers new entries under) and `PROTOCOL_MAJOR`. On
`main` today these are 18 and 19, so the pin reds on `main` before the
fix and names the missing region and the major.
- Why `PROTOCOL_MAJOR` and not "spec major + 1": the protocol major
moves first, on `main` (it reads 19 while the package is still 18.6.0).
It is the leading signal for the next major.
- "spec major + 1" would also red the Version PR tree itself (19 + 1 =
20), unless a major-20 region were opened now.
- Item 2 (seat-amended scope, card objectstack-ai#37549):
`packages/runtime/src/domains/mcp-authoring.test.ts`. The `[objectstack-ai#34774]`
describe parsed `SERVER` with `split('.')`, so on the Version PR tree
(`19.0.0-next.0`) the patch field was `0-next` and the built version was
`19.0.NaN`, which the door refuses as not SemVer. It now parses with
`SEMVER_2_0_0_VERSION_PATTERN` from `@objectstack/spec/kernel`, the
grammar the door itself judges with, and drops the prerelease from the
versions it builds. A new case declares the server's own version
verbatim and `${major}.${minor}.0-next.0`, and asserts both save
byte-identically to no declaration. Test-only; `@objectstack/runtime`
ships `dist` alone, so no runtime changeset is owed.
- Item 3 (seat-amended scope):
`ui/scripts/__tests__/doc-version-claims.test.ts`. The
`skills/objectui/SKILL.md` KNOWN_CLAIMS row was the literal
`@objectstack/spec 18.x`. It is now keyed on `SPEC_MAJOR`, read from
`packages/spec/package.json` under `workspaceRoot()`. The literal in the
skill can't go, because the root `check-skill-compatibility-version.mjs`
requires the pin and rewrites it with the version step. So `skills/**`
is not touched, and the PR stays off Tier H.
- Changeset `.changeset/37549-retired-key-19-region.md` (patch; the
template renders into the shipped `registry.ts`).

## Tests

<details><summary>Pin reds on the pre-fix template (origin/main 1af67b2
template restored, then put back)</summary>

```
× opens and closes `retired-key:19`
× opens and closes `retired-def:19`
AssertionError: src/migrations/registry.ts.template has no `os-generated retired-key:19` region, but major 19 is current (spec package 18.6.0, PROTOCOL_VERSION major 19); an entry registered there is refused by gen:migration-registry. ...
Tests  2 failed | 8 passed (10)
os-verify-lock: VERDICT command-exit 1
```
</details>

<details><summary>Version tree: spec temporarily at 19.0.0-next.0 (not
committed)</summary>

`pnpm gen:migration-registry && pnpm exec vitest run --maxWorkers=2
scripts/build-migration-registry-entry.test.ts
scripts/build-schemas-check-mode.retired-keys.test.ts` (both projects),
with `packages/spec/package.json` version set to `19.0.0-next.0`. The
run includes "the printed route registers: write exactly the files check
(b) names, run the generator, and (b) is silent", the case that fails on
objectstack-ai#35129.

```
Test Files  2 passed (2)
     Tests  20 passed (20)
os-verify-lock: VERDICT command-exit 0
```

The version was restored to `18.6.0` afterwards; `git status` was clean
apart from the intended diff.
</details>

<details><summary>18.6.0 tree: same two files</summary>

```
Test Files  2 passed (2)
     Tests  23 passed (23)
os-verify-lock: VERDICT command-exit 0
```
</details>

<details><summary>Items 2 and 3 on the Version tree (spec at
19.0.0-next.0 and the objectui skill pin at 19.x, both temporary,
restored after)</summary>

```
runtime mcp-authoring.test.ts      Tests 57 passed (57)
ui doc-version-claims.test.ts      Tests 29 passed (29)
```

Ablation on the same tree with the origin/main 1af67b2 versions of the
two tests: runtime `1 failed | 55 passed` (the `SemVer form (e.g.
18.6.0)` case), ui 2 failed (`skills/objectui/SKILL.md ::
@objectstack/spec 18.x`), matching objectstack-ai#35129's CI failures. On the 18.6.0
tree: runtime 57/57, ui 29/29. `ui` `scripts/` suite at the final head:
`172 passed | 2 skipped` files, `5130 passed` tests.
</details>

<details><summary>Spec package, local project, at 2fd0411: `pnpm
--filter @objectstack/spec test` and `pnpm typecheck`</summary>

```
Test Files  899 passed (899)
     Tests  28505 passed | 1 todo (28506)
os-verify-lock: VERDICT command-exit 0
typecheck (tsc + check:scripts-typecheck + check:test-typecheck): VERDICT command-exit 0
```

`test:repo` (the vitest `repo` project) belongs to CI's Test Core. Only
its one touched-path file,
`build-schemas-check-mode.retired-keys.test.ts`, was run locally
(above).
</details>

## Acceptance notes

- In-flight spec PRs objectstack-ai#37366, objectstack-ai#37371 and objectstack-ai#37422: `node
scripts/pm/overlap-check.mjs --pr=37366,37371,37422` gives `VERDICT
clean exit 0`. Their migration changes are major-18 semantic entry files
only, and none touches the template.
- L2: the template is the generator's skeleton for a gitignored
generated file. The two regions are empty, so no exported value or key
changes shape: `RETIRED_KEYS_BY_MAJOR[19]` / `RETIRED_DEFS_BY_MAJOR[19]`
become empty arrays.

Body amended by the seat (repo:objectstack#2 · os-sales ·
session_01L6bhgV6i8jfWwSXjpWJrjA) to cover the three items the card's
scope grew to; the dev report on objectstack-ai#37549 (7194227076) carries the full
evidence.

## Verification

Two-minute check: `pnpm --filter @objectstack/spec exec vitest run
--project local --maxWorkers=2
scripts/build-migration-registry-entry.test.ts`, expected to show `Tests
10 passed (10)`. Then set the spec version to `19.0.0-next.0` and run
`scripts/build-schemas-check-mode.retired-keys.test.ts`, which should
also be green.

Read first: (1) the two new template regions; (2) the pin's choice of
majors (spec package major and `PROTOCOL_MAJOR`).

Local gate subset at 2fd0411: derived by `node
scripts/pm/dispatch-gates.mjs --commands`. Verdicts are in the dev
report on the card. `check:doc-formula-expressions` is NOT MEASURED
locally (PREREQUISITE NOT MET: `@objectstack/formula` and
`@objectstack/lint` are not built in this worktree); CI runs it. The
full farm belongs to CI.

---

_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgV6i8jfWwSXjpWJrjA)_

<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgV6i8jfWwSXjpWJrjA -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… not a refusal (objectstack-ai#37550)

Fixes objectstack-ai#37463

Clause-②: no
Metadata-protocol: none

## 维护者速读
- 用户能看到什么变化:AI
用资料包读一条记录时,如果关联对象那一步因为故障(比如数据库抖动)读不出来,现在回答「内部错误」,不再谎称「无权访问」;对有权限的拒绝、以及「数据源暂不可用」这类本来就有明确说法的故障,照旧原样回答。用户无感于正常路径。
- 为什么做:属于「记录级 AI 问答」专题,替核对 AI
回答引用的一方解决分不清「没权限」和「出故障」的问题,故障时引用会被如实上报而不是悄悄丢掉。
-
出错会怎样:最坏情况是某次故障被报成「内部错误」,调用方可以重试,运维在服务器日志里每次都能看到故障原因;回答里不会多说出任何对象、字段或包的名字,改动可直接撤回。
- 要你做的:无。

## What changes

`get_record_context` (`packages/services/service-record-context`) reads
each related object of a pack before it answers. At four of those reads,
a throw that was **not** a refusal (an outage, a bug) was misanswered.
At three of them it came back as `PERMISSION_DENIED` 403, so the
citation verifier (`verifyRecordCitations`) read it as a refusal and
dropped every citation without a report:

| Site | Before (a failure) | After |
|---|---|---|
| step 4a, `assertApiExposed` failure that is not a coded refusal | 403
unnamed | 500 `INTERNAL_ERROR` |
| step 4a, `servedObjectDefinitionOf(child)` throwing | 403 unnamed |
500 `INTERNAL_ERROR` |
| `publishedOf`, published-definition read throwing | 403 unnamed | 500
`INTERNAL_ERROR` |
| the child list query, an uncoded throw (the `/data` door answers it
`500 Internal server error` and nothing else) | the raw error, which the
doors answered 500 `INTERNAL_ERROR` | 500 `INTERNAL_ERROR`, the original
at the foot of the stack |
| the child list query, a fault the door codes
(`ERR_DATASOURCE_UNAVAILABLE` 503, `DATABASE_ERROR`, `NOT_IMPLEMENTED`
501, a declared 5xx with its sentence) | the raw error, answered with
the door's own code and sentence | unchanged: rethrown untouched |

- **One helper, one line.** `refusedOrFailed` decides refusal vs failure
at all four sites. At the three object-level sites it asks
`isCodedRefusal` (in `record-context-tools.ts`, not on the package
entry): the ADR-0112 line, a non-empty string `code` plus a declared 4xx
status (`.status`, then `.statusCode`). The verifier imports the same
function in place of its private copy. At the child list query it asks
`doorAnswersItself`, which reads the `/data` door's own classifier,
`mapDataError` from `@objectstack/types` (new as a dependency of this
package). Before this change the doors classified that read's throw
themselves, so the executor asks them rather than keeping a second
reader (seat ruling, REWORK 7193191377 S2). The door answers a throw
itself unless its answer is the anonymous fault: status 500, `Internal
server error`, coded `INTERNAL_ERROR` or not coded, and nothing else
(REWORK 7195238190 S3).
- **A refusal answers as before.** At the object-level sites a coded
refusal stays `PERMISSION_DENIED` 403 within the naming bound; a
disabled package's `OBJECT_PACKAGE_DISABLED` (404, coded) is such a
refusal. At the child list query, a throw the door answers itself is
rethrown untouched, exactly as on `main`, with its own code and
sentence. A sandboxed `beforeFind` hook's plain throw stays `400
HOOK_ABORTED` in the hook's words, and a `PERMISSION_DENIED` with no
status stays the door's `PERMISSION_DENIED`. A fault the door codes
stays the door's answer too: an unavailable datasource stays
`ERR_DATASOURCE_UNAVAILABLE` 503 with its sentence (the caller keeps the
retry signal), a driver error the door recognises stays
`DATABASE_ERROR`, a driver's declared `NOT_IMPLEMENTED` stays 501, and a
declared 5xx keeps its code and the sentence or `userMessage` its
producer declared. `INTERNAL_ERROR` 500 applies there to an uncoded
failure only.
- **What an uncoded failure answers, and what it logs.** The code is
`INTERNAL_ERROR` 500, not `SERVICE_UNAVAILABLE` 503. With a 5xx,
`SERVICE_UNAVAILABLE` is on `CAPABILITY_ABSENCE_CODES`
(`packages/types/src/server-fault-log.ts`), and the doors' fault line
logs that code once per route per process, at `warn`, without the error
(record 7193179486, M1). With `INTERNAL_ERROR`, each door logs the
failure at `error` on every call. The fault line prints an error's
message and stack and never its `cause` (both the console sink and
`ObjectLogger`), so the failure's stack ends in `Caused by:` plus the
original's stack. The original is also on `cause` for an in-process
host; the verifier hands it to `onError`. A stack never reaches the
wire.
- **What an MCP caller sees for an uncoded failure (S1).** On either
door the caller gets `{ code: 'INTERNAL_ERROR', status: 500 }` with the
message `Internal server error`. The doors withhold a 5xx's own
sentence, so the executor's `readFailed` sentence (en and zh-Hans; it
names the pack and the root only) is read in-process only. Measured on
`mapDataError`: the answer is `500 INTERNAL_ERROR` `Internal server
error` whatever `cause` holds. Tried with no cause, a plain error, a
SQLite and a Postgres unique violation, `SQLITE_BUSY`, and a coded 403.
- `verify-citations.ts`: the docblock paragraph that this change made
false is rewritten (claim amendment 7192997436).

### ADR-0160 (card item 3)

No ADR-0160 sentence fixes 403 for a failed read. The two sentences
closest are about refusals only:

> Every such refusal carries one code — `PERMISSION_DENIED`, the code
objectstack-ai#35145 uses — so the code does not tell a hidden object from a refused
one. (D4, "The naming bound")

> An object-level refusal names the refused object only when the
caller's served schema shows it, and every such refusal carries one
code. (point 12)

D3 "Object level" covers refusals by gates and says nothing on reads
that fail. So no ADR text has to change for this PR; whether to add a
sentence on failures stays with objectstack-ai#37490.

## Tests

- `record-context-tools.test.ts` has a new `describe`, "a read of a
related object that fails is a failure, not a refusal". It has one
uncoded-throw case per site: 500, the exact `readFailed` sentence, none
of the outage's names, the original on `cause`, and `Caused by:` plus
the original's stack in the failure's stack. It has a refusal control
per object-level site (`OBJECT_PACKAGE_DISABLED` 404 stays
`PERMISSION_DENIED` 403, unnamed) and for the child query (a coded
refusal is rethrown unchanged). For S2: a sandboxed hook's plain throw
(`innerMessage`) and a status-less `PERMISSION_DENIED` at the child
query are rethrown untouched, while the same throws at an object-level
read fail the call. A sandboxed body that crashed (a native error name)
is a fault at the door, so it fails the call. At an object-level read, a
driver errno with no status, a coded 5xx, a status with no code, and a
thrown string are failures too. For S3, at the child query: an
unavailable datasource (503), a driver error the door answers
`DATABASE_ERROR`, a declared `NOT_IMPLEMENTED` 501, and a declared 5xx
with its sentence or a `userMessage` are rethrown as the same object;
each case first asserts the door's own answer for it (`mapDataError`).
The controls there (a status-less 500, a coded `INTERNAL_ERROR` 500, an
errno the door does not recognise, a thrown string), which the door
answers with nothing of its own, fail the call. The sentence follows the
caller's locale.
- `verify-citations.test.ts`: an uncoded throw at the child's
served-definition read drops the citation and is reported once through
`onError` (500, cause is the outage). A coded refusal there drops it and
reports nothing. A control verifies the same citation.
- `packages/runtime/src/mcp-record-context-tools-bridge.test.ts` is the
real-kernel harness, run on both doors. Outage: the related-list read of
`rc_revision` throws an uncoded error in `engine.find`. Asked twice,
there are four `[5xx] 500` error lines (two doors times two calls), each
carrying `INTERNAL_ERROR` and `Caused by: Error: OUTAGE_TEXT` (the
thrown outage) in its stack, and no capability-absence warning. Both
doors answer the same bytes, `INTERNAL_ERROR` 500, with no object name
and no outage text. S2, at the same read: a sandboxed hook's plain throw
answers `HOOK_ABORTED` 400 in the hook's words, and a status-less
`PERMISSION_DENIED` answers `PERMISSION_DENIED` and never a 5xx. S3, at
the same read: an `ERR_DATASOURCE_UNAVAILABLE` throw answers
`ERR_DATASOURCE_UNAVAILABLE` 503 with its sentence on both doors, each
door logs one `[5xx] 503` line, and no line carries `INTERNAL_ERROR`.
Each case has a control that reads once the spy is removed.

## Acceptance notes

- A refusal the door answers at the child list query is rethrown as on
`main`, so the citation verifier still reports a status-less one
(`PERMISSION_DENIED` with no status, or a hook abort with no code)
through `onError`, as it did on `main`. The verifier's rule (a string
`code` plus a declared 4xx) is unchanged.
- The naming-probe read inside the step 4a exposure catch
(`servedObjectDefinitionOf(...).catch(() => null)`) still treats a throw
as "not shown". The refusal is a real one, so a throw there only leaves
out the object's name.
- Every uncoded failure is `INTERNAL_ERROR` 500, a bug included (N2 is
accepted by the seat).
- The child query's predicate asks the classifier with the child's name,
where the door asks with the root's; only the classifier's
name-dependent 404 arm reads it (N3, accepted by the seat).

## Verification

Read first, by risk:
1. `record-context-tools.ts`: `refusedOrFailed`, the four `catch` sites
that call it, and `doorAnswersItself`, the child list query's predicate.
2. `record-context-tools.ts` `isCodedRefusal`, and `verify-citations.ts`
importing it.
3. `packages/services/service-record-context/package.json` and
`pnpm-lock.yaml`: one workspace dependency, `@objectstack/types`.

Two-minute check: `pnpm --filter @objectstack/service-record-context
exec vitest run --maxWorkers=2
src/__tests__/record-context-tools.test.ts`. Expect the new `describe`
to pass, every case.

Readings at head `007615908a` (this container, shared box):

<details><summary>Package suites, ablations, local gates, CI</summary>

- `pnpm --filter @objectstack/service-record-context test` +
`typecheck`: Test Files 4 passed (4), Tests 174 passed (174); tsc clean;
check:test-typecheck OK. `pnpm --filter @objectstack/runtime test`
(whole suite): Test Files 649 passed (649), Tests 12065 passed, 25
skipped. Lock VERDICT command-exit 0.
- Ablation S3, via `scripts/ablation-replace.mjs`: the child list
query's predicate reverted to the round-2 line, "the door answers below
500" (blob 756d303 to cb3d0801619c), rebuilt, marker present in
dist (preflight exit 0). Service 5 failed / 145 passed (the five
coded-fault cases), harness 1 failed / 27 passed (the
`ERR_DATASOURCE_UNAVAILABLE` case: the answer was `INTERNAL_ERROR`).
Restore leg: blob back to 756d303, equal to HEAD; `git diff HEAD`
empty; rebuilt; marker absent (preflight `--absent` exit 0); 150/150 and
28/28 pass.
- The round-2 ablations (M1, S2) were run at `bd03a37ed8` and not rerun
at this head; this commit changes only the child query's predicate.
There, M1 failed the harness at the fault-line pin and S2 failed all
four S2 cases.
- `dispatch-gates --ran`: 83 derived, 82 run with exit 0, 1 NOT
MEASURED: `check:dual-build-cjs-loads`, exit 3, PREREQUISITE NOT MET (it
needs every package's dist). The derivation warned the tree is 23
commits behind `origin/main` with 7 gate files changed there; CI runs
the current gates.
- Overlap check: VERDICT clean (`origin/main`, objectstack-ai#37442 on
`pnpm-lock.yaml`, objectstack-ai#35129 on `package.json`).
- CI on `007615908a`: 69 check-runs, 60 success, 9 skipped, 0 failure.
Every required context is green, the UI ones and Check Changeset
included.

</details>

---

_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc)_
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CbeF2saT6wUBV4E9uc -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…from PROTOCOL_MAJOR, as os init does (objectstack-ai#37650)

Fixes objectstack-ai#37586

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户无感:新建项目模板里写的协议版本,改为由发版流程直接取运行时的协议常量来写(另一个建项目命令早就这样做);主干上模板今天已经是
19,发布出去的模板不变。
- 属于协议 19 升级的收尾:替以后每次升大版本的模板和镜像改动解决“模板写的版本和运行时不一致、新建项目启动不了”这一反复出现的问题。
- 如果读不到协议常量,发版流程的模板盖章步骤会直接报错停下,不会写入错误版本;这次改动可以直接撤回。
- 无

## Premise, restated after the version pass

The card was filed while `main`'s blank template carried
`engines.protocol: '^18'` (the scaffolder's package major) and the
runtime implemented protocol 19, so a project scaffolded from `main` was
refused at boot. That visible symptom was cleared by the version pass in
objectstack-ai#35129 (merged 16:25Z): every package moved to `19.0.0-next.0` and the
stamper wrote `'^19'`, still from the package major. This PR changes
where the stamp comes from. The next time the protocol major moves ahead
of the package major (Changesets pre mode, ruling record 6049734955),
the template follows the constant in the same change, and the version
pass no longer has to catch it up. After merging `origin/main` the
template line is a no-op in this diff.

## What changes

- `scripts/sync-template-versions.mjs` stamps `engines.protocol` from
`PROTOCOL_MAJOR`, the export of
`packages/spec/src/kernel/protocol-version.ts` that `os init` stamps
from (`packages/cli/src/commands/init.ts` imports it from
`@objectstack/spec/kernel`). It never uses the scaffolder's package
major. New exports: `PROTOCOL_SOURCE` and `loadProtocolMajor()`. If the
constant cannot be read, the run exits 1, names the path and writes
nothing. It does not fall back to the package major. The
`@objectstack/*` dependencies still take the scaffolder's exact version.
- **How the constant is read, and what it costs.** The stamper evaluates
the source module: Node's `module.stripTypeScriptTypes`, then an
`import()` of the result. The export is evaluated, not re-parsed with a
regex. It does not import the built `@objectstack/spec/kernel`, for two
reasons:
- The `version-pr` lane runs `pnpm install` and never builds, so no
`dist/` exists there. Adding a build would be a `release.yml` edit,
which the card rules out.
- The root `version` script runs `sync-protocol-version.mjs` first, and
that script may rewrite the source constant. A `dist/` would answer for
the tree before that rewrite.
  
  Costs:
- On Node 22, `stripTypeScriptTypes` prints an `ExperimentalWarning` to
stderr on every run.
- The script needs Node 22.13 or later. `.nvmrc` pins 22, and an older
Node gets a named error, not a link failure.
- `protocol-version.ts` must keep no imports of its own. A relative
import there would fail loudly in this read.
- `--self-test`: new battery Control K (floor 7, roster floor 10 to 11).
With the scaffolder at `42.6.0` and the constant at `43.0.0`, a template
at `'^43'` is judged clean and left unwritten, and a template at `'^42'`
is rewritten to `'^43'`. A checkout without the constant exits 1 naming
it, and the stale template is left untouched. Every fixture checkout now
carries its own `protocol-version.ts`, TypeScript-shaped with
`PROTOCOL_MAJOR` derived from `PROTOCOL_VERSION`.
- `template-consistency.test.ts` holds each template's range to
`PROTOCOL_MAJOR` from `@objectstack/spec/kernel` (vitest aliases it to
source), not to `create-objectstack`'s own major.
- `template-version-stamps.test.ts` (surface widened by claim amendment
7197818926): fixture setup only. The fixtures write a
`protocol-version.ts` at the fixture's major. No assertion or
expectation changed.
- The docblock sentence in `protocol-version.ts` now says the template
is stamped from the constant.
- No changeset, `skip-changeset`. The published template is
byte-identical to `main`'s (`'^19'`, from objectstack-ai#35129). Every other path is a
repo script, tests or a TSDoc comment.

## Tests

- `node scripts/sync-template-versions.mjs --self-test` passes with 51
assertions (Control K: 7).
- `pnpm --filter create-objectstack typecheck` passes, and `pnpm
--filter create-objectstack test` passes: Test Files 26/26, Tests
396/396, at `f837e08af9`.
- **Ablation**, `src/template-consistency.test.ts`. Each on-disk
mutation was restored with `git checkout HEAD`.
- Template set to `'^18'`: 1 failed, 40 passed (`blank stamps
engines.protocol '^18' but the runtime implements protocol 19`).
- `PROTOCOL_VERSION` set to `'20.0.0'`, template `'^19'`: 1 failed, 40
passed (`… implements protocol 20`). The test reads the source, not a
stale `dist/`.
  - Unmutated: 41/41.

## Acceptance notes

- **Version-pass rehearsal stays green.** The `version-pr` Render and
Validate steps were taken verbatim from `release.yml` and run in
throwaway clones (`release-rehearsal-clone.mjs --prepare`).
- Before objectstack-ai#35129 merged, on 54d6726: the control (main) and the full
change both passed 15/15 content gates. Both stamped `'^19'`, at
`19.0.0-next.0`.
- The in-surface change without the `template-version-stamps.test.ts`
fixture lines failed 14/15, on `create-objectstack test` (2 cases,
ENOENT on the fixture's constant). That reading is why the surface was
widened.
- On the final head `f837e08af9`: 11 pending changesets, 290 paths
moved, 15/15 content gates green, 0 unvalidated, `VALIDATE_EXIT=0`.
- **Published template range: no change.** The package major and the
protocol major are both 19 on the current line.
- **Boot of a project scaffolded from this branch: NOT MEASURED.** After
the merge of `origin/main`, this diff leaves the template bytes
identical to `main`'s, so a scaffold from this branch is the scaffold
from `main`. The `'^19'` boot was measured on objectstack-ai#37441 (build ok, test
3/3, `/ready` 200).
- The rehearsal printed two `::warning::` lines (annotate-shipped and
changeset-changelog: `cannot simplify commit`). Both come from the
container's shallow-origin object store, and both appear on the control
leg too.

## Verification

Read first:
1. `scripts/sync-template-versions.mjs`: `loadProtocolMajor()` and
`main()`. This is the risk hunk: the release lane's only read of the
constant.
2. `packages/create-objectstack/src/template-consistency.test.ts`: the
`engines.protocol` case.
3. `scripts/sync-template-versions.mjs`: self-test Control K.

Two-minute check: `node scripts/sync-template-versions.mjs` on this
branch prints `already stamps engines.protocol '^19'` and ends with
`engines.protocol at '^19' (PROTOCOL_MAJOR,
packages/spec/src/kernel/protocol-version.ts)`, plus one
`ExperimentalWarning` line on stderr. Then set `PROTOCOL_VERSION` to
`'20.0.0'` and run it again: the template moves to `'^20'` while
`create-objectstack` stays `19.0.0-next.0`. Revert both edits
afterwards.

<details>
<summary>Local gates at f837e08 (dispatch-gates derivation, 101
families)</summary>

- 97 families exit 0. They include `check:template-version-sync`,
`check:changeset-no-major`, `check:adr-0087-registration`,
`check:spec-docblock-symbol-anchors`, `check:test-source-alias`,
`check:cross-package-test-inputs`, `check:published-files`,
`check:nul-bytes`, and `check:pm-dispatch-gates` (fast tier).
- 4 exit 3, PREREQUISITE NOT MET, so NOT MEASURED; CI judges them:
  - `check-plugin-teardown-shape.mjs --self-test`: shallow clone.
- `check:doc-formula-expressions`: `@objectstack/formula` is not built.
- `check:dual-build-cjs-loads` and `check:lean-entry-closure`: unbuilt
`dist/`.
- `dispatch-gates --ran`: "101 derived famil(ies) accounted for — 97
run, 4 NOT-MEASURED", exit 0.
- `overlap-check.mjs` before the push: VERDICT clean, exit 0.

</details>

---

_Generated by [Claude
Code](https://claude.ai/code/session_016WV4cyyekQEqLjtrCLLAeV)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ate's region pin (objectstack-ai#38119)

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoQcXadSnPCNF2ff1apTGQy2)_

Fixes objectstack-ai#37587
repo:objectstack#3 · os-tesla · session_01L9qibxRSo4RBpRknKqBLmy

Clause-②: no
Metadata-protocol: none

## 维护者速读
- 用户无感:发版流程里"版本 PR 打开前的校验"多跑一个只要 2
秒的测试。它检查迁移登记模板有没有给当前大版本开好区段;下一次跨大版本时,如果漏开了区段,同一次运行里就会直接报出来,不会等到版本 PR
上再红。
- 为什么做:卡 objectstack-ai#37587 的最后一项。19 预发布那次,版本 PR 就是被这类缺口挡住的(objectstack-ai#37549)。卡上另外两项:ui 测试已由
objectstack-ai#38089 合入,mcp-authoring 文案已由 objectstack-ai#37821 修好。
- 出错会怎样:只在 release.yml 的校验步骤里加了一行检查和一段注释,不碰发布、打 tag 或部署那几步;这个 job
只在定时和手动触发时跑。如果这条检查误报,版本 PR 只是暂时不刷新,撤回这一行就恢复。
- 要你做什么:这个文件按路径属于 Tier H,需要你(GOVERNED_APPROVERS)批准后,由 3 号座位落地。

## What changes
- `.github/workflows/release.yml`, job "Version PR maintenance", step
"Validate the post-version tree":
- One new content gate after the `protocol-version.test.ts` line:
`run_gate pnpm --filter @objectstack/spec --fail-if-no-match exec vitest
run --project local scripts/build-migration-registry-entry.test.ts`.
That file holds the registry template's region pin (from objectstack-ai#37557). It
checks that every migration kind has an `os-generated` region for the
spec package's major and for `PROTOCOL_MAJOR`, the majors a new entry
registers under.
- The header's "WHAT IS CHECKED" list gains the entry. It says why the
gate runs here: the version pass moves the spec major, so on a boundary
train this is the first tree where the new major is the package's own.
It also says what the gate adds next to the existing refusal of a moved
`protocol-version.ts`: the same run names a missing region, rather than
the run after the refusal is resolved. And it says why the other three
files that reddened the 19 Version PR are not added (readings below).
- No other step, job, permission or trigger changes. Nothing publishes;
no changeset.

## Tests
<details><summary>Readings at dc29936 (5746ba60 measured on origin/main
6e06729, then cherry-picked onto 447757d, the merge of
objectstack-ai#38089)</summary>

- Premise at 815e882 and 6e06729: the step ran one spec test file,
`src/kernel/protocol-version.test.ts` (l.825).
- The new gate's command on this tree (spec `19.0.0-next.1`,
`PROTOCOL_VERSION` 19), after install and with no build, which is this
job's state: `Tests 7 passed (7)`, 2.2 s.
- Ablation: with the `retired-key:19` region deleted from
`registry.ts.template`, the same command exits 1: `× opens and closes
'retired-key:19'`, "src/migrations/registry.ts.template has no
`<os-generated retired-key:19>` region, but major 19 is current (spec
package 19.0.0-next.1, PROTOCOL_VERSION major 19)…", `Tests 1 failed | 6
passed (7)`. Restored with `git checkout HEAD -- <file>`; `git status
--porcelain` empty.
- Measured and left out:
- `scripts/build-schemas-check-mode.retired-keys.test.ts` (repo
project): `13 passed`, 132 s. Its failure on objectstack-ai#35129 is the missing
region itself, which the pin judges structurally.
- `packages/runtime/src/domains/mcp-authoring.test.ts`: does not start
without a build (`Failed to resolve entry for package
"@objectstack/objectql"`).
- `ui/scripts/__tests__/doc-version-claims.test.ts`: 2.0 s. Its
version-step input is the objectui skill's `compatibility:` pin, which
`check:skill-compatibility` already judges in this step.
- The workflow still parses as YAML (`yaml.safe_load`).
- At dc29936 the new gate's command reads `Tests  7 passed (7)` again.
</details>

<details><summary>Gates</summary>

- `dispatch-gates --ran` on `.github/workflows/release.yml`: 40 derived,
40 run, every one `exit 0`, 0 NOT-MEASURED (a derived zero), 0 unrun.
</details>

<details><summary>Affected step, before and after (advisory)</summary>

- Before: "Validate the post-version tree" on the last four scheduled
runs and one dispatch took 33 s, 27 s, 33 s, 27 s and 33 s (median 33
s).
- After: one more file at 2.2 s measured locally, so about +2 to 3 s.
Nothing else in the job moves.
</details>

## Acceptance notes
- Tier H by path (`check-governed-merges.mjs`, the `release.yml` row of
the workflows split). It lands only after an authorized approval, then
by the owning seat.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibxRSo4RBpRknKqBLmy)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/xl tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant