Repository navigation
feat(spec,ui): an object declares when a whole record is read-only by hand (object-level uiReadonlyWhen) - #38169
Conversation
… hand (object-level uiReadonlyWhen) WIP: spec key, console fold, MCP describe, FLS scrub, lint slot. Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
… regenerated references Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
… describe Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…tems, edit lock, grid and kanban Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…ck key Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…refix Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…uiReadonlyWhen leaves Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…en (52 -> 53) Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…ject-ui-readonly-when
📓 Docs Drift CheckThis PR changes 6 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 187 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 41f6f29da027d2570b0d4cc368468466d812a27b && git checkout 41f6f29da027d2570b0d4cc368468466d812a27b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 73ec085afa2f9689ef96263a9c25b82cde6fda47 b012f9b6094cfc372f46c5a64cbecc127b733524 && git checkout -B drift-repro 73ec085afa2f9689ef96263a9c25b82cde6fda47 && git merge --no-ff b012f9b6094cfc372f46c5a64cbecc127b733524
node scripts/docs-audit/affected-docs.mjs --json 73ec085afa2f9689ef96263a9c25b82cde6fda47
|
…follows the object lock (ruling Q1 = B) Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…rences name the two counting spellings Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head 696c37e · 2026-11-28T07:47Z The lane seat runs the owed CONTRACT_REVIEW_TIER review through an isolated at-tier subagent. |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract reviewServed-tier: Inputs read: card #37402 body and all six comments (rulings 7235326611 included), the governing ruling 7180466652 on #36806, PR #38169 body and file list (73 files), the net diff against the merge base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
S1 (should-fix) — "A create is not judged" does not hold in the wizard's final-submit gate. N1 (nit) — the object describe lists "the line-item grid" among locked surfaces without saying line rows follow the CHILD object's lock; carry with the ③ escalation. N2 (nit) — the N3 (nit) — No must-fix found. S1 is open on this head and earns a delta review of its fix. Implemented-by: VERDICT: PASS |
…and lock on a create (L2 S1) Also: the @object-ui/core changeset names the prerelease the helpers first shipped in, and describe_object says a field's own uiReadonlyWhen may itself lock it. Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…ls/list byte ceiling Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
|
Relay Merge-queue dequeue of #38169 — cause
The relay sends |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Dequeued · 2026-11-28T11:34Z · head That receipt read this PR's CI as "still in progress". It went on to fail on this PR's own diff:
The seat dequeued the re-queued entry (relay |
…ema.uiReadonlyWhen Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46140292866 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head b012f9b · 2026-11-28T12:13Z The lane seat runs the owed CONTRACT_REVIEW_TIER delta review (the conformance-ledger row) through an isolated at-tier subagent. |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract reviewServed-tier: Delta round on the full record 7238240401 (head Inputs read:
① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
The changed
The file exists, which is all N5 (nit) — the row's unchanged opening clause says the evaluator is "called directly by the edit dialog and the grid cell, and through the one verdict fieldReadOnlyByHand … everywhere else". The object grid's cell goes through N6 (nit) — the row id stays Everything else — unchanged since S1: closed N1 (nit) — the object describe lists "the line-item grid" without saying line rows follow the child object's lock. Unchanged; carried by #38249. N2: closed N3: closed N4 (nit) — the No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 L1: ACCEPT · head Seat checks
Landing: non-governed, ≤3000 lines, |
…r their amount and subtitle (objectstack-ai#38214) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoAvhxsnErQnmY8cTbgC3beU)_ Fixes objectstack-ai#37891 repo:objectstack#3 · os-tesla · session_01L9qibwy7XB37e8e1P6jRJ3 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:在手机上看列表和相关列表时,卡片按对象声明的「最重要字段」显示:右下角是其中第一个金额(订单明细显示这一行的合计,不再是单价),副标题依次显示后面最多三个字段,数字类带名称,例如「数量 2 · 单价 ¥6,000.00 · 折扣 10.00%」;电脑上的宽表格不变。 - 为什么做:HotCRM 订单明细的手机卡片只写「1 · 2」、右下角是单价,要改只能动宽表格的列顺序;你 11 月 28 日选了「按对象的最重要字段」,不加新配置。 - 出错会怎样:声明了「最重要字段」的对象,手机卡片都会跟着变(事先粗量约 222 处里 180 处,大多在 HotCRM),哪个对象读着不对,调它的「最重要字段」顺序即可;整个改动可以直接撤回。 - 要你做什么:无。 ## What changes Governing ruling: the maintainer chose option A on objectstack-ai#37891 (ruling record 7235312203, 2026-11-28T06:25Z, anchor 7235198146): phone cards follow the object's `highlightFields` (ADR-0085 §1), no new key, no line-number title prefix. Built as the claim (7235321485) and its surface amendment (seat, 2026-11-28T06:31Z) say. - `ui/packages/plugin-grid/src/ObjectGrid.tsx` (`buildMobileCardRenderer`): when the object declares `highlightFields`, the card body is that list, in order (title excluded): the amount is the first entry that draws as money (objectstack-ai#37890's `drawsAsMoney`), the subtitle the next three, skipping the status field and the title formula's reads, empty values dropped (0 is a value), and a number, currency or percent part (a formula or summary by its value type) is drawn under its field label (`grid-card-subtitle-label`). A highlighted field the view shows is drawn through its column draft; one it does not show through the synthesized draft. Masked fields stay masked: never the amount, never a part. An object without `highlightFields` keeps the column-order card (two unlabelled parts). - `ui/packages/plugin-grid/src/objectGridGenerateColumns.tsx`: the synthesized path's per-field draft is now its own callback, `synthesizeFieldColumn` (same body: renderer, translated label, FLS), which `generateColumns` calls and the card reuses. No behaviour change for columns. - Fetches, beside the declared name field and through the same gates (declared, FLS-readable, not draft-only/withheld/redacted), on every viewport so a width change never refetches: - `ui/packages/plugin-grid/src/objectGridRowLoad.ts` `getSelectFields` (the grid's own fetch); - `ui/packages/plugin-list/src/ListView.tsx` harvest (the list page's fetch); - `ui/packages/plugin-detail/src/RelatedList.tsx` `selectFields` (the related list's fetch; derived-columns lists still send no projection). - Changeset: `@object-ui/plugin-grid`, `@object-ui/plugin-list`, `@object-ui/plugin-detail` patch, naming the phone-card change. ## Tests - `plugin-grid` `phoneCardAmount-34615.test.tsx`, new top-level describe (HotCRM order-line fixture at 390 px): amount = highlighted total (CN¥10,800.00) though the table shows the unit price first; subtitle `Quantity 2 · Sales Price CN¥6,000.00 · Discount % 10.00%`; a text part drawn bare; an empty part dropped; a highlighted field no column shows is drawn and is in the grid's `$select`; CONTROL no `highlightFields` keeps `1 · 2` and the unit price, no labels; CONTROL a `password` field first in `highlightFields` is neither amount nor part and its value is never printed. - `plugin-list` `ListView.harness.test.tsx`, new top-level describe: a highlighted field no column shows is in `$select` and not drawn; CONTROL no `highlightFields` sends the old projection. - `plugin-detail` `RelatedList.selectFls-10186.test.tsx`, new top-level describe: a declared, readable highlighted field is requested, an undeclared one never; an FLS-denied one is not requested; CONTROL no `highlightFields` keeps the projection. ## Acceptance notes - The fetches ask for `highlightFields` on desktop too (a few extra columns per row), as they already ask for the name field, so crossing the 768 px breakpoint never refetches. - The status chip is unchanged: drawn when a column shows the status field; the status field is never a subtitle part. - The related list's non-enlarged mobile gallery (`object-gallery`) path is untouched (objectstack-ai#37008 owns its labels). - No "×" joiner and no title prefix, by the ruling. The HotCRM `highlightFields` re-order (order line, quote line, and a review of its other objects) follows in its own card after this lands, per the anchor's 裁后执行. - Measured before the ruling (anchor 7235198146, static simulation): 180 of 222 shipped phone-card surfaces change, 134 of 138 on HotCRM; platform objects only gain a third part. ## Verification Two-minute check: `cd ui && pnpm exec vitest run packages/plugin-grid/src/__tests__/phoneCardAmount-34615.test.tsx -t highlightFields`, expect the objectstack#37891 describe green (7 cases). First files to read (by risk): `ui/packages/plugin-grid/src/ObjectGrid.tsx` (the card body and the label rule); `ui/packages/plugin-grid/src/objectGridGenerateColumns.tsx` (the extracted draft, must be byte-equivalent for columns); `ui/packages/plugin-detail/src/RelatedList.tsx` (the projection arm and its gates). Verification record: every reading below is on `objectstack-ai/objectstack`, base `origin/main` 4f7aa88, through `os-verify-lock.sh`, after rebuilding the closure (`turbo run build --filter='@object-ui/plugin-grid^...' --filter='@object-ui/plugin-list^...' --filter='@object-ui/plugin-detail^...'`, 58/58). <details><summary>Tests</summary> - The three changed test files at 32340f2+: `Test Files 3 passed (3)`, `Tests 168 passed (168)`; the plugin-grid file alone at the fixture fix: `Tests 18 passed (18)`. - Full suites `pnpm --dir ui exec vitest run packages/plugin-grid/ packages/plugin-list/ packages/plugin-detail/` at 5f2eee0 (head 512ad74 changes only test docblock comments): `Test Files 933 passed | 1 skipped (934)`, `Tests 8897 passed | 18 skipped (8915)`, VERDICT command-exit 0. - `type-check` in plugin-grid, plugin-list, plugin-detail: exit 0 each. </details> <details><summary>Shown red without the fix (ablation, restored to HEAD)</summary> - The five source files restored from base 4f7aa88 (tree only; `objectstack#37891` marker count 0 on disk in each), the three test files run: `Tests 9 failed | 159 passed (168)`. Red: all six grid cases with `highlightFields` (the masked control too, on its amount half: the base tree shows the unit price), both RelatedList projection cases, the ListView projection case. Green: the three no-`highlightFields` controls. - Restored with `git checkout HEAD -- PATHS`: marker counts back (2/1/1/1/1), `git diff HEAD` empty, each blob equal to its HEAD blob. </details> <details><summary>Gates</summary> `node scripts/pm/dispatch-gates.mjs --commands` at 512ad74: 39 families derived, all 39 run locally, all exit 0 (two first hit a 240 s per-gate timeout, exit 124, and were re-run to exit 0: `pnpm check:query-options-erasure`, `pnpm --dir ui exec vitest run scripts/` = 172 files passed). `--ran`: `39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED`. `overlap-check` before each push: VERDICT clean, exit 0 (objectstack-ai#38169 and objectstack-ai#37924 share files and merge cleanly). PR check-runs at 512ad74 (`pr-state`): 42 success, 13 expected skip, 0 failed, 0 pending; mergeable_state clean. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibwy7XB37e8e1P6jRJ3 --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibwy7XB37e8e1P6jRJ3)_ <!-- signed: repo:objectstack#3 · os-tesla · session_01L9qibwy7XB37e8e1P6jRJ3 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…d each whole column when it queries itself (objectstack-ai#38234) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoEynsd5XL1JYxPkwhkywADp)_ Fixes objectstack-ai#37844 repo:objectstack#3 · os-tesla · session_01L9qibwxBy3QieJMqJbJtTk Clause-②: no Metadata-protocol: none ## 维护者速读 - 泳道看板只拿到一部分记录时(列表视图交来的一页,或看板自己按 `limit` 读满一窗),每条泳道的计数只是已加载卡片数,带 `+`;看板自己读数时连列计数也是这样。现在发一次「列字段 × 泳道字段」两键分组读,泳道计数(自查询看板还有列计数)都显示整数。 - 接在 objectstack-ai#37326(泳道看板的列统计)和 objectstack-ai#37327(宿主一页的整列计数)之后,补上泳道这一维。 - 只多一次分组读,筛选、搜索与现有的分组读同源;已经拿到全部记录的看板不发;数据源不支持分组读、被拒、被截断时照旧带 `+`。不改数据和配置,可以直接撤回。 - 无 ## What changes - `ui/packages/plugin-kanban/src/ObjectKanban.tsx`: the swimlane read. On a board drawn in swimlanes (`swimlaneField`, or `grouping.fields[0]`) that holds a window of its query, one `queryGroupHeaders` read with `groupBy: [laneField, swimlaneField]` and `COUNT(*)`, compiled by the existing `compileLaneReadQuery` (same `where`, `search`, `searchFields` as the lane read), plus the second key. "Holds a window": a board that queries itself whose fetch filled its `$top` (`countsAreWindowed`), or a board handed one page (`hostLaneRead`) once the lane read's counts add up to more records than the board holds. The answer is folded twice with `readLaneCounts`: by the swimlane key into `swimlaneCounts` (the no-value group under `''`), and by the lane key into the column counts of a board that queries itself (a board handed a page keeps the lane read's). A cut or refused answer folds to `null`. - `ui/packages/plugin-kanban/src/KanbanImpl.tsx`: a `swimlaneCounts` prop. A swimlane row writes its whole count from it (`swimlaneRowCount`, read the way `wholeLaneCount` reads a column), and falls back to today's cards-plus-`+` (`swimlaneCountIsWhole`) where it gives none. The no-value row reads the `''` group; a row keyed `''` (a stored empty text) shares that group and keeps the fallback. - `ui/packages/plugin-kanban/src/KanbanBoardCore.tsx`: passes `swimlaneCounts` through, a package-internal prop like `laneCounts`. - `patch` changeset for `@object-ui/plugin-kanban`. No new export, spec key or host prop. Cells draw no new figure (claim: A1). ## Tests `ui/packages/plugin-kanban/src/ObjectKanban.swimlaneStatistic-37326.test.tsx` (24 deals: open 20, won 4; north 12, south 12). The rig's grouped door now groups by every `groupBy` key and can cut its answer. - (c) a page handed in (3 north, 1 south on the page): the rows read `12` and `12`, not `3+` and `1+`; the reads are the lane read, then one `{ groupBy: ['stage', 'region'], aggregations: [{ function: 'count', alias: 'count' }] }`; no `find`. - (d) CONTROL, the page holds every record: bare counts, one read (the lane read), no swimlane read. - (f) CONTROL, a board that queries itself and holds every record: no grouped read at all. - New describe, a board that queries itself through `limit: 10`: rows `12`/`12` and columns `20`/`4` from one two-key read, one `find`; under the board's own filter (`amount >= 2`) rows `10`/`10`, columns `18`/`2`; CONTROL no door / refused / cut keep `5+`/`5+` and `10+`/`0+`; CONTROL a window the query does not fill (`limit: 50`) asks nothing; CONTROL a handed page whose lane read is cut asks no swimlane read and keeps `3+`/`1+`. <details><summary>Readings (head c302aa2, base origin/main f294277)</summary> - Premise at f294277 (probe on the objectstack-ai#37326 rig, kept in the project at `/mnt/project-files/card-37844/`, not in this PR): a board that queries itself through `limit: 10` wrote columns `10+`/`0+`, rows `5+`/`5+`, and asked no grouped read; a handed page wrote columns `20`/`4` and rows `3+`/`1+` from one read grouped by `stage` alone; cells draw cards only. - Real backend (scratch test, not in this PR, kept at `/mnt/project-files/card-37844/real-backend-two-key-probe.test.ts`): `RestServer`'s `POST /api/v1/data/:object/query` over `ObjectQL` + `SqlDriver` (better-sqlite3), 26 deals, the query exactly as the board compiles it. `200`, `records: [open/null 2, open/north 10, open/south 10, won/north 2, won/south 2]`, `hasMore: false`. With `where: { amount: { $gte: 2 } }`: open/null 2, open/north 9, open/south 9, won/north 1, won/south 1. With `search: 'won'`: won/north 2, won/south 2. With `OS_DATA_DEFAULT_PAGE_SIZE=3`: 3 groups and `hasMore: true`, which the board reads as no counts. Folded as the board folds it: columns open 22, won 4; rows no-value 2, north 12, south 12. - Ablations on the committed fix through `scripts/ablation-replace.mjs`, each restored to blob == HEAD with `git diff HEAD` empty: - `swimlaneCounts={swimlaneCounts}` → `swimlaneCounts={undefined}`: `Tests 3 failed | 15 passed (18)`, (c) and the two self-window pins; - `laneCounts={boardLaneCounts}` → `laneCounts={hostLaneCounts}`: `Tests 2 failed | 16 passed (18)`, the two self-window column pins. - `pnpm --filter @object-ui/plugin-kanban type-check` exit 0; `pnpm --filter @object-ui/plugin-kanban test`: `Test Files 91 passed (91)`, `Tests 621 passed (621)`; every test file outside the package that reads `ObjectKanban.tsx`, `KanbanImpl.tsx`, `KanbanBoardCore.tsx` or `KanbanLaneStatistic.ts` off disk, plus the app-shell kanban rig: `Test Files 19 passed (19)`, `Tests 642 passed (642)`. - eslint on the four changed source and test files: 0 errors. - `overlap-check` before the first push: clean against origin/main and objectstack-ai#38169 (shares `ObjectKanban.tsx`). - Derived local gates: see Acceptance notes. </details> ## Acceptance notes - Scope is the claim's: swimlane row counts on a windowed swimlane board, and on a board that queries itself its column counts too, from one two-key read. Cells draw no new figure (A1); a "N not loaded" cell line would be new UI with new i18n keys and is not built here. objectstack-ai#37517's lane-foot "Load more" and objectstack-ai#38120's text-field lanes are untouched. - On the board handed a page, the swimlane read follows the lane read: the board knows it holds a window only once that read's counts exceed its cards. A refused or cut lane read asks no swimlane read; the two-key read would be refused or cut the same way. - A swimlane whose records all sit outside the window draws no row (as today); its count is in the answer but no row reads it. - `KanbanLaneStatistic.ts` was in the claimed surface and needed no change: `compileLaneReadQuery` builds the query, and the second key is added beside it. - Local narrowing: `@object-ui/app-shell`'s full suite is left to `Test UI`. - Derived local gate set at c302aa2: `dispatch-gates --ran` reconciles 38 derived, 38 run, every one exit 0, 0 NOT MEASURED, 0 unrun. ## Verification Read first (by risk): 1. `ui/packages/plugin-kanban/src/ObjectKanban.tsx`: `hostWindowed` / `selfWindowed`, `swimlaneQuestion` and `boardLaneCounts`, beside `headerTotals`. 2. `ui/packages/plugin-kanban/src/KanbanImpl.tsx`: `swimlaneRowCount` and the swimlane header. 3. The new pins in `ObjectKanban.swimlaneStatistic-37326.test.tsx`. Two-minute check: from `ui/`, `pnpm exec vitest run packages/plugin-kanban/src/ObjectKanban.swimlaneStatistic-37326.test.tsx` shows 18 passing; set `swimlaneCounts={undefined}` in `ObjectKanban.tsx` and (c) and the self-window pins fail. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibwxBy3QieJMqJbJtTk Co-authored-by: Claude <noreply@anthropic.com>
…ectstack-data teaches the four locks (objectstack-ai#38428) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu8dhiDUf1jDKZiZnYduzapm)_ Fixes objectstack-ai#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 objectstack-ai#36806 (ruling record 7180466652, 「按长远模型」) and the two object-level rulings on objectstack-ai#37402 (ruling records 7235326611 and 7237772411), whose code landed in objectstack-ai#37436, objectstack-ai#37888 and objectstack-ai#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 objectstack-ai#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 objectstack-ai#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: objectstack-ai#37898 (the assistant is among the hands the ruling names; cloud AI service), objectstack-ai#38202 (console Duplicate carries a hand-locked value), objectstack-ai#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 (objectstack-ai#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>
…er-detail lines in the edit form (objectstack-ai#38388) Fixes objectstack-ai#38249 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:对象上写了「整单人手锁定」条件的单据(如已确认的订单),在控制台编辑对话框里,明细行也一并锁住:不能加行、复制行、删行、拖动排序或改单元格;明细字段自己写了「始终可改」的那一列仍可编辑;整单与明细都没有可改之处时,记录页的「编辑」按钮置灰并说明原因。 - 为什么做:对象级整单锁定上线后,表头字段锁住了,明细行却还能手改,与「整单人手锁定」的承诺不符,维护者裁定按字面先落地、再立此跟进卡补上明细这一半。 - 出错会怎样:漏锁时用户仍能手改明细行,服务端校验照常兜底;误锁时只影响手工编辑,按钮、接口、导入、流程照常写入;去掉对象上的锁定条件即可撤回。 - 要你做什么:无。 ## What changes Governing ruling: the maintainer on PR objectstack-ai#38169 (the object-level hand lock), 「本 PR 按字面落地+立跟进卡」; this card is that follow-up. The opt-out reads the existing override rule of the two-tier lock model (ruling on objectstack-ai#36806, Q1 = B on objectstack-ai#37402): a field that declares a hand lock of its own — `uiReadonly: true` or a `uiReadonlyWhen` — is judged by it instead of any object-level default, and `uiReadonly: false` is not such a declaration. No key, value or schema property is added. **`@object-ui/plugin-form`** - `MasterDetailForm.tsx` (the edit dialog's line grids): the header record feed also lands the parent object's `uiReadonlyWhen` with its field names. On an EDIT form the lines judge it over the live header record (every header field seeded `null`, the stored row as `previous`, the host's predicate scope) through the one hand-lock verdict (`fieldReadOnlyByHand` of a field that declares nothing, i.e. the object lock itself, failing closed). While it holds: no Add, Duplicate, Remove or drag-reorder, no per-row editor, and every line column whose child field owns no hand lock is locked on every row. A create is not judged. - `deriveMasterDetail.ts`: derived and hydrated line columns carry an in-memory mark when their child field owns a hand lock (`childFieldOwnsHandLock`, which asks `effectiveUiReadonlyWhen` itself rather than restating the rule). `lockColumnsByParentHandLock` locks every unmarked column. `childLinesOpenUnderParentHandLock` answers whether some child field owns a non-static hand lock (exported from the root and from `/core`). **`@object-ui/app-shell`** - `editFormLockedByState.ts`: an object that places an inline child collection no longer keeps Edit live unconditionally. It greys Edit when the object's own `uiReadonlyWhen` holds over the record, every drawn header field is read-only, and no placed child object has a field that could open a line cell. That needs the child definitions, through a new optional `childObjectDef` argument; without it, or for a child it cannot answer, Edit stays live (fail open, as before). - `RecordDetailView.tsx`: passes the served object list as that resolver. Declared writes (REST, import, actions, flows) are untouched: nothing on the server reads either key (ruling on objectstack-ai#36806). Published surface, both additive (a non-protocol widening, so `patch`): `@object-ui/plugin-form` exports `childLinesOpenUnderParentHandLock` from its `.` and `./core` entries, and the exported `editFormLockedByState` of `@object-ui/app-shell` takes an optional fourth argument, `childObjectDef`; a caller that omits it behaves as before. ## Why PR objectstack-ai#38169's acceptance notes recorded that a parent's object lock did not reach its line rows, and its contract review (record 7236877945) escalated it. The maintainer summary of objectstack-ai#37402 promises 「整单人手锁定」 for a confirmed order, while a person could still edit its lines. ## Tests - New `MasterDetailForm.parentHandLock-38249.test.tsx` (real `MasterDetailForm` and `GridField`): a locked parent offers no add / duplicate / remove / reorder and locks a line cell; a child field with its own `uiReadonlyWhen: 'false'` stays editable while its sibling is locked; `uiReadonly: true` stays locked; a fully configured entry (no child schema read) locks every cell; CONTROL draft parent edits as before; CONTROL a create is not judged. - `__tests__/dialogHandLock-36806.test.ts`, new top-level describe: `childFieldOwnsHandLock` over each spelling (`uiReadonly: false` and a server lock are not ownership); derived and authored (typed and untyped) columns; an unmarked column fails closed; `childLinesOpenUnderParentHandLock`. - `editFormLockedByState.test.ts`, new describe: true when the lock holds and no child field can open; false with a `'false'` child override; true with only a static child lock; false when the predicate does not hold; false when the header is locked field by field only; fail-open without child definitions. - `RecordDetailView.editLockedByState-32756.test.tsx`, new top-level describe: Edit disabled with the state reason on a locked document with lines; CONTROL a `'false'` child override and a draft record keep it live. ## Acceptance notes - Measured on `main` first: the new rendered pin against the unfixed code, 4 failed / 2 passed (a confirmed parent's line cell was editable; both controls green). - Precedence, as the existing override rule gives it: a child field with its own conditional `uiReadonlyWhen` (say over the line's own columns) is judged by that predicate, so the parent's lock does not reach that cell. Its default (no declaration) is now the child object's lock OR the parent's. - A row-level opt-out for adding or removing lines does not exist: under a locked parent no line is added, duplicated, removed or reordered, whatever the child fields declare. A field-level declaration opens only that field's cell on stored lines. - The per-row editor is not offered under a locked parent, because it edits every child field. So in a form-factor collection (`inlineEdit: 'form'`, lines shown as a list) a child field's own opt-out has no surface while the parent is locked: that collection reads fully locked. - A fully configured entry (typed columns and the relationship field) reads no child schema, so its columns carry no ownership mark and all lock under the parent lock (the hand lock fails closed). - Before the header record lands, the parent predicate is judged over `null`-seeded header fields; a predicate such as `record.status == 'confirmed'` then reads open until the record lands. This is the same window as the grid's own object-definition read noted on PR objectstack-ai#38169. - Scope: the console edit form and the record page's Edit state. The record page's own line-items panel (`LineItemsPanel` / the record body table editor) is not changed here; whether it should follow the parent's lock is for its own card. - The four commits' `Claude-Session:` trailers name the dispatching seat's session (`session_017xRBcSAaBEfQpU2yJexSJ8`) instead of this dev session (`session_017xRBcSPkRxFWubkD5XfiDh`), a transcription slip; the history is left as pushed. - File surface beyond the two claimed files, each `check-handover.mjs --inflight` clear: `MasterDetailForm.tsx` (the line grid), `RecordDetailView.tsx` (the Edit state's caller), `core.ts` and `index.tsx` (one export each). ## Verification Patch round (seat claim amendment 7247687945, head `1933251b`): `Clause-②` corrected to `yes (widening)` here and in both changesets (still `patch`, `Metadata-protocol: none`); `origin/main` merged twice (`212babcf`, `1933251b`), no incoming commit touching this diff's files. On `1933251b`: the four pin files 4/4 files, 42/42 tests; `dispatch-gates.mjs --commands` 38 families, all run, all exit 0 (the ui `scripts/` suite 172 files passed, 2 skipped / 5,159 tests); `--ran`: "38 run, 0 NOT-MEASURED"; `overlap-check.mjs` VERDICT clean exit 0; `check:nul-bytes` OK. The readings below are the first round's. Two-minute check: `cd ui && pnpm exec vitest run packages/plugin-form/src/MasterDetailForm.parentHandLock-38249.test.tsx` — expect 6 passed. First files to read (by risk): `ui/packages/plugin-form/src/MasterDetailForm.tsx` (the `parentHandLocked` verdict and the three grid props it gates); `ui/packages/plugin-form/src/deriveMasterDetail.ts` (`childFieldOwnsHandLock` and the mark); `ui/packages/app-shell/src/utils/editFormLockedByState.ts` (the subform branch). Readings on `objectstack-ai/objectstack`, head `9166fa40` (the gate union on `81f9ef2c`; the one later commit adds only the record-page test describe, and the derived list on `9166fa40` is byte-identical). <details><summary>Tests</summary> - `@object-ui/plugin-form` full suite: 249 files / 2,816 passed, 1 skipped. - `@object-ui/plugin-form` and `@object-ui/app-shell` `type-check` (both `tsc --noEmit` and the test tsconfig): exit 0. - app-shell targeted: `RecordDetailView.editLockedByState-32756.test.tsx` + `editFormLockedByState.test.ts` 27/27. The app-shell full suite is not run locally (CI `Test UI` runs it). - New and extended pins together (plugin-form + app-shell utils): 35/35. </details> <details><summary>Shown red without the fix (scripts/ablation-replace.mjs, restored to HEAD each time, blob equal and git diff HEAD empty)</summary> - `MasterDetailForm.tsx` parent verdict forced `false`: rendered pin 4 failed / 2 passed (controls green). - `editFormLockedByState.ts` back to returning false for any subform: 2 failed / 18 passed (the two "is true" cases). - `deriveMasterDetail.ts` ownership mark removed: 3 failed (derived and authored column cases, and the rendered `'false'` override case). - `RecordDetailView.tsx` resolver dropped: 1 failed / 6 passed (the Edit-disabled case). </details> <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands`: 38 families, all run on `81f9ef2c`; 37 exit 0. `pnpm --dir ui exec vitest run scripts/` exit 1: SIGKILLed by the container's memory limit while the plugin-form suite ran beside it, so not measured on that run. Rerun alone under the verify lock with `--maxWorkers=2`: 172 files passed, 2 skipped / 5,159 tests, exit 0. - `dispatch-gates.mjs --ran`: "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED" over the raw record (the exit 1 above as recorded). - `overlap-check.mjs` before every push: VERDICT clean exit 0. - `pnpm check:nul-bytes`: OK. - Full dogfood battery: n/a (no `!`, no `(narrowing)` arm). </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes (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 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_017xRBcSPkRxFWubkD5XfiDh --- _Generated by [Claude Code](https://claude.ai/code/session_017xRBcSPkRxFWubkD5XfiDh)_ <!-- signed: repo:objectstack#8 · sunhaolin · session_017xRBcSPkRxFWubkD5XfiDh --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #37402
Clause-②: yes
Metadata-protocol: added
Skills-docs: follow-up #37405
维护者速读
What changes
Governing ruling (on #36806, 2026-11-26, the card's governing text, quoted): 「按长远模型」 — two tiers (server lock
readonly/readonlyWhen; hand lockuiReadonly/uiReadonlyWhen) × two levels (field, object); a field's own declaration wins over the object default; write paths keep every write (the engine never reads the key). ADR-0085 §2 (the object-level key names the console as a whole, not a page) and ADR-0049 (a declared key is enforced on every surface it names).Spec (
packages/spec)ObjectSchema.uiReadonlyWhen— optional CEL predicate over the record's own columns (EvaluatedExpressionInputSchema, the field key's scope), with TSDoc and describe. No default, so no parsed object grows a key.object.uiReadonlyWhen(live); Studio object form row (Advanced section, CEL code row); regenerated reference docs, authorable-surface record (data/Object:uiReadonlyWhen) and state counts.Console (
ui/packages/**) — item 3, one helper, no surface reads the key@object-ui/corehandLock.ts:effectiveUiReadonlyWhen(def, object)— the field's ownuiReadonlyWhenwhen the field declares a hand lock of its own —uiReadonly: trueor auiReadonlyWhen— else the object's.uiReadonly: falseis not a declaration of its own: it reads as absent and the field follows the object lock (seat ruling on the card, Q1 = B; the one opt-out spelling isuiReadonlyWhen: P\false`).fieldLockPredicates(def, object)for operand fetches.fieldReadOnlyByHand(def, record, { object, … })andfieldHasConditionalHandLock(def, object)take the object **as a required argument**, so the compiler asks every caller for it (the helpers first shipped in the19.0.0-next.0prerelease with the field-level hand lock and are in no stable release; a caller written against that prerelease must now pass{ object }` — the changeset carries the migration).DetailSection,HeaderHighlight,InlineEditSaveBar, stage path), grid cell (cellReadOnlyKindgains a requiredobject), kanban drop, calendar drop, Gantt write gate (ganttPatchByHandtakes the object), timesheet cell.resolveFieldRuleStatecallers read the folded predicate from the producer, not the object: the edit dialog's form fields (sectionFields.fromObjectSchema,ObjectForm) carryeffectiveUiReadonlyWhen(...), soform.tsxandWizardForm(which judge what a form field carries) fold the object lock with no change of their own;editFormLockedByStatefolds it the same way; line-item columns (deriveMasterDetail, derived and authored) carry the CHILD object's predicate, whichGridFieldWidgetalready judges per row.$selectfetch the object predicate's operands for every inheriting column / edited-in-place field.Server
packages/objectql/**reads the key.describe_object(item 5) reports the object'suiReadonlyWhentext at the answer's top level where authored, on HTTP (runtime/domains/mcp.ts) and stdio (mcp/mcp-server-runtime.ts); the tool description says how to read it.metadata-core): an object predicate that reads a field denied to the caller is served as the constanttrue(fail-closed, the field-level precedent: deleting it would open every record for exactly that caller).os validate(lint): the object slot is checked as the field slot is (record-scoped check + root verdict), atobject 'NAME' uiReadonlyWhen.platform-objects); translated-leaf pin 845 → 846.Why
A whole-record lock (confirmed order, posted invoice) had to be written as a
uiReadonlyWhenon every field — tedious, and one missed field leaves a hand edit open. The ruling adopted the object level now.Item 4 (console duplicate) — no surface, not delivered
Measured on
f72f3353: no person-triggered record duplicate exists in the console. Searchedui/packagesandui/appsforduplicate|clone|onClone|cloneRecord|data.clone(: the hits are the view switcher's view actions, Studio package/sharing-rule/permission-set clones, an unuseddetail.duplicatetranslation string, and the spec capability flagenable.clone. The only record clone is the REST doorPOST /data/:object/:id/clone(rest/data-action-routes.ts→cloneData), reached by the SDK'sdata.clone— an API write, which by the ruling keeps every value. Item 4 is reported as "no surface — not delivered" and nothing was built; the done-when clause "duplicating the confirmed record yields a record whosestatusis the field'sdefaultValue" has no surface to hold on. The rule is carried by #38202 as the acceptance of a future console Duplicate action (seat ruling on the card, Q3).Fixes #37402stands.Tests
@object-ui/corehandLock-36806.test.ts(new top-level describe): object lock locks a non-declaring field while TRUE and only then;uiReadonlyWhen: 'false'(string and envelope) keeps a field editable; a field's own predicate /uiReadonly: truelocks where the object does not (override both directions); explicituiReadonly: falseis NOT a declaration — the field follows the object lock (Q1 = B), with a CONTROL thatuiReadonlyWhen: 'false'(alone or besideuiReadonly: false) still opens it; server lock does not cancel the object default; fail-closed on a faulted / operand-less object predicate; the fold helpers.plugin-formdialogHandLock-36806.test.ts: dialog form fields carry the object predicate / the field's own; line-item columns (derived and authored) carry the child object's.app-shelleditFormLockedByState.test.ts: object lock greys Edit; afalseoverride keeps it live; off while the predicate does not hold.plugin-grid: cell verdict over the object lock and its override; the row load$selectasks for the object predicate's operand and not for a column with its own lock.plugin-kanban: a drop on a record the object locks writes nothing; a lane field with its ownfalsewrites the move.lint: object slot accepted / bare reference / parse / undeclared field / unbound root refused (each authoring refusal has a test); read-surface pin gainsuiReadonlyWhen.metadata-core: denied operand → served'true'(string and envelope); readable → served as written.mcpstdio andruntimeHTTPdescribe_object: the object predicate is reported; no field'sreadonlychanges; a storeduiReadonly: falselists no hand-lock key; an object without it carries no key.ui-readonly-hand-lock-36806.dogfood.test.ts, new top-level describe on one shared boot): the done-when object (state_machineonstatus, objectuiReadonlyWhen: P\record.status in ['confirmed','done']`,notesP`false`); the served definition carries both predicates; a PATCH to a confirmed record lands with **noX-ObjectStack-Dropped-Fields`**; an import update writes and the machine still refuses an illegal move; a declarative action writes.Acceptance notes
L2 record (contract review, PASS) S1 fixed in head
36e883f1:WizardForm.tsx's final-submit gate drops the carrieduiReadonlyWhenon a CREATE wizard, at the evaluating site, asform.tsxandGridFieldWidgetdo. Fixed there rather than insectionFields.fromObjectSchemabecause every other create surface already drops the predicate where it evaluates it; omitting it at the producer would make one of four readers behave differently from the other three, and the gate also reads predicates that never pass throughfromObjectSchema. The same gate still judges the field's ownreadonlyWhenon a create, whereform.tsxdoes not; that is pre-existing and left alone. Pin inwizardPredicateScope.test.tsx: a create wizard over a locked object still demands an empty required field (red before the fix: the create went through); CONTROL: an edit wizard on a confirmed record still treats the inheriting field as locked and saves without it (green before and after). N2 (this body and the@object-ui/corechangeset now name19.0.0-next.0) and N3 (describe_object: a field's ownuiReadonlyWhenis judged by that predicate, which may itself lock it) are taken; N1 waits on the seat's maintainer question.Seat rulings on the card's three open questions (newest seat comment on spec: an object declares when a whole record is read-only by hand (object-level uiReadonlyWhen), fields override it, and duplicating a record takes the locked fields' defaults #37402): Q1 = B, maintainer verbatim 「B 不算放开」 — implemented in head
696c37e9(declaresOwnHandLock, the pin flipped, every describe / help / liveness / changeset /describe_objectstring names the two counting spellings; help retranslated in 10 locales). Q2 = A, kept as built. Q3: item 4 closes as "no surface — not delivered", carried by console: a person-triggered "Duplicate record" action, whose copy takes hand-locked fields' defaults (the rule ruled on #36806, no surface today) #38202.requiredWhenprompt collector (fields/requiredWhenPrompt.ts) keeps reading the field's own key: the hosts'fillablecallbacks already judge the object lock over the STORED record, which is the right record for a transition the person is still allowed to make.The public intake form page (
ui/apps/consoleFormPage.tsx) is create-only and never carried a hand lock; untouched.A parent's object lock does not lock its child line-item rows: those rows are records of the child object and follow the child object's own lock.
The grid cell judges with the grid's own fetched object definition; while that read is in flight the cell sees no object lock (the same window the host field catalogue already has).
objectExtensionsdoes not gain the key (not asked).Verification
Two-minute check:
cd ui && pnpm exec vitest run packages/core/src/evaluator/__tests__/handLock-36806.test.ts— expect the#37402describe green (7 cases).First files to read (by risk):
ui/packages/core/src/evaluator/handLock.ts(the fold and its override rule);ui/packages/plugin-form/src/sectionFields.ts(how the edit dialog gets the object lock withoutform.tsxreading it);packages/metadata-core/src/object-schema-fls-references.ts(objectHandLock, the fail-closed serve).S1 verification on head
36e883f1: wizard pins red before the fix (1 failed: the create case; CONTROL green), green after; wizard + dialog files 5 files / 31;@object-ui/plugin-formfull suite 248 files / 2,805 and type-check 0; mcp typecheck 0,mcp-server-runtime.test.ts20/20; overlap-check clean. The derived gate union on36e883f1is reported in the card's delta os-dev-report.Q1 re-verification on head
696c37e9(no conflict withorigin/main, so no merge): ui hand-lock files 5/5 (49 tests); ablation restoring the old rule (uiReadonly !== undefinedcounts) turns the flipped pin red (1 failed / 14 passed), restore blob == HEAD; mcpmcp-server-runtime.test.ts20/20, runtime describe 5/5; typecheck mcp, runtime and@object-ui/coretype-check 0;spec check:liveness0;spec check:generatedall 14 up to date;check:i18n0,check:i18n-stale-fillOK; platform-objects 130 files / 2,214; overlap-check clean. The derived gate union on696c37e9is reported in the card's delta os-dev-report.Verification record (first head) — every reading below is taken on
objectstack-ai/objectstackat head0bee2a81(the branch after mergingorigin/mainat0e361201) unless it says otherwise; locked runs went throughos-verify-lock.sh.Tests (package suites and targeted files)
@objectstack/specfull suite (pre-merge head6ce7aa65, spec untouched by the merge;check:generatedre-run green on0bee2a81): 910 files / 28,814 passed.@objectstack/runtimefull suite (pre-merge): 655 files / 12,342 passed, 25 skipped; on0bee2a81:mcp-object-hand-lock-36806.test.ts5/5 andtypecheck0.@objectstack/lintfull suite on0bee2a81: 245 files / 9,870 passed;typecheck0.@objectstack/metadata-corefull (pre-merge): 244 files / 9,861; on0bee2a81the FLS file 68/68.@objectstack/mcpfull (pre-merge): 88 files / 1,644; on0bee2a81mcp-server-runtime.test.ts20/20.@objectstack/platform-objectsfull (pre-merge): 130 files / 2,214.@objectstack/metadata-protocolprotocol.meta-types-degenerate-derivation.test.tson0bee2a81: 18/18.ui-readonly-hand-lock-36806.dogfood.test.ts(booted stack): 10/10.Test UIruns it); its two lock files ran green.0bee2a81(15 files): 250/250.type-checkon0bee2a81: core, plugin-form, plugin-detail, plugin-grid, plugin-kanban, plugin-calendar, plugin-list, plugin-gantt, plugin-timesheet, app-shell — all Done.Shown red without the fix (ablation, restored to HEAD each time)
effectiveUiReadonlyWhenmade to ignore the object (return undefined): 10 of the new UI pins red across core, plugin-form, app-shell, plugin-grid (cell and row load) and plugin-kanban; the override controls stayed green. Restore: blob equals HEAD,git diff HEADempty.undefined: the four refusal cases red, the accept case green. (A first attempt was refused by the ablation tool before running — its replacement text already existed — and re-anchored.)uiReadonlyWhen: objectHandLockswapped forexpression: the fail-closed pin red, the control green.Gates (derived union on 0bee2a8)
node scripts/pm/dispatch-gates.mjs --commands: 127 families; all run; 124 exit 0; 3 exit 3 (PREREQUISITE NOT MET, NOT MEASURED):check-plugin-teardown-shape.mjs --self-test(shallow clone cannot read its pinned fixture commit),spec check:skill-examples(client SDK dist not built),check:dual-build-cjs-loads(a package without dist). CI runs all three.dispatch-gates.mjs --ranwith exit codes: "127 derived famil(ies) accounted for — 124 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)".spec check:generatedon0bee2a81: "All 14 generated artifacts are up to date".overlap-check.mjsbefore every push: VERDICT clean exit 0.check-nul-bytes.mjs: 0.!, no(narrowing)arm).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI).main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b
Generated by Claude Code