Add diff_has_code_files() and ci_required_for_pr() helpers to
ci-helpers.sh. Non-code PRs (docs/*, formulas/*, evidence/*, *.md)
that have no CI results now skip the CI gate instead of being stuck
forever.
Applied to:
- review-pr.sh: CI gate skipped for non-code PRs
- review-poll.sh: CI gate skipped for non-code PRs
- dev-poll.sh: CI state treated as "success" for non-code PRs in
orphan, stuck-PR, and backlog merge paths
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add optional second TOKEN parameter to codeberg_api_all in lib/env.sh,
defaulting to $CODEBERG_TOKEN. Pass $REVIEW_BOT_TOKEN at the dismiss
block in review-pr.sh so reviews are fetched as the review bot account.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Before posting an APPROVED formal review, fetch all prior reviews by
the review bot on this PR and dismiss any with state REQUEST_CHANGES.
This unblocks merges when branch protection has dismiss_stale_approvals
and the bot has prior REQUEST_CHANGES reviews from earlier rounds.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The APPROVE injection previously told the dev-agent to write PHASE:done
and let the orchestrator merge. Now the dev-agent merges directly, so the
injection includes the full merge + issue-close curl commands matching the
pattern already in the dev-agent.sh prompt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix SC2164: add || exit 1 to bare cd in update-prompt.sh
- Fix SC2155: separate declare and assign in env.sh, supervisor-poll.sh, dev-agent.sh
- Fix SC2034: inline suppression for vars used by sourced helpers
- Remove unused `mergeable` declaration, rename unused loop var to `_w`
- Remove || true from shellcheck CI step — failures are now blocking
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Guard inject_into_session wait_for_claude_ready with || true
- Guard all tmux calls in inject_into_session with || true
- Add worktree cleanup to idle-timeout branch in review-poll.sh
- Check phase before sleep in wait_for_review_output (no 10s delay)
- Prune review-thread-map entries during session cleanup
- Skip human question injection during active review (phase check)
- Remove no-op tmux kill-session after has-session returns false
- Add ASCII fallback for Claude prompt detection (locale safety)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrite review-pr.sh to use persistent tmux sessions instead of one-shot
claude -p. Re-reviews inject incremental diffs into the same session so
Claude remembers what it flagged and can verify fixes were addressed.
- review-pr.sh: tmux session review-{project}-{pr}, phase protocol
(PHASE:review_complete), JSON output via file, retry on invalid JSON
- review-poll.sh: session lifecycle cleanup (merged/closed PRs, 4h idle)
- matrix_listener.sh: route human questions to review sessions via
/tmp/review-thread-map
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add fallback dedup check against comment watermarks before the formal
Codeberg review check. When the formal review submission fails silently,
the existing <!-- reviewed: SHA --> watermark in posted comments now
prevents the next poll cycle from re-reviewing the same commit.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix anti-pattern regex 2 to match quoted form '"$CI_STATE" != "success"'
(was r'\$CI_STATE\s*!=\s*"success"', now r'"?\$CI_STATE"?\s*!=\s*"success"')
- Update both anti-pattern messages to say 'extract ci_passed() to lib/'
instead of implying it already exists as a shared helper in dev-poll.sh
- Add explicit 'when: event: [push, pull_request]' trigger block to ci.yml
- Add '-r' to xargs in shellcheck step to handle zero .sh files gracefully
- Fix operator precedence bug in review-poll.sh:62: scope the OR clause
with braces so CI_STATE=pending bypass only applies when WOODPECKER_REPO_ID=0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Projects with woodpecker_repo_id=0 (like disinto) have no CI status.
Review-poll treated empty CI state as failure and skipped all PRs.
Now treats empty/pending CI as pass when no CI is configured.
These docs never existed — gardener and review-pr referenced them
as if they did. AGENTS.md tree is now the single architecture
reference for all agents.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add matrix_send() to lib/env.sh and matrix_listener.sh daemon for
real-time notifications, threaded escalations, and human-in-the-loop
replies. All agents now notify via Matrix instead of openclaw.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>