Skip to content

fix(id): make world doctor journal check match restore (#1598) - #1600

Merged
dezren39 merged 1 commit into
mainfrom
creator-b/1598-doctor-journal-first-entry
Oct 28, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-b/1598-doctor-journal-first-entry

Conversation

@dezren39

@dezren39 dezren39 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Fixes #1598

validate_journal_file in world_doctor.rs now agrees with the code that actually opens a journal:

  • Version range is JOURNAL_VERSION..=MAX_JOURNAL_VERSION (1..=2), matching WorldCore::restore (world/core.rs) — version 0 is refused instead of reported as a valid "format version 0".
  • First-entry checks (Created must be first; first entry must be Created) use the count of parsed entries, not the raw split-line index, which blank lines skewed: a leading blank line no longer fails a valid journal and no longer lets a headerless journal pass. (read_journal_entries in world_store.rs skips blank lines before parsing, so restore judges the first parsed entry.) Malformed-entry errors keep the raw line number.

New unit test a_journal_version_zero_and_blank_lines_match_restore pins all three cases from #1598 (version 0, blank-line + Created, blank-line + headerless).

Verification: probe crate on the laptop pre-fix showed doctor/restore divergence on all three cases (see #1598); cargo test --lib world_doctor on the laptop after the fix — results in the closing note on #1598.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner October 28, 2026 05:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T05:36:53.812413Z cd50501 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit 63ba170 into main Oct 28, 2026
4 checks passed
@dezren39
dezren39 deleted the creator-b/1598-doctor-journal-first-entry branch October 28, 2026 05:36
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant