Skip to content

feat(council): stall detection with liveness contract, watchdog, and poll-until-green#22

Merged
jorisjonkers-dev-agents[bot] merged 3 commits into
mainfrom
feat/council-stall-detection
Jul 12, 2026
Merged

feat(council): stall detection with liveness contract, watchdog, and poll-until-green#22
jorisjonkers-dev-agents[bot] merged 3 commits into
mainfrom
feat/council-stall-detection

Conversation

@jorisjonkers-dev-agents

Copy link
Copy Markdown
Contributor

Summary

Implements the four-point stall-detection spec from issue #18, built on the monitor primitive from #19.

  • Liveness contract (council/prompts/worker.md): every worker final message must end with STATUS: DONE or STATUS: WAITING(reason=..., resume-condition=..., deadline=...). Bare "waiting..." text triggers an automatic nudge.
  • Watchdog decision logic (council/ts/src/workflows/supervise.ts): parseWorkerLiveness() extracts structured liveness from worker output; evaluateWatchdog() classifies each worker as fresh, waiting-with-live-monitor, stale, or stalled — integrating with monitor list to distinguish legitimately-WAITING workers from actually-stalled ones; shouldEscalate() determines when nudge count has exceeded the limit.
  • Resumable task state schema (council/ts/src/workflows/task-state.ts): ResumeableTaskState interface captures taskId, steps done, next step, watched SHA/PR, and monitor name — enabling deterministic restarts from nudges.
  • Standardized poll-until-green helper (buildPollUntilGreenMonitorArgs()): produces the monitor start argv for probe:actions-runs-for-sha so the merge finalizer runs in the same process as the watcher, never leaving a green PR unmerged.

Fixes #18

Test plan

  • 65 test files, 668 tests pass (npm test in council/ts/)
  • TypeScript type check clean (tsc --noEmit)
  • parseWorkerLiveness: DONE, WAITING with all fields, stalled for bare text
  • evaluateWatchdog: fresh, stalled, waiting-with-live-monitor, stale with dead monitor
  • shouldEscalate: threshold boundary
  • buildPollUntilGreenMonitorArgs: correct argv shape with required flags

…ion logic, and poll-until-green helper

Closes #18
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot added the type: feature New user-facing or operator-facing capability. label Jul 12, 2026
- parseWorkerLiveness: enforce STATUS line at end of output, not anywhere
  (prevents early STATUS: DONE from masking trailing text)
- evaluateWatchdog: treat expired WAITING deadline as stalled
- buildPollUntilGreenMonitorArgs: validate sha/repo before interpolating
  into shell command string; fix --until predicate to use substring match
  compatible with evaluatePredicate
- Rename ResumeableTaskState -> ResumableTaskState (typo fix)
- Update tests to cover new behaviors
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot merged commit 134d014 into main Jul 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New user-facing or operator-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

council: detect and recover stalled/dead worker processes

1 participant