Repository navigation
feat(units): show a quantity with its unit label (#35490) - #37449
Conversation
#35490) A number field declaring unitConfig draws its unit beside the number in grid, list, form and detail, through one resolver in @object-ui/core and one formatter in @object-ui/fields. Standard codes take the platform's per-locale label and their organization's sys_standard_unit_setting row; organization codes take their sys_unit label and decimal places. The field's scale is the ceiling (ADR-0158 L4). A retired or unreadable unit shows the bare code. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
…e zh-Hant (#35490) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
…35490) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
…35490) Apply the rulings on ADR-0158 Open item 6 and L2: - @objectstack/spec gains STANDARD_UNIT_NAMES, the English base name of every standard code, and standardUnitName (own-property, exact case). - platform-objects bundles serve each code's name per locale as messages.standardUnit<CODE>; English is copied from the spec base. - The UI reads app.messages.standardUnit<CODE> and falls back to the spec base; its own per-locale tables are removed. - A quantity rounds at render, half away from zero, at fixed width min(unit places, field scale); stored values, totals, exports, API and MCP stay exact. No marker. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
📓 Docs Drift CheckThis PR changes 2 package(s): 5 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 — 176 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 58db4ead191a0f528b47adbfe79e4756b86ff60c && git checkout 58db4ead191a0f528b47adbfe79e4756b86ff60c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4925039a7558d6477323eeef7b1b16d89da01cc3 37fca77eee7be2df4c6073dac7c5d9a628ca6552 && git checkout -B drift-repro 4925039a7558d6477323eeef7b1b16d89da01cc3 && git merge --no-ff 37fca77eee7be2df4c6073dac7c5d9a628ca6552
node scripts/docs-audit/affected-docs.mjs --json 4925039a7558d6477323eeef7b1b16d89da01cc3
|
…ns (#35490) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
…rm test (#35490) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
… the component-type gate (#35490) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
The number widget reads it, as it reads currencyConfig; the form-field channel census requires every key it reads to be declared. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Final head: Where the per-locale names are served (measured). The platform-objects translation bundles, in their flat ADR-0158 amendment text (for the ADR owner;
|
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 7b7017e · 2026-11-26T07:08Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Inputs read: card #35490 (body and all six comments), the PR body, the 44-file net diff against ① Derived judgments
② Semver levelClause-②: yes (widening) — accurate for
③ Boundary flags
④ Design judgment
Implementing files.
The ADR-0158 amendment text in 7185000835 against the code. Consistent on Open item 6, L1 / Open item 11, L2 and the follow-up item. Two wordings to tighten when the row is filed on #37245 (no row for this PR is there yet, which is expected before landing):
Other nits:
Findings open on this head: S1, S2, S3. No must-fix. Each should-fix earns a delta review of its fix; S2 and the PR-body half of S3 can close on the prose faces, S1 and the changeset half of S3 move the head. Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
…ield key in the changeset (#35490) Contract review S1 and S3: STANDARD_UNIT_NAMES' jsdoc names the single-segment key standardUnit<CODE>; the changeset ships @object-ui/types as minor with Metadata-protocol: added and names unitConfig on FormField/FormFieldSchema. The form-face comments say nothing there reads unitMode 'code' yet. Adds a negative half-rounding pin. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
ADR-0158 Open item 8 (ruled A): a text field declaring unitMode 'code', and the unitField a record-mode quantity on the same form points at, draw UnitCodeField, a searchable picker of the organization's non-retired units and the standard codes, by name and limited to the declared unitDimension. It stores the code; read-only it shows the unit's name. @object-ui/core adds unitPickerOptions and the pointer helpers; the form stamps the pointer and hands the field its record. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
…over (#37471) The form already reads its configs' .field stash (a ledgered reader); the core helper now takes the metadata alone, so the form-field channel census keeps one reader of that key per module. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
…unit name exports (#35490) The PR declares Metadata-protocol: added. The level gate reads only packages/**/src, and spec's public surface grew by STANDARD_UNIT_NAMES and standardUnitName, so spec carries the minor beside @object-ui/types. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Final head: L1 findings, closed
ADR-0158 amendment text (for the ADR owner;
|
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 37fca77 · 2026-11-26T08:24Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Delta review of the record on ① Derived judgments
② Semver levelClause-②: yes (widening) — still accurate. The delta removes nothing.
③ Boundary flags
④ Design judgment
The picker.
The amendment text in 7186545236 against the code. Consistent on every line. N2: closed — Open item 10 now separates "read but empty" from "not read at all", and Open item 6 says the footer is unchanged. The new Open item 8 line matches the picker as built and correctly limits it to the form face. No must-fix, no should-fix. Nits, none blocking:
S1: closed Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Landing · area o5-D · 2026-11-26T08:33Z · on L1 ACCEPT 7186657457 and delta contract review PASS 7186636273 (
State: ready + auto-merge now. Known overlap: PR #37436 (#36806) edits the same |
Keeps both extraFields entries (lockOperandFields and #37449's quantityUnitFields) in objectGridRowLoad.ts.
…writes keep it (uiReadonly / uiReadonlyWhen) (objectstack-ai#37436) <!-- 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#36806 Clause-②: yes Metadata-protocol: added Skills-docs: follow-up objectstack-ai#37405 ## 维护者速读 - 字段新增 `uiReadonly` / `uiReadonlyWhen`:控制台所有手工编辑面锁住该字段,动作、导入、API、流程照常写入。 - 写入仍由对象校验裁决(如 state_machine),引擎不读这两个键;`uiReadonly` 与 `readonly` 同为 true 时被拒。 - 控制台统一走 `@object-ui/core` 的 `fieldReadOnlyByHand`;看板顺带修好:`readonly` 分组字段此前可拖动且写入被静默丢弃。 - MCP describe_object 把两个键单列上报;导入映射与 Studio 读取保持原样。 - 返工(席位 L1 7183712080):`uiReadonlyWhen` 求值失败即锁定、编辑表单拒绝提交,`os validate` 检查该槽;表格与列表视图取回锁谓词的操作数;描述只列出已生效的界面(其余见 objectstack-ai#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: boolean` and `Field.uiReadonlyWhen` (CEL, the same scope as `readonlyWhen`), both optional with no default (absent = unlocked, so no parsed field grows a key), with describes and TSDoc. - The field `superRefine` refuses `uiReadonly: true` beside `readonly: true` at `['uiReadonly']` (every door that parses a field). `uiReadonlyWhen` beside `readonlyWhen` is accepted. - `deriveInlineGridColumns` skips a `uiReadonly` child field, as it skips `readonly`. - Liveness rows `uiReadonly` / `uiReadonlyWhen` (live); regenerated reference docs, authorable-surface record and state counts. - Studio field form (`field.form.ts`) offers both rows beside `readonly` / `readonlyWhen` (`uiReadonlyWhen` as 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)` (new `evaluator/handLock.ts`). `resolveFieldRuleState` takes `uiReadonlyWhen` (rules) and `uiReadonly` (statics) into its `readonly` verdict; a faulted `uiReadonlyWhen` fails CLOSED (no server judges it), unlike `readonlyWhen`. - Hand surfaces swapped to the helper: create/edit dialogs (`filterSystemFields`, `filterCreateModeFields`, `disabled`) and the submitted payload (`sanitize.ts`); form renderer and wizard pass `uiReadonlyWhen`; record page inline edit (`DetailSection`, `InlineEditSaveBar`, `RecordDetailPanel`, stage path), highlight-strip chip (`HeaderHighlight`), related list; grid inline edit (`fieldInlineReadOnlyKind`, `cellReadOnlyKind` now judges the row, which the data table's paste and multi-row staging read) and the required prompt; kanban drag (`cardsMovable` and a refused `handleCardMove`); calendar drag (`onEventDrop`, `endEditable`, and the drop handler over the record); line-item grid (`deriveMasterDetail` carries `uiReadonlyWhen` onto the column; `GridFieldWidget` folds it per row); edit-form state lock (`editFormLockedByState`). - Stays on raw `readonly`: import mapping (`importTargetFields.ts`), Studio/designer reads, calendar quick-create's required exemption (it mirrors the engine insert). **Server** - Engine untouched (`packages/objectql/**`): the strip keys on `readonly` alone, so REST, import, actions and flows write a hand-locked field and the object's validations judge each write. - MCP `describe_object` reports `uiReadonly` / `uiReadonlyWhen` as 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`). - FieldSchema key censuses classify both keys: `driver-sql` storage class (presentation), `metadata-core` FLS reference positions (`uiReadonly: keep`, `uiReadonlyWhen: expression`), `/meta/types` field count 87 → 89. ## Review rework (L1 7183712080, contract record 7183704697) - **S1** Every surface passes the host predicate scope (`usePredicateScope`) to `fieldReadOnlyByHand`: grid cell, record page (inline edit, highlight chip, save bar, stage path), kanban drop, calendar drop. The grid's own row load (`objectGridRowLoad.ts`) and `ListView`'s `$select` fetch the operands of the `readonlyWhen` / `uiReadonlyWhen` of 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. - **S2** A `uiReadonlyWhen` that 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 validate` checks the slot as it checks `readonlyWhen` (`validate-expressions.ts`: the record-scoped check plus the field-rule root verdict, with its own consequence clause). - **S3(a)** `hydrateColumns` carries the child field's `uiReadonly` / `uiReadonlyWhen` onto an authored line-item column, typed or not; `GridFieldWidget` locks a `uiReadonly` column on every row. Gantt, timesheet, swimlane, the assistant and N3 `palettePrefillField` are objectstack-ai#37448. - **S4** `uiReadonlyWhen` is 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). - **Narrowing, N2** Both describes and the `describe_object` text name the surfaces that honour the keys; `uiReadonly`'s describe says a `required` field without `defaultValue` fails every console create. - **N1** Changeset lines for `metadata-core`, `platform-objects`, `lint`, `plugin-list`, `i18n`. ## Delta rework (contract 7186595753, L1 7186604968) - **S5** The line-item grid judges `uiReadonlyWhen` on a stored line only (`rowHasId`): a new line is not judged, as the create dialog does not judge it. `ObjectGrid` has no inline add-record row (`addRecordForm` opens the create dialog), so no second site exists. - **S6** The FLS reference scrub (`metadata-core`) deletes a `uiReadonlyWhen` that reads a field denied to the caller and now serves the field `uiReadonly: true` in its place (unless it is already `readonly`), so the lock never opens for that caller. The `ListView.tsx` comment says so. - **N4** This body's Console bullet now says fail-closed. **N6** The form's hand-lock fault check short-circuits on `readonlyWhen` on both evaluation paths. **N5** (detected kanban lane field) is carried on objectstack-ai#37448. ## Main merge and queue fix - `3eb2bcf8` merges main after objectstack-ai#37449 landed and keeps both `...lockOperandFields` and `...quantityUnitFields` in `extraFields`. `73681b48` regenerates `object.mdx` from the merged tree. - `30090e73` adds the expression-conformance ledger row `cel-field-ui-readonly-when` for `data/field.zod.ts:FieldSchema.uiReadonlyWhen` (`packages/qa/dogfood/test/expression-conformance.ledger.ts`: cel, interpret, enforced, fail-closed, UI only, proof `handLock-36806.test.ts`). The row was added after a merge-queue dequeue (run 45802787226), because PR-side CI does not run `packages/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 (code `custom`, 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 the `uiReadonly` field lands with no `X-ObjectStack-Dropped-Fields` (control: the `readonly` sibling is stripped and advertised); the `state_machine` refuses an illegal move with status 400, code `VALIDATION_FAILED` and its own message on the PATCH, action and import doors; a create without the field lands on `defaultValue`; an API create outside `initialStates` is refused by the machine. - `packages/runtime/src/domains/mcp-object-hand-lock-36806.test.ts` and a block in `packages/mcp/src/__tests__/mcp-server-runtime.test.ts`: both keys reported only where set, never folded into `readonly`. - UI pins, each surface locked: `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); `types` FormField coverage list gains `uiReadonlyWhen`. ## Acceptance notes - Kanban side fix: the board read no field lock before, so a card grouped by a `readonly` field was draggable and its PATCH was silently stripped. Both locks now stop the drag. - `uiReadonly` is `.optional()`, not `.default(false)`: absent means unlocked, and no parsed field or snapshot grows a key. - Overlaps objectstack-ai#37422 in object-lifecycle-panel-echo-decisions.test.ts count pins (837 → 839 here); whichever lands second merges main and re-adds its delta. - objectstack-ai#37449: one-line union in objectGridRowLoad.ts `extraFields`; resolved in the main merge `3eb2bcf8`, keeping both. - Not in this PR: Gantt drag and in-place edit, the timesheet cell, kanban swimlane drag, the assistant acting for a person, and `palettePrefillField` (objectstack-ai#37448); skills pages (objectstack-ai#37405). - No console screenshots: no example app declares either key, and adding one is outside the claim's surface; the surface behaviour is pinned by the UI tests above and ablated. ## Verification Local, per os-dev local verification scope (CI runs the full farm): - Pins: all new tests pass (spec 5, dogfood 6, runtime MCP 3, mcp stdio block, core 6, dialogs 2, record page 2, grid 4, kanban 4, calendar 5, line-item grid 2 + 1). - Package suites: spec 28,424 passed after the form rows (the one red before them was the form reconciliation pin, fixed by offering the rows); runtime 12,030; mcp 1,512; driver-sql 4,551; metadata-core 1,061; metadata-protocol 23,435; platform-objects 2,161; ui core 4,797, types 10,512, fields 5,033. The remaining ui package suites are reported in the final-head comment. - Typechecks green: spec, runtime (incl. test typecheck), mcp, dogfood, metadata-core, driver-sql, and `type-check` in 10 ui packages. - Ablations (each mutation proven on disk, restored, tree clean): - UI read-only pin: `fieldStaticallyReadOnlyByHand` without `uiReadonly` → 8 pins red across kanban, calendar, record page, dialogs and grid. - Write-keeps pin: the engine strip (`rule-validator.ts`) also stripping `uiReadonly`, 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 SYMBOL `FlowItemMoreMenu` in areas/automation.json; neither file is in this diff), `check:dual-build-cjs-loads` (prerequisite: unbuilt packages, nothing measured). - Rework (head 309363d): new pins core 4, grid cell 2 + harvest 4, ListView 5, form refusal 4, line-item 2, lint 5. Suites green: 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; `check:generated --fix` re-checked clean. - Rework ablations (each mutation landed on disk and was restored): fail-open fault → 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. - Delta rework (S5, S6, N6): pins GridField new line, FLS scrub ×3, form readonlyWhen short-circuit; ablations: each mutation turns its pin red (S5 1, S6 1, N6 1), restored. metadata-core 1,064, fields 5,035, plugin-form 2,796, components form 643 green; typechecks green. - overlap-check: clean against main and every open PR except the objectstack-ai#37422 count pin and the objectstack-ai#37449 union line above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Utp6CXSuJCALDHFWaV6Bv5 <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ut of step with main (week of 2026-11-25) (objectstack-ai#38289) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDypKu7B9nwbu5WuV7AEio8)_ Fixes objectstack-ai#37245 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感;只在十份设计记录里补了带日期的说明,写明主线现在实际怎么做,原有的决定文字一个字没动。 - 为什么做:属于「每周设计记录修订」滚动清单(11 月 25 日这一周);清单每一行指出一处「记录写的和主线不一致」,这次一并补齐,免得照着记录干活的人被过时说法带偏。 - 出错会怎样:最坏是某条补充说明写得不准,读这些设计记录的人会碰到;纯文档、只增不删,可以直接撤回,不影响任何功能。 - 要你做什么:请审这些补充说明并亲手合并(设计记录须由你本人合)。 ## What changes Ten ADR files gain notes dated 2026-11-28. Every diff line is an addition: 239 lines added, 0 removed. No original decision text is rewritten, and no decision changes. Each note follows the note convention its own record already uses. Each row's "what is true now" was read against the code on `main` before it was written. Where a row was wrong or had gone stale, the note says what `main` does, and the table and the list under it say so. | Row (comment id on the card) | ADR and section | Result | |:---|:---|:---| | Card body row (from objectstack-ai#37238) | ADR-0146, the 2026-11-24 amendment, "32 registered types" | **Landed. Row stale.** The row asks for 33; the registry holds 35 entries on `main`. The note states no count and points at the registry and at ADR-0084's table. | | 7155511307, nit 1 | ADR-0160 D1, the door's page cap sentence | **Landed. Row stale.** The row says the door has no page cap. PR objectstack-ai#37354 added one. The note says what `main` does: the list is cut one row under the door's cap, not at it. | | 7155511307, nit 2 | ADR-0160 D1, "only contains braces" | **Landed** as the row asks. | | 7155511307, nit 3 | ADR-0160 D3, the link-field sentence | **Landed as a note that the sentence stands.** | | 7161785832 | ADR-0158, Open items 9 and 12 | **Landed.** | | 7178404228, anchor half | ADR-0066, line 146 | **No edit.** PR objectstack-ai#37621 already landed it (record 7198334624). | | 7178404228, end-state half, with 7201928772 | ADR-0066 D2 ⑧ | **Landed.** Its prerequisite, PR objectstack-ai#37371, is merged. The proposed text is tightened in two places, listed below. | | 7179515770 | ADR-0158 U3, U6, L4, Open item 10 | **Landed.** | | 7184833647 | ADR-0159, Context, "One name already taken" (line 109) | **Landed as a note. The anchor line is untouched.** This is not a no-edit row: the anchor resolves, onto the opposite meaning. See below. | | 7187445064 | ADR-0158 L1, L2, Open items 6, 8, 10 and 11, and a new Open item 13 | **Landed.** | | 7195437501 | ADR-0010, the amendment note of 2026-11-24 | **Landed**, with one arm `main` has gained since the row was written. See below. | | 7212321297, first row | ADR-0067 D3 | **Landed. Row wording wrong.** The note carries the revert rule that the `form` type brought. See below. | | 7212321297, second row | ADR-0160, implementation split, row 7's bullet | **Landed.** The row places the stale path near line 425; it is near line 491. | | 7213085888 | ADR-0048 §3.5 | **Landed.** The row's ready text, dated 2026-11-28, with symbol anchors where it had line numbers. | | 7215202653, corrected by 7215223685, with 7224476684 | ADR-0150 D3, the note of 2026-11-26 | **Landed.** Item 2 of the first row said the two doors were still open. The later row supersedes it: PR objectstack-ai#37948 merged, and both doors now refuse. | | 7217585102 | ui ADR-0057, A2 and A3 | **Landed. Row stale on one line.** The plan-marker line is written as `main` is today, after PR objectstack-ai#37970, and not only as it was after PR objectstack-ai#37720. | Comments that are not rows: 7186949648 (triage note), 7196224618 (a one-row claim), 7196910014 (its report), 7198334624 (its landing record) and 7237786310 (this claim). **No row is held.** Every prerequisite is merged on `main`: PRs objectstack-ai#37219, objectstack-ai#37240, objectstack-ai#37268, objectstack-ai#37354, objectstack-ai#37366 (which carried objectstack-ai#37422), objectstack-ai#37371, objectstack-ai#37389, objectstack-ai#37423, objectstack-ai#37449, objectstack-ai#37640, objectstack-ai#37720, objectstack-ai#37818, objectstack-ai#37931, objectstack-ai#37948, objectstack-ai#37970, objectstack-ai#37065, objectstack-ai#36138 and objectstack-ai#37021. The card has 19 comments as of this pull request; a row added after comment 7237786310 is not in it. ### Where a note differs from its row - **ADR-0146.** The row offers two forms, "give the count" or "point to ADR-0084's table". The note takes the second. A count written today would already be the third reading (32, then 33, now 35). - **ADR-0160 D1, the page cap.** The row's premise was true when it was written and is not now. `RecordContextDoor.pageCap` exists, and both doors answer it. The note records the one-row difference between the amendment's words and the code: a list whose cut plus its probe row would pass the cap is cut one row under the cap. - **ADR-0160 D3, the link field.** The note leaves the wording alone. - **ADR-0066 D2 ⑧.** Two changes to the proposed text. The note says in words that `viewAllFieldsReadVote` replaced `superuserFieldVote`, and anchors only the function that exists. And it does not say that nothing re-opens a lock across sets: another set's `viewAllFields` still makes a hidden field readable, and another set's field row with `editable: true` still grants the edit, because field grants union without deny. - **ADR-0159, line 109.** PR objectstack-ai#37422 was merged into PR objectstack-ai#37366's branch, so the anchor `view.zod.ts#defineForm` resolves and the gate is green on it. It now resolves onto the `form` type's factory, while the paragraph describes the Studio helper, which is `defineMetadataForm` today. The paragraph is Context and describes the tree before the ruling was carried out, so the note leaves it as written and states both names. - **ADR-0010.** The row covers the three restore doors of PR objectstack-ai#37423. The same rule has since gained a second refusal, from PR objectstack-ai#37640: a restore that would write a version the platform registered into a package's row. The note has one sentence on it. That sentence goes beyond the row; cut it if the note should carry the row alone. - **ADR-0067 D3.** The row asks for a note "naming `form` as a translated metadata type". D3 is about undo granularity and has no such notion. The contract reviews of PR objectstack-ai#37422 sent one fact to this record: a `form` item is reverted only after every `view` row its commit edited is put back, and it joins `failed[]` otherwise. The note records that. - **ADR-0048.** The row's text was dated 2026-11-24. The note is dated 2026-11-28, the day it was written into the record. - **ADR-0150.** Besides answering "Not judged yet", the note qualifies one sentence of the 2026-11-26 note that said too much: the draft discard is newly refused only over a stored package-less draft. Where it was already refused, only its sentence moved. - **ADR-0158.** Row 7179515770 points at a draft held by its seat, which this session could not read. The notes are written from the two rows and the code. Open item 13 is a new numbered item at the end of the list, carried from the display card; it is marked not built and not settled. - **ui ADR-0057.** The row asks for "what main does after objectstack-ai#37720". `main` has moved once more: since PR objectstack-ai#37970 the entry's marker stands for a write that waits for approval. The note says that, and that A5's "Not recorded yet" bullet held until that pull request merged. ## Tests Docs only. No package is touched, so no build closure and no package test is owed for the change. No tested behaviour changed, so there is no ablation. What was checked by hand, on the committed text: - Each phrase a note quotes from its ADR was compared with the base file. - Each verbatim maintainer quotation was compared, byte for byte, with its record on GitHub. - Each cited path and symbol exists on `main`. The one exception is deliberate: the ADR-0160 note names `packages/spec/src/ai/skill.form.ts` to say that no such file exists. - Upstream moved ten commits while this was written (`e42520c67b` to `e2a0e90025`). None touches an ADR file or a file a note cites. `overlap-check` answers `VERDICT clean exit 0` against `origin/main` at `e2a0e90025`, and no open pull request shares a file with this branch. The local gate set is the `dispatch-gates --commands` derivation for this change set, 27 commands, run on the final commit `c2c3345747`. Each exit code was captured before any pipe. Reconciliation: `Run reconciliation — 27 derived, 27 run, 0 NOT-MEASURED, 0 UNRUN`, all 27 with a recorded exit code. <details><summary>ADR gates on c2c3345 (all exit 0)</summary> | Command | Exit | Verdict line | |:---|:---|:---| | `pnpm check:adr-symbol-anchors` | 0 | `check-adr-symbol-anchors: 4525 anchors across 164 records resolve`, 0 line anchors survive. On the base commit the same gate reads 4478. | | `node scripts/check-adr-links.mjs` | 0 | `check-adr-links: 1268 relative link destination(s) under docs/adr/ resolve` | | `node scripts/check-adr-links.mjs --self-test` | 0 | | | `pnpm check:adr-anchors` | 0 | | | `pnpm check:adr-index` | 0 | `adr-index --report: OK — docs/adr/README.md is current, every record parsed` | | `pnpm check:doc-authoring` | 0 | | | `pnpm check:nul-bytes` | 0 | `check-nul-bytes: OK (scanned 28605 text file(s)`, no raw control bytes | | `pnpm check:closed-ceremony-text` | 0 | | | `pnpm --filter @objectstack/lint run check:doc-formula-expressions` | 0 | run after building `@objectstack/formula` and `@objectstack/lint` under the verify lock | | `pnpm --dir ui run check:new-line-citations` | 0 | `VERDICT new-cross-file-line-citations: 0 new citation(s)`. Not in the derived list; run because a ui ADR changed. | </details> <details><summary>The other derived families on c2c3345 (all exit 0)</summary> `node scripts/check-closing-keyword-parity.mjs` and its `--self-test`, `node scripts/check-comment-mask-corpus.mjs`, `node scripts/ci/plan-test-core-shards.mjs --self-test`, `pnpm check:ci-filter-parity`, `pnpm check:cross-package-test-inputs`, `pnpm check:driver-memory-census`, `pnpm check:gitlink-declared`, `pnpm check:pm-governed-merges`, `pnpm check:pm-prior-rulings`, `pnpm check:published-files`, `pnpm check:refd-timer-probe`, `pnpm check:registry-log-declared`, `pnpm check:rest-log-spy-declared`, `pnpm check:tier-file-adoption`, `pnpm check:undeclared-dep-imports`, `pnpm check:watch-hint-literal`. Before the push: `node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD` exit 0, one commit message, no card relation and no model identifier in the trailer pair. </details> <details><summary>The ui scripts test family: one prerequisite failure, then green</summary> Derived command: `pnpm --dir ui exec vitest run scripts/`, run under the verify lock with `--maxWorkers=2`. - First run: `VERDICT command-exit 1`. `Test Files 1 failed | 171 passed | 2 skipped (174)`, `Tests 1 failed | 5144 passed | 2 skipped (5147)`. The one failure was `scripts/__tests__/unit-registry-absence-collision.test.ts`, with `Failed to resolve entry for package "@objectstack/client"`. The package had no build output in the fresh worktree. That is a missing prerequisite, not a verdict on this change. - After building the `@objectstack/client` closure under the lock, the same command on the same commit: `VERDICT command-exit 0`. `Test Files 172 passed | 2 skipped (174)`, `Tests 5145 passed | 2 skipped (5147)`. </details> Not run locally: the repository test project behind `test:repo`, which CI runs on the pull request and on the merge group. Every other family CI runs is read from this pull request's check runs, not re-run here. ## Acceptance notes - **Changeset.** None, and the pull request carries `skip-changeset`. `docs/adr/**` and `ui/docs/adr/**` ship in no package: the ui tree's root is a private workspace root and `ui/docs` is under no package directory. - **Governed surface.** `docs/adr/**` lands by the maintainer's hand. This pull request stays a draft; the seat hands it over. - **The registry count.** The card row and the amendment both carry a number. The repository rule for a volatile count is to remove it and not to sync it, so the note adds none. - **Seen and left alone.** These are outside the card and are not changed here. - ADR-0084, near line 226, says `form` is not a registered type. It is about the working names of the 2026-07-01 table, and `form` is registered now. It is a candidate row for next week's card of this name. - One internal skill playbook and ui ADR-0056 still use the Studio form helper's old name. The review of PR objectstack-ai#37366 already recorded both. - Comments in the console's chat scope helper still describe the `app:PKG:build` dock key and the Studio copilot. ## Verification ### Read first 1. `docs/adr/0066-unified-authorization-model.md`, the note of 2026-11-28 under D2 ⑧. It is the highest-risk hunk: one long paragraph on authorization, and it supersedes parts of three earlier notes. Check the sentences on what another set can still re-open, and the sentence that stored sets are read with the new meaning and never rewritten. 2. `docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md`, the amendment note of 2026-11-28. Check the four cells and their remedies (enable, enable, name the package, name the package) against the ruling it quotes. 3. `docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md`, the notes under Open items 6 and 10 and the new Open item 13. Both notes quote the maintainer, and item 10's records the shape of a new system object. ### Two-minute check Run `git diff --numstat origin/main...HEAD` on this branch. Expect ten rows, nine under `docs/adr/` and one under `ui/docs/adr/`, each with `0` in the removed column, and 239 added lines in total. Then run `pnpm check:adr-symbol-anchors` and expect exit 0 with a line that contains `check-adr-symbol-anchors: 4525 anchors across 164 records resolve`. --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cxRDKprCtjpEdtiPFW)_ <!-- signed: repo:objectstack#1 · os-elon-musk · session_016WV4cxRDKprCtjpEdtiPFW --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Bill · project thread
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
Fixes #35490
Fixes #37471
Clause-②: yes (widening)
Metadata-protocol: added
What
A quantity (
unitConfigon anumberfield) 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-codetextfield (unitMode: 'code') shows its unit's name (Open item 8 (A)).Choosing a unit (Open item 8, ruled A: 「有下拉」, Units of measure: unit picker for a unit-code field and a quantity's unit field (ADR-0158 Open item 8) #37471). In a form, a unit code field is a searchable picker (
UnitCodeField), never a typed box. That covers atextfield declaringunitMode: 'code'and theunitFieldarecordquantity 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-retiredsys_unitrows, then every standard code, each by its translated name (spec fallback) and limited to the declaredunitDimension. It stores the code. Read-only, the field shows the unit's name, not the bare code.Authorable key (
Metadata-protocol: added).unitConfigis now declared on@object-ui/types'FormField/FormFieldSchema, by reference to the spec'sFieldSchema.unitConfig, besidecurrencyConfig, soobjectui validateaccepts it on a hand-authored form field.@object-ui/typesshipsminor(thescale/currencyConfigprecedent). The tolerant face now checks the key's value againstUnitConfigSchemawhere it passed as an unknown key before.Which unit. Fixed mode uses
unitConfig.unit. Record mode reads the row'sunitField. Grid, ListView and RelatedList add the unit column andorganization_idto their$selectwhen the unit column is not shown.Name. An org unit (
sys_unit, U3) shows itslabel. A standard code shows the platform's name for it in the reader's locale (L2, 2A): the spec English baseSTANDARD_UNIT_NAMES, and each platform bundle servesmessages.standardUnit<CODE>. The UI readsapp.messages.standardUnit<CODE>and falls back to the English base.Decimals. These come from the unit row (org unit
decimal_places, or thesys_standard_unit_settingrow for a standard code, OI10 (A)). The row is the one whoseorganization_idmatches the record's organization (note 7180167601). L4 holds: the display width ismin(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
homeAmountPreviewprecedent). 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
messagesmap, with single-segment keysstandardUnit<CODE>. The keys are not dottedunits.standard.<CODE>becauseFileI18nAdapter.resolveKeysplits on.and walks the parts as nesting (the plugin-audit precedent). The console's served document lays bundles underapp, so the UI key isapp.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
skills/**fence).ObjectGridwith noSchemaRendererContext: 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 ingridQuantityUnit-35490.test.tsx.1,235 kilogram.const extraFields = [...]line inui/packages/plugin-grid/src/objectGridRowLoad.ts: this PR appends...quantityUnitFields, and feat(spec,ui): a field can be read-only by hand at the console while writes keep it (uiReadonly / uiReadonlyWhen) #37436 inserts...lockOperandFields. Whichever lands second merges main and keeps both entries.Verification
standard-units18/18; platform-objects translations 613/613.check:api-surfacewas regenerated (2 added exports).check-i18n-bundles,check-i18n-stale-fillandcheck-i18n-walk-paritypass.check-published-readme-exportspasses.overlap-check: clean against main, feat(ui): retire the grid's staged edit model with its host interface #37437, feat(spec,ui): a field can be read-only by hand at the console while writes keep it (uiReadonly / uiReadonlyWhen) #37436 and feat(fields,plugins,platform-objects): a select option is coloured only when its author declared a colour #37427.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL