Repository navigation
feat(ui): the field hand lock holds on the Gantt, the timesheet cell and the palette prefill - #37888
Conversation
Claude-Session: https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 182 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 829010ad78a87d7b2b40d676f4c8f2c039c3bc23 && git checkout 829010ad78a87d7b2b40d676f4c8f2c039c3bc23
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ddc96d8a4280c69305dd541005cacfbe3e58f4c5 1916ae98dbe07ffc95354785e67ac18107c31501 && git checkout -B drift-repro ddc96d8a4280c69305dd541005cacfbe3e58f4c5 && git merge --no-ff 1916ae98dbe07ffc95354785e67ac18107c31501
node scripts/docs-audit/affected-docs.mjs --json ddc96d8a4280c69305dd541005cacfbe3e58f4c5
|
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Read: card #37448 (body and its five comments), the PR body and file list, the net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
M1 (must-fix) — the calendar's quick-create dialog writes a hand-locked field, so "every console surface" is false of the head.
S1 (should-fix) — Implementing files, against the contract:
N1 (nit) — the changeset leaves N2 (nit) — Nothing private. Implemented-by: VERDICT: FAIL |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Delta round on record 7214835610 (FAIL at The merge brings only ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. M1: closed. S1: closed. The
Implementing files in the delta, against the contract:
N1: left as is by the dev ( N2: fixed on a prose face, as above. N3 (nit) — the changeset's calendar bullet and the PR body speak of a field "locked by hand" and do not say that a server-locked ( Nothing private. Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 1916ae9 · card #37448 · area s2-data · 2026-11-27T10:39ZL1 checklist
Tier: S. Landing: ready and auto-merge in this stroke. |
…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 Sales · project thread
Part of #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 #37898 carries it. The field descriptions, the metadata-form help texts and the MCP
describe_objectguidance 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
uiReadonlyor the hand lock (grep on main), so no skill sentence becomes false维护者速读
uiReadonly/uiReadonlyWhen)现在在 Gantt(拖动、调整、进度、连线、就地编辑、自动排程、撤销重做)、工时表单元格、日历快速新建和命令面板预填上都生效。What changes
Each surface reads the one verdict of
@object-ui/core(fieldReadOnlyByHand, or its static halffieldStaticallyReadOnlyByHandwhere no record exists yet) with the shell's predicate scope (usePredicateScope).@object-ui/plugin-gantt, newganttHandLock.ts).ganttPatchByHandjudges each write over the stored record insidehandleTaskUpdateDefault, the handler every bar write reaches: drag, resize, progress handle, in-place edit, auto-schedule, conflict reschedule, and undo/redo (which skipsonBeforeTaskUpdate, 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.persistDependenciesjudges a drawn link over the target record's dependencies field.ganttHandLockedInteractionsnarrows 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 authoredfalsestaysfalse.$select, so the predicate operands are on the record.@object-ui/plugin-timesheet).cellEditabletakes alockedByHandjudge: 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.writeCellrefuses a locked update or delete like areadonlyone. The timesheet fetch has no$select, so the operands are on the record.@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,quickCreateLockedOwnFieldssends 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 answersreadonly: true, so a server-locked title or date field now hands off the same way, wheremainopened 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 itsdefaultValue;requiredFieldsQuickCreateCannotFillcounts one with nodefaultValueas 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.@object-ui/app-shell,paletteCreate.ts). The create-as prefill skips auiReadonlyfield, as it already skippedreadonly. A create is judged by the static half only, as the create dialog judges it.@object-ui/plugin-list).editedInPlacetakes the kanban lane field the board actually uses (kanbanLaneFieldOf: the block'sgroupByField, else the object's detected lifecycle field), so the lane field's lock operands are in$selecteven when the block names nogroupByField(scope addition from comment 7187109328).onCardMove, so the write is the lane (column) field alone, and the existing lane-field gate inObjectKanban.handleCardMoveholds there too. Now pinned.BEHAVIOUR_SEGMENTS).uiReadonlyWhenis not added. The key is authorable only on field definitions underobjects, whichbucketForalready reads as behaviour;readonlyWhenis in the set because inline-grid columns (acolumnsdisplay segment) carry it, and those columns have no hand lock. A pin invalidate-field-consumers.test.tsproves both keys already credit the fields they name; the lint source is unchanged.uiReadonly/uiReadonlyWhenJSDoc and.describe, their metadata-form help texts (all eleven locales), the MCPdescribe_objectguidance and its code comment, and thehandLock.tsheader 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. TheuiReadonlysurface lists add "calendar drag and quick-create" (uiReadonlyWhendoes 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: thecel-field-ui-readonly-whenrow of the expression-conformance ledger is reworded (the edit dialog and grid cell callresolveFieldRuleStatedirectly; every other surface goes throughfieldReadOnlyByHand) and lists the Gantt and timesheet readers.Small decisions taken in this pull request
Metadata-protocol: semanticwhere the claim hadnone: the keys' descriptions change what an author'suiReadonly/uiReadonlyWhendoes (five more surfaces lock), so the changeset isminoron the packages that move behaviour.Why
Phase 1 (#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.mjsand went red, then the file was restored (git diff --quiet HEAD).CommandPalette.previewCreate-36286.test.tsxfieldStaticallyReadOnlyByHand(field)→field.readonly === trueListView.lockOperandSelect-36806.test.tsx"the lane field the board detects when the block names none"kanbanLaneFieldOf(...)→ the block'sgroupByFieldObjectGantt.harness.test.tsx"ObjectGantt.handLock-37448"writeundefinedObjectTimesheet.test.tsx"the field hand lock"lockedByHand(...)line disabled&& !createLockedByHandremovedObjectKanban.handLock-36806.test.tsx"a drag on the swimlane board"fieldReadOnlyByHandforced falseObjectCalendar.quickCreateHandLock-37448.test.tsxquickCreateLockedOwn.length === 0made always truerequiredFieldsQuickCreateCannotFilldisabledEach Gantt, timesheet, kanban and calendar describe also carries a CONTROL (an unlocked record or field still writes; on the calendar, a
uiReadonlyWhendoes not judge the create).Acceptance notes
Verification
Head
1916ae98(main merged in twice; no conflict, the merges bring onlymain's content). CI on the head: 61 success, 9 skipped, none failed.chrome/, coreevaluator/) 1650 passed, 148 skipped; UI plugin-calendar and coreevaluator/after the rework 1105 passed, 122 skipped;@objectstack/specsrc/data6893 passed;@objectstack/mcp1589 passed;@objectstack/platform-objects2214 passed;@objectstack/lintvalidate-field-consumers.test.ts203 passed. After the last merge the new calendar pin re-ran: 7 passed.pnpm --filter @objectstack/spec run check:generatedpasses on a fresh spec build (docs, liveness state counts and api-surface included);check:livenesspasses;node scripts/check-i18n-bundles.mjsOK;node scripts/check-nul-bytes.mjspasses.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-closureandcheck:dual-build-cjs-loads, which read.d.tsfiles 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.TypeScript Type CheckandType Check UIare green on the head.Human Minimum
packages/specholds no runtime logic (only describe and JSDoc text moved there).main, one pull request.packages/specgenerated artifacts regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi