Repository navigation
feat(spec,plugin-audit): an activity milestone's timeline row reads in the reader's language - #37582
Conversation
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
…check Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
…r, reference docs Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
…r pins to their own file Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
📓 Docs Drift CheckThis PR changes 3 package(s): 15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
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 f83dd5c964b3180d7b5534d876b662c165011d41 && git checkout f83dd5c964b3180d7b5534d876b662c165011d41
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 54d6726c09019bd1d9da29b7aee3fb9e907dbb0a 4a22422916b2b8cd04b935863d6a8f683a928e85 && git checkout -B drift-repro 54d6726c09019bd1d9da29b7aee3fb9e907dbb0a && git merge --no-ff 4a22422916b2b8cd04b935863d6a8f683a928e85
node scripts/docs-audit/affected-docs.mjs --json 54d6726c09019bd1d9da29b7aee3fb9e907dbb0a
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
|
Generated by Claude Code |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Re-run once · 2026-11-26T14:48Z · head 578a08d · run 45837008571 One red on this head: Test Core (5/10), job 139970139703, in The cause is named, and it is not this PR's. The So the failed jobs are re-run once through the relay. A second red on this PR would be read as real. |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Read for this record: card #37524 (body, triage comment, claim comment), PR #37582 (body, 20-file list, 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 M over triage's S, and the serial-overlap note, are the lane seat's. Premise check. The claim reads the "never translated (#7290)" note as an implementation note, not a ruling. The tree agrees: the SQL push-down: no new query, id materialisation or in-app join. The reader composes from rows the read already returned, the in-memory bundle and the registered definitions; the writer adds no read (the token values come from the lookups the authored sentence already made). No finding. ④ Design judgment
No must-fix. One should-fix, owing a delta review. S1 (should-fix) — the reader's ADR-0029 D9.2a judgment is a second copy of the comparison, and it already differs from the one predicate on a ruled edge. Nits:
Implemented-by: VERDICT: PASS |
… one predicate The feed's milestone translator carried its own copy of the ADR-0029 D9.2a "tenant reworded the packaged value" comparison, which disagreed with the shared predicate on an empty served summary. scalarOverridesPackagedBase now takes 'summary', and the feed asks it with the packaged milestone as base. Also corrects the changeset's alias sentence (the aliases are refused, naming _milestones) and two audit-writers comments that predate the translation key. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: DELTA review from Read for this record: card #37524 (body, triage comment, claim comment), PR #37582 (body, 20-file list, the net diff against ① Derived judgmentsWhat the delta commit moves:
Re-read on this head from the net diff, and standing as record 7196337094 named them: Gate verdicts on this head: 61 check-runs concluded ② Semver level
③ Boundary flagsDev flags on the PR body:
The PR body's verification readings. The "Local runs" line still names SQL push-down: the delta adds no query, and the net diff adds no query, id materialisation or in-app join. The reader composes from rows the read already returned, the in-memory bundle and the registered definitions. No finding. ④ Design judgment
Two edges tried and left, both a consequence of composing at read time against the current declaration, as the other codes do: the rewording judgment is of the milestone as declared when the row is READ, not when it was written, so a tenant that rewords and later reverts sees rows from the reworded period composed from the packaged translation; and N7 below.
No must-fix, no should-fix. Nits:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 4a22422 · card #37524 · area s2-ux-T · 2026-11-26T16:28ZL1 checklist
Tier: S. Landing: ready + auto-merge by this stroke. |
… a token reads its stored sentence (objectstack-ai#37731) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#37635 Clause-②: no Metadata-protocol: none Skills-docs: none (no page under `skills/**` describes the stored milestone summary code) ## 维护者速读 - 用户能看到什么变化:应用作者给里程碑摘要模板新加了一个 `{token}` 之后,之前写下的动态记录在中文等翻译语言下不再显示“带空洞”的翻译句,而是显示当时存下的完整英文句。新写的记录不受影响,照常显示翻译。 - 为什么做:objectstack-ai#37582 的审核发现,旧行没有新 token 的值,翻译句里那个位置会变成空白,而存下的英文句是完整的。 - 出错会怎样:最坏是某行显示英文原句而不是翻译,不会丢数据,也不会出现空白。 - 要你做什么:无。 ## What changes - **Fallback (item 1)**, `activity-summary-message.ts` + `audit-writers.ts`: - The writer adds `names` to a fired milestone's summary code: every distinct `{token}` name the fired template held, interpolated or not (`milestoneTokenNames`). - The composer renders a translated template only when each token it names either has a stored value or is listed in `names` (it was in the template and its value was empty, so it renders empty as in the stored sentence). Any other token makes `composeActivitySummary` answer `undefined`, so the row keeps its stored sentence, as it already does for a locale with no entry. - `readActivitySummaryMessage` accepts `names` only as a string list, and still reads a code without it. - **One token grammar (item 2, N3)**: `milestoneTokenRe()` moves to `activity-summary-message.ts` and is exported; the writer imports it, and the composer's literal `/\{(\w+)\}/g` is gone. - **Per-read caching (item 3, N4)**, `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. - **Stale comments (item 4, N6)**: the `scalarOverridesPackagedBase` jsdoc and the `valueOverridesPackagedBase` jsdoc in `packages/spec/src/system/i18n-resolver.ts` name the five scalars (an object's three, a rule's `message`, a milestone's `summary`) instead of "three scalars" / "its two callers"; the header of `audit-option-label-summary.test.ts` says a reader may now read the milestone composed in its language (objectstack-ai#37524), while the stored sentence stays untranslated. - **Changeset**: `@objectstack/plugin-audit` and `@objectstack/spec` patch. Small calls made here (no card): - **How a row tells "empty" from "added later"**: store the template's token names on the row (the card's example). The alternative, a hash or the whole template, carries more and still needs the names to judge a translation. - **A token only the translation names** (not in the authored template) now also keeps the stored sentence. objectstack-ai#37582 rendered it empty; a translation with a token the row never had cannot be composed whole either, so one rule covers both. - **Rows written before this change** carry no `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. - The cache key is `(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 objectstack-ai#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 in `activity-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 without `names` (composes when every token has a value, else keeps the stored sentence), one packaged-base read for many rows and two milestones, and `names` validation. `activity-milestone-summary-locale.integration.test.ts` pins the stored `names` and, 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-audit` and `eslint` on the 5 touched plugin-audit files: exit 0. - `check:changeset-fixed`, `check:test-source-alias`: exit 0. - `node scripts/pm/overlap-check.mjs`: clean (shares `i18n-resolver.ts` with objectstack-ai#37422 and objectstack-ai#37366, both merge cleanly). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (doc comments only). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; lint passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched (comments only): no generated artifact depends on them. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #37524
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #37585
维护者速读
skills/objectstack-i18n补一句的后续卡是 skills: objectstack-i18n lists the object translation sub-keys but not_milestones.<field>.<value>.summaryonce PR #37582 lands #37585。What changes
The reading (at
4116465625): the timeline already serves most rows in the reader's language — the CRUD mirror stores a summary CODE beside the sentence and thesys_activityread middleware re-composes it per reader (packages/plugins/plugin-audit/src/activity-summary-message.ts). A fired milestone was the one row left out, by an implementation note in that file ("its template is the author's sentence and is never translated"), andObjectTranslationDataSchemahad no key the template could be translated under. ADR-0052 §5b.2 defines the milestone and says nothing about its language.packages/spec/src/system/translation.zod.ts). An object translation accepts_milestones: { <field>: { <value>: { summary } } }. A milestone declares no name; the watchedfieldand thevalueit fires on are what fire it (the writer fires the first declared match), so the pair is its address and no new authorable key is added toactivityMilestones.milestonesandactivityMilestonesare refused, and the refusal names_milestonesas the key to write (asvalidationsnames_validations).packages/spec/src/system/i18n-resolver.ts).resolveObjectMilestoneSummary(bundle, object, field, value, opts)reads the template along the locale chain; a dotted value is one key. It is deliberately NOT overlaid bytranslateObject: an object served by/metawith the translated template on it would round-trip into the authored declaration on the next Studio save. A pin holds thattranslateObjectleavesactivityMilestones[].summaryas authored.packages/plugins/plugin-audit/src/audit-writers.ts). A fired milestone's row now carriesmetadata.summary_message={ key: 'activityMilestone', object, field, value, tokens }, each token stored as the field-change code stores a value: the text the writer rendered, plus the select option it matched. The storedsummaryis unchanged (the authored sentence, rendered as before), and so aretype,metadata.kindand the text sources the redaction reads.activity-summary-message.ts).readerSummaryLocalegainsmilestoneSummary, which reads the template from the same bundle andResolveOptionsthe labels are translated with.composeActivitySummaryinterpolates it: a select token is named by the option label on the reader-language object definition, any other token by its stored text, and a token with no stored value (a token the translation adds, or an empty value) renders empty, as an empty value does in the authored sentence. No template for the reader's language ⇒ nothing is composed and the stored sentence stands. A tenant that reworded a packaged milestone'ssummarykeeps its words (ADR-0029 D9.2a, judged as a reworded validation message is: the served milestone against the packaged one of the same pair, through the resolver's one predicatescalarOverridesPackagedBase, whose key union gains'summary'; an empty served summary is no rewording, so the catalog still applies). The code is stripped frommetadatafor every non-system reader, as the other non-field-change codes are.summarydropped before this middleware runs; the middleware only overlays asummarystill present, so it never re-adds a dropped one. Pinned below.i18n-walk.ts) scaffoldsobjects.<o>._milestones.<field>.<value>.summaryfor each pair, the first entry of a repeated pair only. The translation-reference rule (validate-translation-references.ts) flags a_milestoneskey over a pair no milestone of the object declares, suggesting the near value.examples/app-showcasetranslates its one milestone (showcase_task,status→done) in zh-CN, so the extractor's new key is translated where the coverage gate measures it.content/docs/ui/translations.mdx(the key table) andcontent/docs/protocol/kernel/i18n-standard.mdx(the reference rule's table) name the key.content/docs/references/system/translation.mdx,api-surface/system.json,export-origins/system.jsonand the strictness-ledger count (system/409 → 410, the new strict object) regenerated bycheck:generated --fix.Small calls made here (no card): the
field+valueaddress rather than a newnameon a milestone; a boolean token keeps rendering its stored value (as the authored sentence does today) rather than a per-locale yes/no word; token texts are not length-bounded in the code (the authored sentence they come from is not bounded either).Left as they are after contract review (optional, noted here): N3, the
{token}pattern is spelled twice (writer and reader); N4, the reader asksgetPackagedObjectBasetwice per row with no cache. Neither changes an answer.Why
An app that is otherwise fully translated still wrote authoring-language rows ("Case escalated — …") on the record timeline, with no key it could fill in.
Verification
packages/plugins/plugin-audit/src/activity-milestone-summary-locale.integration.test.ts(new; real kernel, real audit writer, SQLite, the engine middleware chain): a zh-CN reader reads商机赢单:Acme(赢单)from the zh-CN template with the{stage}token named by its zh-CN option label; the system, an en reader, a read with no locale and a ja-JP reader (no entry) read the storedDeal won: Acme (Won); the code is stored for the system and served to no other caller; a reader not served a token's field (note) gets the row with nosummary. Red first: with the composer's template lookup stubbed out, the zh-CN pin and the redaction pin's served half fail (2 of 4).activity-summary-message.test.ts, new describe: composes the translated template, an unstored token empty; nothing composed for a locale with no entry or on a locale with nomilestoneSummary; a tenant's rewording of the packaged milestone keeps its words while the untouched one translates, and an emptied one still translates (fails with the earlier local copy of the comparison); the stored code reads back and a malformed one is refused.packages/spec/src/system/i18n-milestone-summary.test.ts(new): the key is read by pair, a dotted value as one key, along the fallback chain,undefinedon misses; the schema accepts the group and refuses a key it does not declare;translateObjectleaves the authored summary.packages/lint/src/i18n-milestones-37524.test.ts(new): the extractor emits one key per fired pair seeded with the authored template; the reference rule resolves declared pairs and flags an undeclared value (with the suggestion) and an unwatched field.validate-translation-references.test.ts: the lint:validate-translation-referenceshas no_tabsleg — an authored key naming a filter-preset tab that does not exist warns nobody #13835 object-branch coverage ledger classifies_milestonesas reference-checked, backed by a ghost that reports, and the all-groups control bundle names the real pair.92e8e1bcf:@objectstack/plugin-auditvitest 110 files / 1,840 tests pass;@objectstack/lintvitest 237 files / 9,683 tests pass (the one red, the coverage ledger, fixed in the tip commit and re-run: 268/268);@objectstack/specvitestsrc/systempass;node scripts/check-i18n-bundles.mjsexit 0; eslint on the touched files exit 0;tsc --noEmitfor plugin-audit exit 0;pnpm --filter @objectstack/spec check:generatedexit 0;node scripts/pm/overlap-check.mjsexit 0.check:i18n-coverageneeds the built examples and is left to CI.Contract review (L2) is owed before landing: the diff changes
packages/spec/src/**and declaresClause-②: yes (widening).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
Generated by Claude Code