Repository navigation
feat(spec,ui): a field can be read-only by hand at the console while writes keep it (uiReadonly / uiReadonlyWhen) - #37436
Conversation
…the dialog surfaces (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
…t reports uiReadonly / uiReadonlyWhen (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
…acts and liveness rows (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
…e, grid, line-item grid, kanban, calendar (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
…ngeset (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
…y / uiReadonlyWhen in the FieldSchema key censuses Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
…and uiReadonlyWhen, translated in every metadata-forms locale Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
… 837 → 839 for the two hand-lock rows Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
📓 Docs Drift CheckThis PR changes 7 package(s): 35 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 18 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 188 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 390517a26f3435300698f611631f9180c0de4501 && git checkout 390517a26f3435300698f611631f9180c0de4501
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 276174ab0c70804700b196d4d718268331be8120 8a1e714518c4ffe5f1541dfe031d0da9a2f016e1 && git checkout -B drift-repro 276174ab0c70804700b196d4d718268331be8120 && git merge --no-ff 8a1e714518c4ffe5f1541dfe031d0da9a2f016e1
node scripts/docs-audit/affected-docs.mjs --json 276174ab0c70804700b196d4d718268331be8120
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Final head for L1 + L2 · area o5-D · 2026-11-26T05:30Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 62c400a · 2026-11-26T05:31Z The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own. |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Inputs read: card #36806 body and all 10 comments (analysis 7179210173, ruling 7180466652, claim 7180490513, amendments 7180683371 / 7181406682 / 7182109621 / 7182190475, os-dev-report 7183535050); PR #37436 body and its 3 comments (final-head 7183553330); the net diff ① Derived judgments
② Semver level
③ Boundary flagsDev deviations:
Escalated to the seat: ruling 7180466652 defines "by hand" to include "an in-app assistant acting for a person". The describe in SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join; the kanban and calendar reads are lookups in rows the surface already holds. ④ Design judgmentWhat holds, read against the ruling and the live tree: the static lock S1 (should-fix) — S2 (should-fix) — a faulted S3 (should-fix) — the describe says "no console surface lets a person edit the field", and four hand surfaces still do, with no server strip behind them. (a) In the diff: S4 (should-fix) — the N1 (nit) — the changeset names neither N2 (nit) — N3 (nit) — Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
…sed fault, lint slot, narrowed describes) Per the L1 rework and contract review on #36806: S1 host scope on every surface and lock-predicate operands fetched by the grid row load and ListView (grid columns, kanban lane, calendar dates); S2 a faulted uiReadonlyWhen locks the field, the edit form refuses to submit, os validate checks the slot; S3(a) authored line-item columns carry the child field's hand lock; S4 uiReadonlyWhen judges existing records only; describes name the honouring surfaces; N1/N2. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
…eadonlyWhen refusal pin check:test-source-alias: the layout renderers reach @object-ui/react-runtime through a dynamic import, so the test imports it at module top. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Final head after rework —
|
| Item | Where | Pin |
|---|---|---|
| S1 host scope on every surface | ObjectGrid / objectGridCellFacts (cell), DetailSection, HeaderHighlight, InlineEditSaveBar, recordPathStageChange, ObjectKanban, ObjectCalendar |
core handLock-36806 (current_user over scope), grid objectGridCellFacts.handLock-36806 |
| S1 operands read before the verdict | objectGridRowLoad.ts (grid's own fetch); ListView.tsx $select (shown columns, kanban groupByField, calendar start/end) |
lockOperandProjection-36806, ListView.lockOperandSelect-36806; a row missing the operand is locked (core, grid) |
| S2 fault direction | UI_READONLY_WHEN_FAULTED = true (fieldRules.ts): fail closed, no server judges the hand lock |
core (parse fault, missing operand, unbound root), faults.uiReadonlyWhen reported |
| S2 submit refusal | form.tsx: an edit form refuses with form.uiReadonlyWhenFaulted (11 ui locales + form fallback); a create never judges it |
uiReadonlyWhen-fault-refuses-submit-36806 (both evaluation paths, create control) |
| S2 lint slot | validate-expressions.ts: uiReadonlyWhen in the field-rule walk (record-scoped check + root verdict, own consequence clause); meta-test slot list |
5 lint pins |
S3(a) hydrateColumns |
withHandLock on typed and untyped authored columns; GridFieldWidget locks a static uiReadonly column |
deriveMasterDetail.test.ts, GridField.handLock-36806 |
| S3 remainder, N3 | #37448 | — |
| S4 "existing record" | field.zod.ts describe + TSDoc, liveness/field.json note, field.form.ts help (retranslated in 10 locales, generator re-run, no fill hash) |
regenerated reference docs, translations suite |
| Narrowing, N2 | both describes and describe_object name the honouring surfaces; required without defaultValue fails every console create |
— |
| N1 | changeset: metadata-core, platform-objects, lint, plugin-list, i18n |
— |
Ablations (each mutation landed on disk and was restored): fault fail-open → 6 pins red (core, grid, form); grid harvest dropped → harvest pins red; ListView harvest emptied → 3 red; form refusal off → 2 red; withHandLock static half off → 1 red; GridField static read off → 1 red; lint slot dropped → 4 red.
Local suites: ui core 4,800 · i18n 2,028 · components 4,996 · fields 5,034 · plugin-form 2,796 · plugin-grid 2,800 · plugin-list 2,075 · plugin-detail 3,970 · plugin-kanban 585 · plugin-calendar 515 · lint 9,634 · spec data 6,865 · mcp 1,512 · platform-objects translations 610. type-check green in 9 ui packages and lint.
Overlap (accepted by the area): #37422 count pin in object-lifecycle-panel-echo-decisions.test.ts; #37449 one-line union in objectGridRowLoad.ts extraFields. Whichever lands second merges main and keeps both.
Deviations: an intermediate head (309363d) went red on check:test-source-alias: the new form pin lacked the module-top @object-ui/react-runtime import. Fixed in 116e042.
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 116e042 · 2026-11-26T08:21Z |
…mance ledger Adds the cel-field-ui-readonly-when row: the console hand lock's predicate, evaluated by the hand-lock verdict in core/evaluator, fail-closed, UI only. A row of its own rather than a cel-field-rule cover, since its evaluator, its fail policy and its reach all differ. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45802459935 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: A whole record for this head. It stands on three earlier rounds by the same reviewer, at Range facts:
① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe hit files against the ruling and their consumers: S1: closed. Host scope on every surface; lock operands fetched by the grid load and S2: closed. Fault fails closed in the one evaluator; the edit form refuses the submit; S3: closed. Authored line-item columns carry the lock; the uncovered surfaces are carried on #37448 and the describes name what is covered. S4: closed. "Existing record only" in the describe, TSDoc, Studio help, ledger and changeset. S5: closed. S6: closed. The scrub serves N1: closed. N2: closed. N3: carried on #37448. N4: closed (the body says fail closed). N5: carried on #37448. N6: closed ( The ledger row
N7 (nit) — the enforcement cell opens with N8 (nit) — No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Re-landing — area o5-DHead-sha:
Re-landing with |
…siness wording in ja-JP, es-ES and zh-CN (objectstack-ai#37464) Fixes objectstack-ai#37384 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用日文、西班牙文(以及部分中文)搭报表的人,在报表设置面板里看到的"列分组、排序、分块、图表、日期范围、导出选项"六条说明和"联合分块""筛选与图表"两段分区说明,现在和英文说的是同一件事,不再是旧的"维度 / 度量 / 数据集"开发者说法。 - 属于报表面板改用业务用语的收尾,接上一轮只修了六行和四个标签的那张卡,补齐其余译文。 - 出错只会是某条译文措辞不够好,不影响任何功能或数据,随时可以直接改回或再改。 - 无。 ## What changes Translation text only, in the three hand-written locale bundles of `@objectstack/platform-objects` (`zh-CN`, `ja-JP`, `es-ES` `*.metadata-forms.generated.ts`), `report` block. No key added or dropped; `pnpm check:i18n` is in sync. Vocabulary follows PR objectstack-ai#37377: データソース / 指標 / グループ化 · Fuente de datos / Métricas / Agrupar por · 数据来源 / 指标 / 分组. The enum tokens `matrix` / `joined` stay as tokens, as the English and each bundle's own `type` hint keep them. **Every leaf re-translated** (current English, then the new value per locale): | Leaf | English | ja-JP | es-ES | zh-CN | |:---|:---|:---|:---|:---| | `report.sections.joined_blocks.description` | Other blocks stacked into the same report, each with its own data source (joined reports only). | 同じレポートに積み重ねる他のブロック。それぞれ独自のデータソースを持ちます(joined レポートのみ)。 | Otros bloques apilados en el mismo informe, cada uno con su propia fuente de datos (solo informes joined). | 叠加进同一张报表的其他分块,各有自己的数据来源(仅 joined 报表) | | `report.sections.filter_and_chart.description` | Filter conditions and how the chart is shown. | フィルター条件と、チャートの表示方法。 | Las condiciones de filtro y cómo se muestra el gráfico. | unchanged (条件与图表展示 already follows) | | `report.fields.columns.helpText` | Groups spread across the columns (matrix reports only). | 列方向に展開するグループ(matrix レポートのみ)。 | Grupos distribuidos en las columnas (solo informes matrix). | 横向展开的分组(仅 matrix 报表) | | `report.fields.order.helpText` | What to sort by, most important first (a grouping or a metric). Time groupings sort in date order by default. | 並べ替えの基準。重要なものから順に指定します(グループまたは指標)。時間のグループは既定で日付順に並びます。 | Por qué ordenar, lo más importante primero (una agrupación o una métrica). Las agrupaciones de tiempo se ordenan por fecha de forma predeterminada. | 排序依据,最重要的在前(某个分组或指标)。时间分组默认按时间先后排列。 | | `report.fields.blocks.helpText` | Sub-reports, each with its own data source (joined reports only). | サブレポート。それぞれ独自のデータソースを持ちます(joined レポートのみ)。 | Subinformes, cada uno con su propia fuente de datos (solo informes joined). | 子报表,各有自己的数据来源(仅 joined 报表) | | `report.fields.chart.helpText` | Chart type and settings. | チャートの種類と設定。 | Tipo y configuración del gráfico. | unchanged (图表类型与配置 already follows) | | `report.fields.dateRange.helpText` | The period the report opens with, and whether people may choose their own range. | レポートを開いたときに表示される期間と、利用者が自分で範囲を選べるかどうか。 | El período con el que se abre el informe y si cada persona puede elegir su propio rango. | 打开报表时显示的时间段,以及使用者能否自己选择范围 | | `report.fields.exportOptions.helpText` | Download formats (csv, xlsx) and file name. Who may download is set by the export permission on the data source’s object. | …データソースのオブジェクトのエクスポート権限で決まります。 (データセット → データソース) | …el permiso de exportación del objeto de la fuente de datos. (del conjunto de datos → de la fuente de datos) | …由数据来源对象上的导出权限决定 (数据集 → 数据来源) | Counts: ja-JP 8 leaves, es-ES 8 leaves, zh-CN 6 leaves. zh-CN `filter_and_chart.description` and `chart.helpText` were already current against the English and are left as is. The six zh-CN values that moved match the console's own zh overlay (`metadata-form-zh-cn.ts`), which already carried the current English, except that the platform bundle keeps the `matrix` / `joined` tokens its `type` hint and `joined_blocks` label use, where the overlay writes 矩阵表 / 联合报表. **Ledger.** `report-dataset-panel-echo-decisions.test.ts`: the `values.helpText` row's reason cited its sibling `order.helpText` as naming the rows/columns dimension and values measure vocabularies; that sibling no longer does, so the reason gains one sentence saying so and keeps the precedent as the record of why the leaf was reached. No verdict or pinned value moved: no ledger pins any of the leaves above by value (they are the population's authored, non-echoing negatives). ## Tests <details><summary>platform-objects: translations suite, full package suite and typecheck, green at d37c591</summary> ``` pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2 src/apps/translations Test Files 26 passed (26) Tests 610 passed (610) pnpm --filter @objectstack/platform-objects run typecheck (tsc --noEmit, scripts tsconfig, check:test-typecheck OK) os-verify-lock: VERDICT command-exit 0 pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2 Test Files 127 passed (127) Tests 2176 passed (2176) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Local gates, at d37c591</summary> ``` node scripts/pm/dispatch-gates.mjs --commands (diff-derived): 63 families pnpm check:i18n EXIT=0 check-i18n-bundles: OK (10 package(s), all bundles in sync, no undeclared authoring keys) (first run EXIT=3 PREREQUISITE NOT MET, CLI unbuilt; re-run after the gate's own closure build) pnpm check:i18n-stale-fill EXIT=0 OK (11 bundle set(s), no new stale fills, 1 baselined) pnpm check:nul-bytes EXIT=0 pnpm check:doc-authoring EXIT=0 pnpm check:issue-citations EXIT=0 (self-test + scan: no issue citations added, 3 files read) pnpm check:cross-package-test-inputs EXIT=0 check-adr-0087-registration / check-changeset-no-major / check-empty-changeset EXIT=0 each pnpm check:dual-build-cjs-loads EXIT=0 (first run EXIT=3 prerequisite, re-run green) remaining 41 derived families EXIT=0 each NOT MEASURED locally (my 150 s per-gate cap, whole-tree scans that read no translation text; CI runs them): check-comment-mask-corpus, check:query-options-erasure, check:slot-lookup dispatch-gates --ran 63 of 63 derived families accounted for node scripts/pm/overlap-check.mjs --branch=HEAD VERDICT clean (origin/main, objectstack-ai#37436, objectstack-ai#37422 merge cleanly) ``` </details> ## Acceptance notes - **Card item "the PR names every leaf it re-translated"**: the table above names all 22 locale-leaves; the two zh-CN leaves left as is are named too. - **Same-family leftovers, not in this card** (noted, not filed): `report.fields.type.helpText` still reads the enum list as slash-joined tokens (tabular / summary / matrix / joined) in all three bundles while the English reads "Report type: tabular, summary, matrix or joined."; the meaning matches, so it is not stale. `report.sections.joined_blocks.label` in zh-CN reads `joined 报表分块` where the console overlay reads 联合报表的分块; label leaves were outside this card. - `dataset-panel-echo-decisions.test.ts` cites `report.sections.joined_blocks.label is 关联对象` in one reason, which the bundle no longer reads; that row is the dataset panel's and its verdict does not depend on it. Not touched. ## Verification First read, by risk: 1. `packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts`, `report` block: the 8 changed values. 2. `packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts`, `report` block: the 8 changed values. 3. `packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts`, `report` block: the 6 changed values. Two-minute check: `pnpm --filter @objectstack/platform-objects exec vitest run src/apps/translations`, expect 26 files, 610 tests passed. In the browser: switch Studio to 日本語, open any report, and the Sort Order hint reads 並べ替えの基準。重要なものから順に指定します(グループまたは指標)… with no rows / columns / values tokens. --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv)_ Co-authored-by: Claude <noreply@anthropic.com>
… (objectstack-ai#37449) <!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg8ZBQe4UHadd2fGHGeWRW9V)_ repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Fixes objectstack-ai#35490 Fixes objectstack-ai#37471 Clause-②: yes (widening) Metadata-protocol: added ## What A quantity (`unitConfig` on a `number` field) now renders with its unit on every display face: the grid cell, the form (read-only and edited), and the detail row (DetailSection, the quick-look panel, RelatedList). A unit-code `text` field (`unitMode: 'code'`) shows its unit's name (Open item 8 (A)). - **Choosing a unit (Open item 8, ruled A: 「有下拉」, objectstack-ai#37471).** In a form, a unit code field is a searchable picker (`UnitCodeField`), never a typed box. That covers a `text` field declaring `unitMode: 'code'` and the `unitField` a `record` quantity on the same form points at; the form stamps that pointer (`withUnitCodePointer`) and hands the field its record. The picker lists the record's organization's non-retired `sys_unit` rows, then every standard code, each by its translated name (spec fallback) and limited to the declared `unitDimension`. It stores the code. Read-only, the field shows the unit's name, not the bare code. - **Authorable key (`Metadata-protocol: added`).** `unitConfig` is now declared on `@object-ui/types`' `FormField` / `FormFieldSchema`, by reference to the spec's `FieldSchema.unitConfig`, beside `currencyConfig`, so `objectui validate` accepts it on a hand-authored form field. `@object-ui/types` ships `minor` (the `scale` / `currencyConfig` precedent). The tolerant face now checks the key's value against `UnitConfigSchema` where it passed as an unknown key before. - **Which unit.** Fixed mode uses `unitConfig.unit`. Record mode reads the row's `unitField`. Grid, ListView and RelatedList add the unit column and `organization_id` to their `$select` when the unit column is not shown. - **Name.** An org unit (`sys_unit`, U3) shows its `label`. A standard code shows the platform's name for it in the reader's locale (L2, 2A): the spec English base `STANDARD_UNIT_NAMES`, and each platform bundle serves `messages.standardUnit<CODE>`. The UI reads `app.messages.standardUnit<CODE>` and falls back to the English base. - **Decimals.** These come from the unit row (org unit `decimal_places`, or the `sys_standard_unit_setting` row for a standard code, OI10 (A)). The row is the one whose `organization_id` matches the record's organization (note 7180167601). L4 holds: the display width is `min(unit places, field scale)`. - **Rounding (OI6, ruled A).** The display rounds half away from zero (Intl `halfExpand`) at a fixed width. The stored value, footer totals (summed exact, then formatted), exports, the API and MCP stay exact. No marker is shown. - **Bare code.** A retired ("deleted") org unit, an unknown code, or a reader who may not read `sys_unit` (an external member, comment 7030066814) gets the bare code, never an error. The rows are read once per data-source adapter for the session (the `homeAmountPreview` precedent). Each table is read on its own, so a refusal of one leaves the other usable. ## Server-side home of the names (measured) The platform-objects translation bundles, flat `messages` map, with single-segment keys `standardUnit<CODE>`. The keys are not dotted `units.standard.<CODE>` because `FileI18nAdapter.resolveKey` splits on `.` and walks the parts as nesting (the plugin-audit precedent). The console's served document lays bundles under `app`, so the UI key is `app.messages.standardUnit<CODE>`. English is copied from the spec base, never re-typed. Ten locales are translated, and a pin test holds every locale to exactly the 41 codes. ## Acceptance notes - **platform-catalog row:** deferred to objectstack-ai#37431 (`skills/**` fence). - **Standalone `ObjectGrid` with no `SchemaRendererContext`:** there is no data source, so no unit rows are read. Codes show bare at the field's own width. This known limit is pinned in `gridQuantityUnit-35490.test.tsx`. - **English names are singular,** e.g. `1,235 kilogram`. - **The catalog is cached per adapter for the session.** A unit edited mid-session shows after a reload. A failed read stays unread for the session; this is deliberate, because an external member's refusal is permanent and re-reading per mount would cost a request per grid cell. Follow-ups N4/N5 are on objectstack-ai#37472. - **Grid and detail cells of a pointed unit field** show the stored code. The pointer is stamped on the form face, where the quantity and its unit field sit together. - **Known overlap with objectstack-ai#37436 (objectstack-ai#36806).** Both PRs edit the `const extraFields = [...]` line in `ui/packages/plugin-grid/src/objectGridRowLoad.ts`: this PR appends `...quantityUnitFields`, and objectstack-ai#37436 inserts `...lockOperandFields`. Whichever lands second merges main and keeps both entries. ## Verification - Card tests: core 21, fields 26, components form, plugin-grid 2, plugin-list, plugin-detail 3. green; the fields, core, components-form and schema-catalog suites (13,000+ tests) pass on the picker head. spec `standard-units` 18/18; platform-objects translations 613/613. - Ablations, each restored to blob == HEAD: - resolver → 24/52 red; - org-row pick → 8/48 red; - served-name read → 1/26 red (the zh served-name case); - picker's retired-unit filter → 4/56 red; - form pointer stamp → 1/2 red; - TextField's picker branch → 3/30 red. - Typecheck: spec, platform-objects and fields are clean. `check:api-surface` was regenerated (2 added exports). - Gates: `check-i18n-bundles`, `check-i18n-stale-fill` and `check-i18n-walk-parity` pass. `check-published-readme-exports` passes. - `overlap-check`: clean against main, objectstack-ai#37437, objectstack-ai#37436 and objectstack-ai#37427. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…cited section (objectstack-ai#37485) Fixes objectstack-ai#37365 Clause-②: yes (a new reserved URL parameter `section`) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:使用应用内 AI 的用户,在回答下方看到“引自记录”的引用条(每条显示摘句);点一条就打开那条记录,并滚到被引的那一节、高亮标出。 - 为什么做:记录 AI 问询专题的第 10b 行,让用户能从 AI 回答一键跳回原文核对。 - 出错会怎样:引用条不显示或跳到记录顶部,记录本身与数据不受影响;撤回本次合并即可恢复原样。 - 要你做什么:无。 ## What changes Governing text: ADR-0160 D9 as amended by objectstack-ai#37363; ruling 7177410380 on objectstack-ai#37144 (Q1 A: draw the persisted, already-verified list, never re-verify; Q3 A: a related-row quote opens the root record). - **Lift** (`plugin-chatbot/src/mapMessages.ts`): `extractRecordCitations(parts)` reads the last `data-record-citations` part (`RECORD_CITATIONS_PART_TYPE`) through the spec's `RecordCitationsSchema`. A part the schema refuses, or an empty list, is no list (the `detectAnswerSource` precedent). `uiMessageToChatMessage` carries it as `recordCitations`; `chatMessageAdapter.ts` names the new render-only key. - **Chips** (`plugin-chatbot/src/RecordCitations.tsx`, new; drawn in `ChatbotEnhanced.tsx` beside `AnswerSourceBlock`): one chip per citation showing the quote. A click calls `onOpenRecord({ objectName: object, recordId: id, anchor })`; `onOpenRecord`'s argument gains an optional `anchor`. Nothing is fetched or verified on display. - **Open** (`app-shell/src/console/ai/AiChatPage.tsx`): `openRecord` takes the optional `anchor` and navigates to `recordOpenTarget(app, …)` = `/apps/APP/OBJ/record/ID?section=ANCHOR`. The dock and the `/ai` page both draw this `ChatPane`. - **Param** (`app-shell/src/urlParams.ts`): `RECORD_SECTION_PARAM = 'section'`, in `RESERVED_URL_PARAMS` and the param table. `RECORD_SECTION_OPENED_STATE` is a history-state key, not a URL parameter (the `RECORD_COMMENTS_PUSHED_STATE` precedent). - **Record page** (`app-shell/src/views/recordSectionAnchor.ts`, new; wired in `RecordDetailView.tsx`): once the record is held, the spec's `headingsOf` runs on each long-text field (`markdown`, `html`/`richtext`, `textarea`) in field order; the first whose outline issues the anchor is the body. The heading element is found in that field's drawn face and scrolled to and marked (the linked-comment marking). The match is trusted only when the face draws exactly as many headings of that title as the outline lists. A `textarea` body, a heading that is not drawn within 4 s, a count that differs, or a heading with no letter or digit scrolls to the field. A stale anchor opens the top. The cleanup takes the mark off, so opening another section moves the mark. Each chip click carries a fresh history-state value (`RECORD_SECTION_OPENED_STATE`), so the same chip clicked again opens its section again; a navigation that keeps the state, such as a tab switch, does not. - **Field marker** (`plugin-detail/src/DetailSection.tsx`): each detail row carries `data-detail-field={field.name}`, which is how the page finds a field. One attribute, no behaviour change. - **i18n**: `chatbot.recordCitations.title` in all 11 `ui/packages/i18n` locales. - Docs: `content/docs/frontend/plugins/plugin-chatbot.mdx`, `ui/packages/plugin-chatbot/README.md`; changeset `.changeset/37365-record-citation-chips.md` (patch, four `@object-ui/*` packages). Read first, by risk: 1. `ui/packages/app-shell/src/views/recordSectionAnchor.ts`: `locateSection` (how a drawn heading is matched) and `focusRecordSection` (observer and settle timer). 2. `ui/packages/plugin-chatbot/src/mapMessages.ts`: `extractRecordCitations` (the parse gate). 3. `ui/packages/app-shell/src/views/RecordDetailView.tsx`: the effect beside `holdsRouteRecord`. ## Tests Head `c1b30e6a0b`. Every run went through `scripts/pm/os-verify-lock.sh` on a shared box. - New pins: `plugin-chatbot/src/__tests__/ChatbotEnhanced.recordCitations-37365.test.tsx` (lift through the spec schema; chips; a refused part draws nothing with a CONTROL leg; no fetch on display; related-row quote opens the root record; record-link grammar still refuses a fragment, with a CONTROL); `app-shell/src/views/recordSectionAnchor.test.tsx` (anchor derived as the server derives it; matching by reading with repeats; a same-titled heading the outline does not list, a listed heading the face does not draw, and a heading with no letter or digit each open the field, each with a CONTROL; textarea opens at the field; a heading never drawn settles on the field; stale anchor moves nothing, with a CONTROL; the cleanup unmarks, keeping a class the heading already had; the same section opened again scrolls and marks again); `app-shell/src/views/RecordDetailView.citedSection-37365.test.tsx` (the REAL `RecordDetailView` and the real markdown face: `?section=scope` marks and scrolls the first Scope, `scope-2` the second, a textarea body scrolls to the field, a stale anchor opens the top with a CONTROL, a setext `Scope` above the cited `# Scope` opens the field with a CONTROL, a second chip moves the mark and the same chip again scrolls again, CONTROL a state-keeping replace does not); a new describe in `AiChatPage.recordLink-13037.test.tsx` (the real `ChatPane`: the chip opens `/apps/APP/OBJ/record/ID?section=scope` under a `/_console` and a root mount; each click carries a fresh opened-state value; a related-row quote opens the root record with no section). <details><summary>Whole suites of the four touched packages, at c1b30e6</summary> - `@object-ui/plugin-chatbot`: `Test Files 104 passed (104) · Tests 1089 passed (1089)` - `@object-ui/i18n`: `Test Files 111 passed (111) · Tests 2028 passed | 13 skipped (2041)` - `@object-ui/plugin-detail`: `Test Files 419 passed | 1 skipped (420) · Tests 3968 passed | 18 skipped (3986)` - `@object-ui/app-shell`: `Test Files 2437 passed | 1 skipped (2438) · Tests 23428 passed | 9 skipped (23437)` - All four ran in one lock hold: `VERDICT command-exit 0`, each package exit 0. - `type-check`: app-shell exit 0 at `c1b30e6a0b`. plugin-chatbot, plugin-detail and i18n exit 0 at `60981028c`; this round changes no source of theirs. - Derived gate families: 73 derived, 73 run, every one recorded `exit 0` (`dispatch-gates --ran`: "a DERIVED zero"), `check:type-check-debt` included. </details> <details><summary>Ablation of the parse gate (round 1, at 6098102)</summary> `node scripts/ablation-replace.mjs` replaced the `RecordCitationsSchema.safeParse` lines in `extractRecordCitations` with a bare `Array.isArray` pass-through (anchor x1 to x0, blob `0354c5b73c28` to `400078723215`). The chip test then went red: `Tests 5 failed | 9 passed (14)`; the failing tests were the four refused-part cases and "a part that fails the parse draws nothing". Restored: blob equals HEAD (`0354c5b73c28`) and `git diff HEAD` is empty. plugin-chatbot resolves to `src` through the vitest alias, so no `dist` rebuild was involved. This round does not touch that file. </details> <details><summary>Mutation of the count check (round 2, at c1b30e6)</summary> `node scripts/ablation-replace.mjs` replaced `drawn.length === candidate.count ? drawn[candidate.ordinal] : undefined` in `locateSection` with `drawn[candidate.ordinal]` (anchor x1 to x0, blob `20eec4db25ed` to `f4f48f4f6379`). The two section test files then went red: `Tests 3 failed | 21 passed (24)`. The failures were the same-titled unlisted heading and the listed-not-drawn heading pins in `recordSectionAnchor.test.tsx`, and the setext pin in `RecordDetailView.citedSection-37365.test.tsx`. Restored with `git checkout HEAD --`: blob equals HEAD (`20eec4db25ed`) and `git diff HEAD` is empty. app-shell tests import their own `src`, so no `dist` was involved. </details> ## Acceptance notes - **Which field is the body.** The URL carries only `section`, so the page cannot read the citation's `context` pack. It runs `headingsOf` on every long-text field the record holds (`markdown`, `html`, `richtext`, `textarea`), in field order, and the first whose outline issues the anchor is the body. When the pack's body field holds the anchor, the result is the same. Another long-text field earlier in the field order that has a heading with the same anchor would be opened instead. The alternative, reading the pack's `body.field`, would need `context` on the URL as well; it was not taken. - **A2 (measured: holds only in part).** The drawn face shows headings that `headingsOf` does not list: setext headings, an empty `#`, headings inside a quote or a list, an indented ATX heading, and empty `h1`-`h6` in html. The outline also lists headings the face does not draw, such as a `#` line inside a raw HTML block or a four-backtick fence. With a bare Nth-element rule, each of these shifts every later heading. The rule taken (`locateSection`) has two parts. First, among the field's drawn heading elements, it picks those whose letters and digits read the same as the outline's heading and indexes them by the outline's repeat count. Second, it trusts that index only when the face draws exactly as many headings of that reading as the outline lists. Otherwise it opens the field, and it also opens the field for a heading with no letter or digit. So a differing heading of another title shifts nothing. A same-titled one, or a listed one the face does not draw, opens the field rather than a heading that may be another. A heading whose raw text carries letters the face does not draw (a link's URL) reads differently and opens at the field too. Two headings that normalise alike (`C` and `C++`) are told apart by order, which both sides share. - **Moving the mark (round 2).** The focus cleanup takes the attribute and only the classes the mark added. A second citation on the open record, or the record left, leaves no stale mark. The chat opener puts a fresh `RECORD_SECTION_OPENED_STATE` value on each chip click, and the record page keys the focus on record, anchor and that value. So the same chip clicked again (same URL) scrolls and marks again. The tab and comment writers replace the URL keeping `location.state`, so they do not re-scroll. - **Files beyond the claim's surface.** (1) `ui/packages/plugin-detail/src/DetailSection.tsx` gets one `data-detail-field` attribute on each detail row. Without it the page has no way to find a field, so the textarea and not-drawn cases could not open at the field. (2) `ui/packages/plugin-chatbot/src/chatMessageAdapter.ts` gets one key on `RuntimeOnlyMessageKeys`, the declared place for a new render-only message key. (3) The new helper `ui/packages/app-shell/src/views/recordSectionAnchor.ts`. (4) The chatbot docs page and README. overlap-check is clean against `origin/main` and against objectstack-ai#37436, which shares `DetailSection.tsx` and the 11 locale files (disjoint hunks), and objectstack-ai#37422, which shares the 11 locale files. - **Not covered: a reload.** The chips are drawn from the live stream. When the `/ai` page rebuilds history, it drops any `data-*` part other than charts: `hydratedMessagesToChatMessages`, then `useObjectChat`'s `initialMessages` rebuild, then the browser display cache (`sanitizeChatMessagesForCache`). So a persisted citation list does not come back after a reload yet; objectstack-ai#37487 carries it. Nothing on `main` emits the part before cloud 10c. The changeset and both doc pages say so: the console draws a verified citations part when a live answer carries one. - Clause-②: yes because a new console URL parameter is reserved. `onOpenRecord`'s argument gains an optional member (widening). No spec file changed. ## Verification - Browser: **NOT MEASURED** here. The seat carries it on objectstack-ai#37487's acceptance: scroll under the sticky chrome, ring visibility, the lazy face against the 4 s settle, the phone row, and `html`/`richtext` bodies. In its place, `RecordDetailView.citedSection-37365.test.tsx` renders the real record page with the real markdown face. - Two-minute check: in the console, ask the assistant something an answer with a `data-record-citations` part covers (cloud 10c). Click a chip. Expected: the address is `/apps/APP/OBJ/record/ID?section=ANCHOR`, the cited heading is scrolled into view with the accent ring, and an edited-away heading opens the record at its top. --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc)_ <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…s own refusal (objectstack-ai#37537) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu3zQ2AqeghSGpv6Q7VEPDyQ)_ Fixes objectstack-ai#37512 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:智能体通过 MCP 遇到应用自己按“无权限”声明的多原因拒绝时,现在也能完整拿到每条原因再转告用户;平台安全检查本身的拒绝仍然什么都不多给。 - 为什么做:这是上一轮“多原因拒绝完整转告智能体”审核留下的跟进项;同一个调用者走 REST 接口早已拿到这些原因,MCP 却少给了。 - 出错会怎样:只影响应用声明为“无权限”的多原因拒绝,智能体多看到一段原因文字;安全检查的内部授权信息在任何路径上都不读取,可以直接撤回。 - 要你做什么:无。 ## What changes `packages/mcp/src/mcp-http-tools.ts` only, plus the tests and one changeset. - **S1, the guard's reach (narrowed to the gate's own refusal).** `withRefusalReasonsRelay` now withholds the relay block on a served `PERMISSION_DENIED` with no `declaredCode`: the security gate's own refusal. A listed refusal an app's catalogue declared at `403` under its own code is served as `PERMISSION_DENIED` with that code in `declaredCode` (the doors' demotion of an unregistered code) and now gets the block. `errorResultFromThrown`'s `PERMISSION_DENIED` arm now passes through the same function, so `run_action` / `resume_run` reach it too; that arm still serves no `details` (the objectstack-ai#23529 / objectstack-ai#7450 withholding is unchanged). The relay reads only `refusals` and `userMessage`, never `details`, so the gate's `positions` / `permissionSets` reach it on no path. - **Parity, measured, not argued.** For the same 403 app-code throw, both REST doors' own readers serve the same caller every relayed line as `details.refusals`: `mapDataError` (what the `/data` routes answer with) and `actionsDoorAnswerOf` (what `/actions` answers with, its `userMessage` uncut, closing line included). The dispatcher's withholding arm keys on `isPermissionDeniedError`, which reads `false` for that throw (scratch probe against `plugin-security`'s source: app-at-403 `false`, gate-shaped `true`). So MCP serves nothing REST does not serve the same caller. MCP stays stricter than REST in two places, both left alone: the gate's own literal `PERMISSION_DENIED` carrying a list (REST `/data` would attach it), and `details` on `run_action` for the demoted 403. - **S2, the 5xx arm.** Pinned (a listed throw at 503 on `run_action` and `resume_run`, the only renderers that reach the relay on a fault; on the record tools a declared 5xx never reaches the envelope path). The jsdoc reason is corrected: the doors do still serve `userMessage` on a declared 5xx; the block is withheld because a refusal catalogue declares only a 4xx (`declaredRefusalEntrySchema`), so a listed throw at a 5xx is no catalogue refusal. - **S3, `delete_records` per-row refusals: declared needless, with a pin.** Measured: the per-row group's `reason` is NOT cut. The catalogue throws a coded `SandboxError` whose caller sentence (`innerMessage`) is the same text as `userMessage` (`hook-refusal-catalogue.ts`, both set to `answer.message`), and `rowRefusalOf` reads a coded throw's own sentence, never the door's 500-character cut. So each group already names every line whole, in order, closing line last. No relay block is added, so the grouping shape is untouched; `rowRefusalOf`'s jsdoc says why, and a pin holds a list over 500 characters. - **N3.** `REFUSAL_REASONS_RELAY_LEAD` now reads `Tell the user every line below, whole and in this order, in place of userMessage:` (true on both doors; `/actions` never cuts). ## Tests `packages/mcp/src/mcp-refusal-reasons.test.ts` (the card's harness file; new top-level `describe` blocks), 17 new cases, all through the real HTTP `/mcp` transport: - S1: on each of the five write/action tools, a listed 403 app-code refusal answers two blocks, `content[0]` is `{ code: PERMISSION_DENIED, declaredCode, status: 403 }` with no `details`, `content[1]` is the relay. Parity case: `mapDataError` and `actionsDoorAnswerOf` on the same throw serve `details.refusals` equal to the lines. Control: a gate-shaped throw (`PermissionDeniedError`, literal code, `details.positions` / `permissionSets`) answers one block on every tool, no `declaredCode`, and none of its details' text. - S2: a listed throw at 503 on `run_action` and `resume_run` answers one block, status 503, no `details`. - N1: `query_records`, `aggregate_records`, `get_record`, `get_record_context` and the `delete_records` outer catch each answer the relay, `content[0]` equal to the same throw without a list; `query_records` with an unknown field keeps `notRecorded` / `ifNotRecorded` beside the envelope and the relay after it. - N2: a `FLOW_FAILED` throw that is also listed answers three blocks in order: envelope, flow sentence, relay. - S3: `delete_records` over two rows refused by a six-line list (over 500 characters): one group, `reason` equal to the whole text, its lines the listed lines then the closing line; one content block. - The double gained an `asCatalogue` option (caller sentence = `userMessage`, the catalogue's real shape); the objectstack-ai#37416 cases keep their old double unchanged. <details><summary>Package suite, typecheck, ablations (head 4682eb8)</summary> - `pnpm --filter @objectstack/mcp typecheck && pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2`, under the verify lock: `VERDICT command-exit 0`; Test Files 86 passed (86), Tests 1557 passed (1557) (1540 on main + 17); `check:test-typecheck: OK`. - Ablation S1 (`node scripts/ablation-replace.mjs`, anchor `PERMISSION_DENIED && served.declaredCode === undefined)` to the bare code check; blob 0754dee to 5fe5f300): 5 failed / 26 passed, the five per-tool 403 cases. Restored: blob equals HEAD, `git diff HEAD` empty. (A first attempt with a replacement that already occurred in the file was refused by the tool before any run: counted 5 to 5; re-run with a distinct marker.) - Ablation S2 (the `isServerFault` guard deleted; blob to fa47a2ee): 2 failed / 29 passed, the two 503 cases. Restored, `git diff HEAD` empty. - Ablation S1 on `/actions` (the `PERMISSION_DENIED` arm back to `codedErrorResult(envelope)`; blob to 4f91d8a8): 2 failed / 29 passed, the `run_action` / `resume_run` 403 cases. Restored, `git diff HEAD` empty. - The tests import `src/` relatively, so no rebuild was needed for the ablations. </details> ## Acceptance notes - Premise corrections, measured: S2's "a catalogue entry may declare a 5xx status" does not hold at authoring (`declaredRefusalEntrySchema` takes 400 to 499; the hook and action schema tests refuse 500 / 503); the arm is defence for a hand-built listed throw. S3's "keeps the cut sentence" does not hold for the catalogue's throw (see What changes); it held only for the objectstack-ai#37416 test double, whose caller sentence is the bare code. - Not changed: `run_action` / `resume_run` still serve no `details` on any `PERMISSION_DENIED`, including the demoted 403, while REST `/actions` serves its `details.refusals`. The relay block now carries those lines, so nothing an agent needs is missing; widening `details` there is outside this card. - L2: the diff narrows a permission-keyed withholding guard, so `Security-touching` reads yes for the reviewer; no exposure found (the relay reads no `details`). ## Verification <details><summary>Derived gates (67), on 4682eb8</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` (3 paths vs merge base 54ea3c8): 67 derived; 66 exit 0. One NOT MEASURED: `pnpm check:dual-build-cjs-loads` exit 3 (PREREQUISITE NOT MET: needs the whole workspace built; CI Build Core runs it). - `--ran` reconciliation with exit codes recorded: 67 accounted, 66 run, 1 NOT-MEASURED (derived from the recorded exit 3), 0 UNRUN. - `node scripts/pm/overlap-check.mjs`: clean against origin/main and objectstack-ai#37436. </details> CI check-runs are the authority for every family. Two-minute check: `pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 src/mcp-refusal-reasons.test.ts`. Expect 31 passed. Read first: `withRefusalReasonsRelay` (the narrowed guard and its jsdoc), the `PERMISSION_DENIED` arm of `errorResultFromThrown`, and the parity case in the test file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgVUz5oS8fMgmncxU96 <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgVUz5oS8fMgmncxU96 --> Co-authored-by: Claude <noreply@anthropic.com>
…ch whole lane, and draws a lane past the first page (objectstack-ai#37511) Fixes objectstack-ai#37327 Clause-②: yes (widening) — @object-ui/i18n kanban.notLoaded Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:列表里的看板按没有选项的字段分泳道时,泳道标题的数量、底部的计数和标题旁的合计,现在按整条泳道的全部记录计算(例如 30,不再是第一页的 13);按查找字段分道时,记录全在第一页之后的泳道也会画出来,并写明有多少张卡片没有加载。 - 为什么做:看板泳道统计这一族的收尾,上一张卡修好了底部的合计/平均/最小/最大,这里补上数量、合计和缺失的泳道,替按客户分组看商机的销售用户解决数字偏小的问题。 - 出错会怎样:数据源不支持分组统计时,数字退回为当前页的数字并标上「+」,不会显示错误的整数;可直接撤回。 - 要你做什么:无 ## What changes On ListView's rows-handed board (lanes from the data: a lane field with no options, such as a lookup, one page of records handed in together with `laneStatisticQuery`; the lanes past the page are drawn for a lookup only), the board's one grouped lane read now answers every lane figure the page cannot: - `KanbanLaneStatistic.ts`: `compileLaneReadQuery` generalises the objectstack-ai#36871 read. Beside the view's statistic it can ask each lane's `COUNT(*)` (alias `count`, `LANE_COUNT_ALIAS`) and the `SUM` of the view's `summarizeField`; it is still ONE grouped aggregate per board. `compileLaneStatisticQuery` delegates to it and compiles the same query as before. New readers: `readLaneCounts` (null on a partial answer) and `readLaneKeys` (the lanes the answer names, null on a partial answer); `LaneFigureReading` takes an optional `alias`. - `ObjectKanban.tsx`: on the hosted, flat board (`hostLaneRead`) the read is asked whether or not the view draws a statistic, with the count and, where the header total is drawn, the total. The read now waits for the object definition, so it is asked once. The answer gives `hostLaneCounts` (a new board prop), `headerTotals` (the header summary's `figures`), and the lanes past the page: lane keys the page does not hold are appended after the page's lanes (`boardColumns`), titled by one read of the referenced records on the lane field's target object, by the key until that answers. - `KanbanImpl.tsx`: `KanbanBoardProps.laneCounts`. A flat lane writes the whole count (`wholeLaneCount`); while the read is pending or cannot answer (no door, a refusal, a partial answer) it writes the page count marked `+`. The foot `count` and the column limit read the same count. `LaneTotal` reads the whole lane's sum off `figures`, else the page's sum marked `+`. - `KanbanBoardCore.tsx`: forwards `laneCounts` (a prop, never a schema key). - `ui/packages/i18n/src/locales/*.ts` (11 packs): new key `kanban.notLoaded`; `count-families-11445.test.ts` lists it as a count-neutral tally. - `.changeset/37327-kanban-lookup-lane-whole-counts.md`: patch, `@object-ui/plugin-kanban` and `@object-ui/i18n`. `Clause-②: yes (widening)`: `kanban.notLoaded` joins the exported `TranslationKeys` type; nothing is removed or renamed. `Metadata-protocol: none`. Mechanism readings (dispatch A1 to A3): - A1: whole-lane figures, no marking. The count and the total ride the read objectstack-ai#36871 already asks: one grouped aggregate per board, never one per lane. On a board with no lane statistic this is one new read per board where objectstack-ai#36871 asked none; one more read (the referenced records' titles) runs only when a lane past the page exists. - A2: the lane set past the page comes from the grouped read's group keys (`readLaneKeys`), not from the page. - A3: `ListView.tsx` is untouched. The fix lives in `ObjectKanban.tsx` and `KanbanLaneStatistic.ts`: the claim's file surface put "the grouped lane read objectstack-ai#36871 added" in `KanbanBoardCore.tsx`, but objectstack-ai#36871 put it in `ObjectKanban.tsx`. `overlap-check` at head: clean; objectstack-ai#37436 shares `ObjectKanban.tsx` and merges cleanly. ### Rework round 1 (seat record 7188888406, note 7188910951) - **S1**: a lane drawn from the read with no card on the page says `Cards not loaded: 10` instead of `No cards`. New key `kanban.notLoaded` in all eleven packs (`Label: N` in each, so it is listed as a count-neutral tally in `count-families-11445.test.ts`). - **S2**: restricted. Past-page lanes are drawn only over a lane field that names the object it references (`laneTargetObject`); any other option-less lane field (text, number, boolean, date) draws the page's lanes only. Whole counts and totals still apply to every option-less field, falling to marked page figures where a key does not match. - **S3**: pins for a refused read and a cut read (`hasMore`) on the real ListView board, the filter scope of the count read in the rig, the search pair and filter of a count-only read in the plugin-kanban suite, and unit pins for `readLaneCounts` / `readLaneKeys`. - **S4**: a lane read's `sum` (the header total and the objectstack-ai#36871 foot `sum`, folded groups included) is printed without binary residue (`withoutBinaryResidue`, 15 significant digits: the server's SUM carries no inputs to measure the widest scale from). Float pin: 0.1 + 0.2 reads `0.3`. - **S6**: the title read projects `$select: ['id', ...title fields]` (the lane field's `displayField`, then the target's name field; every field when the target has only a legacy `titleFormat`). A code comment says why it is an id-IN read: the public aggregate door refuses a dotted `groupBy`, and the list is bounded by one page of groups. - **N3**: changeset reworded: "lanes from the data" for counts and totals, "lookup" for past-page lanes, the Uncategorized lane's whole count stated, `@object-ui/i18n` patch added. ## Tests New top-level describe in the objectstack-ai#36871 rig `ui/packages/app-shell/src/__tests__/listKanbanEveryRecord-12619.test.tsx`: 70 deals, 0 to 59 alternating over `acc-a` / `acc-b`, 60 to 69 all `acc-c` (past the first page of 25). A rig self-check asserts 25 cards (13 / 12) drawn. Each pin has a control over a source with no grouped door: - Header counts read 30 / 30, never 13 / 12, off ONE read asking only `COUNT(*)`. A foot `count` reads 30 / 30. CONTROL: no door reads `13+` / `12+`. - A lane for `acc-c` is drawn, titled `Cyan Corp` (its account), with 0 cards and count 10. CONTROL: no door draws no such lane. - The `summarizeField` header total reads 870 / 900 / 645, never 156 / 144, off the same one read (`count` + `sum_amount`). CONTROL: no door reads `156+` / `144+`. Round 1 adds, in the rig: refused-read and cut-read CONTROLs (`156+` / `144+`, `13+` / `12+`, no past-page lane), filter scope (25 / 25 / 10 under amount above 9), `Cards not loaded: 10`, a text-laned board (30 / 30, no `bronze` lane), a float total (`0.3`), and the projected title read. In `ObjectKanban.laneStatistic-36370.test.tsx`: the count-only read's filter and search pair, and a `readLaneCounts` / `readLaneKeys` / sum-fold describe. <details><summary>Round 1 ablations (head 866e4bd, baseline 55/55 over the rig and the plugin-kanban suite, every leg restored to HEAD, git diff HEAD empty)</summary> - S1 `notLoaded` forced false: 1 failed (the not-loaded pin). - S2 `laneTargetObject` gate removed: 1 failed (the text-laned board draws `bronze`). - S4 `withoutBinaryResidue(total)` changed to `total`: 2 failed (the unit fold and the rig's float total). - S6 `$select` spread emptied: 1 failed (the title-read pin). </details> <details><summary>Ablations (committed first, ablation-replace.mjs on ObjectKanban.tsx, restored blob a099dc1 == HEAD each time)</summary> The vitest config aliases `@object-ui/plugin-kanban` to its `src/`, so no dist rebuild sits between mutation and run. - counts: `laneCounts={hostLaneCounts}` changed to `laneCounts={undefined}`. Anchor 1 to 0, blob a099dc1 to afe97a7a4ed1. 4 failed / 12 passed: both count pins, the count CONTROL and the past-page lane's count. - lanes: `extraLaneIds.length === 0` changed to `extraLaneIds.length >= 0`. Blob to 41dee11b0e25. 2 failed / 14 passed: the past-page lane pin and the header-total pin, which reads that lane. - total: the header summary's `figures` spread changed to an empty spread. Blob to db34e1679cef. 1 failed / 15 passed: the header-total pin. </details> <details><summary>Suites and type-checks</summary> - `vitest run packages/plugin-kanban/ packages/plugin-list/` at 1cd8950: Test Files 275 passed, Tests 2651 passed. - After merging origin/main (head 89e65ab, closure rebuilt): `plugin-kanban` and `app-shell` `type-check` exit 0. The rig, `ListView.kanbanOwnsLanes-12619` and `ObjectKanban.laneStatistic-36370`: Test Files 3 passed, Tests 56 passed. </details> ## Acceptance notes Carried on cards (seat finding S5), not fixed here: - objectstack-ai#37516: the Uncategorized lane is not drawn when every empty-lookup record sits past page one. - objectstack-ai#37517: loading the cards of a past-page lane. - objectstack-ai#37326 (widened, 7188972467): swimlane page counts on this board. - Accepted nits, unchanged: N1 (`+` over-marks a whole page when no read answers), N2 (whole counts unmarked while a re-ask is in flight), N4 (one refused aggregation drops the counts too; a lane field named `count` compiles to no read), N5 (raw-key titles for unreadable or deleted references; extra-lane order follows the answer). ## Verification - Read first: `ObjectKanban.tsx` at `hostLaneRead` / `laneStatisticQuestion` / `extraLaneIds` / `boardColumns`; `KanbanImpl.tsx` at `wholeLaneCount` and `LaneTotal`; `compileLaneReadQuery` in `KanbanLaneStatistic.ts`. - Two-minute check: `cd ui && pnpm exec vitest run packages/app-shell/src/__tests__/listKanbanEveryRecord-12619.test.tsx`. Expect 23 passed, with the 37327 describe's 14 pins. <details><summary>Derived gate families (local subset, head 1cd8950; the merge since changes no file of this diff)</summary> `dispatch-gates --ran`: 38 derived, 37 run, 1 NOT-MEASURED, 0 UNRUN. All 37 exit 0. NOT-MEASURED: `pnpm --dir ui exec vitest run scripts/`, which needs a full ui build; no file in this diff is under `ui/scripts`. Left to CI. </details> repo:objectstack#5 · os-bill · session_01Utp6Ca6EBDpTBZk8v46Jjv Round 1 local gates at head 866e4bd: `dispatch-gates --ran` 41 derived, 40 run and all exit 0, 1 NOT-MEASURED (`pnpm --dir ui exec vitest run scripts/`, needs a full ui build; CI Test UI green). CI at head 866e4bd: 47 success, 15 skipped, 0 failed. ### Rework round 2 (seat record 7191224755, verdict 7191238306) - **S7**: the changeset and this body declare `Clause-②: yes (widening) — @object-ui/i18n kanban.notLoaded`. Level stays patch. - **N6**: fixed. The `withoutBinaryResidue` comment now says a non-integer sum of more than fifteen significant digits loses its last digit, which the page path kept. Comment only. - **N7**: carried to objectstack-ai#37516 (comment 7191410356): the title projection skips later name-ladder rungs, and the title read does not wait for the target definition. It is a code change, and this round is declarations and text only. - **N8**: this body's changeset list, board wording and check counts are refreshed. Round 2 head c0bb509 (changeset line and one comment). Local: the changeset families (`check-changeset-no-major`, `check-empty-changeset`, `check-adr-0087-registration`, `check:changeset-gate-self-tests`), `check:nul-bytes` and `check-closing-keyword-parity` all exit 0; the other derived families read no file this round changed and were green at 866e4bd. CI at head c0bb509 (push run, before this body edit re-runs the body-reading checks): 45 success, 13 skipped, 0 failed. <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6Ca6EBDpTBZk8v46Jjv --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…and the palette prefill (objectstack-ai#37888) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu7gWK41QJR6jihChx1HnxCf)_ Part of objectstack-ai#37448 Open surface: the in-app assistant acting for a person. Its writes run in the AI service, which does not read the hand lock, so this pull request does not cover it; card objectstack-ai#37898 carries it. The field descriptions, the metadata-form help texts and the MCP `describe_object` guidance name it as the one surface that does not honour the lock yet. Every other surface the card lists is covered, and so is the calendar's quick-create, which the contract review (7214835610) found writing a locked field. Clause-②: no Metadata-protocol: semantic Skills-docs: none — no page under skills/** teaches `uiReadonly` or the hand lock (grep on main), so no skill sentence becomes false ## 维护者速读 - 改了什么:手动锁(`uiReadonly` / `uiReadonlyWhen`)现在在 Gantt(拖动、调整、进度、连线、就地编辑、自动排程、撤销重做)、工时表单元格、日历快速新建和命令面板预填上都生效。 - 用户会看到:被锁的字段在这些界面上改不动,Gantt 会把条退回并提示“只读”;工时表锁定的格子变成只读,全局锁定时不再出现“添加行”;日历的标题或日期字段被锁(含服务端只读)时,点空白日期改开完整新建表单。 - 没覆盖的:应用内助手代人写入(在云端 AI 服务里,不读这个锁),描述里已写明,由 objectstack-ai#37898 承接。 - 风险:只收紧手动编辑;API、导入、动作、流程写入不变。 ## What changes Each surface reads the one verdict of `@object-ui/core` (`fieldReadOnlyByHand`, or its static half `fieldStaticallyReadOnlyByHand` where no record exists yet) with the shell's predicate scope (`usePredicateScope`). - **Gantt** (`@object-ui/plugin-gantt`, new `ganttHandLock.ts`). - `ganttPatchByHand` judges each write over the stored record inside `handleTaskUpdateDefault`, the handler every bar write reaches: drag, resize, progress handle, in-place edit, auto-schedule, conflict reschedule, and undo/redo (which skips `onBeforeTaskUpdate`, so the gate sits on the write itself). A write that changes a locked field is refused: nothing is sent, the bar is put back and a toast gives the read-only reason. A locked field the write leaves unchanged is dropped from the patch, so an in-place title edit still saves when the dates it echoes are locked. Dates compare as instants. - `persistDependencies` judges a drawn link over the target record's dependencies field. - `ganttHandLockedInteractions` narrows the authored interaction switches by the static half: a move closes when either date is locked, a resize only when both are, and the progress handle and the link tool close with their own field. An authored `false` stays `false`. - ObjectGantt fetches its own rows without `$select`, so the predicate operands are on the record. - **Timesheet** (`@object-ui/plugin-timesheet`). `cellEditable` takes a `lockedByHand` judge: a cell whose record's value field is locked by hand is read-only, so it is neither edited nor cleared. A row, date or value field locked on every record closes the create (`grants.create`), which also hides **Add row**. `writeCell` refuses a locked update or delete like a `readonly` one. The timesheet fetch has no `$select`, so the operands are on the record. - **Calendar quick-create** (`@object-ui/plugin-calendar`, `ObjectCalendar.tsx`). A create is judged by the static half (`fieldStaticallyReadOnlyByHand`), as the create dialog judges it. Where a field the dialog writes itself (the title field, the start or end field) is locked on every record, `quickCreateLockedOwnFields` sends the day click and the range drag to the host's full create form, and a locked date field is left out of that form's prefill. The static half also answers `readonly: true`, so a server-locked title or date field now hands off the same way, where `main` opened the dialog and the server dropped the value on insert. A required locked field is left out of the dialog's write (the auto-fill loop skips it), so the server applies its `defaultValue`; `requiredFieldsQuickCreateCannotFill` counts one with no `defaultValue` as unfillable, so the gesture is handed off rather than offering a write that would be refused. With no host form, nothing is offered, as before. - **Command palette** (`@object-ui/app-shell`, `paletteCreate.ts`). The create-as prefill skips a `uiReadonly` field, as it already skipped `readonly`. A create is judged by the static half only, as the create dialog judges it. - **List view** (`@object-ui/plugin-list`). `editedInPlace` takes the kanban lane field the board actually uses (`kanbanLaneFieldOf`: the block's `groupByField`, else the object's detected lifecycle field), so the lane field's lock operands are in `$select` even when the block names no `groupByField` (scope addition from comment 7187109328). - **Kanban swimlane drag.** No code change: a drop on the swimlane layout passes only column ids to `onCardMove`, so the write is the lane (column) field alone, and the existing lane-field gate in `ObjectKanban.handleCardMove` holds there too. Now pinned. - **N8 (`BEHAVIOUR_SEGMENTS`).** `uiReadonlyWhen` is not added. The key is authorable only on field definitions under `objects`, which `bucketFor` already reads as behaviour; `readonlyWhen` is in the set because inline-grid columns (a `columns` display segment) carry it, and those columns have no hand lock. A pin in `validate-field-consumers.test.ts` proves both keys already credit the fields they name; the lint source is unchanged. - **Prose.** The `uiReadonly` / `uiReadonlyWhen` JSDoc and `.describe`, their metadata-form help texts (all eleven locales), the MCP `describe_object` guidance and its code comment, and the `handLock.ts` header now say every console surface honours the hand lock, and each names the in-app assistant acting for a person as the one that does not yet. The `uiReadonly` surface lists add "calendar drag and quick-create" (`uiReadonlyWhen` does not: a create is not judged by the conditional half). The liveness evidence (`packages/spec/liveness/field.json`) cites the new readers: `ganttHandLock.ts#ganttPatchByHand`, `ObjectTimesheet.tsx#valueLockedByHand`, and the calendar's quick-create. N7: the `cel-field-ui-readonly-when` row of the expression-conformance ledger is reworded (the edit dialog and grid cell call `resolveFieldRuleState` directly; every other surface goes through `fieldReadOnlyByHand`) and lists the Gantt and timesheet readers. ### Small decisions taken in this pull request - Gantt: a move closes on either locked date, a resize only on both (the locked edge is refused on the write); a locked but unchanged field is pruned from the patch rather than refusing it; a refusal toasts the read-only reason; in-place edit stays open and is judged on the write. - Timesheet: any statically locked row, date or value field closes the create (and Add row); a locked record's cell is read-only, which also blocks clearing it. - Calendar quick-create: a locked field the dialog writes itself hands the gesture to the full form rather than closing it; a locked date field is not prefilled there; a required locked field with a default is left out of the write, one without counts as unfillable. - Palette: static half only. - List view: the detected lane field is always harvested. - N8: not added, reason above. - `Metadata-protocol: semantic` where the claim had `none`: the keys' descriptions change what an author's `uiReadonly` / `uiReadonlyWhen` does (five more surfaces lock), so the changeset is `minor` on the packages that move behaviour. ## Why Phase 1 (objectstack-ai#37436) routed the dialogs, record page, grid, kanban column drag and calendar drag through `fieldReadOnlyByHand`, but a person could still change a hand-locked field from the Gantt, the timesheet cell and the palette's create-as prefill. The card asks the lock to hold on every console surface. ## Tests One pin per surface; each was ablated with `scripts/ablation-replace.mjs` and went red, then the file was restored (`git diff --quiet HEAD`). | Surface | Pin | Ablation | Red | |:--|:--|:--|:--| | Palette prefill | `CommandPalette.previewCreate-36286.test.tsx` | `fieldStaticallyReadOnlyByHand(field)` → `field.readonly === true` | 1 | | List view lane operand | `ListView.lockOperandSelect-36806.test.tsx` "the lane field the board detects when the block names none" | `kanbanLaneFieldOf(...)` → the block's `groupByField` | 1 | | Gantt write | `ObjectGantt.harness.test.tsx` "ObjectGantt.handLock-37448" | verdict forced to `write` | 2 | | Gantt link | same describe, link test | link gate forced open | 1 | | Gantt interactions | same describe, static test | lock defs passed as `undefined` | 1 | | Timesheet cell | `ObjectTimesheet.test.tsx` "the field hand lock" | `lockedByHand(...)` line disabled | 2 | | Timesheet create | same describe | `&& !createLockedByHand` removed | 2 | | Kanban swimlane | `ObjectKanban.handLock-36806.test.tsx` "a drag on the swimlane board" | lane `fieldReadOnlyByHand` forced false | 1 | | Calendar quick-create, own fields | `ObjectCalendar.quickCreateHandLock-37448.test.tsx` | `quickCreateLockedOwn.length === 0` made always true | 3 | | Calendar quick-create, prefill | same file | the prefill's locked-key filter made a pass-through | 2 | | Calendar quick-create, unfillable | same file | the locked branch of `requiredFieldsQuickCreateCannotFill` disabled | 1 | | Calendar quick-create, auto-fill | same file | the auto-fill loop's locked-field skip disabled | 1 | Each Gantt, timesheet, kanban and calendar describe also carries a CONTROL (an unlocked record or field still writes; on the calendar, a `uiReadonlyWhen` does not judge the create). ## Acceptance notes - The in-app assistant is the open surface named above; it needs the hand lock judged where the assistant's writes run. Card objectstack-ai#37898 carries it. ## Verification Head `1916ae98` (main merged in twice; no conflict, the merges bring only `main`'s content). CI on the head: 61 success, 9 skipped, none failed. - Affected suites: UI (plugin-gantt, plugin-timesheet, the ListView operand pin, the kanban hand-lock pin, app-shell `chrome/`, core `evaluator/`) 1650 passed, 148 skipped; UI plugin-calendar and core `evaluator/` after the rework 1105 passed, 122 skipped; `@objectstack/spec` `src/data` 6893 passed; `@objectstack/mcp` 1589 passed; `@objectstack/platform-objects` 2214 passed; `@objectstack/lint` `validate-field-consumers.test.ts` 203 passed. After the last merge the new calendar pin re-ran: 7 passed. - `pnpm --filter @objectstack/spec run check:generated` passes on a fresh spec build (docs, liveness state counts and api-surface included); `check:liveness` passes; `node scripts/check-i18n-bundles.mjs` OK; `node scripts/check-nul-bytes.mjs` passes. - `node scripts/pm/dispatch-gates.mjs --commands` (122 commands) ran on the first head: every one passes except three that refused on a missing prerequisite (no verdict): `check:skill-examples`, `check:dts-closure` and `check:dual-build-cjs-loads`, which read `.d.ts` files this container built without (`OS_SKIP_DTS=1`). On the rework the families its paths touch were re-run, all exit 0: `check-changeset-no-major`, `check-empty-changeset` (and `--self-test`), `check-issue-citations`, `check:changeset-gate-self-tests`, `check:doc-authoring`, `check:i18n`, `check:i18n-stale-fill`, `check:issue-citations`. - Package type-checks were not measured locally (the workspace's dependent declarations are not emitted here); CI's `TypeScript Type Check` and `Type Check UI` are green on the head. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (only describe and JSDoc text moved there). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A changeset with both declaration lines, here and in the changeset. - [x] 6. `packages/spec` generated artifacts 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. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgWGbDsK1qEW72jibhi --> --------- 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>
Requested by Bill · project thread
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
Fixes #36806
Clause-②: yes
Metadata-protocol: added
Skills-docs: follow-up #37405
维护者速读
uiReadonly/uiReadonlyWhen:控制台所有手工编辑面锁住该字段,动作、导入、API、流程照常写入。uiReadonly与readonly同为 true 时被拒。@object-ui/core的fieldReadOnlyByHand;看板顺带修好:readonly分组字段此前可拖动且写入被静默丢弃。uiReadonlyWhen求值失败即锁定、编辑表单拒绝提交,os validate检查该槽;表格与列表视图取回锁谓词的操作数;描述只列出已生效的界面(其余见 uiReadonly / uiReadonlyWhen: honour the hand lock on the remaining console surfaces — Gantt drag and in-place edit, timesheet cell write, kanban swimlane drag, the in-app assistant acting for a person, and palette prefill #37448)。What changes
Ruling 7180466652 (scope items 1–6), surface per claim 7180490513 and amends 7180683371, 7181406682, amend 3 and 7182190475.
Spec (
packages/spec)Field.uiReadonly: booleanandField.uiReadonlyWhen(CEL, the same scope asreadonlyWhen), both optional with no default (absent = unlocked, so no parsed field grows a key), with describes and TSDoc.superRefinerefusesuiReadonly: truebesidereadonly: trueat['uiReadonly'](every door that parses a field).uiReadonlyWhenbesidereadonlyWhenis accepted.deriveInlineGridColumnsskips auiReadonlychild field, as it skipsreadonly.uiReadonly/uiReadonlyWhen(live); regenerated reference docs, authorable-surface record and state counts.field.form.ts) offers both rows besidereadonly/readonlyWhen(uiReadonlyWhenas a CEL code row). The label and help text of each are translated in all 11 metadata-forms locale packs (packages/platform-objects, the generator re-run after the leaf values, so no fill hash is left); the translated-leaf count pin moves 837 → 839.Console (
ui/packages/**)@object-ui/core:fieldReadOnlyByHand(def, record?, ctx?),fieldStaticallyReadOnlyByHand(def),fieldHasConditionalHandLock(def)(newevaluator/handLock.ts).resolveFieldRuleStatetakesuiReadonlyWhen(rules) anduiReadonly(statics) into itsreadonlyverdict; a faulteduiReadonlyWhenfails CLOSED (no server judges it), unlikereadonlyWhen.filterSystemFields,filterCreateModeFields,disabled) and the submitted payload (sanitize.ts); form renderer and wizard passuiReadonlyWhen; record page inline edit (DetailSection,InlineEditSaveBar,RecordDetailPanel, stage path), highlight-strip chip (HeaderHighlight), related list; grid inline edit (fieldInlineReadOnlyKind,cellReadOnlyKindnow judges the row, which the data table's paste and multi-row staging read) and the required prompt; kanban drag (cardsMovableand a refusedhandleCardMove); calendar drag (onEventDrop,endEditable, and the drop handler over the record); line-item grid (deriveMasterDetailcarriesuiReadonlyWhenonto the column;GridFieldWidgetfolds it per row); edit-form state lock (editFormLockedByState).readonly: import mapping (importTargetFields.ts), Studio/designer reads, calendar quick-create's required exemption (it mirrors the engine insert).Server
packages/objectql/**): the strip keys onreadonlyalone, so REST, import, actions and flows write a hand-locked field and the object's validations judge each write.describe_objectreportsuiReadonly/uiReadonlyWhenas their own keys where set, on HTTP (runtime/domains/mcp.ts) and stdio (mcp/mcp-server-runtime.ts); the tool description names them (mcp-http-tools.ts).driver-sqlstorage class (presentation),metadata-coreFLS reference positions (uiReadonly: keep,uiReadonlyWhen: expression),/meta/typesfield count 87 → 89.Review rework (L1 7183712080, contract record 7183704697)
usePredicateScope) tofieldReadOnlyByHand: grid cell, record page (inline edit, highlight chip, save bar, stage path), kanban drop, calendar drop. The grid's own row load (objectGridRowLoad.ts) andListView's$selectfetch the operands of thereadonlyWhen/uiReadonlyWhenof every shown column, the kanban lane field and the calendar start / end fields, through the same FLS and declared-field gates as the other harvests.uiReadonlyWhenthat cannot be evaluated (a parse error, an operand the row lacks, an unbound root) fails CLOSED (UI_READONLY_WHEN_FAULTED): no server judges the hand lock, so the field locks. The edit form refuses to submit and names the field and the rule (form.uiReadonlyWhenFaulted, all 11 ui locales).os validatechecks the slot as it checksreadonlyWhen(validate-expressions.ts: the record-scoped check plus the field-rule root verdict, with its own consequence clause).hydrateColumnscarries the child field'suiReadonly/uiReadonlyWhenonto an authored line-item column, typed or not;GridFieldWidgetlocks auiReadonlycolumn on every row. Gantt, timesheet, swimlane, the assistant and N3palettePrefillFieldare uiReadonly / uiReadonlyWhen: honour the hand lock on the remaining console surfaces — Gantt drag and in-place edit, timesheet cell write, kanban swimlane drag, the in-app assistant acting for a person, and palette prefill #37448.uiReadonlyWhenis judged on an existing record only: the describe, the liveness note and the Studio help say so (help retranslated in 10 locales, generator re-run, no fill hash).describe_objecttext name the surfaces that honour the keys;uiReadonly's describe says arequiredfield withoutdefaultValuefails every console create.metadata-core,platform-objects,lint,plugin-list,i18n.Delta rework (contract 7186595753, L1 7186604968)
uiReadonlyWhenon a stored line only (rowHasId): a new line is not judged, as the create dialog does not judge it.ObjectGridhas no inline add-record row (addRecordFormopens the create dialog), so no second site exists.metadata-core) deletes auiReadonlyWhenthat reads a field denied to the caller and now serves the fielduiReadonly: truein its place (unless it is alreadyreadonly), so the lock never opens for that caller. TheListView.tsxcomment says so.readonlyWhenon both evaluation paths. N5 (detected kanban lane field) is carried on uiReadonly / uiReadonlyWhen: honour the hand lock on the remaining console surfaces — Gantt drag and in-place edit, timesheet cell write, kanban swimlane drag, the in-app assistant acting for a person, and palette prefill #37448.Main merge and queue fix
3eb2bcf8merges main after feat(units): show a quantity with its unit label (#35490) #37449 landed and keeps both...lockOperandFieldsand...quantityUnitFieldsinextraFields.73681b48regeneratesobject.mdxfrom the merged tree.30090e73adds the expression-conformance ledger rowcel-field-ui-readonly-whenfordata/field.zod.ts:FieldSchema.uiReadonlyWhen(packages/qa/dogfood/test/expression-conformance.ledger.ts: cel, interpret, enforced, fail-closed, UI only, proofhandLock-36806.test.ts). The row was added after a merge-queue dequeue (run 45802787226), because PR-side CI does not runpackages/qa/dogfood/test/expression-conformance.test.ts. That test now passes 8 of 8 locally.Tests
packages/spec/src/data/field-ui-readonly.test.ts: parse and absence, the refusal (codecustom, path, message) at the field and object doors, controls, line-item column skip.packages/qa/dogfood/test/ui-readonly-hand-lock-36806.dogfood.test.ts(booted stack, HTTP): a PATCH to theuiReadonlyfield lands with noX-ObjectStack-Dropped-Fields(control: thereadonlysibling is stripped and advertised); thestate_machinerefuses an illegal move with status 400, codeVALIDATION_FAILEDand its own message on the PATCH, action and import doors; a create without the field lands ondefaultValue; an API create outsideinitialStatesis refused by the machine.packages/runtime/src/domains/mcp-object-hand-lock-36806.test.tsand a block inpackages/mcp/src/__tests__/mcp-server-runtime.test.ts: both keys reported only where set, never folded intoreadonly.core/evaluator/__tests__/handLock-36806.test.ts,plugin-form/__tests__/dialogHandLock-36806.test.ts,plugin-detail/__tests__/DetailSection.doubleClickEdit.test.tsx(hand-lock block),plugin-grid/objectGridCellFacts.handLock-36806.test.ts,plugin-kanban/ObjectKanban.handLock-36806.test.tsx,plugin-calendar/__tests__/ObjectCalendar.handLock-36806.test.tsx,fields/widgets/GridField.handLock-36806.test.tsx,plugin-form/deriveMasterDetail.test.ts(line-item block);typesFormField coverage list gainsuiReadonlyWhen.Acceptance notes
readonlyfield was draggable and its PATCH was silently stripped. Both locks now stop the drag.uiReadonlyis.optional(), not.default(false): absent means unlocked, and no parsed field or snapshot grows a key.extraFields; resolved in the main merge3eb2bcf8, keeping both.palettePrefillField(uiReadonly / uiReadonlyWhen: honour the hand lock on the remaining console surfaces — Gantt drag and in-place edit, timesheet cell write, kanban swimlane drag, the in-app assistant acting for a person, and palette prefill #37448); skills pages (adr: field write locks are two tiers, two forms and two levels (readonly / readonlyWhen vs uiReadonly / uiReadonlyWhen, field over object); the data skill teaches the four spellings #37405).Verification
Local, per os-dev local verification scope (CI runs the full farm):
type-checkin 10 ui packages.fieldStaticallyReadOnlyByHandwithoutuiReadonly→ 8 pins red across kanban, calendar, record page, dialogs and grid.rule-validator.ts) also strippinguiReadonly, built to dist (marker in 4 files) → 4 dogfood pins red (PATCH, the machine's refusal on PATCH, action and import); restored, rebuilt, marker absent.dispatch-gates --commands: 124 derived commands run. Reds not from this diff:check-plugin-teardown-shape --self-test(shallow clone cannot reach its pinned fixture commit),check:platform-checklist(ABSENT SYMBOLFlowItemMoreMenuin areas/automation.json; neither file is in this diff),check:dual-build-cjs-loads(prerequisite: unbuilt packages, nothing measured).type-checkgreen in 9 ui packages and lint;check:generated --fixre-checked clean.withHandLockstatic half off → 1 red; GridField static read off → 1 red; lint slot dropped → 4 red.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5