Skip to content

fix(history): ISO 时间校验日历日期,插件版本升到 0.15.25-shared.6 - #16

Merged
mtmtian merged 3 commits into
mainfrom
claude/transcripts-iso-date
Oct 18, 2026
Merged

mtmtian merged 3 commits into
mainfrom
claude/transcripts-iso-date

Conversation

@mtmtian

@mtmtian mtmtian commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

处理 #15 里 Codex review 的两条未处理意见。

日期校验:bin/transcripts.mjs 只对纯日期(2026-02-30)做了日历校验,ISO 时间直接交给 Date.parse,而 V8 会把超出当月的日数顺延到下月:--until 2026-02-30T23:00:00Z 实际变成 2026-03-02T23:00Z,时间窗被悄悄放宽。现在两种写法都先按 Date.parse 所用的前推格里历做纯算术校验(不经过本地时区和 Date 构造函数),不存在的日期报 is not a calendar date;小时越界、时区等仍由 Date.parse 处理。纯日期的本地零点改用 setFullYear 构造,顺带修好 0050-01-01 这类 0–99 年纯日期被误拒的旧问题。

scripts/transcripts.test.mjs 新增:2026-02-30T23:00:00Z、2026-04-31T00:00 判非日历日期;0000-01-01T00:00:00Z、TZ=Pacific/Apia 下的 2011-12-30T12:00:00Z(萨摩亚本地跳过的日子)、纯日期 0050-01-01 按原样解析。各例在对应修复前失败、修复后通过。

版本号:#15 新增了运行时 helper 但两个 manifest 停在 0.15.25-shared.5,按 docs/guide/01-setup.md 一起升到 0.15.25-shared.6。本机 Claude 目录型 marketplace 与 Codex 同版本覆盖安装其实已拿到新代码,升版本主要是遵守发布流程、照顾按版本判断更新的安装方式。

验证:

  • PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH" bash scripts/check.sh → all checks passed.(fork guards、75 个 Node 测试、Python 测试 18+8+9+22+26、Bun 111 个、runtime 产物与源码一致)
  • 与 main 对比:Asia/Shanghai、America/New_York、Europe/London、Pacific/Apia 四个时区 × 6 组常规输入(含夏令时切换日、闰日、带偏移的 ISO 时间),解析出的 since/until 24 组全部相同。

🤖 Generated with Claude Code

mtmtian and others added 2 commits October 18, 2026 12:59
Date.parse 会把超出当月的日数顺延到下个月,例如
--until 2026-02-30T23:00:00Z 被当成 3 月 2 日,时间窗被悄悄放宽。
现在纯日期和 ISO 时间都先校验写出的年月日,不存在的日期报
"is not a calendar date";小时、时区等其余部分仍交给 Date.parse。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
发布 PR #15 新增的 bin/transcripts.mjs 与本次日期校验修复,两个
manifest 按 docs/guide/01-setup.md 的要求一起升级。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T05:10:28.399481Z b67d358 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f50147c919

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/transcripts.mjs Outdated
上一提交用本地 new Date(y, m, d) 校验日期,ISO 时间因此被两类情况误拒:
0000–0099 年会被构造函数映射到 1900 年代,本地日历跳过的日子(如
Pacific/Apia 的 2011-12-30)对 UTC 时间也判无效。改为按 Date.parse 所用
的前推格里历做纯算术校验;纯日期的本地零点改用 setFullYear 构造,0050-01-01
这类纯日期也不再被误拒。四个时区下 24 组常规输入与 main 结果一致。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mtmtian
mtmtian merged commit f583ee4 into main Oct 18, 2026
3 checks passed
@mtmtian
mtmtian deleted the claude/transcripts-iso-date branch October 18, 2026 05:45
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.

1 participant