Skip to content

feat(record-page): one field's change history, from the field and from a list cell's menu - #36661

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-apg8e0
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-apg8e0

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #36290
Fixes #36615

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

Part 3 of the card, the last one: the per-field change history, its two entry points and the read-permission rule (card items 3, 4 and the 修改历史 half of item 5). Part 1 (#36399) made the server serve each changed field's old → new values narrowed per reader; part 2 (#36613) drew them under the record's activity entries; part 1 of the Studio producers (#36641) moved them to fieldHistory. Ruling-ref: 7076513167 — a value the viewer cannot read is never sent to the browser, and the sys_audit_log grant is never widened. #36615 rides along: it is the one sentence in packages/spec that still told authors to write trackHistory: true.

维护者速读

  • 记录页上会记录修改前后值的字段,值旁边多了一个「修改历史」小按钮(鼠标移上去或键盘聚焦时出现),列表里在这类字段的格子上右键也多了「修改历史」;点开就地弹一张小卡片,列出这一个字段改过几次、谁改的、什么时候、从什么改成什么,最新的在上,先给十条,可以继续加载。没开修改历史的字段(比如图片、附件、密码,或被设置关掉的字段)不显示这个入口。
  • 属于「记录详情页重做」专题里的字段修改历史,这是最后一段:前几段让服务器把前后值按权限发出来、在动态里画出来,这一段让人能只看一个字段的历史。
  • 出错时,用户会看到卡片排版不对或加载不出来;不会多看到任何没权限的字段,因为没有读取权限的字段既不显示入口、服务器也本来就不发值;可以整体撤回,数据不受影响。
  • 无

What changes

The card (ui/packages/plugin-detail/src/FieldHistory.tsx, new)

  • FieldHistoryCard lists one field's changes on one record: who · when over old → new, newest first, the newest ten with Load more. The values are worded exactly as the activity lines word them — an option by the field's option label in the reader's language, a yes/no by the pack's word, an empty side by the pack's word for empty — through one new shared hook (fieldChangeText.ts, useFieldChangeWording), which RecordActivityTimeline now reads too, so the two surfaces cannot word the same change apart.
  • A field never changed: No changes recorded, with who created the record and when, read off the record's created activity row.
  • A refused read (401 / 403) says the reader may not see this record's activity; any other failure says the activity could not be loaded.
  • useFieldHistory reads sys_activity by record, newest first, fifty rows at a time ($skip / $top), keeping the rows whose served change code names the field. One user action — the open, or one Load more — reads at most FIELD_HISTORY_SCAN_BATCHES_PER_LOAD (4) batches: it stops sooner when it has the page it shows or the rows run out, and otherwise stops there and offers Load more to read on. When those batches held no change of the field and older rows remain, the card says No changes in the recent activity (new key detail.fieldHistoryNoneRecent); No changes recorded needs every row read. A row repeated by a $skip shifted under a concurrent write is kept once. It reads no change column, because a query naming one is refused for a reader withheld any field of the object (parent-field-query-guard.ts), and it never reads sys_audit_log.

The two entry points

  • The record page: FieldHistoryButton, a history icon beside the value in DetailSection, revealed on hover and on keyboard focus like the copy button, opening the card in a popover. Drawn only for a field the object declares, on the page's own record, and only when fieldHistoryOffered says so: not a platform record column (id, created_at, …), not a field whose old → new values the writer never records (resolveFieldHistory(field, object) from @objectstack/spec/data, the one predicate plugin-audit's changeValuesShownFor keeps values by — false for fieldHistory: false, object enable.fieldHistory: false, a credential field, and a default-off type such as image, file or JSON that does not opt in), and not a field the reader may not read (checkField(object, field, 'read')).
  • The list: data-table now names the data cell a context menu opened on to its host (context.column, a new optional member of the context renderRowContextMenu receives — a data-cell-column attribute on the cell), ObjectGrid adds Change history for a cell of a declared field that fieldHistoryOffered accepts (recorded and readable, the same gate as the record page) when its data source can read activity, and choosing it opens the same card at the pointer (FieldHistoryPopover).
  • FieldChangeItem draws no label for label: '', so the card can name the field once above its lines.

packages/spec — the unknown-key guidance row for the mistyped field key tracked now names fieldHistory: false (and enable.fieldHistory: false on the object) instead of trackHistory: true, which after #36399 changes nothing for most field types. Wording only: tracked stays rejected, no key, shape or default moves.

Language packs — detail.fieldHistory, detail.fieldHistoryNone and detail.fieldHistoryNoneRecent in all 11 locales @object-ui/i18n ships, mirrored byte-identically in DETAIL_DEFAULT_TRANSLATIONS.

Tests

New pins at head c429064ab8:

  • ui/packages/plugin-detail/src/__tests__/FieldHistory-36290.test.tsx (13): only this field's changes, newest first, with actor and timestamp; a save of two fields gives this field's line alone; the read names no change column ($filter is the record, and the params hold no changed_fields / metadata); an option side reads as its label and an empty side as Empty; the newest ten, then Load more to the rest; paging past a full batch of another field's rows to find this field's changes (two reads, the second $skipped); one open reads exactly 4 batches on a record whose field change lies past them, says No changes in the recent activity (not No changes recorded), reads nothing more without a click, and Load more reads the fifth batch at $skip 200 and finds the change; never changed → No changes recorded with the creator and the creation time; a refused read. For the entry point: every declared field offers it and created_at does not, nothing is read until it is opened, a field the reader may not read has no entry (CONTROL: the readable sibling keeps it), a field whose values are not recorded has no entry — fieldHistory: false, a json field, a password field (CONTROL: a json field with fieldHistory: true keeps it) — an object with enable.fieldHistory: false offers none (CONTROL: the same object without it offers both), and a section not drawing the page's record offers none.
  • ui/packages/plugin-grid/src/__tests__/fieldHistoryCellMenu-36290.test.tsx (5): the cell's menu item opens that record's changes of that field (and the read is scoped to that record); a field the reader may not read has no column, so no cell offers it (CONTROL: a readable field's cell still does); a host-joined column the object does not declare offers none; a cell of a fieldHistory: false field opens no row menu at all on a table with no row actions (CONTROL: a recorded field's cell offers it); a data source that cannot read activity offers none.
  • ui/packages/components/src/renderers/complex/__tests__/data-table-row-context-menu-28434.test.tsx: the existing host-renderer pin now asserts column, plus one new case — the column of the data cell the menu opened on, and no column off a data cell (the row's "⋮" cell).
Runs
# the two new pin files, at c429064ab8
Test Files  2 passed (2)   Tests  18 passed (18)

# affected packages at c429064ab8, under scripts/pm/os-verify-lock.sh (plugin-detail, plugin-grid, i18n,
# types, components/renderers/complex, app-shell defaults-maps-mirror-en-pack)
os-verify-lock: VERDICT command-exit 0
Test Files  1260 passed | 1 skipped (1261)   Tests  19388 passed | 31 skipped (19419)
# + app-shell RecordDetailView.harness and the i18n call-site parity suite
Test Files  2 passed (2)   Tests  234 passed (234)

# packages/spec (the tracked row; no spec file moved since 975c4c5576)
packages/spec src/data/field.test.ts   Test Files 1 passed   Tests 308 passed (308)

# type-check at c429064ab8, exit 0 each: plugin-detail, plugin-grid, i18n (components, types unchanged since 975c4c5576, exit 0 there)

# dispatch-gates at c429064ab8: the same 117 derived commands as at 975c4c5576 (diffed), re-run, 117/117 exit 0

Ablations through scripts/ablation-replace.mjs (anchor hit and blob move printed by the tool; each restored, git diff HEAD empty and the file's blob equal to its HEAD blob afterwards):

Mutation Result
the read-permission gate in fieldHistoryOffered removed 1 red: a field the reader may not read has no entry
the batch read always marks itself exhausted 1 red: pages past rows of other fields until it finds this field's changes
the card keeps the first served change instead of the one naming the field 3 red, the field-identity pins
at c429064: the resolveFieldHistory gate in fieldHistoryOffered made a no-op 3 red: the two record-page history-off pins and the grid's
at c429064: the per-action batch cap removed (needsRead = wantsMore) 1 red: one open reads at most 4 batches, then "Load more" reads on

Acceptance notes

  • Rework after contract review 7097637110 (FAIL, two should-fix, no must-fix): S1 the entry points are now gated by resolveFieldHistory, so a field whose values are never recorded offers no history instead of a card that would say 「No changes recorded」 of a changed field; S2 the scan is bounded per user action as described above, and this body now says what the code does; the changeset's Clause-② line names the exported constants and the third key. The two notes taken as well: a row repeated by a shifted $skip is kept once. Not taken: the keyboard-opened cell menu path stays unpinned (as the review noted); a data source that ignores $skip now stops after four reads per click instead of looping until the card closes.
  • Card lines this PR covers: 「在记录页「客户备注」上打开修改历史:列出历次修改,和动态里的一致。」 — yes, and worded by the one hook both surfaces now read. 「在列表的格子上右键「修改历史」:同一张卡片。」 — yes. 「一个没改过的字段:显示「没有修改记录」和创建信息。」 — yes. 「用一个没有某字段读取权限的账号:…那个字段上也没有「修改历史」。」 — yes, pinned on both entry points; the 动态 half landed in feat(record-page): each changed field is its own line under an activity entry, old → new #36613.
  • Not done, as the card says: 「不做「恢复到某个历史值」」, no change to how the audit log is stored or kept, no change to the 动态 tab's grouping or filters.
  • The card's unchecked note on per-field reads is now measured, not assumed: there is no server-side per-field history read, and adding one would mean a query over a change column, which parent-field-query-guard.ts refuses for exactly the readers this feature is for. So the card reads the record's rows in batches of fifty, at most four batches (200 rows) per open or 「Load more」. On a record with thousands of activity rows and a field changed rarely, each click reads the next 200; a server-side per-field door would be a separate Feature card, not this one.
  • The FieldChangeItem line inside the card clamps each side to its line and offers Show all, as the activity lines do.
  • ui/AGENTS.md ✨ Set up Copilot instructions #2's second half: the two package READMEs and the two content/docs/frontend/plugins/*.mdx pages are updated in this PR.
  • Screenshots: below, driven in the running Console (examples/app-showcase + apps/console) as the seeded admin, on showcase_account. GitHub's image store takes uploads only from the browser, and ui/AGENTS.md 🔗 Broken links detected in documentation #185 forbids committing screenshots into the tree, so they are described here and handed to the requester in the thread; the frames themselves are in the project files.

Screenshots

Taken at 975c4c5576. The rework leaves these frames as they are: every field shown is a text or email field, whose values are recorded, so the gate still offers it; the batch cap shows only on a record with more than 200 activity rows. Driven at 1440×900, deviceScaleFactor: 2, record Stark Industries, field Billing Email (edited three times: ap@… → accounts.payable@… → billing@…).

  1. The button — hovering the Billing Email row reveals a history icon beside the existing copy icon; nothing else about the row moves (1-field-history-button.png, crop …-crop.png).
  2. The card, from the field — clicking it opens a popover anchored to the value: a header Billing Email / Change history, then Dev Admin · Nov 23, 2026, 10:01 AM over accounts.payable… struck through → billing@sta… with Show all, and the older change under it, newest first (2-field-history-card.png).
  3. The list's entry point — a right-click on the Account Name cell of Stark Industries lists Change history between Open in new tab and Edit, with the same history icon (3-cell-context-menu.png).
  4. The card, from the cell — choosing it opens the same card at the pointer, headed Account Name, listing that record's four changes of that field, newest first (4-cell-field-history-card.png).
  5. A field never changed — on a record created through the API, Tax ID's card reads No changes recorded over Created by Dev Admin · Nov 23, 2026, 10:03 AM (5-never-changed.png).

A note worth having on the record: on a seeded row the same empty card shows No changes recorded with no creator line, because the seed writes no created activity row and the card states only what the server served it — it does not fall back to created_by, which is a column the reader may be withheld.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQwxbZFiKZ188iQxqGgmnY

…m a list cell's menu

The tracked authoring hint names fieldHistory.

Claude-Session: https://claude.ai/code/session_01JQwxbZFiKZ188iQxqGgmnY
Co-Authored-By: Claude <noreply@anthropic.com>
…oints and the cell column; docs and changeset

Claude-Session: https://claude.ai/code/session_01JQwxbZFiKZ188iQxqGgmnY
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl 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 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 1 documentable anchor(s).

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

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

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

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

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

What this run could not see
  • 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 — 175 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 6a731859def47e2c8cefcab4d635a1c45c60c2c1 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 6a731859def47e2c8cefcab4d635a1c45c60c2c1

⚠️ 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 6a731859def47e2c8cefcab4d635a1c45c60c2c1 → 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#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 975c4c55761d4408a7dbcfd7a57098689cf02639
Local-runs: none
Scope: the full diff from merge-base 3cf6a44bee to head (32 files: .changeset/36290-field-change-history-card.md, packages/spec/src/data/field.zod.ts, field.test.ts, ui/packages/types/src/data-display.ts, ui/packages/components/src/renderers/complex/data-table.tsx and its test, ui/packages/plugin-detail/src/ FieldHistory.tsx, fieldChangeText.ts, FieldChangeItem.tsx, RecordActivityTimeline.tsx, DetailSection.tsx, index.tsx, useDetailTranslation.ts and the new test, ui/packages/plugin-grid/src/ ObjectGrid.tsx, RowContextMenu.tsx and the new test, 11 locale files, 2 READMEs, 2 mdx pages) + cited at head: packages/plugins/plugin-audit/src/activity-field-redaction.ts, parent-field-query-guard.ts, audit-writers.ts, packages/spec/src/data/field-history-default.ts, object.zod.ts, ui/packages/plugin-detail/src/renderers/recordActivityFeed.ts, record-activity.tsx, ui/packages/data-objectstack/src/index.ts, scripts/check-changeset-no-major.mjs; card #36290, ruling comment 7076513167, card #36615, the PR body
Security-touching: yes
Rule-change-verified: none

① Derived judgments

  • Published surface. It matches the list. @object-ui/plugin-detail adds FieldHistoryButton, FieldHistoryCard, FieldHistoryPopover, fieldHistoryOffered, useFieldHistory, useFieldHistoryOffered, FIELD_HISTORY_PAGE_SIZE, FIELD_HISTORY_SCAN_BATCH and seven types. @object-ui/types adds the optional column? on the renderRowContextMenu context. Two detail.* keys land in all 11 locales and in DETAIL_DEFAULT_TRANSLATIONS. Nothing is removed or renamed.
  • column? under strict TS. No implementer breaks. An existing host typed (row, ctx: { selected: boolean }) still accepts the wider argument. data-table passes the bare { selected } object when there is no column, so an exact-match assertion in a host test also keeps passing off a data cell. The one in-repo assertion that changed (data-table-row-context-menu-28434) changed because the test right-clicks a data cell.
  • FieldChangeItem with label: ''. This is a behaviour change, not only an addition: before, '' drew an empty label span and a space. The changeset declares it. No in-repo caller passed ''.
  • field.zod.ts. Only the tracked row of the unknown-key guidance table moves. No key, shape or default moves, and no generated baseline carries the old sentence (git grep for it at head is empty).
  • The new text is true. resolveFieldHistory (packages/spec/src/data/field-history-default.ts) returns false for enable.fieldHistory === false on the object, false for fieldHistory === false on the field, and true for fieldHistory === true on a default-off type (image, file, json and the rest). The writer (audit-writers.ts, changeValuesShownFor) uses that one predicate. The field and object .describe() texts say the same. The hint leaves out that a credential field never shows values; that is fine for a one-line hint.
  • field.test.ts pins it. The new case asserts the message keeps tracked rejected, contains fieldHistory: false, does not contain trackHistory: true, and that fieldHistory: false really parses. A sibling unknown key is the control.
  • Declarations. Clause-②: yes (widening) is true. Metadata-protocol: none is true: the spec change is wording, and DataTableSchema.renderRowContextMenu is a host function hook, not authorable metadata.
  • Note: the changeset's Clause-② line does not name the two exported constants (FIELD_HISTORY_PAGE_SIZE, FIELD_HISTORY_SCAN_BATCH). They are exported and documented in code. Add them to the line.

② Semver level

  • All six entries are patch: @object-ui/plugin-detail, @object-ui/plugin-grid, @object-ui/components, @object-ui/types, @object-ui/i18n, @objectstack/spec. scripts/check-changeset-no-major.mjs requires every entry patch under a declared none, and forbids major. Both hold.
  • @objectstack/spec at patch is right for a wording-only hint under none.
  • Every package whose published source moves is graded. The docs pages are not a package.

③ Boundary flags

  • Entry absent without read. fieldHistoryOffered refuses when perms.isLoaded and checkField(object, field, 'read') is false. That is the field's current read permission, as item 5 and the ruling require. Pinned on the record page by a field the reader may not read has no entry with a readable control, and the PR's ablation of the gate turns that test red. Note: on the grid the pinned case passes because the unreadable field has no column at all, so the fieldHistoryOffered call in ObjectGrid is not pinned on its own. Note: before permissions load the entry is offered (fail-open on the button only); the server narrowing below is the floor, so no value leaks.
  • Values never sent. Confirmed in server code this PR does not touch. packages/plugins/plugin-audit/src/activity-field-redaction.ts, lines 762-793: each metadata.summary_message change of a field outside the reader's served set is dropped, a reference change is kept only when the reader is served the target's title, and an unreadable code is dropped. metadata.old / metadata.new are narrowed key by key just above, and the summary text is re-composed from the kept changes (line 819). An unexpected failure strips every value-bearing column. The card reads only that narrowed code (activityFieldChangesOf). It never reads sys_audit_log, so the ledger grant is not widened.
  • The query. The read is sys_activity filtered by object_name and record_id, ordered by timestamp, with $expand: ['actor_id']. That is the same shape record-activity.tsx already sends. It names none of the guarded columns (summary, record_label, metadata, changed_fields, milestone_key in parent-field-query-guard.ts), and a test pins that.
  • Pagination. Newest first, ten shown, Load more adds ten. Correct.
  • should-fix (S2): the scan has no bound per user action. useFieldHistory keeps reading batches of fifty until it has ten changes or the record's rows run out. It does terminate, and closing the card cancels it. But one open of a never-changed or rarely-changed field on a record with N activity rows fires about N/50 sequential offset reads with no click in between. The PR body says Load more pages through them; the code does not wait for Load more. Cap the batches read per action and let Load more continue, or state the real cost and get it accepted.
  • Note: $skip paging while a new activity row is written can re-read one row, which gives a duplicate entry and a duplicate React key. A data source that ignores $skip would loop until the card closes; the ObjectStack adapter honours it.
  • No changes + creator. The empty state needs the scan exhausted, then shows the creator and time from the record's created activity row. A seeded record has no such row, so no creator line shows. It does not fall back to created_by, which the reader may be withheld. Sound, and by design.
  • RecordActivityTimeline refactor. No behaviour removed. labelOfField and changeSideText moved into useFieldChangeWording line for line; the option, display, yes/no and empty branches are unchanged.
  • data-table column. The cell carries data-cell-column; the handler reads the closest one from the event target. The selection cell and the row's own menu cell carry none, so column is absent there, and a test pins the menu cell. A keyboard menu opened on a focused data cell does carry the column; that path is not pinned. Note.
  • No test weakened. The one changed assertion became stricter.

④ Design judgment

  • should-fix (S1): the entry is offered on fields whose history is off, and the card then says something false. The writer records old → new only for a field where resolveFieldHistory is true. For a field with fieldHistory: false, an object with enable.fieldHistory: false, a default-off type (image, file, json, address and the rest) or a credential field, no change ever reaches the card. The button and the menu item still show, and the card reads 「No changes recorded」 with the creator, even after the field was changed many times. Card item 4 keeps that sentence for a field never changed. Gate both entry points with resolveFieldHistory(field, object) from @objectstack/spec/data (the UI already imports it in app-shell), and pin it.
  • Note: two more cases read 「No changes recorded」 for a changed field: a save that fired a milestone (the writer stores the milestone sentence, not the field-change code), and a reference change dropped because the reader may not see the target's title. Both match what the activity stream shows, which is the card's acceptance line.
  • The rest fits the card. One card for both entry points. One wording hook shared with the activity stream, so the two cannot disagree. Reading by record instead of by field is the right call, because the guard refuses a change-column query for exactly these readers. No restore, no change to audit storage, no change to the activity tab.

Implemented-by: claude/project-thread-apg8e0
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: FAIL

…e recorded, and bound the scan per click

The record page's history button and the list cell's 「Change history」 are
now gated by resolveFieldHistory, the predicate the audit writer keeps old →
new by: a field with fieldHistory: false, an object with
enable.fieldHistory: false, a credential field, or a default-off type that
does not opt in offers neither, where the card could only have said 「No
changes recorded」 of a field that was changed.

Opening the card, and each 「Load more」, now reads at most four batches of
the record's activity rows. When they hold no change of the field and older
rows remain, the card says 「No changes in the recent activity」 and offers
「Load more」 to read on; 「No changes recorded」 needs every row read. A row
repeated by a shifted $skip is kept once.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZFiKZ188iQxqGgmnY
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c429064ab87fd8f123091fc95cb472087639762c
Local-runs: none
Scope: the delta 975c4c5576..c429064ab8 (one commit, 23 files: .changeset/36290-field-change-history-card.md, ui/packages/plugin-detail/src/ FieldHistory.tsx, DetailSection.tsx, index.tsx, useDetailTranslation.ts and the test, ui/packages/plugin-grid/src/ObjectGrid.tsx and its test, 11 locale files, 2 READMEs, 2 mdx pages) + cited at head: packages/spec/src/data/field-history-default.ts, ui/packages/plugin-detail/package.json, the PR body at this head; the round-1 record (FAIL 7097637110) for everything outside the delta, which the delta does not touch (packages/spec, data-table, @object-ui/types, the server)
Security-touching: yes
Rule-change-verified: none

① Derived judgments

  • Published surface at this head. @object-ui/plugin-detail exports FieldHistoryButton, FieldHistoryCard, FieldHistoryPopover, fieldHistoryOffered, useFieldHistory, useFieldHistoryOffered, FIELD_HISTORY_PAGE_SIZE, FIELD_HISTORY_SCAN_BATCH, FIELD_HISTORY_SCAN_BATCHES_PER_LOAD and the same seven types. The changeset's Clause-② line now names all nine values and three keys. It matches index.tsx. The round-1 note is closed.
  • New in the delta, all additive: the constant FIELD_HISTORY_SCAN_BATCHES_PER_LOAD; an optional fourth parameter objectSchema? on fieldHistoryOffered and an optional third on useFieldHistoryOffered; a paused member on the hook's returned FieldHistoryState; the key detail.fieldHistoryNoneRecent. No existing caller breaks.
  • The key is in all 11 locales and in DETAIL_DEFAULT_TRANSLATIONS, with the same English text as the en pack.
  • @objectstack/spec is already a dependency of @object-ui/plugin-detail, so the new resolveFieldHistory import adds no package edge.
  • No packages/spec file moves in the delta. The round-1 findings on the hint string and its pin stand.
  • Declarations. Clause-②: yes (widening) and Metadata-protocol: none are still true. The PR body and the changeset both describe the new gate and the bounded scan as the code does them.

② Semver level

  • Unchanged: six entries, all patch, which scripts/check-changeset-no-major.mjs requires under none. The delta moves no new package.

③ Boundary flags

  • S1 closed. fieldHistoryOffered now refuses when resolveFieldHistory(def, schema) is false. That is the same predicate the audit writer keeps values by. It covers fieldHistory: false, enable.fieldHistory: false, credential types and default-off types that do not opt in.
  • Callers. There are two, and both pass the object schema: DetailSection (which also requires the field's definition to exist) and ObjectGrid (which also requires the column to be an own key of the schema's fields). A schema that does not declare the field is refused. No in-repo code calls useFieldHistoryOffered.
  • Note: a caller that passes no schema is not narrowed by the recorded-values rule. That is documented on the function. It cannot leak a value; the card could only mislead an outside host that omits the schema.
  • S1 pins. Record page: fieldHistory: false, a json field and a password field have no entry, with a json field that opts in as the control; an object with enable.fieldHistory: false offers none, with the same object as the control. Grid: a fieldHistory: false cell opens no row menu, with a recorded field's cell as the control. This also pins the grid's own gate call, which round 1 noted was unpinned.
  • S2 closed. Each read spends one unit of a budget of four. The open starts with four and each Load more resets it to four. The scan stops when the budget is spent, the page is full, or the rows run out.
  • Exactly four batches ending on a short page. The fourth answer sets exhausted and spends the last unit together. paused requires not exhausted, so it is false. The card then says 「No changes recorded」 with the creator, which is correct because every row was read. If the fourth answer is a full page, the card says 「No changes in the recent activity」 and offers Load more. Traced in code; the pinned case is the full-page one. Note: the short-page-on-the-fourth-batch case has no pin of its own.
  • 「No changes recorded」 needs exhausted, so it is never said while rows remain unread. Pinned (the test asserts the none state is absent while paused, and that no read happens without a click).
  • Dedupe key. It is the row's id as a string, checked against the entries already kept. A row repeated by a shifted $skip has the same id and is kept once. Note: a row with no id falls back to a position key, which a shift changes, so it would not be deduped; sys_activity rows always carry an id. Note: the dedupe has no test.
  • Security. The delta adds no read and no query column. The permission gate is unchanged and still runs after the new gate. The server narrowing cited in round 1 is untouched.
  • No test weakened. The delta only adds cases and widens one test helper's parameters.

④ Design judgment

  • Both should-fix items are answered the way round 1 asked, with the shared predicate and a per-action bound. The new wording separates "not found yet" from "never changed", which keeps card item 4 true.
  • The docs and READMEs say the same as the code.
  • Round-1 notes that stay open as notes: the entry shows before permissions load (the server is the floor); a keyboard-opened menu on a data cell carries the column without a pin; a milestone save or a withheld reference title also reads as no change, as in the activity stream.

Implemented-by: claude/project-thread-apg8e0
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

记录页上每个字段、列表格子的右键菜单里,现在都能看到「这一个字段」的历次修改(谁、什么时候、旧值 → 新值)。看不到的字段值不会发到浏览器,不记录历史的字段不显示入口。
一次只往回翻最近一段动态,翻不到就显示「最近动态里没有修改」并可以继续加载,不会一次扫完全部记录。
复核两轮(合同复核级)通过,CI 全绿,席位落地。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head c429064a · 2026-11-23T11:40Z

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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants