Skip to content

feat(analytics): carry a dataset dimension's nullLabel on its column descriptor, and name System Overview's null user bucket "System" - #25402

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-to6m3a
Oct 23, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-to6m3a

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Part of #25330

Clause-②: no
Metadata-protocol: none

The label half of #25330, landing 1 of 3 (seat-approved order). Ruled A (6358843349, maintainer 「同意」); the key itself landed in #25397 (DatasetDimensionSchema.nullLabel). This PR carries the key to the renderer and declares it on System Overview. The objectui consumer follows with a .objectstack-sha bump to this PR's merge commit, then a last objectstack PR flips the nullLabel liveness row to live and closes the card.

Channel: the response's column descriptor, and why

Measured, not assumed. objectui's DatasetWidget stores the dataset answer's fields[] and reads every column's display metadata from it (headerLabel, buildChartSeries). It never fetches the dataset document; its only metadata read is the base object's (/api/v1/meta/object/NAME, for option labels). So the null bucket's name rides the descriptor the renderer already reads, as fields[].nullLabel. The document channel would have added a new metadata read per widget beside it.

That descriptor is typed by @objectstack/spec (objectui's DatasetResultField is AnalyticsResult['fields'][number]), so the carry needs one response member. It is response-only and nothing an author writes changes, so Clause-②: no and Metadata-protocol: none hold (seat ruling on the claim, declared on #18549).

What changes

  • @objectstack/spec: AnalyticsResult.fields[] (contracts/analytics-service.ts) and its mirror AnalyticsResultResponseSchema (api/analytics.zod.ts) gain nullLabel?: string. The compile-time drift guard in analytics.test.ts keeps the two equal; a new case pins that the parse preserves the member (the schema strips undeclared keys).
  • @objectstack/service-analytics: enrichResultColumns, the column-description pass the live query and the draft-data preview share, sets fields[].nullLabel on a dimension column whose dataset dimension declares nullLabel. It resolves through resolveI18nLabel at the request locale, exactly like label, so the wire carries a string and never a locale map. It is written whether or not the header was already set, and never onto a measure column whose name matches a dimension's field. Absent ⇒ no key, so an answer over a dimension without nullLabel is byte-identical to before.
  • @objectstack/platform-objects: sys_audit_log_metrics' user_id dimension declares nullLabel: { en: 'System', 'zh-CN': '系统', 'ja-JP': 'システム', 'es-ES': 'Sistema' }, every locale the platform bundles translate the board into. An inline map is the ruled route: the translation bundles have no slot for a dimension's null label. check:i18n is in sync with no regeneration (the extractor does not read nullLabel).

Pins

  • service-analytics/src/__tests__/dataset-dimension-null-label.test.ts, on both strategies: zh-CN reads 系统, en reads System, no locale reads System, a plain string passes as authored; a dimension without nullLabel and every measure column (one of them over the same user_id field) carry no key.
  • platform-objects/src/apps/dashboards/system-overview-null-label.test.ts: "Events by User" groups sys_audit_log_metrics by user_id, the dimension carries the map, the map names every locale SetupAppTranslations carries for the board, and it survives a strict DatasetSchema parse.
  • spec/src/api/analytics.test.ts: the response parse preserves fields[].nullLabel.

Ablation (scripts/ablation-replace.mjs, under the verify lock): the write if (nullLabel !== undefined) f.nullLabel = nullLabel; replaced by void nullLabel; (anchor 1 → 0, blob changed) turns the service pin 6 failed / 2 passed; the 2 green are the no-key controls, green by design. Restored: blob equals HEAD and git diff HEAD is empty. The source is imported directly by the test, so no build leg applies.

Verification

All at head 0c232759ab (base 7c68b1082; origin/main has moved one commit since, touching none of these paths).

  • pnpm --filter @objectstack/{service-analytics,platform-objects,spec} run typecheck: exit 0 (spec's runs check:scripts-typecheck and check:test-typecheck too).
  • pnpm --filter @objectstack/service-analytics test: Test Files 185 passed (185), Tests 4513 passed, 262 skipped.
  • pnpm --filter @objectstack/platform-objects test: Test Files 93 passed (93), Tests 1341 passed.
  • pnpm --filter @objectstack/spec test: Test Files 711 passed (711), Tests 21634 passed, 1 todo. Lock VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated: all 14 artifacts up to date (no regeneration was needed).
  • node scripts/pm/dispatch-gates.mjs --commands: 93 derived families, 92 run with exit 0, reconciled with --ran (0 unrun). 1 NOT MEASURED: pnpm check:dual-build-cjs-loads exited 3, PREREQUISITE NOT MET, because it reads every package's dist/ and this worktree built only the affected closure; CI runs it in Lint & Repo Gates.
  • pnpm check:i18n: exit 0, all 10 packages' bundles in sync.

Acceptance notes

  • Pivot charts. objectui's buildChartSeries takes one null label per chart, used for both arms of a two-dimension pivot. The objectui consumer therefore applies a declared name on a pivot only when both dimensions declare the same one. Recorded in that PR as well.
  • Other renderers. DatasetReportRenderer and ObjectChart in objectui still read only chart.nullCategory; this card's consumer is the dashboard chart. They can read the same descriptor member later. carrier: none, noted only.
  • The flat table renders a null dimension value as —, not as the chart's bucket label, and is out of scope.

Generated by Claude Code

…descriptor

The chart reads every column's display metadata from the dataset answer's
fields[], so the null bucket's authored name rides there as
fields[].nullLabel, resolved at the request locale like label. The System
Overview audit dataset names its null user bucket "System".

Claude-Session: https://claude.ai/code/session_016qAuAwFXMw94v5vFqTVcw2
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling labels Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/platform-objects, @objectstack/service-analytics, @objectstack/spec, touching 4 documentable anchor(s).

13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/client-sdk.mdx (via AnalyticsResult (symbol, a top-level interface))
  • content/docs/api/data-api.mdx (via AnalyticsResult (symbol, a top-level interface), AnalyticsResultResponseSchema (symbol, a top-level const))
  • content/docs/api/error-catalog.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/data-modeling/drivers.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/deployment/cli.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/kernel/runtime-services/audit-service.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/permissions/authentication.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/permissions/delegated-administration.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/permissions/permission-sets.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/permissions/positions.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/permissions/record-view-auditing.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/permissions/system-context.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/protocol/kernel/config-resolution.mdx (via user_id (literal, a string literal in dimensions))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-3.mdx (via AnalyticsResult (symbol, a top-level interface))
  • content/docs/releases/v17/17-5.mdx (via user_id (literal, a string literal in dimensions))
  • content/docs/releases/v17/17-6.mdx (via AnalyticsResult (symbol, a top-level interface))
  • content/docs/releases/v9.mdx (via AnalyticsResult (symbol, a top-level interface))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 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 — 144 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 c6bdcaccb7a3bd5715ddd461c156c16b3667490a → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json c6bdcaccb7a3bd5715ddd461c156c16b3667490a

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs c6bdcaccb7a3bd5715ddd461c156c16b3667490a → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

ACCEPT · domain:engine seat 1 · os-tesla · session_014Hse9cj2i4o5UAVrd21NKr · 2026-10-23T10:24Z · head b3dc0f513 · #25330 (Part of: PR 1 of the label half's three landings, per the claim amendment 6361158070)

  • Ruling carried: A (6358843349, maintainer 「同意」), the consumer of DatasetDimension.nullLabel (spec: DatasetDimension gains an optional nullLabel (I18nLabel) naming the null bucket, so a dashboard can label system writes "System" instead of "(None)" (ruling 6358843349 on #25330) #25391).

  • Shape: 9 files, about +246 / −5:

    • spec: a response-only nullLabel?: string member on AnalyticsResult.fields[] and its mirror AnalyticsResultResponseSchema, with a parse-preservation pin.
    • service-analytics enrichResultColumns: resolves the dimension's nullLabel with the same resolveI18nLabel at the request locale as label.
    • system.datasets.ts: user_id gets nullLabel covering every locale in the Setup bundles (en, zh-CN, ja-JP, es-ES).
    • data-api.mdx: the fields[] callout.
    • A patch changeset.

    NOT GOVERNED. Clause-② no: the member is response-only and adds no authorable key. Metadata-protocol none.

  • Read on the diff:

    • The label short-circuit became a nested if, so existing header labels are unchanged.
    • nullLabel is written only when it is declared and resolves, and never onto a measure column. That includes a measure whose name matches a dimension's field, and __compare twins.
    • An answer over a dataset with no nullLabel is byte-identical.
  • Pins: on both strategies (NativeSQL and ObjectQL): locale resolution, the plain-string form, the no-locale fallback, and no-key controls. Removing the carry turns 6 red, and the 2 controls stay green. platform-objects pins every bundle locale against the map.

  • Cross-lane: service-analytics was declared on [PM seat] domain:services — 🟢 os-sales #6021, and the spec contract files on [PM seat] domain:spec · seat 2 — 🟢 sunhaolin #18549 (6361152308). No objection was posted.

  • Gates: 42 check-runs on b3dc0f513: 36 success, 6 skipped, 0 failed; mergeable clean. The dev ran 115 derived gates, 114 of them; 1 was NOT MEASURED (check:dual-build-cjs-loads, covered by CI's full build).

  • Landing: the seat marks it ready and enables auto-merge. The objectui consumer follows, bumping its pin to this PR's merge commit. Then PR 2 lands with Fixes #25330 and flips the liveness row.


Generated by Claude Code

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/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants