Skip to content

feat(platform-objects): the System Overview datasets carry synonyms and a description on their seven members - #34992

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-34921-system-overview-dataset-words
Nov 18, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-34921-system-overview-dataset-words

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz

Fixes #34921

repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz
Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:平台自带的“系统概览”五个数据集(用户、组织、会话、安装包、审计日志)里的七个指标/维度,现在都有了中英文同义词和一句业务定义;业务定义在 11 种语言包里都有翻译。
  • 为什么改:管理员问“有多少用户”/ "how many users" 时,问数工具只能靠指标名或当前语言的标签去匹配,平台自己的指标反而查不到;现在这些问法能直接命中 user_count。
  • 风险与回滚:只改元数据和语言包,不动 spec、规则和运行时代码;最坏情况是某个同义词选得不准,回滚就是还原 system.datasets.ts 和语言包这一个 PR。
  • 先看:① packages/platform-objects/src/apps/dashboards/system.datasets.ts(七组同义词,看措辞准不准、有没有两个指标抢同一个词);② packages/rest/src/system-overview-dataset-vocabulary.test.ts(真实数据集走真实 list_datasets 的钉子);③ packages/platform-objects/src/apps/translations/zh-CN.ts 的 datasets 段。
  • 两分钟验证:pnpm --filter @objectstack/rest exec vitest run src/system-overview-dataset-vocabulary.test.ts(需先构建 platform-objects),预期 8 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

The five System Overview datasets (packages/platform-objects/src/apps/dashboards/system.datasets.ts) gain ADR-0149 D1 vocabulary on all seven members:

Dataset Member Synonyms (one authored array, never bundled)
sys_user_metrics measure user_count 用户, 用户数, 用户数量, 用户总数, 有多少用户, users, user count, number of users, total users, how many users
sys_organization_metrics measure org_count 组织, 组织数, 组织数量, 组织总数, 有多少组织, organizations, orgs, organization count, number of organizations, how many organizations
sys_session_metrics measure session_count 会话, 会话数, 会话数量, 登录会话, 有多少会话, sessions, session count, number of sessions, login sessions, how many sessions
sys_package_installation_metrics measure package_count 已安装的包, 安装的包数, 包安装数, 装了多少包, installations, installed packages, package installations, package count, number of installed packages, how many packages are installed
sys_audit_log_metrics dimension action 操作类型, 动作, 审计动作, action type, operation, audit action
sys_audit_log_metrics dimension user_id 操作人, 操作者, 执行人, 操作用户, actor, performed by, acting user
sys_audit_log_metrics measure event_count 事件, 事件数, 审计事件, 审计事件数, 审计日志条数, 有多少审计事件, events, event count, audit events, audit log entries, how many audit events

Each member also gets a one-sentence description. That text is display copy, so it has a bundle entry at datasets.NAME.{measures,dimensions}.MEMBER.description in all eleven Setup bundle locales (en mirrors the source verbatim; zh-CN, zh-Hant, ja-JP, ko, es-ES, fr, pt-BR, de, ru and ar are hand-translated, as the existing datasets.*.label rows are). Each translated locale records the new paths' source digests in its hand-maintained LOCALE.source-hashes.ts, written the same way the label rows were (collectSourceHashes(en); the existing label digests reproduce byte-for-byte). No *.generated.ts file changes, and no generator output moves.

How the matcher treats these words. matchDatasetTerms (service-analytics) compares a term with a member's name, label and synonyms by EQUALITY after normalizeDatasetTerm. It never matches a substring or a single word inside a phrase. So a multi-word term such as "how many users" resolves only where a member writes that exact phrase as one synonym. I chose to write the administrator's phrasing (how many users, 有多少用户) as synonyms, plus the term forms a model lifts from a question (user count, 用户数). A longer question with no exact hit, such as "how many users do we have", still gets only near candidates (containment, two code points or more), which means a clarifying question. That behaviour is unchanged.

Collisions. Within one dataset, the schema's vocabulary refinement judges collisions (full DatasetSchema.safeParse is green for all five). Across the five datasets, no synonym is a word of another measure in any locale, and a new test pins that. The one cross-member equality is 「用户」: it is a user_count synonym and also the existing zh-CN label of the user_id dimension. In zh-CN the two labels already met before this PR. A dimension match picks no number, so the word still answers with user_count. In other locales the synonym adds the only match.

The other language's bare label is listed on purpose (users beside 「用户」). The label a caller is matched against is the one served in the caller's locale, so under zh-CN the English label Users is not a match target.

No spec, schema, protocol or vocabulary-rule change. The rule's module note ("It answers to no synonym unless its source writes one") stays true; the source now writes them.

Tests

  • packages/rest/src/system-overview-dataset-vocabulary.test.ts (new) puts the pin where these datasets meet the dataset tools without new wiring: @objectstack/rest already depends on both @objectstack/platform-objects and @objectstack/service-analytics. It feeds the REAL datasets, localized by the REAL Setup bundle through translateDataset, to the REAL list_datasets of an AnalyticsServicePlugin-booted service. The objects behind the datasets are declaration doubles. Under en and zh-CN:
    • terms: ['用户数'] matches exactly sys_user_metrics.measures.user_count, on synonym, and has no candidates;
    • terms: ['how many users'] matches the same member the same way;
    • the control terms: ['营收', 'revenue'] matches nothing and has no candidates;
    • under zh-CN, the catalogue lists user_count's description from the bundle.
  • system-overview-dataset-translations.test.ts gains a top-level describe in the existing harness file:
    • all seven members declare a Chinese and an English synonym and a description;
    • each dataset survives a full parse;
    • no synonym is another measure's word in any locale;
    • the en bundle copies each description verbatim;
    • no translated locale serves the English description.
Test runs (head 82b53be)
pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/system-overview-dataset-vocabulary.test.ts
 Test Files  1 passed (1)
      Tests  8 passed (8)
pnpm --filter @objectstack/platform-objects test
 Test Files  123 passed (123)
      Tests  2060 passed (2060)
pnpm --filter @objectstack/platform-objects typecheck   -> exit 0
pnpm --filter @objectstack/rest typecheck               -> exit 0 (test layer: 0 files / 0 errors held)
Ablation: drop user_count's synonyms, the pin goes red

The ablation ran through scripts/ablation-replace.mjs, which deleted the user_count synonyms array. Then pnpm --filter @objectstack/platform-objects build, then node scripts/ablation-dist-preflight.mjs @objectstack/platform-objects "total users" --absent (exit 0: the marker is gone from dist/).

MUTANT test exit=1
 × en: 「用户数」 resolves to user_count alone, by its declared synonym
 × en: "how many users" resolves to user_count alone, by its declared synonym
 × zh-CN: 「用户数」 resolves to user_count alone, by its declared synonym
 × zh-CN: "how many users" resolves to user_count alone, by its declared synonym
 Tests  4 failed | 4 passed (8)

The 4 that stayed green are the listing, the two controls and the description case, which is what you would expect.

Restore: ablation-replace: ok restored: blob == HEAD (b3d478488ce5) and git diff HEAD is empty. After a rebuild the preflight found the marker present in 4 built files with a clean tree, and the suite went back to Tests 8 passed (8).

Acceptance notes

  • i18n baseline moved by 0. scripts/i18n-coverage-baseline.json holds packages/platform-objects/scripts/i18n-extract.config.ts: 0 before and after, and node scripts/check-i18n-coverage.mjs reports OK (14 config(s), 423 baselined untranslated string(s), none new). The extract config declares no datasets, so the ratchet's population does not include these rows in either direction. The new strings are held instead by the translation test above (every locale translated, en verbatim).
  • The synonyms are Simplified Chinese and English only. normalizeDatasetTerm does not fold Traditional to Simplified, so a zh-Hant administrator typing 「使用者數」 matches only the zh-Hant label 「使用者」, and only in that locale. This is noted here, not filed.
  • sys_package_installation is cloud-only. Where the object is absent, its dataset is left out of list_datasets, and the synonyms are harmless there.

Verification

Derived gate families (63) and reconciliation

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 63 families from merge base fb5c42d, tree 82b53be. All 63 ran locally.

Three exited 3 (PREREQUISITE NOT MET) on the first pass and were re-run once the prerequisite held, each exit 0:

  • pnpm check:i18n, after the CLI and extract-closure build: OK (10 package(s) — all bundles in sync, no undeclared authoring keys);
  • pnpm check:dual-build-cjs-loads, after a full workspace build: 124 published require entry point(s) across 72 package(s) load;
  • node scripts/check-plugin-teardown-shape.mjs --self-test, after fetching its pinned fixture commit into the shallow clone: 48 cases pass.

The dist-reading gates were re-run after the full build, all exit 0: check:dts-closure, check:published-files, check:lean-entry-closure, check:sourcemap-no-sources-content, check-dts-emitted --self-test.

Run reconciliation — 63 derived, 63 run, 0 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 63 derived famil(ies) accounted for — 63 run, 0 NOT-MEASURED

overlap-check before each push: VERDICT clean exit 0 against origin/main and #34799, which shares the locale bundles and merges cleanly.

The rest of the @objectstack/rest suite was not re-run locally: this PR adds one test file there and changes no rest source. CI's Test Core runs it.

…s and a description

WIP: vocabulary and bundle rows; source hashes, pin and changeset follow.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz
…ord description source digests

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz
@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 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

20 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 — 3 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 4443014630c094cde840f9dd0b0b45ade45b48d9 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 669ddac4f5a113f6bcf218a005b46f36d2104a5b — the merge of head 692c9c1b8c66cb99b6265edae19527169284652c into base 4443014630c094cde840f9dd0b0b45ade45b48d9, 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 669ddac4f5a113f6bcf218a005b46f36d2104a5b && git checkout 669ddac4f5a113f6bcf218a005b46f36d2104a5b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4443014630c094cde840f9dd0b0b45ade45b48d9 692c9c1b8c66cb99b6265edae19527169284652c && git checkout -B drift-repro 4443014630c094cde840f9dd0b0b45ade45b48d9 && git merge --no-ff 692c9c1b8c66cb99b6265edae19527169284652c

node scripts/docs-audit/affected-docs.mjs --json 4443014630c094cde840f9dd0b0b45ade45b48d9

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzf35CD4CvA4nKbwwUn

L1: ACCEPT
Head-sha: 82b53be

This is the first L1 read of #34992 (card #34921) at the head above. The base is fb5c42d, and the head merges cleanly with current main.

Must-fix

None.

Should-fix

  • S1: amend the claim surface to name the rest test file. No head move is needed. packages/rest/src/system-overview-dataset-vocabulary.test.ts is a new file in a package the claim (6961389476) does not name. The pin-test slot names packages/services/service-analytics dataset-tools / term-matcher tests "or platform-objects tests", with the clause "wherever the System Overview datasets reach list_datasets without new wiring". The choice itself is sound:

    • packages/rest already depends on both @objectstack/platform-objects and @objectstack/service-analytics, so no new wiring is needed;
    • it is the one place the real datasets, the real bundle and the real executor meet.

    Still, the claim names two packages and the PR adds a test in a third. One amendment line on the card naming this file closes it.

Notes

  • Shape. Fixes #34921; 25 files, +907 −78, mostly bundle rows. check-governed-merges --pr 34992: 0 of 25 paths are governed and the PR has 985 lines, so it is not Tier H.
  • Changeset. @objectstack/platform-objects patch. That is the only package whose src moved; packages/rest is test-only. Clause-②: no and Metadata-protocol: none match the claim. Members gain values on keys the spec already declares (synonyms, description; dataset-tools.zod.ts, translation.zod.ts), with no schema, protocol or rule change, so this is ui-only and Clause-② no. L1 is the review of record, and no L2 is owed.
  • Scope against acceptance.
    • All seven members declare synonyms in one authored array, Chinese and English together, with no bundle (ADR-0149 D1), and each has a one-sentence description.
    • Each description has a bundle row in all 11 locales, with source-hash rows in the 10 translated ones.
    • I spot-read de, ja-JP, zh-CN and zh-Hant: they are real translations, and they agree with the English on "active or not" and on the System bucket.
    • The rest pin covers both ['用户数'] and ['how many users'], in en and zh-CN, through translateDataset and the real list_datasets. Each resolves to sys_user_metrics.measures.user_count alone, matchedOn: 'synonym', with no candidates.
    • The control ['营收','revenue'] misses.
    • The zh-CN catalogue serves the bundled description.
    • The i18n baseline moved 0, which the PR body states with its reason (the extract config declares no datasets). That satisfies "states by how much".
  • Platform-objects pins. Every member has a Han and a Latin synonym plus a description. The full DatasetSchema parse passes. A cross-dataset, every-locale collision check finds no synonym equal to another measure's name, served label or synonym. The en bundle copies each source description verbatim, and no translated locale serves the English source.
  • Ablation. The PR records that removing user_count's synonyms turns 4 tests red, and that the blob is restored to HEAD.
  • Nit, package_count. The file comment says "the other language's label is listed too (users beside 「用户」)". That holds for user, org, session and event, but not for package_count: its zh-CN label 「安装」 is not among its synonyms, while 'installations' is. If leaving it out is deliberate (「安装」 alone is ambiguous), a few words in the comment would say so. Otherwise add it; the collision pin would judge it.
  • Nit, 「用户」. Under zh-CN, 「用户」 matches the user_count synonym and also the user_id dimension label. The file comment says it still answers with user_count, which follows the selection rule in LIST_DATASETS_DESCRIPTION ("A dimension match alone picks a grouping, not a number: a measure must still match"). It is the most likely word an admin types, so a one-leg pin of listFor('zh-CN', ['用户']) would hold that reading. Optional.
  • CI at this head. When I read it, 17 checks were green and the Test Core shards, Type Check and Build Core were still running. Check Changeset and PR-body guards each show one cancelled run, superseded by the body edit, with a fresh run in progress. Landing waits on them.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz

Flake judgement · 2026-11-17T23:28Z

CI run 44193314153 (ci.yml, attempt 1) on head 692c9c1b8c failed one job: Test Core (10/10). Its log says The action 'Fetch this commit's history and the base branch' has timed out after 20 minutes. The shard never reached its test step, so it measured nothing, and the aggregate Test Core failed with it. Every other required check on this head is green (35 success, 16 skipped). It is the same infrastructure pattern as the Checkout repository timeouts on lint.yml jobs this evening (#34966 at 4345f62, this PR at 82b53be), which the seat is taking to the maintainer.

Area o3-D re-runs the failed jobs of this run once. A second failure goes to the seat, not to another merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz

Landing · 2026-11-18T00:02Z

Probe Reading
check-governed-merges.mjs --pr 34992 NOT governed · 985 changed lines (+907 / -78) ≤ 3000
Head / review 692c9c1b8c (pure merge of origin/main over the reviewed 82b53be; delta stat unchanged, 25 files) · L1 ACCEPT 6962771575, the review of record (no contract face, no L2 owed); its S1 answered by claim amendment 6962789643 · all required check-runs success or skipped on the latest attempts (37 success, 16 skipped)
Freshness merge base = main at 22:46Z, K = 7

CI history on this head: Test Core (10/10) attempt 1 timed out fetching history (measured nothing), judged in 6964080957 and re-run once; attempt 2 green. 82b53be's red was a lint.yml checkout timeout.

Open findings: nits only (package_count's zh label 「安装」 not among its synonyms; a zh-CN ['用户'] pin would hold the dimension-plus-measure reading), kept in the record under the merge standard.

State: ready + auto-merge armed by area o3-D (lease o3-D); Fixes #34921 closes the card on merge.

Dev-effort: high · Rounds: 1

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 18, 2026 00:02
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 2f656af Nov 18, 2026
82 of 84 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34921-system-overview-dataset-words branch November 18, 2026 00:47
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

Development

Successfully merging this pull request may close these issues.

platform-objects: the System Overview datasets carry synonyms and a description on their seven members

2 participants