Skip to content

id(world-doctor): clock check accepts absurd future readings — its doc promises a zero-or-absurd check but only zero is tested, so a clock set to year 2100 (or u64::MAX) reports ok #3004

Closed

Description

@dezren39

Summary

id world doctor's clock check promises to catch an absurd clock reading but only checks that the reading is positive — a clock set years or millennia in the future reports ok.

Evidence (main bd13798)

  • pkgs/id/src/world_doctor.rs:399-411 — the doc comment on check_clock says: "The clock reads a positive unix time. A zero (or absurd) reading means the system clock is before the epoch, which breaks every schedule and expiry." The implementation is only:

    match inputs.now_ms {
        Some(now) if now > 0 => ok("clock", format!("{now} ms since the epoch")),
        _ => fail(/* ... */),
    }

    No upper bound / absurdity check exists anywhere in the check.

  • The CLI feeds it the real system clock: pkgs/id/src/commands/world.rs:445 sets now_ms: Some(crate::time::unix_ms()).

  • Verified this run on the laptop with a verbatim copy of check_clock (world_doctor.rs md5 d82936864cfb68121393220ece88f98f, identical on both clones; probe ~/git/fleet/probe-2026-10-31-laneB-doctorclock/):

    input result
    Some(0) / None Fail (correct)
    realistic 2026-10-31 ms Ok
    year 2100 (4102444800000 ms) Ok
    year 3000 (32503680000000 ms) Ok
    u64::MAX Ok

Why it matters

Doctor exists to mechanically diagnose a broken world setup, and a mis-set clock is one of its six named checks. A far-future clock (bad RTC, mis-set VM/container clock — the classic failure this check is for) silently breaks the things the fix text itself names: schedules are bounded relative to now (MAX_SCHEDULE_HORIZON_MS, 30 days, world_caps.rs:99-101) and expiries compare against now, so a clock years ahead makes expiries instantly due and schedules un-settable — while id world doctor reports the clock check ok and sends the operator looking elsewhere. The module's other checks are carefully aligned with the code they diagnose (e.g. the journal check matches restore semantics, the profile check matches WorldExecutionProfile::resolve exactly); the clock check is the one whose implementation does not deliver what its own contract states.

Acceptance criteria

  • Triage pins the absurdity rule: the upper bound (e.g. a fixed sanity ceiling or a bound relative to a plausible range) and the severity (Fail vs Warn) for a beyond-bound reading, including what the detail/fix text should say for the future case (the current Fail text only covers "before the unix epoch").
  • check_clock implements the pinned rule; realistic current timestamps still report Ok, zero/None still Fail.
  • Unit tests in world_doctor.rs cover: zero, a realistic now, the pinned boundary, and a far-future value (year 2100 / u64::MAX class).
  • The doc comment and the implementation agree after the fix.

Dedup: no open or closed issue covers the doctor clock check (issue search for doctor/clock returned only #2093, the doctor journal disagreement — distinct check). NOT self-solved: the bound and severity are triage's pin.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/lowNice to have; do when convenient
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: filed
    Found via: filed this run by new-issue-creator-code-b (Lane B). Verified on the laptop with a verbatim copy of check_clock (world_doctor.rs md5 d82936864cfb68121393220ece88f98f on both clones, main bd13798; probe ~/git/fleet/probe-2026-10-31-laneB-doctorclock/): zero/None Fail, realistic now Ok, year 2100 / year 3000 / u64::MAX all Ok despite the doc comment promising a zero-or-absurd check. NOT self-solved: the absurdity bound and severity are triage's pin.

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 1, 2026
  4. 15 remaining items

  5. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  6. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · correction (lane E shift, post-shift)

  7. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent: repo-worker-code (lane C)
    state: parked
    task: 5515
    issue: 3004
    pr: 4288

    Lane C claimed task 5515 and parked it again — with one correction and one change since the last park. Correction: this task's PR is #4288 (branch queue/5515-3004-clock-bound, head 569729b, verified by branch lookup); the #4289 named in the task progress belongs to task 5505 (lane E already logged the same correction). Change: the diff and PR body check out (ABSURD_FUTURE_NOW_MS = 2100-01-01 bound, boundary test at bound-1 / bound / u64::MAX), the PR is mergeable, and there are no Codex findings — but the test has still never passed anywhere: the laptop cargo run was interrupted by an SSH drop and CI run 41416960232 remains queued (runner backlog). Laptop load briefly fell below the gate (3.97/13.56/38.07 at 09:44Z) but spiked back to 117/107/76 before a compile could run. Parked 1h; resume when CI completes green or a sustained low-load window allows cargo test --lib world_doctor, then merge PR #4288 and close #3004.

  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  9. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  10. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions