Repository navigation
feat(audit): the activity stream shows each changed field's old → new values by default, served only for fields the reader may read - #36399
Conversation
…em off (#36290) Claude-Session: https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw Co-authored-by: Claude <noreply@anthropic.com>
…rackHistory keeps its meaning (#36290) Claude-Session: https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw Co-authored-by: Claude <noreply@anthropic.com>
…pec references (#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>
…y switch (#36290) Claude-Session: https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 10 package(s): 24 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 6 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 184 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 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
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 REWORK · head 维护者速读
要改的(1 项)
席位核对(本轮已读,增量时不重读)
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: 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 ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
M1 (must-fix) — The new contract reads a stored field
S1 (should-fix) — The object form adds
Implementing files
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: 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>
…eldHistory (#36290) 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>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta review of ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Implementing files
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: VERDICT: PASS |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 REWORK(增量)· head 维护者速读
要改的(1 项)
增量核对(
|
… row (#36290) Claude-Session: https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 ACCEPT(增量)· head 维护者速读
增量核对(
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45041073820 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jRCdMrPNTumXfsr1mw Queue build 45041073820, red in Test UI (5/16): Generated by Claude Code |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Re-landing (seat 7, 2026-11-22T16:27Z): same head |
…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>
…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>
…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>
…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>
…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>
… 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>
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才显示值,其余修改只写字段名。新开关没有默认值,所以已构建或已存储的对象升级后直接生效,不需要重新构建。trackHistory: false(对象上或字段上)都不再关闭值显示。要关闭,对象请写enable.fieldHistory: false,字段请写fieldHistory: false。字段设计器以前每次保存都会写trackHistory: false,所以这个值不能当作关闭开关;仓库内 44 个平台对象已补上对象级开关。What changes
Spec (
packages/spec/src/data/object.zod.ts,field.zod.ts, forms):ObjectCapabilities.fieldHistory: z.boolean().optional()with no default. Absent: values show.false: values off for the object. It has no default on purpose:ObjectSchema.parsematerializes every defaultedenablekey whenever anenableblock exists, so a default would be written into every built artifact and stored definition (measured: 33 of 38 hotcrm objects carry anenableblock). With no default, an upgraded install gets values with no rebuild.enable.trackHistorykeeps its schema and meaning (defaultfalse; withtruethe default record page reads the compliance ledger and the derivedhistoryverb is served). Its describe now says that value display isfieldHistory's question.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 withenable.fieldHistory: false, values stay off whatever the field says.trackHistorykeeps its schema.falsenow reads like absent (values show): the field designer wrotetrackHistory: falseon every save while the key meant nothing (FieldDesigner.tsx, persisted byMetadataFieldsPage.tsx), so a storedfalsecannot be told from a choice.truekeeps one job: it opts a media or JSON field in.enablecomposite offersfieldHistory; the object form'sfieldsrepeater and the field form offer the fieldfieldHistory. Each row's help text says that unset means on, although the switch shows off. Liveness entriesobject.json#fieldHistoryandfield.json#fieldHistory(live, evidenceaudit-writers.ts#changeValuesShownFor).FieldSchemakey classify the new key: driver-sqlFIELD_KEY_STORAGE_CLASS(presentation:createColumnnever reads it) and metadata-coreFIELD_REFERENCE_POSITIONS(keep: a boolean that names no field). The metadata-protocolfieldproperty count moves 84 → 85.Writer (
packages/plugins/plugin-audit/src/audit-writers.ts):changeValuesShownFor(objectDef)decides per changed field: off when the object writesenable.fieldHistory: false, or the field writesfieldHistory: false, or the field is a credential (collectMaskedReadFields:secret, andpasswordoff 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 explicitfieldHistory: trueortrackHistory: true. Everything else is on, including a field that writestrackHistory: false.renderTrackedChangeSummaryandplanTrackedLookupReadstake that predicate instead of readingtrackHistory === true.sys_activity.summary'smaxLength(500) byfitStoredChangeSummary: 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. Thesummary_messagecode keeps every change, each side capped at 1,000 characters.Read side (
activity-field-redaction.ts,activity-summary-message.ts,audit-plugin.ts):fieldChangescode (metadata.summary_message) is now served to readers, narrowed change by change with the sameresolveServedFieldsanswer asmetadata.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, andtext_sourcesstays stripped.44 in-repo objects that wrote
trackHistory: falsenow also writefieldHistory: false, so their "no history" holds: cloud-connectionsys-cloud-binding-credential; metadata-coresys-metadata-audit,sys-metadata-commit,sys-metadata-history; platform-objectssys-attachment, identitysys-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, systemsys-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-auditsys-activity,sys-audit-amendment,sys-audit-checkpoint,sys-audit-log,sys-audit-signing-key,sys-comment-reaction; plugin-sharingsys-share-link; service-automationsys-connector-connection,sys-connector-credential,sys-flow-credential; service-messagingchannel-account,channel-user-link,user-device; service-realtimesys-presence. hotcrm at689166c: 0 objects writetrackHistory: false(reported to the seat; nothing pushed there).Files that moved because the default flipped (approved by the seat as growth within the ruling):
packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts): the newenable.fieldHistorylabel, and the twotrackHistoryhelp 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 fieldfieldHistoryrow 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) andobject-lifecycle-panel-echo-decisions.test.ts(positive control 756 → 759).field-history-tracking-activity.dogfood.test.ts, whose website-only leg pinned the label-only frame and now readsWebsite: https://before.example → https://after.example(why:websitedeclares notrackHistory, so it is on).activity-label-display-field.dogfood.test.ts: itsREF_TITLEDfixture getsenable: { 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 beName: 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.records-forms.field-history-trackingrev 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.protocol/objectql/security.mdx§7,data-modeling/objects.mdxflag table,data-modeling/fields.mdxanddata-modeling/validation-rules.mdxtrackHistoryrows. Why: each said values were opt-in.Review round 1 (L2 7078144432 FAIL, L1 7078132570 REWORK)
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 withincludeRetired: trueand no version window. So a conversion that drops fieldtrackHistory: falsewould also erase every deliberate opt-out saved after the upgrade, on every load. WithfieldHistoryas the off switch, a storedtrackHistory: falsereads like absent, so fields already saved through the designer show values after the upgrade with no conversion. Census: no code-authored field inpackages/**orexamples/**writestrackHistory: false; all 45 occurrences are object-levelenableblocks (44 objects plus a comment).fieldHistoryrow and the fieldtrackHistoryrow now have help text. Renderer, read at this head:SchemaForm.tsxdraws a boolean as<Switch checked={!!value} onCheckedChange={(c) => onChange(c)} />. So an untouched switch writes nothing, and only a toggle writestrueorfalse. It cannot show unset apart fromfalse: an unsetfieldHistoryshows as off while values show. The help text says this. A third state is a renderer change that no PR on this card carries.enable.fieldHistory: falsewins over a fieldtrue(pinned). Not taken:treechanges 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.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 fieldtrackHistory: falseas the field's off switch. At this head it is fieldfieldHistory: false, and the seat owns that card's text.Census: every reader of
enable.trackHistory(seat rider)None of these reads changes meaning, because
trackHistoryis untouched:packages/spec/src/data/api-derivation.ts(historyverb,=== true).RecordDetailView.tsx(historyEnabled:!== true→ no ledger read);appObjectScope.ts(recordStreamObjectNames,=== true);ObjectSettingsPanel.tsx(opt-in toggle; writes an explicit boolean; afieldHistorytoggle is PR 2).plugin-approvalsapproval-service.ts(type only); cliexplain.ts(doc example); metadata-coreobject-schema-fls-references.ts(key list).trackHistoryis an unrelated loader option; driver-sqlbuiltin-column-collisionis a name map; hotcrm has comments only.FieldDesigner.tsxwritestrackHistory: data.trackHistory === trueon create and edit (so every save writes an explicitfalse), andObjectFieldInspector.tsxreads!!def.trackHistory. Since this head thatfalsereads like absent, so it no longer changes behaviour. PR 2 moves both producers tofieldHistory.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: falsealone → still on (the upgrade note); fieldfieldHistory: false→ label only; fieldtrackHistory: false(what the designer wrote) → values still show; objectenable.fieldHistory: falsewins over fieldfieldHistory: true;jsonwithfieldHistory: true→ on; credential → label only;json→ only withtrue; 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-fieldChangescode 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 parsedenableblock carries nofieldHistorykey, andfalsesurvives parse.fieldHistory: falseorenable.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 (#36425showOnCreate) landed. Against main, the PR's diff changes in two places only: the metadata-protocolfieldcount (85 → 86) and the generated liveness count (field115). Re-run ataa362ba1: metadata-protocol pin 18, driver-sql closure 11, metadata-core FLS 63, platform-objects translations 610, specsrc/data6713, plugin-audit writers + redaction 181,check:generated, checklist and i18n-bundle checks all pass. Before that,d531553awasc43a42bbplus one changeset line naming@objectstack/driver-sqlat patch (L1 7080045587); the figures below were measured atc43a42bb, and this commit changes no source. Round 2 (6e416547the field key,17772933the metadata-protocol count,c43a42bbthe two key closures) on top of round 1 (851997e6).src/data187 files / 6708 passed; platform-objects translations 610 passed; metadata-core full suite 27 files / 1048 passed; driver-sqlbuiltin-column-collision2 files / 18 passed; metadata-protocolmeta-types-degenerate-derivation18 passed; lintvalidate-security-posture+rule-explanations232 passed; clidata-model-rules65 passed; service-messaging and metadata-corebuiltin-column-storage-attributes18 passed.git diff HEADempty after): removing the fieldfieldHistory === falsecheck ofchangeValuesShownForreds 4 tests inaudit-writers.test.ts; making fieldtrackHistory: falsean off switch again reds thedesigner_savedpin; removing the driver-sqlfieldHistoryrow redsclassifies EVERY FieldSchema key, and invents none. Round 1's ablations (per-change narrowing 9 of 40,enable.fieldHistorybranch 8 of 139) still hold.dispatch-gates --commandsat 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 at17772933, fixed inc43a42bb.c43a42bb, after rebuilding driver-sql and metadata-core under the verify lock (build VERDICT command-exit 0):vitest runlock VERDICT command-exit 0, Test Files 484 passed / 3 skipped (487), Tests 4107 passed / 68 skipped (4175), no failures. The same battery at6e416547+17772933gave the same counts.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-checkataa362ba1: clean againstorigin/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 generatedliveness/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:
packages/plugins/plugin-audit/src/activity-field-redaction.ts: the per-change narrowing ofsummary_messageand the recomposed summary.packages/plugins/plugin-audit/src/audit-writers.ts:changeValuesShownForandfitStoredChangeSummary.packages/plugins/plugin-audit/src/audit-plugin.ts: the middleware order.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jRCdMrPNTumXfsr1mw