Repository navigation
Commit 4fa4f2c
docs(spec,skills): object-metric polarity reads the aggregate before invert; pages.md points at compareTo (#28348)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoTXwoh1TJYxwy3kcKGFXGqj)_
Fixes #27375
Refs #27347
Clause-②: no
Metadata-protocol: none
Skills-docs: updated here
## 维护者速读
- 改了什么:`object-metric` 的 `polarity` 说明补一句——徽标箭头和 `polarity` 都读 `invert`
之前的聚合值,所以 `polarity` 按原始值声明(错误率显示成可用率时写 `lower`);`objectstack-ui` 技能的
`rules/pages.md` 在 `object-metric` 那一行加上指向 `dashboards.md` 的 `compareTo`
/ `polarity` 小节的链接。
- 为什么改:开了 `invert` 的指标卡上有两个数(原始值和 `1 - 值`),原文没说箭头读哪个,作者可能把好坏方向写反;从
`pages.md` 搭内联 KPI 的作者原先找不到 `polarity` 这个键。
- 风险与回滚:纯文字改动,schema、可接受值、默认值和渲染行为都不变;`pages.md` 的新增由同文件删掉三处重复表述抵付,token
数不变,天花板不动。回滚即 revert 本 PR。
- 先看:`packages/spec/src/ui/component.zod.ts` 的 `polarity`
describe、`skills/objectstack-ui/rules/pages.md` 第 56 行与三处删减。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期全绿,`pages.md` 为
5689 / 5692。
- 需要你做的:本 PR 触及 `skills/**`(Tier H),需要 os-zhuang 或 hotlong 的 APPROVED
评审,之后由席位落地。
## What changes
**S1: the `polarity` prose says which number it reads
(`packages/spec/src/ui/component.zod.ts`).** `ObjectMetricWidget`
computes the derived trend from the raw `fetchedValue` /
`previousValue`, while the number it shows is `1 - value` under `invert:
true` (read at `501c864d`:
`ui/packages/plugin-dashboard/src/ObjectMetricWidget.tsx`, the `invert`
branch near L590 and `derivedTrend` near L684). The `polarity` describe
now ends with one sentence: the badge and polarity read the aggregate
before `invert`, so polarity is declared against the raw value, and an
error rate shown as uptime is `lower`. The TSDoc above it says the same
in one sentence. `content/docs/references/ui/component.mdx` is
regenerated (`check:generated` named only `check:docs`). The SDUI
manifest does not carry this describe (0 hits for the old text in
`sdui.manifest.json`), so it is not regenerated.
**S2: `rules/pages.md` points at the polarity rule.** The
`object-metric` row of the component catalogue now reads `Single KPI
widget (count/sum/avg); trend colour = polarity, see compareTo`, with
the link going to `dashboards.md#period-over-period--compareto` (the
anchor the file's own table of contents uses). The pointer is paid for
by deleting three restatements in the same file:
- `(the CSS is scoped to it)` after "needs a stable `id`": the paragraph
above already says the renderer compiles each node to id-scoped CSS.
- the `// responsive via the model` comment in the styling example: the
rule "Responsive lives in the breakpoint maps" above it says this.
- `(it is real JS, not constrained JSX)` after "`os build` does NOT lint
react source": the tier table at the top of the section says this.
Standing ruling (2026-10-27, tap A, verbatim and untranslated):
「A:先削重复,余额按实测提高」; recognised path per ruling record 6513306068. The cuts
cover the whole pointer, so there is no remainder and the `pages.md` row
in `scripts/check-skills-token-ratchet.mjs` is not touched.
### Skill bundle readings (`skills/**` touched)
| | before (`501c864d`) | after |
|:---|---:|---:|
| `skills/objectstack-ui/rules/pages.md` | 428 lines · 22756 bytes ·
5689 tokens | 428 lines · 22753 bytes · 5689 tokens (ceiling 5692) |
| all `SKILL.md` in `skills/` | 4607 lines | 4607 lines |
| `skills/objectstack-ui/**/*.md` (evals excluded) | 2055 lines | 2055
lines |
**Changeset:**
`.changeset/27375-object-metric-polarity-before-invert.md`,
`@objectstack/spec` patch and `@objectstack/skills` patch, with both
declaration lines. The spec patch is measured, not assumed: after `pnpm
--filter @objectstack/spec build`, the new describe text is in
`packages/spec/dist/chunk-*.{js,mjs}` and
`json-schema/ui/ObjectMetricProps.json`, and both `dist` and
`json-schema` are in the package's `files[]`.
## Tests
No behaviour changes, so there is no new test and no ablation. The
derived-gate set ran locally on the head named under Verification; see
that section.
## Acceptance notes
- Out of scope by the dispatch ruling, and not measured here: whether
the arrow should follow the displayed number when `invert` and
`compareTo` are both set. Nothing in this PR changes it.
## Verification
Head `ebeb7783`, merge base `501c864d`. Derived with `node
scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` (4 paths, 30 changed lines), each line run
with stdin from /dev/null and its exit code written to disk before any
pipe.
- `pnpm --filter @objectstack/spec build`: VERDICT command-exit 0.
`check:generated` named only `check:docs` stale (13 of 14 up to date);
`check:generated --fix` rewrote
`content/docs/references/ui/component.mdx` and nothing else.
- Reconciliation, `dispatch-gates.mjs --repo objectstack-ai/objectstack
--ran`: "104 derived, 103 run, 1 NOT-MEASURED, 0 UNRUN".
- Seven gates first refused on unbuilt prerequisites (exit 3). After
deepening the clone and building the `@objectstack/lint`,
`@objectstack/client-react` and `@objectstack/objectql` closures, six of
them re-ran green.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: it loads the
built CJS entry of every package and 34 had no `dist/`; a full workspace
build was not run for a prose-only diff. CI's `Lint & Repo Gates` runs
it.
<details><summary>Derived gates, with exit codes</summary>
```text
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dev-prereqs.mjs --self-test :: exit 0
node scripts/check-doc-route-spelling.mjs --advisory :: exit 0
node scripts/check-doc-route-spelling.mjs --self-test :: exit 0
node scripts/check-docs-section-name.mjs :: exit 0
node scripts/check-docs-section-name.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-section-landing-index.mjs :: exit 0
node scripts/check-section-landing-index.mjs --self-test :: exit 0
node scripts/check-skills-token-ratchet.mjs :: exit 0
node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:api-surface :: exit 0
pnpm --filter @objectstack/spec run check:authorable-surface :: exit 0
pnpm --filter @objectstack/spec run check:browser-reachable-entries :: exit 0
pnpm --filter @objectstack/spec run check:docs :: exit 0
pnpm --filter @objectstack/spec run check:dual-source-exports :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:empty-state :: exit 0
pnpm --filter @objectstack/spec run check:entry-nameability :: exit 0
pnpm --filter @objectstack/spec run check:export-origins :: exit 0
pnpm --filter @objectstack/spec run check:exported-any :: exit 0
pnpm --filter @objectstack/spec run check:generated :: exit 0
pnpm --filter @objectstack/spec run check:liveness :: exit 0
pnpm --filter @objectstack/spec run check:llms-txt :: exit 0
pnpm --filter @objectstack/spec run check:skill-refs :: exit 0
pnpm --filter @objectstack/spec run check:strictness-ledger :: exit 0
pnpm --filter @objectstack/spec run check:variant-docs :: exit 0
pnpm --filter @objectstack/spec run check:yaml-examples :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:corpus-claim-drift :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:doc-anchors :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:doc-frontmatter :: exit 0
pnpm check:docs-audit-scope :: exit 0
pnpm check:docs-redirects :: exit 0
pnpm check:docs-single-h1 :: exit 0
pnpm check:docs-spec-enumerations :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:pm-changeset-deadline-census :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:pm-skill-id-lint :: exit 0
pnpm check:published-files :: exit 0
pnpm check:published-readme-links :: exit 0
pnpm check:react-page-adapter-contract :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-compatibility :: exit 0
pnpm check:skill-frame-sync :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:spec-docblock-symbol-anchors :: exit 0
pnpm check:spec-parsed-alias :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:vendor-version-stamps :: exit 0
pnpm check:watch-hint-literal :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/lint run check:doc-security-posture :: exit 0
pnpm --filter @objectstack/spec run check:skill-examples :: exit 0
pnpm check:docs-transcript-drift :: exit 0
pnpm check:dual-build-cjs-loads :: exit 3
pnpm check:lean-entry-closure :: exit 0
```
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibyvwrLkwf1kTpdV1Qc)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ea1751b commit 4fa4f2c
4 files changed
Lines changed: 23 additions & 7 deletions
File tree
- .changeset
- content/docs/references/ui
- packages/spec/src/ui
- skills/objectstack-ui/rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1222 | 1222 | | |
1223 | 1223 | | |
1224 | 1224 | | |
1225 | | - | |
| 1225 | + | |
1226 | 1226 | | |
1227 | 1227 | | |
1228 | 1228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5793 | 5793 | | |
5794 | 5794 | | |
5795 | 5795 | | |
5796 | | - | |
| 5796 | + | |
| 5797 | + | |
| 5798 | + | |
5797 | 5799 | | |
5798 | 5800 | | |
5799 | 5801 | | |
5800 | 5802 | | |
5801 | | - | |
| 5803 | + | |
| 5804 | + | |
5802 | 5805 | | |
5803 | 5806 | | |
5804 | 5807 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
| 269 | + | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| |||
0 commit comments