feat(FN-1646): add stale-spec guard to prevent execution of outdated tasks

- Add spec-staleness evaluator to check task specification age before execution
- Guard executor startup and resume to prevent running tasks with stale specs
- Guard scheduler dispatch to skip stale tasks and move them back to triage
- Add comprehensive tests for spec staleness detection (7d/14d thresholds)
- Add getFusionDir mock for executor staleness check tests
This commit is contained in:
gsxdsm
2026-04-12 17:49:22 -07:00
parent bf5ce66a07
commit db6e51d58c
6 changed files with 481 additions and 0 deletions

View File

@@ -136,6 +136,7 @@ function createMockStore(overrides: Record<string, any> = {}) {
parseFileScopeFromPrompt: vi.fn().mockResolvedValue([]),
getSettings: vi.fn().mockResolvedValue({ ...DEFAULT_SETTINGS }),
getRootDir: vi.fn().mockReturnValue("/tmp/root"),
getFusionDir: vi.fn().mockReturnValue("/tmp/root/.fusion"),
getTasksDir: vi.fn().mockReturnValue("/tmp/root/.fusion/tasks"),
updateStep: vi.fn().mockImplementation(async (id: string, step: number, status: StepStatus) => {
return makeTaskDetail(id, "in-progress");