Skip to content

26.3 port, security fixes, CI + releases (0.1.3) - #5

Merged
k33bz merged 1 commit into
mainfrom
claude/ci-26.3
Oct 2, 2026
Merged

k33bz merged 1 commit into
mainfrom
claude/ci-26.3

Conversation

@k33bz

@k33bz k33bz commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Brings Postbox up to the standard of sanctuary, sswaystones and pathways. This PR is main, now Minecraft 26.3; the same change goes to the new 26.2 branch and to 26.1 in follow-up PRs.

Security review fixes

Severity Fix
H1 High Mail store wipe. A postbox_mail.json that failed to parse was replaced by an empty store saved straight over it at boot. That lost every mailbox, queue and in-transit letter, and letters are real books. Now the damaged file is copied to .corrupt-<millis> first (boot refuses to continue if that copy fails), and saves are atomic: temp file, then move. Null entries are dropped. MailFiles + MailFilesTest.
M1 Medium /postbox testsend and take from anywhere. Permission-0 test backends let anyone send from, or empty, their mailbox anywhere in the world. They now follow the send dialog's 8-block rule (SendDialog.inReach).
M2 Medium Outbox crash loop. A spool request with a malformed toUuid crashed the server tick at delivery, and kept crashing it after every restart. Requests are now validated on ingest, and Delivery no longer throws on a bad recipient.
L1 Low Config. An unparseable postbox.json is no longer overwritten with defaults. Every knob is clamped on load: postageCharsPerEmerald: 0 made mail free, and a negative maxQueued blocked all mail. PostboxConfigTest.
L2 Low Immortal couriers. Invulnerable, never-despawning couriers outlived their scene after a restart or chunk unload. Strays are now removed when they load, and run tags are unique per boot.
L3 Low Mailbox id collisions. IDs built from game time plus box count could repeat. New boxes get a random ID.

Checked and fine: owner-only dismantle, the 8-block send session, pay-before-consume, the earlier SNBT escaping, and book contents (no command injection).

Lines and build

  • 26.3 port. Pins follow sanctuary main: loader 0.19.5, fabric-api 0.161.0+26.3, sgui 2.2.1+26.3.
  • sgui and the dev run dir were hard-coded in build.gradle (sgui 2.1.0+26.2, run262) and shared by every branch. So the 26.1 jar bundled the 26.2 sgui, which on a 26.1.2 server also replaces sanctuary's bundled copy. Both are now per-line gradle.properties values.
  • fabric.mod.json takes ~minecraft_version, so each jar only loads on its own line.

CI and releases

  • build.yml: build and unit tests (Postage, MailFiles and PostboxConfig; 19 run locally), the existing mappings-diagnosis step, and scripts/server_test.py. The server test does two real-server boots:

    1. Config clamping, the mail store, /mail, and the outbox: a valid request is delivered as a written book and a malformed one is dropped. It also checks Lost Mail from a slain trader and stray-courier removal.
    2. A restart on a corrupt store, which must be backed up byte for byte.

    It also publishes per-line badges.

  • release.yml: on a v<mod>+<mc> tag it checks the tag against the commit, builds, runs the server test, and publishes a GitHub release with notes from the changelog.

  • CHANGELOG rewritten with real version entries; README covers branches, badges, CI and the store's safety.

This PR's CI is the first 26.3 compile and the first real-server run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DuNimi9Rxqawpjz4vh6bt9


Generated by Claude Code

Security review fixes:
- H1: a corrupt mail store is backed up (.corrupt-<millis>) before starting
  over instead of being overwritten at boot; saves are atomic. MailFilesTest.
- M1: /postbox testsend and take require standing at your own mailbox.
- M2: outbox requests with a malformed toUuid are dropped on ingest;
  delivery no longer throws on a bad recipient inside the server tick.
- L1: config parse failure no longer overwrites the file; knobs clamped on
  load. PostboxConfigTest.
- L2: leftover express couriers are removed when they load.
- L3: random mailbox ids (no gameTime+count collisions).

Lines: main targets 26.3 (pins follow sanctuary main); 26.2 moved to its
own branch. sgui and the dev run dir are per-line gradle.properties values
(the 26.1 jar used to bundle sgui 2.1.0+26.2). fabric.mod.json takes
"minecraft" from minecraft_version. CI: build, unit tests, two-boot real
server test, per-line badges, tag-triggered releases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DuNimi9Rxqawpjz4vh6bt9
@k33bz
k33bz marked this pull request as ready for review October 2, 2026 21:09
@k33bz
k33bz merged commit e69f78e into main Oct 2, 2026
1 check passed
k33bz added a commit that referenced this pull request Oct 2, 2026
Same change as main (#5): security fixes, CI server test,
badges, releases, CHANGELOG. Pins follow sanctuary 26.2: loader 0.19.5,
fabric-api 0.161.0+26.2, sgui 2.1.0+26.2; dev run dir run262.


Claude-Session: https://claude.ai/code/session_01DuNimi9Rxqawpjz4vh6bt9

Co-authored-by: Claude <noreply@anthropic.com>
k33bz added a commit that referenced this pull request Oct 2, 2026
Same change as main (#5): security fixes, CI server test,
badges, releases, CHANGELOG. Pins follow sanctuary 26.1: loader 0.19.5,
fabric-api 0.155.3+26.1.2, sgui 2.0.0+26.1; dev run dir run.


Claude-Session: https://claude.ai/code/session_01DuNimi9Rxqawpjz4vh6bt9

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants