Skip to content

id(world): fork refuses a crash-torn journal that the world's own open repairs — read_journal_entries has no torn-tail case, so a torn world opens fine but can never be forked #1523

Closed

Description

@dezren39

Problem

read_journal_entries — the raw journal reader behind id world fork — refuses a crash-torn final entry in a world journal that FileJournal::open on the very same file forgives: a world that opens, serves and verifies fine after a crash cannot be forked until someone hand-repairs its journal.

Evidence (verified this run on main 279c973, code reading)

Why it matters

Forking (F12.2) is the template/backup path for worlds. The scenario where an admin most wants a fork — recovering or cloning a world after a crash — is exactly the scenario where the journal may carry a torn tail, and it is the one path that refuses it while the world's own open path quietly repairs it. The error message (is corrupt) also misdiagnoses a torn append as corruption, sending the admin toward discarding a journal that was never corrupt.

Acceptance criteria

  • read_journal_entries (or the fork path) treats a final unterminated fragment the way FileJournal::open does: the fragment is excluded from the returned entries (and the exclusion is visible — a warning log or a fork note), so fork_world succeeds on a crash-torn source journal and the fork replays to the parent's last complete entry.
  • A newline-terminated unparseable line, anywhere including the last line, still fails with the corrupt-journal error — corruption is never silently dropped.
  • New tests cover: fork of a journal with a torn final fragment (succeeds, fork state = last complete entry), fork of a journal with a complete-but-corrupt final line (fails).
  • FileJournal::append's version-bump caller (Define rollback compatibility for world profile journal entries #227) behaviour is unchanged for journals it has opened.

Activity

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

    @developing-today
    Contributor
  3. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 28, 2026
  5. 22 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
  10. added a commit that references this issue on Oct 31, 2026
  11. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Merged PR #2933 into main: read_journal_entries excludes unterminated final fragments with a warning, allowing crash-torn worlds to be forked while preserving fatal errors for complete corrupt lines. Verified with targeted tests (world_fork 4/4 passed).

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