Repository navigation
feat(spec,ui): an object declares when a whole record is read-only by hand (object-level uiReadonlyWhen) - #38169
Conversation
… hand (object-level uiReadonlyWhen) WIP: spec key, console fold, MCP describe, FLS scrub, lint slot. Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
… regenerated references Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
… describe Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…tems, edit lock, grid and kanban Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…ck key Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…refix Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…uiReadonlyWhen leaves Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…en (52 -> 53) Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…ject-ui-readonly-when
📓 Docs Drift CheckThis PR changes 6 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 187 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 41f6f29da027d2570b0d4cc368468466d812a27b && git checkout 41f6f29da027d2570b0d4cc368468466d812a27b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 73ec085afa2f9689ef96263a9c25b82cde6fda47 b012f9b6094cfc372f46c5a64cbecc127b733524 && git checkout -B drift-repro 73ec085afa2f9689ef96263a9c25b82cde6fda47 && git merge --no-ff b012f9b6094cfc372f46c5a64cbecc127b733524
node scripts/docs-audit/affected-docs.mjs --json 73ec085afa2f9689ef96263a9c25b82cde6fda47
|
…follows the object lock (ruling Q1 = B) Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…rences name the two counting spellings Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head 696c37e · 2026-11-28T07:47Z The lane seat runs the owed CONTRACT_REVIEW_TIER review through an isolated at-tier subagent. |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract reviewServed-tier: Inputs read: card #37402 body and all six comments (rulings 7235326611 included), the governing ruling 7180466652 on #36806, PR #38169 body and file list (73 files), the net diff against the merge base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
S1 (should-fix) — "A create is not judged" does not hold in the wizard's final-submit gate. N1 (nit) — the object describe lists "the line-item grid" among locked surfaces without saying line rows follow the CHILD object's lock; carry with the ③ escalation. N2 (nit) — the N3 (nit) — No must-fix found. S1 is open on this head and earns a delta review of its fix. Implemented-by: VERDICT: PASS |
…and lock on a create (L2 S1) Also: the @object-ui/core changeset names the prerelease the helpers first shipped in, and describe_object says a field's own uiReadonlyWhen may itself lock it. Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
…ls/list byte ceiling Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 L1: ACCEPT · head Seat checks
Landing: non-governed, ≤3000 lines. The seat lands it through the ordinary queue. |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Re-queue · 2026-11-28T11:30Z · head
Landing rule: a knock-on removal with its root out of the queue ⇒ re-queue once, as is. |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46137914293 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
Relay Merge-queue dequeue of #38169 — cause
The relay sends |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Dequeued · 2026-11-28T11:34Z · head That receipt read this PR's CI as "still in progress". It went on to fail on this PR's own diff:
The seat dequeued the re-queued entry (relay |
…ema.uiReadonlyWhen Claude-Session: https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b Co-authored-by: Claude <noreply@anthropic.com>
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46140292866 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head b012f9b · 2026-11-28T12:13Z The lane seat runs the owed CONTRACT_REVIEW_TIER delta review (the conformance-ledger row) through an isolated at-tier subagent. |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract reviewServed-tier: Delta round on the full record 7238240401 (head Inputs read:
① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
The changed
The file exists, which is all N5 (nit) — the row's unchanged opening clause says the evaluator is "called directly by the edit dialog and the grid cell, and through the one verdict fieldReadOnlyByHand … everywhere else". The object grid's cell goes through N6 (nit) — the row id stays Everything else — unchanged since S1: closed N1 (nit) — the object describe lists "the line-item grid" without saying line rows follow the child object's lock. Unchanged; carried by #38249. N2: closed N3: closed N4 (nit) — the No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 L1: ACCEPT · head Seat checks
Landing: non-governed, ≤3000 lines, |
Fixes #37402
Clause-②: yes
Metadata-protocol: added
Skills-docs: follow-up #37405
维护者速读
What changes
Governing ruling (on #36806, 2026-11-26, the card's governing text, quoted): 「按长远模型」 — two tiers (server lock
readonly/readonlyWhen; hand lockuiReadonly/uiReadonlyWhen) × two levels (field, object); a field's own declaration wins over the object default; write paths keep every write (the engine never reads the key). ADR-0085 §2 (the object-level key names the console as a whole, not a page) and ADR-0049 (a declared key is enforced on every surface it names).Spec (
packages/spec)ObjectSchema.uiReadonlyWhen— optional CEL predicate over the record's own columns (EvaluatedExpressionInputSchema, the field key's scope), with TSDoc and describe. No default, so no parsed object grows a key.object.uiReadonlyWhen(live); Studio object form row (Advanced section, CEL code row); regenerated reference docs, authorable-surface record (data/Object:uiReadonlyWhen) and state counts.Console (
ui/packages/**) — item 3, one helper, no surface reads the key@object-ui/corehandLock.ts:effectiveUiReadonlyWhen(def, object)— the field's ownuiReadonlyWhenwhen the field declares a hand lock of its own —uiReadonly: trueor auiReadonlyWhen— else the object's.uiReadonly: falseis not a declaration of its own: it reads as absent and the field follows the object lock (seat ruling on the card, Q1 = B; the one opt-out spelling isuiReadonlyWhen: P\false`).fieldLockPredicates(def, object)for operand fetches.fieldReadOnlyByHand(def, record, { object, … })andfieldHasConditionalHandLock(def, object)take the object **as a required argument**, so the compiler asks every caller for it (the helpers first shipped in the19.0.0-next.0prerelease with the field-level hand lock and are in no stable release; a caller written against that prerelease must now pass{ object }` — the changeset carries the migration).DetailSection,HeaderHighlight,InlineEditSaveBar, stage path), grid cell (cellReadOnlyKindgains a requiredobject), kanban drop, calendar drop, Gantt write gate (ganttPatchByHandtakes the object), timesheet cell.resolveFieldRuleStatecallers read the folded predicate from the producer, not the object: the edit dialog's form fields (sectionFields.fromObjectSchema,ObjectForm) carryeffectiveUiReadonlyWhen(...), soform.tsxandWizardForm(which judge what a form field carries) fold the object lock with no change of their own;editFormLockedByStatefolds it the same way; line-item columns (deriveMasterDetail, derived and authored) carry the CHILD object's predicate, whichGridFieldWidgetalready judges per row.$selectfetch the object predicate's operands for every inheriting column / edited-in-place field.Server
packages/objectql/**reads the key.describe_object(item 5) reports the object'suiReadonlyWhentext at the answer's top level where authored, on HTTP (runtime/domains/mcp.ts) and stdio (mcp/mcp-server-runtime.ts); the tool description says how to read it.metadata-core): an object predicate that reads a field denied to the caller is served as the constanttrue(fail-closed, the field-level precedent: deleting it would open every record for exactly that caller).os validate(lint): the object slot is checked as the field slot is (record-scoped check + root verdict), atobject 'NAME' uiReadonlyWhen.platform-objects); translated-leaf pin 845 → 846.Why
A whole-record lock (confirmed order, posted invoice) had to be written as a
uiReadonlyWhenon every field — tedious, and one missed field leaves a hand edit open. The ruling adopted the object level now.Item 4 (console duplicate) — no surface, not delivered
Measured on
f72f3353: no person-triggered record duplicate exists in the console. Searchedui/packagesandui/appsforduplicate|clone|onClone|cloneRecord|data.clone(: the hits are the view switcher's view actions, Studio package/sharing-rule/permission-set clones, an unuseddetail.duplicatetranslation string, and the spec capability flagenable.clone. The only record clone is the REST doorPOST /data/:object/:id/clone(rest/data-action-routes.ts→cloneData), reached by the SDK'sdata.clone— an API write, which by the ruling keeps every value. Item 4 is reported as "no surface — not delivered" and nothing was built; the done-when clause "duplicating the confirmed record yields a record whosestatusis the field'sdefaultValue" has no surface to hold on. The rule is carried by #38202 as the acceptance of a future console Duplicate action (seat ruling on the card, Q3).Fixes #37402stands.Tests
@object-ui/corehandLock-36806.test.ts(new top-level describe): object lock locks a non-declaring field while TRUE and only then;uiReadonlyWhen: 'false'(string and envelope) keeps a field editable; a field's own predicate /uiReadonly: truelocks where the object does not (override both directions); explicituiReadonly: falseis NOT a declaration — the field follows the object lock (Q1 = B), with a CONTROL thatuiReadonlyWhen: 'false'(alone or besideuiReadonly: false) still opens it; server lock does not cancel the object default; fail-closed on a faulted / operand-less object predicate; the fold helpers.plugin-formdialogHandLock-36806.test.ts: dialog form fields carry the object predicate / the field's own; line-item columns (derived and authored) carry the child object's.app-shelleditFormLockedByState.test.ts: object lock greys Edit; afalseoverride keeps it live; off while the predicate does not hold.plugin-grid: cell verdict over the object lock and its override; the row load$selectasks for the object predicate's operand and not for a column with its own lock.plugin-kanban: a drop on a record the object locks writes nothing; a lane field with its ownfalsewrites the move.lint: object slot accepted / bare reference / parse / undeclared field / unbound root refused (each authoring refusal has a test); read-surface pin gainsuiReadonlyWhen.metadata-core: denied operand → served'true'(string and envelope); readable → served as written.mcpstdio andruntimeHTTPdescribe_object: the object predicate is reported; no field'sreadonlychanges; a storeduiReadonly: falselists no hand-lock key; an object without it carries no key.ui-readonly-hand-lock-36806.dogfood.test.ts, new top-level describe on one shared boot): the done-when object (state_machineonstatus, objectuiReadonlyWhen: P\record.status in ['confirmed','done']`,notesP`false`); the served definition carries both predicates; a PATCH to a confirmed record lands with **noX-ObjectStack-Dropped-Fields`**; an import update writes and the machine still refuses an illegal move; a declarative action writes.Acceptance notes
L2 record (contract review, PASS) S1 fixed in head
36e883f1:WizardForm.tsx's final-submit gate drops the carrieduiReadonlyWhenon a CREATE wizard, at the evaluating site, asform.tsxandGridFieldWidgetdo. Fixed there rather than insectionFields.fromObjectSchemabecause every other create surface already drops the predicate where it evaluates it; omitting it at the producer would make one of four readers behave differently from the other three, and the gate also reads predicates that never pass throughfromObjectSchema. The same gate still judges the field's ownreadonlyWhenon a create, whereform.tsxdoes not; that is pre-existing and left alone. Pin inwizardPredicateScope.test.tsx: a create wizard over a locked object still demands an empty required field (red before the fix: the create went through); CONTROL: an edit wizard on a confirmed record still treats the inheriting field as locked and saves without it (green before and after). N2 (this body and the@object-ui/corechangeset now name19.0.0-next.0) and N3 (describe_object: a field's ownuiReadonlyWhenis judged by that predicate, which may itself lock it) are taken; N1 waits on the seat's maintainer question.Seat rulings on the card's three open questions (newest seat comment on spec: an object declares when a whole record is read-only by hand (object-level uiReadonlyWhen), fields override it, and duplicating a record takes the locked fields' defaults #37402): Q1 = B, maintainer verbatim 「B 不算放开」 — implemented in head
696c37e9(declaresOwnHandLock, the pin flipped, every describe / help / liveness / changeset /describe_objectstring names the two counting spellings; help retranslated in 10 locales). Q2 = A, kept as built. Q3: item 4 closes as "no surface — not delivered", carried by console: a person-triggered "Duplicate record" action, whose copy takes hand-locked fields' defaults (the rule ruled on #36806, no surface today) #38202.requiredWhenprompt collector (fields/requiredWhenPrompt.ts) keeps reading the field's own key: the hosts'fillablecallbacks already judge the object lock over the STORED record, which is the right record for a transition the person is still allowed to make.The public intake form page (
ui/apps/consoleFormPage.tsx) is create-only and never carried a hand lock; untouched.A parent's object lock does not lock its child line-item rows: those rows are records of the child object and follow the child object's own lock.
The grid cell judges with the grid's own fetched object definition; while that read is in flight the cell sees no object lock (the same window the host field catalogue already has).
objectExtensionsdoes not gain the key (not asked).Verification
Two-minute check:
cd ui && pnpm exec vitest run packages/core/src/evaluator/__tests__/handLock-36806.test.ts— expect the#37402describe green (7 cases).First files to read (by risk):
ui/packages/core/src/evaluator/handLock.ts(the fold and its override rule);ui/packages/plugin-form/src/sectionFields.ts(how the edit dialog gets the object lock withoutform.tsxreading it);packages/metadata-core/src/object-schema-fls-references.ts(objectHandLock, the fail-closed serve).S1 verification on head
36e883f1: wizard pins red before the fix (1 failed: the create case; CONTROL green), green after; wizard + dialog files 5 files / 31;@object-ui/plugin-formfull suite 248 files / 2,805 and type-check 0; mcp typecheck 0,mcp-server-runtime.test.ts20/20; overlap-check clean. The derived gate union on36e883f1is reported in the card's delta os-dev-report.Q1 re-verification on head
696c37e9(no conflict withorigin/main, so no merge): ui hand-lock files 5/5 (49 tests); ablation restoring the old rule (uiReadonly !== undefinedcounts) turns the flipped pin red (1 failed / 14 passed), restore blob == HEAD; mcpmcp-server-runtime.test.ts20/20, runtime describe 5/5; typecheck mcp, runtime and@object-ui/coretype-check 0;spec check:liveness0;spec check:generatedall 14 up to date;check:i18n0,check:i18n-stale-fillOK; platform-objects 130 files / 2,214; overlap-check clean. The derived gate union on696c37e9is reported in the card's delta os-dev-report.Verification record (first head) — every reading below is taken on
objectstack-ai/objectstackat head0bee2a81(the branch after mergingorigin/mainat0e361201) unless it says otherwise; locked runs went throughos-verify-lock.sh.Tests (package suites and targeted files)
@objectstack/specfull suite (pre-merge head6ce7aa65, spec untouched by the merge;check:generatedre-run green on0bee2a81): 910 files / 28,814 passed.@objectstack/runtimefull suite (pre-merge): 655 files / 12,342 passed, 25 skipped; on0bee2a81:mcp-object-hand-lock-36806.test.ts5/5 andtypecheck0.@objectstack/lintfull suite on0bee2a81: 245 files / 9,870 passed;typecheck0.@objectstack/metadata-corefull (pre-merge): 244 files / 9,861; on0bee2a81the FLS file 68/68.@objectstack/mcpfull (pre-merge): 88 files / 1,644; on0bee2a81mcp-server-runtime.test.ts20/20.@objectstack/platform-objectsfull (pre-merge): 130 files / 2,214.@objectstack/metadata-protocolprotocol.meta-types-degenerate-derivation.test.tson0bee2a81: 18/18.ui-readonly-hand-lock-36806.dogfood.test.ts(booted stack): 10/10.Test UIruns it); its two lock files ran green.0bee2a81(15 files): 250/250.type-checkon0bee2a81: core, plugin-form, plugin-detail, plugin-grid, plugin-kanban, plugin-calendar, plugin-list, plugin-gantt, plugin-timesheet, app-shell — all Done.Shown red without the fix (ablation, restored to HEAD each time)
effectiveUiReadonlyWhenmade to ignore the object (return undefined): 10 of the new UI pins red across core, plugin-form, app-shell, plugin-grid (cell and row load) and plugin-kanban; the override controls stayed green. Restore: blob equals HEAD,git diff HEADempty.undefined: the four refusal cases red, the accept case green. (A first attempt was refused by the ablation tool before running — its replacement text already existed — and re-anchored.)uiReadonlyWhen: objectHandLockswapped forexpression: the fail-closed pin red, the control green.Gates (derived union on 0bee2a8)
node scripts/pm/dispatch-gates.mjs --commands: 127 families; all run; 124 exit 0; 3 exit 3 (PREREQUISITE NOT MET, NOT MEASURED):check-plugin-teardown-shape.mjs --self-test(shallow clone cannot read its pinned fixture commit),spec check:skill-examples(client SDK dist not built),check:dual-build-cjs-loads(a package without dist). CI runs all three.dispatch-gates.mjs --ranwith exit codes: "127 derived famil(ies) accounted for — 124 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)".spec check:generatedon0bee2a81: "All 14 generated artifacts are up to date".overlap-check.mjsbefore every push: VERDICT clean exit 0.check-nul-bytes.mjs: 0.!, no(narrowing)arm).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI).main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_017xRBcRd37NZMCYvVAmVk4b
Generated by Claude Code