Skip to content

Send waiting letters on with the estate (stage 6b) - #38

Merged
ryanbarlow97 merged 5 commits into
mainfrom
stage6b/estates
Oct 13, 2026
Merged

ryanbarlow97 merged 5 commits into
mainfrom
stage6b/estates

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Stage 6b (estates and wills, umbrella TF-Minecraft/RPCharacters#89): BirdMessenger becomes the birdmessenger estate participant (design D8, R17, M7).

Sending character. New letters record senderCharacterId in both serialisations, in-flight StoredMail (sender-character) and the pending letter maps, so it survives addPending. Queued letters also keep the mail's ID.

Settle. For the testator's pending letters:

  • letters recipient CHARACTER (will heir): re-keyed, characterId and ownerUuid, to the heir and delivered as normal mail;
  • SENDER, with senderCharacterId and that character alive: back into its pending queue, delivered with "Returned: the recipient has died";
  • SENDER, older letter with only the sender account: into a new account-keyed returned queue (returned_mail.yml), delivered at the account's next character session with "Returned";
  • SENDER, writing character dead or unknown, no sender, or the testator's own unsent letter: left in the testator's queue and listed by describe() (writer's character name, never a UUID) for /estate show; it goes back by itself if the writer is revived. DONE counts only moved letters.

Each moved letter gets a stored ID first (saved before anything moves), and estates/<deathId>.yml lists the IDs before the queue changes, so DONE always carries every moved ID (M12). A move is all or nothing: receiving queues are checked first, a failed save puts every queue back in memory and the participant answers RETRY. Mail files are written whole (temp, fsync, atomic move, folder fsync). The account queue is saved before the testator's queue drops a letter; load discards a copy left behind by a crash in between. In-flight letters are untouched; the hourly reconcile moves them once they land.

Reconcile and probes. The participant registers after mail loads and only when TLibs has the estate API (Class.forName probe), settles every decided estate on the first tick and hourly, and reports with the revision answered, only when the outcome changes. On TLibs 2.5.0, BirdMessenger, MailStore and MailService load and verify without the estate classes; the plugin enables and logs that it does not take part.

Pins TLibs 2.6.0, which is not released yet, so CI may fail resolving it until it is.

Docs: TF-Minecraft/Docs#220

Review. Muse's findings 1-6 are all addressed (5cf2d2b, 48784d5).

Tests. tfmc-mvn -o -B --no-transfer-progress clean verify: 247 tests, 0 failures, JaCoCo line gate (0 missed) met. Behaviour tests cover the sending character through flight and the queue, ID assignment, heir moves, returns to the writing character and to the account, every held case, revival of a held writer, idempotent and cumulative settles, a late landing letter, the crash between the two files, damaged returned queues, failed hand-overs, journal failures, describe, change-only reporting, registration, the probe and enabling without the estate API.

🤖 Generated with Claude Code

ryanbarlow97 and others added 3 commits October 13, 2026 14:48
New letters record the sending character (senderCharacterId) in flight and
in the pending queue, and queued letters keep the mail ID. The store gains
what estates need: stored IDs for letters queued earlier, moves to an heir
or back to the writer, and an account-keyed returned queue in
returned_mail.yml for letters that never recorded their writer. A letter
coming back because its recipient died says so; one returned to an account
arrives at that account's next character session, marked as returned.

The account queue is saved before the dead character's queue drops a
letter, and load discards a copy left behind by a crash in between.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The birdmessenger estate participant moves the testator's pending letters.
With a will heir they are re-keyed (character and account) to the heir and
delivered as normal mail. Without one, each goes back to the character that
wrote it, marked "Returned: the recipient has died"; a letter from before
writers were recorded goes to the writer's account queue; a letter whose
writer is dead or unknown, or the testator's own unsent letter, stays and is
counted as held for staff (it goes back if the writer lives again). Each
moved letter carries a stored ID; a journal per death (estates/<deathId>.yml)
lists them before the queue changes, so DONE always carries every moved ID.
In-flight letters are left alone and moved by the hourly reconcile once they
land.

The participant registers after mail loads, only when TLibs has the estate
API, reconciles on the first tick and hourly over decided estates, and
reports changed outcomes with the revision answered. Pins TLibs 2.6.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:XL 500-999 effective changed lines (tests excluded in mixed PRs). label Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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.

ryanbarlow97 and others added 2 commits October 13, 2026 15:30
Mail queues are now written whole: a flushed temporary file moved over the
queue, then the folder flushed. Estate moves no longer use the saves that
only log a failure: identifyPending and moveEstateLetters throw when a
queue cannot be saved, and put the queues back in memory first, so the
participant answers RETRY instead of DONE for letters that never reached
disk. Every receiving queue is checked before anything changes, and each
moved letter gets its own copy of the item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DONE carries only the letters count, so the site memorial never shows a
held count as something received; letters held for staff are listed by
describe(). Labels name the writer's character, or say the letter predates
recorded writers, instead of showing account or character UUIDs. The
estate journal is written through the same durable path, folder flush
included, and one failing estate no longer stops the hourly reconcile of
the others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ryanbarlow97
ryanbarlow97 marked this pull request as ready for review October 13, 2026 18:27
@ryanbarlow97
ryanbarlow97 merged commit ae57b8a into main Oct 13, 2026
3 of 4 checks passed
@ryanbarlow97
ryanbarlow97 deleted the stage6b/estates branch October 13, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant