Skip to content

[SC-86] Autonomous bug-fix: forge PR capability + /human-autofix - #26

Merged
StephanSchmidt merged 12 commits into
mainfrom
hum-104-pr-capability
May 31, 2026
Merged

[SC-86] Autonomous bug-fix: forge PR capability + /human-autofix#26
StephanSchmidt merged 12 commits into
mainfrom
hum-104-pr-capability

Conversation

@StephanSchmidt

Copy link
Copy Markdown
Collaborator

Implements SC-86 (autonomously fix a reported bug end to end) across three engineering tickets.

What's here

  • HUM-104internal/forge abstraction (separate from internal/tracker, since a PR is a code-host concept) + GitHub CreatePullRequest + human <forge> pr create.
  • HUM-105 — derive the forge + repo from the git origin remote, so human pr create works with no --repo/kind.
  • HUM-103/human-autofix orchestrator + triage/fixer/verify agents (three-way verdict, tracker-only artifacts, test-first fix, PR + handoff), and surfacing the handoff pr: URL in the daemon/TUI.

Notes

  • Opened as a dogfooding test of the very human pr create command this branch introduces.
  • make check green (build + lint + tests + gosec + govulncheck + gitleaks).

🤖 Generated with Claude Code

StephanSchmidt and others added 12 commits May 31, 2026 06:20
Resolve the parent identifier to its internal UUID and pass it as
parentId on issueCreate; read parent { identifier } back on GetIssue.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Set fields.parent.key on create and request the parent field on
GetIssue so subtasks report their parent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Send parent_story_id on create and map it back into ParentKey on read.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a Hierarchy-Reverse relation on create and read the parent back via
$expand=relations, reconstructing the parent key from the link URL.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
After creating an issue, link it under the parent via the sub-issues
endpoint using the child's internal id. Read-direction is not exposed
by the API, so the parent is not shown back on GetIssue.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GitLab's REST v4 API has no issue parent/child relationship, so fail
loudly instead of silently dropping the requested parent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Print a Parent row when an issue has a parent and update the --parent
flag help to list per-tracker subtask support.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Introduce internal/forge, a code-host capability separate from the issue
tracker: a pull request is a repository concept, not a tracker one. GitHub
is both, so its client now implements both tracker.Provider and forge.Forge;
pure issue trackers stay untouched and never advertise a `pr` command.

- internal/forge: Forge/Creator interface, PullRequest type, IsForgeKind gate
- github: CreatePullRequest via POST /repos/{owner}/{repo}/pulls
- cmdutil.ResolveForge: type-asserts the raw provider to forge.Forge,
  bypassing the tracker decorator chain (PR creation has no tracker-write
  audit/policy semantics)
- cmd: `human <forge> pr create` (--repo/--head/--base/--title/--body),
  registered only for forge kinds

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add `human pr create` (no kind) that derives the code forge and owner/repo
from the local `origin` remote, and make `--repo` optional on
`human <forge> pr create` with the same origin fallback. Running inside a
repo no longer needs --repo or a forge-kind-prefixed command.

- forge.ParseRemoteURL (HTTPS/scp-SSH/ssh://) + KindForHost (host→kind)
- internal/gitrepo.OriginURL: the one place Go shells out to git, runner
  injectable for tests
- cmdutil.OriginForge / OriginRepo: derive forge+repo, reuse ResolveForge
- cmdauto.BuildAutoPRCreateCmd registered in main.go; --head required,
  --base defaults to main

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Autonomous bug-fix pipeline: triage & reproduce -> three-way verdict
(confirmed / not-a-bug / undetermined) -> plan -> test-first fix on a
feature branch -> verify -> open a PR and hand off for review. The whole
trail is recorded on the tracker (comments, the engineering ticket, the
PR); no .human/ working files are produced.

- human-autofix skill orchestrates the phases autonomously (no AskUserQuestion)
- human-bug-triage: reproduce + root cause + verdict, posted as a comment
- human-bug-fixer: branch, failing regression test, root-cause fix, push
- human-bug-verify: fails-before/passes-after + green-suite done gate
- Phase 5 opens the PR via `human pr create` (forge derived from origin)
  and posts a [human:ready-for-review] handoff carrying a pr: line
- install.go/install_test.go wiring; README skills listing

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The autofix handoff comment carries an optional `pr:` line. Parse it and
thread the PR URL through to the TUI so the (R) ready-for-review marker
links to the pull request.

- daemon.ParsePRFromHandoff extracts the pr: line (+ tests)
- scanReadyForReview/latestReadyKeys capture the URL per engineering key
- TrackerIssuesResult.ReadyForReviewPRs carries it over the wire
- TUI reviewMarker wraps (R) in an OSC 8 hyperlink to the PR when known

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@StephanSchmidt
StephanSchmidt merged commit f405a59 into main May 31, 2026
4 checks passed
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