feat(FN-978): add diagnostic logging, semaphore resilience, and executor tests

- Add structured diagnostic logging to executor, stuck-task-detector, and pi.ts with subsystem prefixes
- Add defensive guards to AgentSemaphore (limit minimum 1, invalid limit handling)
- Add comprehensive integration tests for agent execution flow (executor.test.ts)
- Add unit tests for semaphore resilience (concurrency.test.ts) and stuck-task-detector (stuck-task-detector.test.ts)
- Fix TypeScript errors in test task objects and duplicate execution test
- Document engine diagnostic logging points in AGENTS.md
This commit is contained in:
gsxdsm
2026-04-05 13:37:21 -07:00
parent d01e31c3b4
commit 1b98f167a0
9 changed files with 586 additions and 7 deletions

View File

@@ -137,6 +137,7 @@ export class StuckTaskDetector {
lastProgressAt: now,
activitySinceProgress: 0,
});
stuckLog.log(`Tracking task ${taskId} (total tracked: ${this.tracked.size})`);
}
/**
@@ -157,6 +158,9 @@ export class StuckTaskDetector {
if (entry) {
entry.lastActivity = Date.now();
entry.activitySinceProgress++;
if (entry.activitySinceProgress <= 3 || entry.activitySinceProgress % 50 === 0) {
stuckLog.log(`Activity recorded for ${taskId} (sinceProgress=${entry.activitySinceProgress})`);
}
}
}