Seed and clear data
Data operations preview by default. Seeding uses a live, authenticated Mainframe. Clearing runs offline with a database lock. Neither requires enabling development fixtures.
Seed missing data
Section titled “Seed missing data”bun run deploy seedbun run deploy seed --applyFor a Mainframe reachable directly, run the application tool with admin credentials in the environment:
bun run data seed --profile staging --url https://mainframe.dev.mainline.incbun run data seed --profile staging --url https://mainframe.dev.mainline.inc --applyMAINFRAME_ADMIN_EMAIL and MAINFRAME_ADMIN_PASSWORD authenticate the operation. Use the current password if it has changed since bootstrap. Remote requests require HTTPS.
Seed files live in apps/mainframe/seeds/staging/ and seeds/dev/. The tool validates their document and fleet schemas, adds missing IDs, and waits for world-sim to confirm each new flight or aircraft. It never targets a hardware fleet. Existing revisions and aircraft are preserved. A retired or offline conflicting identity requires investigation instead of an automatic replacement.
Staging deliberately leaves mission launching to auto-operator; Core dispatches only what a person or a module asks for.
Clear history or operational documents
Section titled “Clear history or operational documents”Take a backup and stop the deployment before applying a clear:
bun run deploy backupbun run deploy downBring up only Postgres with the same project and environment, then preview the clear. The base Compose invocation below preserves the staging volume names through the environment’s project name:
docker compose --env-file deploy/.env.staging -f deploy/compose.yaml up -d postgresbun run deploy clear --scope historyThe preview prints the database identity and row counts. To apply, add --apply --confirm followed by that exact database@host:port identity. The tool refuses the operation while a running Mainframe holds its advisory lock.
| Scope | Cleared |
|---|---|
history |
Samples, snapshots, rollups, events, and command audit rows |
operational |
Everything above, plus missions, markings, alerts, airframe definitions, and their document history |
Both scopes preserve users, roles, grants, provider keys, entity identities, stream sequences, media/blob indexes, captures, clips, chat messages, and map catalogs. Recorded video remains in the bucket under media/, capture stills under blobs/captures/, rendered clips with their posters under blobs/clips/ and chat attachments under blobs/chat/; clips are removed by the daily run once older than Mainframe Settings → Configuration → Media → Keep clips, and chat messages (the chat_messages table) with their attachments once older than Mainframe Settings → Configuration → Comms → Keep messages. Use media retention when you intend to delete recordings; do not erase the index while leaving unmanaged objects behind.
Restart with bun run deploy up. Seed explicitly if you cleared operational documents. World-sim’s persisted fleet remains separate. Its factory-reset operation removes the simulator overlay; it does not clear Mainframe’s database. Do not reset one side and assume the other was reset too.
Documents from an older Mainframe
Section titled “Documents from an older Mainframe”At boot Mainframe tombstones stored documents it can no longer read: anything left in the rules collection, captures a watch rule took or annotated, and markings of an unknown kind (such as border). It retires environment entities a weather module left behind; the retention prune removes them later. Settings sections drop fields they no longer have and keep the rest. Saved layouts, local and shared, load without panels this Terminal no longer has.
Seed production documents without a simulator
Section titled “Seed production documents without a simulator”Use a reviewed directory containing any of layouts.json, markings.json, missions.json, and defs.airframes.json. Each file is an array of documents using the normal collection schema. Omitted collections are left alone. Mainframe itself seeds any of the four starting layouts it has never stored at boot, in every profile and in archive mode (a deleted one stays deleted), and replaces one stored in the old single-arrangement shape; the bundled profiles carry them too, and seeding preserves existing edits and deleted layouts. The layouts are Feeds (one configuration), Pilot (three), Operations (three), and Analysis (two). New workspaces open Feeds by default; existing workspace selections stay unchanged.
bun run data seed --url https://mainframe.example.com --seed-dir ./production-seed --documents-onlybun run data seed --url https://mainframe.example.com --seed-dir ./production-seed --documents-only --applyThis mode does not require world-sim or create aircraft. Keep admin credentials in the environment or supported secret files. It uses the same authentication, schema validation, audit trail and revision checks as Terminal; it preserves existing IDs and deliberate deletions. Perform offline history maintenance when aircraft are idle: clearing snapshots also removes the last persisted tasking state.