| refactor: move cron/always-on business logic from ui/server/ to src/
Enforce backend-bug-locality rule: ui/server/ is a thin protocol
adapter and must not host business logic. This commit extracts ~1600
lines of algorithms into src/always-on/web/ and src/cron/, slimming
ui/server/ files to delegation-only wrappers.
- Discovery plan status machine, lifecycle, and context aggregation
→ src/always-on/web/{DiscoveryPlanStatus,Service,Context}.ts
- Run-history event merging and transcript recovery algorithms
→ src/always-on/web/AlwaysOnRunHistoryService.ts
- Unified "run cron now" via Gateway RPC (cronRunNow) replacing the
dual sendCronDaemonRequest / gateway.cronCreate paths
- mapCronRunOutcome centralised in src/cron/protocol/types.ts
- Deleted dead code: cron-daemon-client-lease.js, cron-session-bridge.js
- 42 new unit tests covering all extracted modules
Co-authored-by: Cursor <cursoragent@cursor.com>
| 19 天前 |