CLAUDE.md: clarify loop exit conditions — never stop mid-loop
Three changes to prevent the agent from stopping between iterations: 1. Add bold "Do NOT stop between iterations" notice at the top of the main loop — each commit is a checkpoint, not a stopping point. 2. Main loop step 6: reinforce "keep looping until blocked or all corpus tests pass." 3. Module-system sub-loop: step 5 now says "immediately continue to step 3. Do NOT stop here." Step 6 is renamed "Exit condition" with explicit criteria (gap zero, num_passing incremented, tests pass). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,10 @@ tests pass.
|
||||
|
||||
Repeat until all corpus tests in `stage0/corpus.zig` pass:
|
||||
|
||||
**Do NOT stop between iterations.** Each commit is a checkpoint, not a
|
||||
stopping point. Continue looping until all tests pass or you are
|
||||
genuinely blocked (need user input to proceed).
|
||||
|
||||
1. **Bump.** Increment `num_passing` by 1 in `stage0/corpus.zig`.
|
||||
2. **Run.** `zig build test-zig0` — observe the failure.
|
||||
3. **Port.** Mechanically copy the needed logic from `src/Sema.zig` into
|
||||
@@ -27,7 +31,8 @@ Repeat until all corpus tests in `stage0/corpus.zig` pass:
|
||||
- Add functions in the same order as in the original Zig file.
|
||||
4. **Test.** `zig build test-zig0` — iterate until the new test passes.
|
||||
5. **Clean up & commit.** See [Cleaning Up](#cleaning-up).
|
||||
6. **Go to 1.**
|
||||
6. **Go to 1.** Do NOT stop between iterations — keep looping until
|
||||
blocked or all corpus tests pass.
|
||||
|
||||
## When stuck
|
||||
|
||||
@@ -85,10 +90,13 @@ entries so that IP indices in the function body AIR match.
|
||||
- `ensureFileAnalyzed` → recursively processes imported modules.
|
||||
- `zirExport` → forces resolution of exported declarations.
|
||||
4. **Test.** `zig build test-zig0` — the gap should shrink.
|
||||
5. **Clean up & commit** (see [Cleaning Up](#cleaning-up)). Keep
|
||||
5. **Clean up & commit** (see [Cleaning Up](#cleaning-up)), then
|
||||
**immediately continue** to step 3. Do NOT stop here. Keep
|
||||
`num_passing` at whatever value passes; don't bump it until the gap
|
||||
reaches zero.
|
||||
6. **Repeat** until the gap is zero and `num_passing` can be incremented.
|
||||
6. **Exit condition:** the gap is zero, `num_passing` is incremented,
|
||||
and `zig build test-zig0` passes. Only then return to
|
||||
[The loop](#the-loop) step 6.
|
||||
|
||||
### Important constraints
|
||||
|
||||
|
||||
Reference in New Issue
Block a user