From 2321f4930d561b2c9a8128ee22a6068086df19f1 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 11:09:17 +0100 Subject: [PATCH 1/3] Keep the rule for which commands reach run-heavy's docker beside that docker in capped_docker.py --- bin/rule_hook/rules.py | 13 +++---------- bin/run_heavy/capped_docker.py | 11 +++++++++++ bin/run_heavy/test_run_heavy.py | 9 +++++++++ bin/shell_command.py | 6 ++++-- docs/reading-cost.md | 17 +++++++++++++++++ todo.md | 5 ----- 6 files changed, 44 insertions(+), 17 deletions(-) diff --git a/bin/rule_hook/rules.py b/bin/rule_hook/rules.py index 6b139516..2338f907 100644 --- a/bin/rule_hook/rules.py +++ b/bin/rule_hook/rules.py @@ -5,8 +5,9 @@ import typing from round_titles import CAP, lacks_counts, RELEASE_REVIEW_CAP from git_command import commits +from run_heavy.capped_docker import finds_this_docker from rule_hook.heavy_command import heavy -from shell_command import launched, Simple, tool_name +from shell_command import launched, Simple from review_folder import REPORTS from docker_command import unlimited @@ -162,15 +163,7 @@ def unlimited_container(words: list[str]) -> bool: docker = launched(words, {"docker"}) if docker is None or not unlimited(docker.arguments): return False - # On Linux, run-heavy's docker adds the limits a container lacks, where PATH finds it: docker named bare, with PATH left as run-heavy set it. - before = words[:len(words) - len(docker.arguments) - 1] - capped = "run-heavy" in docker.launchers and words[len(before)] == "docker" and not any(resets_path(word) for word in before) - return not capped - - -def resets_path(word: str) -> bool: - """Whether a word before docker drops the PATH run-heavy set: a PATH= of its own, env's -i or -u, or sudo or doas, which reset it.""" - return word.startswith(("PATH=", "--unset")) or word in ("-i", "--ignore-environment", "-u") or tool_name(word) in ("doas", "sudo") + return not ("run-heavy" in docker.launchers and finds_this_docker(docker.word, docker.before)) def file_breaches(path: str, before: str, added: str, after: str) -> list[Breach]: diff --git a/bin/run_heavy/capped_docker.py b/bin/run_heavy/capped_docker.py index d9d9d199..77b99d11 100644 --- a/bin/run_heavy/capped_docker.py +++ b/bin/run_heavy/capped_docker.py @@ -6,6 +6,7 @@ import sys import typing from docker_command import capped +from shell_command import tool_name # The folder run-heavy puts first on its command's PATH, holding the docker that runs main. PATH_ENTRY = pathlib.Path(__file__).resolve().parent / "path_entry" @@ -33,3 +34,13 @@ def main(argv: list[str], env: typing.Mapping[str, str]) -> int: def without_path_entry(path: str) -> str: """path less PATH_ENTRY, so the real docker is the one found.""" return os.pathsep.join(entry for entry in path.split(os.pathsep) if pathlib.Path(entry).resolve() != PATH_ENTRY) + + +def finds_this_docker(word: str, before: list[str]) -> bool: + """Whether a command that runs under run-heavy reaches this docker, given the word that names docker and the words before it: docker named bare, since a path names another, and no word before it resets the PATH that run-heavy set. Only where run-heavy knows the memory, as on Linux.""" + return word == "docker" and not any(resets_path(earlier) for earlier in before) + + +def resets_path(word: str) -> bool: + """Whether a word before docker drops the PATH run-heavy set: a PATH= of its own, env's -i or -u, or sudo or doas, which reset it.""" + return word.startswith(("PATH=", "--unset")) or word in ("-i", "--ignore-environment", "-u") or tool_name(word) in ("doas", "sudo") diff --git a/bin/run_heavy/test_run_heavy.py b/bin/run_heavy/test_run_heavy.py index f028d6b7..3a9a158a 100644 --- a/bin/run_heavy/test_run_heavy.py +++ b/bin/run_heavy/test_run_heavy.py @@ -9,6 +9,7 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) +from run_heavy.capped_docker import finds_this_docker from run_heavy import main from machine_load.memory import read_memory from machine_load.slots import slot_count, usable_cpus @@ -141,6 +142,14 @@ class RunHeavy(unittest.TestCase): self.assertEqual(helped.returncode, 0) self.assertIn("usage: run-heavy ", helped.stdout) + def test_the_capped_docker_is_found_only_by_docker_named_bare_with_no_word_before_it_resetting_path(self): + for word, before in [("docker", []), ("docker", ["run-heavy"]), ("docker", ["run-heavy", "env", "X=1"]), ("docker", ["run-heavy", "nice", "-n", "19"])]: + with self.subTest(word=word, before=before): + self.assertTrue(finds_this_docker(word, before)) + for word, before in [("/usr/bin/docker", []), ("docker", ["env", "PATH=/usr/bin"]), ("docker", ["env", "-i"]), ("docker", ["env", "-u", "PATH"]), ("docker", ["env", "--unset=PATH"]), ("docker", ["sudo"]), ("docker", ["/usr/bin/doas"])]: + with self.subTest(word=word, before=before): + self.assertFalse(finds_this_docker(word, before)) + if __name__ == "__main__": unittest.main() diff --git a/bin/shell_command.py b/bin/shell_command.py index 49537e5e..9ba469ba 100644 --- a/bin/shell_command.py +++ b/bin/shell_command.py @@ -18,9 +18,11 @@ PIECE = re.compile(r"""'[^']*'|"(?:\\.|[^"\\])*"|\\.|(? Launch | None: at = next((i for i, name in enumerate(reachable) if name in tools), None) if at is None: return None - return Launch(frozenset(LAUNCHERS.intersection(names[:at])), names[at], words[at + 1:]) + return Launch(frozenset(LAUNCHERS.intersection(names[:at])), names[at], words[at], words[:at], words[at + 1:]) diff --git a/docs/reading-cost.md b/docs/reading-cost.md index 3ebf5a21..03a47608 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -974,3 +974,20 @@ Read most (opens and searches): - `AGENTS.md` 1 - `CHANGELOG.md` 1 - `bin/claude_code/__init__.py` 1 + +## Reading cost, chunk 65835030caa6, finished 2026-11-08T10:06:31Z + +168681 new input tokens before the first commit. + +Read most (opens and searches): + +- `bin/chunk_preflight/test_chunk_preflight.py` 6 +- `bin/loop_claude/loop/main.py` 5 +- `AGENTS.md` 2 +- `README.md` 2 +- `todo.md` 2 +- `CHANGELOG.md` 1 +- `bin/chunk_preflight/facts.py` 1 +- `bin/chunk_preflight/gathered.py` 1 +- `bin/chunk_preflight/main.py` 1 +- `bin/loop_claude/cycle/prompts.py` 1 diff --git a/todo.md b/todo.md index 9ab31a44..769326a7 100644 --- a/todo.md +++ b/todo.md @@ -13,7 +13,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| | 1 | 0.7.0 | | question | **Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.** | 1 | 2 | 1 | 2 | 1 | | 0.0 | -| 229 | 0.7.0 | | | **Keep the rule for which commands reach run-heavy's docker beside that docker in `bin/run_heavy/capped_docker.py`, so rule-hook's `docker-run-memory` asks it instead of repeating run-heavy's PATH rules.** | 2 | 1 | 3 | 4 | 2 | code health by 3 | 18.0 | | 170 | 0.7.0 | | decision | **Re-tune `WORKER_STEPS` and `REVIEW_STEPS` once 50 chunks have shipped under them, from how well L, E and I order their review rounds and 🔴 findings.** | 2 | 2 | 3 | 5 | 2 | 1.1 by 3, 1.4 by 5 | 10.9 | | 218 | 0.7.0 | 170 | | **Drop `LEGACY_WORKER` from `bin/model_routing/route.py`, so `route_from` reads only JSON worker lines.** | 1 | 2 | 1 | 2 | 1 | code health by 2 | 14.4 | | 219 | 0.7.0 | | | **Name the project's rung `project` in `bin/judge_replay/main.py`, `bin/subagent_rung/main.py` and `bin/review_replay/main.py`, in place of `anchor`, as `bin/model_routing/ladder.py` and `bin/loop_claude` name it.** | 1 | 1 | 3 | 3 | 2 | code health by 2 | 12.0 | @@ -87,10 +86,6 @@ It lives under `~/.claude`, which `.gitignore` keeps from the remote, so a lost The README line covers the bench's transcripts in `workflow-bench/logs/` too (goal 3). -### 229. Keep the rule for which commands reach run-heavy's docker beside that docker in `bin/run_heavy/capped_docker.py`, so rule-hook's `docker-run-memory` asks it instead of repeating run-heavy's PATH rules. - -The paired ruling of PR #373 found Locality worse with all four seats, and named `bin/rule_hook/rules.py` `unlimited_container` and `resets_path` first. rule-hook exempts a `docker run` under run-heavy only where run-heavy's docker will run it: docker named bare, with PATH left as run-heavy set it. That knowledge of how `run_heavy/main.py` `capping` puts `PATH_ENTRY` first lives in rule-hook, so a change to run-heavy silently changes what the rule lets through. Move the predicate, with its words-before-docker index arithmetic made plain, next to `PATH_ENTRY`, and have the rule call it. Make the two places easier to read, as the seats named them. - ### 170. Re-tune `WORKER_STEPS` and `REVIEW_STEPS` once 50 chunks have shipped under them, from how well L, E and I order their review rounds and 🔴 findings. `docs/decisions.md` → `routing: one ladder…` calls the steps a first guess. Start this item once 50 chunks have merged since PR #339 set today's steps, each shipping one item scored with L, E and I. By 2026-10-23, 15 had: those of items 117, 126, 122, 207, 130, 154, 186, 66, 121, 213, 137, 212, 214, 210 and 216. Then read `score-outcomes`' rank correlations for L, E and I and the routed-chunks table of `routing-figures.md`, and propose new steps to lilleman, whose call they are. -- 2.52.0 From ed7f3eb949b84213936f97029c0a1e4efe96dbb6 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 11:14:13 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=203=20=F0=9F=9F=A1=20(0=20misread);=20drop=20the?= =?UTF-8?q?=20duplicate=20predicate=20test,=20say=20that=20finds=5Fthis=5F?= =?UTF-8?q?docker=20assumes=20run-heavy's=20PATH,=20say=20why=20resets=5Fp?= =?UTF-8?q?ath=20matches=20broadly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/run_heavy/capped_docker.py | 4 ++-- bin/run_heavy/test_run_heavy.py | 9 --------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/bin/run_heavy/capped_docker.py b/bin/run_heavy/capped_docker.py index 77b99d11..b253d9df 100644 --- a/bin/run_heavy/capped_docker.py +++ b/bin/run_heavy/capped_docker.py @@ -37,10 +37,10 @@ def without_path_entry(path: str) -> str: def finds_this_docker(word: str, before: list[str]) -> bool: - """Whether a command that runs under run-heavy reaches this docker, given the word that names docker and the words before it: docker named bare, since a path names another, and no word before it resets the PATH that run-heavy set. Only where run-heavy knows the memory, as on Linux.""" + """Whether a command's docker is this one, given the word that names docker and the words before it, assuming run-heavy put this docker first on PATH, as it does on Linux. It is where docker is named bare, since a path names a different docker, and no word before it may reset PATH.""" return word == "docker" and not any(resets_path(earlier) for earlier in before) def resets_path(word: str) -> bool: - """Whether a word before docker drops the PATH run-heavy set: a PATH= of its own, env's -i or -u, or sudo or doas, which reset it.""" + """Whether a word before docker may drop the PATH run-heavy set. It errs towards yes, so that a command it matches must set its own memory limits: it matches a PATH= assignment, -i, --ignore-environment, -u or --unset whichever variable and launcher they belong to, and sudo or doas, which reset PATH.""" return word.startswith(("PATH=", "--unset")) or word in ("-i", "--ignore-environment", "-u") or tool_name(word) in ("doas", "sudo") diff --git a/bin/run_heavy/test_run_heavy.py b/bin/run_heavy/test_run_heavy.py index 3a9a158a..f028d6b7 100644 --- a/bin/run_heavy/test_run_heavy.py +++ b/bin/run_heavy/test_run_heavy.py @@ -9,7 +9,6 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) -from run_heavy.capped_docker import finds_this_docker from run_heavy import main from machine_load.memory import read_memory from machine_load.slots import slot_count, usable_cpus @@ -142,14 +141,6 @@ class RunHeavy(unittest.TestCase): self.assertEqual(helped.returncode, 0) self.assertIn("usage: run-heavy ", helped.stdout) - def test_the_capped_docker_is_found_only_by_docker_named_bare_with_no_word_before_it_resetting_path(self): - for word, before in [("docker", []), ("docker", ["run-heavy"]), ("docker", ["run-heavy", "env", "X=1"]), ("docker", ["run-heavy", "nice", "-n", "19"])]: - with self.subTest(word=word, before=before): - self.assertTrue(finds_this_docker(word, before)) - for word, before in [("/usr/bin/docker", []), ("docker", ["env", "PATH=/usr/bin"]), ("docker", ["env", "-i"]), ("docker", ["env", "-u", "PATH"]), ("docker", ["env", "--unset=PATH"]), ("docker", ["sudo"]), ("docker", ["/usr/bin/doas"])]: - with self.subTest(word=word, before=before): - self.assertFalse(finds_this_docker(word, before)) - if __name__ == "__main__": unittest.main() -- 2.52.0 From 86e6c501957d430450704fa5ccf34d15592423fb Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 11:14:13 +0100 Subject: [PATCH 3/3] =?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);=20same=20docs?= =?UTF-8?q?tring=20fixes,=20and=20separate=20the=20items=20of=20Launch's?= =?UTF-8?q?=20docstring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/shell_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/shell_command.py b/bin/shell_command.py index 9ba469ba..21314041 100644 --- a/bin/shell_command.py +++ b/bin/shell_command.py @@ -18,7 +18,7 @@ PIECE = re.compile(r"""'[^']*'|"(?:\\.|[^"\\])*"|\\.|(?