Skip to content

fix(taskctl): adversarial sees out-of-scope changes that are already in dev — worktree diff includes prior commits #285

@randomm

Description

@randomm

Problem

When the adversarial-pipeline reviews a task, it diffs the worktree branch against dev. If dev has moved forward since the worktree was created (e.g. another PR merged while this task was running), the adversarial sees those new dev commits as 'out-of-scope changes in this task'.

Observed in job for issue #275: worktree opencode/remove-hardcoded-sleep-from-installdependencies-3 was created from dev at commit e25e54e7b (PR #284). The adversarial reviewed it and flagged pulse.ts and worktree/index.ts changes as out-of-scope — but those were already in dev from PR #284, not introduced by the developer.

Root Cause

The adversarial prompt likely runs git diff dev..HEAD or similar, which shows all commits in the worktree branch that aren't in the current dev tip. If dev moved forward after worktree creation, the diff is clean. But if dev moved forward and the worktree branch was created from an older dev commit, the diff against current dev shows the developer's changes PLUS any dev commits that postdate the branch point.

OR: the adversarial is diffing against the worktree branch's base commit rather than the current dev, and seeing carry-over from the worktree initialization.

Acceptance Criteria

  • Adversarial only flags changes the developer actually made in this task
  • Changes already present in dev when the worktree was created are not flagged as out-of-scope
  • bun test and bun run typecheck pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions