Repository navigation
Commit d280de9
docs: stale prose on summary currency, the temporal-comparand door and analytics filters now says what the code does (#35806)
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoK8YCcS3hkJHvVLxZNeiKG8)_
Fixes #35409
Fixes #34611
Fixes #35522
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:两条拒绝提示改了措辞(汇总字段币种拒绝时点明子字段缺什么;日期过滤值无法识别时说明会按文本比较、可能选中全部或零行),其余是注释、升级说明和文档文字,行为不变。
- 为什么做:三张文字跟进卡(汇总币种、日期过滤值校验、分析过滤注释与仪表盘文档),旧文字比代码说得窄或说错了,AI 和开发者读到会写错。
- 出错会怎样:只影响提示和文档措辞,不改任何接受或拒绝的范围,直接撤回即可。
- 要你做什么:它更正了一条属于收窄的未发布升级说明(35394),合并队列守卫因此要你在 GitHub 上点一次
Approve;之后席位自主落地。
- 席位意见:通过,没有必改项(席位记录见本 PR 评论)。
## What changes
Text only. No accepted value, key, answer or code path moves; two
refusal messages change words.
### #35409 — summary `dynamic` currency (spec, ui/fields)
The doors admit a `dynamic` summary over any child `currency` field in
`dynamic` mode (`isTenantCurrencyAmount`,
`packages/spec/src/data/record-currency-path.ts:229-232`; read by
`stack.zod.ts:5033` and
`objectql/src/record-currency-aggregate-door.ts:87`).
- N2: module header says "three predicates" (`isRecordCurrencyCodeField`
:50, `storedHomeAmountSourceOf` :207, `isTenantCurrencyAmount` :229).
- N3: the (d) fallback arm now names what a `currency` child lacks
(`record-currency-path.ts:265-270`, used at :282): `fixed` with no
`defaultCurrency` code, or a `currencyMode` outside `dynamic` / `fixed`
/ `record`. A non-`currency` child keeps its old words ("is a 'number'
field, …"), so the existing pins in
`record-currency-guards.test.ts:1229-1230,1328` and
`currency-summary-home-rollup.test.ts:181,203` are unchanged and green.
One new case pins the two new arms by subject.
- N4: upgrade-guide entry
`18.summary-dynamic-currency-rollup-home-amount-judged-as-served.ts`
states the admitted set (surface, replacement, reason). Its `reason`
keeps the present-tense rule ("Both doors now admit it only there")
apart from the history: before the entry, `defineStack` judged it (then
admitting a stored home amount alone) and the engine registry judged
only `record` roll-ups. Its acceptance step now saves over "a child
field that is not a `currency` field in `dynamic` mode (a `fixed` EUR
amount, a plain number or a formula)". The comments in
`ui/packages/fields/src/currency.ts`, `index.tsx` and
`widgets/SummaryField.tsx` say the same.
- Skills text is out of scope (governed; seat 5 files it).
### #34611 — analytics filter-normalizer comments and `dashboards.mdx`
- N1: the `const` arm JSDoc and the `collectFilterLeaves` comment in
`filter-normalizer.ts` now give the full reason. `lowerFilterCondition`
(`packages/spec/src/data/filter-lowering.ts:445-470`) wraps every `$nin`
outside a `$not` in the NULL escape (`nullEscape`, :435), whose `notSet`
leaf names the member. Inside a `$not` it takes that escape when a row
with no value satisfies every operator of the spec, and otherwise a
`$null: false` requirement, either as its own conjunct or the enclosing
one (`requiredFields`, :182). `$null: false` normalizes to a `set` leaf
(`filter-normalizer.ts:1214`). Measured on the built spec at this head:
`{$not:{f:{$nin:[],$gt:5}}}` lowers to
`{$not:{$and:[{f:{$null:false}},{f:{$nin:[],$gt:5}}]}}`.
- N2: left as it is. The `#34514` changeset has been released: its
sentence is in `packages/services/service-analytics/CHANGELOG.md:126`,
and the changeset file is gone from `.changeset/`. The card's own rule
applies ("otherwise fix the docs only").
- D1: the 1,000-record bullet in `content/docs/ui/dashboards.mdx` now
says a single-valued relation "usually" runs as a subquery, and names
the id-read cases that
`content/docs/protocol/objectql/query-syntax.mdx:703-732` lists, a
multi-valued relation (on every driver) first. It also had a MongoDB
clause that disagreed with both `query-syntax.mdx:709-714` and the code.
On a read verb (`aggregate` included,
`relation-filter-lowering.ts:356`), a single-valued relation condition
on a driver without `readableIdsLeaf` (MongoDB, OData) is refused before
any read (`relationReadDriverRefusal`, :370). It is not id-read under
the cap. The bullet now says so, in the capability's terms: "a driver
that cannot run it in one read".
### #35522 — temporal-comparand door prose (objectql, core, lint, spec)
The rule, per kind, is `PLACEHOLDER_AT_THE_TEMPORAL_RULE` in
`packages/core/src/utils/temporal-comparand.ts:292-298`, applied at
:364-365:
- a date macro is stepped around, then judged by its year once resolved;
- a period key and a context token are judged as written;
- an unknown or record-context token is left to the resolver.
Each named sentence now states that rule:
- `temporal-comparand-door.ts`: the module Scope note and the
resolved-token section.
- `engine-top-level.ts`: the one comment above
`assertTemporalComparandsInterpretable`.
- `engine-delete-and-aggregate.ts`: the per-aggregation comment from
comment 7013425050, plus the same sentence on `having` in that file.
- `core/src/utils/import-coerce.ts`: the `readTimeOfDayCell` note. Every
placeholder is refused there first, by `classifyFilterToken` (:361).
- `spec/src/data/filter-number-comparand-declared-type.ts`: the tokens
section. The resolved forms now include the period key's ISO week key
(`filter-tokens.ts`, the period-key resolver).
- `lint/src/validate-rls-predicate-enforceability.ts`: which code a
placeholder gets with no caller. The card names it under
`packages/objectql/src/validation/`, but the file lives at
`packages/lint/src/`. On a temporal field a period key or a context
token answers `INVALID_FILTER` from the door. On a number or a boolean
field every placeholder does: the number door
(`filter-number-comparand-declared-type.ts:351`) and its boolean arm
(`filter-boolean-comparand-declared-type.ts:234`, wired under the number
door in `engine-top-level.ts`). Otherwise the resolver decides
(`filter-tokens.ts:491-528`).
- N4: the junk-literal consequence
(`temporal-comparand-door.ts:748-750`) now reads "As written it would
reach the driver and be compared as text: it may select every row, none
or the wrong ones (or raise a database error), an answer
indistinguishable from a real one." Neither "every row or none" nor "a
200" is exact: on a `date` field a partial day such as `'2026-06'`
selects a subset, and PostgreSQL raises a database error for text on a
`date` column (the measurement at :144). The `having` twin (:827-830)
says the same of the groups: "As written it would be compared with each
group as text: it may keep every group, none or the wrong ones (or raise
a database error), an answer indistinguishable from a real one." The
comments that quoted the old phrase (module note, `MisreadClass` doc,
year-class comment) are updated. The two `not.toContain` pins in
`engine-temporal-comparand-door.test.ts` and
`engine-temporal-year-range.test.ts` now name the new phrase, so they
are not vacuous. A positive pin on the junk cells
(`engine-temporal-comparand-door.test.ts`, the card's comparands test)
holds them to it.
- N6: see DELIBERATE CORRECTION below.
### DELIBERATE CORRECTION —
`.changeset/35394-context-token-temporal-door.md`
This changeset is pending (it is still in `.changeset/`). Its analytics
read-scope bullet now reads: "a scope that compares a `date`, `datetime`
or `time` field with a context placeholder is now refused at compile".
The predicate judges a context token as written on all three kinds
(`temporal-comparand.ts:292-298`), and the same changeset's own BREAKING
line already names all three. `check-empty-changeset` is red for this
note by design. The confirming record is the dispatching seat's
(landing-operations.md).
### Changeset
`.changeset/t1-stale-prose.md` bumps `patch` for `@objectstack/spec`,
`objectql`, `core`, `lint`, `service-analytics` and `@object-ui/fields`.
It carries the two declaration lines.
## Tests
<details><summary>Rework runs at 1965e42 (the L2 should-fixes S1 to S3,
nits N1 and N5)</summary>
- `pnpm --filter '@objectstack/service-analytics^...' --filter
'@objectstack/lint^...' build`, then `pnpm --filter @objectstack/spec
exec vitest run --maxWorkers=2 src/migrations
src/data/currency-summary-home-rollup.test.ts`: Test Files 6 passed (6),
Tests 220 passed (220).
- `pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2
src/engine-temporal-comparand-door.test.ts
src/engine-temporal-year-range.test.ts
src/filter-refusal-prescription-cap.test.ts
src/engine-aggregate-having-temporal-door.test.ts
src/engine-aggregate-positions.test.ts`: Test Files 5 passed (5), Tests
142 passed (142).
- `typecheck` for spec, objectql, lint and service-analytics: all Done.
Lock verdict: command-exit 0.
- Ablation of the moved junk pin (`scripts/ablation-replace.mjs` on
`temporal-comparand-door.ts`, the new message line put back to the old
"selecting every row or none" phrase): the anchor went 1 → 0 and the
blob 22fbb45 → 4960e73e. The card's comparands test went red (Tests 1
failed, 15 passed), then the file was restored and its blob equals HEAD,
with `git diff HEAD` empty.
</details>
<details><summary>Local runs at a555ecc</summary>
- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
src/data/currency-summary-home-rollup.test.ts src/migrations`: Test
Files 6 passed (6), Tests 220 passed (220).
- `pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2
src/record-currency-guards.test.ts
src/engine-temporal-comparand-door.test.ts
src/engine-temporal-year-range.test.ts
src/filter-refusal-prescription-cap.test.ts`: Test Files 4 passed (4),
Tests 132 passed (132).
- `typecheck` for spec, objectql, core, lint and service-analytics: all
Done. `@object-ui/fields` `type-check` was NOT MEASURED locally: the
`ui/` deps are unbuilt in this container (TS2307 on
`@object-ui/components` and others, in files this diff does not touch).
CI `Type Check UI` covers it.
- Ablation of the N3 message (`scripts/ablation-replace.mjs`, anchor `is
${defect}, not a` → `is ${kind}, not a`): the anchor went 1 → 0 and the
blob c0ea2ce → 67a4d5c7. The new case went red (Tests 1 failed, 21
passed), then the file was restored and its blob equals HEAD, with `git
diff HEAD` empty.
</details>
## Acceptance notes
- Contract review PASS at a555ecc (comment 7035670717): S1 to S3 and
nits N1 and N5 are folded in at 1965e42. N2, N3, N4 and N6 are left as
they are. S4 (the "resolves to an id or a date" sentences) is filed as
its own card.
- `overlap-check`: merges cleanly with `origin/main` and with #34817
(`engine-top-level.ts`). It reports a conflict with #35129, the Version
Packages PR, on the pending 35394 changeset. That conflict is the
expected delete-vs-modify shape for a pending note.
- `engine-top-level.ts:962-963` (number door comment) says every
placeholder resolves "to an id or a date". A period key resolves to a
week key. That comment is outside the one edit allowed on this file, so
it is left; the same sentence in
`filter-number-comparand-declared-type.ts` is corrected.
## Verification
Two minutes: `pnpm --filter @objectstack/spec exec vitest run
src/data/currency-summary-home-rollup.test.ts`. Expect 22 passed,
including "a `currency` child that is neither `dynamic` nor a
well-formed `record` / `fixed` …".
Read first:
1. `packages/spec/src/data/record-currency-path.ts`: the `defect` hunk.
It is the only new branch.
2. `packages/objectql/src/temporal-comparand-door.ts`: the junk message
at :747.
3. `content/docs/ui/dashboards.mdx`: the rewritten bullet.
L2 owed: `packages/spec/src/**` is in the diff, so one
`CONTRACT_REVIEW_TIER` review is owed.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb)_
---
Body refreshed 2026-11-20T10:13Z for the should-fix rework (contract
review 7035670717: S1–S3, N1, N5), head 1965e42.
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9d07723 commit d280de9
18 files changed
Lines changed: 180 additions & 80 deletions
File tree
- .changeset
- content/docs/ui
- packages
- core/src/utils
- lint/src
- objectql/src
- services/service-analytics/src/strategies
- spec/src
- data
- migrations/entries/semantic
- ui/packages/fields/src
- widgets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
588 | 592 | | |
589 | 593 | | |
590 | 594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
352 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
353 | 355 | | |
354 | 356 | | |
355 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1188 | 1188 | | |
1189 | 1189 | | |
1190 | 1190 | | |
1191 | | - | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
1192 | 1195 | | |
1193 | 1196 | | |
1194 | 1197 | | |
| |||
1454 | 1457 | | |
1455 | 1458 | | |
1456 | 1459 | | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
1460 | 1465 | | |
1461 | 1466 | | |
1462 | 1467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
200 | 203 | | |
201 | 204 | | |
202 | 205 | | |
| |||
446 | 449 | | |
447 | 450 | | |
448 | 451 | | |
449 | | - | |
450 | | - | |
| 452 | + | |
| 453 | + | |
451 | 454 | | |
452 | 455 | | |
453 | 456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
952 | 952 | | |
953 | 953 | | |
954 | 954 | | |
955 | | - | |
956 | | - | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
957 | 960 | | |
958 | 961 | | |
959 | 962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| |||
140 | 146 | | |
141 | 147 | | |
142 | 148 | | |
143 | | - | |
| 149 | + | |
| 150 | + | |
144 | 151 | | |
145 | 152 | | |
146 | 153 | | |
| |||
188 | 195 | | |
189 | 196 | | |
190 | 197 | | |
191 | | - | |
192 | | - | |
| 198 | + | |
| 199 | + | |
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
| |||
623 | 630 | | |
624 | 631 | | |
625 | 632 | | |
626 | | - | |
627 | | - | |
| 633 | + | |
| 634 | + | |
628 | 635 | | |
629 | 636 | | |
630 | 637 | | |
| |||
712 | 719 | | |
713 | 720 | | |
714 | 721 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
719 | 727 | | |
720 | 728 | | |
721 | 729 | | |
| |||
738 | 746 | | |
739 | 747 | | |
740 | 748 | | |
741 | | - | |
742 | | - | |
| 749 | + | |
| 750 | + | |
743 | 751 | | |
744 | 752 | | |
745 | 753 | | |
| |||
817 | 825 | | |
818 | 826 | | |
819 | 827 | | |
820 | | - | |
821 | | - | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
822 | 831 | | |
823 | 832 | | |
824 | 833 | | |
| |||
0 commit comments