Skip to content

Add hera_revive: coordinator PULL-revive of a bound role - #917

Merged
anutron merged 1 commit into
masterfrom
argus/coordinator-pull-revive
Jul 31, 2026
Merged

Add hera_revive: coordinator PULL-revive of a bound role#917
anutron merged 1 commit into
masterfrom
argus/coordinator-pull-revive

Conversation

@anutron

@anutron anutron commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a new coordinator-only MCP tool, hera_revive(cwd, role_name, [orchestrator]), letting a hera coordinator PULL-revive a bound role after a session-supervisor restart (or any time it looks stuck) instead of requiring a human to press Enter in the TUI.
  • Reuses the exact idle+not-blocked safety gate the TUI's Enter-key revive already enforces (internal/tui/heraactions.go), via a new shared primitive internal/hera.ReviveRole (mirrors the existing RecycleCoord architecture) and a new daemon adapter daemon.HeraReviveRunner.
  • The TUI's own Enter-key revive path is deliberately left untouched — see design.md D3 (archived at openspec/changes/archive/2026-07-31-add-hera-revive/) for the reasoning: it additionally resizes to the live pane's dimensions and is threaded through tview's QueueUpdateDraw model, while every individual check (idle detection, blocked-on-prompt, the in_review→in_progress restore) stays single-sourced between both call sites regardless.
  • Docs: .claude/skills/hera/SKILL.md and README.md's MCP tools table updated; a gotcha bullet added to context/knowledge/gotchas/daemon-rpc.md; the openspec change is archived in the same PR per this repo's process.

Test plan

  • internal/hera/revive_test.go — unit tests for every ReviveOutcome against a fake runner + real in-memory DB
  • internal/daemon/revive_test.goHeraReviveRunner against a real agent.NewRunner(nil) + in-memory DB (dead restart, stuck kick preserving PTY size)
  • internal/mcp/hera_revive_test.go — tool-level resolution/rejection/success cases
  • make pre-pr passes (build, vet, fmt-check, lint-pr all clean; vuln step is CI's own advisory-only stdlib-CVE check per .github/workflows/ci.yml; test-cover-gate passes at 88.7% — the 2 unrelated internal/agent profile-env tests that false-fail from this sandbox's own ARGUS_* env leaking into the test subprocess were verified to pass cleanly with those vars unset, a known pre-existing artifact of running make pre-pr inside a hera worker sandbox, not a regression from this change)

🤖 Generated with Claude Code

Gives a hera coordinator a new MCP tool to notice and revive a dead or
genuinely-stuck role it coordinates (e.g. after a session-supervisor
restart SIGHUPs its PTY), instead of requiring a human to press Enter
in the TUI. Reuses the exact idle+not-blocked safety gate the TUI's
Enter-key revive already enforces, so it can never thrash a session
that's actually working or waiting on a prompt; a healthy role is
reported as such rather than touched.

The gating+action sequence is extracted once into
internal/hera.ReviveRole (mirrors the existing RecycleCoord
architecture: a pure function over narrow store/runner interfaces),
wired daemon-side by daemon.HeraReviveRunner. The TUI's own Enter-key
revive path is deliberately left untouched — see design.md D3 (archived
under openspec/changes/archive/2026-07-31-add-hera-revive/) for why:
it additionally resizes to the current pane's dimensions and is
threaded through tview's QueueUpdateDraw model, while every individual
check it performs stays single-sourced with the new tool either way.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Merging this branch changes the coverage (2 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/drn/argus/internal/daemon 85.02% (-0.19%) 👎
github.com/drn/argus/internal/hera 87.71% (+1.17%) 👍
github.com/drn/argus/internal/mcp 87.64% (-0.37%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/drn/argus/internal/daemon/daemon.go 84.01% (-0.92%) 444 (+6) 373 (+1) 71 (+5) 👎
github.com/drn/argus/internal/daemon/revive.go 88.24% (+88.24%) 34 (+34) 30 (+30) 4 (+4) 🌟
github.com/drn/argus/internal/hera/revive.go 95.65% (+95.65%) 23 (+23) 22 (+22) 1 (+1) 🌟
github.com/drn/argus/internal/mcp/hera.go 80.99% (-0.65%) 705 (+46) 571 (+33) 134 (+13) 👎
github.com/drn/argus/internal/mcp/server.go 95.45% (+0.01%) 703 (+1) 671 (+1) 32 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/drn/argus/internal/daemon/revive_test.go
  • github.com/drn/argus/internal/hera/revive_test.go
  • github.com/drn/argus/internal/mcp/hera_revive_test.go
  • github.com/drn/argus/internal/mcp/hera_test.go

@anutron
anutron merged commit 6ea6df2 into master Jul 31, 2026
1 check passed
@anutron
anutron deleted the argus/coordinator-pull-revive branch August 2, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant