refactor: replace autoChain with projectTick queue scanning

Remove hard-coded auto-chain dispatch (DEV done→QA, QA fail→DEV) and
replace with a general-purpose projectTick service that scans the queue
and fills free worker slots after every state transition.

- Create lib/services/tick.ts: consolidates shared helpers and core
  projectTick() function from duplicated code in work-start/auto-pickup
- work_finish: replaces auto-chain block with projectTick call
- work_start: adds projectTick after dispatch to fill parallel slots
- auto_pickup: delegates per-project loop to projectTick
- Remove autoChain from Project type, migration code, and project-register
- Remove scheduling config dependency from work_finish
- Net -112 lines: simpler, self-healing pipeline

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lauren ten Hoor
2026-02-10 21:46:11 +08:00
parent d7178bb8e5
commit 55b062ac76
8 changed files with 246 additions and 171 deletions

View File

@@ -1,5 +1,5 @@
/**
* dispatch.ts — Core dispatch logic shared by work_start and work_finish (auto-chain).
* dispatch.ts — Core dispatch logic shared by work_start, auto_pickup, and projectTick.
*
* Handles: session lookup, spawn/reuse via Gateway RPC, task dispatch via CLI,
* state update (activateWorker), and audit logging.