Skip to content

Pass shops on with the estate (stage 6b) - #35

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): BarterShops becomes the bartershops estate participant.

Pause at death. Both trade directions refuse with "This shop's owner has died." while the owning character is not alive. An owner who cannot be read keeps the shop closed. A revived owner's shop trades again.

Transfer. When RPCharacters decides an estate, each shop owned by the testator goes to the property recipient, character and account, rewritten in place in Data/<shopId>.json through DurableFiles (the old saveShop always minted a new file, so it is not used here). A journal per death, estates/<deathId>.json, is written before the first shop changes, so a crash is finished at the next settle and DONE always carries every moved shop ID (design M12). Waiting and frozen property answers DONE with nothing moved. The participant acts only while Estates.guardHolds holds and the shop migration has finished. describe() lists the character's shops.

Leftover trades. A shop with a record in trades/ stays with the testator and the estate answers BLOCKED, naming it. The new staff command /bartershops intent <shopId> [clear [--confirm]] (bartershops.admin, audit-logged to logs/staff-audit.log) follows the design's P1 table: only a prepared record whose posting is absent or REFUSED clears without --confirm, and only while Denars.ready(); prepared + APPLIED, delivering, conflict and unreadable records are shown and need clear --confirm after staff act by hand; nothing clears while the ledger is not ready. Clearing removes the file and the in-memory entry, so no restart is needed.

Reconcile and probes. The participant registers 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 the plugin still enables (checked by loading and verifying ShopMain against the 2.5.0 jar) and simply 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#214

Review. Muse's minor findings are addressed in b995f6f: journals from another death are refused, a reconcile failure on one estate no longer stops the others, plus the repository-specific items.

Tests. tfmc-mvn -o -B --no-transfer-progress clean verify: 256 tests, 0 failures (no coverage gate is configured). New tests cover the pause in both directions, the in-place owner rewrite, the transfer, idempotent re-settles, crash replay after the plan and after the shop write, removed or given-away shops, blocked shops then retry, waiting and frozen property, guard and readiness, the reconcile's change-only reporting, chained estates, registration, the probe, and every row of the intent table.

🤖 Generated with Claude Code

ryanbarlow97 and others added 3 commits October 13, 2026 14:05
Both trade directions refuse with "This shop's owner has died." when the
owning character is not alive, and stay closed while the owner cannot be
read. A revived owner's shop trades again. Pins TLibs 2.6.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Staff with bartershops.admin inspect the trade record that keeps a shop
closed and clear it. A prepared trade whose posting is absent or refused
clears at once while the ledger is ready; a prepared trade with an applied
posting, a delivering or conflict record, or an unreadable one is shown and
clears only with --confirm after staff put things right. Nothing clears
while the ledger is not ready. Clearing removes the file and this process's
copy. Every use is written to logs/staff-audit.log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bartershops estate participant gives each shop of the testator to the
property recipient, character and account, rewriting Data/<shopId>.json in
place through DurableFiles. A journal per death (estates/<deathId>.json) is
written before the first shop changes, so a crash is finished at the next
settle and DONE always carries every moved shop ID. Shops with an unfinished
trade stay and answer BLOCKED; waiting and frozen property answers DONE with
nothing moved. Settling waits for the shop migration and acts only while the
estate guard holds. describe() lists the character's shops.

The participant registers 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.

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:33
A shop planned before a crash is checked for an unfinished trade again
before it moves, and is blocked if it has one. A journal whose death or
testator does not match the estate is refused (RETRY), so another death's
shops cannot join this one. Unreadable shop files are reported once each
through the plugin logger instead of a stack trace on every pass, and one
failing estate no longer stops the hourly reconcile of the others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under Main's load order BarterShops enables before RPCharacters and turns
ready on its five-second poll, after the first-tick estate reconcile has
already returned early. Shops of estates decided at start-up then waited
for the hourly pass. The poll now runs the reconcile once when it finds
shops ready; the first-tick and hourly runs stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ryanbarlow97
ryanbarlow97 marked this pull request as ready for review October 13, 2026 18:26
@ryanbarlow97
ryanbarlow97 merged commit b515375 into main Oct 13, 2026
3 of 4 checks passed
@ryanbarlow97
ryanbarlow97 deleted the stage6b/estates branch October 13, 2026 18:26
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