File item 456, so the child-shell stop test stops failing under load
CI / tests (pull_request) Successful in 3m46s

This commit is contained in:
Lilleman
2026-11-19 16:40:35 +01:00
parent 26cadbb79e
commit ff3961ca77
+15 -1
View File
@@ -6,7 +6,7 @@
`Bar = 0.1`
`Next ID = 456`
`Next ID = 457`
## Items
@@ -35,6 +35,7 @@
| 149 | 0.14.0 | | decision | **Fill each release by priority up to a capacity it states, in place of the bar, and move what does not fit to a later release.** | 4 | 2 | 3 | 7 | 5 | 1.1 by 7 | 1.6 |
| 165 | 0.14.0 | | | **Make this repo's tests assert the facts a prompt or help text carries in place of its sentences, and drop the tests that scan source or assert a constant.** | 3 | 2 | 1 | 4 | 5 | 1.1 by 4, 1.4 by 3 | 1.6 |
| 392 | 0.14.0 | | owner | **Group bin/'s packages by concern into seven folders (plan, records, integrations, loop, review, forge and host), so a newcomer finds a tool's neighbours in one place.** | 3 | 1 | 3 | 5 | 7 | code health by 4 | 1.6 |
| 456 | 0.14.0 | | | **Make the child-shell stop test pass under load, so a full test run doesn't fail on a race.** | 2 | 2 | 2 | 4 | 2 | 1.1 by 2, 1.5 by 2 | 1.6 |
| 151 | 0.14.0 | | decision | **Keep 10 to 20 settled decisions per project as its goals' test set, and rerun them after a goal changes.** | 3 | 2 | 2 | 5 | 5 | 1.2 by 7 | 1.6 |
| 68 | 0.14.0 | | principle | **Test `workflow-bench/compare.py`'s blinding and `bench.py`'s run plan.** | 2 | 1 | 1 | 2 | 4 | 1.1 by 5 | 1.5 |
| 102 | 0.14.0 | | | **Give loop-claude's retry delay, and the file it reads the machine's memory from, environment overrides, so the black-box test stops replacing `time.sleep` and `machine_load.memory.MEMINFO` through `sitecustomize`.** | 1 | 1 | 2 | 2 | 3 | 1.1 by 4 | 1.5 |
@@ -376,6 +377,19 @@ Group `bin/` by concern, one package level per group, with the launchers left at
`repo_checks` stays at the root, since it tests the repo, not a tool. The README's `bin/` list then becomes seven short groups. That list is a place the comprehension seats found hard (`README.md` → the `bin/` package list): make it easier to read.
### 456. Make the child-shell stop test pass under load, so a full test run doesn't fail on a race.
Found in a full `bin/run-tests` run on 2026-11-19, on a loaded machine: `ChildShells.test_stops_a_shell_and_the_process_it_started_and_no_other` (`bin/loop_effects/test_effects.py:243`) failed at line 249 with `AssertionError: 0 != -15`, and its file passed alone right after (36 passed). The branch changed nothing under `bin/loop_effects`.
The race, as far as reading shows: `child_shells.stop` sends SIGTERM to the shell's descendants first and to the shell last. The test's shell runs `sleep 60; true`. Once `sleep` dies, bash goes on to `true` and exits 0. When the test's process is descheduled between the two `os.kill` calls, bash has already exited, and the SIGTERM to its zombie does nothing, so `wait` returns 0. The same window is open in production: a shell running a loop, such as `until false; do sleep 60; done`, can start its next child between the kills, and that child outlives the stop, against `stop`'s docstring. `stop` is called by loop-claude's lingering-worker check (`bin/agent_cycle/lingering_workers.py:29`, through `bin/loop_effects/effects.py:106`).
So the fix likely belongs in `stop`, not only in the test: signal the shell before its descendants, or SIGSTOP it first, so it can't run anything after its child dies. Make the test fail on the old order deterministically, for example with a shell whose loop restarts its child, rather than relying on timing.
Touches:
- `bin/loop_effects/child_shells.py`: `stop` (small)
- `bin/loop_effects/test_effects.py`: `ChildShells.test_stops_a_shell_and_the_process_it_started_and_no_other`
### 151. Keep 10 to 20 settled decisions per project as its goals' test set, and rerun them after a goal changes.
Each case is a question the project settled and the answer it chose. A fresh-context agent given only the README's premises answers each case; a case it answers differently says the goals no longer decide it. Written guidance can fail to change behaviour, which is why the goals get a test.