fix(modules-4,7,14): make the git demos/labs actually do what the prose claims

- M4 Part C now commits the reviewed `delete` change as the checkpoint, so
  Part D's `git restore .` returns to a delete-containing state (was wiping it).
- M7 'watch it break': switch to an existing divergent branch so the
  "would be overwritten by checkout" refusal actually fires (git switch -c never did).
- M7 Part C: demonstrate worktree isolation with existing add/list and distinct
  per-worktree data; move the new clear/count commands to after they exist.
- M14 Part C: recover with `git revert HEAD` (Module 12, which precedes M14) so
  CI legitimately goes green; drop the wrong "Module 2's safety net" attribution.

Closes #2
Closes #3
Closes #4
Closes #12

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TfzV5QvtPDz8LJS3Pu5VLT
This commit is contained in:
2026-06-22 14:52:20 -04:00
parent b061a9da14
commit 9835dba566
3 changed files with 98 additions and 39 deletions
+10 -4
View File
@@ -274,15 +274,21 @@ and watch CI stop it.
`test_pending_excludes_completed_tasks` failed, with the assertion and the actual-vs-expected
values. CI caught in seconds what a skim would have waved through.
9. Reproduce and fix:
9. Reproduce and fix. The bad change is already committed *and pushed*, so `git restore` is no help
here — it only discards *uncommitted* edits, and there are none. The team-safe undo for something
already on shared history is `git revert` (Module 12): it writes a **new** commit that inverts the
bad one, instead of rewriting history other people may have pulled.
```bash
pytest -q # fails locally too — same command, same failure
git restore tasks.py # throw away the bad change (Module 2's safety net)
git commit -am "Revert: pending() must exclude completed tasks"
git push # CI goes green again
git revert HEAD # new commit that undoes "Simplify pending()" (Module 12)
git push # CI re-runs on the fixed code and goes green again
```
`git revert HEAD` opens an editor with a prefilled message (`Revert "Simplify pending()"`) — save
and close it. The revert restores the correct `pending()`, the push triggers CI on the fixed code,
and the run goes green.
10. *(Optional, to feel the linter tier.)* Add an obviously unused import to `cli.py`
(`import os` at the top, unused), commit, and push. Watch the **Lint** step fail *before* the
tests even run — the cheap check failing fast. Remove it and push again.