Skip to content

Classify stopped conflicts and print their evidence in Go #901

Description

@tbhb-agent

Problem

The repository-facing classifier at packages/agents/source/skills/resolve-rebase-conflicts/shared/scripts/classify-conflicts.sh:65 combines operation detection, stage interpretation, attributes, proof results and per-side diffs. Porting the pure helper alone would still leave workflow decisions in shell.

Part of #588 and #326.

Acceptance criteria

  1. AC1: Given a stopped merge-backend rebase, apply-backend rebase or cherry-pick, when classification runs, then it accepts the same operation contexts as the frozen classifier.
  2. AC2: Given no supported active operation, or an effective selection (the explicit path arguments if any, otherwise the discovered unmerged set) that is empty, when classification runs, then it returns the frozen refusal; an explicitly named resolved path is not refused and is reported per AC4.
  3. AC3: Given selected paths or the default unmerged set, when classification runs, then it reports paths in the frozen order.
  4. AC4: Given add/add, delete/modify, content or already-resolved paths, when classification runs, then the stage-kind report matches the frozen classifier.
  5. AC5: Given a regeneration declaration, when classification runs, then it recommends taking a complete side and regenerating after replay.
  6. AC6: Given union or manual declarations, when classification runs, then the resulting class and declaration explanation match the frozen classifier.
  7. AC7: Given safe unions, token extensions or ordinary content conflicts, when classification runs, then it prints the corresponding evidence or proposal.
  8. AC8: Given side changes above or below the configured display cap, when classification runs, then it prints the frozen diff body or expansion advice.
  9. AC9: Given a proof-engine failure, when classification runs, then it reports a tool failure rather than a content verdict.
  10. AC10: Given the Go implementation and Git are available, when classification runs without Python or uv, then the native classification succeeds for valid input.
  11. AC11: Non-functional: classification leaves repository contents and the index unchanged.
  12. AC12: Non-functional: native classification cases execute without skips on macOS, Linux and Windows.

Scope and non-goals

Scope: the classification command under agentrepo rebase, including the evidence formerly printed by the helper.

Non-goal: writing resolutions, taking sides, continuing Git or porting guards. Removal of Python/uv as Go runtime prerequisites is an explicit migration change; their frozen fallback still needs them. Keep shell and coupled Python frozen through N-2, with no new shell logic. Do not switch callers or retire tests in this child.

Approach

Compose children 05 and 06. Preserve attribute precedence at packages/agents/source/skills/resolve-rebase-conflicts/shared/scripts/classify-conflicts.sh:124 and side-diff limits at packages/agents/source/skills/resolve-rebase-conflicts/shared/scripts/classify-conflicts.sh:166. Keep stage 2 as base-side and stage 3 as replayed-side. Normalize fixture scratch paths only when comparing reports. Preserve the relative-entry behavior at tests/skills/resolve-rebase-conflicts/scripts/resolve-workflow.bats:98 during later activation.

Dependencies

Blocked by: #899, #900, #753.

Prerequisite: #321's repository-context deliverable.

Size

M. Forecast 640 code lines: 270 implementation, 320 tests and fixtures, 50 integration. Measured shell baseline: 129 code lines, plus report portions of the 212-code-line helper. Prose allowance: 220 lines.

scc could not run in the isolated checkout. Measured baselines count non-blank lines other than full-line # comments, including Python docstrings and embedded code conservatively. Forecasts include implementation, tests, fixtures and registration; they are estimates, not measured future Go. Generated output is excluded only under packages/agents/claude/.apm/skills/, packages/agents/codex/.apm/skills/, .claude/skills/, .agents/skills/ and tokens.json. The source under packages/agents/source/ and copies anywhere else count. The final diff must be at most 800 code lines and 2,000 prose lines, with no exception; split before implementation if either forecast grows beyond its limit.

Verify plan

  • AC1, AC2, AC3, AC4: scratch repositories cover both rebase backends, cherry-pick, no operation, an empty effective selection, an active operation with no unmerged paths run both without arguments (refusal) and with an explicitly named resolved path (reported, not refused), and each stage combination.
  • AC5, AC6, AC7: compare class, evidence, declarations and side labels against frozen reports; include false union declarations and manual paths.
  • AC8: compare exact diff-body and expansion output at display-cap boundaries.
  • AC9: inject a proof failure and assert it cannot become a content classification.
  • AC10: execute the Go cases in an isolated PATH without Python or uv.
  • AC11: snapshot content/index around all classification cases.
  • AC12: inspect executing native cases on all three CI platforms.
  • Definition of done: D1 each AC is verified at the merged head, with the commands and results cited in the pull request's Verification. D2 an independent review approves the exact merged head, and every finding has a recorded disposition. D3 required checks pass with no gate loosened. D4 the leak scans the repository specifies are clean, and every post made for this work passes the per-post leak review before it is posted. D5 every commit is signed. D6 the documentation matches the change or the Verification says why there is no impact. D7 every commit has an Assisted-by trailer and the pull request has the provenance:agent-assisted label. D8 the pull request stays within the size limits. D9 follow-ups are filed as issues and listed under Related. D10 the merge closes the issue through a closing reference, the board shows Done, and the final Status: comment names the merge commit.

Risks

Wrong side names or declaration precedence can turn a content conflict into an unsafe mechanical choice. Undo: revert the Go command before activation; the frozen classifier remains available.

Operator authority

None.

Activity

  1. tbhb-agent commented on Oct 27, 2026

    @tbhb-agent
    ContributorAuthor

    Refinement: READY — Classify stopped conflicts and print their evidence in Go
    Model: gpt-6-astra

    Child 07 Classify stopped conflicts and print their evidence in Go

    Verdict: READY

    Checked: AC2 now defines effective selection as explicit arguments when supplied, otherwise discovered unmerged paths. This matches packages/agents/source/skills/resolve-rebase-conflicts/shared/scripts/classify-conflicts.sh:71. The resolved-path report remains consistent with packages/agents/source/skills/resolve-rebase-conflicts/shared/scripts/classify-conflicts.sh:100.

    The verification plan explicitly covers an active operation with no unmerged paths both without arguments, producing refusal, and with an explicitly named resolved path, producing its report. AC1 retains the supported-operation prerequisite. Child 05’s corrected output boundary does not change classification semantics. Forecast remains 640 code lines.

    Gaps: None. The round 1 gap is closed.

    Split: None required.

    Definition of done

    The definition of done for this issue (Feature). Tick each item and give its evidence.

    • D1 The author verified each AC on the merged head, and the Verification section of the pull request cites each AC ID with its evidence: the command and its result, or a link.
    • D2 An independent reviewer approved the exact merged head, and the author resolved each finding or filed it as a follow-up.
    • D3 The required checks pass on that head, and any loosened gate has the owner's approval of that exact head.
    • D4 The leak scans come back clean: gitleaks, devtools' check-leaks.sh with the repository's private-strings list, and the leak review of each post.
    • D5 The author signed each commit, the squash included.
    • D6 The docs match the change (README, docs/, CHANGELOG or help text), or the Verification section says "No doc impact" and why.
    • D7 The commits and the squash have Assisted-by trailers, and the pull request has the provenance:agent-assisted label.
    • D8 The pull request stays within the size limits, or the owner approved its exact head over the hard limit.
    • D9 The author files follow-ups and deferred findings as issues with at least a Problem and numbered AC and lists them under the Related section of the pull request. Any work left in the code links its issue.
    • D10 The merge closes the issue through a closing reference and the board shows Done. The final Status: comment names the merge commit.
    • devtools-1 mise run check is green, and so are the coverage floors mise run cover-go-check and mise run cover-py-check, which check doesn't run.
    • devtools-2 A change to skill sources under packages/agents/source/ commits what mise run generate-skills, then mise run skill-tokens, then apm install rewrite, in that order, and check-generated-skills (part of lint) passes.
    • devtools-3 A consumer-visible change (the vendored payload, a skill, a reusable workflow, a task or a pin) has its consumer steps in docs/agent-skills-migration.md or the adoption docs, or the PR's Verification says "No consumer impact" and why.

    Round: 2 of 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refinement:readyPassed the Definition of Ready; may be picked up

    Fields

    Priority

    None yet

    Work type

    None yet

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions