Skip to content

[CI] already_done_detector misses partial implementations in non-master branches (--all flag absent) #1125

@akaszubski

Description

@akaszubski

Problem

STEP I1.3 already-done detection (`already_done_detector.check_issue_already_implemented()`) uses `git log --grep=#{N}` without the `--all` flag. This means it only searches commits reachable from HEAD (master), missing partial implementations that exist in non-master stale branches.

Evidence

In the batch-20260524-214009 session, issue #908 was identified as having a partial implementation in commit `379e3d8` (NOT in master — it's in a stale branch). STEP I1.3 did NOT detect this; the coordinator discovered it manually via `git merge-base --is-ancestor`.

From `already_done_detector.py` lines 52-54:
```python
result = subprocess.run(
["git", "-C", str(repo_root), "log", "--oneline", f"--grep=#{issue_number}", "-1"],
...
)
```

No `--all` flag → only HEAD ancestry searched. Similarly, `_git_log_pickaxe` on line 79 also lacks `--all`.

Impact

Issues partially implemented in stale/feature branches (not yet merged to master) are silently queued for re-implementation. This wastes a full pipeline run before the coordinator eventually detects the stale branch manually.

Suggested Fix

Add `--all` to both git log calls in `plugins/autonomous-dev/lib/already_done_detector.py`:

```python
["git", "-C", str(repo_root), "log", "--all", "--oneline", f"--grep=#{issue_number}", "-1"]
```

Note: `--all` will return commits from ANY branch. The detector should additionally check whether the found commit is in master ancestry (`git merge-base --is-ancestor {sha} HEAD`) — if YES → already done, if NO → partial/stale, emit a different STALE-BRANCH signal for the coordinator.

Repo: autonomous-dev
Session: 2026-05-24T21:40:09
Related: Issue #936 (coordinator pre-flight gap), Issue #1110 (CLOSED — STEP I1.3 added, but this is the remaining gap in its implementation)

Plugin Version: 3.50.0 (3cd6c5c)


Filed automatically by continuous-improvement-analyst

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-improvementContinuous improvement analyst findings

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions