Repository navigation
feat(spec): a field can say it is not asked for when a record is created (showOnCreate) - #36449
Conversation
Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj 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 — 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 35ead69fa30f2f8f9ffb12339bb9cd83de1f4bc0 && git checkout 35ead69fa30f2f8f9ffb12339bb9cd83de1f4bc0
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 441a0d7d4d8b62841564da38a2db0097286af590 d8b82f70d50a48747586e5281279e091ce9c9331 && git checkout -B drift-repro 441a0d7d4d8b62841564da38a2db0097286af590 && git merge --no-ff d8b82f70d50a48747586e5281279e091ce9c9331
node scripts/docs-audit/affected-docs.mjs --json 441a0d7d4d8b62841564da38a2db0097286af590
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: PR #36449, card #36425, PR 1 of 2. Read: the card body and its five comments, the PR body and its one comment, the ten-file net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentpackages/spec/src/data/field.zod.ts
S1 (should-fix) — The stated reason for refusing the pair when a
packages/spec/liveness/field.json (implementing)
packages/spec/src/system/metadata-form-zod-reconciliation.test.ts (implementing)
packages/spec/src/data/field-show-on-create.test.ts (implementing)
Does PR 1 stand alone if PR 2 never lands?
Implemented-by: VERDICT: PASS |
…w-up names its card Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude <noreply@anthropic.com>
…owOnCreate Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude <noreply@anthropic.com>
The DDL never reads it (presentation), and FLS keeps it: a boolean facet that names no field. Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta review of PR #36449 (card #36425, PR 1 of 2). The previous record is PASS 7079100809 at The range. Four commits, each with one parent: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentpackages/spec/src/data/field.zod.ts S1: closed. The fix took route (b). The ruling is on the card (7079131071 item 3), and the four texts were rewritten: the comment above the refusal, the message, the describe, and the changeset sentence. None of them now says that no create could pass. The reason given is the card's rule, that a required field is always asked for when a record is created so the person creating it sees every value the record must have. The comment says in so many words that the insert would resolve a
No must-fix, no should-fix. packages/spec/src/data/field-show-on-create.test.ts (implementing)
packages/drivers/driver-sql/src/builtin-column-collision.ts (implementing)
packages/metadata-core/src/object-schema-fls-references.ts (implementing)
packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts (implementing)
packages/spec/liveness/field.json and packages/spec/src/system/metadata-form-zod-reconciliation.test.ts (implementing, unchanged in this range)
Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 REWORK · head 维护者速读
要改的(1 项)
增量核对(
|
Both packages' every-field-key ledgers now classify showOnCreate, which changes their shipped source. Claude-Session: https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 ACCEPT(增量)· head 维护者速读
增量核对(
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Landing (seat 7, 2026-11-22T14:26Z): head |
… values by default, served only for fields the reader may read (objectstack-ai#36399) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_ Part of objectstack-ai#36290 PR 1 of 3 (spec + server). PR 2 draws per-field rows on the record page from the served change code, and PR 3 adds the per-field history card (`Fixes objectstack-ai#36290`). Shape approved by the seat (option B: a new key, `enable.fieldHistory`, with no default), per ruling 7076513167. Clause-②: yes (widening) Metadata-protocol: semantic Skills-docs: carried by objectstack-ai#36419 ## 维护者速读 - 记录的动态里,每个被修改的字段现在默认显示「字段:旧值 → 新值」,所有对象都一样;对象写 `enable: { fieldHistory: false }` 可整体关闭,字段写 `fieldHistory: false` 可单独关闭。成员只能看到自己有权读取的字段的修改,不开放 `sys_audit_log`。 - 属于「记录页字段修改历史」:以前只有逐个字段写了 `trackHistory: true` 才显示值,其余修改只写字段名。新开关没有默认值,所以已构建或已存储的对象升级后直接生效,不需要重新构建。 - 若出错,可能表现为成员看到不该看到的字段值(读取侧已按字段逐条收窄并有测试钉住),或某条动态写入失败(摘要已按 500 字符上限截断)。可整体撤回,已写入的动态行不受影响。 - 升级注意:`trackHistory: false`(对象上或字段上)都不再关闭值显示。要关闭,对象请写 `enable.fieldHistory: false`,字段请写 `fieldHistory: false`。字段设计器以前每次保存都会写 `trackHistory: false`,所以这个值不能当作关闭开关;仓库内 44 个平台对象已补上对象级开关。 ## What changes **Spec** (`packages/spec/src/data/object.zod.ts`, `field.zod.ts`, forms): - New `ObjectCapabilities.fieldHistory: z.boolean().optional()` with no default. Absent: values show. `false`: values off for the object. It has no default on purpose: `ObjectSchema.parse` materializes every defaulted `enable` key whenever an `enable` block exists, so a default would be written into every built artifact and stored definition (measured: 33 of 38 hotcrm objects carry an `enable` block). With no default, an upgraded install gets values with no rebuild. - `enable.trackHistory` keeps its schema and meaning (default `false`; with `true` the default record page reads the compliance ledger and the derived `history` verb is served). Its describe now says that value display is `fieldHistory`'s question. - New `FieldSchema.fieldHistory: z.boolean().optional()`, no default: the field's off switch. Absent: values show. `false`: the change is named by label only. `true`: values show, a media or JSON type included. Under an object with `enable.fieldHistory: false`, values stay off whatever the field says. - Field `trackHistory` keeps its schema. `false` now reads like absent (values show): the field designer wrote `trackHistory: false` on every save while the key meant nothing (`FieldDesigner.tsx`, persisted by `MetadataFieldsPage.tsx`), so a stored `false` cannot be told from a choice. `true` keeps one job: it opts a media or JSON field in. - Object form `enable` composite offers `fieldHistory`; the object form's `fields` repeater and the field form offer the field `fieldHistory`. Each row's help text says that unset means on, although the switch shows off. Liveness entries `object.json#fieldHistory` and `field.json#fieldHistory` (live, evidence `audit-writers.ts#changeValuesShownFor`). - The two closures over every `FieldSchema` key classify the new key: driver-sql `FIELD_KEY_STORAGE_CLASS` (`presentation`: `createColumn` never reads it) and metadata-core `FIELD_REFERENCE_POSITIONS` (`keep`: a boolean that names no field). The metadata-protocol `field` property count moves 84 → 85. **Writer** (`packages/plugins/plugin-audit/src/audit-writers.ts`): - `changeValuesShownFor(objectDef)` decides per changed field: off when the object writes `enable.fieldHistory: false`, or the field writes `fieldHistory: false`, or the field is a credential (`collectMaskedReadFields`: `secret`, and `password` off better-auth objects — both sides would be the same mask). Media and structured-JSON types (`image`, `file`, `avatar`, `video`, `audio`, `signature`, `composite`, `repeater`, `record`, `location`, `address`, `code`, `json`, `vector`) show values only with an explicit `fieldHistory: true` or `trackHistory: true`. Everything else is on, including a field that writes `trackHistory: false`. - `renderTrackedChangeSummary` and `planTrackedLookupReads` take that predicate instead of reading `trackHistory === true`. - The stored summary is fitted to `sys_activity.summary`'s `maxLength` (500) by `fitStoredChangeSummary`: each side is cut to 60 characters first, then trailing changes are left out (`; …`). Before this, the tracked branch was not fitted, so a long value would fail the insert under default-on. The `summary_message` code keeps every change, each side capped at 1,000 characters. **Read side** (`activity-field-redaction.ts`, `activity-summary-message.ts`, `audit-plugin.ts`): - The `fieldChanges` code (`metadata.summary_message`) is now served to readers, narrowed change by change with the same `resolveServedFields` answer as `metadata.old` / `metadata.new`. A reference field's change is kept only for a reader served the referenced record's title (`referenceTitlesPerRead`). Any other code is still stripped for non-system readers, and `text_sources` stays stripped. - When a reader is not served the stored summary, it is recomposed from the narrowed changes in the reader's locale instead of dropped whole. A row whose every change is withheld is still withheld as a row. - The summary-locale middleware is now registered before the redaction middleware, so redaction runs inside it and the locale composer sees the narrowed code. **44 in-repo objects** that wrote `trackHistory: false` now also write `fieldHistory: false`, so their "no history" holds: cloud-connection `sys-cloud-binding-credential`; metadata-core `sys-metadata-audit`, `sys-metadata-commit`, `sys-metadata-history`; platform-objects `sys-attachment`, identity `sys-account`, `sys-device-code`, `sys-jwks`, `sys-oauth-access-token`, `sys-oauth-client-assertion`, `sys-oauth-client-resource`, `sys-oauth-consent`, `sys-oauth-refresh-token`, `sys-oauth-resource`, `sys-personal-view`, `sys-session`, `sys-two-factor`, `sys-user-preference`, `sys-verification`, system `sys-lifecycle-state`, `sys-migration-journal`, `sys-migration`, `sys-platform-setting-audit`, `sys-platform-setting`, `sys-recycle-bin`, `sys-secret`, `sys-seed-landed-key`, `sys-setting-audit`, `sys-setting`, `sys-trusted-key`; plugin-audit `sys-activity`, `sys-audit-amendment`, `sys-audit-checkpoint`, `sys-audit-log`, `sys-audit-signing-key`, `sys-comment-reaction`; plugin-sharing `sys-share-link`; service-automation `sys-connector-connection`, `sys-connector-credential`, `sys-flow-credential`; service-messaging `channel-account`, `channel-user-link`, `user-device`; service-realtime `sys-presence`. hotcrm at `689166c`: 0 objects write `trackHistory: false` (reported to the seat; nothing pushed there). **Files that moved because the default flipped** (approved by the seat as growth within the ruling): - *Object-form translation bundles, 11 locales* (`packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts`): the new `enable.fieldHistory` label, and the two `trackHistory` help texts, which still said "opt-in per field". Why it moved: the form offers a new row, and the old help text is now false. Since review round 1 they also carry the field `fieldHistory` row labels and the new help texts. Count pins move with them: `object-collapsed-sections-echo-decisions.test.ts` (panel leaves 117 → 119, capabilities 11 → 13, open leaves 128 → 130) and `object-lifecycle-panel-echo-decisions.test.ts` (positive control 756 → 759). - *Two dogfood files*: `field-history-tracking-activity.dogfood.test.ts`, whose website-only leg pinned the label-only frame and now reads `Website: https://before.example → https://after.example` (why: `website` declares no `trackHistory`, so it is on). `activity-label-display-field.dogfood.test.ts`: its `REF_TITLED` fixture gets `enable: { fieldHistory: false }`. Why: those pins read the update frame that names the record by its label (the referenced title). With values on, the update's summary would be `Name: titled → titled again`, which names no record label, so the withheld/served pair would pass without testing anything. With values off, the frame still names the record label, so the pins keep testing whether the title is served. - *Checklist item* `records-forms.field-history-tracking` rev 16: title, acceptance[1], negative[0], automated.ref and source[1] said values were opt-in per field. Why: they now describe the shipped default. - *Four hand-written docs*: `protocol/objectql/security.mdx` §7, `data-modeling/objects.mdx` flag table, `data-modeling/fields.mdx` and `data-modeling/validation-rules.mdx` `trackHistory` rows. Why: each said values were opt-in. ## Review round 1 (L2 7078144432 FAIL, L1 7078132570 REWORK) - **M1, designer-saved `trackHistory: false`.** Closed by a field key of its own instead of a conversion (seat OK'd). A stored-row conversion was measured and rejected: `applyConversionsToStoredItem` (`packages/spec/src/conversions/stored.ts`) replays the whole chain on every read with `includeRetired: true` and no version window. So a conversion that drops field `trackHistory: false` would also erase every deliberate opt-out saved after the upgrade, on every load. With `fieldHistory` as the off switch, a stored `trackHistory: false` reads like absent, so fields already saved through the designer show values after the upgrade with no conversion. Census: no code-authored field in `packages/**` or `examples/**` writes `trackHistory: false`; all 45 occurrences are object-level `enable` blocks (44 objects plus a comment). - **S1, two-state switch.** Each `fieldHistory` row and the field `trackHistory` row now have help text. Renderer, read at this head: `SchemaForm.tsx` draws a boolean as `<Switch checked={!!value} onCheckedChange={(c) => onChange(c)} />`. So an untouched switch writes nothing, and only a toggle writes `true` or `false`. It cannot show unset apart from `false`: an unset `fieldHistory` shows as off while values show. The help text says this. A third state is a renderer change that no PR on this card carries. - **Nits.** The field describe now says an object `enable.fieldHistory: false` wins over a field `true` (pinned). Not taken: `tree` changes still show a stored id, and multi-value option types show stored values joined by commas. The card's acceptance names select, lookup and user, and those three resolve. - **L1.** `Skills-docs: carried by objectstack-ai#36419`. objectstack-ai#36419's step 1 still names field `trackHistory: false` as the field's off switch. At this head it is field `fieldHistory: false`, and the seat owns that card's text. ## Census: every reader of `enable.trackHistory` (seat rider) None of these reads changes meaning, because `trackHistory` is untouched: - objectstack `packages/spec/src/data/api-derivation.ts` (`history` verb, `=== true`). - ui `RecordDetailView.tsx` (`historyEnabled`: `!== true` → no ledger read); `appObjectScope.ts` (`recordStreamObjectNames`, `=== true`); `ObjectSettingsPanel.tsx` (opt-in toggle; writes an explicit boolean; a `fieldHistory` toggle is PR 2). - `plugin-approvals` `approval-service.ts` (type only); cli `explain.ts` (doc example); metadata-core `object-schema-fls-references.ts` (key list). - Not readers: database-loader's `trackHistory` is an unrelated loader option; driver-sql `builtin-column-collision` is a name map; hotcrm has comments only. - UI producers of the field key: `FieldDesigner.tsx` writes `trackHistory: data.trackHistory === true` on create and edit (so every save writes an explicit `false`), and `ObjectFieldInspector.tsx` reads `!!def.trackHistory`. Since this head that `false` reads like absent, so it no longer changes behaviour. PR 2 moves both producers to `fieldHistory`. ## Tests - `audit-writers.test.ts`, new describe `[objectstack-ai#36290] a changed field shows old → new unless the object or the field turns it off`: absent → on; `enable.fieldHistory: false` → label only; `enable.trackHistory: false` alone → still on (the upgrade note); field `fieldHistory: false` → label only; field `trackHistory: false` (what the designer wrote) → values still show; object `enable.fieldHistory: false` wins over field `fieldHistory: true`; `json` with `fieldHistory: true` → on; credential → label only; `json` → only with `true`; a long value inserts at ≤ 500 with each code side capped at 1,000 and `…`; 30 changes fit with `; …`. - `activity-field-redaction.test.ts`, `[objectstack-ai#36290]` code pins: a system reader gets the full code; a masked reader's code omits the masked field; an unserved reader's code and recomposed summary omit the unserved field; the control reader gets it all; a non-`fieldChanges` code is still not served; a reference change is kept only under the title rule. These fail if the per-change narrowing is removed (each asserts the absent field is absent from summary, code and old/new). - `spec/src/data/object.test.ts`: a parsed `enable` block carries no `fieldHistory` key, and `false` survives parse. - Fixtures that pin the label-only frame now say so (field `fieldHistory: false` or `enable.fieldHistory: false`): `audit-milestone-summary`, `audit-lookup-summary`, `audit-writers` (amount, campaign, person_qualification), `activity-lookup-name-field-label-34055`, `activity-summary-reader-locale.integration`. ## Verification Head `aa362ba1`: a merge of main after objectstack-ai#36449 (objectstack-ai#36425 `showOnCreate`) landed. Against main, the PR's diff changes in two places only: the metadata-protocol `field` count (85 → 86) and the generated liveness count (`field` 115). Re-run at `aa362ba1`: metadata-protocol pin 18, driver-sql closure 11, metadata-core FLS 63, platform-objects translations 610, spec `src/data` 6713, plugin-audit writers + redaction 181, `check:generated`, checklist and i18n-bundle checks all pass. Before that, `d531553a` was `c43a42bb` plus one changeset line naming `@objectstack/driver-sql` at patch (L1 7080045587); the figures below were measured at `c43a42bb`, and this commit changes no source. Round 2 (`6e416547` the field key, `17772933` the metadata-protocol count, `c43a42bb` the two key closures) on top of round 1 (`851997e6`). - plugin-audit full suite: 109 files / 1809 tests passed (round 2). - spec `src/data` 187 files / 6708 passed; platform-objects translations 610 passed; metadata-core full suite 27 files / 1048 passed; driver-sql `builtin-column-collision` 2 files / 18 passed; metadata-protocol `meta-types-degenerate-derivation` 18 passed; lint `validate-security-posture` + `rule-explanations` 232 passed; cli `data-model-rules` 65 passed; service-messaging and metadata-core `builtin-column-storage-attributes` 18 passed. - Ablations at round 2 (each restored, `git diff HEAD` empty after): removing the field `fieldHistory === false` check of `changeValuesShownFor` reds 4 tests in `audit-writers.test.ts`; making field `trackHistory: false` an off switch again reds the `designer_saved` pin; removing the driver-sql `fieldHistory` row reds `classifies EVERY FieldSchema key, and invents none`. Round 1's ablations (per-change narrowing 9 of 40, `enable.fieldHistory` branch 8 of 139) still hold. - `dispatch-gates --commands` at round 2: 128 commands, every one exit 0; `dispatch-gates --ran`: 128 derived, 128 run, 0 NOT-MEASURED. This sweep does not derive the driver-sql and metadata-core key closures; CI's Test Core 3/10 and 10/10 found them at `17772933`, fixed in `c43a42bb`. - Full dogfood battery at `c43a42bb`, after rebuilding driver-sql and metadata-core under the verify lock (build VERDICT command-exit 0): `vitest run` lock VERDICT command-exit 0, Test Files 484 passed / 3 skipped (487), Tests 4107 passed / 68 skipped (4175), no failures. The same battery at `6e416547` + `17772933` gave the same counts. - CI at `c43a42bb`: 70 check-runs completed, 60 success and 10 skipped, none failed (Test Core 10/10, Test UI 16/16, Type Check UI and workspace, every Lint lane, Build Core, Build Docs, Live E2E UI, Check Changeset, PR-body guards, Spec property liveness). - `overlap-check` at `aa362ba1`: clean against `origin/main`. objectstack-ai#36449 has landed and is merged in. objectstack-ai#36392 now conflicts only in the generated `liveness/state-counts/field.md`. Two-minute check: `pnpm --filter @objectstack/plugin-audit exec vitest run src/audit-writers.test.ts src/activity-field-redaction.test.ts -t 36290`. Read first, by risk: 1. `packages/plugins/plugin-audit/src/activity-field-redaction.ts`: the per-change narrowing of `summary_message` and the recomposed summary. 2. `packages/plugins/plugin-audit/src/audit-writers.ts`: `changeValuesShownFor` and `fitStoredChangeSummary`. 3. `packages/plugins/plugin-audit/src/audit-plugin.ts`: the middleware order. --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jRCdMrPNTumXfsr1mw --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…bject's fields and field groups, and showOnCreate (objectstack-ai#36609) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi91tYCagMT6JaQ6YA5YqnWwi)_ Fixes objectstack-ai#36455 Clause-②: no Metadata-protocol: none Skills-docs: updated here ## 维护者速读 - 用户能看到什么变化:照着界面技能写应用的 AI,今后把「新建 / 编辑」表单的分区、折叠和「新建时不问这个字段」写在对象的字段和字段分组上,不再去写一张已经没人加载的内部表单。 - 为什么做:这是「内部新建和编辑表单退役」那件事的收尾。平台已经改了,技能包还在教旧写法。 - 出错会怎样:AI 照旧文字写出的表单布局不生效,也不知道有「新建时显示」这个开关。本次只改技能文字和它的评测题,撤回这一个合并就恢复原样。 - 要你做什么:技能包属于受管文件,需要你审阅并合并;本单保持草稿。 ## What changes `skills/objectstack-ui` taught the object's internal create and edit form views (`form`, `formViews.create`, `modalSize`, the form-view `subforms` override). After objectstack-ai#36425 (PR objectstack-ai#36449, then PR objectstack-ai#36543) the Console's create and edit surfaces load none of them. The skill now teaches what `main` does. - **`SKILL.md`**, Traps 1: New and Edit are the object's fields and `fieldGroups`, never a form view; `showOnCreate: false` keeps a field off every create surface and is refused beside `required: true`. The "Where to go" row for forms names the object as the place the New / Edit form is authored, and keeps the named and public forms under `src/views/*.view.ts`. - **`rules/list-views.md`**, "Form Views": rewritten. New and Edit are built from the object (fields, sectioned by `fieldGroups` in array order, following the fields' own rules); `collapse: 'collapsed'` on a group folds a rarely filled section; `showOnCreate: false` and its refusal; dialog size and column count are derived. A container's `form`, `formViews.default` and `formViews.create` still parse and steer nothing, and `os validate` warns `form-view-internal-not-loaded`. Kept, as the two kinds of form view that load: a named `formViews` entry (`OBJECT.key`) that an action of type `form` opens at `/forms/:name`, and a public form, whose paragraph is unchanged. - **`rules/list-views.md`**, the `defineView` container example: the default `form` is replaced by a named `formViews` entry (still an `os:check` block). - **`rules/list-views.md`**, "Master-Detail Forms": option 2 (form-view `subforms`) is removed, because no create or edit surface reads it any more. The parent field group naming the child (option 1) and the page block stay. `taxRateField` is attributed to the page block, the only schema that declares it. - **`evals/views-apps-actions-pages.json`**: evals 1, 6, 13 and 19 taught or assumed an internal form view. Each now expects the object's field groups and `showOnCreate`. `evals/README.md` names the new coverage. - **`.changeset/36455-ui-skill-create-surfaces.md`**: `@objectstack/skills` patch. The changeset check requires it: a `skills/**` change releases that package and never takes the skip label. ### Token and line readings (the skills ratchet; no ceiling is changed) | File | Lines before → after | Tokens before → after | Ceiling | |:--|:--|:--|:--| | `skills/objectstack-ui/SKILL.md` | 164 → 164 | 2230 → 2230 | 2272 (unchanged) | | `skills/objectstack-ui/rules/list-views.md` | 413 → 409 | 4447 → 4447 | 4448 (unchanged) | | `skills/objectstack-ui/evals/views-apps-actions-pages.json` | 235 → 235 | 6113 → 6235 | none (eval fixture, measured, not ratcheted) | | `skills/objectstack-ui/evals/README.md` | 54 → 55 | 636 → 655 | none (eval fixture) | | All `SKILL.md` files under `skills/`, summed | 4948 → 4948 | | | | Bundle total (whole shipped tree) | | 293946 → 294087 | | Both ratcheted files end at the token count they started at: the new text is paid for by cuts in the same file. The bundle total rises by 141 tokens, all of it in the two eval files, which the ratchet measures and does not price (`skills/README.md` says `evals/` is inert in a consumer install). Readings taken at `f7c9b8465b` against base `f4c2d0b1b9`. ### Where each sentence comes from Every behavioural claim in the new text, with the code on `main` (`f4c2d0b1b9`) that makes it true. | Claim | Source | |:--|:--| | `showOnCreate` is an optional boolean on a field; absent or `true` means asked for on create | `packages/spec/src/data/field.zod.ts:2931` | | `showOnCreate: false` beside `required: true` is refused, with or without a `defaultValue`; `requiredWhen` is the way out | `packages/spec/src/data/field.zod.ts:3253-3271` | | Every create surface leaves such a field out; edit keeps it | `ui/packages/app-shell/src/utils/recordFormNavigation.ts:206-211` (`isFieldAskedOnFlow`), `ui/packages/app-shell/src/utils/recordFormFields.ts:29-40` | | The three hosts use that one list: the dialog, the full-page form, an action-opened form | `ui/packages/app-shell/src/console/AppContent.tsx:1791`, `ui/packages/app-shell/src/views/RecordFormPage.tsx:296`, `ui/packages/app-shell/src/hooks/useActionModal.tsx:289` | | No internal form view is read: sections, tabs, subforms, `modalSize`, buttons, layout, `defaults` | `ui/packages/app-shell/src/console/AppContent.tsx:1752-1757`, `ui/packages/app-shell/src/utils/recordFormNavigation.ts:213-240` | | Sections come from `fieldGroups` in declared order | `packages/spec/src/data/field-group-layout.ts:16-17` | | `collapse: 'collapsed'` on a group folds its section in the form | `packages/spec/src/data/object.zod.ts:1602-1603`, `ui/packages/plugin-form/src/fieldGroups.ts:121-122` | | The dialog sizes itself when no size is passed, and the hosts pass none (only the phone posture's `full`) | `ui/packages/plugin-form/src/ModalForm.tsx:565-590`, `ui/packages/app-shell/src/utils/recordFormNavigation.ts:213-240` | | `form`, `formViews.default`, `formViews.create` are reported as `form-view-internal-not-loaded`, a warning, by the check tools; a public form and a form under any other name are not | `packages/lint/src/validate-internal-form-views.ts:16-31` and `:76-128`, `packages/lint/src/authoring-rules.ts:1832-1844` | | A `formViews` entry is registered as `OBJECT.key` | `packages/spec/src/ui/view.zod.ts:8092-8101` | | An action of type `form` opens `/forms/:name` with `target` as the name | `ui/packages/core/src/actions/ActionRunner.ts:2931-2950`, `ui/apps/console/src/App.tsx:456` | | A named form's `type` is `simple`, `tabbed` or `wizard`, and the page draws each | `packages/spec/src/ui/view.zod.ts:5341-5343`, `ui/apps/console/src/components/FormPage.tsx:290` and `:2834-2847` | | A wizard step lists `fields`; `group` on one is refused | `packages/spec/src/ui/view.zod.ts:5710-5731` | | A named form draws no child line items | `ui/apps/console/src/components/FormPage.tsx`: zero matches for `subforms`, `relatedList` and `MasterDetail`; control: the same file matches `wizard` 33 times | | Child line items on create and edit come only from `fieldGroups[].relatedList` | `ui/packages/app-shell/src/utils/recordFormNavigation.ts:185-198` | | `taxRateField` is a key of the master-detail page block | `packages/spec/src/ui/component.zod.ts:7552` (no other declaration under `packages/spec/src`) | ## Tests No package source changes, so no package test suite is owed. What was run: - `check:skill-examples` (not in the derived list; run because an `os:check` block changed), after building the `@objectstack/client-react` dependency closure under the verify lock (`VERDICT command-exit 0`, 43 of 43 tasks): `349 prose examples type-check across 3 surface(s)`. - The edited eval file through the repo's own loader (`parseEvalFile`, `packages/qa/scenarios/src/skill-evals/cases.ts`): 23 cases, 0 refusals. - No ablation: the diff changes documentation and eval fixtures, and no behaviour a test pins. ## Acceptance notes - **The three dispatch assumptions.** (1) Confirmed: Traps 1 and "Form Views" were the stale passages, and the container example's `form` was dead for create and edit. Also stale, and corrected: Master-Detail option 2, the "Where to go" row, and four eval cases. (2) Partly falsified: of `columns`, `collapse` and `modalSize`, only `collapse` on a field group is still honoured on create and edit. A field group has no `columns` key, and the hosts pass no `modalSize`. (3) Confirmed: the parent field group naming the child is live and is kept. - **A stepped create form with line items** (eval 6) can no longer be authored as one form view: New and Edit load no wizard, and a named form draws no child lines. The eval now expects the field-group order and says so. - **Not changed, on purpose.** `rules/navigation.md` "Record Presentation" already says width and columns are derived; its `sections` ladder still applies to named forms and page blocks. The `form` row of the Action Types table still holds. `references/react-blocks.md` is generated; its `modalSize` sentence follows the spec `describe` text, which objectstack-ai#36544 carries. - **Noted, not changed here (outside this card's files).** `skills/objectstack-data/rules/relationships.md:278` still points at "`subforms` overrides" in this skill's Master-Detail section, which no longer has one. No file under `skills/objectstack-data` teaches `showOnCreate`, though the key is a field key. `skills/objectstack-automation/SKILL.md:44` and `skills/README.md:125` send a stepped form to a wizard form view without saying it must be a named form an action opens. - **Noted, not filed.** A named or public form carries a section's `collapsed` through (`FormPage.tsx:933-934`) and no render code in that file reads it. Read from source only; not reproduced in a browser. The new text does not teach `collapsed` on a form-view section. ## Verification Head `f7c9b8465b`. **Read first** (by risk): 1. `skills/objectstack-ui/rules/list-views.md`, the "Form Views" hunk: every sentence is new teaching. 2. `skills/objectstack-ui/evals/views-apps-actions-pages.json`, eval 6: the expected answer changed from a wizard to field-group order. 3. `skills/objectstack-ui/SKILL.md`, Traps 1. **Two-minute check:** `node scripts/check-skills-token-ratchet.mjs` prints `skills/objectstack-ui/SKILL.md is 2230 tokens (ceiling 2272` and `skills/objectstack-ui/rules/list-views.md is 4447 tokens (ceiling 4448`, and exits 0. <details> <summary>Local gates at f7c9b84: 50 derived, 49 run with exit 0, 1 NOT MEASURED</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived 50 commands. Each was run with its exit code captured before any pipe, and the record was reconciled: ``` Run reconciliation — 50 derived, 49 run, 1 NOT-MEASURED, 0 UNRUN. ✓ dispatch-gates --ran: 50 derived famil(ies) accounted for — 49 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3). ``` NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3 (it needs every package's `dist`; left to CI). Verdict lines: ``` ✓ check-skills-token-ratchet: 60 authored bundle file(s) within their ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured, not ratcheted. ✅ Skill docs in sync ✓ check-skill-links: 270 relative link(s) in 75 published skill file(s) resolve; 139 fragment(s) name a real heading under GitHub's slug rule. ✓ check-adr-0087-registration: this PR adds no declared-breaking changeset (1 non-breaking changeset(s) seen). check-nul-bytes: OK (scanned 27162 text file(s) -- 27162 tracked, 0 untracked-not-ignored; skipped 101 binary; no raw ASCII control bytes). ``` Outside the derived list, also exit 0: `check:skill-examples`, `check:skill-refs`. `node scripts/pm/overlap-check.mjs` before each push: `VERDICT clean exit 0` (one open PR, objectstack-ai#35129, shares `SKILL.md` and merges cleanly). </details> CI check-runs: not read at the time this body was written. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmPTDM2MxHR8cvoMVUX --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steedos · project thread
repo:objectstack#7 · zhuangjianguo · session_01QsR2jVMKrYARogu1S6PcHj
Part of #36425 (PR 1 of 2: the field key and its save-time refusal. PR 2 retires the internal create and edit forms in the Console and Studio, adds the readers of this key, the Studio switch and the lint notice. The skills text is #36455, a domain:skills card.)
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #36455
维护者速读
What changes
FieldSchema(packages/spec/src/data/field.zod.ts) gainsshowOnCreate, an optional boolean.true: the field is asked for when a record is created, as today.false: every create surface (the create dialog, the full-page create, an action-opened create) leaves the field out; editing, the record page and lists still show it. The key has no default, so no field parsed today changes shape.docs/adr/**is untouched here.showOnCreate: falseon arequired: truefield is refused inFieldSchema'ssuperRefine, at the field'sshowOnCreatekey, so every door that parses a field refuses it (defineStack,os validate, the metadata save; the object door locates it atfields.NAME.showOnCreate). The reason it gives is the card's item 6, which makes no exception: a required field is always asked for when a record is created, so the person creating it sees every value the record must have. The message names both fixes (keep the field on create, or droprequired). AdefaultValuemakes no exception either (the seat's ruling, card comment 7079131071 item 3): the insert would resolve the default, so such a create could pass, but the field is still asked for, with its default filled in. ArequiredWhenfield is accepted: its gate is a predicate the parse cannot judge, and the write door still refuses a create born inside it.liveness/field.jsongains ashowOnCreaterow,planned, evidence the parse-time refusal. Its readers are PR 2's create surfaces, and the row flips tolivein that PR, citing them.authorable-surface/data.json(data/Field:showOnCreate),liveness/state-counts/field.md, and the three reference pages that renderFieldSchema(data/field.mdx,data/object.mdx,system/migration.mdx), fromcheck:generated --fix.@objectstack/specminor;@objectstack/driver-sqland@objectstack/metadata-corepatch, since their every-field-key ledgers (FIELD_KEY_STORAGE_CLASS,FIELD_REFERENCE_POSITIONS) now classify the key.What this PR deliberately leaves to PR 2
The claim's lines (
Clause-②: yes (narrowing),Metadata-protocol: semantic) describe the whole card. Their narrowing and semantic halves belong to PR 2, where an internal form stops steering the create and edit forms; the seat amends the claim when PR 2 opens. Two items move there by the seat's ruling on this split, and the skills text goes to its own card:field.form.tsrow, the eleven metadata-forms locale packs, the field inspector): a switch offered before any create surface honours it is the shape ADR-0078 rules out;Skills-docs: follow-up #36455.Tests
packages/spec/src/data/field-show-on-create.test.ts(new): the key parses switched on and off and stays absent when not authored;showOnCreate: falsebesiderequired: trueis a fullsafeParsefailure located atshowOnCreatewith acustomissue whose message opens with its first sentence; the same with adefaultValue; the object door locates it atfields.amount.showOnCreate; four controls are fullsafeParsesuccesses (on + required, required alone, off + not required, off +requiredWhen).Review round at
1c0012aa: the refusal's comment, message, describe and the changeset now give the card's reason instead of saying no create could pass (L2 S1); the skills follow-up names skills: objectstack-ui still teaches internal create and edit forms, and not showOnCreate (after #36425) #36455 (L1-d). The new test's message assertion follows the reworded first sentence; that file and the reconciliation file ran green at1c0012aa(Tests 81 passed);check:generated14 of 14 up to date after regenerating the three reference pages;check:liveness,check-changeset-no-majorandcheck-nul-bytesexit 0. The rest of the derived set ran at197434e9; this round changed only prose, a test regex and regenerated references.CI round at
b86db2be: Test Core at1c0012aawas red in three shards, all field-key pins this key owes:metadata-protocolprotocol.meta-types-degenerate-derivation.test.ts(fieldserves 85 top-level properties, was 84),driver-sqlbuiltin-column-collision.test.ts("classifies EVERY FieldSchema key":showOnCreateispresentation, the DDL never reads it) andmetadata-coreobject-schema-fls-references.test.ts("classifies every FieldSchema key":showOnCreate: keep, a boolean facet that names no field). Each of the three files ran green locally atb86db2be(18, 11 and 63 tests).L1-d round at
d8b82f70: the changeset adds those two patch entries;check-changeset-no-major,check-empty-changesetandcheck-changeset-fixedexit 0 againstorigin/main. No code changed sinceb86db2be, where all 74 checks finished green (62 success, 12 skipped).Reverse verification (one-off, committed fix first,
scripts/ablation-replace.mjs): replacing the refusal's condition withfalseturned exactly the three refusal cases red and left the controls green; the file was restored to its HEAD blob (aebcfbd38223,git diff HEADempty).Package suite at the head before the last commit:
pnpm --filter @objectstack/spec test(local project, under the verify lock) →Test Files 1 failed | 871 passed (872),Tests 1 failed | 27913 passed | 1 todo. The one red wasmetadata-form-zod-reconciliation.test.ts("field: every top-level key the author may write is offered, or its omission is recorded" namedshowOnCreate). The last commit records the key as not yet offered (anomitrow whose reason is theplannedgrade; PR 2 deletes the row and offers the switch); that file and the new test then ran green at197434e9:Test Files 2 passed,Tests 81 passed.pnpm --filter @objectstack/spec typecheck→ exit 0.scripts/liveness/(repo project) →Test Files 2 passed,Tests 87 passed.test:repobeyondscripts/liveness/is left to CI's Test Core: the diff touches no repo-project test.Acceptance notes
d8b82f70, unchanged fromb86db2be):overlap-check.mjsreports clean merges withorigin/mainand fix(spec)!: retire columnState from the stored view row #36435, feat(kanban): the board's own view settings, lane header create and menu, and a lane statistic #36411, fix(plugin-security)!: an app-authored elevation's reads and writes are judged by its caller's organization wall #36386, fix(fields): a pick leaves an amount in another currency empty and says why #36351. feat: line-item table cells for people, multi-select, tags, check and rating (#36043) #36392 conflicts only in the generatedliveness/state-counts/field.md; feat(audit): the activity stream shows each changed field's old → new values by default, served only for fields the reader may read #36399, which also adds a field key, conflicts there and in thefieldproperty-count pin, which whichever lands second raises by one and regenerates.Verification
Derived gate families at 197434e: 115 derived, 114 run green, 1 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commandsderived 115 commands; each ran with its exit code recorded before any pipe, and--ranreconciled: "115 derived famil(ies) accounted for — 114 run, 1 NOT-MEASURED".packages/spec/distthe loop's own siblings had rebuilt without declarations, and the shallow clone missing the teardown fixture commit). Afterpnpm --filter @objectstack/spec buildand fetching the fixture commit, all seven re-ran at exit 0:check-plugin-teardown-shape --self-test,check:api-surface,check:dual-source-exports,check:entry-nameability,check:exported-any,check:generated(it had reportedapi-surface/stale against that same dist; 14 of 14 up to date after the rebuild),check:skill-examples.pnpm check:dual-build-cjs-loads(exit 3, prerequisite not met in this container), left to CI.node scripts/check-nul-bytes.mjs→ exit 0.Two-minute check:
pnpm --filter @objectstack/spec exec vitest run src/data/field-show-on-create.test.ts→ 5 passed.First files to read:
packages/spec/src/data/field.zod.ts(theshowOnCreatekey besidehidden, and the newsuperRefineblock beforereferenceVia),packages/spec/liveness/field.json(theplannedrow).Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj