Repository navigation
feat(spec): {current_iso_week} defaults a week-keyed filter to the current ISO week - #35391
Conversation
Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY Co-authored-by: Claude <noreply@anthropic.com>
…r docs, plus changeset Regenerated the data api-surface/export-origins shards and the date-macros and dashboard reference pages; the dashboards guide gains a section on defaulting a week-keyed text filter to the current ISO week. Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY Co-authored-by: Claude <noreply@anthropic.com>
…e date-field caveat Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 183 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 215425cea8b544837cb83e55259b9949927ecfc0 && git checkout 215425cea8b544837cb83e55259b9949927ecfc0
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a1b14cdff8df4a203af978290c65c357f1b565c5 3c0e95c7e4f30f7b3fd92e1162ebabd957416672 && git checkout -B drift-repro a1b14cdff8df4a203af978290c65c357f1b565c5 && git merge --no-ff 3c0e95c7e4f30f7b3fd92e1162ebabd957416672
node scripts/docs-audit/affected-docs.mjs --json a1b14cdff8df4a203af978290c65c357f1b565c5
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY Final head for L1:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: Inputs read: card #34938 (body, triage, ruling record 7000277555, claim 7001845808, os-dev report 7003178228), PR #35391 (body, file list, net diff against the merge base, comments 7003161269 / 7003787253 / 7003847515), and the 74 check-runs on the head: 63 success, 11 skipped, 0 failed, 0 pending. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Findings: S1 (should-fix) — A period key must not be stepped around at the temporal-comparand door. This PR turns N1 (nit) — The changeset says N2 (nit) — N3 (nit) — The lint hint strings in No must-fix. One should-fix, S1, open on this head: the record does not clear the PR to land until a delta review closes it. Implemented-by: VERDICT: PASS |
{current_iso_week} on a date, datetime or time column now takes the refusal
the literal week key takes (INVALID_FILTER / 400) instead of being stepped
around and compared as text. Date macros and context tokens are still stepped
around. Pins on the core predicate, the engine door (recording driver) and the
REST query door over SqlDriver; docs and changeset say refused; the changeset
names the cost of the new classifyFilterToken kind; the lint hints name the
week key.
Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY
Co-authored-by: Claude <noreply@anthropic.com>
… sentence Claude-Session: https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY Final head for delta (L1 + L2):
|
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a, delta) · repo:objectstack#5 · head
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: Delta review of the record on ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentS1: closed. N1: closed. N3: closed; the two hint strings and the comment name the week key and three vocabularies, and the lint test was updated with them. N2: carried to #35396. Nothing new found in the fix round or the merge. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY Landing · area ux-1 · 2026-11-19T11:03Z
Head |
Requested by Bill · project thread
Fixes #34938
Clause-②: yes (widening: the closed filter-placeholder vocabulary gains one token)
Metadata-protocol: added
Skills-docs: follow-up owed — skills/objectstack-query/rules/filters.md (its "Date Macros" section lists the filter-placeholder vocabulary; it should name
{current_iso_week}as a period key that is text, not a date)维护者速读
What changes
PERIOD_KEY_TOKENS = ['current_iso_week'],isPeriodKeyTokenandPERIOD_KEY_TOKEN_DESCRIPTIONSindata/date-macros.zod.ts. It is a sibling list, not a member ofDATE_MACRO_TOKENS, soisDateMacroPlaceholder, a date dashboard default and a calendarinitialDatestill refuse it.classifyFilterTokenanswers a new kind,period-key;isKnownFilterTokenknows it. The dashboarddefaultValueTSDoc and describe name the text-filter use.resolveFilterTokens(@objectstack/core) resolves it withbucketDateKey(now, 'week', ctx.timezone), the same label the analytics week bucket groups by: ISO-8601, Monday start, the ISO week-numbering year at the year edges, today in the workspace zone. The unknown-token message names it.resolvePeriodKeyTokens(@object-ui/core) carries the same rule; the client cannot import@objectstack/core, so the two copies are held equal by one 16-row parity table that both sides run.resolveFilterPlaceholdersandresolveDashboardFilterDefscall it, so a text (or any non-date) filter opens with the resolved key in the box; adate/dateRangedefault is left to its own normalizer and refused there as before.{current_iso_week}is a known token, sofilter-token-unknownno longer flags it. The rule's explanation said "exactly two vocabularies", which this change made false; it now lists the period keys.dataapi-surface / export-origins shards are regenerated.Tests
All runs below were at
f3bf7beb08; the only later commit,fa840834a0, edits the changeset text alone, and the families that read it were re-run there.filter-tokens.test.tsand in uidate-macros.test.ts; a sibling of the spec-parity test forPERIOD_KEY_TOKENS; the classify / known-token / near-spelling cases in spec; the dashboard schema (date filter refuses, text filter keeps both spellings and a literal key); the lint no-finding cases; the dashboard-filter seeding cases (text, untyped,${…}, select, zone, literal key, embedded text, a date filter left raw).@objectstack/spec,@objectstack/core,@objectstack/linttypecheckand@object-ui/coretype-check(which compiles its tests) all exit 0.Test run readings
Acceptance notes
The temporal-comparand door, measured as asked. The dispatch asked what the door answers when the token meets a date or datetime column. Measured with
engine.findon the SQL driver (SQLite) and the in-memory driver, which answered the same; now pinned to 2026-11-19. It is not refused and not read as a date: the key reaches the driver and is compared as text. Before this change the same query answeredFILTER_TOKEN_UNKNOWN/ 400.placed_on(date)$eqgives[],$gtegives[], and$ltreturns every row.opened_at(datetime) answers the same;opens_at(time)$gtgives[]."2026-W47"on the same columns is refusedINVALID_FILTER/ 400.The door steps around every placeholder as written, and after resolution it judges only
date-macrokinds. The context tokens ({current_user_id}on a date column) already behave this way. Per the dispatch the door was not widened. The docs say to use the token only on fields that store week keys. The fix belongs in the core temporal-comparand step-around: judge period-key and context placeholders as written, and step around only date macros. It is reported to the seat to file.compareTo. A chart's previous-period series (the compare-to shift) does not shift a period key, so the comparison series filters the same week. Not measured in a UI; reported, not changed.
Placeholders only as the whole value. The token resolves only as a whole value.
'week {current_iso_week}'is left as written, like every other placeholder.Lint does not read dashboard defaults. Lint does not walk
globalFilters[].defaultValue. A typo there, such as{currentIsoWeek}, surfaces only at query time, asFILTER_TOKEN_UNKNOWN/ 400.Files outside the claim's surface.
packages/lint/src/rule-explanations.ts: its text became false with this change.ui/packages/core/src/utils/filter-tokens.ts: the client's sibling resolver.content/docs/data-modeling/analytics.mdxandcontent/docs/frontend/plugins/plugin-view.mdx: the other filter-placeholder paragraphs.skills/**changed; no generator wrote there.Verification
dispatch-gates.mjs --commands, 120 families) ran locally. 118 exited 0 and 2 are NOT MEASURED; the reconciliation reads✓ dispatch-gates --ran: 120 derived famil(ies) accounted for — 118 run, 2 NOT-MEASURED.check:skill-examplesfirst refused with exit 3 because@objectstack/client-reacthad no dist. After building it, the gate exits 0: 346 examples type-check, including the new dashboards example.check:dual-build-cjs-loads. It needs every workspace package's dist, which is a whole-repo build, left to CI.vitest run scripts/(ui). 170 of 171 files passed. The one failure,unit-registry-absence-collision, was caused by an unbuilt@objectstack/client; after building it, that file passes 15/15.check:generatedis green aftergen:api-surface,gen:export-originsandgen:docs. uicheck:new-line-citationsreports 0 new citations, andoverlap-checkmerges cleanly.Gate readings
Fix round (contract review 7003932618)
Head
6b8fc7b563. It supersedes the "temporal-comparand door" acceptance note above: the door now refuses the token on temporal columns.isUninterpretableTemporalComparandno longer steps around aperiod-keyplaceholder; it judges it as written.{current_iso_week}is not a calendar day, an instant or a wall clock, so on adate,datetimeortimecolumn it now gets the same refusal as the literal"2026-W47":INVALID_FILTER/ 400, before any driver read.where, per-aggregation filter andhaving) and the analytics raw-SQL decline therefore move together;judgeResolvedTokengains only a docblock clause.readablegate, so its verdicts do not change.kindgets a compile error until it handles the new kind."flow-value-slot-template.tsis not touched.filter-token-unknownhints and the inline comment now name the week key{current_iso_week}and the three vocabularies. Both hint lines stay one line of at most 200 characters (186 and 176).Pins
temporal-comparand.test.ts). The predicate refuses everyPERIOD_KEY_TOKENSmember in both spellings, plus the literal key, on all three kinds. As controls,{current_week_start},{today},{30_days_ago}and the unknown{current_iso_wek}are still stepped around.engine-temporal-comparand-door.test.ts).INVALID_FILTER/ 400 and no driver read:$eq/$lt/$gte/$gt, implicit equality and an$inmember, ondue_on(date),created_date(datetime) andopens_at(time), in both spellings.$eqand an implicit equality return the W47 row; a text$containsreaches the driver as2026-W47;{current_week_start}on a date column resolves to2026-11-16and returns the W47 row.data-temporal-write-real-day-iso.test.ts).OS_TEST_POSTGRES_URLis set.placed_on,opened_atandslot,$eq/$lt/$gtein both spellings answer 400INVALID_FILTERnaming the field, with no read of the object.$eqand$containsreturn the W47 row, and{current_week_start}on the date field returns it too.@objectstack/driver-memoryneeds a census ruling (scripts/driver-memory-census.ledger.json), which a dev does not make. The refusal sits in front of every driver, and the recording-driver pin asserts that no driver read happens. The pre-fix reading on InMemoryDriver matched SQLite.Ablation of the new arm (once): pins red, then restored to the HEAD blob
Readers and gates at 6b8fc7b
🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY