veratown-prototype

Runtime Naming Cleanup — Implementation Plan

Status: Plan only. No runtime code, MongoDB data, Railway configuration, or BC account settings are changed by this document.

Goal

Remove prototype from active application identifiers, user-facing runtime text, environment/database configuration, and runtime-owned MongoDB collection names so a production deployment does not carry temporary-development naming. Keep the existing production/test isolation guarantees and preserve data across the eventual rename.

Explicit scope and exclusions

Included:

Explicitly unchanged:

Do not run a real database migration, deploy, modify Railway variables, or change credentials/account settings as part of code implementation. Those are separate operator actions, gated as described below.

Adopted naming map

Use these names consistently in code, .env.example, active documentation, and migration code. Do not add a compatibility fallback that silently accepts old database names.

Purpose Current name New name
Production runtime database veratown_prototype veratown
Test runtime database veratown_prototype_test veratown_test
Action journal collection prototypeActions botActions
Runtime heartbeat collection prototypeRuntime botRuntime
Optional door-debug collection prototypeDoorDebug botDoorDebug
Appearance itemsets collection prototypeItemSets veratownItemSets
Bunny member-state collection prototypeBunnyStates veratownBunnyStates
Status commands !prototype, /bot prototype !status, /bot status
Default status reply Veratown prototype is online. Veratown bot is online.

Database names must be confirmed unused or otherwise explicitly approved for this runtime during migration preflight. If either destination is already in use by unrelated data, stop before any database writes and ask for a different approved name. Do not weaken the fixed target-to-database mapping to work around a collision.

Remove the old status command rather than retaining a prototype alias. Help, command tests, status docs, and examples must present only status.

Inventory and ownership boundaries

Before implementation, search the full repository for prototype and classify each match as one of:

  1. Active runtime/code/test/config/database naming to replace.
  2. Repository, package, URL, or Railway source identity explicitly excluded.
  3. Historical context that is not active configuration or behavior.

Implementation must eliminate category 1 references from active runtime behavior and configuration. Old database and collection names may remain only in the tested legacy-to-new migration mapping and documentation explaining that migration. Leave category 2 unchanged. Update active category 3 documentation where doing so makes setup and production behavior clearer; do not rewrite historical material merely to erase a word when it accurately describes past work.

Use the live code as the authoritative inventory of runtime-owned collections. Expected renamed collections are listed in the table above. Existing Veratown room/map/location/keypad configuration collections retain their names so the legacy config-copy allowlist remains a one-to-one contract. The runtime migration must not copy the source ropeybot database or widen that copy-script allowlist.

Implementation sequence

1. Preflight and complete reference inventory

2. Rename application and user-facing identifiers

3. Rename runtime-owned collections and indexes

4. Implement a safe data migration tool

Provide an operator script for moving data from the current test/production databases and old collection names to their new counterparts. It must:

Do not implement dual writes or automatic old-database fallback. Keep the runtime pointed at exactly one fixed database per target. If the migration cannot safely resolve an unknown collection, document shape, duplicate _id, index conflict, or destination collision, fail closed and request operator input rather than guessing.

5. Update configuration, docs, and operational procedures

Update together:

Document the migration as an operator-led, dry-run-first procedure. Make clear that deploying code which expects the new database before migrating/seeding that target will not find the old data. Update target variables only during an approved deployment cutover.

6. Validate and report

Safety and stop conditions

Stop without applying data changes and request operator direction if:

The MongoDB schema-design skill’s migration/versioning guidance and action policy apply to the implementation. It may be used to design/read-verify the migration, but no live MongoDB write, rename, drop, or deployment action is authorized by this plan alone.

Required repository instructions and workflow

During implementation, read and follow the applicable instructions before editing:

Use the repository’s built-in node:test tooling. Do not add dependencies. Changes to database isolation guards or scripts require a short-lived implementation branch and a pull request. Commit only the cohesive, validated implementation files; never include unrelated worktree changes, secrets, generated dist/, or database exports.

Definition of done