Seal the api seam
- ~56 component modules import past the seam, e.g.
- settings/llm-profiles/llm-settings-local-view.tsx → ProfilesService
- chat/git-control-bar.tsx → getStoredConversationMetadata
Before
flowchart TB comp["components"] hooks["hooks"] api["api implementation"] comp --> hooks hooks --> api comp -. reaches through .-> api linkStyle 2 stroke:#dc2626,stroke-width:2.5px classDef m fill:#e2e8f0,stroke:#64748b,stroke-width:1.5px,color:#0f172a; class comp,hooks,api m;
After
flowchart TB comp["components"] hooks["hooks · the only seam"] api["api implementation"] comp --> hooks hooks --> api classDef m fill:#e2e8f0,stroke:#64748b,stroke-width:1.5px,color:#0f172a; classDef deep fill:#e2e8f0,stroke:#0f172a,stroke-width:3.5px,color:#0f172a; class comp,api m; class hooks deep;
ProblemComponents depend on the api's implementation, so its internals can't change without breaking them.
SolutionRoute every call through the hooks seam, then forbid the import path so the seam stays sealed.
Wins
- ▪Components testable in isolation
- ▪Implementation free to change
- ▪One enforced dependency direction