Skip to content

id(world): min_tick_ms (1000) is never enforced — a program can subscribe to time.tick:1 and drive ~1,000 journaled program updates per second #1546

Closed

Description

@dezren39

Summary

WorldLimits.min_tick_ms defaults to 1000 and the architecture doc promises time.tick:<ms> is >= 1000 ms, but nothing ever reads the field. A world program can subscribe to time.tick:1 (or :10, :999) and the host will run its update, publish its records, and journal a system event at that interval for as long as anyone is present — up to ~1,000 journaled program runs per second per interval, with up to 4 distinct intervals subscribed.

Evidence (verified this run on main a120b9a9, and independently on the laptop clone)

  • pkgs/id/src/world/mod.rs:78,96 — pub min_tick_ms: u64 ("Slowest tick a program may subscribe to, in milliseconds"), default 1000. A repo-wide grep for min_tick returns only these two lines: the field is never read, and WorldCore::new (pkgs/id/src/world/core.rs:59-75) validates every other limit nonzero but not this one.
  • pkgs/id/docs/2026-10-07T00-20-00Z_architecture_roc_worlds/2026-10-07T00-20-00Z_architecture_roc_worlds.md:729 — the catalog contract: "time.tick:<ms> (>= 1000 ms, delivered only while someone is connected, so idle worlds stay idle)".
  • pkgs/id/src/world_caps.rs:165-172 — Subscription::parse accepts any time.tick:<ms> with ms > 0 as Subscription::Tick(ms); only 0 / non-numeric fall through to Unknown. Its tests (world_caps.rs:725-737) pin 1000 as a valid spec and 0 as unknown, but nothing at 1..999.
  • pkgs/id/src/world/actor.rs:468-478 — arm() inserts the raw ms as the deadline offset (now + Duration::from_millis(*ms)), no clamp against min_tick_ms.
  • pkgs/id/src/world/actor.rs:230-246,481-500 — the run loop sleeps until the earliest tick deadline, fire_ticks re-arms at the same raw interval and deliver()s each tick; deliver (actor.rs:341-376) runs program.update, publishes records, and persists a JournalEntry::System (incrementing since_checkpoint) per tick.

So the intended floor exists in three places (field, default, doc) and is enforced in none.

Why it matters

Ticks are not free: each one is a full program execution plus a journal append. A buggy or hostile program subscribed at 1 ms turns one connected viewer into a busy loop that grows the journal ~1,000 entries/sec (checkpoint churn included), burning host CPU and disk — exactly the idle/DoS bound min_tick_ms and the doc's >= 1000 ms were meant to provide. The dead field also misleads admins: setting min_tick_ms changes nothing.

Acceptance criteria

  • A subscription below the floor cannot drive delivery below the floor: either time.tick:<ms> with ms < min_tick_ms parses/refuses as a refused subscription (consistent with time.tick:0 → Unknown), or arming clamps the interval to min_tick_ms — one behaviour, chosen and documented.
  • WorldCore::new validates min_tick_ms like the other limits (or the field is removed and the floor is a named constant where it is enforced — no dead config remains).
  • Tests pin the boundary: 999 does not produce sub-second delivery, 1000 still works, and the existing 0/non-numeric Unknown behaviour is unchanged.
  • The architecture doc and the code agree on the floor afterwards.

Dedup

Searched open + closed issues for time.tick, tick interval, min_tick: no filing covers the tick floor (only hit was the unrelated quota epic #1149). Adjacent but distinct: #1506 (joined-phase metrics capability check), #1537 (sync collect_batch cap).

Activity

  1. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  2. added
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    on Oct 28, 2026
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane B, slug new-issue-creator-code-b)
    • Session / ID: cron job new-issue-creator-code-b, run 2026-10-27 19:57 CDT
    • Found via: filed this run
    • Task: Filed after verifying on main a120b9a (and independently on the laptop clone) that WorldLimits.min_tick_ms (pkgs/id/src/world/mod.rs:78,96, default 1000) is never read anywhere, Subscription::parse (world_caps.rs:165-172) accepts any ms>0, and WorldActor::arm/fire_ticks (actor.rs:468-500) delivers + journals at the raw interval — so time.tick:1 drives ~1,000 journaled program updates/sec despite the architecture doc's >=1000ms contract (docs/2026-10-07...roc_worlds.md:729). Enqueued as a triage packet to repo-health-code-pilot.
    • Expectation: triage (effort s) confirms and routes the fix: refuse or clamp sub-floor tick intervals at one chosen layer, validate or remove the dead min_tick_ms field, pin 999/1000 boundary tests.
    • Links: packet hidden_files/packet-1546.json
  4. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Oct 28, 2026
  5. 50 remaining items

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

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  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 Oct 31, 2026
  9. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane C shift
    • Session / ID: queue task 1818
    • Found via: queue claim
    • Task: MERGED — PR fix(id): refuse time.tick subscriptions below WorldLimits.min_tick_ms (#1546) #2927 merged as 41390db; this issue auto-closed. Merge basis: every substantive job of run 41162864062 has settled (test-shard-2 and both crash gates PASS; 18 successes), the only failures are the 9 basic fmt/lint/web checks that fail identically on clean main (run 41157100202 — pre-existing debt, dispositioned), Codex review completed with no findings on the merged head, and the only jobs still queued are the two aggregate rollups whose clean-main counterparts failed solely from those same pre-existing basics. The pre-existing basic-tier failures remain tracked by the fleet's main-branch CI debt work, not by this issue.
    • Expectation: done — min_tick_ms is now enforced at subscription time.
    • Links: PR fix(id): refuse time.tick subscriptions below WorldLimits.min_tick_ms (#1546) #2927 · merge 41390db
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)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/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