Repository navigation
fix(install): supply IANA timezone data on Windows - #7454
Conversation
Signed-off-by: BigDataDZ <76271875+BigDataDZ@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max
动机 / Motivation
使用 pip 安装 LoopX 的 Windows 用户,在配置具名时区的周期报告时会遇到这个问题。此前包没有声明时区数据库依赖,在没有系统 IANA 数据的环境中,上海、纽约这样的有效时区也会被拒绝;改后 Windows 安装会解析 tzdata 依赖,现有配置和日历计算可继续使用这些时区。独立构建并实际安装 wheel,清空系统时区路径:缺少数据时四个有效日历场景失败;补入 tzdata 后,上海、DST 跳时和重复时刻、错误输入及关闭状态共 10 个检查全部符合独立预期。本 PR 只修复包管理安装的数据供给并加强现有 Windows CI;不增加报告订阅、发送权限或调度器,也不宣称源码快照安装器、真实宿主持续运行或模型收益已验收。
改动思路 / Approach
把数据供给放在既有 Python 依赖元数据中,继续由标准库 ZoneInfo 和原报告 owner 解释时区,比自写时区表、容错回落 UTC 或要求用户逐次修环境更小且忠实。本次边界为 pip/wheel Windows 依赖供给及既有 Windows lane 的两个报告模块;现有源码快照安装器不在本次修复内。依赖增加的是时区资源可用性,已有用户意图、日历计算和订阅权限继续由原 owner 处理;这里不应以 UTC 回落掩盖一个用户指定的时区。原 Windows lane 已先安装 .[test],新增步骤直接运行已有两个完整模块,失败仍阻断,不新增第二套时区 oracle。普通 pip 用户不需要多一轮确认或手工配置数据库。下载失败仍交给 pip;合法配置与真正非法输入的校验职责没有混在安装器里。
具体改动 / Changes
关键代码讲解
project.dependencies使用标准tzdata; sys_platform == 'win32'。已检查实际 wheel 的Requires-Dist并解析平台条件:win32 选中,linux/darwin 不选中;不是只检查源文件字符串。- Windows 具名时区步骤 位于既有安装后,执行 cadence 和 machine-default 模块;原 job 条件、权限和失败语义保持。
normalize_report_cadence与report_cadence_window源码未改。它们继续接受真实 IANA 时区并拒绝非法规则,DST 跳时跳过、重复时刻只使用第一次;这次只补充它们原本就消费的数据。
规范为 docs/reference/protocols/periodic-report-v0.md,固定 spec_revision=bafbafc258de72029b54ea016103c0a7bd2409c9:日历契约。本评审的判据名映射为:IANA-CALENDAR → implemented,实际安装包在空系统时区路径下可识别上海/纽约;DST-SINGLE-WINDOW → implemented,gap 跳过、两次 fold 观察得同一完整窗口;REJECT-INVALID-TIME → implemented,invalid zone、HOURLY 和 timezone mismatch 仍明确拒绝;NO-ACTIVATION → implemented,空日历、disabled UTC、未配置 Goal 保持原结果。后两项由同输入 base/head 以及安装后的真实 normalizer 验证,数据就绪没有变成发送授权。
对主干的风险 / Risks
未发现阻断问题。PASS:独立构建/验证 Chat bundle 和 wheel,非 editable 隔离安装后核对 1748 个产品 Py/TS 成员与精确源码及 wheel 逐字一致。PYTHONTZPATH 为空且没有 tzdata 时,10 个检查里 6 个预期失败,其中四个有效日历先被错误拒绝;补入标准 tzdata 后,10 个全部符合独立预期。再用不可变 base 218aa087b66bb99038b1ce7d782110741a5e42ae 与 head、两种数据条件各跑相同输入,完整 case 值与错误文本相等,没有只比 decision code。无日历、disabled UTC、未配置 Goal 和 invalid zone 的完整结果在数据有无之间也相同。
PASS:两个报告模块加 tests/test_python_ci_workflow.py 共 603 passed;原生 premerge 4 direct + 1 catalog + 1 boundary 全过,无 manual hold。首次私有审阅控制器在这两次真实安装 probe 已完成后缺少 packaging;保留该失败,只用现成测试解释器恢复元数据解析,没有重复安装、删断言或挑选成功运行。作者先前的 Windows/license 观察没有被改判为独立通过。
UNVERIFIED:本次独立宿主是 macOS,空系统时区路径与标准 marker 判定不是原生 Windows 运行,也没有查询/等待 CI。另外已经检查 scripts/install-windows.ps1 → windows_install.install_windows:源码快照路径复制源码并使用选定解释器,不经 pip 解析这个依赖,因此不能宣称该安装路径已修复。它是已有边界,不是本 PR 新引入的回归;本批准明确限于普通包管理安装,不要求把无关安装器重构塞入本切片。
语义与 CI 对齐
本次复用既有日历语义和外部 PEP 508 平台词汇,没有新增 prose/substring 状态分类、新协议或兼容 decoder。CI 新步骤加强现有 Windows 检查,没有取消失败、缩范围或抬预算。标准 tzdata 仍有安装下载和后续维护成本,本次没有测量完整长期费用;这些成本不构成修改用户日历或额外报告授权的理由。
我的整体评价 / Verdict
建议 APPROVE,绑定 7362bdc3f3ae90775037560739d66f4916d0033a。长期工作语义 preserved,用户体验 improved 的具体增量是普通 Windows 包安装无需用户另查数据库,即可继续原配置路径;并不声称模型或持续效率收益。把数据供给放在既有 Python 依赖元数据中,继续由标准库 ZoneInfo 和原报告 owner 解释时区,比自写时区表、容错回落 UTC 或要求用户逐次修环境更小且忠实。本次边界为 pip/wheel Windows 依赖供给及既有 Windows lane 的两个报告模块;现有源码快照安装器不在本次修复内。机制与问题相称,无新持久状态、策略层或额外用户确认;回退也可在包版本边界处理。视觉检查 not_applicable:已核完整两个文件 diff 及既有配置入口,依赖与 CI 变化没有修改界面、文字或布局。未验证视觉范围:none:该 diff 没有视觉变更;正式 App 和原生 Windows 执行另列未验证。合并授权、安装到活跃宿主和其它现存安装路线的修复分别保留。
English verdict: APPROVE — the Windows package now declares the standard IANA data dependency while preserving existing calendar and subscription semantics; native Windows and source-snapshot installation remain separate qualifications.
A clean Windows installation cannot resolve named timezones such as
Asia/Shanghaibecause Windows has no system IANA database and the LoopX wheel declares no timezone-data dependency. Existing periodic-report configuration and cadence then reject valid zones before report generation can begin.Declare the standard
tzdataruntime dependency only on Windows, retainingzoneinfoand the existing cadence/configuration owners. Add the existing cadence and machine-default suites to the native Windows lane so missing data is caught with real named-zone, DST and invalid-zone checks. Unix dependency selection, UTC defaults, schedules and authority rules remain unchanged.Validation at signed head
7362bdc3f, target main218aa087b:schedule.timezone is unknown(2 failed); the report lifecycle also fails resolving its Shanghai configuration.loopx.__file__resolves to that environment's site-packages. With systemTZPATHexplicitly empty, installed production cadence handles Shanghai's offset, New York DST gap/fold and invalid-zone rejection correctly. Wheel metadata has the Windows marker; standard marker evaluation excludes Linux/macOS. This is disposable installation evidence, not adoption by an existing user installation.npm ci --ignore-scriptsand the currentbuild:chat, wheel build/install pass; the existing Vite chunk-size warning remains. Generated assets, wheel, lockfile and logs are excluded from the PR.Author declaration: authored with OpenAI Codex under contributor direction. Placement: existing periodic-report configuration/cadence calls use stdlib zoneinfo; this is platform package data, not a new provider or decision owner. No frontend/Lark/CLI contract or activation changes; existing configuration becomes usable with named zones on Windows. The adjacent refactor pass found no computation change needed. No model/benchmark job, active Goal mutation, system upgrade or self-merge. Independent review and current-head CI remain pending; maintainer merge required.