Skip to content

(janitor/dead-code): remove orphaned gastown rig/town-escalation tables - #6467

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

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 21, 2026

Copy link
Copy Markdown
Contributor

What was deleted

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

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

These are leftovers from the rig→town refactor. The active schema (beads, agent-metadata, escalation-metadata, convoy-metadata, bead-dependencies, town-events, agent-nudges, org-towns, user-towns, user-rigs, rig-agent-events) is imported and instantiated in Town.do.ts, Agent.do.ts, GastownUser.do.ts, GastownOrg.do.ts and the dos/town/* sub-modules. The deleted tables are not part of that graph.

Evidence of unreachability

  • No import/export ... from reference to any of the seven .table modules anywhere in the repository (checked apps/, packages/, services/, dev/, scripts/, tools/).
  • No reference to any exported symbol (rig_agents, rig_beads, rig_bead_events, rig_mail, rig_molecules, rig_review_queue, town_escalations, their *Record zod schemas, createTable*/getIndexes* helpers) outside the deleted files themselves — including test files and .sql/migration/seed content.
  • The createTable*() helpers are never called from any DO migration path. The live tables are wired via createTableBeads(), createTableAgentMetadata(), createTableTownEvents(), createTableRigAgentEvents(), createTableUserRigs(), createTableUserTowns(); none of the deleted tables' creators are invoked.
  • No cross-contamination with the generic BeadEventType / EscalationSeverity names: the live definitions in bead-events.table.ts and escalation-metadata.table.ts are self-contained and unaffected.
  • No reference in the external consumer clone (Kilo-Org/kilocode).

Dynamic and configured entry points checked

  • services/gastown/wrangler.jsonc / wrangler.test.jsonc: no Durable Object binding, migration, queue, cron, RPC, or workflow references these tables.
  • No drizzle.config.* or SQL migration files exist in services/gastown; the DO SQLite schema is created at runtime via createTable* only.
  • No barrel/index.ts under db/tables/, and no import * as/glob/dynamic-import of the tables directory.
  • gastown.worker.ts routes and handlers/* reference only the live DO stubs and live tables; town-escalations.handler.ts operates on escalation_metadata, not town_escalations.

Contract and compatibility considerations

  • All packages/* in this monorepo are "private": true; these files are not published exports.
  • The deleted tables are never created in DO SQLite (createTable* never called), so no persisted data, migration, rollback, or rollout dependency is affected. Deleting the type-only definitions has no runtime effect.

Validation performed

  • pnpm --filter cloudflare-gastown exec tsgo --noEmit — passes (baseline and after deletion).
  • pnpm --filter cloudflare-gastown test — 22 files / 323 tests pass.
  • pnpm -w exec oxlint --config .oxlintrc.json services/gastown/src — 0 warnings, 0 errors.
  • Post-deletion grep confirms zero remaining references to any deleted symbol.

Delete seven Durable Object SQLite table definitions in services/gastown
that are no longer imported, created, or queried anywhere:

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

These are leftovers from the rig→town refactor. The active schema
(beads, agent-metadata, escalation-metadata, convoy-metadata,
town-events, agent-nudges, etc.) lives in Town.do.ts and its town/
sub-modules; the deleted tables were never wired into any createTable*()
migration call and their exported symbols/table names have no references.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 21, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) September 21, 2026 07:49
@kilo-code-bot

kilo-code-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Deletion-only PR removing seven unused gastown *.table.ts definitions; independent repository-wide searches confirm none of the deleted modules, symbols, table names, or createTable*/getIndexes* helpers are referenced anywhere in code, config, SQL, or tests, so removal has no runtime effect.

Files Reviewed (7 files)
  • services/gastown/src/db/tables/rig-agents.table.ts (deleted)
  • services/gastown/src/db/tables/rig-beads.table.ts (deleted)
  • services/gastown/src/db/tables/rig-bead-events.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)
Verification Notes
  • No import, re-export, dynamic import, barrel, glob, or test reference to the seven module paths or their exported symbols remains anywhere in the repo.
  • The runtime DO schema (Town/Agent/GastownUser/GastownOrg) creates only beads, bead_events, bead_dependencies, agent_metadata, review_metadata, escalation_metadata, convoy_metadata, rigs, agent_nudges, town_wasteland_connections, town_events, rig_agent_events, user_towns, user_rigs, org_towns; none of the seven deleted tables is created or queried.
  • Same-named symbols (BeadType, BeadStatus, BeadEventType, EscalationSeverity, MoleculeStatus, ReviewStatus, AgentRole, AgentStatus) are defined and imported from separate live modules, so bead-events.table.ts and escalation-metadata.table.ts are unaffected.
  • The only remaining mentions of the deleted table names are descriptive prose in .plans/gastown-town-centric-refactor.md, which is documentation and does not make the modules reachable.
  • No .sql migration/seed files exist under services/gastown; wrangler configs register DO classes only and contain no table DDL.

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

Review guidance: REVIEW.md from base branch main

auto-merge was automatically disabled September 22, 2026 15:51

Pull request was closed

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.

1 participant