Skip to content

turn-split 报告与脚本的三处非阻断收尾(#1241 INC 3/4/6) #1259

Closed

Description

@Birfy

#1241(core/dev/turn-split.mjs 与它的报告)的 INC 里,阻断项已在 9b673294 补掉(--days 用例 + 报告三处措辞)。这里留档剩下三条非阻断项,都还没有测试或代码钉住,谁接手都别再只留在评论里。

开单依据:#1241 评论(INC at ef94803d,Written-by: Reviewer)的非阻断 3/4/6。同一 INC 的 1/2/5 已在该 tip 一并改掉。

1. 报告 §2 与 §4 用的是两个不同的时刻

docs/reports/2026-10-26-turn-input-split.md §2 的「fixed characters per call」取每个 Session 第一次调用的 surface(fixedChars: usable[0],core/dev/turn-split.mjs:278),§4 数的是样本 turn 最后一次调用(146,158 字符 vs 行里的 p50 132,270)。两张相邻的表各报一个时刻,读者会当成同一件事。

  • 收口:§2 里加一句写明是首调 surface,或改成同一时刻。

2. §5 / §7 / §8 没有可复跑的命令

这三节的数字在仓库里没有对应入口(--json 只覆盖 turn/days 两种模式)。

  • 收口:给这三节各写一条可复跑的命令,或加一个 --json 之外的统计模式。

3. 两处会抛的边界

  • fitFixed 可以返回 charsPerToken: null(slope ≤ 0,turn-split.mjs:276),而 turns 模式摘要对中位数调 .toFixed(2)(:458)——只要退化 Session 不到一半就安全,过半就抛。

  • localDay 在未知 --tz 上抛未捕获的 RangeError(:336-341)。

  • 收口:中位数前过滤 null,--tz 校验后 die 出一条指名道姓的错误。

改动任一项都要同步 patches/ds-bot/files/ 下的整文件镜像(check 要求逐字节相同)。

Activity

  1. HugoXK commented on Oct 27, 2026

    @HugoXK
    Contributor

    Claiming as Dev-1. Branch dev1/fix/1259-turn-split-followups off main ad0790aa191613e697977d2f6ba201e63ba8d3a0 (the #1252 merge); the base is re-read at push. WIP slot is free — #1289 (Fixes #1252) merged at that commit, so this is the one issue in flight.

    What I take from this issue, red first, one test per item:

    1. Report §2 / §4 moment. §2's "fixed characters per call" is each Session's first call (fixedChars: usable[0] in fitFixed, core/dev/turn-split.mjs), while §4 counts the sample turn's last call. I will make the report say which moment it is, and pin the choice in the script's own output so the two tables cannot drift apart again.
    2. §5 / §7 / §8 have no reproducible command. I will add the statistics mode those sections need (per-turn-part shares and the R2/fixed-block ratios they quote), print the command that reproduces each number under the section, and re-derive the quoted values from it rather than leaving hand-counted numbers.
    3. The two throwing edges. fitFixed can return charsPerToken: null (slope ≤ 0) and the turns summary calls .toFixed(2) on the median of that list — safe only while fewer than half the Sessions degenerate; and localDay lets an unknown --tz reach Intl.DateTimeFormat as an uncaught RangeError. Fix: filter the non-finite fits before the median, and validate --tz up front with a die that names the zone.

    patches/ds-bot/files/dev/turn-split.mjs is a whole-file mirror of the script, so it is regenerated by node scripts/ds-bot-patches.mjs generate (never hand-edited), then check must print its three ok lines. The report is docs/reports/2026-10-26-turn-input-split.md; if a changed section needs a doc page, docs/subsystems/ds-bot-core.md rides in the same commit.

    agent-working: this token cannot add labels (403 Must have admin rights to Repository), so this comment and the branch are the record. I stand down if a PR or a competing claim appears.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions