docs: mark Phase 3 complete, Phase 4 deferred in DRY migration roadmap

This commit is contained in:
saravanakumardb1 2026-03-20 08:06:37 -07:00
parent 0d8c0a5ffe
commit 470661e274

View File

@ -10,13 +10,13 @@
## Phase Overview
| Phase | Name | New Packages | Repos Touched | Est. Effort | Status |
| ----- | --------------------------------------------------- | ------------ | ------------- | ----------- | ------ |
| **0** | Quick Wins (no new packages) | 0 | 9 | 1 day | ✅ |
| **1** | `@bytelyst/fastify-auth` | 1 | 10 | 3 days | ✅ |
| **2** | `@bytelyst/backend-config` + DB_PROVIDER cleanup | 1 | 12 | 3 days | |
| **3** | Backend utilities (flags, telemetry, domain events) | 3 | 3 | 2 days | ⬜ |
| **4** | Web client DRY (telemetry, diagnostics, config) | 0 | 7 | 2 days | |
| Phase | Name | New Packages | Repos Touched | Est. Effort | Status |
| ----- | --------------------------------------------------- | ------------ | ------------- | ----------- | ----------- |
| **0** | Quick Wins (no new packages) | 0 | 9 | 1 day | ✅ |
| **1** | `@bytelyst/fastify-auth` | 1 | 10 | 3 days | ✅ |
| **2** | `@bytelyst/backend-config` + DB_PROVIDER cleanup | 1 | 12 | 3 days | |
| **3** | Backend utilities (flags, telemetry, domain events) | 2 | 3 | 2 days | ✅ |
| **4** | Web client DRY (telemetry, diagnostics, config) | 0 | 7 | 2 days | ⏸️ Deferred |
**Repos involved (9 product backends):**
@ -407,6 +407,10 @@ export function createBackendConfig<T extends z.ZodRawShape>(opts: {
**Commit:** `feat(backend-config): new package — composable Zod env schema factory`
**Completed commits:**
- common-plat: `08661bb` (create package, 8 tests)
### 2.2 Migrate all 9 product backends to `@bytelyst/backend-config`
**New `config.ts` per repo (example: NomGap):**
@ -435,6 +439,11 @@ export const config = createBackendConfig({
**Per-repo commit:** `refactor(backend): migrate config to @bytelyst/backend-config`
**Completed commits (Phase 2.2 + 2.3 combined — DB_PROVIDER included in base schema):**
- PeakPulse `71dc558`, LysnrAI `75153d7`, MindLyst `45b4c0d`, ChronoMind `0bda7dd`
- JarvisJr `df5c652`, NomGap `6611643`, FlowMonk `6ce2f17`, NoteLett `b04189d`, ActionTrail `1ee7a4e`
### 2.3 Add `DB_PROVIDER` to config schema in 3 older repos
All 9 repos already use `@bytelyst/datastore` in their `datastore.ts`. However, 3 older repos (LysnrAI, MindLyst, ChronoMind) read `DB_PROVIDER` directly from `process.env` inside `datastore.ts` instead of declaring it in their Zod config schema. This means `DB_PROVIDER` isn't validated at startup.
@ -507,6 +516,11 @@ export function createFlagRegistry(defaults: Record<string, boolean>): FlagRegis
**Commit:** `feat(backend-flags): new package — in-memory feature flag registry`
**Completed commits:**
- common-plat: `0d8c0a5` (create backend-flags + backend-telemetry packages)
- FlowMonk `afb3795`, ActionTrail `dc83702`
### 3.2 Create `packages/backend-telemetry/`
**Source:** Byte-for-byte identical code in FlowMonk + ActionTrail `backend/src/lib/telemetry.ts`
@ -532,6 +546,8 @@ export function createTelemetryBuffer(opts: { enabled: boolean }): TelemetryBuff
**Commit:** `feat(backend-telemetry): new package — server-side telemetry event buffer`
**(Completed in same commits as 3.1 above)**
### 3.3 Create `packages/domain-events/`
**Source:** Near-identical event bus infrastructure in FlowMonk + ActionTrail (~150 lines each)
@ -580,6 +596,8 @@ export function createDomainEventBus<TEvent extends { type: string }>(
**Commit:** `feat(domain-events): new package — typed event bus + SSE + webhook wiring`
**STATUS: DEFERRED** — FlowMonk and ActionTrail events.ts have diverged significantly (different event types, different wiring patterns). The ROI of a shared package is low for 2 repos with divergent implementations. Revisit if a 3rd product adopts the same event bus pattern.
### 3.4 Verification checkpoint
```bash