GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(world): bound every journal entry at write time by splitting the compacted checkpoint (fixes #4630) · Issue #4966 · developing-today/code

id(world): bound every journal entry at write time by splitting the compacted checkpoint (fixes #4630) #4966

New issue
Copy link
New issue
Copy link
Closed
#5316
Closed
id(world): bound every journal entry at write time by splitting the compacted checkpoint (fixes #4630)#4966
#5316
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 3, 2026
Issue body actions

Follow-up from the design note in #4962 (doc/2026-11-03T14-55-00Z_design_id4630_oversized_replication_entries.md), which chose bounded checkpoint at write time for #4630. Implementation issue — the fix for #4630 itself; #4630 closes when this merges.

Problem

WorldCore::checkpoint_entries (pkgs/id/src/world/core.rs:1063-1200) emits the whole compacted world as one JournalEntry::Checkpoint. Nothing bounds its size:

  • the program snapshot String (passed in from world/actor.rs:275) has no WorldLimits bound (snapshot_bytes bounds only the client-facing snapshot's event selection, core.rs:2063);
  • retained events (≤ retained_events, default 1024, each ≤ input_bytes 16 KiB, hex-encoded entity inputs double that);
  • admin_history (≤ min(retained_events, 4096)).

One such entry over MAX_REPLICATION_PAYLOAD_BYTES (256 KiB, pkgs/id/src/world/replication.rs:79) makes split_entry_payload return PayloadTooLarge and send_snapshot (world_replication_net.rs:206-243) fail before the first frame. No other entry kind can grow unboundedly (chat ≤ 2 KiB, input ≤ 16 KiB, participant/ceiling/schedule entries small, open_presence capped at 4096 IDs), so bounding the checkpoint bounds every entry.

Required change

Split the checkpoint into bounded part entries at compaction time, mirroring the existing pre-Checkpoint entry pattern (CapsCeiling, ScheduleSet, Isolation, ExecutionProfile, transfer entries):

  • new part entry kinds for the program snapshot, retained events, and admin history, each { sequence, part_index, part_count, ... }, split by encoded size (serde_json::to_vec of the assembled part) at UTF-8 boundaries for the string;
  • MAX_CHECKPOINT_PART_BYTES = 192 * 1024 — deliberately below the 256 KiB payload bound, leaving headroom for the part's scalar fields and JSON framing;
  • Checkpoint keeps scalars plus open_presence (≈86 KiB worst case at the 4096-ID cap, under the part bound);
  • restore assembles parts for the same sequence, refusing missing / duplicate / out-of-order / mismatched part_count parts, and applies exactly today's state;
  • bump JOURNAL_VERSION to 6 and map the new kinds in journal_version_required_by, per the existing header-bump contract (world/mod.rs:980-1060);
  • keep MAX_REPLICATION_PAYLOAD_BYTES and the envelope at v1 — no wire change, no envelope bump, no ReplicationTracker::accept change.

Constraint: a checkpoint that would exceed the part bound must be split, never skipped or truncated — compaction may not silently keep the untrimmed journal for size reasons, except for the already-documented open-presence limit.

Acceptance criteria

  • A compacted journal from a world whose program snapshot is > 256 KiB contains no entry over MAX_CHECKPOINT_PART_BYTES, and restore reconstructs the identical WorldCore state (snapshot bytes, retained events, admin history, presence, transfers, schedules, profile).
  • id(world-replication): a journal whose Checkpoint line exceeds 256 KiB can never be replicated — split_entry_payload refuses the single entry and send_snapshot dies before the first frame #4630 regression test: the same oversized-Checkpoint journal image round-trips the feed path — journal_entry_line per entry → split_entry_payload (no PayloadTooLarge) → ReplicationEnvelope::snapshot/tail + send_snapshot framing → ReplicationTracker::accept — and the accepted cursor equals the sender's final cursor; the received journal restores to the same state.
  • Boundary tests: a part of exactly MAX_CHECKPOINT_PART_BYTES passes; one byte over is split, not errored; a multi-byte UTF-8 character is never cut mid-character.
  • Journal-version tests: a v6 journal is refused by a version-5 reader at the header check; a journal needing only v1-v5 keeps its existing version.
  • cargo test -p id --lib world::replication passes.
  • The world_store replication feed tests pass (they build snapshot bytes through the same path).
  • The existing journal-version / restore / compaction suites pass (cargo test -p id --lib world).
  • The module doc of pkgs/id/src/world/replication.rs states the resulting per-entry guarantee from the design note (every writer-emitted entry ≤ 192 KiB, hence ≤ one v1 payload frame), replacing "such an entry can never be replicated in v1".

Out of scope

  • Sub-entry fragmentation / continuation frames (rejected in the note: v1→v2 wire bump plus permanent receiver buffering for a writer-controlled entry kind).
  • Raising MAX_REPLICATION_PAYLOAD_BYTES (deferred; it changes a receiver-side constant, so it is a compatibility decision).
  • Legacy journals already holding an oversized Checkpoint — handled by the companion residual issue.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 3, 2026
  2. dezren39
    added a commit that references this issue on Nov 3, 2026

    docs(id): link design-note follow-ups (#4966, #4967)

    ec11822
  3. developing-today
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    status/needs-triageNot yet triaged; needs a first look
    on Nov 3, 2026
  4. developing-today commented on Nov 3, 2026

    @developing-today
    developing-todayBot
    on Nov 3, 2026 – with developing.today
    Contributor
    More actions

    agent-note:v1
    state: reviewed (coverage loop-back)
    Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 8558 (triage, queued, priority 40) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
    Found via: coverage loop-back 2026-11-03

  5. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 3, 2026
  6. github-actions
    assigned
    dezren39
    on Nov 3, 2026
  7. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-b
    • Session / ID: task 8558
    • Found via: queue claim
    • Task: task 8558 for issue id(world): bound every journal entry at write time by splitting the compacted checkpoint (fixes #4630) #4966 (triage) — execution lane assigned opencode
    • Expectation: the laptop claimant launches the bound opencode session, which drives task 8558 to its terminal state
    • Links: issue id(world): bound every journal entry at write time by splitting the compacted checkpoint (fixes #4630) #4966
  8. 37 remaining items

  9. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 4, 2026
  10. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked — supplemental read-only audit (no tests run)

    • Implementation is substantially present in pkgs/id/src/world/core.rs (snapshot/event splitting and restore validation), world/mod.rs (entry kinds and v6 mapping), world/replication.rs, and world/tests.rs. Do not stage the whole worktree: 49 files are modified, with broad formatting churn in unrelated files (including boards.rs and web/markdown.rs).
    • Likely failing regression: world/replication.rs:1445 computes the expected cursor with chain_payload(base, &journal_bytes) for the whole oversized journal; that helper rejects payloads over 256 KiB. Advance the expected cursor per bounded entry/frame instead.
    • Gaps to check on resume: exact 192 KiB and one-byte-over tests; documentation of the writer-emitted entry size guarantee; explicit v5-reader rejection of a v6 header.
    • Safety question (potential, not established by the failed search): separate source inspection found a handoff_transfers() accessor but no visible bound on HandoffTransferState or its payload. The search for nonexistent pkgs/id/src/world_caps.rs failed and is not evidence for this question. Confirm whether transfer count/payload can exceed the 192 KiB scalar checkpoint limit, or provide a safe fallback, before claiming the “split, never skip” acceptance.
    • Preserve the worktree and classify unrelated changes before staging. Resume from /home/user/git/fleet/task-9178.

  11. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue 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 4, 2026
  12. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    agent-note:v1
    task: 9178
    lane: code-o
    state: picked-up
    note: Resuming task 9178 for #4966 (direct lane). Existing laptop worktree /home/user/git/fleet/task-9178 on branch queue/9178-4966-bounded-checkpoint-parts has an unclassified dirty diff from a prior lane; this shift will classify it file-by-file, preserve unrelated changes, and finish only the #4966 scope.

  13. dezren39
    added 2 commits that reference this issue on Nov 4, 2026

    id(world): fix checkpoint splitter edge cases from Codex review (#4966)

    3cdba9d

    id(world): split oversized compacted checkpoints into bounded journal…

    285b8b9
  14. dezren39
    closed this as completedin #5316on Nov 4, 2026
  15. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    agent-note:v1
    task: 9178
    lane: code-o
    state: done
    note: Fixed and merged via PR #5316 (squash 285b8b9); #4966 closed. Classified the inherited 49-file dirty diff: 45 files were rustfmt-style churn only (full diff preserved on the laptop at ~/git/fleet/task-9178-full-diff-backup-2026-11-04.patch) and were restored; the 4 world files carried the implementation. Made splitting conditional (inline checkpoint when it fits <=192 KiB, parts only when oversized, so fitting journals keep their existing version), fixed the replication round-trip test cursor computation, and fixed both Codex P2 findings (multibyte midpoint search; quadratic event sizing) with a regression test. Tests: world suite 223 passed; full id lib 2107 passed with one load-flaky log_sync timeout that passes solo. Codex re-review: no findings.

  16. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.