Pattern: Adding a new tool to the Unified Builder requires touching 1...
Documentation for Sessions
🎨 Pattern: Adding a new tool to the Unified Builder requires touching 1...
Date: 2026-02-26
Time: 12:54:47 UTC
Session: gspace1-142.18
Agent: angular
Confidence: 98%
Status: ✅ Documented
📋 Decision Context
Question:
Adding a new tool to the Unified Builder requires touching 10+ locations. What is the exact registration checklist and what breaks if you miss a step?
Task: Not specified
🎯 Decision Made
Chosen:
Create a formal 10-point checklist with file paths and failure modes
Options Considered:
- Document the pattern informally
- Create a formal 10-point checklist with file paths and failure modes
💭 Reasoning
ROOT CAUSE: Adding 'module-editor' as the 8th dock tool exposed 10 registration points, not the 7 documented in the plan. The plan missed 3 Record<ToolType, ...> objects that use exhaustive type checking. FULL CHECKLIST: (1) ToolType union in sidebar.types.ts — miss = TS error in TOOL_CONTENT_MAP. (2) TOOL_CONTENT_MAP in sidebar.types.ts — miss = TS error, exhaustive Record. (3) OrchestrationToolType in tool-orchestration.types.ts — miss = TS error in recommendations map. (4) Recommendations map in tool-orchestration.service.ts — miss = TS error, exhaustive Record. (5) BUILDER_DOCK_PANELS in unified-builder.component.ts — miss = panel not created in dock layout. (6) TOOL_TO_PANEL in unified-builder.component.ts — miss = tool can't find its panel. (7) TOOL_TABS in unified-builder.component.ts — miss = no tab/shortcut in toolbar. (8) getToolComponent() switch in unified-builder.component.ts — miss = 'Unknown tool type' error. (9) ToolSpecificState + DEFAULT_TOOL_STATE in unified-builder-state.service.ts — miss = TS error in getToolStateKey. (10) getToolStateKey() mapping in unified-builder.component.ts — miss = state persistence broken. (11) SidebarRegistryService.registerDefaults() — miss = no sidebar panels. FAILURE MODES: Steps 1-4 cause compile errors (caught). Steps 5-11 cause silent runtime failures (not caught). CONVENTION: When adding a builder tool, grep for 'Record<ToolType' and 'Record<OrchestrationToolType' to find ALL exhaustive maps.
📁 Files Involved
libs/libs-foundational/core-angular/src/lib/components/base-sidebar/sidebar.types.tslibs/libs-foundational/core-angular/src/lib/types/tool-orchestration.types.tslibs/libs-foundational/core-angular/src/lib/services/tool-orchestration.service.tslibs/libs-space/unified-builder/src/lib/components/unified-builder/unified-builder.component.tslibs/libs-space/unified-builder/src/lib/services/unified-builder-state.service.tslibs/libs-space/unified-builder/src/lib/services/sidebar-registry.service.ts
🔗 Related
- Decision ID:
dev_1772110487430_8ajnlw3 - Session: 142
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation