Article 1Layers
| Module | Role |
|---|---|
framework/api | Pure types: manifests, action requests and plans, state mutations, events, permissions, capability ids, language catalog, TOML config, and the economy and claims provider interfaces. |
framework/contracts-gameplay | Domain capability interfaces: organization directory and relations, war rules and status, treasury and territory settlement, approval queue, block journal, presence, progression awards. |
framework/runtime | Package manager, authorized action service, file state store, durable event dispatcher, persistent jobs, permission policy. |
hosts/minecraft/common | One source tree shared by 16 loader shells (Fabric and NeoForge, 8 Minecraft versions). |
packages/* | The gameplay packages, each with a wn-package.json manifest. |
Article 2Packages and manifests
2.1A manifest declares dependencies, the capabilities a package provides and consumes, state schemas with indexes and migrations, actions, events, subscriptions, commands, permissions and a configuration schema. Install validates the manifest and the signature (Ed25519, .wnpkg archives). Activation is staged and rolls back on failure. Upgrades migrate state and configuration. A package an operator disables is never re-enabled by the host.
2.2Optional consumers stay dormant when their provider is absent, so a package list that leaves things out still starts.
Article 3The action pipeline
- Idempotency keys are 1 to 200 characters. Replaying the same key and payload returns the stored receipt. The same key with a different payload raises a conflict.
- Handlers read an immutable state snapshot and return a plan. A single commit is capped at 16 MiB.
- Commit is atomic and optimistic: if state moved under a read, the action retries.
- Actions are marked
HOST_THREAD(touch game APIs, hop onto the server thread with a 10 second timeout) orOFF_HOST_THREAD.
Article 4State
4.1The only shipped store is a file store: one checksummed snapshot (format 8) replaced atomically, plus an append-only framed journal. A torn tail is truncated, because no receipt was issued for it. Corruption in the middle of history stops startup instead of guessing. Limits: 4,000,000 records, 1 GiB image, property indexes fail closed above 2,500,000 records. Retention keeps 10,000 events and expires receipts after 30 days.
Article 5Events and jobs
5.1Events enter a durable outbox inside the action commit and are delivered at least once, with one checkpoint per subscriber. Consumers dedupe by event id. A subscriber that keeps failing is parked so it cannot block retention. Persistent jobs allow 64 pending per package and 4,096 total, back off up to 1 minute and give up after 20 attempts.
Article 6Permissions
6.1Each permission has a privilege: PLAYER, STAFF, OPERATOR or INTERNAL. Undeclared permissions resolve to operator. Policy combines explicit and timed grants, host permission mappings (for example LuckPerms) and host level grants. See Permissions.
Article 7The seven jars
| Jar | Mod id | Holds |
|---|---|---|
| warring-nations | warring_nations | The wn.core:* gameplay packages |
| wn-claims | wn_claims | Open Parties and Claims and FTB Chunks providers (reflection only, no compile dependency) |
| wn-conform | wn_conform | Claims protection; Create, Mekanism and AE2 adapters (NeoForge 1.21.1) |
| wn-economy | wn_economy | Ledger and treasury bridge |
| wn-web | wn_web | Web host and Cloudflare front |
| wn-discord | wn_discord | Discord host (SnakeYAML relocated inside it) |
| wn-maps | wn_maps | Client map sync and the map-layers package |
7.1All seven nest the same framework jar. The loader keeps the highest version it is offered. A build check requires the seven copies to be byte-identical and that no class or resource repeats across any subset of the jars. The base mod reaches the optional web, discord and maps jars by probing for a sentinel class, not by linking against them.
Article 8Failure model
8.1State and trust fail closed. Configuration never does: an unusable config file is replaced by safe defaults and logged. Providers answer UNSUPPORTED or UNAVAILABLE rather than guess. Failed activations roll back, and poison subscribers are parked.
Article 9War lifecycle
- Declare: the declaration gate collects facts for the ruleset (claim counts, approval, government vote, price) and may require confirmation. Phase is preparing.
- Start: the war clock moves it to active on a tick. War rollback begins journaling block changes.
- Score: host reports (kills, deaths) and presence samples update the ledger.
- End: by rule (time, score), surrender, ceasefire, nation disband or treaty.
- Peace and spoils: peace negotiation moves money and land through treasury and territory settlement. Spoils react to the end. Rollback restores blocks.
Article 10Known gaps (from the repository docs)
- Nothing has run on a live server in the recorded evidence. CI runs no server smoke test.
- Treasury records keyed by nation name can leak a reserve to a new nation that reuses the name.
- A peace reparation queued before a war ends can still move money afterwards.
- Remote commands have no idempotency key, so a retry can run twice.
- Presence AFK state resets on reconnect.
- Language files are missing for diplomacy, territory, war, government, treasury, peace and approvals, so those results are in English in every language.
- Trusted compiled packages are not sandboxed, and revoking a signer does not stop an installed package by itself.