From 53e663c8f8c407fe10ba67dd2637da3a0523d798 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:17:05 +0100 Subject: [PATCH 01/10] Run the tests once, on the latest stable Python, across the CPUs --- AGENTS.md | 2 +- CHANGELOG.md | 1 + README.md | 4 ++-- bin/loop_claude/test_black_box.py | 2 +- bin/loop_claude/test_loop_claude.py | 13 +++-------- bin/repo_checks/__init__.py | 4 ++++ bin/repo_checks/test_citations.py | 2 +- bin/repo_checks/test_gitignore.py | 2 +- bin/repo_checks/test_import_order.py | 2 +- bin/repo_checks/test_install.py | 2 +- bin/repo_checks/test_python_floor.py | 27 ----------------------- bin/repo_checks/test_reviewer_launches.py | 2 +- bin/repo_checks/test_settings.py | 2 +- bin/repo_checks/test_types.py | 8 +++---- bin/test_rank_todo.py | 2 +- docs/decisions.md | 8 +++---- docs/reading-cost.md | 4 ++++ todo.md | 17 +++----------- 18 files changed, 33 insertions(+), 71 deletions(-) delete mode 100644 bin/repo_checks/test_python_floor.py diff --git a/AGENTS.md b/AGENTS.md index dd4ede0a..114887a9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,8 +3,8 @@ Decisions live in `docs/decisions.md`: - bin/: an outcome is an entry of a `.outcomes.md` file in loop-claude's archive, a record is a document tools or people keep entries in, and a place is what a comprehension seat names -- bin/: the tests rerun themselves on a `uv`-fetched Python at README Install's floor - bin/: the tools and their tests run on the host's Python, with no container +- bin/: the tools support only the latest stable Python, and the tests run once on it, spread across the CPUs by pytest-xdist - chunks: a chunk takes every unblocked item of its release that fires the same review passes, whatever its purpose, and an item above R 5 ships alone - comprehension floor: every dimension and the overall at 7.0 or above is the target, and blocks no merge or release - larv-review: within a chunk lifting a project towards the comprehension floor, work on the project's lowest-scoring dimension comes first, and the floor doesn't block anything diff --git a/CHANGELOG.md b/CHANGELOG.md index a1688c22..b2caeb04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- The tools and their tests now support only the latest stable Python, today 3.14, which README Install now asks for as `python3`, in place of 3.11 or newer. README's Test line spreads the tests across the CPUs with pytest-xdist through `uvx`, so a full run takes about 23 s on 16 CPUs, where it took about 3.3 minutes. It used to rerun the whole suite on 3.11. - `routing-figures.md` now reports dollars by project, subagent type, rung and tool, in place of tokens. Cache reads are included; the tokens left them out, though they were about a quarter of the cost. The dollars are what each worker transcript's last `cost-state` entry records for each model, split across the messages of the worker and its subagents in proportion to their cost at list prices. The judge's runs are not counted, since the archive doesn't hold them. - larv-review's principles pass now launches one auditor per round, which checks the README's goals, code health and every principles file that applies, so it reads the project once per round. It used to launch one auditor for the goals with code health and one for each principles file, each reading the whole project. Its report is `principles-round-.md`, like every other pass's. - A session running larv-review now enters the chunk's worktree with `EnterWorktree` before the first review pass, so `/security-review` and the full scan read the branch's diff. Run from the checkout root, they used to find it empty. diff --git a/README.md b/README.md index 764a329c..ea824efa 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ git remote add origin ssh://git@gitea.larvit.se:21022/lilleman/claude-config.git Then run Update's commands, skipping `git add settings.json`: the new repository tracks no file yet. -Have Python 3.11 or newer as `python3` on `PATH`, and for Rust projects `rust-analyzer` on `PATH`, which the `rust-analyzer-lsp` plugin needs. Install every plugin `settings.json` enables: +Have the latest stable Python, today 3.14, as `python3` on `PATH`, and for Rust projects `rust-analyzer` on `PATH`, which the `rust-analyzer-lsp` plugin needs. Install every plugin `settings.json` enables: ```sh claude plugin marketplace add anthropics/claude-plugins-official @@ -110,7 +110,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a - `statusline.py` renders Claude Code's status line; `settings.json` → `statusLine` runs it. - `subagent-rung [--plan] ` prints the Agent tool's model and effort for a subagent's task, picked by its L from the project's model, and with `--plan` never below the project's rung; `subagent-rung --help` states the rule. -Test on the host, with `uv` on `PATH` to fetch mypy and the Python version Install names (`docs/decisions.md` → `bin/`): `python3 -m unittest discover -s bin -p 'test_*.py'`. Test the bench's git wrapper with `python3 -m unittest discover -s workflow-bench -p 'test_*.py'`. +Test on the host, with `uv` on `PATH` to fetch mypy and pytest-xdist, which spreads the tests across the CPUs (`docs/decisions.md` → `bin/`): `uvx --python "$(command -v python3)" --with pytest-xdist pytest -n auto bin`. `python3 -m unittest discover -s bin -p 'test_*.py'` runs the same tests one at a time. Test the bench's git wrapper with `python3 -m unittest discover -s workflow-bench -p 'test_*.py'`. To mutation-test a changed module, copy `bin/` to a scratch directory (`cp -r bin "$scratch"`): mutmut writes files beside its config. In the copy, name the module and its tests in a `setup.cfg`, as below for `score_outcomes/results.py`. Leave out each test class that starts a tool's launcher through `subprocess`: a mutated module fails to load in a process mutmut did not start. diff --git a/bin/loop_claude/test_black_box.py b/bin/loop_claude/test_black_box.py index abd14196..8760387f 100644 --- a/bin/loop_claude/test_black_box.py +++ b/bin/loop_claude/test_black_box.py @@ -247,7 +247,7 @@ class Checkout: os.write(controller, typed.encode()) output, deadline = b"", time.monotonic() + 60 while time.monotonic() < deadline: - if select.select([controller], [], [], 1)[0]: + if select.select([controller], [], [], 0.05)[0]: try: chunk = os.read(controller, 4096) except OSError: diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index 61511e60..c11a8a00 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -10,7 +10,6 @@ import stat import subprocess import sys import tempfile -import time import unittest import unittest.mock import uuid @@ -113,12 +112,6 @@ class FakeEffects: return [what for called, what in self.calls if called == seam] -def uuid7(): - # Python 3.11, the floor, has no uuid.uuid7. - random = int.from_bytes(os.urandom(10)) - return uuid.UUID(int=int(time.time() * 1000) << 80 | 7 << 76 | (random >> 62 & 0xFFF) << 64 | 2 << 62 | random & (1 << 62) - 1) - - def ran(stdout="", code=0, stderr=""): return subprocess.CompletedProcess([], code, stdout, stderr) @@ -143,7 +136,7 @@ class Worker: path.parent.mkdir(parents=True, exist_ok=True) with open(path, "a") as handle: if flag == "--session-id": - handle.write(json.dumps({"type": "custom-title"}) + "\n" + json.dumps({"type": "queue-operation", "timestamp": str(uuid7())}) + "\n") + handle.write(json.dumps({"type": "custom-title"}) + "\n" + json.dumps({"type": "queue-operation", "timestamp": str(uuid.uuid7())}) + "\n") if self.prompted: handle.write(json.dumps({**human(args[args.index("-p") + 1]), "promptSource": "sdk"}) + "\n") handle.write(json.dumps(assistant({"type": "text", "text": self.text})) + "\n") @@ -640,7 +633,7 @@ class Interrupts(unittest.TestCase): path = pathlib.Path(home, "t.jsonl") path.write_text(json.dumps(human("a")) + "\n") fake = FakeEffects(on_terminal_claude=[0], git=[""]) - stop = interrupt.talk(home, uuid7(), Rung("m", "high"), str(path), paths.paths_from(pathlib.Path(home)), {}, fake.effects()) + stop = interrupt.talk(home, uuid.uuid7(), Rung("m", "high"), str(path), paths.paths_from(pathlib.Path(home)), {}, fake.effects()) self.assertEqual(fake.made("claude_on_terminal")[0][:4], ["--model", "m", "--effort", "high"]) self.assertEqual(stop, Stop(2, "the human is needed to answer the question above, but the interrupt ended with nothing typed")) @@ -650,7 +643,7 @@ class Interrupts(unittest.TestCase): path.write_text(json.dumps(human("a")) + "\n") fake = FakeEffects(on_terminal_claude=[0], git=[""]) handed = {"LOOP_CLAUDE_PROJECT_RUNG": "claude-opus-5-5 at medium effort", "LOOP_CLAUDE_WORKER_RUNG": "claude-haiku-5-5 at max effort"} - interrupt.talk(home, uuid7(), Rung("claude-haiku-5-5", "max"), str(path), paths.paths_from(pathlib.Path(home)), handed, fake.effects()) + interrupt.talk(home, uuid.uuid7(), Rung("claude-haiku-5-5", "max"), str(path), paths.paths_from(pathlib.Path(home)), handed, fake.effects()) self.assertEqual(fake.terminal_environments, [handed]) diff --git a/bin/repo_checks/__init__.py b/bin/repo_checks/__init__.py index e69de29b..b9002fab 100644 --- a/bin/repo_checks/__init__.py +++ b/bin/repo_checks/__init__.py @@ -0,0 +1,4 @@ +import pathlib + +# The checkout root, which the repo checks read. +ROOT = pathlib.Path(__file__).resolve().parents[2] diff --git a/bin/repo_checks/test_citations.py b/bin/repo_checks/test_citations.py index 7bc89787..3c1796fe 100644 --- a/bin/repo_checks/test_citations.py +++ b/bin/repo_checks/test_citations.py @@ -7,7 +7,7 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from loop_claude.project.records import HUMAN_RULE_DIRS -from repo_checks.test_python_floor import ROOT +from repo_checks import ROOT RULE_PATH = rf"(?:{'|'.join(map(re.escape, HUMAN_RULE_DIRS))})/[\w-]+\.md" CITATION = re.compile(rf'`?(?:~/\.claude/)?(CLAUDE\.md|{RULE_PATH})`? → ("[^"]+"(?:,? (?:and )?"[^"]+")*)') diff --git a/bin/repo_checks/test_gitignore.py b/bin/repo_checks/test_gitignore.py index 7b704a0f..3718c53e 100644 --- a/bin/repo_checks/test_gitignore.py +++ b/bin/repo_checks/test_gitignore.py @@ -5,7 +5,7 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) -from repo_checks.test_python_floor import ROOT +from repo_checks import ROOT PRIVATE = [ ".claude/settings.local.json", diff --git a/bin/repo_checks/test_import_order.py b/bin/repo_checks/test_import_order.py index 58481b99..c8e43d42 100644 --- a/bin/repo_checks/test_import_order.py +++ b/bin/repo_checks/test_import_order.py @@ -6,7 +6,7 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) -from repo_checks.test_python_floor import ROOT +from repo_checks import ROOT def bound(node: ast.Import | ast.ImportFrom) -> list[str]: diff --git a/bin/repo_checks/test_install.py b/bin/repo_checks/test_install.py index 5f18b5bb..7041169a 100644 --- a/bin/repo_checks/test_install.py +++ b/bin/repo_checks/test_install.py @@ -5,7 +5,7 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) -from repo_checks.test_python_floor import ROOT +from repo_checks import ROOT class Install(unittest.TestCase): diff --git a/bin/repo_checks/test_python_floor.py b/bin/repo_checks/test_python_floor.py deleted file mode 100644 index f3e4ae04..00000000 --- a/bin/repo_checks/test_python_floor.py +++ /dev/null @@ -1,27 +0,0 @@ -import pathlib -import re -import shutil -import subprocess -import sys -import unittest - -ROOT = pathlib.Path(__file__).resolve().parents[2] -FLOOR = re.compile(r"Python 3\.(\d+) or newer") - - -def readme_floor() -> tuple[int, int] | None: - named = FLOOR.search((ROOT / "README.md").read_text(encoding="utf-8")) - return (3, int(named.group(1))) if named else None - - -class PythonFloor(unittest.TestCase): - def test_the_suite_passes_on_the_python_the_readme_names_as_floor(self): - floor = readme_floor() - self.assertIsNotNone(floor, "README.md's Install names `Python 3.N or newer`") - if sys.version_info[:2] == floor: - self.skipTest("this run is on the floor") - if shutil.which("uv") is None: - self.fail("uv on PATH fetches the floor interpreter; see README.md's Test line") - suite = ["python", "-m", "unittest", "discover", "-s", "bin", "-p", "test_*.py"] - ran = subprocess.run(["uv", "run", "--no-project", "--python", "%d.%d" % floor, *suite], capture_output=True, cwd=ROOT, text=True) - self.assertEqual(ran.returncode, 0, ran.stderr) diff --git a/bin/repo_checks/test_reviewer_launches.py b/bin/repo_checks/test_reviewer_launches.py index aca0062f..74546109 100644 --- a/bin/repo_checks/test_reviewer_launches.py +++ b/bin/repo_checks/test_reviewer_launches.py @@ -6,7 +6,7 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from review_passes import PASS_AGENTS, PASSES -from repo_checks.test_python_floor import ROOT +from repo_checks import ROOT from rule_hook.reviewer_rung import SEAT, SECURITY_OPENER OPENING = re.compile(r"^## Opening\n+```\n([^\n]+?\.)(?: |\n)", re.MULTILINE) diff --git a/bin/repo_checks/test_settings.py b/bin/repo_checks/test_settings.py index debbcfca..6af60d51 100644 --- a/bin/repo_checks/test_settings.py +++ b/bin/repo_checks/test_settings.py @@ -7,7 +7,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from settings_filter import cleaned from git_repo import git -from repo_checks.test_python_floor import ROOT +from repo_checks import ROOT INSTALL = "git config filter.settings.clean bin/settings_filter.py" diff --git a/bin/repo_checks/test_types.py b/bin/repo_checks/test_types.py index 2640677e..8e8b24b3 100644 --- a/bin/repo_checks/test_types.py +++ b/bin/repo_checks/test_types.py @@ -6,14 +6,12 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) -from repo_checks.test_python_floor import readme_floor, ROOT +from repo_checks import ROOT class Types(unittest.TestCase): - def test_mypy_passes_on_the_tools_at_the_floor(self): - floor = readme_floor() - self.assertIsNotNone(floor, "README.md's Install names `Python 3.N or newer`") + def test_mypy_passes_on_the_tools_for_the_python_running_the_tests(self): if shutil.which("uv") is None: self.fail("uv on PATH fetches mypy; see README.md's Test line") - ran = subprocess.run(["uv", "tool", "run", "--python", "%d.%d" % floor, "mypy==2.3.1", "--cache-dir=/dev/null", "--check-untyped-defs", "--disallow-untyped-defs", "--exclude", "/test_", "-p", "chunk_preflight", "-p", "claude_code", "-m", "comprehension_history", "-m", "git_repo", "-p", "judge_replay", "-p", "larv_review", "-p", "loop_claude", "-m", "markdown_text", "-p", "metric_bench", "-m", "project_key", "-m", "rank_todo", "-p", "reading_cost", "-m", "review_passes", "-p", "review_replay", "-m", "round_titles", "-p", "rule_hook", "-p", "rung_replay", "-p", "score_outcomes", "-m", "settings_filter", "-m", "shell_command", "-m", "statusline", "-p", "subagent_rung", "-m", "todo_table", "-p", "transcript_archive", "-m", "utc_stamp"], capture_output=True, cwd=ROOT / "bin", text=True) + ran = subprocess.run(["uv", "tool", "run", "--python", sys.executable, "mypy==2.3.1", "--cache-dir=/dev/null", "--check-untyped-defs", "--disallow-untyped-defs", "--exclude", "/test_", "-p", "chunk_preflight", "-p", "claude_code", "-m", "comprehension_history", "-m", "git_repo", "-p", "judge_replay", "-p", "larv_review", "-p", "loop_claude", "-m", "markdown_text", "-p", "metric_bench", "-m", "project_key", "-m", "rank_todo", "-p", "reading_cost", "-m", "review_passes", "-p", "review_replay", "-m", "round_titles", "-p", "rule_hook", "-p", "rung_replay", "-p", "score_outcomes", "-m", "settings_filter", "-m", "shell_command", "-m", "statusline", "-p", "subagent_rung", "-m", "todo_table", "-p", "transcript_archive", "-m", "utc_stamp"], capture_output=True, cwd=ROOT / "bin", text=True) self.assertEqual(ran.returncode, 0, ran.stdout + ran.stderr) diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index e910b2bb..17499bd6 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -10,7 +10,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent)) from failure import Failure import rank_todo -from repo_checks.test_python_floor import ROOT +from repo_checks import ROOT import todo_table # Voids code health, so these tests weigh only the project's own goals; class CodeHealth weighs it. diff --git a/docs/decisions.md b/docs/decisions.md index f4577499..5f47472c 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -10,14 +10,14 @@ Valid while the archive's file names, the Vocabulary and the panel keep these words. -## bin/: the tests rerun themselves on a `uv`-fetched Python at README Install's floor - -2026-09-26, larv-review. Serves goal 2. The suite reruns itself on a `uv`-fetched interpreter of the version Install names: `ast.parse(feature_version=)` on the host's Python accepts the nested f-string 186181a fixed, a compile check passes a call newer than the floor, like 3.12's `itertools.batched`, and a `python3.N` on `PATH` is installed by hand on every machine and again at each bump. Valid while `uv` can fetch the floor interpreter and no machine taking the checkout ships an older Python. - ## bin/: the tools and their tests run on the host's Python, with no container 2026-09-24, larv-review. Serves goals 1 and 2. The tools drive the host's claude CLI and read the host's session files, which a container cannot see; the tests run on the same host Python the tools meet. Valid while claude runs on the host. +## bin/: the tools support only the latest stable Python, and the tests run once on it, spread across the CPUs by pytest-xdist + +2026-10-28, lilleman, through todo item 245. Serves goal 1.5: the suite gates every chunk. It took 198 s, 102 s of which reran it on the oldest Python README Install named, 3.11. README Install now asks for the latest stable Python as `python3`, and mypy checks the tools for the Python running the tests. README's Test line runs pytest-xdist through `uvx`, which spreads the tests across the CPUs: 23 s on a 16-CPU machine. It passes the path of `python3`, since `uvx --python python3` picks a Python uv installed itself, which may be older. Plain `python3 -m unittest` runs the same tests one at a time. Valid while every machine taking the checkout gets the latest stable Python soon after its release. + ## chunks: a chunk takes every unblocked item of its release that fires the same review passes, whatever its purpose, and an item above R 5 ships alone 2026-10-22, lilleman, through todo item 217. Serves goal 1.4: each review has a fixed cost, so more items per chunk cost less per item. Across the 165 finished chunks loop-claude archived up to that day, a chunk took a median of 1.30M tokens with one item and 1.33M with two, and three in four chunks shipped one item. The old rule also asked one PR title to state what the items achieve together; lilleman dropped it, since unrelated items that fire the same passes cost one review. diff --git a/docs/reading-cost.md b/docs/reading-cost.md index ff8eacd7..b437bf28 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -883,3 +883,7 @@ Read most (opens and searches): ## Reading cost, chunk 22d616a7a912, finished 2026-10-28T10:14:46Z 116420 new input tokens before the first commit. + +## Reading cost, chunk b25d0b8f6319, finished 2026-10-28T11:11:03Z + +221959 new input tokens before the first commit. diff --git a/todo.md b/todo.md index 76dbf4e3..0acdf7a8 100644 --- a/todo.md +++ b/todo.md @@ -12,10 +12,9 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 245 | 0.4.0 | | owner | **Run the test suite once, on the latest stable Python alone, with its test files spread across the machine's CPUs, so a full run takes under a minute instead of about 3.3.** | 3 | 1 | 2 | 4 | 4 | 1.5 by 5 | 3.2 | -| 239 | 0.4.0 | 245 | owner | **Block a Read, `cat`, `sed` or `head` of a file range already in the session's context, with a note saying so, and let it through once a compaction dropped the range or the file changed.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3 | 2.0 | -| 244 | 0.4.0 | 245 | owner | **Open every line loop-claude prints to its terminal with the machine's local time, as in `2026-10-28 11:46:01`.** | 2 | 2 | 1 | 3 | 3 | 1.5 by 2 | 1.9 | -| 243 | 0.4.0 | 245 | owner | **Show every loop-claude on the machine that waits for the human in one terminal app, and let the human answer each one there, `/talk` included.** | 4 | 2 | 3 | 7 | 6 | 1.5 by 4 | 0.9 | +| 239 | 0.4.0 | | owner | **Block a Read, `cat`, `sed` or `head` of a file range already in the session's context, with a note saying so, and let it through once a compaction dropped the range or the file changed.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3 | 2.0 | +| 244 | 0.4.0 | | owner | **Open every line loop-claude prints to its terminal with the machine's local time, as in `2026-10-28 11:46:01`.** | 2 | 2 | 1 | 3 | 3 | 1.5 by 2 | 1.9 | +| 243 | 0.4.0 | | owner | **Show every loop-claude on the machine that waits for the human in one terminal app, and let the human answer each one there, `/talk` included.** | 4 | 2 | 3 | 7 | 6 | 1.5 by 4 | 0.9 | | 226 | 0.5.0 | | question | **Answer whether rule-hook's `run-heavy` rule should also catch a mutation run or docker build behind `uv run`, `poetry run`, `python3 -m`, `sudo`, `docker image build` and `docker compose up --build`, or narrow the `machine load:` decision's wording.** | 2 | 2 | 3 | 5 | 3 | 1.2 by 2, 1.5 by 2 | 4.0 | | 235 | 0.5.0 | | decision | **Compare the first 20 chunks whose worker ran under the 200k compaction window with the 20 before them, on review rounds past each pass's first, unfinished verdicts, 🔴, 🟡 and misread findings, dollars and hours per chunk, and file an item where any rose.** | 1 | 2 | 1 | 2 | 2 | 1.1 by 2, 1.4 by 3 | 6.8 | | 167 | 0.5.0 | | | **Refuse a `/security-review` or `/claude-security` Skill call below the project's rung, as rule-hook refuses such an Agent call.** | 3 | 2 | 3 | 6 | 2 | 1.1 by 4 | 5.6 | @@ -79,16 +78,6 @@ ## Details -### 245. Run the test suite once, on the latest stable Python alone, with its test files spread across the machine's CPUs, so a full run takes under a minute instead of about 3.3. - -lilleman's call, 2026-10-28: support only the latest stable Python, today 3.14, and drop every older one. It blocks the other 0.4.0 items so their chunks get the faster runs. Measured on 2026-10-28, on a 16-CPU machine: 765 tests in 198 s at 68% of one CPU. 102 s of that is `repo_checks/test_python_floor.py` rerunning the whole suite on 3.11. About 50 s is `loop_claude/test_black_box.py`, whose tests start loop-claude, a fake claude and git repos, 1 to 8 s each. About 30 s is the other tests that start the tools. mypy takes 3 s with its cache off. - -- Drop the floor rerun, `test_python_floor.py` and `readme_floor`, and make README Install ask for the latest stable Python as `python3`. Run mypy for that version. -- Replace `docs/decisions.md` → `bin/: the tests rerun themselves on a uv-fetched Python at README Install's floor` with the new rule, and update its title in `AGENTS.md`. Check that `bin/: the tools and their tests run on the host's Python` still holds. -- Spread the test files across the CPUs, with a small runner or pytest-xdist through `uvx`, and give README's Test line the one command that does it. Keep plain `python3 -m unittest` working. -- In `run_on_terminal` in `test_black_box.py`, check for the prompt every 50 ms instead of every second. -- Then, if the run is still over a minute, have the black-box tests copy one prepared git repo per class instead of building one per test. - ### 239. Block a Read, `cat`, `sed` or `head` of a file range already in the session's context, with a note saying so, and let it through once a compaction dropped the range or the file changed. lilleman's call, 2026-10-27, filed from PR #376's measurement of loop-claude's archive since 2026-10-21: a read of a file the agent read earlier in the thread, more than three messages before and without editing it in between, is 13% of the worker's reading, about $6 of the $45 its reads cost, and 1 to 2% of a reviewer's. How many of those repeat a range exactly is unmeasured, so the figures are a ceiling. A hook on `Read` and on the Bash reads `cat`, `sed` and `head` blocks such a read with a short note that the content is already in context and unchanged. It lets the read through after a compaction, when the content has left the context, or when the file changed since the read. A PreToolUse hook gets a `transcript_path`, which holds the earlier reads and each `compact_boundary`, so it may need no state of its own; check whether a hook inside a subagent gets the subagent's own transcript. -- 2.52.0 From d57727ec3925ec2afa87405113bc5f55af8f5e30 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:21:08 +0100 Subject: [PATCH 02/10] =?UTF-8?q?Answer=20architecture=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1=20(0=20misread);=20run=20the?= =?UTF-8?q?=20tests=20in=20one=20heavy=20slot's=20four=20workers,=20pin=20?= =?UTF-8?q?pytest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 2 +- CHANGELOG.md | 2 +- README.md | 2 +- bin/test_settings_filter.py | 2 +- docs/decisions.md | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 114887a9..d896a3ba 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ Decisions live in `docs/decisions.md`: - bin/: an outcome is an entry of a `.outcomes.md` file in loop-claude's archive, a record is a document tools or people keep entries in, and a place is what a comprehension seat names - bin/: the tools and their tests run on the host's Python, with no container -- bin/: the tools support only the latest stable Python, and the tests run once on it, spread across the CPUs by pytest-xdist +- bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run once on it in four pytest-xdist workers - chunks: a chunk takes every unblocked item of its release that fires the same review passes, whatever its purpose, and an item above R 5 ships alone - comprehension floor: every dimension and the overall at 7.0 or above is the target, and blocks no merge or release - larv-review: within a chunk lifting a project towards the comprehension floor, work on the project's lowest-scoring dimension comes first, and the floor doesn't block anything diff --git a/CHANGELOG.md b/CHANGELOG.md index b2caeb04..de18e887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- The tools and their tests now support only the latest stable Python, today 3.14, which README Install now asks for as `python3`, in place of 3.11 or newer. README's Test line spreads the tests across the CPUs with pytest-xdist through `uvx`, so a full run takes about 23 s on 16 CPUs, where it took about 3.3 minutes. It used to rerun the whole suite on 3.11. +- The tools and their tests now support only the latest stable Python, today 3.14, which README Install now asks for as `python3`, in place of 3.11 or newer. README's Test line runs the tests in four pytest-xdist workers through `uvx`, one heavy slot's CPUs, so a full run takes about 29 s, where it took about 3.3 minutes. It used to rerun the whole suite on 3.11. - `routing-figures.md` now reports dollars by project, subagent type, rung and tool, in place of tokens. Cache reads are included; the tokens left them out, though they were about a quarter of the cost. The dollars are what each worker transcript's last `cost-state` entry records for each model, split across the messages of the worker and its subagents in proportion to their cost at list prices. The judge's runs are not counted, since the archive doesn't hold them. - larv-review's principles pass now launches one auditor per round, which checks the README's goals, code health and every principles file that applies, so it reads the project once per round. It used to launch one auditor for the goals with code health and one for each principles file, each reading the whole project. Its report is `principles-round-.md`, like every other pass's. - A session running larv-review now enters the chunk's worktree with `EnterWorktree` before the first review pass, so `/security-review` and the full scan read the branch's diff. Run from the checkout root, they used to find it empty. diff --git a/README.md b/README.md index ea824efa..92b6c8bc 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a - `statusline.py` renders Claude Code's status line; `settings.json` → `statusLine` runs it. - `subagent-rung [--plan] ` prints the Agent tool's model and effort for a subagent's task, picked by its L from the project's model, and with `--plan` never below the project's rung; `subagent-rung --help` states the rule. -Test on the host, with `uv` on `PATH` to fetch mypy and pytest-xdist, which spreads the tests across the CPUs (`docs/decisions.md` → `bin/`): `uvx --python "$(command -v python3)" --with pytest-xdist pytest -n auto bin`. `python3 -m unittest discover -s bin -p 'test_*.py'` runs the same tests one at a time. Test the bench's git wrapper with `python3 -m unittest discover -s workflow-bench -p 'test_*.py'`. +Test on the host, with `uv` on `PATH` to fetch mypy, pytest and pytest-xdist, which runs the tests in four workers, one heavy slot's CPUs (`docs/decisions.md` → `bin/`): `uvx --python "$(command -v python3)" --with pytest-xdist==3.8.0 pytest==9.2.0 -n 4 bin`. `python3 -m unittest discover -s bin -p 'test_*.py'` runs the same tests one at a time. Test the bench's git wrapper with `python3 -m unittest discover -s workflow-bench -p 'test_*.py'`. To mutation-test a changed module, copy `bin/` to a scratch directory (`cp -r bin "$scratch"`): mutmut writes files beside its config. In the copy, name the module and its tests in a `setup.cfg`, as below for `score_outcomes/results.py`. Leave out each test class that starts a tool's launcher through `subprocess`: a mutated module fails to load in a process mutmut did not start. diff --git a/bin/test_settings_filter.py b/bin/test_settings_filter.py index d0d8cb28..ca140e6a 100644 --- a/bin/test_settings_filter.py +++ b/bin/test_settings_filter.py @@ -10,9 +10,9 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent)) from settings_filter import cleaned from test_env import isolated_env +from repo_checks import ROOT FILTER = pathlib.Path(__file__).resolve().parent / "settings_filter.py" -ROOT = FILTER.parents[1] PICKED = json.dumps({"theme": "dark", "model": "opus[1m]", "env": {}}, indent=2) diff --git a/docs/decisions.md b/docs/decisions.md index 5f47472c..dc0ab570 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -14,9 +14,9 @@ Valid while the archive's file names, the Vocabulary and the panel keep these wo 2026-09-24, larv-review. Serves goals 1 and 2. The tools drive the host's claude CLI and read the host's session files, which a container cannot see; the tests run on the same host Python the tools meet. Valid while claude runs on the host. -## bin/: the tools support only the latest stable Python, and the tests run once on it, spread across the CPUs by pytest-xdist +## bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run once on it in four pytest-xdist workers -2026-10-28, lilleman, through todo item 245. Serves goal 1.5: the suite gates every chunk. It took 198 s, 102 s of which reran it on the oldest Python README Install named, 3.11. README Install now asks for the latest stable Python as `python3`, and mypy checks the tools for the Python running the tests. README's Test line runs pytest-xdist through `uvx`, which spreads the tests across the CPUs: 23 s on a 16-CPU machine. It passes the path of `python3`, since `uvx --python python3` picks a Python uv installed itself, which may be older. Plain `python3 -m unittest` runs the same tests one at a time. Valid while every machine taking the checkout gets the latest stable Python soon after its release. +2026-10-28, lilleman, through todo item 245. Serves goal 1.5: the suite gates every chunk. It took 198 s, 102 s of which reran it on the oldest Python README Install named, 3.11. README Install now asks for the latest stable Python as `python3`, and mypy checks the tools for the Python running the tests. README's Test line runs the tests in four pytest-xdist workers through `uvx`: 29 s on a 16-CPU machine. Four is one heavy slot's CPUs, `CPUS_PER_SLOT` in `bin/machine_load/slots.py`, so a gate under `run-heavy` loads only the slot it waits for. The line pins pytest and pytest-xdist, as `test_types.py` pins mypy, so every machine runs the gate the same way. It passes the path of `python3`, since `uvx --python python3` picks a Python uv installed itself, which may be older. The tests use stdlib `unittest` alone, and pytest only runs them, so plain `python3 -m unittest` runs the same tests one at a time and another runner can replace pytest. Valid while every machine taking the checkout gets the latest stable Python soon after its release. ## chunks: a chunk takes every unblocked item of its release that fires the same review passes, whatever its purpose, and an item above R 5 ships alone -- 2.52.0 From 084d7634127fe134f582781e03f274f54d78b090 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:21:34 +0100 Subject: [PATCH 03/10] =?UTF-8?q?Answer=20architecture=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From dd4bcbd1c4cb7b6eea1ee730682181410fdbc637 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:28:57 +0100 Subject: [PATCH 04/10] =?UTF-8?q?Answer=20principles=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=203=20=F0=9F=9F=A1=20(0=20misread);=20type-check?= =?UTF-8?q?=20every=20tool=20for=20README's=20Python,=20check=20the=20work?= =?UTF-8?q?er=20count,=20pin=20pytest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- bin/repo_checks/test_readme_test_line.py | 16 ++++++++++++++++ bin/repo_checks/test_types.py | 21 +++++++++++++++++++-- docs/decisions.md | 2 +- 4 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 bin/repo_checks/test_readme_test_line.py diff --git a/README.md b/README.md index 92b6c8bc..58a53742 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ pytest_add_cli_args=-k not ScoreOutcomesTool ``` -Then, in the copy: `uvx --with pytest 'mutmut>=3,<4' run && uvx --with pytest 'mutmut>=3,<4' results`, and `uvx --with pytest 'mutmut>=3,<4' show ` to see a mutant's change. The config keys are mutmut 3's. +Then, in the copy: `uvx --with pytest==9.2.0 'mutmut>=3,<4' run && uvx --with pytest==9.2.0 'mutmut>=3,<4' results`, and `uvx --with pytest==9.2.0 'mutmut>=3,<4' show ` to see a mutant's change. The config keys are mutmut 3's. `bin/` is the import root: each launcher puts it on `sys.path`, so a module imports another by its path under `bin/`, such as `from claude_code.entries import parse_entry`. Each tool's package holds its tests; `rank_todo.py`, `settings_filter.py` and `statusline.py` are tools of one file each, tested beside them, `rule_hook` imports `rank_todo.py`'s check, `larv_review` imports `rank_todo.py`'s ranking, `score_outcomes` imports `reading_cost`'s record path, `judge_replay` imports `loop_claude`'s judge, and `loop_claude` runs `chunk-preflight` as a process of its own. `judge_replay` and `review_replay` share `rung_replay/`: the rung search, the argument reader, the candidate rungs and the exits. `rung_replay/` reads `loop_claude`'s retry count and models file. The other non-test modules at `bin/`'s root, `claude_code/` and `transcript_archive/` serve more than one tool; `model_routing/` holds the routing ladder, which loop-claude, `rule_hook`, both replay tools and `subagent-rung` read. `routing_figures/` measures loop-claude's archive for loop-claude's routing calls. `machine_load/` takes the machine's heavy slots, its shared lock files, for `run_heavy`, and reads the memory share that loop-claude waits for. `test_env.py` serves the tests, and `repo_checks/` tests the repo itself. diff --git a/bin/repo_checks/test_readme_test_line.py b/bin/repo_checks/test_readme_test_line.py new file mode 100644 index 00000000..1cd46c08 --- /dev/null +++ b/bin/repo_checks/test_readme_test_line.py @@ -0,0 +1,16 @@ +import pathlib +import re +import sys +import unittest + +sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) + +from machine_load.slots import CPUS_PER_SLOT +from repo_checks import ROOT + + +class TestLine(unittest.TestCase): + def test_the_readme_runs_the_tests_in_one_heavy_slots_cpus(self): + workers = re.search(r"pytest==\S+ -n (\d+) bin`", (ROOT / "README.md").read_text(encoding="utf-8")) + self.assertIsNotNone(workers, "README.md's Test line runs `pytest==X -n N bin`") + self.assertEqual(int(workers.group(1)), CPUS_PER_SLOT) diff --git a/bin/repo_checks/test_types.py b/bin/repo_checks/test_types.py index 8e8b24b3..ab4065c2 100644 --- a/bin/repo_checks/test_types.py +++ b/bin/repo_checks/test_types.py @@ -1,4 +1,5 @@ import pathlib +import re import shutil import subprocess import sys @@ -8,10 +9,26 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from repo_checks import ROOT +SUPPORTED = re.compile(r"the latest stable Python, today (3\.\d+)") + + +def tools() -> list[str]: + """mypy's arguments naming every package and module under bin/ but the repo checks, so a new tool is checked without being listed.""" + bin_folder = ROOT / "bin" + packages = sorted(init.parent.name for init in bin_folder.glob("*/__init__.py") if init.parent.name != "repo_checks") + modules = sorted(path.stem for path in bin_folder.glob("*.py") if not path.name.startswith("test_")) + return [*(word for package in packages for word in ("-p", package)), *(word for module in modules for word in ("-m", module))] + class Types(unittest.TestCase): - def test_mypy_passes_on_the_tools_for_the_python_running_the_tests(self): + def test_mypy_passes_on_the_tools_for_the_python_readme_install_names(self): + supported = SUPPORTED.search((ROOT / "README.md").read_text(encoding="utf-8")) + self.assertIsNotNone(supported, "README.md's Install names `the latest stable Python, today 3.N`") if shutil.which("uv") is None: self.fail("uv on PATH fetches mypy; see README.md's Test line") - ran = subprocess.run(["uv", "tool", "run", "--python", sys.executable, "mypy==2.3.1", "--cache-dir=/dev/null", "--check-untyped-defs", "--disallow-untyped-defs", "--exclude", "/test_", "-p", "chunk_preflight", "-p", "claude_code", "-m", "comprehension_history", "-m", "git_repo", "-p", "judge_replay", "-p", "larv_review", "-p", "loop_claude", "-m", "markdown_text", "-p", "metric_bench", "-m", "project_key", "-m", "rank_todo", "-p", "reading_cost", "-m", "review_passes", "-p", "review_replay", "-m", "round_titles", "-p", "rule_hook", "-p", "rung_replay", "-p", "score_outcomes", "-m", "settings_filter", "-m", "shell_command", "-m", "statusline", "-p", "subagent_rung", "-m", "todo_table", "-p", "transcript_archive", "-m", "utc_stamp"], capture_output=True, cwd=ROOT / "bin", text=True) + ran = subprocess.run(["uv", "tool", "run", "--python", sys.executable, "mypy==2.3.1", "--python-version", supported.group(1), "--cache-dir=/dev/null", "--check-untyped-defs", "--disallow-untyped-defs", "--exclude", "/test_", *tools()], capture_output=True, cwd=ROOT / "bin", text=True) self.assertEqual(ran.returncode, 0, ran.stdout + ran.stderr) + + def test_mypy_checks_run_heavy_and_each_root_module(self): + self.assertLessEqual({("-p", "run_heavy"), ("-p", "machine_load"), ("-m", "chunk_pick"), ("-m", "docker_command")}, set(zip(tools()[::2], tools()[1::2]))) + self.assertNotIn("repo_checks", tools()) diff --git a/docs/decisions.md b/docs/decisions.md index dc0ab570..79d30191 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -16,7 +16,7 @@ Valid while the archive's file names, the Vocabulary and the panel keep these wo ## bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run once on it in four pytest-xdist workers -2026-10-28, lilleman, through todo item 245. Serves goal 1.5: the suite gates every chunk. It took 198 s, 102 s of which reran it on the oldest Python README Install named, 3.11. README Install now asks for the latest stable Python as `python3`, and mypy checks the tools for the Python running the tests. README's Test line runs the tests in four pytest-xdist workers through `uvx`: 29 s on a 16-CPU machine. Four is one heavy slot's CPUs, `CPUS_PER_SLOT` in `bin/machine_load/slots.py`, so a gate under `run-heavy` loads only the slot it waits for. The line pins pytest and pytest-xdist, as `test_types.py` pins mypy, so every machine runs the gate the same way. It passes the path of `python3`, since `uvx --python python3` picks a Python uv installed itself, which may be older. The tests use stdlib `unittest` alone, and pytest only runs them, so plain `python3 -m unittest` runs the same tests one at a time and another runner can replace pytest. Valid while every machine taking the checkout gets the latest stable Python soon after its release. +2026-10-28, lilleman, through todo item 245. Serves goal 1.5: the suite gates every chunk. It took 198 s, 102 s of which reran it on the oldest Python README Install named, 3.11. README Install now asks for the latest stable Python as `python3`, and mypy checks every tool under `bin/` for the version it names. README's Test line runs the tests in four pytest-xdist workers through `uvx`: 29 s on a 16-CPU machine. Four is one heavy slot's CPUs, `CPUS_PER_SLOT` in `bin/machine_load/slots.py`, so a gate under `run-heavy` loads only the slot it waits for. The line pins pytest and pytest-xdist, as `test_types.py` pins mypy, so every machine runs the gate the same way. It passes the path of `python3`, since `uvx --python python3` picks a Python uv installed itself, which may be older. The tests use stdlib `unittest` alone, and pytest only runs them, so plain `python3 -m unittest` runs the same tests one at a time and another runner can replace pytest. Valid while every machine taking the checkout gets the latest stable Python soon after its release. ## chunks: a chunk takes every unblocked item of its release that fires the same review passes, whatever its purpose, and an item above R 5 ships alone -- 2.52.0 From 6ca9b4a2e78d3a141e4dbedff584f014bbc1c734 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:28:57 +0100 Subject: [PATCH 05/10] =?UTF-8?q?Answer=20security=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 17fb0ac247f3381ace5594785475eb74667edfe6 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:29:32 +0100 Subject: [PATCH 06/10] =?UTF-8?q?Answer=20principles=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 4193165c5d2f969e04c7f1529a34906fddae4344 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:33:34 +0100 Subject: [PATCH 07/10] =?UTF-8?q?Answer=20prose=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1=20(0=20misread);=20put=20the?= =?UTF-8?q?=20Test=20command=20first,=20rewrite=20the=20changelog=20entry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 2 +- CHANGELOG.md | 2 +- README.md | 2 +- bin/repo_checks/__init__.py | 2 +- bin/repo_checks/test_types.py | 2 +- docs/decisions.md | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d896a3ba..15b4b334 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ Decisions live in `docs/decisions.md`: - bin/: an outcome is an entry of a `.outcomes.md` file in loop-claude's archive, a record is a document tools or people keep entries in, and a place is what a comprehension seat names - bin/: the tools and their tests run on the host's Python, with no container -- bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run once on it in four pytest-xdist workers +- bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run on it in four pytest-xdist workers - chunks: a chunk takes every unblocked item of its release that fires the same review passes, whatever its purpose, and an item above R 5 ships alone - comprehension floor: every dimension and the overall at 7.0 or above is the target, and blocks no merge or release - larv-review: within a chunk lifting a project towards the comprehension floor, work on the project's lowest-scoring dimension comes first, and the floor doesn't block anything diff --git a/CHANGELOG.md b/CHANGELOG.md index de18e887..2c49dd7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- The tools and their tests now support only the latest stable Python, today 3.14, which README Install now asks for as `python3`, in place of 3.11 or newer. README's Test line runs the tests in four pytest-xdist workers through `uvx`, one heavy slot's CPUs, so a full run takes about 29 s, where it took about 3.3 minutes. It used to rerun the whole suite on 3.11. +- Install the latest stable Python, today 3.14, as `python3`: the tools and their tests no longer support 3.11 to 3.13. A full test run now takes about 29 s, where it took about 3.3 minutes. It runs once, on that Python, in four pytest-xdist workers, where it used to rerun the whole suite on 3.11. - `routing-figures.md` now reports dollars by project, subagent type, rung and tool, in place of tokens. Cache reads are included; the tokens left them out, though they were about a quarter of the cost. The dollars are what each worker transcript's last `cost-state` entry records for each model, split across the messages of the worker and its subagents in proportion to their cost at list prices. The judge's runs are not counted, since the archive doesn't hold them. - larv-review's principles pass now launches one auditor per round, which checks the README's goals, code health and every principles file that applies, so it reads the project once per round. It used to launch one auditor for the goals with code health and one for each principles file, each reading the whole project. Its report is `principles-round-.md`, like every other pass's. - A session running larv-review now enters the chunk's worktree with `EnterWorktree` before the first review pass, so `/security-review` and the full scan read the branch's diff. Run from the checkout root, they used to find it empty. diff --git a/README.md b/README.md index 58a53742..aa4ca79b 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a - `statusline.py` renders Claude Code's status line; `settings.json` → `statusLine` runs it. - `subagent-rung [--plan] ` prints the Agent tool's model and effort for a subagent's task, picked by its L from the project's model, and with `--plan` never below the project's rung; `subagent-rung --help` states the rule. -Test on the host, with `uv` on `PATH` to fetch mypy, pytest and pytest-xdist, which runs the tests in four workers, one heavy slot's CPUs (`docs/decisions.md` → `bin/`): `uvx --python "$(command -v python3)" --with pytest-xdist==3.8.0 pytest==9.2.0 -n 4 bin`. `python3 -m unittest discover -s bin -p 'test_*.py'` runs the same tests one at a time. Test the bench's git wrapper with `python3 -m unittest discover -s workflow-bench -p 'test_*.py'`. +Test on the host with `uvx --python "$(command -v python3)" --with pytest-xdist==3.8.0 pytest==9.2.0 -n 4 bin`. It needs `uv` on `PATH`, which fetches pytest, pytest-xdist and mypy. pytest-xdist runs the tests in four workers, one heavy slot's CPUs (`docs/decisions.md` → `bin/: the tools support only the latest stable Python, …`). `python3 -m unittest discover -s bin -p 'test_*.py'` runs the same tests one at a time. Test the bench's git wrapper with `python3 -m unittest discover -s workflow-bench -p 'test_*.py'`. To mutation-test a changed module, copy `bin/` to a scratch directory (`cp -r bin "$scratch"`): mutmut writes files beside its config. In the copy, name the module and its tests in a `setup.cfg`, as below for `score_outcomes/results.py`. Leave out each test class that starts a tool's launcher through `subprocess`: a mutated module fails to load in a process mutmut did not start. diff --git a/bin/repo_checks/__init__.py b/bin/repo_checks/__init__.py index b9002fab..021d23d6 100644 --- a/bin/repo_checks/__init__.py +++ b/bin/repo_checks/__init__.py @@ -1,4 +1,4 @@ import pathlib -# The checkout root, which the repo checks read. +# The checkout root. ROOT = pathlib.Path(__file__).resolve().parents[2] diff --git a/bin/repo_checks/test_types.py b/bin/repo_checks/test_types.py index ab4065c2..66b68d8d 100644 --- a/bin/repo_checks/test_types.py +++ b/bin/repo_checks/test_types.py @@ -13,7 +13,7 @@ SUPPORTED = re.compile(r"the latest stable Python, today (3\.\d+)") def tools() -> list[str]: - """mypy's arguments naming every package and module under bin/ but the repo checks, so a new tool is checked without being listed.""" + """mypy's arguments naming every package and module under bin/ except `repo_checks`, so a new tool is checked without being listed.""" bin_folder = ROOT / "bin" packages = sorted(init.parent.name for init in bin_folder.glob("*/__init__.py") if init.parent.name != "repo_checks") modules = sorted(path.stem for path in bin_folder.glob("*.py") if not path.name.startswith("test_")) diff --git a/docs/decisions.md b/docs/decisions.md index 79d30191..29d1997c 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -14,9 +14,9 @@ Valid while the archive's file names, the Vocabulary and the panel keep these wo 2026-09-24, larv-review. Serves goals 1 and 2. The tools drive the host's claude CLI and read the host's session files, which a container cannot see; the tests run on the same host Python the tools meet. Valid while claude runs on the host. -## bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run once on it in four pytest-xdist workers +## bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run on it in four pytest-xdist workers -2026-10-28, lilleman, through todo item 245. Serves goal 1.5: the suite gates every chunk. It took 198 s, 102 s of which reran it on the oldest Python README Install named, 3.11. README Install now asks for the latest stable Python as `python3`, and mypy checks every tool under `bin/` for the version it names. README's Test line runs the tests in four pytest-xdist workers through `uvx`: 29 s on a 16-CPU machine. Four is one heavy slot's CPUs, `CPUS_PER_SLOT` in `bin/machine_load/slots.py`, so a gate under `run-heavy` loads only the slot it waits for. The line pins pytest and pytest-xdist, as `test_types.py` pins mypy, so every machine runs the gate the same way. It passes the path of `python3`, since `uvx --python python3` picks a Python uv installed itself, which may be older. The tests use stdlib `unittest` alone, and pytest only runs them, so plain `python3 -m unittest` runs the same tests one at a time and another runner can replace pytest. Valid while every machine taking the checkout gets the latest stable Python soon after its release. +2026-10-28, lilleman, through todo item 245. Serves goal 1.5: the suite gates every chunk. The suite took 198 s, 102 s of which went to rerunning it on the oldest Python README Install named, 3.11. README Install now asks for the latest stable Python as `python3`, and mypy checks every tool under `bin/` for the version Install names. README's Test line runs the tests in four pytest-xdist workers through `uvx`: 29 s on a 16-CPU machine. Four is one heavy slot's CPUs, `CPUS_PER_SLOT` in `bin/machine_load/slots.py`, so a gate under `run-heavy` loads only the slot it waits for. The line pins pytest and pytest-xdist, as `test_types.py` pins mypy, so every machine runs the gate the same way. It passes the path of `python3`, since `uvx --python python3` picks a Python uv installed itself, which may be older. The tests use stdlib `unittest` alone, and pytest only runs them, so plain `python3 -m unittest` runs the same tests one at a time and another runner can replace pytest. Valid while every machine taking the checkout gets the latest stable Python soon after its release. ## chunks: a chunk takes every unblocked item of its release that fires the same review passes, whatever its purpose, and an item above R 5 ships alone -- 2.52.0 From d371869f4aa6e98c715806416268aea323ec7476 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:33:34 +0100 Subject: [PATCH 08/10] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 722dd5e4515fdab65bb69898bc4bec09638bdd78 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:33:34 +0100 Subject: [PATCH 09/10] =?UTF-8?q?Answer=20product-owner=20round=201:=200?= =?UTF-8?q?=20=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From b2aa02eb229861e419e4da7f397319d35d1fbf4d Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 28 Oct 2026 12:36:47 +0100 Subject: [PATCH 10/10] Record the comprehension check: paired ruling same --- docs/comprehension-history.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/comprehension-history.md b/docs/comprehension-history.md index 46fcc58e..1e89b560 100644 --- a/docs/comprehension-history.md +++ b/docs/comprehension-history.md @@ -2792,3 +2792,19 @@ Inherited architect, decided by: - Navigation: `bin/loop_claude/cycle/judge.py:150` `run_judge`: the path from a rejected verdict to exit 1 crosses three files, and only some misquotes count - Navigation, Shape: `bin/round_titles.py:8` `CAP`: the fourth-round cap lives in a module named for commit titles - Self-sufficiency: `bin/loop_claude/loop/main.py:1` module docstring: the exit list maps a code to a cause, but no bullet links to the unit that raises it + +## 2026-10-28T11:36:42Z, PR #386 at 722dd5e, against 243a9d8 + +Ruling: same + +| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall | +|---|---|---|---|---|---| +| Mid A | same | same | same | same | same | +| Inherited architect | same | worse | better | same | same | + +Inherited architect, decided by: + +- Locality: `bin/routing_figures/measure.py:155` `costed`: one message's dollars now depend on every message from the same model in the chunk and on the worker's last cost-state entry, so pricing one message means holding the whole chunk's split +- Locality: `bin/routing_figures/measure.py:125` `measured`: the one-line `lacking=` count is explained only in the `ChunkFigures` docstring and in `basis` +- Shape: `bin/routing_figures/measure.py:85` `Message`: named fields replace unnamed `(at, tools, spent)` tuples and six positional arguments +- Shape: `bin/routing_figures/prices.py:33` `listed`: list-price arithmetic gets its own small module with a name that fits -- 2.52.0