Skip to content

feat: issue-level implement_issue reasoner — use SWE-AF as a sub-harness#99

Merged
AbirAbbas merged 6 commits into
mainfrom
feat/implement-issue-reasoner
Jul 21, 2026
Merged

feat: issue-level implement_issue reasoner — use SWE-AF as a sub-harness#99
AbirAbbas merged 6 commits into
mainfrom
feat/implement-issue-reasoner

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Summary

Adds an issue-level entry point, implement_issue, so a main coding harness (Claude Code / Codex / OpenCode) can delegate one fully-scoped issue to SWE-AF as a cheap sub-harness. The feature-level build pipeline is unchanged — this is the fast path for the second prompt shape ("change this code in this file, like this"), where the caller has already done the planning.

No planning agents run. Deterministic (non-LLM) git setup creates an isolated worktree + issue/<build_id>-<slug> branch off base_branch, the existing coding loop implements the issue (reduced budget: 3 iterations, reviewer-gated; QA + synthesizer when needs_deeper_qa), an optional single verifier pass checks the acceptance criteria, and the branch is returned as the deliverable. Nothing is pushed and no PR is opened by default — the caller owns merge and CI. Typical cost is 4–8 LLM calls instead of hundreds, targeting ~10–30 min on cheap models instead of hours.

Registered on both nodes (swe-planner.implement_issue, swe-fast.implement_issue) and mirrored 1:1 in the Go port (swe-planner-go / swe-fast-go).

Changes

  • swe_af/issue/ — new package: IssueSpec/IssueBuildConfig/IssueBuildResult schemas, deterministic git ops (worktree/branch/checkpoint-commit, repo-local .git/info/exclude masking so the caller's git status stays clean), and the implement_issue orchestrator driving run_coding_loop
  • swe_af/app.py, swe_af/fast/app.py — include the shared issue_router on both nodes
  • go/internal/issue/, go/internal/config/issueconfig.go, go/internal/node/register.go — Go port with identical reasoner name, input schema, and behavior; node surface tests updated to 31/30
  • README.md — "Use SWE-AF as a Sub-Harness" section: when to use implement_issue vs build, async curl + webhook/poll recipes, result shape, config table, fan-out guidance
  • .claude/skills/delegate-issue/ — ready-made Claude Code skill for the delegation flow (.gitignore narrowed from .claude/ to .claude/* + !.claude/skills/ so versioned skills ship while local state stays ignored)

Validation contract (tests derive from these)

  • The result branch contains commits implementing the issue; the caller's working tree, current branch, and git status are untouched
  • N concurrent calls on the same repo_path yield N independent branches (worktree-per-call, retry on repo-lock contention)
  • No planning roles are ever invoked; total agent calls stay within the configured budget
  • Default config pushes nothing to any remote and opens no PR
  • Verifier failure or iteration exhaustion surfaces unmet criteria/debt (success: false keeps a salvageable branch; zero-commit builds delete their branch)
  • Same reasoner name and input schema on all four nodes (Python + Go, planner + fast)

Test plan

  • Python: 47 new contract tests in tests/issue/ (real temp repos + real coding loop; only the agent dispatch is scripted)
  • Full suite at CI parity (Python 3.12, no .env): 1084 passed, 1 skipped + compileall clean
  • Go: new tests in internal/issue + internal/config; full CI gate green — gofmt clean, go build, go vet, go test -race -count=1 ./... with GOWORK=off

Note for reviewers: origin/feat/pipeline-optimization contains related skip-worktree/direct-git commits; this PR deliberately implements its own minimal git ops in swe_af/issue/git_ops.py rather than cherry-picking, since the issue-level path only ever owns a single worktree/branch.


🤖 Generated with Claude Code

AbirAbbas and others added 6 commits July 20, 2026 23:30
Sub-harness surface: a main coding harness (Claude Code/Codex/OpenCode)
delegates one fully-scoped issue; no planning agents run. Deterministic
git setup creates an isolated worktree + issue/<build_id>-<slug> branch,
the existing coding loop implements it (reduced iteration budget), an
optional single verifier pass checks the acceptance criteria, and the
branch is returned as the deliverable. PR/CI stay off by default — the
caller owns merge and CI. Concurrent calls on one repo are safe
(worktree-per-call).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both node apps include the shared issue_router, exposing
swe-planner.implement_issue and swe-fast.implement_issue.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1:1 behavioural port of swe_af/issue/*: spec parsing + slug, deterministic
git ops (worktree/branch/checkpoint-commit/local-excludes), the
implement_issue orchestrator driving coding.RunCodingLoop, and
IssueBuildConfig in internal/config. Registered on BOTH Go nodes with the
same reasoner name and input schema; node surface tests updated to 31/30.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
README section for main-harness authors (Claude Code/Codex/OpenCode):
when to use implement_issue vs build, async curl + webhook/poll recipes,
result shape, config table, fan-out guidance.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Ships a ready-made skill for a main Claude Code harness: preflight, issue
composition, async delegation with a fan-out cap, progress tracking, and
branch collection/merge. Narrows the .claude/ gitignore so versioned
skills ship while local Claude Code state stays ignored.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Found in live testing: the coder runs pytest in the worktree, and both a
sloppy model commit and the checkpoint's git add -A swept __pycache__/*.pyc
onto the issue branch (which then blocks branch switching for the caller).
The checkpoint commit now excludes junk pathspecs, and a deterministic
scrub commit untracks any junk the agent itself committed. Mirrored in Go.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AbirAbbas
AbirAbbas force-pushed the feat/implement-issue-reasoner branch from 3e6e024 to 7d542ad Compare July 21, 2026 03:38
@AbirAbbas
AbirAbbas merged commit 5ec08f6 into main Jul 21, 2026
3 checks passed
@AbirAbbas
AbirAbbas deleted the feat/implement-issue-reasoner branch July 21, 2026 13:19
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