Skip to content

test: phase-executor.model-roles.test.ts runs the exec guard against the developer's checkout and auto-commits uncommitted work #1232

Closed

Description

@admarble

Tier: mechanical

Problem

src/lib/workflow/phase-executor.model-roles.test.ts calls executePhaseWithRetry(975, "exec", …) with the SDK mocked and no cwd override, so the exec guard runs against the real process.cwd(). When that tree has uncommitted changes, the #1032 rescue (autoCommitUncommittedWork, phase-executor.ts) commits them as chore(#975): wip checkpoint — exec ended with uncommitted work (auto-committed by sequant).

Observed 2026-09-30 while writing #1227. Running this file next to phase-executor.test.ts, with the fix still uncommitted, turned the three edited files into a wip-checkpoint commit on the feature branch. CI is unaffected because its tree is clean. A developer running the file mid-edit gets a surprise commit, which is recoverable with git reset --soft HEAD~1.

This is the same class as #1163/#1164 (the suite writing checkout state), but here it's a git write.

Acceptance criteria

  • AC-1: The model-roles tests run the exec path in a temporary git repo, or with the change classifier stubbed, never against the developer's checkout. Evidence: with an uncommitted edit in the working tree, npx vitest run src/lib/workflow/phase-executor.model-roles.test.ts leaves git log -1 and git status --short unchanged
  • AC-2: No other test that calls executePhaseWithRetry / executePhase for the exec phase runs the guard against process.cwd(). Evidence: grep -rln 'executePhaseWithRetry(\|executePhase(' src --include='*.test.ts' reviewed in the PR body, one line per file

Relates to #1163, #1164, #1032, #1227.

Activity

  1. added
    bug
    on Sep 30, 2026
  2. added a commit that references this issue on Sep 30, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions