Parent Epic
#11831 — Sub 9 of Epic (folder-structure cleanup; sub-daemon co-location).
Scope
Move the 4 sub-daemon clusters into per-daemon folders matching Sub 8's ai/daemons/orchestrator/ pattern. Each cluster: service-logic class + daemon.mjs entry-point + any private helpers.
Source moves
| From |
To |
ai/scripts/bridge-daemon.mjs |
ai/daemons/bridge/daemon.mjs |
ai/scripts/bridge-daemon-queries.mjs |
ai/daemons/bridge/queries.mjs (rename per folder-context) |
ai/daemons/KbAlertingService.mjs |
ai/daemons/kb-alerting/KbAlertingService.mjs |
ai/scripts/kb-alerting-daemon.mjs |
ai/daemons/kb-alerting/daemon.mjs |
ai/daemons/KbGarbageCollectionService.mjs |
ai/daemons/kb-gc/KbGarbageCollectionService.mjs |
ai/scripts/kb-gc-daemon.mjs |
ai/daemons/kb-gc/daemon.mjs |
ai/daemons/KbReconciliationService.mjs |
ai/daemons/kb-reconciliation/KbReconciliationService.mjs |
ai/scripts/kb-reconciliation-daemon.mjs |
ai/daemons/kb-reconciliation/daemon.mjs |
Test moves (mirror source)
test/playwright/unit/ai/daemons/KbAlertingService.spec.mjs → test/playwright/unit/ai/daemons/kb-alerting/KbAlertingService.spec.mjs
test/playwright/unit/ai/daemons/KbGarbageCollectionService.spec.mjs → test/playwright/unit/ai/daemons/kb-gc/KbGarbageCollectionService.spec.mjs
test/playwright/unit/ai/daemons/KbReconciliationService.spec.mjs → test/playwright/unit/ai/daemons/kb-reconciliation/KbReconciliationService.spec.mjs
- (No bridge unit spec exists currently.)
package.json
"ai:kb-alerting" script path: ./ai/scripts/kb-alerting-daemon.mjs → ./ai/daemons/kb-alerting/daemon.mjs
"ai:kb-gc" script path: ./ai/scripts/kb-gc-daemon.mjs → ./ai/daemons/kb-gc/daemon.mjs
"ai:kb-reconciliation" script path: ./ai/scripts/kb-reconciliation-daemon.mjs → ./ai/daemons/kb-reconciliation/daemon.mjs
.github/workflows
(none affected — no workflows reference bridge-daemon or kb-*-daemon paths)
Integration tests
test/playwright/integration/ai/kb-ingestion/multi-tenant.spec.mjs:114 — await import('./ai/daemons/KbReconciliationService.mjs') → update path
Acceptance Criteria
- 8 source moves + 3 test moves completed.
- 3 npm scripts updated.
- 1 integration test import updated.
- All affected unit + integration specs pass.
npm run ai:kb-alerting, npm run ai:kb-gc, npm run ai:kb-reconciliation all work.
- Bridge-daemon-queries (now
bridge/queries.mjs) consumed correctly by Orchestrator (cross-cluster import).
Depends on
Sub 8 #11844 (must merge first to free Orchestrator-cluster move; otherwise Sub 9 conflicts).
Authored by: [Claude Opus 4.7] (Claude Code)
Parent Epic
#11831 — Sub 9 of Epic (folder-structure cleanup; sub-daemon co-location).
Scope
Move the 4 sub-daemon clusters into per-daemon folders matching Sub 8's
ai/daemons/orchestrator/pattern. Each cluster: service-logic class +daemon.mjsentry-point + any private helpers.Source moves
ai/scripts/bridge-daemon.mjsai/daemons/bridge/daemon.mjsai/scripts/bridge-daemon-queries.mjsai/daemons/bridge/queries.mjs(rename per folder-context)ai/daemons/KbAlertingService.mjsai/daemons/kb-alerting/KbAlertingService.mjsai/scripts/kb-alerting-daemon.mjsai/daemons/kb-alerting/daemon.mjsai/daemons/KbGarbageCollectionService.mjsai/daemons/kb-gc/KbGarbageCollectionService.mjsai/scripts/kb-gc-daemon.mjsai/daemons/kb-gc/daemon.mjsai/daemons/KbReconciliationService.mjsai/daemons/kb-reconciliation/KbReconciliationService.mjsai/scripts/kb-reconciliation-daemon.mjsai/daemons/kb-reconciliation/daemon.mjsTest moves (mirror source)
test/playwright/unit/ai/daemons/KbAlertingService.spec.mjs→test/playwright/unit/ai/daemons/kb-alerting/KbAlertingService.spec.mjstest/playwright/unit/ai/daemons/KbGarbageCollectionService.spec.mjs→test/playwright/unit/ai/daemons/kb-gc/KbGarbageCollectionService.spec.mjstest/playwright/unit/ai/daemons/KbReconciliationService.spec.mjs→test/playwright/unit/ai/daemons/kb-reconciliation/KbReconciliationService.spec.mjspackage.json
"ai:kb-alerting"script path:./ai/scripts/kb-alerting-daemon.mjs→./ai/daemons/kb-alerting/daemon.mjs"ai:kb-gc"script path:./ai/scripts/kb-gc-daemon.mjs→./ai/daemons/kb-gc/daemon.mjs"ai:kb-reconciliation"script path:./ai/scripts/kb-reconciliation-daemon.mjs→./ai/daemons/kb-reconciliation/daemon.mjs.github/workflows
(none affected — no workflows reference bridge-daemon or kb-*-daemon paths)
Integration tests
test/playwright/integration/ai/kb-ingestion/multi-tenant.spec.mjs:114—await import('./ai/daemons/KbReconciliationService.mjs')→ update pathAcceptance Criteria
npm run ai:kb-alerting,npm run ai:kb-gc,npm run ai:kb-reconciliationall work.bridge/queries.mjs) consumed correctly by Orchestrator (cross-cluster import).Depends on
Sub 8 #11844 (must merge first to free Orchestrator-cluster move; otherwise Sub 9 conflicts).
Authored by: [Claude Opus 4.7] (Claude Code)