Skip to content

spec: a field a person changes only through actions — read-only on every UI surface, still writable by the API, import and action writes, judged by validations #36806

Done
3 of 3 issues completed

Description

@objectstack-fleet

repo:hotcrm#1 · huangyiirene · session_01J8VVAmQQaqVXpJepCqm4Xa

Filing gate: ③ · Source: maintainer — her answer in the hotcrm project thread on 2026-11-24 to the seat's question 「订单状态做不成只读,#2716 先上三个按钮吗?」, choosing 「先上按钮,只读等平台」 (ship the three actions now; the read-only half waits for a platform capability, filed here). Ruling recorded on objectstack-ai/hotcrm#2716.
Grade: area:data · Feature · p2 (inherits the p2 of the hotcrm card it blocks part of) · reach: measured on @objectstack 18.6.0 by the hotcrm lane (report objectstack-ai/hotcrm#2716 comment 7101256352) · evidence measured.
Reader: whichever seat triages domain:spec / area:data; on landing, the hotcrm seat adds the read-only line to the sales order (hotcrm#2716's remaining half).
Dedupe: searched readonly field action writable, readonlyWhen drops action write, field editable only through action, ui readonly field api writable (24 hits incl. closed). Nearest: #35068 (closed; taught "gated action + field lock", see below), #35403 (closed; owner_id read-only on the default form, a built-in special case, not an authorable key), #32666 (closed; flow writing a readonly field). None asks for this key.

维护者速读

  • 用户能看到什么变化:作者可以把一个字段(比如订单状态)标成「界面只读」,表单、行内编辑、看板拖拽、高亮条都不能改,只能点「确认订单」这类按钮改;接口和导入照常能写,仍由校验规则(状态机)把关。
  • 为什么做:业务对象的状态普遍应该只经按钮流转(Salesforce Activate、Odoo/SAP Confirm),今天的 readonly 会连按钮、接口、导入的写入一起静默丢掉。
  • 出错会怎样:漏掉某个界面入口,用户仍能直接改状态(数据仍由状态机兜底,不会错);回滚即去掉这个键。
  • 要你做什么:无,已由你在 hotcrm 线程里选定。

What happens today (18.6.0, read again on main 4c93f88)

Asked

A field-level authoring key (name is the spec owner's call; for example editable: 'actions' or uiReadonly: true) meaning:

  1. Every console surface treats the field as read-only: create and edit dialogs, the record page's inline edit, the highlight-strip chip, grid inline edit, kanban drag between columns grouped by this field, bulk edit.
  2. Write paths keep it: REST create/update, import, declarative and script action writes, flows. Each write is judged by the object's validations (a state_machine rule included), exactly as an ordinary field.
  3. Optional, the spec owner's call: whether an insert may set it, or only its defaultValue applies on create from the UI.
  4. objectstack validate refuses it together with readonly: true (contradictory), and the field describe and the data skill say when to use which.

Done when

On a test object with a state_machine rule on status and the new key: the console offers no way to edit status (all surfaces in 1.); a declarative update action, a PATCH and an import update each change it when the machine allows and are refused with the machine's message when it does not; describe_object (MCP) reports the field as not UI-editable.

Blocks part of: objectstack-ai/hotcrm#2716 (Status read-only on the sales order).

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    enhancement
    priority:p2
    pm:queue
    domain:spec
    on Nov 24, 2026
  2. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:data · domain:spec · priority:p2 · Feature · pm:queue · size M. The filing seat's area, type and grade stand.
    Rationale: a field that a person changes only through actions is a new authorable capability, so it is a Feature. Its source is the maintainer, whose hotcrm ruling 「先上按钮,只读等平台」 leaves the read-only half to the platform. hotcrm#2716 (p2) waits on it, so under the blocker rule in North Star Priority rule 2 it takes p2. A new spec key widens the authoring contract (Clause-②), so it lands through the seat's contract review. Dispatch follows the area order the maintainer has set for area:data.

  3. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim: area o5-D round 1 · 2026-11-26T00:38Z · area:data p2 (the maintainer, verbatim, 2026-11-25T23:33Z in this seat's project: 「开一个专区 ,接 data 的 p1 p2」)
    Area: o5-D
    Session: session_01Utp6CbdHk3orAeensH6EzS
    Account: os-bill
    Branch: pending — mode:thread: the card thread pushes only the branch the platform assigns it; the area posts a Branch: amendment here when the thread opens
    Worktree: the card thread's own checkout
    Domain: domain:spec
    Seat: repo:objectstack#5
    File surface: packages/spec/src/data/field.zod.ts (the new key, its describe, the readonly contradiction refusal) and the spec generated artefacts through their generators, the liveness ledger row, the console surfaces the card lists under ui/packages/** (create/edit dialogs, record-page inline edit, highlight-strip chip, grid inline edit, kanban drag, bulk edit), the MCP describe_object projection, packages/objectql/** only if a write path must be told the key is not a write filter, tests named for the card, root .changeset/. ⛔ skills/** (the data-skill text goes to the weekly skills card as a Skills-docs: follow-up), ⛔ docs/adr/**. Stop on breach and report.
    Container & model: L, mode:thread, model: default (dispatch-gates --tier: "no path-derived mandate"), effort: high
    Clause-②: yes (a new authorable field key)
    Metadata-protocol: added
    Responsibility: n/a — not a defect card (Feature; source: the maintainer's hotcrm answer 「先上按钮,只读等平台」, ruling recorded on objectstack-ai/hotcrm#2716)
    Thread-read: 7119215664
    Premise: holds at origin/main b8c8c88 — packages/spec/src/data/field.zod.ts has no UI-only read-only key (git grep -E "uiReadonly|editable: *z\.|readonlyInUi|actionOnly" → 0 hits); readonly still strips non-system writes (card's measurement on 18.6.0). Not yet measured (thread, before code): the key name and whether a same-concept precedent exists in spec or a producer (the card leaves the name to the spec owner); the thread brings the name with its precedent to the area before code — no precedent ⇒ it goes to the maintainer via a decision thread, not decided in the area.
    Pre-claim lane: packages/spec/** → domain:spec; the ui/** surfaces stay in this lane per area-lease 留道 once the key is settled.
    Pre-claim deps: none named. Hot files: open PRs #37314 (PROTOCOL_VERSION 19) and #37366 (defineForm → defineMetadata) touch packages/spec/src/data/field.zod.ts; overlap-check before each push decides order.
    Prior rulings read: check-prior-rulings --card 36806 --paths → 392 ADR candidates, 0 ruling comments on the card; binding: the maintainer's hotcrm choice (above); ADR-0049 (a declared key must be enforced on every surface it names); ADR-0014 §2 (form spec shape) to read for the console half.
    Serial constraints cleared: open-PR file scan: #37314, #37366 (field.zod.ts) only on the spec side; ui surfaces re-scanned by the thread at code time.
    Scope: the card's "Asked" 1–4 and "Done when". Fixes #36806.

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 26, 2026
  5. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7178983371 (area o5-D) · 2026-11-26T00:41Z
    Branch: claude/project-thread-zjehmt (mode:thread: the platform-assigned branch of the card thread; replaces the claim's pending line)
    Thread session: session_01Utp6CXSuJCALDHFWaV6Bv5
    Worktree: the card thread's own checkout

  6. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Release: claim 7178983371 (area o5-D, session session_01Utp6CbdHk3orAeensH6EzS) · 2026-11-26T00:45Z · to the maintainer's decision box, before any code.
    Why: the card leaves the key's name to the spec owner, and the pre-code reading found no same-concept precedent (0 hits tree-wide), so the name of a new authorable key is a public-contract choice the area may not settle (SKILL.md, escalation: a contract shape existing rules do not decide). Card item 3 (insert from the UI) rides with it.
    Readings at b8c8c889 (card thread session_01Utp6CXSuJCALDHFWaV6Bv5): candidate uiReadonly: boolean (spelled off readonly / readonlyWhen, packages/spec/src/data/field.zod.ts ~3047 / ~2917; boolean like hidden ~2994 and showOnCreate ~3012); rejected editable: 'actions' (collides with the permission grant editable, permission.zod.ts ~1146) and widening readonly to 'ui' (the engine strips on a truthy readonly, rule-validator.ts ~2260). Item 3 reading: the console treats the key as readonly, so a UI create applies only defaultValue; API/import/action inserts may set it, judged by the state machine's initial states. Side finding: kanban drag (ObjectKanban.tsx ~2084) reads no field read-only flag today.
    Next: a decision thread writes the options, recommendation and four-axis analysis on this card; on the maintainer's answer the area re-claims and the same card thread builds.
    Resume-from: claude/project-thread-zjehmt@b8c8c889 (no commits yet)

  7. added
    needs-user-decision
    and removed
    pm:dispatched
    on Nov 26, 2026
  8. 8 remaining items

  9. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 26, 2026
  10. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7180490513 (area o5-D) · 2026-11-26T02:18Z
    File surface (adds): packages/spec/src/data/inline-grid-columns.ts (deriveInlineGridColumns skips uiReadonly: true as it skips readonly) and ui/packages/plugin-form/src/**/deriveMasterDetail.ts (passes uiReadonlyWhen beside readonlyWhen). Reason: the master-detail dialog's inline line-item grid is a hand surface under ruling 7180466652 ("every hand surface"); without it a uiReadonly child field draws an editable cell.

  11. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7180490513 (area o5-D) · 2026-11-26T03:06Z
    File surface (adds):

  12. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7180490513 (area o5-D) · 2026-11-26T03:52Z
    File surface (adds): packages/spec/src/data/field.form.ts (offer uiReadonly and uiReadonlyWhen beside readonly / readonlyWhen; uiReadonlyWhen as type: 'code', language: 'expression', as readonlyWhen); the 11 metadata-forms locale packs packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts through their generator only (⛔ no hand edits to generated files); the row-count pin that counts field-form rows (e.g. object-lifecycle-panel-echo-decisions.test.ts), moved only by what this change moves.
    Reason: metadata-form-zod-reconciliation.test.ts refuses a key the Zod accepts and the form does not offer. The area picks offering the rows over a ledger entry: a key an author can declare only in source or over the API is a gap the next card would have to close, and the long-term answer costs one form row each now (maintainer standing guidance on #36806: design for the realistic long-term need, don't defer obvious sibling needs).
    Fences unchanged otherwise. Overlap-check each added file before the push.

  13. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7180490513 (area o5-D) · 2026-11-26T03:58Z · clarifies amendment 3
    The metadata-forms locale packs take in-place edits of the NEW leaf string values only (label and helpText for uiReadonly and uiReadonlyWhen, every locale), as the files' own header directs ("Edit translations in place … only the leaf string values"), followed by a generator re-run that drops the fill hashes; the same route #36425 took for showOnCreate. ⛔ No structural edit, no other leaf. Reason: the catalog pins (field-panel-echo-decisions.test.ts, object-lifecycle-panel-echo-decisions.test.ts) refuse unauthored English fills.

  14. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
    os-dev-report

    {
      "issue": 36806,
      "status": "done",
      "branch": "claude/project-thread-zjehmt",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37436",
      "session": "session_01Utp6CXSuJCALDHFWaV6Bv5 (card thread; area session_01Utp6CbdHk3orAeensH6EzS)",
      "premise_still_valid": true,
      "summary": "Ruling 7180466652 scope 1-6 at head 62c400a2 (55+ files, +1.6k lines). Spec: Field.uiReadonly / uiReadonlyWhen (optional, no default), refusal of uiReadonly beside readonly at ['uiReadonly'], line-item column skip, liveness rows, regenerated artifacts, Studio field form rows translated in all 11 locale packs (amends 3/4). Console: one verdict in @object-ui/core (fieldReadOnlyByHand / fieldStaticallyReadOnlyByHand) read by dialogs + payload, record inline edit + stage path, highlight chip, grid inline edit + multi-row save, kanban drag (new lock read; also fixes a readonly lane field being draggable with a silently stripped PATCH), calendar drag, line-item grid. MCP describe_object (HTTP + stdio) reports both keys as their own fields; engine untouched.",
      "tests": "New pins all pass: spec field-ui-readonly (5), dogfood ui-readonly-hand-lock-36806 (6: PATCH lands with no X-ObjectStack-Dropped-Fields, readonly sibling stripped as control; state_machine refusal 400 VALIDATION_FAILED + machine message on PATCH, action and import; create lands on defaultValue; initialStates refusal), runtime MCP (3), mcp stdio block, ui 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; 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, plugin-form 2,795, plugin-detail 3,970, plugin-grid 2,794, plugin-kanban 585, plugin-calendar 515 (components and app-shell: CI Test UI shards green). Typechecks green: spec, runtime (+test typecheck), mcp, dogfood, metadata-core, driver-sql, type-check in 10 ui packages. Ablation 1 (ablation-replace): fieldStaticallyReadOnlyByHand without uiReadonly -> 8 pins red (kanban, calendar x2, record page x2, dialogs x2, grid); restored blob == HEAD. Ablation 2: rule-validator strip also stripping uiReadonly, objectql built (JS emitted, DTS failed on the type), dist preflight marker in 4 files -> 4 dogfood pins red; restored, rebuilt, preflight --absent clean, tree clean.",
      "gates": "dispatch-gates --commands: all 124 derived commands run locally. Fixed in this PR: driver-sql builtin-column-collision, metadata-core object-schema-fls-references, metadata-protocol meta-types count (amend 7181406682), spec metadata-form-zod-reconciliation (form rows, amends 3/4), platform-objects count pin 837->839. Non-diff reds: (1) check-plugin-teardown-shape --self-test exit 3: shallow clone cannot reach pinned fixture commit 621a4876; an environment fact, red on main in this container too. (2) check:platform-checklist exit 1: ABSENT SYMBOL FlowItemMoreMenu in docs/qa/platform-checklist/areas/automation.json; neither file differs between base b8c8c889 and main 7d50dc8b and the symbol is only in a comment there, so red on main too. (3) check:dual-build-cjs-loads exit 3: prerequisite not met (unbuilt dist), nothing measured on either. (4) spec check:skill-examples exit 3 was a prerequisite miss (client-react unbuilt); after building it, exit 0. i18n: check:i18n and check:i18n-stale-fill exit 0. CI on 62c400a2: 61 success, 9 skipped, 0 failed (Lint & Repo Gates, Type Check UI, Test UI 1-16/16, Test Core 1-10/10, Build & E2E UI all success).",
      "dogfood_battery": "n/a: no ! in the PR title and Clause-2 is yes without a (narrowing) arm",
      "mcp_calls": "1: subscribe_pr_activity (claude-code-remote); no GitHub MCP writes",
      "api_writes": "2 relay strokes: pr_create (#37436, assignee os-bill) and this os-dev-report comment; plus git push",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none, noted: lint CEL authoring check for uiReadonlyWhen (packages/lint) not added",
        "carrier: none, noted: kanban swimlane-field drag does not read the hand lock",
        "carrier: none, noted: docs-drift bot lists 11 hand-written pages naming FieldSchema; none documents readonly semantics needing uiReadonly beyond the generated field reference, which is regenerated here",
        "carrier: #37405: skills pages for uiReadonly / uiReadonlyWhen"
      ],
      "deviations": [
        "First push of the WIP branch happened before overlap-check (clean afterwards); head 62c400a2 was pushed before reading an overlap verdict against #37422 (count-line arithmetic in object-lifecycle-panel-echo-decisions.test.ts, Acceptance note in PR); push now gated on the overlap-check exit.",
        "uiReadonly is .optional(), not .default(false).",
        "No 1280x800 zh-CN screenshots: no example app declares either key and adding one is outside the surface; surface behaviour pinned by UI tests and ablated.",
        "Ablation 2 mutated packages/objectql temporarily (trap-restored, rebuilt, tree clean); nothing in packages/objectql is in the diff.",
        "PR carries assignee os-bill per the claim's Account line (os-dev rule 2)."
      ]
    }

    read 2026-11-26T05:29Z · head 62c400a

  15. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7180490513 (area o5-D) · 2026-11-26T05:43Z · on L1 REWORK 7183712080 and contract record 7183704697
    File surface (adds): packages/lint/src/validate-expressions.ts (+ its test) so os validate checks uiReadonlyWhen as it checks readonlyWhen (S2's lint slot rides this PR); the operand read-before-verdict for kanban and calendar beside the grid's (S1).
    Carried out of this PR: Gantt drag and in-place edit, timesheet cell write, kanban swimlane drag, the in-app assistant acting for a person, and palettePrefillField (N3) → #37448 (filed now under this card). Until it lands, the uiReadonly describe and the describe_object text name the surfaces that honour it (S3).

  16. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7180490513 (area o5-D) · 2026-11-26T11:02Z · on the merge-queue dequeue of PR #37436 at 10:59Z
    File surface (adds): packages/qa/dogfood/test/expression-conformance.ledger.ts, a row of its own classifying data/field.zod.ts:FieldSchema.uiReadonlyWhen (ADR-0060). Merge-queue run 45802787226, job "Dogfood Regression Gate (3/3)", failed expression-conformance.test.ts with "UNCLASSIFIED surface — add a ledger row (ADR-0060): data/field.zod.ts:FieldSchema.uiReadonlyWhen". The PR-side CI does not run that dogfood file, so the PR's checks were green.
    Fence widening accepted by seat repo:objectstack#5 (thread note, 11:02Z). The seat reads a same-reviewer delta and re-ACCEPTs on the new head before the area re-lands.

  17. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Close-out · area o5-D · 2026-11-26T12:50Z
    Delivered by PR #37436 (merged, 021524cd0a): Field.uiReadonly and Field.uiReadonlyWhen. A field a person changes only through actions is read-only on every UI surface that edits it: the edit dialog (which also refuses the submit), the record page, grid cells and stored line-item rows, and kanban and calendar drag. Writes from actions, flows and the API are unaffected.

  18. removed
    pm:dispatched
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:specenhancementpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions