ICPI Dependency Edge Map
Status: ACTIVE
Sprint: Extraction Prep Sprint 44
Purpose
This document maps the current dependency edges around ICPI and classifies whether each edge is:
- acceptable shared dependency after extraction
- something that should become an API/service contract
- something that should be duplicated or re-homed locally
- something that should be removed before extraction
- unresolved
Dependency Edges
| Dependency edge | Current source -> target | Type | Verdict | Notes |
| --- | --- | --- | --- | --- |
| ICPI route flow -> ICPI repository | registerIcpiRoutes.ts -> src/icpi/repository.ts | route -> repository | must move together | This is the core ICPI backend seam |
| ICPI route flow -> ICPI support builder | registerIcpiRoutes.ts -> routes/support/icpiRouteSupport.ts | route -> support | must move together or collapse locally | Useful only as long as shell helpers remain external |
| ICPI support builder -> shell auth helper | -> in | auth/principal | acceptable shared dependency after extraction, but direct shell dependency must be replaced | Shared auth is fine; helper reach-in is not |
| ICPI support builder -> shell parser helpers | -> , , , , in | parser/helper | should be duplicated locally inside ICPI later | These are generic enough to copy or re-home |
| ICPI route flow -> mixed validation module | -> in | validation/schema | should be removed before extraction | Current schema home is mixed-domain |
| ICPI route flow -> root repository type exports | -> ICPI types in | type surface | should be removed before extraction | Mixed root type hosting is a real extraction blocker |
| ICPI repository -> root repository type exports | -> ICPI types in | type surface | should be removed before extraction | Persistence already moved; types did not |
| Root repository -> ICPI repository | -> | compatibility delegation | should be removed before extraction | Compatibility-only, not core ICPI ownership |
| Service shell -> ICPI route registration | -> | shell/server wiring | should be converted to API/service contract | Current monolith host seam |
| Service shell -> ICPI repository instantiation | -> | shell/server wiring | should be converted to API/service contract | Current host bootstrap only |
| Gateway -> ICPI host | -> | API/service contract | acceptable shared dependency after extraction | This is the best current extraction seam |
| Gateway upsert auth -> shared auth | -> auth service | auth/principal | acceptable shared dependency after extraction | Shared Kvary backbone concern |
| Web portal client -> gateway ICPI routes | -> | UI/client -> API | acceptable shared dependency after extraction | Preferred public contract for web should stay here |
| ICPI portal page -> portal client | -> | UI consumption | acceptable shared dependency after extraction | Product-distinct UI already exists |
| ICPI -> Kafka / outbox / KES event runtime | no direct edge found | event/runtime | acceptable as no dependency | No ICPI topic, outbox trigger, or consumer was found |
| ICPI -> upload/storage | no direct edge found | upload/storage | acceptable as no dependency | No storage blocker |
| Web contract types -> service contract types | local ICPI types vs service-side ICPI types | contract/type duplication | unresolved | Strong drift risk unless contracts are shared or generated |