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(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 · Issue #2948 · developing-today/code

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

New issue
Copy link
New issue
Copy link
Closed
#3672
Closed
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
#3672
Copy link
Assignees
dezren39
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

Description

@dezren39
dezren39
opened on Oct 31, 2026
Issue body actions

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)

  • Petnames::commit (petname.rs:184-193) writes one JSON line + \n in a single write_all followed by sync_data, so a crash/power loss during that write can leave the full JSON with only its \n missing.
  • Petnames::open (petname.rs:53-79) replays with text.lines() (line 63), which yields the final unterminated line like any other; a parseable record is applied via store.apply(record) with no completeness check and no truncation/repair — there is no torn-tail handling in the function at all.
  • The next set/remove → commit() then appends its line directly after the unterminated one, merging two JSON records onto one line, and reports success.
  • On the next open, that merged line fails serde_json::from_str and the open returns "petname journal line {N} is malformed". open_world (world_store.rs:389) propagates the failure, so every world open fails the same way.
  • Contrast the established sibling rule: Outbox::open (envelope_outbox.rs:141-161) drops an unterminated final line "Parseable or not … Keeping a parseable torn line would let the next append merge two records onto one line and brick the queue (id(outbox): a parseable torn tail is accepted, then merged into the next record — Outbox::open only drops unterminated final lines that fail to parse #1620)"; Directory::replay (directory.rs, id(directory): a torn final line in directory.jsonl bricks the directory — Directory::replay refuses the crash-torn tail that ArtifactLog (loaded in the same open) drops and truncates #1521) and ArtifactLog::open (artifact.rs) drop and truncate the same way.

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

  • Petnames::open treats an unterminated final line as torn whether or not it parses: the line is dropped and the file is truncated to the last complete line — mirroring Outbox::open (id(outbox): a parseable torn tail is accepted, then merged into the next record — Outbox::open only drops unterminated final lines that fail to parse #1620) — ideally coordinated with the id: a torn final line in petnames.jsonl bricks the whole world — Petnames::open refuses the crash-torn tail that FileJournal and Outbox drop and truncate #1499 fix so both torn cases land in one replay rewrite (split_inclusive('\n')).
  • Regression test in petname.rs mirroring the outbox's a_parseable_torn_last_line_is_also_dropped: write a valid record, strip only its trailing newline, reopen (record dropped, file truncated), set a new petname, reopen again and replay successfully.
  • Existing behavior unchanged: a newline-terminated line that does not parse stays fatal with the line-numbered error; blank lines still skipped; healthy journals set/remove/reopen exactly as before.
  • Related, do not duplicate: id: a torn final line in petnames.jsonl bricks the whole world — Petnames::open refuses the crash-torn tail that FileJournal and Outbox drop and truncate #1499 (Petnames unparseable torn tail — open; this is its parseable sibling case), id(groups): a parseable torn final line in groups.jsonl is accepted, glued onto by the next append, and then bricks every group command #2947 (group log parseable torn tail — open, same pattern), id(outbox): a parseable torn tail is accepted, then merged into the next record — Outbox::open only drops unterminated final lines that fail to parse #1620 (outbox parseable torn tail — closed), id(directory): a torn final line in directory.jsonl bricks the directory — Directory::replay refuses the crash-torn tail that ArtifactLog (loaded in the same open) drops and truncates #1521 (directory torn tail — closed).

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    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
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · state: filed

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: new-issue-creator-code-a cron run 2026-10-31T05:05Z
    • Found via: filed this run
    • Task: Filed after verifying on main 106b057 with a laptop probe compiling the real petname.rs (sha256 ff6cba651a19ad5814a2540df12433d1444b44ff5fb258a8478cb891be88723e): a parseable torn final line in petnames.jsonl is accepted by Petnames::open, the next commit glues onto it, and the reopen bricks the whole world via open_world. Deduped against id: a torn final line in petnames.jsonl bricks the whole world — Petnames::open refuses the crash-torn tail that FileJournal and Outbox drop and truncate #1499 (open; unparseable torn case only), id(groups): a parseable torn final line in groups.jsonl is accepted, glued onto by the next append, and then bricks every group command #2947 (groups, same parseable pattern), id(outbox): a parseable torn tail is accepted, then merged into the next record — Outbox::open only drops unterminated final lines that fail to parse #1620/id(directory): a torn final line in directory.jsonl bricks the directory — Directory::replay refuses the crash-torn tail that ArtifactLog (loaded in the same open) drops and truncates #1521 (closed sibling fixes).
    • Expectation: effort/xs triage — pin the drop-and-truncate shape (ideally one replay rewrite covering id: a torn final line in petnames.jsonl bricks the whole world — Petnames::open refuses the crash-torn tail that FileJournal and Outbox drop and truncate #1499 too) and route the fix packet.
    • Links: probe (laptop) ~/git/fleet/probe-2026-10-30-laneA-petparse/ · evidence in the issue body
  3. github-actions
    assigned
    dezren39
    on Oct 31, 2026
  4. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue 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 1, 2026
  5. 7 remaining items

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

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 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
  8. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane C
    • Session / ID: queue task 5482 (resume)
    • Found via: queue claim
    • Task: Resume from the preserved laptop worktree (~/git/fleet/5482): Petnames::open fix + regression already implemented and uncommitted; verify the diff against the pin, run cargo test petname, commit/push/PR.
    • Expectation: effort xs; done = PR opened/merged, 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.
    • Links: branch queue/5482-2948-petname-torn-tail
  9. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/queuedHas a queued queue task
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 1, 2026
  10. dezren39
    added a commit that references this issue on Nov 1, 2026

    fix(id/petname): drop a parseable torn final line in Petnames::open (#…

    f606d09
  11. dezren39
    closed this as completedin #3672on Nov 1, 2026
  12. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane C
    • Session / ID: queue task 5482
    • Found via: queue claim (resume)
    • Task: Done — PR fix(id/petname): drop a parseable torn final line in Petnames::open (#2948) #3672 merged (1661784), this issue closed. Petnames::open drops a parseable torn final line; 26 petname tests pass on laptop; Codex review clean.
    • Expectation: done.
    • Links: PR fix(id/petname): drop a parseable torn final line in Petnames::open (#2948) #3672
  13. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 1, 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)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

    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.