Preserve JARVIS menus while porting gameplay, Citizens NPCs and plugin-only CI

This commit is contained in:
unimatrixgit 2026-11-29 01:54:16 +01:00
commit dbf4bb25ff
137 changed files with 2251 additions and 196035 deletions

View file

@ -1,69 +0,0 @@
# Account control panel — 27 October 2026
## Published sites
- Standalone account site: https://cp.dunerealms.com/
- Embedded login, registration and account panel: https://www.dunerealms.com/account.html
- Monthly community support: https://www.dunerealms.com/donate.html
- Dutch naming explanation: https://www.dunerealms.com/wiki.html and the first manual chapter.
- Planet sigils: https://www.dunerealms.com/arrakis.html#route-sigils and the currency/travel manual chapter.
- Imperial artwork and Landsraad appointments: https://www.dunerealms.com/diplomacy.html
The panel is a separate Node application and HTTPS host, sharing the existing website account database. Sessions are host-specific; accounts and passwords are shared. This is not a hosting control panel.
## Accounts and rewards
- Registration cannot grant staff access. Passwords use salted scrypt; session cookies are Secure, HttpOnly and host-only.
- The owner staff account was provisioned separately. Its random credentials are in the private local `output/DuneRealms-admin-login.txt`; no password is included in this repository or public site. Change it after signing in.
- Account linking uses a private, single-use 128-bit code, expires after ten minutes, and must be entered with `/linkwebsite CODE` by the actual game player. The game bridge authenticates independently over HTTPS.
- Minecraft UUID is the permanent eligibility and claim key. The first verified link time survives unlinking, website account changes and player renames.
- Personal codes are generated only for goals reached after that first verified link. There is no personal-code backfill. Linking alone does not release currency.
- Staff create a monthly target and fixed equal reward. Verified totals can unlock it during that month, in Europe/Brussels time. Staff changes are audited. Targets and reward amounts cannot be casually edited after creation.
- Public codes remain equally available to all players, including players without a website link. Personal and public codes use one UUID/month claim record.
- `/communitycode CODE` prepares a receipt, then the game durably credits the balance and claim together. Only a game acknowledgement marks the website code used. Unacknowledged receipts retry after restart; used codes leave Available and appear in History.
- Codes have no expiry or shared redemption cap. Currency cannot be cashed out or redeemed for real-world value.
- No payment provider, live funding target or currency reward has been activated. Verified totals are manually recorded, not automatically inferred from a payment provider.
## Deployment
Website release: `/home/dunerealms/apps/dunerealms/releases/20261027-leto-zero`; `current` points there. Main application: `dunerealms-web`; account application: `dunerealms-account-panel`, localhost port 3003. Forgejo uses port 3001 and was left running.
The `cp` CNAME resolves to the existing host. Its certificate covers `cp.dunerealms.com`, `dunerealms.com` and `www.dunerealms.com`; public HTTPS and HTTP-to-HTTPS redirects were checked without disabling certificate verification. The cp vhost shares the CloudPanel-managed certificate. Its ACME location uses the main site's document root. The panel permits framing only by the two main-site origins; the main site explicitly permits the cp frame.
The owner login, staff authorization, forged-header rejection, empty reward state, logout, embedded rendering and registration-mode UI were verified live. No fake campaign, test donation or live currency credit was created.
The gameplay backend remains Paper 1.21.4. Compatible DuneEss, DuneCore and DuneNPC binaries come from the separate `dunemarks-live-1.21.4` checkout. It was backed up and restarted with zero players. The proxy and lobby stayed running. The account bridge secret is kept in operator-only configuration, never source or public assets.
Resource pack: `/downloads/Dunemarks-ResourcePack-1.21.4.zip`, SHA1 `f9470108e9cff93231968e6b8b2d99293e62fce2`. Pack acceptance is optional; Java clients declining it see material fallbacks. Bedrock texture rendering and in-client menu appearance have not been verified.
The active account/reward bridge is installed on the gameplay backend. Do not deploy independent local currency ledgers on multiple redemption backends: concurrent cross-backend redemption requires the shared PostgreSQL ledger. Its existing economy/market connection warning is separate from the website account database.
The main checkout also contains the 1.21.8 source implementation, retaining native menu support. Do not deploy its binaries onto Paper 1.21.4. The source is included in the DuneGit inventory/account integration. Server publication still uses the saved deployment packages; new inventory runtime activation is documented separately in INVENTORY-EXCHANGE-INTEGRATION.md.
## Artwork and wording
Public houses: Aerdrecht, Harkveen, Korenholt, Oordwijk, Vrijduin. Travel: Vaerkring; exchange: Koopkring; water sellers: Welvaarders. The Emperor's spice and water offices are presented as **Landsraad appointments**, with Specerhuis and Welvaart House office labels. Existing faction/world IDs, command arguments, ballots and balances remain compatible. Old binaries, imported lobby/world text and technical identifiers may still contain earlier names; this is not a claim of a full saved-world migration.
The five route sigils were authored as SVGs, with angular letter rings encoding the Dutch-inspired destination names, retaining their original-name roots. GUI textures are derived from those same SVGs. The imperial banner was generated with the built-in image tool; its exact prompt is saved beside the artwork documentation. The rights disclaimer does not claim that renaming or attribution clears underlying IP.
## Tomorrow's checks
1. Open the private login file, sign in on cp, and change the password in Account security.
2. Generate a private link command, enter it on the gameplay backend, and refresh the panel. Check the exact Minecraft UUID.
3. Confirm no old personal rewards appear. No rewards should exist before an actual funded goal is configured and reached.
4. Accept the Java resource pack; open travel and Landsraad menus. Check the sigils, office seals, back button and unchanged travel/appointment rules.
5. Once a real goal is met, claim its reward, confirm the balance and History entry, then retry both its personal and public codes. Neither may issue a second credit.
Automated checks: 54 website tests; 27 compatible DuneEss/DuneCore checks; both target-version game builds; local ledger restart, duplicate-receipt, failed-write and acknowledgement tests. Client interaction remains a manual check, not a completed test.
## Vaerkring note series and theme update
Five full front/reverse designs and transparent GUI icons: 1 (Stilgar), 5 (Aliah), 100 (Mira Vesk), 1,000 (Ghanima), 5,000 (Leto and an imagined victory over House Harkonnen). Every note reads Vaerkring Reserve and uses the newly designed crown/sun/dunes imperial seal. The 0-Dunemark Leto II search tribute is website/design-only: no game item model, GUI denomination, balance value or resource-pack entry. It is explicitly commemorative and has no cash value.
The character editions are an explicit operator-requested exception to the earlier original-character-only artwork policy. The wiki and IP risk review disclose this; they are not cleared merchandise. Exact built-in imagegen prompts and PNG masters are in docs/artwork/dunemarks/; production WebP and 64px/128px transparent icons are in website/web/assets/.
Main account page, standalone control panel, login/register, dashboard and staff forms share the site artwork, fonts, parchment and gold/teal theme. Full-note artwork uses natural image proportions; the preview icon selector is scoped separately at 64px to prevent accidental full-column enlargement. Browser measurements confirmed all five previews are 64 by 64.
The Dutch explanation appears both on wiki.html#dutch-inspired-names and the first manual chapter. It describes Landsraad's Dutch-language connection and broader Germanic parallels, rather than claiming an exclusively Dutch origin. It cites a linguistic study and retains the no-licence/no-endorsement wording.
Latest gameplay binaries: DuneEss SHA256 bec211ed8807d841cc997e1fce264af497ceea6718fda563b62bf612de9f0dad; DuneCore SHA256 8df87b13122a28a932913cc6e11b1fb5a1ce74efbf180f1bc54dcd04d613701b. Startup completed in 35.524 seconds without ERROR/Exception entries. Proxy, lobby and gameplay services were active after deployment. The public resource-pack download SHA1 matches the configured hash above. No zero-note game changes were deployed.

View file

@ -1,66 +0,0 @@
# DuneRealms Alpha 1.0.0.5  PR #198 Handover
**Current user instruction (2026-11-12): Work ONLY on DuneGit through the authenticated Composio Gitea/Forgejo plugin for now. No Work mode. No DuneHub. No GitHub PR #8. Prefer actual coding and commits over repeated reporting.**
Repository: https://www.dunerealms.com/git/unimatrix/MC
PR: https://www.dunerealms.com/git/unimatrix/MC/pulls/198
Branch: `fix/website-integrations-20261111` -> `main`
## Access
Use `mcp__Composio__COMPOSIO_SEARCH_TOOLS` to discover GITEA tools; the `unimatrix` Gitea connection is active. Read via `GITEA_GET_PULL_REQUEST`, `GITEA_GET_REPOSITORY_CONTENTS`, `GITEA_LIST_COMMITS`. Write via `GITEA_CHANGE_REPOSITORY_FILES` with base64 content and SHA for updates, specifying exact branch. Verify the returned commit and PR head. Do not reveal tokens, force push, merge or deploy without authorization.
## Status
Last confirmed code commit from this chat: `2a1ce5869a2f4b2bd4bbccd63de8c6763812eae8`  Task 01/10 account migration snapshot validation rejects unexpected tables and duplicate usernames case-insensitively; adds two tests in `website/tests/minimal-account-migration.test.mjs`. Tests have NOT yet been executed. Recheck branch head before any write.
Continue Tasks 0110, especially migration safety, staff permissions, Kit Exchange end-to-end, and regression verification. Preserve accounts, bank data, worlds, sessions and all existing functionality. Inspect current source, implement focused fixes, add tests, execute checks where available, review and commit. Clearly distinguish tests added from tests passing.
## Do not repeat earlier mistake
GitHub `unimatrixgit/mcdune` PR #8 and commits `a1f891d`, `178db6b`, `919512c`, `5de9e3e` are NOT DuneGit PR #198. User explicitly wants DuneGit-only for now. Keep messages brief.
## Mandatory commit title format
Use **exactly** `Alpha 1.0.0.5 - [Task NN/10] Short descriptive action` for EVERY development, test, documentation and handover commit in PR #198. Keep the literal square brackets, zero-padded task number, `/10`, and the `Alpha 1.0.0.5 - ` prefix. Example: `Alpha 1.0.0.5 - [Task 01/10] Validate migration tables and unique usernames`. No generic `docs:` or `ci:` prefixes. Preserve this naming in future chats.
## Latest progress
Commit `1de5d29898b591dcac098ee7fa985f6ca0d99def` strengthened `website/node/minimal-account-migration.mjs` to reject array snapshots/rows and invalid or missing timestamps, adding two regression tests in `website/tests/minimal-account-migration.test.mjs`. Tests not executed. Earlier commit `2a1ce5869a2f4b2bd4bbccd63de8c6763812eae8` rejected unexpected tables and case-insensitive duplicate usernames. Both are on DuneGit PR #198. Continue DuneGit-only; do not touch DuneHub or GitHub PR #8.
## Updated mandatory workflow: separate implementation and test commits (2026-11-12)
User explicitly requires the same split used by another developer on PR #198:
1. Inspect the latest PR head and existing implementations/tests before starting; other agents may commit concurrently. Do not overwrite their changes.
2. Commit actual implementation in a **separate implementation-only commit** with title `Alpha 1.0.0.5 - [Task NN/10] <Task Name> - <Implementation description>`.
3. Add or update regression tests in a **separate test-only commit**, titled `Alpha 1.0.0.5 - [Task 10/10] Testing, Merge & Deployment - <Test description>`.
4. Run relevant tests; report pass/fail accurately. Fix failures in focused commits. Never claim that a syntax check equals an integration test.
5. Only DuneGit PR #198 for now. No Work mode, no GitHub runner dependency, no merge or deployment without authorization.
Examples from another developer: implementation `d772142247` (consistent MySQL export snapshot), test `dfa4a3f4a2` (require consistent snapshot); implementation `c5e058e81a` (escape username wildcard), test `bc0aaf4e11` (literal underscore searches).
Recent verified work: `8434d60` expanded dependency-free syntax checks; `b6400a5`, `90850f2`, `b47029e` built the syntax suite; `80f1e9e` aligned monitoring/staff regression expectations; `462e8fc` fixed ban bridge SQL string syntax. Focused migration and staff tests passed; broad CP tests require runtime dependencies (`mysql2`, etc.).
## Latest user decision: prioritize efficiency (2026-11-12)
User superseded the strict two-commit requirement with **"work whatever way is most efficient"**. Prefer implementation and regression tests together in one atomic, tested DuneGit commit when that saves time; separate commits are optional when they genuinely improve review or debugging. Preserve the exact `Alpha 1.0.0.5 - [Task NN/10] ...` naming convention and always show actual commit links in the reply. Recheck the PR head and blob SHAs before writes to avoid colliding with other agents. DuneGit PR #198 only; no Work mode, no unauthorized merge/deploy.
Task 09: commit `a51e044e838f5c462c53e69baabdb9250a817e56` rejects malformed native Kit Exchange response shapes. Follow-up malformed-response regression tests were locally passing (5/5) but their separate commit was blocked; next step is to publish them and verify against current PR branch.
## Preferred workflow confirmed 2026-11-12: larger tested batches
The user explicitly approved **larger cohesive coding runs** as the preferred method ("this is da way"). Inspect the latest DuneGit PR #198 head first, group several related changes and their tests into a single coherent batch, run relevant tests, then commit implementation + tests together under `Alpha 1.0.0.5 - [Task NN/10] ...`. Separate commits only when useful for isolating failures. Always provide real DuneGit commit links and test counts. Coordinate against colleagues' concurrent commits using current blob SHAs. No Work mode, no GitHub, no merge/deploy without authorization.
Latest completed batch: `7d6e6530e0e8f48730b0796c6babebe111050981` tightened Kit Studio UUID validation and native API response checks; 15/15 focused Kit Studio/Market tests passed.
## Progress checkpoint (2026-11-12)
Overall Alpha 1.0.0.5: **approximately 74%** (planning estimate). Task 09/10 Kit Exchange: **approximately 82%** (planning estimate). These figures are not test-derived or release approval.
DuneGit PR #198 has published Kit Market and Studio preflight changes (`74dcc82`, `569c66f`), their regression tests (`251c90c`), and browser API malformed-response handling (`db0d3bd`). Latest focused suite: **52/52 Kit Exchange tests passed**; no Minecraft plugin integration or production deployment was tested.
Remaining Task 09 scope: end-to-end website/CP shop usability, kit publishing and database integration checks, native API compatibility verification, and the deferred Minecraft claim/delivery implementation in a later update. Preserve rollout gates, identity checks, cart idempotency, and the website-only scope.
Workflow: implement cohesive website batches, run regression tests, publish each passing batch directly to DuneGit PR #198, and verify the remote commit before further development. Never ask the user to run Git commands when connected publishing works. Do not merge or deploy without authorization.
## Saved progress — 2026-11-12 (latest checkpoint)
**Remote branch head:** `2fa146ebc5f717df484e9ca5a1987cbe72f92e30`, DuneGit PR #198, `fix/website-integrations-20261111`. **Latest verified focused checks: 79/79 passing**, including website syntax; this is not live database, native game integration, or production acceptance testing.
**Planning estimates only:** Overall Alpha 1.0.0.5 ~74%; Task 09/10 Kit Exchange ~87%. These are not measured or release-approved completion rates.
**Completed since earlier checkpoint:** Kit Market and Studio request preflight hardening; regression coverage; browser API response and cart validation; case-insensitive UUID consistency; staged checkout handling; receipt grouping, safe refresh and redemption-state display; native order response validation; optional receipt references/timestamps; private redemption-code stripping for sellers and fulfilled receipts; Kit Studio draft withdrawal, archive/restore publication safety, and concurrency conflict guards. Latest pair `f3c222e` (reject duplicate unpublish under listing row lock) and `2fa146e` (regression test). Earlier critical branch fix `1e9c9ff` and test `3707fdb` prevent existing design saves from entering the new-blueprint insert path.
**Next development task:** Inspect simultaneous publishing and stale listing revisions, duplicate listing creation, and transaction integrity; implement focused website/CP fixes and regression tests. Review actual DB schema and native order/claim contracts before asserting full integration. Preserve historical purchases and bank records. No Minecraft plugin edits, Work mode, GitHub, production deployment, or PR merge without explicit authorization.
**Publishing workflow:** Use authorized Composio Gitea connection for DuneGit; inspect remote HEAD and blob SHA before writes, test changes, publish passing batches, and verify returned commits. Do not ask user to run server commands while direct publishing works. Development does not continue after the assistant turn ends; a new turn is needed to resume.

View file

@ -1,28 +0,0 @@
# Alpha 1.0.0.5 — PR #198 release handover (2026-11-12)
## Freeze and scope
**Feature freeze: no more additions.** Source: [PR #198](https://www.dunerealms.com/git/unimatrix/MC/pulls/198), branch `fix/website-integrations-20261111`, tested head `86496ebbb1c6b8124777bb1a547c952eacf8f361`. This handover PR is documentation-only and does not merge or replace PR #198.
## Verified build
On the isolated checkout at the exact head above, `corepack pnpm run build` succeeded and packaged **541 website assets**. `node scripts/test-constrained.mjs` passed **340/340** tests. The build left the authored navigation source unchanged. No Minecraft plugin, production database, world, or live service was modified.
## Release blockers / verification gaps
1. The constrained suite deliberately **excludes** `content-removal.test.mjs`, `node-host.test.mjs`, and `worker.test.mjs` because the isolated runner is memory-limited. The normal CI runs `pnpm test`, not the constrained suite; full CI is **not verified green**.
2. The Forgejo web workflow `.forgejo/workflows/web-deploy.yml` contains **two consecutive deployment SSH steps**. Review and correct the release workflow in a separately authorized change before triggering production; avoid deploying twice.
3. Live database migration, native Kit Exchange purchase/redeem/claim response compatibility, receipt persistence, and Java/Bedrock in-game delivery remain unverified. Keep `kit-policy-v2-publish-enabled` and `kit-legendary-upgrade-delivery-ready` disabled until staging acceptance.
4. The existing workflow deploys on a successful `main` push after CI. Merging PR #198 would therefore be a **production deployment action**; review CI, backup and rollback before merging.
## Safe release sequence
1. Freeze and review PR #198; check for other agents' commits and verify the exact head before release.
2. Run full `pnpm test` on a runner with adequate memory and resolve all failures; validate the 541-asset build and inspect its artifact.
3. Confirm database backup, service health, deployment key, release gates, and rollback procedure; review the duplicate SSH deploy steps.
4. Test linked account, checkout idempotency, order receipts, redemption and claims against a staging native API. Do not enable game delivery gates without actual plugin integration verification.
5. Only then approve and merge PR #198, monitor CI and the single intended deployment, and verify website/CP smoke tests. Roll back on failed health checks.
## Deployment status
**NOT DEPLOYED.** No merge, live SSH action, production release or gate activation was performed as part of this handover. This document records the release decision and outstanding blockers rather than declaring the release safe.

View file

@ -1,15 +0,0 @@
# Arrakis reset and sandworm deployment — 28 October 2026
Owner requested operator access for unimatrix999, an Arrakis-only reset, a server panel, and review/deployment of the supplied display-sandworm patch before resetting.
- Granted level-4 operator to verified cached UUID `49d2fe76-7977-4d49-bd39-e48fc8c648b8` on Arrakis and lobby. Retained through the reset.
- Reviewed the older patch instead of overwriting current build/config/plugin files. Preserved current shared-inventory/economy changes and current names. Added bounded model history, no initial unloaded-chunk height sampling and shutdown cleanup. Core is 1.0.13.
- Both Java 21/Paper 1.21.4 compatibility and main Paper 1.21.8 builds/tests passed, including five display-model tests. The uploaded patch's old version/build descriptors were not installed wholesale.
- Deployed compatible Core before resetting. Live console summon at 0/150/0 succeeded; `execute if entity @e[type=minecraft:block_display]` returned count 27. No visual/client claim is implied by entity-count verification. No startup errors found.
- Stopped only dune-arrakis with zero online players; full server archive plus PostgreSQL dump created under `/opt/dunerealms/backups/arrakis-reset-20261028-100119/`. Original world is also retained there as `world/`.
- Reset only `/opt/dunerealms/servers/arrakis/arrakis`. Kept seed `-9071110667412489906`, world identity and level metadata; all old terrain, entities and point-of-interest data remain in the backup. New terrain is generated by DuneTerrain. Kept playerdata, statistics and advancements, relocated saved player positions to spawn, removed stale bed/vehicle respawns. Compared old/new inventory, EnderItems and experience values exactly; all matched. Shared PostgreSQL inventory/account data remains intact.
- Cleared backed-up Arrakis event notices so the test worm and removed entities do not generate stale network alerts. Lobby and other worlds were not reset.
- Fresh terrain region files were saved, Arrakis completed startup in 54.047 seconds and proxy/lobby/Arrakis status returned online. Startup error scan was empty. Four other planet backends remain unconfigured.
- Core artifact SHA256: `dd932573488f216ba9d6c03cf4136bbc2a30c1863a8e7cb69c575c4bba600d4e`. Live legacy filename remains DuneCore-1.0.10.jar; plugin metadata is 1.0.13.
Server operations are documented in `network/server-control/README.md`. Website and account data are not part of the world reset. Player appearance/combat and Java/Bedrock rendering still need human gameplay checks.

View file

@ -1,17 +0,0 @@
# Arrakis update validation
Development branch: `feature/organic-arrakis-plateaus`.
Built on Java 21 for Paper 1.21.8: DuneRealms-Core 1.0.11, DuneRealms-Essentials 1.0.3, and DuneRealms-Terrain 1.0.9. Existing compiled NPC and Lobby JARs remain unchanged. 50 JUnit tests pass across Core (11), Essentials (19), Terrain (15), and NPC (5). Lobby has no unit tests.
Terrain tests cover deterministic asymmetric contours, cardinal gaps 300–500, upper and lower terrace groups, bounded erosion ridges, biome footprint alignment, exact 900-column rich patches including negative coordinates, seeded fortress attempt rate, persistent deposit identity consumption across listener restarts, farm-free village palette/bed/job-site generation, and fortress entrance/vault geometry. Deposit tests use mocked Paper chunk PDC and creative harvesting; real server event dispatch still requires staging.
The development preview invokes the actual compiled private Arrakis formation generator using a ChunkData recording proxy. At X 166, Z 165 the lower flat sand surfaces are Y 85 / 89 / 93 and upper surfaces Y 117 / 121 / 125. Each group has four-block steps. The rocky shoulder between groups is intentionally taller. Both exposed block positions and material types are recorded for the renderer. [Generator render](../DuneTerrain/previews/dune-highlands.png) is not an in-game screenshot or shader promise.
Biome and loot JSON parse successfully; data pack archive and all five project JARs pass ZIP integrity checks. Release packaging verifies pinned crossplay SHA-256 checksums and includes the server-side Arrakis datapack alongside all server JARs in one ZIP.
No live Minecraft server or Java/Bedrock clients were run. Biome registry startup, Geyser biome translation, ViaVersion handling, asynchronous chunk generation/population, natural village AI, real block physics, protection-plugin interactions and economy/NPC purchases need a separate staging world. No existing world, configuration, economy database or player data was modified. Install the updated Core and Terrain together for authoritative Harkonnen kit loot, and Essentials for seller purchases.
Publication requires authenticated DuneGit access. The current browser runtime cannot resume native credential state and Git has no credential helper. No credentials from chat are used; local commits and packages are not proof of a remote push.
Highland sietch placement: 441 default highland regions across positive and negative coordinates each have three deterministic, distinct sites at least 26 blocks apart inside the highland footprint. A population test also checks three actual chest placements and the highlands-only disable switch. The original open-desert placement formulas and spacing are unchanged; highland sites use separate cache identities. Compact cave geometry, real chunk population, cave connectivity, fluid physics and personal loot still need live staging.

View file

@ -1,86 +0,0 @@
# DuneRealms coding agent handover
Verified on 28 November 2026. Use production `unimatrix/MC:main` as the release baseline. Develop in the restored `dev/MC` fork.
## Source and exact commits
| Reference | Meaning |
|---|---|
| `2e0df25736236378415d1f292bfeda992687ed95` | Verified canonical `main` at handover. CI publishes all plugin JARs, including the DuneKits companion. |
| `f100733d` | Adds the canonical plugin build workflow. |
| `88ff96791d691826357cbb660e9538a1107a3123` | Website recipe book, player manual and workspace release. |
| `47e42ba64bd11a067f688e1b06048e1882ecf691` | POL source checkpoint. Already an ancestor of canonical `main`. |
| `eee0265c314112960158e0379438690014f31ea0` | War/Beta launch source checkpoint. Already an ancestor of canonical `main`. |
| `2bec0e6a` | Historical fork-only CI experiment. The canonical `plugins.yml` already covers the fleet. |
Canonical remote: `https://www.dunerealms.com/git/unimatrix/MC.git`. Use the retained DuneGit account `dev` with its approved repository credential for feature-branch pushes. The `dev/MC` fork was restored from verified production commit `2e0df257`. Set `origin` to the fork and `upstream` to production. Inspect `git remote -v` before pushing. Preserve any uncommitted work in other checkouts.
```powershell
git clone https://www.dunerealms.com/git/dev/MC.git DuneRealms-MC
Set-Location DuneRealms-MC
git remote add upstream https://www.dunerealms.com/git/unimatrix/MC.git
git fetch --prune origin
git switch -c work/my-task origin/main
git status --short
git rev-parse HEAD
```
## Compile a single plugin
The canonical CI uses Java **21** and Gradle **9.2.1**. Set `JAVA_HOME` to your Java 21 installation. Run Gradle from the repository root and use `-p` to target the module. The dependency cache must be populated for `--offline`; omit the flag on a fresh environment with repository access. Install Gradle and Java 21 through the authorised workstation setup if the local paths below are unavailable.
```powershell
# From the development repository root, with Java 21 and Gradle 9.2.1 configured.
gradle --no-daemon -p DuneRealmsGUI test jar
Get-FileHash DuneRealmsGUI/build/libs/DunerealmsGUI.jar -Algorithm SHA256
```
On Linux, from the repository root with Java 21 and Gradle 9.2.1 installed, run `gradle --no-daemon -p DuneRealmsGUI test jar`. Replace the module for other plugins. GUI compilation and tests were rerun successfully at `2e0df257`. The local output SHA-256 was `80639ec86dd0d8ac7a73334a9f3b23c299e715b89f31869d068e391efef6d310`. Record the hash of each build you hand off.
| Module | Output in that module's `build/libs/` |
|---|---|
| DuneEss | `DuneRealms-Essentials.jar` |
| DuneKits (retired in cleanup branch) | Historical output `DuneKits-3.0.0.jar` and `DuneAtelierCompat-3.0.0.jar` at baseline `2e0df257` |
| DuneLobby | `DuneRealms-Lobby.jar` |
| DuneNPC | `DuneRealms-NPC.jar` |
| DuneRealms-minecraft-only | `DuneRealms-Core.jar` |
| DuneRealmsGUI | `DunerealmsGUI.jar` |
| DuneTerrain | `DuneRealms-Terrain.jar` |
| JarvisConnector | `jarvistranslator.jar` |
`.forgejo/workflows/plugins.yml` built eight modules at the baseline and builds seven after merging the DuneKits cleanup on the DuneGit runner. The `DuneRealms-Plugins` artifact contains the JARs, `SOURCE_COMMIT` and `SHA256SUMS`. Compare the artifact commit with the reviewed commit. A compile check and an isolated Paper runtime check are separate steps. Use the exact installed server and dependency versions for runtime acceptance.
## Access and tools
- **DuneGit** is Forgejo at `https://www.dunerealms.com/git/`. `unimatrix` is the owner/admin account. `dev` is retained for coding. Use the OS Git credential helper or an owner-provisioned repository credential. The existing helper is keyed to `git/dev/MC.git`. Use the development remote for all coding pushes. Never embed bearer tokens in a URL or commit.
- **Composio** has an authorised **Gitea** connection for DuneGit. Discover the exact supported tool and schema and verify the connected account before doing a write. Use Gitea tools for PRs and metadata, and Git for source. The owner-level Composio connection does not change the scope on the workstation's `dev` token. A repository-level admin response does not prove a token has `write:user`, `write:issue` or `read:admin`.
- **Gateway** is the managed server-access path. Use `list_servers`, match the intended host, inspect `server_capabilities`, and follow any job ID through completion. Use stored values for secrets and Gateway's privilege approval when needed. Choose a typed tool where it fits, and use scoped SSH commands for application-specific work.
- **Credentials** come from the owner, approved workstation helper, Composio connection or Gateway stored values. Keep key material, plaintext credentials, private bridge values and tokens out of Git, chat and build output. Keep the host and account details in this private handover.
## Publishing flow
1. Start in a clean checkout of `dev/MC` based on verified production `main`. Preserve uncommitted work before reconciling repositories. Confirm the pending PR before creating a work branch.
2. Produce and test the smallest useful change. Stage only intended paths and review `git diff --cached`. Commit locally with a descriptive message. Push the task branch to `dev/MC` and reuse the existing development PR for its updates. Run builds and CI in development.
3. The owner's policy is at most **one open PR per repository**. Use one coordinated build per release. Identify the relevant Forgejo Actions workflow and inspect overlapping push triggers before merging. Publish or deploy only when the task authorises it.
4. Check the exact merged revision, Actions result, package names and checksums. A standalone JAR request ends with the requested JAR, source hash and build result. A publication request also needs the appropriate release workflow and verification.
5. For an authorised native rollout, compare installed JARs/config with the reviewed release, preserve live-only patches and world data, and stage an isolated Paper test when runtime behavior changes. Roll out to the affected servers and confirm service readiness and the scenario itself. Release packs by immutable URL and expected hashes. Leave worlds and persistent data alone during JAR replacement.
Production `main` blocks direct pushes, including from admins, and only `unimatrix` can merge. Merge a complete update only after successful development CI and explicit owner authorization. The one-open-PR rule applies to both repositories. Server-side PR-cap enforcement is pending. The owner requested this cleanup without creating a backup.
## How J.A.R.V.I.S. works
J.A.R.V.I.S. is DuneRealms' project-specific authority and action framework. The website defines rules, validates keys and actors, stores authoritative records and drives rewards. Minecraft GUIs and NPCs display the same information and submit typed actions. The Java translator bridges approved actions into native game adapters and returns verified results.
1. **Define the action in the existing domain.** Find the relevant master action, request domain, quest definition, decision policy or war action. Reuse its input schema, permission model, purpose and owner. For quest dialogue, add role-specific metadata on the versioned definition. The GUI reads those fields and shows matching art when dialogue is absent.
2. **Resolve identity and permission centrally.** Match the website actor and linked Minecraft UUID or authorised system identity. Resolve current memberships, offices and functional rights on each sensitive action. A portrait, NPC click, client request or position in a list never grants authority.
3. **Validate and redeem the typed key.** Validate identifiers, scope, expiry, current eligibility and any usage limits against the central record. The internal `PluginKey` maps a validated domain action to fixed native commands and fields. Players do not supply arbitrary console commands.
4. **Execute with existing services.** NPCs, GUIs, web forms and rosters use the same underlying actions. Native systems still own gameplay. The bridge uses existing server identity and private credentials. Each game server has its own native storage and receives projections needed for that server.
5. **Record actual proof and apply rewards once.** Record genuine game events, item surrender, verified arrivals or posted settlements at the corresponding authority. A dispatch acknowledgement alone does not establish a completed delivery. Bind receipts to actor, action and source event, and preserve replay protection. The website and game read the resulting record.
### Where to read the source
- `docs/audits/JARVIS-KEYGEN-20261119.md` and the module `JarvisConnector/README.md` explain key and native adapter design. Some README omissions describe older rollout states. Cross-check the current implementation.
- `website/node/jarvis-master-generator.mjs`, `jarvis-master-generator-api.mjs`, `jarvis-key-validation.mjs`, `jarvis-request-domains.mjs`, `jarvis-identity.mjs` and `jarvis-web-key-boundary.mjs` cover definitions, routing, identity and validation.
- `website/node/progression-pol-runtime.mjs` and corresponding POL quest definitions implement quest progress and claims. The in-game adapters are in `JarvisConnector` and the NPC/quest views are in `DuneRealmsGUI`. Search the checked-out source for the exact quest ID and metric.
- For POL: use the existing authority, ballot, ledger, native verification and eligibility modules. Keep government decisions and player quests distinct. For War: the website roster is authoritative, and the game reads/updates the same team registration. Apply the existing J.A.R.V.I.S. key to the intended team and verify capacity and duplicate acceptance centrally.
- A feature can compile while its live adapter, pack or configuration is still pending. Check live JAR versions and route/receipt tests before declaring a runtime flow complete.

View file

@ -1,31 +0,0 @@
# Control panel: feature manual and permissions
Published 28 October 2026 at https://cp.dunerealms.com/#staff-manual.
Release directory: /home/dunerealms/apps/dunerealms/releases/20261028-cp-feature-guides.
The staff manual has 13 searchable feature categories, including CoreProtect, WorldEdit, WorldGuard, Chat, Permissions, Moderation, Inventory, Economy, Tickets, Travel, Quests, Politics and Server operations. Guides explicitly distinguish live behaviour from pending integrations. Reading the guide requires cp.menu.staffmanual, checked on the server as well as in the menu.
Account menu sections now open one view below the navigation. Ranks & permissions provides a checkbox matrix, lower-rank creation and protected owner accounts. Both existing accounts unimatrix_admin_44a5a3 and grmacken were assigned Owners without changing passwords. Game permissions await the DuneEss/LuckPerms deployment; this release publishes the website controls and private game snapshot endpoint only.
Validation: 67 website tests passed locally and on the live host before switching the release. Both HTTPS health checks passed; unauthenticated staff manual returned 401. Browser verified Owners session and separate Staff manual view with feature categories. Core and Ess local builds passed, but those game changes were not deployed in this release.
Changed source paths:
- website/control-panel/public/index.html
- website/control-panel/public/pages.mjs
- website/control-panel/public/panel.js
- website/control-panel/public/ranks.css
- website/control-panel/public/ranks.mjs
- website/control-panel/public/staff-manual.mjs
- website/control-panel/server-control.mjs
- website/control-panel/server.mjs
- website/control-panel/staff-manual.mjs
- website/node/account-admin.mjs
- website/node/auth.mjs
- website/node/community-rewards.mjs
- website/node/permissions.mjs
- website/node/rank-admin.mjs
- website/node/schema.sql
- website/node/server.mjs
- website/tests/node-host.test.mjs
- website/tests/rank-permissions.test.mjs
- website/tests/server-control.test.mjs

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,90 +0,0 @@
Imported handoff from the supplied ZIP. This records the package's original state; current integration and deployment status is in INVENTORY-EXCHANGE-INTEGRATION.md. The CP source is now available and wired locally; the package's statement that CP integration is missing is historical.
# DuneRealms — shared planetary inventory, exchange and account UI handoff
Prepared 27 October 2026. This package contains implemented source plus compiled Core/Essentials JARs. It does not deploy a running database, Minecraft server or cp.dunerealms.com.
## Repository and source state
- Repository read: https://www.dunerealms.com/git/unimatrix/MC
- Base main commit: `73e1bc8b75608b77280c6d957bf590be3f3ed8b6`.
- Local checkout: `/workspace/scratch/54b8ff792ef6/MC`.
- Changes are local, packaged in this ZIP, and have not been pushed to DuneGit.
- The separate MC-inventory-sharing repository was inspected; its main branch is an older copy of this project. This package implements inventory ownership inside DuneCore; do not install a competing inventory sync plugin.
- Source package includes plugin modules, shared GUI code, website source/assets, scripts/configurations and text documentation. Existing large generated manual/artwork exports and pre-generated world archives are omitted. Keep the current worlds and resource/data files on production; this is not a replacement server directory.
## Requirements described by the supplied package
1. Shared inventory is for the five planetary servers only: Arrakis, Giedi Prime, Kaitain, Caladan and Sigma Draconis IV.
2. Lobby inventory is separate and must never be loaded from or saved to the planetary shared inventory.
3. Ender chests are local to each world/backend. Do not synchronize, copy into shared SQL or expose them in the account inventory display.
4. Account page on cp.dunerealms.com should display saved planetary inventory using a nice Minecraft-style layout and a dummy skin wearing the saved armor.
5. Show completed exchange items under the exact label **History of sales**.
6. Finish exchange coding, package the code/JARs and provide a handoff. No production deployment or DuneGit push was performed in this session.
## Implemented
### Core 1.0.12
SharedDatabase loads inventory/hotbar/armor/offhand, faction, XP level/progress/total and selected hotbar slot. Existing serialized inventories remain readable. It never calls ender-chest accessors. Existing unused legacy SQL ender-chest columns, if any, are left untouched.
Only known planetary network.local-planet identifiers enable profile loading. Lobby and spacing_guild are excluded. Keep this setting correct on each backend; planet identifiers with hyphens are normalized to underscores.
Each online planetary player owns a dedicated PostgreSQL connection and session advisory lock. Concurrent/early transfer loads are rejected. Failed loads cannot write a stale local inventory on quit. Durable session_open markers block automatic login after a process/connection loss until an administrator reconciles the checkpoint. Controlled quit closes the open inventory, writes the full checkpoint, clears the marker, then releases the connection. Autosave defaults to 60 seconds (minimum 10). Failed SQL saves attempt a timestamped local recovery YAML snapshot.
InventoryWebSnapshot writes a safe JSONB display projection and timestamp in the same SQL checkpoint, with material/name/quantity, enchantment flag, durability and leather dye color. It contains no ender chest data or Bukkit serialization for the browser to decode.
transactNetworkInventory coordinates exchange SQL and the resulting authoritative inventory checkpoint on the same owned connection. Ordinary transaction failures restore the prior in-memory inventory. Unknown commit outcomes quarantine and disconnect the profile without an ordinary quit save over the evidence.
### Essentials 1.0.4 / exchange
Existing native Java/Bedrock menus, held-item listing, purchase confirmation, owner cancellation/reclaim, filters, pagination, inventory capacity checks and admin inspection are retained.
Actual trades require a loaded planetary Core profile. Listing escrow, buyer debit, seller credit, stock changes and the inventory checkpoint commit together. The bound ExchangeStore cannot independently commit or close Core's transaction. Delivery overflow aborts the transaction; it does not drop items into the world.
Every completed unit purchase also records dune_exchange_sales: listing ID, seller/buyer identities and names, material/display name, quantity, exact unit/total price, planet and timestamp. Failures and cancellations create no sale. Existing historic sales were not previously recorded and cannot be backfilled from missing data.
Shared economy deposits/withdrawals now use SQL arithmetic, avoiding stale read/overwrite races with exchange payments. Configured shared mode does not fall back to local cached wallets during SQL failures. This does not make all other Core/gameplay actions atomic with the economy; review those separately before public launch.
### Database deployment
network/database provides a PostgreSQL 17 Compose template, non-superuser application role and setup.sh with generated private credentials, persistent volume, localhost-default listener and health check. The guide explains private networking, backend configuration, migration, capacity, backups and manual recovery. The scripts have not been run against the user's server. Migrations are additive and preserve existing records.
### Account inventory and sales UI
control-panel-inventory contains the account UI, self-contained inventory-preview.html, safe authenticated API adapters, read-only market bridge, public asset installer and tests. The dark teal/gold layout has a local block-style dummy mannequin wearing saved armor, equipment/offhand slots, backpack/hotbar grid, item inspection, XP and a **History of sales** tab. No lobby or ender chest items appear. Item icons are stylized local vector glyphs, not exact Minecraft textures; the mannequin supports base armor shapes/colors but not exact trims, resource-pack models or elytra geometry.
Account APIs resolve the signed-in CP account's verified Minecraft UUID server-side. Visitors cannot supply another UUID. Responses are private/no-store. Queries are parameterized, bounded and read only. Sales use seller-only keyset pagination. The optional private market bridge supplies sanitized live listings to the existing website gateway with a separate server-to-server bearer token; purchases remain in-game.
## Critical remaining CP integration work
The public cp.dunerealms.com page and panel.js were inspected. They already implement verified /api/game-link associations, account sessions and rewards. The real CP server source, verified-link schema and deployment environment are NOT present in MC main, the public beta/cloudpanel branches or the older MC-inventory-sharing main copy. Personal Context did not provide another source location.
Do not claim this feature is live. Obtain the current CP source from its actual owner/workspace. Follow control-panel-inventory/README.md to wire the provided handlers into the existing server's session validator and verified-link resolver. Preserve existing account/reward/security/staff features. Install public assets using install-assets.py, grant a separate CP reader only the documented columns, deploy through the existing CP workflow, and test two-account isolation and link/unlink/logout behavior. Never replace verified linking with an editable profile name or guess a link table.
For the existing public website live exchange, mount the supplied private bridge, then configure its EXCHANGE_LISTINGS_URL and EXCHANGE_READ_TOKEN secrets. Without that runtime configuration the existing website intentionally keeps labelled demo listings. This session did not change live settings.
## Build and validation completed
Target: Java 21 / Paper 1.21.8 as pinned by the repository. No unverified change to a newer Paper API was made.
- Core: `gradle build` successful, **21 tests passed** (mocked JDBC/Paper), including failed/dirty loads, ownership, snapshots, transaction rollback and unknown commit quarantine.
- Essentials: `gradle build` successful, **21 tests passed**. Exchange SQL tests use H2 in PostgreSQL compatibility mode and cover last-item concurrency, wallet/stock rollback, ownership, sales history and rollback of externally owned transactions. This is not a live PostgreSQL test.
- Account integration: `node --test tests/*.test.mjs`, **12 tests passed**, including verified ownership, no-store, parameter rejection, outage handling, sales pagination and the private market bridge.
- Layout: JSDOM checked 41 equipment/inventory buttons, the armor mannequin, item selection, History of sales navigation and zero runtime errors with the demo fixture. A real-browser visual review was not available in this environment.
- Asset installer: tested idempotence and preservation of the original HTML backup against the observed CP page.
- Shell syntax, YAML parsing, Python compilation, JavaScript syntax and `git diff --check` passed.
## Files and installation
The `plugins/` directory in this ZIP contains the built `DuneRealms-Core.jar` and `DuneRealms-Essentials.jar`. Replace both together with all planetary servers stopped. Preserve existing worlds, player data, config files, Vault, terrain/NPC/lobby plugins and proxy settings. Do not install the planetary Core/profile stack in place of the selection lobby plugin.
Before enabling shared mode, select one authoritative first-login backend for existing inventories. A player with no SQL snapshot adopts that backend's inventory; inventories from other backend player files are not merged automatically. Back up/archive alternatives. Configure the same database on all planets before DuneEss starts; it reads Core's config from disk.
Run fresh database setup only on the intended database host. For an existing database keep its data/credentials and use the plugin's additive migrations. Configure private routing/firewall to allow only backend/CP hosts. Never expose PostgreSQL publicly, overwrite configs with defaults or clear all unclean-session markers.
## Staging acceptance before public use
Test two real planetary backends with PostgreSQL, Velocity and the same player UUIDs. Verify exact custom item metadata/quantities, armor/offhand, XP, listing escrow, purchase/reclaim, wallets, sales history, transfers and process/SQL failure paths. Verify the lobby inventory is different and unchanged; verify each planet keeps different local ender contents. Check Java, Bedrock/Floodgate and ViaVersion clients. Review synchronous SQL tick time and PostgreSQL connection capacity under expected concurrency. SQL profile locks require direct/session-compatible connections; do not use transaction-pooled PgBouncer.
Known scope limits: general non-exchange item/container mutations still depend on checkpoints and manual crash reconciliation; politics still uses its existing shared YAML snapshot and is not normalized by this change. Health/hunger/position/advancements/other plugin data are not synchronized. Fast transfers may need a reconnect while the source backend finishes its final save. Autosaving restores temporarily hidden Ordos armor, which can shorten the hidden-armor portion of Shadow Step. Per-world ender isolation assumes the intended one-planet-per-backend network; vanilla worlds within a single backend still follow that backend's existing ender-chest behavior.

View file

@ -1,38 +0,0 @@
# Inventory, exchange and account integration
Prepared 27 October 2026. Imported DuneRealms-Inventory-Exchange-Account.zip (SHA256 666db85847308b5f24fb461d466df86de6d2a38b0df6d59d163573bae70b7b99), based on DuneGit main 73e1bc8b75608b77280c6d957bf590be3f3ed8b6.
## Merged behavior
- Planetary inventory ownership, dedicated PostgreSQL session locks, durable unclean-session markers, armor/offhand and XP checkpoints, safe browser projections. Lobby and ender chests remain separate.
- Core-owned exchange transactions commit inventory, escrow, wallet changes and completed sales together. SQL arithmetic preserves concurrent wallet updates. Existing durable monthly community rewards and UUID/month receipts are retained.
- CP inventory and exact History of sales UI are wired into the real account server. It validates the existing host session and resolves the current verified UUID from site_game_links. The client cannot choose a UUID. Unlink/logout and two-account isolation are covered by integration tests.
- Canonical runtime modules: website/control-panel/inventory/. Canonical UI: website/control-panel/public/inventory/. The original package API entry points re-export the canonical modules so its tests exercise production code. The asset installer reads those canonical assets.
- Current Vaerkring/Dunemarks names, planet labels, site/account theme, notes/seal, disclaimer, CAPTCHA contact, rewards and staff controls are preserved. Existing internal world/faction/model identifiers remain compatible.
- An explicitly configured but incomplete shared database cannot silently use a second local wallet.
## Validation and publication scope
Core 1.0.12 and Essentials 1.0.4 target Java 21 / Paper 1.21.8. Rebuilt JARs come from reviewed merged source, not the ZIP's precompiled plugins. The live server remains on its existing 1.21.4 compatibility binaries. No database setup, migration, inventory import or new game deployment is performed by this source integration.
Website build/tests, package API tests, merged Core/Essentials tests and a local browser review cover the integration. The browser uses clearly fictional local fixture data; it is not evidence of live inventory availability. PostgreSQL, multi-backend transfer/crash behavior and real Java/Bedrock clients still need staging acceptance.
For activation, configure DUNE_INVENTORY_DATABASE_URL with the separate column-limited reader described in control-panel-inventory/README.md. It is optional: a linked account receives an honest unavailable response while unconfigured. EXCHANGE_READ_TOKEN optionally protects the private server-to-server market bridge; the main website requires its existing EXCHANGE_LISTINGS_URL setting. No production secret is committed.
The original supplied handoff is preserved as INVENTORY-EXCHANGE-IMPORT-NOTES.md. Its missing-CP-source statements describe the original package, before this integration. Source publication is a normal DuneGit push, not a force push or an automatic live rollout.
## Live deployment — 28 October 2026
Deployed by explicit owner request. Website and account panel use release `/home/dunerealms/apps/dunerealms/releases/20261028-inventory`. Both HTTPS health checks passed. The new inventory module returns 200; unauthenticated inventory/sales return 401; private backend modules return 404. The public exchange returns a real empty listings array from PostgreSQL.
Arrakis remains on Paper 1.21.4 / Java 21. The exact compatible source is DuneGit branch `deploy/paper-1.21.4`, commit `d070784bc7248917a9e898ecbf52e2b2b4d0bdf3`. It uses inventory screens for the existing inventory menus and clickable choices for standalone menus because this Paper version has no dialog API. Essentials 1.0.4 and Core 1.0.12 were rebuilt and their tests passed. Explicit JDBC driver loading fixes plugin-classloader discovery on the live host; the same fix is applied to main.
Deployed artifact SHA256:
- Essentials: `631632f98b24953bfb02981b1cdb729e6c79c70c88587f102fbff48c1490891b`
- Core: `f70e02d8789766205b8a029dfeacd2fd02cbe0e8f0840aacafe49f1142ab21ba`
A dedicated `dunerealms` PostgreSQL database on the game host now holds shared inventory, economy and exchange data. Its listener remains loopback-only. The account panel connects through an enabled, restartable systemd SSH tunnel with a dedicated forwarding-only key restricted to PostgreSQL. Reader permissions include only the required public projection/listing/sales columns. Verified: raw inventory and economy-table reads are denied. Credentials remain in private host files, never Git.
Before activation, the backend was stopped with zero players online and backed up to `/opt/dunerealms/backups/inventory-20261028/arrakis.tar.gz`; all existing PostgreSQL databases were also backed up there. The prior local wallet contained one UUID at zero, migrated successfully; no reward receipts required import. Website environment backup is `.config/dunerealms.env.before-inventory`; the previous website release remains available for rollback. Never roll back inventory ownership or wallets independently after new player writes.
Proxy, lobby and Arrakis are online. Four other planetary backends were already unconfigured and remain so; no cross-backend transfer can be claimed tested. Real player inventory views populate after a planetary checkpoint. Java/Bedrock interaction, actual selling/buying and crash/transfer acceptance still require player testing. No test balances, sales, links, funding goals or inventory fixtures were added to production.

View file

@ -1,58 +0,0 @@
# Website naming and IP exposure review
Review date: 26 October 2026; publication status updated 27 October 2026. This is an evidence-based editorial assessment, not legal clearance or an estimate of litigation probability. Applicable jurisdictions, licences, commercial activity and rights-holder enforcement intentions have not been established.
## Source and publication
Source: https://www.dunerealms.com/git/unimatrix/MC, main at 73e1bc8b75608b77280c6d957bf590be3f3ed8b6.
Changes are in the separate local checkout `dunerealms-story-update`. No synced `sources/` files or other existing project checkouts were edited. The website was deployed and verified on 27 October 2026 as release 20261027-manual-disclaimer. No source push to DuneGit has been performed.
## Changes assessed
- Removed the six-essay journal, index, data, graphics metadata, browser code, styles and generator, together with navigation and public contribution-record references. The build no longer regenerates these routes.
- The three requested novel characters appeared only in that removed journal. They were not globally relabelled inside a retained retelling. A separate original supporting outline now features Tavren Sile, Mira Vesk and Archivist Elian Voss investigating conflicting cargo records.
- Public website labels now use the original proposals recorded in `PUBLIC-NAMES.json`. This covers static pages, the searchable manual, accessible image labels, SVG text, faction panels, market labels, world-status names and dynamic feed presentation.
- The visible site brand is `dunerealms.com`; spice is retained at the owner's explicit request.
- Added an unofficial-project notice and the operator contact `unimatrix@dunerealms.com` to every generated public page and the custom-host login page.
- Added the requested comparison wiki. Legacy terminology remains intentionally in its clearly labelled comparison column, also included as the first manual chapter, not as current public faction or planet labels.
- Replaced direct legacy manual PDF download links with the current web manual. Historical PDFs and prior plugin releases still exist in the repository and external distribution history.
## Remaining concerns
| Area | Assessment after the local changes | Reason |
| --- | --- | --- |
| Website retelling of the novels | Reduced substantially within the edited site | The journal and its build inputs are removed; the new outline is about unrelated adults and a cargo-record dispute. |
| Current faction and planet labels | Reduced direct naming overlap | Public labels are replaced. The new proposals have not received a comprehensive trademark clearance search. |
| Brand and overall association | Material residual concern | The owner retained the Dune-containing domain, spice and a recognisable desert-resource/faction/creature theme. Renaming does not establish that the overall expression is independent or licensed. |
| Artwork, heraldry and textures | Unresolved | Existing illustrations and raster assets were not replaced or given a provenance/licensing audit. Updated captions do not change ownership of an image. |
| Game plugins, saved worlds and old releases | Material residual concern outside the website rename | Persistent IDs, command arguments, plugin artifact filenames, binaries, source histories, old documentation and previously distributed PDFs retain earlier names. They need a separately planned game-side migration and distribution audit if the intention is to rebrand the actual server too. |
| Comparison wiki | Limited contextual use, not a clearance | Short source names identify the comparison; no novel passages are reproduced. Whether a particular use is lawful depends on context and jurisdiction. |
| Disclaimer | Helps explain independence; no licence | It addresses apparent affiliation and identifies a contact. It does not remove copyright or trademark rights or guarantee Minecraft policy compliance. |
| Monetary exposure | Not quantified | There is no evidential basis here for a percentage, damages amount or enforcement prediction. Revenue, permissions, distribution and jurisdiction would matter. |
Overall: these edits reduce direct copying and naming overlap in the website, but do **not** justify describing the project as legally cleared or low risk. The most substantial unresolved areas are the retained brand/overall presentation, asset provenance, and the unchanged game/distribution materials. No conclusion about a particular live trademark registration was reached.
## Scan scope and exceptions
Checked tracked text sources in the current repository before editing, then checked public HTML, JSON, browser scripts, SVG text, the built Worker and custom-host labels. Runtime checks cover retired routes and current pages. The original character names and retired journal terminology no longer occur in public content. Old setting names remain deliberately in the comparison wiki, compatibility label maps, filenames/anchors, API identifiers and accurate command examples. Historical repository documentation and game sources remain reference/compatibility material; binaries, raster image text and all third-party sites were not exhaustively audited.
## Legal sources
- [U.S. Copyright Office Circular 33](https://www.copyright.gov/circs/circ33.pdf): individual names and short phrases are generally not copyrightable; trademark protection is a separate issue.
- [U.S. Copyright Office Circular 14](https://www.copyright.gov/circs/circ14.pdf): original additions do not acquire rights in underlying protected material; unauthorised adaptations may infringe.
- [USPTO: likelihood of confusion](https://www.uspto.gov/trademarks/search/likelihood-confusion): similarity and related goods/services matter to source confusion.
- [Minecraft Usage Guidelines](https://www.minecraft.net/en-us/usage-guidelines): require a prominent independence notice and identifiable responsibility/contact; they do not license someone else's fictional universe.
- [Official Dune overview](https://dunenovels.com/dune/): source context for the wiki's desert-setting and spice comparison.
These are background sources, primarily U.S. copyright/trademark summaries, not a jurisdiction-specific legal opinion.
Publication follow-up: the operator contact is now revealed only after self-hosted ALTCHA verification. Public HTML and static browser code do not contain the plain address. This protects against basic harvesting, not all automated solving or spam. Contact access controls do not affect the IP assessment above.
## 2026-10-27 commemorative note series update
At the operator's request the 1, 5, 1,000 and 5,000 Dunemark designs now explicitly portray Stilgar, Aliah, Ghanima and Leto as Minecraft-style fan characters. The 5,000 reverse imagines a victory over House Harkonnen. The 100 retains original character Mira Vesk. All notes use Vaerkring Reserve and a newly designed crown/sun/dunes imperial seal.
Assessment: the character editions reintroduce Dune adaptation references and therefore undermine any claim that all published artwork is independent of the source works. Their Minecraft styling and unofficial label do not supply adaptation rights. They are decorative game artwork, no cash value, not licensed merchandise. No percentage probability of a claim can be supported from the available evidence. This is not a jurisdiction-specific legal clearance.
The U.S. Copyright Office describes adaptations and the rights-holder's derivative-work right: https://www.copyright.gov/circs/circ14.pdf (checked 2026-10-27). Trademark confusion is a separate inquiry: https://www.uspto.gov/trademarks/search/likelihood-confusion . The new seal and invented reserve label have not undergone a trademark clearance search. A lower-risk merchandise edition would use wholly original characters and stories or obtain appropriate licences.

View file

@ -1,37 +0,0 @@
# Native GUI branch validation — 2026-10-21
Branch: `feature/native-gui-1.21.8`, based on `c692949a78f09a117d84684dbae7f9aef39189af`.
Java: Temurin 21.0.12.1; Gradle: 8.14; Paper API: 1.21.8.
| Module | Compile/build | Automated tests |
| --- | --- | --- |
| DuneRealms Essentials | Passed | 19 passed |
| DuneRealms Core | Passed | 11 passed |
| DuneRealms Terrain | Passed | 2 passed |
| DuneRealms NPC | Passed | 5 passed |
| DuneRealms Lobby | Passed | No existing automated tests |
New checks include owner-bound menu sessions, stale screen invalidation, one-use selection,
expiry, normalized/validated home names and teleport consent with repeated acceptance rejected.
The existing SQL exchange, economy, announcements, terrain, and NPC tests remain enabled.
The Paper API upgrade required stubbing `Plugin.namespace()` in the sandworm mock; production
sandworm code was unchanged. Mockito is now installed explicitly as a test-only Java agent.
Geyser/Floodgate Spigot and Velocity variants and ViaVersion downloaded successfully and
matched the official pinned SHA-256 metadata. The all-server ZIP has eleven plugin JARs;
the network ZIP verifies 45 JAR placements across the proxy and six backends. ZIP integrity,
plugin descriptors, workflow YAML, Python syntax and `git diff --check` were checked.
No existing worlds, runtime configuration, database or player data were opened or modified.
The local packaging test creates fresh-install templates only in ignored generated directories.
## Pending
* Live Paper 1.21.8/Velocity, Java 1.21.8, supported older Via clients, and Bedrock clients.
* Visual dialog/form behavior, bed/anchor death/respawn, actual transfers and live shared SQL.
* DuneGit push: unauthenticated HTTPS write requires repository authentication.
* GitHub publishing: connected API returned 403, "Your account was suspended".
No production deployment or merge has been performed. This is a staging candidate, not a
claim of live compatibility. Follow the checklist in Native-GUI.md before production rollout.

View file

@ -1,111 +0,0 @@
# DuneRealms native menus and Essentials
Target: Paper 1.21.8, Java 21. No resource pack or client mod is needed.
## Plugin filenames
| Module | Published filename | Existing internal ID / data folder |
| --- | --- | --- |
| DuneCore | DuneRealms-Core.jar | DuneCore |
| DuneEss — DuneRealms Essentials | DuneRealms-Essentials.jar | DuneEss |
| DuneTerrain | DuneRealms-Terrain.jar | DuneTerrain |
| DuneNPC | DuneRealms-NPC.jar | DuneNPC |
| DuneLobby | DuneRealms-Lobby.jar | DuneLobby |
The internal IDs intentionally remain stable. Do not rename existing plugin data folders.
Stop each backend and replace its old project JARs; do not leave duplicate old/new copies.
Do not replace existing worlds, server properties, configs, balances, SQL databases or player data.
Back up the existing server and database first. The network ZIP is a **fresh-install template**;
never extract it over an existing deployment. Existing configuration files are not rewritten.
## Menus
CHOAM Exchange, DuneEss help/travel, the configurable Navigator (including its economy pages),
lobby departures and `/essentials` now use a shared renderer:
* Bedrock: Floodgate native SimpleForms, checked before Java protocol detection.
* Java 1.21.6+ (protocol 771+): native Paper dialogs, including Paper 1.21.8 clients.
* Earlier clients supported by the existing Via stack: clickable chat actions.
* Unknown Via protocol: clickable chat fallback, avoiding unsupported dialog packets.
CHOAM listings retain the SQL transactions, tagged item payloads, ownership checks,
capacity checks, purchase/reclaim confirmations and Solaris economy. Actions are owner-bound,
expire after two minutes, accept only one selection and become invalid when a new menu opens.
Bedrock responses schedule gameplay actions on the Bukkit thread. The shared layer does not
shade or duplicate Geyser, Floodgate, ViaVersion or Cumulus APIs.
The existing DuneNPC/admin-only inventory interfaces are outside this player-menu migration.
Older client login support still depends on the installed ViaBackwards/ViaRewind configuration;
ViaVersion by itself permits newer clients, not every older version.
## Crossplay package
`tools/crossplay-lock.json` pins official download URLs and SHA-256 hashes:
* Geyser 2.12.0 build 1267 (Spigot and Velocity)
* Floodgate 2.2.5 build 141 (Spigot and Velocity)
* ViaVersion 5.12.1 (universal)
Run `python3 tools/download-crossplay.py built-crossplay` to obtain and verify the JARs.
Upstream metadata was checked on 2026-10-21. These are pinned builds, not moving `latest` URLs.
Run `python3 tools/package-server.py` after the Gradle builds for a local all-JAR ZIP.
The actual supported Bedrock versions follow the selected Geyser release; staging must verify
that version against the production Bedrock clients before rollout.
For a standalone Paper server: install the Spigot variants and ViaVersion in `plugins/`.
For Velocity: install Geyser-Velocity and Floodgate-Velocity on the proxy; install
Floodgate-Spigot and ViaVersion on every Paper backend. Do not also install Geyser-Spigot
behind a proxy running Geyser. Do not install ViaVersion at both proxy and backend layers.
Retain existing ViaBackwards/ViaRewind plugins if used.
For backend forms, enable `send-floodgate-data` on the proxy and use the same Floodgate
`key.pem` on the proxy and backends. Keep that private key out of Git and ZIPs.
Set Geyser's `auth-type` to `floodgate`, retain existing UUID/link settings, and keep backend
ports protected. Do not regenerate keys, forwarding secrets or player UUID settings during an upgrade.
GitHub build.yml publishes **DuneRealms-All-Server-Jars.zip**, containing every Dune plugin,
Vault and the platform-specific crossplay plugins together, plus the lock manifest and instructions.
The network workflow puts the appropriate JARs into each server directory and includes the lobby
plugin only on the Vaerkring backend. Paper/Velocity engine executables are obtained separately;
this package contains server **plugin** JARs.
## Minimal essentials
`/duneess` and `/essentials` open **DuneRealms Essentials**. The existing `/duneess help`,
economy, trade, administration, spice sale and travel commands continue to work.
* `/sethome [name]`, `/home [name]`, `/delhome [name]`, `/homes`
* `/tpa <player>`, `/tpaccept`, `/tpdeny` (60-second consent requests)
* `/spawn` for the current world
* `/server [planet]` for the existing paid Guild server travel
Permission: `duneess.basics` (default true); default home limit: three, configurable through
`essentials.max-homes`. Homes persist atomically in `plugins/DuneEss/homes.yml`, keyed by UUID.
They are local to the backend, not synchronized across the proxy. Player requests and home/spawn
teleports remain within the current world, so they cannot bypass planet permits or fares. Use
Guild travel first, then the destination's local homes. Vanilla handles valid bed/anchor respawns;
this plugin does not overwrite existing spawn locations, beds, anchors or respawn event behavior.
HuskHomes was evaluated as a focused alternative to EssentialsX. It supports global homes and
cross-server player teleports, but also exposes a substantially broader command surface. This
change implements a small original subset inside DuneEss; it does not embed or bundle HuskHomes.
If global homes or cross-server player-to-player teleports are wanted, that requires an explicit
shared destination/arrival design rather than bypassing the existing Guild economy.
## Verification and rollout
Run Gradle 8.14 `clean build` for all five modules on Java 21. The feature branch workflows
also compile/test before creating ZIPs. Unit tests cover session ownership, expiry/invalidation,
repeated selection and home-name validation, alongside the existing trading/economy tests.
Before merging/deployment, verify on an isolated Paper 1.21.8/Velocity staging copy:
1. Java 1.21.8 dialogs, supported older Via client fallback, and current Bedrock forms.
2. Listing, filtered browsing, pagination, buy, reclaim, full-inventory rejection, offline database,
stale confirmation and repeated click. Compare Solaris and item counts before and after.
3. Help pagination, configured Navigator actions, fares/permits, lobby departures and proxy failure.
4. Save homes, restart, reconnect, request/accept/decline/expiry, permission denial, full home limit,
absent worlds, and vanilla death at a valid bed; test broken beds and anchors as well.
5. Compare world/config/player/database snapshots before and after; deploy only replacement JARs.
Compilation and unit tests do not establish live Bedrock rendering or proxy transfer compatibility.

View file

@ -1,27 +0,0 @@
{
"brand": "dunerealms.com",
"planets": {
"arrakis": "Arrakduin",
"caladan": "Kaladam",
"giedi_prime": "Giedermark",
"kaitain": "Kaiterhof",
"sigma_draconis_iv": "Sigmadraken IV"
},
"factions": {
"Fremen": "Vrijduin",
"Atreides": "Aerdrecht",
"Harkonnen": "Harkveen",
"Corrino": "Korenholt",
"Ordos": "Oordwijk"
},
"terms": {
"Shai-Hulud": "Dune Maw",
"Spacing Guild": "Vaerkring",
"CHOAM": "Koopkring",
"Solaris": "dunemarks",
"spice": "spice",
"stillsuit": "reclaimer suit",
"sietch": "rockhaven"
},
"note": "Public website names only. Existing game identifiers, plugin artifact names, URLs, commands, saves and feed contracts retain compatibility. New names are proposals, not trademark-cleared."
}

View file

@ -1,64 +0,0 @@
# DUNE-008: read-only Battlegroup analysis for SF-032 / G-006
Reference: https://bitbucket.org/liamrigg/pa-tools/src/564f02157c7c028beb57c16b4c8a2c02869b35ba/
Inspected 2026-10-14. The cloned repository HEAD exactly matches this commit. No Starfall implementation or running game was inspected or changed. Recommendations below are a port proposal, not claims about current Starfall behaviour.
## Source map and behaviour
| Source path | Observed behaviour |
| --- | --- |
| `app/BattleGroup.php` | Owner is `creator_id`; many-to-many accepted and pending users; bookings linked by `bg_id`. Derived flags identify the current user's ownership/membership/application. Member counts and average size/value/score/XP use accepted members. |
| `app/Http/Controllers/Api/BattleGroupController.php` | Sorted group list, create with creator auto-enrolled, detail with roster/candidate users and upcoming booking counts, delete, request membership. |
| `app/Http/Controllers/Api/BattleGroupUserController.php` | Add directly, accept application, remove member. Candidate list excludes accepted/pending users and requires a planet. |
| `routes/api.php` | Battlegroup routes are inside auth/enabled/activity middleware, outside the explicit admin and BC route groups. Join/accept mutate through GET. |
| `resources/assets/js/components/pages/Battlegroups.vue` | Ranking table: owner, member count, averages, growth; sort, create, request join, admin delete. Join disabled while pending or without a planet. |
| `resources/assets/js/components/pages/Battlegroup.vue` | Detail: booking list, pending roster, accepted roster with planet stats/distorters/booking counts, direct-add candidates. UI accepts/declines for owner/Admin; add/remove for owner/Admin/BC. Some handlers reference loadTeamups/loadTeams/loadFleets without corresponding methods in this component. |
| `app/Console/Commands/CalculateBattlegroups.php`, `app/Console/Commands/PaTick.php` | Tick processing accumulates accepted members' latest planet changes in size/value/score/XP. Growth counters reset at hour zero; cumulative totals remain. This is contribution accumulation, not a snapshot sum of current planets. |
| `app/AttackBooking.php`, `app/Services/MyBookings.php` | Booking owner, explicit shared users, optional group assignment. Group-filter/detail queries add accepted groups to booking visibility. Upcoming means landing tick strictly greater than current tick and attack still open. |
| `app/Http/Controllers/Api/AttackBookingsController.php` | Owner/shared user may edit notes, calc, group and status. Owner reassignment moves the old owner to shared users and removes the new owner from shared users. Owner cannot drop while shared users remain; unshared owner drop clears owner and group. |
| `app/Services/Booking/BookingUserList.php`, `BookingUser.php`, `ChangeBookingStatus.php` | Candidate co-users limited to enabled planet holders and, when assigned, accepted group members; separate add/remove helpers. Status change notifies other booking participants through Telegram. |
| `app/Services/Bot/Commands/Attacks/BattleGroupCommand.php`, `TopBGSCommand.php`, `config/bot.php` | `bg` members/targets and ranking summaries. Members output coordinates and race; targets include claims and landing data. The command picks the first membership row without explicit accepted-state filtering. |
| `database/migrations/2019_08_05_*battlegroup*`, `*battelgroup*` | Group totals and membership pivot. Inspected creation migrations do not establish unique group/user pairs or foreign-key cleanup. The pivot rollback uses a differently spelled table name. |
`AttackBookingBattleGroup.php` and `AttackBooking::teamups()` contain a further pivot relation, but searching source only found those definitions and unused component state. Do not present teamup CRUD as a complete working subsystem without further evidence.
## Rights and ownership issues to resolve in the port
The inspected group controllers do not enforce the owner/Admin/BC checks shown in the UI. Enforce an explicit policy in Worker for every read and write, independent of hidden buttons. Distinguish group creator/leader, global BC, administrator, accepted member, pending applicant and outsider. There is no separate deputy/leader role model in the inspected source. Owner transfer is a proposed addition, not an existing group endpoint.
The booking owner endpoint authorises when the actor owns the booking OR the **destination user** belongs to its group. That second condition does not establish authority of the actor. Require actor ownership or an explicitly authorised group-leader/admin action; also validate the destination's accepted membership and eligibility. Membership alone should not silently transfer another person's claim.
`MyBookings` applies its ID restriction only when the computed permitted-ID array is nonempty. Use deny-by-default SQL predicates even for an empty allowed set. Check group/booking detail and participant-list access separately. Candidate-list restrictions are not sufficient write validation: the inspected add/remove helpers do not themselves enforce actor rights or candidate eligibility.
Joining an already accepted group should not demote the member to pending, as the unconditional sync can do. Accept must require a real pending row. Define whether multiple accepted groups are allowed: the data model permits them, while the bot assumes a first group. Keep group membership separate from alliance membership and do not reset either incidentally.
## Practical Worker + vanilla JS proposal
1. Reuse Starfall's authenticated account/planet IDs and existing booking records. Add `battlegroups(id,name,owner_user_id,created_at,version)` and `battlegroup_members(group_id,user_id,state,joined_tick)` with unique composite membership, checked states and deliberate deletion rules. Add group reference to bookings and a unique booking-participant pivot only if those concepts are absent. Keep historical tick contributions separate from current membership.
2. Centralise `canViewGroup`, `canManageMembers`, `canViewBooking`, `canEditBooking` and `canTransferBooking`. Initially mirror the documented UI role matrix, after confirming Starfall's BC equivalent. Scope candidate users to the intended game/round and eligibility. Do not return complete user/scan models to outsiders.
3. Provide authenticated GET list/detail/booking reads and POST create/apply/accept/decline/add/leave/transfer operations; use PATCH for edits and DELETE for removal. Avoid state-changing GETs. Return per-action capabilities from Worker for accessible UI buttons; still recheck every mutation. Bound sorting fields, pagination, name length and request bodies.
4. Make membership changes, leader transfer and booking reassignment atomic using the deployed database's supported transaction or conditional-batch mechanism. Use a version/expected-owner comparison to reject stale writes with 409. A target/wave/landing-slot claim needs a uniqueness rule or atomic conditional update; identify the actual Starfall claim unit before choosing that constraint.
5. Vanilla JS needs a sortable group index and detail view with pending/accepted members, eligible candidates, booking list/filter, assignment selector and transfer/drop dialogs. Show loading/error/empty/permission states and refresh capabilities after mutations. Render names and notes as text, not trusted HTML. No Vue or PHP dependency is needed.
6. Preserve contribution-based totals only if desired for SF-032: record each group/member/tick contribution once and derive averages explicitly (including zero and negative totals). Use a stored UTC day/tick boundary, not repeated wall-clock midnight resets; guard zero denominator. Process no-planet/no-tick members safely. Re-running a tick must not double count contributions.
7. Keep notifications behind Starfall's existing channel integration and emit after a successful write. Telegram and bot commands are optional adapter parity, not requirements to import their credentials or dependencies. Implement core groups/permissions/bookings first, scoring and notification adapters second.
## Claims and lifecycle decisions
- Leader departure/removal: require atomic transfer to an eligible accepted member, or explicit disband; never leave an ownerless active group. Pending users cannot lead.
- Member departure/removal: immediately revoke group-derived access; define whether their individually owned booking remains personal or must be reassigned. Do not silently release a claim while other participants still depend on it.
- Group deletion: require owner/admin authority, show affected future bookings and choose reassignment or conversion to personal bookings. Avoid dangling group IDs; preserve an audit trail and historical score records.
- Planet deletion/reset, disabled account and round change: revalidate eligibility at mutation and read time. Coordinate policy with existing reset rules; this analysis does not authorise any reset or alliance changes.
- Reassigning a booking's group: validate actor and new group, and deliberately handle shared users outside the new group. Preserve or revoke explicit sharing by an explicit rule, not an accidental join query.
- Past/closed booking: read-only history unless a separate administrative correction is authorised. Boundary is `land_tick > current_tick` for parity.
## Verification plan for the implementing colleague
- Policy matrix tests for owner/Admin/BC/member/pending/outsider against every endpoint, including guessed IDs and forged group/user IDs. Verify empty memberships return no bookings.
- Membership tests: duplicate apply/add/accept, apply by accepted member, accept without application, cross-group access, missing/disabled planet, owner removal and concurrent transfer/delete.
- Booking tests: actor versus destination membership on transfer; old owner becomes participant exactly once; new owner removed from shared list; protected drop; reassignment across groups; membership loss revokes only group-derived access.
- Concurrent claim tests: two requests for one slot yield one winner; stale update returns conflict; retry is idempotent. Test current-tick boundary and closed attacks.
- Tick tests: no planet, zero/negative totals, leave/rejoin, midnight, replayed tick, two rounds and independent groups; no duplicate contribution or divide-by-zero.
- UI integration: real Worker responses, permission refresh, failed/stale writes, empty rosters, escaped HTML, small screens and keyboard operation. Confirm whether bot/notification parity belongs in acceptance criteria.
This is a source review and implementation/test proposal only. No Starfall runtime tests were run and no Starfall code, branches or game state were changed.

View file

@ -1,53 +0,0 @@
# DUNE-016 / SF052 — beta contribution handoff
Confirmed Starfall beta push: `c4169b3d5697a1fdbec19c074537ba3d28ba52f9`, based on `f0752b54f6313a06036b76126853fa0a712c0d91`. Only four agreed files changed: worker/cache.js, scripts/asset-manifest.cjs, tests/cache-efficiency.test.cjs and tests/asset-manifest.test.cjs. No Starfall main push, deployment, reset, game/stronghold/slot edits or build-script edits.
All 241 tests pass (226 baseline + 15 new). Worker cache is exercised by both focused fixtures and the existing full Worker suites. Collector integration remains with the colleague; no production build with the new collector hook is claimed.
## Active cache changes
- Retained public response bodies capped at 2 MiB aggregate, 256 KiB each, 128 entries per DB handle/isolate. These are cache-body limits, not total Worker memory guarantees; in-flight response buffering and application objects are separate.
- Only existing public allowlisted JSON routes are eligible. Catalogue parameter ordering is canonical; unknown/duplicate keys, Authorization and explicit caller no-cache/no-store bypass. Set-Cookie, private Cache-Control, non-JSON, varying personal headers and non-200 responses are not retained or shared across waiting callers.
- TTL begins after completion. Evicted/invalidated in-flight records cannot repopulate the cache or evict a newer replacement. Failed requests permit retry. Existing request-scoped auth and audit logging are unchanged.
- Known unrelated fleet telemetry, mail, ticket, forum, intel and scan writes no longer invalidate public roster/count/catalogue reads. Other successful mutations still conservatively invalidate all public entries. Review this allowlist if endpoint responsibilities expand.
- Optional build-supplied SHA256 ETag metadata avoids same-length content collisions. Without metadata the existing fallback remains. Year-long immutable caching is restricted to portal-runtime URLs whose filename hash matches the supplied content digest; protected pages stay private/no-store. This part needs the collector hook below.
## Read-only asset helper and measured candidates
`createAssetManifest(dist, options)` hashes assets and returns files, omitted, warnings, unreferencedRuntimePaths and byte statistics. It excludes server/.openai directories as the current collector does; everything else, including arbitrary lazy artwork and PNG/WebP pairs, stays included by default. It never writes/deletes source files. Symlinks fail explicitly.
Only root `portal-runtime-<12 hex>.js` files can be omitted. Reachability considers all non-hash HTML/JS/CSS/JSON roots, follows hash-bundle references transitively and fails for a missing referenced runtime. Unresolved dynamic runtime prefixes disable pruning. No general JS/CSS/image tree-shaking is attempted.
On the confirmed source snapshot: 1,703 eligible files, 45,557,159 raw bytes before the old PNG/WebP filter. There are 23 unreferenced hash-runtime candidates totalling 1,268,514 bytes when measured with an explicitly empty compatibility list. **This is a potential maximum, not a deployed saving.** Retaining previous release runtimes may reduce it. Default operation omits zero bytes.
## Complete collector hook for the colleague
This replaces only the existing `collect` function in scripts/build-worker.cjs. It is deliberately supplied here rather than changing that colleague-owned file. Keep its invocation after diagnostic generation so the manifest sees final assets. It uses the build script's existing fs/path/assets/mime bindings.
```js
function collect(dir) {
const { createAssetManifest } = require('./asset-manifest.cjs');
const { createHash } = require('node:crypto');
const manifest = createAssetManifest(dir);
for (const file of manifest.files) {
const full = path.join(dir, file.path);
// Preserve existing publication behaviour; this helper does not add PNG pruning.
if (file.path.endsWith('.png') && fs.existsSync(full.replace(/\.png$/, '.webp'))) continue;
const bytes = fs.readFileSync(full);
if ('sha256-' + createHash('sha256').update(bytes).digest('hex') !== file.etag) {
throw new Error('Asset changed during collection: ' + file.path);
}
assets[file.url] = {
data: bytes.toString('base64'),
type: mime[path.extname(full)] || 'application/octet-stream',
etag: file.etag
};
}
console.log('Asset manifest: ' + manifest.files.length + ' files; '
+ manifest.stats.omittedBytes + ' bytes omitted');
}
```
This safe default enables digest metadata but performs no pruning. To enable pruning, pass `pruneUnreferencedPortalRuntimes:true` and an explicit `previousRuntimePaths` array of root filenames from the preceding deployed pages. Those files must still exist in the input, or the helper fails. Retain compatible runtimes through the HTML cache/rollout window and any agreed rollback interval; do not supply an empty list just to maximise the saving on an existing deployment.
Before publication: rebuild runtimes/Worker in the colleague's composed branch; audit links and actual generated metadata, verify digest-based 304/immutable headers and old cached-page loader compatibility, and run live/preview CPU/D1 measurements. Existing audits still write on authenticated API calls; cache hits are not zero-DB-work. No media binding, telemetry retention, private caching, polling schedule or authentication algorithm was changed by this contribution.

View file

@ -1,75 +0,0 @@
# DUNE-013 / SF-052 — efficiencyreview portal en game
Read-only bronreview, 14 oktober 2026. Gemeten op GitHub main `2577efefb56aae14da63df725cdf180419563bd1`. De aangekondigde v0.120.1/splitdiagnostics waren bij de fetch nog niet beschikbaar; bevindingen daarop opnieuw controleren. Geen live browsermeting, databaseprofilering, Starfall-codewijziging, reset of deployment uitgevoerd.
## Samenvatting
Pak eerst de manier van assetpublicatie, overlappende achtergrondaanvragen en volledige directoryreads aan. Optimaliseer daarna rendering en verdere codesplitsing. Er bestaan al nuttige maatregelen: request-scoped session-deduplicatie, begrensde asset-bytecache, enkele visibility/busy-guards, publieke readcache, content-hashed portalbundles en video preload=none. Behoud die bescherming; voer geen algemene cache voor persoonlijke spelgegevens in.
## Gemeten brongegevens
Met `git ls-tree -r -l` zijn tracked bestandsgroottes bepaald; met `git show` is gzipgrootte van geselecteerde bestanden berekend. De collectorselectie is nagebootst volgens `scripts/build-worker.cjs`, zonder een build te draaien of bronbestanden te wijzigen.
| Maat | Uitkomst |
| --- | ---: |
| Tracked assets onder dist, zonder server/.openai | 1.682 bestanden; 44.602.234 bytes |
| Na bestaande uitsluiting van PNG met WebP-equivalent | 1.679 bestanden; 36.727.913 bytes |
| Base64-payload van die selectie, exclusief JSON/Worker-code | 48.972.756 bytes |
| Reeds door collector vermeden PNG-data | 7.874.321 bytes |
| MP4 binnen collectorselectie | 13.047.538 bytes |
| WebP / overige PNG binnen selectie | 9.383.388 / 5.834.651 bytes |
| game-runtime.js | 657.934 bytes; gzip 183.490 |
| game.js | 462.463 bytes; gzip 130.905 |
| Game index.html | 263.656 bytes; gzip 56.940 |
| Portal HTML | 39.183 bytes; gzip 10.222 |
| planet-catalog.json | 974.757 bytes |
| Tracked portal-runtime hashes | 19; daarvan 13 niet rechtstreeks teruggevonden in tracked HTML |
Dit is geen gemeten eerste-paginatransfer: browser laadt niet alle assets tegelijk, Worker-sourcecompressie en HTTP-contentencoding zijn andere maten, en runtimegeneratie kan de uiteindelijke selectie veranderen. Een runtime zonder directe HTML-verwijzing kan nog indirect gebruikt worden; controleer bereikbaarheid voordat iets wordt weggelaten. `dist/server/index.js` is niet tracked in deze snapshot; daarom wordt geen exacte Worker-gzipgrootte geclaimd.
## Prioriteiten en meetbare doelen
| Volgorde | Knelpunt en bronbewijs | Voorstel en meetbaar resultaat | Risico/controle |
| --- | --- | --- | --- |
| 1 | build-worker embedt recursief assets als base64 in één Worker; media alleen al 13 MB MP4 | Houd grote video/audio/artwork buiten de JS-module via ondersteunde static-assets/object-storage publicatie. Behoud URL's of gebruik een versie-manifest. Meet Worker raw/gzip, cold-start CPU en mediaverkeer apart. MP4-extractie haalt aantoonbaar 13.047.538 raw assetbytes uit deze collectorselectie. | Eerst vaststellen wat bestaande hosting ondersteunt; deze review wijzigt geen bindings/publicatie. Behoud contenttypes, range/HEAD, privacy en fallback. |
| 2 | Veel 15/30/60s timers, dubbele /api/version-aanvragen | Eén visibility-aware scheduler per tab, dedup per endpoint, in-flight guards, backoff/jitter en refresh na mutaties. Combineer versie/clockcheck; 30s + 60s wordt 30s: 3 naar 2 requests/minuut per actieve tab voor dat paar. | Gameplaycommando's en audit-outbox niet verliezen; verborgen tab mag hervatting/uitloggen niet missen. Huidige guards verschillen per module. |
| 3 | /api/planets leest alle directory- en alliancerijen voordat client revision vergelijkt | Autorisatie-eerst revision/ETag short-circuit; gewijzigde eigen gegevens en publieke directory gescheiden of pagineer/delta. Bij ongewijzigde revisie geen volledige JSON-parse/response. Meet rows-read, CPU en bytes per poll bij groeiende universe. | Revision moet álle relevante wijzigingen, permission changes en reset generation representeren; geen oude privérechten/owned-state hergebruiken. |
| 4 | recordAccountAccess voegt bij iedere ingelogde API-aanvraag een accesslog toe en bij IP een history-upsert | Scheid verplichte security-events van herhaald routine-heartbeatverkeer; aggregeer routinehits in een persistent tijdvenster met hitcount/first/last, indien securitybeleid dat toestaat. Meet writes per actieve speler per uur. | Geen audit stilzwijgend uitschakelen; staff/reset/auth/mutaties en incidentonderzoek behouden. Isolate-memory alleen is geen betrouwbare auditbuffer. |
| 5 | Alle statics max-age=60; collector bevat oude hashes; zwakke ETag gebruikt versie/pad/lengte | Pristine build + bereikbaarheidsmanifest en contenthash-URL's. Alleen werkelijk immutable hashed assets lang cachen; HTML kort revalideren. Meet herhaalbezoek: immutable asset heeft nul bodytransfer zolang vers gehouden. | Ongehashte assets niet immutable maken. Privé/staff/game HTML blijven private no-store. Oude URLs tijdens rollout ondersteunen. |
| 6 | update() normaliseert/save't en herschrijft veel UI; save stringify't complete state synchroon | Dirty-state checkpoints, kleine zichtbare view-updates, coalesced renders; metadata-only refresh mag niet complete state save/render doen. Meet long tasks, update()/save()-duur en inputlatency op representatief groot savebestand. | Saveformat/starfall-round-v2, tickvolgorde en duurzame pending commands behouden; kritisch event direct opslaan, debounced flush plus page lifecycle testen. |
| 7 | Gedeelde JS-functies en volledige game HTML/monolith start tegelijk | Core shell eerst, paneelcode op eerste gebruik; pure metadata los van DOM. Behoud één bootstrap. Meet bytes/parse time vóór eerste bruikbare gameactie; streef pas na baseline naar bijvoorbeeld 25–40% minder init-JS. | Doelpercentage is een voorstel, geen gemeten winst. Concat-globals maken blind defer/dynamic import riskant; contracttests vóór splitsing. |
## Polling: concrete locaties
- `dist/game.js`: syncServerClock vraagt /api/version onmiddellijk en elke 30s op; `dist/planets.js` vraagt dezelfde route elke 60s voor versiecontrole. Voeg beide functies samen zonder de serverklok-offset te verliezen.
- `dist/planets.js`: directorypoll 15s met document.hidden-check; `refreshSharedPlanets` haalt eerst het volledige antwoord en vergelijkt daarna revision. Zijn guard voorkomt save-conflict maar is geen algemene refresh-in-flightguard.
- `dist/fleet-features.js`: readiness elke 30s met busy/time guard; één cycle doet snapshotwrite en command-read, plus eventuele commandafhandeling. Beoordeel snapshot-dirtychecking en aparte rustige commandpoll. Movement-outbox elke 15s doet niets bij lege wachtrij: tel die timer niet als onvoorwaardelijke netwerkrequest.
- `dist/population-development.js`: galaxy development en distribution controls elke 15s met visibility/role guards; alliance economy elke 30s. Galaxydevelopment slaat state op en rendert gedeelten na het antwoord. Meet per endpoint; niet iedere callback geldt voor iedere gebruiker.
- `dist/communications.js`, `special-worlds.js`, `site-management.js`: diverse 30s checks; sommige voor algemene signals/news/features, andere voor actie-/kolonietoestand. Deel een read-snapshot waar dezelfde context nodig is, maar maak geen brede command-endpoint die alle mutaties elke poll uitvoert.
- `dist/portal.js`: universe/worldstats elke 30s wanneer de betreffende DOM bestaat. Ook een nieuws-sorteertimer en staff-iframehoogte bestaan; die zijn DOM-werk, niet automatisch DB-verkeer.
Belastingsmodel voor dimensionering: één onvoorwaardelijke 15s GET is 4 verzoeken/minuut per tab, dus 400/minuut bij 100 actieve tabs. Als elk verzoek één sessiequery, één accessloginsert en één IP-upsert veroorzaakt, is de orde van grootte 400 sessiereads + 800 routinewrites/minuut, vóór endpointwerk. Dit is een scenario, geen gemeten productieaantal. Zichtbaarheid, caching, cookies, role guards, outboxinhoud en multi-tabgebruik veranderen het resultaat.
## Caching en server/database
`worker/cache.js` heeft een 16 MiB decoded-assetcache met 60s entryleeftijd, request-deduplicatie voor publieke reads en maximaal 128 cachekeys per DB-handle. Publieke allowlist: worldstats, staff-directory en planet-catalog. Cache is per isolate en dus geen globale garantie. Iedere succesvolle niet-GET/HEAD-request invalideert de hele publieke readcache; regelmatige readinesswrites kunnen cacheeffectiviteit drukken. Gebruik gerichte invalidatie waar dependencies bekend zijn. Voeg hit/miss/body-size/request-rate metingen toe voordat TTL's worden verhoogd.
Een body boven 256.000 tekens wordt niet bewaard. Het losse planet-catalog.json is circa 975 KB; controleer de werkelijke /api/planet-catalog-body om vast te stellen of deze route daarom structureel de cache mist. Publiceer een content-versioned publieke catalogus als static JSON, of maak een lichte index en lazy details. Waar rechten/typefilters gelden, mogen die niet via een publieke variant lekken.
De static ETag is gebaseerd op releaseversie, pad en base64-lengte; inhoud kan bij dezelfde lengte veranderen. Gebruik een echte build-time contenthash. Grote MP4's hebben expliciete ranges maar blijven slechts 60s gecachet. Bij uitplaatsing Range/206/416/HEAD en hervatten daadwerkelijk testen; geen complete video decode per range blijven doen als assetopslag dit kan afhandelen.
`worker/portal.js` memoiseert `portalUser` per Request, inclusief de promise: dubbele oproepen in dezelfde request zijn al samengevoegd. Behoud dit. Wel vraagt /api/portal/session altijd COUNT(*) op portal_users voor setupRequired. Vervang desgewenst door een goedkope EXISTS/flag met duidelijke initialisatie-semantiek; trek PBKDF2 niet omlaag als performance-optimalisatie. Authschema-initialisatie gebruikt isolate-guards; vaste schemawijzigingen naar genummerde migrations verplaatsen voorkomt herhaald initwerk op nieuwe isolates, met behoud van compatibiliteit.
`worker/planets.js` parse't directorydata meerdere keren in één GET voor publieke projectie, type-overzicht en membershiprepair. Parse één keer en hergebruik. Vergelijk DB-queryplan en rows-read voor coords/owner/kind filters voordat indexen worden toegevoegd. `worldStatsAPI` leest alle planeet-JSON en telt asteroids; revision-keyed aggregatie of incrementele counters kunnen dit reduceren, maar moeten reset/afbraak/import correct verwerken.
`worker/access.js` logt alle /api/* voor ingelogde gebruikers, ook goedkope version/publieke cachehits. Daardoor betekent een publieke cachehit niet nul DB-werk. Logretentiecleanup loopt per isolate ongeveer eens per uur; zonder tijdindex kan verwijderen grote scans geven. Onderzoek queryplans/indexen voor created_at, last_seen en paginering; verander bewaartermijn of auditinhoud alleen als beleid dit toestaat. `waitUntil` verplaatst werk buiten de responsewachttijd maar maakt DB-writes niet kosteloos.
## Praktisch meet- en verificatieplan
1. Neem HAR/profielen voor guestportal, ingelogde portal, nieuwe game, grote save, staff en 10 minuten idle/hidden/weer zichtbaar. Meet cold/warm cache, requestcount per route, encoded transfer, JS execution/long tasks, grootste artwork en eerste bruikbare actie. Redigeer cookies/privédata uit gedeelde HARs.
2. Meet per Worker-route CPU, wall time, responsebytes en D1 rows-read/rows-written; groepeer auth/audit versus endpointqueries. Belast met 1/10/100 gesimuleerde sessies en een representatieve universegrootte. Geen loadtest op live zonder afgesproken grenzen.
3. Eerst publicatie/assetmanifest en scheduler/dedup, daarna revisionfastpath en gerichte cache-invalidatie; vergelijk dezelfde scenario's per kleine wijziging. Leg budgetten vast op basis van echte baseline, niet alleen totale repositorybytes.
4. Tests: geen dubbele bootstraps/timers; geen overlappende poll na langzame response; backoff herstelt; logout/rolewijziging/resetgeneration invalideren data; in-flight stale response overschrijft geen nieuwe mutatie; privéresponse nooit shared cached. Audit en commands blijven volledig volgens afgesproken beleid.
5. Buildchecks: geen onbereikbare oude runtimes in manifest, alle dynamische imports/assets bestaan, cached rollbackURLs werken, release niet afhankelijk van oude dist. Test videoranges en opkomst in mobiele viewport. Herhaal review tegen v0.120.1-bron zodra die gepusht is.
Geen Starfall-wijzigingen zijn gemaakt. Alle besparingen behalve de expliciete bron-byteberekeningen en timerfrequentieverschillen zijn hypothesen of doelen die live/DB-metingen moeten bevestigen.

View file

@ -1,56 +0,0 @@
# DUNE-010: portal/game separation proposal — SF-041
Read-only review of https://github.com/unimatrixgit/starfall at `4ca0737b9293701e72697653226d899b9a756e6a`, 2026-10-14. Linked to colleague-owned collaboration G-009. No Starfall code, branches, access settings, database or deployments changed. Later fixes, including the colleague's announced SF-044, are outside this snapshot.
## Actual dependencies
- The current repository mixes authored and generated files under `dist/`. Do not discard it as disposable output before extracting its authored JS, CSS, HTML, assets and data. Root deployment archives are build products rather than application source.
- `scripts/build-portal.cjs` reads `dist/ship-catalog.js`, evaluates the prefix of `dist/game.js` before its click-handler marker in a VM, and extracts BUILDINGS, TECH_TREE, SCAN_TYPES, STRUCTURE_DEFS, SHIPS and PLANET_TYPES. It separately evaluates `worker/planet-types.js` for the complete planet catalogue. This is a direct build dependency on game source and a brittle string marker.
- The same portal generator calls `freshState()` and `normalizeFleet()`, rewrites seed coordinates and member ranks/planet links, and writes `worker/default-round.json`. Therefore a portal/manual build currently changes the game server's seed input. Separate this responsibility before assigning independent ownership.
- `scripts/build-planet-catalog.cjs` reads `data/planet-reference-names.json` and `data/original-worlds.json`, writes `worker/planet-types.js`, rewrites the initial catalogue/helper portion of `dist/game.js`, writes `dist/planet-catalog.json`, and invokes `planet-art.cjs`. Catalogue generation currently edits both browser and server sources.
- `scripts/build-game-runtime.cjs` concatenates an explicit ordered list of files in `dist/` into `game-runtime.js`. It strips the bootstrap from `game.js` and appends one bootstrap and a ready flag. Its list includes shared-facing modules such as portal, forums, tickets, communications and site management; these filenames are not evidence of a clean portal/game split.
- `scripts/build-portal-runtime.cjs` reads script tags from a fixed page list, concatenates their JS into content-hashed portal runtimes, rewrites the pages and inserts the page loader. It operates on already generated pages. Repeated processing without restoring pristine HTML risks consuming previously rewritten runtime references; make clean-input builds a contract.
- `scripts/build-worker.cjs` invokes both runtime bundlers and diagnostics, recursively embeds `dist/` assets except server/.openai, and concatenates server modules into `dist/server/index.js`. Its concatenation order supplies shared globals including PLANET_TYPES, DEFAULT_ROUND, ASSETS, portal helpers, gameplay handlers, cache and the final fetch entrypoint. It does not itself invoke `build-portal.cjs` or `build-planet-catalog.cjs`; the README's build command depends on existing inputs.
- The same build copies `.openai/hosting.json` and `drizzle/` into deployment output. `scripts/build-diagnostics.cjs` executes part of `audit-links.cjs` in a VM and writes a diagnostic manifest. Both rely on the combined output layout.
- `worker/index.js` routes portal APIs, game APIs, Miday scans, forums, tickets and staff tools, then serves embedded assets. `/game`, `/game/` and `/index.html` are game aliases; root serves the portal. Preserve these aliases and guards during the move.
- `worker/portal.js` resolves the `starfall_session` cookie and database-backed sessions; account registration/profile logic is in `worker/accounts.js`. Gameplay uses `portalUser()` too. Authentication is a platform dependency, not an independently replaceable portal widget. The README still contains earlier identity descriptions, so treat current code as the source of truth.
- `tests/game.test.cjs`, `miday.test.cjs`, `planets.test.cjs`, `forums.test.cjs` and `cache.test.cjs` cover different domains. Some harnesses read browser files or assemble Worker source directly: update their path/assembly contracts together with the move. `scripts/preview.cjs` loads the built Worker and an in-memory SQLite/D1 adapter; retain one integrated preview.
## Recommended ownership layout
Start with one GitHub repository, clear source directories and CODEOWNERS/review boundaries. Separate source ownership does not require separate deployments or databases. If the user specifically requires distinct repositories, extract only after these interfaces and a clean build are stable; pin shared releases and compose portal/game versions in one integration release.
| Proposed location | Owner and responsibility |
| --- | --- |
| `apps/portal/` | Public pages, manuals, news, account-facing views and portal styling. Manual content consumes versioned shared catalogue data. Staff UI can live here but does not own staff authorisation. |
| `apps/game/` | Game shell, gameplay UI, browser simulation/save migration and game-only visuals. Preserve the `starfall-round-v2` save key and existing stable identifiers. |
| `packages/catalog/` | Canonical ships, structures, research, scans, planet definitions, names and display metadata. Export browser/server/manual views from the same inputs. No copy-pasted independent constants. |
| `packages/game-core/` | Pure defaults/fleet normalisation and other genuinely shared game logic. The game team owns seed generation, not the portal generator. |
| `packages/contracts/` | API schemas, error shapes, version/capability declarations and immutable IDs. No session tokens or deployment credentials. |
| `server/platform/` | Auth/session/account services, shared policy helpers, cache, diagnostics, route composition and deployment integration. Cross-domain review for changes. |
| `server/portal/`, `server/game/` | Domain handlers under the same composed Worker. Forums/tickets/site-management belong to portal-facing services; gameplay handlers to game. Miday/intel need explicit game-policy ownership even if linked from portal. |
| `database/migrations/` | One ordered schema migration history, reviewed by platform plus affected domain. Moving files must not replay or renumber deployed migrations. |
| `tools/build/`, `tests/integration/`, `public/shared/` | Build graph, combined preview/integration tests and deliberately shared static assets. Domain-specific artwork stays with its owner. |
These are proposed boundaries, not existing directories. Do not copy whole source modules based only on names: inspect their global references and API use first. Shared navigation/theme components need a named owner so portal edits do not rewrite game pages by broad directory loops.
## Migration sequence and build contract
1. Inventory every tracked `dist/` file as authored input, generated output or retained binary artwork. Preserve source history and record an input/output manifest. Protect existing saves and deployments; no reset is part of this work.
2. Extract metadata/default construction into importable pure modules. Replace portal VM execution and string slicing with explicit exports. Generate `default-round.json` in a game-seed step; validate it against the catalogue. Preserve current seed content first; change gameplay only in separate tickets.
3. Move authored inputs into the ownership layout; update relative paths, test fixtures and asset URLs. Make generators write only into a fresh staging directory. Catalogue generation must never rewrite authored game source.
4. Use an explicit DAG: canonical catalogue → browser/server/manual catalogue outputs; game-core → seed; portal source + catalogue → portal pages; game source + catalogue → game assets; pristine pages/assets → ordered runtimes; combined assets → link/diagnostic manifest; server modules + seed + assets → final Worker + hosting manifest + migrations.
5. Preserve the current single Worker, public origin, session cookie, origin checks and D1 binding during this structural migration. Switch source organisation first. A later multi-Worker deployment needs explicit service/auth routing and migration ownership; it must not duplicate session databases or rely on broad cross-origin cookies.
6. Establish one root build entrypoint that starts from checked-in inputs and works on a clean checkout. Initially keep the runtime concatenation order through explicit manifests; later convert to modules as a separate change. Verify bootstrap runs once and that content-hash/loader references resolve. Do not run a portal bundler over already rewritten HTML.
7. If separate repositories are still required, choose explicit immutable package/artifact versions for catalog/contracts and retain one deployment-composition owner. Portal and game pipelines publish artifacts; integration pins versions, checks contracts, embeds assets and deploys. Avoid each repository carrying its own editable catalogue/default state or migration copy.
## Acceptance and verification contracts
- Clean checkout build creates the full release without prebuilt Worker, previously generated pages or local archives. A second clean build has identical semantic assets; isolate expected timestamp changes in diagnostics. Source trees remain unchanged after building.
- Before/after catalogue and seed equality: stable IDs, ship/game statistics, planet types, initial fleets, coordinates, alliance member links and save migration remain intact. Validate server/browser/manual views against canonical inputs.
- Run all existing five test suites after updating their assembly/path contract. Add focused regression checks for portal metadata imports, seed generation ownership and combined Worker composition. This review did not run or claim those runtime tests.
- Integration smoke matrix: root portal, manual, register/login/logout/profile, `/game` aliases and unauthenticated redirects, staff-only views, forums/tickets, game APIs, Miday sharing/privacy, caching and same-origin mutation rejection. Assert authorised session works across portal/game and private content is never cached publicly.
- Audit generated runtime/loader references, image/style URLs, all internal links, hosting manifest, D1 migration copy and Worker size. Test representative pages with keyboard and mobile viewport after the migration.
- CI per domain can run focused checks, but shared catalogue/auth/schema/build changes require combined tests. CODEOWNERS should request both teams for shared paths; it does not itself grant repository access. Keep deployment credentials and publication authority in the existing integration flow.
Result: reduce overlapping edits through source ownership while keeping a single catalogue, identity model and release composition. A repository split can follow without turning a directory move into an unplanned authentication or game-state migration.

View file

@ -1,66 +0,0 @@
# DUNE-011 — voorstel voor SF-046: meerdere alliances in één stronghold-galaxy
14 oktober 2026. Beleidsvoorstel, geen ingevoerde spelregel. Read-only broncontrole op Starfall `2577efe`: `dist/game.js` gebruikt `fortress.strongholdGalaxy`, lokale structuurslots 11–15 en een residentcontrole die zowel alliancelidmaatschap als verblijf in die galaxy vereist. `worker/alliance.js` initialiseert een eigen fortress per alliance en kent een stabiele `registryId`. Dit is geen volledige runtime-audit en bewijst niet dat alle actuele claimpaden dezelfde controle uitvoeren. De bijzondere slotregels van G-004/G-005 hieronder komen uit de opdracht van de collega.
## Advies in gewone taal
**Laat meerdere alliances samen in een galaxy wonen, maar geef die galaxy maximaal één stronghold-eigenaar.** Wonen betekent geen eigendomsrecht. De andere bewoners blijven gewoon lid van hun eigen alliance; hun planeten worden niet verplaatst en hun lidmaatschap verandert niet.
De bevoegde leiding claimt de galaxy voor haar alliance. Alleen de eigenaar mag daar nieuwe alliance-structuren bouwen. Een claim geeft geen zeggenschap over andermans planeten, geen toegang tot hun gegevens en geen recht om bewoners uit te zetten. Diplomatieke toestemming voor gastbewoners kan later apart worden ontworpen.
| Keuze | Voordeel | Nadeel |
| --- | --- | --- |
| Eén stronghold-eigenaar per galaxy — aanbevolen | Duidelijk eigendom, eenvoudigere bouwrechten en bonussen; vijf structuurslots hebben één verantwoordelijke. | Alliances die samen wonen moeten verschillende stronghold-galaxies kiezen. Tijdelijke lege claims vereisen een expliciete vrijgaveregel. |
| Meerdere stronghold-alliances delen één galaxy | Ondersteunt coalities en gedeelde woongebieden zonder exclusieve claim. | De vijf slots blijven wereldwijd gedeeld, niet vijf per alliance. Vereist afspraken over bezetting, wachtrij, leiderschap en bonusstapeling; één alliance kan alle ruimte gebruiken. |
Als gedeeld eigendom toch gewenst is: gebruik één galaxyregister met afzonderlijke allianceclaims en één gezamenlijke slotlijst. Iedere structuur heeft precies één eigenaar; alleen die eigenaar beheert haar bouw/upgrade/verwijdering. Geen impliciete gezamenlijke kas of extra slots. Elke bonus heeft een expliciete ontvanger en stapelregel: een speler krijgt alleen de toepasselijke bonus van zijn eigen alliance; coalitiebonussen vereisen een aparte goedgekeurde regel. Quota of gereserveerde slots zijn nieuwe spelregels en kunnen vijf slots onbruikbaar verdelen; voer ze niet stilzwijgend in.
## Eigendom en gelijktijdige aanvragen
1. De server controleert een concrete stronghold-bevoegdheid, niet alleen de zichtbaarheid van een knop. Aanbevolen: alliance Owner/HC, of een expliciet gedelegeerde bevoegdheid. Welke rollen die bevoegdheid krijgen moet bij invoering worden bevestigd. Een geldige inwonende eigen planeet is een voorgestelde claimvoorwaarde; verblijf alleen verleent nooit automatisch een claim.
2. De canonieke claimsleutel is `(round_id, galaxy_x, galaxy_y)`, gekoppeld aan het stabiele alliance-ID, niet aan de wijzigbare naam. Voor het aanbevolen model is die sleutel uniek. Stel ook maximaal één actieve stronghold per alliance per ronde vast; anders kan de eerste claimant meerdere galaxies blokkeren. De ene alliance mag meerdere woon-galaxies hebben.
3. Claimcontrole en vastlegging gebeuren atomisch. Twee gelijktijdige aanvragen leveren één winnaar en één duidelijke conflictmelding op. Een herhaalde aanvraag van dezelfde alliance is idempotent. Controleer rechten en membership opnieuw in dezelfde logische mutatie; vertrouw niet op een oude browserkopie.
4. Structuurbouw reserveert een globale coördinaat atomisch, inclusief wachtrij en bouwwerk in aanbouw. Gebruik een unieke occupancy-sleutel voor ieder objecttype, niet aparte planeten- en structuurtabellen die dezelfde coördinaat kunnen bezetten. Werk met conditionele writes/versies en een transactie of ondersteunde atomische batch. Een mislukte reservering mag geen geld afboeken.
5. Een claim of slot mag nooit stilzwijgend worden overgenomen op basis van het feit dat iemand inmiddels meer bewoners of een hogere score heeft. Leaderwissel verandert het alliance-ID en de galaxyclaim niet. Een echte claimoverdracht vereist bevoegde partijen of een afzonderlijk gemotiveerde staffbeslissing en auditlog.
## Structuurverlies, vertrek en alliancewissel
- **Laatste functionele structuur verloren:** markeer de claim als inactief en schakel alleen de daarvan afhankelijke bonussen uit. Laat haar niet onmiddellijk vrij voor een gelijktijdige vijandelijke aanvraag. Aanbevolen is eigendom behouden totdat de bevoegde leiding expliciet vrijgeeft of overdraagt; dat voorkomt een heimelijk conquest-mechanisme. Keerzijde: verlaten claims kunnen blijven bestaan. Een vervaltermijn of veroveringsmechaniek moet daarom later expliciet als aparte spelregel worden gekozen, met waarschuwing en hersteltermijn, niet als verborgen timer in deze migratie.
- **Bewoner wisselt alliance:** de planeet blijft op haar coördinaat; claim en structuren blijven bij de oorspronkelijke alliance. De speler verliest oude alliancebonussen en krijgt alleen nieuwe bonussen als de geldende voorwaarden dat toelaten. Reeds verstrekte items worden niet automatisch teruggevorderd; periodieke beloningen hebben een ledger om dubbel innen bij wisselen te voorkomen.
- **Alle eigen bewoners vertrokken:** markeer de claim als verlaten/inactief, behoud assets en eigendom tot expliciete afhandeling. Bewoners migreren niet automatisch mee met een nieuwe stronghold.
- **Vrijgave of stronghold verplaatsen:** blokkeer stilzwijgende vrijgave zolang structuren of reserveringen bestaan. Laat de leiding een expliciet plan kiezen: behouden onder gemarkeerde oude status, toegestane overdracht of afzonderlijk goedgekeurde verhuizing/afbraak. Geen automatische vernietiging. De uiteindelijke productregel moet bepalen of oude structuren na verhuizing nog mogen functioneren; aanbevolen is geen nieuwe bonussen buiten de actieve stronghold.
- **Alliance opgeheven:** archiveer de claim met haar assets als af te handelen nalatenschap; geef niet automatisch andermans planeet of structuur weg. Staff- of goedgekeurde herstelprocedure is nodig. Naamhergebruik mag geen eigendom herstellen zonder hetzelfde bevoegde alliance-ID.
## Bonussen en zichtbaarheid
Laat iedere berekening expliciet kijken naar speler → actuele alliance → actieve claim → juiste galaxy → functionele structuur en eventuele cooldown. De bestaande residentvoorwaarde voor de lokale strongholdbeloning blijft behouden. Bestaande alliancebrede effecten houden hun bestaande bereik; deze beleidskeuze mag ze niet allemaal ineens lokaal maken. Gebruik geen regel “iedereen in deze galaxy krijgt alle aanwezige bonussen”.
Toon in galaxyoverzicht en strongholdpaneel: eigenaar, claimstatus, bezetting/gereserveerde slots, eigenaar per structuur en de reden waarom een bonus wel/niet geldt. Bij conflict: duidelijk ‘betwist — geen nieuwe claim/bouw totdat opgelost’. Houd oude schade-, bouw-, kas- en bonuslogs beschikbaar. Laat spelers vóór een bevestiging weten welke bonussen stoppen; geen onzichtbare membershipwijzigingen.
## Bijzondere galaxy 1:1 en ghosts
Gewone galaxies behouden 1–10 spelers en 11–15 structuren. Alleen **1:1 wanneer zij daadwerkelijk een stronghold is**, krijgt volgens G-005: spelers 1–10, ghosts 11–15, structuren 16–20. Slot 15 is dus uitsluitend ghost binnen die uitzondering. G-004 reserveert de tribute op 1:1:11; deze reservering blijft beschermd, ook als die tribute nog niet geplaatst is.
De server bepaalt de toegestane slotklasse centraal. Een claim, alliancenaam of clientinstelling mag de bijzondere indeling niet naar andere galaxies kopiëren. Bestaande staffplaneten blijven staan; de gewone instroomblokkade voor 1:1 wordt niet door deze beleidsanalyse veranderd.
Schakel de bijzondere indeling niet heen en weer wanneer de laatste structuur verdwijnt. Wanneer 1:1 eenmaal geldig is omgezet en ghost/structuurobjecten bevat, moet een vrijgave een expliciete overgangscontrole krijgen. Bescherm die coördinaten tot een apart goedgekeurde conversie; nooit ghosts herschikken om een structuurslot vrij te maken.
## Bestaande conflicten veilig migreren
1. Maak een read-only inventaris en herstelbare snapshot van alle claims, alliance-IDs, bewoners, structuren, bouwreserveringen, globale coördinaten en bonusstatus. Geen winnaar afleiden uit onbetrouwbare JSON-volgorde of hoogste score.
2. Maak de nieuwe registers naast bestaande gegevens. Eenduidige claims worden gekoppeld aan hun bestaande stabiele alliance-ID; ontbrekende identiteit wordt onderzocht. Normaliseer galaxycoördinaten voordat unieke sleutels worden gecontroleerd.
3. Meerdere claims op dezelfde galaxy krijgen een **betwiste migratiestatus**. Bewaar alle assets en bestaande membership, blokkeer nieuwe claims/bouw/overdracht in dat conflict en toon het probleem. Bewaar bestaande aantoonbaar rechtmatige effecten volgens een vooraf vastgelegde overgangsregel; ken geen extra of dubbele bonussen toe. Als rechtmatigheid niet uit logs vaststaat, laat staff daarover een expliciete beslissing nemen vóór de nieuwe bonusregel actief wordt.
4. Een aantoonbare eerste rechtmatige claim kan richting geven, maar alleen volgens een vooraf goedgekeurde beslisregel. Anders laat betrokken leiding een regeling kiezen: één eigenaar met vrijwillige verhuizing, of expliciet tijdelijk legacy gedeeld gebruik. Een verhuizing behoudt asset-ID, eigenaar, niveau, schade, resterende bouwtijd en betaalde kosten; doelcoördinaten worden eerst gereserveerd. Geen willekeurige verwijdering, verplaatsing of kostenberekening.
5. Coördinaatbotsingen en reeds bezette bijzondere slots gaan naar een staff-herstelplan. Geen automatische massashift; vooral tribute/ghosts en staffplaneten zijn beschermd. Bewaar mapping en auditlog voor een hervatbare migratie.
6. Activeer unieke constraints pas als alle actieve rijen ermee verenigbaar zijn; legacy conflicten blijven apart opgeslagen en zichtbaar. Bij onopgelost conflict wordt de handhaving voor die galaxy niet half ingevoerd. Herhalen van de migratie verandert geen reeds toegewezen eigenaar of asset-ID.
## Controle vóór eventuele invoering
- Twee alliances claimen tegelijk: één claim; geen dubbele afboeking. Twee bouwtaken reserveren hetzelfde slot: één winnaar. Retries, stale versies, leaderwissel tijdens aanvraag en rollback werken.
- Leden/pending/buitenstaanders kunnen niet claimen via vervalste requests; na alliancewissel wordt een oude sessie opnieuw gecontroleerd. Alliance hernoemen behoudt ownership.
- Bewoners van verschillende alliances blijven in dezelfde galaxy zonder membershipverlies; uitsluitend juiste bonussen. Geen dubbel dagelijks item bij switch/retry; nul functionele structuren deactiveert alleen afhankelijke effecten.
- Laatste structuur vernietigd, laatste bewoner vertrokken, opheffing, vrijgave en verhuizing volgen hun expliciete toestand; geen gratis assetovername.
- Gewone galaxy weigert structuren 16–20. Bijzondere 1:1 weigert structuren 11–15, beschermt 1:1:11 en verplaatst geen bestaande objecten. Claimverlies schakelt de slotindeling niet destructief terug.
- Migratiefixtures: twee verschillende claims, dubbele slots, ontbrekend alliance-ID, rename, al gereserveerd bouwslot en half uitgevoerde migratie. Aantallen assets en memberships blijven gelijk; één herhaling veroorzaakt geen extra wijzigingen.
**Beslissing gevraagd aan de gebruiker vóór implementatie:** één eigenaar per galaxy (aanbevolen) of gedeelde strongholds; daarna de expliciete regels voor verlaten claims, verhuizing en betwiste bestaande bonussen. Dit rapport voert geen van deze keuzes uit. Er zijn geen Starfall-runtimetests uitgevoerd.

Some files were not shown because too many files have changed in this diff Show more