mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
test: add 43 deep integration tests for OrchestratorLoop state machine
Covers full lifecycle: start → plan → approve → execute → verify → complete. Tests state transitions, event emissions, persistence/recovery, pause/resume, skip/retry, team phase execution, error handling, and edge cases. Also fixes bugs found during review: - Route context snapshot: use getter for orchestratorLoop (was null forever) - Event listener stacking: guard setupEventForwarding with boolean flag - Replan completion: create tracked TaskQueue task instead of raw sendInput - Pause cleanup: call cleanupTaskHandlers() on pause - Phase timeout: add phaseTimeoutTimer enforcement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -488,6 +488,8 @@ export class WebServer extends EventEmitter {
|
||||
* Single object with zero runtime cost — ISP enforced at the type level.
|
||||
*/
|
||||
private createRouteContext() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
const self = this;
|
||||
return {
|
||||
// SessionPort
|
||||
sessions: this.sessions as ReadonlyMap<string, Session>,
|
||||
@@ -540,8 +542,10 @@ export class WebServer extends EventEmitter {
|
||||
// AuthPort
|
||||
authSessions: this.authSessions,
|
||||
qrAuthFailures: this.qrAuthFailures,
|
||||
// OrchestratorPort
|
||||
orchestratorLoop: this._orchestratorLoop,
|
||||
// OrchestratorPort — use getter so routes always see current value (not a null snapshot)
|
||||
get orchestratorLoop() {
|
||||
return self._orchestratorLoop;
|
||||
},
|
||||
initOrchestratorLoop: () => this.initOrchestratorLoop(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user