From 31da587415ea5e985d3c9e3167e85640be5d718f Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 16 Nov 2026 16:53:36 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=2014=20=F0=9F=9F=A1=20(0=20misread);=20tests=20th?= =?UTF-8?q?at=20kill=20the=20surviving=20mutants,=20with=20a=20versioned?= =?UTF-8?q?=20MemoryStore=20and=20appended=5Fto,=20plan/named=5Fpaths.py,?= =?UTF-8?q?=20TakenIn's=20docstring=20and=20the=20run-heavy=20rule=20namin?= =?UTF-8?q?g=20LAUNCHERS;=20three=20places=20left=20to=20item=20300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- bin/atlassian/test_client.py | 9 ++++++--- bin/chunk_preflight/main.py | 2 +- bin/larv_review/history_commands.py | 8 +++++--- bin/larv_review/test_larv_review.py | 9 +++++++++ bin/loop_claude/test_loop_claude.py | 16 ++++++++++++++++ bin/loop_claude/verdicts.py | 2 +- bin/plan/{named_code.py => named_paths.py} | 0 .../{test_named_code.py => test_named_paths.py} | 2 +- bin/reading_cost/test_reading_cost.py | 6 ++++++ bin/record_store/fakes.py | 13 +++++++++---- bin/record_store/test_confluence_page.py | 4 ++++ bin/record_store/test_stores.py | 7 +++++++ bin/release_plan/test_release_standing.py | 11 ++++++++++- bin/repo_checks/test_package_cycles.py | 11 +++++++++++ bin/rule_hook/rules.py | 4 ++-- bin/score_outcomes/main.py | 2 +- bin/score_outcomes/results.py | 2 +- bin/touch_predictions/test_touch_predictions.py | 5 +++++ 19 files changed, 96 insertions(+), 19 deletions(-) rename bin/plan/{named_code.py => named_paths.py} (100%) rename bin/plan/{test_named_code.py => test_named_paths.py} (95%) diff --git a/README.md b/README.md index eb206ac5..79645686 100644 --- a/README.md +++ b/README.md @@ -210,7 +210,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a - `machine_load/` takes the machine's heavy slots, its shared lock files, for `run_heavy` and `adf_codec`, and reads the memory share that loop-claude waits for. It also gives `mutate_changes` a slot's CPU count. - `model_routing/` holds the shipped routing ladder (`routing-ladder.json`) and its steps (`ladder.py`), and reads a ladder from that file or a project's own (`ladder_file.py`), for loop-claude, `rule_hook`, both replay tools and `subagent-rung`. It finds a project's config folder through `project_config`. It also holds the list prices, which `routing_figures` and `transcript_archive` read. - `notifier/` sends the human a DM through the notifier a project's config names, for `notify` and for loop-claude through `loop_effects`. Its backends are `mattermost.py` and `slack.py`. -- `plan/` is the plan's core, and imports neither `plan_store` nor `release_plan`. It holds an item and the items table's format (`todo_table.py`), releases (`release.py`), the ranking (`ranking.py`, with its score formula in `formula.py` and its blocker order in `blockers.py`), the paths an item's text names (`named_code.py`) and `citations.py`, which holds `todo.md` and `docs/decisions.md` to each other. `goals_file.py` reads the goals file's sections, goals and goal weights, for the ranking and for `loop_claude`'s premises. +- `plan/` is the plan's core, and imports neither `plan_store` nor `release_plan`. It holds an item and the items table's format (`todo_table.py`), releases (`release.py`), the ranking (`ranking.py`, with its score formula in `formula.py` and its blocker order in `blockers.py`), the paths an item's text names (`named_paths.py`) and `citations.py`, which holds `todo.md` and `docs/decisions.md` to each other. `goals_file.py` reads the goals file's sections, goals and goal weights, for the ranking and for `loop_claude`'s premises. - `plan_store/` reads and writes a project's plan through the store the project's config names (`stores.py`). Every backend meets `plans.py`'s `PlanStore`: a markdown file (`todo_md.py`, which also ranks and checks the file in place, with its text edits in `markdown_edits.py`) or a Jira epic (`jira_epic.py`). `scoring.py` reads the goal weights that both backends rank by. `contract.py` holds the tests every backend that writes must pass, which `jira_epic.py` doesn't yet, since it changes no link, 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`): a markdown file, a Confluence Cloud page (`confluence_page.py`), or, for the goals, a Jira epic's description (`jira_description.py`). `contract.py` holds the tests every backend must pass, and `fakes.py` a store in memory that the tests of other tools use. diff --git a/bin/atlassian/test_client.py b/bin/atlassian/test_client.py index d2e072de..fbf91612 100644 --- a/bin/atlassian/test_client.py +++ b/bin/atlassian/test_client.py @@ -1,4 +1,5 @@ import base64 +import json import pathlib import sys import tempfile @@ -30,8 +31,8 @@ class Jira(Served): def test_an_error_answer_fails_with_jiras_messages_and_its_status(self): base = self.serve((400, b'{"errorMessages": ["One."], "errors": {"jql": "Two."}}')) self.assertEqual(client.jira_json("POST", f"{base}/rest/api/3/search/jql", AUTHORIZATION, {"jql": "x"}), ErrorAnswer("POST /rest/api/3/search/jql answered 400: One.; Two.", 400)) - [(_, _, headers, _)] = self.server.got # type: ignore[attr-defined] - self.assertEqual(headers["Authorization"], AUTHORIZATION) + [(_, _, headers, body)] = self.server.got # type: ignore[attr-defined] + self.assertEqual((headers["Authorization"], json.loads(body)), (AUTHORIZATION, {"jql": "x"})) def test_reads_jiras_messages_from_an_error_answer(self): cases = ( @@ -49,7 +50,9 @@ class Jira(Served): class Confluence(Served): def test_an_error_answer_fails_with_confluences_messages_and_its_status(self): base = self.serve((409, b'{"errors": [{"status": 409, "title": "Version must be incremented"}]}')) - self.assertEqual(client.confluence_json("PUT", f"{base}/wiki/api/v2/pages/1", AUTHORIZATION, {}), ErrorAnswer("PUT /wiki/api/v2/pages/1 answered 409: Version must be incremented", 409)) + self.assertEqual(client.confluence_json("PUT", f"{base}/wiki/api/v2/pages/1", AUTHORIZATION, {"version": {"number": 2}}), ErrorAnswer("PUT /wiki/api/v2/pages/1 answered 409: Version must be incremented", 409)) + [(_, _, headers, body)] = self.server.got # type: ignore[attr-defined] + self.assertEqual((headers["Authorization"], json.loads(body)), (AUTHORIZATION, {"version": {"number": 2}})) def test_reads_confluences_messages_from_an_error_answer(self): self.assertEqual(client.confluence_errors({"errors": [{"status": 409, "title": "Version must be incremented"}, {"title": "and more"}, "odd"]}), "Version must be incremented; and more") diff --git a/bin/chunk_preflight/main.py b/bin/chunk_preflight/main.py index ec1b583e..c1490a77 100644 --- a/bin/chunk_preflight/main.py +++ b/bin/chunk_preflight/main.py @@ -82,7 +82,7 @@ from chunk_preflight.gathered import Forge, Gathered, ItemFacts, NamedPath, Ran, from chunk_preflight.choices import forge_of, pulls_command, worktree_add, worktree_on from chunk_preflight.facts import JOINING_DETAILS, render from project_config.main import located -from plan.named_code import named_paths +from plan.named_paths import named_paths from release_plan.next_chunk import NextChunk, NoItem, plan_name, planned from release_plan.release_standing import project_plan diff --git a/bin/larv_review/history_commands.py b/bin/larv_review/history_commands.py index 743bc9a8..cbc39cf2 100644 --- a/bin/larv_review/history_commands.py +++ b/bin/larv_review/history_commands.py @@ -163,9 +163,11 @@ def held_history(home: pathlib.Path) -> tuple[RecordStore, Held] | Failure: def append(read: str, entry: str, home: pathlib.Path) -> str | Failure: """Appends entry and returns the line the tool prints; a Failure where the history already holds an entry on what the seats read.""" read_history = held_history(home) - if isinstance(read_history, Failure): - return read_history - history, held = read_history + return read_history if isinstance(read_history, Failure) else appended_to(*read_history, read, entry) + + +def appended_to(history: RecordStore, held: Held, read: str, entry: str) -> str | Failure: + """Writes entry onto held, the history as history's store read it, over held's version; the line the tool prints, or why the entry isn't written.""" if recorded(held.text, read): return Failure(f"{history.label} already holds an entry on {read}; record each ruling or run once") written = history.write(appended(held.text, entry), held.version) diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 19089a50..03002506 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -15,6 +15,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from larv_review.agreement import agreement_report, ruling_agreement, run_agreement from review_rules.comprehension_history import appended, entries, HistoryChange, latest_places, Place, recorded, ruling_entry, scoring_entry, ScoringRun, Seat +from larv_review.history_commands import appended_to from larv_review.plan import checkout_plan, Emptied, EMPTIED_WORDS, landed_towards, plan_reasons, scoring_run_due from review_rules import comprehension_history from project_config.test_project_config import configured @@ -25,6 +26,7 @@ from failure import Failure from plan_store.todo_md import FilePlan from record_store.stores import FileStore from larv_review.scoring import floor_step, means, under_floor +from record_store.held import Held from test_env import isolated_env from plan.todo_table import Item, items, NoItemsTable from release_plan.release_standing import LastCut @@ -459,6 +461,13 @@ class LandedTowards(unittest.TestCase): self.assertEqual(landed_towards(plan, LastCut(Failure("fatal: bad object"), "", 3, [])), Failure("could not tell the next release: the default branch's tags cannot be read: fatal: bad object")) +class AppendedTo(unittest.TestCase): + def test_writes_the_entry_over_the_version_the_history_was_read_at(self): + history = MemoryStore(label="history.md", version=5) + self.assertEqual(appended_to(history, Held("", "5"), "PR #2 at abcdef1\n", "## an entry\n"), "Appended to history.md.") + self.assertEqual(history.overs, ["5"]) + + class Shortfall(unittest.TestCase): def test_skill_md_names_the_words_that_end_the_reason_a_release_empties(self): self.assertIn(EMPTIED_WORDS, (pathlib.Path(__file__).resolve().parents[2] / "skills" / "larv-review" / "SKILL.md").read_text(encoding="utf-8")) diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index 0f2f2d80..2e0a0cdb 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -1305,6 +1305,17 @@ class TmuxCommands(unittest.TestCase): self.assertEqual(tmux.start_window(window, "/r", {}, ["x"], True, failed), Failure("tmux could not start the window loop-proj:item-7: duplicate session: loop-proj")) self.assertEqual(tmux.start_window(window, "/r", {}, ["x"], True, silent), Failure("tmux could not start the window loop-proj:item-7: it exited 2")) + def test_fails_where_it_cannot_mark_a_session_it_made_as_the_checkouts_but_not_where_remain_on_exit_fails(self): + def answering(failing: str): + def run(args): + fails = args[:1] == ["set-option"] and failing in args + return subprocess.CompletedProcess(args, 1 if fails else 0, "" if fails else "@9\n", "no such session\n" if fails else "") + return run + window = tmux.Window("loop-proj", "item-7", "") + self.assertEqual(tmux.start_window(window, "/r", {}, ["x"], True, answering(tmux.OWNER)), Failure("tmux started the session loop-proj but could not mark it as this checkout's: no such session")) + self.assertIsNone(tmux.start_window(window, "/r", {}, ["x"], True, answering("remain-on-exit"))) + self.assertIsNone(tmux.start_window(window, "/r", {}, ["x"], False, answering(tmux.OWNER))) + def test_reads_the_checkout_the_session_names(self): fake = FakeEffects(owner="/c/proj") self.assertEqual(tmux.owner("loop-proj", fake.tmux), "/c/proj") @@ -1499,6 +1510,11 @@ class StartChunks(unittest.TestCase): fake = FakeEffects(windows="item-5\t1\t@3\n") self.assertEqual(self.start(fake), ["item-5", "item-1"]) + def test_a_plan_with_no_item_starts_nothing_beside_a_restarted_chunk(self): + self.limit(2) + fake = FakeEffects(windows="item-5\t1\t@3\n") + self.assertEqual(self.start(fake, plan=next_chunk.NoItem("release 1.0.0 has no items")), ["item-5"]) + def test_a_finishing_chunk_leaves_a_stopped_chunk_and_its_items_to_the_human(self): self.limit(2) transcripts = paths.paths_from(self.home).claude_code_transcripts diff --git a/bin/loop_claude/verdicts.py b/bin/loop_claude/verdicts.py index 49ffe940..9d06aaca 100644 --- a/bin/loop_claude/verdicts.py +++ b/bin/loop_claude/verdicts.py @@ -6,7 +6,7 @@ from claude_code.tokens import Tokens @dataclasses.dataclass(frozen=True) class TakenIn: - """The levels of the plan items the worker names on its latest `Chunk items:` line, as cycle.chunk_items reads them. The item the chunk was routed on counts only where the worker names it.""" + """The highest L, and the highest E + I, among the plan items the worker names on its latest `Chunk items:` line, as cycle.chunk_items reads them. The item the chunk was routed on counts only where the worker names it.""" # The highest L among them, 0 for none: an escalation steps up from the rung that L picks, and an unfinished verdict also raises the worker to it. highest_likelihood: int = 0 # The highest E + I among them, 0 for none: after an unfinished verdict, it routes the next cycle's reviewers. diff --git a/bin/plan/named_code.py b/bin/plan/named_paths.py similarity index 100% rename from bin/plan/named_code.py rename to bin/plan/named_paths.py diff --git a/bin/plan/test_named_code.py b/bin/plan/test_named_paths.py similarity index 95% rename from bin/plan/test_named_code.py rename to bin/plan/test_named_paths.py index 72165bed..bbb59633 100644 --- a/bin/plan/test_named_code.py +++ b/bin/plan/test_named_paths.py @@ -4,7 +4,7 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) -from plan.named_code import named_files, named_paths +from plan.named_paths import named_files, named_paths class NamedPaths(unittest.TestCase): diff --git a/bin/reading_cost/test_reading_cost.py b/bin/reading_cost/test_reading_cost.py index 34eef95f..b53aac7c 100644 --- a/bin/reading_cost/test_reading_cost.py +++ b/bin/reading_cost/test_reading_cost.py @@ -236,6 +236,12 @@ class Located(unittest.TestCase): class Update(unittest.TestCase): + def test_writes_over_the_version_it_read(self): + record = MemoryStore("# Reading cost\n", version=2) + archive = pathlib.Path(self.enterContext(tempfile.TemporaryDirectory())) + self.assertNotIsInstance(main.update(record, archive, Checkout("/c/p", "/c/p", frozenset(), BRANCH), "/h", "2026-11-14T00:00:00Z"), Failure) + self.assertEqual(record.overs, ["2"]) + def test_fails_where_the_record_refuses_the_write(self): class Unwritable(MemoryStore): def write(self, text: str, over: str | None) -> Held | Failure: diff --git a/bin/record_store/fakes.py b/bin/record_store/fakes.py index 6398535b..0cc3e9eb 100644 --- a/bin/record_store/fakes.py +++ b/bin/record_store/fakes.py @@ -7,20 +7,25 @@ from record_store.held import Held @dataclasses.dataclass class MemoryStore: - """A record held in memory, as a backend outside git holds one. Set fails to make every read and write fail with that reason.""" + """A record held in memory, as a backend outside git holds one: versioned as a wiki page is, refusing a write over a version it no longer holds. Set fails to make every read and write fail with that reason. overs holds the version each write named, so a test can check that a caller wrote over the version it read.""" text: str = "" label: str = "the record in memory" tracked: str | None = None fails: str | None = None + version: int = 0 + overs: list[str | None] = dataclasses.field(default_factory=list) def read(self) -> str | Failure: return Failure(self.fails) if self.fails else self.text def held(self) -> Held | Failure: - return Failure(self.fails) if self.fails else Held(self.text) + return Failure(self.fails) if self.fails else Held(self.text, str(self.version)) def write(self, text: str, over: str | None) -> Held | Failure: + self.overs.append(over) if self.fails: return Failure(self.fails) - self.text = text - return Held(text) + if over is not None and over != str(self.version): + return Failure(f"someone saved {self.label} since version {over}") + self.text, self.version = text, self.version + 1 + return Held(text, str(self.version)) diff --git a/bin/record_store/test_confluence_page.py b/bin/record_store/test_confluence_page.py index 4a2bfb62..06cafb0d 100644 --- a/bin/record_store/test_confluence_page.py +++ b/bin/record_store/test_confluence_page.py @@ -190,6 +190,10 @@ class ConfluencePageTest(ConfluenceCase): store = ConfluencePage(PAGE, self.env, lambda *_: ErrorAnswer("GET /wiki/api/v2/pages/2293761 answered 404: Not Found", 404), to_markdown, to_adf) self.assertEqual(store.read(), Failure(f"cannot read {PAGE.spelling}: GET /wiki/api/v2/pages/2293761 answered 404: Not Found")) + def test_a_write_handed_no_version_fails_naming_the_page_where_its_version_cannot_be_read(self) -> None: + store = ConfluencePage(PAGE, self.env, lambda *_: ErrorAnswer("GET /wiki/api/v2/pages/2293761 answered 404: Not Found", 404), to_markdown, to_adf) + self.assertEqual(store.write("text\n", None), Failure(f"cannot read {PAGE.spelling}: GET /wiki/api/v2/pages/2293761 answered 404: Not Found")) + def test_fails_without_credentials_before_any_request(self) -> None: self.env.unlink() read = self.new_store().read() diff --git a/bin/record_store/test_stores.py b/bin/record_store/test_stores.py index e804bf4b..62796778 100644 --- a/bin/record_store/test_stores.py +++ b/bin/record_store/test_stores.py @@ -143,6 +143,13 @@ class LocalFile(unittest.TestCase): self.assertIsInstance(opened, Failure) self.assertIn(f"cannot write {copy}: ", opened.reason) + def test_a_version_that_cannot_be_kept_beside_the_copy_is_a_failure_naming_its_file(self): + copy = self.folder / "decisions.md" + (self.folder / "decisions.version").mkdir() + opened = stores.local_file(MemoryStore("# Decisions\n"), copy) + assert isinstance(opened, Failure), opened + self.assertTrue(opened.reason.startswith(f"cannot write {self.folder / 'decisions.version'}: "), opened.reason) + def test_storing_a_missing_copy_fails_and_leaves_the_record(self): record = MemoryStore("kept\n") self.assertIn("is missing or empty", stores.stored(record, self.folder / "decisions.md").reason) diff --git a/bin/release_plan/test_release_standing.py b/bin/release_plan/test_release_standing.py index 6287210c..3c9491d5 100644 --- a/bin/release_plan/test_release_standing.py +++ b/bin/release_plan/test_release_standing.py @@ -14,8 +14,9 @@ from plan_store.todo_md import FilePlan, plan_of from record_store.stores import FileStore from test_env import isolated_env from record_store.fakes import MemoryStore +from release_plan import next_chunk, release_standing from plan.todo_table import NoItemsTable -from release_plan import release_standing +from plan_store.plans import Plan from plan import todo_table from plan.release import version @@ -380,3 +381,11 @@ class ChunkItem(unittest.TestCase): def test_fails_to_name_releases_when_the_newest_plan_marks_one_in_a_form_it_cannot_read(self): plan = "## Items\n\n| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |\n|---|---|---|---|---|---|---|---|---|---|---|---|\n| 1 | 0.3.0 | | | **Do 1.** | 1 | 1 | 1 | 1 | 1 | 1 by 1 | 10.0 |\n" self.assertIsInstance(release_standing.named_releases([plan, plan + "\n## Renamed\n\nsoon\n"]), Failure) + + +class NextChunk(unittest.TestCase): + def test_names_the_release_a_carried_item_moved_to_not_another_items(self): + later, carried, next_one = (dataclasses.replace(one(release), id=id_) for id_, release in ((9, (0, 4, 0)), (5, (0, 2, 0)), (3, (0, 3, 0)))) + planned = next_chunk.planned(Plan([later, carried, next_one]), release_standing.LastCut("v0.2.0", "", 4, []), "origin/main", "item-{id}") + assert isinstance(planned, next_chunk.NextChunk), planned + self.assertEqual(planned.carried, next_chunk.CarriedOver((0, 3, 0), (5,))) diff --git a/bin/repo_checks/test_package_cycles.py b/bin/repo_checks/test_package_cycles.py index 6a59c4e0..88636a3d 100644 --- a/bin/repo_checks/test_package_cycles.py +++ b/bin/repo_checks/test_package_cycles.py @@ -2,6 +2,7 @@ import ast import graphlib import pathlib import sys +import tempfile import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) @@ -36,6 +37,16 @@ class PackageCycles(unittest.TestCase): def test_no_package_under_bin_imports_one_that_imports_it_back(self): self.assertEqual(cycle(package_imports(ROOT / "bin")), [], "move what both packages need into a package that imports neither") + def test_reads_an_import_deferred_into_a_function_and_leaves_out_tests(self): + with tempfile.TemporaryDirectory() as temp: + folder = pathlib.Path(temp) + for package, source in (("a", "def f():\n\tfrom b.mod import x\n"), ("b", "import a.mod\n"), ("c", "")): + (folder / package).mkdir() + (folder / package / "__init__.py").write_text("") + (folder / package / "mod.py").write_text(source) + (folder / "c" / "test_mod.py").write_text("import a\n") + self.assertEqual(package_imports(folder), {"a": {"b"}, "b": {"a"}, "c": set()}) + def test_a_cycle_through_a_deferred_import_is_found(self): self.assertEqual(sorted(cycle({"a": {"b"}, "b": {"a"}})[:2]), ["a", "b"]) self.assertEqual(cycle({"a": {"b"}, "b": set()}), []) diff --git a/bin/rule_hook/rules.py b/bin/rule_hook/rules.py index c82e4d05..7a138522 100644 --- a/bin/rule_hook/rules.py +++ b/bin/rule_hook/rules.py @@ -7,7 +7,7 @@ from review_rules.round_titles import CAP, COUNTS, EXAMPLE, lacks_counts, OPENIN from git_cli.git_command import CommitCall from run_heavy.capped_docker import finds_this_docker from rule_hook.heavy_command import heavy -from command_lines.shell_command import launched, Simple +from command_lines.shell_command import launched, LAUNCHERS, Simple from review_rules.review_folder import REPORTS from project_config import templates from command_lines.docker_command import unlimited @@ -88,7 +88,7 @@ RULES: dict[RuleName, Rule] = { ), "run-heavy": Rule( "a heavy command, which loads the machine for minutes, runs under ~/.claude/bin/run-heavy, so sessions running at once cannot starve the machine", - "a docker build, docker buildx build or docker compose build, and a run of mutate-changes, or of cargo mutants, Infection, mutmut or Stryker, the mutation tools it runs, whether direct, through a launcher such as uvx, uv run, poetry run, sudo or doas, or inside docker run, docker exec or docker compose run or exec. A gate script is not checked, since no program can tell it from a light one", + "a docker build, docker buildx build or docker compose build, and a run of mutate-changes, or of cargo mutants, Infection, mutmut or Stryker, the mutation tools it runs, whether direct, through a launcher (" + ", ".join(sorted(LAUNCHERS - {"run-heavy"})) + "), or inside docker run, docker exec or docker compose run or exec. A gate script is not checked, since no program can tell it from a light one", ), "todo-rank-check": Rule( "while todo.md has changes, staged or not, a git commit waits until rank_todo.py --check passes on it: the checkout's own bin/rank_todo.py where the checkout is of this setup's repo, else ~/.claude/bin/rank_todo.py", diff --git a/bin/score_outcomes/main.py b/bin/score_outcomes/main.py index ba6dd1e6..d3c9452f 100644 --- a/bin/score_outcomes/main.py +++ b/bin/score_outcomes/main.py @@ -100,7 +100,7 @@ from failure import Failure from score_outcomes.results import file_lines, fixed_later, item_text, misreads, nearest, render, report, Result, results_of from plan.todo_table import item_details, LEVELS, risk, TOP_SCORE from text_files.markdown_text import listed -from plan.named_code import named_files +from plan.named_paths import named_files from project_config.main import project, title_templates from transcript_archive.location import project_archive from score_outcomes.reversals import reversal_lines diff --git a/bin/score_outcomes/results.py b/bin/score_outcomes/results.py index f14896d9..ced5d19a 100644 --- a/bin/score_outcomes/results.py +++ b/bin/score_outcomes/results.py @@ -6,7 +6,7 @@ from branch_chunks.cut import BranchChunk, Landing, NOT_WORK from review_rules.round_titles import Findings, round_findings, rounds_past_first from plan.todo_table import Item from text_files.markdown_text import listed -from plan.named_code import named_files +from plan.named_paths import named_files # Fewest single-item chunks a score needs before its medians print: the 10 figures the reading-cost trend waits for; no published standard sets either. ENOUGH = 10 diff --git a/bin/touch_predictions/test_touch_predictions.py b/bin/touch_predictions/test_touch_predictions.py index 72146ef1..ea2109e4 100644 --- a/bin/touch_predictions/test_touch_predictions.py +++ b/bin/touch_predictions/test_touch_predictions.py @@ -414,6 +414,11 @@ class EntryTest(unittest.TestCase): self.assertEqual([line.split(" at ")[1] for line in store.text.splitlines() if line.startswith("## ")], ["ccccccc", "ddddddd", "eeeeeee"]) self.assertEqual(store.text.count("\n\n\n"), 0) + def test_writes_over_the_version_it_read(self) -> None: + store = MemoryStore("", version=3) + record.append(store, [5], "## Chunk 5, 2026-01-01T00:00:00Z, at aaaaaaa\n") + self.assertEqual(store.overs, ["3"]) + def test_a_record_that_cannot_be_read_is_a_failure(self) -> None: self.assertEqual(record.append(MemoryStore(fails="no disk"), [5], "x"), Failure("no disk"))