Skip to content

feat(audit): the activity stream shows each changed field's old → new values by default, served only for fields the reader may read - #36399

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

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

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Part of #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 #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 #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 #36419. skills: objectstack-data still teaches field history as opt-in after the default flips #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 [#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, [#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 #36449 (#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. feat(spec): a field can say it is not asked for when a record is created (showOnCreate) #36449 has landed and is merged in. feat: line-item table cells for people, multi-select, tags, check and rating (#36043) #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.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw

…rackHistory keeps its meaning (#36290)

Claude-Session: https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw
Co-authored-by: Claude <noreply@anthropic.com>
…ins, the checklist item and the docs (#36290)

Claude-Session: https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:data 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 10 package(s): @objectstack/cloud-connection, @objectstack/driver-sql, @objectstack/metadata-core, @objectstack/platform-objects, @objectstack/plugin-audit, @objectstack/plugin-sharing, @objectstack/service-automation, @objectstack/service-messaging, @objectstack/service-realtime, @objectstack/spec, touching 40 documentable anchor(s). ⚠️ 5 changed file(s) yielded no anchor (packages/spec/authorable-surface/data.json, packages/spec/liveness/field.json, packages/spec/liveness/object.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

24 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 9abc732132a2f723627d585b049e2cc10869db19.

⛔ 6 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 5 changed file(s) yielded no anchor (packages/spec/authorable-surface/data.json, packages/spec/liveness/field.json, packages/spec/liveness/object.json, …) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • 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 — 184 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 9abc732132a2f723627d585b049e2cc10869db19 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 4ce76a40f9e97507ab508c6067eceaa34a5ccb7b — the merge of head aa362ba1a79d95585d2c189fc4197ba6293133c6 into base 9abc732132a2f723627d585b049e2cc10869db19, 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 4ce76a40f9e97507ab508c6067eceaa34a5ccb7b && git checkout 4ce76a40f9e97507ab508c6067eceaa34a5ccb7b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9abc732132a2f723627d585b049e2cc10869db19 aa362ba1a79d95585d2c189fc4197ba6293133c6 && git checkout -B drift-repro 9abc732132a2f723627d585b049e2cc10869db19 && git merge --no-ff aa362ba1a79d95585d2c189fc4197ba6293133c6

node scripts/docs-audit/affected-docs.mjs --json 9abc732132a2f723627d585b049e2cc10869db19

⚠️ 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 9abc732132a2f723627d585b049e2cc10869db19 → 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_01QsR2jS7jCv5PH4ytECQWqf

L1 REWORK · head 851997e677adc14a324b8634a1325e683d58b11a · 2026-11-22T10:57Z

维护者速读

  • 用户能看到什么变化:记录「动态」里的每条修改,现在默认在服务端记下并提供「字段:旧值 → 新值」,所有对象都一样。对象写 enable: { fieldHistory: false } 可以整体关掉,字段写 trackHistory: false 可以单独关掉。密码、密钥类字段永远不记值;图片、文件、JSON 这类字段只有显式写 trackHistory: true 才记。成员只拿得到自己有权读取的字段的修改,sys_audit_log 不对成员开放。这是三个 PR 里的第 1 个(规格和服务端);逐字段显示和「修改历史」卡片在后两个 PR。
  • 为什么做:卡 字段修改历史:动态里的修改显示「旧值 → 新值」;字段和格子上可以看这一个字段的历次修改(数据后端已有) #36290「字段修改历史」,按席位批准的方案 B(新开关 enable.fieldHistory,不设默认值)执行。
  • 出错会怎样:最坏情况是成员看到不该看到的字段旧值或新值(读取时已逐条收窄,有测试钉住);或者动态写入失败(摘要已按 500 字符截断)。可以整体撤回,已写入的动态不受影响。
  • 升级注意:单写 enable.trackHistory: false 不再能关掉值的显示,要关请改写 enable.fieldHistory: false;仓库里 44 个平台对象已经补上,HotCRM 没有对象需要改。
  • 要你做什么:无。
  • 席位意见:REWORK,只有一项:Skills-docs: 那一行欠的卡还没立。实现和测试我读下来是对的,见下面。

要改的(1 项)

  1. Skills-docs: follow-up owed 要先立卡,再把这一行改成 Skills-docs: carried by #N。 L1 清单的规定是:写 follow-up owed 的,要在 ACCEPT 之前立卡并改成卡号,缺了就判 REWORK;l1-face 也标了这一项。我在 head 上核过,欠的内容属实:skills/objectstack-data/SKILL.md:112 写的是 trackHistory 默认 false、「Field-level audit trail」,本 PR 之后字段不写就是开着;:104 的 enable 一行也没有 fieldHistory。我在仓库里按 fieldHistory skills 搜了今天新开的卡,没有找到。立卡由席位来做;卡号回来后,请 dev 把 PR 正文这一行改掉(changeset 里没有这一行,不用加)。只改文字,我做增量审核时只核这一行。

席位核对(本轮已读,增量时不重读)

  • 形态:l1-face --pr 36399 只标了 skills-docs 一项,也就是上面那一项。draft、base main、Part of #36290:这是 3 个 PR 里的第 1 个,所以用 Part of 是对的,卡要保留 pm:dispatched;卡上验收要求的截图归第 2、3 个 PR。88 个文件 +650 −107;check-governed-merges 判定 NOT governed。dogfood:没有 !,也没有 (narrowing),所以不欠;正文照样在 head 上全量跑了一轮,4175 条里 4107 过、0 失败。
  • 声明:Clause-②: yes (widening) 属实:新增可选键 ObjectCapabilities.fieldHistory,没有 .default(),object.test.ts 钉住了解析后不会写出这个键。Metadata-protocol: semantic 属实:是默认值变了,而且带了升级说明。按 ruling A,semantic 不算破坏性变更,所以不欠 ADR-0087 条目(check-adr-0087-registration 已过)。changeset 里 spec 和 plugin-audit 是 minor,其余 7 个包只是对象文件加了一个键,用 patch。
  • 写入侧(audit-writers.ts):changeValuesShownFor 的判断顺序是:对象写了 fieldHistory: false 就全关;字段写了 trackHistory: false,或者字段属于 collectMaskedReadFields 收出来的凭据字段,就关;字段写了 trackHistory: true 就开;剩下的按类型判断,14 种媒体或结构化类型默认关,其余默认开。对象上的 enable.trackHistory 不参与这个判断,和 changeset 的说法一致。查关联记录标题的计划和渲染摘要读的是同一个判断。存储的摘要用 fitStoredChangeSummary 截到 activitySummaryMaxLength():先把每一侧截到 60 字,再从后面去掉若干条改动,补上 ; …;编码里的每一侧最多 1000 字。
  • 读取侧(安全上最要紧的一段):redactActivityRows 对 fieldChanges 编码逐条判断:字段不在这个读者能读的集合里就去掉;关联字段要读者能拿到被引用记录的标题才保留。读不懂的 fieldChanges 编码直接删掉(读不懂就不给)。全部去掉时连编码一起删;摘要整条不可给但编码还剩几条时,用剩下的几条重新拼一句,不整条丢。其他编码仍然对非系统读者剥掉,text_sources 照旧剥掉。中间件的注册顺序换了:语言中间件在外,脱敏在内,所以按读者语言重拼摘要时用的是已经收窄的编码,不会用存储的完整编码。我按这个顺序把几种情况都推了一遍:被删掉的摘要不会被重新拼出来;非 fieldChanges 编码先按来源判断,再照原样剥掉。没有找到会漏出去的路径。
  • 文本逐句核:changeset 的五条加最后一句都与 diff 一致。手写文档 security.mdx §7、objects.mdx 的开关表、fields.mdx 和 validation-rules.mdx 的 trackHistory 一行、两处 describe,都与 changeValuesShownFor 一致。生成的 references/* 与 describe 逐字相同。11 个语言的表单翻译包只加了 fieldHistory 的标签,并改了两句已经不对的 trackHistory 帮助文字。
  • nit:三张文档表格里 trackHistory 那一行写的是「on unless the field or object turns them off」,没提媒体和 JSON 类字段默认关(security.mdx 和 describe 里提了),以后顺手补上即可,不改判。
  • 测试证据:写入侧新增 8 条:不写就开;对象写 false 只记标签;只写 enable.trackHistory: false 照样开;字段写 false 只记标签;凭据字段只记标签;json 要写 true 才开;长文本能写进 500 以内,编码每侧截到 1000 并带 …;30 条改动能装下并带 ; …。读取侧新增 6 条:系统读者拿到完整编码;被遮蔽的读者的编码里没有那个字段;读不到某字段的读者,编码和重拼的摘要里都没有它;对照读者拿到全部;非 fieldChanges 编码仍不给;关联字段按标题规则。消融:去掉逐条收窄的两个过滤,9/40 挂;去掉 fieldHistory === false 那一支,8/139 挂。我没有在本地重跑,读的是报告和 CI。
  • 「随默认值一起动的文件」逐条有理由:两个 dogfood 用例里,website 没有写 trackHistory,现在会记值;REF_TITLED 加了 fieldHistory: false,好让那组「标题给不给」的用例仍然在测东西,不是空过。清单条目 rev 16、两处计数钉也写清了为什么动。
  • CI @ 851997e6:62 success · 12 expected skip · 0 failed · 0 pending;mergeable_state clean。
  • 落地条款:非受管;这一项改完后做增量 L1,加上席位的 schema 面 L2;之后由区 ready + auto-merge;Part of ⇒ 卡保留 pm:dispatched。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 851997e677adc14a324b8634a1325e683d58b11a
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts, packages/spec/src/data/field.form.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/data/object.form.ts + packages/plugins/plugin-audit/src/audit-writers.ts, packages/plugins/plugin-audit/src/activity-field-redaction.ts, packages/plugins/plugin-audit/src/activity-summary-message.ts, packages/plugins/plugin-audit/src/audit-plugin.ts
Security-touching: yes
Rule-change-verified: none

Inputs read: card #36290 with its four comments (triage, ruling 7076513167, claim 7076544277, dev report 7078070848), the PR #36399 body and its 87 files, the net diff from merge base c448c6151d to the head, and the check-runs on the head. Every check-run on the head is success or skipped, both Check Changeset runs included. Code outside the diff was read, not reviewed.

① Derived judgments

  • New key ObjectCapabilities.fieldHistory, z.boolean().optional(), no default. This widens the accept set. Right. The no-default reason holds in the tree: trackHistory beside it is .default(false), so a parsed enable block cannot tell an authored false from silence, and a new key without a default can.
  • Field trackHistory keeps its schema (z.boolean().optional()). Its meaning changes: absent now shows values, where before only true did. Nothing is refused. This is a changed default, so semantic. Right.
  • enable.trackHistory keeps its schema, its default and its readers (api-derivation.ts, the record page ledger gate). Only its describe moved. Right. The writer never read the object flag before either, so no object that wrote trackHistory: false loses a behaviour it had.
  • Narrowing check, value by value. Field trackHistory: false reads as before (label only). Field trackHistory: true reads as before, with two exceptions. On a credential field it now gives the label only, where before it gave mask to mask: no information is lost. Under an object that writes the new fieldHistory: false it is off: no earlier author could have written that key. No value an author could write before is refused. I find no narrowing. Clause-②: yes (widening) is right.
  • Wire surface. metadata.summary_message with key fieldChanges is now served to non-system readers, narrowed change by change. Every other code is still stripped. A reader not served the stored summary now gets a summary rebuilt from the kept changes, where before the column was dropped. Both widen. Right, and ruling point 2 asks for it.
  • Wire surface, changed meaning. On an update with no opted-in field the stored summary used to name the record ("Updated Customer X: Notes"). It now reads "Notes: old value, new value" and names no record. record_label still carries the label. This follows from the ruling and is covered by semantic.
  • Stored code values are capped at 1,000 characters a side, and the stored summary is fitted to 500. Before, an over-long tracked summary failed the insert on a SQL driver. metadata.old and metadata.new keep the whole value. Not a narrowing of anything an author writes.
  • The values in the summary and the code come from the same masked ledger views that already fill metadata.old and metadata.new. So default-on adds no new class of value to the row. The only added content is referenced-record titles, and those pass the existing per-reader title rule.

② Semver level

  • Metadata-protocol: semantic is right. The diff holds one added (the new key) and one semantic (the changed default). The rule ranks semantic over added, and nothing is narrowed.
  • Levels match. @objectstack/spec minor and @objectstack/plugin-audit minor carry the kind. The seven packages that only add fieldHistory: false to their own objects take patch. Check Changeset is green on the head.
  • Clause-②: yes (widening) is on the PR body and in the changeset body, and it is right (see ①).
  • Migration entry under the gate: none is owed. No key is removed, renamed or refused, and the registration gate treats a changed default as not breaking. The changeset states the upgrade step in words. A stored-row conversion is a separate question, and M1 raises it.

③ Boundary flags

  • open_questions: empty. Nothing to answer.
  • Dev flag, UI producers left to PR 2 (FieldDesigner.tsx, ObjectFieldInspector.tsx, a fieldHistory toggle in ObjectSettingsPanel). Not answered by a later PR alone. See M1.
  • Dev flag, skills/objectstack-data/SKILL.md still teaches trackHistory as the switch. Declared on the PR body as Skills-docs: follow-up owed. Accepted as a follow-up for the seat.
  • The ruling reverses ADR-0052 §5b.1. The ADR text is not amended in this diff. The ruling names card ADR revisions, week of 2026-11-21: rolling checklist of ADR text out of step with main (one governed PR) #36086 as the carrier. Accepted on that carrier.
  • The PR body says "PR 1 of 3". The claim says only "split into PRs". No effect on this head.
  • SQL push-down: no new in-app join and no new id materialisation. The referenced-title read is the existing one, batched per target object. It now runs for every changed reference field, where before it ran only for opted-in fields. The cost per write is one read per target object. No finding.
  • Security floor (ruling point 3): held in the code read. A change of a field the reader is not served is dropped from the code before the summary is rebuilt. A reference change is kept only under the title rule. A redaction failure strips metadata whole, so the code goes with it. Filters on the stored text stay refused for a withheld reader by the existing query guard. No security finding.

④ Design judgment

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

M1 (must-fix) — The new contract reads a stored field trackHistory: false as the author's choice to turn values off. The repository's own field designer writes that value for every field it saves. ui/packages/plugin-designer/src/FieldDesigner.tsx sets trackHistory: data.trackHistory === true on create and on edit, and MetadataFieldsPage.tsx (fromDesignerField) persists it as written. Until this head, false and absent meant the same thing to every reader, so that false was noise. From this head it is an opt-out. Three consequences follow. First, fields already saved through the designer stay label-only after the upgrade. That is the card's own scene, a self-built app, and ruling point 1 says values show by default on every object. Second, the PR body's line that stored objects take effect on upgrade with no rebuild is not true for those fields. Third, PR 2 as described only stops the producer from writing false. It does not touch stored definitions, and between this merge and PR 2 every designer save opts a field out without the author asking. Once a release ships this meaning, a stored false from the designer can no longer be told from a chosen one. The PR gives exactly this argument for enable.fieldHistory having no default, and then does not apply it to the field key. So this head does not stand on its own. One of these closes it: (a) an ADR-0087 stored-row conversion that drops a field's trackHistory: false written before this release, shipped in the same release as the flip, with the producer fix in the same PR or landed first; or (b) a maintainer ruling that designer-saved false stays off, quoted on the PR. Limit of this finding: I read the producer and the page code. I did not run the designer.

packages/spec/src/data/object.form.ts and packages/spec/src/data/field.form.ts

S1 (should-fix) — The object form adds { field: 'fieldHistory', type: 'boolean' } with no help text. Its label is "Field History" and it sits next to "Track History". For this key, absent means on, and false is the only value an author has a reason to write. A bare checkbox shows absent as unchecked, which reads as off. The field form has the same shape for trackHistory: its help text now says "on unless turned off", but a two-state control cannot show absent apart from false. Give the object row a help text that says what unchecked and untouched each mean, and make sure the form does not write false for a box the author never touched. If the renderer cannot hold a third state, say so on the PR and name the PR that carries it. I did not read the form renderer, so the write behaviour is unverified.

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

  • The fieldHistory schema line, its jsdoc and the trackHistory describe agree with the writer, sentence by sentence. changeValuesShownFor returns off for enable.fieldHistory === false, does not read enable.trackHistory, and treats absent as on. The spec test pins that a parsed enable block carries no fieldHistory key. Holds.
  • Nit: the field describe does not say that an explicit field true is still off under an object fieldHistory: false. The object describe covers it ("off for this object").

Implementing files

  • audit-writers.ts: agrees with both describes. Credential fields come from collectMaskedReadFields, the engine's own predicate, not a second list. The fourteen no-line types are all members of FieldType. The fit to 500 cuts each side to 60 first, then drops trailing changes, then cuts the sentence, and the code keeps every change. Holds.
  • Nit: tree is not in the reference set, so its change shows a stored id. Multi-value option types show stored values joined by commas, not labels. The card's acceptance names select, lookup and user only, and those three resolve.
  • activity-field-redaction.ts: the code is narrowed by the same served set as old and new. A code with key fieldChanges that this version cannot read is deleted, which fails closed. The rebuilt summary uses the kept changes only. When the security service gives no answer, the row is left as it is, code included. That is the existing rule for old, new and the summary, and the code holds nothing those do not. Holds.
  • activity-summary-message.ts and audit-plugin.ts: the order flip is sound. The redaction now runs first on the result. The summary middleware composes only when the summary key is still on the row, so a summary the redaction dropped is not rebuilt from a code. It still strips every code other than fieldChanges for a non-system reader. The two projection helpers do not remove each other's added columns. Holds.

Summary: the server half is correct and the declarations are right. The head fails on M1, a stored value whose meaning this PR changes while an in-repo producer still writes it.

Implemented-by: claude/project-thread-xu21qu
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: FAIL

…ry key; trackHistory: false reads like absent (#36290)

The field designer wrote trackHistory: false on every save while the key
meant nothing, so a stored false cannot be told from a choice.

Claude-Session: https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw
Co-authored-by: Claude <noreply@anthropic.com>
…he two key closures (#36290)

Both are boolean presentation facets that name no field: driver-sql's
storage/presentation map and ADR-0106 D1's FLS reference positions.

Claude-Session: https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw
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: c43a42bbc652e70b888b6b768d870f726825e728
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts, packages/spec/src/data/field.form.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/data/object.form.ts + packages/plugins/plugin-audit/src/audit-writers.ts, packages/plugins/plugin-audit/src/activity-field-redaction.ts, packages/plugins/plugin-audit/src/activity-summary-message.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/drivers/driver-sql/src/builtin-column-collision.ts, packages/metadata-core/src/object-schema-fls-references.ts
Security-touching: yes
Rule-change-verified: none

Delta review of 851997e6..c43a42bb on top of record 7078144432 (FAIL at 851997e6). The range is three commits in a line (6e416547, 17772933, c43a42bb), 39 files. None is a merge of main, so every hunk in the range is the PR's own. Inputs read: card #36290 with its five comments (round-2 dev report 7079935296 included), the PR body, the range diff, and the check-runs on the head: 60 success, 10 skipped, none failed, both Check Changeset runs green. Files the range does not touch keep their round-1 judgments: activity-field-redaction.ts, activity-summary-message.ts and audit-plugin.ts hold as written there.

① Derived judgments

  • New key FieldSchema.fieldHistory, z.boolean().optional(), no default. This widens the accept set. Right. The no-default reason is the same one that holds for enable.fieldHistory: a parsed field never carries the key, so only an author who wrote it turns values off.
  • Field trackHistory keeps its schema. Its meaning moves again inside this PR, and against main the net is: true shows values as before; absent and false both show values, where on main both gave the label only. false and absent read the same on main and read the same here. Nothing is refused. A changed default, so semantic. Right.
  • Narrowing check against main, value by value. Field trackHistory: true: as on main, except on a credential field (label only, where main gave mask to mask, no information lost) and under the new object or field fieldHistory: false, which no earlier author could have written. Field trackHistory: false and absent: wider. fieldHistory: new. No value an author could write on main is refused or loses a capability. Clause-②: yes (widening) is right.
  • Precedence in the writer, read at the head: object enable.fieldHistory: false first, then field fieldHistory: false, then credential, then fieldHistory: true or trackHistory: true, then the type rule. A field that writes both trackHistory: true and fieldHistory: false is off. That agrees with both describes.
  • Public surface moved by the new key: authorable surface (data/Field:fieldHistory), liveness (field 113 to 114 classified, 107 to 108 live), the metadata-protocol field card (84 to 85 properties), the field form and the object form's fields repeater (one row each). Each is the mechanical result of one added key. Right.
  • The round-1 judgments on ObjectCapabilities.fieldHistory, enable.trackHistory, the served fieldChanges code, the rebuilt summary and the 500 and 1,000 character caps are carried forward. The range does not touch them, other than the object describe now naming the field's key correctly.

② Semver level

  • Metadata-protocol: semantic is still right: two added keys and one semantic change, and semantic ranks over added.
  • @objectstack/spec minor and @objectstack/plugin-audit minor carry it. The range adds source to @objectstack/driver-sql (one map row) and @objectstack/metadata-core (one map row). metadata-core is in the changeset at patch. driver-sql is not named, and does not need to be: it sits in the same fixed group as @objectstack/spec in .changeset/config.json, so it is released with it. Check Changeset is green on the head.
  • The changeset body states the new field key, says that field trackHistory: false no longer means anything, and its closing upgrade line names fieldHistory: false for a field. It agrees with the tree.
  • Clause-②: yes (widening) is on the PR body and the changeset, and it is right (see ①).
  • Migration entry: none is owed. No key is removed, renamed or refused.

③ Boundary flags

  • open_questions: empty in both dev reports.
  • M1: closed. The dev took neither route the finding named (a stored-row conversion, or a ruling) and removed the premise instead: the field's off switch is a new key, and a stored field trackHistory: false reads like absent. So a field saved through the designer shows values after the upgrade, which is ruling point 1, and no stored value has to be told apart from a choice. Read in the tree: changeValuesShownFor no longer tests trackHistory === false; the designer_saved pin holds it; FieldDesigner.tsx still writes trackHistory: data.trackHistory === true, which is now harmless; MetadataFieldsPage.tsx (fromDesignerField) spreads carryOver(prev), so a designer save keeps a stored fieldHistory; ObjectFieldInspector.tsx patches the definition and never writes false. The PR body's upgrade line is now true for designer-saved fields. The dev's reason for rejecting the conversion (the stored chain is replayed on every read with no version window) was not needed for the closure and was not checked beyond the option type in conversions/stored.ts.
  • S1: closed. Every fieldHistory row (object enable, object fields repeater, field form) now has help text saying that unset means on although the switch shows off, and that only a switch turned on and then off writes false. The write behaviour is verified in the renderer on main: SchemaForm.tsx draws a boolean as a Switch with checked={!!value} and calls onChange only on a toggle, and I found no code that seeds a boolean on a new row. Limit: I read the boolean branch and searched for row seeding; I did not read the whole form.
  • Escalated to the seat, from S1: the form still cannot show unset apart from false. An author looking at an off switch cannot tell whether values are on or off, and cannot go back from false to unset through the form (turning the switch on writes true, which behaves like unset for every type but a media or JSON one). The PR says no PR on this card carries a third state. That needs a carrier: a follow-up card for the renderer, or a line on PR 2. It is not a finding on this head, because the contract and the stored values are right.
  • Dev flag, UI producers move to fieldHistory in PR 2 (FieldDesigner.tsx, ObjectFieldInspector.tsx, an enable.fieldHistory toggle in ObjectSettingsPanel). Accepted on that carrier. After this head PR 2 is a convenience, not a correctness dependency.
  • Dev flag, Skills-docs: carried by #36419, whose step 1 still names field trackHistory: false as the off switch. Confirmed against the tree: at this head it is field fieldHistory: false. The seat owns that card's text and must correct it before skills: objectstack-data still teaches field history as opt-in after the default flips #36419 is built. skills/objectstack-data/SKILL.md line 112 still reads "Field-level audit trail" for enable.trackHistory.
  • For the same carrier, outside the diff: packages/spec/src/data/authoring-key-lint.ts lines 130 and 131 tell an author to "use trackHistory for the activity timeline". Still true for the object key, no longer the whole answer for a field.
  • ADR-0052 §5b.1 is still not amended in this diff. Carrier ADR revisions, week of 2026-11-21: rolling checklist of ADR text out of step with main (one governed PR) #36086, as in round 1. The row there should now name both keys.
  • SQL push-down: the range adds no read, no join and no id materialisation. The predicate change is in-memory over the object definition. No finding.
  • Security floor (ruling point 3): the range does not touch the read side. The writer change can only move a field between "values in the summary and code" and "label only"; who is served a value is still the per-reader redaction judged in round 1. A credential field stays label only even with fieldHistory: true, because the credential test runs before the opt-in. No security finding.

④ Design judgment

No must-fix, no should-fix.

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

  • The fieldHistory line, its jsdoc and its describe agree with changeValuesShownFor, sentence by sentence: absent shows (a no-line type only with true), false is label only, true shows a no-line type too, the object's false wins, a credential never shows. Each arm has a pin in audit-writers.test.ts (quiet, payload_on, insisted under an object false, api_token).
  • The rewritten trackHistory describe and jsdoc agree with the writer: true matters only for a no-line type, false and absent read the same, and the off switch is named. The round-1 nit (the field describe did not say the object's false wins) is fixed, on the fieldHistory describe where it now belongs.
  • Tried to break it: trackHistory: true with fieldHistory: false is off, and fieldHistory: true on a secret is off. Both follow the describes.
  • Nit: the authoring hint for the mistyped key tracked (line 1684, not changed by this PR) still says per-field timeline tracking is trackHistory: true. After this head that advice changes nothing for most fields. Wording only; the same carrier as the skills text.

packages/spec/src/data/field.form.ts and packages/spec/src/data/object.form.ts

  • The three new help texts say what the renderer does (see S1 in ③). The trackHistory rows now say that off does not hide values and point at Field History. Holds.
  • Nit: the field-level help text says "Unset means ON" for every field. For the fourteen media and JSON types, and for a credential field, unset is off. The last sentence ("On also shows a media or JSON field's values") implies it but does not say it. The describe in field.zod.ts is exact; the help text is a little too broad.

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

  • Describe and jsdoc of enable.fieldHistory now name the field's own fieldHistory: false and add "whatever a field says". Both agree with the writer's first line, which returns off before any field is read. Holds.

Implementing files

  • audit-writers.ts: the two changed lines are the whole contract change, and the rewritten comment block matches them. renderTrackedChangeSummary and planTrackedLookupReads still take the one predicate, so the summary and the referenced-title reads cannot disagree. Holds. The round-1 nit stands as an accepted deviation: a tree change shows a stored id, and multi-value option types show stored values.
  • driver-sql/src/builtin-column-collision.ts: fieldHistory: 'presentation' is right. The map's only reader skips every key that is not storage when it reports what a builtin column discards, createColumn does not read the key, and trackHistory beside it has the same class for the same reason.
  • metadata-core/src/object-schema-fls-references.ts: fieldHistory: keep is right. The value is a boolean and names no field, so there is nothing to scrub when a field is withheld; trackHistory and referenceNameVisible are keep on the same ground. Serving the flag to a reader who can see the field's definition tells them nothing about any value.
  • Both closures were found by CI (Test Core 3/10 and 10/10 at 17772933) and are green at this head. The dev's local gate sweep does not derive them. That is a gap in the sweep, reported to the seat, not a finding on this PR.

Summary: M1 and S1 are closed, the new field key is declared, enforced and pinned, and the two key closures classify it correctly. Two nits and one escalation (a carrier for the three-state control) remain, none of which holds the head.

Implemented-by: claude/project-thread-xu21qu
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 REWORK(增量)· head c43a42bbc652e70b888b6b768d870f726825e728 · 2026-11-22T13:45Z

维护者速读

  • 用户能看到什么变化:记录的动态里,改了哪个字段,默认就显示「字段:旧值 → 新值」。这一轮新加了字段自己的关闭开关 fieldHistory: false。字段上的 trackHistory: false 不再表示关闭,因为字段设计器每次保存都会写上它,分不清是不是作者有意关的。
  • 为什么做:卡 字段修改历史:动态里的修改显示「旧值 → 新值」;字段和格子上可以看这一个字段的历次修改(数据后端已有) #36290 的第 1 个 PR。这一轮是对我的 REWORK 7078132570 和席位契约档 L2 7078144432 的修改,走的是席位同意的路线 (c)。
  • 出错会怎样:最坏情况是某个字段的旧值和新值在动态里显示了出来,而作者原本想关掉。用 fieldHistory: false 就能关;谁能看到值,仍按这个字段的读取权限来定。可以整体撤回。
  • 要你做什么:无。
  • 席位意见:REWORK,只有 1 项:补一条 changeset 条目,不改代码。我上一轮那一项已经改好,这一轮的新键、写入方的判断、表单、文档和台账,我读下来都是对的。

要改的(1 项)

  1. @objectstack/driver-sql 改了源码,changeset 里没有它。 c43a42bb 在 packages/drivers/driver-sql/src/builtin-column-collision.ts 的 FIELD_KEY_STORAGE_CLASS 里加了 fieldHistory。这个包不是 private,files 发运的 dist 就是这个文件编译出来的,而且这张表是导出的常量,所以发运的内容变了,要有条目。l1-face 也标了。清单的规定是:判据不是改动大小,缺了就不入队。
    • 怎么改:在 .changeset/36290-field-history-values-default-on.md 的 frontmatter 里加 '@objectstack/driver-sql': patch,正文加半句,说明 SQL 驱动把 fieldHistory 归为展示键,建表时不读它。
    • @objectstack/metadata-core 已经有条目了。@objectstack/metadata-protocol 只改了测试文件,files 只发运 dist,所以不欠,l1-face 对它标的旗不成立。
    • feat(spec): a field can say it is not asked for when a record is created (showOnCreate) #36449 在同一处欠了同样的条目,它在 7079997817 里是同一项。

增量核对(851997e6 → c43a42bb,3 个提交,39 个文件)

  • 我上一轮的那一项已改。 正文第 10 行改成了 Skills-docs: carried by #36419。skills: objectstack-data still teaches field history as opt-in after the default flips #36419 是 domain:skills 卡,状态 open,pm:blocked。
  • L2 M1(设计器每次保存都写 trackHistory: false)按路线 (c) 收口。
    • FieldSchema 新加了可选键 fieldHistory,没有 .default()。
    • changeValuesShownFor(audit-writers.ts)改成:字段的 fieldHistory === false 时关闭;fieldHistory === true 或 trackHistory === true 时打开,媒体和 JSON 类型也算在内;其余情况都按默认打开,只有无单行值的类型除外。对象上的 enable.fieldHistory: false 仍然最先判断。字段的 trackHistory: false 不再关闭,和不写一样。
    • 我逐句核了这几处,说法一致:两个键的 TSDoc 和 describe、生成的三个参考页、fields.mdx / validation-rules.mdx / security.mdx / migration.mdx、liveness/field.json 新加的 fieldHistory 一行(live,证据指向 changeValuesShownFor)、platform-checklist 的三处措辞,以及 changeset 改写的两条。
    • 在本 head 上 git grep 过 content/docs 和 skills,已经没有把字段的 trackHistory: false 写成关闭开关的地方。
    • 报告写了为什么不做存量行转换:applyConversionsToStoredItem 每次读都重放转换链,没有版本窗口,所以升级后有意存下的关闭也会被抹掉。这个理由成立。
  • L2 S1(表单开关没有帮助文字)已改。 field.form.ts 和 object.form.ts 的 fieldHistory、trackHistory 都加了帮助文字,而且明说了「不设置就是开,但开关看起来是关的」。原因是 SchemaForm 的布尔开关画成两态,!!value。要做成三态开关,得改渲染器,不在本卡范围内。帮助文字已经改成十种语言的生成翻译。
  • 声明:Clause-②: yes (widening) 对。新增一个可选键,没有任何东西因此被拒。Metadata-protocol: semantic 对,字段 trackHistory: false 的含义变了,changeset 第 24 行写明了。不是 !,也没有 (narrowing),不欠 dogfood。报告里仍然在本 head 上跑了一遍:484 个文件、4107 条通过,0 失败。
  • 消融:三处各做了一次:去掉 fieldHistory === false 的判断,audit-writers.test.ts 红 4 条;把 trackHistory: false 恢复成关闭开关,designer_saved 那条红;去掉 driver-sql 的那一行,穷举检查红。都复原了,git diff HEAD 为空。
  • 与 feat(spec): a field can say it is not asked for when a record is created (showOnCreate) #36449 冲突:两个 PR 都给 FieldSchema 加了一个顶层键,都把 protocol.meta-types-degenerate-derivation.test.ts 里 field 的属性数从 84 改为 85。builtin-column-collision.ts 和 object-schema-fls-references.ts 也是同一行附近。后落地的那个要合入 main,把属性数改成 86,再让 CI 跑一遍。
  • CI @ c43a42bb:62 success、12 skipped、0 failed;mergeable clean。
  • 落地:第 1 项改完、CI 全绿后,我做增量 L1,只核 changeset;再加上席位契约档增量 L2 PASS。另外,席位要先把 skills: objectstack-data still teaches field history as opt-in after the default flips #36419 的文字改好。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

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

维护者速读

增量核对(c43a42bb → d531553a,1 个提交,只改 changeset)

  • 上一轮那一项已改。 .changeset/36290-field-history-values-default-on.md 的 frontmatter 加了 '@objectstack/driver-sql': patch。正文新加的一条我逐句核过:「SQL 驱动把 fieldHistory 算作展示键,建列时不读它」,和 builtin-column-collision.ts 的 fieldHistory: 'presentation' 一致;「字段级权限的清理按原样保留它,因为布尔值不指向任何字段」,和 object-schema-fls-references.ts 的 keep 一致。@objectstack/metadata-core 原来就在里面。
  • 增量 L2 留下的两点小意见(tracked 提示和帮助文字)由 dev 移到第 2 个 PR,席位同意,我不另作要求。
  • overlap-check 对 feat(spec): a field can say it is not asked for when a record is created (showOnCreate) #36449 退出码 1,就是我上一轮写过的字段数冲突:两个 PR 都把 field 的属性数从 84 改到 85。后落地的那个要合入 main,改成 86,并重跑 CI。
  • 给席位,落地前:skills: objectstack-data still teaches field history as opt-in after the default flips #36419 第 1 步的文字(字段的关闭开关是 fieldHistory: false,不是 trackHistory: false)请先改好。
  • 其余各项沿用上一轮在 c43a42bb 上的核对。这一轮没有动代码。
  • CI @ d531553a:62 success、12 skipped、0 failed。
  • 落地:非受管。等席位契约档增量 L2 PASS 后,由区 ready + auto-merge。Part of 卡保留 pm:dispatched。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 15:56
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 45041073820 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test UI (5/16) — 失败步骤: Run the ui tests (shard 5/16)

    × a phone draws the star beside the name, and its bottom bar's ⋯ holds no favorites entry 1163ms
    FAIL   dom  packages/app-shell/src/views/RecordDetailView.favoritesEntry-12427.test.tsx > record page: the favorite star beside the record name, none in the ⋯ (objectstack#36246) > a phone draws the s
      ↳ 失败原因: AssertionError: expected null to be truthy
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 5 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jRCdMrPNTumXfsr1mw

Queue build 45041073820, red in Test UI (5/16): packages/app-shell/src/views/RecordDetailView.favoritesEntry-12427.test.tsx (a phone draws the star beside the name, expected null to be truthy). This PR's diff touches no file under ui/, so the test is outside it. The same signature popped #36338 and #36478 from the same speculative stack, and #36515 tracks it as a queue flake. Nothing to fix on this branch: re-queue aa362ba1 once #36515 is settled or the stack ahead clears. The landing seat owns the re-queue.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Re-landing (seat 7, 2026-11-22T16:27Z): same head aa362ba1a79d95585d2c189fc4197ba6293133c6, same records as landing 7081686153. Queue build 45041073820 failed in RecordDetailView.favoritesEntry-12427 as an inherited row of #36515. The root is #36478 (a semantic conflict with #36456's new test, now dequeued and being reworked), and this PR touches no ui/ file. #36478 is out of the queue, so this build no longer stacks on it. → pr_ready + automerge_enable (merge queue).

Merged via the queue into main with commit 70194ff Nov 22, 2026
75 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-xu21qu branch November 22, 2026 16:37
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…ted (showOnCreate) (objectstack-ai#36449)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_

repo:objectstack#7 · zhuangjianguo · session_01QsR2jVMKrYARogu1S6PcHj

Part of objectstack-ai#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 objectstack-ai#36455, a domain:skills card.)

Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up objectstack-ai#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 objectstack-ai#36455 (domain:skills: skills text
lands only in a domain:skills PR), hence `Skills-docs: follow-up
objectstack-ai#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 objectstack-ai#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

- Overlap at push (`d8b82f70`, unchanged from `b86db2be`):
`overlap-check.mjs` reports clean merges with `origin/main` and objectstack-ai#36435,
objectstack-ai#36411, objectstack-ai#36386, objectstack-ai#36351. objectstack-ai#36392 conflicts only in the generated
`liveness/state-counts/field.md`; objectstack-ai#36399, which also adds a field key,
conflicts there and in the `field` property-count pin, which whichever
lands second raises by one and regenerates.
- The card's acceptance lines are UI readings (the create dialog, the
full-page create, the action modal, the Studio switch). They are PR 2's,
with live checks and screenshots there; this PR has no rendered surface.

## Verification

<details><summary>Derived gate families at 197434e: 115 derived, 114
run green, 1 NOT MEASURED</summary>

- `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.

</details>

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](https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jVMKrYARogu1S6PcHj
<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jVMKrYARogu1S6PcHj -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…and activity-summary labels read as /meta serves them in a declared sourceLocale (objectstack-ai#36464)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb3T2gwH6MWTYde4qF8edEDN)_

Part of objectstack-ai#35384 — this PR moves three of the card's readers onto the
`/meta` resolve path. The approval NOTIFICATION subject param stays
open: it is resolved per recipient at delivery by service-messaging's
general keyed-param path, so it is left for the area to file (see
Acceptance notes).

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:应用以英文编写、默认面向中文用户时,英文用户在审批收件箱、审批页、活动记录摘要和自定义校验规则的报错里看到英文原文,不再夹杂默认语言的中文;中文用户看到的不变。
- 为什么做:这是多语言标签统一的后续:让这三处和对象元数据接口用同一种方式取标签。
- 出错会怎样:最坏情况是某处标签显示成原文而不是译文,不影响数据和权限,合并后可直接回退。
- 要你做什么:无

## What changes

The objectstack-ai#34030 rule, quoted from the card: "resolve the label through
`translateObject` with the same resolve options `/meta` builds, so `t()`
carries messages only."

- **objectql** (`validation/rule-validator.ts`, `authoredRuleMessage`):
an author-written rule message
(`objects.OBJECT._validations.RULE.message`) now resolves through
`translatedLabels` over `ValidationMessageContext.labelTranslation`.
That is the bundle plus `ResolveOptions` that the same refusal's field,
option and object labels already read (objectstack-ai#34030), so this half adds no
copy of the options. The ADR-0029 D9.2a tenant-rewrite check is
unchanged. `translate` (that is, `t()`) now carries only the built-in
messages.
- **plugin-approvals** (`reader-locale-labels.ts`,
`readerLabelsFor().objectLabel`): the object label resolves through
`translateObject` over every locale the service holds, with the metadata
route's options: the negotiated reader locale, the declared fallback
chain, and `sourceLocale` else `defaultLocale`. This one change covers
the inbox row, the request page, the generic data door's request rows
and the two lifecycle refusals that name an object. Flow, step and
position labels and the catalog sentences stay on `t()`.
- **plugin-audit** (`activity-summary-message.ts`):
`readerSummaryLocale` hands the composer the object definition that
`translateObject` put in the reader's language. The object, field and
select-option labels are read off that definition and no longer come
from `t()` keys. The writer's stored sentence is unchanged, because its
locale already reads only authored labels.
- A service that cannot hand its translations over (no `getLocales()` /
`getTranslations()`) no longer gets these labels translated through
`t()`: the authored text stands. Every service the platform ships
implements both.

## Tests

- objectql `engine-label-source-locale.test.ts`: new top-level describe
for the authored rule message under `sourceLocale: 'en'` /
`defaultLocale: 'zh-CN'`. An `en` write reads the authored sentence.
Controls: a `zh-CN` write reads the zh-CN row, and with no
`sourceLocale` an `en` write walks to the zh-CN row.
- objectql `validation/rule-validator.test.ts` (objectstack-ai#14253 and D9.2a
describes) moved from `translate` doubles to `labelTranslation`. The
first case wires a `t()` decoy beside it, so a regression back to `t()`
turns it red.
- objectql `engine-validation-locale-negotiation.test.ts` and
`engine-validation-tenant-rewrite.test.ts`: the served-adapter doubles
gain `getTranslations` / `getFallbackLocale`, which `FileI18nAdapter`
has. The three `t()`-locale probes in the negotiation suite now trip a
built-in `max_length` message, the sentence the `t()` bridge still
carries.
- plugin-approvals `reader-locale-labels.test.ts` and plugin-audit
`activity-summary-message.test.ts`: a new `[objectstack-ai#35384]` describe in each.
Each covers the real in-memory service and the served-adapter shape, and
asserts that `t()` itself answers the zh-CN row at the same service, so
the defect's precondition is measured and not assumed. Also covered: the
two controls, a `t()`-only service, and a throwing `getTranslations`.
- `/meta`'s half of the same scenario is pinned in
`packages/rest/src/meta-i18n-declared-fallback-chain.test.ts` §6.

## Acceptance notes

- **Not fixed here, left for the area to file:** the approval
notification subject param (`approval-notification-text.ts`
`subjectParams`, `{ key: objects.OBJECT.label, fallback }`). It is
resolved at delivery by
`packages/services/service-messaging/src/notification-text.ts`
(`renderWith`: `lookup(i18n, param.key, locale) ?? param.fallback`,
through `t()`). The producer holds no recipient locale at emit, so it
cannot hand over a resolved label. The only messaging fix would parse
the key shape inside the per-delivery param resolver that every
producer's keyed params share, which goes past the narrow widening the
area allowed. **Routed (seat):** this is the objectstack-ai#35384 remainder, released
back to `pm:queue` on merge as a typed object-label param in
`NotificationTextKeys` that service-messaging resolves through
`translateObject` (`domain:server`), together with `readerLabelsFor`'s
flow, step and position labels.
- **Folded into the same objectstack-ai#35384 remainder (L1 7081082388):** the two
readers this PR moves hand `translateObject` the metadata route's
resolve options but not its packaged base. plugin-approvals
`objectLabel` passes `{ name }` alone, and plugin-audit
`translatedObjectDef` passes no `packagedBase`. So for a renamed object
(a served label that diverged from the packaged one) they read the
translation of the old label, where `/meta` serves the rename. This is
not a regression: `t('objects.<o>.label')` did the same. The fix is the
`getPackagedObjectBase` read objectstack-ai#36460 threads for the share-link label.
Until then, the docblocks' "as `/meta` resolves it" holds for the
resolve options only.
- **Measured: `en-US` under `sourceLocale: 'en'`.** `/meta` hands
`translateObject` the request tag as written. objectql (objectstack-ai#34030) and now
these readers hand it the tag negotiated against the service's locales.
When the service holds an `en` locale (any `en` catalog), an `en-US`
request gets `客户` (the defaultLocale row) from `/meta` and `Account`
from objectql. With no `en` locale held, both give `客户`. Reading taken
with `translateObject` from this branch's `@objectstack/spec` dist at
c0111e2. Raised as a decision; not changed here. **Filed:** objectstack-ai#36466
(`/meta` negotiates the request locale first; no spec change).
- No resolve-options builder is reachable from plugin-approvals or
plugin-audit: rest's `metaTranslateOptions` is not a dependency, and
objectql's `labelTranslationOf` is private. So each plugin carries the
same few lines that plugin-security and objectql inlined in objectstack-ai#34030, with
a docblock naming `metaTranslateOptions`. **Filed:** objectstack-ai#36467 (one
exported spec builder, contract tier).

## Verification

Two-minute check: `pnpm --filter @objectstack/plugin-approvals exec
vitest run --maxWorkers=2 src/reader-locale-labels.test.ts`. Expect
every case to pass, including `[objectstack-ai#35384] … an en reader picks no
defaultLocale row`.

Read first:
1. `packages/plugins/plugin-audit/src/activity-summary-message.ts`, the
`readerSummaryLocale` / `translatedObjectDef` hunk (the reader's
definitions are now the translated ones).
2. `packages/objectql/src/validation/rule-validator.ts`, the
`authoredRuleMessage` hunk.
3. `packages/plugins/plugin-approvals/src/reader-locale-labels.ts`, the
`objectLabel` hunk.

<details><summary>Test readings (b815112 unless stated; fix round at
final head 67d23af first)</summary>

- Fix round at 67d23af (CI Test Core 6/10 red on b815112: 4 cases in
`packages/services/service-automation/src/flow-write-refusal-locale.integration.test.ts`,
whose i18n double held the rule message only as a `t()` key, so the
bundle read now returned the authored English). The double's zh-CN
bundle gains
`objects.crm_deal._validations.amount_not_negative.message`. It is a
fixture change of spelling only: no assertion changed and nothing was
skipped. In that file, Tests 8 passed (8).
`@objectstack/service-automation` 290/290 files, 4222/4222 tests.
`@objectstack/plugin-approvals` 126/126 files, 1853/1853.
`@objectstack/plugin-audit` 109/109 files, 1800/1800. Lock VERDICT
command-exit 0. overlap-check at 67d23af is clean. A sweep of the
other tests that combine validations, an i18n service and a non-en
locale found no further consumer.
- objectql `pnpm --filter @objectstack/objectql test` at 8be4929
(objectql is unchanged after it): Test Files 628 passed (628), Tests
14286 passed (14286); lock VERDICT command-exit 0.
- plugin-audit `pnpm --filter @objectstack/plugin-audit test` at
b61713e: 107/109 files, 1798/1800 tests. Two failures: the new pin's
expected list wording, and the bare-string option case (triaged below).
After the fix, those two files at b815112: Tests 31 passed (31).
- plugin-approvals `pnpm --filter @objectstack/plugin-approvals test` at
b61713e: 125/126 files, 1846/1853 tests. Seven failures, all in
`record-lock-user-facing-message.test.ts`, whose doubles answered labels
through `t()` only. After those doubles gained `getTranslations`, that
file and `reader-locale-labels.test.ts` at b815112: Tests 41 passed
(41).
- typecheck at b815112: objectql exit 0, plugin-audit exit 0,
plugin-approvals exit 0. At b61713e approvals failed with TS2339 on
the label-only doc literal; fixed with an `ObjectLike` annotation.
- Fixture triage: the bare-string option `options: ['p1', 'p2']` is not
a `SelectOptionSchema` (strict object with `label`). `translateObject`,
and so `/meta`, serves it as written. The objectstack-ai#7289 case now pins `p1` as
`/meta` serves it, where it used to pin the `t()` row.

</details>

<details><summary>Reverse verification (each fixed source file put back
to origin/main, its pins run, then restored)</summary>

At b61713e, under one lock call, the scratch script used `git restore
--source=BASE` (tree only), checked the BASE blob hash on disk, then
`git checkout HEAD --` and checked the HEAD blob hash. Pins resolve
`src/` directly, so no dist step is involved.
- `rule-validator.ts` at BASE: `engine-label-source-locale.test.ts` 1
failed / 8 (`an en write reads the authored English sentence`).
- `reader-locale-labels.ts` at BASE: `reader-locale-labels.test.ts` 4
failed / 22 (both `en reader picks no defaultLocale row` cases, the
inbox-row case, and the `t()`-only case).
- `activity-summary-message.ts` at BASE:
`activity-summary-message.test.ts` 4 failed / 18 (both `en reader`
cases, the `t()`-only case, and the throwing-translations case).
- Controls stayed green on every leg. After restore, `git diff HEAD` was
empty.

</details>

<details><summary>Gates</summary>

`node scripts/pm/dispatch-gates.mjs --commands` derived 74 families;
reconciliation with `--ran` reported 74 derived, 74 run.
- 70 exit 0 at b61713e. Re-run at b815112, exit 0:
`check:type-check-debt` (a PREREQUISITE exit 3 on the first pass, while
a sibling build held dist), `check:type-check-coverage`,
`check:cross-package-test-inputs`, `check:test-source-alias`,
`check:undeclared-dep-imports`, `check:nul-bytes`,
`check:engine-double-contract`, `check:doc-authoring`,
`check:issue-citations`.
- NOT MEASURED locally, left to CI: `check:i18n` (needs the built CLI
closure), `check:dual-build-cjs-loads` (needs a full build), and
`check-plugin-teardown-shape --self-test` (needs a commit this shallow
clone does not have).
- `overlap-check --branch=HEAD`: clean against origin/main and objectstack-ai#36399.

</details>

---

_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq)_

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jTyyBmoPBsURQjeJGq -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…rnel with no http.server (objectstack-ai#36539)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JpRoUZGqtwqMU5k7b4C58D)_

Part of objectstack-ai#36469

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

-
托管环境里的成员现在可以撤回自己的表情回应、标记评论已解决或重新打开、删除自己的评论;以前这三个操作在托管环境一律报“找不到接口”,自托管环境不变。
- 修的是评论协作这块的托管缺口,与之前已裁定的“托管环境缺少服务端入口”一类问题同一种修法。
- 出错时只影响这三个评论操作:没装审计插件的环境会明确提示缺什么,而不是“找不到”;改动可以直接撤回。
- 无。

## What changes

The cause is in objectstack, in two layers: `AuditPlugin` mounted the
three comment doors only on the kernel's own `http.server`, and the
runtime dispatcher had no domain for `/comments`. A hosted tenant kernel
owns no socket and registers no `http.server`, so `DELETE
/api/v1/comments/reactions/:id`, `PUT /api/v1/comments/:id/resolution`
and `DELETE /api/v1/comments/:id` reached the host's `createHonoApp`
catch-all, whose `dispatch()` had no domain for them, so they answered
the dispatcher's `404 ROUTE_NOT_FOUND`.

**Premise reading.** Cloud confirmed the hosted composition on the card
(comment 7084177018, cloud `apps/objectos` at `ab4358642`). The rig
mounts `createHonoApp({ prefix: '/api/v1' })` under the
`plugin-hono-server` raw app with `outer.route('/', inner)`, after the
plugin routes. So an unclaimed `/api/v1/comments/**` request reaches the
dispatcher catch-all, and the new `/comments` domain is reachable on
hosted. **Unexplained:** the card read `404` with
`{"code":"ENDPOINT_NOT_FOUND","message":"Not found"}`. In this tree only
the `plugin-hono-server` transport's unmatched answer spells that, and
the `createHonoApp` catch-all answers `ROUTE_NOT_FOUND`. Either the
reading predates the pin cloud read, or a layer upstream of the
catch-all answered it; that was not measured here. The code text now
states the tree's answer (`ROUTE_NOT_FOUND`) and records this
discrepancy instead of the old account.

Shape: ruling A on objectstack-ai#22438 (record 6079645593, applied to this member of
the class; seat scope comment 7081381198). Three segments, one PR.

- **spec** (`packages/spec/src/contracts/comment-doors-service.ts`): new
`ICommentDoorsService` with one OPTIONAL, transport-neutral member
`handleCommentDoor(request: Request)` answering a promised `Response`,
the shape `IWebhookService.handleRedeliver` and
`IApprovalService.handleActionPage` already use. `ServiceSlotContracts`
gains `comments: ICommentDoorsService`. No comment service contract
existed, so this is the smallest new one. API surface and export-origin
snapshots gain the one interface.
- **plugin-audit** (`comment-doors-member.ts`, `audit-plugin.ts`):
`init()` registers the `comments` service. Its member runs the SAME two
registrars (`registerCommentReactionRoutes`,
`registerCommentDoorsRoutes`) over the same deps as the `http.server`
mount, on a private `HonoHttpServer` that never listens, built on first
request. The registrar body moved verbatim into a module-level
`registerCommentDoors(http, ctx)` that both faces call;
`mountCommentDoors` is otherwise unchanged, so the raw mount is
byte-unchanged and nothing is mounted twice. The no-server branch now
logs (info) that the doors are served on the `comments` service instead
of warning that they are unmounted. New dependency:
`@objectstack/plugin-hono-server`.
- **runtime** (`domains/comments.ts`, registered in
`http-dispatcher.ts`): a `/comments` segment domain for `PUT`/`DELETE`
that claims exactly the three method and path shapes and forwards
`context.request` with its body unread (env-scoped spellings are
rewritten to the `/api/v1` wire path). Every other `/comments` shape
keeps `404 ROUTE_NOT_FOUND`. No slot, or a slot without the member: `501
NOT_IMPLEMENTED` naming `@objectstack/plugin-audit`. A consumed body or
a throwing member: sanitised 500, logged. No auth-gate or
membership-gate exemption. Route ledger: three `server-only` rows under
domain `/comments`.
- **guards**: `scripts/check-route-envelope.mjs` declares `comments.ts`
in `DISPATCHER_DOMAINS`; the dogfood authz matrix classifies the new
ledger key (`comment-doors-session`); the live-mount parity boot pins
the three rows as unexercised (that boot composes no `AuditPlugin`).

Overlap: PR objectstack-ai#36399 also edits `audit-plugin.ts`. This diff stays in the
imports, the `init()` slot registration, `mountCommentDoors` and the new
`registerCommentDoors` helper, and touches none of that PR's regions.

Out of scope here (filed separately by the seat): the personal-views and
attachments doors of the same class.

## Tests

**Why `Part of`, not `Fixes` (seat, on l2-review#4 7086653795 ③):**
cloud's reading (7084177018) shows that this tree's hosted composition
reaches the bridged path. However, the card's own measurement read
`ENDPOINT_NOT_FOUND` with no `mountCommentDoors` warning, which this
tree would not produce. So no hosted evidence yet shows that the card's
request took this path. objectstack-ai#36469 stays open for one hosted live probe
after this merges. That probe also checks whether a tenant kernel with
no auth service answers 401.

**Text rework (L2 S1), head `e7dcb26cc4`** (main merged at `f3a8a13c` in
merge commit `acc0d0cd`, no rebase): the contract jsdoc, `comments.ts`,
`comment-doors-member.ts`, the unreact ledger note, the conformance test
header and the changeset now state the prior hosted miss as the
dispatcher's `ROUTE_NOT_FOUND`, and the absence promise as never
`ROUTE_NOT_FOUND` (nor `ENDPOINT_NOT_FOUND`). The member's own
`ENDPOINT_NOT_FOUND` for paths outside its three routes is unchanged.
The conformance pin now refuses both miss codes. Readings at
`e7dcb26cc4`:
- runtime `comments.test.ts` + `route-ledger.conformance.test.ts` 26/26;
conformance 6/6; spec contract tests 12/12.
- typecheck exit 0 for plugin-audit and http-conformance. runtime `tsc
--noEmit` exit 0; its `check:test-typecheck` flagged only 3 untouched
files with TS2307 on the unbuilt `@objectstack/driver-turso`. That run
was green with the full build in the previous round.
- eslint on the five edited source files: exit 0. The CI ESLint parse
error at `604b45ec3` (an unescaped apostrophe in the ledger note) is
fixed at `e7dcb26cc4`.
- dispatch-gates derived for this round's six paths: 98 families, 95
exit 0. NOT MEASURED: `check:dual-build-cjs-loads` and `check:i18n` (no
whole-workspace dist), and `check:type-check-debt` (its locked closure
build queue-timed out). CI runs all three.

Earlier readings at head `6b916dcfc` unless noted (spec and runtime
source unchanged after the noted sha).

-
`packages/qa/http-conformance/src/hono-comment-doors.conformance.test.ts`
(new, the dispatcher-only shape: `createHonoApp`, no `http.server`, real
`AuditPlugin`, real ObjectQL over sqlite-wasm): **6/6 passed**. Covers
unreact, resolve then reopen, own-comment delete (200, store follows),
byte parity of the anonymous refusal and the refused body between the
self-hosted mount and the hosted door, and a typed `501 NOT_IMPLEMENTED`
per door with no `comments` service.
- `packages/runtime/src/domains/comments.test.ts` (new) +
`route-ledger.conformance.test.ts`: **26/26 passed** (at `2f6e249ad`).
- `@objectstack/plugin-audit` full suite: **109 files, 1794 tests
passed** (at `2f6e249ad`).
- `@objectstack/spec` `comment-doors-service.test.ts` +
`core-service-contracts.test.ts`: **12/12 passed**; spec `typecheck`
(incl. `check:test-typecheck`) exit 0.
- dogfood `authz-conformance.test.ts` +
`authz-probe-blind-spot.test.ts`: **70/70 passed**.
- typecheck exit 0: plugin-audit, runtime, http-conformance, dogfood.

<details><summary>Red before, green after (two ablations, both
restored)</summary>

Both via `scripts/ablation-replace.mjs` (anchor hit 1 to 0, blob
changed, then restored: blob == HEAD and `git diff HEAD` empty). Both
subjects resolve to source (runtime tests import
`../http-dispatcher.js`; http-conformance aliases
`@objectstack/plugin-audit` to `src`), so no dist rebuild sits between
mutation and reading.

1. Runtime domain registration removed from `http-dispatcher.ts`:
`comments.test.ts` **10 failed / 3 passed** (the door shapes fall to the
ordinary miss).
2. `ctx.registerService('comments', ...)` removed from
`audit-plugin.ts`: conformance **4 failed / 2 passed**. Unreact, resolve
and own-delete answer `501 NOT_IMPLEMENTED ... no comments service is
registered`, and byte parity breaks.

Not done: a conformance-level ablation of the runtime domain. That
subject reaches the conformance test through `@objectstack/runtime`'s
`dist/` and would need a locked rebuild per leg. The unit-level ablation
(1) covers the domain.
</details>

<details><summary>Gates</summary>

`node scripts/pm/dispatch-gates.mjs --commands` at `6b916dcfc` derived
135 families. All 135 ran locally; `--ran` reconciliation: 135 derived,
135 run, 0 unrun.

Final pass, non-zero exits only:
- `check:dual-build-cjs-loads` and `check:i18n` exited 3 (PREREQUISITE
NOT MET: unbuilt workspace dist). Both were rerun after the full build
`check:type-check-debt` performed, and both exited 0.
- `check-self-test-workflow-commands.mjs` failed once with `spawnSync
node ETIMEDOUT` on the loaded box. Rerun: exit 0.

Fixed in this PR because a gate caught them:
- `check:route-ledger-census`: 150 to 153.
- `check:test-source-alias`: plugin-audit gets an anchored alias for
plugin-hono-server, and the domain test imports `@objectstack/metadata`
at module top.
- `check-affected-docs`: the runtime door table keys `pattern`, not
`path`, so it is not read as a spec API declaration.
- `check:query-options-erasure`: the test's `findOne` options are typed.
</details>

## Acceptance notes

- The cause is in objectstack: the plugin-audit mount and the runtime
dispatcher layer. Ruling A on objectstack-ai#22438 is applied to this member of the
class. The personal-views and attachments doors of the same class are
not touched here; the seat files them separately.
- Clause-② `yes (widening)` adds one optional member on one new contract
and one new slot key. Nothing is removed or narrowed. A service without
the member still satisfies the contract (pinned).
- The `/comments` rows enter the route ledger as `server-only`, because
the gap ratchet is 0. The live-mount parity boot pins them as
unexercised, because that boot composes no `AuditPlugin`.
- Unmeasured on hosted: the member resolves the caller with the tenant
kernel's own `auth` service (`ctx.getService('auth')`), while the
dispatcher's identity step can fall back to the host kernel. A tenant
kernel with no `auth` service of its own would answer 401 after the
dispatcher admitted the caller. The webhooks precedent makes the same
assumption.
- L2 N1, accepted deviation (also in the changeset):
`@objectstack/plugin-audit` now depends on
`@objectstack/plugin-hono-server` at runtime (the member's private table
is a `HonoHttpServer`), and the `comments` service name is taken, so a
composition that registers its own `comments` service beside
`AuditPlugin` fails to boot with a duplicate-service error. L2 N2 to N4
are accepted as is.
- NOT MEASURED: `route-ledger-live-mount-parity.dogfood.test.ts`. It
boots the showcase app, and the box's verify lock never reached this run
for that boot. CI's merge-queue dogfood shard runs it.
- Deviation: the shared verify lock answered queue-timeout (exit 99) on
every attempt in about 2.5 hours, under holders that each ran 10 to 80
minutes. One build closure did acquire the lock (`VERDICT command-exit
0`). Per the seat's fallback, the scoped vitest and typecheck runs above
ran outside the lock, one at a time. A parked slot did not keep its
place across re-queues (it reappeared at the back); that is recorded for
the seat.

## Verification

Read first, by risk:
1. `packages/runtime/src/domains/comments.ts`: `handleCommentsRequest`
(the three-shape claim, the 501 legs, the body-unread forward).
2. `packages/plugins/plugin-audit/src/audit-plugin.ts`: the `init()`
slot registration and the extracted `registerCommentDoors` (must equal
the old inline body).
3. `packages/plugins/plugin-audit/src/comment-doors-member.ts`: the
private never-listening table.

Two-minute check: `pnpm --filter @objectstack/http-conformance exec
vitest run --maxWorkers=2 src/hono-comment-doors.conformance.test.ts`
after building the closure. Expected: 3 suites green; the unreact,
resolve/reopen and own-delete legs answer 200 on a kernel with no
`http.server`.

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY

<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmRY38EZf38Yy3zthbY -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…nd Default says what it resolves to (objectstack-ai#36580)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9RrM5sKZCWCaM7kfFhKhSDe)_

Fixes objectstack-ai#36482

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

- 字段表单、对象表单的字段列表、对象「功能」里的「字段修改值」从开关改成三选一:默认 / 开 / 关。
- 「默认」不写任何值(跟随平台),并直接写出它对这一行意味着什么:大多数类型显示「默认(开)」,媒体、JSON、凭据字段显示「默认(关)」。
- 以前关掉后回不到「跟随默认」,现在选「默认」即删掉这个键;开、关照旧写 true / false。
- 「默认是开还是关」与动态写入时的判断用同一个函数(新放进 spec),两边不会再各写一份类型清单而对不上;写入行为不变。
- 若出错,可能表现为某个字段类型的「默认」标成开、实际写入时却不显示值(或相反),已有测试逐类型钉住。
- 11 个语种的帮助文字同步改写,去掉了「开关显示为关」的说明。

## What changes

**Spec** (`packages/spec/src/data/field-history-default.ts`, new,
exported from `@objectstack/spec/data`):
- `resolveFieldHistory(field, object)`: whether a changed field's old →
new values show on the activity timeline. Off when the object writes
`enable.fieldHistory: false`, or the field writes `fieldHistory: false`,
or the field is a credential (`isMaskedOnReadFieldType`, with the
object's `managedBy`). On when the field writes `fieldHistory: true` or
`trackHistory: true`. Otherwise on unless the type is in
`FIELD_HISTORY_DEFAULT_OFF_TYPES`.
- `FIELD_HISTORY_DEFAULT_OFF_TYPES`: the 14 types that were a private
`Set` in the audit writer, unchanged, now frozen and typed
`FieldType[]`.
- Same home and same reason as `isMaskedOnReadFieldType` (objectstack-ai#20141): two
consumers ask the question, so it is declared once.
- `field.form.ts` and `object.form.ts`: the three `fieldHistory` rows
(field form, the `fields` repeater, the `enable` composite) name
`widget: 'field-history'`; the repeater and composite rows drop `type:
'boolean'` so the widget is what renders. Help text rewritten: no
"though the switch shows off"; the field rows say what Default means per
type (fixes the L2 nit on objectstack-ai#36399 that "Unset means ON" was too broad for
media, JSON and credential fields).
- Names per the seat's ruling (comment 7088708778):
`resolveFieldHistory` (the resolved value of the authored key, as
`resolveDisplayField` is for `displayField`),
`FIELD_HISTORY_DEFAULT_OFF_TYPES`, input interfaces `FieldHistoryField`
/ `FieldHistoryObject`.
- `api-surface/data.json` and `export-origins/data.json` regenerated: 4
added, 0 removed.

**Writer** (`packages/plugins/plugin-audit/src/audit-writers.ts`):
`changeValuesShownFor(objectDef)` now returns `(_key, field) =>
resolveFieldHistory(field, objectDef)`. The local `NO_LINE_VALUE_TYPES`
set is gone. Equivalence: the old credential test was
`collectMaskedReadFields(objectDef).has(key)`, which is
`isMaskedOnReadFieldType(def.type, objectDef.managedBy)` over
`objectDef.fields`; every caller passes `field =
getObjectDef(object).fields[key]` (`getFieldDefs`), so the two read the
same definition. The full plugin-audit suite passes unchanged.

**Studio**
(`ui/packages/app-shell/src/views/metadata-admin/widgets.tsx`): new
registered widget `field-history`, labelling `control` (the host label
names the Select trigger). Three options: `Default (On|Off)`, `On`,
`Off`. Default calls `onChange(undefined)`, which removes the key. A
field row (one carrying `type`) resolves Default through
`resolveFieldHistory({ type, trackHistory }, undefined)`; the `enable`
block resolves to on. A non-boolean stored value draws as Default, as
the writer reads it. New i18n keys `engine.form.fieldHistoryDefault` /
`fieldHistoryOn` / `fieldHistoryOff` in the studio namespace (en, zh).

**Translations**: the three help texts in all 11
`*.metadata-forms.generated.ts` bundles, hand-translated (extract does
not overwrite a present leaf).

## Tests

- `packages/spec/src/data/field-history-default.test.ts` (new, 12): each
arm of the predicate, every no-line type, the better-auth password
exemption, literal-boolean reads.
- `ui/.../FieldHistoryWidget-36482.test.tsx` (new, 10): the three
published rows name the widget; Default (On) / Default (Off) per type
and with `trackHistory: true`; stored `true` / `false` draw On / Off;
choosing Default after Off calls `onChange(undefined)`; On / Off write
`true` / `false`; read-only disables it. Ablation: with the resolver
replaced by `true`, "names Default (Off) for a media, JSON or credential
type" fails; with Default writing `false`, "a stored false goes back to
unset" fails.
- Registry tables extended with a `field-history` row, as each one
requires for a new key: `SchemaForm.widgetLabelling.test.tsx`,
`SchemaForm.controlWidgetGridNaming-9889.test.tsx`,
`__tests__/SchemaForm.controlWidgetFailureArmNaming-9931.test.tsx`
(164/164).
- Local runs: plugin-audit 109 files / 1815 tests; spec `src/data` 190
files / 6778 tests; platform-objects translations 26 files / 610 tests.
Derived gates are in the seat's gates file; CI runs the full farm.

## Acceptance notes

- The field rows cannot see the object's own `enable.fieldHistory` (a
field form, a repeater row has only the field), so Default names the
field's own resolution; the help text says the object's off wins.
- Accepted deviation (contract review 7088768550, N3): the widget passes
no object to `resolveFieldHistory`, so two cases differ from the writer:
an object with `enable.fieldHistory: false` (disclosed in the help
text), and a `password` field on a `managedBy: 'better-auth'` object
(label Default (Off), writer on). No better-auth object declares a
`password`-typed field today, so the second is unreachable; passing the
object needs row-to-document plumbing in `RecordField`, not owed by this
card.
- Contract review N1 and N2 fixed in `5df919cb`: module header wording;
the field rows' help text now says a credential field never shows values
(11 locales).
- Contract review N4 (delta 7088846404) fixed in `e285ca09`: the widget
docblock and the changeset no longer read as if Track History could turn
a credential field on; a credential field's Default is Off always.
Wording only, no code change.
- Out of scope, carried by objectstack-ai#36290's remaining PRs: the Studio field
designer and object field inspector (`FieldDesigner.tsx`,
`ObjectFieldInspector.tsx`) and an `enable.fieldHistory` control in
`ObjectSettingsPanel`. They do not render these spec form rows.
- ADR-0052 §5b.1 amendment for the reversed default is already carried
by objectstack-ai#36086 (from objectstack-ai#36399); this PR adds no ADR sentence.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmPedgY4mKE12ad7oAo)_

<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmPedgY4mKE12ad7oAo -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…ty entry, old → new (objectstack-ai#36613)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9NRmimMwnUgR1DbqgHtBWM3)_

Part of objectstack-ai#36290

Clause-②: yes (widening) — four new `detail.*` language-pack keys in
every locale `@object-ui/i18n` ships, and new optional props on the
exported `FieldChangeItem`; nothing removed or renamed
Metadata-protocol: none

PR 2 of 4 on the card (part ②: card items 1 and 2, and the activity half
of item 5). PR 1 (objectstack-ai#36399, merged as `70194ffc`) made the activity stream
serve each changed field's old and new values, narrowed per reader. This
PR draws them on the record page. Part ① (the designer producers of
`fieldHistory`) waits for objectstack-ai#36580; part ③ (the per-field history card and
the field and grid-cell entry points) closes the card. Ruling-ref:
7076513167.

## 维护者速读

- 记录页「动态」里,每次保存现在先写改了哪些字段,下面每个字段一行「字段名:旧值 →
新值」;旧值为空写「空」,长文字截成一行,点「展开」看全文;单选显示选项名,关联记录和人员显示名字。
- 属于「记录详情页重做」专题下的字段修改历史:以前动态里只写「更新了
客户备注」,看不到改前改后的值;服务器上周已经按读取权限发送这些值,这次是把它们画出来。
-
出错时,用户会看到动态里的修改行排版不对或展开按钮失灵;不会多看到任何字段,因为没有读取权限的字段服务器本来就不发送;可以整体撤回,数据不受影响。
- 无

## What changes

**The served values reach the timeline**
(`ui/packages/plugin-detail/src/renderers/recordActivityFeed.ts`)
- New `activityFieldChangesOf(row)`: reads the field-change code
plugin-audit serves in `sys_activity.metadata` (`summary_message`, key
`fieldChanges`) and turns it into one `FieldChangeEntry` per field.
`activityRowToFeedItem` puts it on the item as `fieldChanges`. An option
side keeps the option it matched; a yes/no side keeps the boolean; the
writer's empty mark (`∅`, or an empty text) becomes an empty side. A
code it cannot read whole gives nothing, and the row draws its summary
as before.
- Nothing is filtered in the browser. The server already drops a change
of a field the reader may not read, and a reference change whose record
title the reader is not served (PR 1, `activity-field-redaction.ts`).
The timeline draws exactly the changes it is handed.

**One line per changed field** (`RecordActivityTimeline.tsx`,
`FieldChangeItem.tsx`)
- An entry with changes (an activity row's served code, an audit-log
entry, or the audit entry paired onto an activity row) draws its usual
one-line row, then one line per changed field under it: `Label: old →
new`.
- The row's own text: for an entry whose changes are its own, `Updated
Phone, Email` (its stored summary would repeat the lines). An activity
row carrying its paired audit entry keeps its own summary. The record's
creation is unchanged (one row, values beside the summary).
- Each side: an option reads as the field's option label in the reader's
language (`fieldOptionLabel`, falling back to the schema label, then the
served text); a lookup or user reads as the record name the server
served; a yes/no reads as `common.yes` / `common.no`; an empty side as
`detail.fieldChangeEmpty`.
- Each side is cut to its line (`truncate`). A side that overflows
(measured), holds a line break, or is longer than 48 characters offers
`Show all`, which wraps both sides in full, and `Show less`.
- The row's markers (`data-stream-row`, `data-stream-system-row`) sit on
the whole entry (the line plus its field lines), so a reader of the row
reads both; the 30 px line is `data-stream-line`.
- The compact one-line change text (the activity panel's peek rows, the
creation row's diff) now uses the same label, words and empty word:
`Status: New → Contacted`, where it read `Status New → Contacted` with
`—` for empty.
- `FieldChangeItem` (exported, previously unused) is the line: new
optional `label`, `oldText` / `newText`, `emptyLabel`, `expandLabel` /
`collapseLabel`; with none of them it draws as before except the arrow
is text and the empty word defaults to `(empty)`.

**Language packs** (`ui/packages/i18n/src/locales/*.ts`, 11 locales;
`useDetailTranslation.ts` defaults mirror `en`)
- `detail.fieldChangeLabel` (`{{field}}:`; fullwidth colon in zh-Hans,
zh-Hant, ja; `{{field}} :` in fr), `detail.fieldChangeEmpty` (`Empty`,
`空`), `detail.fieldChangeExpand` (`Show all`, `展开`),
`detail.fieldChangeCollapse` (`Show less`, `收起`).

## Tests

New pins, as top-level describes in the existing harness files:
- `renderers/__tests__/record-activity.test.tsx` — `record:activity —
one line per changed field, old → new (objectstack#36290)`: one field
(`Customer notes: Old words → New words`); phone and email in one save
is ONE row with two lines; empty side reads `Empty`, never `∅`; select,
lookup, user and yes/no read as option label, record names and words;
only the served changes draw (a field left out of the code has no line);
a long value truncates and toggles; the stream fold opens to each save's
own lines; CONTROL: a short value has no toggle, and a row with no code
draws its summary.
- `renderers/__tests__/recordActivityFeed.test.ts` —
`activityFieldChangesOf`: mapping of text, option, boolean and the empty
mark; the item carries the changes beside its summary; no code, another
code, an empty or unreadable code give nothing.

Forced test changes (each because the line format moved from `Label old
→ new` on one element to `Label: old → new` drawn over several
elements):
- `__tests__/recordTimelineStream-27055.test.tsx`: a `changeLines()`
reader over `[data-field-change]`; the six `getByText(/… → …/)` matches
read it instead (a text matcher cannot see a line split over spans). The
negative `queryByText(/New → Contacted/)` was moved too, since it would
have become vacuous. The two creation-diff strings gain the colon.
- `__tests__/RecordTimelinePanel-27524.test.tsx`: the peek line reads
`Status: New → Contacted`.
- `ui/packages/app-shell/src/views/RecordDetailView.harness.test.tsx`:
the audit-date and currency diff readers read `[data-field-change]`
lines, and their expected strings gain the colon (`Close date: 3.3.2020
→ 4.3.2020`, `Amount: €1,500.00 → €2,500.00`). The values themselves are
unchanged.
- `ui/packages/i18n/src/__tests__/untranslated-identity-4376.test.ts`:
`detail.fieldChangeLabel` joins `LEGITIMATE_IDENTITIES` as a format
string (ko/ru/ar keep `:`), like `grid.summary.pattern`.

The permission half is the server's, pinned by PR 1 in
`packages/plugins/plugin-audit/src/activity-field-redaction.test.ts`
(`[objectstack-ai#36290] masked: …`, `[objectstack-ai#36290] not served: the code and the summary
are served without the change of the field not served`, `[objectstack-ai#36290]
control: a reader served every field is served the whole code`). This PR
adds the UI side: the timeline draws only what is served.

## Acceptance notes

- Card lines, as this PR covers them: 「改一条客户的「客户备注」并保存:动态里出现「客户备注:旧文字 →
新文字」。」 — yes (zh-Hans label template `{{field}}:`).
「一次保存同时改电话和邮箱:一条动态,下面两行。」 — yes. 「单选、关联记录、人员字段:前后值显示的是选项名和记录名,不是内部编号。」 —
yes for single select, lookup and user (option label read per reader;
record names as served). 「用一个没有某字段读取权限的账号:动态里没有那个字段的修改行」 — the server
leaves the change out (PR 1); the UI draws what is served. The 「修改历史」
half of that line is part ③.
- Screenshots of the activity: NOT MEASURED in this PR (no local backend
and console build in this run). To reproduce: `OS_PORT=3000 pnpm dev`,
open a showcase record, edit a long text field and, in one save, two
short fields; the record's 动态 tab shows one entry per save with one line
per field; a long value shows `Show all`.
- The empty side is recognised by the writer's text `∅` (or an empty
text), the notation plugin-audit's `summaryValueOf` writes and its tests
pin; the served code carries no separate empty mark. A structural mark
would be a server change, outside this PR.
- Multi-select and `tree` sides still read as the stored text the writer
wrote (PR 1 nits, not taken there either).
- Docs: `ui/AGENTS.md` objectstack-ai#2 asks for the package README and the
`content/docs/frontend/` page; both are outside this dispatch's file
surface, so neither is edited here.
- No change to which entries the activity shows, how consecutive edits
fold, the activity filters, or audit storage.

## Verification

Read first:
1. `ui/packages/plugin-detail/src/renderers/recordActivityFeed.ts` —
`activityFieldChangesOf` (the only new read of server data; the empty
mark).
2. `ui/packages/plugin-detail/src/RecordActivityTimeline.tsx` —
`fieldChangeLinesOf`, `changeSideText`, and `renderSystemLine` (which
entries get lines, and the row-marker move in `streamRow`).
3. `ui/packages/plugin-detail/src/FieldChangeItem.tsx` — truncation, the
measured overflow and the toggle.

Two-minute check: `pnpm --dir ui exec vitest run
packages/plugin-detail/src/renderers/__tests__/record-activity.test.tsx`
— expect 35 passed, among them the eight `one line per changed field`
tests.

Readings below are at head `f281417b` (after merging `origin/main`
once).

<details><summary>Tests (local, under the verify lock)</summary>

- `pnpm --dir ui exec vitest run packages/plugin-detail/ packages/i18n/
packages/app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx`
plus the 22 app-shell `RecordDetailView.*` / record-page activity test
files, at `f281417b`: `Test Files 543 passed | 1 skipped (544)`, `Tests
6159 passed | 31 skipped (6190)`, lock `VERDICT command-exit 0`.
- `pnpm --filter @object-ui/plugin-detail run type-check` and `pnpm
--filter @object-ui/i18n run type-check` (each `tsc --noEmit && tsc -p
tsconfig.test.json`; the test project lists the four edited test files):
exit 0, before the merge.
- `ui`: `check:i18n-keys` 0, `check:i18n-drift` 0,
`check:i18n-dead-keys` 0, `check:new-line-citations` 0 (`0 new
citation(s)`), before the merge.

</details>

<details><summary>Ablation</summary>

Committed head first, then `node scripts/ablation-replace.mjs` replaced
`const lines = fieldChangeLinesOf(item);` in `renderSystemLine` with
`const lines = null …` (anchor 1 → 0, blob `5cc789c3a1d9` →
`0061c6cdd8de`) and ran `record-activity.test.tsx` under the lock:
`Tests 8 failed | 27 passed (35)` — all eight `one line per changed
field` tests red, every older test green. Restored: blob after restore
`5cc789c3a1d9` == HEAD, `git diff HEAD` empty. No `dist` is involved:
the ui vitest config aliases `@object-ui/plugin-detail` to its source.

</details>

<details><summary>Gates</summary>

`node scripts/pm/dispatch-gates.mjs --commands` at `f281417b`: 41
commands, each run with its exit code recorded before any pipe; all 41
exit 0. `--ran`: `Run reconciliation — 41 derived, 41 run, 0
NOT-MEASURED, 0 UNRUN.` CI owns the rest (Lint UI, Type Check UI, Test
UI, the repo-wide lint); not re-run here.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
… write Field change values (objectstack-ai#36290 part 1) (objectstack-ai#36641)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9NRmimMwnUgR1DbqgHtBWM3)_

Part of objectstack-ai#36290

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

- 管理员在 Studio 的字段设置和字段设计器里,原来的「记录历史」开关换成「字段修改值」三选一(默认 / 开 /
关),对象设置的「功能开关」里新增「字段修改值」;普通用户无感。
- 属于记录页「字段修改前后值」专题,落实「默认显示、对象或单个字段可关」的裁决:以前 Studio
写的是不再起作用的旧开关,管理员在界面上关不掉前后值。
- 若出错,管理员可能看到「默认」标成开而动态里实际不显示前后值(或相反),或关掉后回不到默认;改动只在设置界面,可直接撤回。
- 要你做的:无。

## What changes

Card objectstack-ai#36290 part ① (PR 3 of 4; ruling 7076513167 point 1: "Old → new is
shown by default on every object's record page; an object, or a single
field, can turn it off."). PR 1 (objectstack-ai#36399) gave the runtime `fieldHistory`
(field) and `enable.fieldHistory` (object); objectstack-ai#36580 gave the metadata
form a three-way `field-history` widget. The Studio's own producers
still wrote the old key. This PR moves all three named in the release
comment.

**Field inspector** (`ObjectFieldInspector.tsx`, Advanced section)
- The "Track history" box (`value={!!def.trackHistory}`, `patchDef({
trackHistory: v || undefined })`) is gone. Measured reason: since PR 1 a
field's `trackHistory: false` reads like absent and `true` does only
what `fieldHistory: true` does for a media or JSON type (spec describe
of `FieldSchema.trackHistory`), so a second box beside Field change
values could only mislead. A stored `trackHistory` is never written or
removed here; it is still read, because `resolveFieldHistory` reads it.
- New row "Field change values": Default / On / Off over the field's
`fieldHistory`. Default removes the key (`unsetDefKey`, not a patch to
`undefined`); On / Off write `true` / `false`.
- Default names what it resolves to through `resolveFieldHistory` from
`@objectstack/spec/data`, the predicate the activity writer uses. Unlike
the form widget, this rail holds the object document, so it passes the
object: an object with `enable.fieldHistory: false` makes every field's
Default read "Default (Off)", and a note under the row says the object's
off wins.
- The row sits inside the existing `DisplayPatchLock`, so on a read-only
base field it is locked with the same reason as its neighbours
(`fieldHistory` is not on `BASE_FIELD_DISPLAY_WHITELIST`).

**Object settings** (`ObjectSettingsPanel.tsx`, Features card)
- New row "Field change values" (`enable.fieldHistory`), next to "Field
change history" (`enable.trackHistory`). Ticked unless the stored value
is a literal `false`. Unticking writes `false`; ticking again REMOVES
the key (unset already means on, so no `true` the author did not need).
Sibling `enable` keys are kept, as for every other row.
- The Field change history description no longer says "pair with
per-field history tracking to pick which field diffs are summarized" (no
longer true); it points to Field change values.

**Field designer** (`plugin-designer` `FieldDesigner.tsx`, the drawer
behind `MetadataFieldsPage` and the `field-designer` SDUI type)
- The Advanced section's Track History switch wrote `trackHistory:
data.trackHistory === true` on every save, create and edit. It is
replaced by Field Change Values with the same three choices. The update
path no longer names `trackHistory`: a stored value rides the
`...editingField` spread, and a created field carries neither key at
Default.
- Default's label depends on the type, which the author can change in
the same drawer, and a drawer select's options are static. So the choice
is drawn as two rows under form-local names, one per resolved default,
each shown by a `visibleWhen` built from `resolveFieldHistory` over
`DESIGNER_FIELD_TYPES` (with the field's stored `trackHistory`). The
save reads the row shown for the saved type, which is the one on screen
at the click. Neither form-local name reaches the model.
- `DesignerFieldDefinition` (`@object-ui/types`) and its zod mirror gain
an optional `fieldHistory`. Both save paths carry it:
`MetadataFieldsPage` (`toDesignerField` / `fromDesignerField`) and
`MetadataService.toFieldPayload`. Default writes `fieldHistory:
undefined`, which overrides the carried value and is dropped on the
wire, so a stored key is removed. That is the converters' existing
clear-by-absence rule.
- It cannot import `fieldHistoryChoice.ts`, because app-shell depends on
plugin-designer. What it shares is the rule (`resolveFieldHistory` from
`@objectstack/spec/data`). Its own copy of the choice-to-value mapping
is two lines. Its strings are the language-pack keys
`appDesigner.fieldDesigner.fieldHistory`, `fieldHistoryDefault`,
`fieldHistoryOn` and `fieldHistoryOff`, in all 11 locales and the
designer's defaults table. They replace
`appDesigner.fieldDesigner.trackHistory`.

**Shared logic** (`metadata-admin/fieldHistoryChoice.ts`, new): the
three choices, the value each writes and their wording, used by both the
inspector row and the objectstack-ai#36580 `field-history` widget (refactored onto it;
its behaviour and its 10 pins unchanged). The controls stay separate on
purpose: the widget is a `WidgetProps` renderer that sees one form row
and no object; the inspector row is an `InspectorSelectField` with the
inspector's label and lock semantics and the whole object in hand.

**Strings** (studio namespace, en + zh; the other locales fall back to
en by that namespace's design): `designer.field.fieldHistory`,
`designer.field.fieldHistoryObjectOff`,
`engine.studio.settings.capFieldHistory`,
`engine.studio.settings.capFieldHistoryDesc`;
`engine.studio.settings.capTrackHistoryDesc` reworded;
`designer.field.trackHistory` removed with its box.

Not in this PR: record-page rows (part ②, landed as objectstack-ai#36613), the
per-field history card (part ③).

## Tests

- New `ObjectFieldInspector.fieldHistory-36290.test.tsx` (7): Default
(On) for a one-line type; Default (Off) for image / json / password and
Default (On) once `trackHistory: true`; Off writes `false`, On writes
`true`; Default after Off removes the key; no Track history box, no
`trackHistory` written, a stored one kept; the object's off makes
Default (Off) and shows the note; control: no note otherwise.
- New describe in `ObjectSettingsPanel.test.tsx` (4): checked for unset
and `true`, unchecked only for `false`; untick writes `false` with
siblings kept; re-tick removes the key with siblings kept; labelled by
its own title.
- New `FieldDesigner.fieldHistory-36290.test.tsx` (9), on the real
`FieldDesigner` with a drawer double that captures its schema and calls
its own `onSuccess`. The cases: two rows and no Track History row, with
the labels; for every designer type exactly one row's `visibleWhen`
evaluates true (through `evalFieldPredicate`, the form's own evaluator),
and it is the one `resolveFieldHistory` names; a stored `trackHistory:
true` moves a media type to the Default (On) row; an untouched edit
writes neither key; Off writes `false`, On on a media type writes
`true`; a stored `false` opens as Off and Default removes it; a stored
`trackHistory` is kept; a type changed in the drawer saves what is on
screen; a created field at Default carries neither key.
- New `MetadataFieldsPage.fieldHistory-36290.test.tsx` (4), on PUT bytes
through the real page and a real `MetadataClient`. A stored
`fieldHistory: false` survives and no `trackHistory` is written; a
stored `trackHistory: true` survives and gains no `fieldHistory`; a
field with neither key gains neither; every PUT field parses through
`FieldSchema`.
- Extended: `MetadataService.fieldKeyCarryOver.test.ts` adds
`fieldHistory` to its populated entry and its clearable keys;
`designer-zod-arms-10859.test.ts` adds `fieldHistory` to the fully
populated `field-designer` document.
- Forced test changes:
`ObjectFieldInspector.displayPatchReason-28986.test.tsx` names the Field
change values combobox instead of the removed Track history checkbox
among the locked controls;
`ObjectSettingsPanel.businessWording-36512.test.tsx` lists
`enable.fieldHistory` among the keys the tab writes.
`ObjectFieldInspector.externalIdNotOffered-26674.test.tsx` and
`ObjectFieldInspector.retiredIndexed.test.tsx` listed Track history
among the Advanced siblings that still render; they name Field change
values, and (being edited) now pay the formula and lint loads at module
top, as `check:test-source-alias` requires.
`FieldDesigner.externalIdNotOffered-26674.test.tsx` and
`MetadataFieldsPage.externalIdRoundTrip-26674.test.tsx` used the Track
History row as their positive control; they now use the Field Change
Values row.


## Acceptance notes

- The field designer's Default label follows the drawer's type and the
object is not in hand, so an object with `enable.fieldHistory: false` is
not reflected there, the same accepted bound as objectstack-ai#36580's widget. Neither
`FieldDesigner` nor `MetadataFieldsPage` is mounted by the Console
today; both are published exports, and `field-designer` is a registered
SDUI type.
- A stored field `trackHistory: true` on a media or JSON type makes
Default read "Default (On)"; such a field can still be turned off with
Off, but not returned to the type's off-by-default without editing the
key in the form. That is the resolver's answer, not a UI choice.
- `ui/AGENTS.md` objectstack-ai#2 (package README and `content/docs/frontend/` page)
not edited: outside this part's file surface.
- Screenshots NOT MEASURED (no Console build or backend run here).

## Verification

Read first, by risk:
1. `ui/packages/plugin-designer/src/FieldDesigner.tsx`: the
`fieldHistoryRows` memo (two rows, `visibleWhen` built from
`resolveFieldHistory`) and `fieldHistoryFromForm`, which picks the row
for the SAVED type on both save paths.
2.
`ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx`:
`patchEnable` with `unsetWhenOn` (re-ticking removes
`enable.fieldHistory`, keeps siblings).
3.
`ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.tsx`:
the Field change values row and the object-off note inside
`DisplayPatchLock`.

Two-minute check: open Studio, an object, Settings, Features: "Field
change values" is ticked. Untick, save, and reopen the object JSON: it
shows `enable.fieldHistory: false`. Tick again: the key is gone. Then
open a field's Advanced section: "Field change values" reads "Default
(Off)" with the note under it.

<details><summary>Runs (local, head 3b5b130 after merging origin/main
9e2a4ac)</summary>

- Builds under the verify lock: the
`@objectstack/{spec,formula,lint,client,sdui-parser}` closure, and
`@object-ui/app-shell^...` again after the merge (VERDICT command-exit 0
each).
- `type-check` (tsc plus `tsconfig.test.json`) of
`@object-ui/app-shell`, `@object-ui/i18n`, `@object-ui/types` and
`@object-ui/plugin-designer`: all four Done, exit 0 (after the merge;
plugin-designer again at 3b5b130).
- Post-merge union at ffa608d: `vitest run
packages/app-shell/src/views/metadata-admin/inspectors/
packages/app-shell/src/views/studio-design/ObjectSettingsPanel
packages/app-shell/src/views/metadata-admin/FieldHistoryWidget-36482.test.tsx
packages/app-shell/src/views/metadata-admin/SchemaForm
packages/plugin-designer/ packages/types/
packages/app-shell/src/services/ packages/i18n/
packages/app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx`
gave Test Files 851 passed (851) and Tests 16838 passed, 14 skipped.
3b5b130 changes only the designer pin's types; that file re-run: 9/9.
- Pre-merge union at 3fa510b (`metadata-admin/`, `studio-design/`,
`i18n/`) gave Test Files 1232 passed and 2 failed (1234). The 2 were
sibling pins still naming Track history, fixed in 58cef60.
- Ablations, each through `scripts/ablation-replace.mjs` (anchor 1 to
0), restored with blob equal to HEAD and `git diff HEAD` empty:
- The inspector writes `trackHistory` again: 2 of 7 new inspector pins
red.
- The settings switch writes `true` instead of removing the key: 1 of 14
red.
- The designer's update path writes `trackHistory: data.trackHistory ===
true` in place of `fieldHistory`: 7 of 13 red across the two new
designer files.
- `dispatch-gates --commands` at 3b5b130 derived 42 families; all 42
ran locally with exit 0; `--ran` reconciliation gives "42 derived, 42
run, 0 NOT-MEASURED, 0 UNRUN".
- `overlap-check` at 3b5b130: VERDICT clean exit 0 against origin/main
d7411fa (three commits past the merged 9e2a4ac; `git merge-tree` is
also clean) and objectstack-ai#36634, objectstack-ai#36629, objectstack-ai#36606, objectstack-ai#36587, objectstack-ai#36525.
- ui extras: `check:new-line-citations` 0, `check:i18n-keys` 0,
`check:i18n-drift` 0, `check:i18n-dead-keys` 0. eslint on the changed
source and test files: 0 errors, and no warnings on added lines.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht

---------

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 size/l 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