Skip to main content

Dead Code Cleanup Plan -- components/shopify/ Only

Scope

This plan covers dead code, unused exports, commented-out code, and code duplication exclusively within components/shopify/:

  • admin_server/
  • admin_ui/
  • storefront_search/
  • extensions/
  • e2e_tests/
  • test/ (top-level scaffold directory)
  • ui_tests/ (empty directory)

All reference checks were performed across the entire repo (not just shopify/) to avoid removing code consumed by external components such as ecom_utils, ecom_indexer, etc.


1. Definitely Dead Code (High Confidence -- Zero Callers Anywhere)

1.1 admin_server/models/configuration_settings.py -- Entire File Dead

This file defines FilterMode, ConfigurationOption, ConfigurationSettings, and get_default_configuration(). None of these symbols are imported by any file in the entire repo. The file was likely intended for a configuration management feature that was never wired up. The concepts it models (filter mode, debug mode, feature flags) are handled differently in the actual codebase.

FileLinesNotes
admin_server/models/configuration_settings.py1-118Entire file. Zero imports anywhere.

Confidence: Definitely dead.

1.2 admin_ui/src/types/uiTypes.ts -- Entire File Dead

This file defines a rich type system for UI components (TemplateUIComponent, ConfigUIComponent, StyleUIComponent, discriminated unions, type guards, factory functions, a migration helper, and a ConfigurationSettings interface). None of these types or functions are imported anywhere -- not in admin_ui/src/, not in tests, not anywhere in the repo.

The actual UI code uses the simpler types from apiTypes.ts instead.

FileLinesNotes
admin_ui/src/types/uiTypes.ts1-194Entire file. Zero imports anywhere.

Confidence: Definitely dead.

1.3 admin_ui/src/hooks/useProducts.ts -- Dead Hook

useGenerateProduct is defined and re-exported via useApi.ts but never called by any page or component. The only reference outside its own file is in tests that mock it but don't meaningfully test it. The related ProductGenerationResult type in apiTypes.ts is also only consumed by this dead hook (the same-named class in api_requests.py on the backend IS used by settings_routes.py).

FileLinesDead content
admin_ui/src/hooks/useProducts.ts1-13Entire file. useGenerateProduct never called from UI.
admin_ui/src/hooks/useApi.ts17Re-export line: export { useGenerateProduct } from "./useProducts"
admin_ui/src/types/apiTypes.ts29-52ProductGenerationResult type -- only used by dead useProducts.ts

Confidence: Definitely dead in frontend. Note: the backend endpoint /api/generate-product and its ProductGenerationResult model in api_requests.py are still in use.

1.4 admin_ui/entry.server.ts -- Dead Remix Artifact

This file imports @remix-run/architect and references ./build/server/index.js. The app was migrated from Remix to Vite SPA but this entry point was never cleaned up. It is not referenced by any config, script, or other file.

FileLinesNotes
admin_ui/entry.server.ts1-4Remix server entry point; app uses Vite now.

Confidence: Definitely dead.

1.5 admin_ui/env.d.ts -- Stale Remix Type Reference

Contains /// <reference types="@remix-run/architect" /> alongside the Vite reference. The Remix reference is dead since the app no longer uses Remix.

FileLinesDead content
admin_ui/env.d.ts2/// <reference types="@remix-run/architect" />

Confidence: Definitely dead (the Vite reference on line 1 should remain).

1.6 admin_ui/tailwind.config.js and postcss.config.js -- Dead Tailwind Setup

The Tailwind configuration points at ./app/**/*.tsx (Remix convention), but the source is in ./src/. No CSS file contains @tailwind directives. The admin_ui uses Shopify Polaris, not Tailwind. The @tailwindcss/typography dependency in package.json is also dead.

FileLinesNotes
admin_ui/tailwind.config.js1-8Unused; references non-existent ./app/ directory.
admin_ui/postcss.config.js1-6Only configures tailwindcss + autoprefixer; dead if tailwind removed.

Confidence: Definitely dead. Zero Tailwind usage in any source or CSS file.

1.7 admin_ui/test-route.js -- One-Off Debug Script

A standalone script that parses a hardcoded path string to demonstrate route generation logic. Not referenced by any config or npm script. Not a test file (no test framework assertions).

FileLinesNotes
admin_ui/test-route.js1-12One-off utility script, never run by anything.

Confidence: Definitely dead.

1.8 admin_server/utils/cursor_utils.py -- Never Imported

Defines encode_dynamodb_cursor and decode_dynamodb_cursor. Duplicated from admin_lambda/utils/cursor_utils.py. Zero imports within admin_server or anywhere in the repo (the admin_lambda copy is used by admin_lambda itself).

FileLinesNotes
admin_server/utils/cursor_utils.py1-31Zero imports. Duplicate of admin_lambda version.

Confidence: Definitely dead.

1.9 admin_server/utils/error_handlers.py -- SettingsErrorHandler Class Dead

The SettingsErrorHandler class (lines 20-133) is marked TODO and never called. The InputValidator class (lines 135-184) in the same file IS actively used by settings_routes.py and storefront_routes.py -- do NOT remove it.

FileLinesDead content
admin_server/utils/error_handlers.py5-13Imports of CriticalSettingsError, ExternalServiceError, RecoverableSettingsError, ValidationError (only used by dead SettingsErrorHandler)
admin_server/utils/error_handlers.py20-133SettingsErrorHandler class -- three methods, zero callers

Confidence: Definitely dead.

1.10 admin_server/exceptions/settings_exceptions.py -- Most Classes Dead

The exception hierarchy is only imported by error_handlers.py for the dead SettingsErrorHandler. Once that class is removed, the only remaining consumer disappears. The base SettingsError class is not used directly either.

FileLinesDead content
admin_server/exceptions/settings_exceptions.py12-69SettingsError, CriticalSettingsError, RecoverableSettingsError, ValidationError, ExternalServiceError -- zero direct callers

Note: CLAUDE.md references this exception pattern as aspirational documentation. Plans 03/04/05 propose adding new exception classes here. Recommendation: Keep the file but annotate it as "currently unused -- planned for adoption" OR remove it and recreate when actually needed.

Confidence: Definitely dead today. Probably intended for future use.

1.11 admin_server/models/enums.py -- Duplicate Enum Definitions

Five enum classes duplicate ecom_utils/models/enums.py and are never imported from this file. Only DocumentErrorType (lines 52-57) is actually used.

EnumLinesNotes
ApiKeyStatus11-16Duplicate, never imported from this file
JobType19-24Duplicate, never imported
SyncOperation27-32Duplicate, never imported
JobStatus35-42Duplicate, also missing CONFLICT value vs ecom_utils
MarqoModel45-49Duplicate, never imported

Confidence: Definitely dead. All callers use ecom_utils.models.enums.

1.12 admin_server/constants/sync.py -- Dead Demo Constants

Three demo timing constants are never referenced anywhere:

ConstantLineNotes
SyncProcessing.DEMO_PENDING_TO_PROGRESS_DELAY32Zero references
SyncProcessing.DEMO_PROGRESS_TO_COMPLETE_DELAY33Zero references
SyncProcessing.DEMO_CHUNK_PROCESSING_DELAY34Zero references

Confidence: Definitely dead.

1.13 admin_server/models/api_requests.py -- ProductCreateInput Dead

The ProductCreateInput Pydantic model (lines 56-60) is defined but never imported. The string "ProductCreateInput" appears in GraphQL mutations and docstrings but those are Shopify API references, not Python imports.

FileLinesDead content
admin_server/models/api_requests.py56-60ProductCreateInput class -- zero imports

Confidence: Definitely dead.

1.14 admin_server/graphql/queries/product_queries.py -- Unused Query Constants

Two GraphQL query constants are defined but never imported:

ConstantLinesNotes
LIST_PRODUCTS5-29Exported via __init__.py, zero imports outside graphql package
GET_VARIANT_INVENTORY_LEVELS263-287Not exported via __init__.py, zero imports anywhere

Confidence: Definitely dead.

1.15 admin_server/graphql/queries/collection_queries.py -- Unused Query Constants

Three GraphQL query constants are exported but never imported outside the graphql package:

ConstantLinesNotes
GET_COLLECTION_BY_ID5-32Exported, zero imports from services/handlers/routes
GET_COLLECTION_BASIC34-46Exported, zero imports
LIST_COLLECTIONS48-70Exported, zero imports

Note: GET_COLLECTION_PRODUCTS in the same file IS used by collection_webhook_handler.py.

Confidence: Definitely dead.

1.16 admin_server/graphql/mutations/product_mutations.py -- Unused Mutations

Five of seven mutation constants are never imported outside the graphql package:

ConstantLinesNotes
UPDATE_PRODUCT32-53Zero imports (only CREATE_PRODUCT and UPDATE_PRODUCT_VARIANTS_BULK are used)
DELETE_PRODUCT55-65Zero imports
CREATE_PRODUCT_VARIANT84-112Zero imports
UPDATE_PRODUCT_VARIANT114-142Zero imports
DELETE_PRODUCT_VARIANT144-155Zero imports

Confidence: Definitely dead. These are valid Shopify GraphQL mutations that could be useful for ad-hoc work, but they have zero programmatic callers.

1.17 admin_server/graphql/utils/query_builders.py -- Partially Dead

Several functions/classes are never called outside their own file:

SymbolLinesNotes
build_pagination_variables()52-81Only called by GraphQLVariableBuilder (itself dead)
build_metafield_variables()84-106Only called by GraphQLVariableBuilder (itself dead)
build_search_query()109-158Zero callers
GraphQLVariableBuilder class161-205Zero callers outside file
variables() factory209-211Zero callers

The following ARE used: build_graphql_id, build_product_id, build_variant_id, build_collection_id, extract_numeric_id.

Confidence: Definitely dead.

1.18 e2e_tests/e2e_tests/marqo/marqo_client_2.py -- Entire File Dead

Self-described as a "hack for a simpler API" with a TODO to replace. Zero imports anywhere.

FileLinesNotes
e2e_tests/e2e_tests/marqo/marqo_client_2.py1-56Never imported. Self-described hack.

Confidence: Definitely dead.

1.19 e2e_tests/e2e_tests/util/shared_helpers.py -- Re-export With Active Callers

Line 13 re-exports INDEX_READY_TIMEOUT_S "for backwards compatibility". Three test files still import it from shared_helpers rather than from e2e_tests.config.timeouts:

  • e2e_tests/e2e_tests/tests/ecom_onboarding_test.py (line 31)
  • e2e_tests/e2e_tests/tests/ecom_aliasing_test.py (line 35)
  • e2e_tests/e2e_tests/util/e2e_test_helpers_test.py (line 4)
FileLinesContent
e2e_tests/e2e_tests/util/shared_helpers.py13INDEX_READY_TIMEOUT_S = INDEX_READY_TIMEOUT_S re-export

Confidence: The re-export IS live today. It becomes dead only after the 3 callers are migrated. A prerequisite migration step is included in Phase 2 (step 17a).

1.20 test/ Directory -- Entire Scaffold Dead

The components/shopify/test/ directory is a Shopify CLI boilerplate app scaffold (Express backend, React frontend with product counter, etc.). It is not referenced by the parent package.json workspaces, no npm scripts reference it, and no code imports from it. It appears to be a tutorial/template that was generated during initial app scaffolding and never cleaned up.

DirectoryFilesNotes
components/shopify/test/~30+ filesFull Shopify CLI scaffold app, zero references from actual codebase

Confidence: Definitely dead.

1.21 ui_tests/ Directory -- Empty

Contains only a .DS_Store file. No test files, configs, or meaningful content.

DirectoryFilesNotes
components/shopify/ui_tests/1 (.DS_Store only)Empty directory

Confidence: Definitely dead.


2. Probably Dead Code (Medium Confidence -- Needs Discussion)

2.1 admin_server/app_lifecycle.py -- requires_scopes Decorator (Placeholder)

Lines 112-131 define a no-op decorator that is never applied to any route. It has a TODO for implementing scope checking.

Confidence: Probably dead. This is intentionally a placeholder for future work. If scope checking is not planned soon, it adds confusion.

2.2 admin_server/services/resource_provisioning_service.py -- Disabled S3 Methods

  • _add_s3_notification_for_shop (lines 421-514): Only call site is commented out (line 124)
  • _grant_s3_permission_to_sqs (lines 516-557): Only called by the above

Both are fully implemented but disabled. Comment says "S3 notifications temporarily disabled to prevent duplicate SQS messages."

Confidence: Probably dead. Intentionally preserved for future re-enablement. Recommend annotating with a clear "DISABLED" marker rather than removing.

2.3 admin_server/handlers/webhook_handler.py -- AppLifecycleWebhookHandler Stubs

Methods _handle_app_uninstall (lines 185-194) and _handle_scopes_update (lines 196-201) only log and return. They have TODOs for implementing actual cleanup and scope tracking logic.

Confidence: Not truly dead (they are registered and called), but they are no-ops. These are stubs awaiting implementation, not dead code to remove.

2.4 storefront_search/src/constants.ts -- API_PATHS.SEARCH and API_PATHS.COLLECTIONS

API_PATHS is imported in search-state.ts but only API_PATHS.UI_SEARCH is accessed. The API_PATHS.SEARCH ("/apps/marqo/search") and API_PATHS.COLLECTIONS ("/apps/marqo/collections") are the old App Proxy paths replaced by DIRECT_API_PATHS.

ConstantNotes
API_PATHS.SEARCHOld app proxy path, unused. Only UI_SEARCH is accessed.
API_PATHS.COLLECTIONSOld app proxy path, unused.

Confidence: Probably dead. The paths might be kept for reference but serve no runtime purpose.

2.5 storefront_search/src/constants.ts -- UIComponentKeyType Type Alias

Line 439: export type UIComponentKeyType = keyof typeof UIComponentKey; is exported but never imported anywhere.

Confidence: Probably dead. The UIComponentKey enum itself IS used.


3. Commented-Out Code Blocks

3.1 storefront_search/src/search-api.ts -- Lines 18-29

The old callAppProxy function is fully commented out (12 lines) with a note saying "using direct API route." This was replaced by callSearchProxy.

3.2 admin_server/handlers/test_bulk_sync_product_aware.py -- Lines 644-654

Two test stubs are fully commented out with TODO notes about fixing async context manager mocking.

3.3 admin_server/graphql/types/shopify_models.py -- Lines 386-387

Two lines of variant serialization are commented out with a TODO.

3.4 admin_server/handlers/webhook_handler.py -- Lines 199-200

Scopes update code is commented out within the _handle_scopes_update stub.


4. Code Duplication Within components/shopify/

4.1 extract_numeric_id vs extract_numeric_id_from_graphql_id

Two implementations of the same logic exist:

  • graphql/utils/query_builders.py:39 -- extract_numeric_id(graphql_id): Simple rsplit("/", 1)[-1], returns empty string on bad input
  • transformers/product_transformer.py:37 -- extract_numeric_id_from_graphql_id(graphql_id): Validates gid://shopify/ prefix, raises ValueError on bad input

Both are actively used by different callers:

  • query_builders.extract_numeric_id: used by collection_webhook_handler.py
  • product_transformer.extract_numeric_id_from_graphql_id: used by product_webhook_handler.py and collection_webhook_handler.py

Recommendation: Consolidate into one function (preferably the validating version) in a shared location (e.g., query_builders.py) and update all callers.

4.2 cursor_utils.py Duplication (admin_server vs admin_lambda)

The admin_server copy is dead (1.8 above) and the admin_lambda copy is the active one. If cursor utils are ever needed in admin_server, they should import from a shared location.


5. TODO/FIXME Inventory (Within components/shopify/ Scope)

These are not dead code but represent tracked tech debt:

LocationTODOCategory
admin_server/dependencies.py:345Follow DI convention like injectorArchitecture
admin_server/dependencies.py:527,635Remove once ShopifySettings backfilledMigration
admin_server/main.py:91Remove legacy analytics route prefixMigration
admin_server/main.py:112Serve marketing page at rootEnhancement
admin_server/app_lifecycle.py:84Move get_index_html to static_assets.pyRefactoring
admin_server/services/resource_provisioning_service.py:119S3 notifications disabledFeature toggle
admin_server/services/resource_provisioning_service.py:203Implement resource destructionMissing feature
admin_server/handlers/webhook_handler.py:187Implement uninstall cleanupMissing feature
admin_server/handlers/webhook_handler.py:198Update stored scopesMissing feature
admin_server/routes/sync_routes.py:50Improve time estimationEnhancement
admin_server/exceptions/settings_exceptions.py:11Use these in settings routesAdoption
admin_server/utils/error_handlers.py:19Use these in settings routesAdoption
admin_server/models/marqo_documents.py:118Move to ecom_utilsRefactoring
admin_server/graphql/types/shopify_models.py:389Remove duplicate option builderCleanup
admin_server/transformers/product_transformer.py:495Other images for variantEnhancement
admin_server/transformers/product_transformer.py:881Make configurableEnhancement
admin_server/transformers/product_transformer.py:975Recheck media/collections transformVerification
admin_server/handlers/collection_webhook_handler.py:403Get product ID from Marqo docEnhancement
admin_server/conftest.py:415Verify path proxy formatVerification
admin_server/services/index_settings_initialization_service.py:85,287,335,343,436,444,483Various config TODOsEnhancement
admin_ui/src/pages/index.tsx:40Fix loading state race conditionBug
storefront_search/src/filter-manager.ts:59,211Clean up filter removal and param schemaRefactoring
storefront_search/src/types.d.ts:95Remove variant fields after migrationMigration
storefront_search/src/vue/ProductCard.ts:386Laura Geller-specific badge logicCustomer-specific
e2e_tests (various)Multiple TODOs for test improvementsTest quality

6. Proposed Removal Order (Safest First)

Phase 1: Dead Files and Directories (Zero Risk -- No Callers)

  1. Delete admin_server/models/configuration_settings.py -- zero imports 1a. Update admin_server/CLAUDE.md -- Remove the reference to models/configuration_settings.py on line 117 under the "Settings" section. The line reads - **[models/configuration_settings.py](https://github.com/marqo-ai/cloud_control_plane/blob/445728d0a3ede69aeb9fa75d585b6d2547a443f9/docs/plans/...)** - Selector component configuration and will be stale after the file is deleted.
  2. Delete admin_ui/src/types/uiTypes.ts -- zero imports
  3. Delete admin_ui/src/hooks/useProducts.ts -- zero callers
  4. Delete admin_ui/entry.server.ts -- Remix artifact
  5. Delete admin_ui/test-route.js -- one-off debug script
  6. Delete admin_server/utils/cursor_utils.py -- zero imports
  7. Delete e2e_tests/e2e_tests/marqo/marqo_client_2.py -- zero imports
  8. Delete test/ directory -- unused scaffold (entire directory tree)
  9. Delete ui_tests/ directory -- empty

Phase 2: Dead Code in Active Files (Low Risk)

  1. Remove re-export line from admin_ui/src/hooks/useApi.ts (line 17: useGenerateProduct) 10a. Remove useGenerateProduct mock from admin_ui/tests/pages/index.test.tsx -- Remove the import of useGenerateProduct (line 7), the useGenerateProduct: vi.fn() mock (line 18), and the (useGenerateProduct as any).mockReturnValue(...) setup (lines 85-86) from the vi.mock("../../src/hooks/useApi", ...) block. The mock exists but exercises dead code; removing it alongside the hook prevents test breakage.
  2. Remove ProductGenerationResult type from admin_ui/src/types/apiTypes.ts (lines 29-52)
  3. Remove ProductCreateInput from admin_server/models/api_requests.py (lines 56-60)
  4. Remove Remix reference from admin_ui/env.d.ts (line 2)
  5. Remove dead Tailwind setup: delete admin_ui/tailwind.config.js, admin_ui/postcss.config.js, and remove @tailwindcss/typography from admin_ui/package.json
  6. Remove duplicate enums from admin_server/models/enums.py (lines 11-49, keep DocumentErrorType)
  7. Remove DEMO_* constants from admin_server/constants/sync.py (lines 32-34) 17a. Migrate INDEX_READY_TIMEOUT_S imports (prerequisite for 17b) -- Update the following 3 files to import INDEX_READY_TIMEOUT_S from e2e_tests.config.timeouts instead of e2e_tests.util.shared_helpers:
    • e2e_tests/e2e_tests/tests/ecom_onboarding_test.py (line 31)
    • e2e_tests/e2e_tests/tests/ecom_aliasing_test.py (line 35)
    • e2e_tests/e2e_tests/util/e2e_test_helpers_test.py (line 4) 17b. Remove INDEX_READY_TIMEOUT_S re-export from e2e_tests/util/shared_helpers.py (line 13) -- Safe only after 17a is complete.

Phase 3: Dead Classes/Functions in Active Files

  1. Remove SettingsErrorHandler class from admin_server/utils/error_handlers.py (lines 20-133) and its exception imports (lines 5-13, keeping only logging and HTTPException if needed)

  2. Evaluate admin_server/exceptions/settings_exceptions.py: Remove if no adoption is planned, or annotate with "PLANNED: not yet adopted" comment

  3. Remove unused query constants from graphql/queries/__init__.py: Remove exports for LIST_PRODUCTS, GET_COLLECTION_BY_ID, GET_COLLECTION_BASIC, LIST_COLLECTIONS

    WARNING -- GET_COLLECTION_BASIC branch dependency: The live worktree branch worktree-feat+cognito-login has a metaobject_webhook_handler.py that imports GET_COLLECTION_BASIC. If that branch merges before this cleanup runs, deleting the query will break it. Action: Before removing GET_COLLECTION_BASIC, check whether feat+cognito-login has merged. If it has merged, coordinate with the author to remove or migrate the import. If it has NOT merged, skip removing GET_COLLECTION_BASIC from this step and revisit after the branch state is resolved.

  4. Remove unused mutation constants from graphql/mutations/__init__.py: Remove exports for UPDATE_PRODUCT, DELETE_PRODUCT, CREATE_PRODUCT_VARIANT, UPDATE_PRODUCT_VARIANT, DELETE_PRODUCT_VARIANT (keep definitions in module file for ad-hoc use)

  5. Remove GET_VARIANT_INVENTORY_LEVELS from product_queries.py (lines 263-287)

  6. Remove dead functions from graphql/utils/query_builders.py: build_pagination_variables, build_metafield_variables, build_search_query, GraphQLVariableBuilder class, variables()

  7. Remove requires_scopes decorator from admin_server/app_lifecycle.py (lines 112-131)

Phase 4: Commented-Out Code Cleanup

  1. Remove commented-out callAppProxy from storefront_search/src/search-api.ts (lines 18-29)
  2. Remove commented-out test stubs from admin_server/handlers/test_bulk_sync_product_aware.py (lines 644-654)
  3. Remove commented-out variant serialization from graphql/types/shopify_models.py (lines 386-387)
  4. Remove dead API_PATHS.SEARCH and API_PATHS.COLLECTIONS from storefront_search/src/constants.ts
  5. Remove unused UIComponentKeyType type from storefront_search/src/constants.ts (line 439)

Phase 5: Code Duplication Consolidation

  1. Consolidate extract_numeric_id and extract_numeric_id_from_graphql_id into a single function. Move the validating version to query_builders.py (or create a shared graphql_utils.py module) and update all callers in product_webhook_handler.py, collection_webhook_handler.py, and product_transformer.py.

7. Testing Strategy

Before Any Changes

# Baseline: run full test suites for all affected components
pants test //components/shopify/admin_server::
pants test //components/shopify/e2e_tests/e2e_tests::

# TypeScript tests
cd components/shopify/storefront_search && npm test
cd components/shopify/admin_ui && npm test

Record baseline test results (counts, which pass).

After Phase 1 (File/Directory Deletions)

pants test //components/shopify/admin_server::
pants test //components/shopify/e2e_tests/e2e_tests::

Since these files have zero importers, deletion should not affect any test. If a test fails, it reveals an import we missed -- investigate before proceeding.

After Phase 2 (Dead Code in Active Files)

pants test //components/shopify/admin_server::
cd components/shopify/admin_ui && npm test

Pay special attention to:

  • admin_ui/tests/pages/index.test.tsx -- the useGenerateProduct mock must be removed per step 10a; verify tests still pass after removal
  • admin_server/routes/settings_routes_test.py -- uses InputValidator from error_handlers.py (do NOT break this when removing SettingsErrorHandler from the same file)

After Phase 3 (Class/Function Removals)

pants test //components/shopify/admin_server::
ruff check components/shopify/admin_server/

Ruff will catch any broken imports or unused import warnings introduced by the removals.

After Phase 4 (Comment Cleanup)

# Minimal verification
pants test //components/shopify/admin_server::
cd components/shopify/storefront_search && npm test

After Phase 5 (Duplication Consolidation)

pants test //components/shopify/admin_server::

Focus on tests in:

  • admin_server/handlers/test_product_webhook_handler.py
  • admin_server/handlers/test_collection_webhook_handler.py
  • admin_server/transformers/test_product_transformer.py

General Guidance

  • Make one commit per phase (or per sub-item for additional safety)
  • Run ruff after each Python change to catch import issues
  • Run TypeScript compilation (npx tsc --noEmit) after each TypeScript change
  • If a test references a deleted symbol, update the test to remove the reference
  • Do NOT run E2E tests locally -- those run in CI

8. Summary Statistics

CategoryItemsEst. Lines
Dead files to delete9 files + 2 directories~500+ lines
Dead code in active files15 items~400 lines
Commented-out code blocks5 blocks~30 lines
Dead constants/exports14 constants~150 lines
Code duplication to consolidate2 instances~30 lines net reduction
Total estimated removal~1100+ lines