Merge remote-tracking branch 'origin/main' into plan-team-principles
CI / tests (pull_request) Failing after 3m3s

# Conflicts:
#	todo.md
This commit is contained in:
2026-11-18 17:35:10 +01:00
4 changed files with 27 additions and 14 deletions
+1
View File
@@ -2,6 +2,7 @@
## Unreleased
- The technical principles now forbid a test that decides at run time whether to check anything, by a conditional skip, early return or catch around its assertions, and stability-reviewer flags one.
- do-epic's scorer orders an epic's items by score, then by Blocked by: an item's Moves names a goal as `epic 1.1`, `code health` or `repo 2`, and the epic's achieve goals outweigh the achieve goals of every repo. Nothing calls it yet.
- `todo-item add` and `todo-item edit --detail` refuse a detail whose `Touches:` list touch-predictions cannot read, and `rank_todo.py --check` fails on each item holding one, so rule-hook refuses a commit of such a plan: after updating, run `~/.claude/bin/rank_todo.py --check` in each project and fix each list it names.
- loop-claude hands each worker's claude a Bash output ceiling of 6,000 characters that saves a longer result to a file, rule-hook refuses a Read of a session transcript under ~/.claude/projects, and review-replay takes --bash-ceiling and --read-limit to test such a limit against archived review rounds.
+1
View File
@@ -125,6 +125,7 @@ Every PR gets at least this sweep.
- Was a test deleted while the behaviour it pinned remains? Flag it; restore the test.
- Were tests and implementation changed together in a way that could mask a regression — e.g. an assertion weakened to make a test pass? Flag it; these should be separate changes.
- Does each test earn its keep, as the technical principles' test bullet says? Look at where its expected values come from, what it asserts, what it mocks, what wording it pins, whether another test already pins the behaviour, and whether it sleeps or reads the wall clock.
- Does a test decide at run time whether to check anything, by a conditional skip, early return or catch around its assertions, as the technical principles' test bullet forbids? Flag it.
- Are there untestable side effects that should be refactored?
+1
View File
@@ -46,6 +46,7 @@
- Assert the outcome — returned values, stored state, emitted output — not how the code reached it. Use real collaborators or fakes; mock only slow, nondeterministic or external edges. BANNED: asserting which internal function ran, or scanning the source with `ast` or a regex. GOOD: `assertEqual(saved_row, {...})` against a fake store; a fake clock.
- Pin wording only where the wording is the contract: a message a consumer parses, a published format. For prompts, help and error text, assert the facts the text must carry — an item ID, a model argument, an error code — not the sentence. BANNED: `assertIn("<a 600-character prompt sentence>", prompt)`. GOOD: `assertIn("model opus, effort high", prompt)`.
- One behaviour per test, named for it, tested once, at the lowest level that reproduces it. No loops or branches in a test body; parametrize the cases.
- A test doesn't decide at run time whether to check anything: no conditional skip, early return, or catch around its assertions. A test that needs a state creates it, or fails and names what is missing. BANNED: `test.skip(created.every((count) => count === 0))` after the payroll run under test, since a broken payroll also creates zero rows. GOOD: before running the payroll, check each precondition and fail naming the one that is missing; after it, `expect(created).toEqual([1, 2, 1])`.
- Every escaped bug becomes a test that fails without its fix.
- Write no test that no real bug could fail: a constant's value, a list's length, the framework's own behaviour.
- A test neither sleeps nor asserts on the wall clock, and seeds any randomness.
+24 -14
View File
@@ -12,6 +12,7 @@
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 428 | 0.12.0 | | principle | **Make each test that skips at run time create the state it needs or fail naming what is missing, so no test in the repo skips at run time.** | 3 | 2 | 1 | 4 | 4 | code health by 3, 1.1 by 3 | 4.8 |
| 426 | 0.12.0 | | | **Read each epic issue's scores, its blockers and whether the loop filed it through `EpicStore`, from both backends.** | 2 | 2 | 2 | 4 | 3 | 1 by 5 | 1.9 |
| 427 | 0.12.0 | 426 | | **Re-rank Jira's backlog to match an epic's ranking, moving only the issues the loop filed, so people's issues keep their rank.** | 3 | 2 | 3 | 6 | 3 | 1 by 5 | 1.9 |
| 410 | 0.12.0 | 427 | | **Run `do-epic <EPIC-KEY>`: one tmux session per epic, a window per chunk, up to the epic's cap of running chunks and each repo's `parallel-chunks`, and never in a repo a loop-claude is running chunks in.** | 3 | 2 | 3 | 6 | 6 | 1 by 5 | 0.8 |
@@ -19,7 +20,6 @@
| 413 | 0.12.0 | 410 | | **File a finding about an epic goal in the epic and one about a repo goal by that repo's rules, ask the human where unsure which, and give the judge the epic's records beside the repo's.** | 3 | 2 | 3 | 6 | 4 | 1 by 5 | 1.6 |
| 415 | 0.12.0 | 410, 413 | | **Finish an epic: run release-review passes on each repo it changed, work what they file, have the human confirm each goal, post a summary comment, and close the epic in Jira last.** | 3 | 2 | 3 | 6 | 5 | 1 by 5 | 1.2 |
| 418 | 0.12.0 | 415 | | **Describe do-epic in `README.md`'s tools and setup, with its machine settings and `repo-rule.md`.** | 1 | 2 | 1 | 2 | 2 | 1 by 5 | 2.1 |
| 400 | 0.12.0 | | | **Forbid a test that decides at run time whether to check anything in `principles/technical-principles.md`, and point stability-reviewer's Tests checks at it.** | 1 | 2 | 3 | 4 | 2 | 1.1 by 5 | 2.0 |
| 420 | 0.12.0 | | | **End a worker that printed its final result and lingers, by killing the background shells it left, after a few minutes, and print each kill with its evidence on loop-claude's terminal.** | 2 | 2 | 2 | 4 | 3 | 1.5 by 6 | 2.0 |
| 409 | 0.12.0 | | | **Split an epic item that changes several repos into one Jira sub-task per repo, each labelled for its repo, with the parent tracking the whole change, when do-epic plans the item.** | 2 | 2 | 3 | 5 | 3 | 1 by 5 | 1.9 |
| 411 | 0.12.0 | 410 | | **Park a chunk whose PR waits on a long gate, keeping its worktree, PR and session in a state file that survives a reboot, and resume its session when the gate passes or a reviewer comments.** | 3 | 2 | 3 | 6 | 5 | 1 by 5 | 1.2 |
@@ -83,6 +83,29 @@
## Details
### 428. Make each test that skips at run time create the state it needs or fail naming what is missing, so no test in the repo skips at run time.
Follows item 400's bullet in `principles/technical-principles.md` → the tests principle: "A test doesn't decide at run time whether to check anything: no conditional skip, early return, or catch around its assertions. A test that needs a state creates it, or fails and names what is missing." Stability review found the repo's own tests break it in 13 places, each a skip decided at run time:
- root-less permission checks, `skipIf(os.geteuid() == 0, ...)`: 3 in `bin/loop_claude/test_black_box.py`, 3 in `bin/loop_claude/test_loop_claude.py`, 1 in `bin/routing_figures/test_routing_figures.py`, 1 in `bin/plan_store/test_stores.py`;
- pytest: `skipUnless(HAS_PYTEST, ...)` on the class `Run` in `bin/run_tests/test_run_tests.py`;
- docker: the `docker info` skipif on 2 tests in `bin/adf_codec/test_adf_codec.py`, and `needs_docker` in `bin/plan/test_touches.py`;
- /proc: `self.skipTest("no /proc/meminfo ...")` in `bin/run_heavy/test_run_heavy.py`.
The choice per case is the implementer's: for example, run the permission tests as a non-root user or drop the permission check in favour of an injected failure, take the docker or /proc state from an injected fake, or let the test fail naming what is missing. Done when a grep for `skipIf`, `skipUnless`, `skipTest` and `mark.skip` in the repo's tests finds none.
Touches:
- `bin/loop_claude/test_black_box.py`: `Cycles.test_exits_1_when_the_transcript_cannot_be_read`, `Interrupt.test_exits_1_when_the_transcript_cannot_be_read_after_the_interrupt`, `Models.test_exits_1_when_the_models_file_cannot_be_written`
- `bin/loop_claude/test_loop_claude.py`: `Cycles.test_stops_on_a_session_folder_it_cannot_read_whole`, `Cycles.test_stops_keeping_the_transcript_when_the_finished_chunks_session_cannot_be_deleted`, `RoutingCheck.test_says_a_figure_it_cannot_write_and_goes_on`
- `bin/routing_figures/test_routing_figures.py`: `Archive.test_fails_when_it_cannot_keep_the_state` (small)
- `bin/plan_store/test_stores.py`: `FilePlan.test_a_file_it_cannot_write_fails_naming_it` (small)
- `bin/run_tests/test_run_tests.py`: `HAS_PYTEST`, `Run` (small)
- `bin/adf_codec/test_adf_codec.py`: `test_round_trip_through_the_real_container`, `test_the_lossless_pair_gives_back_a_jira_description_identical_and_the_portable_pair_does_not`
- `bin/plan/test_touches.py`: `needs_docker`, `PredictedTest.test_a_list_written_in_markdown_and_read_back_from_a_jira_description_reads_as_written`, `PredictedTest.test_a_list_typed_in_jiras_editor_reads_as_its_files_and_parts`
- `bin/run_heavy/test_run_heavy.py`: `RunHeavy.test_a_docker_run_without_limits_gets_three_quarters_of_the_memory_split_across_the_slots` (small)
- `bin/machine_load/memory.py`: `read_memory` (small)
### 426. Read each epic issue's scores, its blockers and whether the loop filed it through `EpicStore`, from both backends.
Today `EpicIssue` holds none of the three, so do-epic cannot score or order an epic's items (item 408) or tell a person's issue from its own (item 427). The Jira backend reads them as `plan_store/jira_epic.py` does: the `plan-item` issue property, its `Filed by` key, and the "is blocked by" links. The contract tests in `contract.py` cover both backends.
@@ -164,19 +187,6 @@ Touches:
- `README.md`: `## Tools`, `### Set up a project` (small)
### 400. Forbid a test that decides at run time whether to check anything in `principles/technical-principles.md`, and point stability-reviewer's Tests checks at it.
Today the rule is only implied, by "fails when that behaviour breaks" and "states what it needs and gets it". Proposed bullet under the tests principle: "A test doesn't decide at run time whether to check anything: no conditional skip, early return, or catch around its assertions. A test that needs a state creates it, or fails and names what is missing. BANNED: `test.skip(created.every((count) => count === 0))`, since a broken payroll also creates zero rows. GOOD: check the precondition before the action, failing with its cause, then `expect(created).toEqual([1, 2, 1])`."
Add one line to section 11 of `agents/stability-reviewer.md` that points at the bullet.
Source: a client project's pull request, where a fix hid a regression behind a conditional skip.
Touches:
- `principles/technical-principles.md`
- `agents/stability-reviewer.md`: `### 11. Tests` (small)
### 420. End a worker that printed its final result and lingers, by killing the background shells it left, after a few minutes, and print each kill with its evidence on loop-claude's terminal.
On 2026-11-18 the worker of the item 402 chunk merged its pull request at about 11:47, printed its summary and then waited 95 minutes: it had started `until [ -s /tmp/merge-402.log ] && ! pgrep -f "chunk-pr merg"; do sleep 15; done` in the background, and `pgrep -f` matched the loop's own command line, so the condition never held. Its `claude -p` stayed alive ("Waiting for background work to finish"), `loop-claude` waited for it to exit, and the window's slot started no new chunk until the human found it and killed the shell.