Scope: Migrate core UI base classes to Skin system terminology
Changes:
- VisualNeuron → SkinCell
- SensoryNeuron → Receptor
- MotorNeuron → Effector
- InterneuronUI → DermalLayer
- VisualAstrocyte → Adipocyte
- VisualOligodendrocyte → Melanocyte
- ComponentProps → System-specific props
- ComponentState → System-specific state
Rationale: Foundation for all UI components. Must be done first.
Dependencies: None
Risk: Critical - Breaking changes to core UI system
Estimated Effort: 2 weeks
Scope: Rename generic UI components to medical equivalents
Changes:
- Button → TouchReceptor
- Input → TextReceptor
- Select → SelectReceptor / ChoiceReceptor
- Form → DermalLayer
- Modal → Membrane / Vesicle
- Card → DermalLayer / Epidermis
- Alert → AlertReceptor / Nociceptor
- Text → Keratinocyte / TextCell
- Radio → RadioReceptor / ChoiceReceptor
- Checkbox → CheckReceptor / ToggleReceptor
Rationale: Depends on Phase 1. Components extend base classes.
Dependencies: Phase 1
Risk: High - Breaking changes to component library
Estimated Effort: 2 weeks
Scope: Rename visualization components to medical equivalents
Changes:
- Chart → Visualization
- BarChart → BarVisualization
- LineChart → LineVisualization
- PieChart → PieVisualization
- ScatterPlot → ScatterVisualization
- ChartDataPoint → DataPoint / Measurement
- DataBounds → Bounds / Range
- CanvasPoint → Coordinate / Point
- BaseChartProps → BaseVisualizationProps
- BaseChartState → BaseVisualizationState
- ChartTheme → VisualizationTheme
Rationale: Independent of UI system changes. Can be done in parallel with Phase 2.
Dependencies: None (but extends VisualNeuron which becomes SkinCell in Phase 1)
Risk: Medium - Breaking changes to visualization system
Estimated Effort: 2 weeks
Scope: Migrate communication terms to Circulatory System
Changes:
- EventBus → Heart / Artery
- Event → BloodCell / Signal
Rationale: Independent system. Can be done in parallel.
Dependencies: None
Risk: Medium - Breaking changes to communication system
Estimated Effort: 1 week
Scope: Rename respiratory system terms to medical equivalents
Changes:
- Router → Bronchus / Trachea
- Resource → Oxygen / Nutrient
- ResourcePool → Alveolus / Capillary
- Route → Bronchiole
- DatabaseResource → DatabaseOxygen / DatabaseNutrient
- CacheResource → CacheOxygen / CacheNutrient
- StorageResource → StorageOxygen / StorageNutrient
- RestAdapter → RestBronchus
- GraphQLAdapter → GraphQLBronchus
- WebSocketAdapter → WebSocketBronchus
- ProtocolAdapter → ProtocolBronchus
Rationale: Independent system. Can be done in parallel.
Dependencies: None
Risk: Medium - Breaking changes to respiratory system
Estimated Effort: 2 weeks
Scope: Rename infrastructure terms to medical equivalents
Changes:
- Server → Organ / System
- Client → Receptor / Effector
- Bridge → Synapse / Connection
- WebSocketBridge → WebSocketSynapse / WebSocketConnection
- TheaterServer → TheaterOrgan / TheaterSystem
- ClientConnection → ReceptorConnection / EffectorConnection
- HotReload → Regeneration / Renewal
- ServerConfig → OrganConfig / SystemConfig
- ServerState → OrganState / SystemState
- WebSocketConfig → WebSocketConnectionConfig
- HotReloadConfig → RegenerationConfig
Rationale: Independent system. Can be done in parallel.
Dependencies: None
Risk: Medium - Breaking changes to infrastructure
Estimated Effort: 1 week
Scope: Rename tools and testing terms to medical equivalents
Changes:
- DependencyAuditor → DependencyAnalyzer / DependencyInspector
- AuditReport → AnalysisReport / InspectionReport
- AuditOptions → AnalysisOptions / InspectionOptions
- Test → Experiment / Hypothesis (in test files)
- Mock → Specimen / Model (in test files)
Rationale: Less critical. Can be done last.
Dependencies: None
Risk: Low - Internal tools, less breaking
Estimated Effort: 1 week
-
Before Refactoring:
- Write tests asserting new terminology (SkinCell, Receptor, etc.)
- Write tests for backward compatibility (if needed)
- Document expected behavior
-
During Refactoring:
- Run existing tests to identify breaking changes
- Update test imports to use new names
- Update test class names (TestVisualNeuron → TestSkinCell)
- Update test type references (ComponentProps → SkinCellProps)
-
After Refactoring:
- Run full test suite
- Verify all tests pass
- Check for any remaining old terminology
- Verify exports work correctly
-
Update Test Imports:
// Before import { VisualNeuron } from '../VisualNeuron'; // After import { SkinCell } from '../SkinCell';
-
Update Test Class Names:
// Before class TestVisualNeuron extends VisualNeuron<...> {} // After class TestSkinCell extends SkinCell<...> {}
-
Update Type References:
// Before class TestComponent extends VisualNeuron<ComponentProps, ComponentState> {} // After class TestComponent extends SkinCell<SkinCellProps, SkinCellState> {}
-
Update Test Assertions:
// Before expect(component).toBeInstanceOf(VisualNeuron); // After expect(component).toBeInstanceOf(SkinCell);
-
Type Checking:
- Run
npm run type-check - Verify no type errors
- Verify all imports resolve correctly
- Run
-
Test Execution:
- Run
npm test - Verify all tests pass
- Check test coverage remains >90%
- Run
-
Build Verification:
- Run
npm run build - Verify build succeeds
- Verify no compilation errors
- Run
-
Export Verification:
- Check
src/ui/index.tsexports - Verify all exports work
- Test imports from external packages
- Check
-
Before Refactoring:
- Write tests asserting new component names
- Document component behavior
-
During Refactoring:
- Update component class names
- Update component file names
- Update component imports
- Update component type references
-
After Refactoring:
- Run component tests
- Verify all components work
- Check stories still work
-
Update Component Imports:
// Before import { Button } from '../components/Button'; // After import { TouchReceptor } from '../components/TouchReceptor';
-
Update Component Usage:
// Before const button = new Button({ ... }); // After const button = new TouchReceptor({ ... });
-
Update Component Types:
// Before const props: ButtonProps = { ... }; // After const props: TouchReceptorProps = { ... };
-
Component Tests:
- Run component-specific tests
- Verify all components render correctly
- Verify all components handle interactions correctly
-
Story Verification:
- Run Storybook
- Verify all stories work
- Verify component names in stories
-
Integration Tests:
- Run integration tests
- Verify components work together
- Verify no breaking changes
-
Before Refactoring:
- Write tests asserting new visualization names
- Document visualization behavior
-
During Refactoring:
- Update visualization class names
- Update visualization file names
- Update visualization imports
- Update visualization type references
-
After Refactoring:
- Run visualization tests
- Verify all visualizations render correctly
- Check data visualization works
-
Update Visualization Imports:
// Before import { BarChart } from '../visualization/BarChart'; // After import { BarVisualization } from '../visualization/BarVisualization';
-
Update Visualization Usage:
// Before const chart = new BarChart({ ... }); // After const chart = new BarVisualization({ ... });
-
Update Visualization Types:
// Before const props: BarChartProps = { ... }; // After const props: BarVisualizationProps = { ... };
-
Visualization Tests:
- Run visualization-specific tests
- Verify all visualizations render correctly
- Verify data visualization works
-
Visual Verification:
- Manually verify visualizations render correctly
- Verify charts display data correctly
- Verify interactions work
-
Before Refactoring:
- Write tests asserting new communication names
- Document communication behavior
-
During Refactoring:
- Update communication class names
- Update communication imports
- Update communication type references
-
After Refactoring:
- Run communication tests
- Verify event bus works correctly
- Check message routing works
-
Update Communication Imports:
// Before import { EventBus } from '../communication/EventBus'; // After import { Heart } from '../circulatory/core/Heart'; // OR import { Artery } from '../circulatory/core/Artery';
-
Update Communication Usage:
// Before const eventBus = new EventBus(); // After const heart = new Heart(); // OR const artery = new Artery('event-stream');
-
Communication Tests:
- Run communication-specific tests
- Verify event bus works correctly
- Verify message routing works
-
Integration Tests:
- Run integration tests
- Verify communication between systems works
- Verify no breaking changes
-
Before Refactoring:
- Write tests asserting new respiratory names
- Document respiratory behavior
-
During Refactoring:
- Update respiratory class names
- Update respiratory imports
- Update respiratory type references
-
After Refactoring:
- Run respiratory tests
- Verify routing works correctly
- Check resource management works
-
Update Respiratory Imports:
// Before import { Router } from '../respiratory/resources/Router'; // After import { Bronchus } from '../respiratory/resources/Bronchus';
-
Update Respiratory Usage:
// Before const router = new Router({ ... }); // After const bronchus = new Bronchus({ ... });
-
Respiratory Tests:
- Run respiratory-specific tests
- Verify routing works correctly
- Verify resource management works
-
Integration Tests:
- Run integration tests
- Verify respiratory system works with other systems
- Verify no breaking changes
-
Before Refactoring:
- Write tests asserting new infrastructure names
- Document infrastructure behavior
-
During Refactoring:
- Update infrastructure class names
- Update infrastructure imports
- Update infrastructure type references
-
After Refactoring:
- Run infrastructure tests
- Verify server works correctly
- Check hot reload works
-
Update Infrastructure Imports:
// Before import { TheaterServer } from '../theater/server/TheaterServer'; // After import { TheaterOrgan } from '../theater/server/TheaterOrgan';
-
Update Infrastructure Usage:
// Before const server = new TheaterServer({ ... }); // After const organ = new TheaterOrgan({ ... });
-
Infrastructure Tests:
- Run infrastructure-specific tests
- Verify server works correctly
- Verify hot reload works
-
Integration Tests:
- Run integration tests
- Verify infrastructure works with other systems
- Verify no breaking changes
-
Before Refactoring:
- Write tests asserting new tool names
- Document tool behavior
-
During Refactoring:
- Update tool class names
- Update tool imports
- Update tool type references
-
After Refactoring:
- Run tool tests
- Verify tools work correctly
- Check testing infrastructure works
-
Update Tool Imports:
// Before import { DependencyAuditor } from '../tools/dependency-auditor'; // After import { DependencyAnalyzer } from '../tools/dependency-analyzer';
-
Update Tool Usage:
// Before const auditor = new DependencyAuditor(); // After const analyzer = new DependencyAnalyzer();
-
Tool Tests:
- Run tool-specific tests
- Verify tools work correctly
- Verify analysis works
-
Testing Infrastructure:
- Run test suite
- Verify testing infrastructure works
- Verify no breaking changes
Before refactoring, write tests that assert the new terminology:
- Test that new class names exist
- Test that new class names work correctly
- Test that old class names are deprecated (if backward compatibility needed)
As you refactor:
- Update test imports
- Update test class names
- Update test type references
- Update test assertions
After refactoring:
- Run full test suite
- Verify all tests pass
- Check test coverage
- Verify no regressions
If backward compatibility is required:
- Create deprecated aliases
- Add deprecation warnings
- Document migration path
- Plan removal timeline
For each phase:
- All tests pass
- Type checking passes
- Build succeeds
- Exports work correctly
- Documentation updated
- No old terminology remains
- Integration tests pass
- Performance not degraded
- No breaking changes (or documented)
Last Updated: 2024 Status: Phasing & TDD Plan Complete