Skip to content

fix(scheduler): 补齐 2027 年中国工作日历 - #3904

Merged
deepcoldy merged 1 commit into
masterfrom
codex/cn-work-calendar-2027
Nov 27, 2026
Merged

deepcoldy merged 1 commit into
masterfrom
codex/cn-work-calendar-2027

Conversation

@xiongz-c

Copy link
Copy Markdown
Collaborator

跨年行为

#1662 引入的内置 cn 日历只覆盖到 2026-12-31。北京时间进入 2027 年后,绑定该日历的工作日任务和休息日任务都会跳过自动执行并记录 calendar_out_of_coverage。

依据国务院办公厅发布的安排,补齐 2027 年的 7 段假期(29 天)及 5 个周末补班日,保留 2026 年数据。升级后,现有任务按原绑定继续运行。例如,每天 09:00 的工作日任务在元旦假期后于 1 月 4 日执行,1 月 31 日(周日)也可正常触发。2027 年通知(国办发明电〔2026〕10号) · 政府网站转载

影响范围

更新内置日历数据、静态资源引用和中英文使用文档。调度器、持久化格式及 CLI、IM、后端各自的执行路径沿用原实现。自定义日历与无日历绑定的任务不受影响。已核实范围截至 2027-12-31,再往后的日期仍记录覆盖不足。

验证

  • bun run test test/work-calendar.test.ts test/scheduler-calendar.test.ts test/schedule-cli-update.test.ts 通过,3 个文件共 154 项。按两份年度通知逐日核对 730 天的判定及原因码,覆盖北京时间跨年、下次触发预览、调度器实际准入和 CLI 绑定。
  • bun run build 通过,含类型检查、打包及静态资源审计。通过构建产物运行 schedule calendars,回读到 cn 版本 2027.1 和完整覆盖范围。
  • 另用 bun build --compile 编译日历模块,在独立可执行文件中验证了元旦休息、1 月 4 日工作、1 月 31 日补班和 2028 年越界。
  • git diff --check 通过。

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复审结论:0 个阻断项,代码与数据通过;CI 待全绿收口

复审对象:7bf14767efbf789bfdd81370169e54d6648db54a。该提交直接基于当前 origin/master(0e69a2de),差异为 9 个文件、+89/-68。未发现需要修改的代码或数据问题;发布本评论时仍有 build、bun-binary 及部分 test/bun-test 分片未完成,合并仍以 CI 全绿为准。

独立核对

  1. 权威来源与数据一致:读取国办发明电〔2026〕10号 gov.cn 正文及政府网站转载,2027 年七段安排逐条为:元旦 01-01..01-03、春节 02-05..02-13、清明 04-03..04-05、劳动节 05-01..05-05、端午 06-09、中秋 09-15、国庆 10-01..10-07;补班为 01-31、02-14、05-08、09-26、10-09。与 src/services/work-calendars/cn.json:19-40 完全一致。2026 年通知也重新读取,旧文件中的 33 个休息日、6 个补班日、时区和 workWeek 均逐字保留。
  2. 730 天独立探针:期望表由两份通知独立转录,经真实 checkWorkCalendar 逐日检查 2026、2027 全年的日期、状态和原因码,并核验 62 个休息日、11 个补班日、排序、coverage 与来源元数据,共 2216 项断言全部通过。北京时间边界正确:2026-01-01 首日可判,2027-12-31 仍可判,2028-01-01 返回 calendar_out_of_coverage,与 src/services/work-calendar.ts:142-148 的 fail-closed 路径一致。
  3. 编译态实测:将同一探针用 bun build --compile 编成独立单文件二进制,在无源码 JSON 读取路径下复跑全年与边界检查,2211 项断言全部通过。bun run build 通过,资产审计输出 19 dist asset(s) accounted for;src/services/work-calendars/catalog.ts:1 与 scripts/audit-embedded-assets.mjs:54 的重命名相互匹配,HEAD 无 cn-2026 残留。
  4. CLI 用户面:通过构建产物执行 schedule calendars --lark-app-id pr3904_review,实际输出 cn 的 dataVersion=2027.1、coverage 2026-01-01..2027-12-31 和完整日期表。
  5. 定向测试:bun run test test/work-calendar.test.ts test/scheduler-calendar.test.ts test/schedule-cli-update.test.ts 为 153/154 通过。唯一失败 test/schedule-cli-update.test.ts:676 是 root 下 chmod 0o000 不产生 EACCES 的环境性失败;在父提交 0e69a2de 的独立临时 worktree 中单独复跑同一条,仍以相同断言失败,确认不是本 PR 引入。
  6. 变异复验:临时删除 2027-06-09 后,test/work-calendar.test.ts 精确咬红,报告该日由期望的 rest_date/rest 变为 work_week/working;恢复后该文件 43/43 通过,git diff --exit-code HEAD -- 通过,工作树无残留。
  7. git diff --check 通过。调度器、持久化格式、CLI/IM/后端执行逻辑未改;存量 cn 绑定无需迁移,自定义日历与无日历任务不受影响。2028 年及以后仍按覆盖不足停止自动执行,不作节假日推算。

@deepcoldy
deepcoldy merged commit 7fe5bdc into master Nov 27, 2026
20 checks passed
@deepcoldy

Copy link
Copy Markdown
Owner

感谢贡献,已合并。

评审中按国务院办公厅国办发明电〔2026〕10号原文逐日核对了 2027 年七段假期(29 天休息日)与 5 个周末补班日,并确认 2026 年数据逐字保留、coverage 扩至 2027-12-31 后 2028 年仍按 calendar_out_of_coverage 收敛;编译态单文件二进制下日历数据可正常读取,定向测试与构建均通过。无遗留 follow-up。

@github-actions

Copy link
Copy Markdown

@xiongz-c @deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。

这次运行覆盖 7fe5bdc…63f6dcb16(4 个提交),同批合入的还有 #3880 #3903 #3907,失败不一定由本 PR 引起。

用例 跑道 状态 失败信息
Grok basic bot flow feishu-core-clis failed openThreadForMessage: couldn't find topic entry containing "e2e-grok-1795786610057" within 30000ms
Thread /status and /close commands feishu-core-conversation failed Node "feishu.runScenario" timed out after 1800000ms.
Claude group reply mode new-topic starts a session per topic feishu-core-group-modes failed Reply "ACK-e2e-gr-new-topic-claude-1-1795786324963 RECALL ACK-e2e-gr-new-topic-claude-1-1795786324963" appeared 0 time(s) within 240000ms, expected 1 (clicked 直接开启会话 1×; re-opened 1×; repo card butto…

@github-actions

Copy link
Copy Markdown

🚀 Released in v3.59.36

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants