From d6e8b7b1050cfdda1e58c2bbb7be18e563ec5d19 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 14 Nov 2026 16:01:53 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=201=20?= =?UTF-8?q?=F0=9F=94=B4,=204=20=F0=9F=9F=A1=20(0=20misread);=20run=20the?= =?UTF-8?q?=20stranded=20held=5Fat=20test,=20and=20test=20a=20blocked=20ro?= =?UTF-8?q?w,=20an=20edit=20without=20a=20detail=20and=20an=20ID=20that=20?= =?UTF-8?q?prefixes=20another?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- bin/deploy_release/cut.py | 2 +- bin/plan_store/contract.py | 3 ++- bin/plan_store/test_stores.py | 22 +++++++++++++++++++--- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 87b2b958..378e1cdf 100644 --- a/README.md +++ b/README.md @@ -160,10 +160,10 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a - `settings_filter.py` is git's clean filter for `settings.json`: it drops `"model"` and sorts the keys. `.gitattributes` sets the filter `settings` on `settings.json`, and Install's `git config` line makes this script that filter. - `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. -- `todo-item` reads and changes a project's plan, whatever holds it: `list` prints the items in the plan's order and `show ` one item's row and detail; `add …` files an item under the next free ID, `edit …` sets its cells or detail, and `move --release ` sets its release; `finish ` removes a finished item and adds the bullet passed with `--changelog` to `CHANGELOG.md`. Each change ranks a markdown plan. `todo-item --help` states the flags. +- `todo-item` reads and changes a project's plan, whatever holds it: `list` prints the items in the plan's order and `show ` one item's row and detail; `add …` files an item under the next free ID, `edit …` sets an item's cells or detail, and `move --release ` sets an item's release; `finish ` removes a finished item and adds the bullet passed with `--changelog` to `CHANGELOG.md`. Each change ranks a markdown plan. `todo-item --help` states the flags. - `wait-for [] [--timeout ]` waits until a file a background job writes holds a line matching the pattern, and prints it. -`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. Beside the packages, `bin/`'s root holds only the launchers, the tools of one file with their tests, `test_env.py`, `failure.py` and `setup.cfg`. `failure.py`'s `Failure`, which modules across `bin/` return for a failed step, belongs to no single package. `branch_chunks/`, `claude_code/`, `command_lines/`, `git_cli/`, `loop_effects/`, `loop_state/`, `machine_load/`, `mattermost_dm/`, `model_routing/`, `record_store/`, `release_plan/`, `review_rules/`, `rung_replay/`, `text_files/` and `transcript_archive/` serve more than one tool. +`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. Beside the packages, `bin/`'s root holds only the launchers, the tools of one file with their tests, `test_env.py`, `failure.py` and `setup.cfg`. `failure.py`'s `Failure`, which modules across `bin/` return for a failed step, belongs to no single package. `branch_chunks/`, `claude_code/`, `command_lines/`, `git_cli/`, `loop_effects/`, `loop_state/`, `machine_load/`, `mattermost_dm/`, `model_routing/`, `plan_store/`, `record_store/`, `release_plan/`, `review_rules/`, `rung_replay/`, `text_files/` and `transcript_archive/` serve more than one tool. - `branch_chunks/` cuts a default branch into chunks and finds, for each, the items it shipped and the later chunks that fixed its code, for `score_outcomes` and `routing_figures`. It imports `reading_cost`'s record path. - `command_lines/` reads a shell command: its simple commands, and a docker call's subcommand and memory limits, for `command_patterns`, `reading_cost`, `routing_figures`, `rule_hook` and `run_heavy`. @@ -180,7 +180,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a - `plan_store/` reads and writes a project's plan through the store the project's config names (`stores.py`), with the markdown file's edits in `markdown_edits.py`. `contract.py` holds the tests every backend must pass, and `fakes.py` a plan in memory. - `rank_todo.py`, `settings_filter.py` and `statusline.py` are tools of one file each, tested beside them. - `record_store/` reads and writes a project's records, each through the store the project's config names (`stores.py`). `contract.py` holds the tests every backend must pass, and `fakes.py` a store in memory that the tests of other tools use. -- `release_plan/` reads `todo.md`'s items table and release versions, says which release is next and whether it is ready to cut (`release_standing.py`), and ranks the plan (`ranking.py`, with its score formula in `formula.py` and its blocker order in `blockers.py`). `goals_file.py` reads the goals file's sections, goals and goal weights, for the ranking and for `loop_claude`'s premises, and `citations.py` holds `todo.md` and `docs/decisions.md` to each other. `plan_file.py` reads, ranks, checks and writes a `todo.md`, for `larv_review`, `rank_todo.py`, `rule_hook` and `todo_item`. +- `release_plan/` reads `todo.md`'s items table and release versions, says which release is next and whether it is ready to cut (`release_standing.py`), and ranks the plan (`ranking.py`, with its score formula in `formula.py` and its blocker order in `blockers.py`). `goals_file.py` reads the goals file's sections, goals and goal weights, for the ranking and for `loop_claude`'s premises, and `citations.py` holds `todo.md` and `docs/decisions.md` to each other. `plan_file.py` ranks, checks and writes a `todo.md`, for `larv_review`, `rank_todo.py` and `rule_hook`. - `repo_checks/` tests the repo itself. - `review_rules/` holds the larv-review rules that several tools apply: its passes, its review folder, its round commit titles and the comprehension history's format. - `routing_figures/` measures loop-claude's archive, and each of its projects' default branches, for loop-claude's routing calls. diff --git a/bin/deploy_release/cut.py b/bin/deploy_release/cut.py index da4b7767..62a088bf 100644 --- a/bin/deploy_release/cut.py +++ b/bin/deploy_release/cut.py @@ -109,7 +109,7 @@ def same_origin(clone: str, checkout: str) -> Failure | None: def clone_plan(clone: str) -> FilePlan: - """The clone's plan, with each file ranking reads, at the paths this repo keeps them.""" + """The clone's plan, at the path this repo keeps it. ready_release only reads it; FilePlan also takes the files a write would rank it against.""" decisions, history = (FileStore(pathlib.Path(clone, path), path) for path in ("docs/decisions.md", "docs/comprehension-history.md")) return FilePlan(pathlib.Path(clone, "todo.md"), "todo.md", pathlib.Path(clone, "README.md"), decisions, history) diff --git a/bin/plan_store/contract.py b/bin/plan_store/contract.py index a2159252..3a3db70b 100644 --- a/bin/plan_store/contract.py +++ b/bin/plan_store/contract.py @@ -11,7 +11,7 @@ SECOND = {"Release": "0.2.0", TAGLINE: "Ship the later thing.", "L": "2", "E": " class PlanStoreContract: - """Runs against the store new_store returns: a plan that holds no item yet, and whose goals number a goal 1.""" + """Runs against the store new_store returns: a plan that holds no item yet. The project's goals file must hold a goal numbered 1, which the test items move.""" assertEqual: typing.Callable[..., None] assertIsInstance: typing.Callable[..., None] assertNotEqual: typing.Callable[..., None] @@ -70,6 +70,7 @@ class PlanStoreContract: id_ = self.filed(store, FIRST) store.edit(id_, {"Release": "0.3.0"}, None) self.assertEqual(self.items(store)[id_].release, release_of("0.3.0")) + self.assertEqual(self.items(store)[id_].detail, "") def test_finish_removes_the_item_and_keeps_the_others(self) -> None: store = self.new_store() diff --git a/bin/plan_store/test_stores.py b/bin/plan_store/test_stores.py index 454f9d6f..0cb5c088 100644 --- a/bin/plan_store/test_stores.py +++ b/bin/plan_store/test_stores.py @@ -1,4 +1,5 @@ import dataclasses +import os import pathlib import sys import tempfile @@ -71,6 +72,17 @@ class FilePlan(FilePlanContract): self.assertEqual([note.split(": ")[0] for note in written.notes], [str(self.folder / "todo.md")]) self.assertIn("item 1 ", written.notes[0]) + def test_only_the_item_written_refuses_the_write(self): + store = self.new_store() + first = self.filed(store, FIRST) + todo = self.folder / "todo.md" + todo.write_text(todo.read_text().replace("`Next ID = 2`", "`Next ID = 10`")) + self.assertEqual(self.filed(store, FIRST), 10) + todo.write_text("".join(line.replace("| 4 | 1 | 1 by 9 |", "| 4 | 10 | 1 by 9 |") if line.startswith("| 10 ") else line for line in todo.read_text().splitlines(keepends=True))) + written = store.edit(first, {"E": "2"}, None) + assert isinstance(written, stores.Written), written + self.assertIn("item 10 ", written.notes[0]) + def test_a_missing_file_fails_naming_it(self): store = self.new_store() (self.folder / "todo.md").unlink() @@ -104,6 +116,7 @@ class FilePlan(FilePlanContract): self.assertEqual(store.edit(id_, {}, "### Why\n"), Failure(split)) self.assertEqual((self.folder / "todo.md").read_text(), before) + @unittest.skipIf(os.geteuid() == 0, "root writes into a read-only directory") def test_a_file_it_cannot_write_fails_naming_it(self): store = self.new_store() self.folder.chmod(0o555) @@ -140,9 +153,12 @@ class HeldAt(unittest.TestCase): self.assertEqual(stores.held_at("origin/main", held, "/checkout", run), held.read()) + def test_fails_where_the_revision_cannot_be_read(self): + def run(*args, cwd): + return Failure("no git") if args[0] == "ls-tree" else "a commit\n" + + self.assertEqual(stores.held_at("origin/main", MemoryPlan(tracked="todo.md"), "/checkout", run), Failure("no git")) + if __name__ == "__main__": unittest.main() - - def test_fails_where_the_revision_cannot_be_read(self): - self.assertEqual(stores.held_at("origin/main", MemoryPlan(tracked="todo.md"), "/checkout", lambda *args, cwd: Failure("no git")), Failure("no git"))