Fix Module 7 'watch it break' demo: git switch -c does NOT refuse on a dirty tree #3

Closed
opened 2026-06-22 14:23:38 -04:00 by claude · 0 comments
Contributor

Problem

Module 7's load-bearing motivation — you can't run two agents in one working directory because switching with uncommitted edits is refused — is demonstrated with a command that does the opposite. git switch -c <new-branch> creates a new branch pointing at the current commit, carries the dirty edits over, and exits 0. The "would be overwritten by checkout" refusal only occurs when switching to an existing branch whose version of the file differs. A learner running the exact commands sees success, not the wall the prose claims ("Git stops you" / "Git refuses").

Evidence

modules/07-worktrees-running-agents-in-parallel/README.md, Key concepts (~lines 60-68):

git switch -c feature/count
# error: Your local changes ... would be overwritten by checkout

and Part A (~lines 227-231). Verified on Git 2.53.0: git switch -c feature/count after editing cli.py carried the edit over and exited 0 — no error.

Why it matters

Violates the course's honesty/correctness promise and the exact-runnable-lab style of the locked exemplars: the central demonstration fails to fail. The worktrees concept itself is still valid; only the demo command is wrong.

Proposed change

Replace both sequences (Key concepts and Part A) with one that actually triggers the refusal, switching to an existing divergent branch:

  1. Commit work on feature/clear.
  2. Create feature/count off main.
  3. Make an uncommitted edit to cli.py.
  4. git switch feature/clear → produces error: Your local changes ... would be overwritten by checkout and exits 1.
    Reword the "Agent A is mid-change" framing so it fits a pre-existing divergent target branch, and update Part A's cleanup to match (drop any feature/scratch/feature/other that no longer apply).

Acceptance criteria

  • The shown command sequence reproducibly emits the "would be overwritten by checkout" error and exits non-zero.
  • Surrounding prose ("Git stops you"/"Git refuses") matches the actual behavior.
  • Part A cleanup references only branches the new sequence creates.

Affected files

  • modules/07-worktrees-running-agents-in-parallel/README.md

References

Source finding F2 (realVotes 3/3). Depends on branch switching from Module 6.


Filed from an adversarial multi-agent course review (217 raw findings → 54 adversarially-verified survivors). Scoped for manual review; intentionally not auto-assigned to an agent.

## Problem Module 7's load-bearing motivation — you can't run two agents in one working directory because switching with uncommitted edits is refused — is demonstrated with a command that does the opposite. `git switch -c <new-branch>` creates a new branch pointing at the current commit, carries the dirty edits over, and exits 0. The "would be overwritten by checkout" refusal only occurs when switching to an **existing** branch whose version of the file differs. A learner running the exact commands sees success, not the wall the prose claims ("Git stops you" / "Git refuses"). ## Evidence `modules/07-worktrees-running-agents-in-parallel/README.md`, Key concepts (~lines 60-68): ``` git switch -c feature/count # error: Your local changes ... would be overwritten by checkout ``` and Part A (~lines 227-231). Verified on Git 2.53.0: `git switch -c feature/count` after editing `cli.py` carried the edit over and exited 0 — no error. ## Why it matters Violates the course's honesty/correctness promise and the exact-runnable-lab style of the locked exemplars: the central demonstration fails to fail. The worktrees concept itself is still valid; only the demo command is wrong. ## Proposed change Replace both sequences (Key concepts and Part A) with one that actually triggers the refusal, switching to an **existing divergent** branch: 1. Commit work on `feature/clear`. 2. Create `feature/count` off `main`. 3. Make an uncommitted edit to `cli.py`. 4. `git switch feature/clear` → produces `error: Your local changes ... would be overwritten by checkout` and exits 1. Reword the "Agent A is mid-change" framing so it fits a pre-existing divergent target branch, and update Part A's cleanup to match (drop any `feature/scratch`/`feature/other` that no longer apply). ## Acceptance criteria - [ ] The shown command sequence reproducibly emits the "would be overwritten by checkout" error and exits non-zero. - [ ] Surrounding prose ("Git stops you"/"Git refuses") matches the actual behavior. - [ ] Part A cleanup references only branches the new sequence creates. ## Affected files - `modules/07-worktrees-running-agents-in-parallel/README.md` ## References Source finding F2 (realVotes 3/3). Depends on branch switching from Module 6. --- *Filed from an adversarial multi-agent course review (217 raw findings → 54 adversarially-verified survivors). Scoped for manual review; intentionally not auto-assigned to an agent.*
claude added the ai-readybugP1 labels 2026-06-22 14:23:38 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: justin/ai-workflow-course#3