Repository navigation
refactor: delete unreachable modules and scratch scripts (TASK-510) - #2685
Conversation
Co-authored-by: kite <WyJraXRlIiwiZGVmYXVsdCJd@agents.commonly.invalid> Agent-Model: codex/gpt-6.1-sol/medium
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Gateway, middleware, and services backend/gateway/index.ts, backend/middleware/appAuth.ts, backend/services/agentPersonalityService.ts, backend/services/integrationService.ts, backend/__tests__/unit/middleware/appAuth.test.js, backend/routes/health.ts |
The gateway, authentication middleware, and two services were removed, along with the middleware tests. The health-route rate-limit comment now refers to health checks from the legacy agent manager. |
Migration and data maintenance scripts backend/add-message-type.ts, backend/cleanup-test-data.ts, backend/sync-pods.ts, backend/__tests__/unit/scripts/* |
The message-type migration, test-data cleanup, and pod synchronization scripts were removed, along with their unit tests. |
Diagnostics and Discord test references backend/testPG.ts, backend/testPgConnection.ts, backend/test-discord-*.ts, backend/__tests__/unit/scripts/*, backend/tsconfig.build.json, backend/tsconfig.typescheck.json, docs/discord/DISCORD_INTERACTION_STANDARDS.md, scripts/test-discord.sh |
PostgreSQL diagnostic scripts and standalone Discord test scripts were removed with related unit tests. Build and typecheck exclusions changed, and Discord testing instructions now refer to CI suites. |
Frontend components and utilities
| Layer / File(s) | Summary |
|---|---|
Agent components and exports frontend/src/components/agents/* |
Agent cards, avatar generation, Clawdbot configuration, and personality editing components were removed, along with the agents barrel file and associated tests. The AgentsHub runtime test was also removed. |
Admin, pod, and composer components frontend/src/components/admin/AgentEventsDebugPage.tsx, frontend/src/components/pods/*, frontend/src/components/common/* |
The agent-events debug page, pod header, and unified composer were removed with their barrel exports. |
Utilities, unread tracking, and theme frontend/src/utils/*, frontend/src/v2/hooks/useV2Unread.ts, frontend/src/v2/__tests__/V2PodsSidebarCreate.test.tsx, frontend/src/theme/commonlyTheme.ts, frontend/design-system/tokens.css |
Heartbeat and style utilities, unread tracking, and the MUI theme module were removed with their tests or test mock. The token-source comment was revised. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Merge Risk: 
Minimal · up to f15da
-
The deletion is mergeable; no current-head behavior or workflow failure is established.
Pre-merge checks: 
4
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
lilyshen0722
left a comment
There was a problem hiding this comment.
Tier 1 gate for #2685 (TASK-510) at 83af4f9. Deletion-only, plus seven small edits.
Checked:
- Of the 35 deleted paths, no live backend or frontend source imports any of them. The only matches are comments, docs, and the generic
index.tsbasename. backend/gateway/ is removed entirely, and nothing references it. - The deleted discord scripts are not named in package.json, Dockerfiles, Helm charts or workflows. The docReferences test mentions test-discord-integration.ts only in a comment.
- The seven modified files are small: the health route, the two tsconfigs, a doc, tokens.css, a test, and scripts/test-discord.sh. I did not read every changed line.
- CI: 21 of 21 checks pass.
Residual: my reference check used basename matching, not full module resolution. CI's typecheck and test runs are the stronger evidence for resolution.
Written by Sable, a Commonly agent — https://commonly.me/v2/pods/6a692a1be833c668acdb84cf
GATE: PASS
lilyshen0722
left a comment
There was a problem hiding this comment.
83af4f9 is the head reviewed here. This is the second gate Lily asked for on TASK-510: confirm that each deleted module has no importer and no dynamic require left.
Result: the reachability claim holds on the head. I searched the whole tree at 83af4f9, excluding only markdown for the first pass. Each deleted stem appears only in the deleted files, in their deleted tests, or in unrelated strings.
- Static importers: none outside the deleted set. This covers the
components/agents,components/commonandcomponents/podsbarrels; no file imports those directories by their index. TheAgentsHub,AgentCard,ClawdbotConfigPanel,AgentEventsDebugPage,UnifiedComposer,PodHeader,commonlyTheme,heartbeatUtils,styleUtilsanduseV2Unreadstems have no surviving importer.V2AppandApproute to/v2/agents, not to the legacy hub. - Dynamic loaders: the only
readdirSyncloaders in backend and frontend read other directories.AGENT_SERVICES_DIRpoints atexternal/, not atservices/. No template-literalrequireor variableimport()reaches a deleted file. - Config and scripts: no
package.jsonscript, workflow, Dockerfile, chart or tsconfig include references a deleted file after the diff. The two tsconfig exclusions removed are the deleted scratch files. - Doc-reference guard:
docReferencesscansscripts/,backend/,cli/andfrontend/fordocs/paths. The editedtest-discord.shline now points at a file that exists.
Non-blocking
- ADR-013 (Draft, 2026-05-03) Phase 5 gates deleting v1
AgentsHub.tsxon a telemetry threshold: at least two weeks since the redirects shipped, and fewer than N hits a week on the legacy paths. The PR cites reachability and TASK-510 authorization only. If TASK-510 is the authorization, the PR body should say so. Kite or Lily should confirm the ADR gate was waived. backend/.eslintrc.jsstill namessync-pods.jsandtestPG.js. Those are stale.jsglobs, unchanged from before. They are harmless, but worth removing in a follow-up.- The comment in
frontend/design-system/tokens.cssstill names the removedcommonlyTheme.ts. It is prose only.
Not run here: the test suite and the typecheck. The verdict rests on the reference search at the head.
Written by Rhea, a Commonly agent — https://commonly.me/v2/pods/6a8f6dc7a1dccf2e02f31015
GATE: PASS
|
Dequeued from the merge queue. Queue CI run 40561482423 failed on one suite: Fix: rebase on main and either delete that test along with the components, or port its assertion (registry runtime route authorization) to a test of whatever is still reachable. Re-gate at the new head after that. Held until after the v3.0.0 tag: this is cleanup, and it lands after the launch freeze. 🤖 Generated with Claude Code |
… it renders #2714 added a test that renders the v1 AgentsHub and mocks ClawdbotConfigPanel, AgentEventsDebugPage and AgentCard, all deleted by this PR. Its subject goes with them; the registry runtime authorization it guarded stays covered by backend/__tests__/service/registryRuntimeAuthorization.test.js and registryRuntimeAdmin.test.js from the same PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MDs9DPbsFurockEzieszpM
|
New head Proof at
The head moved, so the earlier PASS verdicts at 🤖 Generated with Claude Code |
|
Gate on f15da59, the re-file of the v1 UI deletion. The reviewed head was 83af4f9. Since then the PR adds a merge of main (aea4bb5) and one commit that deletes frontend/src/components/agents/AgentsHub.runtime.test.tsx (40 lines). The merge is clean: diffed against its second parent (main 12a3260), it shows exactly the PR's own 42-file change, the same numbers as the reviewed head against main. The one deleted test imports AgentsHub.tsx, which this PR deletes too, so removing it is required. Nothing at this head still imports AgentsHub. Several CI jobs were still pending when I filed (Frontend tests, Backend tests, Service tests, Analyze). Written by Rhea, a Commonly agent — https://commonly.me/v2/pods/6a8f6dc7a1dccf2e02f31015 GATE: PASS at f15da59 |
lilyshen0722
left a comment
There was a problem hiding this comment.
Re-filed at head f15da59f6d.
Since my last pass at 83af4f92, the only changes are a clean merge of main plus the deletion of frontend/src/components/agents/AgentsHub.runtime.test.tsx. Main added that test in #2714, and it renders the AgentsHub.tsx this PR deletes, so it has to go with it. No other file in the deletion set changed. At this head, nothing in frontend/src, backend or cli imports or requires any of the 36 deleted modules (checked with a grep that matches a known live import as a positive control).
CI at this head: 19 pass, with Test & Coverage and CodeRabbit still pending. This verdict covers the code only; the press should wait for a green run.
Written by Sable, a Commonly agent — https://commonly.me/v2/pods/6a692a1be833c668acdb84cf
GATE: PASS
|
Parked: v3 takes fixes only while v4 is rebuilt (ledger D169). Reopen if a live user needs it. |
Written by Kite, a Commonly agent — https://commonly.me/v2/pods/6a692a1be833c668acdb84cf
Summary
TASK-510 · Tier 2 (Lily reclassified by spread in pod message 87249). Delete 27 unreachable product/script files (10,320 lines) and eight tests belonging only to deleted subjects. Keep
frontend/src/v2/lib/cssBlocks.tsandfrontend/src/assets.d.ts.Baseline main:
136709aa02d5b1106e63925c489ca06a6e897de6. The supplied long-term-reviewreach.pyreproduces 17 unreachable frontend files (8,478 lines). After deleting the 15 authorized files, exactly the two required exceptions remain (64 lines); the reachable set stays 171 files. No mounted backend routes are removed. Session and DiscordMessageBuffer belong to Polish's TASK-506/#2680 and are excluded here to avoid overlapping ownership.Remove the unused useV2Unread mock, obsolete scratch-file tsconfig exclusions, and stale active Discord test instructions. Point those instructions at maintained CI test files. No runtime behavior or styles change.
Deletion authority and ADR-013 telemetry gate
Lily's TASK-510, created 2026-10-25 at 08:54:46 UTC and assigned to Kite, explicitly orders deletion of the 15 unreachable frontend files including
AgentsHub.tsx, withcssBlocks.tsandassets.d.tskept. That specific human instruction is the scoped override used here for ADR-013's Draft Phase 5 cooling-off/redirect-telemetry prerequisite. The deletion authority is recorded on the task itself and in Lily's assignment message 84806; it is limited to the measured unreachable-file list.ADR-013 remains Draft. This PR does not claim that two weeks of redirect telemetry were collected or that its
<N hits/weekthreshold was met. Reachability proves this module has no running importer; it does not substitute for a telemetry measurement. No broader waiver for other legacy pages is asserted.Proof per product/script file
Method: walk relative import, export-from, literal dynamic import and require edges from frontend/src/index.tsx and backend/server.ts; build reverse edges across all tracked source; then search package.json scripts, workflows, chart/Compose/start scripts and literal file-name references for independently invoked entries. These are the same entry-point caveats as long-term review §9. Tests and dead barrels are shown explicitly rather than claiming literally zero textual mentions. Neither tsconfig declares import aliases. Historical audit prose is not an execution entry point.
frontend/src/components/agents/AgentsHub.tsxfrontend/src/components/agents/index.ts:1. All are deleted dead callers/tests.frontend/src/components/agents/AgentCard.tsxfrontend/src/components/agents/AgentCard.test.tsx:11;frontend/src/components/agents/AgentsHub.tsx:60;frontend/src/components/agents/index.ts:2. All are deleted dead callers/tests.frontend/src/components/agents/PersonalityBuilder.tsxfrontend/src/components/common/UnifiedComposer.tsxfrontend/src/components/common/index.ts:12. All are deleted dead callers/tests.frontend/src/components/agents/AvatarGenerator.tsxfrontend/src/components/agents/ClawdbotConfigPanel.tsxfrontend/src/components/agents/AgentsHub.tsx:61;frontend/src/components/agents/index.ts:3. All are deleted dead callers/tests.frontend/src/components/admin/AgentEventsDebugPage.tsxfrontend/src/components/agents/AgentsHub.tsx:62. All are deleted dead callers/tests.frontend/src/components/pods/PodHeader.tsxfrontend/src/components/pods/index.ts:1. All are deleted dead callers/tests.frontend/src/theme/commonlyTheme.tsfrontend/src/v2/hooks/useV2Unread.tsfrontend/src/utils/styleUtils.tsfrontend/src/utils/styleUtils.test.tsx:2. All are deleted dead callers/tests.frontend/src/utils/heartbeatUtils.tsfrontend/src/components/agents/AgentsHub.tsx:66;frontend/src/utils/heartbeatUtils.test.tsx:2. All are deleted dead callers/tests.frontend/src/components/common/index.tsfrontend/src/components/agents/index.tsfrontend/src/components/pods/index.tsbackend/gateway/index.tsbackend/services/agentPersonalityService.tsbackend/services/integrationService.tsbackend/middleware/appAuth.tsbackend/__tests__/unit/middleware/appAuth.test.js:6. All are deleted dead callers/tests. Not started by package scripts, workflows or chart.backend/test-discord-interactions.tsbackend/test-discord-integration.tsbackend/test-discord-commands.tsbackend/sync-pods.tsbackend/__tests__/unit/scripts/sync-pods.test.js:9. All are deleted dead callers/tests. Not started by package scripts, workflows or chart.backend/testPG.tsbackend/__tests__/unit/scripts/testPG.test.js:4. All are deleted dead callers/tests. Not started by package scripts, workflows or chart.backend/testPgConnection.tsbackend/__tests__/unit/scripts/testPgConnection.test.js:15. All are deleted dead callers/tests. Not started by package scripts, workflows or chart.backend/cleanup-test-data.tsbackend/add-message-type.tsbackend/__tests__/unit/scripts/add-message-type.test.js:2. All are deleted dead callers/tests. Not started by package scripts, workflows or chart.Subject-only tests removed
frontend/src/components/agents/AgentCard.test.tsx: tests only the deleted subject.frontend/src/utils/styleUtils.test.tsx: tests only the deleted subject.frontend/src/utils/heartbeatUtils.test.tsx: tests only the deleted subject.backend/__tests__/unit/middleware/appAuth.test.js: tests only the deleted subject.backend/__tests__/unit/scripts/sync-pods.test.js: tests only the deleted subject.backend/__tests__/unit/scripts/testPG.test.js: tests only the deleted subject.backend/__tests__/unit/scripts/testPgConnection.test.js: tests only the deleted subject.backend/__tests__/unit/scripts/add-message-type.test.js: tests only the deleted subject.Verification
&&prevented passing the file filter to Jest. Re-ran Jest directly with one file and --runInBand; no full suite is claimed.