Skip to content

id(petname): a parseable torn final line in petnames.jsonl is accepted, glued onto by the next append, and then bricks the whole world — Petnames::open has no torn-tail handling at all #2948

Closed

Description

@dezren39

Summary

id(petname): Petnames::open (pkgs/id/src/petname.rs) accepts a parseable torn final line — a complete petname record JSON whose trailing newline was lost to a crash mid-append — and the next commit() append glues the new record onto that same line. The resulting file can never be opened again: the glued line is unparseable, so Petnames::open fails fatally with "petname journal line N is malformed", and because open_world propagates that error (world_store.rs:389), the whole world bricks until someone hand-edits petnames.jsonl.

This is exactly the failure #1620 fixed for the envelope outbox ("a parseable torn tail is accepted, then merged into the next record") and #2947 filed for the group log. The sibling rule those fixes established — an unterminated final line is torn, parseable or not, and is dropped and truncated at open — was never applied to Petnames. #1499 (still open) covers Petnames only for the unparseable fragment case; its acceptance criteria drop only a final line that is "unterminated and unparseable", so a parseable torn tail survives that fix and still glues.

Evidence (main 106b0571)

Verified (laptop probe, real petname.rs)

Probe: ~/git/fleet/probe-2026-10-30-laneA-petparse/ on the laptop, compiling the real petname.rs (sha256 ff6cba651a19ad5814a2540df12433d1444b44ff5fb258a8478cb891be88723e, identical to the sandbox checkout at main 106b0571) against a stub directory::Refusal; cargo run exit 0:

control journal bytes: "{\"op\":\"set\",\"owner\":\"00ff\",\"account\":\"aa11aa11\",\"name\":\"Ali\"}\n"
CONTROL clean journal: open OK, Ali=Some("Ali")
PARSEABLE TORN TAIL: open OK, Carol=Some("Carol") (accepted despite no newline)
AFTER NEXT APPEND bytes: "{\"op\":\"set\",\"owner\":\"00ff\",\"account\":\"aa11aa11\",\"name\":\"Ali\"}\n{\"op\":\"set\",\"owner\":\"00ff\",\"account\":\"cc33cc33\",\"name\":\"Carol\"}{\"op\":\"set\",\"owner\":\"00ff\",\"account\":\"dd44dd44\",\"name\":\"Dave\"}\n"
REOPEN AFTER APPEND: open FAILED: petname journal line 2 is malformed: trailing characters at line 1 column 64
  • Control: a healthy newline-terminated journal opens and replays.
  • Case: after appending a complete record with only its trailing \n stripped (the crash cut), reopen accepts Carol; the next set (Dave) succeeds but glues onto Carol's line; the final reopen is bricked.

Why it matters

petnames.jsonl is a small private store, but open_world loads it on the world-open path, so one unlucky crash during a petname rename converts a recoverable one-byte tear into a permanently unopenable world on the next ordinary write — silently (the append reports success). Three sibling stores in the same crate already encode the correct rule with regression tests; Petnames is the remaining store that doesn't, and the open #1499 fix as scoped does not close this parseable half.

Acceptance criteria

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)
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: filed

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 1, 2026
  4. 7 remaining items

  5. added
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 1, 2026
  6. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: ses_e5e694e24f2ffewiZH7IfYuYHP · queue task 5482
    • Found via: repo-health-code-pilot atomic claim
    • Task: Parked during cold Cargo compilation as the scheduler cutoff approached.
    • Expectation: Resume from the existing worktree and running test shell; no triage or worktree recreation. Commit/open PR only after the targeted test result is verified.
    • Links: branch queue/5482-2948-petname-torn-tail · worktree /home/user/git/fleet/5482 · test shell sh_wxe3l2cq
  7. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/queuedHas a queued task in the Supabase agent queue
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 1, 2026
  9. dezren39 commented on Nov 1, 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/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