Repository navigation
Commit 367e324
docs(skills): a zoned date bucket stays in memory only where the driver cannot bucket that zone (#35012)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBLW6dHPW6sSheA32XPKZzPV)_
Fixes #34597
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:查询技能 `aggregation.md` 里一句话,原来说「非 UTC 时区的日期分桶会让整次聚合在内存里算」,现在改成:声明了
`supports.zonedDateBucketing` 的驱动(目前只有 driver-sql 的
PostgreSQL)在时区能解析成地区/城市名时直接在库里分桶;其它驱动、以及 `+08:00`、`EST5EDT`
这类解析不出地区的时区,仍整次在内存里算。另加一条 eval。
- 为什么改:#33697 合并后 PostgreSQL 已经在库里算带时区的分桶,旧句子对 PG 是错的,AI 读技能会对性能和
`aggregationFilter` 行为做出错误判断。
- 风险与回滚:只改对外发布的技能文字和 eval,不动代码;回滚就是还原这一个 PR。
- 先看:`skills/objectstack-query/rules/aggregation.md` 第 127–131
行(新句子),`skills/objectstack-query/evals/filters-pagination-search.json` 的
eval 9,`.changeset/34597-skills-zoned-date-bucket.md`。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期看到
`aggregation.md is 2346 tokens (ceiling 2357; headroom 11)` 且整体通过。
- 需要你做的:无,席位落地(`skills/**` 属受治理面,按其档位记录落地)。
## What changes
`skills/objectstack-query/rules/aggregation.md`, section "Filtered
Aggregation (FILTER WHERE)": the parenthetical that said a date bucket
under a non-UTC `timezone` keeps the whole call in memory now matches
the merged engine.
- Old: "(a date bucket under a non-UTC `timezone`, or one the driver
does not bucket natively, keeps the whole call in memory)"
- New: "(a date bucket the driver does not bucket natively keeps the
whole call in memory; so does one under a non-UTC `timezone`, unless the
driver declares `supports.zonedDateBucketing` — PostgreSQL via
`driver-sql` — and the zone resolves to an area/location: `Asia/Taipei`
buckets in the database, `+08:00` or `EST5EDT` never)"
Sources, read at `origin/main` 4443014:
`packages/objectql/src/engine-delete-and-aggregate.ts` lines 1435–1459
(`judgeBucketZone`, `zoneNative`, `tzRequiresInMemory`, which gates
`nativeAggregate` at line 1488) and
`packages/drivers/driver-sql/src/sql-driver.ts` line 409
(`zonedDateBucketing: this.isPostgres`).
`skills/objectstack-query/evals/filters-pagination-search.json`: new
eval case 9 (monthly revenue on Taipei calendar months with a filtered
count; PostgreSQL vs SQLite vs `+08:00`). No earlier case exercised the
sentence.
`.changeset/34597-skills-zoned-date-bucket.md`: `@objectstack/skills`
patch, the same shape as the earlier skills-text notes.
## Why
#33697 (ADR-0053 Phase 2 D2 as amended, maintainer ruling 「PG 在库里算,修订
ADR」) made PostgreSQL bucket a zoned date in the database. The skill
still told authors and agents the whole call runs in memory, which is
false on PostgreSQL for an area/location zone.
## Tests
No code changed, so there is no unit test or ablation. Eval check by
script at head 2555c75: case ids 1–9 distinct; every `must_contain` of
every case appears in its `expected_output`; no `must_not_contain`
appears in it (0 violations).
Skills readings (lines): `aggregation.md` 272 → 275; eval file 85 → 95
(unpriced, population 1b); sum of all `SKILL.md` 4730 → 4730
(unchanged); all `skills/**/*.md` 18128 → 18131. Tokens:
`aggregation.md` 2292 → 2346 against ceiling 2357 (headroom 11), paid
from existing headroom; no ceiling row moved.
## Acceptance notes
- `dispatch-gates --tier` derives a mandatory contract-review authoring
tier for `skills/**`. The claim's `Container & model` line records
`TIER_DEFAULT`, and this run was served at that tier, so this body
carries no `Served-tier: CONTRACT_REVIEW_TIER` line. The seat decides
the review route.
- Grepped `skills/objectstack-query/**` (SKILL.md, rules, references)
for the same claim: no other sentence says a zoned bucket always stays
in memory. `rules/aggregation.md` § Date-Bucketed Grouping does not
mention `timezone` at all; it is not the same false claim and is left as
is.
- Observation, not filed: `content/docs/data-modeling/queries.mdx`
(Date-bucketed grouping callout) says the SQL driver ignores a
structured `groupBy` `alias`, while the skill says results are correct
either way "including the column keys". Not measured on a public door;
outside this card's file surface.
## Verification
Local targeted gates at head 2555c75: 46 derived by `node
scripts/pm/dispatch-gates.mjs --commands`, plus `check:skill-examples`,
`check:skill-docs`, `check:skill-refs` (the `os:check` and skill-doc
gates). `dispatch-gates --ran`: 46 accounted — 45 run, 1 NOT MEASURED.
<details><summary>Gate readings</summary>
- 48 commands exit 0, including `node
scripts/check-skills-token-ratchet.mjs` (and `--self-test`), `pnpm
check:skill-links`, `pnpm check:skill-identifier-liveness`, `pnpm
check:skill-compatibility`, `pnpm check:skill-frame-sync`, `pnpm
check:doc-authoring`, `pnpm check:nul-bytes`, `pnpm
check:published-files`, `node scripts/check-empty-changeset.mjs --base
origin/main`, `node scripts/check-changeset-no-major.mjs --base
origin/main`, `node scripts/check-adr-0087-registration.mjs --base
origin/main`, `pnpm --filter @objectstack/spec check:skill-examples`,
`check:skill-docs`, `check:skill-refs`.
- `pnpm check:dual-build-cjs-loads`: exit 3, PREREQUISITE NOT MET (needs
a full build). NOT MEASURED locally; CI runs it.
- `node scripts/pm/overlap-check.mjs
--branch=claude/issue-34597-aggregation-zoned-bucket`: `VERDICT clean
exit 0` (merges cleanly into origin/main; no PR head collides).
- Builds under the verify lock: `@objectstack/lint...` and
`@objectstack/client-react...`, both `VERDICT command-exit 0`.
</details>
## Fix round 2 (seat contract review 6963664711)
- S1 (should-fix): eval case 9's `must_not_contain` held `timezone:
'+08:00'`. The case's own prompt asks about passing `+08:00`, and the
grader matches substrings, so a correct answer restating it as code
would fail. Dropped that one token; `must_not_contain` is now
`["date_trunc"]`. `must_contain` (`timezone: 'Asia/Taipei'`, `in
memory`, the rest) and N1/N2 are unchanged; `aggregation.md` is
unchanged.
- Head 6465f93. Eval script check: ids 1-9 distinct, 0 violations.
`check-skills-token-ratchet` (+`--self-test`), `check:nul-bytes`,
`check:skill-links`, `check:skill-identifier-liveness`,
`check:skill-compatibility`, `check:skill-frame-sync`,
`check:doc-authoring`, `check:published-files`,
`check:corpus-claim-drift`, `check:role-word`, `check:pm-skill-id-lint`:
all exit 0. `overlap-check`: VERDICT clean exit 0.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (no code changed; the
repo-wide lint run is CI's)
- [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: its generated artifacts are
regenerated and committed. (not touched)
- [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 by [Claude
Code](https://claude.ai/code/session_01WGufzfrh8TiPJf1i2kMSoa)_
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzfrh8TiPJf1i2kMSoa -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9089728 commit 367e324
3 files changed
Lines changed: 25 additions & 2 deletions
File tree
- .changeset
- skills/objectstack-query
- evals
- rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
0 commit comments