Skip to content

feat(plugins): implement 4 spec-only plugins#3252

Merged
steveyegge merged 1 commit intogastownhall:mainfrom
outdoorsea:feat/plugin-implementations
Mar 27, 2026
Merged

feat(plugins): implement 4 spec-only plugins#3252
steveyegge merged 1 commit intogastownhall:mainfrom
outdoorsea:feat/plugin-implementations

Conversation

@outdoorsea
Copy link
Copy Markdown
Contributor

Summary

Four plugins had complete specifications in plugin.md but no executable run.sh. This PR adds implementations for all four, following the existing plugin pattern (cooldown gate, bd wisp recording, escalation on failure).

  • stuck-agent-dog (5m cooldown): Context-aware stuck/crashed agent detection for polecats and deacon. Checks tmux session + process health, notifies witness for restarts, escalates on mass death (>=3 agents). Scoped to polecats and deacon only — never touches crew, mayor, witness, or refinery sessions.

  • rebuild-gt (1h cooldown): Safe binary rebuild from gastown source. Uses gt stale --json to verify staleness and forward-safety before building. Only rebuilds on main branch — prevents the crash-loop incident where a bad rebuild broke every session's startup hook.

  • git-hygiene (12h cooldown): Stale branch, stash, and gc cleanup across all rig repos. Deletes merged local branches, orphan agent branches (polecat/*, dog/*, fix/*) with no remote tracking branch, merged remote branches on GitHub via gh api, clears stashes, and runs git gc --prune=now.

  • dolt-snapshots: Build/run wrapper for the existing Go binary (main.go) that tags Dolt databases at convoy boundaries for audit, diff, and rollback.

Test plan

  • bash -n syntax check passes for all 4 scripts
  • stuck-agent-dog: correctly enumerates polecats from rigs.json, detects dead sessions, skips crew
  • rebuild-gt: skips when binary is fresh, skips when safe_to_rebuild=false, rebuilds when stale+safe
  • git-hygiene: deletes merged branches, preserves main/master/refinery-patrol, runs gc
  • dolt-snapshots: builds Go binary and executes it

🤖 Generated with Claude Code

These plugins had complete specifications in plugin.md but no executable
run.sh. Each implementation follows the existing plugin pattern: cooldown
gate, bd wisp recording, and escalation on failure.

- **stuck-agent-dog**: Context-aware stuck/crashed agent detection for
  polecats and deacon. Checks tmux session + process health, notifies
  witness for restarts, escalates on mass death (>=3 agents). Never
  touches crew/mayor/witness/refinery sessions.

- **rebuild-gt**: Safe binary rebuild from gastown source. Uses
  `gt stale --json` to verify staleness and safety before building.
  Only rebuilds forward on main branch — prevents the crash-loop
  incident where a bad rebuild broke every session's startup hook.

- **git-hygiene**: Stale branch, stash, and gc cleanup across all rig
  repos. Deletes merged local branches, orphan agent branches (polecat/*,
  dog/*, fix/*) with no remote, merged remote branches on GitHub via
  `gh api`, clears stashes, and runs `git gc --prune=now`.

- **dolt-snapshots**: Build/run wrapper for the existing Go binary
  (main.go) that tags Dolt databases at convoy boundaries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the status/needs-triage Inbox — we haven't looked at it yet label Mar 24, 2026
@codecov-commenter
Copy link
Copy Markdown

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
9319 5 9314 48
View the top 3 failed test(s) by shortest run time
github.com/steveyegge/gastown/internal/cmd::TestBuildRefineryPatrolVars_FullConfig
Stack Traces | 0s run time
=== RUN   TestBuildRefineryPatrolVars_FullConfig
    patrol_helpers_test.go:166: expected 5 vars, got 7: [target_branch=main integration_branch_refinery_enabled=true integration_branch_auto_land=false run_tests=true delete_merged_branches=true judgment_enabled=false review_depth=standard]
--- FAIL: TestBuildRefineryPatrolVars_FullConfig (0.00s)
github.com/steveyegge/gastown/internal/cmd::TestRunHooksSyncNonClaudeAgent
Stack Traces | 0.01s run time
=== RUN   TestRunHooksSyncNonClaudeAgent
Syncing hooks...
  ✓ mayor/.claude/settings.json (created)
  ✓ deacon/.claude/settings.json (created)
  ✓ myrig/crew/.claude/settings.json (created)
warning: role_agents[crew]=opencode - agent "opencode" binary "opencode" not found in PATH, falling back to default

Synced 3 targets (3 created, 0 updated, 0 unchanged)
    hooks_sync_test.go:366: opencode plugin not created in worktree alice
--- FAIL: TestRunHooksSyncNonClaudeAgent (0.01s)
github.com/steveyegge/gastown/internal/doctor::TestHooksSyncCheck_Fix_TemplateAgent
Stack Traces | 0.01s run time
=== RUN   TestHooksSyncCheck_Fix_TemplateAgent
warning: role_agents[crew]=opencode - agent "opencode" binary "opencode" not found in PATH, falling back to default
    hooks_sync_check_test.go:219: expected StatusWarning before fix, got OK
--- FAIL: TestHooksSyncCheck_Fix_TemplateAgent (0.01s)
github.com/steveyegge/gastown/internal/doctor::TestHooksSyncCheck_TemplateAgent_Missing
Stack Traces | 0.01s run time
=== RUN   TestHooksSyncCheck_TemplateAgent_Missing
warning: role_agents[crew]=opencode - agent "opencode" binary "opencode" not found in PATH, falling back to default
    hooks_sync_check_test.go:193: expected StatusWarning for missing template agent file, got OK: All 3 hook targets in sync
--- FAIL: TestHooksSyncCheck_TemplateAgent_Missing (0.01s)
github.com/steveyegge/gastown/internal/doctor::TestHooksSyncCheck_TemplateAgent_OutOfSync
Stack Traces | 0.02s run time
=== RUN   TestHooksSyncCheck_TemplateAgent_OutOfSync
warning: role_agents[crew]=opencode - agent "opencode" binary "opencode" not found in PATH, falling back to default
    hooks_sync_check_test.go:172: expected StatusWarning for out-of-sync template agent, got OK: All 3 hook targets in sync
--- FAIL: TestHooksSyncCheck_TemplateAgent_OutOfSync (0.02s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@steveyegge steveyegge merged commit a84dadc into gastownhall:main Mar 27, 2026
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/needs-triage Inbox — we haven't looked at it yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants