Skip to content

(janitor/dead-code): remove orphaned gastown rig/town table definitions - #6073

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/dead-code-gastown-rig-tables
Open

(janitor/dead-code): remove orphaned gastown rig/town table definitions#6073
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/dead-code-gastown-rig-tables

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

What was deleted

Seven unused Durable Object SQLite table definitions in services/gastown/src/db/tables/:

  • rig-agents.table.ts
  • rig-bead-events.table.ts
  • rig-beads.table.ts
  • rig-mail.table.ts
  • rig-molecules.table.ts
  • rig-review-queue.table.ts
  • town-escalations.table.ts

These are legacy Postgres-era table schemas that were superseded by the Town and Rig Durable Object sub-modules (dos/town/*). The modern Durable Objects that would have owned this data (Town.do.ts, Agent.do.ts, GastownUser.do.ts, GastownOrg.do.ts) use different, actively-imported tables (beads, agent_metadata, town_events, rig_agent_events, user_rigs, user_towns, org_towns, etc.) and never reference the deleted ones.

Evidence of unreachability

Each deleted file's module path and every exported symbol/table-name string were searched repository-wide:

  • rg -l "rig-agents.table" (and the other six module basenames) → zero matches anywhere, including no export * barrel re-export (there is no db/tables/index.ts).
  • Every exported value/type (RigMailRecord, rig_mail, createTableRigMail, getIndexesRigMail, RigAgentsRecord, rig_agents, RigBeadsRecord, RigMoleculesRecord, RigReviewQueueRecord, TownEscalationsRecord, town_escalations, …) → zero references outside their own files.
  • Raw SQL table name strings (rig_mail, rig_agents, rig_beads, rig_molecules, rig_review_queue, town_escalations) → zero references in any source, test, migration, .sql, README, or doc.
  • No .test.ts files reference any of these modules or symbols.

The handlers that share the rig/town domain (rig-agents.handler.ts, rig-mail.handler.ts, etc.) are reachable from gastown.worker.ts but route to Durable Objects (getTownDOStub, getRigDOStub), not to these tables.

Dynamic and configured entry points checked

  • No wrangler/Cloudflare bindings, Durable Object migrations, queues, cron triggers, alarms, RPC, or workflows reference these files or their table names.
  • No drizzle config, schema, or bootstrap list references them (gastown has no .sql or migration files; tables are created explicitly per-DO via createTableXxx() calls, and none of the deleted createTable*/getIndexes* functions are called).
  • No Next.js file convention, dynamic import, registry, or code generation discovers them.
  • No package exports/SDK/CLI contract exposes them (gastown is a private Worker service, not a published package).
  • Not referenced by tests, scripts, CI, deployment tooling, or examples.
  • The external Kilo-Org/kilocode consumer was cloned and searched: no reference to any deleted identifier or table name.

Contract and compatibility considerations

  • Deleting these modules removes no module-initialization side effects: each file only imports zod and util/table helpers, and nothing imports the files, so no code is loaded at runtime.
  • No persisted-data, migration, rollback, or incomplete-rollout dependency: the tables are no longer created, read, or written by any live code path.
  • util/table.ts (getTableFromZodSchema, getCreateTableQueryFromTable) remains used by the actively-imported tables, so it is not orphaned by this change.

Validation performed

  • pnpm exec tsgo --noEmit in services/gastown — passes (before and after).
  • oxlint on services/gastown/src — 0 warnings / 0 errors (before and after).
  • pnpm exec vitest run in services/gastown — 21 files, 314 tests passed.
  • git diff --check — clean.

Delete seven unused Durable Object SQLite table definitions from
services/gastown/src/db/tables/: rig-agents, rig-bead-events, rig-beads,
rig-mail, rig-molecules, rig-review-queue, and town-escalations.

These are legacy Postgres-era table schemas superseded by the Town and
Rig Durable Object sub-modules. None are imported by any source file,
test, migration, config, or prompt, and their exported symbols and table
name strings appear nowhere else in the repository or in the external
Kilo-Org/kilocode consumer.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 11, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) September 11, 2026 07:46
@kilo-code-bot

kilo-code-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Deletion-only change removing seven orphaned gastown table definitions. Confirmed no imports, barrel re-exports, symbol references, or raw table-name references remain in source, tests, Durable Objects, wrangler/config, or migrations; remaining util/table.ts is still used by the active tables.

Files Reviewed (7 files)
  • services/gastown/src/db/tables/rig-agents.table.ts (deleted)
  • services/gastown/src/db/tables/rig-bead-events.table.ts (deleted)
  • services/gastown/src/db/tables/rig-beads.table.ts (deleted)
  • services/gastown/src/db/tables/rig-mail.table.ts (deleted)
  • services/gastown/src/db/tables/rig-molecules.table.ts (deleted)
  • services/gastown/src/db/tables/rig-review-queue.table.ts (deleted)
  • services/gastown/src/db/tables/town-escalations.table.ts (deleted)

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants