Skip to content

feat(spec): a field can say it is not asked for when a record is created (showOnCreate) - #36449

Merged
objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-8l1u7g
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-8l1u7g

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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) gains showOnCreate, an optional boolean.

  • Meaning. Absent or 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.
  • Name and admission (ADR-0085 §2). Per the seat's reading on the claim: the key is a field's creation-time intent (which fields this business asks for when a record is born), not inferable from the schema, and it binds every create surface rather than one page, so its name names no page or dialog. The ADR note rides the week's ADR card after this lands; docs/adr/** is untouched here.
  • The one refused pair. showOnCreate: false on a required: true field is refused in FieldSchema's superRefine, at the field's showOnCreate key, so every door that parses a field refuses it (defineStack, os validate, the metadata save; the object door locates it at fields.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 drop required). A defaultValue makes 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. A requiredWhen field is accepted: its gate is a predicate the parse cannot judge, and the write door still refuses a create born inside it.
  • Liveness ledger. liveness/field.json gains a showOnCreate row, planned, evidence the parse-time refusal. Its readers are PR 2's create surfaces, and the row flips to live in that PR, citing them.
  • Generated. authorable-surface/data.json (data/Field:showOnCreate), liveness/state-counts/field.md, and the three reference pages that render FieldSchema (data/field.mdx, data/object.mdx, system/migration.mdx), from check:generated --fix.
  • Changeset. @objectstack/spec minor; @objectstack/driver-sql and @objectstack/metadata-core patch, 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:

  • the lint notice for a still-declared internal form (card item 8): its sentence says the form is no longer loaded, which is false until PR 2 retires the readers;
  • the Studio switch (card item 7: the field.form.ts row, 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;
  • the skills text (card item 9) is skills: objectstack-ui still teaches internal create and edit forms, and not showOnCreate (after #36425) #36455 (domain:skills: skills text lands only in a domain:skills PR), hence 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: false beside required: true is a full safeParse failure located at showOnCreate with a custom issue whose message opens with its first sentence; the same with a defaultValue; the object door locates it at fields.amount.showOnCreate; four controls are full safeParse successes (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 at 1c0012aa (Tests 81 passed); check:generated 14 of 14 up to date after regenerating the three reference pages; check:liveness, check-changeset-no-major and check-nul-bytes exit 0. The rest of the derived set ran at 197434e9; this round changed only prose, a test regex and regenerated references.

  • CI round at b86db2be: Test Core at 1c0012aa was red in three shards, all field-key pins this key owes: metadata-protocol protocol.meta-types-degenerate-derivation.test.ts (field serves 85 top-level properties, was 84), driver-sql builtin-column-collision.test.ts ("classifies EVERY FieldSchema key": showOnCreate is presentation, the DDL never reads it) and metadata-core object-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 at b86db2be (18, 11 and 63 tests).

  • L1-d round at d8b82f70: the changeset adds those two patch entries; check-changeset-no-major, check-empty-changeset and check-changeset-fixed exit 0 against origin/main. No code changed since b86db2be, 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 with false turned exactly the three refusal cases red and left the controls green; the file was restored to its HEAD blob (aebcfbd38223, git diff HEAD empty).

  • 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 was metadata-form-zod-reconciliation.test.ts ("field: every top-level key the author may write is offered, or its omission is recorded" named showOnCreate). The last commit records the key as not yet offered (an omit row whose reason is the planned grade; PR 2 deletes the row and offers the switch); that file and the new test then ran green at 197434e9: 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:repo beyond scripts/liveness/ is left to CI's Test Core: the diff touches no repo-project test.

Acceptance notes

Verification

Derived gate families at 197434e: 115 derived, 114 run green, 1 NOT MEASURED
  • node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands derived 115 commands; each ran with its exit code recorded before any pipe, and --ran reconciled: "115 derived famil(ies) accounted for — 114 run, 1 NOT-MEASURED".
  • Seven families first exited 3 (PREREQUISITE NOT MET: a packages/spec/dist the loop's own siblings had rebuilt without declarations, and the shallow clone missing the teardown fixture commit). After pnpm --filter @objectstack/spec build and 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 reported api-surface/ stale against that same dist; 14 of 14 up to date after the rebuild), check:skill-examples.
  • NOT MEASURED: 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 (the showOnCreate key beside hidden, and the new superRefine block before referenceVia), packages/spec/liveness/field.json (the planned row).


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:data protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/driver-sql, @objectstack/metadata-core, @objectstack/spec, touching 4 documentable anchor(s). ⚠️ 3 changed file(s) yielded no anchor (packages/spec/authorable-surface/data.json, packages/spec/liveness/field.json, packages/spec/liveness/state-counts/field.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-driven.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/external-datasources.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/field-types.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/validation-rules.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/deployment/troubleshooting.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/deployment/validating-metadata.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/getting-started/quick-reference.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/kernel/contracts/data-engine.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/backward-compatibility.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/objectql/types.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/objectui/concept.mdx (via FieldSchema (symbol, a top-level const))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-1.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-3.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-4.mdx (via FieldSchema (symbol, a top-level const))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 3 changed file(s) yielded no anchor (packages/spec/authorable-surface/data.json, packages/spec/liveness/field.json, packages/spec/liveness/state-counts/field.md) — pages documenting those are invisible to this run
  • the SDK route bridge reached 68 of 251 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 441a0d7d4d8b62841564da38a2db0097286af590 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 35ead69fa30f2f8f9ffb12339bb9cd83de1f4bc0 — the merge of head d8b82f70d50a48747586e5281279e091ce9c9331 into base 441a0d7d4d8b62841564da38a2db0097286af590, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 441a0d7d4d8b62841564da38a2db0097286af590 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 197434e99892c47512a9c91e84e243fa8fcc97e0
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts + packages/spec/liveness/field.json, packages/spec/src/system/metadata-form-zod-reconciliation.test.ts, packages/spec/src/data/field-show-on-create.test.ts

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 main (merge base ff60149900), and the check-runs on the head. Code outside the diff was read in the head tree only.

① Derived judgments

  • Accept set, the one change. FieldSchema is a strictObject (field.zod.ts:1647). Before this head it refused the key showOnCreate as an unrecognized key. It now accepts showOnCreate: true and showOnCreate: false on any field. Right, and a pure widening.
  • The refused pair is inside the new space. showOnCreate: false beside required: true is refused by the new superRefine block (field.zod.ts:3232), at path showOnCreate, code custom. Every input that pair names was already refused on main, as an unknown key. Nothing that parsed before is refused now. Right.
  • Nothing is reshaped. The key is z.boolean().optional() with no default. The .overwrite() step does not touch it. A field that does not author the key parses to the same output, key for key. The test pins the absence ('showOnCreate' in data is false). Right.
  • Where the key is reachable. ObjectSchema.fields and the migration field slot take FieldSchema whole, so both gain the key. The three regenerated reference pages agree. ObjectExtensionSchema.fieldPatches is built from BASE_FIELD_DISPLAY_WHITELIST (label, description, inlineHelpText, placeholder), so an extension can patch neither showOnCreate nor required. The refusal cannot be bypassed through a patch. Right.
  • Public surface. One new optional key on the inferred field type and one row in authorable-surface/data.json (data/Field:showOnCreate). Additive. Right.
  • Liveness. liveness/field.json grades the key planned, with the parse refusal as evidence, and the count file moves from 5 to 6 planned. No reader of the key exists anywhere in the head tree (a full grep finds the schema, the test, the ledger and generated pages only). planned is the honest grade. Right.
  • Form reconciliation. The omit row for field.showOnCreate follows the five existing planned, not yet rendered rows in the same ledger. Not offering a switch that nothing honours is the ADR-0078 reading. Right.
  • Check-runs. Green at review time: Check Changeset, Spec property liveness, Lint docs and code guards, Lint repo and tooling gates, Lint CI release and engine gates, Lint ESLint, Lint PM dispatch-gates, the three scoped lint runs, Type Check source gates, PR-body guards, Governed Surface Queue Guard, Check PR Size, Check Documentation Links, Build Docs, Build UI Deps, Dogfood Regression Gate. Pending, not judged: Test Core 1 to 10, Test UI 1 to 16, Build Core, Build and E2E UI, Live E2E UI, Type Check UI, Type Check workspace, Type Check consumer gates, Type Check debt ledger. This record does not vouch for a pending run.

② Semver level

  • The changeset is @objectstack/spec minor. An added kind on the published spec takes at least minor. Minor is right, and Check Changeset is green.
  • Clause-②: yes (widening) is right for this diff. The only accept-set move is the new key, and the refused pair was never accepted.
  • Metadata-protocol: added is right. One authorable key is added, none is removed, renamed or re-meant.
  • Skills-docs: follow-up owed is acceptable. No skill should teach a key that has no reader yet. The debt is real and is PR 2's.
  • Part of #36425 is right. The card's acceptance lines are all UI readings and none is met by this PR.
  • The card's claim still reads Clause-②: yes (narrowing) and Metadata-protocol: semantic. Those describe the whole card. They do not describe this diff, and the claim should be amended when PR 2 opens, as the PR body says.

③ Boundary flags

  • open_questions in the os-dev-report (7079007194) is empty. Nothing to answer.
  • out_of_scope_findings: no review request was sent, because the relay has no such op. That is the seat's carrier matter, not a contract point.
  • security_findings: withheld in the report. No detail is on the card, so it cannot be judged here. The seat should confirm with the dev whether a finding exists. This review found no security-sensitive mechanism in the diff.
  • Rulings cited but not on the card. The PR body and report cite "the seat's rulings" for three things: defaultValue is no exception, requiredWhen is accepted, and the lint notice, Studio switch and skills text move to PR 2. No card comment records them. They were judged here from the tree alone. The move of the lint notice and the Studio switch to PR 2 is sound on its own terms: the notice would say a form is no longer loaded while it still is, and a switch offered before a reader exists is what ADR-0078 rules out. The defaultValue arm is S1 below. The seat should record these rulings on the card.
  • ADR-0085 §2. The jsdoc cites the admission test. §2 is written for ObjectSchema presentation keys, and the ADR carries no note for this key at this head. The reading itself holds: which fields a business asks for at creation is not inferable, and the name names a lifecycle moment, not a page. The maintainer approved the switch on the card. The ADR note is owed on ADR revisions, week of 2026-11-21: rolling checklist of ADR text out of step with main (one governed PR) #36086.
  • SQL push-down. The diff adds no query, no id materialisation and no join. Nothing to flag.
  • Dogfood battery. n/a is right: no narrowing arm and no rendered surface.

④ Design judgment

packages/spec/src/data/field.zod.ts

  • The key, its type and its absence semantics hold against the card (item 5: a switch, default on) and against the first consumer PR 2 names. Absent reads as on, so no stored field changes meaning.
  • The refusal sits in the field's own superRefine, so every door that parses a field reaches it. The object door locates it at fields.NAME.showOnCreate, and the test pins that path.
  • requiredWhen is accepted. That holds: the parse cannot judge a predicate, and the describe says the create is still refused when the predicate holds and the value is empty.
  • The refusal is stricter than its siblings. hidden: true or readonly: true beside required: true carry the same hazard and parse today. That is a deliberate choice for a new key, not a defect.

S1 (should-fix) — The stated reason for refusing the pair when a defaultValue is declared does not hold against the write door. The comment at field.zod.ts:3225 says that together "no record of the object could be created from the platform's create surfaces", and the message says a default is "not a guarantee that the create carries one". But insert() resolves defaultValues before it validates, "so a required field carrying a default is never missing by the time validateRecord runs" (packages/objectql/src/engine-validate.ts:139, measured there on tier: { required: true, defaultValue: 'standard' }; record-validator.ts:2390 says the same). A create surface that leaves the field out sends no key, so a static default always fills it and the create passes. The card's own reason for item 6 ("否则新建永远过不了") is therefore untrue for a defaulted field. This is also the most common hide-on-create case (a required status with a default), and the message steers its author to drop required, which weakens the write contract. Two honest fixes, either one closes this: (a) admit the pair when the field declares a defaultValue, which is still a pure widening, with a control case in the test; or (b) keep the refusal as the conservative choice, record the ruling on the card, and rewrite the comment, the message, the describe clause and the changeset sentence so they state the real reason (for example: a default can evaluate empty, and the platform refuses the pair until that is ruled). Refusing now and widening later is semver-safe, so (b) does not block the release. What cannot stand is a published refusal message whose reason the engine contradicts.

  • Nit: the describe is in the present tense ("false: no create surface shows it") while no reader exists. The changeset says so plainly and the ledger says planned, which matches the house pattern (conditionalFormatting, referenceDeletedWhen). No change asked.
  • Nit: required: true with the field's own visibleWhen is "required when shown", so that triple can also create successfully. It falls under the same choice as S1.

packages/spec/liveness/field.json (implementing)

  • The row agrees with the tree: planned, evidence is the parse refusal, the note names the readers and the flip. It carries no authorWarn, like the other planned field rows. See the standalone point below.

packages/spec/src/system/metadata-form-zod-reconciliation.test.ts (implementing)

  • The omit row agrees with the ledger grade and names its own deletion in PR 2. Holds.

packages/spec/src/data/field-show-on-create.test.ts (implementing)

  • The three refusal cases assert the located issue: count one, path ending showOnCreate, code custom, the message's first sentence, and the object-door path. The reported ablation (condition set to false, 3 of 3 red, controls green) fits what these cases read. They do pin the new refusal.
  • The acceptance side is pinned by full safeParse success on four controls and by the parsed value for true and false. That pins the widening itself.
  • Nit: the second case is titled "naming both remedies" but matches only the first sentence. If S1 takes route (a), the defaultValue case flips to a control. If it takes route (b), that case should pin the corrected sentence.

Does PR 1 stand alone if PR 2 never lands?

  • Yes, with one caveat. Nothing existing breaks, nothing is reshaped, and the revert is one commit. The key would then be parsed and unread: an author who writes showOnCreate: false gets no warning, and the reference page states a behaviour nothing implements. The ledger row is honest about it, and the form does not offer it. If PR 2 slips past the next release cut, the row should take authorWarn: true or the describe a not-yet-enforced marker. That is a follow-up condition, not a finding on this head.

Implemented-by: claude/project-thread-8l1u7g
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

…w-up names its card

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b86db2be460ae3c2d4393353c71117324c549f6d
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts + packages/spec/liveness/field.json, packages/spec/src/system/metadata-form-zod-reconciliation.test.ts, packages/spec/src/data/field-show-on-create.test.ts, packages/drivers/driver-sql/src/builtin-column-collision.ts, packages/metadata-core/src/object-schema-fls-references.ts, packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts

Delta review of PR #36449 (card #36425, PR 1 of 2). The previous record is PASS 7079100809 at 197434e9. Read this round: the card body and its six comments (the seat's rulings 7079131071 included), the PR body and its two comments, the range 197434e9..b86db2be in full, the thirteen-file net file list, and the check-runs on this head. Code outside the diff was read on main at ff60149900, which is still the merge base.

The range. Four commits, each with one parent: 2eaa2bc9, 1c0012aa, e89912af, b86db2be. There is no merge of main in it, so every hunk is the PR's own. Nine files move: field.zod.ts, its test, the changeset, three regenerated reference pages, and the three pin files. liveness/field.json, metadata-form-zod-reconciliation.test.ts, authorable-surface/data.json and liveness/state-counts/field.md did not change, and their earlier judgments are carried forward unchanged.

① Derived judgments

  • Accept set: no move in this range. The superRefine condition is byte-identical (field.showOnCreate === false && field.required === true), as are the issue's code and path and the key's type (z.boolean().optional(), no default). Only the comment, the message string, the describe string and the jsdoc changed. Every accept-set judgment of the previous record stands: a pure widening, the refused pair inside the new space, nothing reshaped, no bypass through fieldPatches.
  • Public surface. The describe text of showOnCreate changed, and the three reference pages were regenerated to match (one row in field.mdx, two each in object.mdx and migration.mdx). No key, type or export moved. Right.
  • Pin 1, metadata-protocol field count 84 to 85. Right. main pins field: 84, this PR adds exactly one top-level FieldSchema key, and the pin carries its [#36425] reason line like its neighbours. The body's note that a second PR adding a field key (feat(audit): the activity stream shows each changed field's old → new values by default, served only for fields the reader may read #36399) will raise it again is correct and is that PR's to do.
  • Pin 2, driver-sql FIELD_KEY_STORAGE_CLASS.showOnCreate = 'presentation'. Right. The file draws the line "at what the DDL reads": no column shape, index or default depends on whether a create surface asks for a field. Its family (hidden, readonly, visibleWhen, requiredWhen, and required itself under ADR-0113) is all presentation, and the row sits beside hidden. On a builtin column name the key would still be honoured by the create surfaces, so reporting it as discarded would be false. At runtime an unclassified key is already read as presentation, so the row changes no behaviour.
  • Pin 3, metadata-core FIELD_REFERENCE_POSITIONS.showOnCreate = keep. Right. The value is a boolean and names no field, the same reasoning the table gives for dueLike, mailAssociation and referenceNameVisible, and the same class as hidden and readonly on the line above. A denied field leaves the served fields map whole, so the facet of a served field discloses nothing about a denied one. Before the row, the key fell to unclassified, which removes a value only when a string or key in it mentions a denied field; a boolean never does. So the served schema is the same before and after, and the row only makes the choice deliberate.
  • Why these three were missed at 197434e9. Each is a "classify every FieldSchema key" pin in another package. They are not readers of the key, so the previous record's statement that no reader exists still holds, and the ledger grade planned still stands.
  • Check-runs on this head. All concluded, none failed. Green: Test Core and its ten shards, Test UI and its sixteen shards, Build Core, Build and E2E UI, Live E2E UI, Type Check UI, Type Check workspace, consumer gates, source gates and debt ledger, Check Changeset, Spec property liveness, every Lint run, PR-body guards, Governed Surface Queue Guard, Check PR Size, Check Documentation Links, Build Docs, Build UI Deps, Dogfood Regression Gate. The runs the previous record left as pending are now answered. Skipped runs are the opt-in and schedule ones.

② Semver level

  • The changeset is still @objectstack/spec minor. Right for an added key.
  • driver-sql and metadata-core gain source lines and no changeset entry of their own. That is acceptable: both sit in the fixed group with @objectstack/spec in .changeset/config.json, so they version with it, and neither line changes behaviour. Check Changeset is green.
  • Clause-②: yes (widening) and Metadata-protocol: added still describe the diff. Right.
  • Skills-docs: follow-up #36455 on the PR body and the changeset. skills: objectstack-ui still teaches internal create and edit forms, and not showOnCreate (after #36425) #36455 is open and carries domain:skills. This is better than the earlier follow-up owed. Right.
  • The changeset's refusal sentence now gives the card's reason and says a defaultValue makes no exception because the field is still asked for. It agrees with the message and the describe.

③ Boundary flags

  • Rulings now on the card. Comment 7079131071 records the seven seat rulings: the split, the name and absence semantics, the refusal with no defaultValue exception and its honest reason (item 3), requiredWhen accepted (item 4), action-opened named forms (item 5), the skills card (item 6), and the claim's lines (item 7). The previous record's "rulings cited but not on the card" flag is answered.
  • open_questions in the os-dev-report is still empty.
  • security_findings: withheld in the report still has no detail on the card. This round found nothing security-sensitive in the range; the FLS row is judged under ① and holds. The seat's confirmation with the dev is still owed.
  • ADR-0085 §2. Unchanged. The ADR note is owed on ADR revisions, week of 2026-11-21: rolling checklist of ADR text out of step with main (one governed PR) #36086 after the PRs merge, per ruling 2.
  • Card claim. Still reads Clause-②: yes (narrowing) and Metadata-protocol: semantic. Ruling 7 says the seat amends it when PR 2 opens. Not a point against this head.
  • SQL push-down. The range adds no query, no id materialisation and no join. The one driver file touched gains a row in a classification table. Nothing to flag.
  • Overlap. GitHub reports the PR mergeable and clean against main, which still pins field: 84.

④ Design judgment

packages/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 defaultValue, which is what engine-validate.ts measures. The engine no longer contradicts the published message.

  • The message still names both fixes and the requiredWhen alternative. It steers a defaulted field's author to keep the field on create, with its default filled in, which no longer weakens the write contract by implication.
  • The jsdoc, the describe and the message agree with one another and with the condition, sentence by sentence.
  • Nit: "a required field is always asked for on create" is written as a fact, but it is this key's rule, not the platform's present behaviour. A required: true field that is hidden or readonly is left off the create dialog today (the card's own measurement, 7 of 26 fields), and the schema accepts those pairs. The previous record already named the stricter-than-siblings choice as deliberate. No effect on what parses. Left as an accepted deviation, or tidied when PR 2 touches the describe.
  • Carried nit: the describe is in the present tense while no create surface reads the key. The changeset and the ledger say so. No change asked.
  • Carried nit: required: true with the field's own visibleWhen falls under the same ruling.

No must-fix, no should-fix.

packages/spec/src/data/field-show-on-create.test.ts (implementing)

  • The message assertion follows the reworded first sentence (would leave this field off every create surface), and the header comment gives the new reason. The five cases and what they pin are otherwise unchanged, so the earlier judgment stands: the refusal is pinned by count, path, code and the object-door path, and the widening by full safeParse success on four controls.
  • Carried nit: the second case is titled "naming both remedies" and matches only the first sentence, and the defaultValue case pins the issue count alone, not the sentence that says a default makes no exception. A test-only tightening, for PR 2 if at all.
  • Nit: one line of the header comment runs long after the edit. Lint is green.

packages/drivers/driver-sql/src/builtin-column-collision.ts (implementing)

  • The row agrees with the file's own contract, as judged under ①. Its comment states the reason. Holds.

packages/metadata-core/src/object-schema-fls-references.ts (implementing)

  • The row and its comment agree with the table's contract, as judged under ①. Holds.

packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts (implementing)

  • The count and its reason line agree with the schema. Holds.

packages/spec/liveness/field.json and packages/spec/src/system/metadata-form-zod-reconciliation.test.ts (implementing, unchanged in this range)

  • Carried forward: the planned row and the omit row both agree with the tree. The stand-alone caveat of the previous record also carries: if PR 2 slips past the next release cut, the ledger row should take authorWarn: true or the describe a not-yet-enforced marker. A follow-up condition, not a finding on this head.

Implemented-by: claude/project-thread-8l1u7g
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 REWORK · head b86db2be460ae3c2d4393353c71117324c549f6d · 2026-11-22T13:41Z

维护者速读

要改的(1 项)

  1. 两个已发布的包改了源码,changeset 里没有它们。 修 1c0012aa 上 CI 红的两个提交,改了三个包:

    • packages/drivers/driver-sql/src/builtin-column-collision.ts:FIELD_KEY_STORAGE_CLASS 加了 showOnCreate: 'presentation';
    • packages/metadata-core/src/object-schema-fls-references.ts:FIELD_REFERENCE_POSITIONS 加了 showOnCreate: keep;
    • packages/metadata-protocol 里的一个测试文件。

    @objectstack/driver-sql 和 @objectstack/metadata-core 都不是 private,files 发运的 dist 就是这两个 src 文件编译出来的,这两张表也都是导出的常量。所以发运的内容变了,要有条目。l1-face 也标了。清单的规定是:判据不是改动大小,也不是用户能不能感觉到,缺了就不入队。

    • 怎么改:在 .changeset/36425-field-show-on-create.md 的 frontmatter 里加 '@objectstack/driver-sql': patch 和 '@objectstack/metadata-core': patch,正文加一句:两个包登记了新的字段键(SQL 驱动把它归为展示键,建表时不读;字段级权限的清理按原样保留它)。也可以另开一个 changeset 文件。
    • @objectstack/metadata-protocol 不欠条目:它只改了测试文件,files 只发运 dist。l1-face 对它标的那面旗不成立。

增量核对(1c0012aa → b86db2be,2 个提交,3 个文件)

Skills-docs: 一行(L1 清单的必核项)

  • PR 正文和 changeset 都改成了 Skills-docs: follow-up #36455。skills: objectstack-ui still teaches internal create and edit forms, and not showOnCreate (after #36425) #36455 是 domain:skills 卡,状态 open,挂着 pm:blocked,标题写的就是「objectstack-ui 还在教内部新建和编辑表单、也没讲 showOnCreate」。它接的是我在 head 上核过的欠账:skills/objectstack-ui/SKILL.md:47,77 和 rules/list-views.md:342 起的「Form Views」一节。skills/** 只能在 domain:skills 的 PR 里改(pm-dispatch SKILL.md 第 320 行),所以单独一张卡是对的。

席位核对

  • 形态:draft、base main、Part of #36425。这是两个 PR 里的第 1 个,所以用 Part of 是对的,卡要保留 pm:dispatched;卡的验收都是界面上的读数,归第 2 个 PR。10 个文件,+150 −1。dogfood:没有 !,也没有 (narrowing),所以不欠。
  • 声明:Clause-②: yes (widening) 属实:FieldSchema 新增了一个可选键,没有 .default()(测试钉住了不写时解析结果里也没有这个键)。拒绝只针对新键的一种组合,今天能解析的东西没有一样会被拒,所以不是收窄。claim 上的 yes (narrowing) 和 semantic 描述的是整张卡,正文写明了收窄的那一半在第 2 个 PR,并由席位到时修改 claim。Metadata-protocol: added 属实,@objectstack/spec 是 minor。
  • 197434e9 之后两个提交:拒绝的理由改成卡第 6 项的原话——必填字段新建时一定要问,有 defaultValue 也一样,只是默认值已经填好;提示、describe、TSDoc、注释、测试的正则和 changeset 一起改了,参考页重新生成,逐句一致。
  • 规范:新键放在 hidden 旁边。superRefine 只在 showOnCreate === false && required === true 时报一条 custom issue,位置在 ['showOnCreate'],经对象入口时是 fields.NAME.showOnCreate。提示给了两种改法,并说明 defaultValue 不算例外。requiredWhen 放行,理由写在 describe 和注释里。TSDoc、describe、注释和 changeset 逐句一致。
  • 台账与生成物:liveness/field.json 新增一行,状态是 planned,注明在落地读取方的那次提交改成 live;state-counts 的计数从 5/113 改为 6/114;authorable-surface/data.json 新增一行;三个参考页由 check:generated --fix 生成。metadata-form-zod-reconciliation 加了一行 omit,理由是 planned;第 2 个 PR 删掉这一行,并提供开关。
  • 测试证据:新文件 5 条:开、关、不写;必填加关会被拒;再加上 defaultValue 仍被拒;4 个对照都完整解析成功;对象入口的报错位置。消融(在 197434e9 上做,拒绝的条件之后没变)把条件换成 false,3 条拒绝用例挂,对照全绿,还原后 blob 等于 HEAD。
  • 重叠:正文写了,和 feat(audit): the activity stream shows each changed field's old → new values by default, served only for fields the reader may read #36399、feat: line-item table cells for people, multi-select, tags, check and rating (#36043) #36392 只在生成的 state-counts/field.md 上冲突,后落地的那个重新生成即可。
  • CI @ b86db2be:62 success、12 skipped、0 failed。1c0012aa 上 Test Core 有 4 个红,原因是三处字段键清单没有登记新键;e89912af 和 b86db2be 两个提交补上了,见上面第 1 项。
  • 落地条款:非受管。第 1 项改完、CI 全绿后,我做增量 L1,只核 changeset;再加上契约档增量 L2 PASS,之后由区 ready + auto-merge。Part of ⇒ 卡保留 pm:dispatched。

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT(增量)· head d8b82f70d50a48747586e5281279e091ce9c9331 · 2026-11-22T14:22Z

维护者速读

增量核对(b86db2be → d8b82f70,1 个提交,只改 changeset)

  • 上一轮那一项已改。 .changeset/36425-field-show-on-create.md 的 frontmatter 加了 '@objectstack/driver-sql': patch 和 '@objectstack/metadata-core': patch。正文新加了一条,我逐句核过:
    • 「FIELD_KEY_STORAGE_CLASS 把 showOnCreate 标为 presentation,建表时不读它」,和 builtin-column-collision.ts 一致;
    • 「FIELD_REFERENCE_POSITIONS 保留它,因为它是布尔值,不指向任何字段」,和 object-schema-fls-references.ts 的 keep 一致;
    • 「两个包对任何字段的处理都没有变」也成立:unclassified 本来就保留布尔值,新加的这一行只是让穷举检查认识这个键。
  • @objectstack/metadata-protocol 只改了测试文件,不欠条目,上一轮已经说明。
  • 和 feat(audit): the activity stream shows each changed field's old → new values by default, served only for fields the reader may read #36399 冲突,是已知的字段数钉子:两个 PR 都把 field 的属性数从 84 改为 85。后落地的那个要合入 main,改成 86,再重跑 CI。
  • 其余各项沿用上一轮在 b86db2be 上的核对,这一轮没有动代码。Part of #36425 不变,卡保留 pm:dispatched。
  • CI @ d8b82f70:61 success、12 skipped、0 failed;唯一一个 cancelled 是 PR-body guards 的旧一次运行,同名的新运行在 13:52Z 是 success;mergeable clean。
  • 落地:非受管。等席位契约档增量 L2 PASS 后,由区 ready + auto-merge。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Landing (seat 7, 2026-11-22T14:26Z): head d8b82f70d50a48747586e5281279e091ce9c9331 · L1 delta ACCEPT 7080502758 (L1-d, after REWORK 7079997817) · L2 PASS 7079996213 (CONTRACT_REVIEW_TIER, at b86db2be; the one commit since adds two changeset entries and one bullet, no source, so the record carries) · check-governed-merges --pr 36449: NOT governed, 162 changed lines · CI on the head: 61 success, 12 skipped, 1 cancelled superseded PR-body guard run, none failed. → pr_ready + automerge_enable (merge queue).
Landing order: #36399 also moves the metadata-protocol field count 84 to 85; it lands second and takes 86. PR 2 of #36425 is not started (maintainer ruling 2026-11-22: finish the stage in progress only).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 14:26
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 28588d0 Nov 22, 2026
74 of 75 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-8l1u7g branch November 22, 2026 15:04
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
… 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>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:data protocol:system size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants