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(groups): a torn final line in groups.jsonl bricks every group command — GroupLog::open refuses the crash-torn tail that FileJournal and Outbox drop and truncate · Issue #1522 · developing-today/code

id(groups): a torn final line in groups.jsonl bricks every group command — GroupLog::open refuses the crash-torn tail that FileJournal and Outbox drop and truncate #1522

New issue
Copy link
New issue
Copy link
Closed
#2924
Closed
id(groups): a torn final line in groups.jsonl bricks every group command — GroupLog::open refuses the crash-torn tail that FileJournal and Outbox drop and truncate#1522
#2924
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)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator job

Description

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

Problem

A crash-torn final line in groups.jsonl bricks every group command: GroupLog::open refuses the unterminated partial event that a crash mid-append leaves behind, instead of dropping and truncating it the way the sibling JSONL stores in this codebase do.

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

  • pkgs/id/src/groups/log.rs:137-150 — GroupLog::append writes one JSON line + \n with a single write_all followed by sync_data. A crash/power loss during that write leaves a final line that is a truncated JSON fragment with no terminating newline.
  • pkgs/id/src/groups/log.rs:48-71 — GroupLog::open collects text.lines() through serde_json::from_str(...)? for every non-empty line. lines() yields the unterminated final fragment as a line, so one torn append fails the whole open with line N is not an event. There is no torn-tail special case: no missing-final-newline check, no truncation/repair.
  • pkgs/id/src/commands/group.rs:200,361,395 — every group command (cmd_group and helpers) starts with GroupLog::open(&log_path(path))?, so one torn append makes all group operations fail the same way until someone hand-edits groups.jsonl.
  • Contrast — the established house semantics in the same codebase:
    • pkgs/id/src/world_store.rs:85-130 (FileJournal::open): an unterminated last line is a torn append — dropped, file truncated to the last complete line; a newline-terminated unparseable line is corruption and still fails.
    • pkgs/id/src/envelope_outbox.rs:143-165 (Outbox::open): unterminated failing final line is dropped and the file truncated via set_len(kept); a complete corrupt line still errors.
    • pkgs/id/src/artifact.rs:575-600 and pkgs/id/src/directory_log.rs:196-235: same drop-the-torn-tail treatment.
  • Existing test test_a_line_that_is_not_an_event_is_an_error (groups/log.rs:386-392) writes "not json\n" — a complete, newline-terminated line — and correctly asserts an error. No test covers an unterminated final fragment, which is the distinct torn case the sibling stores forgive.
  • Dedup: 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) is the same defect class in Petnames::open only (pkgs/id/src/petname.rs); the directory journal instance is filed separately as 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. No open or recently-closed issue mentions GroupLog / groups.jsonl torn tails.

Why it matters

Groups are a user-facing feature whose entire local history lives in this one append-only log. Its own append path can produce exactly the torn tail its load path refuses — so a single ill-timed crash converts a recoverable restart into a permanently unopenable group log, while the envelope outbox written by the same binary already survives the same crash.

Acceptance criteria

  • GroupLog::open on a log whose final line is an unterminated truncated fragment loads all complete events, drops the fragment, and truncates the file to the last complete line (mirroring FileJournal::open / Outbox::open semantics, including a warning log).
  • A newline-terminated line that does not parse, anywhere including the last line, still fails — the existing test_a_line_that_is_not_an_event_is_an_error test keeps passing unchanged.
  • New tests cover: torn final fragment (loads + file truncated), torn fragment after valid events (earlier events intact and projection() still folds).
  • No change to the event format, the fold, or append behaviour.

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
    on Oct 27, 2026
  2. developing-today commented on Oct 27, 2026

    @developing-today
    developing-todayBot
    on Oct 27, 2026 – with developing.today
    Contributor
    More actions

    CODE-582

  3. dezren39
    added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 27, 2026
  4. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane A, slug new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-10-27 15:05 CDT
    • Found via: filed this run
    • Task: Filed after verifying on main 279c973 that GroupLog::open (pkgs/id/src/groups/log.rs:48-71) propagates a parse error on an unterminated final fragment with no torn-tail handling, while GroupLog::append (:137-150) can produce exactly that fragment on a crash mid-write_all, every group command opens the log first (commands/group.rs:200,361,395), and FileJournal::open / Outbox::open already drop-and-truncate torn tails. Enqueued as a triage packet to repo-health-code-pilot.
    • Expectation: triage (effort s) confirms and routes the fix: drop+truncate an unterminated final fragment in open, keep failing on newline-terminated corrupt lines (existing test at groups/log.rs:386-392 unchanged), add torn-tail tests.
    • Links: packet hidden_files/packet-1522.json · related 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), 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 journal — same defect class, different store)
  5. github-actions
    assigned
    dezren39
    on Oct 27, 2026
  6. 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 Oct 28, 2026
  7. 5 remaining items

  8. dezren39
    added
    queue/queuedHas a queued queue task
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    queue/queuedHas a queued queue task
    on Oct 28, 2026
  9. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane C
    • Session / ID: queue task 1800
    • Found via: queue claim
    • Task: Implement the triage-pinned fix for id(groups): a torn final line in groups.jsonl bricks every group command — GroupLog::open refuses the crash-torn tail that FileJournal and Outbox drop and truncate #1522: GroupLog::open drops+truncates an unterminated torn final fragment (mirroring FileJournal/Outbox), newline-terminated corruption stays fatal, plus torn-tail tests.
    • Expectation: effort s; done = PR opened with targeted tests passing, then merged if CI/Codex clean.
    • Links: task 1800; triage task 1567
  10. dezren39
    added a commit that references this issue on Oct 31, 2026

    fix(id/groups): GroupLog::open drops and truncates a torn final fragm…

    d46fdfc
  11. dezren39
    closed this as completedin #2924on Oct 31, 2026
  12. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane C
    • Session / ID: queue task 1800
    • Found via: queue claim
    • Task: Done — PR fix(id/groups): GroupLog::open drops and truncates a torn final fragment (#1522) #2924 merged (squash, d46fdfcd0): GroupLog::open drops+truncates a torn unterminated final fragment with a warning, newline-terminated corruption stays fatal.
    • Expectation: met; issue closed by the merge.
    • Links: PR fix(id/groups): GroupLog::open drops and truncates a torn final fragment (#1522) #2924 · branch queue/1800-1522-grouplog-torn-tail · laptop tests: groups::log 6/6, groups module 443/443 · Codex review clean on f9ace95 · no PR-triggered CI exists for pkgs/id (id-check.yml has no pull_request trigger; the jules push failures are repo-wide workflow-file noise, also failing on main)
  13. dezren39
    removed
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 31, 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)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator job

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.