Skip to content

chore(approvals): merge main into the approvals trunk again (#38497 refresh 2) - #38797

Merged
os-zhuang merged 181 commits into
claude/o5-data-approvals-trunkfrom
claude/project-thread-nmutvp
Nov 30, 2026
Merged

os-zhuang merged 181 commits into
claude/o5-data-approvals-trunkfrom
claude/project-thread-nmutvp

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Part of #37767

Clause-②: yes (narrowing)
Metadata-protocol: added

The second refresh of the approvals trunk with main, so the trunk → main PR #38497 merges clean (claim amendment 6). Base: the trunk claude/o5-data-approvals-trunk at fe50943d10, which took #38791 as a squash. The declarations above are the trunk's; the merge adds none.

Commits:

维护者速读

Resolutions

  • packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts (text conflict): both sides' comments kept; translated 872 + 3 (fieldTabs, main) + 1 (closedStates, the trunk) = 876.
  • packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts (merged without a conflict, wrong): each side moved object 54 → 55 with a different key, and git kept 55. Corrected to 53 → 54 (closedStates) → 55 (pinOverview) → 56 (fieldTabs), both comments kept.

Regenerated (not hand-edited)

packages/spec/liveness/state-counts/object.md, packages/spec/authorable-surface/data.json (now closedStates, pinOverview and fieldTabs together), packages/spec/docs/references/api/metadata.md, packages/spec/docs/references/system/migration.md, packages/spec/docs/references/system/migration.part-2.md, content/docs/references/data/object.mdx.

Measured, on tree 85aea4d1c2

  • No side lost: every file that differs from main at fc198b2847 is one the trunk touched since the merge base c610020e2f, and every file 134a682262 changes against ba57382ea6 is one main touched since 59faf74c6f.
  • scripts/pm/dispatch-gates.mjs against main: 147 derived, 147 run, 0 NOT-MEASURED, all exit 0.
  • Tests and typecheck green: objectql, metadata-protocol, platform-objects, plugin-approvals, core, service-automation, spec, runtime; cli tests green; dogfood 500 files / 4295 tests passed.

Out of scope

main has moved past fc198b2847.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmPpwJymVUdp5AnRPBq

objectstack-fleet Bot and others added 30 commits November 28, 2026 23:32
…d — ADR text (D10) and the registration gate (#38365)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_

Fixes #38328
Fixes #37447

Claims: #38328 (7240075259) and #37447 (re-posted 7242295202, naming
this branch).
Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:用户无感。「元数据协议升级契约」这份架构决定记录新增第八种申报类别(已发布类型上的成员留着、但声明的类型改了),登记检查同一笔学会核验它。
- 为什么做:你在决策卡上选了「新增第八类」,这里把它写成成文规则;此前这类改动没有一个如实可选的申报类别,写破坏性变更说明的开发者只能卡住。
- 出错会怎样:只有写破坏性变更说明的开发者会照这段文字申报,运行中的系统不受影响;文字有误可以直接撤回这一笔。
- 要你做什么:审阅并批准合并(Tier H)。文字与门禁两半已按座位路由裁定并进本
PR(门禁的词表钉要求两边同一笔,任一半单独合并都会报红);#38366 已并入关闭。

## What changes

Two files, both halves of one decision, combined by the seat's route
ruling (recorded on #37447 and #38328: combine, reason = the #8299
lockstep pin):

- `docs/adr/0087-metadata-protocol-upgrade-contract.md`: +199 −4 (1538
to 1733 lines) — the ADR half (#38328), described below.
- `scripts/check-adr-0087-registration.mjs`: +922 −93 — the gate half
(#37447 item 2), cherry-picked from
`claude/issue-37447-runtime-member-retyped` (closed PR #38366; os-dev
report 7241851254 on #37447) and then reworked on this branch for L2
record 7242485283 and L2 delta record 7243871018 (os-dev reports
7243462155 and 7244464363 on #38328): `runtime-member-retyped` in
`CATEGORIES`, `verifyRuntimeMemberRetyped` with
`RUNTIME_MEMBER_RETYPED_PREDICATES` (`present-at-both-type-differs`,
`no-metadata-surface`, `from-operands-named`), D9's predicates 2–3
lifted into shared helpers with no behaviour change, an explicit
`strictNullChecks`, and the self-test batteries RMR (83) and RMR-N (3).
The rework adds reading (b) of predicate 1 (see the table below).
`type-surface-only` and its predicate 4 are unchanged apart from one
hint line in an existing refusal.

The ADR's changeset disposition vocabulary gains its eighth category,
`runtime-member-retyped`, for a member that stays on a published type
while its declared type changes. Five places move together:

1. **Status line.** The 2026-11-28 amendment entry: the card and its
parent, the decision's own words 「新增第八类」, and where the decision is
recorded.
2. **Vocabulary block** (2026-08-13 addendum). The eighth marker line,
`runtime-member-retyped PACKAGE#TYPE.MEMBER`.
3. **The two prose enumerations beside that block.** The list of
categories resting on a checked fact, which the 2026-11-12 amendment
offers a refused narrowing, and the sentence that names each added
category and the addendum that explains it.
4. **A dated note under D8's predicate 4.** The retyped-member class got
a category of its own instead of a limb on predicate 4, which reads
exactly as it did.
5. **A new addendum (2026-11-28) with D10.** Provenance, the dead end
the category closes (measured), the operands, the three predicates by
name, what the category inherits and what it leaves alone, the worked
example, and what it does not decide.

No untouched text is rewritten, and no existing category's wording
changes.

**The category, as written.** It is D9's sibling. The operand is a
member of a type the package's published entry exports (or a member of
an exported value, read on that value's type as D9's reader reads it),
`PACKAGE#TYPE.MEMBER`, or `PACKAGE/SUBPATH#TYPE.MEMBER` behind a literal
subpath key. An export operand and the whole-package operand are refused
by name. Three predicates, checked by name:

| predicate | what it asks |
|---|---|
| `present-at-both-type-differs` | The type is exported at the merge
base and at HEAD, the member is on it at both, and the type the checker
prints for the member (with its optionality, under `strictNullChecks`)
differs. A vanished member, an added member, and a declaration naming a
type the reader cannot resolve are refused. Reading (b), added in the L2
rework: also refused as unprovable, at either revision, a member whose
printed type names a type with no declaration behind it, or carries more
`any` than the member's own declarations write. An `any` the declaration
writes is still compared as written. The refusal covers what leaves a
trace (the member's own declaration, the printed type); a type that
rests on something unresolved without a trace is compared, on three
named roads carried by #38379. |
| `no-metadata-surface` | D9's predicate 2, asked at both revisions. |
| `from-operands-named` | D9's predicate 3, unchanged. |

It inherits the `no-migration-prescription` refusal as D9 does, it does
not go through D8's text walker, and D8's predicate 4 gains no limb.

**Agreement with the gate half.** The text was first read against the
gate branch for #37447 at `a2b044f1fb` and `e657c303b2`. The gate in
this PR is no longer that file: the L2 reworks changed it on this branch
(blob `e56281db17` first, `15df493f67` at `e2661365c1`, `bc082d7904` at
`8c1017d6d2` and this head), and the ADR changed with it each time:
predicate 1 corrected and scoped to traces, and "What this does not
decide" gaining the trace-less item and one scoped clause. Category
name, operand forms, the three predicate names and each predicate's
reading agree, and neither half departs from the decision's design.

**The vocabulary pin is green on this head.** The gate pins the
categories the ADR documents to the categories it accepts, both ways;
either half alone was red (`documented but not accepted` / `documented
nowhere`), which is why they are one PR.

**Read first** (by risk)

1. The three predicates under D10, from "An author may claim the
category when". Predicate 1's reading is the part the gate has to
implement word for word.
2. The paragraph "D8's predicate 4 is not weakened" and the 2026-11-28
note under D8. The risk is any wording that could be read as a limb on
predicate 4.
3. The table under "The dead end it closes". Two of its rows record
admissions, not refusals: `already-registered` on any old id, and the
two catch-all categories on a body the detector does not read.

**Two-minute check.** Run `node scripts/check-adr-0087-registration.mjs
--self-test` on this branch: it prints 960 assertions (V3 included) and
exits 0.

## Tests

The gate's suite is its own `--self-test` (no test file names the
script). The L2 rework changes behaviour, so it carries new pins and
ablations:

- New pins: RMR-R12 / R12b (inferred `any` at both revisions, refused as
unprovable, not "the SAME"), RMR-R13 (`any` at one revision, refused),
RMR-R14 (annotation naming a local alias over an unresolved name),
RMR-R15 (a mapped type's member), RMR-G4 (a written `any` is still
compared and its retyping admitted); for the nits RMR-G5, R16, G6, R17.
Round 3 adds RMR-C1 (road b, a named compare on the `keyof` shape, to
turn red when the road is closed), RMR-G7 and G7b (a member of an
exported value; the `any` count over an initialiser), RMR-R17's wording
pin with R17b and R17c (the private-package refusal names a retyping;
D9's sentence unchanged), and one pin each on RMR-R12 and R13 for the
remedy line. RMR goes from 44 to 83 cases, its floor with it; the
self-test from 921 to 960 assertions.
- Ablations at `e2661365c1` (accept-set; the arm did not move after it),
direction written before each run, restored each time (`git diff HEAD`
empty): (A) the new arm off: predicted 14, observed 14 red; (C1) the
`any` rule alone off: 8 / 8; (C2) the name rule alone off: 6 / 6; (D)
the written-`any` allowance zeroed: 1 / 1 (RMR-G4); (B) RMR floor at 73:
refused, fixing the battery at exactly 72. At `8c1017d6d2` (the gate
blob of this head): (N7) the wording handed back to D9's: 2 / 2; (N8a)
the merge-base clause off: 1 / 1; (N8b) the clause always on: 1 / 1; (D)
the written-`any` allowance zeroed: 3 / 3 (RMR-G4, G7, G7b); (B) the
floor at 84: refused, fixing the battery at 83.
- On the real `@objectstack/client`, `ObjectStackClient.connect` was
refused as "the SAME at both revisions" at `31596e5b6e` and is now
refused as unprovable, naming `GetDiscoveryResponse`. On the real
`@object-ui/auth`, `AuthClient.updateUser` is still verified and
`AuthClient.signOut` still "the SAME".
- **What predicate 1 does not refuse, stated and carried.** The refusal
covers what leaves a trace. A type that rests on something unresolved
without one is compared, on three roads, each measured through the
shipping gate: (a) the `any` count is a count, not a position, and the
produced `any` arrives through a local alias or by inference; (b) an
operator such as `keyof` consuming an unresolved type behind a local
alias (pinned by RMR-C1 as a named compare); (c) inference through a
local overloaded function. Predicates 2 and 3 hold on all three. The ADR
and the gate header both state this and name the carrier, #38379; until
it lands, that item is the contract. Road b was left stated, not closed:
following every local alias would refuse the by-design named compare.

<details>
<summary>The dead end, measured: the worked example under every existing
disposition</summary>

Method: the net diff of PR #37433 (head `ac218b2489`) applied on
`4cb162bfb9` in a detached comparison worktree, the changeset's marker
and its FROM / TO spelling rewritten per variant, each variant committed
locally and judged by the shipping gate's own `assertInputs` and `scan`.
Nothing from that worktree was pushed.

| variant | marker | how the fix is spelled | outcome |
|---|---|---|---|
| V0 | `type-surface-only`, bare | the PR's own two-line pair | refused,
predicate 4 |
| V1 | `type-surface-only`, dotted member path | two-line pair |
refused, predicate 4 |
| V2 | `no-migration-prescription` | two-line pair | admitted |
| V3 | `runtime-interface-only` | two-line pair | admitted |
| V4 | `runtime-export-retired`, member operand | two-line pair |
refused, predicate 1 |
| V5 | `unpublished` | two-line pair | refused |
| V6 | `registered`, an id not in the diff | two-line pair | refused |
| W1, W3 | the two catch-all categories | one arrowless FROM … TO line |
admitted |
| W2, W4 | the two catch-all categories | an arrow line under no
migration label | admitted |
| W5, W6 | `runtime-export-retired`, member operand | arrowless line,
arrow line | refused, predicate 1 |
| W7 | `already-registered`, a real id older than the merge base |
two-line pair | admitted |
| X1, X2 | the two catch-all categories | a labelled FROM → TO arrow
line | refused by the prescription detector |
| X3 | `type-surface-only`, bare | labelled arrow line | refused,
predicate 4 |

</details>

<details>
<summary>The two halves in one tree: green, and the worked example is
accepted</summary>

Joint tree `e121e0e10c`, a local-only merge of the gate branch at
`a2b044f1fb` with this branch at `819cdf7cd0`. This reading predates the
L2 rework: the ADR and the gate both changed at `e2661365c1`, so the 921
below is that tree's number, not this head's (960). R2 and R6 were
re-measured on this head's gate and still hold.

- `node scripts/check-adr-0087-registration.mjs --self-test` printed `✓
check-adr-0087-registration --self-test: 921 assertions over real temp
git repos (real scan()/assertInputs() path)`, exit 0.
- `node scripts/check-adr-0087-registration.mjs --base origin/main` exit
0.

Each half alone:

- This branch: exit 1, `category documented but not accepted:
runtime-member-retyped`; the self-test reports one failure, `V3`.
- The gate branch at `e657c303b2`: exit 1, `category documented nowhere:
runtime-member-retyped`.

The worked example on the joint tree, same driver:

| variant | marker and how the fix is spelled | outcome |
|---|---|---|
| R1 | `runtime-member-retyped @object-ui/auth#AuthClient.updateUser`,
the PR's own two-line pair | refused by predicate 3: the body carries a
vertical FROM / TO pair, which this category does not read |
| R2 | same marker, one FROM … TO … line with `AuthClient.updateUser` on
the FROM side | accepted; the gate prints the member's declared type at
both revisions |
| R3 | same marker, an arrow line | accepted |
| R4 | an export operand | refused by name |
| R5 | the whole-package operand | refused by name |
| R6 | a member the diff did not retype, `AuthClient.signOut` | refused,
predicate 1: the same type at both revisions |
| R7 | `type-surface-only`, bare | still refused by predicate 4 |

</details>

<details>
<summary>The compiler delivers the break (D10's channel
argument)</summary>

TypeScript 6.0.3 on the worked example's shape. A caller that reads the
result gets `TS2339` (the property does not exist on type void). A host
that passes its own implementation returning a Promise of AuthUser gets
`TS2322` (not assignable to a Promise of void).

</details>

## Acceptance notes

- **Done-when, first bullet.** The ADR names the eighth category with
its three predicates, and every enumeration of the vocabulary carries
it: the marker block and the two prose lists beside it. The status line
carries the amendment entry. Every occurrence of the seventh category's
name was read to find a list that omits the eighth; there is none. The
ADR counts categories by ordinal only (fifth, sixth, seventh, now
eighth), so no count word needed changing.
- **"The two land in either order" does not hold.** This branch alone
fails the vocabulary pin, and the gate half alone fails it in the other
direction. The two agree and are green together, in one merged tree
only.
- **One sentence on the parent card is narrower than it reads.** It says
the two catch-all categories are refused for a body that carries a FROM
→ TO. Measured, that depends on how the pair is spelled: the detector
reads a labelled arrow line and refuses, and it reads neither the
two-line pair PR #37433 carries nor an arrowless line, so both
categories are admitted there. The ADR records the measured outcomes.
Across the 114 pending changesets, two carry a two-line pair the
detector does not read, and both describe behaviour in prose and
prescribe no rewrite. Noted, not filed.
- **PR #37433 needs one edit beyond its marker.** Under the new category
its two-line pair is refused by predicate 3 (R1), and one FROM … TO …
line is accepted (R2). The ADR's worked-example paragraph says so; the
edit itself belongs to that PR.
- **The gate half is no longer carried unchanged.** The L2 reworks
changed it on this branch (blob `e56281db17` before, `bc082d7904` at
this head). Its header now follows the ADR's measured table on the two
catch-all categories: refused on a labelled arrow line the detector
reads; admitted on the two-line pair, an arrowless line, and an arrow
line under no migration label (the ADR's row names the first two). It
also corrects the old reason for the unresolved-name refusal: "two
unresolved names print alike" is measured false on TypeScript 6.0.3; the
true reason is that a name is only its spelling, so one spelling can be
two types at two revisions.
- **Ablations of the gate half** were run by its dev on its branch
(report 7241851254 on #37447): each new refusal reds its own case when
removed. The rework's ablations were run on this branch (see Tests).
- **The private-package refusal names a retyping.** Under this category
it reads "no published entry to retype a member on" (L2 delta N7, L1
item 2); D9's own sentence and its pin REX-R9 are unchanged.
- **Landing pointer for PR #37433.** Under this category #37433's
two-line `FROM:`/`TO:` pair is refused by predicate 3 (R1); it lands
only with one `FROM … TO …` line naming `AuthClient.updateUser` before
TO (R2). The seat posts that pointer on #37433 when this PR lands; the
edit belongs to that PR.

## Verification

Local, head `1f7fcfd66c` (merge base `eef1cbfe4a`, 0 behind main at the
run): the 44 commands of `dispatch-gates --commands` for the two-file
diff, under the shared verify lock (`VERDICT command-exit 0` in two
holds, 976 s and 485 s), each exit captured before any pipe.

- 44 of 44 exit 0, among them `check-adr-0087-registration --base
origin/main`, its `--self-test` (960 assertions), `pnpm
check:changeset-gate-self-tests` (167 + 960 + 456) and `pnpm
check:pm-dispatch-gates` (fast tier, 2385 cases).
- Reconciliation: `dispatch-gates --ran: 44 derived famil(ies) accounted
for - 44 run, 0 NOT-MEASURED`.
- `overlap-check` before the push: `VERDICT clean exit 0`, against
origin/main and 0 PR heads.

NOT MEASURED locally, CI-owned: the slow tier of the dispatch-gates
self-test, the type-check lanes, the governed-merges audit over workflow
variables. No changeset: both files ship in no package.

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

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oPfjnm2yWHEwkiYrn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
…and push forms (#38397)

Closes #38356

Clause-②: no
Metadata-protocol: none
Rule-change: ruled
Ruling-ref: the maintainer, verbatim in the security#2 session on
2026-11-28: 「按建议」 on the delta review 7238071861 of PR #38077, recorded
in comment 7241046206 on #38074; the option it chose cards the
glob-character guards separately, as this card. The ruling's recorded
words name the branch argument; the six commit-file rows (`-F` and
`--allow-empty -F`) come from this card's own scope (#38356) and the
delta reviewer's measured candidate set.

## 维护者速读

- 用户无感:云端值班席位提交和推送自己的卡分支、信箱分支时,写法里带通配符的变体改为先弹审批,四条原样写法照旧免审批。
- 为什么做:命令行会先把问号、方括号、星号展开成别的内容,免审批规则却按原样匹配,带通配符的写法可能推出不该推的分支。
- 出错会怎样:最坏是席位在这几种少见写法上多弹一次审批;撤回只需删掉这十行。
- 要你做什么:审阅后亲自合并这个草稿 PR。

## What changes

`.claude/settings.json`, `permissions.ask` gains ten rows, after the two
literal-`*` push guards from #38077:

```
"Bash(git push -u origin claude/issue-*?*)",
"Bash(git push -u origin claude/issue-*[*)",
"Bash(git push -u origin claude/mailbox-*?*)",
"Bash(git push -u origin claude/mailbox-*[*)",
"Bash(git commit -F *\\**)",
"Bash(git commit -F *?*)",
"Bash(git commit -F *[*)",
"Bash(git commit --allow-empty -F *\\**)",
"Bash(git commit --allow-empty -F *?*)",
"Bash(git commit --allow-empty -F *[*)"
```

Each of the four allowed forms now has an ask guard for `?`, `[` and a
literal `*` in its argument. The two push forms already had the
literal-`*` guard (#38077), so it is not repeated. Nothing else in the
file changes: the allow list, the deny roster (17 GitHub content-write
tools) and the hooks are as on `main`.

## Why

The shell expands `?`, `[...]` and `*` in the argument against files in
the working directory before the command runs. The permission matcher
reads the argument as typed, so a spelling that matches only the allow
rule could expand into a form the ask rules exist to stop. On `main` the
sandbox measurement below shows it: `git push -u origin
claude/mailbox-ui-4?pwned-glob`, the `[^a]` and `[!a]` spellings, and
the same on the card-branch family, ran without approval and created
`refs/heads/pwned-glob` on the sandbox origin. `git commit -F m*` and
`-F *` also ran without approval.

## Reach

Measured end to end: the CLI binary, driven against a mocked model
endpoint in throwaway sandbox repos, default mode unless stated.
Precedence is deny, then ask, then allow.

**Runs without approval** (unchanged from `main`):

- the four bare forms: `git commit -F FILE`, `git commit --allow-empty
-F FILE`, `git push -u origin claude/issue-N-SLUG`, `git push -u origin
claude/mailbox-SLUG`;
- the wrapper, redirect, chain and read-only pipe shapes listed in
#38077's Reach section, for example `timeout 30 ...`, `... 2>&1 | tail
-5`, two allowed commands joined by `&&` or `;`;
- a `*` that is not in the argument: a trailing `# *` comment, or `grep
'*'` after a pipe.

**An ask rule prompts for** (new rows, this PR):

- `?` anywhere in the branch argument of either push family, for example
`claude/mailbox-ui-4?pwned-glob`, `claude/issue-?-x`,
`claude/mailbox-?i-4`;
- `[` anywhere in the branch argument of either push family: `[x]`,
`[^a]`, `[!a]`, a range (`[:]` already asked on `main` through the `:**`
guard);
- `?`, `[` or a literal `*` in the message-file argument of `git commit
-F` and `git commit --allow-empty -F`: `m*`, `*`, `m?g`, `ms?`, `m[s]g`,
`m[^x]g`, `m[!x]g`, `m[a-z]g`.

**An ask rule prompts for** (already on `main`, held): anything after
the branch or the message file, a `src:dst` refspec, a literal `*` in
the branch argument, and arguments fed through `xargs`.

**Prompts for another reason, or matches no rule:** unchanged from
`main`, as #38077's Reach section lists. A quoted or backslash-escaped
`?`, `[` or `*` in the argument now asks by rule on all four forms,
although the shell would not expand it: on the commit forms it ran
before this PR; on the push forms a quoted `*` already asked. Glob
spellings behind a pipe prompt as a subcommand prompt rather than a
top-level rule ask.

**Not guarded here:** tilde expansion (`-F ~/x`), which is not a glob
and ran before and after.

## Readings

- `node scripts/pm/check-settings-deny-roster.mjs`: EXIT=0, `17
content-write tool(s) declared = enforced`.
- JSON parse of `.claude/settings.json`: EXIT=0.
- `node scripts/pm/mailbox-open.mjs --self-test`: EXIT=0, `93 cases in
10 batteries pass`.
- End to end, `main` (ff69bca) against this head (6d072bb), 566
command shapes: 40 that ran without approval now ask by rule. Nothing
else changes, and nothing that prompted before runs now.

<details><summary>End to end, before (ff69bca) and after
(6d072bb)</summary>

Each shape is one fresh CLI session in its own sandbox repo with a bare
`origin`, a mocked model endpoint that emits the one Bash call, and the
head's `permissions` block as project settings. Every prompt was
answered "deny". RAN = executed with no prompt. ASK(rule) = an ask rule
matched the line. PROMPT(...) = a prompt raised for another reason. Both
heads were run in this session, same binary. No session reached a real
model endpoint.

Sets: the 526 shapes of #38077's review (main 116, xargs/wrapper/chain
41, glob/continuation 29, acceptEdits 10, round-3 extras 9 + 158 + 163)
and 40 glob shapes added for this card (9 per commit form, 11 per push
family).

```
                              before  after
RAN                           116     76
ASK(rule)                     167     207
PROMPT(subcommandResults)     186     186
PROMPT(other)                  87      87
PROMPT(safetyCheck)             4       4
PROMPT(unclassified)            6       6
```

Every row that changed (all RAN before, ASK(rule) after):

```
set   id    command
e2e   p58   git push -u origin claude/mailbox-?i-4
e2e   c47   git commit --allow-empty -F *
e2e   c48   git commit --allow-empty -F m*
e2e   c49   git commit -F *
y     y01   git push -u origin claude/mailbox-ui-4?pwned-glob   (before: created refs/heads/pwned-glob)
y     y06   git push -u origin claude/issue-1-x?pwned-glob      (before: created refs/heads/pwned-glob)
y     y18   git commit --allow-empty -F *
y     y19   git commit --allow-empty -F m*
v     v1    git push -u origin claude/mailbox-ui-4[^a]pwned-glob (before: created refs/heads/pwned-glob)
v     v2    git push -u origin claude/issue-1-x[!a]pwned-glob    (before: created refs/heads/pwned-glob)
glob  cf01..cf08  git commit -F  m*  *  m?g  ms?  m[s]g  m[^x]g  m[!x]g  m[a-z]g
glob  ca01..ca08  git commit --allow-empty -F  (the same eight arguments)
glob  pi01..pi03  git push -u origin claude/issue-1-x  ?pwned-glob  [^a]pwned-glob  [!a]pwned-glob
glob  pi06 pi07   git push -u origin claude/issue-1-x?   claude/issue-1-x[x]
glob  pi10 pi11   git push -u origin claude/issue-?-x   claude/issue-[1]-x
glob  pm01..pm03  git push -u origin claude/mailbox-ui-4  ?pwned-glob  [^a]pwned-glob  [!a]pwned-glob
glob  pm06 pm07   git push -u origin claude/mailbox-ui-4?   claude/mailbox-ui-4[x]
glob  pm10 pm11   git push -u origin claude/mailbox-?i-4   claude/mailbox-[u]i-4
```

Held at both heads: the four bare forms RAN (glob cf00, ca00, pi00,
pm00; e2e c01, c18, i01, p01), each making its commit or creating its
own branch on the sandbox origin; the literal-`*` push shapes and `[:]`
asked by rule before and after (pi04, pi05, pi12, pm04, pm05, pm12).
Per-set totals, before / after: e2e RAN 29 / 25, y RAN 5 / 1, v RAN 2 /
0, glob RAN 34 / 4; x, z, z2 and acceptEdits identical.

</details>

<details><summary>Local gate readings at 6d072bb</summary>

`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 18 commands for this one path; all
18 ran and exited 0. `check:doc-formula-expressions` first exited 3
(prerequisite: `@objectstack/formula` and `@objectstack/lint` unbuilt,
nothing measured); after building those two it exited 0. The always-runs
tail and the type-check lanes are CI's.

</details>

Files to read first: `.claude/settings.json`, the ask block, the ten
rows after `claude/mailbox-*\\**`.

Two-minute check: `node scripts/pm/check-settings-deny-roster.mjs`
prints `17 content-write tool(s) declared = enforced`.

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

https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov

<!-- signed: security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov
-->

Co-authored-by: Claude <noreply@anthropic.com>
…e probe rule (#35237 slice 13) (#38393)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_

Fixes #35237
Claim on the card naming this branch: 7247494260 (slice 13; base claim
7245952141).
Clause-②: no
Metadata-protocol: none
Rule-change: none

## 维护者速读

- 用户无感:车队开发代理用的内部脚本和开发代理规则里的一行命令写法做了收尾修整,推送前后的行为对用户不可见。
- 属于「车队技能整理」里「把每次手敲的流程改成脚本」这一步,本次清掉这一步最后几项遗留小问题,做完后这一步可以关闭。
- 最坏情况是开发代理推送遇到超时、限流类错误时多重试几次(有固定上限)或照旧提前停下;一个提交即可整体撤回。
- 无

Slice 13 of the card: carrier item 24, the rule half of item 14 N7, and
items 26–29 (notes 7246458172 and 7246788470), plus the card's done-when
check below. 6 files, +54 / −16.

| Item | Where | What changed |
|:---|:---|:---|
| 24 | `scripts/pm/check-owed-reviews.mjs:140` | "The name is kept:
importers read it" was false (nothing imports `TRIAGE_ROUND_MINUTES`).
It now says the name is kept because this file reads it, in the trigger
(b) docblock and `owedReviewRow`, and that nothing imports it. Comment
only. |
| 14 N7 (rule half) | `.claude/agents/os-dev.md:31` | The probe command
now spells `--branch=BRANCH`, so it runs as written instead of ending in
a usage exit. Bytes are offset on the same line (see Acceptance notes).
|
| 14 N7 (ratchet) | `scripts/pm/check-skill-line-ratchet.mjs` | The
`os-dev.md` row is lowered 33500 → 33492, the landed size. No row
raised. |
| 26 | `scripts/pm/dev-worktree.sh` `classify_push_failure` | A new arm,
ahead of the 4xx arm and keyed exactly as it is, reads 408, 421, 429 and
every 5xx as `network`. "Received HTTP code 502 from proxy after
CONNECT" is now placed. The comment now says why. 5 classifier cases;
floor 14 → 19. |
| 27 | `scripts/pm/dev-worktree.sh` `rerun_with_probe` | A flag made
only of characters no shell reads specially is printed as typed
(`--backoff=2,4`). Any other flag is still quoted with `printf %q`. The
pinned line now carries `--backoff=2,4`. One round-trip case; floor 20 →
21. |
| 28 | `scripts/pm/git-history.mjs` self-test | The case titled "a
problem the CLI refuses as usage" now asserts through the CLI: `ancestor
--cwd=` pointed at a missing directory exits 1, prints nothing on stdout
and says "could not be checked" on stderr. |
| 29 | `scripts/pm/check-handover.mjs` `--inflight` clear line | The
line now names the unjudged case: "a claimed path fragment deeper inside
a dispatched directory, spelled DIR, DIR/** or DIR/**/GLOB alike". It is
pinned in the N12 case. |

### Why 408, 421 and 429 are network errors under rule 1
(`os-dev.md:33`, only a network error is retried)

The rule separates two kinds of failure. A refusal on the merits stops
the run (403, and every other judged 4xx). A failure of the path is
retried on a bounded schedule. Each of these three statuses says the
path failed and says nothing about the push itself:

- **408 Request Timeout.** The server closed the connection because the
request did not arrive whole in time. It is the same event as the
`Operation timed out` the classifier already retries; this time the
server noticed the timeout first.
- **421 Misdirected Request.** The request reached a connection that
cannot answer for this host, usually a reused HTTP/2 connection or a
proxy route. It describes the connection, not the request, and the
retry's new connection is the fix.
- **429 Too Many Requests.** The path is throttled for now. HTTP's own
remedy is to wait and retry, and the backoff schedule is that wait: four
retries, 30 s in all, never a loop.

All three read `network` before #38387 (through the words "RPC failed").
This PR restores that reading and keeps 401, 404, 407 and 409 as
`other`. Every 5xx already read `network` in the `error:` and `HTTP`
spellings. The new arm adds the key words the 4xx arm uses (`status`,
`code`, `response`, `HTTP/N`), so a proxy's "Received HTTP code 502"
reads the same way.

### Done-when check, item by item

The card's done-when: each listed procedure is a script with a
self-test, its prose is a one-line pointer, and the card-pick reader
works against the live board. The closing check also asks that no
carrier item stays open apart from item 7 option B, which landing ruled
out of scope (7222751511 ③).

| Part | State | Evidence |
|:---|:---|:---|
| Slice 1: card-pick, lock depth, prior-rulings `--paths` | landed | PR
#35482 |
| Slice 2: `landing-k`, `pr-state`, `sweep-closed-cards --pr` | landed |
PR #35576 |
| Slices 3, 5, 6: `fleet-roster --health`, the dispatch-runbook pointer,
`l1-face` | landed | PR #35671 |
| Slice 4: `check-handover --inflight`, `round-open` | landed | PR
#37878 |
| Slice 7: `git-history ancestor`, `dev-worktree.sh` | landed | PR
#38018 |
| Card-pick against the live board | works | `node
scripts/pm/card-pick.mjs --order area:fleet --seat repo:objectstack#5
--limit 3` at 23:04Z: read 231 open `pm:queue` issues over 3 pages, the
platform counts 231, `card-pick COMPLETE — 3 pick(s)`, exit 0 |
| Carrier items 1, 2 | done | slice 4 (landing note 7226135228) |
| 3, 5, 6, 11 (10's N6 too) | done | slice 8, PR #38146 |
| 16–19 | done | slice 9, PR #38212 |
| 4, 12, 13, 15 | done | slice 10, PR #38222 |
| 20–22 | done | slice 11, PR #38243 |
| 7 N11, 9, 14 N3/N5/N6 and N7's script half, 23, 25 | done | slice 12,
PR #38387 |
| 24, N7's rule half, 26–29 | done | this PR |
| 8, 10 | owe nothing | listed for completeness and accepted as
deviations (7222785044) |
| 7 option B | out of scope | landing kept option A (7222751511 ③) |

Each part holds as far as it can be measured, so the first line is
`Fixes #35237`. One limit: the review reports' section 4, the candidate
list the card names, cannot be read from this project, and slice 3's
claim (7022183772) recorded the same gap. "Each listed procedure" is
therefore checked against the slice plan in claim 7006559529, amendment
7013022048 and release 7017468070. If the seat holds a section-4
candidate outside that plan, the first line should become `Part of`.

## What changes

The four scripts and one comment above, one rule line and one ratchet
row. Nothing here ships in a package.

## Tests

All runs are at head `084b6dba7a`.

<details><summary>Self-tests of every script edited</summary>

- `bash scripts/pm/dev-worktree.sh --self-test`: `✓ dev-worktree
self-test: 95 cases pass across 7 batteries` (89 before: 5 classifier
cases and 1 probe case added).
- `node scripts/pm/git-history.mjs --self-test`: `git-history
--self-test: all cases passed.`
- `node scripts/pm/check-handover.mjs --self-test`: `✓ check-handover
self-test: 114 cases pass`.
- `node scripts/pm/check-owed-reviews.mjs --self-test`: `✓
check-owed-reviews self-test: 96 cases pass in 10 batteries`.
- `node scripts/pm/check-skill-line-ratchet.mjs --self-test`: `116 cases
pass`. The gate itself exits 0.

</details>

<details><summary>Ablations (scripts/ablation-replace.mjs; each mutation
was proven on disk and the restore proven blob == HEAD with an empty git
diff HEAD)</summary>

- A1 `(408|421|429|5[0-9][0-9])` → `(5[0-9][0-9])` in the new arm: 3 of
95 red, the 408, 429 and 421 cases.
- A2 `(408|421|429|5[0-9][0-9])` → `(408|421|429)`: 1 of 95 red, the
proxy CONNECT 502 case.
- A3 the as-typed branch of `rerun_with_probe` back to `printf %q`: 2 of
95 red, the pinned second-run line and the round-trip case.
- A4 the `--inflight` clear line back to its old text: 1 of 114 red, the
N12 case.
- A5 the CLI's usage refusal skipped for a "could not be checked"
problem: 1 red, the item 28 case, through its CLI half alone (the direct
calls stay green).

</details>

<details><summary>Classifier false-match probe (the shapes record
7246776227 tried against the 4xx arm, run against the new arm, at this
head and at the merge base)</summary>

A port (`port 429`, `github.com:502`), an errno (`errno 408`,
`errno=502`), an OpenSSL code (`error:0A000126`, `error:42900000`), a
byte count (`408 bytes`, `Total 429`, `(502/502)`) and an HTTP/2 stream
number (`HTTP/2 stream 421`, `stream 503`) read the same at head as at
base. Only two answers moved: `RPC failed; HTTP 429` and `Received HTTP
code 503 from proxy after CONNECT`, both from `other` to `network`.

</details>

## Acceptance notes

- **os-dev.md byte offset.** Adding `--branch=BRANCH ` costs 16 bytes
against 9 bytes of headroom. The same line drops 「建好分支后」 (15 bytes), so
the file lands at 33492 (+1 against main's 33491), within the 33500
ceiling. The row is then lowered to 33492. The rule is unchanged: the
timing it sets is still 「任何编辑前」, and the one command now builds the
branch and sends the probe in a single run. `BRANCH` is the placeholder
the file already uses three lines up (`Resume-from: BRANCH@SHA`). The
edit stays one line, adding one argument, with the offset on the same
line.
- **The old 5xx alternative is kept.** The case-insensitive
`(error:|HTTP)[ :]+5xx` alternative stays in the transport-words arm, so
no spelling that read `network` before reads anything else now.
- **`check-owed-reviews.mjs` keeps `export`.** Nothing imports the name,
and the sentence now says so. Removing the export would be a surface
change this item did not ask for.

## Verification

Read first, by risk: `scripts/pm/dev-worktree.sh` (the new arm in
`classify_push_failure`, then `rerun_with_probe`),
`.claude/agents/os-dev.md:31`, `scripts/pm/git-history.mjs` (the item 28
case).

Two-minute check: `bash scripts/pm/dev-worktree.sh --self-test` should
print `95 cases pass across 7 batteries`.

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

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oPfjnm2yWHEwkiYrn -->

Co-authored-by: Claude <noreply@anthropic.com>
…to biz (#38405)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XDXvJPPtrTGfdDYhWWpihq5)_
Fixes #38371
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:新工作区装上的基础模板应用里,公司、联系人、应用、仪表盘和两个数据集的接口名前缀从 starter 换成
biz,界面上的显示名称不变。
- 为什么做:维护者裁定模板应用的前缀改为 biz,替看接口名的搭建者和 AI 去掉像临时代号的前缀,赶在下一次版本发布把模板推上预发市场之前。
- 出错会怎样:只影响新装的模板应用;已经装过旧版的环境保留原有对象不受影响,本改动可以直接撤回。
- 要你做什么:无。

## What changes

The Starter app (`examples/app-starter`) now declares `namespace:
'biz'`, and every API name that carried `starter_` carries `biz_`:

| Was | Now |
|:---|:---|
| `starter_company` | `biz_company` |
| `starter_contact` | `biz_contact` |
| `starter_app` | `biz_app` |
| `starter_overview_dashboard` | `biz_overview_dashboard` |
| `starter_company_metrics` | `biz_company_metrics` |
| `starter_contact_metrics` | `biz_contact_metrics` |

Every reference follows: the contact's company lookup, the company's
related list, the views' `data.object`, the menu, the dashboard widgets'
datasets, the translation keys in both locales, the README listing text
and the boot test. Unchanged, per the ruling: `manifest.id`
(`com.example.starter`), the package name, file names and the display
name. No alias and no retirement window (the Starter installs unmanaged,
ADR-0131 D6).

The blank-template parity test
(`packages/create-objectstack/src/blank-template-starter-parity.test.ts`)
now guards the Starter's namespace as `'biz'`; the blank template itself
keeps `blank_*` and `namespace: 'blank'`. The publish script's self-test
fixture spells the same namespace. One patch changeset for
`@objectstack/example-starter`.

The cloud half is carried by #38373; the knowledge-article card #38372
starts from this branch.

First read (by risk):
1. `examples/app-starter/src/translations/starter.translation.ts`: the
nested object, app, dataset and dashboard keys in both locales; a missed
key would surface as an untranslated label.
2.
`packages/create-objectstack/src/blank-template-starter-parity.test.ts`:
the namespace guard is the one assertion that changed value.
3. `examples/app-starter/test/boot.test.ts`: the install, menu and
uninstall paths now read `biz_*`.

## Tests

- `pnpm --filter @objectstack/example-starter validate`: Validation
passed.
- `pnpm --filter @objectstack/example-starter test`: Test Files 1 passed
(1), Tests 5 passed (5) (installs unmanaged, reads the menu,
uninstalls).
- `pnpm --filter @objectstack/example-starter typecheck`: exit 0.
- `pnpm --filter create-objectstack exec vitest run --maxWorkers=2
src/blank-template-starter-parity.test.ts`: Tests 9 passed (9); `pnpm
--filter create-objectstack typecheck`: exit 0.
- `node scripts/ci/publish-starter-marketplace.mjs --self-test`: 20
cases pass.
- After building the Starter, `--dry-run` prints `"namespace": "biz"`
and `"manifest_id": "com.example.starter"`; the built
`dist/objectstack.json` holds 0 `starter_` names.

All readings at head d11655c.

## Acceptance notes

- `git grep -n "starter_" -- examples/app-starter
':!examples/app-starter/CHANGELOG.md'` prints nothing at d11655c.
- Outside `examples/app-starter`, the only remaining `starter_company`
spellings are the two standalone fixtures the card puts out of scope
(`packages/spec/src/stack-nav-platform-object-requires-object.test.ts`,
`packages/lint/src/validate-object-references.test.ts`); neither reads
the Starter.

## Verification

Two-minute check: `pnpm --filter @objectstack/example-starter test`
shows 5 passed, and the menu assertion lists `biz_company`,
`biz_contact`, `sys_task`, `sys_note`.

<details><summary>Derived local gate subset (dispatch-gates --commands
at d11655c)</summary>

81 derived; 78 run with exit 0 (`check-plugin-teardown-shape
--self-test` first exited 3 on the shallow clone, then 0 after fetching
its pinned fixture commit; `check:i18n-coverage` first refused on
missing builds, then OK after building its prerequisite closure: 15
configs, none new). NOT MEASURED, left to CI:
`check:dual-build-cjs-loads` (needs a whole-workspace build),
`check:type-check-debt` (whole-workspace sweep) and
`check:pm-dispatch-gates` (beyond the foreground cap). Dogfood: not owed
(no `!` title, no narrowing arm).

</details>

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
…eature is on (#38408)

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

Fixes #38385

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:部署开了两步验证后,用户打开自己的记录页,能看到「Enable Two-Factor
Auth」按钮了;其他按部署功能开关显示的按钮(比如团队、OAuth 应用、邀请相关的按钮)也按开关正确显示或隐藏。
- 为什么做:控制台判断这类按钮该不该显示时,没有拿到部署的功能开关,判断直接报错,按钮就一律被藏起来,功能开着也没人能自己开启两步验证。
- 出错会怎样:最坏是某个按功能开关的按钮在开关关着时也显示出来,点了会被服务端拒绝;只改控制台一处取值,可以直接撤回。
- 要你做什么:无。

## What changes

The console's action runner now binds the predicate scope's `features`
root (the deployment's `/auth/config` flags), beside the `current_user`
it already bound.

- **Cause, measured.** `requiresFeature: 'twoFactor'` is lowered at
parse time into a `visible` conjunct `… && features.twoFactor == true`
(`featureGatePredicate`, `@objectstack/spec/kernel`).
`ActionEngine.getActionsForLocation` evaluates `visible` against the
runner's bag with `throwOnError: true`. That bag is the host's context
plus `current_user` from the predicate scope; `features` was never on
it, so the predicate faulted and the action hid fail-closed. A probe on
main `c610020e` with the exact `sys_user.enable_two_factor` predicate
under `ActionProvider` above `PredicateScopeProvider` (the console's
arrangement) printed the card's warning verbatim and returned no action;
the same predicate without the `features` conjunct showed the action. So
the identifier that throws is `features`, not `ctx` or `ctx.user`.
- **Fix.** New `useRunnerScopeBindings`
(`ui/packages/react/src/hooks/useRunnerScopeBindings.ts`, not exported
from the package entry) returns the scope roots a runner binds,
`current_user` and `features`, with one content key for memo
dependencies. `useActionEngine` (shared and standalone runners) and
`ActionProvider` (its own runner) both use it, so the two writes cannot
drift apart. A root the scope does not carry is not bound, as before.
- **Reach.** The fix is where the context is built, so every
`features.*` action gate on this path evaluates: the three
`requiresFeature: 'twoFactor'` actions on `sys_user`, the `organization`
and `oidcProvider` gates on `sys_team`, `sys_team_member` and
`sys_oauth_application`, and the hand-written `features.cloudManaged !=
true` gates on `sys_user`, `sys_member` and `sys_invitation`.
- `.changeset/38385-action-runner-features-root.md`: `@object-ui/react`
patch.

## Tests

New top-level describe in
`ui/packages/react/src/hooks/__tests__/useActionEngine.sharedRunner.test.tsx`
(the existing `useActionEngine` × `ActionProvider` harness), 8 cases.
The two actions are lowered by the spec's own `ActionSchema` from the
shapes `sys_user.enable_two_factor` and `sys_team.create_team` declare,
so a change to the lowering is read here too.

- the spec lowers both gates onto `features` (`== true` for opt-in
`twoFactor`, `!= false` for default-on `organization`);
- for each of three arrangements (provider above the scope, provider
inside it, standalone): flags on, both actions show and both gates
evaluate `true`; flags off, both hide and both gates evaluate `false`
without throwing (the engine warns once per predicate per module, so the
hide is also checked by evaluating each gate fail-closed on the bag the
engine read);
- `ActionProvider`'s own runner carries `features` and `current_user`
from a scope above it.

Reverse verification: with `useActionEngine.ts` and `ActionContext.tsx`
restored to main (tree only, fix committed first), 7 of the 8 new cases
fail; with the fix, all 11 in the file pass. `@object-ui/react` package
test: 141 files, 1609 tests passed. `tsc --noEmit` on
`ui/packages/react` `tsconfig.json` and `tsconfig.test.json`: exit 0.

## Acceptance notes

- The claim's file surface names `ui/packages/core`. The action engine
there is unchanged: the runner's bag is built in `@object-ui/react`
(`useActionEngine` and `ActionProvider`), which is where `current_user`
is already bound from the predicate scope, and `core` has no access to
that scope. `sys-user.object.ts` is unchanged: the predicate is right.
- Only the top-level `features` root is bound, the root the spec lowers
onto. `ctx.features` is not added: no action predicate in
`packages/platform-objects` reads it.
- A flag the server does not serve (absent from `features`) still faults
and hides, as it did; the flags the auth plugin serves are booleans, so
an on and an off deployment both answer by verdict.
- Platform checklist: two-factor enrolment is already covered
(`identity-auth.two-factor-enrollment-reveal` and its siblings name
`enable_two_factor`), so no item is added.
- Not measured in a browser: the reproduction from the card (production
`objectstack start` with `OS_AUTH_TWO_FACTOR=true`) was not re-run; the
pins drive the same hooks the record page mounts.
- Branch `claude/project-thread-9ndw7c` is assigned by the harness, not
the repo's `claude/issue-N-…` convention.

## Verification

Two-minute check: `pnpm --dir ui exec vitest run
packages/react/src/hooks/__tests__/useActionEngine.sharedRunner.test.tsx`,
expect 11 passed.

Read first, by risk: `ui/packages/react/src/hooks/useActionEngine.ts`
(the engine memo now reads `scopeBound`),
`ui/packages/react/src/context/ActionContext.tsx` (the binding memo),
`ui/packages/react/src/hooks/useRunnerScopeBindings.ts`.

<details><summary>Gates at 646c331</summary>

- `dispatch-gates.mjs --commands` derived 38 families from this tree
(objectstack-ai/objectstack at 646c331); all 38 ran locally, each exit
0. `dispatch-gates.mjs --ran` on the record with exit codes: 38 derived,
38 run, 0 NOT-MEASURED, 0 UNRUN.
- `overlap-check.mjs` against origin/main c610020: VERDICT clean (0 PR
heads read; the claim records that no open PR of the seat edits these
files).
- `@object-ui/react` test: 141 files, 1609 tests passed. `tsc --noEmit`
on its `tsconfig.json` and `tsconfig.test.json`: exit 0.
- CI at 646c331 when written: 36 success, 13 skipped, 0 failed, 8 in
progress.

</details>

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

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

https://claude.ai/code/session_01L6bhgWZUEXV9XJ6bqbPqzh

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
…nce tables; the redirect table fails loudly without its folder (#38409)

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

Fixes #38337
repo:objectstack#3 · os-tesla · session_01L9qibvFXC2YadYHU4FMbqf

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:core、runtime、rest 三个包的 README 里「API
Reference」直接打开仓库里的参数表;`os test`
遇到格式不对的测试文件,报错里给的参考链接能打开了(原来指向一个已删的文件);「Locked items」页补准了两种情况。
- 为什么做:九类平台和接口参数表撤下网站后的收尾(你 11-28 14:00Z 的决定「只撤平台和接口类,留编写类」的第三张卡)。
-
出错会怎样:只改文字和一处构建自检;最坏是某条链接不对,旧网址仍有永久跳转兜底,可直接撤回。参数表目录缺失时文档站构建会直接报错,不会再悄悄丢掉全部跳转。
- 要你做什么:无。

## What changes

- **Shipped READMEs.** The "API Reference" link in
`packages/core/README.md` and `packages/runtime/README.md` (was
`objectstack.ai/docs/references/kernel`) and in
`packages/rest/README.md` (was `.../references/api`) now opens the
category folder on GitHub, `packages/spec/docs/references/{kernel,api}`,
in the spelling #38381 used for the hand-written pages. The old URLs
keep redirecting; this removes the hop.
- **`os test` error text** (`packages/cli/src/commands/test.ts`). A file
that is not a valid Quality Protocol suite printed `Reference:
content/docs/references/qa/testing.mdx`, a file #38381 removed and no
redirect covers (it is a repo path, not a URL). It now prints the GitHub
URL of `packages/spec/docs/references/qa/testing.md`. No test pins the
text.
- **N1 from #38381** (`apps/docs/reference-redirects.mjs`).
`repoReferencePages` answered an empty map when
`packages/spec/docs/references` was missing, so the docs site would
build and serve none of the 292 reference redirects without a word. It
now throws when the folder is missing or holds no category folder, and
the error names the generator command. `check:docs-redirects` gains a
self-test battery (4 assertions) that drives the real function at
fixture roots: a missing folder, an empty folder, and a populated
control. The battery floor rises from 8 to 9.
- **Locked items page** (`content/docs/permissions/locked-items.mdx`),
the two nits from the L2 record on #38343 (7241541435):
- N4: the object-delete clause now holds only where the deployment runs
an environment kernel. The removal door sits inside `environmentId !==
undefined` (`protocol-diff-delete-load.ts:515`, `:571`); a host-config
kernel does not ask it (`:604-613`).
- N6: a save that names the read-only package answers `403 ITEM_LOCKED`
with a message that the package is read-only
(`protocol-packaged-base-refusal.ts:151-156`,
`SysMetadataRepository.readOnlyBaseOverrideError`), as
`concepts/metadata-lifecycle.mdx:230` already states.
- **Changeset** `.changeset/38337-moved-reference-links.md`: patch for
`@objectstack/core`, `@objectstack/runtime`, `@objectstack/rest` (README
ships in the tarball) and `@objectstack/cli` (the message ships in
`dist`).

## Acceptance notes

- Premise corrected at claim (7247472854): #38381 already rewrote every
hand-written `content/docs` link into the nine namespaces. On
`origin/main` ff69bca, `git grep` for
`/docs/references/{api,identity,integration,kernel,marketplace,qa,shared,studio,system}`
outside the generated trees finds none in `content/docs`, none under
`/en/docs`, and no relative `../references/...` links.
- Moved to #38394 by the claim (Q1 = A): the skills example `docsUrl` in
`skills/objectstack-data/references/examples-objects.md` and the
AGENTS.md Documentation Guardrails row for
`packages/spec/docs/references/`. Both are governed and the skills path
mandates a higher tier.
- Not changed, per the claim: the hotcrm skills copy (synced from
`@objectstack/skills` and pinned in `skills-lock.json`), and history
mentions of the old paths (ADRs, audits, migration descriptions,
comments, `variant-docs.json` reasons).
- The other package READMEs that link `objectstack.ai/docs/references`,
`/references/security` or `/references/automation` point at the index or
at categories that stay on the site. They are unchanged.
- The live deploy reading the card asks for is posted on the card on its
own, from the 11-29 00:43Z scheduled deploy. It is not tied to this PR.

## Verification

All readings at head `710368a2`.

- **Two-minute check.** Move `packages/spec/docs/references` aside and
import the table: `node -e
"import('./apps/docs/reference-redirects.mjs')"` exits 1 with `Error:
reference-redirects: packages/spec/docs/references does not exist, so
the redirect table for the moved reference pages would be empty.
Generate it with \`pnpm --filter @objectstack/spec gen:docs\`.` Put the
folder back and it loads.
- **Read first:** `apps/docs/reference-redirects.mjs` (the two throws),
then the new battery at the end of `scripts/check-docs-redirects.mjs`'s
self-test, then the N4/N6 sentence in `locked-items.mdx`.

<details><summary>Redirect gate</summary>

- `node scripts/check-docs-redirects.mjs --self-test`: exit 0, 69
assertions (was 65), 9 batteries.
- `node scripts/check-docs-redirects.mjs`: exit 0. The reference table
still has 292 entries, with 290 repository destinations resolved against
the checkout and 2 on-site.
</details>

<details><summary>Derived gates</summary>

- `node scripts/pm/dispatch-gates.mjs --commands` derived 113 families.
All 113 ran and exited 0, and `--ran` reports 113 run, 0 NOT-MEASURED.
- 12 of them first exited 3 (prerequisite). They passed after `turbo run
build --filter='./packages/**' --filter='@objectstack/dogfood^...'`
under the verify lock (exit 0, 86 tasks). `check-plugin-teardown-shape
--self-test` passed after fetching its fixture commit.
- `dispatch-gates.mjs --tier` on this diff: no path-derived mandate. 79
changed lines, under the 3000 threshold.
- `overlap-check`: clean against `origin/main`, and no open PR shares a
file.
</details>

<details><summary>Package checks</summary>

- `pnpm --filter @objectstack/cli typecheck`: exit 0.
- `vitest run test/qa-suite-schema-load.test.ts test/commands.test.ts`
in `@objectstack/cli`: 2 files, 58 tests passed. No test pins the
`Reference:` line.
- `eslint --no-inline-config` on the three changed scripts and modules:
exit 0.
</details>

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

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

https://claude.ai/code/session_01L9qibvFXC2YadYHU4FMbqf

Co-authored-by: Claude <noreply@anthropic.com>
…ed, executed, failed or held elsewhere as that outcome (#38410)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XAqkG8y9atnquyRXBY4zVGV)_

Fixes #38344

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
控制台用户重新打开一段对话时,聊天里那张早已在别处(审批收件箱、另一个标签页)被批准、执行、失败或转人工审批的审批卡片,现在直接显示结果,不再显示「批准
/ 拒绝」按钮。
- 属于聊天内审批卡片的收尾:上一轮已让过期和被拒的卡片显示结果,这一轮补齐其余四种结果,并把每段对话的读取次数压到固定的两次。
- 出错时最坏情况是卡片仍显示按钮(与改动前一样),点下去会收到服务端拒绝;不涉及数据写入,撤回本改动即可回到原样。
- 无。

## What changes

`ui/packages/plugin-chatbot/src/useHitlInChat.ts` only (plus tests and a
changeset). No route, query parameter, status value, server change or
public export change.

**End states.** `settledDecisionOf` now maps every settled row status
from `PendingActionStatus` (`@objectstack/spec/contracts`: `pending |
approved | held | executed | failed | rejected`) to the decision state
the card already draws after its own press. The press path and the
restored path now share the same wording constants, so they cannot
drift:

| Row | Decision state | What the card says |
|:---|:---|:---|
| `executed` | `success`, `decision: approved`, `result` = the row's
stored `result` decoded | "Approved — action executed." (the press
wording) |
| `held` | `held`, `decision: approved` | "Waiting for approval"
(`aiApprovals.statusHeld`, the press wording) |
| `failed` | `error`, `decision: approved` | the row's `error`, or
"Action approved but execution failed." (the press fallback) |
| `approved` (approval taken, no outcome recorded yet) | `pending`,
`decision: approved` | "Approving…" — the state the card holds between
an Approve press and its answer |
| lapsed (`rejected` + `lapsed` + no `decided_by`) | `expired` |
unchanged |
| `rejected` by a person | `success`, `decision: rejected` | unchanged |
| `pending`, unknown status, no answer | none | buttons stay, unchanged
|

`approved` is the one status the press path never receives (the approve
answer is `executed | held | failed`), so it has no press wording of its
own. It maps to the in-flight state rather than to `success`, because a
`success` with `decision: approved` makes the record-write card say the
record was written, which an `approved` row does not record. No new
string was added.

The press-wins rule is unchanged: a read that lands after a decision
made on this card never overwrites it.

**The read bound.** The rows of one conversation are now read with at
most two requests in the common case, not one per card:

1. the first awaiting card's row by id (`GET …/pending-actions/:id`, as
before);
2. if more cards await and that row names its `conversation_id`, ONE
list read for the rest: `GET …/pending-actions?conversationId=ID`.

A card the list does not answer (past the list's row cap, a row with no
conversation, a failed list read) falls back to its own item read, so no
card is left unread. A single awaiting card, or a first row with no
`conversation_id`, behaves exactly as before.

Why this read and not "one list read filtered to the conversation's
pending ids", as the card suggested: the list route takes no id filter.
What it does take, read from this tree (the route handler itself is not
in this repository):

- `ListAiPendingActionsRequestSchema` in
`packages/spec/src/api/protocol.zod.ts`: `status`, `conversationId`,
`limit`, documented there as "Only the three the ROUTE reads";
- `@objectstack/client` `pendingActions.list`: sends exactly those
three;
- the AI Approvals inbox (`usePendingActions`): sends `status`,
`conversationId`, `limit`.

An id filter would be a new query parameter, which the card rules out.
The conversation filter is the narrowest read that exists, and the hook
gets the conversation id from the first row
(`PendingActionRow.conversation_id`) rather than from a new hook option,
so `UseHitlInChatOptions` and the console's call site are unchanged. No
`status` filter is sent, since every status is needed, and no `limit`,
so the server default applies; the fallback covers any card past it.

## Tests

<details><summary>New pins in
ChatbotEnhanced.restoredLapsedApproval-38250.test.tsx (the restored-card
harness), all green at HEAD 8bb62c2</summary>

Two new top-level `describe` blocks in the existing harness file:

- end states: executed, held, failed (with the row error and with the
fallback), approved, and the decoded stored `result` handed to the
decision;
- the bound: four cards read with exactly `GET …/pending-actions/pa_1`
then `GET …/pending-actions?conversationId=conv_1`; a card the list
leaves out gets its own item read; a first row with no conversation
sends no list read.

```
pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.restoredLapsedApproval-38250.test.tsx packages/plugin-chatbot/src/__tests__/useHitlInChat.test.tsx
 Test Files  2 passed (2)
      Tests  22 passed (22)
```

The four pins this file already held (lapse, person rejected, press
wins, pending or no answer) are unchanged and green: the lapse and
person-rejected paths and `pendingActionLapse.ts` are not touched.
</details>

<details><summary>Ablation, one mutation per behaviour, each restored to
the HEAD blob</summary>

All via `node scripts/ablation-replace.mjs` (anchor hit 1 to 0, restore
blob == HEAD blob `73b205115eb7`, `git diff HEAD` empty):

- the list read disabled (`listed` forced to `null`): 2 failed, 10
passed: the two bound pins went red, every end-state pin stayed green;
- the end-state mapping disabled (only `rejected` reaches the switch): 8
failed, 4 passed: every new pin red, the four existing pins green;
- the stored-result decode disabled (`JSON.parse` removed): 1 failed, 11
passed: the decoded-result pin alone.
</details>

<details><summary>Package, ratchet and console sweeps</summary>

```
pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-chatbot/ [16 ui ratchet test files] packages/app-shell/src/console/
 Test Files  383 passed (383)
      Tests  3363 passed (3363)

pnpm --filter @object-ui/plugin-chatbot run type-check   (after building its dependency closure)
 exit 0, 0 TS errors; tsconfig.test.json's program lists both changed files
```

`packages/app-shell/src/console/` was run as a whole directory (a
superset of the `console/*.test.tsx` the card's seat asked for). It
includes `AiChatPage.approvalRehydration.test.tsx`, which pins a single
card's read URL.
</details>

## Acceptance notes

- **`approved` → in-flight.** A judgment call. The other honest reading
would be a new "Approved" line, which is a new string. Flagged in the
report as an open question, with a recommendation to keep this.
- **Routing (seat repo:objectstack#5):** the card's wording "the same
wording the card uses after its own press" covers `approved` → A
("Approving…", the state after an Approve press until its answer); not a
maintainer decision. B (`Status: approved`, which draws `written` early)
and C (new copy) are out.
- **Not filed, read only:** `countWritesAwaitingApproval` (app-shell)
counts a decision in state `error` as a write still awaiting approval. A
press whose approve answers `failed` (a terminal row) draws `error`, so
it is counted. A restored `failed` row now draws `error` too, which
leaves its count where it was before this PR (an undecided card was
counted already). Executed, held and approved rows stop being counted,
which is correct. Not measured on a host.
- The list route's handler is not in this repository, so its honouring
of `conversationId` was read from the spec schema and the two existing
callers, not measured. If a host ignored the filter, cards are still
matched by id and any card it misses falls back to its own read.

## Verification

Read first, by risk:
1. `useHitlInChat.ts`, the read effect (`settleCards`): the two-step
read and the per-card fallback.
2. `useHitlInChat.ts`, `settledDecisionOf`: the status mapping,
especially `approved`.
3. The new `describe` blocks in
`ChatbotEnhanced.restoredLapsedApproval-38250.test.tsx`.

Two-minute check: `pnpm --dir ui exec vitest run
packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.restoredLapsedApproval-38250.test.tsx`.
Expect 12 passed, including "reads the first row by id, then every other
row through one list read of its conversation".

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

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5nvFivDeQyYgTFkZhi -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
…ls at once instead of being re-sent whole three more times (#38407)

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

Fixes #38270

Clause-②: no
Metadata-protocol: none

## 维护者速读
- 在控制台上传文件时,存储服务明确拒收(签名过期 403、令牌过期 401、文件太大 413)现在立刻报错,不再把整个文件再传 3 次、多等约
3.5 秒。
- 只有"暂时失败"才自动重传:断网、408/425/429/502/503/504,沿用仓里唯一一份 `TRANSIENT_STATUS`
定义。取消上传照旧不重传。
- 代价:直传 S3 偶尔遇到 500 时会直接报错,不再自动重传(500 不在那份定义里,是它有意的决定)。
- 无

## What changes
- `ui/packages/data-objectstack/src/upload-adapter.ts`,
`uploadWithProgress` (step 2 of the presigned flow, the byte upload): a
failure that carries an HTTP status is retried only when the status is
in `TRANSIENT_STATUS` from `@object-ui/types` (408, 425, 429, 502, 503,
504), the one definition of "not now" `http-retry.ts` keeps for the
whole tree. Any other refusal throws at once. A failure with no HTTP
answer (a network error, the XHR `onerror`) is retried as before, and an
abort is never retried, as before. No second definition is written.
- 500 is not retried. `http-retry.ts` already decides that (a genuine
server fault). Cost, accepted in the claim: an S3 `500 InternalError` on
a direct presigned upload, which AWS documents as retryable, now fails
at once instead of being re-sent.
- Rider (accepted in the claim): the byte refusal now goes through the
same file's `refusalOf` on both the fetch path (reads `res.text()`) and
the XHR path (reads `xhr.responseText`), so it carries the server's
error `code` beside its `status` when the answer was the declared
envelope, as the presign and completion refusals already did.
`uploadFile` / `uploadFiles` map that code to `serverCode`. The local
raw PUT answers the envelope (401 `INVALID_TOKEN` for an expired upload
token); S3 answers XML, which `refusalOf` leaves as status only.
- `ui/packages/types/src/upload.ts`: the `maxRetries` JSDoc says which
failures it counts. No type change.
- `patch` changeset for `@object-ui/data-objectstack` and
`@object-ui/types`.

## Tests
- New `ui/packages/data-objectstack/src/upload-retry-38270.test.ts`: a
fake storage service answers the byte PUT, and each case runs on both
the fetch path (no `onProgress`) and the XHR path (an `onProgress` and a
stand-in `XMLHttpRequest`, unstubbed after each test). 8 cases × 2
paths:
- 413 `FILE_TOO_LARGE`, 403 and 401 `INVALID_TOKEN`: one byte request,
the error carries the status (and the code where the envelope has one).
  - 500: one byte request.
- 503 then 200: two byte requests, upload succeeds. 503 forever with
`maxRetries: 3`: four byte requests, then the 503 is thrown.
  - Network error then 200: two byte requests.
- Abort during the retry wait after a 503: `AbortError`, one byte
request.

<details><summary>Readings at 8ac6117 (base origin/main
f42bcc1)</summary>

- Premise at f42bcc1: `uploadWithProgress` (upload-adapter.ts 213-247)
rethrew only `AbortError` and retried every other failure up to
`maxRetries` (default 3), 500 × 2^n ms apart: 0.5 + 1 + 2 = 3.5 s for a
refusal that cannot change. `UploadOptions.maxRetries` was already
documented as retries "on network failure".
- New pins: `Test Files 1 passed (1)`, `Tests 16 passed (16)`.
- Request counts, read from the pins: 403 → 1 byte request with the fix,
**4** with the gate ablated (`expected 4 to be 1`); 503 then 200 → 2;
503 forever → 4 (1 + `maxRetries`).
- Ablation 1, the `TRANSIENT_STATUS` gate line replaced by a no-op:
`Tests 8 failed | 8 passed (16)` — 413, 403, 401 and 500 on both paths.
Restored after.
- Ablation 2, the two `refusalOf` calls put back to the status-only
error: `Tests 4 failed | 12 passed (16)` — the 413 and 401 code
assertions on both paths. Restored after.
- Ablation 3, the loop's `signal.aborted` check removed: `Tests 2 failed
| 14 passed (16)` — the abort pin on both paths (`expected 'Error' to be
'AbortError'`, `expected 2 to be 1`). Restored after.
- `pnpm --filter @object-ui/data-objectstack test` (under the verify
lock): `Test Files 129 passed (129)`, `Tests 1466 passed (1466)`,
`VERDICT command-exit 0`.
- `pnpm --filter @object-ui/data-objectstack --filter @object-ui/types
run type-check`: exit 0 (the package `tsconfig.json` includes
`src/**/*`, the new test with it).
- `dispatch-gates.mjs --tier`: no path-derived mandate, default tier;
273 changed lines, under 3000.
- `overlap-check.mjs` at 8ac6117: `VERDICT clean exit 0`, 0 open PR
heads touch the changed files.
- Derived gates (`dispatch-gates --commands`, 38): 38 run at 8ac6117,
every one exit 0 (each command, its exit code and its verdict line:
`/mnt/project-files/card-38270/gates-results-8ac61177.txt`).
`dispatch-gates --ran`: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.
`pnpm --dir ui exec vitest run scripts/` (under the verify lock) and
`check:type-check-debt` included.
- PR check-runs at 8ac6117: 45 success, 13 expected skip, 0 unexpected
skip, 0 failed, 0 pending; `mergeable_state` clean (`pr-state.mjs`).
</details>

## Acceptance notes
- None.

## Verification
Read first (by risk):
1. `upload-adapter.ts`, the `catch` in `uploadWithProgress`: the
`TRANSIENT_STATUS` gate sits after the abort rethrow and before the
attempt budget.
2. The two `refusalOf` calls (fetch `!res.ok`, XHR `onload` non-2xx).

Two-minute check: `pnpm --dir ui exec vitest run
packages/data-objectstack/src/upload-retry-38270.test.ts` passes 16/16;
replace the `TRANSIENT_STATUS` gate line with a no-op and 8 go red (a
403 then makes 4 byte requests instead of 1).

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

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

https://claude.ai/code/session_01L9qibxgdN9nHqqceW6yq9Q

<!-- signed: repo:objectstack#3 · os-tesla ·
session_01L9qibxgdN9nHqqceW6yq9Q -->

Co-authored-by: Claude <noreply@anthropic.com>
…eads it (#38398)

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

Fixes #37753

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no `skills/**` file names any of the six exports or
`data-build-progress` (`git grep -n -i
"build-progress\|BuildProgress\|BUILD_PROGRESS" -- skills/` returns
nothing)

## 维护者速读

- 是什么:spec 里给 build 对话进度面板用的流式帧定义(`ai/build-progress.zod.ts`,6
个导出)整个删掉。它唯一的读方(控制台的 build 进度面板)已随 build 对话前端删除,云端产生它的 build
循环也已删除(cloud#5046 已合并),现在没有任何代码读它。
- 为什么:没人读的导出 schema 会被下一个读者当成平台还有这个能力(ADR-0049 留或删)。
- 出错会怎样:用户无感,元数据作者无感(它从来不是可编写的元数据)。若有宿主代码还 import 这 6
个名字,升级后编译报错,changeset 里写了改法:删掉 import。可整体撤回。
- 要你做什么:批准这个拉取请求——它收窄了 `@objectstack/spec` 的公开导出,属 Tier H。

## What changes

`packages/spec/src/ai/build-progress.zod.ts` and its test are deleted,
with the `ai/index.ts` re-export. The six exports leave
`@objectstack/spec/ai`: `BuildProgressFrameSchema`,
`BuildProgressFrame`, `BuildProgressPhaseSchema`, `BuildProgressPhase`,
`BUILD_PROGRESS_PHASES`, `BUILD_PROGRESS_FRAME_TYPE`.

Route: the playbook's "nobody parses it" row (`spec-property-retirement`
§2). The frame was a stream payload, never a metadata type, so there is
no tombstone, no D2 conversion and no liveness-ledger row. What the
build asks for a whole-def removal is there:

- `RETIRED_DEFS_BY_MAJOR[19]`:
`retired-defs/19.ai__BuildProgressFrame.ts`,
`retired-defs/19.ai__BuildProgressPhase.ts` (the manifest deletion gate
names both).
- D3 semantic `ai-build-progress-frame-retired`
(`semantic/19.ai-build-progress-frame-retired.ts`), so the upgrade guide
tells a host what to delete. The changeset's ADR-0087 marker is
`registered ai-build-progress-frame-retired`. `runtime-export-retired`
does not fit: its predicate 2 refuses an operand declared in a
`*.zod.ts`.
- Deliberate baseline deletions: `json-schema.manifest/ai.json` (2 defs)
and `authorable-surface/ai.json` (3 keys). The build's check (c) accepts
the second because the whole def leaves. `authorable-surface.base.json`
is the pinned anchor and is not touched.
- Regenerated: `api-surface/ai.json` (−6), `export-origins/ai.json`
(−6), `declaration-map/ai.json` (−4), the reference docs
(`content/docs/references/ai/build-progress.mdx` removed, both indexes),
and the strictness-ledger counts.
- `type-alias-convention.pin.test.ts`: the M188 import leaves (slot
stays vacant, as for M166), the two `Iso_ai_buildProgress__*` pins
leave, and the count goes 881 → 879 in the assertion and both prose
counts.
- Three comments that cited the module as a precedent are reworded:
`contracts/ai-service.ts` (`onProgress`), `ai/record-citation.zod.ts`,
`ui/component.zod.ts` (which now says its remaining precedent,
`DashboardWidgetConfigSchema`, is declared in `ui/packages/types`).
- `packages/spec/llms.txt` (hand-kept, ships in the tarball): the schema
inventory count 233 → 232, the `ai` row 18 → 17 and its "Build Progress"
entry removed (contract review 7247625401 M2; `check:llms-txt`).

Changeset `.changeset/37753-build-progress-frame-retired.md`:
`@objectstack/spec` **minor** (kind `narrowed`), BREAKING banner, one
FROM → TO line per export group. The claim said `Metadata-protocol:
none`; `Check Changeset` reads the three removed
`authorable-surface/ai.json` rows as a narrowing and refuses `none` (run
46202350592 on 5036e03), so the line and the level follow the gate
(7b40319).

## Premise

- This repo, exact-name `git grep` of all six exports at `main` 600197a
and again after merging `main` ff69bca: zero code readers. Hits were
only the module, its test, the type-alias pin, the generated baselines,
the reference page, CHANGELOGs and three prose citations. Control, same
instrument: `KnowledgeBuildProgress` has live readers in
`service-knowledge` and `cli`. Under `ui/`, only three comments
(`plugin-chatbot/src/chat/liveness.tsx` twice,
`plugin-chatbot/src/toolResultParsers.ts:138`) and one test fixture
literal `'data-build-progress'` in
`useObjectChat.setMessagesHonest-8342.test.tsx` remain; none imports the
spec.
- Cloud: `objectstack-ai/cloud` is outside what this thread can read.
The premise that cloud no longer produces or imports the frame rests on
the maintainer's word, relayed by seat 2 on 2026-11-28 23:24Z: 「5046
已合并」 (cloud#5046, the cloud producer's removal, has merged). Card step 3
("order after cloud#5046") is therefore met.

## Verification

<details><summary>runs</summary>

Head 5036e03 (after `git merge origin/main`, no rebase); 7b40319
changes only the changeset's level and kind line, and
`check:adr-0087-registration` was re-run on it (exit 0,
`metadata-protocol-narrowed`). Rework for contract review 7247625401:
1d77b3a (M2, `llms.txt`) and 45c0e27 (S1, the changeset's fix line
names `ToolExecutionContext.onProgress`; N1, the `component.zod.ts`
comment). At 45c0e27, after a fresh spec build: `check:generated`
14/14, `check:llms-txt` 98 claims re-derived (232 schemas),
`check:adr-0087-registration` exit 0.

- `pnpm --filter @objectstack/spec build`: exit 0. The first two runs
went red on purpose, first on the manifest rows and then on the
authorable-surface rows, and each remedy above was applied.
- `pnpm --filter @objectstack/spec check:generated`: exit 0, 14/14
current.
- `pnpm check:adr-0087-registration`: exit 0 (self-test 871 assertions;
`registered ai-build-progress-frame-retired (new here)`).
- `pnpm --filter @objectstack/spec typecheck` (tsc, scripts typecheck,
test-typecheck): exit 0.
- `vitest run` on `src/type-alias-convention.pin.test.ts src/migrations
scripts/build-schemas-check-mode.deletion-proofs.test.ts src/ai`: 31
files, 791 tests passed.
- `node scripts/pm/overlap-check.mjs`: VERDICT clean.

</details>

**Dogfood battery** at 45c0e27: `pnpm --filter @objectstack/dogfood
test` under the verify lock after building its closure, VERDICT
command-exit 0, 495 test files passed (3 skipped), 4183 tests passed (68
skipped). Browser pass on `app-showcase` (own port, `--seed-admin`,
console built from this head): the boot log has no build-progress line,
the showcase app renders with zero console errors, and discovery reports
`services.ai` `enabled: false` (no AI service ships in the open
framework), so no assistant entry renders. A real tool-calling assistant
turn is NOT MEASURED: this container has no model provider key.

## Out of scope

- `docs/adr/0037-live-canvas-draft-preview.md` still lists
`data-build-progress` parts as shipped, and the three
`ui/packages/plugin-chatbot` comments cite the part name. Not touched
here (an ADR edit is its own tier); carrier: #38402.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(a module removed, nothing added)
- [x] 2. Every name I added uses the casing for its kind. (entry ids
only)
- [x] 3. No formatter ran.
- [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/releases/`.
- [x] 8. Title, body and comments are in English. (the 维护者速读 summary is
the seat's Chinese summary for the maintainer)

The branch is `claude/project-thread-akskmv`, assigned by the platform
rather than the repo's `claude/issue-<n>-…` convention.

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

https://claude.ai/code/session_01L6bhgVih5qknszNdfFQwYb

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
…e is enabled by configuration (#38401)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XDXvJPPtrTGfdDYhWWpihq5)_

Fixes #38368

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:用户无感;只在知识平台的架构决策记录里加一条带日期的注记,写明知识服务挂上不等于启用:私有部署配齐嵌入参数和存储才启用,没配齐时所有知识源都留着、管理员列得出,但不建索引、不同步、不能搜,也不能保存或移入应用包。
-
为什么做:属于知识平台专题;您定的规则(同一套元数据,私有部署看参数配没配,云端不管)和您随后裁定的四处细节,现有条文都没写,随后的实现要有据可依。
- 出错会怎样:只改一份文档,运行行为不变;条文若写错,碰到的是随后照它做实现的人,可以直接撤回。
- 要你做什么:审阅并合并这份注记(受管面,由您批准合并)。

## What changes

One file,
`docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md`,
22 lines added and none removed against `main`, in three places:

- **Header.** A third `**Amended**` line, dated 2026-11-28, beside the
two that are there. It names both sources of the note: the maintainer's
words of 2026-11-28 and the four points he ruled on 2026-11-29. The
status line is left as it is.
- **K4.** A cross-reference appended to the existing cross-reference
block, in the shape of the one dated 2026-11-26. It says which two texts
of K4 are read with the new note (clause 3, "A real consumer", and
"Source admission at save") and closes with "No sentence of this record
is changed."
- **K8.** A third dated note after the two notes under the table, read
with item 12:
- item 12 is unchanged, and mounted is not enabled; the maintainer's six
sentences of 2026-11-28 are quoted verbatim, untranslated and in order;
- **Enabled**: at `kernel:bootstrapped` an embedder is available and the
deployment's store is mounted, which means its adapter is registered;
read once per boot;
- **Not enabled: held, not served**: sources are loaded and listed to
administrators, and not built, synced, reconciled or searched; no tool
definition is handed out; a direct search is refused with a coded
refusal and never answered empty; the state is said once in the boot's
log;
- **Enabling is an egress decision** (K5); the boot that first finds
both halves runs K7's boot pass;
- **The switch** is the existing setting `ai.embedder_provider`, default
`none`;
- the three ◆ choices ruled on 2026-11-28 by 「以上都同意」, each quoted in the
card's words: an author's save, the log line, a service the host mounts;
- the four ◆ points ruled on 2026-11-29 by the maintainer's choice of
the decision card's option 「全按推荐(1A 2A 3A 4A)」, each under the number
the ruling record gives it (comment 7248214179 on the card):
- point 1: the package move-in of a package-less source is an author's
save, refused while the service is not enabled, and no door value is
added;
- point 2: the state is the whole service's, so every source of a
runtime-mounted service is held, whichever store it names; an
application whose store embeds on its own mounts the knowledge service
itself;
- point 3: the service registers no lifecycle reap guard and calls no
store, so a retention sweep deletes its rows on time; an entry left in a
store that holds an earlier index joins the known gap, and K3 item 3 is
read with the note as the promise of an enabled service;
- point 4: the refusal of an author's save names the half that is
missing;
- **A known gap**, **Alternatives not taken**, and **Cloud is out of
scope**;
- the closing paragraph: no contract member, no settings key, no
capability token; `main` has no such state until the implementation card
#38369 lands; "The table is left as written; read item 12 with this
note."

The K8 table and every earlier sentence of the record are untouched. No
file outside `docs/adr/` changes.

**Read first, by risk** (one file, three bullets of the K8 note):

1. **Point 2, the state is the whole service's.** It is the one bullet
that declares a narrowing: on `main` a source on an application's store
that reads no embedder is built and searched under a runtime-mounted
service, and under this note it is held. The bullet says so and says it
is a named part of the narrowing #38369 declares.
2. **Point 3, no reap guard and no store call.** It is read against K3
item 3 ("an index entry never outlives its row") and the header's
"Leaves unchanged" list. The bullet states the reading and changes
neither sentence.
3. **Point 4, the refusal names the half that is missing.** The store
sentence, "mount the deployment's knowledge store, restart, then save",
is this area's English. The ruling record says it was not put to the
maintainer word for word and is the delta review's to read.

## Tests

No package is touched, so there is no build closure to build and no
package test to run. A record is prose: nothing here is ablated. The
checks that read the changed file are listed under Verification.

## Acceptance notes

**The card's acceptance.**

- The note sits under K8 and ends with the line "The table is left as
written; read item 12 with this note".
- K4 carries a cross-reference.
- The three ◆ choices of 2026-11-28 are recorded as ruled, each in the
card's words inside quotation marks, and are unchanged by the second
commit.
- `git diff origin/main...HEAD --stat` reads one file, 22 insertions.

**The contract review's findings on the first head (comment 7247818861
on this pull request), and the ruling that answers them.**

- The open choice of the first report, move-in: ruled, point 1. The two
sentences that said the note did not decide it are replaced.
- S1, a source on a store the application registered: ruled, point 2.
- S2, the lifecycle reap guard: ruled, point 3, and one sentence added
to **A known gap**.
- S3, the save remedy when the store is the missing half: ruled, point
4, and "the boot that first finds an embedder" now reads "the boot that
first finds both, an embedder and the deployment's store".
- N1, applied: the K4 cross-reference says "listed to administrators".
- N2, applied: the log-line bullet says the rule is about this state
alone, and that a declared capability whose provider cannot be built
still fails the boot, as before.
- N3, not applied in the record: the Consequences sentence on index
state, "The service keeps none of its own", is an earlier sentence and
is left as written. It reads against the per-source sync state row that
landed with pull request #38307. It stays a follow-up for a later
revision of the record.
- N4, applied: **Enabled** says the store is mounted when its adapter is
registered, and that whether a registered store can open its database is
outside the note, which declares no boot probe of it.

**What the note says about code, read on `main`.** The files the note
cites are byte-identical at `ff69bcabb2`, where they were first read,
and at `3579cf136d`, which this branch has merged. Every anchor is a
`path#symbol` or a file, as the record's anchor check requires.

- The knowledge plugin provides its embedder from a
`kernel:bootstrapped` hook: it keeps one another plugin registered, else
builds one from the saved settings, else registers a stand-in whose
every use is refused
(`packages/services/service-knowledge/src/knowledge-service-plugin.ts#provideEmbedder`).
`embedder_provider` defaults to `none`, and a saved default counts as
not configured.
- The settings description of that key reads "Read when the server
starts: a saved change to any embedder setting takes effect after the
next restart."
(`packages/services/service-settings/src/manifests/ai.manifest.ts#aiEmbedderSettingsSpecifiers`).
- Ruling D's three save doors ask `authoredKnowledgeSourceRefusal`: the
REST `PUT /meta/:type/:name`, the dispatcher's same route, and the MCP
draft save. The package duplicate door is `POST
/packages/:id/duplicate`, through `refuseDuplicatedKnowledgeSources`,
with the predicate's `duplicate` door. `POST /packages/:id/move-in` asks
the same predicate with the default door, `save`.
- A scheduled reconcile exists: `scheduleReconcile` registers a daily
job on the job service by default, and an option turns it off. A
reconcile walk removes the documents of rows that were deleted, for a
store that lists its documents.
- Composition is decided from the stack and the process environment
before the kernel starts; the settings service reads saved values only
once its data engine is bound at `kernel:ready`; the embedder settings
section is contributed by the knowledge service itself
(`contributeKnowledgeSettings`). Both halves of the first alternative
hold.
- For point 2: the service core never reads the embedder service, and
the in-memory store plugin reads none, so on `main` a source on such a
store builds and is searched with no embedder saved.
- For point 3: the reap guard's work is a store call
(`packages/services/service-knowledge/src/knowledge-reap-guard.ts`), and
a failed call keeps the row.
- For N2: under `os serve` a declared capability whose provider cannot
be provided is a hard boot error, and a capability the stack's items
mount is read as declared
(`packages/core/src/capability-composition.ts`).
- K9 rule 1, K7 rule 5, K8 rule 2, K5, K1, K3 item 3 and ADR-0078 §4
each say what the note cites them for.

**Places where the note's wording departs from the card's, each on a
reading of `main` or of the ruling record.**

1. Card point 9 gives the reason "(the service keeps no state of its
own)". That no longer holds: a per-source sync state row landed on
`main` after the card's evidence commit (pull request #38307;
`packages/services/service-knowledge/src/knowledge-sync-state.ts`). The
gap itself stands, for a different reason, and the note states that one:
the row holds a source's last build and its failed syncs, and a change
that was never attempted is neither.
2. Card point 4 says the enabling boot "builds every held source and
names each". Read literally that contradicts point 9, since a store that
already holds a current index is not rebuilt. The note says the boot
runs K7's boot pass over every held source and names each one it builds,
and that a source held since it was first loaded is built whole.
3. Ruling D's item 5 cites the capability file by line number. The
record's anchor check refuses line anchors, so the note cites the same
place as
`packages/spec/src/kernel/platform-capabilities.ts#PLATFORM_CAPABILITY_TOKENS`
and quotes the comment's words, "Requested, never always-on".
4. The note keeps its date, 2026-11-28, the day of the maintainer's
words and of the first three choices. The four later points carry their
own date, 2026-11-29, in the header line, in the note's first paragraph
and in each bullet's title.

**Noted, not filed, and not changed here.**

- The stdio MCP bridge reads the knowledge service in its `start()`,
before `kernel:bootstrapped`, the event at which the note says the state
is read. The implementation card #38369 has to make `search_knowledge`
absent on that transport too; the note states the outcome and leaves the
mechanism to that card.
- The Consequences sentence named under N3 above.

## Verification

**Two-minute check.** Open the Files changed tab: one file, 22 lines
added, none removed. The K8 note carries four bullets whose titles begin
"◆ Ruled 2026-11-29 (point", and its last line ends with "The table is
left as written; read item 12 with this note."

<details>
<summary>Local checks on head 83e9252 (the 21 commands derived for this
diff)</summary>

Derived with `node scripts/pm/dispatch-gates.mjs --commands` and
reconciled with `--ran`:

`✓ dispatch-gates --ran: 21 derived famil(ies) accounted for — 21 run, 0
NOT-MEASURED`

Each exit code was captured before any pipe.

| Command | Exit |
| --- | --- |
| `node scripts/check-adr-links.mjs` | 0 |
| `node scripts/check-adr-links.mjs --self-test` | 0 |
| `node scripts/check-closing-keyword-parity.mjs` | 0 |
| `node scripts/check-closing-keyword-parity.mjs --self-test` | 0 |
| `node scripts/check-comment-mask-corpus.mjs` | 0 |
| `node scripts/ci/plan-test-core-shards.mjs --self-test` | 0 |
| `pnpm --filter @objectstack/lint run check:doc-formula-expressions` |
0 |
| `pnpm check:adr-anchors` | 0 |
| `pnpm check:adr-index` | 0 |
| `pnpm check:adr-symbol-anchors` | 0 |
| `pnpm check:ci-filter-parity` | 0 |
| `pnpm check:closed-ceremony-text` | 0 |
| `pnpm check:cross-package-test-inputs` | 0 |
| `pnpm check:doc-authoring` | 0 |
| `pnpm check:driver-memory-census` | 0 |
| `pnpm check:gitlink-declared` | 0 |
| `pnpm check:nul-bytes` | 0 |
| `pnpm check:pm-governed-merges` | 0 |
| `pnpm check:pm-prior-rulings` | 0 |
| `pnpm check:refd-timer-probe` | 0 |
| `pnpm check:watch-hint-literal` | 0 |

Verdict lines the checks print:

- `check-adr-links: 1268 relative link destination(s) under docs/adr/
resolve`
- `check-adr-symbol-anchors: 4538 anchors across 164 records resolve`,
with 0 line anchors surviving
- `adr-index --report: OK — docs/adr/README.md is current, every record
parsed`
- `check-nul-bytes: OK`, no raw ASCII control bytes

The repo-wide scans and the full check farm are left to CI.

</details>

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oQLfL8thb6wtUHnTb -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
…udges a board's group field (#38430)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XAqkG8y9atnquyRXBY4zVGV)_

Fixes #38153

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户无感:只改对外发布的技能包里教 AI 做看板的一处文字,把“分组字段要用选项字段”的口头提示换成指向已上线的那条检查和它给的首选改法。
- 属于「发布时拦下保存成功却用不了的元数据」这组检查的技能包收尾:检查上线后,技能包里口头教的同一个坑让位给检查本身。
- 只是一句教 AI 的话,写错最多让 AI 学到一句不准的说法,可以直接撤回这次修改。
- 无

## What changes

One published skill page, `skills/objectstack-ui/rules/list-views.md`,
in its kanban section. `skills/objectstack-ui/SKILL.md` is not changed
(measured below: it teaches none of the six traps).

- The kanban example no longer carries the comment "a select field"
beside `groupByField`.
- A two-line note under the example takes its place: "Group by a
single-valued `select`, boolean or lookup: a text, number or date field
or a multi-valued one warns
`list-view-kanban-group-field-uncategorical`." The first half follows
the rule's own hint in
`packages/lint/src/validate-list-view-field-refs.ts`
(`checkKanbanGroupField`); the fields that warn are named in the rule
explanation's terms. The hint's second remedy, a grid grouping, is not
taught: the engine refuses that grouping for a multi-value,
structured-JSON or formula field (contract review S1, record 7248601916;
follow-up #38433).

**Each of the six rule ids of PR #38107, measured against both files at
`f42bcc18`:**

| Rule id | `rules/list-views.md` | `SKILL.md` |
|:--|:--|:--|
| `list-view-filter-field-virtual` (error) | not taught, no change.
Filtering (lines 94-119) and the quick-filter rules (lines 140-154) name
no formula field. The two `formula` mentions (lines 184 and 202) are the
search axis, already named by `searchable-field-unsearchable`. | not
taught, no change |
| `list-view-kanban-group-field-uncategorical` | taught as prose at line
267 (the example comment "a select field"): changed | not taught as this
trap, no change. Line 89 describes the kind ("a board by status"); lines
99-100 are another trap (a board over a field added in the same change
opens empty), which none of the six rules judges. |
| `dashboard-without-widgets` | not taught, no change | not taught, no
change |
| `app-navigation-empty` | not taught, no change | not taught, no
change. App Navigation (lines 103-108) says one app per package and that
hiding is not gating. |
| `object-unreachable-from-navigation` | not taught, no change | not
taught, no change |
| `object-without-view` | not taught, no change | not taught, no change
|

None of the six ids appeared anywhere under `skills/` before this change
(`grep -rn` over the tree, zero hits; control:
`searchable-field-unsearchable` hits).

**Paid for in the same file (token ratchet; no ceiling row moves).**

| Cut | Bytes | Where it still lives |
|:--|--:|:--|
| the comment "a select field" and its padding | 33 | replaced by the
note |
| alignment padding before the two "optional, default true" comments of
the kanban example | 28 | the comments stay |
| the sentence "`summary`, `showFieldLabels` and `hideEmptyFields` are
optional." and the line break it left | 67 | the example marks the two
card keys "optional, default true"; the note still says "Omit `summary`
to keep the older `summarizeField`'s sum" |
| alignment padding before the comment "open, OR urgent" in the
Filtering example | 33 | the comment stays |

161 bytes cut, 162 added.

Skill size readings, base `f42bcc18`, head `6395a44f`:

| | lines before | lines after | bytes before | bytes after | tokens
before | tokens after |
|:--|--:|--:|--:|--:|--:|--:|
| `skills/objectstack-ui/rules/list-views.md` | 412 | 414 | 18038 |
18039 | 4510 | 4510 (ceiling 4510) |
| `skills/objectstack-ui/SKILL.md` (untouched) | 164 | 164 | 8937 | 8937
| 2228 | 2228 (ceiling 2228) |
| every published `SKILL.md`, summed | 4386 | 4386 | | | | |
| whole shipped bundle | | | | | 304822 | 304822 |

Net over `skills/**`: 8 lines added, 6 removed.

## Why

PR #38107 made `os validate`, `os lint`, `os build` and the publish door
warn on a board grouped by a field with no fixed lanes. Card #35143's
Scope says: "When a family lands, the matching trap leaves the published
skills where it is taught as prose." The kanban example taught it as a
three-word comment, and incompletely: a boolean or a lookup draws fixed
lanes too. The page now names the rule, its first fix and the fields
that warn.

## Tests

Prose and comments only: no unit test changes, no ablation, no eval case
edited and no eval round run.

Local gates, run on head `6395a44f` (the final commit, clean tree) after
`turbo run build` over the workspace (verify lock: `VERDICT command-exit
0`):

```text
✓ dispatch-gates --ran: 48 derived famil(ies) accounted for — 48 run, 0 NOT-MEASURED (a DERIVED zero — all 48 recorded an exit code and none of them is 3).
```

<details><summary>verdict lines of the gates that read the
page</summary>

```text
✓ check-skills-token-ratchet: skills/objectstack-ui/rules/list-views.md is 4510 tokens (ceiling 4510; headroom 0).
✓ check-skills-token-ratchet: 61 authored bundle file(s) within their ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured, not ratcheted.
✓ check-skill-served-sections: 24 served section(s), each heading exactly once in its file (6 json, 2 json+ts, 16 neutral); 10 JSON fence(s) parse and pass their spec validators.
✓ check-skill-links: 281 relative link(s) in 76 published skill file(s) resolve; 149 fragment(s) name a real heading under GitHub's slug rule.
check-nul-bytes: OK (scanned 28762 text file(s) -- 28762 tracked, 0 untracked-not-ignored; skipped 101 binary; no raw ASCII control bytes).
```

Outside the derived list, run on `85c42af4` because the kanban block is
a checked example (the block is unchanged since): `pnpm --filter
@objectstack/spec run check:skill-examples` under the verify lock,
`VERDICT command-exit 0`, "352 prose examples type-check across 3
surface(s)".

`node scripts/pm/overlap-check.mjs` before each push: `VERDICT clean
exit 0`.

</details>

Everything else is CI's run: the check-runs on this pull request are the
record.

## Acceptance notes

- **Premise, re-read on `main` at `f42bcc18`:** it holds for one id of
the six. The six ids are live in `packages/lint/src` and none was named
in `skills/`. Only the board's group field was taught as prose, and only
in `list-views.md`.
- **No other file of this skill teaches one of the six traps as prose.**
`rules/navigation.md` was read in full; `rules/dashboards.md`,
`rules/pages.md`, `rules/record-page.md` and `rules/actions.md` were
searched by keyword (empty dashboard, navigation reach, list view,
board, formula filter). `rules/dashboards.md` lines 106-108 say a
`formula` is refused as a dataset dimension or `groupBy`: that is the
dataset contract, not a list view filter.
- **Noted, not filed:** `skills/objectstack-formula/SKILL.md` lines
430-435 say a `where` on a `formula` field answers `400 INVALID_FIELD`.
That is the engine's refusal for every query; the new list-view rule
covers one producer of such a query, so the sentence stays true and is
left alone.
- **`radio`:** the rule also passes a `radio` field
(`KANBAN_CATEGORICAL_TYPES`), though its hint names `select` only. The
note follows the hint for what to group by and names only the fields
that do warn, so it does not claim a `radio` field warns.
- **Budget:** two lines net on one file; `SKILL.md` unchanged at 8,937
bytes.
- `skills/**` is a governed path: this pull request stays a draft, and
its contract review is the seat's to arrange.

## Verification

Read first: the note under the kanban example in
`skills/objectstack-ui/rules/list-views.md`. The risk hunk is the
removed "optional" sentence in the note below it.

Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints
`skills/objectstack-ui/rules/list-views.md` at 4510 / 4510.

## 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.
- [ ] 3. No formatter ran; `pnpm lint` is the CI-owned repo scan, 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` 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 by [Claude
Code](https://claude.ai/code/session_01FEkQ5nvFivDeQyYgTFkZhi)_

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5nvFivDeQyYgTFkZhi -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
…ectstack-data teaches the four locks (#38428)

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

Fixes #37405

Clause-②: no (no accept set or export changes; governed rules text, so
one contract-review-tier review before the queue; Tier H)
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:给应用建数据模型的人和
AI,现在能从技能里学到「锁定一个字段」的四种写法各在什么时候用(比如销售订单的状态只让「确认」按钮改、不让人手改);把两种锁同时配在一个字段上时,校验报错会指出该看哪份设计说明。平台行为不变。
- 为什么做:你对「字段只读分两级」那张决策卡已经定了长远模型,功能也已上线,但设计说明和技能里一直没有记下来,这一步是补上记录。
- 出错会怎样:最坏是说明里某句话和平台实际做法对不上,作者照着配错了锁;只改文字和一句报错提示,可以直接撤回。
- 要你做什么:设计说明和技能文件的改动需要你批准合并。

## What changes

No key, schema, accepted value, default or runtime behaviour changes.
This records the ruling of record on #36806 (ruling record 7180466652,
「按长远模型」) and the two object-level rulings on #37402 (ruling records
7235326611 and 7237772411), whose code landed in #37436, #37888 and
#38169.

-
`docs/adr/0163-field-write-locks-two-tiers-two-forms-two-levels-ui-prefix-admission.md`
(new, `Accepted (2026-11-26)` on the ruling record; it reaches `main`
only by the Tier H approval). D1 two tiers (server lock `readonly` /
`readonlyWhen`, hand lock `uiReadonly` / `uiReadonlyWhen`), D2 two forms
(`readonlyWhen: P\`true\`` is the set-once spelling), D3 two levels (the
object's `uiReadonlyWhen`; a field's own declaration wins; `uiReadonly:
false` is not a declaration), D4 what "by hand" is, D5 the admission
rule of the `ui` prefix (`uiVisibleWhen` / `uiRequiredWhen` are not
admitted), D6 contradictions, D7 the server lock stays a strip. The
record keeps two kinds of statement apart: Decision carries only what
the rulings say, quoted; "As built" says what `main` does at `c610020e`,
by symbol anchor. A third section, "Ruled and not yet held", lists the
three places the ruling covers and the code does not reach yet, each
with its open carrier card.
- `docs/adr/README.md`: regenerated by `node scripts/adr-index.mjs` (164
records).
- `skills/objectstack-data/rules/validation.md`: new section `## Locking
a Field`: a two-by-two table of the four keys (who is kept out, and
when), one checked sales-order example (the hotcrm#2716 case: a `status`
only the Confirm action moves), and five bullets on what each column
does at run time.
- `skills/objectstack-data/SKILL.md` § Conditional Field Rules: the
first bullet keeps its trap (the value is dropped, the write is not
refused, a declarative action's included) and routes to the new section.
- `skills/objectstack-data/evals/objects-fields-relationships.json`:
case 30, a `uiReadonly` status field (`must_contain`: `uiReadonly:
true`, `state_machine`). `evals/README.md` names it.
- `packages/spec/src/data/field.zod.ts`: the parse refusal for
`uiReadonly: true` beside `readonly: true` keeps its wording and now
ends `The two locks and which one to choose: ADR-0163 (D1, D6).` This is
the text `objectstack validate` prints for the pair. Pinned in
`field-ui-readonly.test.ts`.
- `.changeset/37405-field-write-lock-adr-skill.md`: `@objectstack/spec`
and `@objectstack/skills`, patch.

**One sentence of the skill is corrected, not only moved.**
`rules/validation.md` said "Imports and migrations are system-context
writes too." An import is not a system-context write. The `readonly`
describe in `FieldSchema` says so ("A normal (non-system) import is NOT
system-context and still strips"), `importControlOptOutRefusal` in
`packages/rest/src/import-prepare.ts` refuses the historical-import
opt-out to every HTTP caller, and the #36806 measurement found the same.
The new section lists an import among the writes `readonly: true` drops,
and a migration among the system writers it lets through.

**Token ratchet** (`scripts/check-skills-token-ratchet.mjs`), two rows:

- `skills/objectstack-data/SKILL.md` 2239 → 2224: lowered to the
measurement.
- `skills/objectstack-data/rules/validation.md` 3466 → 3862 (+396). The
section is ordered into this skill by the ruling of record on #36806
(ruling record 7180466652: the four spellings, which one to use, the
sales-order status example), and the raise follows the standing ruling,
verbatim: 「A:先削重复,余额按实测提高」 (ruling record 6513306068). Paid down first
in the same file, 1035 bytes cut against 2622 added:
- the two `readonly` / `readonlyWhen` bullets of § Conditional Field
Rules are now one pointer at the new section, which says the same once;
- § Conditional Validation loses its first example
(`enterprise_requires_manager`) and the lead-in of the second, whose
`when` / `then` / `otherwise` rule shows everything the first did.

### Skills readings (lines / bytes / tokens)

| | before | after |
|:-|:-|:-|
| `skills/objectstack-data/rules/validation.md` | 392 / 13861 / 3466 |
421 / 15448 / 3862 |
| `skills/objectstack-data/SKILL.md` | 167 / 8983 / 2239 | 167 / 8923 /
2224 |
| `skills/objectstack-data/evals/objects-fields-relationships.json` (not
ratcheted) | 520 / 37381 | 533 / 38751 |
| `skills/objectstack-data/evals/README.md` (not ratcheted) | 17 / 969 |
18 / 1016 |
| all of `skills/objectstack-data/**` | 4643 / 252853 | 4686 / 255797 |
| all `skills/*/SKILL.md` | 4386 / 228159 | 4386 / 228099 |
| all of `skills/**` | 23333 / 1230467 | 23376 / 1233411 |
| ratcheted (authored) total, tokens | 200510 | 200891 |

### Round 2 (head 6e397de): the contract review of 0922ab3

The review (comment 7248470779, PASS) left one should-fix and one nit.
Both are done in one commit.

- S1, `SKILL.md`: "a button's action included" was true of a declarative
action only. A script action's body runs in a system context, so its
write to a `readonly: true` field lands (ADR-0163, Alternatives, row 3).
The clause now reads "a declarative action's included". The ratchet row
follows the file to its measurement, 2224 (2223 at the previous head).
- N1, `rules/validation.md`: the table's left column was headed "Every
non-system write" over `readonlyWhen` too, which binds system writes as
well. The header is now "Every write" and the `readonly: true` cell
carries "(system writes pass)". The right header lost one word to pay
for it ("Only a person at the console"), and the Confirm sentence names
"a declarative Confirm". The file is 15448 bytes and its row stays 3862.
- The changeset's sentence on the Confirm action says "a declarative
action's own write" to match.

## Tests

- `packages/spec/src/data/field-ui-readonly.test.ts`: the existing
refusal case also asserts the message ends with `ADR-0163 (D1, D6).`
`vitest run src/data/field-ui-readonly.test.ts` in `packages/spec`: 5 of
5 pass.
- The new skill example carries the `os:check` marker, so
`check:skill-examples` type-checks it against the built
`@objectstack/spec` declarations. Exit 0: 353 marked examples
type-check, this one among them. The example was also parsed by
`ObjectSchema` and read by `validateStackExpressions` in two scratch
vitest files (not committed): it parses, and the expression lint reports
no issue for `readonlyWhen: P`true`` or `uiReadonlyWhen: P`false``.
- `check:skill-eval-tokens`: exit 0; both `must_contain` tokens of case
30 are taught by the bundle.
- Not run: a model-driven round of the skill evals. Case 30 has a new
hash and no recorded answer yet.

## Acceptance notes

- Done-when, line by line. "ADR accepted on `main`": the record's status
is `Accepted` on the ruling record and it lands by the Tier H approval
of this PR. "Skill section in place and its eval exercises a
`uiReadonly` status field": the section and case 30. "`objectstack
validate`'s refusal text for `uiReadonly` + `readonly` points at the
ADR": the message above.
- The card's Asked lists what the ruling says. Three points of it are
not held by code on `main` yet. The ADR says so in "Ruled and not yet
held" and names the open carrier of each: #37898 (the assistant is among
the hands the ruling names; cloud AI service), #38202 (console Duplicate
carries a hand-locked value), #38249 (inline child lines of a
hand-locked parent). The skill section teaches only what `main` does
today.
- "`uiVisibleWhen` / `uiRequiredWhen` refused" (card wording): the
ruling's rule is that a key earns a `ui` twin only when an action must
write what a person may not, and only read-only meets it. Neither key
exists in the schema, so a strict parse answers each as an unknown key.
No dedicated refusal is added here; the ADR records the rule (D5) and
the skill says there is no `uiVisibleWhen`.
- D3 records that an object-level server lock (`readonlyWhen` on the
object) is not filed anywhere; it is named so a later reader does not
infer it from the hand lock's object level.
- The refusal message names the ADR by number, the form the spec's other
messages use (`ADR-0158 U2`, `ADR-0049`).
- Branch `claude/project-thread-bqsxpg` is assigned by the harness, not
the repo's `claude/issue-N-…` convention.

## Verification

Two-minute check: `node scripts/check-skills-token-ratchet.mjs`, expect
exit 0 with `skills/objectstack-data/rules/validation.md` 3862 / 3862
and `skills/objectstack-data/SKILL.md` 2224 / 2224.

Read first, by risk:

1. `skills/objectstack-data/rules/validation.md` § Locking a Field (it
ships to third parties verbatim): the left-column bullet, where the
writers `readonly: true` drops and lets through are listed, and the
import correction.
2. `docs/adr/0163-…md` D3 and D4 against the ruling records, then "Ruled
and not yet held".
3. `scripts/check-skills-token-ratchet.mjs`: the two rows and their
arithmetic.

<details><summary>Local gates at 6e397de (only what reads the two
changed skill files)</summary>

Not the whole list again: the second commit changes two skill files, the
ratchet rows and one changeset sentence. Re-run, each exit 0:
`check-skills-token-ratchet.mjs` (and `--self-test`), `ui`
`check:skill-eval-tokens`, `check:skill-links`,
`check:skill-frame-sync`, `check:skill-identifier-liveness`, spec
`check:skill-examples` (353 examples), `check:skill-docs`,
`check:skill-refs`, `check:skill-served-sections`,
`check-nul-bytes.mjs`.

</details>

<details><summary>Local gates at 0922ab3</summary>

`node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--ran FILE`, each command recorded as `CMD :: exit N`: **124 derived,
120 run, 4 NOT-MEASURED, 0 UNRUN**. Every run family exit 0, among them
`check-skills-token-ratchet.mjs` (and `--self-test`), `check:adr-index`,
`check:adr-anchors`, `check:adr-symbol-anchors`, `check-adr-links.mjs`,
`check:skill-links`, `check:skill-frame-sync`,
`check:skill-identifier-liveness`, spec `check:docs` /
`check:api-surface` / `check:authorable-surface` / `check:skill-docs` /
`check:skill-refs` / `check:liveness`, `check-empty-changeset.mjs`,
`check-adr-0087-registration.mjs --base origin/main`,
`check:ratchet-remedy-authority`, `check:type-check-debt`.

- The four recorded exit 3 (prerequisite not met), as the tool reads the
record:
- `check-plugin-teardown-shape.mjs --self-test`: NOT MEASURED. Its
positive control is pinned to a commit this shallow clone cannot reach.
The gate itself (without `--self-test`) ran, exit 0.
- `check:doc-formula-expressions`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure`: exit 3 on the first pass (their build
closures were missing). After the closures were built each was run again
alone, exit 0. The record keeps both lines, and the tool reads a command
with two codes as the worse one, so its count stays 4.
- Outside the derived list, run by hand: spec `check:skill-examples`
(exit 3 before the `@objectstack/client-react` closure was built, exit 0
after: 353 examples), `ui` `check:skill-eval-tokens` (exit 0), `ui`
`check:skills-paths` (exit 0).
- `scripts/pm/overlap-check.mjs`: clean against `origin/main` (3579cf1)
and the one open PR that shares a file (#38192,
`skills/objectstack-data/SKILL.md`).
- Built at `c610020e` plus this diff; `main` moved three commits since
(none under this diff's paths), not merged in.

</details>

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

https://claude.ai/code/session_01L6bhgTpyo8gQyqf9Tj9mfz

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
…ching better-auth's receipt (#38431)

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

Fixes #36987
Supersedes #37433

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill or doc page reads AuthClient.updateUser's
result

> **BREAKING** (published typing, shipped as `patch`):
`AuthClient.updateUser` in `@object-ui/auth` now resolves a promise of
`void` instead of a promise of `AuthUser`. Callers that read the result,
and hosts that implement `AuthClient` and pass it as
`AuthProviderOptions.client` with an `updateUser` that returns a user,
no longer type-check; read the session instead / return nothing. Runtime
behaviour that ever worked is unchanged (the server always answered `{
status: true }`).

## 维护者速读

- 用户无感:只改了认证包对外声明的返回类型,界面和资料保存的表现都不变。
- 为什么做:认证包对外说"改资料后会交回用户",实际服务器只回一个"成功"回执,对外的说明和实际对不上。
- 出错会怎样:只影响直接调用这个接口的外部代码,它们改读会话即可;改动可直接撤回。
- 要你做什么:在席位审核通过后批准合并(申报为收窄,需你批准)。

## What changes

This PR carries seat 5's draft #37433 (4 commits, cherry-picked in order
onto `origin/main` f42bcc1, no conflict) and finishes it on the ruling
recorded on #37433 (maintainer ruling 7183687803, 「新增第八类」), now that
ADR-0087's eighth category `runtime-member-retyped` has landed (#38365,
f42bcc1).

Arm (a): the declaration now says what the call returns.
`AuthClient.updateUser` in `@object-ui/auth` was declared as a `Promise`
of `AuthUser`. It is now a `Promise` of `void`, and
`createAuthClient().updateUser` resolves with nothing instead of handing
on better-auth's answer.

- FROM `(data: Partial of AuthUser) => Promise of AuthUser` TO `(data:
Partial of AuthUser) => Promise of void`.
- Premise (measured on #37433's base da7c559, re-read on f42bcc1):
better-auth's `dist/api/routes/update-user.mjs` ends `/update-user` with
`ctx.json({ status: true })`. `plugin-auth` passes the route through
unchanged (`auth-route-ledger.ts`, disposition `sdk`). The client cast
that receipt to `AuthUser` and returned it.
- Why (a) and not (b), where (b) means returning a real user with one
more session read:
- Census of `updateUser` readers (see Verification; re-run on this
head): the only in-repo caller of the client method is
`AuthProvider.updateUser`, which awaits the call and ignores the result.
`AuthContext.updateUser` and `useAuth().updateUser` already resolve with
nothing. `ProfilePage` calls `useAuth().updateUser` and never reads a
result. No reader needs the user.
- With (b), every profile write would cost one more round trip to fetch
a user that nobody reads. `updateUser` would also be the only write on
`AuthClient` that returns the entity; `changePassword`,
`setInitialPassword`, `verifyTotp` and the other writes all resolve with
nothing.
- `@objectstack/client` already types the same route as a status receipt
(`AuthStatusReceipt`). (a) brings the two published clients into
agreement about what the server answers.
- A refusal still rejects, as before. The `no data` guard stays, with a
one-line comment on why (N2).
- Changeset `.changeset/36987-auth-updateuser-returns-void.md`:
`@object-ui/auth` patch, `fix(auth)!:`, `Clause-②: no (narrowing)`,
`Metadata-protocol: none`, a `**BREAKING**` banner, the migration lines
for result readers and for host `AuthClient` implementations (S1), and
exactly one ADR-0087 marker, `not-required (runtime-member-retyped
@object-ui/auth#AuthClient.updateUser)`. Its FROM and TO are written on
ONE line, which the category's from-operands-named predicate reads. The
member is not rewritten as a method signature (ruling 7183687803).
- N1: the client doubles in `AuthProvider.test.tsx` and
`LoginForm.test.tsx` now resolve `updateUser` with nothing, as the
server does, instead of a user.

Read first (by risk):
1. `ui/packages/auth/src/types.ts`, the `AuthClient.updateUser`
declaration: the published typing that narrows.
2. `ui/packages/auth/src/createAuthClient.ts`, the `updateUser` hunk:
the runtime change (returns nothing).
3. `.changeset/36987-auth-updateuser-returns-void.md`: the disposition
marker and the one-line FROM ... TO that external callers read.

## Tests

- New `ui/packages/auth/src/__tests__/updateUser-return-36987.test.ts`
has two pins. The type pin checks that `ReturnType` of
`AuthClient['updateUser']` and of `createAuthClient()`'s `updateUser`
both equal a `Promise` of `void` (held by `tsc -p tsconfig.test.json`,
the package's `type-check`). The runtime pin checks that `{ status: true
}` from the wire resolves to `undefined`.
- The existing `createAuthClient.test.ts` case used to stub
`/update-user` with a `{ user }` body the server never sends and assert
`result.name`. It now stubs the real receipt and asserts that the call
resolves with `undefined`.

<details><summary>Package tests, type-check and build
(830cdac)</summary>

- Closure build under the verify lock: `pnpm --workspace-concurrency=2
--filter '@object-ui/auth^...' build`, `VERDICT command-exit 0`.
- `pnpm --filter @object-ui/auth type-check && pnpm --filter
@object-ui/auth test && pnpm --filter @object-ui/auth build`, `VERDICT
command-exit 0`. Tests: `Test Files 52 passed (52)`, `Tests 557 passed
(557)`.

</details>

<details><summary>Ablation: the old declaration plus the old cast
(one-off, no file kept)</summary>

- One ablation, three mutations through `scripts/ablation-replace.mjs`,
all landed by its own counts: `types.ts` back to the `AuthUser` promise
(anchor 1 to 0, blob 2d83741 to 5b271b75); in `createAuthClient.ts` the
`void` return annotation removed (anchor 1 to 0, blob e6af426 to
e9aafd14) and `return data as unknown as AuthUser;` put back (anchor 1
to 0, blob e9aafd14 to 0e7700bb).
- Type leg: `tsc -p tsconfig.test.json` exited 2, TS2344 on both type
pins (`updateUser-return-36987.test.ts` lines 22 and 24).
- Runtime leg: vitest on the pin and `createAuthClient.test.ts` went
red: `Tests 2 failed | 42 passed (44)`, `AssertionError: expected {
status: true } to be undefined`.
- Restore: `git checkout HEAD --` on both paths; `git diff HEAD` empty,
blobs equal HEAD (2d83741, e6af426).
- The first attempt was a no-op: the third mutation's replacement
contained its anchor (count 1 to 1). The tool refused it and restored;
the run was repeated with a different anchor. Both pins import from
source, so no `dist/` is on the path.

</details>

## Acceptance notes

- The ProfilePage test doubles added since #37433's base
(`ProfilePage.passwordRefusal-37973.test.tsx` among them) stub
`useAuth().updateUser` as resolving nothing, which is the context
surface that was already void. They neither read the client method's
result nor implement `AuthClient`. Noted, nothing owed.

## Verification

<details><summary>ADR-0087 disposition (830cdac)</summary>

- `node scripts/check-adr-0087-registration.mjs --base origin/main`:
exit 0, `verified: @object-ui/auth#AuthClient.updateUser (updateUser:
(data: Partial of AuthUser) => Promise of AuthUser -> updateUser: (data:
Partial of AuthUser) => Promise of void,
ui/packages/auth/src/types.ts)`, tags
`[BREAKING+bang+clause-②-narrowing]`.
- Two earlier attempts on the way were refused on predicate 3
(from-operands-named): a FROM side spelled as a whole signature in one
code span, then a second code span between FROM and TO. The FROM side
now names `AuthClient.updateUser` alone and the signatures sit outside
it.

</details>

<details><summary>updateUser census on this head (ui/, apps/, examples/,
skills/, content/)</summary>

- 48 hits by `git grep -n updateUser` (CHANGELOGs excluded). Against
#37433's base da7c559 the only new file is
`ProfilePage.passwordRefusal-37973.test.tsx`, a `useAuth()` double whose
`updateUser` resolves nothing (the context surface, already void).
- Client-method callers: `ui/packages/auth/src/AuthProvider.tsx:549`
only, awaiting and discarding. No code outside `ui/packages/auth`
implements `AuthClient.updateUser`.
`content/docs/frontend/data-source.mdx:121,150` is an unrelated
user-defined data-source method. Nothing under `examples/` or `skills/`.

</details>

<details><summary>Derived gate families (830cdac)</summary>

- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 39 families; each was run and its
exit recorded.
- 38 exited 0 on the first pass, including `pnpm --dir ui exec vitest
run scripts/` (`Test Files 172 passed | 2 skipped (174)`, `Tests 5159
passed | 2 skipped (5161)`).
- `pnpm check:type-check-debt` exited 3 (PREREQUISITE NOT MET: its
closure build lost the lock turn to the dogfood run). Rerun under the
lock, appended: exit 0, `0 ledger entr(ies) re-measured ... none above
its recorded number`.
- `dispatch-gates --ran`: `39 derived famil(ies) accounted for — 38 run,
1 NOT-MEASURED` (the first-pass exit 3; the appended rerun is green).
- Also run: `pnpm check:changeset-fixed` (roster under `.changeset/`)
exit 0; `dispatch-gates --tier`: no path-derived mandate.
- `overlap-check --branch=HEAD --exclude-pr=37433` before the first
push: `VERDICT clean exit 0` (#37433 is the superseded draft and
overlaps by construction).

</details>

<details><summary>Dogfood battery (830cdac)</summary>

- Owed: the title carries `!` and the declaration a `(narrowing)` arm.
Closure `pnpm --filter '@objectstack/dogfood^...' build` then `pnpm
--filter @objectstack/dogfood test`, both under the lock, no shard and
no path.
- `VERDICT command-exit 0`, `Test Files 495 passed | 3 skipped (498)`,
`Tests 4183 passed | 68 skipped (4251)`. No failures.

</details>

Two-minute check: `pnpm --filter @object-ui/auth exec vitest run --root
../.. packages/auth/src/__tests__/updateUser-return-36987.test.ts`
should show 2 passing tests, and `node
scripts/check-adr-0087-registration.mjs --base origin/main` should print
a `verified:` line for `@object-ui/auth#AuthClient.updateUser`.

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

<!-- signed: repo:objectstack#3 · os-tesla ·
session_01L9qibyUSf2nKJWW6qBemSU -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
… / p1 / p2 / p3 switch and each topic's p1/p2 card list (#38424)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_

Fixes #38400
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:你打开专题看板时,顶部多了「全部 / p1 / p2 /
p3」切换,所有数字跟着切;每行按可派、在做、阻塞、待你裁、搁置拆开;点开一个专题或「专题以外」一行,直接列出其中每张 p1、p2
卡,带状态、谁在做、在等什么。
- 为什么做:你说看板上的剩余任务和你自己在 GitHub 上查到的对不上;这次把「可派」单独算,并在页脚写清每个数字的口径和可以照着查的查询。
- 出错会怎样:只影响看板这一页的数字和列表,不改任何卡片;数字错了下一次刷新前会一直显示错的,撤掉这次改动即可回到原来的看板。
- 要你做的:无。

## Round 2 (head d3ab35a, answering L1 comment 7248641965)

1. **Cloud grade word.** The cloud lead's span is now
`data-draw="gradeWordC"`, drawn by the same function as `gradeWord`,
like every other cloud copy on the page. (The Data type's guide says
`dash.draw(name, fn)` runs `fn(el)` on each element carrying that name,
so one name did fill both; the rename removes the question.) Stand-in
render of the cloud tab, fed the objectstack datasets because this
session cannot read `objectstack-ai/cloud`: at p2 the cloud sentence
reads 「15 个专题在推进。共有 125 张未完成的 p2 卡;可派 50 张,在做 23 张,阻塞 28 张,等你裁决 9 张,搁置
15 张。」, at 全部 「19 个专题在推进。共有 357 张未完成的卡,其中 p1 15 张;可派 226 张,在做 27 张,阻塞 47
张,等你裁决 19 张,搁置 34 张。」; the cloud board shows and the objectstack board
hides; topic #35154's list opens with 6 rows; 0 page errors, 0 drawing
faults.
2. **One-writer: fixed in this PR.**
- The tab write moved. The repo tabs now toggle the class `eb-on-cloud`
on `.eb`, and the CSS keys off that class; `data-repo` is gone from the
HTML and the script. It was the one script write outside a drawing that
the guide does not allow, and it fired at load for a viewer whose last
tab was cloud.
- The grade switch's three writes stay in `dash.onData`, because the
guide lists exactly them as allowed: "Outside a drawing a script only
listens and sets `class`, `style`, `hidden`, `open`, `disabled`,
`checked`, `selected`, `value`, `tabindex` or `aria-*`. Any other write
there is a fault." For `hidden` on `.eb-allonly`, the container of the
`p1` drawing, it adds: "a drawing can't show itself or its container.
`dash.onData(fn)` runs before the drawings and can." Moving them into
drawings would make the switch buttons and the `.eb` root drawings and
put the switch's fixed labels into script, which the same guide rules
out. A comment at the `onData` call now says this.
- Reading: the stand-in records every script write outside a `data-draw`
element that is not on that allowed list. At 12dff8d it records
`attributes data-repo on DIV.eb` on a tab click, and at load when the
viewer last chose cloud. At d3ab35a it records none. The only other
records, at both heads alike, are the harness's own parser insertions of
its trailing script elements. The live check is still the first refresh
with this template.
3. **Nit.** The case now asserts #717's own state through `classifyCard`
(`queued`) beside `p3_queued` = 1 and `p3_ready` = 1, and its name says
`p3_ready` is #711.

`origin/main` was merged in at be348bd (a plain merge: no generated
artifact on either side; no rebase, no force-push).

## What changes

- `scripts/pm/topic-board.mjs` — every topic row and area row now
carries a grade by state cross-count, one column per cell named
`GRADE_STATE`: grades `p1` (p0 counted with p1), `p2`, `p3`, `un` (no
grade label, so the four add up to the row); states `ready`
(dispatchable: `pm:queue`, no assignee, no open `Blocked-by:` target, a
column of its own), `queued` (`pm:queue` with an assignee, or only
`pm:triage` / `pm:retriage`), `waitq` (`pm:queue` with an open
`Blocked-by:` target, shown as blocked), `doing`, `merge`, `blocked`,
`hold`, `decide`, `none`. A topic row also carries `closed_GRADE` and
`unlinked_GRADE`, and every row a `cards` list of its open p1/p2 cards
(number, title, grade, state, holding seat, what it waits on), p1 first,
then dispatchable first. Every older column keeps its meaning and is a
sum of cells (the self-test pins that on every fixture row).
- Readers are imported from `check-half-states.mjs`, none re-spelled:
`blockerTargetsFor` (body and comment channels) and
`blockerResolutionFromRow` (a PR target releases only when merged) for
`Blocked-by:`; `latestClaimComment`,
`markerMatches(CLAIM_COMMENT_MARKER)`, `claimSeatNumber` and
`directiveValues(body, 'Seat')` for the holding seat. card-pick.mjs
reads targets through the same two functions, so this is the same
reading, not a second one.
- Reads stay bounded: one comment-thread read per open p1/p2 card the
board counts, and one row read per distinct `Blocked-by:` target named
by a listed p1/p2 card or a `pm:queue` card. p3 and ungraded cards are
judged on their body alone (stated in the page footnote). An unreadable
target is held as open and named in the run output, never read as
closed; a failed thread read fails the run (exit 3, nothing written),
like the existing reads.
- The self-test gains the battery roster, floor and verdict handshake
from AGENTS.md "Writing a `--self-test`" (copied from
`check-agent-model-declared.mjs`): 12 batteries, 74 cases.
- `scripts/pm/topic-board/page.html` — a 全部 / p1 / p2 / p3 switch at the
top; it is a page filter no query names (`dash.setParams({grade})`), so
a pick redraws at once and fetches nothing, and it is remembered per
viewer in `localStorage` inside try/catch. Every number follows it: the
summary sentence (now 可派 / 在做 / 阻塞 / 等你裁决 / 搁置), group headers, row
columns (new 可派, 在做, 阻塞, 待你裁, 搁置, 其他, 无状态; the p1/p2/p3 columns hide
under a single grade), stacked bars, done/total/unlinked. Each topic row
and each area's not-in-a-topic row gets a button that opens its p1/p2
card list (none under p3). The footnote states each definition in one
sentence and gives the GitHub query for the dispatchable column. A
dataset built by the old script shows a rebuild notice instead of zeros
passing as numbers.
- `scripts/pm/topic-board/README.md` — a "The columns" section only.

## Reconciliation with the maintainer's query

Live run, read-only, `node scripts/pm/topic-board.mjs --repo=objectstack
--out=SCRATCH` at 2026-11-29 00:19 UTC, tree
`objectstack-ai/objectstack` @ 095e939: 428 open issues, 30 topics.

| Reading | Count | Cards |
|:--|--:|:--|
| `state:open label:pm:queue label:priority:p2,priority:p1
label:area:ai` (read 00:19 UTC) | 5 | #38153, #37898, #36558, #36206,
#34869 |
| Board, AI group, p1+p2 dispatchable | 6 | the same five, plus #38373 |

- All five cards the query returns are dispatchable on the board (no
assignee, no open `Blocked-by:` target): #38153 and #37898 sit in the AI
area's "not in a topic" row, #36558, #36206 and #34869 in topic #35154
(an AI topic).
- The difference is #38373: it is labelled `area:cloud`, but it is a
member of topic #38346, whose own area is `ai`. The board groups a
topic's cards under the topic's area, not the card's own `area:*` label,
so it counts in the AI group and the query does not see it. The footnote
now says this in so many words.
- The query's own answer moved during this session as seats claimed and
relabelled cards (4 at about 00:10; 5 at 00:19; at 00:25 still 5 but a
different set, #38153 out and #36079 in), so the table compares the two
readings taken in the same minute. The queue query also counts cards
that are assigned or carry an open `Blocked-by:` target, which the
dispatchable column leaves out; for area:ai none of the five did at this
run.

Request footprint of that run: 302 GET requests = 49 listing +
sub-issues (what the script made before) + 140 thread pages for 140
p1/p2 cards + 113 `Blocked-by:` target rows, 4 of them unreadable from
this session (targets in `objectstack-ai/cloud` and
`objectstack-ai/docs.objectos.ai`, HTTP 403 here; held as open and
named). Wall time 2m14s.

## Tests

<details><summary>topic-board self-test (offline)</summary>

`node scripts/pm/topic-board.mjs --self-test` → `topic-board self-test:
all passed (12 batteries, 74 cases)`, exit 0 (re-run at d3ab35a in
round 2, same line). New batteries: every state cell (dispatchable apart
from queued, needs-user-decision outranking pm:queue, pm:awaiting-merge,
pm:triage, ungraded); Blocked-by (open target holds, closed issue and
merged PR release, closed-unmerged PR and unreadable target hold,
comment-only line holds for a p2 card, a p3 card's thread is never
read); p0 counted with p1; legacy columns as sums of cells on every row
of both fixtures; the card list (order, no p3, seat from the newest
claim's `Seat:` line, login fallback, waits); the thread and target
reads (17 threads, 6 targets read once each, a failed thread read fails
the run naming the card).
</details>

<details><summary>Local gates at d3ab35a (round 2; 32 derived by
dispatch-gates --commands, all exit 0)</summary>

Run under `scripts/pm/os-verify-lock.sh`, slot issue-38400 (VERDICT
command-exit 0). `dispatch-gates --ran` with each exit code recorded:
「32 derived famil(ies) accounted for — 32 run, 0 NOT-MEASURED (a DERIVED
zero)」. The derived list is the same 32 as round 1. `overlap-check`
before the push: clean against origin/main 28c2fe8.

- `node scripts/check-closing-keyword-parity.mjs` exit 0
- `node scripts/check-closing-keyword-parity.mjs --self-test` exit 0
- `node scripts/check-comment-mask-corpus.mjs` exit 0
- `node scripts/check-declaration-mirrors.mjs` exit 0
- `node scripts/check-declaration-mirrors.mjs --self-test` exit 0
- `node scripts/check-self-test-wired.mjs` exit 0
- `node scripts/check-self-test-wired.mjs --self-test` exit 0
- `node scripts/check-self-test-workflow-commands.mjs` exit 0
- `node scripts/check-self-test-workflow-commands.mjs --self-test` exit
0
- `node scripts/check-whole-set-label-write.mjs` exit 0
- `node scripts/check-whole-set-label-write.mjs --self-test` exit 0
- `node scripts/ci/plan-test-core-shards.mjs --self-test` exit 0
- `node scripts/pm/bare-root-worklist.mjs --self-test` exit 0
- `pnpm check:adr-anchors` exit 0
- `pnpm check:agent-test-spelling` exit 0
- `pnpm check:bash32-floor` exit 0
- `pnpm check:ci-filter-parity` exit 0
- `pnpm check:cli-command-ids` exit 0
- `pnpm check:cross-package-test-inputs` exit 0
- `pnpm check:driver-memory-census` exit 0
- `pnpm check:entry-guard` exit 0
- `pnpm check:gitlink-declared` exit 0
- `pnpm check:nul-bytes` exit 0
- `pnpm check:parse-guard` exit 0
- `pnpm check:pm-board-snapshot` exit 0
- `pnpm check:pm-dispatch-gates` exit 0
- `pnpm check:pnpm-filter-targets` exit 0
- `pnpm check:pnpm-flag-spellings` exit 0
- `pnpm check:ratchet-remedy-authority` exit 0
- `pnpm check:refd-timer-probe` exit 0
- `pnpm check:scripts-symbol-anchors` exit 0
- `pnpm check:watch-hint-literal` exit 0
</details>

## Acceptance notes

- The cloud tab's data was not rebuilt (out of scope; this session
cannot read `objectstack-ai/cloud`). The `--repo=cloud` path runs the
same code; until the next cloud rebuild the cloud tab shows the rebuild
notice.
- Rendered locally against the live objectstack datasets with a stand-in
for the Data type's runtime (switch at p2, topic #35154 opened; round 2
adds the cloud tab, see above): the p2 sentence read 「15 个专题在推进。共有 125
张未完成的 p2 卡;可派 50 张,在做 23 张,阻塞 28 张,等你裁决 9 张,搁置 15 张。」 and 全部 read 「19
个专题在推进。共有 357 张未完成的卡,其中 p1 15 张;可派 226 张……」, no page errors. The real
Data runtime was not exercised: the first refresh with this template is
where `dash.setParams` for a name no query uses gets its live reading.
- The repo-tab write that L1 flagged moved to a class toggle in round 2
(see Round 2, item 2). Nothing is left noted-but-untouched.

## Verification

Read first (by risk): `scripts/pm/topic-board.mjs` `classifyCard` and
`countedCards` (the state precedence and which cards buy reads), then
`page.html` `view` and `makeBoard` (what each column sums under a pick).

Two-minute check: `node scripts/pm/topic-board.mjs --self-test` — expect
`topic-board self-test: all passed (12 batteries, 74 cases)` and exit 0.

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

https://claude.ai/code/session_01FEkQ5oPfjnm2yWHEwkiYrn

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oPfjnm2yWHEwkiYrn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
…ngs panel and the create-view dialog only when opened (#38429)

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

Part of #37444. This is the first cut: the object list page stops
loading authoring code before its first screen. The card stays open,
because this cut alone is not expected to bring the list page under 2.5
s; a second cut waits for this PR's reading and a claim amendment.

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户打开对象列表页时少下载约 180 KB 的编辑类代码,首屏更快;页面上看到和保存的内容都不变。
- 属于「控制台首屏 2.5 秒内打开」专题,这是列表页的第一刀。
- 出错时,第一次打开选包框、视图设置面板或新建视图框会多等一下,或者打不开;撤回这个 PR 即可恢复。
- 无。

## What changes

The object list route (`ObjectView`) pulled about 69 chunks (~183 KB
brotli, measured on `ff69bcab`) of authoring code before its first
screen:

1. `objectViewViewCrud.tsx` and `objectViewViewSharing.ts` imported
`metadata-admin/PackageCreateAsk` and `metadata-admin/i18n` statically
(since #38204). `usePackageCreateAsk` drew a closed
`PackageCreateAskDialog` on every list, and that dialog imports the
package page's create dialog, `PackageFormDialog`, `SchemaForm` and the
Studio catalogue.
2. `ViewConfigPanel` and `CreateViewDialog` are `React.lazy`, but were
rendered closed on every list, so their chunks were fetched on every
list load too.

Now:

- `useDeferredPackageCreateAsk` (in `objectViewViewCrud.tsx`) keeps the
same `ask(request) => Promise<string | null>` contract. It mounts a lazy
`PackageCreateAskDialog` on the first ask and keeps it mounted
afterwards, so it closes the way it did before. A newer ask still
resolves the older one with `null`, and unmount still resolves a pending
ask with `null`.
- `reportViewNotSaved(err, locale)` still answers synchronously whether
the error was a runtime-create refusal. The refusal text, the designer
locale mapping and the Studio catalogue load on the refusal, and the
toast shows once they arrive. A cancelled ask still shows nothing.
- Both hooks read the locale from `useObjectTranslation()` instead of
`useMetadataLocale()`; `designerLocaleOf` maps it at refusal time.
- `ObjectView.tsx` mounts `ViewConfigPanel` and `CreateViewDialog` the
first time each opens (`useOpenedOnce`), and keeps them mounted after
that.

No exported shape changes, no spec or metadata change.

## Tests

- New `objectViewListRoute.deferredAuthoring-37444.test.tsx` pins the
load order with counted `vi.mock` factories: importing `./ObjectView`
evaluates none of `PackageCreateAsk`, `PackagesPage`, `SchemaForm`,
`metadata-admin/i18n`, `ViewConfigPanel`, `CreateViewDialog`; the ask
loads its dialog on the first ask, answers it and stays mounted closed;
a refused create toasts once its words load, a cancelled one never
toasts.
- `ObjectView.readOnlyPackageViewSaves-35974.test.tsx` and
`ObjectView.viewConfigSaveWiring-10210.test.tsx` read the panel's props;
they now open the panel first, since a closed panel is no longer
mounted. The personal-view case now asserts the closed panel is not
mounted.

<details><summary>Pin ablation</summary>

Committed first, then `scripts/ablation-replace.mjs` on
`objectViewViewCrud.tsx`: the anchor `import type { PackageAskRequest }
from './metadata-admin/PackageCreateAsk.js';` replaced with a value
import of `PackageCreateAskDialog` (`void`-used). Result: case 1
(`packageAsk` 0 → 1) and case 2 red, case 3 green: 2 failed, 1 passed.
Restored: blob equals HEAD, `git diff HEAD` empty.

What is not separately pinned: the `CreateViewDialog` render deferral in
`ObjectView` (its module-load count is pinned at import time only; no
case opens the dialog). The `ViewConfigPanel` render deferral is pinned
by the 35974 personal-view case.
</details>

## Acceptance notes

- Read first: `objectViewViewCrud.tsx` (`useDeferredPackageCreateAsk`:
the resolve-older-ask and unmount paths), then `ObjectView.tsx`
(`useOpenedOnce` and the two mount sites), then
`objectViewViewSharing.ts` (the catch path).
- Two-minute check: on a list page, open the browser's network panel,
load the list: no `PackagesPage`, `SchemaForm` or `CreateViewDialog`
chunk. Click the view settings gear: the panel opens after one chunk
fetch.
- Found while testing, not changed here: the toolbar Settings path opens
the config panel on the first grid view (`all`), not on the open view
(unit-level evidence only).

## Verification

LCP on this PR's build (`bd4f2071`) against main, by the card's method:
production builds, HTTP/2 TLS front, Lighthouse 13.6.0 desktop preset,
signed in, blocks main-1, pr-1, pr-2, main-2 of 5 runs per page. The
record page got a reversed round on top. p is a two-sided permutation
test on the median difference. Full runs: card comment 7248989586.

| page | main median (ms) | PR median (ms) | delta | p |
|:--|--:|--:|--:|--:|
| home (10 vs 10) | 2080.5 | 2115.5 | +35 | 0.33 |
| object list (10 vs 10) | 2647 | 2551 | −96 | 0.03 |
| record (20 vs 20) | 2444.5 | 2478.5 | +34 | 0.30 |

On the list page, the scripts fetched before the first screen go from
274 to 225: 171.6 KB less gzip as served, or 188 KB less brotli by the
dist's `.br` files. Home and record fetch the same script count on both
builds. The list is still 51 ms over 2500, so the card stays open for a
second cut.

<details><summary>Gates</summary>

- `node scripts/pm/dispatch-gates.mjs --commands`: 38 derived, all 38
exit 0. `--ran`: 38 run, 0 NOT-MEASURED, 0 UNRUN.
- `--tier`: no path-derived mandate; 356 changed lines (under 3000).
- `overlap-check`: merges cleanly onto `origin/main`, VERDICT clean.
- `cd ui && pnpm exec vitest run` on 23 affected app-shell files:
265/265 passed.
- eslint on the 6 changed source and test files: 0 errors.
</details>

## 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; eslint on the changed files: 0 errors.
- [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_01L9qibxzGFPvShbd2qnkdEv

<!-- signed: repo:objectstack#3 · os-tesla ·
session_01L9qibxzGFPvShbd2qnkdEv -->

Co-authored-by: Claude <noreply@anthropic.com>
…ound (#38449)

Fixes #38426
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户无感:只改内部测试清单里七个发版必测项的文字,产品本身没有任何变化。
- 为什么做:11 月 29 日发版候选轮测试发现这七项的步骤、计数或措辞已跟不上产品,照旧文字跑会误判或白费时间。
- 出错会怎样:只影响测试人员照清单操作时读到的说明,直接撤回这次合并即可恢复原文。
- 要你做什么:无。

## What changes

Seven P0 items in `docs/qa/platform-checklist/areas/`, each re-pointed
to what QA run #38417 measured at `ff69bcab`, each with its `revision`
bumped and one `history` row (ref: the card). No other item, no
area-level recipe and no product file is touched (checked: a parse of
each file before and after differs only in these seven items).

| item | rev | what was stale | now reads |
|---|---|---|---|
| `platform-core.console-login` | 5 → 6 | acceptance[0] expected
`/_console/home` with the launcher and no sidebar | a desktop sign-in
lands in an app (last app, else default, else first visible product app:
Showcase on a fresh boot), with its sidebar; only a phone keeps `/home`.
steps[4]'s in-app leg clicks a sidebar link to another page, since Home
has no tiles |
| `platform-core.builtin-apps-nav-render` | 20 → 21 | 46 Setup / 8
Account destinations; "no stock app mounts knowledge" | 55 / 10; the
showcase mounts the knowledge service, so 11 settings namespaces and the
two knowledge Setup entries; Account adds Mobile App and Notification
Settings |
| `approvals.account-app-entry` | 10 → 11 | acceptance[3]: a row click
opens under the record's host app | a queue row stays in the inbox's own
app (objectstack#35412); only an inbox with no app segment, and the
`?request=` deep link, go to the host app |
| `records-forms.crud-roundtrip` | 22 → 23 | steps[4]: edit button
"Update", write is a PATCH | the record page's edit state button reads
"Save"; its write is a PATCH or one `POST /api/v1/batch` when body
tables ride along |
| `studio-authoring.first-run-loop` | 16 → 17 | steps stale in five
places | Add app → New blank app; New object's Create drafts and
publishes; Save drafts and publishes, no Publish all sheet; Application
→ New has no objects-as-menu-items option (wire it in Preview → Add nav
item); App Studio menu and per-object tabs; the app shows in the app
switcher |
| `platform-core.boot-health` | 15 → 16 | steps[3]: 30 author-time
warnings | 44. Only the count: acceptance[2]'s ERROR clause is untouched
(the false knowledge ERROR is the product defect #38418) |
| `cli.organization-ownership-ceremony` | 13 → 14 | acceptance[5] had no
room for two measured exceptions | carve-outs for the renamed showcase
sharing rule (one re-keyed `sys_record_share` row) and the 14-day /
30-day retention reaps on the aging 18.0 fixture; rows are read at the
second boot's ready |

First read (by risk):

1. `docs/qa/platform-checklist/areas/studio-authoring.json`: five whole
steps rewritten; the one item where the new text describes a flow rather
than a count.
2. `docs/qa/platform-checklist/areas/cli.json`: the a5 carve-outs, which
must not loosen the "no row disappears" rule beyond the two named cases.
3. `docs/qa/platform-checklist/areas/approvals.json`: acceptance[3] now
expects the opposite app from before.

Two-minute verification: `node scripts/check-platform-checklist.mjs`
prints `check-platform-checklist: OK — 16 areas, 449 items`, and `node
scripts/checklist-select.mjs priority:P0` still lists all seven items.

## Tests

No code changed, so no test suite applies. Gates run locally at
`6781fdca` (the PR head), each exit captured before any pipe:

<details><summary>Derived gate families: 17 derived, 17 run, all exit
0</summary>

- `pnpm check:platform-checklist`: exit 0, `OK — 16 areas, 449 items
(438 active, 5 planned)`
- `pnpm check:nul-bytes`: exit 0
- `pnpm check:doc-authoring`, `pnpm check:adr-anchors`, `pnpm
check:ci-filter-parity`, `pnpm check:cross-package-test-inputs`, `pnpm
check:driver-memory-census`, `pnpm check:gitlink-declared`, `pnpm
check:refd-timer-probe`, `pnpm check:watch-hint-literal`: exit 0 each
- `node scripts/check-adr-links.mjs` (+ `--self-test`), `node
scripts/check-closing-keyword-parity.mjs` (+ `--self-test`), `node
scripts/check-comment-mask-corpus.mjs`, `node
scripts/ci/plan-test-core-shards.mjs --self-test`: exit 0 each
- `pnpm --filter @objectstack/lint run check:doc-formula-expressions`:
exit 3 on the first run (prerequisite not met, `@objectstack/formula`
and `@objectstack/lint` unbuilt, nothing measured); after `turbo run
build --filter=@objectstack/formula --filter=@objectstack/lint` under
the verify lock (VERDICT command-exit 0), re-run exit 0
- `node scripts/pm/dispatch-gates.mjs --ran`: `17 derived famil(ies)
accounted for — 17 run, 0 NOT-MEASURED (a DERIVED zero — all 17 recorded
an exit code and none of them is 3)`
- `node scripts/pm/overlap-check.mjs`: `VERDICT clean exit 0` (0 open PR
heads overlap; origin/main merges cleanly)

</details>

## Acceptance notes

- `approvals.account-app-entry` steps[2] still explains the landing as
"only two or more visible apps to /home". On a desktop that is also
retired by objectstack#36732, but the step's measured fact (the
single-app persona lands in Showcase) is right and #38417 did not flag
it, so it is left for the next re-point of that item.
- `platform-core.boot-health`: the compile's summary line read 44 in
#38417, while
`examples/app-showcase/test/author-time-advisories.test.ts` holds 37
allow-list entries. The step now says the test allow-lists what
`validate --json` reports rather than "each of the 44 is named", since
the two counts are not the same reading. Not re-measured live here.
- `studio-authoring.first-run-loop`: two facts rest on #38417's live en
leg rather than on source read here: the Application form's Active
defaulting off, and the app switcher listing order.
- History rows cite the card (#38426), the convention many rows in these
files already follow, so the PR body is written once at create.

## Verification

Verification retest (`checklist-test` §5), one row per edited item. No
item was re-driven live in this lane. Each row stands on #38417's live
reading at `ff69bcab` and on the product source re-read at base
`0c1b2ffe`. `git diff --stat ff69bca 0c1b2ff` over every source path
the new text cites (RootLandingRedirect.tsx, App.tsx,
ApprovalsInboxPage.tsx, RecordDetailView.tsx, recordEditState.tsx, the
app-shell hooks, studio-design and metadata-admin views,
platform-objects apps, examples/app-showcase, service-knowledge, mcp
connect-ui.ts) is empty, so that reading holds at this base.

<details><summary>Per-item retest table</summary>

| item (new rev) | edited part | verdict | evidence |
|---|---|---|---|
| platform-core.console-login (6) | acceptance[0], steps[4] | pass |
#38417 landed on
`/_console/apps/com.example.showcase/page/showcase_capability_map` with
sidebar, avatar and bell; `resolveDesktopLandingPath` answers last app,
then default, then first product app, then `/home`; `HomeRoute`
redirects on a desktop |
| platform-core.builtin-apps-nav-render (21) | steps[3], steps[5],
acceptance[4].verify | pass | #38417 served 55 Setup and 10 Account
leaves, matching the rendered links; account.app.ts: 10 entries, less
`nav_account_memberships` (org-scoping), plus `nav_connect_agent` (mcp
connect-ui.ts) = 10; showcase config mounts `KnowledgeServicePlugin` |
| approvals.account-app-entry (11) | acceptance[3].verify,
acceptance[4].verify | pass | #38417 row click opened
`/apps/com.objectstack.account/sys_approval_request/record/…`;
`openRequest` navigates under `appName` when the inbox has one, and asks
`requestPagePath` only without it |
| records-forms.crud-roundtrip (23) | steps[4] | pass | #38417 read the
button "Save"; `sys_record_edit_save` is labelled `detail.save`;
`recordEditState.tsx` saves with `dataSource.update` alone, else
`runBatchTransaction` (`POST /api/v1/batch`) |
| studio-authoring.first-run-loop (17) | steps[1], [2], [3], [5], [6];
acceptance[3]; negative[1]; knownGaps[0], [1] | partial | en leg: #38417
drove every clause pass on this path. Source: `useAddAppEntries` offers
New blank app; New object's confirm is `engine.studio.createLive` =
Create and publishes through `publishSavedItem`; `studioSaveBar.tsx`
Save drafts then publishes; no `appAddObjects` left in ui/packages.
zh-CN leg not run (#38417 did not run it either), so under negative[2]
the item stays partial |
| platform-core.boot-health (16) | steps[3] count | pass for the edited
text | #38417 read `⚠ 44 author-time warning(s)` on the compiling boot
with the advisories test 2/2 green. acceptance[2] is unchanged and still
fails on #38418, the product defect |
| cli.organization-ownership-ceremony (14) | acceptance[5].verify | pass
| #38417 a5: one `sys_record_share` row re-keyed from `share_key_…` to
`showcase_share_key_…` (the old name is in the 18.0.0-next.5 dump, the
new one in sharing-rules.ts); `sys_activity` retention `maxAge '14d'`,
`sys_automation_run` `maxAge '30d'`; the 66 activity and 4 terminal runs
were present at ready + 60 s |

</details>

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

Co-authored-by: Claude <noreply@anthropic.com>
…zation before the position bind (#38450)

Fixes #38422

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户无感:只改内部测试夹具,QA 跑测时一条命令就能造出可用的「贡献者」测试账号,不再卡在第三步。
- 替平台测试清单的 QA 跑测者解决:他们每轮都要手工绕过这一步。
- 出错只影响 QA 夹具本身,产品与邮箱验证规则不变,可直接撤回。
- 无

## What changes

`node scripts/qa/qa-fixture.mjs contributor-member` failed at step 3
with `400 VALIDATION_FAILED ... is not a member of the organization`. An
invited sign-up is, by design, not bound into the organization while its
address is unverified (`settleMembership`,
`packages/plugins/plugin-auth/src/auth-manager-membership-admission.ts`);
the fixture has no mailbox to verify, so the position bind ran against a
user with no `sys_member` row.

After step 2 (resolve the `sys_user` id) the fixture now has the
platform admin attach the member through the admin-gated `POST
/api/v1/auth/organization/add-member` door (`{ userId, role: 'member',
organizationId }`), then reads the `sys_member` row back and refuses
unless exactly one is there. Then step 3 binds the position. The
product's verification rule is not touched (as the triage ruled). The
invite and invited sign-up stay as they were, so the printed JSON keeps
every field, `invitationId` included. Why add-member rather than admin
create-user: create-user stamps `must_change_password`, which would add
a change-password round-trip and rotate the printed password.

Only `scripts/qa/qa-fixture.mjs` changes (two hunks: the new step after
step 2, and the header line that lists the steps). No published package
changes, so `skip-changeset`.

## Tests

The script has no test file under `scripts/qa/`. I tested it against a
real boot: a fresh showcase (`examples/app-showcase`, `pnpm dev --fresh
-p 38422`), built from this tree at base `0c1b2ffe`.

<details><summary>Before (base 0c1b2ff): step 3 fails</summary>

```
qa-fixture: FAILED — step 3: bind showcase_contributor: answered 400, expected 200 or 201 — {"error":"User: 'xYrSC232TdcEUWpSlHtZmd7qOoWH54zl' is not a member of the organization 'org_mx16zzajf740wc7o' this position assignment applies in. sys_user_position.user_id must name a user who holds a sys_member row in the row's organization_id: add the user to that organization first, then grant it.","code":"VALIDATION_FAILED", ...
EXIT=1
```
</details>

<details><summary>After (head 55f03a5): end to end, with --task
--position showcase_finance</summary>

```
qa-fixture: replaying search:qa-contributor-bound-member against http://localhost:38422 for qa-contributor-20261129020142@verify.test
{
  "fixture": "contributor-member",
  "replays": "docs/qa/platform-checklist/areas/search.json fixtures.qa-contributor-bound-member",
  "baseUrl": "http://localhost:38422",
  "persona": { "email": "qa-contributor-20261129020142@verify.test", "password": "(redacted)", "userId": "dqtMxvxSXCHGn41F2UoDiJMscnuFUTQV", "bearer": "(redacted)" },
  "organizationId": "org_mx16zzajf740wc7o",
  "invitationId": "Fa7VoQVXVPkcHZoepZJFtmWMdT5ZTTjc",
  "positionRowId": "BfMDAacBAJeIcCNl",
  "extraPosition": { "position": "showcase_finance", "rowId": "eq1tapH4lFpc-3fm" },
  "invisibleRow": { "object": "showcase_invoice", "name": "INV-1003", "id": "xOg7-AamUAsz1kgB" },
  "ownInvoiceId": "wZufHQ_sFWwmQhvA",
  "assignedTask": { "object": "showcase_task", "id": "2h9HuTjfrm5jUjJn", "due_date": "2026-12-02" },
  "teardown": "discard the run's own file DB, or delete the sys_user_position row(s) and the own invoice (the recipe's teardown)"
}
EXIT=0
```

A second run with no flags also exited 0. Step 4's subset proof passed
on both runs: none of the twelve seeded invoices was visible, and
INV-1003 was not served.
</details>

## Acceptance notes

- The ledger recipe `search:qa-contributor-bound-member`
(`docs/qa/platform-checklist/areas/search.json`) still lists steps 1 to
5 with no membership step between 2 and 3. Its prose is now behind the
script on this point. That file is outside this card's file surface, so
it is unchanged here; I left it for the seat to decide. The script names
the add-member door and the reason in a comment at the call.
- The invitation the sign-up presented stays `pending`, since the member
never accepts it. A boot that is torn down with its file DB, the usual
case for this fixture, drops it.

## Verification

Read first: the new block in `contributorMember` after step 2
(`scripts/qa/qa-fixture.mjs`). Risk: the `sys_member` read-back filters
by bare query parameters (`user_id`, `organization_id`), the data list
door's field-filter form.

Two-minute check: boot a fresh showcase, then run `node
scripts/qa/qa-fixture.mjs contributor-member --base-url
http://localhost:PORT`. Expect exit 0 and the one JSON object above.

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

https://claude.ai/code/session_016WV4d13AraSmVmgVtCvkWk

Co-authored-by: Claude <noreply@anthropic.com>
… stored pending_approval one (#38446)

Fixes #38322
Part of: #33806 (step 2 of 4, UI and SDK; step 1 merged as PR #38273)

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

## 维护者速读

-
用户能看到什么变化:用户无感。控制台聊天里待确认操作的审批卡片,今后服务端换成新的答复写法后照样出现;按旧写法保存的历史对话也照样出现,批准、拒绝都能用。
-
为什么做:这是「把应用内助手的待确认操作并入统一确认服务」四步中的第二步(界面与客户端),必须在第三步改服务端答复之前落地,否则新提案在聊天里看不到审批卡片。
- 出错会怎样:最坏情况是聊天里某条待确认操作不显示审批按钮,用户可改到 AI 审批收件箱处理;本改动只动控制台识别逻辑,可整体撤回。
- 要你做什么:无

## What changes

Step 1 (PR #38273) moved the in-app pending answer from `{ status:
'pending_approval', pendingActionId }` to `{ status:
'pending_confirmation', pendingId }` (`ActionConfirmationPending`,
`packages/spec/src/contracts/ai-service.ts`), and its contract text ("A
stored `pending_approval` answer") says a stored old answer is read by
the SAME recogniser, taking `pendingActionId` as the `pendingId`, with
no second reader. Ruling A on #33806 says the same.

- `ui/packages/plugin-chatbot/src/toolResultParsers.ts`:
`detectPendingApproval` is that one recogniser. It reads
`pending_confirmation` + `pendingId` and `pending_approval` +
`pendingActionId`. Each status pairs with its own id key only: a crossed
pair (`pending_confirmation` + `pendingActionId`, or `pending_approval`
+ `pendingId`) is not read, so no lenient dialect gets in. The id still
comes back as `pendingActionId`, the name
`ChatToolInvocation.pendingActionId` and the approve/reject routes
already use. Signature and return type are unchanged. An orphaned
docblock that named only the old literal is gone.
- Every reader already goes through it: `mapMessages.ts` (the live and
stored-history mapper, plus the record-write, sample-data-cleanup and
package-removal card detectors), app-shell `useChatConversation.ts`
(`toUIMessages` approval promotion), and `aiChatHydration.ts`.
`useHitlInChat.ts` and `useObjectChat.ts` read only the lifted
`tool.pendingActionId`. No reader of either literal is left outside the
recogniser (`git grep` over `ui/` for both literals, outside tests and
CHANGELOGs, finds only the recogniser, the docblocks and the cache
writer below).
- Docblocks that named only the old literal now name both:
`chat/types.ts`, `useHitlInChat.ts`, `useObjectChat.ts`,
`mapMessages.ts`, and `useChatConversation.ts` (the cache writer).
- SDK half of the card: nothing to move. `packages/client/src/index.ts`
(`ai.pendingActions.*`) and
`ui/packages/plugin-chatbot/src/usePendingActions.ts` call the REST
routes `/ai/pending-actions/*`. They name none of the four retired
`IAIService` members (`proposePendingAction`, `approvePendingAction`,
`rejectPendingAction`, `listPendingActions`), so `git grep` over
`packages/client`, `packages/client-react` and `ui/` (CHANGELOGs
excluded) finds 0 hits. The routes belong to step 3, so both files are
untouched.
- No runtime, route or spec change, and no export added or removed.

## Tests

- `ui/packages/plugin-chatbot/src/__tests__/mapMessages.test.ts`: a new
top-level `describe`, "detectPendingApproval reads the current and the
stored pending answer". It covers the new shape (bare, text-wrapped,
JSON string), the old shape (bare, text-wrapped), crossed pairs and
malformed ids refused, a live `pending_confirmation` result lifted to
`approval-requested` + id, the record-write card drawn from a
`pending_confirmation` envelope, and a conversation stored with the old
answer re-drawing its approval card. A lit control checks that an
ordinary result draws no card.
-
`ui/packages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx`:
two new driven round trips that end in the REST call Approve makes. One
restores a cached entry from the stored `pending_approval` envelope
alone (part-key fallback removed, so the recogniser is what is proven).
The other takes a live `pending_confirmation` answer through the cache
to Approve.

## Acceptance notes

- The chat's local cache writer (`pendingApprovalToCachedResult`) still
mints `{ status: 'pending_approval', pendingActionId }`. This PR first
switched it to the current answer, but
`AiChatPage.runtimeMessageSeam.test.tsx` under
`app-shell/src/console/ai/__tests__` pins that exact shape, and that
file is outside this card's claimed file surface, so the writer change
was reverted. The recogniser reads both, so a cached entry restores
either way. Moving the writer to the current answer is a one-line change
plus that one assertion. Carrier: #38448.
- `detectPendingApproval` is a public export of
`@object-ui/plugin-chatbot` (and `/core`). Its signature is unchanged,
and it now also recognises the `pending_confirmation` answer. It refused
that input before, so this PR declares `Clause-②: yes (widening)` (seat
routing on the dev's question; the claim said `no`). The bump stays
`patch`: the level follows `Metadata-protocol`, which is `none`. The
declaration owes a TIER_DEFAULT review of record.

## Verification

Two-minute check: `pnpm --dir ui exec vitest run
packages/plugin-chatbot/src/__tests__/mapMessages.test.ts`. Expect every
test to pass, including the 7 under "detectPendingApproval reads the
current and the stored pending answer".

Read first (by risk):
1. `ui/packages/plugin-chatbot/src/toolResultParsers.ts`, the
`detectPendingApproval` / `pendingAnswerIdKey` hunk: the strict
literal-to-id-key pairing.
2.
`ui/packages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx`:
the two new round trips.
3. `ui/packages/plugin-chatbot/src/__tests__/mapMessages.test.ts`: the
new `describe`.

All readings below are at head `e5da5265` unless a line says otherwise.

<details><summary>Tests (local, under the shared verify lock)</summary>

- `pnpm --dir ui exec vitest run --maxWorkers=2
packages/plugin-chatbot/` + all 14 `*ratchet*` tests under
`packages/app-shell/src` + `packages/app-shell/src/console/*.test.tsx` +
`packages/app-shell/src/console/ai/` + `packages/app-shell/src/hooks/` +
`packages/app-shell/src/assistant/`: Test Files 238 passed (238), Tests
2086 passed (2086), VERDICT command-exit 0.
- `pnpm --filter @object-ui/plugin-chatbot type-check`: exit 0.
`--listFiles` shows `tsconfig.test.json` compiles
`src/__tests__/mapMessages.test.ts`.
- `pnpm --filter @object-ui/app-shell type-check` (after building the
`@object-ui/app-shell^...` closure, 72/72 tasks): VERDICT command-exit
0.
- eslint over the 8 changed `ui/` files: 0 errors (13 warnings, all on
lines this PR does not touch).
- Narrowing, declared: the full app-shell suite (about 2,459 files) was
not run locally. CI `Test UI` runs it.

</details>

<details><summary>Ablation (on-disk mutation via
scripts/ablation-replace.mjs, restored to the HEAD blob each
time)</summary>

The vitest config aliases the packages under test to `src`, so no `dist`
was involved.

- Removed the `pending_confirmation` arm (`toolResultParsers.ts` blob
9e4f150 to 9ba227b6). 4 red: the three new-shape pins in
`mapMessages.test.ts` and the new-answer cache round trip. Restored:
blob equals HEAD, `git diff HEAD` empty.
- Removed the `pending_approval` arm (blob 9e4f150 to 89c4cedb). 6 red:
the old-shape pin, the stored-conversation re-draw, the new
stored-envelope-only cache restore, and three existing cache round trips
that read the stored literal. Restored: blob equals HEAD, `git diff
HEAD` empty.

</details>

<details><summary>Gates</summary>

- `node scripts/pm/dispatch-gates.mjs --commands` derived 38 families
for this diff. All 38 ran locally, each exit 0 (`pnpm --dir ui exec
vitest run scripts/`: 172 files passed, 2 skipped). `--ran`
reconciliation: "38 derived famil(ies) accounted for — 38 run, 0
NOT-MEASURED (a DERIVED zero)".
- `node scripts/pm/overlap-check.mjs`: "VERDICT clean exit 0". It merges
cleanly with `origin/main` and shares a file with no open PR.
- Families CI runs (repo-wide lint, the full UI test shards, typecheck
lanes): read from this PR's check-runs, not re-run locally.

</details>

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(`packages/spec` is not touched.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran. eslint on the changed files shows 0 errors;
repo-wide `pnpm lint` is left to CI.
- [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 applicable.
- [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, apart from the
maintainer quick-read section the fleet contract asks for in Chinese.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

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

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5nvFivDeQyYgTFkZhi -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
…s is one passage (#38439)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XPVeTnk3WhfrSQRKLNq8upv)_
Fixes #38351
Clause-②: no
Metadata-protocol: semantic
Skills-docs: follow-up #38442

## 维护者速读

-
用户能看到什么变化:按标题切分的知识源里,一个放得下一段的小节(一条条文、一节说明、一张表格连同它的注释)现在整节一段,检索命中的是完整的一条,不再是半条;放不下的小节切法与以前完全一样。
- 为什么做:知识切分专题第一阶段,按您对“放得下的小节整节一段做成默认”的裁决(选 A)实现,作者不用再手动调合并阈值。
-
出错会怎样:只影响按标题切分的知识源,这些知识源本来就要因上一个“标题丢失”修复重建一次,这次改动搭同一次重建,不再多建;切分功能仍在预发布期,撤回只需回退本次改动并再重建一次。
- 要你做的:无。

## What changes

- **Splitter**
(`packages/services/service-knowledge/src/split/splitter.ts`,
`withPrefix`): under `split.strategy: 'markdown'`, after the
heading-path prefix is selected exactly as before (full path, else the
innermost heading, else none, by the existing half-the-bounds rule), a
section whose emitted passage (prefix plus trimmed text) fits the bounds
is returned as that one passage, whatever `minChars` is. Only a section
that does not fit reaches `splitRecursive`, unchanged, so its passages
are byte-identical to before. The path-less branch (text before the
first heading) takes the same rule. Body-less headings and the carry
logic are untouched. `recursive` and `whole` are untouched.
- **Which "fits" (Zone 2 hypothesis 3).** Fitting is judged on the
passage as emitted, `fits(lead + body.trim(), b)`, not on `fits(body,
left)`. `estimateTokens` rounds up per text and the prefix ends in
whitespace, so the two raw sums add and the estimate of the passage is
at most the prefix's estimate plus the body's: the emitted check accepts
everything the split check accepts, plus the sections that are over the
budget left after the prefix only by one rounding token. Characters
agree, except for a heading that starts with whitespace other than a
space or tab, where the emitted check is again the looser one. The
emitted check is the bound the file promises for every passage, so a
fitting passage can never exceed it. Pinned by a test.
- **Version.** `SPLIT_ALGORITHM_VERSION_BY_STRATEGY.markdown` stays
**2**. Read at base `d751790c`:
`.changeset/38350-markdown-bodyless-headings.md` is still pending, and
the published `@objectstack/service-knowledge@next` is `19.0.0-next.2`,
whose changelog does not carry it. So this rides the 1 to 2 move already
in this train (topic rule: one bump per train).
`SPLIT_ALGORITHM_VERSION` and its export are not touched.
- **Prose that restates the ruling** (ruling 7247322956, A): the
splitter file head and `splitMarkdown` docblocks; the
`KnowledgeSplitSchema` docblock for `markdown`, the `minChars` docblock
and `.describe`, and the knowledge source form's `minChars` help text in
`packages/spec`; the regenerated
`content/docs/references/ai/knowledge-source.mdx`;
`content/docs/protocol/knowledge.mdx` section 3.5 and
`content/docs/ai/knowledge-rag.mdx`. No key, value, default or export
changes (`check:api-surface` and `check:authorable-surface` green).
- **Form translations** (patch round 1, contract review record
7249205899 M1/S1): the `en` bundle leaf `source.split.minChars.helpText`
in
`packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts`
regenerated by `node scripts/check-i18n-bundles.mjs --write`; the
hand-translated `zh-CN`, `ja-JP` and `es-ES` leaves re-translated to the
new rule. The other seven locales serve the new English through their
source-hash fallback.
- **Changeset** `.changeset/38351-markdown-fitting-section.md`:
`@objectstack/service-knowledge` minor, `@objectstack/platform-objects`
minor (the bundles above), and `@objectstack/spec` minor, because the
spec's shipped prose changes (the `.describe` string ships in the JSON
schemas and the reference, the help text ships in the form) and
AGENTS.md asks at least `minor` of a `semantic` kind on every package
the diff moves.

## Tests

`packages/services/service-knowledge/src/__tests__/split.test.ts`, new
top-level describe "splitter — markdown: a section that fits is one
passage", 11 cases:

- three 250-character paragraphs under one heading at the default
`minChars`: one passage, prefix first;
- the same with `minChars: 0`: still one passage;
- a section that does not fit: cut exactly as before (pinned output),
and `minChars` still merges its short pieces;
- the prefix counts: exactly `maxChars` with the prefix is one passage,
one character more is cut;
- a path too long for the half-bounds rule falls back to the innermost
heading, and that passage fits: one passage under the innermost prefix;
- a table and its note inside a fitting section: one passage;
- the token budget: under `maxChars` but over the budget is still cut,
each piece within it;
- "fits" reads the emitted passage (the rounding case above);
- text before the first heading that fits: one passage, no path;
- a parent's own text before its first child: one passage when it fits;
- `recursive` unchanged on the same paragraphs.

Before the fix, against the unmodified splitter, 8 of these were red
(the 3 that pin unchanged behaviour were green, as they must be). The
existing "every heading and line is kept" and "no passage over the
budget" properties and the golden files pass unchanged
(`headings.markdown.golden.json` is byte-identical).

## Acceptance notes

Seeded synthetic corpus (the private corpus is not available; the script
stays out of the PR). 400 documents per shape, article length lognormal
with median 96 (about 78% under 200), 1 to 6 chapters and 1 to 8
articles each, paragraphs of 120 to 320 characters, 5% of articles
carrying a table and its note at a random position, `maxChars` 800. A
unit "fits" when its passage under its full heading path is within
`maxChars` and the token budget. Real `estimateTokens`, not stubbed.

| Shape | Setting | Passages | Mixed passages | Fitting units split |
Fitted table + note together |
|---|---|---|---|---|---|
| Units are headings | default, before | 6,814 | 0% | 261 / 6,018
(4.34%) | 209 / 251 (83.3%) |
| Units are headings | default, **after** | 6,537 | **0%** | **0 / 6,018
(0%)** | **251 / 251 (100%)** |
| Units are headings | `minChars = maxChars` (before = after) | 6,342 |
0% | 0 | 251 / 251 |
| Units are bold paragraphs under chapter headings | default, before |
4,245 | 59.22% | 891 / 6,208 | 60 / 260 |
| Units are bold paragraphs under chapter headings | default, **after**
| 3,951 (-6.9%) | 59.68% (+0.46 pt) | 813 / 6,208 | 69 / 260 |
| Units are bold paragraphs under chapter headings | `minChars =
maxChars` (before = after) | 2,486 | 75.22% | 262 / 6,208 | 218 / 260 |

- Topic bar met on heading-shaped input: 0% of fitting units split (bar
0.5%), 0 mixed, every fitted table with its note.
- Non-heading shape, the reading the ruling asked for: passages -6.9%,
mixed share +0.46 points. The `minChars = maxChars` recipe on the same
input gives -41% and +16 points.
- With a 512-token embedder (budget 409), both shapes read identically
before and after: under that budget the fitting sections were already
one passage.
- Byte-identity of sections that do not fit, measured: 20,000 random
Markdown documents (headings, tables, lists, Chinese and English
sentence marks) under random `maxChars`, `minChars` and token limits,
compared section by section between the base splitter and this one:
162,790 sections identical, 7,735 sections that were cut now one
passage, 0 other differences.
- Zone 2 hypothesis 5 (the card's 0.2% residual under the recipe): not
reproduced. The synthetic corpus gives 0 there, as in the decision
analysis; its headings are short, so the prefix fallback is never
reached. Not explained here.
- Not touched, by the order: `docs/adr/**` (no ADR note owed: no ADR
text contradicts the change; ADR-0161 hands the split rules to the
splitter's card and only names the `maxChars`/`minChars` keys),
`skills/**` (the `Skills-docs:` follow-up), `content/docs/releases/`,
and the `markdown` entry's comment in
`SPLIT_ALGORITHM_VERSION_BY_STRATEGY`, which names only the body-less
heading change. It sits next to the constant sibling #38377 retires, so
it is left to avoid a conflict, and the changeset records that version 2
carries both changes.
- `content/docs/protocol/knowledge.mdx` section 3.5's `markdown` row
said "A heading with no text of its own joins the next passage". That
has not been true since the body-less heading fix, so the rewritten row
states the landed behaviour.

## Verification

Read first, by risk:

1. `packages/services/service-knowledge/src/split/splitter.ts`,
`withPrefix`: the two early returns (the `fits(whole, b)` lines) and the
comment above the prefix loop.
2. `packages/spec/src/ai/knowledge-source.zod.ts`: the `markdown` bullet
and the `minChars` docblock and `.describe` (contract-tier L2 face).
3. `content/docs/protocol/knowledge.mdx` section 3.5.

Two-minute check: `pnpm --filter @objectstack/service-knowledge exec
vitest run src/__tests__/split.test.ts -t "fits is one passage"` shows
11 passing tests.

<details><summary>Local runs (heads 4723a4f and c645c31)</summary>

Patch round 1, head `c645c319` (two commits on `4723a4fe`, no splitter
or test change): `pnpm check:i18n` red at `4723a4fe` (`platform-objects
DRIFTED (1)`), exit 0 at `c645c319` (all bundles in sync);
`check:i18n-stale-fill` exit 0; `pnpm --filter
@objectstack/platform-objects exec vitest run src/apps/translations`: 28
files, 625 tests passed; spec `check:generated`: all 14 up to date;
`dispatch-gates --ran`: 118 accounted, 115 run, 3 NOT MEASURED
(prerequisite not met in this container; CI runs them);
`overlap-check.mjs --branch=HEAD`: clean.

Round 0, all on head `4723a4fe`, worktree base `d751790c`.

- `pnpm --filter @objectstack/service-knowledge test`: Test Files 21
passed (21), Tests 737 passed (737); lock VERDICT command-exit 0.
- `pnpm --filter @objectstack/service-knowledge typecheck`: tsc clean;
`check:test-typecheck: OK`, 0 errors.
- `pnpm --filter @objectstack/spec exec vitest run
src/ai/knowledge-source.metadata-form.test.ts
src/ai/knowledge-source.test.ts`: 2 files, 42 tests passed; `pnpm
--filter @objectstack/spec typecheck` exit 0. The rest of the spec suite
is CI's (prose-only change in spec).
- `pnpm --filter @objectstack/spec build && check:generated`: 1 of 14
stale (`check:docs`), regenerated with `--fix` (the reference page
above); `check:authorable-surface`, `check:api-surface` green,
`authorable-surface.base.json` untouched.
- Red before the fix, on the unmodified splitter: `vitest run
src/__tests__/split.test.ts -t 'fits is one passage'`, Tests 8 failed /
3 passed (the 3 pin unchanged behaviour), each failure a fitting section
returned as 2 to 4 passages.
- `node scripts/pm/dispatch-gates.mjs --commands` (derived from the
merge base, 8 paths): 114 commands, run locally; `--ran` reconciliation:
114 accounted, 110 exit 0, 4 NOT MEASURED (exit 3, prerequisite not met
in this container: `check-plugin-teardown-shape --self-test` needs an
unshallow clone; `check:skill-examples`, `check:dual-build-cjs-loads`
and `check:i18n` need a full workspace build). CI runs all four.
- `node scripts/pm/overlap-check.mjs --branch=HEAD`: `VERDICT clean exit
0`, merges cleanly with `origin/main`, 0 open PR heads overlapping.
- Dogfood battery: not owed (no `!` in the title, no `(narrowing)` arm).

</details>

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

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5mCvGQKiCEBneFwp1j -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
…rm a package still ships as an old shape (#38453)

Fixes #38437

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:用户无感;Setup 之后读已安装应用的表单原件时,能读到应用自带的那份,不再是空。
- 为什么做:为控制台改读表单类型(表单条目进控制台那张卡)扫清障碍,否则"应用自带即关闭"的判断和"恢复为包内原样"都读不到原件。
- 出错会怎样:只影响两个读接口对旧写法表单的回答,匿名表单的打开与提交不变(已逐字节比对);可整体撤回。
- 要你做什么:无

## What changes

The by-name read and the list of `form` already serve a form a package
still ships in its `views:` (a container's `formViews` entry, or a
`viewKind: 'form'` item) through the projection (`projectViewForms`,
ADR-0159 D5). Two reads did not, measured at main `5df10ecc` (probe
readings on #37087):

- `getMetaItemLayered({ type: 'form' })` answered `code: null`, and
`effective: null` while only a stored `view` row stood over the form.
- `getMetaItemsPerPackage({ type: 'form' })` answered no item.

Now:

- **Layered read** (`protocol-meta-layered-reads.ts`): the exported
`getMetaItemLayered` folds the type and, for `form`, reads the generic
`form` layers (the unchanged body, renamed `getGenericMetaItemLayered`).
Only when they answer no `code`, or no `effective` and no stored `form`
row, it also reads the same address's `view` layers and fills those two
fields from their projection (`withOldShapeFormLayers`). `overlay` stays
the stored `form` row: a `view` row is not a `form` overlay. A stored
`form` row or an authored `form` item keeps its generic answer. A `view`
read that refuses leaves the generic answer as it was.
- **Per-package read** (`protocol-meta-list-reads.ts`): for `form`, adds
the projection of the same request's per-package `view` list
(`withProjectedPerPackageForms`); an authored `form` item of the same
package and name shadows its projection.
- Both helpers live in `protocol-form-reads.ts` beside the effective
read's projection; projected items carry `_formDefinedIn: 'view'` and
`requiredPermissions` as `projectedItem` already sets them, served under
the layer's package (else the address the read answered for).

Response shapes are unchanged: only fields that answered `null` / `[]`
now carry the item the by-name read already serves.

Read first (by risk):

1. `packages/metadata-protocol/src/protocol-meta-layered-reads.ts`, the
new `getMetaItemLayered` wrapper: when the second (`view`) read happens,
and that its failure is swallowed to the generic answer.
2. `packages/metadata-protocol/src/protocol-form-reads.ts`,
`withOldShapeFormLayers`: `effective` is filled only when
`form.effective` and `form.overlay` are both empty.
3. `packages/metadata-protocol/src/protocol-meta-list-reads.ts`,
`getMetaItemsPerPackage`: the doors read this layer for withdrawals
only.

## Tests

`packages/rest/src/form-old-shape-layers-38437.test.ts` (new), the real
protocol over SQLite with the harness of
`public-form-two-type-withdrawal.test.ts`:

| Pin | Fixture | Asserts | Ablation that turns it red |
|:--|:--|:--|:--|
| 1 | old-shape container base, no pair | layered `code` and `effective`
= the projected form at the base and naming no package; per-package =
the projected item; doors open | layered arm removed (A1); per-package
arm removed (A2); `effective` half removed (A3) |
| 2 | `form` override in the pair | at the pair and the base: `code` =
the base's projection, `overlay` and `effective` = the override (not
projected); pair per-package = the override only; doors closed | A1 |
| 3 | pre-card `view` override in the pair, no `form` row | `code` = the
base's, `overlay` null, `effective` = the override's projection; doors
closed | A1, A3 |
| 4 | base ships the form switched off (`sharing.enabled: false`) |
layered `code` / `effective` and per-package carry `enabled: false`;
doors closed | A1, A2, A3 |
| 5 | authored `form` item (control) | layered and per-package answer
the generic item, not projected; doors open | control |
| 6 | open override over an open old-shape base | doors open | control |
| 7 | read gate: the container's form entry carries
`requiredPermissions` | `/meta/form/NAME/layers` refuses a caller
without it with the same status and body as `/meta/view/NAME/layers`
(`403 PERMISSION_DENIED`), and serves the projected code to a caller
with it | A1 (the `form` read answers `404` for every caller) |

Updated:

- `protocol.lookup-artifact-item-call-sites.test.ts`: the recorded site
moves with the body to `getGenericMetaItemLayered` (same call, same
disposition).
- `public-form-reads-once-37709.test.ts`, the CONTROL outside one
request reading: the `view` rows read 5 times, not 4, because the `form`
per-package layer now reads the per-package `view` list. Inside one
reading (the doors' real path) the counts are unchanged: that pin passes
as it was.

## Acceptance notes

- Known residual, kept by the claim: an authored `form` base plus a
pre-card `view` override. The layered `effective` keeps the generic
answer (the authored item), while the by-name read serves the `view`
override by rule 11. No first-party form is in that state.

## Verification

Two-minute check: `cd packages/rest && pnpm exec vitest run
src/form-old-shape-layers-38437.test.ts` → 7 passed.

<details><summary>Doors byte-equal (pins 1 to 7's fixtures, with both
arms removed vs in place)</summary>

A scratch test (not committed) recorded each fixture's resolve-door
answer (status, code and whole body), submit-door status and code, and
the record count, with the arms in place and under each ablation. All
three ablations (A0 both arms off, A1, A2, A3) produced the same 7 lines
byte for byte: `200` / `400 VALIDATION_FAILED` / 0 records for the open
fixtures 1, 5, 6, 7; `404 FORM_NOT_FOUND` on both doors / 0 records for
2, 3, 4.
</details>

<details><summary>Ablation readings</summary>

- A0 (both arms removed): pins 1, 2, 3, 4, 7 red; 5, 6 green.
- A1 (layered arm removed): pins 1, 2, 3, 4, 7 red.
- A2 (per-package arm removed): pins 1, 4 red (`expected [] to deeply
equal [ { …(5) } ]`).
- A3 (`effective` half removed): pins 1, 3, 4 red.
- Sources restored by copy from a backup and compared with `cmp`; dist
rebuilt after.
</details>

<details><summary>Suites and gates</summary>

All at head `37428f10e7` except where named (the head's only change
after them is test bookkeeping, re-run in its files):

- `@objectstack/metadata-protocol` full vitest: 23645 passed, 2 failed
at the first commit (the `lookupArtifactItem` site census and the
request-boundary fold census, both caused by this diff: the site moved
to `getGenericMetaItemLayered`, and the wrapper did not fold the type).
Both fixed; the two files re-run: 24 passed.
- `@objectstack/rest` full vitest: 9324 passed, 2 failed (the
`public-form-reads-once-37709` CONTROL count, 5 `view` row reads outside
one request reading, not 4: the new per-package `view` read). Count
updated with its reason; that file plus the new pin file plus
`public-form-two-type-withdrawal`: 78 passed.
- `@objectstack/objectql` full vitest: 14546 passed.
`@objectstack/runtime` `src/domains` plus `action-package-addressing`:
7588 passed, 4 skipped.
- `pnpm typecheck` in metadata-protocol and rest (with
`check:test-typecheck`): exit 0.
- Derived gates (`dispatch-gates.mjs --commands`, 69 families), each
recorded with its exit code: 67 exit 0 on the first pass.
`check:dts-closure` exit 1 and `check:dual-build-cjs-loads` exit 3 named
packages outside this diff whose dist had no declarations; after a dts
build of `./packages/**` both re-ran exit 0. `--ran` reads the first
codes (69 accounted, 68 run, 1 NOT-MEASURED), which I report as
recorded.
- `overlap-check.mjs --pr=38386`: clean against main `1afd9c1338` and
#38386 (the open PR of the other form follow-up card).
</details>

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

https://claude.ai/code/session_01L9qibxQiu6MyZ2ngLJtA5Y

Co-authored-by: Claude <noreply@anthropic.com>
…ult (#38459)

Fixes #38420

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:管理员在 Studio
打开元数据表单(知识源、智能体、技能、应用、邮件模板、对象能力、仪表盘页眉等)时,未填写且默认开启的开关,编辑与只读两种模式下都显示为「开」,与实际运行一致。
- 为什么做:修复 Studio 知识源表单把默认开启的「可被 AI 智能体搜索」「随记录变更同步」显示成关闭、与帮助文字和实际行为相反的缺陷。
- 出错会怎样:只影响开关的显示,不写入任何值;未改动的条目保存后仍不存这个键,出问题时撤回本次改动即可恢复原显示。
- 要你做什么:无

## What changes

The metadata-form Switch in `SchemaForm` drew every unset boolean as
`!!value`, so a key whose served schema says `default: true` read OFF
while the runtime treats it as on. It now draws the value in effect: an
unset key (the shared `isUnsetFieldValue` definition) draws the schema's
declared `default`, a stored boolean draws itself. This is the flow node
inspector's existing "show, do not write" boolean rule applied to the
generic form: nothing is written until the author toggles, so an
untouched item still saves without the key and keeps following the
default (the ruling's display-only constraint).

The default is read off the served JSON Schema, which already carries
it: `aiExposed` and `refresh.onRecordChange` are
`z.boolean().default(true).optional()`, and `z.toJSONSchema` emits
`default: true` for both. The form declares no default of its own and
needs none, so `packages/spec` is untouched.

Every boolean row a registered metadata form declares whose derived
schema defaults to `true` shares this one Switch; the new test
enumerates them from `METADATA_FORM_REGISTRY` and the registered type
schemas rather than listing them. At the head of this PR the walk finds
rows on nine forms: knowledge source (`aiExposed`,
`refresh.onRecordChange`), skill, agent, app and email template
(`active`), object (`enable.searchable`, `enable.apiEnabled`,
`enable.feeds`, `enable.activities`, `enable.clone`), field
(`sortable`), report (`drilldown`, `dateRange.allowCustomRange`) and
dashboard (`header.showTitle`, `header.showDescription`,
`dateRange.allowCustomRange`). That list is a reading taken once; the
test is the instrument that re-derives it.

Read first, by risk:
1. `ui/packages/app-shell/src/views/metadata-admin/SchemaForm.tsx`, the
boolean branch of `FieldControl` (the `declaredDefault` line and the
`checked` expression): the only behaviour change.
2.
`ui/packages/app-shell/src/views/metadata-admin/SchemaForm.declaredBooleanDefault-38420.test.tsx`,
the `defaultTrueRows` walker: what "every default-true switch" means
here (top-level rows and `composite` sub-rows).

Two-minute check: `pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/SchemaForm.declaredBooleanDefault-38420.test.tsx`,
expect 6 passed.

## Tests

New `SchemaForm.declaredBooleanDefault-38420.test.tsx`, all against the
real spec (the served form and
`z.toJSONSchema(getMetadataTypeSchema(type))`, as the `/meta/types` row
carries them):
- knowledge-source form, edit and read-only: both unset switches report
`aria-checked="true"`;
- explicit `false` reports `"false"`, explicit `true` reports `"true"`;
- an untouched form calls `onChange` zero times; the first click writes
`aiExposed: false` and adds no `refresh` key;
- every enumerated default-true row renders ON when unset, with a floor
(`knowledge_source.aiExposed`,
`knowledge_source.refresh.onRecordChange`, `skill.active`) so the walk
cannot pass by finding nothing;
- CONTROL: a boolean with no declared default, unset, reports `"false"`.

Ablation (fix reverted on disk by `scripts/ablation-replace.mjs`,
`checked={!!value}`; app-shell is a vitest source alias, so no build
sits between): 4 failed, 2 passed, exactly the four unset cases red and
the explicit-value and control cases green; restore verified blob equal
to HEAD and `git diff HEAD` empty.

<details><summary>Readings</summary>

- Final head 03896dd, the new file plus the neighbouring suites
(`SchemaForm.optionalEnumUnset-29733`,
`SchemaForm.requiredMarker-10367`, `SchemaForm.widgetLabelling`,
`ResourceEditPage.formBoundObject-37309`): `Test Files 5 passed (5)`,
`Tests 104 passed (104)`.
- Ablated: `Tests 4 failed | 2 passed (6)`; `ablation-replace: ok
restored: blob == HEAD (3095ad6) and git diff HEAD is empty`.
- `pnpm --dir ui exec vitest run scripts/` (derived family): `Test Files
1 failed | 171 passed | 2 skipped (174)`; the one failure was
`js-comment-mask-returns-interpolation-9424.test.ts` timing out at
15000ms on a contended box (unrelated to this diff); rerun alone: `Tests
8 passed (8)`.

</details>

## Acceptance notes

- Local `type-check` of `@object-ui/app-shell` was not measured: it
needs every `@object-ui/*` dist built (the run reported `Cannot find
module '@object-ui/components'` and its siblings before reaching any
check of this diff). NOT MEASURED locally, reason: closure not built;
`Type Check UI` in CI carries it. The change types against `JsonSchema`,
which that file declares as a string-keyed record of any value.
- Not verified in a running Studio; the component test drives the real
served form and derived schema through `SchemaForm`.
- The walker covers top-level rows and `composite` sub-rows. Boolean
columns inside repeaters (an object's `fields` rows, for one) render
through the same `FieldControl` Switch, so they take the fix, but the
pin does not enumerate them.
- `dynamic-config`'s schema-driven boolean (`DynamicConfigWidget` in
`widgets.tsx`) has the same `Boolean(cur)` shape, but nothing in the
tree populates `WidgetContext.dynamicSchemas`, so it has no reachable
default-true input today. Noted, not changed.
- The dispatch's file surface named `ui/.changeset/*.md`; `ui/AGENTS.md`
says new changesets go to the root `.changeset/` and none are added
under `ui/.changeset/`, so the changeset is
`.changeset/38420-unset-switch-shows-default.md`.

## Verification

Local derived gate list (`node scripts/pm/dispatch-gates.mjs --commands
--repo objectstack-ai/objectstack`): 38 families, run at 862c74b, all
exit 0 except two. `check:test-source-alias` was red on the new test (it
reached `@objectstack/lint` and `@object-ui/plugin-detail` through
dynamic imports with no module-top import); 03896dd adds the two
imports, and the gate is green there. `vitest run scripts/` had one
timeout, which passed when rerun alone. On 03896dd, the families that
read the changed test file were rerun, all exit 0:
`check:test-source-alias`, `check:undeclared-dep-imports`,
`check:cross-package-test-inputs`, `check:nul-bytes`,
`check:gitlink-declared`, and ui `check:new-line-citations` (0 new
citations). `--ran` reconciliation: `38 derived famil(ies) accounted for
— 38 run, 0 NOT-MEASURED (a DERIVED zero)`. Every family CI runs is read
from this PR's check-runs.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
…ate row without a false boot ERROR (#38460)

Fixes #38418

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:管理员每次启动带知识源的应用(如 showcase),服务日志不再出现一条假的 `[knowledge]` ERROR
和一条主键冲突 WARN;运维手动重建索引时也不再报这条假错。
- 为什么做:这是发版候选冒烟轮唯一不通过的一项(启动健康检查),维护者要在这次 next 版前修掉。
-
出错会怎样:最坏情况是知识源的同步状态行少记一次构建开始,管理员在设置页看到的上次构建信息滞后,下次构建会重写;改动只在知识服务内部,可直接回滚。
- 要你做什么:无。

## What changes

`ObjectStoreKnowledgeSyncState.upsert` (the write of a build's start,
`startBuild`) wrote the row through `updateWhere({ id: key }, data)` and
read the answer as a count. A `where` of the id alone is the engine's
by-id update even under `multi: true` (`resolveEngineUpdateDispatch`: a
pure-id `where` never reaches the predicate branch), and the by-id
update answers the record, not a count. So:

- row present: the record read as "0 rows changed", the fallback insert
hit the primary key (engine `WARN Insert operation failed … UNIQUE
constraint failed: sys_knowledge_sync_state.id`), the retry read 0
again, and `startBuild` threw the duplicate error. The service then
logged `ERROR [knowledge] the start of the build of source '…' was not
recorded`, and spent its once-per-process sync-state error report on it.
- row absent: the by-id update threw `RECORD_NOT_FOUND`, so `upsert`
threw before it ever reached its insert.

Now `upsert` calls a new `updateById`, which sends the by-id update
deliberately (no `multi`) and reads the answer the way
`IDataEngine.update` declares it: a record means the row was updated, a
count above zero means the same, `null` or `RECORD_NOT_FOUND` means
there is no row yet, so the insert runs. Any other error is rethrown.
The precedent for reading the by-id 404 as "no row" is `stamp` in
`packages/plugins/plugin-auth/src/mcp-client-last-use.ts`. `updateWhere`
now says in its docblock that it is for predicate writes only. Both
update forms go through one private `sendUpdate`, so the store still has
one engine `update` call site.

ObjectQL's update path and its return shape are not changed (the
ruling).

Measured on a real engine (ObjectQL + `SqlDriver` on better-sqlite3),
the raw answer of `engine.update(sys_knowledge_sync_state, …, { where,
multi: true })` for each `where` shape in this file:

| `where` (caller) | answer |
|---|---|
| `{ id }`, row present (`upsert`) | the record (object): **misread as
0** |
| `{ id }`, row absent (`upsert`) | throws `RECORD_NOT_FOUND` 404 |
| `{ id, build_id }` (`progressBuild`, `finishBuild`) | count: 1 on
match, 0 on a stale build id |
| `{ id, build_id, build_status }` (`closeInterrupted`) | count (0 on no
match) |
| `{ id, failure_count }` (`addFailure`, `setFailures`) | count (1 on
match) |

Only `upsert` was affected. The guarded writes take the predicate path
and answer a count. The new pin asserts each of them answers `true` and
`false` correctly.

## Tests

New file
`packages/services/service-knowledge/src/knowledge-sync-state-upsert.test.ts`,
on a real kernel (`ObjectQLPlugin`, `SqlDriver` on a file,
`QueueServicePlugin`, `KnowledgeServicePlugin`). No count and no engine
logger is mocked:

1. `startBuild` onto the existing row: one `update`, zero `insert`, and
the row reads `running` with the new build id. Onto no row: one
`insert`. Then `progressBuild` / `finishBuild` / `closeInterrupted` /
`addFailure` / `setFailures` each answer whether they landed. ObjectQL's
own logger records no warn or error.
2. A boot with `buildAtBoot: true` over an existing database, then an
operator rebuild: both builds are recorded as `done`, the knowledge
service logs nothing at warn or error, and the engine logs nothing at
warn or error.

<details><summary>Before the fix (test committed first, 19e02cc): both
red</summary>

```
× onto the existing row it updates once and inserts nothing; …
  DuplicateRecordError: Duplicate record refused on 'Knowledge Sync State': a unique constraint on 'Source Key' already holds this value. No record was written.
  Caused by: SqliteError: … UNIQUE constraint failed: sys_knowledge_sync_state.id
× a boot that builds the source over its existing row, and an operator rebuild after it, …
  AssertionError: expected "vi.fn()" to not be called at all, but actually been called 1 times
  "[knowledge] the start of the build of source 'kb' was not recorded (Duplicate record refused on 'Knowledge Sync State': …"
Test Files  1 failed (1) · Tests  2 failed (2)
```
</details>

<details><summary>After the fix</summary>

At head 85d21d1, under the verify lock (`VERDICT command-exit 0`):

```
pnpm --filter @objectstack/service-knowledge exec vitest run --maxWorkers=2
 Test Files  22 passed (22)
      Tests  728 passed (728)
pnpm --filter @objectstack/service-knowledge typecheck   (tsc --noEmit + check:test-typecheck OK, 0 errors)
pnpm --filter @objectstack/service-knowledge build       (exit 0)
```

Derived gate families (`dispatch-gates.mjs --commands`, 66): 64 exit 0.
`check-plugin-teardown-shape --self-test` and
`check:dual-build-cjs-loads` exit 3 PREREQUISITE NOT MET (a shallow
clone, and a workspace without every dist), so NOT MEASURED locally; CI
runs both. `--ran` reconciliation: 66 derived, 66 run, 0 UNRUN.
</details>

## Acceptance notes

- The pin sits in a new file, as the claim's file surface says.
`AGENTS.md` (ruling record 6583487846) puts a new pin for a component
that already has a shared harness into that harness as a top-level
`describe`. Here that harness is `src/__tests__/sync-state.test.ts`,
which is outside this card's surface. The new file copies a reduced form
of its boot helper. Moving the pin there is a mechanical follow-up if
the seat wants it.
- The existing harness never caught this defect: its knowledge logger is
a `vi.fn()` that no test asserts stays unused at error. Its rebuild
tests pass on the old code, because the row is written before `upsert`
throws.
- Showcase boot before/after (`grep -c 'ERROR \[knowledge\]'`): NOT
MEASURED. A showcase boot needs the whole workspace built, and the
container was shared with a full-workspace build and a UI suite holding
the verify lock. Test 2 above reproduces the card's exact ERROR line
before the fix and asserts it is absent after.

## Verification

First read (by risk):
1. `packages/services/service-knowledge/src/knowledge-sync-state.ts`:
`updateById` and `upsert`. Risk hunk: how the by-id answer is read
(record / count / `null` / `RECORD_NOT_FOUND`).
2.
`packages/services/service-knowledge/src/knowledge-sync-state-upsert.test.ts`:
test 2, the boot-and-rebuild case.

Two-minute check: `pnpm --filter @objectstack/service-knowledge exec
vitest run src/knowledge-sync-state-upsert.test.ts`. Expect `Tests 2
passed (2)`. Revert `knowledge-sync-state.ts` to `origin/main` and
expect both tests red with `UNIQUE constraint failed:
sys_knowledge_sync_state.id`.

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

https://claude.ai/code/session_016WV4d13AraSmVmgVtCvkWk

---------

Co-authored-by: Claude <noreply@anthropic.com>
…MAJOR (#38436)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_
Fixes #38240
Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:用户无感;只有往平台升级说明里新增条目的开发者会碰到:条目编号低于当前协议大版本时,合并前的门禁直接拒绝,并告诉他改成哪个文件名。
- 为什么做:属于升级说明(ADR-0087 迁移账本)的守卫;此前已有三条 19 版的升级说明被误放在 18 下,按「从 18
升级」运行时永远看不到(已另行改正)。
- 出错会怎样:最坏是误拒一条合法的补登记说明;作者在变更说明里加一行补登记声明即可通过,门禁本身可直接撤回,不影响任何已发布内容。
- 要你做什么:无。

**Round 2** (contract review 7249162118, head `323f21d860`): S1 fixed
(the refusal's printed backfill line carries `MINOR`, `PATCH` and `WHY`
placeholders and the reason must name a release of the entry's own major
in digits, so the line pasted unedited stays red, EM-R6); S2 fixed (the
`ledgerAdded` conjunct applies only on a merge base from before the
per-entry split, so an id the template already carries no longer hides a
new entry, EM-R7); N1 fixed (`retired-keys/` and `retired-defs/`
refusals give the tombstone aging cost read by `build-schemas.ts`).
Also: EM-G7 (the L1-a nit), EM-R8 (a case at major 20), and EM-U2 no
longer spells a spec version in prose (the `check:future-spec-major`
red). Battery EM now has 50 cases; `origin/main` merged.

_Where the sections below still describe round 1 (the `ledgerAdded`
condition on every base, a 40-character-only backfill reason, 31 EM
cases, test readings at `9982079f87`), the Round 2 line above supersedes
them: delta contract review 7250195970 (PASS) and delta L1-a 7250194256
(ACCEPT) read head `323f21d860`._

## What changes

`scripts/check-adr-0087-registration.mjs` gains a second rule, judged on
every diff (with or without a breaking changeset):

- **Added entries.** For each of the three entry directories
(`semantic/`, `retired-keys/`, `retired-defs/`), an entry file at HEAD
is *added* when its key (the filename minus its `MAJOR.` prefix) is
absent from the merge base's listing of the same directory. A
`semantic/` entry must also be in `ledgerAdded`, the id set the R4
`registered` check already reads, so the two never disagree about what a
PR registered.
- **Refusal.** An added entry whose prefix is below `PROTOCOL_MAJOR` is
refused. The message names the file, its prefix, the current
`PROTOCOL_MAJOR` and where it was read, gives the `git mv` to
`PROTOCOL_MAJOR.KEY.ts`, and says the one case that may sit lower is a
backfill, with the exact line to write.
- **Backfill escape.** The gate had no existing escape for this (its
only text input is changeset bodies, and its one marker is the
breaking-change disposition, of which a changeset may carry exactly
one). So a minimal declaration form: an HTML-comment line in a changeset
the PR adds, whose keyword is `adr-0087-backfill` plus a colon, followed
by the entry path and the release that shipped the change (40 characters
minimum, the same floor as a `not-required` reason). It is not an
`adr-0087` disposition (that pattern needs the colon directly after
`adr-0087`), and each one is printed and annotated as an exemption on
every run.
- **`PROTOCOL_MAJOR` source.** Read at HEAD from
`packages/spec/src/kernel/protocol-version.ts` (`PROTOCOL_SOURCE`,
imported from `scripts/sync-template-versions.mjs`) and evaluated by
that module's `loadProtocolMajor`, the same reader the version lane
uses. Nothing is hard-coded and no second copy is parsed. The reader is
async and `scan()` is not, so it runs in a child `node` process, only
when the diff adds an entry. A major that cannot be read is a red.
- **Self-test.** New battery `EM (#38240)`, 31 cases, roster floor 60 to
61. The GR7 transition fixture now carries the protocol module, because
its `beta` entry counts as added and is judged against it.

## The rule's reach

Covers:
- An entry the PR adds, in any of the three entry directories, whose
prefix is below `PROTOCOL_MAJOR` at HEAD. That covers the three
`semantic/18.*` entries #38142 moved to 19.
- CI's `Check Changeset` job checks out the PR's merge commit. So a
branch cut before a protocol move is judged against the major on `main`
once its CI runs after the move.

Does not cover:
- **Entries stranded by the protocol move itself.** The 34
`semantic/18.*` entries #38256 carries were each filed while
`PROTOCOL_MAJOR` read 18. They were at the major of their day, so this
rule would not have refused any of them. Catching that shape takes a
check at the protocol move (no unreleased entry left below the new
major), not a check on added entries. That check is not built here.
- **A move to a lower major.** A file renamed from `19.X.ts` to
`18.X.ts` keeps its key, so it is not *added* (the card's R100 pin) and
is not judged.
- **A PR carrying `skip-changeset`.** The real scan runs in `Check
Changeset`, which that label skips wholesale. Adding an entry publishes
from `@objectstack/spec`, so such a PR owes a changeset anyway.
- **A merge base from before the per-entry split.** The key alone
decides added-ness in `retired-keys/` and `retired-defs/` (they have no
`id:` line for `ledgerAdded` to see). From such a base, all of their
files would read as added: a red, never a silent pass, and no open
branch is that old.

## History reading

From #38239's Acceptance notes: since the per-entry files exist
(`f293d454b`, 2026-08-10), about **1,150** entries were added and **3**
landed below the protocol major of their day, all three in #38142. No
backfill was among them: the one explicit backfill (`5823d593db`) landed
at the major of its day. A rule of "equal to `PROTOCOL_MAJOR`" would
have refused the 717 entries filed ahead of the 17 to 18 bump.

Re-measured for this PR from a blobless clone of `main`, first-parent
`f293d454b..f42bcc1`, all three entry directories. An entry counts as
added when its key appears as `A` and not as `D` in the same commit, so
a move between majors is not an add. Major of the day is read by
position against the two bump commits `4e9fe9ff6` (17 to 18) and
`204356a6e` (18 to 19).

| directory | added | above the major of the day | equal | below |
|:--|--:|--:|--:|--:|
| `semantic/` | 643 | 330 | 310 | 3 |
| `retired-keys/` | 305 | 218 | 87 | 0 |
| `retired-defs/` | 210 | 169 | 41 | 0 |
| **total** | **1,158** | **717** | **438** | **3** |

The three below:
`publish-refuses-data-model-fields-that-save-and-do-not-work`,
`define-form-studio-helper-renamed-define-metadata-form` and
`form-type-define-form-and-packageless-list-at-form-name`, each `18.*`
under protocol 19.

## Tests

All readings are at head `9982079f87`, unless a line names another tree.

- **Red before.** The `EM-R1` fixture (an added `semantic/18.*` while
`PROTOCOL_VERSION` is `19.0.0`) run through `scan()` from `main`'s gate
(`f42bcc18c6`) and from this branch's gate: main's is green, this
branch's is red. The same battery run against this branch's gate with
the refusal loop switched off: 15 failures, all in `EM-R1`, `EM-G5`,
`EM-R3`, `EM-R4` and `EM-R5`. Nothing else in the self-test moved.
- **Green after.** `node scripts/check-adr-0087-registration.mjs
--self-test` printed `991 assertions` and exited 0. The battery floor
holds, including `EM (#38240)` at 31.
- **Replayed on real history.** `scan()` over `d9bc148e0` (#37513, the
commit that filed
`publish-refuses-data-model-fields-that-save-and-do-not-work` under 18
while protocol was 19) is red, naming that file. Over `216524a286`
(#38239, three `R100` renames 18 to 19) it is green, with 0 entries
counted as added. The CLI over `f42bcc18c6..origin/main` (`5df10eccaa`,
three new `19.*` entries) prints `3 migration entries added, each at or
above PROTOCOL_MAJOR 19.`

<details><summary>Red before: main's scan() against this branch's, on
the EM-R1 fixture</summary>

```text
main f42bcc1: GREEN -- EM-R1 expected RED, got green (0 problem(s))
branch: RED (1 problem(s))
  packages/spec/src/migrations/entries/semantic/18.late-note.ts: adds a migration entry under protocol major 18, below the current PROTOCOL_MAJOR 19
--- ablated gate (refusal loop off) --self-test:
✗ check-adr-0087-registration --self-test -- 15 failure(s)
  • EM-R1 an added semantic/18.* under PROTOCOL_MAJOR 19 is refused: expected RED, got green
  • EM-G5: the backfill is reported with where it was declared -- got []
  • EM-R3 a backfill line with a short reason is refused: expected RED, got green
  • EM-R4 a backfill line naming another entry does not excuse this one: expected RED, got green
  • EM-R5 an added retired-keys/18.* under PROTOCOL_MAJOR 19 is refused: expected RED, got green
  (and ten message-match lines under those cases)
```
</details>

<details><summary>Green after, and the replay on the commit that filed a
19 note under 18</summary>

```text
✓ check-adr-0087-registration --self-test: 991 assertions over real temp git repos (real scan()/assertInputs() path)

replay d9bc148 (the commit that filed a 19 note under 18): protocolMajor 19 · added ["semantic/18.publish-refuses-data-model-fields-that-save-and-do-not-work.ts"] · 1 problem(s)
packages/spec/src/migrations/entries/semantic/18.publish-refuses-data-model-fields-that-save-and-do-not-work.ts
      adds a migration entry under protocol major 18, below the current PROTOCOL_MAJOR 19
      (evaluated from packages/spec/src/kernel/protocol-version.ts at d9bc148).
      The filename prefix alone decides which upgrade step lists an entry, and
      `os migrate meta --from N` replays only the steps above N. An entry filed below the current
      major is never shown to a project upgrading from 18, the readers it was written for.
      fix: file it under the current major --
        git mv packages/spec/src/migrations/entries/semantic/18.publish-refuses-data-model-fields-that-save-and-do-not-work.ts packages/spec/src/migrations/entries/semantic/19.publish-refuses-data-model-fields-that-save-and-do-not-work.ts
      The one case that may sit lower is a BACKFILL: ...
      (the last line prints the exact backfill declaration for this path)

replay 216524a (PR #38239, three R100 renames 18 -> 19): added 0 · 0 problem(s)

$ node scripts/check-adr-0087-registration.mjs --base f42bcc1 --head origin/main
✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition.
✓ check-adr-0087-registration: 3 migration entries added, each at or above PROTOCOL_MAJOR 19.
```
</details>

<details><summary>Derived gate families: 34 derived, 34 run, all exit
0</summary>

Derived with `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at `9982079f87`. Each command ran under
`os-verify-lock.sh`, and its exit code was captured before any pipe.
- 33 commands in one runner: `VERDICT command-exit 0`. Every one exited
0: `check-adr-0087-registration` (`--base origin/main` and
`--self-test`), `check-closing-keyword-parity` (both halves),
`check-comment-mask-corpus`, `check-declaration-mirrors` (both),
`check-self-test-wired` (both), `check-self-test-workflow-commands`
(both), `check-whole-set-label-write` (both), `ci/plan-test-core-shards
--self-test`, `pm/bare-root-worklist --self-test`, and the pnpm families
`adr-anchors`, `agent-test-spelling`, `bash32-floor`,
`changeset-gate-self-tests`, `ci-filter-parity`, `cli-command-ids`,
`cross-package-test-inputs`, `driver-memory-census`, `entry-guard`,
`gitlink-declared`, `nul-bytes`, `parse-guard`, `pnpm-filter-targets`,
`pnpm-flag-spellings`, `ratchet-remedy-authority`, `refd-timer-probe`,
`scripts-symbol-anchors` and `watch-hint-literal`.
- `pnpm check:pm-dispatch-gates`: `VERDICT command-exit 0`,
`dispatch-gates self-test (fast tier): 2459 cases pass`.
- `dispatch-gates --ran`: `34 derived famil(ies) accounted for — 34 run,
0 NOT-MEASURED`.
</details>

## Acceptance notes

- **No changeset.** The diff is one file under `scripts/` and publishes
nothing, so the PR carries `skip-changeset`. That label skips the real
scan in `Check Changeset`. The gate's `--self-test` half still runs,
unconditionally, in `Lint & Repo Gates`
(`check:changeset-gate-self-tests`).
- **Why a new declaration form for backfills.** The gate's only text
input is changeset bodies. Its one marker is the breaking-change
disposition, which a changeset may carry exactly once, and a backfill is
not a breaking change. Reading the PR body instead would need the
workflow to pass it in, which is a governed `.github/workflows/**` edit.
The form is one line per entry, checked against the exact added path,
with the same 40-character reason floor as `not-required`. A line that
names no refused entry excuses nothing and is not itself an error.
- **`PROTOCOL_MAJOR` runs in a child process.** `loadProtocolMajor` is
async (it imports the type-stripped module) and `scan()` is synchronous
and called synchronously across the whole self-test. So the reader is
called in a child `node`, only when an entry is added. The reader file
itself is untouched. Cost: one short spawn on a PR that adds an entry,
nothing on any other.
- **Seat routing on the scope (A).** The seat (repo:objectstack#5) read
the card's ":570 entry dirs" as plural and ruled scope A: all three
entry directories, decided by key, with `semantic/` also required in the
R4 set. A stays within *added* entries, so it does not widen past the
reach note 7237892858. The narrower B (`semantic/` only, exactly the R4
id set) was not taken.
- **The R4 set and renames.** `ledgerAdded` (the R4 set) is an id set
read from `id:` lines. Renames do not count in it, because an id
survives a move. But it carries no file paths, and it cannot see
`retired-keys/` or `retired-defs/`, whose entries declare `export const
entry = '...'` and no `id:`. The card's directory scope and its ~1,150
reading both span all three directories, so added-ness is decided by the
key in each directory, and `semantic/` additionally requires the id to
be in `ledgerAdded`. EM-G3 (semantic) and EM-G6 (retired-keys) pin that
a rename, here a downward one so a counting rule would red, is not
counted.
- **Predicate 4 untouched.** Nothing in `verifyTypeSurfaceOnly` or the
prescription exemption moved (maintainer ruling 2026-08-30 on #13080).
- **Not merged with `main`.** Since the branch point, `main` gained 8
commits. None touches this file, `sync-template-versions.mjs` or the
protocol module (`overlap-check`: merges cleanly). The three entries
`main` added are the CLI reading above.
- **Follow-up filed: #38467.** As the reach note suggests, a second
check could run at the protocol move: no entry absent from every
released tag may stay below the new major. That shape is the one that
stranded the 34. #38467 carries that check, a downward rename, a PR not
re-judged after a protocol move, the `build-schemas.ts` remedy major,
the README/ADR prose and `--list` (L2 N2, N3), and the delta L2 nits N1
(`retired-defs/` cost text) and N5 (capitalised placeholder words).

## Verification

Read first (by risk):
1. `scan()`'s new tail block (the refusal and its backfill match) and
`addedMigrationEntries`, the added-ness definition the rule stands on.
2. `protocolMajorAt`, the child process that evaluates `PROTOCOL_MAJOR`
with `loadProtocolMajor`.
3. The `EM` battery, especially EM-G3 and EM-G6 (renames are not added)
and EM-R2 (an unreadable major is red).

Two-minute check: `node scripts/check-adr-0087-registration.mjs
--self-test` prints the success line with no failures. Then run the gate
on this branch with `node scripts/check-adr-0087-registration.mjs`. Its
last line should read `this PR adds no migration entry.`

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


<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oPfjnm2yWHEwkiYrn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XPpqjfjwZCAyAm71ZUE2yhz)_
Fixes #38377
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no published skill, doc page or example names the
retired constant (git grep over `skills`, `content/docs`, `docs`,
`examples`, `apps`, `ui`, `.claude` at 4fa2f8e: 0 hits); the ADR text
is item 2, carried by the lander

## 维护者速读

- 用户能看到什么变化:用户无感;只有直接引用知识服务包里那个旧常量的宿主代码,升级后编译会提示删掉这行引用。
- 为什么做:知识平台「切分版本按策略计」之后的收尾,撤掉一个已经没有任何运行代码读取的公开常量,免得作者和 AI 以为改它有效。
- 出错会怎样:最坏是某个宿主仍引用它而编译失败,删掉那行引用即可;可直接撤回本改动,不会触发任何索引重建。
- 要你做的:无。

## What changes

`SPLIT_ALGORITHM_VERSION` leaves `@objectstack/service-knowledge` at
once, with no alias (the card's stage posture). Since the per-strategy
split version landed, the index fingerprint (ADR-0161 K7) reads
`SPLIT_ALGORITHM_VERSION_BY_STRATEGY` for the source's resolved
strategy, and the global constant was read by no runtime code.

- `src/split/splitter.ts`: the constant and its docblock are deleted.
The per-strategy table's docblock linked to it ("Every entry started at"
the constant); it now says every entry started at 1, the one split
version the fingerprint read before the table, which names no retired
symbol and stays true.
- `src/split/index.ts`, `src/index.ts`: both re-exports are deleted.
- `src/__tests__/index-fingerprint.test.ts`: the version pin keeps the
two remaining constants (`INDEX_FINGERPRINT_VERSION`,
`ASSEMBLY_RULE_VERSION`), and a new case pins the retirement: neither
the split barrel nor the package entry has the property, with a positive
control on the entry.
- Area-ordered additions (the sibling split card's L2 nit, comment text
only, no assertion, value or snapshot changed): two comments now name
both changes `markdown` version 2 carries, the body-less heading as its
own passage and a fitting section as one passage whatever `minChars` is.
One is the `markdown: 2` entry comment in
`SPLIT_ALGORITHM_VERSION_BY_STRATEGY` (`splitter.ts`); the other is the
`PINNED` docblock in `index-fingerprint.test.ts`. The second clause is
true only once PR #38439 merges; the seat lands this PR after it. The
table's docblock does not tie version 2 to one change, so it needed no
edit.
- `.changeset/38377-retire-split-algorithm-version.md`: `patch` (kind
`none`), BREAKING banner, FROM/TO table, a sentence saying this
retirement replaces the still-pending 38349 changeset's note that the
constant keeps its name and value (that changeset is not edited),
ADR-0087 disposition `not-required (runtime-export-retired
@objectstack/service-knowledge#SPLIT_ALGORITHM_VERSION)`.

Item 2 of the card (the ADR-0161 K7 revisions row) is not in this PR: no
`docs/adr/**` edit. The landing seat appends it to the weekly ADR
revisions card (`carrier:` PR #38375). `Fixes` stays because that row is
landing bookkeeping.

Landing: a narrowing of a published surface. It owes one
contract-review-tier L2 on its final head before the queue.

Read first: (1) `src/split/splitter.ts` — the reworded docblock is the
only prose a reader of the table keeps; (2) the changeset — it ships as
the CHANGELOG line an upgrader greps; (3) the new test case.

Two-minute check: `pnpm --filter @objectstack/service-knowledge exec
vitest run src/__tests__/index-fingerprint.test.ts` — expect 9 tests
passing, including "publishes no global split version beside the
per-strategy table".

## Tests

Package suite at `f76ba9c9`. At `987b09ca`, the last commit that touched
code or tests, `index-fingerprint.test.ts` alone under the verify lock:
Test Files 1 passed (1), Tests 9 passed (9), VERDICT command-exit 0.


<details><summary>service-knowledge test + typecheck (lock VERDICT
command-exit 0)</summary>

```
pnpm --filter @objectstack/service-knowledge test
 Test Files  21 passed (21)
      Tests  727 passed (727)
pnpm --filter @objectstack/service-knowledge typecheck
check:test-typecheck: OK, the test layer compiles under tsconfig.test.json; 0 file(s) / 0 error(s) held in test-typecheck-debt.json
```
</details>

<details><summary>Ablation of the new retirement pin</summary>

With `export const SPLIT_ALGORITHM_VERSION = 1;` appended to
`src/index.ts` on disk, `index-fingerprint.test.ts` went red: `publishes
no global split version beside the per-strategy table` failed with
`expected ... to not have property "SPLIT_ALGORITHM_VERSION"` (1 failed,
8 passed). Restored with `git checkout HEAD`, tree clean.
</details>

<details><summary>Full dogfood (the narrowing arm), at
`4fa2f8ee`</summary>

`pnpm turbo run build --filter='@objectstack/dogfood^...'` then `pnpm
--filter @objectstack/dogfood test` under the verify lock: VERDICT
command-exit 0, Test Files 495 passed, 3 skipped (498), Tests 4183
passed, 68 skipped (4251). `987b09ca` differs from `4fa2f8ee` by
comments only (`git diff --stat 4fa2f8e..HEAD`: 2 files changed, 4
insertions, 1 deletion; one hunk in `splitter.ts`, one in
`index-fingerprint.test.ts`, both comment lines). The final head
`42214359` adds one changeset sentence. So the battery was not re-run.
</details>

## Acceptance notes

- Whole-tree search before deleting, at `d751790c`: `git grep -n
'SPLIT_ALGORITHM_VERSION\b'` gave 13 lines. 5 were the declaration, the
two re-exports and the pin's import and assertion (all removed here); 1
was the per-strategy docblock link (reworded); the other 7 are history:
`.changeset/38349-split-version-per-strategy.md`,
`.changeset/pre/37100-knowledge-pgvector.md` and five generated
`CHANGELOG.md` files. They are left alone: existing changesets are never
edited, and CHANGELOGs are release-owned. No `skills`, `content/docs`,
`docs`, `examples`, `apps`, `ui` or `.claude` hit.
- The package has no API-surface baseline, so no generator was owed.

## Verification

<details><summary>Local gates (derived with dispatch-gates --commands,
reconciled with --ran: 63 derived, 63 run)</summary>

- 60 of 63 exited 0 on the first pass.
- `node scripts/check-adr-0087-registration.mjs --base origin/main` exit
1 on `0c4609e7` (the FROM column spelled an import statement, not the
operand); after the fix, exit 0 on `4fa2f8ee`: `not-required
(runtime-export-retired) -- verified:
@objectstack/service-knowledge#SPLIT_ALGORITHM_VERSION`.
- `node scripts/check-plugin-teardown-shape.mjs --self-test` exit 3
(shallow clone could not reach its pinned fixture commit); after
fetching that commit, exit 0, 48 cases pass.
- `pnpm check:dual-build-cjs-loads` exit 3, PREREQUISITE NOT MET (needs
every package built). NOT MEASURED locally, CI runs it.
- Re-run at `4fa2f8ee` after the changeset fix:
check-changeset-no-major, check-empty-changeset,
check:changeset-gate-self-tests, check:nul-bytes, check:doc-authoring,
check:issue-citations: all exit 0. check:nul-bytes exit 0 again at
`f76ba9c9` and at `987b09ca`. At `42214359` (changeset sentence only),
check-adr-0087-registration, check-changeset-no-major,
check-empty-changeset and check:nul-bytes: all exit 0.
- `node scripts/check-platform-checklist.mjs --changed-from origin/main`
exit 0: 0 anchored files in the change set.
- `node scripts/pm/overlap-check.mjs` before each push: clean; at
`f76ba9c9`, `987b09ca` and `42214359` it also merges cleanly with PR
#38439.
</details>

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

https://claude.ai/code/session_01FEkQ5omA3kZCsWzBMMqF11

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5omA3kZCsWzBMMqF11 -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
… not a maintainer decision (#38444)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_
Fixes #38390
Clause-②: no
Metadata-protocol: none
Rule-change: yes
Ruling-ref: 「分区扩大这种问题用fable分析没有意义,座位可以自己决定,立卡更新skills」 — the maintainer,
in the session of seat repo:objectstack#8, as quoted in the body of the
rule card (filed 2026-11-28T23:20Z) and in triage record 7247665159
(2026-11-28T23:47Z)

## 维护者速读

- 用户无感:只改车队内部规则。分区会话碰到租约之外的文件,不再停下等你,而是交给席位当场定:扩区、只认领这一张卡,或转给别的席位。
-
替分区会话与席位解决:此前「扩不扩区」被当成要请示你的决策,还先跑一轮独立分析,几张已获批的卡因此空等了几个小时;你已裁定这类事由席位自己定。
- 席位扩错了区,最坏是和别的认领撞文件;认领前的在途重叠检查会当场挡住,改为排队,不会越过别人。规则文字可整体撤回。
- 批准这份规则文本落地。这次批准同时覆盖:席位三选一中的另两条路(该区只认领此卡,文件级 `File surface:`,认领前
`--inflight` 复查;或转给别的席位);共享热文件默认逐卡认领、租约路径不动;以及 `area-lease.md` 字节上限上调
404(6586 到 6990)。

## What changes

Rule text only, on the governed face. Three files.

**`.claude/skills/pm-dispatch/references/area-lease.md`, 〈区内规则〉** (card
items 1 to 3). One line changed, two lines added, directly above the
line that says which option sets get an independent review.

Before:

```text
- 席只裁路由(拆并延、归区);改可见行为或解读 ADR 照 SKILL.md〈升级与决策〉呈维护者。
```

After:

```text
- 席只裁路由(拆并延、归区;区边界扩、缩、并、释放,重写租约表为记);改可见行为或解读 ADR 照 SKILL.md〈升级与决策〉呈维护者。
- 卡碰租约外文件 ⇒ 区交席位,⛔ 不留卡等维护者;席三选一:扩区;该区只认领此卡(文件级 `File surface:`,`check-handover.mjs --inflight` 复查);转他席。⛔ 不呈维护者、不起评审,只留否决窗口。
- 租约外是共享热文件(如 `packages/core`)⇒ 默认逐卡认领、租约路径不动:租约罩热文件即挡他席。
```

- Item 1: the zone boundary (widen, narrow, merge, release) is named
among the routing acts the seat rules alone. The record is the lease
table rewrite; the rule that the table lives on the seat post and is the
one record stays where it is, in 〈分不分区,动态定〉, and is not restated.
- Item 2: a card that touches files outside its zone's lease goes to the
seat; the zone does not hold it for the maintainer. The seat picks one
of three routes. No maintainer decision, no independent review; the veto
window stays.
- Item 3: for a shared hot file the default is card-by-card claims with
the lease paths unchanged.

**`.claude/skills/pm-dispatch/SKILL.md`, 〈升级与决策〉** (card item 4). The
zone boundary is added to the no-escalation class beside task order.

Before:

```text
- 不升级类(碰产品行为或契约形状即报 fork):恢复不变量;任务顺序;验证策略;说明书脱节。
- 四类记账事同属不升级类,恒以无产品可见行为变化为界:去重与卡片合并;台账与记账整理;
- 纯文档措辞更正(无契约声明改动);既有门禁内部参数与盲区修复(加强,非削弱,非新增)。
```

After:

```text
- 不升级类(碰产品行为或契约形状即报 fork):恢复不变量;任务顺序;区边界;验证策略;说明书脱节。
- 四类记账事同属此类,恒以无产品可见行为变化为界:去重与卡片合并;台账与记账整理;纯文档措辞更正(无契约声明改动);既有门禁内部参数与盲区修复(加强,非削弱,非新增)。
```

The rule change is the one item `区边界;` (+10 bytes). The other two edits
pay for it and change no rule: the second and third bullets were one
sentence split across two bullets and are joined (-3 bytes), and
`同属不升级类` becomes `同属此类`, whose referent is the line directly above (-6
bytes).

**`scripts/pm/check-skill-line-ratchet.mjs`**: the `area-lease.md` row
moves 6586 to 6990, the landed size. The `SKILL.md` row is not moved.

## Byte budget

| File | Before | After | Ceiling before | Ceiling after |
|:---|---:|---:|---:|---:|
| `.claude/skills/pm-dispatch/references/area-lease.md` | 6562 | 6990
(+428) | 6586 | 6990 (+404, headroom 0) |
| `.claude/skills/pm-dispatch/SKILL.md` | 33348 | 33349 (+1) | 33351 |
33351 (headroom 2) |

Lines: `area-lease.md` 66 to 68, `SKILL.md` 322 to 321.

- `SKILL.md` is paid by deletion inside the file (+10 for the item, -9
by the join and the reworded referent); the remaining +1 comes out of
the 3 bytes of headroom the file had. Its row cannot rise in any case:
it is the declared source of the cross-file move into
`decision-analysis.md`, which has 2 bytes of slack.
- `area-lease.md` takes a ruled raise of +404 bytes, the measured delta
of the ruled text (+428) less the 24 bytes of headroom the file had. The
ruling of record that orders this text into the skills is the one on the
`Ruling-ref:` line above (「立卡更新skills」); its record is the rule card's
body and triage record 7247665159. No deletion pays for it: the file has
no wrapped line to join, and the new lines displace no existing rule, so
the only other currency was cutting rules the ruling does not name.

## Tests

No test pins this text. The gate that reads it is the byte ratchet
(self-test and scan), run locally at the final head; see Verification.

## Acceptance notes

- The ceiling raise is put to the maintainer with the text
(`Rule-change: yes`, corrected from `ruled` by the seat after the
contract review): the ruling is quoted by the card and by the triage
record, with no comment by the maintainer's own account to cite. If the
raise is refused, the alternative is to pay 404 bytes by deleting or
tightening other lines of `area-lease.md`, which this PR does not
attempt.
- The ruling's own words cover "the seat decides, no independent
analysis, update the skills". The three routes of item 2 and the
hot-file default of item 3 are the card's elaboration of that ruling
(the card was filed on the maintainer's direction). They are not a copy
of the ruling, so the maintainer's approval of this PR is what makes
them rule; the seat records that approval on #38390.
- `SKILL.md`: the dispatch named one item in the no-escalation class;
the two bullets under it were also touched, to pay for the bytes. They
are the continuation of the same passage and no rule in them changes.
- Observation, not changed here: `references/lanes/objectstack.md` tells
a seat to read the other seats' lease tables before it opens, splits,
merges or takes over a zone. It does not name widening. A seat that
widens a zone under the new rule meets the same path-intersection
question. That file is outside this card's surface.
- Not touched, as the card says: `check-handover.mjs`,
`overlap-check.mjs`, the lease table's shape, the mailbox keys. The
subject of the card queued behind this one (the decision-analysis
served-tier line) is not touched either.

## Verification

Read first, by risk:

1. `.claude/skills/pm-dispatch/references/area-lease.md`, the second new
line: it is the one that takes a question away from the maintainer and
from the independent review.
2. `.claude/skills/pm-dispatch/SKILL.md`, the joined bullet: check that
nothing but the join and the referent changed.
3. `scripts/pm/check-skill-line-ratchet.mjs`, the `area-lease.md` row:
the raise and its citation.

Two-minute check: `node scripts/pm/check-skill-line-ratchet.mjs` exits 0
and prints `area-lease.md is 6990 bytes (ceiling 6990; headroom 0)` and
`SKILL.md is 33349 bytes (ceiling 33351; headroom 2)`.

<details><summary>Local gates at head 53f0817</summary>

- `node scripts/pm/dispatch-gates.mjs --commands` derived 44 commands
from the three changed paths. All 44 were run under
`scripts/pm/os-verify-lock.sh` (slot `issue-38390`), each exit code
captured before any pipe; every hold ended `VERDICT command-exit 0`.
- 43 exited 0 on the first run. `pnpm --filter @objectstack/lint run
check:doc-formula-expressions` first answered PREREQUISITE NOT MET (exit
3: `@objectstack/formula` not built); after `pnpm exec turbo run build
--filter=@objectstack/formula --filter=@objectstack/lint
--concurrency=2` (exit 0, 5 tasks) it exited 0.
- `node scripts/pm/dispatch-gates.mjs --ran`: "44 derived famil(ies)
accounted for — 44 run, 0 NOT-MEASURED".
- `pnpm check:pm-skill-ratchet` exit 0: self-test 116 cases pass;
`area-lease.md is 6990 bytes (ceiling 6990; headroom 0)`; `SKILL.md is
33349 bytes (ceiling 33351; headroom 2)`; "declared cross-file moves: 1,
total ceilings down 2 bytes".
- `pnpm check:pm-skill-id-lint` exit 0 (134 files clean), `pnpm
check:pm-governed-prose` exit 0, `pnpm check:skill-frame-sync` exit 0,
`pnpm check:nul-bytes` exit 0, `pnpm check:pm-dispatch-gates` exit 0
(fast tier, 2459 cases pass).
- Local-only reading: `pnpm check:skill-frame-freshness` exit 0 (the
decision frame is unchanged against `origin/main`).
- `node scripts/pm/overlap-check.mjs` before each push: exit 0, "VERDICT
clean".
- The branch is cut from `f42bcc18c6` and `origin/main` has moved since;
it is not merged in (no conflict). One of the commits that landed edits
the ratchet script too, so the ratchet was also read on the merged tree
(this head merged with `origin/main` at `3579cf136d`, in a throwaway
worktree, never pushed): self-test and scan exit 0 with the same two
lines.
- Not run locally, left to CI: `test:repo`, the type-check lanes, the
artifact-roster and whole-root families the derivation names as outside
its list.

</details>

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5mzSTSPADAvwapnhxr -->

Co-authored-by: Claude <noreply@anthropic.com>
…38434)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X7GWETDi9u4dvkUQScG3bFd)_

Part of #34770

Clause-②: no
Metadata-protocol: none

`Part of`, not the closing form: the catalog-size line of the card's
Done-when is not met by this PR (PR 1 of the per-skill split in claim
7247529795).

**Eval parity is settled by ruling record 7249189592** (see Eval parity
under Tests): the three cases that read as misses on single runs, cases
6, 11 and 20, flip on `main`'s own text too and do not block.

## 维护者速读

- 用户能看到什么变化:用户无感。发给 AI 的平台技能说明,入口文件从约 25 KB 缩到 9
KB:入口只留开工前四项检查、能通过校验却在运行时出错的坑、和「要做什么就去读哪个文件」的路由表;其余原文搬进同一技能的参考文件,教的内容不变。
- 为什么做:这是「技能目录瘦身」的第四份(数据、界面、自动化三份已完成)。入口文件每次都整份装进 AI 的上下文,越长越贵,也越容易漏读。
- 出错会怎样:只动教 AI 的文字,没有产品行为变化;风险是 AI 少读一段后答错。改动前后都跑了评测:23
题里有三题在单次运行里时过时不过,改动前的文字上也一样,按你的裁定算两边都不稳,不拦这笔改动。可整笔撤回。
- 要你做的:无。席位核对与合约审查通过后,会按治理规则请审批人批准。

## Rulings this executes

- **Card Scope** (decision record on the card, S3 = A): the entry file
holds first checks, at most about 8 traps that pass the schema and fail
at run time, and a routing list; 6–9 KB, hard cap 500 lines; restated
option lists and key tables go behind a pointer; no trap is removed
until a publish-time check covers it or it stays inline.
- **7128031203** fork 4 = A, verbatim: "A ratchet ceiling raised because
text MOVED between files is accepted when (a) each raised row equals the
measured bytes moved in, with zero headroom, and (b) the sum of ceilings
does not rise. It covers PR #36158's seven rows (re-measured on its
final head) and later moves of the same kind; any row outside (a)/(b)
still goes to the maintainer." Beside the standing 2026-10-27 ruling
「A:先削重复,余额按实测提高」 (record 6513306068).
- **7128031203** fork 2 = A, the parity rule, verbatim: "the same set of
failing cases counts as \"not lower\"; a case that flips between the
rounds is rerun once and its second reading counts."
- No new file under `skills/` (a split needs new ratchet rows, which
that ruling left to a human): text moved only into files that already
have a row.
- **Ruling record 7249189592** (on the card; the maintainer's answer,
verbatim 「4」, to the option 「把技能瘦身那个时好时坏的评测按「两边都不稳」放行,#34770 后面 7 个 PR
才能接着走。」): "a `config-plugins-ops` case whose result flips between runs
on both trees (main and head) is treated as unstable on both and does
not block the PR. On PR #38434, case 6 (`driver-sql`: main 3/5, head
5/5) and case 11 (`new similar`: main 4/5, head 3/5) pass the parity
gate on this ruling. ... A case that fails on every run of head while
main passes is still a regression."


## What changes

**The entry file becomes a router.**
`skills/objectstack-platform/SKILL.md`: 24,659 → 9,025 bytes, 421 → 105
lines, 6,158 → 2,250 tokens. Frontmatter (description, triggers) is
byte-identical. It now holds:

- `## First checks`: version, read what exists, read the contract
(`references/_index.md`), `os validate`.
- `## Traps`, five, each one passing `os validate` and failing at run
time: no driver in `plugins:`; an installed package is customized from
its paired `.custom` package; who owns the HTTP server and that `prefix`
does not move auth; `manifest.engines.protocol`; `manifest.namespace`.
- Three sections a gate binds to this file, each cut to its enumeration
plus what fails silently: the `defineStack()` key list
(`check-skill-top-level-keys`), the `requires:` provider table with
three rules, and `## Seed Data` with the `demoStaff` trap (both Leg 2 of
`check-skill-identifier-liveness`).
- `## Where to go`: one row per task, naming the file to open.

**Where each old section went.**

| Old entry section | Now |
|:--|:--|
| Full Configuration Reference (key list, phantom keys, queues /
assignment rules) | stays inline, compacted (gate-bound) |
| Strict Validation | `references/bootstrap.md` § Strict Validation,
verbatim |
| Compile Artifact and Runtime Metadata Boundary | one paragraph in
`references/operations.md`, above Verify your work |
| Manifest Reference | the two rules are traps 4 and 5; the rest is
`references/bootstrap.md` § Manifest; the annotated example is cut (see
Acceptance notes) |
| Customizing an installed package | trap 2 inline; the three paragraphs
verbatim in `references/bootstrap.md` § Customizing an installed package
|
| The App / Platform Boundary | cut to a pointer at objectstack-project,
which states it; the two sentences it does not have are
`references/bootstrap.md` § App or platform |
| The Template | `references/bootstrap.md`, under Scaffolding Command |
| Project Structure Conventions, Naming Conventions |
`references/bootstrap.md` § Project Structure Conventions; the naming
table is cut to a pointer at objectstack-data |
| Driver Selection Guide, Wiring a driver | trap 1 inline; the table
verbatim and the remainder in `references/operations.md` |
| HTTP Layer (Hono) | trap 3 inline; the two-package table and the
remainder in `references/operations.md`; the usage snippet is cut |
| Runtime Boot Sequence | `references/bootstrap.md` § Runtime Boot
Sequence, verbatim |
| `requires:` | provider table and three rules inline; the remainder is
`references/bootstrap.md` § `requires:` in detail |
| `onEnable` | `references/bootstrap.md`, verbatim |
| Seed Data, Demo accounts | inline (modes, and that a seed cannot
create a person); the example and detail in `references/bootstrap.md` §
Demo accounts |
| References | replaced by the routing table |

**Two restatements cut inside the skill** to pay for the move: in
`references/plugin-development.md`, the `Plugin` interface block and the
hook example with its event list are one pointer each to
`rules/plugin-lifecycle.md` and `references/plugin-hooks.md`, which
carry the same text.

**Sizes** (bytes · lines · ratchet tokens):

| | before (`ff69bcab`) | after (`cb8b7cd1`) |
|:--|--:|--:|
| `SKILL.md` (entry) | 24,659 · 421 · 6,158 | 9,025 · 105 · 2,250 |
| `references/bootstrap.md` | 5,425 · 188 · 1,340 | 17,621 · 375 · 4,389
|
| `references/operations.md` | 13,556 · 179 · 3,389 | 16,075 · 223 ·
4,019 |
| `references/plugin-development.md` | 12,505 · 358 · 3,127 | 11,360 ·
320 · 2,840 |
| `skills/objectstack-platform/**` (9 files) | 107,525 · 2,398 | 105,461
· 2,275 |
| all 14 `SKILL.md` together | 228,159 · 4,386 | 212,525 · 4,070 |
| whole `skills/` tree (115 files) | 1,230,467 | 1,228,403 |
| whole tree without `evals/` | 872,675 | 870,611 |
| ratchet: authored tokens = sum of all ceilings | 200,510 | 199,994 |
| ratchet: bundle total, tokens | 304,822 | 304,306 |

**Budget reading:** entry 9,025 B, over 9,000 B by 25 B. 9,000 B is the
top of the card's Scope line ("Budget 6–9 KB, hard cap 500 lines", the
maintainer-approved filing); the overrun is the
`@objectstack/driver-sql` literal the case-6 behaviour depends on, kept
inline on the seat's choice (B) of 2026-11-29, and is for the approver
to accept or refuse. No ratchet ceiling rises for it. The 500-line cap
holds (105 lines). The row is unchanged at 2,250 tokens (8,998 priced
bytes), still at the measure.

**Contract review fix (review record 7249357427, S1 and N1), paid inside
the entry, 9,027 → 9,025 B:** the AI-door rule names the gated call
again (`run_action` on an action declaring `ai.requiresConfirmation:
true` is what is refused 428 with no confirmation service), and the
host-default sentence says `pinyin-search` mounts for a `zh-*` locale in
`i18n`.

The skill directory falls 2,064 bytes. The cut is small beside the move
because three of the entry's enumerations are gate-bound and stay (see
Acceptance notes).

**Ratchet rows** (`scripts/check-skills-token-ratchet.mjs`), each pinned
AT its measurement, zero headroom: entry 6158 → 2250 (−3908),
`references/bootstrap.md` 1340 → 4389 (+3049),
`references/operations.md` 3389 → 4019 (+630),
`references/plugin-development.md` 3127 → 2840 (−287). The four rows sum
14,014 → 13,498; the sum of all ceilings goes 200,510 → 199,994, so both
conditions of fork 4 = A hold.

## Tests

### Eval parity

Judged by ruling record 7249189592, quoted under Rulings: a case that
flips between runs on both trees is unstable on both and does not block;
a case that fails on every run of the head while `main` passes is a
regression. **No case fails on every run of the head while `main`
passes.**

Skill evals, both arms, one command line for every round (`skill-evals
--skills objectstack-platform --repeats 1 --model sonnet --effort medium
--concurrency 4`; served `claude-sonnet-5-5`, CLI 2.1.332, subscription
login). 23 cases in `evals/config-plugins-ops.json`, untouched.

| reading | tree | with-skill | no-skill | with-skill failing cases |
|:--|:--|--:|--:|:--|
| before round | `ff69bcab` | 20/23 | 0/23 | 2, 5, 9 |
| after round | `9129aa7d` | 20/23 | 0/23 | 5, 9, 11 |
| second reading of each flipped case, once | `9129aa7d` | | | 11 fail ·
2 fail |
| after set by the one-rerun rule | | | | 2, 5, 9, 11 |
| round on the final head | `cb8b7cd1` | 19/23 | 0/23 | 2, 5, 9, 20 |
| case 20 read three more times | `cb8b7cd1` | 1/3 | 0/3 | |

Cases 2, 5 and 9 fail on `main` and on the head alike (case 2 misses
`destroy`; case 5 carries `os rollback`; case 9 misses `queues:` and
`assignmentRules:`). The two cases that read as misses on single runs,
each read five times on each tree (`--case` with `--repeats 5`; for the
`main` side the four skill files were checked out from `ff69bcab` over
the worktree for the run, then restored):

| case | what it asks | `main`'s skill files | this PR | literal missed
|
|:--|:--|--:|--:|:--|
| 6 | a production deployment plan | 3/5 | 5/5 on `989821ef`; on
`9129aa7d` it passed its own reading and the round | `driver-sql` |
| 11 | a dependent package wants to override an installed package's view
and permission set | 4/5 | 3/5 on `9129aa7d` | `new similar` |

Both flip on both trees. In every reading of either case the answer
gives the right course; what comes and goes is one literal.

Case 20 (must `storage` and `settings` be listed in `requires:`) is the
third of the kind. On `main`'s skill files it passed the before round
and 2 of 4 turns of the five-repeat round; on this branch it read 3/5 on
`9129aa7d` and, on `cb8b7cd1`, failed the round and passed 1 of 3
further readings. Each failing answer says no, they are always-on, and
then shows the forbidden literal `requires: ['storage', 'settings']` as
what to add under `--preset minimal`, which is what the case's own
expected answer says to do there. The sentence it reads ("every boot
mounts them, and only `--preset minimal` drops them") is the same text
on every head.

**Six cases changed verdict at least once across the five single-repeat
rounds on this branch: 2, 6, 9, 11, 19, 20.**

| case | `ff69bcab` (before) | `74592fbd` | `989821ef` | `9129aa7d` |
`cb8b7cd1` |
|:--|:--|:--|:--|:--|:--|
| 2 | fail | fail | fail | pass, rerun fail | fail |
| 6 | pass | pass | fail, rerun fail | pass | pass |
| 9 | fail | fail | pass, rerun fail | fail | fail |
| 11 | pass | pass | fail, rerun pass | fail, rerun fail | pass |
| 19 | pass | fail, rerun pass | pass | pass | pass |
| 20 | pass | pass | fail, rerun pass | pass | fail, then 1 of 3 |

Round totals, with-skill: `ff69bcab` 20/23, `74592fbd` 19/23, `989821ef`
18/23, `9129aa7d` 20/23, `cb8b7cd1` 19/23; no-skill 0/23 in every round.

<details><summary>Round records and what each with-skill turn
read</summary>

- Before round: 46/46 turns, 3 min. 8 of 23 with-skill turns read a
reference file (`operations.md` 8, one each of `bootstrap.md`,
`plugin-development.md`, `plugin-hooks.md`, `plugin-lifecycle.md`,
`service-registry.md`).
- After round on `74592fbd`: 46/46 turns, 2.9 min. 13 of 23 with-skill
turns read a reference file (`operations.md` 6, `bootstrap.md` 5,
`_index.md` 2).
- After rounds on `989821ef` and `9129aa7d`: 46/46 turns, 3 min each.
Round on `cb8b7cd1`: 46/46 turns, 2.8 min; cases 17 and 23, whose
sentences the last commit shortened or extended, pass.
- A five-repeat round, started under a method the ruling then replaced,
is on record as taken and is not the basis of the verdict. It completed
on `9129aa7d`: with-skill 95/115, no-skill 0/115; cases 2, 5 and 9 at
0/5, case 11 at 3/5, case 19 at 4/5, case 20 at 3/5, every other case
5/5. On `main`'s skill files it was stopped at 206 of 230 turns when the
ruling arrived; in the turns that ran, cases 2, 5 and 9 were at 0/5,
case 6 at 3/5, case 11 at 4/5, case 20 at 2/4, every other case passing.
- Every `must_contain` literal of the 23 cases that the skill's files
carried before is still carried after (77 literals checked; 0 lost). Two
left the entry for a reference: `os lint` (case 5), `manager: '` (case
8).

</details>

### Other tests

`pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
scripts/platform-catalog.test.ts` (the suite that names the ratchet
script), on `cb8b7cd1`: `Test Files 1 passed (1)`, `Tests 21 passed
(21)`, under the verify lock (`VERDICT command-exit 0`). No ablation:
the diff changes prose and one ledger, no tested behaviour.

## Acceptance notes

Decided here (small, no shipped behaviour), each open to reversal in
review:

- **A mechanism assumption of the dispatch did not hold for three
blocks.** The key list, the `requires:` provider table and `## Seed
Data` are restated contract lists, but the gates that keep them true
bind to the entry file by path and heading. Moving them behind a pointer
needs gate edits outside this claim's file surface, so they stay inline
in compact form (the UI router kept its bound enumerations the same
way). This is why the directory falls 2.1 KB and not more.
- **"No trap is removed" was read as: silent or degraded-at-run-time
facts stay inline; loud ones may sit one link away.** Inline: the five
traps, the dropped-key warning, `triggers` without `job`, the
confirmation service, `hierarchy-security` without its provider (a boot
warning, scopes fall back to owner-only), `demoStaff` (a seed cannot
create a person; only `os dev` creates the accounts), and the `data:*`
hook that never fires (in the routing row). One link away, each refused
loudly when hit: `automation` missing while `plugins:` lists a connector
(boot fails), a query capability the Memory or MongoDB driver refuses,
the unknown `requires` token (refused by `defineStack`), route-literal
names and the legacy double-underscore prefix (refused by `os validate`
/ `defineStack`).
- **The App / Platform Boundary section is cut to a pointer.**
objectstack-project states the same test and steps; the two sentences it
does not have are kept in `references/bootstrap.md` § App or platform.
- **The annotated manifest example is cut**, so the type-checked example
count falls by one (351 marked examples pass). Every key it showed is in
`kernel/manifest.zod.ts`; the barrel example in
`references/bootstrap.md` gained `engines` so one checked example still
shows it.
- **Three counts left the template paragraph** ("three" executors,
"eight" barrels, "five" retired templates): the lists themselves are
printed, and a count beside a list drifts.
- **The pinyin-search row folded into the plugin- row** of the provider
table (same package rule, 41 bytes), to pay for the two facts that went
back inline.
- **Trap 1 names `@objectstack/driver-sql` again** (36 bytes), the
seat's choice after the case-6 miss; the entry is 25 bytes over the
card's 9 KB budget line for it (see Budget reading).
- **The review fix was paid with four phrases of the entry**, none of
them a trap: "an error-in-waiting" after the dropped-key warning (the
warning itself stays), "on the stack root turns it on" beside `requires:
[...]` (the key list above it names `requires`), the `@objectstack/core`
home of `CAPABILITY_PROVIDERS` (the name stays), and "to your Cloud
environment" in the routing row, now "to Cloud"
(`references/operations.md` names the environment).

Noted, not changed (outside this claim's file surface):

- Other skills name sections of this skill in prose: objectstack-i18n
("Runtime Boot Sequence"), objectstack-api ("Driver Selection Guide"),
objectstack-automation and objectstack-data ("Customizing an installed
package"), several ("Verify your work"). Each heading keeps its name and
now lives in a reference file the routing table or a trap links; no link
gate reads these prose pointers, and their files sit at zero ratchet
headroom.
- `packages/spec/scripts/lib/skill-map-guards.ts`: the
`objectstack-platform` rows of `TRANSITIVE_ALLOWLIST` go stale, not only
their comment. The list's header says a row means the SKILL.md teaches
that schema, and the rows are "kept iff" the entry names one of the
module's exported names; at this head three rows lose the only export
the entry named (`data/field.zod.ts` `FieldSchema`,
`security/rls.zod.ts` `RLS`, `data/object.zod.ts` `ObjectSchema`), and
`data/hook.zod.ts` was already unmatched on main. `check:skill-refs`
stays green because it does not ask reachability. Carrier: #38451 (drop
or re-justify the rows and regenerate `references/_index.md` after this
PR merges).
- The version PR #38192 touches the same two files on the stamp line and
the five body pins only; `overlap-check` reads it as merging cleanly.

## Verification

Read first, by risk:

1. `skills/objectstack-platform/SKILL.md`, the whole file: is anything a
model needs before opening a second file missing? The risk hunks are `##
Traps` and the three rule bullets under the provider table.
2. `skills/objectstack-platform/references/bootstrap.md` § `requires:`
in detail and § Manifest: these were rewritten as the complement of the
entry, not moved verbatim.
3. `scripts/check-skills-token-ratchet.mjs`: the four
`objectstack-platform` rows.

Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints
`ratcheted (authored) 199994 / 199994 (+0)` and every
`objectstack-platform` row at `(+0)`; `wc -c
skills/objectstack-platform/SKILL.md` prints 9025.

Gates, local (each exit code captured before any pipe). The whole
derived list ran on `989821ef`; `cb8b7cd1` differs from it by five
sentences of the entry, one ratchet row with its comments and one number
in the changeset, so only the families that read those were run again on
it.

<details><summary>On `cb8b7cd1`: the families the last two commits
reach, all exit 0</summary>

- `node scripts/check-skills-token-ratchet.mjs`: `✓
check-skills-token-ratchet: 61 authored bundle file(s) within their
ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured,
not ratcheted.` (`ratcheted (authored) 199994 / 199994 (+0)`).
- `pnpm check:skill-top-level-keys`:
`skills/objectstack-platform/SKILL.md:44 enumerates all 56 authorable
top-level keys of ObjectStackDefinitionSchema`.
- `pnpm check:skill-identifier-liveness`: `Leg 1: 544 citation(s) over
76 published file(s) ...; Leg 2: 11 registered exhaustive section(s), 0
ledgered gap(s).`
- `pnpm check:skill-links`: `285 relative link(s) in 76 published skill
file(s) resolve; 157 fragment(s) name a real heading under GitHub's slug
rule.`
- `pnpm --filter @objectstack/spec run check:skill-docs`: `Skill docs in
sync`. `check:skill-refs`: `10 generated files in sync with
packages/spec`.
- `pnpm --filter @objectstack/spec run check:skill-examples`: `351 prose
examples type-check across 3 surface(s)`.
- `pnpm check:nul-bytes`: `no raw ASCII control bytes`. `pnpm
check:role-word`: exit 0.
- `node scripts/pm/overlap-check.mjs
--branch=claude/project-thread-lqv7wj`: `VERDICT clean exit 0` before
the push.

</details>

<details><summary>On `989821ef`: derived families, 70 derived, 69 run
green, 1 NOT MEASURED</summary>

- Reconciliation: `✓ dispatch-gates --ran: 70 derived famil(ies)
accounted for — 69 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit
3).`
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3, `PREREQUISITE
NOT MET`. It reads every package's built `dist/`, and this container
holds only two packages' build closures. The diff touches no package
source; CI's run is the reading.
- Exit 0 in that run, beside the families listed above:
`check:role-word`, `check:doc-authoring`, `check:published-files`,
`check:scaffold-emission-policy`, `check:skill-compatibility`,
`check:corpus-claim-drift`, the changeset gates,
`check:pm-dispatch-gates` (fast tier, 2459 cases).
- Beside the derived list, exit 0: `check:doc-anchors` (`1175 internal
#fragment link(s) across 367 source file(s) all resolve to a real
heading`), `check:skill-served-sections` (the hosted door serves no
section of this skill), `check:published-readme-links`, `node
scripts/check-platform-checklist.mjs --changed-from origin/main` (`0
anchored files in the change set — nothing judged.`).
`check:published-readme-exports`: NOT MEASURED, exit 3, the same
missing-build prerequisite; not derived for this diff.

</details>

CI on `cb8b7cd1`, read while it ran: 17 check-runs success, 16 skipped
by the path filter, 10 in progress, none failing; the seat reads its
conclusion. On `9129aa7d` it ended 32 success and 20 skipped, none
failing. The earlier run on `989821ef` (46210313609) was cancelled when
`9129aa7d` was pushed; its two aggregate jobs read `failure` only
because four lanes concluded `cancelled` (no lane failed).

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

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5kaby17PRNj45xGyDc -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
…t object or field as such (#38465)

Fixes #38419

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 在 Studio 或 MCP
保存知识源的搭建者:以前填错对象名或字段名时,会看到"暂时无法判断、请重试"或"无权访问"的提示,现在会直接看到"该对象/字段不存在",并带上与
`os validate` 相同的规则名。
- 属于知识库检索(把业务数据建成可搜索的知识源)这条线,替搭建者解决"拼错了却被告知去重试或去找管理员"的误导。
- 出错时只影响保存知识源这一个入口的提示文字与状态码;对存在但无权访问的对象和字段,拒绝提示一字未变,可以直接撤回。
- 无。

## What changes

`KnowledgeService.admitAuthoredSource` (the save-time admission every
knowledge-source save door asks: `PUT /meta/knowledge_source/:name`, the
runtime `/meta` door, the MCP draft save, and the package duplicate)
gains a "does not exist" arm ahead of every permission arm (ADR-0161 K4,
row 4):

- `source.object` names no object the registry defines ⇒ `400
VALIDATION_ERROR`, naming the object and the rule
`knowledge-source-object-unknown`.
- a `source.content` / `source.contentFields` / `source.metadataFields`
member names neither a declared field nor `id` or a system column the
registry injects (`resolveInjectedSystemColumns`, the derivation `os
validate` uses) ⇒ `400 VALIDATION_ERROR`, naming the object, the field
(`field` on the verdict) and the rule `knowledge-source-field-unknown`.

Before this PR, with a platform-like security service, the same saves
answered `503 SERVICE_UNAVAILABLE` "... could not be judged ... try
again" (absent object), `403` "is a system object that does not opt into
AI reads" (absent `sys_` object), and `403` "you may not query field ...
hidden from you" (absent field). With no security service they were
admitted.

The arm reads the object's registered definition only. It never reads a
permission answer. Every door that asks this verdict admits only a
`manage_metadata` holder, and ADR-0106 D4 serves that caller every
object definition whole. So the arm tells the author nothing they could
not already read. It draws no verdict for an engine with no schema
registry, for an object of a disabled package (that gate still answers
it), or for an object whose fields cannot be enumerated. A registry that
throws keeps the `503`, reported once. No new error code:
`VALIDATION_ERROR` is the code this method already answers for an
unmounted adapter.

The refusal is worded for the door, as the other arms are: the
duplicate's caller is told the source cannot be copied, then to
duplicate the package again.

## Read first

1. `packages/services/service-knowledge/src/knowledge-service.ts`,
`absentSourceReference`: the riskiest hunk is the three early returns
(no `getSchema`, disabled package, no field map). Each one keeps a case
that exists from being read as absent.
2. `packages/services/service-knowledge/src/knowledge-service.ts`,
`admitAuthoredSource`, the new block after the engine check: its
position decides which arm wins.
3.
`packages/services/service-knowledge/src/__tests__/knowledge-source-save-absent-reference.test.ts`,
the `no permission answer changes for an object or a field that exists`
block, which holds the full answers taken on the base.

## Two-minute verification

`pnpm --filter @objectstack/service-knowledge exec vitest run
--maxWorkers=2
src/__tests__/knowledge-source-save-absent-reference.test.ts`. Expect 15
passed. Restore `knowledge-service.ts` from `0c1b2ffe` and the same
command shows 7 failed and 8 passed: the absent references answer 503 /
403, and every pin for what exists still passes.

## Tests

<details><summary>New file:
knowledge-source-save-absent-reference.test.ts (15 cases)</summary>

- Absent business object and absent `sys_` object, with and without a
security service: `VALIDATION_ERROR` / `400`, `object` set, no `field`,
message carries `knowledge-source-object-unknown`, never "could not be
judged", "try again", "does not opt into AI reads" or "may not query".
The engine's own write (`isSystem`) is admitted.
- Absent `content`, `metadataFields` and retired `contentFields` member,
for a member and a manager, with and without a security service:
`VALIDATION_ERROR` / `400`, `object` + `field`, message carries
`knowledge-source-field-unknown`.
- An absent field is named before a hidden one in the same source.
- CONTROL: `id`, `created_at`, `owner_id` (not declared, injected) are
admitted.
- `door: duplicate`: same status, code, object and field as the save,
worded for the duplicate.
- Exists, answer unchanged, full verdict with `toEqual`, sentences taken
from the base: hidden field (403), `sys_` object without
`enable.aiReadable` (403), security service that answers neither
question (503), disabled package with and without a served definition
(403), registry that throws (503, logged once), engine with no schema
registry (admitted).

</details>

<details><summary>Red on the base, green on the head</summary>

Base `knowledge-service.ts` (`0c1b2ffe`), head test file:

```
Tests  7 failed | 8 passed (15)
AssertionError: expected { admitted: false, status: 503, ... } to match object { admitted: false, ... }   (absent object)
AssertionError: expected { admitted: false, status: 403, ... } to match object { admitted: false, ... }   (absent sys_ object)
AssertionError: u_member undefined: expected { admitted: false, status: 403, ... }                       (absent field)
os-verify-lock: VERDICT command-exit 1
```

Head `cf125c96`, after `pnpm turbo run build
--filter='@objectstack/service-knowledge...' --concurrency=2` (20/20):

```
pnpm --filter @objectstack/service-knowledge test
 Test Files  22 passed (22)
      Tests  741 passed (741)
pnpm --filter @objectstack/service-knowledge typecheck
check:test-typecheck: OK — 0 file(s) / 0 error(s)
os-verify-lock: VERDICT command-exit 0
```

</details>

## Acceptance notes

- The fields a `where` reads are not checked for existence here. `os
validate` does not check them either (`validate-knowledge-source.ts`
checks `content` and `metadataFields` only), so no rule name exists for
them. Measured on `cf125c96`: a `where` naming an absent field answers
`403 PERMISSION_DENIED` "which you may not query (it is hidden from you
...)" when a security service is mounted, and is admitted when none is.
Reported to the seat to file; not changed here.
- The published `objectstack-ai` skill says `os validate` and publish
check the two rules. That is still true. It does not mention the save
door, and this PR leaves `skills/**` untouched.
- Search-time admission (`admitSources`) is untouched by this PR. Only
the save-time verdict changes.

## Verification

<details><summary>Local derived gates at cf125c9 (dispatch-gates
--commands, 71 commands)</summary>

Each derived command ran on head `cf125c96` (after merging `origin/main`
at `1afd9c13`), exit captured before any pipe:

```
dispatch-gates --ran: 71 derived famil(ies) accounted for, 70 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)
NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test, reason: PREREQUISITE NOT MET, its positive control is pinned to a commit this shallow clone cannot reach (checker health only; CI runs it)
pnpm check:dual-build-cjs-loads: 126 published require entry point(s) across 74 package(s) load; 2593 emitted CommonJS file(s) parse
```

The other 69 commands exit 0, among them `check:nul-bytes`,
`check:doc-authoring`, `check:issue-citations`, `check:published-files`,
`check:type-check-coverage`, `check:type-check-debt`,
`check:undeclared-dep-imports`, `check:engine-double-contract`,
`check:error-status-conformance`, `check:adr-0087-registration --base
origin/main` and `check:empty-changeset --base origin/main`. Every
family CI runs beyond these is read from this PR's check-runs, not
re-run locally.

</details>

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
…ames chunk_target the longest passage (#38468)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XDXvJPPtrTGfdDYhWWpihq5)_

Fixes #38290
Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:写知识源的应用作者在知识检索指南里能读到“一条一段”的做法(每条写成一个标题、在同一条记录上派生一个专供检索的文本字段、可选的顶层标题写明文档和所属部门);管理员在知识设置页看到的“目标片段大小”改名为“片段最大长度”,各语言一致。
-
为什么做:知识切分专题第一阶段的文档项,回答外部作者提出的“怎样让每一条恰好一段”的问题;放得下的小节整节一段已按您的裁决合入,这里只把做法写清楚。
- 出错会怎样:只改文档和设置页的文字,键名、默认值、切分行为都不变;写错只会误导读者,直接撤回即可。
- 要你做的:无。

## What changes

- **Knowledge guide** (`content/docs/ai/knowledge-rag.mdx`): a new `###
One passage per unit` section under "Splitting documents into passages".
It teaches, as the landed `markdown` splitter behaves at f19ee34:
- one heading per unit (a heading at the start of its line; bold text is
not a heading; a unit's sub-items as list items, since a sub-heading is
a section and a passage of its own);
- a unit whose text with its heading path fits is one passage whatever
`minChars` is, and a table with the note after it inside that unit stay
together;
- no passage holds two units (each section is split on its own), and
every passage begins with its unit's heading path;
- a unit that does not fit is cut as `recursive` cuts, its pieces merged
up to `minChars`; the note after a cut table can land in another piece;
- `minChars` is the merge threshold of a unit that does not fit, not a
switch, and `minChars: 0` turns nothing off;
- a derived field on the same record carries the index text, listed
alone in `content` (why the same record and not a second object: the hit
names the record people open, the search re-checks that record as the
asker, `where` and `metadataFields` read its own fields);
- an optional top heading names the document (and the department that
owns it), so every passage's heading path begins with it; keep it short,
because a path that leaves less than half of the passage length shortens
to the unit's own heading; a title already in that heading needs no
second `content` entry;
- moving a source to this shape changes `content` and `split`, so it
rebuilds once and re-sends the source to the embedder.
- **Protocol page** (`content/docs/protocol/knowledge.mdx` §3.5): one
paragraph that states the result and points to the guide; the setting's
name updated.
- **Settings page** (`packages/services/service-settings`):
`knowledge.chunk_target` was labelled **Target chunk size (chars)**
while its help text and the splitter treat it as a maximum. The label is
now **Longest passage (characters)** and the help adds that passages can
be shorter, in the manifest and in all 11 locales (en, zh-CN, zh-Hant,
ja-JP, ko, de, es-ES, fr, pt-BR, ru, ar). Key, default, bounds and
reader unchanged.
- **Changeset**: a patch on `@objectstack/service-settings`, which also
says that earlier notes naming **Target chunk size** mean the same
setting (the pending changesets that name it are not edited).

## Answer to #38290

The card asked for either a split strategy that cuts at a unit pattern,
or a documented way to get one passage per unit. #38351's ruling A
(record 7247322956, 「#38351 同意」, merged in PR #38439) made a fitting
`markdown` section one passage by default, so the documented way needs
no setting: write each unit as a heading. `minChars: 0` is not that
switch and is not an opt-out (ruling item 2): `minChars` only merges the
pieces of a section that does not fit. A table and its trailing note
inside one fitting unit are one passage. The app's workaround (a second
object with one row per article) can become a derived field on the
policy record itself. The 84% → 94% figure is not cited here: the
topic's adoption comment notes it changed several variables at once.

## Acceptance notes

- `skills/objectstack-ai/SKILL.md` still names "the **Target chunk
size** setting". Skills are #38442's surface; its dev was told to write
"the **Longest passage** setting" and to land after this PR.
- The card's claim names this PR's head in claim 7250337030 (the area's
re-post of 7250017151 with the platform branch).
- The pending changesets that name **Target chunk size**
(`.changeset/pre/37098-knowledge-splitter.md`,
`.changeset/pre/37292-skill-knowledge-split.md`) are not edited; this
PR's changeset carries the superseding sentence.

## Verification

All at head `340bb349`, tree `objectstack-ai/objectstack`, base
`origin/main` f459c86.

- `pnpm --filter @objectstack/service-settings test`: Test Files 79
passed (79), Tests 1545 passed (1545); exit 0.
- `pnpm --filter @objectstack/service-settings typecheck`: exit 0
(dependency closure built first, exit 0).
- `node scripts/pm/overlap-check.mjs --branch=HEAD`: `VERDICT clean exit
0` (merges cleanly with origin/main; no open PR head on these files).
- Derived gate families (`dispatch-gates --commands`): 89 derived, 86
run with exit 0, 3 NOT MEASURED (exit 3, prerequisite not met, nothing
measured; CI runs them):
- `node scripts/check-plugin-teardown-shape.mjs --self-test`: its
positive control is pinned to a commit the shallow clone cannot reach.
- `pnpm --filter @objectstack/spec run check:skill-examples`: needs a
`@objectstack/client-react` build this diff does not touch.
- `pnpm check:dual-build-cjs-loads`: needs every package's `dist/`,
which this container did not build.
- `dispatch-gates --ran`: 89 derived families accounted for, 86 run, 3
NOT MEASURED (derived from the recorded exit 3).
- Every other family CI runs on this PR is read from its check runs, not
re-run here.

Two-minute check: open `content/docs/ai/knowledge-rag.mdx` at "One
passage per unit" and compare each bullet with `withPrefix` and
`splitMarkdown` in
`packages/services/service-knowledge/src/split/splitter.ts`.

Read first: the new section of `content/docs/ai/knowledge-rag.mdx` (the
claims a reader acts on), then the `zh-CN.ts` / `ja-JP.ts` label
wording.

## 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. (no names
added)
- [x] 3. No formatter ran; `pnpm lint` passes. (CI)
- [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.

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

https://claude.ai/code/session_01FEkQ5mDidoPNcFwxVX65bA

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5mDidoPNcFwxVX65bA -->

Co-authored-by: Claude <noreply@anthropic.com>
… app (#38461)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_
Refs #35238 (item e)
Clause-②: no
Metadata-protocol: none
Rule-change: none

## 维护者速读

- 用户能看到什么变化:用户无感;车队代理用来启动示例应用、在浏览器里实地验证的内部手册,按今天的启动方式重新核对并改了几步。
- 为什么做:车队技能整理第七步,替做浏览器验证的代理解决手册与现状对不上、照做会白跑一圈的问题。
- 出错会怎样:只改内部手册文字,不碰产品和发布;某步若写错,代理验证时多绕一段路,可以直接撤回。
- 要你做什么:无;席位按合同复核记录(席内达档)落地,不需要您批准。

**Round 2** (head 60478bd): S1 fixed. §1 now gives Studio's live
address, `/_console/studio/PKG`, not the retired pillar form, and the
ratchet row was lowered to the landed 9513 bytes. `origin/main` is
merged in (merge, no rebase). Body corrections: the rule-change line
declares none, as the contract review (7250178674) verified; the 维护者速读
line says the seat lands this PR; the §6 claim now says folded, not
deleted; the acceptance notes now name their carriers on #35238.

## What changes

`.claude/skills/dogfood-verification/SKILL.md` was walked step by step
against the tree at `0c1b2ffe30` and against a real showcase boot from
this branch (`objectstack dev --ui --seed-admin -p 41873 -d
file:SCRATCH/data.db`, in a fresh worktree, after a cached build of the
showcase's dependency closure). What the skill is for is unchanged.
Every step that no longer matched is listed with what moved it:

| Step | Was | Now | Evidence |
| --- | --- | --- | --- |
| §0 own port | avoid 3000/3001/3210 | avoid 3000 and the ports the
tracked `.claude/launch.json` entries already use | `os dev` defaults to
3000 (`packages/cli/src/commands/dev.ts`, `requestedPort = port ??
'3000'`) and the Console dev proxy targets it
(`ui/apps/console/vite.config.ts`, the `/api` proxy). `git grep 3210`
finds no port use outside this skill. |
| §0 launch.json | add a named entry for this worktree | same, and ⛔
never commit it | `.claude/launch.json` is tracked at `0c1b2ffe30` (`git
ls-files`), and `.claude/**` is a governed surface. |
| §0 `OS_PORT` | "export `OS_PORT` too, `-p` alone is not enough" | `-p`
is exported by `os dev` itself for its compile; the trap is
`--no-compile` and a shifted port, both in RUNNER's connector entry |
`dev.ts` exports the flag's port before the compile (`portFlagEnv`,
`packages/cli/src/utils/port-contract.ts`: `OS_PORT` and `PORT`).
Measured: with `OS_PORT` unset in the shell, `-p 41873` alone gave `GET
/api/v1/meta/connector/showcase_status_api` a `baseUrl` of
`http://127.0.0.1:41873`. |
| §1 Console paths | `/_console/apps/APPID`, e.g.
`com.objectstack.setup`, `com.objectstack.studio` | the package id is
the address and the app name an alias; Studio is not an app, it lives at
`/_console/studio/PKG` (the package's Overview; the pillar segments are
retired) | `matchAppBySegment`
(`ui/packages/app-shell/src/utils/appRoute.ts`) tries `_packageId`, then
`name`. Measured: `GET /api/v1/meta/app` listed `showcase_app` /
`com.example.showcase`, `setup` / `com.objectstack.setup`, `account` /
`com.objectstack.account`, and no Studio. Studio's bare package address
opens the package's 概览 Overview, and the old pillar segments only
redirect
(`ui/packages/app-shell/src/views/studio-design/studioPillarRedirectModel.ts`).
|
| §1 `?id=` | a long paragraph that repeats RUNNER | same warning,
compressed, pointing at RUNNER's entry | Measured: `?id=showcase_app`
returns the app, `?id=com.example.showcase` and `?id=studio` return
`{"type":"app","items":[]}`. |
| §2 HMR console | `VITE_SERVER_URL=… DEV_PROXY_TARGET=… pnpm --filter
@object-ui/console dev` | `DEV_PROXY_TARGET=…` only, browse `:5180`; ⛔
no `VITE_SERVER_URL` | With `VITE_SERVER_URL` set the Console calls the
server cross-origin and skips the proxy (`ui/apps/console/src/App.tsx`
and siblings read it as an absolute base). RUNNER records QA run #33096:
401 that way, 200 through the proxy. AGENTS.md (*Fast iteration on `ui/`
src*) names the proxy form only. |
| §5 delivery | patch in `/tmp`; `git worktree add … /tmp/pr`; a
`Co-Authored-By:` trailer; "dev container uses the REST endpoint"; `git
worktree remove /tmp/pr` | patch under the scratchpad's `issue-N/`;
`dev-worktree.sh`; the model-free trailer pair; the relay's `pr_create`;
`rm -rf TREE/node_modules && git worktree remove TREE` |
`.claude/agents/os-dev.md` (basic rule 1, resource rule 4, rule 3's
write channel) and AGENTS.md (commit trailer). The pre-push hook refused
this PR's own first commit for a card relation in its message. |

Paid for by deletion, so the file shrinks 9525 → 9513 bytes and its
ceiling row follows (`scripts/pm/check-skill-line-ratchet.mjs`, 9526 →
9513): an incident narrative in §2 (AGENTS.md: rules carry no incident
narrative), §6's second bullet folded into the first as one clause (it
repeated §5's explicit-paths rule, which it now points at), §0's PR
bullet cut down to a pointer at §5, and the bullets this PR rewrote are
no longer hard-wrapped (the ratchet counts bytes and allows full lines).

Re-measured and unchanged: `/api/v1/health` answers 200; the seeded
`admin@objectos.ai` / `admin123` signs in (200), and the boot says
"seeded on empty DB"; `/api/settings` is 200 signed in and 401 without a
session; `pkg.main` is `dist/index.js` for runtime, objectql, rest and
cli; `pnpm console:build` builds `ui/apps/console` and copies it into
`packages/console/dist` (`turbo.json`: `@objectstack/console#build:dist`
depends on `@object-ui/console#build`); that dist carries no SHA stamp;
ADR-0124 is the server-enforces record §3 cites.

Declared none because every changed hunk is a boot or delivery process
step. None changes what an agent may do without the maintainer, what
gets done or in what order, or what must go to him. The `OS_PORT` step
changed because `os dev` changed. §5 keeps its one authority sentence:
ready, queue and merge belong to the dispatching seat. The contract
review on this PR verified the same value.

### Read these first (by risk)

1. §0, the `-p` bullet: it replaces an instruction, it does not only
re-point it.
2. §2, the HMR command: the one command an agent copies verbatim.
3. §5: the delivery steps now defer to `os-dev.md` and the relay.

## Tests

Text only: no code, no test. The ratchet row is the only script edit.

<details><summary>Local gates on head 60478bd (after merging
origin/main): 39 derived, 39 run, all exit 0</summary>

`node scripts/pm/dispatch-gates.mjs --commands` derived 39 commands for
this diff against merge base `2052c8995a`. All ran in one batch under
`scripts/pm/os-verify-lock.sh` (slot `issue-35238`; lock VERDICT
`command-exit 0`). One gate, `check:doc-formula-expressions`, first
exited 3 (PREREQUISITE NOT MET: `@objectstack/formula` and
`@objectstack/lint` were not built in the recreated worktree). It passed
under the lock after building them. `--ran` reconciliation: "39 derived
famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero — all
39 recorded an exit code and none of them is 3)".

- `node scripts/check-closing-keyword-parity.mjs` :: exit 0
- `node scripts/check-closing-keyword-parity.mjs --self-test` :: exit 0
- `node scripts/check-comment-mask-corpus.mjs` :: exit 0
- `node scripts/check-declaration-mirrors.mjs` :: exit 0
- `node scripts/check-declaration-mirrors.mjs --self-test` :: exit 0
- `node scripts/check-self-test-wired.mjs` :: exit 0
- `node scripts/check-self-test-wired.mjs --self-test` :: exit 0
- `node scripts/check-self-test-workflow-commands.mjs` :: exit 0
- `node scripts/check-self-test-workflow-commands.mjs --self-test` ::
exit 0
- `node scripts/check-whole-set-label-write.mjs` :: exit 0
- `node scripts/check-whole-set-label-write.mjs --self-test` :: exit 0
- `node scripts/ci/plan-test-core-shards.mjs --self-test` :: exit 0
- `node scripts/pm/bare-root-worklist.mjs --self-test` :: exit 0
- `node scripts/pm/check-harness-current.mjs --self-test` :: exit 0
- `pnpm --filter @objectstack/lint run check:doc-formula-expressions` ::
exit 0
- `pnpm check:adr-anchors` :: exit 0
- `pnpm check:agent-test-spelling` :: exit 0
- `pnpm check:bash32-floor` :: exit 0
- `pnpm check:ci-filter-parity` :: exit 0
- `pnpm check:cli-command-ids` :: exit 0
- `pnpm check:cross-package-test-inputs` :: exit 0
- `pnpm check:doc-authoring` :: exit 0
- `pnpm check:driver-memory-census` :: exit 0
- `pnpm check:entry-guard` :: exit 0
- `pnpm check:gitlink-declared` :: exit 0
- `pnpm check:nul-bytes` :: exit 0
- `pnpm check:parse-guard` :: exit 0
- `pnpm check:pm-dispatch-gates` :: exit 0
- `pnpm check:pm-governed-merges` :: exit 0
- `pnpm check:pm-record-recognisers` :: exit 0
- `pnpm check:pm-settings-deny-roster` :: exit 0
- `pnpm check:pm-skill-ratchet` :: exit 0
- `pnpm check:pnpm-filter-targets` :: exit 0
- `pnpm check:pnpm-flag-spellings` :: exit 0
- `pnpm check:ratchet-remedy-authority` :: exit 0
- `pnpm check:refd-timer-probe` :: exit 0
- `pnpm check:scripts-symbol-anchors` :: exit 0
- `pnpm check:skill-frame-sync` :: exit 0
- `pnpm check:watch-hint-literal` :: exit 0

</details>

CI runs the full farm; this PR does not re-run it locally.
`overlap-check` before each push: clean against `origin/main` and
against #38444, which also edits the ratchet script.

## Acceptance notes

Each finding below has a carrier on #35238, for one small follow-up PR
`Part of` that card after this one. This PR edits none of those files.

- Item e-runner (comment 7250083793 on #35238): a fresh worktree has no
Console build. `/_console/` answered **503** with the remedy text
("Console dist not found … Build it with `pnpm console:build`"), and the
boot warned the same. RUNNER's `stale-console-bundle` trap row still
says "a 404 `/_console/`".
- Item e-build-dist (comment 7250083793 on #35238):
`packages/console/build-dist.sh` says to run it through "`pnpm
console:build`, or the root `pnpm build`". The package declares only
`build:dist`, so the root `pnpm build` never runs it, which is what the
boot warning says too.
- Item e-restatements (comment 7250187648 on #35238):
`docs/qa/studio-benchmark/SCENARIO.md:15` and
`docs/qa/platform-checklist/areas/platform-core.json:16` still quote the
§0 wording this PR removes ("`OS_PORT` exported, not only `-p`"; "not
3000/3001/3210").
- Item e-pillar-notes (comment 7250187648 on #35238): the retired
`/_console/studio/PKG/PILLAR` address still stands in comments in
`packages/cli/src/commands/serve.ts`,
`packages/plugins/plugin-dev/src/dev-plugin.ts` and
`packages/apps/studio/src/index.ts`, and is quoted in `RUNNER.md`.
- NOT MEASURED: §3 and §4 (driving a browser). This session had no
preview browser, so those steps were read against the code, not run. The
HMR dev server was not started either; the §2 change rests on the proxy
config and RUNNER's measured run.

## Verification

Two-minute check: `pnpm check:pm-skill-ratchet` prints
`.claude/skills/dogfood-verification/SKILL.md is 9513 bytes (ceiling
9513; headroom 0)`; then read §0 and §2 of the skill against the table
above.

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

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oPfjnm2yWHEwkiYrn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
… read, so the agent can pick one (#38462)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XDXvJPPtrTGfdDYhWWpihq5)_

Part of #38445

`Part of`, not a closing keyword: the card's first acceptance item has
an agent half (which page a live model picks from the contents, then
answers) that this PR does not measure. The tool half is measured below
and posted on the card (comment 7250659272). The card stays open for the
agent probe, and #38352's Restart-when does not fire on this merge.

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

## 维护者速读

-
用户能看到什么变化:智能体在手册里搜不到用户说的词时,回答里会附上它能看的手册目录(每页标题、所在手册、链接),它按标题挑一页再读;搜得到时一切照旧。
- 为什么做:手册搜索只认原词,用户说「潜在客户」「催款」而手册写「线索」「回款」时,今天只能说手册没写;这是您「目录兜底,A
暂停」的那张小卡。
- 出错会怎样:最坏是智能体挑错一页或仍说手册没写,不会多看到无权看的页,也不透露有多少页被挡;撤回这一个改动即恢复原样。
- 要你做的:无。

## What changes

- `searchPackageDocs` (`@objectstack/runtime`, `mcp-package-docs.ts`):
when nothing matches, the answer also carries `contents` (the pages the
caller may read, within `package` when sent, each the exact address a
hit carries: `name` and `title`, plus `package`, `book` and `url` where
the page has a package; no excerpt) and `contentsTruncated`. It is built
from the same gate-passed `readableDocsAndBooks` read as the search, so
no entry, count or flag depends on a page the caller cannot read.
- Order is the Console's (measured in
`ui/apps/console/src/pages/book-nav.ts`, `buildPortalBooks` /
`sortBooks` / `resolveBookTree`): authored manuals by `order`, then
label as served in the request's locale, then each package's implicit
manual; inside a manual, the order its resolved tree lists the pages;
each page once, under its home manual (the one its `url` names). Pages
with no package come last. Titles follow the request's locale as
`read_package_doc` serves them.
- Cap: `PACKAGE_DOC_CONTENTS_MAX_ENTRIES = 50` (`@objectstack/mcp`),
passed to the member as `opts.maxContents` beside `maxResults`; over it,
the first 50 in that order and `contentsTruncated: true`. A caller that
sends no `maxContents` gets the same 50
(`PACKAGE_DOC_CONTENTS_DEFAULT_MAX` in the runtime module, which carries
no runtime dependency on `@objectstack/mcp`; each package pins its
constant to 50), so the list is never uncapped.
- A search with a hit answers exactly as on main (`{ terms, results,
truncated }`, no new key).
- `SearchPackageDocsOutput` gains optional `contents?` and
`contentsTruncated?`. The tool description and the `initialize`
answer-order rule (`packageDocAnswerRule`) say: with no match the answer
lists the readable pages; read the one whose title fits; when none fits,
the manuals do not cover it.
- Changeset: patch on `@objectstack/mcp` and `@objectstack/runtime`
(`Metadata-protocol: none` takes `patch`, AGENTS.md Post-Task step 3).

## Tests

- `packages/runtime/src/domains/mcp-package-docs.test.ts` (new describe,
9 cases): readable pages exactly, in manual order, each `toStrictEqual`
the address a hit answers; gate first (deep-equal answers with and
without a hidden page, at cap 50 and at a cap equal to the readable
count, plus the holder control seeing it and getting `contentsTruncated:
true`); `package` scoping (and an unknown package answers empty
`contents`); 60 pages over the cap (50 entries, `contentsTruncated`,
implicit manual ordered by `order`); a call with no `maxContents` capped
at 50; manual order (authored by `order` over label, before implicit,
loose pages last); a page no manual of its package claims listed under
that package's first manual, after its claimed pages; locale of titles
and manual names; the hit answer pinned whole with its key list.
- `packages/mcp/src/mcp-package-doc-tools-35442.test.ts`: the opts the
tool hands the member (`maxContents`), the description sentence pinned,
a zero-hit answer's `contents` reaching the client unchanged, and the
`initialize` rule sentence pinned.

## Acceptance notes

- Stdio does not serve `search_package_docs`: both transports compose
tools through `wireBridgeTools`, and the stdio bridge
(`stdio-data-bridge.ts`) carries no doc members, so the field reaches
every transport that serves the tool (HTTP).
`packages/mcp/src/plugin.ts` was not touched.
- "Pages are cut whole, never mid-book where a book fits" is read as:
whole entries, a prefix of the manual order, so a book is cut only when
it does not fit the room left. That is the only reading under which
"over the cap, the answer holds 50 entries" always holds.
- The Console labels an implicit manual by a humanized package id
("Setup"); the MCP answer labels it by the package id (unchanged from
today's hit addresses), and implicit manuals are ordered by that label.
On HotCRM every manual is authored, so this does not show there.
- `packages/mcp/README.md` lines 88-95 and 170 describe the docs pair;
they stay true but do not mention `contents`. The README is outside this
card's file surface; left for whoever next edits it.
- The few-hit case stays out of scope (card What 4): on HotCRM `签批` hits
three pages through a heading, and `prospect` hits the opportunities
page through a stage name, so neither answers `contents`.

## Verification

Two-minute check: `pnpm --filter @objectstack/runtime exec vitest run
--maxWorkers=2 src/domains/mcp-package-docs.test.ts`; expect 37 passed,
among them the nine `[#38445]` cases.

Read first, by risk: `packages/runtime/src/domains/mcp-package-docs.ts`
`contentsOf` (the gate inputs and the order), then the zero-hit branch
of `searchPackageDocs`, then the description sentence in
`packages/mcp/src/mcp-http-tools.ts` `registerPackageDocTools`.

<details><summary>Paraphrase probes on HotCRM's manual, before
(84477b9) and after (d6430a2)</summary>

No in-repo example ships a CRM manual (`examples/app-crm` has no docs),
so the probes ran over HotCRM's real manual: its 29 pages collected by
the CLI's own loader (`collectDocsFromSrc`,
`packages/cli/src/utils/collect-docs.ts`) from a local HotCRM checkout
at 142e7a1, its 8 books transcribed from its `*.book.ts` files (the
admin manual behind `permissionSet: system_admin`), served through the
real `/mcp` bridge (`HttpDispatcher.handleMcp`) for a signed-in member
without that set, and called through the real `search_package_docs` tool
(`MCPServerRuntime.handleHttpRequest`, `tools/call`). Request locale
zh-CN; with no locale the results are the same, with English titles. The
probe was a temporary test file, not committed.

| term | before | after |
|:--|:--|:--|
| `潜在客户` | 0 hits (none); no contents | 0 hits; contents 25 pages,
contentsTruncated false |
| `销售机会` | 0 hits (none); no contents | 0 hits; contents 25 pages,
contentsTruncated false |
| `签批` | 3 hits (`crm_sales_opportunities`, `crm_overview`,
`crm_getting_started`); no contents | 3 hits; no contents |
| `催款` | 0 hits (none); no contents | 0 hits; contents 25 pages,
contentsTruncated false |
| `谁来跟进新线索` | 0 hits (none); no contents | 0 hits; contents 25 pages,
contentsTruncated false |
| `prospect` | 1 hits (`crm_sales_opportunities`); no contents | 1 hits;
no contents |
| `线索` | 9 hits (`crm_sales_leads`, `crm_analytics_metrics`,
`crm_sales_activities`, `crm_overview`, `crm_ai_skills`,
`crm_sales_opportunities`, `crm_getting_started`,
`crm_marketing_campaigns`, `crm_marketing_automation`); no contents | 9
hits; no contents |

The 25 pages are the member's readable set (the 4 admin pages are
absent), in manual order: User Manual (overview, getting started,
assistant, then 线索——分配与转化, 商机——阶段、提醒与审批, 合同, 订单, 活动, 指标), Revenue,
Marketing, Order to Cash (回款计划, 发票与回款), Service, Project Delivery,
Expenses. By title, `潜在客户` and `谁来跟进新线索` lead to `crm_sales_leads`
(线索——分配与转化), `销售机会` to `crm_sales_opportunities` (商机), and `催款` to
`crm_o2c_invoices_payments` / `crm_o2c_collection_plan` (回款). Which page
a live model picks was not run here (NOT MEASURED: no agent loop in this
container); the answers above are what it receives. The positive control
`线索` answers hits and no `contents`.
</details>

<details><summary>Local verification at 3c22f05 (patch round: changeset
patch, default cap, description, comment; origin/main merged at
8b59499)</summary>

- Build closure (`turbo run build --filter='@objectstack/runtime^...'
--filter=@objectstack/runtime --filter=@objectstack/driver-turso`): 43
successful, 43 total.
- `pnpm --filter @objectstack/mcp test`: Test Files 88 passed (88),
Tests 1653 passed (1653); `pnpm --filter @objectstack/mcp typecheck`:
`check:test-typecheck: OK`.
- `pnpm --filter @objectstack/runtime test`: Test Files 656 passed
(656), Tests 12493 passed, 25 skipped (12518); `pnpm --filter
@objectstack/runtime typecheck`: `check:test-typecheck: OK`. One `&&`
chain under the verify lock: VERDICT command-exit 0.
- `mcp-package-docs.test.ts`: 37 cases (28 before this card + 9).
- Ablation (at d6430a2, on disk against the committed fix): the
zero-hit branch disabled reds 6 of the then 7 new cases (the hit pin
stays green); `contents` built from the unscoped pages reds the
`package` case. Restored, file identical to HEAD.
- Derived gate list (`dispatch-gates.mjs --commands` at 3c22f05, 69
families, same list as at d6430a2): 68 exit 0;
`check:dual-build-cjs-loads` exit 3, PREREQUISITE NOT MET (it needs
every package's `dist/`): NOT MEASURED locally; CI's `Lint & Repo Gates`
is green on this head. `--ran`: 69 derived, 68 run, 1 NOT-MEASURED, 0
UNRUN.
- `overlap-check --branch=HEAD`: VERDICT clean exit 0.
- Dogfood battery: not owed (no `!` in the title, the declaration
carries the `(widening)` arm).
</details>

https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb

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

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oQLfL8thb6wtUHnTb -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Conflict in object-lifecycle-panel-echo-decisions.test.ts: both sides'
comments kept, translated 872 + 3 (fieldTabs) + 1 (closedStates) = 876.
protocol.meta-types-degenerate-derivation.test.ts auto-merged to 55 but
both sides added one object key: object 53 -> 54 (closedStates) -> 55
(pinOverview) -> 56 (fieldTabs).

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPpwJymVUdp5AnRPBq
…refresh)

The trunk took the first refresh as a squash (fe50943), whose tree is
the tree of ba57382. This merges the branch that continues from
ba57382 (main fc198b2 merged, regenerated): every conflict is the
first refresh's hunks seen twice, so the result is that branch's tree
unchanged.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPpwJymVUdp5AnRPBq
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:ai protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 9 package(s): @objectstack/cli, @objectstack/lint, @objectstack/metadata-core, @objectstack/metadata-protocol, @objectstack/platform-objects, @objectstack/knowledge-pgvector, @objectstack/knowledge-turso, @objectstack/service-knowledge, @objectstack/spec, touching 162 documentable anchor(s). ⚠️ 20 changed file(s) yielded no anchor (packages/lint/src/index.ts, packages/metadata-protocol/src/index.ts, packages/plugins/knowledge-pgvector/README.md, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

51 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json fe50943d1094e8a522f150b15232faf586d19bba.

⛔ 13 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 20 changed file(s) yielded no anchor (packages/lint/src/index.ts, packages/metadata-protocol/src/index.ts, packages/plugins/knowledge-pgvector/README.md, …) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: VALIDATION_ERROR (literal, 40 pages)
  • 25 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 194 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json fe50943d1094e8a522f150b15232faf586d19bba → packageMentionDocs.

Which tree this was computed on

This run read content/docs from e75ab8106baa0e07ab86fef9254a60b6003e8ab9 — the merge of head 8ff2442358a2df5c62b010ae5dfb468f1b012188 into base fe50943d1094e8a522f150b15232faf586d19bba, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older claude/o5-data-approvals-trunk holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin e75ab8106baa0e07ab86fef9254a60b6003e8ab9 && git checkout e75ab8106baa0e07ab86fef9254a60b6003e8ab9
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin fe50943d1094e8a522f150b15232faf586d19bba 8ff2442358a2df5c62b010ae5dfb468f1b012188 && git checkout -B drift-repro fe50943d1094e8a522f150b15232faf586d19bba && git merge --no-ff 8ff2442358a2df5c62b010ae5dfb468f1b012188

node scripts/docs-audit/affected-docs.mjs --json fe50943d1094e8a522f150b15232faf586d19bba

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs fe50943d1094e8a522f150b15232faf586d19bba → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-steve · os-steve · session_01ADHkmPpwJymVUdp5AnRPBq

Deliberate correction: one pending release note changed by this PR, as main corrected it (Check Changeset).

Head 8ff2442358a2df5c62b010ae5dfb468f1b012188. This PR merges main (fc198b2847) into the approvals trunk (base fe50943d10). One note that is on the merge base changes, and the change is not this PR's own: it is a correction main already landed, carried in by the merge. After the merge the file is byte-identical to main at fc198b2847 (git diff --quiet fc198b2847 HEAD -- FILE, exit 0). It is not restored from the base, because that would put back the sentences main corrected. It is not renamed, because this is not a filename collision.

.changeset/37815-body-capabilities-every-gate.md, from 94b346356b (#38755, which judges a lowered hook or action body's capabilities like an authored one). Four passages change, each as main wrote it:

No other line of the file differs from the base. The gate is unchanged. The seat confirms this declaration by its same-head contract review record.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB
L1-b, the seat's L1 thread · 2026-11-30T19:28Z · merge review

席位核对

ACCEPT @ 8ff2442 (#37767, the second main → approvals-trunk refresh for #38497). I reviewed only the merge.

The chain, and the tree.

No side lost (merge base 59faf74c; main took 15 commits to fc198b28):

  • Every file at this head that differs from main fc198b28 is one the trunk touched or one the regeneration commit wrote. Every file that differs from the trunk ba57382e is one main touched or one the regeneration wrote. Both lists are empty.
  • 27 files were touched by both sides. In each, every non-blank line either side added since the merge base is present at this head, except three count lines, read below.
  • .changeset/37815-body-capabilities-every-gate.md is byte-identical to main fc198b28 (git diff --quiet exit 0). That matches declaration 7289249692.

The two hand resolutions, against both parents:

  • protocol.meta-types-degenerate-derivation.test.ts.
  • object-lifecycle-panel-echo-decisions.test.ts.
    • Main went 872 → 875 (fieldTabs), and the trunk went 872 → 873 (closedStates). The head keeps both comments and pins 876 = 872 + 3 + 1.
    • Ablated back to main's 875: red.
  • state-counts/object.md (generated): main 98 → 100 and trunk 98 → 99, so the head's 101 / 103 is the sum.
  • object-collapsed-sections-echo-decisions.test.ts keeps the trunk's 131/118 and main's 134 → 140 capabilities total. No count there was touched by both.

Regeneration, measured in a scratchpad worktree at this head:

  • check:generated exit 0.
  • check:authorable-surface exit 0 (1761 schemas).
  • gen:liveness-counts exit 0, with git status clean after it.
  • check-system-context-census.mjs exit 0.
  • So the 6 files 25c63f5c writes are what the generators emit.

Tests:

  • meta-types-degenerate-derivation: 18/18.
  • The two platform-objects translation files: 78/78.
  • spec compose-stacks-* and src/data/object*: 625/625 (18 files).
  • objectql closed-state: 13/13.

Check Changeset is red on 37815-body-capabilities-every-gate.md alone. That is the file the declaration names, and it is byte-identical to main. Its edits are main's own corrections, carried in by the merge. As with #38791, the red is structural and does not travel to #38497. Other runs at this head: 21 success, 7 skipped, 36 in progress. This ACCEPT does not cover the runs in progress. The L2 is the seat's.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 8ff2442358a2df5c62b010ae5dfb468f1b012188
Local-runs: none
Scope: packages/spec/src/ai/knowledge-source.metadata-form.ts, packages/spec/src/contracts/index.ts, packages/spec/src/contracts/reranker.ts, packages/spec/src/data/object.metadata-form.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/migrations/entries/semantic/19.hook-and-action-bodies-calling-an-ungranted-gate-refused.ts, packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts, packages/spec/src/migrations/entries/semantic/19.lowered-hook-and-action-bodies-capabilities-judged.ts, docs/adr/0037-live-canvas-draft-preview.md, docs/adr/0084-application-builder-information-architecture.md, docs/adr/0085-object-semantic-roles-over-surface-hint-blocks.md, docs/adr/0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md, docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md, docs/adr/0159-forms-are-their-own-metadata-type-public-forms-are-form-items-view-is-lists-only.md, skills/objectstack-ai/SKILL.md, skills/objectstack-platform/evals/config-plugins-ops.json, AGENTS.md + packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts, packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts, .changeset/37815-body-capabilities-every-gate.md, packages/spec/liveness/state-counts/object.md, packages/spec/authorable-surface/data.json, packages/spec/docs/references/api/metadata.md, packages/spec/docs/references/system/migration.md, packages/spec/docs/references/system/migration.part-2.md, content/docs/references/data/object.mdx
Security-touching: no
Rule-change-verified: none

PR #38797 (card #37767, claim amendment 6): the second refresh of main into the approvals trunk. Base: the trunk at fe50943d10 (#38791, squashed). Head 8ff2442358 merges the line ba57382ea6 → 134a682262 (merge of origin/main at fc198b2847) → 25c63f5c3c (regeneration) onto that base. Read from: the PR body, the three commits and their re-merge diffs, both parents' trees by sha, declaration comment 7289249692, and the check-runs on this head. Nothing built or run locally.

① Derived judgments

  • Tree identity holds. The head's tree is 85aea4d1c2, the same tree as 25c63f5c3c. The base fe50943d10 has tree c2c12919a8, the same tree as ba57382ea6, the head reviewed on chore(approvals): merge main into the approvals trunk (#38497 refresh) #38791. So the outer merge 8ff2442358 decides nothing of its own: its conflicts are chore(approvals): merge main into the approvals trunk (#38497 refresh) #38791's hunks met twice across the squash, and its result is the gated line's tree unchanged. What this PR changes against its base is exactly what 134a682262 and 25c63f5c3c change against ba57382ea6.
  • That change is main's delta 59faf74c6f → fc198b2847 plus the two resolutions, with nothing lost on either side. (i) The merge base of ba57382ea6 and fc198b2847 is 59faf74c6f. All 157 files that differ between the base and the head are files main touched in that range; all 148 files that differ between fc198b2847 and the head are files the trunk touched since c610020e2f. (ii) 21 files differ from both parents of 134a682262. For 19 of them the line delta trunk→head equals main's delta and the delta main→head equals the trunk's, line for line; the two published-schema files among them (packages/spec/src/data/object.zod.ts, object.metadata-form.ts) are in that 19. The other two are the hand resolutions (④ b). (iii) Of the 17 review-face hits on the file list, 15 are byte-identical to main at fc198b2847; the two that are not are those two schema files, which carry main's fieldTabs and the trunk's closedStates and nothing else.
  • Check-runs on this head, all concluded (69 runs): 61 success, 7 skipped, 1 failure. Test Core 12/12, Test UI 16/16, every Type Check and Lint · job (PM dispatch-gates included), Build Core, Build Docs, Spec property liveness, Dogfood Regression Gate, Governed Surface Queue Guard, PR-body guards, Live E2E UI: success. The two hand-set pins (object: 56; 876 translated) are confirmed by Test Core green.
  • The one failure is Check Changeset, on exactly one refusal: .changeset/37815-body-capabilities-every-gate.md is "present on the merge base and CHANGED by this PR". Its log has no other error line. The remedy the gate names is a declaration confirmed by a same-head record: the declaration is comment 7289249692 (19:21Z) and this record is the confirmation (④ c). The gate must be re-run after this record is posted to read both.

② Semver level

The merge adds no changeset of its own and should not. Against the base, 13 notes are added (all main's, byte-identical to main) and one is modified (④ c); none is deleted or renamed. Against main at fc198b2847 the head differs in .changeset only by the trunk's 19 added notes. The declarations on the PR body (Clause-②: yes (narrowing), Metadata-protocol: added) are the trunk's, restated.

③ Boundary flags

  • PR body, two resolutions: both hold (④ b).
  • PR body, "the result is 25c63f5c3c's tree unchanged": confirmed (①).
  • PR body, "No side lost": confirmed independently (① ii).
  • PR body, "Regenerated (not hand-edited)": holds (④ d).
  • Tenant scope and security (④ e): no hunk changes tenant scoping, permission or credential behaviour relative to both parents. Security-touching: no.
  • Rules: no .claude/** path differs between the base and the head, or between main and the head. Rule-change-verified: none.
  • main has moved again: origin/main is 2fba83493b, seven commits past fc198b2847. A trial merge of this head with it reports no text conflict. Not this head's concern; whether feat(objectql): a record in a closed state, and its lines, are closed to change (closedStates, ADR-0162) — trunk #38497's generated outputs need another regeneration is for that PR's own gates.
  • SQL push-down: the two resolved hunks are test pins and comments; no id materialisation or in-app join is added.
  • open_questions: none raised by the PR.

④ Design judgment

a) Tree and delta — judged in ①: the final tree equals 85aea4d1c2, and its diff from fe50943d10 is main's 59faf74c6f → fc198b2847 delta plus the two resolutions. Nothing of main's is dropped and nothing of the trunk's is dropped.

b) The two resolutions

  1. packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts (text conflict) — holds. Both sides start at 872. Main: 875 since #37802, the fieldTabs repeater, three labels. Trunk: 873 since ADR-0162 D1, the closedStates row, one label. Head: main's comment and step verbatim, then the trunk's row renumbered to 876. 872 + 3 + 1 = 876. This is also the order the two changes reach main in.
  2. packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts (merged without a conflict, to a wrong number) — holds, and the correction was needed. Each side moved object to 55 by a different key, so git kept 55 while the merged tree has both keys. Checked against the tree: main at fc198b2847 pins 55 and the head's ObjectSchema differs from main's by one top-level key, closedStates; the trunk pinned 55 and the head differs from it by one top-level key, fieldTabs. Both give 56. The authorable-surface register agrees: 47 data/Object: keys on each parent, 48 at the head. The comments read 53 → 54 (closedStates), 54 → 55 (pinOverview), 55 → 56 (fieldTabs). The companion pin in object-collapsed-sections-echo-decisions.test.ts (131 leaves, advanced 118) needed no hand: main's fieldTabs sits in the open basics section and moved a different line (OPEN_LEAVES 134 → 140), which arrived by clean merge.

c) The changed changeset note — .changeset/37815-body-capabilities-every-gate.md. It is a correction main already landed, 94b346356b (#38755), carried in by the merge. At the head the file is byte-identical to main at fc198b2847; the trunk never touched it (the base's copy equals main's at 59faf74c6f); four lines differ from the base and no other. The declaration's four quoted passages match the tree. Before and after, the sentences that change:

  • BREAKING line — before: an action, an object or a hook whose authored L2 body calls a member the QuickJS sandbox gates; after: an action, an object or a hook whose L2 body calls a member the QuickJS sandbox gates.
  • hook-body-capability-undeclared — before: an authored L2 hook body that calls any of those gates without its token. [...] Only a body the author wrote is judged: a hook body os build/os verifylowered from an inlinehandler is not, since its grant is the build's inference (the lowered reading is #38653).; after: an L2 hook body that calls any of those gates without its token. [...] A hook body os build/os verifylowered from an inlinehandler is judged the same way: its grant is the one the build inferred from its calls, and the build reads each gated call in each spelling the rule reads.
  • action-body-capability-undeclared — before: an authored L2 action body [...] An action body os build/os verifylowered from an inlinetargetfunction is not judged for these tokens, since its grant is the build's inference (the lowered reading is #38653); its writes are still judged underaction-body-write-capability-undeclared.; after: an L2 action body [...] An action body os build/os verifylowered from an inlinetarget function is judged the same way, against the grant the build inferred from its calls.
  • Closing paragraph — before: A hook whose body was lowered from an inline handleris unchanged: FROM and TO alike, it is not judged by this rule. So is an action whose body was lowered from an inlinetargetfunction, for every token butapi.write: [...] TO, it still builds clean, and its writes are judged as before.; after: A hook written as an inline handler, and an action written as an inline target function, need no change: the build infers the grant from each gated call in each spelling the rule reads (?., whitespace or a comment between steps, the optional call), so the body it lowers carries the token. [...] TO, it still builds clean, its lowered body granted api.transaction.

Restoring the base's version would be wrong. #38755's code is in the head's tree (packages/lint/src/validate-action-body-capabilities.ts and packages/cli/src/utils/extract-hook-body.ts are byte-identical to main), so a lowered body IS judged on the merged tree; the old sentences say it is not, which would tell an upgrader the opposite of what the gate does. Restoring would also make the trunk → main PR revert main's correction. It is not a filename collision: no second note was drawn on the name, so renaming is not the remedy.

DELIBERATE CORRECTION confirmed: .changeset/37815-body-capabilities-every-gate.md — Only a body the author wrote is judged: a hook body [...] lowered from an inline handler is not (with the three matching sentences above) → A hook body [...] lowered from an inline handler is judged the same way (with the three matching sentences above), as main wrote them in #38755

d) Generated files — regenerated output, not hand edits (spot-check, nothing rebuilt). 134a682262 left the generated files on one side and 25c63f5c3c rewrote six of them. At the head each differs from main by the trunk's one key and nothing else: authorable-surface/data.json by the line "data/Object:closedStates"; references/api/metadata.md, references/system/migration.md, migration.part-2.md and content/docs/references/data/object.mdx by one closedStates row each; liveness/state-counts/object.md reads 101 / 103, which is main's 100 / 102 plus one, and equally the trunk's 99 / 101 plus main's two since 59faf74c6f. The gates that refuse a generated file differing from what the tree produces (Spec property liveness, Build Docs, the docs-and-code lint job) are green.

e) Tenant scope and security — none relative to both parents. The only hand-resolved files are two test files. No file under packages/objectql/src differs from both parents; the one objectql path that differs from the base (protocol-stored-form-migration.test.ts) is main's test arriving unchanged. The engine files reviewed on #38791 (engine-update.ts, engine-delete-and-aggregate.ts, closed-state-lock.ts) are untouched by this PR.

f) CI — judged in ①: everything concluded, green except Check Changeset, whose single refusal is the note confirmed in c).

Findings

No must-fix, no should-fix.

  • nit (carried, not new here) — protocol.meta-types-degenerate-derivation.test.ts: the history comments keep the trunk's key first (53 → 54 closedStates, then main's two renumbered), while the echo-decision test keeps main's steps verbatim and puts the trunk's last. On main the comment will misstate the step each of main's two keys took. The pinned number is right; comment only. This refresh extends the ordering chore(approvals): merge main into the approvals trunk (#38497 refresh) #38791 chose rather than choosing it.

Implemented-by: claude/project-thread-nmutvp
Reviewed-by: session_01ADHkmSAjFEZHRpRq3WCj6z

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

维护者速读

Seat opinion: merge as is.

席位核对

ACCEPT at head 8ff2442358a2df5c62b010ae5dfb468f1b012188 · base claude/o5-data-approvals-trunk @ fe50943d10 · Part of #37767

  1. Shape: 157 files, all main's own 59faf74c6f → fc198b2847 changes, merged via os-regen-merge.sh; final tree 85aea4d1c2, identical to the tree the gates ran on.
  2. Premise: two hand resolutions, both test counts: object-lifecycle-panel-echo-decisions.test.ts translated 876 (872 + 3 + 1), and the degenerate-derivation pin object: 56 (git auto-merged 55; each side added one key). Nothing is lost on either side (L2 7289911344, (a) and (b)).
  3. Gates: on this head 61 success, 7 skipped, 1 failure. The failure is Check Changeset, on the one declared note. Test Core 12/12, Test UI 16/16 and dogfood are green.
  4. Accepted deviations: one comment-only nit carried from chore(approvals): merge main into the approvals trunk (#38497 refresh) #38791 (step order in the degenerate-derivation history comment).
  5. DELIBERATE CORRECTION confirmed for .changeset/37815-body-capabilities-every-gate.md (from 94b346356b, feat(lint)!: judge a lowered hook or action body's capabilities like an authored one #38755). It is byte-identical to main; restoring the trunk's text would contradict feat(lint)!: judge a lowered hook or action body's capabilities like an authored one #38755's code, which is in this tree.
  6. Landing: L1-b ACCEPT 7289462740 and L2 PASS 7289911344 on this head. After this merges, feat(objectql): a record in a closed state, and its lines, are closed to change (closedStates, ADR-0162) — trunk #38497 runs the battery and its own L2 against main.

ACCEPT → comment 7289462740 · Contract review → comment 7289911344

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 30, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 30, 2026 22:21
@os-zhuang
os-zhuang merged commit a5f3362 into claude/o5-data-approvals-trunk Nov 30, 2026
71 of 73 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-nmutvp branch November 30, 2026 22:21
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 30, 2026
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ooted code as a pair (objectstack-ai#38803)

_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9SSdM6AYsxMukn8uhMeGEh7)_

Part of objectstack-ai#37111 — PR 3 (the card's two remaining acceptance items). PR 1
is objectstack-ai#38613 (`1d959b0910`) and PR 2 is objectstack-ai#38748 (`c4472c8631`). The seat
closes the card once this PR merges.

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:把 `.custom`
定制包当作代码启动的部署,升级时定制包自己那张旧写法表单会搬成它自己的表单行,不再被误拦住;定制包代码里自己也带这个表单名时同样如此。公开地址前后应答不变。
- 另一项只加钉子:在一个真正强制「一槽一行」的存储上,证明两个计划抢同一槽时升级照旧被拦,什么都不写。
- 要你做什么:Tier H 的 draft,审核后按受管流程批准。
- 风险:小。普查只多认出一种已知形状;其余计划不变(planner、引擎、rest 全套件绿)。

## What changes

- **③ a pair held as booted code**
(`protocol-stored-form-migration.ts`). A `.custom` pair registered as
code is read-only, so the census reads it at a `base` address. It then
asked the pair door for a pair of the pair, which ADR-0146 D3 never
gives. Measured before the change: the pair's own old-shape row held the
upgrade with the refusal "is itself a paired customization package". The
census now reads the pair by what its package is
(`customizationBasePackageId`), not by the address kind:
- the pair's own old-shape row moves into the pair's own `form` row
(`pair_form`, no `overrides`), as ADR-0159 D7 already states for the
pair's own row;
  - a stored `form` row already there is kept.
This holds on both destination routes: where the pair's code ships no
form of the name, and where it ships the name itself (an old-shape form
among its items; review 7292231403 S1). On the second route the store's
seal is still read first: where the pair ships the name as a sealed
`form` item, the hold is the seal's, naming the pair. The pair door is
not asked. Two other shapes were measured over the same booted pair and
were already right, so they are unchanged: a declared override in the
pair, and a row bound to the base.
- **Step 7 of ruling record 7265816895: one slot, one row, on a store
that enforces it.** Measured first: neither the engine tests' memory
store nor the rest tests' SQL store refuses a second active row in a
slot as booted, because the overlay unique index is built by
`ensureOverlayIndex`. The new rest pin builds that index and proves the
store refuses a second active row in a pair's slot (control). Then, with
the pair's own `form` row beside a row planned into that pair, it
asserts that the census holds both, `--apply` writes nothing, the slot
keeps its one row byte-equal, every stored row is byte-equal, and both
doors answer the same.

## Why

These are the two acceptance items objectstack-ai#38748 left owed on objectstack-ai#37111, with
their reasons (the `③` note of record 7253682863 on
`pairFormDestination`, and step 7 of ruling record 7265816895). The
seat's ruling of 2026-11-30T20:09Z puts them on this card as PR 3 (claim
amendment 6, 7290758981). N7 of contract review 7282065700 does not fit
here: the early route has no destination that could be read as a move.
It stays where the seat put it.

The operator page (`content/docs/deployment/stored-forms-upgrade.mdx`)
gains one clause (review 7292231403 N1): a row of a `.custom` package
the deployment holds as code stays in that package as its own form.

## Verification

Head `0a1bb19fd8`.

- **Red first** (the pins run against `origin/main`'s planner): planner
"③ a pair held as booted code…" 2 red; rest "③ a pair held as booted
code…" red. For S1 (the pins run against `5a6cb82666`'s planner):
planner "where the pair's code ships the name itself…" 3 red (the first
two held, the third named the pair door's refusal instead of the seal);
rest "③ a pair held as booted code that ships the name itself…" red (it
held). The step 7 pin pins behaviour that already held, so the ablation
below is its proof.
- **Ablations** (`scripts/ablation-replace.mjs`, each restored to
`HEAD`):
- Reading the pair from the address kind where the pair ships no form of
the name: the two ③ planner pins and the ③ rest pin red; engine 38/38.
- Reading the pair from the address kind where the pair ships the name
itself: exactly the three S1 planner pins and the S1 rest pin red;
engine 38/38.
- Not keeping the pair's own `form` row where it stands: exactly the
planner "its stored `form` row is kept" pin red.
- Dropping the hold of a pair slot two plans claim: the step 7 rest pin
red, with 9 planner and 7 engine contested-slot pins.
- **Suites at the head:** planner 112/112, engine 38/38, rest 97/97;
metadata-protocol type-check clean.
- **Derived gates:** `dispatch-gates --commands` derived 95 commands;
all 95 exit 0, each run with `< /dev/null`; `dispatch-gates --ran`: 95
run, 0 NOT-MEASURED.
- **`overlap-check`:** clean against `origin/main`. Two open trunk pulls
of the approvals lane are named. objectstack-ai#38797 merges cleanly. objectstack-ai#38497 conflicts
in the planner test file only because its head predates objectstack-ai#38748, which
those files came from; neither authors a change to these files.
- **Not measured locally, CI owns:** the type-check lanes and the
CI-only jobs the derivation names.

## Deviations

- **File surface** (claim amendment 6): the planner and the rest pin
file; the planner's own test file and the changeset are implicit. The
operator page is added by the seat's order on review 7292231403 (N1). No
other path.
- **`Clause-②: no`** differs from the claim's standing `yes`, which was
written for PR 2's exports (review 7292231403 N2). This PR changes no
export, type, route or schema, so nothing an author writes or a consumer
imports changes.
- **No ADR change.** ADR-0159 D7 already says the pair's own row moves
into the pair's own `form` row; the code now agrees with it for a pair
held as booted code.
- **N7 of record 7282065700 is not built.** The seat records it as an
accepted deviation when it closes the card.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No `packages/spec` change.)
- [x] 2. Every name I added uses the casing for its kind.
- [ ] 3. No formatter ran; `pnpm lint` was not run locally (CI's lint
lane owns it).
- [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_01ADHkmQrGTjSRSiwWSe6AhK

<!-- signed: repo:objectstack#3 · os-steve ·
session_01ADHkmQrGTjSRSiwWSe6AhK -->

---------

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

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi99QsuPTPkC1uKm2mViUT3Rf)_

Part of objectstack-ai#34770

Clause-②: no
Metadata-protocol: none

`Part of`, not the closing form: the catalog-size line of the card's
Done-when is not met by this PR. This is PR 5 of the per-skill split,
under claim 7280537583 and its amendments 7280758590 and 7288186602.

## 维护者速读

- 用户能看到什么变化:用户无感。发给 AI 的「接口设计」技能说明,入口文件从约 21 KB 缩到 9
KB:入口只留开工前四项检查、平台自动提供的接口清单、一个对象可以开放的六种操作、一段可照抄的自定义接口示例、六个「写得通过、上线后却答错或被拒」的坑,以及其余内容去哪里查的指路表。
- 为什么做:这是「技能目录瘦身」的第八份(界面、数据、自动化、平台、跨大版本升级、多语言翻译、表达式与公式七份已完成)。入口文件每次都整份装进
AI 的上下文,越长越贵,也越容易漏读。
- 出错会怎样:只动教 AI 的文字,没有产品行为变化;风险是 AI
少读一段后答错。改动前后各跑完一轮评测(八道题每题三遍,共二十四次):改动后通过十次,改动前九次;没有哪一道题是改动后才每遍都不过的。有四道题前后都是每遍不过,原因前后一样:三道是答案内容对、却没写出题目要求的某个词,一道是
AI 没有打开这份技能说明;这是题目和触发方式的问题,本次没有动。这两轮是经你同意、越过本周额度九成保护线跑的。可整笔撤回。
- 要你做什么:无。席位核对、合约审查与评测对比都已有结果,接下来由席位按治理规则请审批人批准。

## Rulings this executes

- **Card Scope** (decision record on the card, S3 = A): the entry file
holds first checks, at most about 8 traps and a routing list; 6–9 KB,
hard cap 500 lines; restated option lists and tables go behind a
pointer; no trap is removed until a publish-time check covers it or it
stays inline.
- **7128031203** fork 4 = A: ratchet rows are pinned at the measurement
with zero headroom, and the sum of ceilings does not rise. Here no row
rises and none is added.
- **7168461386** = A: text an eval shows the entry lost goes back into
the entry, paid inside the entry. Not used: the two full rounds show no
fact the entry lost (see Eval parity).
- **Ruling record 7249189592**, the parity rule: a case whose result
flips between runs on both trees is unstable on both and does not block;
a case that fails on every run of the head while `main` passes is a
regression. Read below: no case is one.
- **Seat order for this PR** (claim amendment 7288186602, PR 5 =
`objectstack-api`): same shape as PR 3 (objectstack-ai#38663) and PR 4 (objectstack-ai#38795); no
new file under `skills/` (a new file needs a new ratchet row, which
stays with a human); the cut, not a move, lowers the catalog total.

## What changes

**The entry file becomes a router.** `skills/objectstack-api/SKILL.md`:
21,359 → 8,986 bytes, 438 → 151 lines, 5,333 → 2,240 tokens. Frontmatter
(description, tags) is byte-identical. It now holds:

- `## First checks`, four: the installed contract wins over the
`compatibility` line, and an `apis:` block written before protocol 17
turns live; read the stack's `apis`, its `manifest.namespace` and the
object's `apiMethods`, and prefer a generated route; read the contract
and never recall a key or a code; verify with `os validate` or `os
build` and read the publish rejection, which carries the fix.
- `## Generated routes`: one listing (the `data` routes, the two `batch`
routes, import and export, the metadata read), the two routes that do
not exist (`/bulk`, a `GET` aggregate), and the two request contracts a
client gets wrong: the metadata list's closed query set with `?names=`,
and an import mapping's entry form, the only one that carries `applyOn`.
- `## API Methods (Operations)`: the six authorable primitives and what
each of the eight derived operations derives from. The heading and the
six names are held by a gate (see Acceptance notes).
- `## A declared endpoint`: the two servable `type` values, one
type-checked example (the path carve-out, `object_operation` with
`objectParams`, `cacheTtlSeconds`), and the mapping rule (move and
rename only; `transform` is rejected).
- `## Traps`, six: an anonymous endpoint needs an armed budget
(`rateLimit.enabled: true`); an app never mounts on `http.server`,
handler code runs in a flow, an inbound webhook is a `type: 'api'` flow,
and three cases have no app surface; `DELETE` is not final (the recycle
bin, the restore door, the two grants); a `PATCH` with no version token
skips the concurrency check; a public form answers `404 FORM_NOT_FOUND`
unless its `sharing` declares all three keys, strips fields outside its
sections, and is withheld on a walled posture with only a warning;
`userMessage` is the sentence for a person.
- `## Where to go`: six rows (the endpoint contract and its page, the
HTTP protocol page, the error contracts and catalog, the auth contract,
the forms page, the three sibling skills).

**No text moved.** This skill has no hand-written reference file
(`references/_index.md` is generated), and a new file needs a new
ratchet row. So what left the entry was cut, each behind what now
answers it:

| Old entry section | Now |
|:--|:--|
| Skill Boundaries | The frontmatter description and the last routing
row. |
| Auto-Generated APIs | The routes listing, with the two absent routes.
|
| Metadata API (`/meta`) | The first note under the listing: the closed
query set, `?names=`, the two refusals. Cut to the HTTP protocol page:
the one metadata type whose list refuses `names`. |
| Public (anonymous) Form Endpoints | Trap 5: the three `sharing` keys,
the two doors, what the declaration grants, the stripped fields and the
hook to write, the walled-posture withholding. Cut to the forms page:
the file-field rule (an error at `os validate` and at publish), the
`guest_portal` name, the two form contracts. |
| Declarative Endpoints; Choosing between `apis:` and a code handler |
`## A declared endpoint` and trap 2. |
| The path carve-out | The example's two comments (`manifest.namespace`
is required and never derived; the path shape). |
| Five publish gates, each with a prescription | First check 4 (read the
rejection, it carries the fix) and routing row 1. The entry no longer
counts the gates. |
| `authRequired` and the D6 pairing | Trap 1, whole: the default, the
armed budget, why `windowMs` / `maxRequests` alone meter nothing, the
separate metering. |
| Mapping keys: projection only | One sentence under the example. Cut,
each a publish refusal that names the key: `inputMapping` on a `find` /
`get` / `delete` operation, two entries writing one target path. |
| Upgrading a pre-17 stack | First check 1 names the upgrade guide's
entry; the steps are there. |
| Endpoint Naming Conventions | Cut. Its two patterns are not paths an
app can declare (see Acceptance notes). |
| API Methods (Operations) | Kept under the same heading, as prose: the
six primitives, the eight derived operations and their sources, `upsert`
having no route. Cut: the per-primitive route table (the routes listing
carries the routes) and the size of the `ApiOperation` vocabulary. |
| Discovery & Health | Cut: discovery to the HTTP protocol page; the
health routes are not a thing a stack declares. |
| Dispatcher Error Codes | Routing row 3 (`api/dispatcher.zod.ts`). |
| Realtime Subscriptions | Cut: `references/_index.md` lists both
contract files, and first check 3 sends there. |
| Authentication & Authorization | Routing row 4: `AuthProvider` with
its six members, `LoginRequestSchema`, and that an endpoint has
`authRequired` and no nested `auth` block. Cut to the contract: the
login request's field list, and the flat `public` + `permissions` pair
of the plugin route registry. |
| Error Envelopes & the Code Ledger | Routing row 3 (a code in no ledger
fails CI) and trap 6. Cut to the contract and the error catalog: the two
envelope shapes, the two-tier vocabulary, the downstream-ledger recipe,
the locale ladder's subtag steps, the `advisories[]` element. |
| Best Practices | First check 2 (prefer a generated route), the
`upsert` clause, and the routes listing. Cut: the envelope shapes (the
contract). |
| Common Pitfalls | Traps 4 and 3. Cut to the two protocol pages, each
loud when hit: the quoted-empty entity tag, the four restore refusals,
the list / purge / empty doors. |
| Verify your work; References | First checks 4 and 3. |

**Sizes** (bytes · lines · ratchet tokens):

| | before (`main` at `2fba8349`, merged in) | after (head `2b912f16`) |
|:--|--:|--:|
| `SKILL.md` (entry) | 21,359 · 438 · 5,333 | 8,986 · 151 · 2,240 |
| `skills/objectstack-api/**` (3 files) | 33,220 · 569 | 20,847 · 282 |
| all 14 `SKILL.md` together | 165,278 · 3,056 | 152,905 · 2,769 |
| whole `skills/` tree (115 files) | 1,200,447 | 1,188,074 |
| whole tree without `evals/` (73 files) | 841,293 | 828,920 |
| ratchet: authored tokens = sum of all ceilings | 192,665 | 189,572 |
| ratchet: bundle total, tokens | 297,316 | 294,223 |

The head column is measured. The tree and bundle figures of the `main`
column are the head's reading plus this entry's fall: the entry is the
only file under `skills/` that differs (`git diff --stat origin/main
HEAD -- skills`: 1 file). The sum of ceilings on `main` is read from
`main`'s own table (61 rows).

**Budget reading:** the entry is 8,986 B, inside the card's 6–9 KB line,
and 151 lines against the 500-line cap. The whole catalog is 12,373
bytes smaller, all of it cut.

**Ratchet row** (`scripts/check-skills-token-ratchet.mjs`), pinned AT
its measurement, zero headroom: `skills/objectstack-api/SKILL.md` 5333 →
2240 (−3,093): `ceil((8986 − 27) / 4) = ceil(8959 / 4) = 2240`. It is
the skill's only row. The sum of all ceilings goes 192,665 → 189,572. No
row rises and none is added.

## Tests

### Eval parity

Judged by ruling record 7249189592. **No case fails on every run of the
head while `main` passes.** The with-skill arm passes 10 of 24 turns on
the head against 9 of 24 on `main`'s text. Three cases pass 3/3 on both
trees, four fail 3/3 on both trees for the same reason on each, and one
(case 6) goes 0/3 → 1/3.

Both arms, one command line for both rounds: `pnpm --filter
@objectstack/scenarios skill-evals --skills objectstack-api --repeats 3
--concurrency 4 --max-utilization 0.99`, with the model and effort flags
PR 3's rounds used; CLI 2.1.333, subscription login. The two rounds ran
back to back in one window (2026-12-01 00:32Z to 00:38Z), each from a
clean checkout of its commit. 8 behaviour cases in
`evals/endpoints-auth-routes.json`, untouched; this skill has no trigger
file, so there is no trigger reading to give.

| reading | tree | with-skill | no-skill | with-skill cases below 3/3 |
|:--|:--|--:|--:|:--|
| before round | `2fba8349` (`main`'s text; the entry is unchanged on
`main` since) | 9/24 | 0/24 | 3 (0/3) · 4 (0/3) · 5 (0/3) · 6 (0/3) · 8
(0/3) |
| **after round** | `2b912f16` (this head) | **10/24** | 0/24 | 3 (0/3)
· 4 (0/3) · 5 (0/3) · 6 (1/3) · 8 (0/3) |

| case | subject | `main` | head | what the failing answers have in
common, on both trees |
|:--|:--|--:|--:|:--|
| 1 | a declared `GET` feed | 3/3 | 3/3 | |
| 2 | an anonymous endpoint's budget | 3/3 | 3/3 | |
| 3 | a signed inbound webhook | 0/3 | 0/3 | Every answer refuses to
mount on `http.server` and sends the Stripe callback to a `type: 'api'`
flow whose start node declares the vendor header as `config.signature`.
That is what both entries and the contract say; the case requires the
literal `x-objectstack-signature`, the platform's own header, which a
Stripe answer has no reason to name. Two of three answers on `main` and
one of three on the head also leave out `functions`. |
| 4 | sign-in providers | 0/3 | 0/3 | Every answer names `AuthProvider`,
`auth.zod.ts`, `google` and `github` and stops because the project has
no files; none names `LoginRequestSchema`, the fifth required literal.
Both entries carry it. |
| 5 | `apiMethods`, `/batch`, the recycle bin | 0/3 | 0/3 | Every answer
gives the primitives, the absent `/bulk` route, the derived `restore`
and the recycle-bin restore route; none writes the table name
`sys_recycle_bin`. Both entries carry it. One head answer also names the
import route and not `/batch` (all three `main` answers name `/batch`).
|
| 6 | an import mapping's `applyOn` | 0/3 | 1/3 | Two of three turns on
each tree answer without opening the skill, and fail. The one turn that
opens it passes on the head and fails on `main`, where the entry form
(`sourceField`, `targetField`) was not in the entry. |
| 7 | the metadata list's `?names=` | 3/3 | 3/3 | |
| 8 | `userMessage` on a batch publish | 0/3 | 0/3 | No turn on either
tree opens the skill; every answer builds the per-code translation table
the case forbids. The description that decides whether the skill is
opened is the frontmatter, byte-identical in this PR. |

- **No restoration under ruling 7168461386**: no failing answer on the
head traces to a sentence the cut removed. The literals the failing
answers miss (`x-objectstack-signature`, `LoginRequestSchema`,
`sys_recycle_bin`, `userMessage`) are all carried by the head's entry,
and by `main`'s.
- **Case 5, one observation that is not a regression under the rule**:
one of the three head answers does not name `/batch`. The case fails on
every run of both trees on another literal, so the rule does not read
it; the head's entry names `/batch` in the routes listing and in the
`apiMethods` paragraph. It is reported as seen, one run.
- **Cases 3, 4, 5 and 8 cannot show a regression as they stand**: they
fail on every run of `main`. Cases 3 to 5 fail on a literal a correct
answer need not write, and cases 6 and 8 mostly on the skill not being
opened. The parity rule treats the cases as fixed, so this PR does not
touch them (see Acceptance notes).
- **No extra repeats were run**: no case flips in the direction the rule
reads, and the window is short.

Before the full rounds, the same check that calls no model: of the 27
`must_contain` literals of the 8 cases, the entry carried 24 before and
after, lost 0 and gained 2 (`sourceField`, `targetField`, case 6); 1 is
in neither tree (`/api/v1/meta/object`, which an answer composes from
the route). No `must_not_contain` literal appears in either tree's
entry.

<details><summary>Round records</summary>

- Before round on `2fba8349`: 48 of 48 turns, 2.4 min, exit 0. After
round on `2b912f16`: 48 of 48 turns, 2.6 min, exit 0. No turn timed out.
- Quota: the runner's guard was raised from its default 0.9 to 0.99 for
these two rounds, on the maintainer's answer in the project chat
(2026-12-01 00:30Z, option B of the three put to him: run now past the
0.9 line). Seven-day window as each turn reported it: 0.95 on every turn
of the before round; 0.95 rising to 0.96 during the after round; status
`allowed_warning` throughout, no turn rejected.
- The first attempt, on 2026-11-30, was stopped by the guard at its
default after 4 of 48 turns on each tree (utilization 0.90 and 0.91;
cases 1 and 2 passed once each on both trees). Those stopped rounds ran
on CLI 2.1.332 and are not counted in the table above.

</details>

### Other tests

On tree `d53fb207` (local head `57c7738b`, the same tree as the pushed
head `2b912f16`), under the verify lock (`VERDICT command-exit 0` each):

- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
scripts/platform-catalog.test.ts scripts/skill-map-guards.test.ts` (the
suite that names the ratchet script, and the skill-map guards): `Test
Files 2 passed (2)`, `Tests 57 passed (57)`.
- `pnpm --filter create-objectstack exec vitest run --maxWorkers=2
src/created-summary.test.ts` (the one test file in the tree that names
this skill): `Test Files 1 passed (1)`, `Tests 12 passed (12)`.

No ablation: the diff changes prose and one ledger, no tested behaviour.

## Acceptance notes

Held by a gate, recorded here as it stands in the entry:

- **The heading `## API Methods (Operations)` and the six primitive
names stay inline.** `scripts/check-skill-identifier-liveness.mjs`
registers that section of this file as exhaustive for `ApiMethod` and
requires every member in it. That script is outside this claim's file
surface. So the section became four lines of prose under its old
heading, and the route table went to the routes listing. If the section
should leave too, the registration moves first, in its own change.

Decided here (small, no shipped behaviour), each open to reversal in
review:

- **"No trap is removed unless a publish-time check covers it or it
stays inline" was read as: a declaration or a call that passes and then
answers wrong at run time stays inline.** Inline: the six traps and the
two request contracts under the routes listing. Cut to a pointer, each
loud when hit: a wrong endpoint key (the strict shape refuses it and
names the key to write), the publish gates one by one, the two further
mapping refusals, the restore refusals, the quoted-empty entity tag.
- **Two traps stay inline although a check exists.** Trap 1: the gate
refuses `authRequired: false` without an armed budget, and the entry
carries the form to write, which is what eval case 2 asks for. Trap 5's
walled-posture sentence: its check only warns at save and publish, and a
warning is not a refusal, so the consequence (the form is withheld) and
the declaration that resolves it stay, the standard PR 3 applied to its
own warning-only rules.
- **The endpoint naming table is cut, not moved.** Its two patterns (an
object-scoped action path and a domain action path) are not paths an app
can declare: a declared path lives under the app's own carve-out, and
the endpoint matcher has no path-template syntax. The table taught a
form the publish gate rejects.
- **`AuthProvider` keeps its six members inline** (0.1 KB): a provider
name that is not a member is an authoring mistake the entry can stop
before the contract is opened, and eval case 4 asks for the names.
- **The health routes are cut with no pointer.** Nothing in a stack
declares them, and the HTTP protocol page has no health section, so a
pointer there would be untrue.
- **The entry no longer counts the publish gates.** The published pages
count them differently (four on one, five on another, for the same
checks); the entry says the rejection arrives one gate at a time and
carries its fix.
- **Trap 6 is scoped to the sites where it is true**: "show
`userMessage`, never `message`" is said of a batch publish's
`probes.issues[]` alone, and the flow door's order (`userMessage`, then
`details.innerRefusal`, then `message`) is given beside it. The locale
sentence is said of platform text.
- **A version check opens the first checks**, as in the other router
entries; here it also carries the one upgrade fact that changes what an
old `apis:` block does.
- **Section anchors of the entry changed.** The changeset lists every
anchor that left `SKILL.md` (24) and the five new ones;
`#api-methods-operations` stays. No file in this repository links one of
the old ones.
- **Four lines in the summary above, not six**: the standing order for
this card thread asks for six, and the agent file that binds the dev
fixes four named lines and wins on conflict.
- **Footer form**: this body ends with the single block AGENTS.md
prescribes for a PR body.

Noted, not changed:

- Four eval cases fail on every run of both trees (Eval parity). Case
3's expected answer says an inbound `type: 'api'` flow verifies only the
platform's own signature header, while `main`'s entry and the contract
(`automation/api-trigger-signature.zod.ts`) also give a vendor's HMAC
header declared as `config.signature`, and every answer on both trees
follows the contract. Cases 4 and 5 each require one name
(`LoginRequestSchema`, `sys_recycle_bin`) that a correct answer leaves
out. Case 8 never opens the skill, and case 6 does in one turn of three.
The parity rule treats the cases as fixed and the frontmatter is
byte-identical by order, so this PR touches neither. Carrier: none;
noted for whoever owns the case file and the description.
- `main` moved during the work: PR 4 of this split (objectstack-ai#38795) and a rise
of one `objectstack-data` row merged. `main` is merged in (`2fba8349`, a
plain merge commit); the textual merge was clean and the workspace was
rebuilt before any gate ran.

## Verification

Read first, by risk:

1. `skills/objectstack-api/SKILL.md`, the whole file: is anything a
model needs before opening the contract missing? The risk hunks are `##
Traps` (six items replace most of the old file) and trap 2, which
carries the whole "no handler code" teaching.
2. `.changeset/34770-api-skill-router.md`: the "what left, and what
answers it now" list is the record of every cut.
3. `scripts/check-skills-token-ratchet.mjs`: the one `objectstack-api`
row.

Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints
`ratcheted (authored) 189572 / 189572 (+0)` and
`skills/objectstack-api/SKILL.md 2240 / 2240 (+0)`; `wc -c
skills/objectstack-api/SKILL.md` prints 8986.

Gates, local, each exit code captured before any pipe. The whole derived
list ran on tree `d53fb207` (local head `57c7738b`; the pushed head
`2b912f16` carries the same tree, `main` unmoved at `2fba8349`), after
the merge of `main` and a full rebuild.

<details><summary>Derived families on tree `d53fb207`: 69 derived, 69
run green, 0 NOT MEASURED</summary>

- Reconciliation: `✓ dispatch-gates --ran: 69 derived famil(ies)
accounted for — 69 run, 0 NOT-MEASURED (a DERIVED zero — all 69 recorded
an exit code and none of them is 3).` No STALE TREE warning.
- `node scripts/check-skills-token-ratchet.mjs`: `✓
check-skills-token-ratchet: 61 authored bundle file(s) within their
ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured,
not ratcheted.` (`ratcheted (authored) 189572 / 189572 (+0)`, `bundle
total 294223`); its `--self-test`: `111 cases pass`.
- `pnpm check:dual-build-cjs-loads`: `126 published require entry
point(s) across 74 package(s) load; 2593 emitted CommonJS file(s)
parse`. It reads every package's built `dist/`; a full `pnpm build
--concurrency=2` ran first on the merged tree under the verify lock
(`VERDICT command-exit 0`, 123 tasks).
- `pnpm check:dts-closure`: `123 built package(s) swept - 324/324
declared declaration file(s) present`.
- `pnpm check:skill-links`: `290 relative link(s) in 76 published skill
file(s) resolve; 160 fragment(s) name a real heading under GitHub's slug
rule.`
- `pnpm check:skill-identifier-liveness`: `Leg 1: 517 citation(s) over
76 published file(s) ...; Leg 2: 11 registered exhaustive section(s), 0
ledgered gap(s).`
- `pnpm --filter @objectstack/spec run check:skill-docs`, `pnpm --filter
@objectstack/lint run check:doc-formula-expressions`, `pnpm
check:skill-compatibility`, `check:skill-frame-sync`, `check:role-word`,
`check:corpus-claim-drift`, `check:doc-authoring`,
`check:published-files`, `check:nul-bytes`,
`check:cross-package-test-inputs`, `check:ratchet-remedy-authority`:
exit 0.
- The changeset gates (`check-changeset-no-major`,
`check-empty-changeset`, `check-adr-0087-registration`,
`check:changeset-gate-self-tests`): exit 0. `pnpm
check:pm-dispatch-gates`: exit 0.

</details>

<details><summary>Beside the derived list, on tree `d53fb207`, all exit
0</summary>

- `pnpm --filter @objectstack/spec run check:skill-examples`: `347 prose
examples type-check across 3 surface(s)`. The entry's one block is among
them.
- `pnpm --filter @objectstack/spec run check:skill-refs`: `10 generated
files in sync with packages/spec`.
- `pnpm --filter @objectstack/spec run check:skill-served-sections`: `24
served section(s), each heading exactly once in its file`.
- `pnpm check:doc-anchors`: `1186 internal #fragment link(s) across 368
source file(s) all resolve to a real heading`.
- `pnpm check:published-readme-links`: `566 outbound link(s) across 168
published markdown file(s)`, `99 docs-site page(s) resolved`; the four
pages the entry links are among them.
- `pnpm check:skill-top-level-keys`: exit 0.
- `pnpm --filter @objectstack/spec check:generated` after the merge and
the rebuild: `All 14 generated artifacts are up to date`.
- `node scripts/check-platform-checklist.mjs --changed-from
origin/main`: `0 anchored files in the change set — nothing judged.`
- `node scripts/check-nul-bytes.mjs`: exit 0; a control-byte scan of the
three changed files finds none.

</details>

Not run locally: `test:repo` (CI's).

Base: the router commit was written on a local branch cut from
`f7252bc3` while PR objectstack-ai#38795 held this branch; after objectstack-ai#38795 landed, the
thread branch took `main` at `2fba8349` (merge `840c3aa8`) and the
router commit was cherry-picked onto it as `2b912f16`, whose tree is the
gated tree `d53fb207`. `overlap-check` before the push: origin/main,
objectstack-ai#38797, objectstack-ai#38790 and objectstack-ai#38192 merge cleanly; objectstack-ai#38497 conflicts in the ratchet
file against `main` itself (another skill's row), not this branch's. CI
on the head is the seat's reading.

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

<!-- signed: repo:objectstack@os-steve · os-steve ·
session_01ADHkmSAjFEZHRpRq3WCj6z -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…d to change and held for its whole approval (closedStates, ADR-0162) (objectstack-ai#38810)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9HqHpbnZfMBnSP27W5MzeEY)_

Part of objectstack-ai#37768
Part of objectstack-ai#37766
Part of objectstack-ai#37767

Clause-②: yes (narrowing)
Metadata-protocol: semantic
Skills-docs: follow-up objectstack-ai#38425

**This PR supersedes objectstack-ai#38497** (the approvals trunk
`claude/o5-data-approvals-trunk` → `main`). The trunk took its two
`main` refreshes as squashes, which left its history without `main` and
objectstack-ai#38497 in conflict with `main` again. This branch is the trunk with its
history joined to `main`: it carries every commit on the trunk, and
`main` up to `2fba83493b`. The Part-of lines and the two declarations
above are objectstack-ai#38497's; Clause-② carries the narrowing arm of piece 5
(objectstack-ai#38746, `feat(approvals)!`), which landed on the trunk after objectstack-ai#38497's
body was written. objectstack-ai#38497's description follows unchanged below, under
"The trunk (from objectstack-ai#38497)".

## 维护者速读

- 改了什么:objectstack-ai#38497 的全部内容(单据关闭态锁定 ADR-0162 的 A/B/C 各片、objectstack-ai#37766 各片、审批 objectstack-ai#37767
各块,含第 5 块「审批全程锁单」),改由这个 PR 落到 main;objectstack-ai#38497 由席位关闭。
- 为什么换 PR:主干两次刷新都被 squash 合入,主干和 main 的历史断开,objectstack-ai#38497 又与 main
冲突;这条分支内容等于主干加最新 main,历史里带着 main,所以对 main 是干净的。
- 谁受影响:同 objectstack-ai#38497 下文说明;声明了 `closedStates` 的对象受影响,没声明的照旧。
- 要你做什么:待 battery、L1 与非实现方契约复审之后,由席位交棒。

## How this branch is built

- Trunk head `a5f33621e3` (objectstack-ai#38797, squashed; its tree is `85aea4d1c2`).
- `77e94868d0` merges `8ff2442358`, the gated head objectstack-ai#38797 squashed: same
tree `85aea4d1c2`, no content change; it puts `main` up to `fc198b2847`
into the history.
- `2f344f7b1d` merges `origin/main` at `2fba83493b` (7 commits after
`fc198b2847`) through `scripts/pm/os-regen-merge.sh`: no conflict, and
none of the 7 commits touches a file the trunk's own changes touch.

## Trunk refreshes with `main`, and their records

- objectstack-ai#38791 (`main` at `59faf74c6f`): L1-b ACCEPT 7284982294, contract
review PASS 7285519382, seat record 7285551596; DELIBERATE CORRECTION
declaration 7284894883.
- objectstack-ai#38797 (`main` at `fc198b2847`): L1-b ACCEPT 7289462740, contract
review PASS 7289911344, seat record 7289942965; DELIBERATE CORRECTION
declaration 7289249692.

## Measured on this head

- `scripts/pm/dispatch-gates.mjs` against `main`: 147 derived, 147 run,
0 NOT-MEASURED, all exit 0.
- Regeneration from this tree (`gen:schema`, `gen:docs`,
`gen:liveness-counts`, then `check:generated` and
`check-system-context-census.mjs`): exit 0, and the tree was unchanged
after it.
- Tests and typecheck green: objectql, metadata-protocol,
platform-objects, plugin-approvals, core, service-automation, spec,
runtime; cli tests green; dogfood 500 files / 4295 tests passed.
- A trial merge of this head with `main` at `0fc9eab900` has no
conflict.

## The trunk (from objectstack-ai#38497)

> **Trunk moved (seat repo:objectstack#5, area o5-data).** This PR
replaces objectstack-ai#38421, the same closed-state trunk handed back by seat 2
(clock-out brief 7250342397 on objectstack-ai#34478). The trunk branch is now
`claude/o5-data-approvals-trunk`, cut from
`claude/project-thread-yxheps` at `bfe2df88b` and written only by area
`o5-data`. Since the hand-back it carries objectstack-ai#37766 slice C (PR objectstack-ai#38485,
merged into this trunk as `07f0923c5c` with `--no-ff`). Still to land on
this trunk before it leaves draft: objectstack-ai#37766 slices B and D, objectstack-ai#37767 pieces
3–5, objectstack-ai#37768 slice C (Release-order lines on those cards). The sections
below are objectstack-ai#38421's, for slices A and B of objectstack-ai#37768 and piece 2 of objectstack-ai#37767;
the slices added since are described in their own PRs.

> **Since landed on this trunk** (all in this PR's diff): objectstack-ai#37766 slices
B and D: objectstack-ai#38499, objectstack-ai#38546, objectstack-ai#38562, objectstack-ai#38563; objectstack-ai#37767 pieces 3–5: objectstack-ai#38540
(piece 3), objectstack-ai#38618 (piece 4), objectstack-ai#38746 (piece 5), with the ADR-0162
revision objectstack-ai#38601; objectstack-ai#37768 slice C: objectstack-ai#38516. Two refreshes with `main`:
objectstack-ai#38791, objectstack-ai#38797.

> (objectstack-ai#38497 as written) Clause-②: yes (widening: one new optional
authorable key, `ObjectSchema.closedStates`, and the engine's
enforcement of it)
> (objectstack-ai#38497 as written) Metadata-protocol: added
> (objectstack-ai#38497 as written) Skills-docs: follow-up objectstack-ai#38425

### 维护者速读

-
用户能看到什么变化:对象上写了「哪些状态算已关闭」后,单据一旦进入这些状态(比如发票已付款、已作废),它和它的明细行就不能再被普通用户改、删、挪动明细或加明细,系统返回
409「记录已锁定」;批量操作只要碰到一条已关闭的单据就整批不执行。系统自身的写(汇总重算、审批回写状态)照常落地。没写这个键的对象完全不变。
- 为什么做:单据关闭态锁定(ADR-0162)的第一、二部分:A
定下这个键和编写规则,B(本次新增)让平台真正按它锁单据,应用不用再手写锁定代码,也第一次能挡住「删一条明细」这种以前挡不住的改动。
-
出错会怎样:只影响写了这个新键的对象。最坏情况是该锁的没锁(回到今天的样子),或者某个平台内部写被误锁(已逐条列出并测试)。分支在拒绝文案(C
部分)和审批两张卡落地前不合并,所以不会单独发布。
- 要你做什么:无。有一条覆盖层的发现交座位判断是否要上决策卡(见 Acceptance notes「Overlay」)。

### What changes

#### Slice A — the key (ADR-0162 D1)

Slice A of objectstack-ai#37768 (ADR-0162 D1, the key), on the card's trunk branch.
Slices B (the engine's judgement, D2–D7, D10) and C (the refusal, D8)
land on this same branch; it does not merge before the card's
`Release-order` line is met, so the key is never published without its
enforcement (ADR-0078, ADR-0162 D10).

**Spec (`packages/spec`)**
- `ObjectSchema.closedStates`: optional map from a field of the object
to the list of that field's values that close a record, e.g. `{ status:
['paid', 'void'], approval_status: ['approved'] }`. The record is
guarded against a `__proto__` key like `fields`. No default, so no
parsed object grows a key. TSDoc and `.describe()` state the contract
D1–D5 give.
- `refuseDishonestClosedStates` (`src/data/closed-states.ts`, outside
the barrel, the `stage-field-kinds.ts` precedent), called from the
object's `superRefine`. One located `custom` issue each, at
`['closedStates', FIELD]` or `['closedStates', FIELD, i]`: a key naming
no field of the object; a field that is not a single-value `select`
(another type, `radio` included, or `multiple: true`); a select with no
inline `options` (a `picklist`-backed one); an empty list; a value that
is not one of the field's options; a repeated value. Because the object
document is judged whole, the same refusals cover removing or retyping a
named field and removing a listed option: the next version leaves a
declaration that names what the edit took away.
- Studio object form row (Advanced section, JSON row beside
`uiReadonlyWhen`).
- Liveness row `object.closedStates`: **`planned`**, evidence
`closed-states.ts#refuseDishonestClosedStates` (the refusals, live at
parse) — the `enable.aiReadable` precedent. It turns `live`, with its
runtime proof, in slice B: nothing on this branch reads the key at
runtime yet. See Acceptance notes.
- Regenerated: reference docs
(`content/docs/references/data/object.mdx`,
`packages/spec/docs/references/**`), the authorable-surface record
(`data/Object:closedStates`), liveness state counts (object: planned 1 →
2).

**Other packages**
- `metadata-core` FLS scrub: `closedStates` classified as a map keyed by
this object's fields (`recordOf(keep, true)`): an entry whose field is
denied to the caller is left out of the served definition, an emptied
map is deleted, and the values (option codes) are literals, never read
as references.
- `platform-objects`: the form row's label and help text authored in all
ten translated metadata-forms locales (ar, de, es-ES, fr, ja-JP, ko,
pt-BR, ru, zh-CN, zh-Hant), `en` regenerated by `check-i18n-bundles
--write`; two derived leaf-count pins moved (+2 leaves in `advanced`, +1
translated label).
- Three changesets: `@objectstack/spec` minor,
`@objectstack/metadata-core` patch, `@objectstack/platform-objects`
patch (the `uiReadonlyWhen` precedent).

#### Slice B — the engine's judgement (ADR-0162 D2–D7, D10)

**Engine (`packages/objectql`)**
- `closed-state-lock.ts` (new): the one judgement every write door
calls. A record is closed when its STORED row holds a listed value (D2);
its unit is the record plus its direct `master_detail` lines, and a
junction row is a line of both masters (D3). Every write a system
context does not make is bound, and a write with no context is bound
(D5). The refusal is `409 RECORD_LOCKED` with `reason` (`record_closed`
· `master_closed` · `cascade_reaches_closed` · `cannot_judge`),
`object`, `blockingObject`, `lockReason: 'closed_state'`; the message
names no id and no state value. D8's sentences are slice C.
- Wired doors: by-id update and delete (`engine-update.ts`,
`engine-delete-and-aggregate.ts`, judged against the prior row the write
already reads); predicate update and delete (refused whole before any
row is written: one existence probe on the record, and for lines one
semi-join probe where the store compiles the composed `ReadableIds`
leaf, else the write's one read of its matched rows under
`MAX_BULK_PER_ROW_HOOK_ROWS`); insert and insertMany (a line under a
closed master; partial-mode insertMany is refused whole); the cascade
set where it is planned (`engine-cascade-planning.ts`, D6); restore
(`recycle-bin/restore.ts`, D7).
- Placement (D10): after the middleware gates, before the before-hooks.
A master the write NAMES goes through the caller's own read door first
(`masterDetailHeadersCallerReads`), so an unreadable master answers as
before and the lock never confirms that a record the caller cannot read
exists; a STORED master is read by the engine.
- `closed-state-values.ts` (new): `closedValuesOf`, split out so the
registry does not import the write path.

**Registry fold (seat review S1, `registry-closed-state-fold.ts`, new)**
- An extension that redeclares a field the served `closedStates` names,
and removes it, retypes it, makes it multi-value or narrows its options
past a listed value (or leaves it with no inline options), has THAT
redeclaration refused: the field stands as the fold had it, the fold
logs it once naming the package, and the rest of the extension lands.
One test per case. The four guarantee sentences of slice A stand as
written.
- A tenant overlay (the fold's base) may ADD closed values; the served
declaration is the package's list with the overlay's added, and a field
the package's list names keeps the package's definition where the
overlay broke it.

**Other**
- Liveness `object.closedStates` → **`live`**, evidence the engine's
reads and the dogfood suite; state counts regenerated.
- Error-code ledger: `RECORD_LOCKED` registered under
`@objectstack/objectql` (third emitter beside plugin-approvals and
rest). This is a D8 ledger line pulled forward because B already throws
the code; C keeps the sentences.
- Changeset `@objectstack/objectql` minor; the spec changeset gains the
ledger line.

**After the seat's delta review (7249320091, PASS), head 8e95b36**
- S2: every master check is asked of the store: one existence probe per
chunk of ids with the closed predicate in its `where` and `fields:
['id']` (`anyClosedAmong`), never a read of state columns tested in
process. The cascade set is judged the same way: one probe per chunk for
its own state, and for its lines the predicate door's semi-join where
`lineProbeServes` says the store runs it; only a store that cannot keeps
the read of the lines' keys, then one probe of their masters (D4's
stated fallback). Pinned per shape by `a cascade that reaches a line of
a closed record is refused …` (probe store: no read of the master;
no-probe store: one probe carrying the predicate, `fields: ['id']`).
- N2: where the fold restores the package's field over an overlay that
broke it, the overlay's added closed values for that field are served
only where the package's field declares them.
- CI on a0d9493: the system-context census row for
`boundByClosedStates` (row 29g on
`content/docs/permissions/system-context.mdx`, register regenerated).
The local census had passed before the commit because it walks tracked
files only.
- Carried to slice C by the seat: tests for the assignment-rule and
approval-mirror system writes, a plugin-security-level D10 test, and the
API names in the developer `message`.

#### Engine-derived writes (Done-when list)

| Write | Context it runs in | What the lock does | Test |
|---|---|---|---|
| Referential clear of a deleted record's references (`set_null`) |
system (reference-cleanup elevates; the clear also carries the
referential-clear marker) | lands: exactly the cleared field | `a
referential clear lands on a closed record` |
| Recycle-bin relink on restore | caller, carrying
`REFERENTIAL_CLEAR_OPTION` | lands (a bare reference restore, the
clear's inverse) | `the recycle-bin relink puts a cleared reference back
on a closed record, for the caller` |
| Roll-up summary recompute | `{ ...caller, isSystem: true }` | lands |
`the summary recompute writes the closed invoice in a system context,
and lands` |
| Cascade legs of a planned delete | caller | judged ONCE, at the
planned set (D6); legs are not judged again | `a delete whose cascade
reaches a closed record removes no row`, with and without transactions |
| Change Owner (`changeRecordsOwner`) | **caller** | bound: each closed
record (and line) is a `RECORD_LOCKED` failure, the open ones move |
Change Owner block (4 tests) |
| Banned-user hand-over (`transferUserAssignedWork`) | **caller** |
bound: closed records stay with the user, counted as failures | `the
hand-over of a user's work leaves the closed records …` |
| Assignment rules | system | lands | not added here (system, unbound by
D5) |
| Approval status mirror | system, attributed | lands | measured below |

The two writes that run in the CALLER's context (Change Owner and the
hand-over) are bound, not exempted, and are reported to the seat as the
card asks.

#### Measured: the approval mirror and the request's finalisation

They do **not** share one unit of work. `ApprovalService` finalises the
request (`engine.update('sys_approval_request', …, { context: SYSTEM_CTX
})`, `approval-service.ts` ~6305) and then calls `mirrorStatusField`
(~6312), which issues its own `engine.update` with no transaction handle
and swallows a failure into a warning (`approval-service.ts`
~4989–5015). The same order holds at recall, reject, return and the
dead-run abandon (~7110, ~7726, ~7768, ~9810). A mirror that fails
leaves a finalised request and an unmirrored record. The lock does not
change this: the mirror is a system write and lands on a closed record.

#### Hook-supplied master (N14)

A master a `beforeInsert` / `beforeUpdate` hook supplies is **not**
judged: the lock runs before the before-hooks (D10), so it judges the
master the caller named. Pinned by `a master a beforeInsert hook
supplies is not judged by the lock`.

### Why

ADR-0162 (merged as `972114df`), Execution item 1, on the maintainer's
rulings recorded on objectstack-ai#32004 (7073676422) and objectstack-ai#36253 (7200732942,
7201405662, 7205949718). Apps that must freeze a decided document
hand-code it today and cannot guard the removal of a line at all.

### Tests

**Slice B**
- `packages/qa/dogfood/test/closed-state-lock.test.ts` (new, 69): on
SQLite in two store shapes, each pinned, a store that runs the line
probe and one that declares `readableIdsLeaf: false` (the MongoDB /
OData shape). Every row of D4's table, for a record and for a line,
single-row and many-row, on both shapes; the read shape of each (probe:
one statement on the line table; no probe: the matched rows plus one
read of their masters); the three cannot-judge cases (a master named by
something that is not one id, a state read that fails, a many-row line
write past the per-row ceiling with 10,001 seeded lines, with the
probe-store control that lands); the closing write lands whole and the
next is refused; no context refused; system writes, deletes and
restores; the cascade removes no row with and without transactions;
restore; engine-derived writes; a refused write runs no before-hook; an
object that declares nothing reads nothing extra; Change Owner and the
hand-over.
- `packages/objectql/src/registry-closed-state-fold.test.ts` (new, 13):
the four extension breaches each refused with the rest of the extension
applied, two controls; overlay may add, may add to an object with none,
may not shorten (key left out, fewer values), may not break a named
field, relabel control, and an overlay's added value for a field the
package's version of which is restored is not served (N2). Measured:
with the two guards disabled, 7 of the first 12 fail.

**Slice A**
- `packages/spec/src/data/closed-states.test.ts` (new, 22 cases): the
ADR example parses and keeps its value; absent stays absent; no tie to a
`state_machine` rule either way; `create()` keeps it; each refusal
above, one located issue each, with its message's subject; one issue per
offending entry with a sound entry untouched; removing the field,
retyping it, making it multi-value and removing a listed option each
refused, with the control that removing an unlisted option lands; the
save and publish door (`getMetadataTypeSchema('object')`) and the stack
door refuse at the same path; a line object needs no declaration and may
declare its own.
- `metadata-core` `object-schema-fls-references.test.ts`: a denied
field's entry dropped and the readable one kept; a map left empty
deleted; CONTROL: a value spelled like the denied field is served as
written.
- Moved pins, each with a history line:
`compose-stacks-merge-collection-refusal.test.ts` and
`compose-stacks-collection-pipe-arm.test.ts` — `closedStates` is an
object-level collection, so `composeStacks` `objectConflict: 'merge'`
refuses two stacks that declare it differently (new `it.each` row), and
it is the first collection key on the real shape behind a preprocess
stage, which the landed reading carries and the in-only reading does not
(the invariance case now pins exactly that);
`protocol.meta-types-degenerate-derivation.test.ts` object 53 → 54
top-level properties; the two `platform-objects` echo-decision counts.

<details><summary>Slice A local runs (head 5d8b45b)</summary>

- `pnpm --filter @objectstack/spec test`: 913/915 files on the first
run; the two red files were the composeStacks pins above, re-run green
after the move (92/92).
- `pnpm --filter @objectstack/metadata-core --filter
@objectstack/platform-objects test`: 29/29 files, 1121 tests; 130/130
files, 2218 tests.
- `pnpm --filter @objectstack/metadata-protocol exec vitest run
src/protocol.meta-types-degenerate-derivation.test.ts`: 18/18.
- `typecheck` of spec, metadata-core, platform-objects: exit 0.
- `pnpm --filter @objectstack/spec check:generated`: all artifacts up to
date (after `--fix` rebuilt the dist; it wrote nothing).
- `pnpm check:i18n`: OK, all bundles in sync.
- `node scripts/pm/dispatch-gates.mjs --ran`: 122 derived, 120 run,
every one exit 0; 2 NOT MEASURED (exit 3, prerequisite: other packages'
builds) — `check:skill-examples` (client SDK dist) and
`check:dual-build-cjs-loads` (a full build); CI runs both.
- `node scripts/pm/overlap-check.mjs`: clean against `origin/main`, no
open PR shares a file.
- No full dogfood battery: no `!` in the title and no `(narrowing)` arm.

</details>

<details><summary>Slice B local runs</summary>

On 8e95b36: objectql full suite 644/644 files, 14559/14559 tests;
dogfood `closed-state-lock.test.ts` 69/69 on a rebuilt dist; fold 13/13;
typecheck objectql and dogfood, `check:facade-delegation-only`,
`check:system-context-census` green.

Head 1f399d9.

- `pnpm --filter @objectstack/objectql exec vitest run`: 643/644 files,
14557/14558 tests on the first run; the red file was
`federated-injected-column-readers.test.ts`, which asks every engine use
of `isFederatedObject()` for a disposition: the line probe's
federated-master decline got its row (`exempt`, reads no row) and the
file re-ran green (5/5).
- `pnpm --filter @objectstack/dogfood exec vitest run
test/closed-state-lock.test.ts` against a rebuilt objectql dist: 67/67.
- `pnpm --filter @objectstack/objectql exec vitest run
src/registry-closed-state-fold.test.ts`: 12/12; with the two fold guards
disabled, 7 of 12 fail.
- `typecheck` of objectql (with `check:test-typecheck`) and dogfood:
exit 0.
- `node scripts/pm/dispatch-gates.mjs --ran`: 101 derived, 101 run,
every one recorded `exit 0`. First run: 94 green, 7 red, each re-run
after its fix: five spec dist-reading gates and `check:generated`
answered exit 3 / 1 on a spec dist older than the ledger edit (green
after `pnpm --filter @objectstack/spec build`);
`check:facade-delegation-only` was red because `engine.ts` grew 7 lines
past its ceiling (the new host members now share existing lines, 6856 ≤
6857).
- `pnpm check:system-context-census`: OK (the lock reads `isSystem`
through `boundByClosedStates`, inside the census).
- `node scripts/pm/overlap-check.mjs`: clean against `origin/main`, no
open PR shares a file.
- No full dogfood battery: no `!` in the title and no `(narrowing)` arm.

</details>

Slice A CI on 5d8b45b: 65 checks passed, 11 skipped, none failed.


### Acceptance notes

- **Overlay (card Done-when, for the seat).** Verified and pinned: an
overlay may ADD `closedStates`, and before this branch it already could
(an overlay body is a full object document, and the fold serves it as
the base), so a subscriber's admin can freeze records of a packaged
object in states the package did not close. Before the guard an overlay
could also SHORTEN the package's list (leave the key out or list fewer
values), which unlocked what the package locks; it no longer can.
Whether "may add" stays is a product question: if it changes what a
subscriber may do to a packaged document, it goes back to the seat as a
decision card, as the card says. The pin is `may ADD: an overlay that
declares closed values of its own is served with them`.
- **The fold "refuses" by keeping the field, not by failing
registration.** An extension is a separate package that may load in any
order; failing its whole registration over one field would take its
other objects and fields down with it. The redeclaration of the named
field is dropped, the fold logs it once with the package id, and the
rest applies.
- **D10 gate placement** is proven in the engine by order (the lock runs
inside the write after the middleware chain and before the before-hooks,
pinned by `a refused write runs no before-phase hook`); no
plugin-security-level test was added for "a caller denied the object
gets the same answer on a closed record".
- **Liveness (slice A: `planned`; slice B: `live`)** (confirmed by the
seat, claim revision 7248339226). The claim's file surface names "the
liveness ledger row with its runtime proof (ADR-0054)". On this slice
there is no runtime reader to prove: the engine's judgement is slice B.
A `live` row now would cite a consumer that does not exist. Slice A set
the row `planned`; slice B flips it to `live` with the engine reads and
the dogfood suite as evidence.
- **Narrow readings of D1, decided here (small, listed for the seat):**
`radio` is refused (D1 says `select`); a `picklist`-backed select is
refused because its options are not on the object and this is the one
door every save passes (the `stageField` precedent); an empty map
`closedStates: {}` is accepted and closes nothing (D1 refuses an empty
list, not an empty map). "Stored" needs no check of its own: a computed
value is a `formula` field, never a `select`.
- **Publish door.** The removal and retype refusals ride the object's
whole-document parse, which the save and publish door runs (pinned at
`getMetadataTypeSchema('object')`). A field removed through a tool that
rewrites the object document reaches the same parse.
- **Not in this slice (the card's other Done-when lines):** the overlay
question moved to slice B (claim revision 7248339226) and is answered
above. The `skills/**` follow-up is objectstack-ai#38425; the docs card (item 5) and
an eval that exercises a declaration are owed by the card, named here as
the card asks.
- The Metadata-protocol line was `added` on objectstack-ai#38497, the card's own value
for the key (the seat's claim revision 7248339226). This PR declares
`semantic`: it also carries objectstack-ai#38746, whose changeset
`.changeset/37767-hold.md` declares `Metadata-protocol: semantic` (a
record that declares `closedStates` is now held for its whole approval,
with no change to what an author writes), and AGENTS.md takes the
strongest of several kinds, `narrowed` over `semantic` over `added`.
- Branch is the trunk `claude/o5-data-approvals-trunk` (cut from seat
2's `claude/project-thread-yxheps`), not `claude/issue-37768-*`.

### Verification

Two-minute check: `pnpm --filter @objectstack/spec exec vitest run
src/data/closed-states.test.ts` — expect 22 passed; `pnpm --filter
@objectstack/objectql exec vitest run
src/registry-closed-state-fold.test.ts` — expect 13 passed; after `pnpm
--filter @objectstack/objectql build`, `pnpm --filter
@objectstack/dogfood exec vitest run test/closed-state-lock.test.ts` —
expect 69 passed.

### 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 (CI).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request (the card's trunk branch).
- [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.

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

https://claude.ai/code/session_01ADHkmPpwJymVUdp5AnRPBq

<!-- signed: repo:objectstack@os-steve · os-steve ·
session_01ADHkmSAjFEZHRpRq3WCj6z -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:ai protocol:data size/xl tests 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.

3 participants