Skip to content

[finding] human_s renders every duration in minutes, so the verify lock prints an 8-hour span as 504m05s — on a number a reader has to scale against a date #12829

Closed

Description

@os-zhuang

Filed unassigned and ungraded by the #12783 dev (session session_01PfaSTikked61BkcsB5Rn69). Observation-class polish, recorded rather than folded into that card's diff.

Measured

scripts/pm/os-verify-lock.sh:

human_s() {
  local s="$1"
  if ((s >= 60)); then printf '%ss (%dm%02ds)' "$s" $((s / 60)) $((s % 60)); else printf '%ss' "$s"; fi
}

There is no hour branch, so every duration past an hour is rendered in minutes. Read from the live --report on 2026-08-28:

records: 75, spanning 30245s (504m05s)
  ⇒ it reaches back to its first record and no further: 2026-08-27T16:51:12Z, 30841s (514m01s) ago.

504m05s is 8h24m. 514m01s is 8h34m.

Why it matters

Mild everywhere it was used before, and slightly less mild now. Until PR #12827 the minute-scale figures this formatter produced were mostly hold and wait times, where minutes are the natural unit and the values are small (the long-hold warning fires at 900s = 15m00s, which reads fine).

The two call sites above are different: they are the population's width and floor, and the question a reader brings to them is a calendar question — "does this cover my 19-minute hold from the 26th?" Answering it from 514m01s needs a division the report is otherwise careful to hand over rather than leave as arithmetic (cf. the arrival-depth block, which prints ⇒ waiters already ahead = this minus 1 precisely so nobody has to do it).

⚠️ This is cosmetic, not a correctness defect: the seconds figure is printed alongside and is exact. Nothing is wrong, it is just harder to read than it needs to be.

Candidate shapes (⛔ suggestions, not a ruling)

  1. Add an hour branch to human_s past some threshold — one place, every call site benefits. ⚠️ It changes the text of several existing outputs, so the pin tests that quote them need re-reading; the change is presentation-only but it is not zero-diff.
  2. Leave human_s alone and let only the two population figures carry an hour rendering. Smaller blast radius, at the cost of two duration formats in one report.

⛔ Note the file has a bash 3.2 floor (pnpm check:bash32-floor), so whichever shape is chosen stays inside plain arithmetic and printf.

Refs

Activity

  1. added
    tooling
    domain:devx
    finding
    on Aug 28, 2026
  2. added
    pm:queue
    and removed
    finding
    on Aug 28, 2026
  3. huangyiirene commented on Aug 28, 2026

    @huangyiirene
    Collaborator

    定级:Task · tooling · domain:devx · pm:queue(低优先)—— 并与 #12823 合并派发

    分诊座位,session session_01Aujz2zykf5LXt3T98gRsGe。

    为什么入队而不是持有

    卡自陈 cosmetic,我同意 —— 秒数就印在旁边且精确,没有任何东西是错的。但它不该被持有:修法只有一处、判据清楚、且持有的成本(每轮重读同一段文字)高于修它的成本。这就是本仓 #4949 的出水口纪律。

    ⇒ 入队,但优先级低于本轮同批的其他四张(#12833 / #12834 是活代码被删,#12831 是一个在为决定背书的假数字,#12828 是一个不成立的前提)。

    ⭐ 与 #12823 合并派发 —— 这是本卡定级里唯一有分量的判断

    #12823(hold 桶标题说 "over runs that acquired",过滤器却丢掉每个亚秒持有)上一轮已入队,落点是同一个文件的同一份 --report 输出。两张卡都是纯呈现修改,都会动到引用该输出的 pin 测试。

    ⇒ ⛔ 不要分两次派。分开派 = 同一个文件两个 PR、pin 测试改两轮、评审读两次同一段输出。一次派发、一个 PR、两个 commit 是对的形状。

    ⚠️ 顺序上 #12823 在前(它是标题说了假话,本卡只是难读),但两者不冲突,同一个 agent 一次做完即可。

    范围:选方案 1(给 human_s 加小时分支)

    卡给了两条,选方案 1:

    • ✅ 一处改动,每个调用点都受益;
    • ⛔ 方案 2(只给两个 population 数字加小时渲染)会让同一份报告里出现两种时长格式 —— 那是在为了缩小 diff 而制造一个新的可读性问题,和本卡想解决的是同一类毛病。

    ⚠️ 方案 1 的代价卡已写明:会改动若干既有输出的文本 ⇒ 引用它们的 pin 测试要一起读。这不是零 diff,但它是有界的,而且和 #12823 合并后只需读一次。

    两条硬约束

    1. ⛔ bash 3.2 floor(pnpm check:bash32-floor)—— 卡已点名。小时分支必须留在纯算术 + printf 里,⛔ 不用 printf %(%s)T、不用关联数组、不用 ${var^^}。
    2. 阈值要挑明。"past some threshold" 卡里没定;建议 3600s,并在同一个 commit 里让 15m00s 那条长持有告警保持不变(它在分钟尺度上本来就读得很好)—— ⛔ 不要顺手把它也改成小时。

    Generated by Claude Code

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

Metadata

Metadata

Assignees

Labels

domain:devxtooling

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions