From 03a63262ec78c2357207b99f484522cad5cc7545 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Tue, 1 Dec 2026 15:35:40 +0100 Subject: [PATCH] Plan a principle on waiting for another goroutine's work in a test --- todo.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/todo.md b/todo.md index 87ad5c48..00fd3817 100644 --- a/todo.md +++ b/todo.md @@ -6,13 +6,14 @@ `Bar = 0.1` -`Next ID = 566` +`Next ID = 567` ## Items | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| | 565 | 0.17.0 | | question | **Decide whether Install's backup step covers the agents' memory files under `~/.claude/projects/`, and whether the plan item that lists `~/.claude/rules/this-machine/` names a folder anything writes.** | 1 | 2 | 1 | 2 | 2 | | 0.0 | +| 566 | 0.17.0 | | | **Add to `technical-principles.md` that a test waits for work another goroutine or process does on a signal the code or its fake sends, never on a count read straight after the call.** | 1 | 2 | 1 | 2 | 1 | 1 by 1 | 0.4 | | 480 | 0.18.0 | | owner | **Resolve every path the tools use in one module: the release root (the folder the running code ships in), the config folder, the state folder and the Claude home. Then only that module names `~/.claude`, and the loop still runs from `~/.claude`.** | 3 | 2 | 3 | 6 | 6 | 1.6 by 3, code health by 3 | 1.9 | | 481 | 0.18.0 | 480 | owner | **Put the release's tools on `PATH` for every session the loop starts and every hook it runs, name them bare in the prose in place of `~/.claude/bin/`, and refuse the old spelling in new prose.** | 3 | 2 | 3 | 6 | 6 | 1.4 by 2, 2 by 2, code health by 2 | 1.5 | | 561 | 0.18.0 | | | **Clean up a do-epic chunk whose pull request has merged without waiting for a running slot, and close its window.** | 2 | 2 | 2 | 4 | 3 | 1.5 by 2 | 0.5 | @@ -120,6 +121,16 @@ Recommendation: drop it from item 484's detail, unless the human keeps files the Touches: - `README.md`: `## Install` (small) +### 566. Add to `technical-principles.md` that a test waits for work another goroutine or process does on a signal the code or its fake sends, never on a count read straight after the call. + +An outside reviewer found a test that counted the connections a fake server had accepted straight after the calls that made them. The server's accept loop runs on its own goroutine, so the count can lag, and the test could fail with nothing wrong. Our stability review passed it twice, and the fix I first reached for was a sleeping poll, which the principle "A test neither sleeps nor asserts on the wall clock" bans. The principle names the sleep but gives no way to wait without one. + +Add one bullet beside it under "Most, if not all, code should have automated tests": a test that reads state another goroutine, process or queue sets waits on a signal that the code under test or its fake sends, such as a channel or a callback, with a timeout that only fails the test. BANNED: `assert len(server.connections) == 3` right after the client calls. GOOD: the fake sends on a channel per connection, and the test receives three times, with a timeout. + +Touches: + +- `principles/technical-principles.md` + ### 480. Resolve every path the tools use in one module: the release root (the folder the running code ships in), the config folder, the state folder and the Claude home. Then only that module names `~/.claude`, and the loop still runs from `~/.claude`. Part of the standalone-install plan lilleman approved on 2026-11-20. Today about 160 references in some 40 modules name `~/.claude`; `bin/loop_state/paths.py` holds a few. This item changes no behaviour. -- 2.52.0