Skip to content

ci(temporal): the non-SQL backends run under a skewed process zone too - #4180

Merged
os-zhuang merged 2 commits into
mainfrom
claude/adr-0053-temperature-consistency-akyja5
Jul 30, 2026
Merged

ci(temporal): the non-SQL backends run under a skewed process zone too#4180
os-zhuang merged 2 commits into
mainfrom
claude/adr-0053-temperature-consistency-akyja5

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

补上温度一致性矩阵的最后一条环境轴:非 SQL 后端此前从未在偏移的进程时区下跑过。

为什么这几个包更需要

driver-sql#3979 起就在 TZ=America/New_York 下运行,但矩阵同样约束的另外几个后端从来没有——而恰恰是它们的正确性完全依赖「与进程时区无关」,因为它们没有服务器可以推责:

  • storageDatetimeValue / storageTimeValue 用 UTC getter 折算瞬间
  • filter-token 解析器用 UTC 日历部件推导「今天」
  • analytics 的分桶器同理

把其中任何一个 getUTC* 换成本地版本,全都会按宿主偏移悄悄平移——正是 ADR-0053 D-C1 记录的那个缺陷(Date 绑到 Postgres TIME 列时按进程时区序列化)。

所以 core、formula、driver-memory、driver-mongodb、service-analytics 现在都在同一个 job、同一个偏移时区下运行。跑整包而不只是时间相关的文件,理由与 driver-sql 那一步给出的一致:包里任何一处对时区的隐含假设,都应该在发布前先在这里红掉。

顺带堵掉一个空转风险

两个测试步骤现在都会断言进程时区确实是偏移的。此前没有任何东西做这件事——删掉一行 TZ:,整个 job 会退回 UTC 覆盖而依然全绿。这与活库套件在服务器侧断言非 UTC 是同一条纪律,只是进程侧一直缺着。

守卫已实测:TZ=UTC 与未设置 TZ 都以退出码 1 拦下,America/New_York 放行。

诚实的结论:今天它什么也没抓到

落地前我先在本地量过:五个套件在 America/New_York(−5/−4,含 DST)、Asia/Kolkata(+05:30)、Pacific/Chatham(+12:45)三个时区下全部通过

所以这是棘轮而非捉虫——它把「折算一律走 UTC」这条性质从「碰巧正确」变成「被强制」。这一点值得写明,而不是把 job 说得像发现了什么。

一处刻意不改

job 的名称仍是「Temporal Conformance (live PG + MySQL)」,尽管它现在也跑非服务器的包。名称就是 required check,改名会在分支保护引用它的地方悄悄丢掉这道闸——该文件自己在 dogfood 分片处就警告过这个陷阱。已在 job 注释里写明范围已扩大。

无包变更,故无 changeset。

Refs #4081、ADR-0053 D-A3 / D-C1。

🤖 Generated with Claude Code

https://claude.ai/code/session_01TqqZmPS5a4gJGBoCTwipFr


Generated by Claude Code

`driver-sql` has run under `TZ=America/New_York` since #3979, but the other
backends the temporal conformance matrix holds to one standard never did — and
they are the ones whose correctness rests ENTIRELY on process-zone
independence, because they have no server to blame. `storageDatetimeValue` and
`storageTimeValue` fold an instant through UTC getters, the filter-token
resolver derives "today" from UTC calendar parts, and the analytics bucketer
does the same. Swap a single `getUTC*` for its local twin and every one of
those shifts by the host's offset, silently — the exact defect ADR-0053 D-C1
records for a `Date` bound to a Postgres TIME column.

So core, formula, driver-memory, driver-mongodb and service-analytics now run
in the same job under the same skewed zone. Whole suites rather than the
temporal files alone, matching the reason the driver-sql step gives: a
TZ-sensitive assumption anywhere in a package should fail here before it ships.

Both test steps now also ASSERT the process zone is skewed. Nothing did
before, so a dropped `TZ:` line would have returned the job to UTC coverage
with everything still green — the vacuous pass the live-server suites already
close on the SERVER side by asserting a non-UTC server. Verified the guard
rejects both `TZ=UTC` and an unset TZ, and accepts America/New_York.

Measured before landing: all five suites already pass under America/New_York
(-5/-4, with DST), Asia/Kolkata (+05:30) and Pacific/Chatham (+12:45). This
found nothing today, which is what a ratchet is for — it makes the property
enforced rather than incidental.

The job keeps its "live PG + MySQL" name deliberately: the name is the
required check, so renaming would silently drop the gate wherever branch
protection lists it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TqqZmPS5a4gJGBoCTwipFr
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 30, 2026 2:13pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling and removed documentation Improvements or additions to documentation tooling labels Jul 30, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 30, 2026 14:26
@os-zhuang
os-zhuang merged commit 48bec97 into main Jul 30, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/adr-0053-temperature-consistency-akyja5 branch July 30, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants