Skip to content

Commit aa57c76

Browse files
feat(spec): add next_month, next_quarter and next_30_days date-range presets (#30133)
domain:spec#3 · os-support-ai · session_01WGufzfgvGexKn9vLHsy89K <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBNZcb3qbDCs7tSZcvMtReq8)_ Fixes #30076 Ruling-ref: 6631151570 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: none — `git grep -n "last_90_days\|last_30_days" -- skills .claude/skills` has 0 hits, and no `skills/**` line lists the preset vocabulary (the dashboards rule only uses `this_quarter` / `this_year` as examples). Nothing is owed to the paused skills lane. Prior rulings read: date-range-presets,date_range_presets,next_month → 0 hits; none; thread: none; repo: objectstack-ai/objectstack (the card's own ruling 6631151570 is the scope; the tool reads rulings by first-line shape and did not classify it) ADR-0087: not needed. Nothing is removed or narrowed; the 13 existing windows are byte-identical. ## 维护者速读 - 改了什么:spec 的日期预设表新增三个往后看的预设:`next_month`(下月)、`next_quarter`(下季度)、`next_30_days`(未来 30 天),服务端 `analytics-date-range` 能解析它们,控制台 10 种语言都有标签。 - 为什么改:卡片 #30076 的裁决 A(「其他全部同意」)。销售预测问的都是往后:下个月、下季度、未来 30 天成交什么;以前只能用会过期的自定义日期。 - 风险与回滚:只加不改,原有 13 个窗口一字不动。下月、下季度的服务端终点没有现成宏,采用席位批准的“重锚定”:同一个解析器从下月第一天再算一次“下月第一天”,不新增宏 token,也不在 core 里做日期运算。回滚就是 revert。 - 先看:`packages/spec/src/data/date-range-presets.ts`(表和顺序说明)、`packages/core/src/utils/analytics-date-range.ts`(重锚定),以及下面的测量表。 - 两分钟验证:`pnpm --filter @objectstack/spec exec vitest run src/data/date-range-presets.test.ts`,然后 build spec 后 `pnpm --filter @objectstack/core exec vitest run src/utils/analytics-date-range.test.ts`(含上海、纽约 DST、查塔姆群岛行)。 - 需要你做的:现在不用做什么,等 CI 和席位验收。 ## What changes - **Spec** (`packages/spec/src/data/date-range-presets.ts`): `DATE_RANGE_PRESETS` adds `next_month`, `next_quarter`, `next_30_days`, named after `last_30_days`'s spelling. `DATE_RANGE_PRESET_MACRO_WINDOWS` adds their rows in the inclusive last-day convention (commit 80aef80), and the closed-window rule now covers the forward presets. Every row is pinned by extent in `date-range-presets.test.ts` (reference day 2026-07-15: August is 31 days, Q4 is 92, `next_30_days` is 31 days like `last_30_days`). - **Display order** (the filter bar reads the array in order): `this_month, last_month, next_month`, `this_quarter, last_quarter, next_quarter`, then `last_7_days, last_30_days, last_90_days, next_30_days`. Each forward preset sits in the family it extends, after the backward member, so all month windows are found in one place and the rolling group reads backward then forward. The existing 13 keep their relative order; no forward preset opens a group, because the backward windows are the ones most filters ask for. - **`next_30_days` = today plus the 30 days after it** (`['{today}', '{30_days_from_now}']`), the mirror of `last_30_days` (`['{30_days_ago}', '{today}']`). It opens on today because a row due today is still ahead of a forecast. - **Server** (`packages/core/src/utils/analytics-date-range.ts`): `PRESET_WINDOW_TOKENS` resolves the three half-open. A bound may now be `{ token, from }`: resolve `from`, then resolve `token` again with the reference instant moved into that day (its noon) in the same zone. `next_month` ends at `{ token: 'next_month_start', from: 'next_month_start' }`, i.e. the month after next; `next_quarter` likewise. The resolver stands at noon of the anchor day, not its first instant: where a zone springs forward at 00:00 on a period's first day (America/Asuncion, 2023-10-01) the day has no midnight, the day-start instant reads as the day before, and the window came out empty (measured: `end === start`). Seat ruling on this card thread: re-anchor, no new macro token (option A of the seat's two). - **Readers that close over the vocabulary**: the conformance kit (`analytics-date-range-conformance.ts`), `analytics-date-range-closed-vocabulary.test.ts` and lint `validate-preset-comparands.ts` iterate `DATE_RANGE_PRESETS`, so they take the three without edits. objectql `temporal-comparand-door.ts` does not iterate the list: it judges a comparand by the field's declared type, so a new preset name needs nothing there (its test passes unchanged). Only prose counts ("the 13 declared names", "each of the thirteen") were made count-free. - **ui/** (seat-lifted, exactly these): the three labels in all 10 packs under `ui/packages/i18n/src/locales/` (ar, de, en, es, fr, ja, ko, pt, ru, zh; zh-Hant has no pack yet, phase 2 of #29428, so none is created); the three English defaults in `filter-builder.tsx`'s label table (measured: without them the 29115 test renders the raw keys `dashboard.filters.range.next_month`, 4 cases red); `next_month_end` and `next_quarter_end` in the client resolver `ui/packages/core/src/utils/date-macros.ts` (spec tokens the client did not resolve; without them the console lowers 下月 to `['2026-08-01', '{next_month_end}']`); and the two pins that counted 13 (`dashboard-filters.presetWindows-29116.test.ts`, `filter-builder-relative-dates-29115.test.tsx`). - **`packages/verify`** (`dashboard-window.ts`, a reader of `DATE_RANGE_PRESETS`): its fixture rows were written only on days up to today, so the three forward windows selected no rows and 5 of 15 cases in `dashboard-window.test.ts` went red. A window whose last day is after today now also writes its own future edges; the days written for the 13 existing presets are unchanged (15/15 green). - **Pins**: `packages/spec/src/ui/dashboard.test.ts` counted 13 presets and 14 default ranges; now 16 and 17. The 29116 test's compareTo case runs on the 13 retired presets only, with a comment naming #30140. - **Docs**: `content/docs/ui/dashboards.mdx` preset table; stale "13 presets" / "never after today" prose in `packages/verify/README.md` and `content/docs/deployment/cli.mdx`; the preset list in `ui/packages/plugin-dashboard/README.md`; `content/docs/references/**` regenerated by `gen:docs`; the `docs/qa/platform-checklist/areas/api-backend.json` item `api-backend.date-range-preset-matrix` widened to 16 variants (revision 3, `enumSource.expect: 16`). ## Measurement: preset → spec window → server window → resolves? Reference: spec on 2026-07-15 (UTC days); server on `now` 2026-09-09T12:34:56.789Z unless noted. Server windows are `[start, end)` instants. | preset | spec window (inclusive, `$between`) | server half-open tokens | server window | resolves? | |---|---|---|---|---| | `next_month` | `['{next_month_start}', '{next_month_end}']` → 2026-08-01 … 2026-08-31 | `next_month_start` → `next_month_start` re-anchored on `next_month_start` | 2026-10-01T00:00Z → 2026-11-01T00:00Z | yes, by re-anchoring (no `month_after_next_start` token exists; `PERIOD_RE` stops at `next_`) | | `next_quarter` | `['{next_quarter_start}', '{next_quarter_end}']` → 2026-10-01 … 2026-12-31 | `next_quarter_start` → `next_quarter_start` re-anchored on `next_quarter_start` | 2026-10-01T00:00Z → 2027-01-01T00:00Z | yes, by re-anchoring | | `next_30_days` | `['{today}', '{30_days_from_now}']` → 2026-07-15 … 2026-08-14 | `today` → `31_days_from_now` | 2026-09-09T00:00Z → 2026-10-10T00:00Z | yes, directly (parametric days resolve to a calendar day) | Timezone and DST rows pinned in `analytics-date-range.test.ts` (`#30076` block): | preset | now | zone | window | why | |---|---|---|---|---| | `next_month` | 2026-01-31T20:00Z | Asia/Shanghai | 2026-02-28T16:00Z → 2026-03-31T16:00Z | the Shanghai day is already Feb 1, so next month is March | | `next_month` | 2026-01-31T20:00Z | UTC | 2026-02-01T00:00Z → 2026-03-01T00:00Z | control | | `next_month` | 2026-10-15T12:00Z | America/New_York | 2026-11-01T04:00Z → 2026-12-01T05:00Z | DST ends Nov 1: start EDT, end EST | | `next_quarter` | 2026-12-10T12:00Z | America/New_York | 2027-01-01T05:00Z → 2027-04-01T04:00Z | year rollover, EST start, EDT end | | `next_30_days` | 2026-10-20T12:00Z | America/New_York | 2026-10-20T04:00Z → 2026-11-20T05:00Z | window crosses DST end | | `next_month` | 2026-03-15T00:00Z | Pacific/Chatham | 2026-03-31T10:15Z → 2026-04-30T11:15Z | +13:45 then +12:45, non-whole-hour | | `next_month` | 2023-09-15T12:00Z | America/Asuncion | 2023-10-01T03:00Z → 2023-11-01T03:00Z | springs forward at 00:00 on Oct 1; a midnight anchor gave an empty window | | `next_quarter` | 2023-08-15T12:00Z | America/Asuncion | 2023-10-01T03:00Z → 2024-01-01T03:00Z | the quarter opens on the gap day | The existing `#17341` sweep (every preset, 8 instants × 4 zones) also holds each new end to "the day after the spec's inclusive last day", and the tiling test now includes `this_month → next_month` and `this_quarter → next_quarter`. ## UI reader measurement | reader | reads the spec table? | result | |---|---|---| | `ui/packages/core/src/utils/dashboard-filters.ts` | yes: imports `DATE_RANGE_PRESETS` and lowers through `DATE_RANGE_PRESET_MACRO_WINDOWS` | takes the three with no edit | | `ui/packages/components/src/custom/filter-builder.tsx` | yes: `DATE_RANGE_PRESETS.map(...)` for options and label keys | takes the three; its English defaults table needed the three rows | | `ui/packages/core/src/utils/date-macros.ts` (client resolver) | no: its own token table | lacked `next_month_end` / `next_quarter_end`; added here. `next_week_end` and `next_year_end` are still missing: follow-up #30134 | | `ui/packages/types/src/data-protocol.ts:595-610` | no: a hand-kept union | already lists `next_month`, `next_quarter`, `next_30_days` (plus undeclared `next_year`, `next_7_days`, `next_90_days`); not edited | No `domain:ui` follow-up is needed for the preset list itself: both readers derive from the spec. ## Follow-ups - #30134 (`domain:ui`, p3): the console's client resolver leaves `{next_week_end}` and `{next_year_end}` unresolved. - #30140 (`domain:ui`, p2): dashboard `compareTo` on a forward preset compares the window with itself. `compare-to.ts` is not touched here. ## Verification - spec suite (os-verify-lock): 24,399 passed after the dashboard pin move (811 files); spec typecheck passed. - core suite: 133 files, 2,970 passed at f7e8b20; `analytics-date-range.test.ts` 73 at the round-1 head (two Asuncion rows added). core and lint typecheck passed (after a full `packages/**` build, 80/80 tasks). - Readers that iterate the vocabulary: driver-memory date-range conformance, DST, timezone and arity files (49 passed); service-analytics conformance and arity (42); verify `dashboard-window.test.ts` (15); lint `validate-preset-comparands.test.ts` (29); objectql `engine-temporal-comparand-door.test.ts` (14); driver-sql `sql-driver-calendar-day-upper-bound.test.ts` (18); service-analytics `native-sql-temporal-comparand-decline.test.ts` (8); verify typecheck passed. - ui (from the `ui/` root): `dashboard-filters.presetWindows-29116`, `filter-builder-relative-dates-29115`, `dashboard-range-preset-labels-4984`, `en-zh-key-parity`: 4 files, 112 passed. - `pnpm --filter @objectstack/spec check:generated`: all 14 artifacts current. - Derived gates: `dispatch-gates --commands` listed 108; all 108 run, `--ran` reconciles 108/108, 0 NOT-MEASURED. 107 exit 0. `pnpm check:platform-checklist` exits 1 on one finding that is on `main` already: `areas/platform-core.json` anchors `packages/metadata-protocol/src/protocol.ts#assertProtocolCompat`, which `origin/main`'s `protocol.ts` no longer declares (0 matches at base `f68b47ca`). This PR's own checklist item passes. `check:generated` crashed once on heap at 4 GB inside `check:test-typecheck` and passed at CI's 6 GB (`NODE_OPTIONS=--max-old-space-size=6144`). - Lint: eslint on every changed file, 0 errors. - Round 1 (contract review 6634808446): derivation grew by one family, `pnpm check:cli-examples-parity`, exit 0; the docs gates for the edited prose (`check:doc-authoring`, `check:docs-transcript-drift`, `check:doc-anchors`, `check-affected-docs`, `check-drift-comment`, `check:published-readme-links`, `check:issue-citations`, `check:docs-spec-enumerations`) exit 0; the ui 29116 test 51 passed. ## 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. - [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. - [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 with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WGufzj9os3R42oiDRwN6HZ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 471add3 commit aa57c76

32 files changed

Lines changed: 341 additions & 43 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/core': minor
4+
'@objectstack/lint': patch
5+
'@objectstack/verify': patch
6+
'@object-ui/core': minor
7+
'@object-ui/components': minor
8+
'@object-ui/i18n': minor
9+
---
10+
11+
feat(spec): three forward date-range presets: `next_month`, `next_quarter` and `next_30_days`
12+
13+
Clause-②: yes (widening)
14+
Metadata-protocol: added
15+
16+
The relative dates a dashboard date filter and the filter builder offer looked only backward. A forecast asks forward: what closes next month, next quarter, in the next 30 days. Those questions had to use a custom range, whose fixed dates go stale.
17+
18+
`DATE_RANGE_PRESETS` now also declares `next_month` (the whole of next month), `next_quarter` (the whole of next quarter) and `next_30_days` (today and the 30 days after it, the mirror of `last_30_days`). Every place that accepts a preset accepts them: `dashboard.dateRange.defaultRange`, a date global filter's `defaultValue`, the filter builder's `between` row and `AnalyticsQuery.timeDimensions[].dateRange`. They sit beside the family they extend in the filter bar: `next_month` after `last_month`, `next_quarter` after `last_quarter`, `next_30_days` after `last_90_days`. Their `DATE_RANGE_PRESET_MACRO_WINDOWS` rows follow the inclusive last-day convention: `['{next_month_start}', '{next_month_end}']`, `['{next_quarter_start}', '{next_quarter_end}']` and `['{today}', '{30_days_from_now}']`. A preset name written as a bare filter comparand is refused with that window as the prescription, as for the other presets.
19+
20+
`@objectstack/core`'s `resolveAnalyticsDateRangePreset` resolves the three in its half-open form. `next_30_days` stops before `{31_days_from_now}`. `next_month` and `next_quarter` stop before the month and the quarter after next, which no macro token names: the resolver reads `next_month_start` (or `next_quarter_start`) again from the start of the day it named, so the end is still a day the one token resolver computed. No macro token is added.
21+
22+
In the console, the three presets have labels in all ten locale packs, and the client date-macro resolver now answers `{next_month_end}` and `{next_quarter_end}`, two spec tokens it did not resolve before. `@objectstack/verify`'s dashboard-window proof also writes fixture rows on a forward preset's future edges, so it judges the three new windows; the days it writes for the other presets are unchanged. `@objectstack/lint` changes documentation only.

‎content/docs/deployment/cli.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,12 +2592,12 @@ os verify --dashboard-windows # Also prove each dashboard date
25922592
measure of a bound widget that is a count, a sum, or a derived measure over
25932593
those, fixture rows are written through the seed door
25942594
on every preset's first and last day and the day either side (never after
2595-
today), stamped at UTC noon, owned by the caller and holding every column
2595+
today, except a forward preset's own edges, which are future days), stamped at UTC noon, owned by the caller and holding every column
25962596
the widget's own filter, the dataset's filter and the measure's filter
25972597
compare (the smallest record first, every synthesized field if the seed
25982598
door refuses it), and read back. The widget is then asked through
25992599
`POST /analytics/dataset/query` as the signed-in admin with no window and
2600-
under each of the 13 presets, before and after the fixtures. A preset is
2600+
under each preset, before and after the fixtures. A preset is
26012601
handed as the spec's `{date-macro}` window for it
26022602
(`{ $gte: '{7_days_ago}', $lte: '{today}' }` for `last_7_days`, `{ $gte: '{month_start}', $lte: '{month_end}' }` for
26032603
`this_month`), ANDed with the widget's filter, and the server resolves the

‎content/docs/references/api/analytics.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const result = AnalyticsEndpoint.parse(data);
107107
| :--- | :--- | :--- | :--- |
108108
| **dimension** | `string` | ✅ | |
109109
| **granularity** | `Enum<'day' \| 'week' \| 'month' \| 'quarter' \| 'year'>` | optional | |
110-
| **dateRange** | `Enum<'today' \| 'yesterday' \| 'this_week' \| 'last_week' \| 'this_month' \| 'last_month' \| …> \| [string, string]` | optional | Time window for this dimension: a date-range PRESET name from the closed vocabulary in `data/date-range-presets.ts` (today, yesterday, this_week, last_week, this_month, last_month, this_quarter, last_quarter, this_year, last_year, last_7_days, last_30_days, last_90_days — e.g. `'last_7_days'`), or an explicit `[start, end]` array of ISO dates / `{date-macro}` tokens (e.g. `["2023-01-01", "2023-01-31"]`). Any other string is refused at the schema with `400 ANALYTICS_DATE_RANGE_UNRECOGNIZED`. |
110+
| **dateRange** | `Enum<'today' \| 'yesterday' \| 'this_week' \| 'last_week' \| 'this_month' \| 'last_month' \| …> \| [string, string]` | optional | Time window for this dimension: a date-range PRESET name from the closed vocabulary in `data/date-range-presets.ts` (today, yesterday, this_week, last_week, this_month, last_month, next_month, this_quarter, last_quarter, next_quarter, this_year, last_year, last_7_days, last_30_days, last_90_days, next_30_days — e.g. `'last_7_days'`), or an explicit `[start, end]` array of ISO dates / `{date-macro}` tokens (e.g. `["2023-01-01", "2023-01-31"]`). Any other string is refused at the schema with `400 ANALYTICS_DATE_RANGE_UNRECOGNIZED`. |
111111

112112

113113
---
@@ -236,7 +236,7 @@ const result = AnalyticsEndpoint.parse(data);
236236
| :--- | :--- | :--- | :--- |
237237
| **dimension** | `string` | ✅ | |
238238
| **granularity** | `Enum<'day' \| 'week' \| 'month' \| 'quarter' \| 'year'>` | optional | |
239-
| **dateRange** | `Enum<'today' \| 'yesterday' \| 'this_week' \| 'last_week' \| 'this_month' \| 'last_month' \| …> \| [string, string]` | optional | Time window for this dimension: a date-range PRESET name from the closed vocabulary in `data/date-range-presets.ts` (today, yesterday, this_week, last_week, this_month, last_month, this_quarter, last_quarter, this_year, last_year, last_7_days, last_30_days, last_90_days — e.g. `'last_7_days'`), or an explicit `[start, end]` array of ISO dates / `{date-macro}` tokens (e.g. `["2023-01-01", "2023-01-31"]`). Any other string is refused at the schema with `400 ANALYTICS_DATE_RANGE_UNRECOGNIZED`. |
239+
| **dateRange** | `Enum<'today' \| 'yesterday' \| 'this_week' \| 'last_week' \| 'this_month' \| 'last_month' \| …> \| [string, string]` | optional | Time window for this dimension: a date-range PRESET name from the closed vocabulary in `data/date-range-presets.ts` (today, yesterday, this_week, last_week, this_month, last_month, next_month, this_quarter, last_quarter, next_quarter, this_year, last_year, last_7_days, last_30_days, last_90_days, next_30_days — e.g. `'last_7_days'`), or an explicit `[start, end]` array of ISO dates / `{date-macro}` tokens (e.g. `["2023-01-01", "2023-01-31"]`). Any other string is refused at the schema with `400 ANALYTICS_DATE_RANGE_UNRECOGNIZED`. |
240240

241241
### Nested Shape: `DatasetSelection.compareTo`
242242

‎content/docs/references/data/analytics.mdx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ This schema accepts one of the following structures:
5252

5353
#### Option 1
5454

55-
Allowed Values: `today`, `yesterday`, `this_week`, `last_week`, `this_month`, `last_month`, `this_quarter`, `last_quarter`, `this_year`, `last_year`, `last_7_days`, `last_30_days`, `last_90_days`
55+
Allowed Values: `today`, `yesterday`, `this_week`, `last_week`, `this_month`, `last_month`, `next_month`, `this_quarter`, `last_quarter`, `next_quarter`, `this_year`, `last_year`, `last_7_days`, `last_30_days`, `last_90_days`, `next_30_days`
5656

5757
---
5858

@@ -75,13 +75,16 @@ Type: `[string, string]`
7575
* `last_week`
7676
* `this_month`
7777
* `last_month`
78+
* `next_month`
7879
* `this_quarter`
7980
* `last_quarter`
81+
* `next_quarter`
8082
* `this_year`
8183
* `last_year`
8284
* `last_7_days`
8385
* `last_30_days`
8486
* `last_90_days`
87+
* `next_30_days`
8588

8689

8790
---
@@ -108,7 +111,7 @@ Type: `[string, string]`
108111
| :--- | :--- | :--- | :--- |
109112
| **dimension** | `string` | ✅ | |
110113
| **granularity** | `Enum<'day' \| 'week' \| 'month' \| 'quarter' \| 'year'>` | optional | |
111-
| **dateRange** | `Enum<'today' \| 'yesterday' \| 'this_week' \| 'last_week' \| 'this_month' \| 'last_month' \| …> \| [string, string]` | optional | Time window for this dimension: a date-range PRESET name from the closed vocabulary in `data/date-range-presets.ts` (today, yesterday, this_week, last_week, this_month, last_month, this_quarter, last_quarter, this_year, last_year, last_7_days, last_30_days, last_90_days — e.g. `'last_7_days'`), or an explicit `[start, end]` array of ISO dates / `{date-macro}` tokens (e.g. `["2023-01-01", "2023-01-31"]`). Any other string is refused at the schema with `400 ANALYTICS_DATE_RANGE_UNRECOGNIZED`. |
114+
| **dateRange** | `Enum<'today' \| 'yesterday' \| 'this_week' \| 'last_week' \| 'this_month' \| 'last_month' \| …> \| [string, string]` | optional | Time window for this dimension: a date-range PRESET name from the closed vocabulary in `data/date-range-presets.ts` (today, yesterday, this_week, last_week, this_month, last_month, next_month, this_quarter, last_quarter, next_quarter, this_year, last_year, last_7_days, last_30_days, last_90_days, next_30_days — e.g. `'last_7_days'`), or an explicit `[start, end]` array of ISO dates / `{date-macro}` tokens (e.g. `["2023-01-01", "2023-01-31"]`). Any other string is refused at the schema with `400 ANALYTICS_DATE_RANGE_UNRECOGNIZED`. |
112115

113116

114117
---

‎content/docs/ui/dashboards.mdx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,19 @@ dateRange: {
380380
| `last_week` | Previous week |
381381
| `this_month` | Current month |
382382
| `last_month` | Previous month |
383+
| `next_month` | Following month |
383384
| `this_quarter` | Current quarter |
384385
| `last_quarter` | Previous quarter |
386+
| `next_quarter` | Following quarter |
385387
| `this_year` | Current year |
386388
| `last_year` | Previous year |
387389
| `last_7_days` | Rolling 7 days |
388390
| `last_30_days` | Rolling 30 days |
389391
| `last_90_days` | Rolling 90 days |
392+
| `next_30_days` | Today and the 30 days after it |
390393
| `custom` | User-defined range |
391394

392-
The thirteen named ranges are published as `DATE_RANGE_PRESETS` in
395+
The named ranges are published as `DATE_RANGE_PRESETS` in
393396
`@objectstack/spec/ui` — the vocabulary's single source of truth. `custom` is not
394397
one of them: it selects no window, it opens the picker.
395398

‎docs/qa/platform-checklist/areas/api-backend.json‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@
14771477
"title": "Every date-range preset resolves to its declared macro window, and a bare preset name used as a raw comparand is refused with the prescription",
14781478
"since": "v17",
14791479
"status": "active",
1480-
"revision": 2,
1480+
"revision": 3,
14811481
"priority": "P2",
14821482
"surface": "api",
14831483
"personas": [
@@ -1489,7 +1489,7 @@
14891489
"an object with a date/datetime field carrying rows spread across the preset windows (today, this week, last quarter, last 90 days) so each preset has a distinguishable answer set"
14901490
],
14911491
"knownGaps": [
1492-
"Stock seeds are unlikely to place rows in every one of the 13 windows. Presets whose window contains no seeded row prove only that the window RESOLVED, not that it selected correctly — the run must record which presets were answer-discriminating and which were merely well-formed. Seeding rows at known offsets during the run is the honest way to close this; record it if done.",
1492+
"Stock seeds are unlikely to place rows in every one of the 16 windows, and the three forward ones (next_month, next_quarter, next_30_days) select only future-dated rows. Presets whose window contains no seeded row prove only that the window RESOLVED, not that it selected correctly — the run must record which presets were answer-discriminating and which were merely well-formed. Seeding rows at known offsets during the run is the honest way to close this; record it if done.",
14931493
"Presets are relative to run time, so a run near a period boundary (month/quarter/year rollover, or a run spanning midnight) can legitimately shift an answer set. Capture the run's clock alongside the results."
14941494
]
14951495
},
@@ -1539,18 +1539,21 @@
15391539
"last_week",
15401540
"this_month",
15411541
"last_month",
1542+
"next_month",
15421543
"this_quarter",
15431544
"last_quarter",
1545+
"next_quarter",
15441546
"this_year",
15451547
"last_year",
15461548
"last_7_days",
15471549
"last_30_days",
1548-
"last_90_days"
1550+
"last_90_days",
1551+
"next_30_days"
15491552
],
15501553
"enumSource": {
15511554
"file": "packages/spec/src/data/date-range-presets.ts",
15521555
"export": "DATE_RANGE_PRESETS",
1553-
"expect": 13
1556+
"expect": 16
15541557
},
15551558
"traps": [
15561559
"clock-skew",
@@ -1574,6 +1577,12 @@
15741577
"date": "2026-10-02",
15751578
"change": "split clause 3 into its two designed arms. The clause expected the preset prescription for step 5's own example, an EQUALITY (where: { created: 'today' }); the platform deliberately raises that message only in ordering positions (18.filter-preset-ordering-comparand-refused.ts) and refuses an equality on a date field at the temporal door (400 INVALID_FILTER). Measured on 17.6.0 by the release-verification run: equality → INVALID_FILTER with the temporal message, $gte → VALIDATION_FAILED with bareDateRangePresetComparandMessage, neither ever 200. Step 5 now drives both arms",
15761579
"ref": "#21330"
1580+
},
1581+
{
1582+
"revision": 3,
1583+
"date": "2026-11-04",
1584+
"change": "variants widened from 13 to 16: DATE_RANGE_PRESETS gained the forward presets next_month, next_quarter and next_30_days (ruling A on the card). Their windows are [{next_month_start}, {next_month_end}], [{next_quarter_start}, {next_quarter_end}] and [{today}, {30_days_from_now}]; the bare-comparand refusal prescribes them like every other preset. A forward window needs future-dated rows to discriminate, which the knownGaps line now says",
1585+
"ref": "#30076"
15771586
}
15781587
]
15791588
},

‎packages/cli/test/verify-dashboard-windows.test.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { tmpdir } from 'node:os';
2929
import { join } from 'node:path';
3030
import { CLI, childEnv } from './helpers/serve-process.js';
3131
import { defineStackSource, defineStackSourceFromLiteral, linkSpec } from './helpers/define-stack-fixture.js';
32+
import { DATE_RANGE_PRESETS } from '@objectstack/spec/data';
3233

3334
const MANIFEST = {
3435
id: 'com.example.verify-dashboard-windows',
@@ -161,7 +162,14 @@ describe('os verify --dashboard-windows', () => {
161162
const report = docOf(proven).dashboardWindows!;
162163
expect(report.door).toBe('rest');
163164
expect(report.results).toEqual([expect.objectContaining({ dashboard: 'vdw_board', widget: 'cases', status: 'proven' })]);
164-
expect(report.summary).toMatchObject({ widgets: { proven: 1, contradicted: 0 }, probes: 13, held: 13, inert: 0, hardFailures: 0 });
165+
// One probe per preset of the picker, read from the vocabulary so a new preset moves it too.
166+
expect(report.summary).toMatchObject({
167+
widgets: { proven: 1, contradicted: 0 },
168+
probes: DATE_RANGE_PRESETS.length,
169+
held: DATE_RANGE_PRESETS.length,
170+
inert: 0,
171+
hardFailures: 0,
172+
});
165173
expect(docOf(proven).hardFailures).toBe(0);
166174
});
167175

‎packages/core/src/utils/analytics-date-range-conformance.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export async function analyticsDateRangeConformanceFindings(
197197
const say = (msg: string) => findings.push(`${face.name}: ${msg}`);
198198
const seenWindows = new Set<string>();
199199

200-
// ── The thirteen declared names must resolve, and resolve identically ────
200+
// ── Every declared name must resolve, and resolve identically ──────────
201201
for (const preset of DATE_RANGE_PRESETS) {
202202
const expected: ResolvedAnalyticsDateRange = resolveAnalyticsDateRangeString(preset, options);
203203
const got = await attempt(face, preset);

0 commit comments

Comments
 (0)