Skip to content

fix(plugin-audit): name a lookup-titled record by its target's title in activity rows, and word boolean changes per locale - #34172

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/area-A3-34055
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/area-A3-34055

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #34055
Fixes #33830

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:活动动态里,名称字段是查找字段的记录(如 HotCRM 项目成员按「人员」命名)现在显示被引用记录的名称,不再显示 32 位 id;布尔字段的变更显示为当前语言的「是/否」,不再是 false → true。
  • 为什么改:项目经理在活动动态里看到的是一串 id,和记录页标题对不上;中文界面里布尔值夹着英文字面量,与同一行已翻译的选项标签不一致。
  • 风险与回滚:只影响此后新写入的活动行,已写入的行保持原样;每次写入最多多一次批量读取,且仅当名称字段是查找字段时才读。回滚即还原本 PR,无数据迁移。
  • 先看:packages/plugins/plugin-audit/src/audit-writers.ts(记录标签按写入者身份读取目标名称的那段)、activity-summary-message.ts(布尔值按语言措辞)、translations/messages.ts(新增两个词条)。
  • 两分钟验证:pnpm --filter @objectstack/plugin-audit exec vitest run src/activity-lookup-name-field-label-34055.test.ts src/activity-boolean-change-wording-33830.test.ts,预期 2 个文件、18 个用例全部通过。
  • 需要你做的:无,席位落地。

What changes

Lookup nameField labels (#34055). recordLabel in audit-writers.ts now follows a title field that is a reference (lookup, master_detail, user) to the target record's own title. It reuses the resolver that already titles a referenced record inside a field-change summary, resolveLookupTitles. That gives ADR-0079's titleFieldOf on the target, the target's declared API exposure (servesSummaryTitleTarget, get), the credential / internal / key-material skips, and one id: { $in } read projected to ['id', titleField]. A new planLabelLookupRead builds the plan. It is empty when the title field is not a reference or when the object mirrors no activity, so such writes pay no read. The record header gets its name from the data door's $expand, which reads as the reader. The writer's equivalent is to read as the WRITER, so resolveLookupTitles now takes the reader as a parameter. The two summary branches are unchanged. The label passes the hook's own api. When the writer is refused the target's title column, or is served the row without it, the label keeps the stored value. An id without a resolved title keeps the stored value too, so the change can only replace an id with a title. The label still declares the lookup field as its source (text_sources.record_label).

Boolean wording (#33830). summaryValueOf renders a boolean / toggle value with no matching declared option as { text: <English word>, boolean }. composeActivitySummary words it through two new catalogue keys, messages.activityValueTrue / messages.activityValueFalse, in the locale it composes in. That is the write locale for the stored sentence, and the reader's negotiated locale on a read: the same request-locale path the verb templates take (the #32655 rule). The words are added to all eleven bundles of the plugin's messages.ts. readActivitySummaryMessage accepts the new optional member. A boolean field that declares options keeps reading through them. A fired milestone's template is the author's sentence and is never re-composed, so a boolean token there keeps its stored value.

Tests

Two new files, named for the cards:

  • activity-lookup-name-field-label-34055.test.ts (12 cases). Covers create / update / delete labels and sentences, a user-typed title, a multi-value lookup, and the blank-title floor. Read scope: a writer refused the title column, a writer served the row without it, the system writer, and a target whose exposure serves no get. Cost: one title read per write with $in over every id, and zero title reads for a text-titled object.
  • activity-boolean-change-wording-33830.test.ts (6 cases), on a real SQLite driver through the read middleware. Covers zh-CN 已转化: 否 → 是 beside the option labels, the stored and en sentences, ja-JP, declared options winning, the stored code carrying the boolean, and the floor for a locale with no catalogue word.
Red first: the new tests against the base source (63db724)

The three source files were restored to the base blobs (hashes checked equal to 63db7240aa:PATH), the two new test files were run, and the files were restored to HEAD. 11 failed and 7 passed. The 7 that pass are the floors and controls, which hold on base by design (stored value kept, no read for a text title, declared options, a silent locale).

Received: "状态: 新建 → 已转化; 已转化: false → true"
Received: "Status: New → Converted; Converted: false → true"
expected 'usr_grace_hopper_00000000000000' to be 'Grace Hopper'
expected 'c1' to be 'Grace Hopper, Alan Turing'
expected [] to have a length of 1 but got +0
 Test Files  2 failed (2)
      Tests  11 failed | 7 passed (18)
Ablations via scripts/ablation-replace.mjs (merged head 49982fa), each restored to the HEAD blob with an empty git diff HEAD
Mutation Red
A: the label is handed no titles 5 (the title cases, the system writer, the allowed writer)
B: the label read as api.sudo() instead of the writer 2 (the refused writer and the column-stripped writer both get the title)
C: the writer stores a boolean as String(value) 4 (zh-CN, en/stored, ja-JP, stored code)
D: the composer ignores the boolean member 2 (zh-CN, ja-JP)

Each one logged ok mutation landed: anchor 1 -> 0 and ok restored: blob == HEAD … and git diff HEAD is empty.

Package suite and typecheck

At merged head 49982fa, under scripts/pm/os-verify-lock.sh, with the closure rebuilt after the merge (pnpm --filter '@objectstack/plugin-audit^...' build, VERDICT command-exit 0):

pnpm --filter @objectstack/plugin-audit test && pnpm --filter @objectstack/plugin-audit typecheck
 Test Files  96 passed (96)
      Tests  1559 passed (1559)
check:test-typecheck: OK — @objectstack/plugin-audit's test layer compiles
os-verify-lock: VERDICT command-exit 0

Acceptance notes

  • Scope of the palette site. The ⌘K palette's renderTitle (packages/metadata-protocol/src/protocol-record-reads.ts, searchAll) is the same class, but it is not fixed here. The resolver this PR reuses is a closure inside plugin-audit, and metadata-protocol sits below it in the dependency graph. The engine-side equivalent ($expand on the title field) would change the record each hit returns on the wire. The report hands it to the seat for filing.
  • Test placement. The dispatch asked for new files named for the cards. Neither component has a shared harness file (each audit suite carries its own harness), so ruling record 6583487846 does not move these into an existing file.
  • Already-written rows keep the label and sentence they were written with. Snapshots are not rewritten.
  • git merge-tree --write-tree --name-only against origin/main is clean. No open PR touches the changed files (file lists of all 80 open PRs read).

Verification

Local gate subset: the scripts/pm/dispatch-gates.mjs --commands list derived at 49982fa (71 commands), with results in the report on the card. CI runs the full farm.


Generated by Claude Code

…rding, red first

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…ctivity labels, and word boolean changes per locale

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…mn rather than every read

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

14 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 12 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 121017b91d12602f8db428d3403cb1a638a7b92f → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 69df1ab28a3b80cd5f15f292e92f93a67dd6901d — the merge of head 3d6005cbb0cda60f77b56ce9106d475e39f1ef0b into base 121017b91d12602f8db428d3403cb1a638a7b92f, 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 69df1ab28a3b80cd5f15f292e92f93a67dd6901d && git checkout 69df1ab28a3b80cd5f15f292e92f93a67dd6901d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 121017b91d12602f8db428d3403cb1a638a7b92f 3d6005cbb0cda60f77b56ce9106d475e39f1ef0b && git checkout -B drift-repro 121017b91d12602f8db428d3403cb1a638a7b92f && git merge --no-ff 3d6005cbb0cda60f77b56ce9106d475e39f1ef0b

node scripts/docs-audit/affected-docs.mjs --json 121017b91d12602f8db428d3403cb1a638a7b92f

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh

Request: review · PR #34172 · area S2 (A3) · Fixes #34055, Fixes #33830 (p3 ride-along, same summary composer) · head 49982fab3f9a3ff6dbf7a157dbb0d98872b41948 (declared final) · reviewer review-b

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review claim · head 49982fa · 2026-11-16T00:01Z

review (review-b, areas S2+S4): L1 ordinary ACCEPT read per review-checklist.md, plus the face question; the verdict follows on this PR.

@objectstack-fleet

objectstack-fleet Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review — PASS

Head-sha: 49982fab3f9a3ff6dbf7a157dbb0d98872b41948
Area: S2 / A3 · Fixes #34055, Fixes #33830 · L1 ordinary ACCEPT read per review-checklist.md.

  1. The area's face question: is the optional boolean member plus the two catalogue keys a public-surface addition? No, and Clause-②: no holds.
    • plugin-audit's exports map has . only, and src/index.ts re-exports neither activity-summary-message.ts (so not ActivitySummaryValue or englishBooleanWord) nor translations/messages.ts. No exported signature names them either: the exported interfaces of audit-writers.ts do not reference ActivitySummary*. Under contract-review.md ("已发布面以包的 exports 映射为准"), an interface that the entry's type graph cannot reach and exports cannot address is not published surface.
    • The stored summary code rides in sys_activity.metadata.summary_message, which installActivitySummaryLocale reads and strips. It is an internal storage format, not a served shape.
    • The format is compatible in both directions. An older reader's isValue ignores the extra member and renders text, the English word. An old row with no member renders as before.
    • The two keys are entries in the plugin's own message bundle. The accept set of a translation bundle (any key) does not move, so this is the same kind of change as activityMoreFields (record discussion feed: thirteen consecutive system entries "Updated Campaign \"CPG-0001 - …\"" with no field diff — an update event should carry what changed and consecutive same-actor updates should fold #25787).
  2. Premise measured. Red first: 11 of 18 failed on the base, including expected 'c1' to be 'Grace Hopper, Alan Turing'. Ablations A–D each turn their named cases red and were restored to blob == HEAD.
    • B (the label read as api.sudo()) proves that the refused writer and the column-stripped writer never get a title.
  3. Mechanism, read on the tree.
  4. Locales. All eleven bundles gain both keys. es No equal to en No is the correct Spanish word, not an untranslated copy.
  5. Metadata-protocol: none and patch: right. No authorable key moves. Dogfood is n/a because the PR has no ! and no narrowing arm.
  6. Tests.
    • activity-lookup-name-field-label-34055.test.ts and activity-boolean-change-wording-33830.test.ts are new card-named files. Each audit suite carries its own harness and there is no shared harness file, so ruling 6583487846 does not apply. That is accepted.
    • The plugin-audit suite at the merged head: 96 files and 1559 tests passed, and typecheck is OK.
  7. Changeset. Each sentence matches the diff, including "read as the writer, not as the system" and "rows written before this release keep the label they were written with".
  8. Out-of-scope, handed to the seat. The ⌘K palette's renderTitle (metadata-protocol searchAll) has the same lookup-title class. It sits below plugin-audit in the dependency graph, so it needs its own card. The seat files it, or records why not, in the ACCEPT.
  9. Check-runs on the head: 37 success, 18 skipped, none failed or pending.

The patch-id is d0f20779f0a2b62cf1f04b8fa5d4033dc2e475b7. A clean main merge that keeps it keeps this PASS.

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

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh

席位核对

Head-sha: 3d6005cbb0cda60f77b56ce9106d475e39f1ef0b · 读于 2026-11-16T00:53Z

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

Projects

None yet

1 participant