Domain Language Adherence: 17% (Critical)
The codebase shows significant terminology drift from the medical/biological domain terminology. While core systems (Nervous, Circulatory, Immune, Skeletal, Muscular, Respiratory, Glial) use medical terminology, the UI system, visualization system, and infrastructure terms use generic technical terminology.
-
UI System (Critical): 12 legacy terms need migration to Skin system
- VisualNeuron → SkinCell (42 files affected)
- SensoryNeuron → Receptor (25 files affected)
- ComponentProps/State → System-specific types (100+ files affected)
-
Visualization System (High): 11+ generic chart terms need medical equivalents
- Chart → Visualization (10 files affected)
- All chart types need medical equivalents
-
Infrastructure (High): Server/Client/Bridge terms need medical equivalents
- Server → Organ/System (15 files affected)
- Client → Receptor/Effector (10 files affected)
-
Communication (Medium): EventBus/Event need Circulatory System terms
- EventBus → Heart/Artery (3 files affected)
-
Respiratory System (Medium): Router/Resource/Route need medical equivalents
- Router → Bronchus/Trachea (15 files affected)
- Resource → Oxygen/Nutrient (20 files affected)
- Total Terms Audited: 500+
- Direct Match: 85 terms (17%)
- Legacy/Deprecated: 12 terms (2.4%)
- Ambiguous/Confusing: 8 terms (1.6%)
- No Match: 395+ terms (79%)
- Misspelled: 0 terms (0%)
-
UI System: The entire UI system uses legacy terminology (VisualNeuron, SensoryNeuron, etc.) that should be migrated to Skin system terminology (SkinCell, Receptor, etc.) per SKIN_WEBNN_ARCHITECTURE.md.
-
Type System: Generic ComponentProps/ComponentState types are used throughout the codebase (100+ files). These should be system-specific (SkinCellProps, ReceptorProps, etc.).
-
Visualization System: All visualization components use generic "Chart" terminology. These should use "Visualization" or medical equivalents.
-
Infrastructure: Server/Client/Bridge terms are generic technical terms. These should use medical equivalents (Organ/System, Receptor/Effector, Synapse/Connection).
See DOMAIN_TERMINOLOGY_GLOSSARY.md for the complete Official Domain Terminology Glossary.
See AUDIT_FINDINGS.md for the complete audit findings with all categorized terms.
- Core medical/biological terms are correctly used
- Nervous System, Circulatory System, Immune System, Skeletal System, Muscular System, Respiratory System, Glial System terms are correct
- Theater System terms are correct
- VisualNeuron → should be SkinCell
- SensoryNeuron → should be Receptor
- MotorNeuron → should be Effector
- InterneuronUI → should be DermalLayer
- VisualAstrocyte → should be Adipocyte
- VisualOligodendrocyte → should be Melanocyte
- ComponentProps → should be system-specific
- ComponentState → should be system-specific
- Router → could mean network router or HTTP router (should be Bronchus/Trachea)
- Resource → generic technical term (should be Oxygen/Nutrient)
- ResourcePool → generic technical term (should be Alveolus/Capillary)
- Protocol → conflicts with Theater Protocol (should be Bronchus/Trachea)
- Route → generic technical term (should be Bronchiole)
- Adapter → generic technical term (should be Bronchus)
- EventBus → generic technical term (should be Heart/Artery)
- Event → generic technical term (should be BloodCell/Signal)
- Generic UI components: Button, Input, Select, Form, Modal, Card, Alert, Text, Radio, Checkbox
- Visualization terms: Chart, BarChart, LineChart, PieChart, ScatterPlot, ChartDataPoint, DataBounds, CanvasPoint
- Infrastructure terms: Server, Client, Bridge, WebSocketBridge, TheaterServer, HotReload
- Configuration terms: Config, Options, Settings, ServerConfig, ServerState
- Type system terms: ComponentProps, ComponentState, Props, State
- Testing terms: Test, Mock
- Communication terms: EventBus, Event
- Tools terms: DependencyAuditor, AuditReport, AuditOptions
See PRIORITIZED_REFACTORING_PLAN.md for the complete prioritized refactoring plan.
- VisualNeuron → SkinCell (42 files, Critical)
- ComponentProps → System-specific props (100+ files, Critical)
- ComponentState → System-specific state (100+ files, Critical)
- SensoryNeuron → Receptor (25 files, Critical)
- Button → TouchReceptor (5 files, High)
- Input → TextReceptor (5 files, High)
- Chart → Visualization (10 files, High)
- EventBus → Heart/Artery (3 files, High)
- Router → Bronchus/Trachea (15 files, High)
- Resource → Oxygen/Nutrient (20 files, High)
- Configuration terms (Config, Options, Settings)
- Respiratory system resource terms (DatabaseResource, CacheResource, StorageResource)
- Protocol adapters (RestAdapter, GraphQLAdapter, WebSocketAdapter)
- Component props/state (InputProps, SelectProps, FormProps, etc.)
- Testing terms (Test → Experiment/Hypothesis, Mock → Specimen/Model)
- Tools terms (DependencyAuditor → DependencyAnalyzer)
- Technical infrastructure terms that don't conflict with medical metaphor
- Storybook conventions (Story, StoryObj)
- Internal implementation details
See BLAST_RADIUS_ASSESSMENT.md for detailed blast radius assessment for each High Priority change.
-
VisualNeuron → SkinCell: 42 files affected, Critical risk
- Breaking: API, Type, Inheritance, Export
- Migration: Rename class, file, update 42 imports, 100+ type references
-
ComponentProps/State: 100+ files affected, Critical risk
- Breaking: Type system, Generic constraints
- Migration: Create system-specific types, update 100+ files
-
SensoryNeuron → Receptor: 25 files affected, Critical risk
- Breaking: API, Type, Inheritance, Export
- Migration: Rename class, file, update 25 imports, 50+ type references
See PHASING_AND_TDD_PLAN.md for the complete phasing strategy.
- 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.
Risk: Critical - Breaking changes to core UI system
Estimated Effort: 2 weeks
- 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.
Risk: High - Breaking changes to component library
Estimated Effort: 2 weeks
- 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.
Risk: Medium - Breaking changes to visualization system
Estimated Effort: 2 weeks
- EventBus → Heart / Artery
- Event → BloodCell / Signal
Rationale: Independent system. Can be done in parallel.
Risk: Medium - Breaking changes to communication system
Estimated Effort: 1 week
- 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.
Risk: Medium - Breaking changes to respiratory system
Estimated Effort: 2 weeks
- 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.
Risk: Medium - Breaking changes to infrastructure
Estimated Effort: 1 week
- 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.
Risk: Low - Internal tools, less breaking
Estimated Effort: 1 week
11 weeks (approximately 3 months) for complete refactoring
See PHASING_AND_TDD_PLAN.md for the complete TDD/Verification plan.
- Write Tests First: Before refactoring, write tests that assert the new terminology
- Update Tests During Refactoring: Update test imports, class names, type references, assertions
- Verify After Refactoring: Run full test suite, verify all tests pass, check test coverage
- Backward Compatibility (if needed): Create deprecated aliases, add deprecation warnings, document migration path
- 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)
-
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);
| Current Term | Location(s) | Proposed Term | Justification | Priority | Affected Files | Risk Level |
|---|---|---|---|---|---|---|
| VisualNeuron | src/ui/VisualNeuron.ts, src/ui/components/*.ts, src/visualization/*.ts (42 files) |
SkinCell | Per SKIN_WEBNN_ARCHITECTURE.md, VisualNeuron should be SkinCell. This is the base class for all UI components. | High | 42 | Critical |
| SensoryNeuron | src/ui/SensoryNeuron.ts, src/ui/components/Button.ts, src/ui/components/Input.ts, src/ui/components/Select.ts, src/ui/components/Radio.ts, src/ui/components/Checkbox.ts |
Receptor | Per SKIN_WEBNN_ARCHITECTURE.md, SensoryNeuron should be Receptor. Input components detect external stimuli. | High | 25 | Critical |
| MotorNeuron | src/ui/MotorNeuron.ts |
Effector | Per SKIN_WEBNN_ARCHITECTURE.md, MotorNeuron should be Effector. Action components produce responses. | High | 3 | High |
| InterneuronUI | src/ui/InterneuronUI.ts, src/ui/components/Form.ts, src/ui/components/Modal.ts, src/ui/components/Card.ts |
DermalLayer | Per SKIN_WEBNN_ARCHITECTURE.md, InterneuronUI should be DermalLayer. Container components provide structural support. | High | 8 | High |
| VisualAstrocyte | src/ui/glial/VisualAstrocyte.ts |
Adipocyte | Per SKIN_WEBNN_ARCHITECTURE.md, VisualAstrocyte should be Adipocyte. State storage in skin layer. | High | 3 | Medium |
| VisualOligodendrocyte | src/ui/glial/VisualOligodendrocyte.ts |
Melanocyte | Per SKIN_WEBNN_ARCHITECTURE.md, VisualOligodendrocyte should be Melanocyte. Rendering optimization in skin layer. | High | 3 | Medium |
| ComponentProps | src/ui/types.ts, src/ui/*.ts, src/visualization/*.ts (100+ files) |
SkinCellProps / ReceptorProps / EffectorProps / DermalLayerProps | Generic "ComponentProps" should be system-specific. Use SkinCellProps for base, ReceptorProps for inputs, EffectorProps for actions, DermalLayerProps for containers. | High | 100+ | Critical |
| ComponentState | src/ui/types.ts, src/ui/*.ts, src/visualization/*.ts (100+ files) |
SkinCellState / ReceptorState / EffectorState / DermalLayerState | Generic "ComponentState" should be system-specific. Use SkinCellState for base, ReceptorState for inputs, EffectorState for actions, DermalLayerState for containers. | High | 100+ | Critical |
| VisualNeuronConfig | src/ui/VisualNeuron.ts |
SkinCellConfig | Should match SkinCell naming. Configuration for skin cell components. | High | 1 | Medium |
| Button | src/ui/components/Button.ts |
TouchReceptor | Already exists in Skin system. Button is a touch/click receptor. | High | 5 | High |
| Input | src/ui/components/Input.ts |
TextReceptor | Already exists in Skin system. Input is a text receptor. | High | 5 | High |
| TestVisualNeuron | src/ui/__tests__/VisualNeuron.test.ts |
TestSkinCell | Test class should match production naming. | High | 1 | Low |
| Select | src/ui/components/Select.ts |
SelectReceptor / ChoiceReceptor | Needs medical equivalent. Select is a choice receptor. | High | 5 | High |
| Form | src/ui/components/Form.ts |
DermalLayer | Container component. Form coordinates multiple receptors. | High | 5 | High |
| Modal | src/ui/components/Modal.ts |
Membrane / Vesicle | Medical term for overlay. Membrane separates spaces, Vesicle contains content. | High | 5 | High |
| Card | src/ui/components/Card.ts |
DermalLayer / Epidermis | Container component. Card provides structural container. | High | 5 | High |
| Alert | src/ui/components/Alert.ts |
AlertReceptor / Nociceptor | Medical term for alerts. Nociceptor detects harmful stimuli. | High | 5 | High |
| Text | src/ui/components/Text.ts |
Keratinocyte / TextCell | Medical term for text display. Keratinocyte is a skin cell that displays content. | High | 5 | High |
| Radio | src/ui/components/Radio.ts |
RadioReceptor / ChoiceReceptor | Needs medical equivalent. Radio is a choice receptor. | High | 5 | High |
| Checkbox | src/ui/components/Checkbox.ts |
CheckReceptor / ToggleReceptor | Needs medical equivalent. Checkbox is a toggle receptor. | High | 5 | High |
| Chart | src/visualization/*.ts (4 files) |
Visualization / Graph | Generic "Chart" needs medical equivalent. Visualization is more precise. | High | 10 | High |
| BarChart | src/visualization/BarChart.ts |
BarVisualization / BarGraph | Needs medical equivalent. Bar visualization. | High | 3 | High |
| LineChart | src/visualization/LineChart.ts |
LineVisualization / LineGraph | Needs medical equivalent. Line visualization. | High | 3 | High |
| PieChart | src/visualization/PieChart.ts |
PieVisualization / PieGraph | Needs medical equivalent. Pie visualization. | High | 3 | High |
| ScatterPlot | src/visualization/ScatterPlot.ts |
ScatterVisualization / ScatterGraph | Needs medical equivalent. Scatter visualization. | High | 3 | High |
| ChartDataPoint | src/visualization/types.ts |
DataPoint / Measurement | Needs medical equivalent. Data point in visualization. | High | 5 | Medium |
| DataBounds | src/visualization/types.ts |
Bounds / Range | Needs medical equivalent. Data bounds for scaling. | High | 5 | Medium |
| CanvasPoint | src/visualization/types.ts |
Coordinate / Point | Needs medical equivalent. Canvas coordinate. | High | 5 | Medium |
| BaseChartProps | src/visualization/types.ts |
BaseVisualizationProps | Should match Visualization naming. | High | 5 | Medium |
| BaseChartState | src/visualization/types.ts |
BaseVisualizationState | Should match Visualization naming. | High | 5 | Medium |
| ChartTheme | src/visualization/types.ts |
VisualizationTheme | Should match Visualization naming. | High | 5 | Medium |
| Server | src/theater/server/TheaterServer.ts |
Organ / System | Medical term for server. Organ performs specific function. | High | 15 | Medium |
| Client | src/theater/server/WebSocketBridge.ts |
Receptor / Effector | Medical term for client. Receptor receives, Effector acts. | High | 10 | Medium |
| Bridge | src/theater/server/WebSocketBridge.ts |
Synapse / Connection | Medical term for bridge. Synapse connects neurons. | High | 5 | Medium |
| WebSocketBridge | src/theater/server/WebSocketBridge.ts |
WebSocketSynapse / WebSocketConnection | Medical term for WebSocket bridge. | High | 5 | Medium |
| TheaterServer | src/theater/server/TheaterServer.ts |
TheaterOrgan / TheaterSystem | Medical term for theater server. | High | 5 | Medium |
| ClientConnection | src/theater/server/WebSocketBridge.ts |
ReceptorConnection / EffectorConnection | Medical term for client connection. | High | 5 | Medium |
| EventBus | src/communication/EventBus.ts |
Heart / Artery | Should use Circulatory System terms. Heart is message broker, Artery is outgoing channel. | High | 3 | Medium |
| Event | src/types/index.ts, src/communication/*.ts |
BloodCell / Signal | Should use medical terminology. BloodCell carries messages, Signal is neural communication. | High | 10 | Medium |
| Router | src/respiratory/resources/Router.ts |
Bronchus / Trachea | Medical term for routing. Bronchus branches airways, Trachea is main airway. | High | 15 | Medium |
| Resource | src/respiratory/resources/Resource.ts |
Oxygen / Nutrient | Medical term for external resources. Oxygen/nutrients are external resources. | High | 20 | Medium |
| ResourcePool | src/respiratory/resources/ResourcePool.ts |
Alveolus / Capillary | Medical term for resource pooling. Alveolus exchanges oxygen, Capillary exchanges nutrients. | High | 10 | Medium |
| Route | src/respiratory/resources/Route.ts |
Bronchiole | Medical term for routing path. Bronchiole is small airway branch. | High | 10 | Medium |
- Classes: PascalCase (e.g.,
SkinCell,TouchReceptor) - Interfaces: PascalCase (e.g.,
SkinCellConfig,TouchReceptorProps) - Types: PascalCase (e.g.,
ReceptorType,SkinCellState) - Methods: camelCase (e.g.,
activate(),receive()) - Variables: camelCase (e.g.,
signalQueue,activationTime) - Constants: UPPER_SNAKE_CASE (e.g.,
MAX_RETRIES,DEFAULT_TTL)
- Create New Classes: Create new classes with medical names
- Update Imports: Update all imports to use new names
- Update Types: Update all type references
- Update Tests: Update all test files
- Update Documentation: Update all documentation
- Deprecate Old Names (if backward compatibility needed): Add deprecated aliases with warnings
- Remove Old Names: After migration period, remove deprecated aliases
If backward compatibility is required:
-
Create Deprecated Aliases:
/** @deprecated Use SkinCell instead */ export const VisualNeuron = SkinCell;
-
Add Deprecation Warnings:
/** @deprecated Use SkinCell instead */ export class VisualNeuron extends SkinCell { constructor(...args) { console.warn('VisualNeuron is deprecated. Use SkinCell instead.'); super(...args); } }
-
Document Migration Path: Create migration guide
-
Plan Removal Timeline: Set timeline for removing deprecated aliases (e.g., 2 major versions)
-
VisualNeuron → SkinCell:
- Mitigation: Create comprehensive migration guide
- Mitigation: Provide automated migration script
- Mitigation: Maintain backward compatibility for 2 major versions
-
ComponentProps/State → System-specific:
- Mitigation: Create type aliases for gradual migration
- Mitigation: Provide migration guide with examples
- Mitigation: Use TypeScript's type system to catch errors
-
SensoryNeuron → Receptor:
- Mitigation: Create migration guide
- Mitigation: Maintain backward compatibility
-
Chart → Visualization:
- Mitigation: Create migration guide
- Mitigation: Maintain backward compatibility
-
EventBus → Heart/Artery:
- Mitigation: Decide on single term (Heart or Artery)
- Mitigation: Create migration guide
-
Router → Bronchus/Trachea:
- Mitigation: Decide on single term (Bronchus or Trachea)
- Mitigation: Create migration guide
- All VisualNeuron references migrated to SkinCell
- All SensoryNeuron references migrated to Receptor
- All MotorNeuron references migrated to Effector
- All InterneuronUI references migrated to DermalLayer
- All VisualAstrocyte references migrated to Adipocyte
- All VisualOligodendrocyte references migrated to Melanocyte
- All ComponentProps references migrated to system-specific props
- All ComponentState references migrated to system-specific state
- All tests pass
- All type checking passes
- All exports work correctly
- Documentation updated
- 100% of High Priority changes completed
- 80% of Medium Priority changes completed
- All tests pass
- All type checking passes
- All builds succeed
- All exports work correctly
- Documentation updated
- No old terminology remains in production code
- Domain language adherence > 80%
This plan is now ready for critical review by the architecture and product teams before any implementation begins.
- Architecture team reviews terminology choices
- Product team reviews breaking changes
- Development team reviews implementation plan
- Testing team reviews TDD plan
- Documentation team reviews documentation updates
- Security team reviews security implications
- Performance team reviews performance implications
- Architecture team approval
- Product team approval
- Development team approval
- Testing team approval
- Create detailed migration guides for each phase
- Create automated migration scripts (if possible)
- Set up backward compatibility (if needed)
- Begin Phase 1 implementation
- Track progress and update plan as needed
See DOMAIN_TERMINOLOGY_GLOSSARY.md for the complete Official Domain Terminology Glossary.
See AUDIT_FINDINGS.md for the complete audit findings with all categorized terms.
See PRIORITIZED_REFACTORING_PLAN.md for the complete prioritized refactoring plan.
See BLAST_RADIUS_ASSESSMENT.md for detailed blast radius assessment for each High Priority change.
See PHASING_AND_TDD_PLAN.md for the complete phasing strategy and TDD/Verification plan.
Version: 1.0 Date: 2024 Status: Complete - Ready for Review Author: Domain Terminology & Codebase Refactoring Architect
This Comprehensive Refactoring Playbook is now complete and ready for critical review by the architecture and product teams before any implementation begins.