Butkhuzi Dependency Edge Map
This map lists the concrete dependency edges around the current Butkhuzi surface.
Route and runtime edges
| Source | Target | Dependency type | Verdict | Notes | | --- | --- | --- | --- | --- | | services/svc-tenders/src/server.ts | services/svc-tenders/src/routes/registerButkhuziRoutes.ts | shell route registration | should move into Butkhuzi later | Current runtime host is temporary | | services/svc-tenders/src/server.ts | route-support assembly | should stay temporary for now | Support builder currently depends on shell-owned auth/parser helpers | | services/svc-tenders/src/routes/registerButkhuziRoutes.ts | repository port dependency | should move into Butkhuzi later | Already narrow and extraction-friendly | | services/svc-tenders/src/routes/registerButkhuziRoutes.ts | contract/type dependency | should move into Butkhuzi later | Already domain-owned after Sprint 75 | | services/svc-tenders/src/routes/registerButkhuziRoutes.ts | validation schema dependency | unresolved | Schemas are still mixed into the service-wide validation file |
Persistence edges
| Source | Target | Dependency type | Verdict | Notes | | --- | --- | --- | --- | --- | | services/svc-tenders/src/butkhuzi/repository.ts | services/svc-tenders/src/butkhuzi/contracts.ts | domain contracts | should move into Butkhuzi later | Clean internal dependency | | services/svc-tenders/src/butkhuzi/repository.ts | services/svc-tenders/migrations/0009_butkhuzi_norms.sql | table ownership | should move into Butkhuzi later | Canonical Butkhuzi norms store | | services/svc-tenders/src/butkhuzi/repository.ts | services/svc-tenders/migrations/0012_butkhuzi_chunks.sql | search substrate ownership | should move into Butkhuzi later | Chunk table is Butkhuzi-specific | | services/svc-tenders/src/repository.ts | root compatibility delegation | should stay temporary for now | Transitional delegation only; not canonical owner |
Auth and gateway edges
| Source | Target | Dependency type | Verdict | Notes |
| --- | --- | --- | --- | --- |
| services/api/src/routes/butkhuzi.ts | BUTKHUZI_SERVICE_URL ?? TENDERS_SERVICE_URL | gateway seam | can remain shared after extraction | This is the right initial extraction seam |
| services/api/src/routes/butkhuzi.ts | gateway auth guard | can remain shared after extraction | Shared API auth behavior should stay intact |
| requireServiceAuth in services/svc-tenders/src/server.ts | auth/principal resolution | can remain shared after extraction | Service auth ingress should stay shared initially |
Web/client edges
| Source | Target | Dependency type | Verdict | Notes |
| --- | --- | --- | --- | --- |
| apps/web/src/portal/api.ts | /api/v1/butkhuzi/* | web client API dependency | can remain shared after extraction | Portal client already speaks gateway routes, not direct svc-tenders |
| apps/web/src/portal/api.ts | duplicated Butkhuzi types | unresolved | Current client types duplicate backend contracts |
| apps/web/src/app/[locale]/(portal)/kes/page.tsx | Butkhuzi portal client calls | should become API/service contract | KES consumes Butkhuzi through stable HTTP routes, which is good for extraction |
Event / background / infra edges
| Source | Target | Dependency type | Verdict | Notes |
| --- | --- | --- | --- | --- |
| Butkhuzi code search in services/svc-tenders/src/kafka | none found | Kafka/event dependency | can be absent | No real Kafka or outbox dependency found for Butkhuzi |
| services/svc-tenders/src/routes/registerButkhuziRoutes.ts | chunk rebuild transaction in repository | admin runtime dependency | should move into Butkhuzi later | Rebuild is synchronous and service-local today |
Takeaway
The current Butkhuzi dependency graph is favorable for later extraction:
- gateway seam already exists
- persistence is already on a dedicated repository file
- auth can remain shared initially
- no Kafka/outbox dependency complicates the first split
The main extraction-friction edges are:
- mixed validation ownership
- temporary root compatibility delegation
- duplicated web/client contract types
- runtime still hosted in
svc-tenders