Fix Module 25 reject(): git restore . leaves the simulated agent's untracked files in place
#26
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When the gate fails (Part A
--simulate bad),reject()printsgit restore . # throw the agent's change away (Module 2). In the simulated path the agent's change is the UNTRACKED filesagent_demo.pyandtest_agent_demo.py(plus__pycache__).git restoreonly touches tracked files, so it removes nothing — the bad change persists. The printed cleanup is wrong for the exact mode the lab tells learners to run first, and it misteaches the Module 2 fact it cites.Evidence
modules/25-autonomous-agents/lab/agent_runner.py(~lines 180-182) printgit restore ..simulate_implement()createsagent_demo.py/test_agent_demo.pyas NEW (untracked) files.Reproduced: after
--simulate bad,git restore .leavesagent_demo.py,test_agent_demo.py,__pycache__unchanged.Why it matters
The first-run mode the module promotes demonstrates a git fact that is false, undermining a Module-2 safety-net teaching in a course that promises honesty.
Proposed change
Make the printed/instructed cleanup match what actually discards the change:
rm agent_demo.py test_agent_demo.py).git restore .only for the real-agent path that edits tracked files, with accurate wording.Do NOT use
git clean -fd: it is over-broad (deletes all untracked files in the learner's repo) and would carry a "(Module 2)" callback to a command Module 2 never teaches.Acceptance criteria
--simulate badreject, the demo change is actually gone.git restoreon tracked edits).Affected files
modules/25-autonomous-agents/lab/agent_runner.pyReferences
Source finding F40 (realVotes 3/3).
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.