feat(council): stall detection with liveness contract, watchdog, and poll-until-green#22
Merged
Conversation
…ion logic, and poll-until-green helper Closes #18
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the four-point stall-detection spec from issue #18, built on the monitor primitive from #19.
council/prompts/worker.md): every worker final message must end withSTATUS: DONEorSTATUS: WAITING(reason=..., resume-condition=..., deadline=...). Bare "waiting..." text triggers an automatic nudge.council/ts/src/workflows/supervise.ts):parseWorkerLiveness()extracts structured liveness from worker output;evaluateWatchdog()classifies each worker asfresh,waiting-with-live-monitor,stale, orstalled— integrating withmonitor listto distinguish legitimately-WAITING workers from actually-stalled ones;shouldEscalate()determines when nudge count has exceeded the limit.council/ts/src/workflows/task-state.ts):ResumeableTaskStateinterface captures taskId, steps done, next step, watched SHA/PR, and monitor name — enabling deterministic restarts from nudges.buildPollUntilGreenMonitorArgs()): produces themonitor startargv forprobe:actions-runs-for-shaso the merge finalizer runs in the same process as the watcher, never leaving a green PR unmerged.Fixes #18
Test plan
npm testincouncil/ts/)tsc --noEmit)parseWorkerLiveness: DONE, WAITING with all fields, stalled for bare textevaluateWatchdog: fresh, stalled, waiting-with-live-monitor, stale with dead monitorshouldEscalate: threshold boundarybuildPollUntilGreenMonitorArgs: correct argv shape with required flags