Skip to content

docs(skills): teach the {current_iso_week} period key in the query filter rules - #35743

Closed
objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/issue-35496-filters-iso-week-token
Closed

objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/issue-35496-filters-iso-week-token

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread
Fixes #35496

Clause-②: no
Metadata-protocol: none
Skills-docs: updated here

维护者速读

  • 用户能看到什么变化:装了查询技能的 AI 写筛选条件时,会知道「本 ISO 周」周键占位符是什么、只能用在存周键的文本字段上、用在日期字段会被拒绝。
  • 为什么做:「本 ISO 周周键」这个占位符已经上线,对外发布的查询技能说明还没写,属于「技能文档跟上平台」这一批。
  • 出错会怎样:只改说明文字和一条评测样例,不动运行时;写错了 AI 会给出错的筛选写法,直接撤回这个改动即可。
  • 要你做什么:无。

What changes

skills/objectstack-query/rules/filters.md, section "Date Macros (declarative filter metadata)":

  • A new Period key paragraph beside the date-macro bullets and the session tokens: {current_iso_week} is a member of PERIOD_KEY_TOKENS, not a date macro; it resolves to today's ISO week key YYYY-Www in the workspace time zone, Monday-start weeks, ISO week-year at year edges (2027-01-01 is 2026-W53); it is text, for a text field storing week keys; a date / datetime / time field refuses it with INVALID_FILTER / 400 like the literal key, and the date-field spelling is {current_week_start} / {current_week_end}; a date dashboard filter's defaultValue and calendar.initialDate refuse it, a text dashboard filter may default to it; there is no last- or next-week key.
  • The session-token example now carries the week key on a text field (cost_week: '{current_iso_week}').
  • Scope names resolveFilterPlaceholders() as the client resolver, the one call over resolveDateMacros(), resolvePeriodKeyTokens() and resolveContextTokens().
  • The spelling check is isKnownFilterToken(tok), the one predicate that answers for all three vocabularies. The two predicates the file named before both answer false for current_iso_week, so leaving them would have contradicted the new paragraph.

skills/objectstack-query/evals/filters-pagination-search.json: eval 10, a text week-key field filtered with the token and a date field filtered with the week's boundaries, never with the token.

scripts/check-skills-token-ratchet.mjs: the filters.md row moves 2473 to 2596, the measured remainder (see the budget below).

.changeset/35496-skills-filters-iso-week-key.md: @objectstack/skills patch.

Read first, by risk:

  1. skills/objectstack-query/rules/filters.md, the Period key paragraph (the risky hunk: every clause is a claim about the runtime, sourced below).
  2. scripts/check-skills-token-ratchet.mjs, the comment over the filters.md row (the deletion list and the arithmetic).
  3. skills/objectstack-query/evals/filters-pagination-search.json, eval 10.

Two-minute check: node scripts/check-skills-token-ratchet.mjs, expected line skills/objectstack-query/rules/filters.md is 2596 tokens (ceiling 2596; headroom 0) and a passing verdict.

Each sentence and where main says it (origin/main 598a34d)

Sentence in the skill Source on main
a list of its own, not a date macro packages/spec/src/data/date-macros.zod.ts:62-67 and :179-181 (PERIOD_KEY_TOKENS), :190-192
YYYY-Www, workspace time zone, Monday-start weeks, ISO week-year packages/spec/src/data/date-macros.zod.ts:69-74 and :344-348; server resolver packages/core/src/utils/filter-tokens.ts:471-473
2027-01-01 is 2026-W53 packages/core/src/utils/filter-tokens.test.ts:568 (parity table row), spec prose date-macros.zod.ts:72
text, for a text field storing week keys date-macros.zod.ts:75-80; positive control packages/objectql/src/engine-temporal-comparand-door.test.ts:646-647
date / datetime / time refuse it, INVALID_FILTER / 400, like the literal key packages/objectql/src/engine-temporal-comparand-door.test.ts:621-641 (both wrappings, code and status asserted, the literal 2026-W47 in the same loop); over HTTP packages/rest/src/data-temporal-write-real-day-iso.test.ts:385
use {current_week_start} / {current_week_end} on a date field date-macros.zod.ts:133 (the two tokens); the same door test's title and its positive control
a date dashboard filter's defaultValue refuses it, a text one may default to it packages/spec/src/ui/dashboard.test.ts:506-518; packages/spec/src/ui/dashboard.zod.ts:1663-1676
calendar.initialDate refuses it packages/spec/src/ui/calendar-config-initial-date.test.ts:94
both spellings, in every vocabulary ui/packages/core/src/utils/date-macros.ts:255 (the same wrapper pattern); filter-tokens.test.ts:603-604
client resolver resolveFilterPlaceholders() over the three ui/packages/core/src/utils/filter-tokens.ts:301-308; exported at ui/packages/core/src/index.ts:221-234
isKnownFilterToken(tok) packages/spec/src/data/context-tokens.zod.ts:333-335; listed in packages/spec/api-surface/data.json:1057
no last- or next-week key PERIOD_KEY_TOKENS has one member (date-macros.zod.ts:179-181)

Whole-value only (card item 4, last sentence) is true on main (filter-tokens.test.ts:607 and :616, ui/packages/core/src/utils/date-macros.ts:255) and is not written again: the section's "Unknown tokens" paragraph already says a value that merely contains braces is a literal, for every token.

Token and line budget

Standing ruling for skills/**, quoted verbatim: 「A:先削重复,余额按实测提高」 (maintainer, 2026-10-27; ruling record 6513306068).

Deleted first, all in the same section of filters.md:

  1. The wrapper regex in the "Both spellings parse" bullet, which restated in pattern form the sentence it sat in.
  2. The code comment // List-view / dashboard filter values, which repeated the sentence above its block.
  3. The second date-macro comparison in the session-token example (close_date with {current_year_start}), a second showing of what the first block shows; the week key takes its place.
  4. The two per-vocabulary predicates, replaced by the one predicate.
  5. The driver sentence's list of value kinds ("ISO strings and concrete ids"), now "resolved values".
Reading Before (598a34d) After (47fe010)
filters.md lines 208 215 (+7)
filters.md bytes / tokens 9876 / 2469 10382 / 2596 (+127)
filters.md ceiling row 2473 (headroom 4) 2596 (headroom 0), +123 after the 4 of headroom
eval file lines / tokens 95 / 1898 105 / 2160 (not ratcheted)
all SKILL.md lines, summed 4861 4861
whole skills/ tree, lines 22535 22552 (+17)
ratcheted (authored) tokens / ceilings 196132 / 201053 196259 / 201176
bundle total, tokens 280730 281119 (+389)

Tests

Text only; no package source changes, so no package test or ablation is owed. Local readings at head 47fe010:

  • node scripts/check-skills-token-ratchet.mjs: exit 0, 59 authored bundle file(s) within their ceilings.
  • node scripts/check-skills-token-ratchet.mjs --self-test: exit 0, 104 cases pass (the script this diff edits).
  • pnpm --filter @objectstack/spec run check:skill-refs, check:skill-docs, check:skill-served-sections: each VERDICT command-exit 0 under the verify lock.
  • pnpm check:skill-links, check:skill-identifier-liveness, check:skill-compatibility, check:skill-frame-sync, check:pm-skill-id-lint, check:nul-bytes, check:doc-authoring, check:ratchet-remedy-authority, check:scripts-symbol-anchors, check:corpus-claim-drift, check:role-word, check:changeset-gate-self-tests, node scripts/check-empty-changeset.mjs --base origin/main, node scripts/check-changeset-no-major.mjs --base origin/main, node scripts/check-declaration-mirrors.mjs, node scripts/check-comment-mask-corpus.mjs: exit 0 each.
  • node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 (one open pull shares the ratchet script and merges cleanly).

NOT MEASURED: check:skill-examples, reason: PREREQUISITE NOT MET, it reads built output and this worktree has none; the blocks this diff touches are where fragments the gate skips by the file's own opening note. CI runs it.

Acceptance notes

  • Search for contradictions in skills/objectstack-query/: current_week has no hit outside the new text; week outside filters.md hits once, rules/aggregation.md:83 ("weeks are ISO-8601, starting Monday"), which agrees. current_iso_week had no hit under skills/ before this diff.
  • Left out, on purpose: the this_week preset the card offers as a date-field alternative. It is a date-range preset name, and where a preset is a legal filter comparand is a separate rule this pull did not measure; the two boundary tokens are the measured spelling.
  • Left out: $contains with the token on a text field also resolves (door test line 648). True, and not worth its tokens.
  • The server reads the request's reference time zone (filter-tokens.ts:172, default UTC when the request carries none); the skill says "workspace time zone", the wording of the spec's own description table.
  • The section's opening ("compute the date yourself" for ad-hoc queries) and its Scope paragraph ("use tokens in a hand-issued engine query too") pull in different directions. Older text, not changed here.

Verification

dispatch-gates --ran: 19 of 65 derived families run locally; the 46 others are declared to CI. They are matched by the edit to one scripts/*.mjs ceiling row (script-population gates) or are whole-tree families; none reads the skill text.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgTRf6qBRCqPh4JZaZL

…lter rules

The Date Macros section of the published query skill listed the date macros
and the session tokens only. It now names the period key beside them: the
YYYY-Www value, the text-field-only rule, the INVALID_FILTER / 400 refusal on
date, datetime and time fields, and the two date-only surfaces that refuse it.
Five restatements in the same section pay first; the ratchet row moves by the
measured remainder. One eval case pins the text-field / date-field split.

Claude-Session: https://claude.ai/code/session_01L6bhgTRf6qBRCqPh4JZaZL
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTRf6qBRCqPh4JZaZL

Area b1-D · 2026-11-20T05:09Z · final green head 47fe01057286d676b52fa7417ebb33b8e4d5a574 (l1-face CLEAN: 29 success, 16 expected skip, 0 failed, 0 pending). L1 is asked of thread L1-a on this head. The brief below goes to an isolated sub-agent at the contract tier; its record follows as a separate comment.

Brief handed to the contract reviewer — PR #35743 @ 47fe01057286d676b52fa7417ebb33b8e4d5a574 (card #35496)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template — with a PASS or FAIL verdict. Return the record as your final message; the area thread posts it as ONE comment on the PR.

Inputs — these and nothing else:
· card #35496: its body and EVERY comment (rulings and earlier records included)
· PR #35743: its body, its file list, and the net diff against main at 47fe01057286d676b52fa7417ebb33b8e4d5a574
· the check-runs on 47fe01057286d676b52fa7417ebb33b8e4d5a574: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: skills/objectstack-query/rules/filters.md, skills/objectstack-query/evals/filters-pagination-search.json;
plus every file IN THIS DIFF that directly implements or enforces them — here scripts/check-skills-token-ratchet.mjs (the ceiling row and its comment, against the standing raise ruling the script header quotes) — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (the changeset) is the lane seat's ACCEPT at TIER_DEFAULT.
④ judges the hits files and those implementing files ONLY; code outside the diff is READ to judge them, never reviewed.

Security — if the change teaches security, auth or permission behaviour the path name doesn't show, the record says so on its Security-touching: line: write no ONLY when no changed hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else yes.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family. If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated. SQL push-down: not applicable to a text diff unless you find otherwise.
④ Design judgment — for EVERY hits file: does each changed sentence hold against the spec and the resolvers it teaches on main (date-macros.zod.ts, context-tokens.zod.ts, dashboard.zod.ts, the period-key resolver and its tests) and against the card's six expected items? Does the eval case assert what main does? For the ratchet row: is the deletion genuine restatement, is the raise the measured remainder, is it in proportion to the feature? Try to break the design.
Grade each finding must-fix, should-fix or nit. Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as No must-fix, no should-fix.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with claude/issue-35496-filters-iso-week-token and Reviewed-by: with session_01L6bhgTRf6qBRCqPh4JZaZL — the value is the FIRST thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

维护者速读

  • 用户能看到什么变化:对外发布的查询技能多讲了一个写法:用 {current_iso_week} 可以筛出"本周",它会被换成当前周的编号,比如 2026-W47。技能同时讲清楚:这个写法只能用在存周编号的文本字段上,日期字段要用本周开始、结束两个日期。AI 客户端照技能写看板筛选时,就不会写错。
  • 出错会怎样:只是文档和一条评测,不改任何运行行为。最坏的情况是某句话说得不准,而文中提到的每个名字我都在代码里核对过。
  • 要你做什么:这张 PR 动了对外发布的技能包和计量脚本,属于 Tier H,需要 os-zhuang 批准。L2 正在跑。

席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head 47fe01057286d676b52fa7417ebb33b8e4d5a574 · 2026-11-20T05:12Z

  • Shape — draft, base main, 2 commits, 4 files, +52/−11. Merge-base 598a34d0. check-governed-merges.mjs --pr 35743: GOVERNED, Tier H. The low-risk skills arm is out because scripts/check-skills-token-ratchet.mjs is in the diff; it always is when a skills/** ceiling row moves. Mergeable clean. The changeset is @objectstack/skills at patch, with Clause-②: no and Metadata-protocol: none. That is right: the text teaches a token that feat(spec): {current_iso_week} defaults a week-keyed filter to the current ISO week #35391 already shipped, and changes no accept set.
  • Every claim in the new text, checked against the code at this head
    • PERIOD_KEY_TOKENS is ['current_iso_week'] (packages/spec/src/data/date-macros.zod.ts:179). It is a list of its own and not a member of DATE_MACRO_TOKENS, so "There is no last- or next-week key" is exact.
    • The YYYY-Www value, Monday-start weeks, the ISO week-year, "2027-01-01 is 2026-W53" and the workspace time zone are all in the same module's note (lines 62–90).
    • The note gives three refusals: a date / datetime / time field (INVALID_FILTER / 400, the temporal-comparand door), a date dashboard filter's defaultValue, and calendar.initialDate. It also says a text dashboard filter may default to the key, which dashboard.zod.ts:1676 and dashboard.test.ts:517 pin.
    • resolveFilterPlaceholders() (ui/packages/core/src/utils/filter-tokens.ts:301, exported from the package index) calls resolveContextTokens(resolvePeriodKeyTokens(resolveDateMacros(…))), which is "in one call", as written.
    • isKnownFilterToken is exported from @objectstack/spec/data (context-tokens.zod.ts:333, re-exported by data/index.ts), and its note says it knows the period key.
    • "Both spellings parse … in every vocabulary": CONTEXT_TOKEN_WRAPPED_RE = DATE_MACRO_WRAPPED_RE, and the period key is read by the same wrapped form.
  • The eval case (id 10) asks for the text/date split on one prompt: it must contain plan_week: '{current_iso_week}' and the two week-boundary tokens, and must not contain {current_week} (a near-miss) or the key on the date field. That is the one behaviour the text adds.
  • Is the ratchet raise proportionate? (you asked) Yes. The arithmetic: filters.md goes from 9876 to 10382 bytes (+506) at net +7 lines, inside the dispatch's +10-line budget. ceil(10382 / 4) = 2596 tokens. The row's 4 tokens of headroom are absorbed, so the ceiling rises by 123, pinned at the measurement. check-skills-token-ratchet.mjs passes at headroom 0, and --self-test gives 104 cases pass. Measured here.
    • The raise path. It is the standing 「A:先削重复,余额按实测提高」 (record 6513306068, letter B), and the paid-down-first condition holds: I count five restatements cut in the same section. They are the duplicated wrapper regex, the code comment that repeats the sentence above it, the second date-macro example (the week key takes its place), the two per-vocabulary predicates (one predicate now answers for all three) and the driver's "ISO strings and concrete ids". Two of those cuts also correct text that feat(spec): {current_iso_week} defaults a week-keyed filter to the current ISO week #35391 had made incomplete: the client resolver list and the spelling check. So part of the 506 bytes is upkeep, not new teaching.
    • What could still go, and why I would not cut it. The 2026-W53 year-edge example (~30 bytes), "a text dashboard filter may default to it" (~40) and "no last- or next-week key" (~35). Each stops an agent writing a wrong key or inventing a token, which is the misuse this card exists to prevent. Nothing is owed.
  • Gates — at this head: 29 success, 16 skipped, 0 failure. l1-face is CLEAN, as announced in 7031053102.
  • Note for the thread — card skills: filters.md Date Macros never mentions the {current_iso_week} period-key token #35391 added #35496 is priority:p2. If the maintainer's 11-20 00:37Z p1-only order still stands, confirm before landing that this card was released from it. The PR itself is sound either way.
  • Landing terms — Tier H. It needs the same-head ## Contract review PASS (an isolated reviewer, running) and os-zhuang's APPROVED. Then the owning thread lands it. A new push needs a fresh L1 unless it is a clean main merge.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTRf6qBRCqPh4JZaZL

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 47fe01057286d676b52fa7417ebb33b8e4d5a574
Local-runs: none
Scope: skills/objectstack-query/rules/filters.md, skills/objectstack-query/evals/filters-pagination-search.json + scripts/check-skills-token-ratchet.mjs
Security-touching: no

Read for this record: card #35496 (body and its three comments: triage 7009568590, claim 7030503012, os-dev-report 7030743883), PR #35743 (body, four-file list, net diff from merge base 598a34d04 to the head) and the head's 45 check-runs. "main" below is origin/main at 03bce5c22, one commit past the merge base (#35716, approvals files only); every file cited is identical at both.

① Derived judgments

  • Accept sets: none moves. Right. The diff is skill prose, one eval case, one ceiling number with its comment, and a changeset. No schema, resolver, validator or door changes. The behaviour taught landed with feat(spec): {current_iso_week} defaults a week-keyed filter to the current ISO week #35391 and is read on main in ④.
  • Published surface: two files of @objectstack/skills change content. Right. rules/filters.md is loaded text. The eval fixture ships but is inert in a consumer install (scripts/check-skills-token-ratchet.mjs:212-216).
  • Identifiers the skill names: three new, three dropped, no package surface changes. Right. isKnownFilterToken, resolveFilterPlaceholders and resolvePeriodKeyTokens already exist and are exported on main (cites in ④). DATE_MACRO_WRAPPED_RE, isDateMacroToken and isContextToken still exist; the skill only stops pointing at them.
  • CEILINGS row 2473 to 2596: repo tooling, publishes nothing. Right as a surface reading. Whether the raise is allowed is judged in ④.
  • Gate verdicts, read off the head's check-runs: 45 runs, 29 success, 16 skipped, 0 failed, 0 pending. The skipped runs are UI, docs-build, temporal-conformance, dogfood-CLI, opt-in and queue-verdict lanes, none matched by this diff. The gates that read this diff are green: the token ratchet with its self-test and the check:skill-refs, skill-docs, skill-served-sections, skill-links and skill-compatibility steps (Type Check · source gates, .github/workflows/lint.yml:5481-5487), check:skill-examples (Type Check · consumer gates, lint.yml:6318), skill identifier liveness (Lint · docs & code guards, lint.yml:2291), Check Changeset and Test Core.
  • The security line above reads no, and why. No changed hunk teaches permission, sharing, credential, authentication or other security behaviour. The "tokens" here are filter placeholders. One changed line re-prints owner_id: '{current_user_id}' as it was, and the resolver sentence still names resolveContextTokens(). Neither changes what is taught about them, and the spec declares those placeholders a presentation scope, not a security boundary (packages/spec/src/data/context-tokens.zod.ts:60-82).

② Semver level

  • One changeset, '@objectstack/skills': patch. It matches what the diff publishes: wording and one eval case in a released package, kind none, which takes patch (AGENTS.md:1019-1028). The script edit publishes nothing and owes none.
  • The changeset body was re-read clause by clause against filters.md at the head; every clause is in the file.
  • The declaration reads Clause-②: no, bare and line-initial, on the PR body and in the changeset. Right: nothing widens an accept set or a public surface, and nothing narrows one. Metadata-protocol: none on both carriers is right for the same reason.
  • No ! in the title and no BREAKING banner owed. Skills-docs: updated here in the PR body is not owed for kind none, and it is true.

③ Boundary flags

open_questions is empty. The dev's flags, each answered:

  • Ceiling raised 123 tokens above what deletion paid. Upheld, on the standing ruling's recognised path; judged in ④.
  • Two sentences changed that the card did not list (spelling predicate, driver sentence). Upheld. Each would have contradicted the new paragraph, and the card's done-when asks for no contradiction; cites in ④.
  • this_week left out (card item 3). Upheld. On main a preset name is refused as a filter comparand: at publish (packages/spec/src/migrations/entries/semantic/18.filter-preset-ordering-comparand-refused.ts:28-36) and at query time, INVALID_FILTER / 400 (same file :48-49). It is legal only in the dashboard date-filter positions (packages/spec/src/data/date-range-presets.ts:22-30), which is where the user docs offer it (content/docs/ui/dashboards.mdx:671-676). Written into a where rule it would teach a refused spelling.
  • Whole-value-only not restated (card item 4). Upheld. The section's standing sentence already says a value that merely contains braces is a literal (main filters.md:201-202), and for the period key that is true on both sides (packages/core/src/utils/filter-tokens.test.ts:607 and :615-616; ui/packages/core/src/utils/date-macros.ts:255-256).
  • check:skill-examples and 46 derived families not run locally. Answered by the head's check-runs listed in ①; each lint lane ends in a verdict step that keeps a red gate red.
  • Skills-docs: line in the PR body only. Not owed anywhere for kind none.
  • Model-free commit trailers instead of the harness-suggested one. Matches AGENTS.md:447-451.
  • First pr_create dry run refused, zero writes. No effect on the tree.
  • Branch base 598a34d04. Confirmed as the merge base; main's one later commit touches none of the files read here.
  • Out-of-scope observation (the section opening says "compute the date yourself", the scope paragraph says to use tokens in a hand-issued query). Older text outside the hunks (main filters.md:140 and :184-185). The first shows a fixed literal bound and the second is about "today", so this diff creates no contradiction. A follow-up card is the seat's call.

Read while checking the whole-value flag, not reviewed and not a finding on this diff: the client date-macro resolver does substitute a date macro embedded in a longer string (ui/packages/core/src/utils/date-macros.ts:186-205), while the server leaves it (packages/core/src/utils/filter-tokens.ts:86-90). The standing sentence is exact for session tokens and the period key, and for date macros on the server only.

SQL push-down: not applicable. The one code file changes a number and a comment.

④ Design judgment

No must-fix, no should-fix.

skills/objectstack-query/rules/filters.md — every changed sentence, at head line numbers, against main.

The Period key paragraph (head :169-176), clause by clause:

Clause Verdict Where main says it
A list of its own, not a date macro holds packages/spec/src/data/date-macros.zod.ts:62-67, :179-181; isDateMacroToken answers false, :84
Today's ISO week key YYYY-Www, Monday-start weeks, ISO week-year at year edges holds date-macros.zod.ts:69-73, :344-348; server packages/core/src/utils/filter-tokens.ts:471-473; client ui/packages/core/src/utils/date-macros.ts:243-250
2027-01-01 is 2026-W53 holds date-macros.zod.ts:72; packages/core/src/utils/filter-tokens.test.ts:568
In the workspace time zone holds date-macros.zod.ts:73-74; the reference zone comes from the localization settings, packages/spec/src/kernel/execution-context.zod.ts:161-166; UTC only when a request carries none, filter-tokens.ts:172-173
Text, for a text field storing week keys holds date-macros.zod.ts:75-80; packages/objectql/src/engine-temporal-comparand-door.test.ts:646-647
A date / datetime / time field refuses it, INVALID_FILTER / 400, like the literal key holds packages/core/src/utils/temporal-comparand.ts:292-298, :323-330; door test :621-641, the literal at :637-639; over HTTP packages/rest/src/data-temporal-write-real-day-iso.test.ts:385
Use {current_week_start} / {current_week_end} there holds for date and datetime (N2) date-macros.zod.ts:133, :303-304; door test :650-651
A date dashboard filter's defaultValue refuses it holds (N1) packages/spec/src/ui/dashboard.zod.ts:1521-1550; packages/spec/src/ui/dashboard.test.ts:506-511
calendar.initialDate refuses it holds (N1) packages/spec/src/ui/view.zod.ts:2611; packages/spec/src/ui/calendar-config-initial-date.test.ts:94
A text dashboard filter may default to it holds dashboard.zod.ts:1668-1674; dashboard.test.ts:513-522
No last- or next-week key holds date-macros.zod.ts:179-181, one member

The other changed sentences:

  • "Both spellings parse … in every vocabulary here" (head :166-167): holds. The server takes an optional $ for every kind (context-tokens.zod.ts:238, :364-380; both wrappings of the key at filter-tokens.test.ts:603-604). The client does too (ui/packages/core/src/utils/date-macros.ts:191, :255; ui/packages/core/src/utils/filter-tokens.ts:131). The regex literal that was cut is the token-name grammar, which the spec says is not what decides a placeholder (context-tokens.zod.ts:193-196), so nothing an author writes against is lost.
  • Code comment removed (main filters.md:155): holds. It repeated main :150-151.
  • Example cost_week: '{current_iso_week}' beside {current_user_id} (head :183): holds. It is the spec's own example (date-macros.zod.ts:78) and resolves beside the other vocabularies on one instant (filter-tokens.test.ts:599-618).
  • Resolver sentence (head :186-188): holds. resolveFilterPlaceholders() composes the three resolvers in one call (ui/packages/core/src/utils/filter-tokens.ts:301-308) and is exported from @object-ui/core with resolvePeriodKeyTokens (ui/packages/core/src/index.ts:221, :229-234).
  • "The driver only ever sees resolved values" (head :191-192): holds. The old list, ISO strings and concrete ids, is no longer complete: a period key reaches the driver as week-key text (filter-tokens.ts:530-535; door test :649).
  • isKnownFilterToken(tok) (head :210-211): holds. It is the union of the three vocabularies (context-tokens.zod.ts:333-335), exported from @objectstack/spec/data (packages/spec/src/data/index.ts:193; packages/spec/api-surface/data.json:1057). The pair it replaces both answer false for current_iso_week (date-macros.zod.ts:237-242; context-tokens.zod.ts:148-150).

Attempts to break it, none of which did:

  • Client resolves first, so the server sees the literal key on a date field. Same refusal (door test :637-639).
  • A dashboard widget queries through analytics, not find. Analytics judges through the same predicate (packages/services/service-analytics/src/comparand-shape.ts:497).
  • isKnownFilterToken('record_id') is false. This skill teaches no {record_id}, and the replaced pair answered false too (context-tokens.zod.ts:322-331).
  • Unchanged neighbours whose meaning now includes the key. The flow-node sentence still holds (context-tokens.zod.ts:325-331), and so does the build refusal of unknown tokens, which knows the key (packages/lint/src/validate-filter-tokens.ts:25).

Against the card's six items:

  • Items 1, 2, 5 and 6 are delivered in full.
  • Item 3 is delivered without this_week, upheld in ③.
  • Item 4 is delivered except the display clause (N3); its whole-value clause stands on existing text.
  • Done-when: at the head, week outside the changed files hits only skills/objectstack-query/rules/aggregation.md:83-84 (ISO-8601, Monday), which agrees. The router line skills/objectstack-query/SKILL.md:93 names no period key and states nothing false.

skills/objectstack-query/evals/filters-pagination-search.json, eval 10 — it asserts what main does.

  • plan_week: '{current_iso_week}' matches a text field of week keys (door test :646-647).
  • The two boundary tokens select the same week as the key. One reference day in one zone feeds both (filter-tokens.ts:437-447, :471-473); the week starts Monday and ends Sunday (:322-330, :417-421); a bare-day upper bound covers the whole day (date-macros.zod.ts:111-115).
  • The forbidden {current_week} is an unknown token on main (filter-tokens.test.ts:621-628), and the forbidden ship_date: '{current_iso_week}' is the refused form (door test :621-641).
  • The expected output satisfies its own assertions.

scripts/check-skills-token-ratchet.mjs, the filters.md row — it agrees with the contract it implements.

  • Path. The header's one recognised raise path needs deletion of restatement shown in the same file, the standing ruling quoted in the PR body, and the row pinned at the measurement (main :151-170). All three are present: the diff shows the cuts in § Date Macros, the body quotes the 2026-10-27 words and record 6513306068, and the comment's "letter B" matches the header (:159-160).
  • Measured remainder. Blob sizes read from the two trees: 9876 bytes on main, 10382 at the head. By the header's convention (:49) that is 2469 and 2596. The main row was 2473 (:1373), so 4 tokens of headroom are absorbed and the row moves by 123, to zero headroom. The comment's arithmetic is exact.
  • Genuine deletion. The wrapper regex, the code comment and the second date-macro comparison are plain restatements. The predicate pair and the driver's value list are replacements the new token forces (N5). No further restatement is left in the section to cut.
  • Proportion. The raise is 127 tokens and 7 net lines, for a token whose misuse was a silent wrong answer before the door judged it (door test :587-591). Every clause of the new paragraph maps to a card item. The same block's precedent is the now-anchor at 333 tokens (main :1357-1366). The 10402 principle (:14-16, :167-168) is respected.

Nits, none affecting correctness or the contract:

  • N1 (nit) — head filters.md:172-175: the INVALID_FILTER / 400 parenthetical can be read as also covering the two metadata surfaces. On main those refuse at schema parse, not with that code (dashboard.zod.ts:1537-1549; calendar-config-initial-date.test.ts:105). The refusal itself is right, and the changeset words it unambiguously.
  • N2 (nit) — head filters.md:173-174: "there" also spans time fields, where a week boundary names no time of day. The advice is exact for date and datetime (door test :650-651).
  • N3 (nit) — card item 4's "shows the resolved key" is not stated, and the dev's deviation list does not name it. On main the filter bar shows the key (dashboard.zod.ts:1670-1673; ui/packages/core/src/utils/dashboard-filters.ts:385-396). Accepted as a deviation: a display fact, the dashboards skill's subject.
  • N4 (nit) — eval 10 pins the current_ spellings, while main also resolves the bare aliases {week_start} / {week_end} (date-macros.zod.ts:154-159; date-range-presets.ts:143), which the dashboards skill itself uses in a widget filter (skills/objectstack-ui/rules/dashboards.md:272). An answer that is right on main can fail the case. So can one that quotes the refused form to warn against it. Both follow the file's existing conventions.
  • N5 (nit) — the row comment calls all five cuts "restatements"; two are corrections. The arithmetic does not depend on the label.

Implemented-by: claude/issue-35496-filters-iso-week-token
Reviewed-by: session_01L6bhgTRf6qBRCqPh4JZaZL

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTRf6qBRCqPh4JZaZL

Superseded by #35757, which folds this pull with the three other area b1-D skills-text pulls (#35743, #35746, #35750, #35751) onto current main at the seat request: one approval and one merge on the governed skills/** surface instead of four rounds on the shared token-ratchet budget. The commits of this branch are carried into #35757 unchanged by merge. Closing this one; the branch is left in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skills: filters.md Date Macros never mentions the {current_iso_week} period-key token #35391 added

2 participants