Skip to content

Rectify: Merge Failure Domain Routing — Rebase Misrouted to resolve-failures#2175

Merged
Trecek merged 9 commits into
developfrom
rebase-failures-misrouted-to-resolve-failures-instead-of-res/2173
May 7, 2026
Merged

Rectify: Merge Failure Domain Routing — Rebase Misrouted to resolve-failures#2175
Trecek merged 9 commits into
developfrom
rebase-failures-misrouted-to-resolve-failures-instead-of-res/2173

Conversation

@Trecek
Copy link
Copy Markdown
Collaborator

@Trecek Trecek commented May 7, 2026

Summary

The recipe routing architecture treats all four recoverable MergeFailedStep values as a single undifferentiated class, routing them all to the same fix/assess step which invokes resolve-failures. But failed_step == 'rebase' is a git-conflict failure that requires resolve-merge-conflicts — a fundamentally different skill. The existing merge-routing-incomplete semantic rule enforces routing completeness (all four values have explicit routes) but not routing correctness (each value routes to a domain-appropriate skill). The architectural fix introduces failure domain classification and a new semantic rule that cross-validates the failure domain against the downstream skill, making this entire class of misrouting bug impossible.

Conflict Resolution Decisions

The following files had merge conflicts that were automatically resolved.

Changed Files

New (★):

  • tests/recipe/test_rules_merge_failure_domain.py

Modified (●):

  • src/autoskillit/recipe/rules/rules_merge.py
  • src/autoskillit/recipes/implementation-groups.yaml
  • src/autoskillit/recipes/implementation.yaml
  • src/autoskillit/recipes/remediation.yaml
  • src/autoskillit/skills_extended/resolve-merge-conflicts/SKILL.md
  • tests/recipe/CLAUDE.md
  • tests/recipe/test_rules_integration_predicate.py

Closes #2173

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/remediation-20260507-093144-301871/.autoskillit/temp/rectify/rectify_rebase_misrouting_2026-05-07_093500.md

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
rectify claude-sonnet-4-6 1 2.7k 15.2k 1.0M 136.9k 204 72.3k 12m 7s
dry_walkthrough claude-sonnet-4-6 1 2.8k 9.5k 769.0k 56.4k 112 46.3k 7m 14s
implement* MiniMax-M2.7-highspeed 1 3.6M 20.2k 2.2M 34.0k 185 44.1k 15m 48s
prepare_pr* MiniMax-M2.7-highspeed 1 163.1k 4.0k 312.8k 28.7k 29 15.3k 1m 22s
compose_pr* MiniMax-M2.7-highspeed 1 48.1k 2.0k 198.0k 28.7k 18 15.1k 47s
review_pr claude-sonnet-4-6 2 578 58.7k 754.3k 75.5k 70 119.7k 13m 27s
resolve_review claude-opus-4-6 2 107 20.0k 2.4M 76.7k 93 165.7k 12m 9s
Total 3.8M 129.6k 7.6M 136.9k 478.5k 1h 2m

* Step used a non-Anthropic provider; caching behavior may differ.

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
rectify 0
dry_walkthrough 0
implement 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 20 121269.9 8285.6 1000.2
Total 20 380971.2 23925.5 6480.7

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
claude-sonnet-4-6 2 5.5k 24.7k 1.8M 118.6k 19m 22s
MiniMax-M2.7-highspeed 3 3.8M 26.1k 2.7M 74.4k 17m 58s

Trecek and others added 9 commits May 7, 2026 09:53
Step 1 of the rebase misrouting fix. These tests encode the invariant
that failed_step == 'rebase' must route to resolve-merge-conflicts (not
resolve-failures), and that code failures must not route to the merge-
conflict skill.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Introduces failure domain classification (_MERGE_FAILURE_DOMAINS,
_REQUIRED_SKILL_BY_DOMAIN) and a new rule that cross-validates that
rebase failures route to resolve-merge-conflicts and code failures route
to resolve-failures.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…cipes

Add rebase_conflict_fix step to implementation.yaml, implementation-groups.yaml,
and remediation.yaml. Change the rebase on_result route from fix/assess
to rebase_conflict_fix, which invokes resolve-merge-conflicts.

Also update the resolve-merge-conflicts SKILL.md to document the
rebase_conflict_fix step as a caller alongside the existing queue/direct/
immediate/CI conflict paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…d table

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
cond3.route for rebase failures now routes to rebase_conflict_fix
instead of fix/assess, reflecting the new merge failure domain split.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The for-loop in test_rebase_routes_to_merge_conflict_skill silently
passes if no rebase condition exists in a recipe. Add a found_rebase
flag to fail explicitly when no rebase condition is matched.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tests

TestBundledRecipesPassFailureDomainCheck performs filesystem I/O via
load_recipe(), violating the small size constraint. Add pytest.mark.medium
override on the class. Also guard target_step.with_args against None to
produce a clear assertion failure instead of AttributeError.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ts SKILL.md

Replace RST-style double backticks with Markdown single backticks in
the "When to Use" section for consistency with the rest of the file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Trecek Trecek added this pull request to the merge queue May 7, 2026
Merged via the queue into develop with commit c8a7033 May 7, 2026
2 checks passed
@Trecek Trecek deleted the rebase-failures-misrouted-to-resolve-failures-instead-of-res/2173 branch May 7, 2026 17:48
Trecek added a commit that referenced this pull request May 8, 2026
…ailures (#2175)

## Summary

The recipe routing architecture treats all four recoverable
`MergeFailedStep` values as a single undifferentiated class, routing
them all to the same `fix`/`assess` step which invokes
`resolve-failures`. But `failed_step == 'rebase'` is a git-conflict
failure that requires `resolve-merge-conflicts` — a fundamentally
different skill. The existing `merge-routing-incomplete` semantic rule
enforces routing *completeness* (all four values have explicit routes)
but not routing *correctness* (each value routes to a domain-appropriate
skill). The architectural fix introduces failure domain classification
and a new semantic rule that cross-validates the failure domain against
the downstream skill, making this entire class of misrouting bug
impossible.

## Conflict Resolution Decisions

The following files had merge conflicts that were automatically
resolved.

## Changed Files

### New (★):
- tests/recipe/test_rules_merge_failure_domain.py

### Modified (●):
- src/autoskillit/recipe/rules/rules_merge.py
- src/autoskillit/recipes/implementation-groups.yaml
- src/autoskillit/recipes/implementation.yaml
- src/autoskillit/recipes/remediation.yaml
- src/autoskillit/skills_extended/resolve-merge-conflicts/SKILL.md
- tests/recipe/CLAUDE.md
- tests/recipe/test_rules_integration_predicate.py

Closes #2173

## Implementation Plan

Plan file:
`/home/talon/projects/autoskillit-runs/remediation-20260507-093144-301871/.autoskillit/temp/rectify/rectify_rebase_misrouting_2026-05-07_093500.md`

🤖 Generated with [Claude Code](https://claude.com/claude-code) via
AutoSkillit
<!-- autoskillit:pipeline-signature
steps=prepare_pr,run_arch_lenses,compose_pr,annotate_pr_diff,review_pr
-->

## Token Usage Summary

| Step | Model | count | uncached | output | cache_read | peak_ctx |
turns | cache_write | time |

|------|-------|-------|----------|--------|------------|----------|-------|-------------|------|
| rectify | claude-sonnet-4-6 | 1 | 2.7k | 15.2k | 1.0M | 136.9k | 204 |
72.3k | 12m 7s |
| dry_walkthrough | claude-sonnet-4-6 | 1 | 2.8k | 9.5k | 769.0k | 56.4k
| 112 | 46.3k | 7m 14s |
| implement* | MiniMax-M2.7-highspeed | 1 | 3.6M | 20.2k | 2.2M | 34.0k
| 185 | 44.1k | 15m 48s |
| prepare_pr* | MiniMax-M2.7-highspeed | 1 | 163.1k | 4.0k | 312.8k |
28.7k | 29 | 15.3k | 1m 22s |
| compose_pr* | MiniMax-M2.7-highspeed | 1 | 48.1k | 2.0k | 198.0k |
28.7k | 18 | 15.1k | 47s |
| **Total** | | | 3.8M | 50.9k | 4.4M | 136.9k | | 193.1k | 37m 20s |

\* *Step used a non-Anthropic provider; caching behavior may differ.*

## Model Usage Breakdown

| Model | steps | uncached | output | cache_read | cache_write | time |
|-------|-------|----------|--------|------------|-------------|------|
| claude-sonnet-4-6 | 2 | 5.5k | 24.7k | 1.8M | 118.6k | 19m 22s |
| MiniMax-M2.7-highspeed | 3 | 3.8M | 26.1k | 2.7M | 74.4k | 17m 58s |

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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