Commit a24a802
feat(code-review, test-planning): detect the diff base across multiple remotes and git-flow
The code-review and test-planning git-context detectors chose the branch to
diff changes against from origin/HEAD alone. On a fork whose origin default is
stale, on a git-flow branch cut from an integration branch, or on a branch that
merged another branch in, that base was wrong, so the review or test plan was
scoped to an inflated, empty, or mis-attributed diff.
Port review-skill-or-agent's base selection to both detectors: the base is now
the candidate whose fork point is nearest the current commit, measured along the
branch's own first-parent line, chosen across a multi-remote candidate pool.
- Candidate pool: every remote's declared default branch plus well-known
trunk/integration names (main, master, trunk, mainline, next, develop, devel,
development, default, dev), looked up as local and per-remote branches;
nearest own-line coincidence wins, declared defaults break ties.
- A candidate the branch merely merged in cannot win on its absorbed commits.
- Output contract shape unchanged; fail-open to `default-branch: none` preserved.
- Adds test/detect-review-context.bats and test/detect-test-context.bats
(16 tests each) under test/, which these detectors previously lacked.
Completes the OI-1 follow-up flagged in review-skill-or-agent (PR testdouble#119),
which intentionally ran ahead of these copies.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NfTexc8iv7XAqt3ksH9zNP1 parent a90cb09 commit a24a802
4 files changed
Lines changed: 674 additions & 10 deletions
File tree
- han-coding/skills
- code-review/scripts
- test-planning/scripts
- test
Lines changed: 53 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
31 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
32 | 81 | | |
33 | 82 | | |
34 | 83 | | |
| |||
38 | 87 | | |
39 | 88 | | |
40 | 89 | | |
41 | | - | |
42 | 90 | | |
43 | 91 | | |
Lines changed: 53 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
31 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
32 | 81 | | |
33 | 82 | | |
34 | 83 | | |
| |||
38 | 87 | | |
39 | 88 | | |
40 | 89 | | |
41 | | - | |
42 | 90 | | |
43 | 91 | | |
0 commit comments