Skip to content

Latest commit

 

History

History
1082 lines (865 loc) · 43.5 KB

File metadata and controls

1082 lines (865 loc) · 43.5 KB

Domain Terminology Refactoring: Align Codebase with Medical/Biological Terminology

Overview

This issue tracks the comprehensive refactoring of the entire codebase to align with medical/biological domain terminology (Ubiquitous Language). The goal is to ensure 100% adherence to medical/biological terminology throughout the codebase, reflecting the body and all that belongs to it.

Current Status

Health Score: 17% (Critical - Significant terminology drift)

  • 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%)

Critical Areas

  1. UI System (Critical): 12 legacy terms need migration to Skin system
  2. Type System (Critical): ComponentProps/ComponentState used in 100+ files
  3. Visualization System (High): 11+ generic chart terms need medical equivalents
  4. Infrastructure (High): Server/Client/Bridge terms need medical equivalents
  5. Communication (Medium): EventBus/Event need Circulatory System terms
  6. Respiratory System (Medium): Router/Resource/Route need medical equivalents

Reference Documents

All analysis and planning documents have been created:

  1. DOMAIN_TERMINOLOGY_GLOSSARY.md - Official Domain Terminology Glossary
  2. AUDIT_FINDINGS.md - Complete audit findings with categorized terms
  3. PRIORITIZED_REFACTORING_PLAN.md - Prioritized refactoring plan with 100+ changes
  4. BLAST_RADIUS_ASSESSMENT.md - Blast radius assessment for each High Priority change
  5. PHASING_AND_TDD_PLAN.md - 7-phase implementation strategy with TDD plan
  6. COMPREHENSIVE_REFACTORING_PLAYBOOK.md - Complete refactoring playbook

Implementation Phases

Phase 1: Core UI System Terminology (Week 1-2) - START HERE

Critical Changes:

  • VisualNeuronSkinCell (42 files affected)
  • SensoryNeuronReceptor (25 files affected)
  • MotorNeuronEffector (3 files affected)
  • InterneuronUIDermalLayer (8 files affected)
  • VisualAstrocyteAdipocyte (3 files affected)
  • VisualOligodendrocyteMelanocyte (3 files affected)
  • ComponentProps → System-specific props (SkinCellProps, ReceptorProps, EffectorProps, DermalLayerProps) (100+ files affected)
  • ComponentState → System-specific state (SkinCellState, ReceptorState, EffectorState, DermalLayerState) (100+ files affected)

Files to Update:

  • src/ui/VisualNeuron.tssrc/ui/SkinCell.ts
  • src/ui/SensoryNeuron.tssrc/ui/Receptor.ts
  • src/ui/MotorNeuron.tssrc/ui/Effector.ts
  • src/ui/InterneuronUI.tssrc/ui/DermalLayer.ts
  • src/ui/glial/VisualAstrocyte.tssrc/ui/glial/Adipocyte.ts
  • src/ui/glial/VisualOligodendrocyte.tssrc/ui/glial/Melanocyte.ts
  • src/ui/types.ts (add system-specific types)
  • All files in src/ui/components/ (18 files)
  • All files in src/visualization/ (10 files)
  • All test files in src/ui/__tests__/ (4 files)
  • All story files *.stories.ts (9 files)
  • src/ui/index.ts (update exports)

Migration Steps:

  1. Create new classes with medical names (SkinCell, Receptor, etc.)
  2. Update all imports (use find/replace carefully)
  3. Update all type references
  4. Update all class extensions
  5. Update exports in index files
  6. Update tests
  7. Update stories
  8. Run full test suite
  9. Verify type checking passes
  10. Verify build succeeds

Phase 2: UI Component Names (Week 3-4)

Changes:

  • ButtonTouchReceptor (5 files)
  • InputTextReceptor (5 files)
  • SelectSelectReceptor / ChoiceReceptor (5 files)
  • FormDermalLayer (5 files)
  • ModalMembrane / Vesicle (5 files)
  • CardDermalLayer / Epidermis (5 files)
  • AlertAlertReceptor / Nociceptor (5 files)
  • TextKeratinocyte / TextCell (5 files)
  • RadioRadioReceptor / ChoiceReceptor (5 files)
  • CheckboxCheckReceptor / ToggleReceptor (5 files)

Files to Update:

  • All component files in src/ui/components/
  • All component test files
  • All component story files
  • src/ui/components/index.ts

Phase 3: Visualization System (Week 5-6)

Changes:

  • ChartVisualization
  • BarChartBarVisualization
  • LineChartLineVisualization
  • PieChartPieVisualization
  • ScatterPlotScatterVisualization
  • ChartDataPointDataPoint / Measurement
  • DataBoundsBounds / Range
  • CanvasPointCoordinate / Point
  • BaseChartPropsBaseVisualizationProps
  • BaseChartStateBaseVisualizationState
  • ChartThemeVisualizationTheme

Files to Update:

  • All files in src/visualization/
  • src/visualization/index.ts

Phase 4: Communication System (Week 7)

Changes:

  • EventBusHeart / Artery (decide on single term)
  • EventBloodCell / Signal (decide on single term)

Files to Update:

  • src/communication/EventBus.ts
  • src/communication/index.ts
  • src/index.ts
  • All files using EventBus

Phase 5: Respiratory System (Week 8-9)

Changes:

  • RouterBronchus / Trachea (decide on single term)
  • ResourceOxygen / Nutrient (decide on single term)
  • ResourcePoolAlveolus / Capillary (decide on single term)
  • RouteBronchiole
  • DatabaseResourceDatabaseOxygen / DatabaseNutrient
  • CacheResourceCacheOxygen / CacheNutrient
  • StorageResourceStorageOxygen / StorageNutrient
  • RestAdapterRestBronchus
  • GraphQLAdapterGraphQLBronchus
  • WebSocketAdapterWebSocketBronchus
  • ProtocolAdapterProtocolBronchus

Files to Update:

  • All files in src/respiratory/
  • src/respiratory/index.ts

Phase 6: Infrastructure Terms (Week 10)

Changes:

  • ServerOrgan / System (decide on single term)
  • ClientReceptor / Effector (decide on single term)
  • BridgeSynapse / Connection (decide on single term)
  • WebSocketBridgeWebSocketSynapse / WebSocketConnection
  • TheaterServerTheaterOrgan / TheaterSystem
  • ClientConnectionReceptorConnection / EffectorConnection
  • HotReloadRegeneration / Renewal
  • ServerConfigOrganConfig / SystemConfig
  • ServerStateOrganState / SystemState
  • WebSocketConfigWebSocketConnectionConfig
  • HotReloadConfigRegenerationConfig

Files to Update:

  • All files in src/theater/server/
  • src/theater/index.ts

Phase 7: Tools & Testing Terms (Week 11)

Changes:

  • DependencyAuditorDependencyAnalyzer / DependencyInspector
  • AuditReportAnalysisReport / InspectionReport
  • AuditOptionsAnalysisOptions / InspectionOptions
  • TestExperiment / Hypothesis (in test files - optional)
  • MockSpecimen / Model (in test files - optional)

Files to Update:

  • src/tools/dependency-auditor.ts
  • Test files (optional - can keep Test/Mock for compatibility)

Planned Features & Components (Future Implementation)

This section lists all planned features and components from the roadmap and GitHub issues that need to use medical/biological terminology from the start.

Phase 3: Muscular System (Planned)

Core Components:

  • Muscle (base class for operations) - Already correct
  • MuscleGroup (operation composition) - Already correct
  • MuscleMemory (operation caching) - Already correct
  • MuscleCoordination (orchestration) - Already correct
  • Tendon (integration points) - Already correct

Built-in Muscles:

  • ComputeMuscleComputeMuscle (already correct)
  • TransformMuscleTransformMuscle (already correct)
  • AggregateMuscleAggregateMuscle (already correct)
  • FilterMuscleFilterMuscle (already correct)
  • SortMuscleSortMuscle (already correct)
  • MapMuscleMapMuscle (already correct)
  • ReduceMuscleReduceMuscle (already correct)

Phase 4: Circulatory System (Planned)

Core Components:

  • Heart (central message broker) - Already correct
  • Artery (outbound data streams) - Already correct
  • Vein (inbound data streams) - Already correct
  • Capillary (micro-channels) - Already correct
  • BloodCell (message envelope) - Already correct
  • Hemoglobin (data carrier) - Already correct

Phase 5: Respiratory System (Planned)

Core Components:

  • Lung (HTTP client/server) - Already correct
  • Alveoli (API endpoints) - Already correct
  • Diaphragm (breathing control) - Already correct
  • Bronchi (protocol adapters) - Already correct
  • Oxygen (external resources) - Already correct
  • CarbonDioxide (error exhaust) - Already correct

Protocol Adapters:

  • RestAdapterRestBronchus
  • GraphQLAdapterGraphQLBronchus
  • WebSocketAdapterWebSocketBronchus
  • SSEAdapterSSEBronchus
  • gRPCAdaptergRPCBronchus

Phase 6: Immune System (Planned)

Core Components:

  • WhiteBloodCell (threat detection) - Already correct
  • Antibody (authentication) - Already correct
  • TCell (authorization) - Already correct
  • BCell (error memory) - Already correct
  • Macrophage (cleanup & sanitization) - Already correct
  • Lymph (security context) - Already correct
  • Vaccine (security configuration) - Already correct

Phase 7: Endocrine System (Planned)

Core Components:

  • Gland (configuration provider) - Already correct
  • Hormone (configuration value) - Already correct
  • Receptor (config consumer) - Already correct (but conflicts with Skin Receptor - decide on naming)
  • Hypothalamus (feature flags) - Already correct
  • Pituitary (central control) - Already correct
  • Thyroid (performance tuning) - Already correct

Phase 8: Digestive System (Planned)

Core Components:

  • Mouth (data ingestion) - Already correct
  • Esophagus (data pipeline) - Already correct
  • Stomach (data processing) - Already correct
  • Intestine (data transformation) - Already correct
  • Liver (data cleansing) - Already correct
  • Enzyme (transformation functions) - Already correct

Phase 9: Skin Layer - Advanced Components (Planned)

Form Controls:

  • Select / DropdownSelectReceptor / ChoiceReceptor
  • CheckboxCheckReceptor / ToggleReceptor
  • RadioRadioReceptor / ChoiceReceptor
  • Toggle / SwitchToggleReceptor / SwitchReceptor
  • Slider / RangeRangeReceptor / SliderReceptor
  • DatePickerDateReceptor / TemporalReceptor
  • TimePickerTimeReceptor / TemporalReceptor
  • ColorPickerColorReceptor / VisualReceptor
  • FileUploadFileReceptor / UploadReceptor

Data Display:

  • TableDataTable / GridCell / TabularCell
  • TreeViewTreeCell / HierarchicalCell
  • ListListCell / CollectionCell
  • GridGridCell / MatrixCell
  • TimelineTimelineCell / ChronologicalCell
  • AccordionAccordionCell / ExpandableCell
  • TabsTabCell / TabularCell
  • BreadcrumbsBreadcrumbCell / NavigationCell

Navigation:

  • Menu / DropdownMenuMenuCell / NavigationCell
  • SidebarSidebarCell / LateralCell
  • NavbarNavbarCell / NavigationCell
  • PaginationPaginationCell / PageNavigationCell
  • Stepper / WizardStepperCell / ProgressiveCell
  • CommandPaletteCommandCell / PaletteCell

Feedback:

  • Modal / DialogMembrane / Vesicle
  • Toast / NotificationNotificationCell / AlertCell
  • AlertAlertReceptor / Nociceptor
  • ProgressBarProgressCell / ProgressIndicator
  • SkeletonLoaderSkeletonCell / LoadingCell
  • SpinnerSpinnerCell / LoadingCell
  • BadgeBadgeCell / IndicatorCell
  • TooltipTooltipCell / HintCell
  • PopoverPopoverCell / OverlayCell

Layout:

  • GridGridCell / MatrixCell
  • Flex / FlexContainerFlexCell / FlexibleCell
  • StackStackCell / LayeredCell
  • DividerDividerCell / SeparatorCell
  • SpacerSpacerCell / EmptyCell
  • ContainerContainerCell / WrapperCell
  • CardCardCell / Epidermis / DermalLayer

Advanced:

  • ChartVisualization (see Phase 3)
  • CodeEditorCodeCell / EditorCell
  • RichTextEditorRichTextCell / EditorCell
  • MarkdownViewerMarkdownCell / DocumentCell
  • PDFViewerPDFCell / DocumentCell
  • ImageCropperImageCell / ImageProcessor
  • AutocompleteAutocompleteReceptor / SuggestReceptor
  • ComboboxComboboxReceptor / SelectReceptor

Phase 10: Observability & Monitoring (Planned)

Core Components:

  • SensoryNerve (telemetry collection) - Already correct
  • HealthMonitor - Already correct
  • MetricsRegistry - Already correct
  • DashboardDashboardCell / MonitorCell

Phase 11: Developer Experience & Tooling (Planned)

CLI Components:

  • CLICLI (keep as-is, or use CommandLineInterface)
  • REPLREPL (keep as-is, or use InteractiveShell)
  • CodeGeneratorCodeGenerator / CodeSynthesizer
  • MigrationToolMigrationTool / MigrationAssistant

Build Tools:

  • BuildToolBuildTool / CompilationTool
  • BundleAnalyzerBundleAnalyzer / BundleInspector
  • CodeSplitterCodeSplitter / CodeDivider

Debug Tools:

  • DebuggerDebugger / DiagnosticTool
  • StateInspectorStateInspector / StateExplorer
  • PerformanceProfilerPerformanceProfiler / PerformanceAnalyzer
  • MemoryLeakDetectorMemoryLeakDetector / MemoryAnalyzer

Phase 12: Performance Optimization (Planned)

Optimization Components:

  • JITCompilerJITCompiler / RuntimeCompiler
  • ObjectPoolObjectPool / ObjectCache
  • MemoryArenaMemoryArena / MemoryPool
  • WorkerThreadPoolWorkerThreadPool / ThreadPool
  • CacheStrategyCacheStrategy / CachingStrategy
  • LazyLoaderLazyLoader / DeferredLoader
  • CompressorCompressor / CompressionTool

Phase 13: Advanced Data Patterns (Planned)

Core Patterns:

  • CQRSCQRS (keep as-is, or use CommandQuerySeparation)
  • EventStoreEventStore / EventRepository
  • EventStreamEventStream / EventFlow
  • SagaSaga / TransactionOrchestrator
  • OutboxOutbox / MessageOutbox
  • MaterializedViewMaterializedView / CachedView

Phase 14: Real-time Collaboration (Planned)

Core Components:

  • CRDTCRDT (keep as-is, or use ConflictFreeReplicatedDataType)
  • OperationalTransformOperationalTransform / OperationTransformer
  • PresenceTrackerPresenceTracker / PresenceMonitor
  • SyncEngineSyncEngine / SynchronizationEngine
  • CollaborativeEditorCollaborativeEditor / SharedEditor

Phase 15: AI & Machine Learning Integration (Planned)

Core Components:

  • MLPipelineMLPipeline / MachineLearningPipeline
  • ModelServingModelServing / ModelServer
  • ModelVersioningModelVersioning / ModelRegistry
  • AutoMLAutoML / AutomatedML
  • ExplainabilityExplainability / ModelExplanation

WebNN Integration:

  • WebNNWebNN (keep as-is)
  • NeuralNetworkNeuralNetwork / NeuralCircuit (already exists)
  • ModelOptimizerModelOptimizer / ModelCompressor
  • HardwareAcceleratorHardwareAccelerator / AccelerationEngine

Pre-trained Models:

  • TextClassifierTextClassifier / TextAnalysisModel
  • SentimentAnalyzerSentimentAnalyzer / SentimentModel
  • NamedEntityRecognizerNamedEntityRecognizer / EntityExtractor
  • ImageClassifierImageClassifier / ImageAnalysisModel
  • ObjectDetectorObjectDetector / ObjectRecognitionModel

Intelligent Features:

  • SmartAutocompleteSmartAutocomplete / IntelligentAutocomplete
  • ContentRecommenderContentRecommender / RecommendationEngine
  • AnomalyDetectorAnomalyDetector / AnomalyRecognition
  • PredictiveAnalyticsPredictiveAnalytics / PredictionEngine
  • PersonalizationEnginePersonalizationEngine / PersonalizationSystem

Phase 16: Edge Computing & Distributed Systems (Planned)

Core Components:

  • EdgeRuntimeEdgeRuntime / EdgeExecutionEnvironment
  • DistributedCacheDistributedCache / DistributedMemory
  • ServiceMeshServiceMesh / ServiceNetwork
  • GlobalStateSyncGlobalStateSync / GlobalSynchronization
  • EdgeOptimizerEdgeOptimizer / EdgeOptimizationEngine
  • DistributedTracingDistributedTracing / DistributedTraceSystem

Deployment Targets:

  • CloudflareWorkersCloudflareWorkers / CloudflareEdge
  • AWSLambdaAWSLambda / LambdaFunction
  • VercelEdgeFunctionsVercelEdgeFunctions / VercelEdge
  • DenoDeployDenoDeploy / DenoEdge

Phase 17: Testing & Quality Assurance Framework (Planned)

Testing Tools:

  • TestUtilitiesTestUtilities / TestingUtilities
  • MockFactoryMockFactory / SpecimenFactory
  • FixtureGeneratorFixtureGenerator / TestDataGenerator
  • SnapshotTesterSnapshotTester / SnapshotValidator
  • VisualRegressionTesterVisualRegressionTester / VisualTester

E2E Testing:

  • E2ETesterE2ETester / EndToEndTester
  • PlaywrightIntegrationPlaywrightIntegration / PlaywrightAdapter
  • PuppeteerIntegrationPuppeteerIntegration / PuppeteerAdapter
  • VisualTesterVisualTester / VisualRegressionTester
  • AccessibilityTesterAccessibilityTester / A11yTester

Load Testing:

  • LoadTesterLoadTester / LoadTestingTool
  • StressTesterStressTester / StressTestingTool
  • SoakTesterSoakTester / SoakTestingTool
  • SpikeTesterSpikeTester / SpikeTestingTool
  • ScalabilityTesterScalabilityTester / ScalabilityTestingTool

Contract Testing:

  • ContractTesterContractTester / ContractValidator
  • APIContractTesterAPIContractTester / APIContractValidator
  • ConsumerDrivenContractConsumerDrivenContract / ConsumerContract

Chaos Engineering:

  • ChaosEngineerChaosEngineer / ChaosTestingTool
  • FailureInjectorFailureInjector / FailureSimulator
  • LatencyInjectorLatencyInjector / LatencySimulator
  • NetworkPartitionSimulatorNetworkPartitionSimulator / PartitionSimulator
  • ResourceExhaustionSimulatorResourceExhaustionSimulator / ResourceSimulator

Test Coverage:

  • CoverageAnalyzerCoverageAnalyzer / CoverageTool
  • MutationTesterMutationTester / MutationTestingTool
  • PropertyBasedTesterPropertyBasedTester / PropertyTester

Phase 18: Enterprise Features (Planned)

Enterprise Components:

  • MultiTenancyMultiTenancy / TenantIsolation
  • TenantIsolationTenantIsolation / TenantSeparation
  • AuditTrailAuditTrail / AuditLog
  • ComplianceToolComplianceTool / ComplianceManager
  • GDPRComplianceGDPRCompliance / GDPRManager
  • HIPAAComplianceHIPAACompliance / HIPAAManager
  • SOC2ComplianceSOC2Compliance / SOC2Manager

Advanced Authorization:

  • HierarchicalRolesHierarchicalRoles / RoleHierarchy
  • DelegatedAdministrationDelegatedAdministration / DelegationSystem
  • TimeBasedAccessTimeBasedAccess / TemporalAccess
  • LocationBasedAccessLocationBasedAccess / SpatialAccess
  • RiskBasedAuthenticationRiskBasedAuthentication / RiskAssessment

Reporting:

  • UsageReporterUsageReporter / UsageAnalytics
  • PerformanceReporterPerformanceReporter / PerformanceAnalytics
  • SecurityReporterSecurityReporter / SecurityAnalytics
  • ComplianceReporterComplianceReporter / ComplianceAnalytics
  • CustomReportBuilderCustomReportBuilder / ReportGenerator
  • ScheduledReporterScheduledReporter / ScheduledReportGenerator

Billing & Metering:

  • UsageTrackerUsageTracker / UsageMonitor
  • QuotaManagerQuotaManager / QuotaSystem
  • RateLimiterRateLimiter / RateController
  • BillingIntegratorBillingIntegrator / BillingAdapter
  • InvoiceGeneratorInvoiceGenerator / InvoiceCreator
  • PaymentProcessorPaymentProcessor / PaymentHandler

SLA Management:

  • SLOManagerSLOManager / ServiceLevelManager
  • SLITrackerSLITracker / ServiceLevelTracker
  • ErrorBudgetErrorBudget / ErrorAllowance
  • UptimeMonitorUptimeMonitor / AvailabilityMonitor
  • IncidentManagerIncidentManager / IncidentSystem
  • PostMortemTemplatePostMortemTemplate / PostMortemGenerator

Phase 19: Plugin Ecosystem (Planned)

Plugin System:

  • PluginPlugin / Extension
  • PluginInterfacePluginInterface / ExtensionInterface
  • PluginLifecyclePluginLifecycle / ExtensionLifecycle
  • PluginIsolationPluginIsolation / ExtensionIsolation
  • PluginSandboxPluginSandbox / ExtensionSandbox
  • PluginDependenciesPluginDependencies / ExtensionDependencies
  • PluginVersioningPluginVersioning / ExtensionVersioning
  • PluginHotReloadPluginHotReload / ExtensionHotReload

Plugin APIs:

  • CoreExtensionPointCoreExtensionPoint / CoreHook
  • UIExtensionPointUIExtensionPoint / UIHook
  • DataExtensionPointDataExtensionPoint / DataHook
  • CLIExtensionPointCLIExtensionPoint / CLIHook
  • BuildExtensionPointBuildExtensionPoint / BuildHook

Plugin Development:

  • PluginCLIGeneratorPluginCLIGenerator / ExtensionGenerator
  • PluginTestingFrameworkPluginTestingFramework / ExtensionTestingFramework
  • PluginDebuggerPluginDebugger / ExtensionDebugger
  • PluginDocumentationGeneratorPluginDocumentationGenerator / ExtensionDocumentationGenerator

Plugin Distribution:

  • PluginMarketplacePluginMarketplace / ExtensionMarketplace
  • PluginDiscoveryPluginDiscovery / ExtensionDiscovery
  • PluginRatingsPluginRatings / ExtensionRatings
  • PluginReviewsPluginReviews / ExtensionReviews
  • PluginAnalyticsPluginAnalytics / ExtensionAnalytics

Official Plugins:

  • DatabasePluginDatabasePlugin / DatabaseAdapter
  • StoragePluginStoragePlugin / StorageAdapter
  • AuthPluginAuthPlugin / AuthAdapter
  • PaymentPluginPaymentPlugin / PaymentAdapter
  • EmailPluginEmailPlugin / EmailAdapter
  • AnalyticsPluginAnalyticsPlugin / AnalyticsAdapter

Plugin Security:

  • PermissionSystemPermissionSystem / CapabilitySystem
  • CapabilityBasedSecurityCapabilityBasedSecurity / CapabilitySecurity
  • CodeSigningCodeSigning / CodeVerification
  • SecurityAuditSecurityAudit / SecurityReview
  • VulnerabilityScannerVulnerabilityScanner / VulnerabilityDetector

Phase 20: Advanced UI & Visualization (Planned)

Visualization Components:

  • LineChartLineVisualization (see Phase 3)
  • BarChartBarVisualization (see Phase 3)
  • PieChartPieVisualization (see Phase 3)
  • ScatterPlotScatterVisualization (see Phase 3)
  • HeatmapHeatmapVisualization / HeatVisualization
  • NetworkGraphNetworkVisualization / GraphVisualization
  • TreeMapTreeMapVisualization / HierarchicalVisualization
  • GanttChartGanttVisualization / TimelineVisualization
  • RealTimeChartRealTimeVisualization / LiveVisualization
  • 3DChart3DVisualization / ThreeDimensionalVisualization

Canvas-based Rendering:

  • CanvasRendererCanvasRenderer / CanvasEngine
  • WebGLRendererWebGLRenderer / WebGLEngine
  • GPUAcceleratorGPUAccelerator / GPUEngine
  • CustomShaderCustomShader / ShaderProgram
  • ParticleSystemParticleSystem / ParticleEngine

Data Visualization:

  • GeographicMapGeographicMap / MapVisualization
  • NetworkTopologyNetworkTopology / TopologyVisualization
  • FlowDiagramFlowDiagram / FlowVisualization
  • SankeyDiagramSankeyDiagram / SankeyVisualization
  • ChordDiagramChordDiagram / ChordVisualization
  • ForceDirectedGraphForceDirectedGraph / ForceGraph

Interactive Features:

  • ZoomAndPanZoomAndPan / ZoomController
  • BrushSelectionBrushSelection / SelectionBrush
  • TooltipTooltip / HintCell (see Phase 9)
  • CrosshairsCrosshairs / CrosshairIndicator
  • AnnotationsAnnotations / AnnotationLayer
  • ExportToImageExportToImage / ImageExporter
  • ExportToPDFExportToPDF / PDFExporter

Animation System:

  • AnimationSystemAnimationSystem / AnimationEngine
  • SpringPhysicsSpringPhysics / SpringAnimation
  • EasingFunctionsEasingFunctions / EasingCurves
  • StaggeredAnimationsStaggeredAnimations / SequentialAnimations
  • GestureAnimationsGestureAnimations / GestureBasedAnimations
  • ScrollTriggeredAnimationsScrollTriggeredAnimations / ScrollAnimations
  • PageTransitionsPageTransitions / TransitionAnimations

3D Rendering:

  • WebGLRendererWebGLRenderer / WebGLEngine (duplicate)
  • ThreeJSIntegrationThreeJSIntegration / ThreeJSAdapter
  • 3DModelLoader3DModelLoader / ModelLoader
  • SceneManagerSceneManager / SceneController
  • CameraControlsCameraControls / CameraController
  • LightingLighting / LightSystem
  • MaterialsMaterials / MaterialSystem
  • TexturesTextures / TextureSystem

Advanced UI Patterns:

  • VirtualScrollingVirtualScrolling / VirtualList
  • InfiniteScrollingInfiniteScrolling / InfiniteList
  • WindowingWindowing / WindowManager
  • MasonryLayoutMasonryLayout / MasonryGrid
  • DragAndDropDragAndDrop / DragDropSystem
  • GestureRecognitionGestureRecognition / GestureSystem
  • TouchInteractionsTouchInteractions / TouchSystem
  • VoiceInteractionsVoiceInteractions / VoiceSystem

Theater System (Planned - Phase 6)

Core Components:

  • Theater - Already correct
  • Stage - Already correct
  • Amphitheater - Already correct
  • Specimen - Already correct
  • Observation - Already correct
  • Dissection - Already correct
  • Laboratory - Already correct
  • Experiment - Already correct
  • Hypothesis - Already correct
  • Atlas - Already correct
  • Protocol - Already correct
  • Instrument - Already correct
  • Microscope - Already correct

Microscope Tools:

  • SignalTracerSignalTracer / SignalTracker
  • StateExplorerStateExplorer / StateInspector
  • PerformanceProfilerPerformanceProfiler / PerformanceAnalyzer
  • HealthMonitorHealthMonitor / HealthChecker

Laboratory Components:

  • PetriDishPetriDish / TestContainer
  • CultureCulture / TestEnvironment
  • Experiment - Already correct

Atlas Components:

  • ComponentCatalogueComponentCatalogue / ComponentRegistry
  • DiagramDiagram / Visualization
  • Protocol - Already correct

Server & Hot Reload:

  • TheaterServerTheaterOrgan / TheaterSystem (see Phase 6)
  • HotReloadRegeneration / Renewal (see Phase 6)
  • WebSocketCommunicationWebSocketSynapse / WebSocketConnection (see Phase 6)

CLI & Configuration:

  • TheaterCLITheaterCLI / TheaterCommandLine
  • TheaterConfigurationTheaterConfiguration / TheaterConfig
  • SpecimenFileLoaderSpecimenFileLoader / SpecimenLoader

Planned UI Components (From GitHub Issues)

Manufacturing Components:

  • QuantumAssemblyQuantumAssembly / MultiPathAssembly (keep as-is or rename)
  • NeuralProductionLineNeuralProductionLine / IntelligentProductionLine (keep as-is or rename)
  • SynapticQualitySynapticQuality / NeuralQualityControl (keep as-is or rename)

Energy Components:

  • NeuralEnergyMonitorNeuralEnergyMonitor / IntelligentEnergyMonitor (keep as-is or rename)
  • SynapticGridControlSynapticGridControl / NeuralGridControl (keep as-is or rename)
  • QuantumEnergyOptimizerQuantumEnergyOptimizer / MultiSourceEnergyOptimizer (keep as-is or rename)

Agriculture Components:

  • QuantumHarvestQuantumHarvest / MultiScenarioHarvest (keep as-is or rename)

Note on "Quantum" and "Neural" Prefixes:

  • These components use "Quantum" and "Neural" prefixes which may not align with medical terminology
  • Consider renaming to more medical terms or keeping as domain-specific terminology
  • Decision needed: Should "Quantum" → "Multi" / "Parallel" / "Concurrent"?
  • Decision needed: Should "Neural" → "Intelligent" / "Adaptive" / keep as-is (since it's part of Nervous System)?

Implementation Guidelines

Naming Conventions

  1. Classes: PascalCase (e.g., SkinCell, TouchReceptor)
  2. Interfaces: PascalCase (e.g., SkinCellConfig, TouchReceptorProps)
  3. Types: PascalCase (e.g., ReceptorType, SkinCellState)
  4. Methods: camelCase (e.g., activate(), receive())
  5. Variables: camelCase (e.g., signalQueue, activationTime)
  6. Constants: UPPER_SNAKE_CASE (e.g., MAX_RETRIES, DEFAULT_TTL)

Migration Strategy

  1. Create New Classes: Create new classes with medical names
  2. Update Imports: Update all imports to use new names
  3. Update Types: Update all type references
  4. Update Tests: Update all test files
  5. Update Documentation: Update all documentation
  6. Backward Compatibility (if needed): Add deprecated aliases with warnings
  7. Remove Old Names: After migration period, remove deprecated aliases

Backward Compatibility

For critical breaking changes, consider adding deprecated aliases:

/** @deprecated Use SkinCell instead. Will be removed in v2.0.0 */
export const VisualNeuron = SkinCell;

/** @deprecated Use SkinCell instead. Will be removed in v2.0.0 */
export class VisualNeuron extends SkinCell {
  constructor(...args: ConstructorParameters<typeof SkinCell>) {
    console.warn('VisualNeuron is deprecated. Use SkinCell instead.');
    super(...args);
  }
}

Testing Requirements

Before Each Phase

  • Write tests asserting new terminology (if applicable)
  • Document expected behavior
  • Review test coverage

During Each Phase

  • Update test imports to use new names
  • Update test class names (TestVisualNeuron → TestSkinCell)
  • Update test type references
  • Update test assertions
  • Run tests frequently to catch issues early

After Each Phase

  • Run full test suite: npm test
  • Verify all tests pass: npm test -- --passWithNoTests
  • Check test coverage: npm run test:coverage
  • Verify type checking: npm run type-check
  • Verify build succeeds: npm run build
  • Verify linting passes: npm run lint
  • Verify no old terminology remains (grep for old names)
  • Verify exports work correctly
  • Update documentation

Acceptance Criteria

Phase 1 (Critical)

  • 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 builds succeed
  • All linting passes
  • All exports work correctly
  • Documentation updated
  • No old terminology remains in production code

Overall Success Criteria

  • 100% of High Priority changes completed
  • 80% of Medium Priority changes completed
  • All tests pass: npm test
  • All type checking passes: npm run type-check
  • All builds succeed: npm run build
  • All linting passes: npm run lint
  • All exports work correctly
  • Documentation updated
  • No old terminology remains in production code
  • Domain language adherence > 80%

Verification Checklist (Per Phase)

After completing each phase, verify:

  • All tests pass: npm test
  • Type checking passes: npm run type-check
  • Build succeeds: npm run build
  • Linting passes: npm run lint
  • Exports work correctly
  • Documentation updated
  • No old terminology remains (grep for old names)
  • Integration tests pass
  • Performance not degraded
  • No breaking changes (or documented with deprecation warnings)

Risk Mitigation

High Risk Changes

  1. VisualNeuron → SkinCell (42 files, Critical)

    • Create comprehensive migration guide
    • Consider backward compatibility aliases
    • Test thoroughly before merging
  2. ComponentProps/State → System-specific (100+ files, Critical)

    • Create type aliases for gradual migration
    • Use TypeScript's type system to catch errors
    • Test type checking thoroughly
  3. SensoryNeuron → Receptor (25 files, Critical)

    • Create migration guide
    • Consider backward compatibility

Testing Strategy

  1. Before Refactoring: Write tests asserting new terminology
  2. During Refactoring: Update tests as you go
  3. After Refactoring: Run full test suite, verify coverage

Decision Points

Before starting, decide on these ambiguous terms:

  1. EventBus → Heart or Artery?

    • Recommendation: Use Heart (already exists, is message broker)
  2. Event → BloodCell or Signal?

    • Recommendation: Use BloodCell for messages, Signal for neural communication
  3. Router → Bronchus or Trachea?

    • Recommendation: Use Bronchus (branches airways, more flexible)
  4. Resource → Oxygen or Nutrient?

    • Recommendation: Use Oxygen (more specific, fits respiratory metaphor)
  5. ResourcePool → Alveolus or Capillary?

    • Recommendation: Use Alveolus (exchanges oxygen, fits pooling metaphor)
  6. Server → Organ or System?

    • Recommendation: Use Organ (more specific, fits medical metaphor)
  7. Client → Receptor or Effector?

    • Recommendation: Use Receptor (receives, fits client role)
  8. Bridge → Synapse or Connection?

    • Recommendation: Use Synapse (connects neurons, fits bridge role)
  9. HotReload → Regeneration or Renewal?

    • Recommendation: Use Regeneration (cells regenerate, fits hot reload)

Notes

  • Do NOT break existing functionality - All tests must pass
  • Do NOT introduce linting errors - All linting must pass
  • Do NOT break type checking - All type checking must pass
  • Do NOT break builds - All builds must succeed
  • Consider backward compatibility - Add deprecated aliases if needed
  • Update documentation - Keep documentation in sync
  • Test thoroughly - Run full test suite after each phase
  • Commit frequently - Small, focused commits per change
  • Review carefully - Code review before merging

Project Rename Analysis: Synapse → Full Body Metaphor

Current State

Current Name: "Synapse Framework"

  • Package: @synapse-framework/core
  • CLI: synapse
  • Repository: synapse
  • Description: "Neural-inspired TypeScript framework"

The Problem

"Synapse" is too narrow - it only refers to the Nervous System (a synapse is a connection between neurons). However, the framework has expanded to include the entire body metaphor:

Current Systems (Implemented + Planned):

  • Nervous System (Synapse is part of this)
  • Skeletal System (Bone, Schema, validation)
  • Skin Layer (SkinCell, Receptor, Effector)
  • Muscular System (Muscle, MuscleGroup, operations)
  • Circulatory System (Heart, Artery, Vein, BloodCell)
  • Respiratory System (Lung, Alveoli, Diaphragm, Bronchi)
  • Immune System (TCell, BCell, Macrophage, WhiteBloodCell)
  • Endocrine System (Gland, Hormone, Receptor)
  • Digestive System (Mouth, Esophagus, Stomach, Intestine)
  • Theater System (Stage, Specimen, Laboratory, Experiment)

Conclusion: The framework is about the entire body/organism, not just the nervous system.

Rename Options

Option 1: Anatomy Framework ⭐ (Recommended)

Pros:

  • ✅ Reflects the entire body structure
  • ✅ Medical/biological terminology
  • ✅ Clear and professional
  • ✅ "Anatomy" = study of body structure (perfect fit)
  • ✅ Package: @anatomy-framework/core
  • ✅ CLI: anatomy

Cons:

  • ⚠️ Breaking change for existing users
  • ⚠️ Repository rename needed
  • ⚠️ Package name change needed

Tagline: "A TypeScript framework inspired by human anatomy"

Option 2: Organism Framework

Pros:

  • ✅ Reflects the entire living system
  • ✅ Biological terminology
  • ✅ Emphasizes systems working together
  • ✅ Package: @organism-framework/core
  • ✅ CLI: organism

Cons:

  • ⚠️ Less specific than "Anatomy"
  • ⚠️ Might sound too generic
  • ⚠️ Breaking change

Tagline: "A TypeScript framework inspired by biological organisms"

Option 3: Physiology Framework

Pros:

  • ✅ Reflects body functions (physiology = how body works)
  • ✅ Medical terminology
  • ✅ Emphasizes systems and their functions
  • ✅ Package: @physiology-framework/core
  • ✅ CLI: physiology

Cons:

  • ⚠️ Less well-known term than "Anatomy"
  • ⚠️ Breaking change
  • ⚠️ Might be confused with medical education

Tagline: "A TypeScript framework inspired by human physiology"

Option 4: Body Framework

Pros:

  • ✅ Simple and clear
  • ✅ Immediately understandable
  • ✅ Package: @body-framework/core
  • ✅ CLI: body

Cons:

  • ⚠️ Too generic (could be confused with CSS frameworks)
  • ⚠️ Less professional sounding
  • ⚠️ Breaking change

Tagline: "A TypeScript framework inspired by the human body"

Option 5: Keep "Synapse" but Rebrand

Pros:

  • ✅ No breaking changes
  • ✅ Existing brand recognition
  • ✅ Can expand meaning: "Synapse = connection between all body systems"

Cons:

  • ⚠️ Still narrow - synapse is specifically nervous system
  • ⚠️ Doesn't reflect full body metaphor
  • ⚠️ Might confuse users when they see "Muscle", "Heart", "Lung" but framework is called "Synapse"

Tagline: "A TypeScript framework inspired by biological systems" (vague)

Impact Assessment

Breaking Changes Required:

  1. Package Name: @synapse-framework/core@anatomy-framework/core

    • All imports need updating
    • NPM package republish
    • Documentation updates
  2. CLI Command: synapseanatomy

    • All scripts need updating
    • Documentation updates
    • User migration guide needed
  3. Repository Name: synapseanatomy (or anatomy-framework)

    • GitHub repository rename
    • All URLs change
    • CI/CD updates
    • Badge URLs update
  4. Documentation:

    • All README files
    • All code examples
    • All API documentation
    • All guides and tutorials
  5. Code References:

    • Framework metadata in src/index.ts
    • All documentation files
    • All markdown files

Migration Strategy

If renaming, recommend:

  1. Phase 1: Create new package name, keep old one as alias

    {
      "name": "@anatomy-framework/core",
      "synapse": "@anatomy-framework/core"  // Alias
    }
  2. Phase 2: Update all documentation to use new name

  3. Phase 3: Deprecate old package name (6 months)

  4. Phase 4: Remove old package name

Recommendation

Recommendation: Rename to "Anatomy Framework"

Rationale:

  1. Accurate: Reflects the entire body metaphor, not just nervous system
  2. Professional: Medical terminology that's well-understood
  3. Clear: "Anatomy" = study of body structure (perfect fit)
  4. Consistent: Aligns with all the body system terminology already in use
  5. Future-proof: Works for all planned systems

Timing:

  • Best time: Before v1.0.0 (currently v0.1.0)
  • Reason: Less breaking change impact before major release
  • Strategy: Do it now while still in early development

Alternative if keeping current name:

  • Keep "Synapse" but update tagline to: "A TypeScript framework inspired by biological systems"
  • Add note in README: "Synapse connects all body systems, just as synapses connect neurons"
  • Accept that name is narrower than scope

Decision Matrix

Option Accuracy Professional Breaking Change Brand Recognition Score
Anatomy ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⚠️⚠️⚠️ ⭐⭐ 18/20
Organism ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⚠️⚠️⚠️ 15/20
Physiology ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⚠️⚠️⚠️ 14/20
Body ⭐⭐⭐ ⭐⭐ ⚠️⚠️⚠️ 10/20
Keep Synapse ⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐ 13/20

Next Steps

If proceeding with rename:

  1. Update package.json with new name
  2. Update all documentation files
  3. Update repository name (GitHub settings)
  4. Create migration guide for users
  5. Update CI/CD configurations
  6. Publish new package to NPM
  7. Deprecate old package (6 months notice)

Questions to Consider

  1. Is the project mature enough for a rename? (Currently v0.1.0 - YES, perfect time)
  2. How many users would be affected? (Check GitHub stars, NPM downloads)
  3. Is brand recognition important? (If yes, consider keeping "Synapse")
  4. Do we want to emphasize "body" or "systems"? (Anatomy = body, Organism = systems)

Reference

See COMPREHENSIVE_REFACTORING_PLAYBOOK.md for complete details. See PROJECT_RENAME_ANALYSIS.md for detailed project rename analysis.


Status: Ready for Implementation
Priority: High
Estimated Effort: 11 weeks (7 phases) + Project rename (if decided)
Assignee: TBD
Labels: refactoring, domain-terminology, breaking-change, high-priority