Repository navigation
fix(plugin-audit): name a lookup-titled record by its target's title in activity rows, and word boolean changes per locale - #34172
Conversation
…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
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
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
📓 Docs Drift Check14 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
Coarse fallback — 12 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 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 |
|
domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh Request: review · PR #34172 · area S2 (A3) · Fixes #34055, Fixes #33830 (p3 ride-along, same summary composer) · head
|
|
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. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review — PASSHead-sha:
The patch-id is |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
|
domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh 席位核对Head-sha:
|
Requested by Steedos · project thread
Fixes #34055
Fixes #33830
Clause-②: no
Metadata-protocol: none
维护者速读
false → true。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
nameFieldlabels (#34055).recordLabelinaudit-writers.tsnow 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'stitleFieldOfon the target, the target's declared API exposure (servesSummaryTitleTarget,get), the credential /internal/ key-material skips, and oneid: { $in }read projected to['id', titleField]. A newplanLabelLookupReadbuilds 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, soresolveLookupTitlesnow takes the reader as a parameter. The two summary branches are unchanged. The label passes the hook's ownapi. 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).
summaryValueOfrenders aboolean/togglevalue with no matching declared option as{ text: <English word>, boolean }.composeActivitySummarywords 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'smessages.ts.readActivitySummaryMessageaccepts 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, auser-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 noget. Cost: one title read per write with$inover 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).Ablations via scripts/ablation-replace.mjs (merged head 49982fa), each restored to the HEAD blob with an empty git diff HEAD
api.sudo()instead of the writerString(value)Each one logged
ok mutation landed: anchor 1 -> 0andok 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):Acceptance notes
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, andmetadata-protocolsits below it in the dependency graph. The engine-side equivalent ($expandon the title field) would change therecordeach hit returns on the wire. The report hands it to the seat for filing.git merge-tree --write-tree --name-onlyagainst 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 --commandslist derived at 49982fa (71 commands), with results in the report on the card. CI runs the full farm.Generated by Claude Code