Skip to content

fix: refresh realm trade when bankruptcy changes - #203

Merged
ryanbarlow97 merged 2 commits into
mainfrom
fix/bankruptcy-export-refresh
Oct 22, 2026
Merged

ryanbarlow97 merged 2 commits into
mainfrom
fix/bankruptcy-export-refresh

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

A realm treasury can cross into bankruptcy without dirtying province economics. Quiet exports could then publish its current negative bank with cached trade/production from before bankruptcy. A direct or single-guild flood between two treasury transitions could also leave the guarded cache marked fresh for outputs from the wrong state.

Refresh dirty economics before exporting live provinces, guilds and Chronicle. Guarded recalculation checks realm-bank bankruptcy alongside the model version; every completed full recalculation records that state, and partial/failed floods invalidate it. Same-state balance changes retain the cache. Chronicle uses the refreshed trade for its existing prestige update. Bank balances and settlement code are unchanged.

Validation: the original bankruptcy/export regressions fail before the fix. Three added regressions fail on the first revision and pass on the final revision: recovery after direct full and single-guild floods, and no duplicate guarded flood after a completed full recalculation. All 37 affected-suite tests pass. Final TFMC_MVN_REMOTE=0 tfmc-mvn -o -B clean verify passed all 8,510 tests with no failures, errors or skips and zero missed-line coverage. Runtime JAR validation and GitHub CI pass on head 0335990.

Independent Opus 5.5 and Muse reviews both accepted final head 0335990 with no blockers. Their direct/partial recalculation finding was reproduced and fixed before merge. No live plugin or server has been changed by this PR.

Documentation: TF-Minecraft/Docs#313

@coderabbitai

coderabbitai Bot commented Oct 21, 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.

@github-actions github-actions Bot added the size:S 10-29 effective changed lines (tests excluded in mixed PRs). label Oct 21, 2026
@ryanbarlow97
ryanbarlow97 marked this pull request as ready for review October 22, 2026 07:36
@ryanbarlow97
ryanbarlow97 merged commit 5e1cde8 into main Oct 22, 2026
3 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/bankruptcy-export-refresh branch October 22, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant