Skip to content

feat(finale): add sub-agent option for merge conflict resolution - #326

Merged
em-redhat merged 2 commits into
unbound-force:mainfrom
em-redhat:opsx/finale-conflict-resolution
Jul 6, 2026
Merged

em-redhat merged 2 commits into
unbound-force:mainfrom
em-redhat:opsx/finale-conflict-resolution

Conversation

@em-redhat

Copy link
Copy Markdown
Contributor

Summary

Adds a sub-agent option (Option 5) to /finale step 6b's
conflict recovery menu. When a PR has merge conflicts, users
can now choose "Spawn sub-agent to resolve conflicts
(AI-assisted)" alongside the existing manual options.

The sub-agent flow:

  1. Merges the target branch to create conflict markers
  2. Identifies conflicting files
  3. Spawns a cobalt-crush-dev sub-agent with a scoped prompt
  4. Shows the resolution diff for user approval before committing
  5. Falls back to manual options if resolution fails

This also includes the full mergeability gate (6a), conflict
recovery (6b options 1-4), and workflow cross-reference (6c)
from PR #320 as baseline content.

Closes #325

How to Test

  1. Read .opencode/commands/finale.md and verify:
    • Step 6b conflict recovery menu shows 5 options
    • Option 5 documents the sub-agent spawn flow
    • User approval gate requires diff review before commit
    • Failure handling aborts merge and returns to menu
  2. Run go test -race -count=1 ./... -- all tests pass
    including embedded asset drift detection

How to Demo

This change modifies agent instructions (Markdown), not
runtime code. To verify:

  • Open .opencode/commands/finale.md
  • Navigate to step 6b and confirm the 5-option menu
  • Read the Option 5 section for the sub-agent flow

Key Files Changed

  • .opencode/commands/finale.md -- Added step 6a/6b/6c
    with option 5 sub-agent conflict resolution
  • internal/scaffold/assets/opencode/commands/finale.md --
    Synced embedded scaffold asset
  • openspec/changes/finale-conflict-resolution/ -- Change
    artifacts (proposal, design, specs, tasks)

This PR was generated by /finale (AI-assisted).

- Add option 5 to step 6b conflict recovery menu: spawn
  cobalt-crush-dev sub-agent for AI-assisted resolution
- Include mergeability gate (6a), conflict recovery (6b),
  and workflow cross-reference (6c) from PR unbound-force#320 baseline
- Add user approval gate, failure handling with merge abort,
  and post-resolution CI polling
- Add guardrails for force push safety and sub-agent approval
- Sync embedded scaffold asset
- Create OpenSpec change artifacts (proposal, design, specs,
  tasks)

Closes unbound-force#325

Assisted-by: claude-opus-4
Generated with AI assistance (claude-opus-4)

@yvonnedevlinrh yvonnedevlinrh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-structured PR with thorough OpenSpec artifacts. All CI checks pass, scaffold asset is in sync, constitution alignment is solid. Three findings -- one consistency issue (MEDIUM), and one spec/implementation gap (MEDIUM)
Findings

  1. MEDIUM git push missing from confirmation prompts in Options 1 and 5
    Options 1 and 5 execute git push after the user approves, but the confirmation text only mentions fetch/merge (Option 1) or "Approve and commit" (Option 5). Option 2 correctly includes git push --force-with-lease in its confirmation text. All three options should be consistent -- the user should see that push is part of what they're approving.
  • Option 1: Add git push to the confirmation prompt alongside git fetch and git merge
  • Option 5 step (a): Add git push to the initial confirmation or clarify it happens after approval
  • Option 5 step (e): Change "Approve and commit" to "Approve, commit, and push" (or similar)
  1. MEDIUM Spec FR-003 promises "request edits" option not present in implementation
    The spec (specs/finale-conflict-resolution.md FR-003) says: "The user MUST be asked to approve, request edits, or abort." The implementation in finale.md step (e) only provides two options: "Approve and commit" / "Abort (discard resolution)." Either add a "Request edits" option to the implementation or remove "request edits" from the spec.

Show the commands and ask for explicit confirmation
before executing:

> "I will run the following commands:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM Push not shown in confirmation prompt

The confirmation text shows git fetch and git merge but the git push that follows on success is not shown to the user. Option 2 correctly includes push in its confirmation. For consistency, add git push here so the user knows they're approving a remote-affecting operation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in a31f235: Added git push to the Option 1 confirmation prompt and updated the description to "This creates a merge commit and pushes to the remote. Proceed?" — now consistent with Option 2.

Comment thread .opencode/commands/finale.md Outdated
> the resolution diff above.
>
> Options:
> 1. Approve and commit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM "Approve and commit" should mention push

The approval prompt says "Approve and commit" but git commit --no-edit and git push both execute on approval. The user should know push is included. Suggest changing option 1 text to "Approve, commit, and push" for transparency. Also, the spec (FR-003) promises a "request edits" option that isn't implemented here -- either add it or update the spec.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in a31f235: Renamed "Approve and commit" to "Approve, commit, and push" for transparency. Added "Request edits (modify resolution manually)" as option 2 per FR-003, which lets the user edit resolved files and re-show the diff before committing. Abort is now option 3.

- Option 1 (merge): add `git push` to the confirmation prompt
  for consistency with Option 2 (rebase) which already shows push
- Option 5 (sub-agent): rename "Approve and commit" to "Approve,
  commit, and push" for transparency
- Option 5 (sub-agent): add "Request edits" option per FR-003
  which requires approve, request edits, or abort

Addresses PR unbound-force#326 review feedback from @yvonnedevlinrh.

Signed-off-by: Em <[email protected]>
Assisted-by: OpenCode (claude-opus-4-6)
@em-redhat
em-redhat requested a review from yvonnedevlinrh July 3, 2026 15:04

@yvonnedevlinrh yvonnedevlinrh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both prior findings are resolved. All CI checks pass. The implementation is consistent with the spec, the scaffold asset is in sync, and no new concerns were introduced by the fix commit.

@gxmiranda gxmiranda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean PR with thorough OpenSpec artifacts and full spec coverage (FR-001 through FR-006). All CI checks pass. Scaffold asset verified in sync. Prior reviewer findings (push transparency in confirmation prompts, missing "request edits" option per FR-003) were addressed in commit a31f235 and confirmed resolved. No new concerns. Constitution alignment verified across all five principles.

This review was generated by /review-pr (AI-assisted).

@em-redhat
em-redhat merged commit 4d12c7d into unbound-force:main Jul 6, 2026
14 checks passed
@em-redhat
em-redhat deleted the opsx/finale-conflict-resolution branch July 6, 2026 12:43
@em-redhat em-redhat moved this from In Review 👀 to Done ✔️ in Unbound Force Planning Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done ✔️

Development

Successfully merging this pull request may close these issues.

finale: add sub-agent option for merge conflict resolution

3 participants