fix: Prevent duplicate work, add graceful shutdown, and enforce team lifecycle (#86)

- Change trigger-server MAX_CONCURRENT default from 3 to 1 to prevent
  overlapping cycles that duplicate GitHub issue comments
- Add SIGTERM/SIGINT handling to trigger-server so running scripts finish
  gracefully on service restart instead of being killed mid-flight
- Add cleanup trap to refactor.sh for worktree/tempfile cleanup on exit
- Add pre-cycle cleanup of stale worktrees, merged branches, and
  abandoned PRs from previously interrupted cycles
- Add mandatory Lifecycle Management section to team lead prompt requiring
  shutdown_request to all teammates before exiting
- Add dedup checks to community-coordinator: check existing comments
  before posting to prevent duplicate acknowledgments/resolutions
- Pass issue number in workflow trigger reason for better logging

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
A 2026-02-09 09:10:56 -08:00 committed by GitHub
parent 89ed02fe55
commit ab343d26a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 170 additions and 25 deletions

View file

@ -20,5 +20,5 @@ jobs:
SPRITE_URL: ${{ secrets.REFACTOR_SPRITE_URL }}
TRIGGER_SECRET: ${{ secrets.REFACTOR_TRIGGER_SECRET }}
run: |
curl -sf -X POST "${SPRITE_URL}/trigger?reason=${{ github.event_name }}" \
curl -sf -X POST "${SPRITE_URL}/trigger?reason=${{ github.event_name }}&issue=${{ github.event.issue.number || '' }}" \
-H "Authorization: Bearer ${TRIGGER_SECRET}"