Upgrading from 1.0.0-rc.3 to 1.0.0

Handbook · Operations · Changelog (CHANGELOG.md)

These are the operator steps for moving an installation from the 1.0.0-rc.3 release archive to 1.0.0 on MariaDB 10.6 or later, or MySQL 8. Do them in order. The upgrade needs a maintenance window, for three reasons:

  • the ledger-heads migration must run with the site down;
  • an installation that runs Gamekit must move to Gamekit 1.3.0 together with the engine: in the same window, or, where Gamekit comes from the marketplace, from the admin as soon as the site is back up;
  • the engine now runs MySQL and MariaDB sessions at READ COMMITTED, which the database server must allow.

An installation on SQLite skips the database checks. The isolation setting does not apply there, and the timestamp migration does nothing on SQLite. Coming from a release candidate older than rc.3, also read the rc.3 section of the changelog.

Run every command from the installation's backend directory with the same PHP CLI the cron entries use. On Plesk that is /opt/plesk/php/8.3/bin/php artisan ...; see native scheduler and worker setup.

Shared hosts. On a shared host (for example under Plesk), only touch your own site's folder and databases. Do not install server-wide packages or restart global services, and never reset a live database (migrate:fresh, db:wipe) to fix a problem.

Before the window (read-only)

  1. Check the database server. READ COMMITTED needs binlog_format ROW or MIXED when binary logging is on. On MariaDB:

    SELECT VERSION(), @@global.binlog_format, @@global.log_bin, @@global.tx_isolation;
    

    On MySQL 8, read @@global.transaction_isolation instead of @@global.tx_isolation. The upgrade is safe if log_bin is 0 or the format is ROW or MIXED. With STATEMENT, every write fails with error 1665. In that case either change the binlog format first, or set DB_ISOLATION_LEVEL=server. That keeps the server default (usually REPEATABLE READ) and gives up the protection READ COMMITTED adds; see transaction isolation.

  2. Get Gamekit 1.3.0 ready, if the installation runs Gamekit. Engine 1.0.0 locks the player's users row before player_stats in every payment (EconomyService::LOCK_ORDER = 2; see economy). With Gamekit 1.2.x, a Gamekit money action can deadlock against a plain credit. Gamekit 1.3.0 on rc.3 logs a critical "degraded" message, notifies admins and can deadlock the same way. How you deploy it depends on where Gamekit comes from. If you put the plugin's files in place yourself, switch both in step 6. If the installation gets its plugins from the marketplace, Gamekit cannot be updated inside the window: while the application is down the admin answers 503, and no artisan command updates a marketplace plugin. Update it from the admin straight after step 9 instead. The bundled referrals 1.1.2 and commercekit 1.0.1 check LOCK_ORDER >= 2, so they are safe with either engine.

  3. Review .env. No new key is required. Keys new or changed since rc.3:

    Key Default when unset Notes
    DB_ISOLATION_LEVEL READ COMMITTED One of the four standard levels, or empty / server for the server default. Any other value fails at config load.
    PULSE_FIRST_PARTY_ONLY on, unless APP_ENV is local or testing Refuses installing, updating, uploading, enabling or activating packages that are not by Blackwave Studios.
    PULSE_FIRST_PARTY_VENDORS lf-studio Marketplace vendor slugs trusted for marketplace downloads.
    PULSE_FIRST_PARTY_AUTHORS Blackwave Studios Extra legacy author names, comma-separated.
    PULSE_FIRST_PARTY_HUB_AUTHOR_FALLBACK false Only for a hub that does not send vendor.slug yet. Leave it false.
    PULSE_ACTIVITY_RECEIPT_DAYS 90 Days a player.activity receipt is kept before the daily prune deletes it.
    PULSE_EXTENSIONS every packages/*/pulse-extension.json Colon-separated extension roots. Set but empty loads none.
    MARKETPLACE_INSTALLS_URL derived from the marketplace address: /marketplace-hub at the end becomes /installs Where the optional marketplace check-in and player count are sent. Unused while that check-in is off, which is the default (see "Other changes to expect").

    All of these appear, commented out, in backend/.env.example. Core no longer reads OPEN_WORLD_*, WORLD_EDITOR_*, PULSE_ASSET_* or ROOM_ENDPOINT_ALIASES; the 3D toolkit moved to the separate pulse-3d extension.

    If the installation runs plugins or themes that are not by Blackwave Studios, decide on PULSE_FIRST_PARTY_ONLY before the upgrade. Those packages keep running, but while the policy is on they cannot be updated, re-enabled or installed.

  4. Take a backup, for example with php artisan pulse:backup:database. A separate dump of idempotency_keys, stage_tickets and player_claims makes the timestamp repair in step 7 easy to compare.

Confirm before the window:

  • Restarting PHP-FPM for this site only. Step 8 restarts the site's PHP-FPM pool so that every web process opens new database connections at the new isolation level. This handbook documents no command for a site-scoped restart on Plesk. Agree the exact method before the window. Never restart the global PHP-FPM service on a shared host.
  • Workers during maintenance mode. The steps below pause the scheduler and worker cron entries and stop Horizon or the queue workers, as in the restore runbook. Whether a worker that is still running keeps processing jobs while the application is down has not been verified for this release. Make sure every worker has exited before step 7.

In the window

  1. Stop writers and take the site down.

    php artisan down
    

    Pause the scheduler and worker cron entries, then run php artisan horizon:terminate (or php artisan queue:restart). A deploy hook that runs migrate --force with the site up must not be used for this release. An entry written by the old code after the ledger-heads backfill is missing from its user's head, and that user's next entry forks the chain permanently.

  2. Switch the code to 1.0.0, and to Gamekit 1.3.0 if the installation runs Gamekit and you deploy its files yourself (step 2).

    Extracting the release archive over the old installation adds and replaces files but deletes none, so files that 1.0.0 no longer contains stay on disk. The release test counted 2,448 of them coming from rc.3. These notes assume that in-place replacement, which leaves your .env files, storage and uploads where they are, and the upgrade was tested with the leftover files in place. Leave them.

  3. Migrate and repair the ledger heads.

    php artisan migrate --force
    php artisan pulse:ledger:audit --repair-heads --chains
    

    --repair-heads recomputes every head from the ledger and refuses, with exit 1, unless the application is in maintenance mode. The command can also exit 1 because --chains found forks written before this release. Those forks are expected and stay in the history. Do not chain the next step with && or set -e, or the site stays down: read the report, then continue. The migrations can be rerun after a partial failure.

    Migrations new since rc.3, all under backend/database/migrations:

    Migration Effect
    2026_11_11_120000_add_role_colour_and_plugin_admin_access Nullable roles.color and the new role_plugin_admin_access table.
    2026_11_12_120000_create_economy_ledger_heads_table New economy_ledger_heads, backfilled from economy_transactions. Run with the site down (step 5).
    2026_11_13_090000_add_target_user_id_to_activity_logs Indexed nullable activity_logs.target_user_id, backfilled from metadata in chunks.
    2026_11_13_090100_add_source_to_device_fingerprints Nullable device_fingerprints.source. Existing rows stay null.
    2026_11_13_120000_keep_admin_actions_when_a_user_is_deleted activity_logs.user_id becomes nullable with ON DELETE SET NULL, and actor_username is backfilled. On MariaDB this rebuilds activity_logs in place, which takes time on a large table.
    2026_11_13_120100_index_player_activity_receipts_created_at Index for the daily receipt prune.
    2026_11_13_140000_drop_timestamp_auto_update_on_mariadb MySQL and MariaDB only. Redefines idempotency_keys.expires_at, stage_tickets.expires_at and player_claims.claimed_at as TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, without ON UPDATE, and recomputes the expiry of stored idempotent responses from created_at. Past stage_tickets and player_claims times are not repaired.
    2026_11_14_090000_add_last_active_index_to_users Adds the index users_last_active_index on users.last_active where it is missing, and does nothing where it exists. MariaDB builds it in place, so reads and writes continue, but the statement waits behind any long-running transaction on users. On a large table, run it at low traffic, or build the index beforehand with ALTER TABLE users ADD INDEX users_last_active_index (last_active), ALGORITHM=INPLACE, LOCK=NONE; and the migration then skips.
    2026_11_15_090000_create_email_template_contents_table New email_template_contents: one row per email and language, holding the draft and a pointer to the published version.
    2026_11_15_090100_create_email_template_versions_table New email_template_versions: the published versions, append-only. Until both tables exist, email is sent from the old email_templates row or the built-in default.

    rc.3 also shipped nine 3D migrations (world_scene_drafts and the open_world_* tables) that core no longer contains. An rc.3 database keeps those tables and their migrations rows, and 1.0.0 neither drops nor runs them. Leave them in place.

  4. Rebuild the configuration cache and restart long-running processes. The isolation level applies to each new database connection.

    php artisan config:cache
    

    Then restart this site's PHP-FPM (see "Confirm before the window"), and Horizon or the queue workers. The worker cron entries start them again on the new code once they are resumed in step 9.

    If the Mafia: Underworld kit is already applied, run this once, after updating the code (and after rebuilding the player, if you build it yourself instead of using the release's built player):

    php artisan kit:install mafia-underworld
    

    The update replaces the Noir Syndicate stylesheet (1.0.1 to 1.0.2), but the installed theme keeps the integrity pin of the old one. Until you run this, browsers refuse theme.css and players see the site without its theme.

    This is a normal kit install, so it relies on the backup from step 4. Because the kit version changed (1.3.2 to 1.3.3), it runs the kit's seeder again. The seeder only adds what is missing and keeps the values in rows you edited (on an existing item it only adds stat keys the item lacks), but it puts back a kit setting, crime, item, Black Market shop or stock row that you deleted or renamed. Add --no-seed to skip it; the next kit install without --no-seed then runs it. The command also runs any pending migrations of the kit's plugins, turns a kit plugin you had disabled back on, and makes Noir Syndicate the active theme again; if you use another theme, activate it again afterwards. It rewrites no file that is already identical, and pins the stylesheet now on disk.

    If you edited one of the kit's files under frontend/src (views/game, components/mafia, the two Mafia composables useMafiaHub.ts and useSyndicateComms.ts, router/product-routes.ts) or a file in a noir-syndicate theme folder, and the edit survived the update, the command stops before it changes anything and names the file. Run it again with --force to replace it (the old file is kept under storage/app/kits/kit-mafia-underworld/backups and the path is printed), then reapply your edit and rebuild the player. --force also runs the seeder again unless you add --no-seed. An edited theme.css cannot be put back: the stylesheet is pinned, so a changed copy is refused again; keep such changes in a theme of your own.

  5. Bring the site back.

    php artisan up
    

    Gamekit from the marketplace. If the installation gets Gamekit from the marketplace (step 2), update it to 1.3.0 now, from the admin's Marketplace screen, before players act. Until you do, Gamekit 1.2.x runs on engine 1.0.0, and a Gamekit money action can deadlock against a plain credit.

    Docker stack. While the application is in maintenance mode the backend container's health check is answered with 503, and after about two minutes Docker reports that container as unhealthy. The other services wait for a healthy backend, so a docker compose up -d run straight after php artisan up can fail once with exit 1. Run it again; the next health check, at most 10 seconds later, passes.

    Resume the scheduler and worker cron entries. Three scheduled tasks are new, and all run through the existing schedule:run cron:

    Task When What it does
    pulse:activity-receipts:prune daily at 03:20 Deletes player.activity receipts older than PULSE_ACTIVITY_RECEIPT_DAYS.
    pulse:vault-check-in hourly Sends the optional marketplace check-in, at most once a day. Sends nothing while the check-in is off.
    pulse:vault-report-players every 15 minutes Sends the optional online player count. Sends nothing while the check-in is off or no listing is set.

After the window (read-only checks)

  1. php artisan pulse:ledger:audit --chains reports no stale heads. Forks from before this release may still be listed.

  2. On MariaDB, this query returns no engine columns. Plugin tables can still have such columns:

    SELECT TABLE_NAME, COLUMN_NAME, EXTRA FROM information_schema.COLUMNS
    WHERE TABLE_SCHEMA = DATABASE() AND DATA_TYPE = 'timestamp' AND EXTRA LIKE '%on update%';
    
  3. If Gamekit is installed, no critical log line or admin notification says that Gamekit 1.3.0 needs an engine whose EconomyService locks the users row first.

  4. Update monitors that read php_version or environment from healthz/live, or check details from healthz/ready. healthz/ready now returns one status per check and is throttled to 60 requests a minute per client.

Other changes to expect

These need no step in the window, but scripts, staff and monitors may notice them.

  • Kit installs can now exit 1. php artisan kit:install and php artisan gamekit:install exit 1 when an optional plugin of the kit failed, or was skipped at preflight (a missing or incompatible package, a refused third-party author, an outdated registered version or a dependency error). The rest of the kit is installed and the command names the plugin. --dry-run of a local recipe exits 1 for a plugin it would skip. A deploy script that treated exit 0 as "kit installed" must fix or drop the plugin, or read the message before it stops.
  • Admin email changes ask for the password again. Saving or testing the email settings, creating, changing, deleting or seeding a template, a manual send, a test send, and publishing, resetting or rebranding in the email template library need a password confirmation in the same browser session in the last 15 minutes. Without it the API answers 423 with reauth_required, and the admin panel asks for the password. A script that calls these routes with a bearer token is always refused. Reading, previewing, saving or discarding a draft, and restoring an old version into the draft, do not need it.
  • New account emails. While the admin email settings are active, players get an email when their password changes, when two-factor is switched on or off, and when staff ban or unban them from the admin Users screen. A ban that runs out, an anti-multi cluster ban and removing the banned flag in the user tools send no email. Each email uses, in order: the version published for the player's language, the version published for English, an active legacy email_templates row of the same key, then the built-in English default. The legacy raw-HTML templates and their admin routes still work. They are sent as queued mail. Queued email now uses the mail settings saved in the admin when it is delivered, not the worker's environment mailer.
  • New request limits. POST /api/v1/user/change-password, POST /api/v1/2fa/confirm and POST /api/v1/2fa/disable allow 5 requests a minute each. Account emails are limited per recipient address: 2 notices of one kind in 10 minutes and 12 a day, and verification emails 3 in 10 minutes and 10 a day. Over a limit the email is dropped and a warning is logged with the template name; the account action still succeeds. Admin routes with a new limit of their own: GET /api/v1/admin/system/health 30 a minute, POST /api/v1/admin/email/settings/test and a template library test send 5 a minute, a template library preview 60 a minute, and PUT /api/v1/admin/marketplace/reporting 10 a minute.
  • A ban reason is at most 1000 characters on POST /api/v1/admin/users/{user}/ban. A longer one is refused with 422.
  • The optional marketplace check-in stays off. The upgrade sends nothing. An administrator can switch it on under Admin > Plugins > Marketplace > Connection. It then sends once a day a signed check-in: a random install id, the install's public key, a timestamp, the engine version, and the slug and version of at most 100 installed plugins and themes. If a directory listing is entered, it also sends every 15 minutes a signed player report: the install id, the listing slug, a timestamp and the number of signed-in players active in the last five minutes (capped at 100,000). That report links the install id to the listing. Neither message carries a domain, player data or account details. Switching it off sends a signed switch-off, which is sent again hourly until the marketplace accepts it; nothing else is sent.
  • A new public route, GET /.well-known/pbbg-vault/{challenge}, answers the marketplace's domain check for a licence. The application serves it (backend/routes/web.php), so the web server must pass /.well-known/pbbg-vault/ on to it. A domain can also be verified by DNS TXT.
  • Two new outbound marketplace behaviours. After a marketplace sync that finds a valid licence, the engine asks the marketplace to check its domain (POST <marketplace address>/domain-verification/check, with the host the sync request came in on; local, single-label and IP hosts are never sent). Every marketplace request now carries an Accept-Language header with the language of the current request.
  • Admin System Health shows "unknown" for anything the server cannot measure, for example the process list on a host that does not allow ps. Before, it showed invented values. Unknown is not a fault report.

Going back

Restore the backup from step 4 together with the rc.3 code rather than relying on migrate:rollback. The timestamp migration's down() does nothing, and the keep_admin_actions_when_a_user_is_deleted rollback deletes activity rows whose actor account was deleted.

For plugin and game authors

These need no operator action, but code built against rc.3 may need a change:

  • Lock users first before paying, or check EconomyService::LOCK_ORDER >= 2 (see economy).
  • The player api.get() no longer caches by default; pass cacheTTL to opt in. api.patch and api.delete now reject on HTTP errors, so their catch blocks run.
  • A new timestamp column must use ->useCurrent() or ->nullable(), never a bare NOT NULL timestamp. MariaDB before 10.10 turns that column into one that resets itself on every update.
  • READ COMMITTED does not prevent lost updates between two unlocked read-modify-write sequences. Keep using lockForUpdate().