Butkhuzi Code Boundary Hardening
Sprint 76 performed the first real Butkhuzi code-boundary hardening pass.
The goal was not extraction yet.
The goal was to reduce dependence on mixed svc-tenders surfaces where ownership was already clear.
What validation moved
Moved out of the mixed service-wide validator:
butkhuziComponentSchemabutkhuziReferenceMetaSchemaupsertButkhuziNormSchemarebuildButkhuziChunksSchema
New Butkhuzi-owned validation module:
Updated route dependency:
- services/svc-tenders/src/routes/registerButkhuziRoutes.ts now imports Butkhuzi validation from the local domain module rather than services/svc-tenders/src/validation.ts
Result:
- Butkhuzi validation no longer primarily lives in the mixed service-wide validation file
- route behavior stayed the same
- payload validation behavior stayed the same
- error shape stayed the same
What contracts and types were hardened
Sprint 75 already moved Butkhuzi contracts into:
Sprint 76 preserved and used that harder boundary:
- services/svc-tenders/src/butkhuzi/repository.ts continues to depend on local Butkhuzi contracts
- services/svc-tenders/src/routes/registerButkhuziRoutes.ts continues to depend on local Butkhuzi contracts
- services/svc-tenders/src/repository.ts now remains a compatibility re-export/delegation surface rather than the primary owner of Butkhuzi shapes
What mixed dependencies were reduced
Reduced in Sprint 76:
- direct Butkhuzi route dependence on mixed services/svc-tenders/src/validation.ts
Still mixed after Sprint 76:
- root repository compatibility delegation in services/svc-tenders/src/repository.ts
- shared shell auth/parser helpers used to build services/svc-tenders/src/routes/support/butkhuziRouteSupport.ts
- duplicated client-side Butkhuzi types in apps/web/src/portal/api.ts
- migration ownership in
services/svc-tenders/migrations
What still remains shared
Still shared on purpose:
- gateway route family in services/api/src/routes/butkhuzi.ts
- gateway auth enforcement
- service-shell auth ingress and principal resolution through
/auth/me - parser helpers adapted through services/svc-tenders/src/routes/support/butkhuziRouteSupport.ts
What still blocks runtime/bootstrap prep
Main remaining blockers:
- Root repository compatibility delegation still exists in services/svc-tenders/src/repository.ts
- Butkhuzi migration ownership is still in
svc-tenders - Portal client types still duplicate Butkhuzi contracts in apps/web/src/portal/api.ts
- Shared-shell auth/parser dependencies are still adapted from the
svc-tendershost shell
Takeaway
Sprint 76 did the first low-risk Butkhuzi boundary cleanup that directly helps extraction:
- contracts are domain-owned
- validation is now domain-owned
- route behavior is unchanged
- shared-shell residue is smaller and easier to describe honestly