Repository navigation
fix(plugin-audit): a milestone row written before its template gained a token reads its stored sentence - #37731
Conversation
… a token reads its stored sentence
A fired milestone's summary code now stores every {token} name its
template held. A reader composes the translated template only when each
token it names has the row's stored value or was in the template and
empty; otherwise the row keeps its stored sentence, which has no hole.
Also: one exported {token} pattern (milestoneTokenRe) shared by the
writer and the reader; a read answers each milestone once and reads each
object's packaged base once; two stale doc comments (i18n-resolver's
scalarOverridesPackagedBase, the audit-option-label-summary test header).
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
📓 Docs Drift Check7 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 180 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 675e99ad08537cd224c84279013a2c3b6eb5c741 && git checkout 675e99ad08537cd224c84279013a2c3b6eb5c741
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 579b85776d1abb6722df870eb2a652231ee4047e 48cd3c9ddcadbe8e5d92f6956d7e13b4ae08188d && git checkout -B drift-repro 579b85776d1abb6722df870eb2a652231ee4047e && git merge --no-ff 48cd3c9ddcadbe8e5d92f6956d7e13b4ae08188d
node scripts/docs-audit/affected-docs.mjs --json 579b85776d1abb6722df870eb2a652231ee4047e |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Re-run failed jobs once (seat) · head 48cd3c9 · 2026-11-27T03:12Z Run 45916380697 failed only
|
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: FIRST round on this PR. Read for this record: card #37635 (body, triage comment 7198755801, claim comment 7206277918), records 7196337094 and 7197635792 on PR #37582 (the source of the card's four items: N3, N4, N6, N7 there), PR #37731 (body, 7-file list, the net diff against ① Derived judgments
② Semver level
③ Boundary flagsDev flags, from the PR body's "Small calls made here (no card)":
Claim-comment flags (container S, SQL push-down: the diff adds no query, no id materialisation and no in-app join. The writer derives ④ Design judgment
Do the pins fail without each change? The composer rule: yes, in the unit file (the red-first case and three more) and through the real writer, driver and middleware in the integration file. No must-fix, no should-fix. Nits, each left as it is or carried to a follow-up card (a fix in code or tests moves the head):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 48cd3c9 · card #37635 · area s2-ux · 2026-11-27T03:42ZL1 checklist
Tier: S. Landing: ready + auto-merge by this stroke. |
Requested by Sales · project thread
Fixes #37635
Clause-②: no
Metadata-protocol: none
Skills-docs: none (no page under
skills/**describes the stored milestone summary code)维护者速读
{token}之后,之前写下的动态记录在中文等翻译语言下不再显示“带空洞”的翻译句,而是显示当时存下的完整英文句。新写的记录不受影响,照常显示翻译。What changes
activity-summary-message.ts+audit-writers.ts:namesto a fired milestone's summary code: every distinct{token}name the fired template held, interpolated or not (milestoneTokenNames).names(it was in the template and its value was empty, so it renders empty as in the stored sentence). Any other token makescomposeActivitySummaryanswerundefined, so the row keeps its stored sentence, as it already does for a locale with no entry.readActivitySummaryMessageacceptsnamesonly as a string list, and still reads a code without it.milestoneTokenRe()moves toactivity-summary-message.tsand is exported; the writer imports it, and the composer's literal/\{(\w+)\}/gis gone.readerSummaryLocale: each(object, field, value)milestone's answer is computed once per read, and each object's packaged base is read once per read, shared by the translated definition and every milestone answer.scalarOverridesPackagedBasejsdoc and thevalueOverridesPackagedBasejsdoc inpackages/spec/src/system/i18n-resolver.tsname the five scalars (an object's three, a rule'smessage, a milestone'ssummary) instead of "three scalars" / "its two callers"; the header ofaudit-option-label-summary.test.tssays a reader may now read the milestone composed in its language (activityMilestones summary has no translation slot, so an app cannot localize the timeline rows its milestones write #37524), while the stored sentence stays untranslated.@objectstack/plugin-auditand@objectstack/specpatch.Small calls made here (no card):
names: they compose only when every token of the translation has a stored value. Such a row with an empty value shows its stored sentence instead of the translation; it never shows a hole.(object, field, value), one level finer than the card's(object, field), because the answer depends on the value; the packaged base is cached per object.Why
Contract review records 7196337094 and 7197635792 on PR #37582 (accepted deviations and nits, adopted at ACCEPT), carried here per the one-card-per-PR rule.
Verification
Head
48cd3c9dd:packages/plugins/plugin-audit:vitest run src/: 110 files, 1846 tests passed. New cases inactivity-summary-message.test.ts: red-first for a token added after the row (keeps the stored sentence), an empty listed token renders empty, a translation-only token, a code withoutnames(composes when every token has a value, else keeps the stored sentence), one packaged-base read for many rows and two milestones, andnamesvalidation.activity-milestone-summary-locale.integration.test.tspins the storednamesand, through the real writer, SQLite driver and read middleware, that a zh-CN reader reads the stored English for a row written before the template gained{note}, with the lost row (whose template held{note}) still composed as a control.tsc --noEmit -p packages/plugins/plugin-auditandeslinton the 5 touched plugin-audit files: exit 0.check:changeset-fixed,check:test-source-alias: exit 0.node scripts/pm/overlap-check.mjs: clean (sharesi18n-resolver.tswith feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types #37422 and refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts #37366, both merge cleanly).Human Minimum
packages/specholds no runtime logic (doc comments only).main, one pull request.packages/spectouched (comments only): no generated artifact depends on them.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
Generated by Claude Code