Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,28 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

# One file per invocation — `bash -n a b c` only checks the first file
# (the rest become positional parameters).
- name: Bash syntax
run: |
bash -n fixbuddy.sh
bash -n fixbuddy-wizard.sh
bash -n tests/integration.sh
bash -n tests/stubs/agent
bash -n tests/stubs/gh

- name: Install ShellCheck
run: sudo apt-get update && sudo apt-get install -y shellcheck

- name: ShellCheck
run: shellcheck fixbuddy.sh fixbuddy-wizard.sh
run: shellcheck fixbuddy.sh fixbuddy-wizard.sh tests/integration.sh tests/stubs/agent tests/stubs/gh

integration:
name: Integration tests (mocked CLIs)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Run integration tests
run: tests/integration.sh
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@ All notable changes to fixbuddy are documented here. The format is based on
[Keep a Changelog](https://keepachangelog.com/), and this project aims to follow
[Semantic Versioning](https://semver.org/).

## [0.6.0] - 2026-06-12

Google retires the Gemini CLI on 2026-06-18; its successor is the Antigravity
CLI (`agy`). fixbuddy v0.6.0 swaps the agent and gains an offline integration
test suite.

### Added
- **`agy` agent** (Antigravity CLI) as fix or review agent. Invocation details
that matter: `--add-dir <project>` (agents launch from the operator's CWD),
`--print-timeout` pinned 60s above `--agent-timeout` so fixbuddy's watchdog
classifies timeouts (agy itself exits 0 on its internal timeout — fixbuddy
also detects that output and treats it as `fix:blocked`/auto-requeue), and
`--sandbox` on verify/review as defense in depth (agy has no read-only mode).
- **Integration tests** (`tests/integration.sh`) — deterministic, offline,
zero new dependencies: stub `gh`/agent CLIs plus a local bare repo as
`origin`, covering happy path, false positive, review rejection, check gate,
dry-run read-only, and crash classification. Run in CI.

### Removed (breaking)
- **`gemini` agent.** Passing `gemini` (flag or config) now exits with a
migration message. Replace `fix_agent`/`review_agent` values with `agy`.
Note: agy in verify/review runs sandboxed but NOT read-only — the old
`--approval-mode plan` has no equivalent in the Antigravity CLI.

### Security & robustness
- The two read-only-by-contract stages are now guarded deterministically (no
agent CLI offers an enforced read-only mode): after **every** verify outcome
(proceed, false positive, blocked, crash) worktree files the verify agent
wrote are stashed and commits it created on the base branch are discarded,
and the **review** branch is pinned to the reviewed commit — commits a
reviewer creates are discarded, so only the reviewed commit is ever pushed.

## [0.5.0] - 2026-06-12

Security hardening from a full audit, plus five new features. No breaking changes
Expand Down Expand Up @@ -49,4 +81,5 @@ to existing flags.

Predate this changelog. See the git history and the `v0.4.0` / `v0.3.2` tags.

[0.6.0]: https://github.com/Codevena/fixbuddy/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/Codevena/fixbuddy/compare/v0.4.0...v0.5.0
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ Run these before opening a pull request:
```bash
bash -n fixbuddy.sh
bash -n fixbuddy-wizard.sh
shellcheck fixbuddy.sh fixbuddy-wizard.sh
shellcheck fixbuddy.sh fixbuddy-wizard.sh tests/integration.sh tests/stubs/agent tests/stubs/gh
tests/integration.sh
```

`tests/integration.sh` runs the full pipeline offline against stubbed `gh`/agent
CLIs and a local bare repository — no network, no API keys, a few seconds.

If `shellcheck` is not available locally, the GitHub Actions workflow will run it for pull requests.

## Pull Request Guidelines
Expand All @@ -36,7 +40,8 @@ If `shellcheck` is not available locally, the GitHub Actions workflow will run i

## Manual Test Checklist

For behavior changes, test against a disposable repository when possible:
Most of these paths are covered by `tests/integration.sh`; for behavior changes,
additionally test against a disposable repository when possible:

1. `--dry-run` lists expected issues.
2. A false-positive verification closes or labels the issue correctly.
Expand Down
42 changes: 28 additions & 14 deletions NEXT_SESSION.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
# Next session

All P0/P1 review items and the full P2 backlog (#6 repo topics, #7 `install.sh`, #8 GitHub Action wrapper) are done.
v0.6.0 is implemented on branch `feat/agy-agent-v0.6.0`: the retired `gemini`
agent is replaced by `agy` (Antigravity CLI — Gemini CLI shuts down 2026-06-18)
and a deterministic offline integration test suite landed.

## Status snapshot

- Branch `main`, working tree clean.
- **`v0.4.0` is tagged and pushed**, with a floating **`v1`** ref pointing at it. Consumers use `uses: Codevena/fixbuddy@v1`.
- `action.yml` (composite action, pure bash) + `.github/workflows/action-smoke.yml` (dry-run smoke test) shipped in #8. README has a "Use in GitHub Actions" section.
- `fixbuddy.sh` `--dry-run` skips the agent-CLI presence check (agent-name validation still runs) so the smoke test works on bare runners.
- `install.sh` pins `DEFAULT_REF="v0.4.0"`; README Quick Start one-liner points at `v0.4.0`.
- `SHA256SUMS` holds hashes of `fixbuddy.sh` + `fixbuddy-wizard.sh`. **Regenerate it (`shasum -a 256 fixbuddy.sh fixbuddy-wizard.sh > SHA256SUMS`) whenever either script changes, before cutting a new tag** — `install.sh` verifies checksums and fails closed.
- When cutting a new release: bump `VERSION` in `fixbuddy.sh`, the header comment, `install.sh` `DEFAULT_REF`, the README one-liner; regenerate `SHA256SUMS`; tag `vX.Y.Z`; then `git tag -f v1 vX.Y.Z && git push origin v1 --force` to move the floating major ref.
- Definition-of-Done gate from `~/.claude/CLAUDE.md` still applies. Note from #8: `codex exec` hung at 0% CPU again — the OpenCode fallback (`opencode run --dangerously-skip-permissions "$(<file)"`) worked. Write reviewer prompts with the Write tool, not Bash heredocs.
- Branch `feat/agy-agent-v0.6.0`, all work committed; awaiting merge to `main`
and the release tag.
- Spec: `docs/superpowers/specs/2026-06-12-agy-agent-and-integration-tests-design.md`
(includes the locally verified agy CLI behavior: no read-only mode, `--sandbox`
semantics, `--print-timeout` default 5m with **exit code 0** on timeout).
- Plan: `docs/superpowers/plans/2026-06-12-agy-agent-and-integration-tests.md`.
- Tests: `tests/integration.sh` — 9 scenarios against stubbed `gh`/agent CLIs and
a local bare-repo origin. Runs in CI (`integration` job) alongside shellcheck.
- Audit history moved to `docs/audit/2026-06-10-findings.md` (all 18 findings
fixed in v0.5.0).

## What's next
## Release checklist (v0.6.0)

P2 is complete. Remaining work lives in the README **Roadmap**:
Version bumps, CHANGELOG, and `SHA256SUMS` are already done on the branch. After
merge to `main`:

1. `git tag v0.6.0 && git push origin v0.6.0`
2. `git tag -f v1 v0.6.0 && git push origin v1 --force` (floating major ref for
`uses: Codevena/fixbuddy@v1`)
3. Verify the CI + action-smoke workflows are green on `main`.

Remember for future releases: regenerate `SHA256SUMS`
(`shasum -a 256 fixbuddy.sh fixbuddy-wizard.sh > SHA256SUMS`) whenever either
script changes, before tagging — `install.sh` verifies checksums fail-closed.

## What's next (README Roadmap)

- Config file support
- More deterministic integration tests with mocked CLIs
- Optional notifications for run summaries
- Explicit resume mode for interrupted runs

Pick one and run it through the brainstorm → plan → DoD-gate flow. Verify the action-smoke workflow went green on GitHub after the v0.4.0 push.
Pick one and run it through the brainstorm → plan → DoD-gate flow.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![version](https://img.shields.io/github/v/tag/Codevena/fixbuddy?label=version)](https://github.com/Codevena/fixbuddy/tags)
[![license](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![shell](https://img.shields.io/badge/shell-bash-black.svg)](fixbuddy.sh)
[![agents](https://img.shields.io/badge/agents-claude%20%7C%20codex%20%7C%20opencode%20%7C%20gemini-purple.svg)](#supported-agents)
[![agents](https://img.shields.io/badge/agents-claude%20%7C%20codex%20%7C%20opencode%20%7C%20agy-purple.svg)](#supported-agents)

fixbuddy reads open GitHub issues, asks one agent to verify and fix each issue, asks a second agent to review the committed diff, then opens a pull request. If enabled, it requests auto-merge after review approval.

Expand All @@ -22,12 +22,12 @@ The goal is controlled automation: one issue per branch, one issue per PR, expli

Most AI issue-fixers let a single agent write a fix and, at best, review its own work. fixbuddy splits the job across **two different agents from two different vendors**: by default `claude` writes the fix and `codex` reviews the committed diff with a fresh context. The fixer never approves its own work.

It needs no cloud service, no Docker, and no separate API-key broker — it drives the AI coding CLIs you already have installed (`claude`, `codex`, `opencode`, `gemini`), so it runs on the subscriptions you already pay for. The orchestrator is ~1,200 lines of readable Bash.
It needs no cloud service, no Docker, and no separate API-key broker — it drives the AI coding CLIs you already have installed (`claude`, `codex`, `opencode`, `agy`), so it runs on the subscriptions you already pay for. The orchestrator is ~1,200 lines of readable Bash.

| | fixbuddy | Copilot coding agent | claude-code-action | OpenHands resolver |
|---|---|---|---|---|
| Fix **and** review | two agents, cross-vendor (fixer ≠ reviewer) | one vendor | one vendor | one agent |
| Choice of agent | claude · codex · opencode · gemini | Copilot's models | Claude only | bring your own LLM |
| Choice of agent | claude · codex · opencode · agy | Copilot's models | Claude only | bring your own LLM |
| Where it runs | your machine **or** a GitHub Action | GitHub cloud | GitHub Action | local / Docker |
| Infra required | bash · git · gh · jq | none (hosted) | GitHub Actions | Docker + API keys |
| Cost | your existing CLI subscriptions | paid Copilot (premium requests) | API / subscription | your API + compute |
Expand Down Expand Up @@ -57,15 +57,15 @@ VERIFY -> FIX -> REVIEW -> PUSH/PR -> optional auto-merge
Install with the one-liner (macOS and Linux, including WSL2):

```bash
curl -fsSL https://raw.githubusercontent.com/Codevena/fixbuddy/v0.5.0/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/Codevena/fixbuddy/v0.6.0/install.sh | bash
```

This downloads the pinned `v0.5.0` scripts into `~/.local/bin` (or `/usr/local/bin`), makes them executable, and prints a PATH hint if needed. Override the location with `| bash -s -- --prefix /custom/bin` or track the latest commit with `--ref main`.
This downloads the pinned `v0.6.0` scripts into `~/.local/bin` (or `/usr/local/bin`), makes them executable, and prints a PATH hint if needed. Override the location with `| bash -s -- --prefix /custom/bin` or track the latest commit with `--ref main`.

**Prefer to read before you run?** The installer is short — inspect it first, then run it:

```bash
curl -fsSL https://raw.githubusercontent.com/Codevena/fixbuddy/v0.5.0/install.sh -o install.sh
curl -fsSL https://raw.githubusercontent.com/Codevena/fixbuddy/v0.6.0/install.sh -o install.sh
less install.sh # read it
bash install.sh # then run it
```
Expand Down Expand Up @@ -121,7 +121,7 @@ Both `--fix-agent` and `--review-agent` must be installed. They may point to the
| `claude` | `claude --dangerously-skip-permissions -p -` | Full tool access. |
| `codex` | `codex exec --dangerously-bypass-approvals-and-sandbox` | Full tool access. |
| `opencode` | `opencode run --dangerously-skip-permissions` | Full tool access. |
| `gemini` | `gemini -p ... --approval-mode {plan\|yolo}` | Read-only style `plan` mode for verify/review; `yolo` for fix. |
| `agy` | `agy --dangerously-skip-permissions --add-dir <project> -p ...` | Antigravity CLI (Gemini's successor). Verify/review add `--sandbox` (terminal restrictions — not read-only). |

These agent invocations are intentionally powerful. Run fixbuddy only against repositories and issue content you trust.

Expand All @@ -134,8 +134,8 @@ These agent invocations are intentionally powerful. Run fixbuddy only against re
| `--label <name>` | Include only issues with this label. Repeatable | none |
| `--severity <level>` | Include issues labeled `severity:<level>` | none |
| `--max <n>` | Maximum issues to process in this run | unlimited |
| `--fix-agent <agent>` | `claude`, `codex`, `opencode`, or `gemini` | `claude` |
| `--review-agent <agent>` | `claude`, `codex`, `opencode`, or `gemini` | `codex` |
| `--fix-agent <agent>` | `claude`, `codex`, `opencode`, or `agy` | `claude` |
| `--review-agent <agent>` | `claude`, `codex`, `opencode`, or `agy` | `codex` |
| `--max-retries <n>` | Retry count after review rejection | `1` |
| `--agent-timeout <secs>` | Wall-clock timeout per agent call | `1200` |
| `--crash-abort <n>` | Abort after consecutive agent crashes | `3` |
Expand Down Expand Up @@ -215,8 +215,10 @@ fixbuddy creates and manages these labels:

- fixbuddy refuses to start if the target checkout has a dirty working tree.
- Each issue gets a fresh `fix/issue-N` branch.
- The verify stage is read-only by contract, but no agent CLI enforces that: files it writes are stashed and commits it creates on the base branch are discarded before the fix branch is created.
- The fix agent is instructed to stage only relevant files and to avoid generated artifacts.
- The review agent receives the committed diff and must reject unrelated changes.
- If the reviewer creates commits, the branch is reset to the reviewed commit — only the reviewed commit is ever pushed.
- Push happens only after review approval.
- `fix:applied` is added only after GitHub reports that the PR is merged.
- Cleanup stashes uncommitted agent output before deleting temporary branches.
Expand Down Expand Up @@ -275,11 +277,11 @@ Use one agent for both roles:
--fix-agent claude --review-agent claude --max 3
```

Use Gemini as a read-only reviewer:
Use agy (Antigravity CLI) as a cross-vendor reviewer:

```bash
./fixbuddy.sh --repo owner/repo --project ~/code/repo \
--fix-agent claude --review-agent gemini
--fix-agent claude --review-agent agy
```

## Use in GitHub Actions
Expand Down Expand Up @@ -343,7 +345,7 @@ If `github-token` is empty the action fails fast with a clear error. Pass a diff

### Prerequisites in CI

GitHub-hosted runners do **not** ship the agent CLIs (`claude`, `codex`, `opencode`, `gemini`). Install whichever ones you pass to `fix-agent` / `review-agent` in a step *before* the `Codevena/fixbuddy` step — pinning them to a known version is recommended. Consult each agent's own documentation for the current install command.
GitHub-hosted runners do **not** ship the agent CLIs (`claude`, `codex`, `opencode`, `agy`). Install whichever ones you pass to `fix-agent` / `review-agent` in a step *before* the `Codevena/fixbuddy` step — pinning them to a known version is recommended. Consult each agent's own documentation for the current install command. Note that `agy` has no npm package — install it with the vendor script: `curl -fsSL https://antigravity.google/cli/install.sh | bash`.

The action does not read API keys itself; each agent CLI reads its own environment variable (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and so on). Provide them from `secrets` at the job or workflow level, as shown above.

Expand Down Expand Up @@ -392,7 +394,6 @@ Native Windows is not tested. WSL2 is the recommended Windows environment.

## Roadmap

- More deterministic integration tests with mocked CLIs
- Optional notifications for run summaries
- Explicit resume mode for interrupted runs (interrupting a run cleans up the in-progress branch; the issue is retried automatically on the next run)

Expand Down
4 changes: 2 additions & 2 deletions SHA256SUMS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
288eda7831f6b3bd7078417e46ac8270a7f8b0175a288748cf9f3bac55c23cb8 fixbuddy.sh
d6868daf05471c46ab969fe50b441af004d6622f664c529912da82d91665ac73 fixbuddy-wizard.sh
b63b3e549ddb30f154482abf585313d56edd281e2493d878b6f154693c1d1674 fixbuddy.sh
ba3ba121a60ecb37fc5ca796f3cf5279a24a54566aeb2bb0dca3c3a1f4b7bd2f fixbuddy-wizard.sh
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ inputs:
required: false
default: "."
fix-agent:
description: "Fix agent: claude | codex | opencode | gemini"
description: "Fix agent: claude | codex | opencode | agy"
required: false
default: "claude"
review-agent:
description: "Review agent: claude | codex | opencode | gemini"
description: "Review agent: claude | codex | opencode | agy"
required: false
default: "codex"
severity:
Expand Down
File renamed without changes.
Loading