Fresh production baseline [skip ci]

This commit is contained in:
DuneRealms 2026-11-27 23:43:05 +00:00
commit 0a11a18274
29 changed files with 229644 additions and 0 deletions

View file

@ -0,0 +1,60 @@
# CP V2 — Agent Handover and Release Workflow
Updated: 2026-11-12. Source of truth: Forgejo `unimatrix/MC`.
Status must be checked live; do not assume this document means deployment succeeded.
## Non-negotiable rules
1. Preserve the live CP V1 at `https://cp.dunerealms.com/`. CP V2 is isolated at `https://cp.dunerealms.com/v2/` and must not replace V1.
2. Develop **one page at a time**, with reviewable commits per page. Current page: **Staff / Imperial Bureau → Citizens Registry** (`#bureau/user-management`). Next page only after this page is tested and accepted: **Imperial Permissions**.
3. Reuse actual V1 API contracts and artwork. Do not invent backend endpoints, claim unverified data is live, or enable untested destructive actions. Missing features get stable, responsive, static placeholders with clear integration status.
4. Design was accepted by the user. Preserve the approved dark forest-green/gold Alphastyle interface, V1 `sietch.webp` page banners, header/footer, compact balanced left/right menus, unique category/submenu icons and mobile layout.
5. **Preview after deployment must be the live `/v2/` staging route**, not GitHack. GitHack is historical design reference only.
6. User explicitly requests coding directly without Work mode. Avoid unnecessary repeated explanations.
7. Do not publish secrets, database credentials, temporary passwords or user data in screenshots, logs or previews.
## Repository locations
- CP server router: `website/control-panel/server.mjs`.
- Citizens API: `website/node/admin-registration.mjs`.
- V2 staged interface: `website/control-panel/public/cp-v2/index.html`.
- V2 citizen module: `website/control-panel/public/cp-v2/citizens-registry.mjs`.
- V1 frontend and styling: `website/control-panel/public/` (especially `panel.css`, `panel-layout.mjs`, `admin-registration.mjs`).
- Website CI/deploy: `.forgejo/workflows/web-deploy.yml`.
- CP V2 design-only PR: #202. Staff staging PR: #203 (merged 2026-11-12; verify status).
- Previous staging development branch: `feature/cp-v2-staff-citizens-api-20261112`.
- Historical GitHub design branch: `unimatrixgit/mcdune:preview/cp-v2-compact-unfolded-20261112`.
## Verified API contracts
`GET /api/admin/register-user`: existing V1 owner-authorized list of valid access ranks.
`POST /api/admin/register-user`: existing V1 owner-authorized registration; JSON `{username,email,ageBand,ranks}`, same-origin check, audited creation, first-login reset and one-time credentials. Never expose credentials after initial response.
`GET /api/admin/register-user?view=accounts&page=N`: newly added owner-authorized paginated listing. Returns `{accounts:[{id,username,displayName,primaryRank,createdAt}],page,pageSize,hasMore}`; page size 25.
`GET /api/auth/session`: existing session endpoint.
Owner checks occur server-side. V2 route is owner-restricted. Future per-role access must be implemented server-side before broadening access.
## Page-by-page engineering and release
1. Inspect V1 code and actual API contract, permission checks, database tables and current branch status.
2. Implement a **single page** in an isolated Forgejo branch, including UI, server routes, authorization, safe loading/empty/error states and meaningful tests.
3. Run `cd website && corepack pnpm install --frozen-lockfile && corepack pnpm build && corepack pnpm test`. Fix failures. Also run focused API/auth/security and UI tests. **Syntax-only checks are not enough to call a page complete.**
4. Review for V1 regressions, authentication bypass, unintended writes, missing audit, XSS and mobile issues. Preserve V1.
5. Open a PR to `main`; merge only after required checks pass and deployment is authorized. No force merge.
6. The Forgejo workflow `.forgejo/workflows/web-deploy.yml` triggers on `main` changes under `website/**`, runs Node 22, `pnpm build` and `pnpm test`, then SSHes the tested commit to the deployment process. **A development-branch commit does not deploy.**
7. Inspect the exact Actions run and deploy result. Test `https://cp.dunerealms.com/v2/` with a valid Owner session, then test API reads, forbidden access, pagination and registration in a controlled test account. Unauthenticated/unauthorized requests should be denied, not expose user data.
8. Verify V1 at `https://cp.dunerealms.com/` still works. Record commit, PR, CI run, deploy outcome and any blockers before moving to the next page.
9. If CI or deployment fails, fix on a new branch/commit; never claim the live URL works until verified. Do not bypass CI or overwrite V1.
## Current checkpoint (verify before resuming)
- PR #203: `https://www.dunerealms.com/git/unimatrix/MC/pulls/203`; merge accepted.
- Forgejo web CI run #33: `https://www.dunerealms.com/git/unimatrix/MC/actions/runs/33`. Last observed status: **running**; this is a snapshot, not a live assertion.
- Staging URL: `https://cp.dunerealms.com/v2/`. Previously returned Not Found before deployment. Do not call it live until verified.
- Citizens Registry frontend is mounted in staged V2 HTML and calls the new API; syntax and static route assertions passed. Full DB/browser/live checks were not yet established.
- If the URL is still Not Found after CI success, investigate the deployed server revision, the CP service restart and reverse-proxy path routing before modifying frontend design.
- User wants page-by-page live testing and a separate V2 link; next work remains Citizens Registry until it is functionally verified.
## Agent recovery checklist
Read this file, inspect PR #203 and Actions run #33, verify current `main` HEAD and deployed commit, inspect live `/v2/`, check V1 unaffected, run relevant tests, then continue the single active page. Report what was **actually** tested, not merely coded.

View file

@ -0,0 +1,65 @@
# CP V2 API integration
V2 is a new Alpha interface. Existing API contracts are reused; V1 browser modules are functional references and are not imported into V2. A feature without a verified API remains a visible placeholder. Do not add speculative endpoints or backend behavior to make a page appear complete.
## Available company contracts
The control-panel router maps `/api/companies/manage` to `website/node/company-admin.mjs`. Every request requires a website session. All operations require the existing `web.accounts.assign` permission; mutations also require the exact control-panel Origin. These contracts are present in the repository. Live availability still depends on deployment of the matching server revision.
| Operation | Request | Response and behavior | V2 integration |
| --- | --- | --- | --- |
| Account search | GET `?account=<username prefix>` | `accounts` with `id` and `username`; 3–32 valid username characters; up to 12 results | Explicit founder and CEO search and selection |
| Company registry | GET `?view=registry&page=<positive integer>` | `companies`, `page`, `hasMore`, verified `access`; 50 records per page | Registry, founder and CEO tables; company selection |
| Corporate audit | GET `?view=events&page=<positive integer>` | `events`, `page`, `hasMore`; company, action, actor and timestamp; raw event details excluded | Audit register and CEO appointment history |
| Register company | POST JSON with `action: register`, `slug`, `name`, `description`, `founderId` | Returns new `id` and pending status; transaction checks founder and writes company plus audit event | New Alpha registration form; explicit submission only |
| Appoint CEO | POST JSON with `action: appoint-ceo`, `companyId`, `ceoId` | Returns matching company and CEO IDs and `changed`; locks company and records event; unchanged appointment is idempotent | New Alpha CEO appointment form; explicit submission only |
Registration does not issue shares or move funds. CEO appointment does not grant website staff permissions. Handle 401 and 403 as an access failure, 400 as rejected input, 409 as a conflict and 503 as unavailable. Never retry an uncertain mutation automatically; refresh and verify the recorded state first.
## Company Directorate gaps
The existing company schema records founder and CEO only. It has no verified company-specific role, member grant or access-boundary API. Keep the Company permissions expansion as a placeholder and display the current operator's actual management permission separately. Do not synthesize corporate roles from website rank names.
Future integration needs scoped company membership and grants, explicit authorization rules, bounded reads, versioned mutations, an audit trail and tests for access denial and concurrent changes. Endpoint paths and permission names remain unassigned until the service is designed and approved.
## Corporate Administration gaps
Company registry and founder/CEO assignments use the available contracts above. Corporate settings have no verified read or update contract. Keep that tab as an Alpha placeholder.
Future integration needs a settings schema, company-scoped access checks, optimistic version checks, validation and audit events. Other officers must remain unavailable until an actual officer-assignment service exists. Do not present founder or CEO records as a complete officer hierarchy.
## Corporate Audit gaps
Registration and CEO changes can be read through the corporate event contract. Compliance reports, reporting exports and compliance verdicts have no verified service. Keep those modules as placeholders; an audit event alone is not a compliance result.
Future integration needs an authorized report schema, report scope and date bounds, provenance, safe export rules and tests. Choose endpoint paths only when that service exists. No page should claim that a report was generated or a company was approved without a confirmed backend result.
## Integration checks
- Keep new page modules independent of the legacy V1 DOM and global events.
- Use explicit API projections and text rendering; reject malformed response shapes.
- Clear stale data on failed refresh or permission loss.
- Check empty, loading, error, conflict and mobile states.
- Test writes against isolated fixtures; do not create companies or change CEOs in production as a UI test.
- Publish tested commits through CI and the existing autodeploy, then verify the active revision.
## Imperial Revenue
The existing `/api/bank/staff` GET contract supplies the shared treasury, its exact decimal-string balance, account number, `canManage` access flag and bounded ledger records. The new Alpha component displays the account, copies its number and provides statement search, incoming/outgoing filters and display sorting. Amounts are never converted to floating-point values. Records expose only the operator and counterparties supplied by the service; missing parties remain “Not recorded.”
No player/account override or query parameters are sent. Authentication, staff treasury permission and upstream access checks remain in the existing backend. The current service bounds its returned ledger; V2 does not claim to show all historical records.
Treasury allocations and staff-treasury transfers have no verified action on this contract. The V1 treasury transfer control was also unavailable. Keep the allocation tab as a documented placeholder, even when `canManage` is true. The separate managed-official-account transfer route is not a substitute for an authorized staff-treasury allocation service.
Future integration needs explicit source/beneficiary authorization, precise amount validation, a durable idempotent receipt, ledger/audit provenance, concurrency protection and authoritative backend confirmation. Define a route only when that service exists. Full-history paging or exports also require a scoped history contract; do not manufacture extra rows or totals.
## Claim Registry — unavailable staff service
The existing `/api/kits/orders` is personal and may include private redemption data. It is not a staff-wide claims API and must not be used as a substitute. The V2 Claim Registry deliberately performs no claim, code-redemption or fulfilment requests. Its three design tabs now support explicitly labelled in-memory sample records and workflow previews. They never submit claims, codes or delivery requests.
A later backend integration needs a separately authorised staff claim register with bounded pagination, explicit case scope, recipient references, original receipt and delivery references, statuses and timestamps. Read projections must omit reusable private redeem codes. Delivery checks and retry actions require their own permission checks, original idempotency keys and audit entries, and must confirm the upstream result before the UI claims success. Select concrete endpoints only when the service exists and can be tested. No claims or paid receipts were altered during this rebuild.
## Current rendering convention
New V2 page modules pass `shellHost: host` to `createCPV2Page`. This uses the single shell artwork banner and removes only that page's wrapper title/description duplicates. Older modules keep their current presentation until the owner-requested final style batch. Do not globally hide headings or restyle old pages during the functional rebuild.

View file

@ -0,0 +1,80 @@
# CP V2 owner-directed rollout
## Current instructions
- Complete Imperial Bureau first. Once it is complete and verified, replace V1 with V2; finish the remaining V2 workspaces afterward.
- Deliver batches of two or three related pages, with a commit link and a live preview URL after each verified publication.
- Reuse working V1 contracts, retaining current APIs and authorization. Recode where adapting is slower or less reliable.
- For every component, repair and verify its public counterpart in the same batch. Newsroom includes portal news; Tribunal includes the public ban list; citizen identity includes public passports; roster changes include Staff. Do not rebuild the entire portal separately before its component integrations work.
- Every page uses the approved Dev/Alpha template, artwork and compact tables with filtering, sorting, pagination and details. Preserve existing editorial content and account assignments.
- Forum, support and shop may reuse their native services. Verify login, permissions, embedded navigation and sizing; checkout needs its own verification.
- Prepare Alpha 1.0.1.0 after the CP milestone. At that point close obsolete pull requests while retaining history and preserving unfinished work.
- Server-root cleanup is requested: inventory and reversibly archive obsolete work files. Active services, credentials and rollback paths are protected. Forty inactive regular `.log` files older than seven days were reversibly archived after checking open file descriptors and service/cron/local-script references; manifest `/root/_work-archive/20261112/inactive-logs-manifest.json`. Remaining root contents have not been cleaned.
## Verified news recovery
PR 250 / merge `0b94f94aecbe83744ff565cbedc441e1debc0f05` published the new Newsroom interface and three Bureau service layouts. The latter explicitly distinguish connected catalogue reads from missing administrative services.
PR 252 / merge `7381bc88f60979786ec561af5bcb66b5f596ba31` restored editorial routing ahead of the legacy Discord feed and registered the existing Newsroom read/publish permission nodes. The owner account was already `owners`; its assignments were not modified.
Verified live: public news API returned 15 existing articles; signed-in Newsroom loaded the same 15 records with enabled editor controls; the portal displayed existing articles, original authors and forum links. No production article was created, edited or deleted for verification. CI passed before deployment; the prior application slot is retained for rollback.
## Work retained
Citizen Passport and Personal Records components are retained in the named local Git stash `Preserve owner-requested citizen passport and personal records until Bureau cutover batch`. They are not published or certified complete. Restore deliberately after the Bureau batch; do not discard this work.
PR #253 / merge `f7028d66ade93466dd503c09a62570dbdf6905d0` is live. Browser verification: Tribunal loaded 194 retained records with live/global source status; case details and confirmation-gated controls rendered; Evidence Registry loaded the selected case and authorised upload form. The public register displayed 186 records; portal rendered five news cards, three recent bans and three appeal decisions. No ban was removed and no evidence was submitted.
PR #254 / merge `afa90268bb2edb2fa7a9facfb58338b8cb9c6479` is live. Signed-in ticket desk, support administration and native forum workspace verified inside V2. The forum exact-origin sizing handshake reported 6,738 px and removed the internal scrollbar. Screenshot evidence is saved in the project `output/cp-v2-proof/` folder.
Deployment initially rolled back because curl returned HTTP/2 framing error 16 immediately after nginx reload. The root-owned promoter retains all public HTTP 200 checks and rollback, now retries transient transport errors twice and parses an exact final status marker separately from diagnostic output. After the fix, both releases passed public checks and were deployed with prior slots retained. Review/backups are in `/var/lib/dunerealms-ci-promote/`.
Next batch: Exchange Authority, native Merchant Directorate, public market pause handling and original-date moderation ordering. Local checks passed; publication/browser verification pending.
## News delivery recovery and Bureau continuation
- PR #256 / merge `ad5b54922939a547146491835ab48cc6fb5539f1`: the dedicated news-delivery service is active independently of blue/green web slots. Actual pending article `c0aec636-9b1b-4ee1-83e1-bbf3a123edd8` was delivered by the original outboxes: Discord message `1570530366366679194` and forum thread `19`. Discord message was independently retrieved; forum public-page verification was left to the owner. No synthetic announcement created.
- PR #257 / source `9e41eec3f8601a334b4a658684c868c922e4a4c0`: Campaign Directorate, embedded Network Command and public world-status route. Eight targeted tests passed; feature CI 99 passed. Merge `6eaa72a1c1e4c1e131b359c46e8ee692f8ffb643`; live verification pending at this checkpoint.
- Merchant Directorate verified signed in inside the CP frame. No production catalogue mutation performed.
- Static CP release was behind the API release; explicitly ran the approved publisher to synchronize `ad5b549`. New builds must be published only after matching CI/build completion.
- Exchange live verification exposed unaliased MySQL cast fields; PR #258 fixes the production query aliases with a real adapter regression test. Do not mark Exchange complete before the corrected live contract is verified.
## Verified Bureau follow-through
- Static and API release synchronized to PR #258 merge `a9566b22469b6dfa759d0f77abe85f3a2c3c97da`. Campaign editor showed Buried Thunder revision 1 with the saved key, description, schedule and hidden/enabled flags. No mutation submitted. Exchange listing register showed two actual prices, 21.01 and 1.00 DM.
- PR #259 source `d0b11c595ee6b1484b34acb02661f7080c127df9`, merge `a2fe71b4870b5ae26d35e97803d72ee3f64d4805`: Network operator configuration referenced the owner's obsolete username. Configured the same two existing accounts using immutable IDs, with username fallback only when no IDs are configured. Roles unchanged. Five targeted tests and feature/main CI passed. Approved blue/green rollout verified seven active game/network services in the embedded owner workspace; no console or power action submitted.
- PR #260 source `301f33727e983c4b10ca9396e5551ae370bee8b2`: new Kit Directorate/Publications editor supports the existing server-studio actions, preserving optimistic revisions and paid receipts. Three targeted contract tests, build and feature CI passed. Merged; live verification pending at this checkpoint.
## Owner migration decision — after V2 completion
Move the entire DuneRealms website/API/databases, Forgejo repositories and related services, runners, build workflow and SSH access from the old Debian/YouSMP host to the DuneRealms MC host. Establish a clean Forgejo installation and a clean V2 main, preserving prior Git/ticket/release history separately. Verify the migrated systems before cutover. Only after successful migration remove old DuneRealms installations and credentials; YouSMP, other projects and shared services stay intact. No migration or destructive reset is authorised for execution before V2 completion.
## Kit batch live verification
PR #260 merged as `b1030f20d2e2c32025227e12778a2ab70a8476e5`. Feature CI 105 and main CI 106 passed. Matching immutable API and static CP releases published. Verified both server-kits and kit-publishing entry points; saved Legendary Tavren II Aedrecht revision 2, published status, stored colour/lore and 2,000 DM price opened correctly. Confirmation button disabled without its checkbox. Live catalogue returned two actual products at 1,600 and 2,000 DM. No design save, publication, archive, redemption or purchase submitted. Screenshot evidence: output/cp-v2-proof/kit-editor-live-20261112.png and network-command-live-20261112.png in the project workspace. Bureau checklist now 19/25 completed; full V2 19/97.
## Community and item batch verified live
PR #261 source `713d132f90580b4cbb753131e7ad4d30578e8107`, merge `11b1f9c3ec8768329097c7a390082f97178016e0`. Feature CI 107 and main CI 108 passed. API and static CP releases match the merge. Item Registry returned eight authored definitions; item details showed artwork and retained lore. Unsigned catalogue requests return 401. Public armoury returns 200 and includes the item-catalogue script in source; public campaigns endpoint returns 200 with zero campaigns, matching the CP. Community owner management access and fixed-month goal form verified; confirmation unchecked and submission disabled. No production goal, verified total, reward release or financial operation submitted. Existing Imperial Revenue page also verified read-only: 100,000 DM and fourteen returned statement rows. Screenshots in project output/cp-v2-proof: item-register-live-20261112.png, community-treasury-live-20261112.png, imperial-revenue-live-20261112.png.
Checklist: 22/25 Imperial Bureau entries ready for the available Alpha contracts. Remaining: Claim Registry (no verified staff delivery API), Hosting Command and Development Approvals. Missing item definition/publication APIs remain explicit unavailable integrations; the completed item register does not imply authoring is live.
## Latest owner navigation and style direction
DuneForge now combines Dev Control and DuneGit as one workspace: Dev categories on the left, DuneGit on the right. Development Approvals leaves Imperial Bureau; its legacy Bureau hash redirects to DuneForge. Existing Dev overview stays unchanged on Support. Existing native Dev workflows and Git account/repository services are reused, with their own permission checks. Further engineering integrations retain explicit pending states. Owner confirmed rebuild order remains Bureau → My Realm/User → Imperial Post → Postbank → CHOAM → DuneForge; do not expand engineering work ahead of My Realm.
New pages use one artwork-banner title through the explicit shellHost template option. Keep old page styling unchanged until the final consolidated style pass, as requested by the owner. Do not run that old-page style migration now.
## Owner-approved design-only batch
All new, previously unimplemented menu pages are now authored design workbenches before further integration work. The V1 comparison script `website/scripts/audit-cp-v2-design.mjs` inventories 90 canonical menu entries: 36 new design pages, 31 preserved implemented adapters/pages, and 23 V1 integration entries to handle next. There are no uncovered new menus. The 36 specifications contain 118 feature tabs. Companies is one workbench with eight logical tabs instead of eight User links; nine old company hashes are retained as tab aliases across My Realm and CHOAM.
The design renderer supports local sample creation/editing/removal, review confirmation, search, sorting, status filters, paging, details, workflow-state previews, attachment metadata, sample charting and local JSON download. It has no network or persistent-storage calls. Every page carries a design-only notice; records are prefixed PREVIEW and are destroyed on navigation. No backend integration, accounts, mail, payments, offices, game state or private receipts are changed. All newly designed pages use the single-title artwork banner. Existing integrated page styles remain untouched until the final style batch.
The User Passport/Profile integration WIP was preserved in a named Git stash while this priority batch runs. Resume User/My Realm immediately after publication, then Imperial Post, Postbank, CHOAM and DuneForge. Owner will perform manual UI review; do not spend time on browser verification unless a concrete reported issue requires it. Continue automated build and deployment safeguards.

View file

@ -0,0 +1,42 @@
# CP V2 preview publication
The legacy promotion script exits before its PM2 restart steps because that path caused repeated public 502s. Leave that guard in place. A separate live rollout switched the control-panel upstream to an already running release process while this fallback was being prepared. Preserve that active rollout mechanism; the static-only alternative below is prepared and tested but is not the active public route.
## Verified rollout checkpoint
Revision `7cb0b29a8670eaac36138deb111677c2c879ea42` passed main CI and the website release builder. The live nginx control-panel upstream changed independently from port 3003 through 3103 to 3203, backed by separate immutable release processes. Concurrent-content guards prevented this work from overwriting that newer nginx configuration. The new V2 modules now return 401 for an unsigned request and the removed DuneGit module returns 404. Public website and V1 panel health remained available.
The additional `dunerealms-cpv2-preview.path` watcher created for this fallback was disabled and stopped after the active rollout was verified. Its nginx fragment was never included and no nginx reload was performed by this fallback. The approved static snapshot and source files are retained for recovery and review. Do not enable the alternative automatically or compete with the active publication path.
## Release flow
1. Code, local tests, review, commit and push.
2. Run the existing web CI on the feature branch. The main-only deployment step stays skipped.
3. Merge only the tested commit. Main CI and the existing release builder must pass.
4. The release builder records matching `built-commit` and `pending-commit` values and an immutable website artifact.
5. `dunerealms-cpv2-preview.path` watches the completed-build marker and runs the static publisher. It validates the revision, source paths, file types, size bounds, required files and local imports. DuneGit assets are rejected.
6. The publisher creates a root-owned immutable preview release, preserves the prior pointer and atomically switches only `/var/lib/dunerealms-cp-v2/current`.
The preview nginx location serves only `/v2/`. Its internal authorization subrequest goes directly to the existing panel's owner-protected stylesheet route on loopback port 3003, forwarding the existing session cookie. Guests receive 401 and non-owners receive 403. Other website, API and V1 routes are not redirected to a new application.
## One-time activation
After CI approval, install the reviewed publisher and unit files from the approved artifact. The publisher is `/usr/local/lib/dunerealms-publish-cpv2.mjs`; the matching `.service` and `.path` units belong in `/etc/systemd/system`. Create the root-owned preview state directory. Reload systemd's unit definitions, enable the new path watcher and run the new static publication unit once to consume the already completed build. None of these operations restart the application services.
Install `website/ops/cp-v2-preview.nginx.conf` as a root-owned include and add it only to the control-panel TLS server block. Preserve the prior config, validate the complete nginx configuration and use one graceful nginx reload after validation. Subsequent approved preview updates switch static files and require no reload.
Do not activate an untested nginx fragment or copy V2 assets directly into the active V1 release. Do not remove the legacy promotion guard. The publisher must not execute repository code, connect to a database, alter process-manager state or accept caller-selected revision paths.
## API availability
The static preview uses the currently running API service. A source contract in a newly built release is not proof that the live API has that route. Missing read views return an explicit integration placeholder. Existing company registration, account search and CEO appointment remain on their existing route and authorization policy. If company listing is not available, verified operators can still use a known company reference, matching the existing API contract.
Follow `CP-V2-API-INTEGRATION.md` for company contracts and missing roles, settings and reporting services. Do not activate new backend services merely to fill a placeholder.
## Validation and fallback
The publisher tests run in ordinary website CI. Linux exercises atomic links, immutable release verification and fallback preservation. The isolated nginx test runs as an unprivileged Linux user with temporary assets, a fixture-only authorization backend and separate high ports; it never changes the real nginx configuration.
After activation, verify the current manifest revision and source hashes, confirm the preview is still denied without a session, confirm new module paths are protected, confirm the DuneGit path stays unavailable and check the public website and V1 panel health. Compare the application process IDs before and after; publication must not change them.
For a static release rollback, atomically repoint `current` to the already retained `previous` release. No application restart is required. For a configuration rollback, restore the preserved nginx config, validate it and gracefully reload nginx. Keep prior releases for review and manual recovery.

View file

@ -0,0 +1,184 @@
# CP V2 rebuild checklist
Rebuild the control panel with newly authored V2 components, using V1 as a functional reference and retaining the approved V2 design. Imperial Bureau is first. DuneGit is excluded.
97 navigation entries are tracked: 22 completed and 75 remaining. A shared page appearing in two workspaces is tracked at both entry points so routing and permission checks are verified in each location.
## Completion rule
A finished page implements its available API-backed functionality in the approved Alpha design, with tested permissions and behavior. Missing API capabilities have explicit placeholders and integration notes. A placeholder does not claim a working feature. User-approved completed pages stay complete and are not reopened. Existing V1 UI code is not copied into V2.
For a missing API, prepare the contract and implementation separately. Keep the corresponding V2 module visibly unavailable until the API is usable and tested. For genuinely new V2 features with no V1 counterpart, retain explicit future-ready placeholder modules. Do not invent live records or enable incomplete actions.
## Current checkpoints
- Company Directorate read foundation: PR #244, merged as `344bfcdd624858bf4dafedb064e7bf711cc60fe5`.
- Bureau read-only batch and website-only release-test fix: PR #245, merged as `9dc2464bafced7e49e22a4f8a2509ba96eb750ce`.
- These checkpoints provide infrastructure and data reads; they do not certify full V1 functionality for every page.
## Imperial Bureau
### Citizens & Authority
- [x] **Citizens Registry** (`bureau/user-management`) — Finished, confirmed by the user. Preserve the existing V2 implementation.
- [x] **Imperial Permissions** (`bureau/permissions`) — Finished, confirmed by the user. Preserve the existing V2 implementation.
- [x] **Honours & Seals** (`bureau/manual-seals`) — Finished, confirmed by the user. Preserve the existing V2 implementation.
- [x] **Seal Generator · V2.1** (`bureau/seal-generator`) — Approved V2.1 placeholder page finished, confirmed by the user. Later generator functionality is separate future work.
- [x] **Company Directorate** (`bureau/company-management`) — Alpha remake complete: registry, search, founder/CEO account lookup, registration and CEO appointment use verified API contracts. Company-role extensions remain documented placeholders. Tested source rolled out as 7cb0b29; production mutations were not used for testing.
- [x] **Corporate Administration** (`bureau/company-management-v2`) — Alpha page complete for the available registry and founder/CEO read contracts. Missing corporate settings and additional officers remain placeholders documented in CP-V2-API-INTEGRATION.md.
- [x] **Corporate Audit** (`bureau/company-audit`) — Alpha audit register and CEO-change history complete for the available read contract. Compliance reporting remains a documented API-integration placeholder.
### Commerce & Kits
- [x] **Imperial Revenue** (`bureau/staff-bank`) — Existing Alpha overview and returned ledger verified live: 100,000 DM balance and 14 entries, with search/direction/sort controls. No bank mutation performed. Allocation controls remain explicitly unavailable without an API. PR #251 implementation; live verification 12 November.
- [x] **Kit Directorate** (`bureau/server-kits`) — New versioned server-studio editor, rarity register, colours/lore/piece names, draft/publication/withdraw/archive/restore operations and live catalogue. Contract tests validate all six operations against the production validator. Verified saved Legendary design revision 2 and price 2,000 DM; no live mutation submitted. PR #260.
- [x] **Kit Publications** (`bureau/kit-publishing`) — Same new server publication workspace verified through this entry point, showing the existing published Legendary revision. The existing API governs publication; separate immutable revision-history reporting has no API and is not invented. PR #260.
- [ ] **Claim Registry** (`bureau/kit-claims`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [x] **Exchange Authority** (`bureau/exchange-admin`) — Listing register with search/sort/pagination and permission-gated visibility controls. Live prices verified after fixing MySQL cast aliases: 21.01 and 1.00 DM. Public paused-market behavior tested; no live visibility toggle submitted. PRs #255/#258.
- [x] **Merchant Directorate** (`bureau/shop-admin`) — Native shop administration authenticated within the V2 frame; existing catalogue, order and payment controls retained. Verified live after synchronizing the approved static release. No catalogue or payment mutation submitted. PR #255.
- [x] **Item Registry** (`bureau/items`) — Permission-checked published catalogue, search/rarity filter, pagination and artwork/lore details. Eight real definitions verified live. Public armoury uses the same authored catalogue; its source integration restored. Definition editing and publication have no verified API and remain explicit unavailable tabs. PR #261.
### Community
- [x] **Imperial Newsroom** (`bureau/website-posts`) — New V2 editor and register on existing APIs; version-checked save, publish, archive and delete controls. Owner access and 15 existing articles verified live. Public portal news restored with original authors. PRs #250/#252/#253.
- [x] **Petition Office** (`bureau/staff-tickets`) — Existing native staff ticket desk integrated and verified signed in within V2; native workflow and records retained. PR #254.
- [x] **Tribunal** (`bureau/bans`) — Compact register, filters, case details, linked native appeals and confirmed-unban controls. Verified 194 live/retained records and case details; no production unban submitted. Public register restored. PR #253.
- [x] **Evidence Registry** (`bureau/ban-evidence`) — Scoped case selection, private retained history, downloads and existing idempotent evidence-upload API. Verified case linkage, permission-gated upload form and empty history; no production evidence submitted. PR #253.
- [x] **Forum Wardens** (`bureau/forum-admin`) — Existing native forum workspace integrated and verified within V2; exact-origin sizing handshake verified at 6,738 px without an inner scrollbar. PR #254.
- [x] **Campaign Directorate** (`bureau/quests-admin`) — V2 definition editor and encounter history on the existing quest engine API. Verified Buried Thunder revision 1 and its populated editor live. Optimistic revisions and explicit confirmation; no production quest mutation submitted. PR #257.
- [x] **Community Treasury** (`bureau/community-goals`) — Existing campaign creation and verified-total accounting rebuilt with explicit confirmation and permission checks. Live empty register and authorised fixed-goal form verified; no production goal, accounting total or reward release submitted. Public campaign endpoint verified. PR #261.
- [x] **Petition Administration** (`bureau/support-management`) — Existing native support administration integrated and verified signed in within V2. Native authorization remains authoritative. PR #254.
### Network
- [x] **Network Command** (`bureau/server-operations`) — Existing standalone server operator workspace embedded within V2. Seven live services and console controls verified for the owner; operator identities now survive username changes. Both explicit operator allowlist and original permissions remain enforced. No power or console mutation submitted. PRs #257/#259.
- [ ] **Hosting Command** (`bureau/hosting-control`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Development Approvals** (`bureau/dev-approvals`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
## My Realm
### Identity
- [ ] **My Identity** (`realm/game`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Personal Records** (`realm/site-profile`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Account Security** (`realm/security`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Discord Link** (`realm/discord-link`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **My Inventory** (`realm/planetary-inventory`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Communications
- [ ] **My Correspondence** (`realm/shared-inbox`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Petition Hall** (`realm/tickets`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Rewards & Seals** (`realm/rewards-codes`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Adventures
- [ ] **Contracts & Quests** (`realm/quests`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Clans & Alliances** (`realm/clans`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Imperial Tailor** (`realm/kits-exchange`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Order of the Crysknife** (`realm/crysknife`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Commerce
- [ ] **My Treasury** (`realm/personal-bank`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Transaction Ledger** (`realm/transactions`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Sales History** (`realm/sales-history`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Exchange Preferences** (`realm/exchange-settings`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Merchant Preferences** (`realm/shop-settings`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Companies
- [ ] **My Companies** (`realm/companies`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Company Registry** (`realm/company-directory`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Establish a Company** (`realm/company-registration`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Corporate Records** (`realm/company-profile`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Company Officers** (`realm/company-members`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Corporate Treasury** (`realm/company-finance`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Corporate Authority** (`realm/company-permissions`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Pending Petitions** (`realm/company-applications`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
## Imperial Post
### Correspondence
- [ ] **Incoming Dispatches** (`post/mail-inbox`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Compose Dispatch** (`post/mail-compose`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Sent Dispatches** (`post/mail-sent`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Draft Dispatches** (`post/mail-drafts`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Imperial Archives** (`post/mail-archive`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Discarded Dispatches** (`post/mail-trash`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Channels
- [ ] **Internal Dispatches** (`post/shared-inbox`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **External Mail** (`post/webmail`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Address Book** (`post/mail-contacts`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Correspondence Settings** (`post/mail-settings`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Postmaster Administration** (`post/mail-admin`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
## Imperial Postbank
### Accounts
- [ ] **Treasury Overview** (`bank/bank-overview`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **My Accounts** (`bank/personal-bank`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Transfer Solari** (`bank/bank-transfers`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Account Ledger** (`bank/bank-statements`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Transfer History** (`bank/bank-history`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Beneficiaries** (`bank/bank-beneficiaries`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Credit
- [ ] **Credit Applications** (`bank/loan-centre`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **My Loans** (`bank/bank-loans`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Credit Directorate** (`bank/loan-administration`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Administration
- [ ] **Bank Dashboard** (`bank/bank-dashboard`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Imperial Revenue** (`bank/staff-bank`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Corporate Accounts** (`bank/company-finance`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Treasury Audit** (`bank/bank-audit`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
## CHOAM Exchange
### Markets
- [ ] **Market Overview** (`market/stock-overview`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Listed Enterprises** (`market/stock-listings`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Market Prices** (`market/stock-quotes`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **My Holdings** (`market/stock-portfolio`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Trading Floor** (`market/stock-orders`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Trade Ledger** (`market/stock-trades`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Watchlist** (`market/stock-watchlist`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Enterprises
- [ ] **My Companies** (`market/companies`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Company Registry** (`market/company-directory`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Corporate Profiles** (`market/company-profile`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Listing Applications** (`market/stock-ipo`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Dividends** (`market/stock-dividends`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Oversight
- [ ] **Market Authority** (`market/stock-admin`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Market Surveillance** (`market/stock-surveillance`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
## DuneForge
### Development
- [ ] **Forge Overview** (`forge/dev-panel`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Work Orders** (`forge/dev-queue`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Review Chamber** (`forge/dev-approvals`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Submit Blueprint** (`forge/dev-new`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Forge Archives** (`forge/dev-archive`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
### Engineering
- [ ] **Build & CI Monitor** (`forge/dev-builds`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Release Ledger** (`forge/dev-releases`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **API Reference** (`forge/dev-api`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.
- [ ] **Change Audit** (`forge/dev-audit`) — To do: assess V1 behavior, build new V2 components, connect or prepare APIs, test and publish.

View file

@ -0,0 +1,67 @@
# Netherite kit atelier
The v3 designer uses one bounded equipment contract for personal, clan, office,
faction and server kits. Every armour piece carries a netherite material, literal
name, up to six structured lore lines and a vanilla trim pattern/material. An
optional banner carries its base colour, up to six ordered pattern layers and
its own name and lore. Text components do not accept commands, click events,
HTML or arbitrary Minecraft component data. Blank lore lines are preserved;
colour, bold and italic are explicit.
Website validation lives in `control-panel/public/kit-design-model.mjs`. The
private game bridge uses `network/server-control/kit_equipment.py` and the
checked-in matching contract and cross-language fixtures.
Versioned equipment is saved in the same transaction as its blueprint revision
and audit entry. Updating a current design must never rewrite a paid order's
`snapshot_json`. Existing receipts retain the original purchased contract.
The rotatable browser preview uses the Minecraft 1.21.4 netherite, trim palette
and banner textures. The exact official client URL and Mojang SHA-1 are recorded
in `web/assets/kit-textures/source.json`. Only the small required PNGs are kept;
the downloaded client archive was removed. Minecraft textures are copyright
Mojang Studios; this is an independent fan project.
## Migration dependency corrected
The private bridge at 2.28.33.142 previously connected gameplay SQL to the old
website host. Its kit routines join the `website` schema, so removing that schema
broke the catalogue even though the main website was healthy. The gameplay
connection now uses a separate SSH forward at local port 13308 to 91.107.196.242.
The current 41 gameplay tables / 661 rows were copied during a brief pause of
the private control service and savings timer. Both services were resumed; the
catalogue was checked successfully against current website publications.
The LuckPerms connection remains on its existing separate port 13307. Do not
remove that tunnel or its database as part of website-file cleanup. No website
account, balance, receipt or current publication was restored from an older
website backup to make this correction.
Native bridge modules captured here originate from the running private bridge.
Their configuration and credentials are not part of the repository. Install
the v3 bridge and verify native item delivery before publishing the new editor
or changing live kit revisions. The previous Alpha 1.0.0.5 handoff's plugin
deferral described that older task; this rebuild includes the requested native
item implementation and its verification.
## Active inventory and activation
The active lobby runs DuneCore 1.0.27-layout1-jobs1 with MySQL inventory.
Its game worlds share that process. The inactive Arrakis directory has a
PostgreSQL configuration; it must not be mistaken for the active inventory.
For MySQL, DuneKits locks the paid, requested, buyer-bound `dune_kit_sales` row
and commits its delivery acknowledgement inside DuneCore's inventory transaction.
The PostgreSQL dispatcher service is **not enabled** for this deployment: running
both delivery paths against independent inventory databases could duplicate kits.
Its prepared configuration and additive outbox schema remain unused.
The lobby's existing private database credentials also match the gameplay bridge.
Before moving its connection from port 13307 to 13308, stop the empty lobby,
compare all gameplay tables, preserve any quest event delta and newer quest
schedule in a transaction, and retain a backup on the new mounted volume.
LuckPerms continues using its separate existing tunnel at port 13307.
Apply `scripts/remake-current-kits.mjs --apply` only after native delivery is
active. It locks current revisions, backs up the affected designs, adds distinct
rarity/faction heraldry, increments publication versions, and audits each change.
It preserves existing v3 edits and never updates paid receipt snapshots.

View file

@ -0,0 +1,38 @@
# Kit Exchange: website-to-game integration handoff
**Scope:** Alpha 1.0.0.5 / Task 09. Website, control panel, and gateway preparation only. **Do not change, build, publish or deploy Minecraft plugins as part of this work.** In-game implementation is deferred to the next game update.
## Existing routes (preserve these contracts)
| Consumer | Method | CP path | Native path | Notes |
| --- | --- | --- | --- | --- |
| CP market | GET | `/api/kits/catalogue` | `/kits/catalogue` | Public catalogue; no identity query override |
| Linked player | GET | `/api/kits/arc` | `/kits/arc?uuid=<linked UUID>` | Linked UUID comes from DB, not browser |
| Linked player | GET | `/api/kits/orders` | `/kits/orders?uuid=<linked UUID>` | Response identity must match linked UUID |
| Linked player | POST | `/api/kits/redeem` | `/kits/redeem` | `{uuid,code}`; server-side UUID injection |
| Linked player | POST | `/api/kits/arc/claim` | `/kits/arc/claim` | `{uuid,index}`; chapter 0–4 |
| Linked buyer | POST | `/api/kits/cart/checkout` | `/kits/cart/checkout` | `{buyerUuid,cartId,lines}`; validate versions/prices |
| Kit studio | GET/POST | `/api/kits/studio` | Native `/kits/arc` and `/kits/player` lookups | Workshop and publishing actions; DB-backed |
| Protected network studio | GET/POST | `/api/kits/server-studio` | Native `/kits/arc` and `/kits/player` lookups | Protected rank and registered owner required |
The website's read-token-protected catalogue bridge is `/internal/kits/catalogue`, which obtains native `/kits/catalogue` and applies the `kit-policy-v2-publish-enabled` setting. The public market uses the internal catalogue bridge. **Do not expose native bearer tokens in browser code.**
## Rollout gates and safe behavior
- `kit-policy-v2-publish-enabled` controls non-personal kit purchases and publishing availability. Keep it **disabled** until the next game update implements and verifies the full in-game delivery path. Existing personal-sale behavior is deliberately unchanged.
- `kit-legendary-upgrade-delivery-ready` is independent; do not enable until upgrade delivery is verified.
- Website preparation must not grant items, mark orders fulfilled, invent receipts, or treat a successful CP request as proof of in-game delivery.
- Existing CP authorization, origin checks, linked UUID binding, JSON-only writes, and native service authentication remain mandatory.
- Verify end-to-end ordering, one-time redemption, retry/idempotency, delivery after disconnect, duplicate claims, refunds/failures and account unlink/relink behavior **after** the plugin update, before enabling the gate.
## Next game-update integration checklist
1. Implement/verify native endpoints listed above with the same request and response identity semantics.
2. Persist purchase orders and claim state transactionally; preserve receipts across retries and restarts.
3. Connect in-game claim UI to the native order/redeem path; do not let clients choose a different UUID.
4. Exercise staging purchases and claims with Java and Bedrock clients, including reconnect/restart and insufficient balance.
5. Enable the publish/delivery gate only after staged verification and an authorized release decision.
## Verification in this branch
Run `node --test website/tests/kit-market-identity.test.mjs website/tests/kit-studio-fetch-policy.test.mjs website/tests/kit-ingame-contract.test.mjs`. These are website/gateway checks, **not** Minecraft plugin or live-delivery tests.

View file

@ -0,0 +1,9 @@
# Editorial delivery worker
The public/CP API rebuild retained article persistence and the existing delivery modules but no longer started either news worker. New publications therefore existed in `website_posts` without a corresponding Discord or forum queue row.
Run the existing Discord and forum outboxes from one dedicated service, independently of blue/green web candidates. `website/ops/news-delivery-worker.mjs` loads the active release's existing database adapter and delivery modules. Install it root-owned as `/usr/local/lib/dunerealms-news-delivery.mjs` with the matching `dunerealms-news-delivery.service` unit. It runs as the existing `dunerealms` service identity, reads the existing private environment/configuration and requires no new webhook or role grant.
The worker starts both existing outboxes, serialises its own passes, keeps running between publications and waits for an active pass before closing the database. Existing claims, Discord baseline markers, message IDs, forum source markers, revision hashes and uncertain states remain authoritative. It never resets sent/baseline/uncertain records to resend old announcements. Drafts and future articles remain excluded by the original modules.
After installation, verify the unit is active and inspect the newest published article's `discord_news_delivery` and `forum_news_delivery` rows. Claim Discord success only after a confirmed message ID and forum success only after a confirmed topic ID/source revision. Do not send a synthetic announcement to test the integration. Restart this dedicated unit when changing delivery modules; do not start additional senders inside each web slot.

View file

@ -0,0 +1,44 @@
# Campaign backend
The existing War Exchange, calendar, native bridge and system parent-link
consumer support clan (2 × 8), world (2 × 16), universal (3 × 86) and religious
(3 × 86) campaigns. No new game tunnel or command execution endpoint is added.
Political sides require current occupied Royal offices, verified Minecraft
identities and registered physical Home Blocks. Coalition partners each approve
their own agreement. Changing an alliance or roster clears all calendar choices.
All named sides must choose the same future hour. Overlapping players and Home
Blocks cannot be deployed in another simultaneous campaign.
Universal conflicts place the Empire first. Religious conflicts place Guild,
Church, independent world in that order; the Emperor joins the Guild. The Emperor
may join a world campaign on either side with mutual consent, substituting its
Home Block for that side's principal province. Clan wars exclude intervention.
The universal/religious Imperial finale is hidden and immune until a challenger
owns every other province, then stays revealed through counterattacks.
Original clan ownership, primary membership and nested client links are retained.
Completed conquest consumes one existing system parent-link instrument. Political
victory reparents losing clan mothers, not every child. Imperial defeat additionally
transfers the remaining current office term to the winning political controller
and retains the former Emperor's personal mother estates under the Imperial
institution. Expiry of an old military affiliation cannot undo a conquest edge.
No balances, payroll or historical election results are rewritten.
POL campaign-service missions use the existing quest and Reputation engine:
enrolment in an agreed campaign at its start (150 base XP), a native capture
(200), and a capture for the winning side with consumed victory settlement (250).
The separate v5 policy preserves existing configured rewards and season dates.
Claims re-read the original evidence; private generic game activity submissions
cannot assert war progress. Existing Mentat/faith modifiers still apply. There
is no automatic DM award for opening proposals, calendar choices or invitations.
POL mission panels use the real journal with office artwork. War decisions open
the authenticated War Exchange controller. Existing proclamation, honour, passage
and faith consumers retain their authority, funding and cooldowns. Other proposed
intelligence, sabotage and cargo-contract mechanics remain explicitly unavailable
until their actual domain consumers exist; this release does not fabricate them.
Deployment requires `WAR_BRIDGE_ENABLED=true` and the existing generic native
campaign consumer. An unregistered office Home Block is a prerequisite failure,
not grounds to invent a location or start a demonstration war in production.

View file

@ -0,0 +1,29 @@
# PR #198 — Canonical DuneRealms API/Security/Ranks Baseline
## Baseline gate (not active yet)
The canonical baseline is the **merge commit on main** of PR #198, `API - Security - Ranks`, only after full tests and production verification. Do not tag the unmerged PR head or substitute an older bank/permissions branch. Record the exact merge SHA, release date, test report and approved migration mode in the release record.
## Post-merge backup procedure
1. Verify PR #198 merged into `main`, confirm CI and smoke tests pass and document any known limitations.
2. Capture the exact `main` merge commit SHA; create annotated, protected tag `baseline/api-security-ranks-198` pointing to that SHA.
3. Create protected recovery branch `recovery/api-security-ranks-198` at the same SHA. Never rewrite or force-push this branch.
4. Produce a full Git mirror bundle (`git bundle create dunerealms-api-security-ranks-198.bundle --all`) from a fully fetched repository clone, and verify with `git bundle verify` and a test clone.
5. Store the verified bundle outside the production host, with a SHA-256 checksum, encrypted access controls and a recorded retention policy. Keep a second independent copy.
6. Back up the production SQL database separately with a consistent transaction snapshot and encrypted storage; validate a restore on an isolated database. Git backups do not contain database data, secrets, or live inventories.
7. Record recovery instructions and the tag/branch/bundle/checksum locations in an operator-only runbook; do not commit backup credentials or database exports.
8. Protect `main` and the baseline references; future feature branches start from the latest approved `main` descendant of this baseline. Never reset `main` to the baseline as part of routine development.
## Guardrails
- Merging PR #198 does **not** automatically activate shadow staff hierarchy migration. Owner must explicitly approve the account mappings and authorization activation.
- Archive obsolete PRs and branches only after confirming that unique work is preserved and the baseline backup is verified.
- If tests, database restore or bundle verification fail, keep PR #198 unmerged or postpone the baseline declaration until corrected.
- Never delete `main`, the baseline tag, recovery branch, or historical backups during cleanup.
## Completion checklist
- [ ] PR #198 merged and exact SHA recorded
- [ ] Full CI and live API smoke tests passed
- [ ] Protected tag and recovery branch created at merge SHA
- [ ] Git bundle verified and stored in two independent locations
- [ ] SQL backup restored successfully in isolated environment
- [ ] Recovery runbook and checksums recorded
- [ ] Baseline formally approved for future development

View file

@ -0,0 +1,19 @@
# DuneRealms heraldic ring seal generator
## Authoritative style
Create **one isolated circular heraldic signet seal**, not a gaming medal, poster, hexagonal badge or collection sheet. Engraved outer ring with precise readable DUNEREALMS and requested title, deep enamel center, medieval heraldic relief, metallic rim, laurel and sand motifs. Colorful Minecraft-like voxel geometry integrated with Dune-inspired desert, spice, moons and sandworm motifs. Strong contrast at 150 px. Transparent background. No rectangular banner outside the ring. Do not copy movie logos or franchise marks.
## Reusable image-generation prompt
> Create a single square, transparent-background, high-resolution circular heraldic signet ring seal for the DuneRealms Minecraft network. Seal key: {KEY}. Exact outer-ring inscription: {TITLE}. Exact owner username (if personal): {USERNAME}. Exact verified current staff position (if personal): {POSITION}. Central emblem: {EMBLEM}. Enamel palette: {COLORS}. Sculpted gold/bronze/silver outer ring, engraved legible lettering, crisp geometric Minecraft-style emblem, Arrakis-like sand and spice details, noble Dune-inspired heraldry, premium relief engraving. No extra names, no invented ranks, no poster, no background, no unrelated symbols. The complete ring must be visible, centered, and readable at small sizes.
## Required variants
Export PNG at 150, 300 and 600 px, and a high-resolution source. Preserve existing filename keys and recognition IDs. Use exact account names, current verified positions and canonical lore house names from the repository. Do not guess personal names or award eligibility. For personal seals archive previous positions instead of overwriting history.
## Crysknife exception
The Order of the Crysknife is a rare ceremonial seal: dramatic glowing sapphire enamel, crystalline crysknife, sandworm engraving, complex golden filigree, exceptional depth and intricate relief, but **still a circular ring seal**. It is never included in the generic DuneRealms showcase and is not granted by shop purchases.
## Entitlement safety
Art generation never grants a badge. Shop seals are granted only on verified completed payment and keyed idempotently to the purchase, with auditable reversal on refund/chargeback. Staff-managed awards require an authorized CP actor and audit trail. Keep existing grants, historical purchases, and award rules when migrating. Never grant someone else's personal seal.
## Approval and rollout
The visual style was approved in conversation; individual generated outputs require inspection for correct spelling, cropping, and size before replacing production assets. Do not treat a multi-seal concept sheet as production-ready individual files.

View file

@ -0,0 +1,22 @@
# Staff client products
Operations Dashboard → Clients & Accounts → View → Client product management.
Bank staff inspect current products, change eligible packages, and configure
Balance Guard using the same service rules as the customer workspace. A reason
and confirmation are required. Every write retains the actual staff authoriser;
retries bind that reason to the original request. Customer history, account
numbers and funds are retained. The adapter grants no payment capability to the
ordinary customer API.
`web.bank.staff.clients` permits customer, company and clan product edits.
Official house, political office and staff accounts require existing bank
management authority. Read-only bank staff remain read only. Current permissions
and session identity are checked again within the domain transaction.
Deployment: `scripts/enable-bank-client-management.mjs --actor=<pinned actor>`
plans a single additive Sales Officer policy change. Use `--apply` to apply it
after publication. Existing custom policy nodes are retained. Leads inherit the
Officer policy; bank managers already have access. No balances or products are
changed by this deployment script.
This batch does not activate automated fees, protection, payroll or compensation.

View file

@ -0,0 +1,31 @@
# Central Scheduler
The central scheduler replaces the bank ticker name and runs registered tasks
under durable database leases. Current tasks are four-hour Brussels bank/credit
settlement, private credit-review ticket synchronisation, statement indexing and
statement generation. Future payroll and tax jobs join this registry.
Operations Dashboard exposes **Run Central Scheduler** only to pinned Big Four
control identities (including the verified owner alias and exempt Dev operator).
It runs due slots only. The endpoint accepts no clock, cutoff or force override.
Manual runs are audited under the actual actor. Already completed or currently
leased slots are skipped; failures retain a retry state. Domain financial jobs
retain their own account locks, idempotency keys, audit and posting transactions.
Non-grant credit applications create a durable Support job in the application
transaction. The existing osTicket intake API creates a private Sales review
ticket bound to the applicant and application ID. Bank decisions remain in Credit
Management. Grants create no manual review ticket. Support failures do not undo
an application or move money. A completed/withdrawn review closes its ticket; an
unreviewed application reopens a prematurely closed review ticket.
Install the custom CLI adapter with install-bank-credit-support.py --apply after
CI-approved publication. link-pending-credit-support.mjs plans by default; an
explicit --apply --actor=UUID links existing submitted non-grant applications.
Native idempotency mapping and an advisory lock prevent duplicate tickets after
retries. An interrupted creation with an ambiguous native result stops for review
rather than creating another ticket. No native core code is replaced.
## Manual recheck of all bank tickers
The owner-authorized Run Due Scheduled Tasks action rechecks every registered bank ticker, including the bank settlement ticker's loan engine. It also invokes credit support, standing instructions, monthly payroll, tariff publication and statement workers. A completed scheduler slot does not suppress a manual recheck, but an active lease still does. The original cutoff is passed to each worker; payment dates, four-hour settlements, maturity dates and domain idempotency remain authoritative. Intent is audited before workers start, and authority is checked again between tickers. Additional wage cycles are never triggered by this scheduler action.

View file

@ -0,0 +1,24 @@
# Clans, Realms and emblems
Clans are non-noble player houses focused on combat/PvP roleplay. Their selected
homeworld determines Realm affiliation: Kaladam/Aerdrecht, Giedermark/Harkveen,
Kaiterhof/Korenholt, Sigmadraken IV/Oordwijk, Arrakduin/Vrijduin. No selection
means unassigned. Affiliation itself does not grant political office or staff
permissions. Companies are the economic-roleplay grouping beneath Vaerkring;
covert operations are a future gameplay feature, not enabled by this batch.
The linked clan owner can upload, replace or remove an emblem on the clan
management page. Accept still PNG/JPEG/WebP up to 2 MB and 4 million pixels.
The server decodes and re-encodes to a metadata-free WebP bounded to 512 pixels.
Current ownership, link and image version are checked within the transaction.
Changes are audited. Missing clan/emblem uses the neutral clan placeholder.
One central image endpoint supplies clan cards, citizen profiles and the area
below forum avatars. Forum output is a custom adapter, not a MyBB core patch.
Public image reads deliberately reveal only the emblem, not member identity,
email or UUID. Replacements propagate through the same endpoint.
After publication, apply `scripts/install-clan-emblems.py --apply` for the custom
forum adapter. `scripts/set-unimatrix-clan-emblem.mjs` plans the explicitly
requested pinned owner/clan artwork; `--apply` installs it using the same
ownership/version/write handler. It refuses to replace an existing owner upload.

View file

@ -0,0 +1,19 @@
# Central directory console
Imperial Bureau uses one account registry with Users and Staff views, a dashboard,
and a department/team tree. Existing account creation, assignment, permission and
audit services remain authoritative. The tree reuses Wunderbaum 0.15.0 (MIT),
upstream commit 905d65471e19f8dee8acc0504738b4a947870e9f. The bundled ESM and CSS
retain upstream copyright notices; the complete license is in
`wunderbaum-LICENSE.txt`. This is a web directory console, not Windows AD or LDAP.
The immutable person number is `DR-0001`, etc. Number 0001 is reserved for the
pinned primary owner account. Users retain their number when appointed to staff,
promoted, moved between teams, renamed or removed from staff. Numbers never grant
permissions. Official alternate identities and technical service exemptions do
not receive a second person number.
Registration and sign-in provision missing numbers. Staff appointment provisions
a missing number in the same transaction as the appointment. Existing human
accounts are backfilled by `scripts/rollout-directory-numbers.mjs --actor=UUID
--apply`; without `--apply` it only previews the number of eligible accounts.

View file

@ -0,0 +1,145 @@
# Alpha 1.0.0.7 — The Great Migration
## Batch 1: central directory and contextual account views
The existing CP account tool mixes staff access, user memberships and recognition.
The new directory separates Users and Staff while keeping one underlying account.
Review URL after this batch is deployed:
`https://cp.dunerealms.com/?migration=1#bureau/user-management`.
The regular URL continues to use the existing editor during this incremental batch.
Included:
- Central organisation vocabulary: two departments, nine branches, contextual roles.
- Additive `org_assignments` storage, indexed by account and scope.
- Read-only `/api/admin/citizens`, `/catalogue`, and `/:accountId` endpoints.
- Server-side whole-directory search by account name, Minecraft name/UUID or ID,
contextual staff filtering and 25-record pagination with an extra sentinel row.
- Users, Manage User and Manage Staff views. User responses exclude staff scopes
and staff provenance. Staff views retain imported source identity for review.
- Existing account administration and all live permissions remain unchanged.
Not claimed complete in batch 1: assignment writes, permission activation/projection,
native integration migration, the recognition editor and the audit timeline. Existing memberships have not
yet been imported into `org_assignments`; an empty new-model list is not a claim
that the citizen has no memberships in existing systems.
Validation: contextual disclosure, authentication and authorisation denials,
SQL parameterisation/literal wildcard search, filter validation, schema no-grant
behaviour, and pagination are covered by executable tests. No financial actions,
player identities or live staff appointments are changed by this batch.
## Migration rules
Reuse the existing API, database adapter and integration adapters. Do not rewrite
osTicket, MyBB or LuckPerms. Human ranks lose native user/group/permission editing
capabilities; those writes originate centrally. Do not remove or lock the native
modules. Dev retains existing service access, separate from the human organigram.
Official bank account management is reserved for the Big Four and Department Heads.
Existing system-account restrictions remain. Staff ranks contain explicit job
nodes, without wildcard or OP grants. Assignments may overlap and expire; their
derived rights/seals must follow their lifecycle. Earned honours remain intact.
## Subsequent batches
1. Contextual assignment editor, audited changes and central policy matrix.
2. Map current rights to the approved hierarchy and existing native adapters;
synchronisation/revocation, visible failures and retry.
3. Recognition, personal and function seals, signatures across connected systems.
4. Public staff organigram + ordered bio cards; separate Crysknife Order gallery.
5. Full public profile template preserving current features; verified Bedrock-name
normalisation; Picard memorial restyle/link and Big-Four-only Deceased workflow.
6. Access/lifecycle/privacy verification, release and combined .6/.7 announcement.
Do not change the public version banner or publish release news before .7 is done.
## Personal and function seal batch
The current organisation catalogue supplies eleven department/branch seals and
eleven new personal seals, alongside three existing Staff personal seals. Big
Four artwork carries the fixed CEO/CTO/COO/CCO title; other personal seals say
Staff. The official account has no personal seal. The public organigram, staff
cards, profiles and managed native signatures follow current appointments;
earned service awards retain their existing eligibility and artwork.
Raster originals, prompts and catalogue live in artwork/seals/great-migration.
package-migration-seals.py creates alpha-preserving 150/300px delivery images.
install-migration-seals.py plans by default; --apply installs custom adapters,
merges the historical manifest and copies native delivery images. It does not
alter native application core files. Run native seal/profile reconciliation
after deployment. The native avatar allowlist now accepts the central face
endpoint while retaining its fixed origin and UUID-only path restriction.
## Recognition and remembrance
The directory recognition tab shows current seals and earned awards, with
manual grant/revoke controls backed by the existing entitlement ledger. Automatic
and purchased recognition stays managed at its source; self-awards are blocked.
Native signatures read active entitlements and manual changes queue the existing
synchronisation flow. Support cards use the new branch artwork.
The Account tab exposes remembrance status only to pinned Big Four principals
(and the exempt Dev operator), including the verified owner alias. Changing it
requires an exact username confirmation, reason and current version. Status,
memorial creation and audit commit together. A repeated notification creates no
duplicate page. Corrections hide the page while retaining history. This metadata
does not change login access, linked identity, ranks or bank records. Existing
community tribute content is preserved; no real-life death status is inferred.
Citizen details read earned tiers, house/office/path/Order ranks and current clan
membership from the existing registers. They do not expose staff functions in the
User view or copy membership authority into the staff register. Legacy User/VIP
permission lists cannot retain staff powers through cp.* aliases, native forum
administration, job ticket nodes, item issuance or lobby administration.
## Batch 2: audited assignment editor and policy preparation
Staff assignments can be recorded and revoked within the manager's scope. One
lead per branch/department is enforced under a shared scope lock. A scope version
prevents stale forms from overwriting another manager's work. Automatic records
must be changed at their source. Service accounts stay outside human appointments.
The permission matrix at `?migration=1#bureau/permissions` maps registered existing
nodes to each function. It rejects wildcard/OP/native-editor nodes and official
bank management on ordinary branch roles. Policy writes and assignments share
atomic audit and version checks. These are preparatory records: they do not yet
replace live roles. No native backend code is rewritten.
An explicit operator-run `scripts/bootstrap-organisation-control.mjs --apply`
pins the existing Big Four and Dev service by account ID for management authority.
It is idempotent, checks the established Owner/Dev identities, refuses conflicting
existing principals and does not run at application startup. Its audit clearly
states that it does not activate live permission projection.
## Additional Owner-approved bank work
After the current management batch, add a staff Client Management context reusing
Accounts & Payments components without generic Wire Transfers.
Add immediate Service Compensation from Payment Control, linked to the original
posted payment, with reason, consent, actual actor and a distinct purple type
badge in staff/customer histories and statements. Recover funds from the original
recipient when possible; otherwise the bank bears the cost. Never erase the
original payment or compensate its value more than once across retries/partials.
The shared budget is the available balance of a dedicated Compensation Reserve.
A monthly standing instruction funds it from Website Bank Treasury, initially
25,000 DM; unspent funds roll forward. Big Four and the bank CEO may change that
standing instruction and transfer reserve funds in/out through Treasury Accounts.
No extra Officer cap/counter, CEO override system, support ticket, approval flow,
or four-hour compensation queue. Reuse existing posting/audit infrastructure.
Cash conversion is reserved for the future in-game GUI + central API in both
directions. No cash web page, redeem code flow or game changes in this batch.
Effective-access preview: GET /api/admin/organisation/effective?userId=UUID requires web.ranks.manage and computes explicit new-model grants with provenance. Branch Leads inherit their own Officer policy. Missing policies and blocked unsafe grants are reported. Staff Directory has an Access preview tab; User context does not. Payroll requires a pinned Big Four control principal (Dev service exception), never an Executive title alone. No live rank mutation or native projection is activated by this endpoint.
Default policies now enumerate 22 function mappings (nine branches with Officer/Lead, two Department Heads, Owner/Executive). Native permission editors are excluded for humans; official bank management remains departmental/executive, payroll requires pinned control identity. bootstrap-organisation-policies.mjs defaults to a plan; explicit --apply --actor=UUID requires an active control principal, retains existing policies, versions each scope and audits inserts atomically. It stores preparation data only, with no legacy rank replacement, user appointments or native group projection.
Runtime integration: ORGANISATION_ACCESS_ENABLED=true opts the central database adapter into fresh, read-snapshot organisation access. The default remains disabled. Enabled accessFor replaces legacy staff/owner bypass with new explicit policies, preserves ordinary/VIP/Order membership, and keeps only the pinned exempt Dev service on its existing access path. Invalid policy data fails closed, never falls back to old admin grants. This switch must not be enabled before control baseline, assignments, policy coverage and native projections are reconciled. This source batch does not enable it in production. Public session exports the account's own active functions.
Native bridge integration: activated game sync sends stable permission-set groups through the existing revision-confirmed /permissions/teams bridge. Explicit canonical game nodes plus retained citizen gameplay perks are combined; wildcard/OP/LuckPerms editor grants and service identities are excluded. Duplicate verified UUIDs abort the projection. Unactivated game sync stays on its existing path. Native agent sync reuses the installed osTicket adapter and maps ticket department tags; active human payloads omit native administration flags while retaining business department access. Dev service payload is unchanged. No game server or native application code is rewritten or deployed by this source batch.
Approved appointments and public staff page: the migration plan resolves 14 existing people into 26 current functions, validates the existing Owner identity and rejects service accounts or conflicting leaders. It defaults to dry-run; explicit application is audited and idempotent. The redesigned staff.html uses the public publication allowlist, one biography card per person, an organigram with explicit vacancies and a separate Crysknife Order gallery. Canonical profile links are retained for Bedrock display names. Active function changes now atomically queue the existing native synchronization outbox; the public process starts its retry worker only in active mode. Forum SSO filters native privilege administration for central human identities while retaining the Dev service path. Existing native products are reused.

View file

@ -0,0 +1,11 @@
# Kits website workflow
The public Kit Exchange and the personal/Clan Atelier use the burgundy, antique-gold and muted parchment presentation, with existing atelier artwork and rarity accents.
The catalogue searches all returned designs, including biographies of a design in its lore, and supports category, rarity, purchase availability, price/name/sales order and 12-card pages. An unavailable catalogue has a retry control. Purchase availability follows the existing rollout gate, including legacy personal-sale compatibility.
The shared design editor adds a hex colour code, live lore limits, a restore-saved-design action, unsaved-change confirmation between qualities and a locked single save while the request is pending. Save & Publish and saved-revision publication/withdrawal use the current versioned studio API. The workshop directly opens the existing progression, personal receipts and redemption services; game delivery states remain authoritative.
Verification uses isolated catalogue, studio, progression and receipt fixtures on desktop/mobile, including complete-catalogue search, colour changes, restore, one save/publish request and versioned withdrawal. Checkout, identity, publication and gate contract tests remain required.
The in-game integration scope and rollout gates in KIT-EXCHANGE-INGAME-HANDOFF.md remain unchanged. Staff-wide Claim Registry delivery records are not substituted with private personal redemption codes. Game activation and staff-wide claim processing require the documented native integration.

View file

@ -0,0 +1,8 @@
# Political CP artwork
Generated with the built-in image generation tool, 15 November 2026.
- web/assets/political-imperial-chamber-v1.png: Wide cinematic imperial governmental parliament, detailed Minecraft voxel sandstone architecture inspired by a Dune desert empire; burgundy banners, antique gold ornaments, warm muted desert light, distant sandstone city, painterly game environment, no people, text, logos or watermark.
- web/assets/political-small-council-v1.png: Atmospheric imperial Minecraft desert-world Small Council library, circular voxel sandstone architecture, gilded celestial globe and map table, burgundy draperies, brass emblems, desert through arches; painterly game environment, no people, readable text, logos or watermark.
Images serve as decorative backgrounds beneath solid readable content panels.

View file

@ -0,0 +1,27 @@
# Political CP
Government at `https://www.dunerealms.com/government.html` hosts the independent
`https://cp.dunerealms.com/politics-cp` shell. It reuses the authored User/Dev CP
layout, illustrated portals, left/right menus and gold framing, with a burgundy
and parchment palette and Elections, Offices and Tools tabs. The public office
directory remains available below the workspace in a disclosure panel.
Politics is excluded from both normal User CP and Clan CP portal lists. Old
`#politics/page` and single-page CP bookmarks redirect to the corresponding
Government tab; political service links also use that destination.
The shell retains the existing CP sign-in, onboarding, game-access requirement,
election APIs, ballots, council and proclamation services. It does not grant
new authority or replace existing preview-only functionality. Office cards use
the same read-only public government projection as the public directory.
Outer/inner route and height messages verify both frame source and exact origin.
Routes are restricted to the fixed political page catalogue; heights are bounded.
The responsive sidebar and nested service frames resize into the outer page.
Person profiles show current political offices, scope, term dates and the
matching existing seal. Both the dedicated profile section and recognition
gallery use the same current-term projection as Government. Expired, future,
conflicting and disabled-identity terms cannot produce a current office. A
register outage is reported as unavailable. Recognition ranks and forum caches
do not establish the current public mandate; profile access rules are unchanged.

View file

@ -0,0 +1,29 @@
# Postbank credit processing
Website-only credit engine, using the existing central identity API and the independent bank database. No game database, Java code or inventory is modified.
## Activation
`POSTBANK_CREDIT_ENABLED=true` enables application/actions endpoints and the credit section of the existing four-hour Brussels bank ticker. Missing/false keeps financial intake closed while read-only records and simulations work. Deploy and verify the additive schema migration before enabling. No sample customer contract, test credit or balance reset is seeded.
## Products and cash movement
- Launch grants: one per personal client, zero interest, borrower-selected monthly repayment within the published term. Consent queues acceptance; bank liquidity is still required.
- Personal, Business and Civic loans: staff review, seven-day offer, separate borrower acceptance, then payout on the bank ticker. A manager cannot approve their own controlled client.
- New ordinary loans require a first instalment of 5% of the requested loan amount, rounded up to a whole DM cent. Own funds are reserved on offer acceptance and paid to the lender before principal is issued, in the same atomic disbursement transaction. This instalment is a repayment: it reduces remaining principal and the subsequent repayment schedule, with interest calculated on that reduced balance. No new blocked collateral is collected. Launch grants remain exempt. Historical contracts keep their recorded collateral and release rules.
- Refinancing replaces all active interest-bearing contracts for one client; zero-interest grants remain separate. Historical contracts and ledger entries are retained; no additional cash is paid out. Current payoff changes invalidate the queued refinance rather than overpay.
- Election concessions use actual current winning terms, not provisional/custom ranks. Personal discount is limited to the first5,000DM per eligible election event; corporate concessions require a real CEO change. Reuse is prevented by an atomic event claim.
- The one-month advance is a fixed loan paid into the current account; it does not enable a negative account balance. True account-overdraft permissions remain a later integration.
- Revolving credit cards remain a separately planned product, not an active card/payment facility.
All principal, interest and recovery receipts return to the Website Bank Treasury. The treasury cannot disburse reserved or unavailable money. Neither P&O nor the Federal Reserve is a borrower or ordinary loan funding source.
## Processing and audit
Monthly instalments start one month after payout. Early settlement charges interest earned through the UTC bank value date and excludes unearned future interest. Confirmed manual repayments reserve cash immediately and retain that value date when the four-hour batch posts them. Partial early payments revise only the remaining period, retaining previously paid interest. A seven-day grace period precedes arrears; no invented automatic penalty. Staff recovery is limited to the contract's pledged DM. Full settlement releases remaining collateral. Upcoming/failed/arrears messages are visible with contract details; this does not claim external email delivery.
Canonical entity/client/account locks, exact minor-unit amounts, stable request IDs, payload fingerprints, paired ledger legs and same-transaction credit/global audit records protect mutations. Current user authority is checked again before queued payout or manual recovery/repayment. Browser retries keep the same instruction after an uncertain result.
Credit scoring is advisory and private to the borrower and authorised bank staff. Completed-month cash flow excludes own-client transfers and system/grant/loan/treasury/test credits. Limited history stays explicit; ordinary lending is not automatically approved from the score. Declines have a bounded, recovering impact; waiting for bank liquidity is not a decline.
Future game adapter requirements are described in `postbank-contract.mjs`. It must map verified game identity to the existing bank client and call the same services; it must not maintain another debt ledger.

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