diff --git a/AGENTS.md b/AGENTS.md index 45eef074..95726fe0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ Decisions live in `docs/decisions.md`: - workflow-bench/: the remote may show the bench cases' names and commit SHAs - settings.json: Claude Code runs in auto mode with the dangerous-mode prompt skipped - the repo may name bender, bender-infra and ai-sandbox -- todo.md: one table of items scored by the formula it states, each README achieve goal weighed by its rank, held to its bar, ranked by `bin/rank_todo.py`, which ranks each blocker above the items it blocks; the table's order is the plan's only order +- todo.md: one table of items scored by the formula it states, each README achieve goal weighed by its position, the first heaviest, held to its bar, ranked by `bin/rank_todo.py`, which ranks each blocker above the items it blocks; the table's order is the plan's only order - todo.md: only a session or subagent on the project's rung or above scores or reshapes the plan; one below it drafts new items and changes to filed ones for a subagent at or above that rung to apply and score, and removes finished ones - reading cost: larv-review measures each finished chunk from loop-claude's archive and appends the figure to `docs/reading-cost.md` in the next chunk's PR - reading cost: a rise is the last 5 chunks' median above the 5 before them, and files or refreshes one plan item diff --git a/CHANGELOG.md b/CHANGELOG.md index d1f198bf..120dd923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## Unreleased - Every goal in `README.md` β†’ Goals is marked `**Maintain:**`, a state to hold, or `**Achieve:**`, a direction to pursue. Each achieve goal has a signal, a counter-signal and a one-line reason under it. A change that breaks a maintain goal is redesigned or dropped, whatever it scores: `rules/todo-items.md` says so, and larv-review's goal alignment step no longer merges such a PR. `rules/goals-and-audience.md` states the form for every project's README. Expect larv-review to stop a PR on a maintain goal where it asked you before. -- `todo.md` ranks items by value per cost: `Score = 100 * V / 2**S`. A Moves column replaces A, G and Goals, naming each achieve goal an item moves and how far, such as `1.1 by 8, 1.2 by 5`. V sums each named goal's weight times its move. `rank_todo.py` weighs each achieve goal by its rank in README.md, so the goal weights table goes, and a maintain goal scores nothing. An item names the most specific goal it moves, never a goal beside its own sub-goal. An item that restores a maintain goal the project breaks today is exempt as `defect`, and defects now rank right after security items in their release. A `todo.md` still in the old shape ranks by its own formula and weights, with defects moved up as above, but reshaping it is now the project's only work until done, as for missing premises, and `rank_todo.py` says so. Reshaping needs the README's goals marked first, and a bar set on the new scale under every item to keep, since the old bar would drop most items. Move every machine to this release before reshaping a `todo.md` another machine shares: an older release asks to restore A, G and Goals. `rules/todo-items.md` and `rank_todo.py --help` show the new shape. +- Reshape every project's `todo.md` to the new shape below: until it is reshaped, that is the project's only work, as it is while README.md lacks Goals and Audience, and `rank_todo.py` says so. First move every machine to this release: an older release rejects the new formula, so it fails on every reshaped `todo.md`. Then mark the README's goals `**Maintain:**` or `**Achieve:**`, and set a bar on the new scale below the score of every item to keep, since the old bar would drop most items. Until then, an old-shape `todo.md` still ranks by its own formula and weights. +- `todo.md` ranks items by value per cost: `Score = 100 * V / 2**S`. A Moves column replaces A, G and Goals, naming each achieve goal an item moves and how far, such as `1.1 by 8, 1.2 by 5`. V sums each named goal's weight times its move. `rank_todo.py` weighs each achieve goal by its position in README.md, the first heaviest, so the goal weights table goes, and a maintain goal scores nothing. An item names the most specific goal it moves, never a goal beside its own sub-goal. `rules/todo-items.md` and `rank_todo.py --help` show the new shape. +- Defect items now rank right after security items in their release, in either shape. An item that restores a maintain goal the project breaks today is exempt as `defect`. ## 0.1.0 diff --git a/CLAUDE.md b/CLAUDE.md index c77db3a4..2c9ab4af 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,7 +5,7 @@ How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The *next release* is the earliest one not yet cut. Other words, such as *chunk*, are defined under "Vocabulary" at the end of this file. - **Until `README.md` has a `## Goals` and an `## Audience` section, writing them is the only work.** Not even planning in `todo.md`. Both are public: an outside reader judges a project by where it is heading and who it is for. Goals or an audience written anywhere else, such as `AGENTS.md` or `docs/`, do not count. -- **Plan `todo.md` as one scored table, in the shape `~/.claude/bin/rank_todo.py --help` shows**: every item names the release that ships it. Until `todo.md` has that shape, reshaping it is the only work, and the human approves it. +- **Plan `todo.md` as one scored table, in the shape whose example `~/.claude/bin/rank_todo.py --help` shows**: every item names the release that ships it. Until `todo.md` has that shape, reshaping it is the only work, and the human approves it. - **When the next release has no items and no work has landed towards it, plan it as this chunk.** Move the highest-scoring items of later releases into it, and get the human's approval of that set before writing any code. - **When the next release has no items left and work has landed towards it, it is finished: stop.** Report what it holds and that it is ready to cut. Under `/loop`, this ends the loop. Until the human cuts it, only a security fix lands, into that release; never start a later release's items or plan a new one. - **Open every chunk with one line:** the last version cut, how many changes are unreleased (the entries under `CHANGELOG.md` β†’ `## Unreleased`, or else the commits since the last tag), and the release this chunk ships into. A repo that publishes nothing says so once. diff --git a/bin/rank_todo.py b/bin/rank_todo.py index bdb9fe9f..cdfe4572 100755 --- a/bin/rank_todo.py +++ b/bin/rank_todo.py @@ -1,14 +1,14 @@ #!/usr/bin/env python3 -"""Score todo.md's items by the formula it states, weighing each achieve goal by its rank in README.md, and hold them to its bar. +"""Score todo.md's items by the formula it states, weighing each achieve goal by its position in README.md, and hold them to its bar. usage: rank_todo.py [--check] [todo.md] Reads todo.md (default: ./todo.md), the README.md beside it, and docs/decisions.md when there is one. Rewrites each item's Score from the formula and sorts the items by release; within a release, -security rows come first, then defect rows, then the rest, each group by score from highest, then by ID. Then it moves each blocker, -an item another's Blocked by cell names, that ranks below an item it blocks to just above the first -such item. Orders the details to match. Adds the Blocked by column to a table -without it. --check writes nothing and fails when the file is not ranked as it would be. +security rows come first, then defect rows, then the rest, each group by score from highest, then +by ID. Then it moves each blocker, an item another's Blocked by cell names, that ranks below an item +it blocks to just above the first such item. Orders the details to match. Adds the Blocked by column +to a table without it. --check writes nothing and fails when the file is not ranked as it would be. A valid todo.md; ## Details and each item's detail are optional: @@ -83,11 +83,11 @@ LARGEST_FORMULA = 200 LONGEST_FORMULA = 4 * LARGEST_FORMULA OPERATORS = (ast.Add, ast.BinOp, ast.Div, ast.Expression, ast.Load, ast.Mult, ast.Pow, ast.Sub, ast.UAdd, ast.UnaryOp, ast.USub) WEIGHTS_HEADER = "| Goal | W |" -# The Exempt reasons that rank an item ahead of the rest of its release, in order: a security finding, then a defect, which a πŸ”΄ or a broken maintain goal is. +# Exempt reasons that rank ahead of the rest of their release, in this order. FIRST = {"security": 0, "defect": 1} # How README.md marks a goal; None where it marks it neither way. Mark = typing.Literal["Maintain", "Achieve"] | None -RESHAPE = f"the items table scores A and G against goal weights todo.md states, the shape before {MOVES}. Until it has the shape rank_todo.py --help shows, reshaping it is the project's only work, as ~/.claude/CLAUDE.md β†’ 'Working loop' says: mark README.md's goals **Maintain:** or **Achieve:**, name each item's {MOVES}, and set the bar on the new scale under every item to keep" +RESHAPE = f"todo.md's items table is in the old shape, scoring A and G against goal weights todo.md states. Until todo.md has the shape rank_todo.py --help shows, reshaping it is the project's only work, as ~/.claude/CLAUDE.md β†’ 'Working loop' says: mark README.md's goals **Maintain:** or **Achieve:**, name each item's {MOVES}, and set the bar below the score of every item to keep" @dataclasses.dataclass(frozen=True) @@ -98,7 +98,7 @@ class Scoring: next_id: int # README.md's goal numbers, in reading order. goals: list[str] - # The weight of each goal an item may name: in OLD_SHAPE every goal, at the weight todo.md states; else each achieve goal, by its rank in README.md. + # The weight of each goal an item may name: in OLD_SHAPE every goal, at the weight todo.md states; else each achieve goal, by its position in README.md. weights: dict[str, float] @@ -106,7 +106,7 @@ class Scoring: class Ranked: text: str under_bar: list[str] - # The lines ranking prints and --check does not: that an old-shape table wants reshaping, and each blocker ID dropped because the table no longer holds it, since a mistyped ID is dropped the same way. + # What ranking prints and --check does not: an old-shape table's call to reshape, a README with no achieve goal, and each dropped blocker ID, since a mistyped ID drops the same way. notes: list[str] @@ -221,7 +221,7 @@ def notes(items: list[Item], scoring: Scoring) -> list[str]: dropped = [f"item {item.id}: dropped {', '.join(map(str, gone))} from its {BLOCKED_BY}; the table no longer holds {'it' if len(gone) == 1 else 'them'}" for item in items if (gone := sorted(set(item.blocked_by) - held))] if scoring.shape is OLD_SHAPE: return [RESHAPE] + dropped - # Said, since every item under the bar for that reason reads like one of low value. + # Printed so the under-bar lines it causes do not read as items of low value. unweighed = [] if scoring.weights else ["README.md marks no goal **Achieve:**, so every item scores V 0"] return unweighed + dropped @@ -271,7 +271,7 @@ def read_scoring(text: str, lines: list[str], readme: str, shape: Shape) -> Scor if shape is OLD_SHAPE: weights = parse_weights(lines, numbers) elif WEIGHTS_HEADER in lines: - weights = Failure(f"todo.md holds a goal weights table beside a {MOVES} column; drop the table, since rank_todo.py weighs each achieve goal by its rank in README.md") + weights = Failure(f"todo.md holds a goal weights table beside a {MOVES} column; drop the table, since rank_todo.py weighs each achieve goal by its position in README.md") else: weights = achieve_weights(goals) if isinstance(weights, Failure): @@ -299,7 +299,9 @@ def unknown_columns(table: Table) -> Failure | None: known = shape_of(table.columns).columns unknown = [column for column in table.columns if column not in known] if old := [column for column in unknown if column in OLD_SHAPE.columns]: - return Failure(f"todo.md's items table has the column {', '.join(old)}, a column of the old shape, which {MOVES} replaced; drop it") + listed = old[0] if len(old) == 1 else f"{', '.join(old[:-1])} and {old[-1]}" + kind = f"a column of the old shape that {MOVES} replaced; drop it" if len(old) == 1 else f"columns of the old shape that {MOVES} replaced; drop them" + return Failure(f"todo.md's items table has {listed}, {kind}") if unknown: return Failure(f"todo.md's items table has the column {', '.join(unknown)}, which this rank_todo.py does not know; the columns it knows are {', '.join(known)}. Rename it, or move this machine to the release that added it") return None @@ -473,7 +475,7 @@ def evaluate(node: ast.AST, values: dict[str, float]) -> float: divisor = evaluate(right, values) return evaluate(left, values) / divisor if divisor else math.nan case ast.BinOp(left, ast.Pow(), right): - # Caught in place of checking first: a negative base with a fractional exponent, zero to a negative power and an overflow each raise, and three checks would read worse than one catch. + # math.pow raises on a negative base with a fractional exponent, zero to a negative power, and overflow; one catch covers all three. base, exponent = evaluate(left, values), evaluate(right, values) # A nan from a zero divisor stays nan, though math.pow(1, nan) and math.pow(nan, 0) give 1. if math.isnan(base) or math.isnan(exponent): @@ -497,7 +499,7 @@ def variables(shape: Shape) -> tuple[str, ...]: def score(formula: ast.Expression, item: Item, scoring: Scoring) -> float | Failure: if goal_term(scoring.shape) == "W": - # An item serving several goals is weighed by the heaviest; summing them would reward citing more. + # The old shape weighs an item by its heaviest cited goal. term = max(scoring.weights[goal] for goal, _ in item.moves) else: # Only an OLD_SHAPE item names a goal without a move. diff --git a/bin/test_rank_todo.py b/bin/test_rank_todo.py index 0487fb76..743c0406 100644 --- a/bin/test_rank_todo.py +++ b/bin/test_rank_todo.py @@ -178,7 +178,7 @@ class Rank(unittest.TestCase): def test_asks_to_drop_a_goal_weights_table_from_a_table_with_moves(self): weighted = TODO.replace("## Items\n", "| Goal | W |\n|---|---|\n| 1 | 1.00 |\n\n## Items\n") - self.assertEqual(self.ranked(weighted), Failure("todo.md holds a goal weights table beside a Moves column; drop the table, since rank_todo.py weighs each achieve goal by its rank in README.md")) + self.assertEqual(self.ranked(weighted), Failure("todo.md holds a goal weights table beside a Moves column; drop the table, since rank_todo.py weighs each achieve goal by its position in README.md")) def test_refuses_a_formula_that_is_more_than_arithmetic_over_the_scores(self): for formula in ("__import__('os')", "R.real", "X + 1", "C + 1", "A + V", "G + V", "W * V", "R ^ 2", "R +", "R / (S - 2)", "R\x00", "1" * 400, " + ".join(["R"] * 300), "-" * 100000 + "R", "10 ** 10 ** 10", "(-8) ** (1 / 3)", "0 ** -1"): @@ -252,7 +252,9 @@ class OldShape(unittest.TestCase): def test_refuses_a_table_with_both_moves_and_goals(self): both = OLD_SHAPE.replace("| Goals | Score |\n|---|", "| Goals | Moves | Score |\n|---|---|").replace(" | 0 |\n", " | 1 by 1 | 0 |\n") - self.assertEqual(self.ranked(both), Failure("todo.md's items table has the column A, G, Goals, a column of the old shape, which Moves replaced; drop it")) + self.assertEqual(self.ranked(both), Failure("todo.md's items table has A, G and Goals, columns of the old shape that Moves replaced; drop them")) + one = TODO.replace("| Moves | Score |\n|---|", "| Moves | G | Score |\n|---|---|").replace(" | 0 |\n", " | 1 | 0 |\n") + self.assertEqual(self.ranked(one), Failure("todo.md's items table has G, a column of the old shape that Moves replaced; drop it")) def test_names_the_goals_column_a_table_misspells_by_its_shape(self): misspelt = TODO.replace("| C | Moves |", "| C | Move |") diff --git a/bin/todo_table.py b/bin/todo_table.py index 49fc8ec7..6d371b5e 100644 --- a/bin/todo_table.py +++ b/bin/todo_table.py @@ -65,7 +65,6 @@ def write_cited(moves: Moves) -> str: return ", ".join(goal for goal, _ in moves) -# The current shape. SHAPE = Shape(("R", "S", "C"), MOVES, parse_moves, write_moves) # The shape from before MOVES replaced A, G and Goals, which older todo.md files hold. OLD_SHAPE = Shape(("R", "S", "C", "A", "G"), "Goals", parse_cited, write_cited) @@ -101,7 +100,7 @@ class Table: def shape_of(columns: tuple[str, ...]) -> Shape: - """The items table's shape: OLD_SHAPE where columns hold one only that shape has and no MOVES, else SHAPE, so a misspelt MOVES is named as missing.""" + """OLD_SHAPE where the columns include A, G or Goals and not MOVES; else SHAPE, so a misspelt MOVES is reported missing.""" old_only = set(OLD_SHAPE.columns) - set(SHAPE.columns) return OLD_SHAPE if MOVES not in columns and old_only.intersection(columns) else SHAPE @@ -200,7 +199,7 @@ def check_cells(row: str, named: dict[str, str]) -> Failure | None: def parse_scores(id_: str, named: dict[str, str], names: tuple[str, ...]) -> dict[str, int] | Failure: - """Each score of names the row holds; only C may be missing, since the table holds every needed column.""" + """Each score in names that the row holds; only C may be missing, since the table holds every needed column.""" scores: dict[str, int] = {} for name in names: if name not in named: diff --git a/docs/decisions.md b/docs/decisions.md index 05f75676..6a314faa 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -4,9 +4,9 @@ 2026-09-20, lilleman. Serves goal 1. Across six projects scored with the four seats, Locality or Self-sufficiency was the lowest dimension at every seat and Navigation at none, so a layout fix would not lift a project under the floor. Valid while the scoring run keeps those four seats. -2026-10-15, lilleman: an item that lifts the lowest dimension scores G 9, since the lowest dimension caps the overall and lifting it is worth the most to the floor. PR #257's scoring run found Shape lowest, at 6.25, which names the Shape items, `todo.md` items 114, 124 and 125. When todo item 148 replaces G, the chunk that ships it carries this rule into the new score. +2026-10-15, lilleman: an item that lifts the lowest dimension scores G 9, since the lowest dimension caps the overall and lifting it is worth the most to the floor. PR #257's scoring run found Shape lowest, at 6.25. The Shape items are `todo.md` items 114, 124 and 125. When PR #283 replaces G, the chunk that ships it carries this rule into the new score. -2026-10-16, implementing todo item 148: such an item moves each goal it cites by 9, in place of G 9. lilleman, answering the review of PR #283: such items compete with the others like any item, so they no longer rank first. +2026-10-16, PR #283: such an item moves each goal it cites by 9, in place of G 9. lilleman, answering that PR's review: such items compete with the others like any item, so they no longer rank first. ## loop-claude: a judge decides each interrupt and each quoted answer from the transcript, the README's premises, `AGENTS.md`, `docs/decisions.md`, `~/.claude/CLAUDE.md`, `~/.claude/rules/` and larv-review's standards, and holds a chunk open while an answer the human typed in it is recorded nowhere; the worker's own account of which goal settles a choice decides nothing @@ -122,15 +122,15 @@ Valid while the ladder orders its rungs by competence. 2026-10-02, lilleman. Serves goal 4, which keeps credentials, transcripts and memory files off the remote; a private project's name and commit ids are none of those. Valid while the bench names only cases and commits, never their code or results. -## todo.md: one table of items scored by the formula it states, each README achieve goal weighed by its rank, held to its bar, ranked by `bin/rank_todo.py`, which ranks each blocker above the items it blocks; the table's order is the plan's only order +## todo.md: one table of items scored by the formula it states, each README achieve goal weighed by its position, the first heaviest, held to its bar, ranked by `bin/rank_todo.py`, which ranks each blocker above the items it blocks; the table's order is the plan's only order -2026-10-02, lilleman. Serves goal 1: findings were filed faster than chunks closed them, so the plan grew without telling what mattered. Each item is scored as `~/.claude/rules/todo-items.md` says; this repo's formula counts value highest and size least. An item under the bar is not kept; this repo's bar started at 10 and was set to 9 the same day, purging the 17 items under it. An Exempt cell keeps a row past the bar where a rule needs it kept. lilleman retired the two decisions whose plans the purge removed: the stats line in the transcript archive, and three benches before a workflow change merges. A finding under the bar is recorded nowhere, so a later review may raise it again, and the run rescores it. That costs one scoring; a ledger of dropped findings would regrow the list the bar caps. larv-review's "Round cap" β†’ "Done" counts a finding named under the bar as settled, so one raised again holds no pass open. `rank_todo.py --check` is part of larv-review's gate, since only a check keeps the stored Score from going stale. The format is mandatory in every project, as the premises are (goal 1.3); the formula, bar and weights are each project's own. A script ranks the table so a re-rank after each addition or edit is deterministic and cheap. A 🟑 against a technical principle is exempt as `principle`, because its audience value scores low and the bar would drop every one. A 🟒 against a principle is scored like any other finding. 2026-10-08, lilleman: the goal weights in `todo.md` depart from an even spread by position, which would weigh goal 4, leaking nothing, at 0.11. Valid while one human sets the bar and reads the ranking, and while the items marked `principle` stay few enough to rank. +2026-10-02, lilleman. Serves goal 1: findings were filed faster than chunks closed them, so the plan grew without telling what mattered. Each item is scored as `~/.claude/rules/todo-items.md` says; this repo's formula counts value highest and size least. An item under the bar is not kept; this repo's bar started at 10 and was set to 9 the same day, purging the 17 items under it. An Exempt cell keeps a row past the bar where a rule needs it kept. lilleman retired the two decisions whose plans the purge removed: the stats line in the transcript archive, and three benches before a workflow change merges. A finding under the bar is recorded nowhere, so a later review may raise it again, and the run rescores it. That costs one scoring; a ledger of dropped findings would regrow the list the bar caps. larv-review's "Round cap" β†’ "Done" counts a finding named under the bar as settled, so one raised again holds no pass open. `rank_todo.py --check` is part of larv-review's gate, since only a check keeps the stored Score from going stale. The format is mandatory in every project, as the premises are (goal 1.3); the formula and bar are each project's own. A script ranks the table so a re-rank after each addition or edit is deterministic and cheap. A 🟑 against a technical principle is exempt as `principle`, because its audience value scores low and the bar would drop every one. A 🟒 against a principle is scored like any other finding. 2026-10-08, lilleman: the goal weights in `todo.md` depart from an even spread by position, which would weigh goal 4, leaking nothing, at 0.11. Valid while one human sets the bar and reads the ranking, and while the items marked `principle` stay few enough to rank. -2026-10-15, lilleman: the scores get a researched method, which todo item 148 and `todo.md` items 146, 149, 151 and 152 build; the evidence is in `docs/scoring-and-goals-research.md`. R becomes L + E + I βˆ’ 2: the chance the change holds a defect, set first by its size; the chance the defect escapes tests, review and monitoring; and the worst impact dimension, each about Γ—10 per level. I5, irreversible, holds R at 7 or more, and I4 at 5 or more, since a severe enough consequence outranks how unlikely it is. C goes from every table and tool: what it scored beyond size, spread and novelty, which L already holds, is complexity, which adds almost nothing once size is accounted for. A task's R alone then picks its rung. Items rank by V / C, value per cost: C is 2^S, and V sums each cited achieve goal's sum-reciprocal weight times how far the item moves it. A goes, and the Audience says whose value the goals serve. R stays out of the ranking and sets how carefully an item is done; an item that lowers risk scores it as value. Each release fills by priority up to a capacity it states, in place of the bar. Each README goal is `maintain`, which vetoes an item that breaks it, or `achieve`, with a signal, a counter-signal and a one-line reason, as this README's Goals now mark them; each project keeps settled decisions to test its goals against. Until these items ship, the formula and bar above hold. +2026-10-15, lilleman: the scores get a researched method, which `todo.md` items 146, 149, 151 and 152 build, after PR #283 shipped the ranking; the evidence is in `docs/scoring-and-goals-research.md`. R becomes L + E + I βˆ’ 2: the chance the change holds a defect, set first by its size; the chance the defect escapes tests, review and monitoring; and the worst impact dimension, each about Γ—10 per level. I5, irreversible, holds R at 7 or more, and I4 at 5 or more, since a severe enough consequence outranks how unlikely it is. C goes from every table and tool: what it scored beyond size, spread and novelty, which L already holds, is complexity, which adds almost nothing once size is accounted for. A task's R alone then picks its rung. Items rank by V / C, value per cost, the cost being 2^S, and V sums each cited achieve goal's sum-reciprocal weight times how far the item moves it. A goes, and the Audience says whose value the goals serve. R stays out of the ranking and sets how carefully an item is done; an item that lowers risk scores it as value. Each release fills by priority up to a capacity it states, in place of the bar. Each README goal is `maintain`, which vetoes an item that breaks it, or `achieve`, with a signal, a counter-signal and a one-line reason, as this README's Goals now mark them; each project keeps settled decisions to test its goals against. Each part of this method holds once the item that builds it ships. -2026-10-16, implementing todo item 148: items rank by `Score = 100 * V / 2**S`. 2**S is the cost; the 100 lets a score read to one decimal. V sums, over the achieve goals an item's Moves cell names, each goal's sum-reciprocal weight times how far the item moves it, 1 to 10. `rank_todo.py` derives the weights from README.md's achieve goals in reading order, so A, G and the goal weights table are gone, the 2026-10-08 weights with them. A maintain goal scores nothing, so an item that cited only maintain goals now names the achieve goal it moves, or none and scores 0. A panel of three readers seated as lilleman picked the spelling: two put a Moves column holding `1.1 by 8, 1.2 by 5` first, and one put `1.1: 8` first; two chose `2**S`, since a Python reader takes `^` for XOR; all three chose one decimal of 100 Γ— V / 2**S over three significant digits or a log. The bar moved to 0.1, lilleman's call answering the review of PR #283: on one-decimal scores it drops an item scoring under 0.05, in practice one that moves no achieve goal, and item 149 revisits it. A table in the old shape still ranks by the formula and weights it states, and ranking it says to reshape it, so no other project's commits stop; reshaping it is that project's only work until done, as `CLAUDE.md` β†’ "Working loop" says. The C column stays until `todo.md` item 146 drops it. The old shape's ranking is valid until `todo.md` item 156. +2026-10-16, PR #283: items rank by `Score = 100 * V / 2**S`. 2**S is the cost; the 100 lets a score read to one decimal. V sums, over the achieve goals an item's Moves cell names, each goal's weight times how far the item moves it, 1 to 10. The goal ranked k of n achieve goals in reading order weighs (1/k) / (1 + 1/2 + … + 1/n), the sum-reciprocal weight. A Moves column replaces A, G and Goals, and `rank_todo.py` derives the weights from README.md, so the goal weights table and the 2026-10-08 weights are gone. A maintain goal scores nothing, so an item that cited only maintain goals now names the achieve goal it moves, or none and scores 0. A panel of three readers seated as lilleman picked the spelling: two put a Moves column holding `1.1 by 8, 1.2 by 5` first, and one put `1.1: 8` first; two chose `2**S`, since a Python reader takes `^` for XOR; all three chose one decimal of `100 * V / 2**S` over three significant digits or a log. The bar moved to 0.1, lilleman's call answering the review of PR #283: on one-decimal scores it drops an item scoring under 0.05, in practice one that moves no achieve goal, and item 149 revisits it. A table in the old shape still ranks by the formula and weights it states, and ranking it says to reshape it, so no other project's commits stop; reshaping it is that project's only work until done, as `CLAUDE.md` β†’ "Working loop" says. The C column stays until `todo.md` item 146 drops it. The old shape's ranking is valid until `todo.md` item 156. -2026-10-16, lilleman, answering the review of PR #283. An item that restores a maintain goal the project breaks today is a defect: exempt as `defect`, and ranked right after security items in its release, as every defect now is, since a broken maintain goal vetoes whatever else the plan would do. An item names the most specific goal it moves, and a parent only for a move none of its sub-goals covers, so a sub-goal's move does not count twice; `rank_todo.py` refuses a goal named beside its own sub-goal. Each project reshapes its own `todo.md`; centrally, `CLAUDE.md` β†’ "Working loop" makes the reshape the only work until done, as missing premises are. An item that makes this project easier to read moves goal 1.4 as well as 1.1, since reading cost is measured in tokens per chunk; a goal of its own for readability is left for later. +2026-10-16, lilleman, answering the review of PR #283. An item that restores a maintain goal the project breaks today is a defect: exempt as `defect`, and ranked right after security items in its release, as every defect now is: work that restores a broken state comes before work that adds value. An item names the most specific goal it moves, and a parent only for a move none of its sub-goals covers, so a sub-goal's move does not count twice; `rank_todo.py` refuses a goal named beside its own sub-goal. Each project reshapes its own `todo.md`; `CLAUDE.md` β†’ "Working loop" makes the reshape the only work until done, as it makes writing missing premises. An item that makes this project easier to read moves goal 1.4 as well as 1.1, since reading cost is measured in tokens per chunk; a goal of its own for readability is left for later. 2026-10-15, lilleman. Serves goal 1.4: loop-claude routes a chunk's first cycle on the item the chunk takes (`routing: one ladder`). An item lists the items that must be done before it starts in a Blocked by column, and `rank_todo.py` ranks each blocker above every item it blocks. The table's order is `todo.md`'s only order: `rank_todo.py` fails on text beside the table under `## Items`, since a prose order there, "Release 0.3.0 takes items 125, 114 and 124 first", contradicted the table and loop-claude could not read it. A decision that wants an order sets the scores instead. An item waits while it is marked `question` or a blocker of it is still in the table, whatever the rows' order, so a release's first row that does not wait is the item a chunk takes. A blocker the table no longer holds was finished or deleted, and is dropped, so the cell shows what still blocks. A panel of three readers seated as lilleman picked the spelling: two ranked "Blocked by" first, as the cell lists only what still blocks, and all three chose bare IDs such as `12, 14` in a column right after Release, read before the tagline and kept apart from the scores. `rank_todo.py` adds the column to a table without it. The tools read cells by column name, so a later column leaves a reader on an older release working; `rank_todo.py`, which writes every column, fails on one it does not know rather than drop it. diff --git a/rules/todo-items.md b/rules/todo-items.md index a4dbb4ef..a8a1fd61 100644 --- a/rules/todo-items.md +++ b/rules/todo-items.md @@ -5,7 +5,7 @@ paths: # Todo items (`todo.md`) -- **`todo.md` is mandatory in every project, in one shape**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. Cite an item by its ID. The formula and bar are the project's own to tune. +- **`todo.md` is mandatory in every project, in the shape `rank_todo.py --help` shows**, which `~/.claude/bin/rank_todo.py` checks and ranks; its `--help` shows a valid file. `## Scoring` holds the formula and the bar; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. Cite an item by its ID. The formula and bar are the project's own to tune. - **Order items only by score and the Blocked by column.** An item's Blocked by cell lists the IDs of the items that must be done before it starts, such as `12, 14`; `rank_todo.py --help` says how it ranks them. No text in `todo.md` outside the table orders items: where an item must go first, score it so, and say why in its detail. - **Plan only on the project's rung or above.** loop-claude's prompt tells you when you run below it. Below it, never score or re-score an item, move it between releases, split a milestone into items, delete an item under the bar, or rewrite a filed item's tagline or detail. Draft each new item, and each change to a filed item, instead. Before your next commit, launch one subagent to apply the drafts, score them and set their release. Launch it on the rung `CLAUDE.md`'s delegation rule gives a subagent that files or scores items. Keep the scores and releases it writes. For a security finding, launch it at once. Any rung may remove a finished item's row and detail, and score a delegated task's R + C. A subagent launched for another task leaves `todo.md` alone. - **An item's release allows the bump that semver read strictly asks for.** An item that changes what exists needs a major, or before 1.0.0 a minor. One that only adds needs a minor, and a fix a patch. @@ -13,8 +13,8 @@ paths: - **R** β€” the risk that the change creates serious bugs or issues. - **S** β€” the size of the change. - **C** β€” how hard the change is to get right: novel design, subtle invariants, many interacting parts. A huge rename is low C; a ten-line lock fix can be high. C stays out of the score. - - **Moves** β€” each achieve goal in `README.md` β†’ `## Goals` the item moves, and how far, from 1 to 10, judged by its value to the audience in `## Audience`: `1.1 by 8, 1.2 by 5`. Name the most specific goal it moves, and a parent goal only for a move none of its sub-goals covers, never beside its own sub-goal. Leave out every maintain goal, which vetoes and never scores. `rank_todo.py --help` says how it weighs each goal. - - A table with A, G and Goals in place of Moves is in the old shape. Reshaping it is the project's only work until done, as `CLAUDE.md` β†’ "Working loop" says, and `rank_todo.py` says how. Until then, A is the item's value to the audience and G its value to the goals it cites. +- **Name in Moves each achieve goal in `README.md` β†’ `## Goals` the item moves, and how far,** from 1 to 10, judged by its value to the audience in `## Audience`: `1.1 by 8, 1.2 by 5`. Name the most specific goal it moves, and a parent goal only for a move none of its sub-goals covers, never beside its own sub-goal. Leave out every maintain goal, which vetoes and never scores. `rank_todo.py --help` says how it weighs each goal. +- **A table with A, G and Goals in place of Moves is in the old shape.** Reshaping it is the project's only work until done, as `CLAUDE.md` β†’ "Working loop" says, and `rank_todo.py` says how. Until then, A is the item's value to the audience and G its value to the goals it cites. - **Check R, S and C against finished chunks.** Guess them, then run `~/.claude/bin/score-outcomes ` in the project. It lists the finished items guessed nearest, what their chunks measured, and the median outcome at each guessed value. Set each score to the value guessed for the finished items whose outcome matches what you expect of this one. Keep your guess when no listed item resembles the one you are scoring. - **Read the places the comprehension seats found hard before filing an item.** `~/.claude/bin/larv-review places`, run in the project, prints them. Where the item's change touches one, its detail says to make that place easier to read. - **An item scoring under the bar is deleted, with every item that needs it, and a finding under the bar is not filed.** The chunk's summary names each, with its score. diff --git a/todo.md b/todo.md index 8b18eb10..1f2798e2 100644 --- a/todo.md +++ b/todo.md @@ -6,7 +6,7 @@ `Bar = 0.1` -`Next ID = 157` +`Next ID = 158` ## Items @@ -34,6 +34,7 @@ | 133 | 0.3.0 | | | **Show, beside `bin/rule_hook/override_log.py`'s `this_chunks`, one example per case it decides: an amended or rebased commit, a renamed branch, and a commit on the default branch.** | 1 | 2 | 2 | 1.1 by 4, 1.4 by 4 | 32.8 | | 134 | 0.3.0 | | | **Name in `bin/shell_command.py`'s `segments` the shell forms it does not parse, so a caller knows what it misses.** | 1 | 2 | 2 | 1.1 by 4, 1.4 by 4 | 32.8 | | 140 | 0.3.0 | | | **Split `docs/decisions.md` β†’ `routing: one ladder` into one entry per decision, so a reader finds the rules for the ladder, the worker's rung, the routing figures and delegation by their titles.** | 1 | 2 | 1 | 1.1 by 4, 1.4 by 4 | 32.8 | +| 157 | 0.3.0 | | | **Split `docs/decisions.md` β†’ `todo.md: one table of items …`'s 2026-10-02 paragraph into one paragraph per choice.** | 1 | 2 | 1 | 1.1 by 4, 1.4 by 4 | 32.8 | | 139 | 0.3.0 | | | **Split `bin/routing_figures/measure.py` by concern, and keep the figures' measured cycle and each raised call as fields loop-claude reads back, not as the prose it renders.** | 2 | 3 | 3 | 1.1 by 5, 1.4 by 5 | 20.5 | | 114 | 0.3.0 | | decision | **Run git through `git_repo.py` in `rule_hook`, `metric_bench`, `reading_cost`, `stability_replay` and `loop_claude`, keeping rule-hook's guards as an option, so one module owns how a tool runs git.** | 3 | 4 | 4 | 1.1 by 9, 1.4 by 9 | 18.5 | | 120 | 0.3.0 | | | **Rewrite larv-review Β§3's "Round cap" and "Re-entry" as one table that says, for each kind of fix, which passes rerun and what a round reviews.** | 2 | 4 | 5 | 1.1 by 6, 1.2 by 6, 1.4 by 6 | 17.8 | @@ -86,7 +87,7 @@ ### 116. Report L by the share of chunks with a πŸ”΄, once 10 chunks that each shipped one item record finding counts and most record no πŸ”΄. -`score-outcomes` reports risk as the median πŸ”΄ count at each guessed R; with item 146 it is L a πŸ”΄ tests. Where most chunks have no πŸ”΄, every median reads 0 and tells a scorer nothing. No round title held counts before PR #254, so how often a chunk has a πŸ”΄ is not yet known. +`score-outcomes` reports risk as the median πŸ”΄ count at each guessed R; after item 146, the part of R a πŸ”΄ tests is L. Where most chunks have no πŸ”΄, every median reads 0 and tells a scorer nothing. No round title held counts before PR #254, so how often a chunk has a πŸ”΄ is not yet known. ### 149. Fill each release by priority up to a capacity it states, in place of the bar, and move what does not fit to a later release. @@ -124,7 +125,7 @@ Each level is about Γ—10 of a real quantity; `docs/decisions.md` β†’ `todo.md: | 4 | two or more of level 3's, or a rewrite of code with known defects | β€” | everything down, a backup restore, or a secret or PII exposed | | 5 | β€” | β€” | irreversible: data lost for good, or a one-way door | -`rank_todo.py` accepts a table in the old shape until its project reshapes it, and says so, so no project's commits stop the day this lands. Reshaping is then that project's only work until done, as `CLAUDE.md` β†’ "Working loop" says. +`rank_todo.py` ranks a table with C and without L, E and I until its project reshapes it, and says so, as it does for the old shape since PR #283, so no project's commits stop the day this lands. Reshaping is then that project's only work until done, as `CLAUDE.md` β†’ "Working loop" says. C goes in the same chunk, so no reshaped table meets bands built for R + C: R alone runs 1 to 10, and the R + C bands would step most tasks well down the ladder. The bands (`docs/decisions.md` β†’ `routing: one ladder…`) become bands over R, spread across the R values the rescored plans hold. The bands are the human's call, so the chunk proposes them and waits, and puts one option beside them: the worker routed on L and its reviewers on E + I, since impact makes a task riskier, not harder. `CLAUDE.md`'s delegation rule, `subagent-rung` and its `--plan`, loop-claude's chunk routing and prompts, the judge's rung, escalation trigger 1 and `score-outcomes` drop C. The routing decision's "S never moves a rung" no longer holds, since size sets L, so the chunk revises it. Once it merges, append a `Reset` to `routing-calls-raised.md`, as `AGENTS.md` says of a band change, so the routing figures count only chunks routed on R. @@ -176,6 +177,10 @@ Junior A and Mid A of PR #257's scoring run named `bin/shell_command.py:31` `seg The entry holds 7 paragraphs under one title of about 70 words chaining three decisions: the ladder and bands, the worker below the project's rung with its reviewers, the routing figures and calls, delegation, and when the worker changes rung. A reader after one rule reads the whole entry. The prose pass of the chunk that split out the judge's rung asked for the rest. Once split, the delegation entry's title names the floor that `todo.md: only a session or subagent on the project's rung or above scores or reshapes the plan…` puts under a subagent that files or scores items. +### 157. Split `docs/decisions.md` β†’ `todo.md: one table of items …`'s 2026-10-02 paragraph into one paragraph per choice. + +Raised by PR #283's prose pass. The paragraph runs about 330 words and holds six choices: the bar, the purge, re-raising findings, the gate check, the `principle` exemption and the 2026-10-08 weights note. A reader after one of them reads all six. + ### 139. Split `bin/routing_figures/measure.py` by concern, and keep the figures' measured cycle and each raised call as fields loop-claude reads back, not as the prose it renders. The paired ruling on PR #265 ruled worse. Make these places easier to read: `measure.py` `measured` and `render` (token attribution, subagent rungs, round counting, calls and rendering in one module; `measured`, `Measured` and `measure_archive` side by side); `calls` with `archive.py` `raised` and `last_measured`, where a call's identity is its sentence and the measured cycle is read back from rendered markdown; and `Reports.searches`, which holds characters, not searches. @@ -224,7 +229,7 @@ Three seats of PR #257's scoring run named `bin/comprehension_history.py:106` `l Shape is the lowest dimension, so this item moves goal 1.1 by 9, per `docs/decisions.md` β†’ `larv-review: a project lifting itself to the comprehension floor starts at the lowest dimension`. -PR #257's scoring run put Shape at 6.25, the lowest dimension. `bin/` holds about 30 entries: 6 launchers, 6 tool packages, 3 shared packages and 13 root modules. Two root modules are tools (`rank_todo.py`, `statusline.py`) and 11 are shared libraries, and nothing in the layout tells them apart; only README's import-root paragraph maps them. Candidate packages: git running and parsing, the todo table with `rank_todo.py`'s formula language and goal weighing, and the comprehension history with round titles. `rank_todo.py` keeps its path, which every project's rules call. The `.gitignore` allowlist and README follow the move. +PR #257's scoring run put Shape at 6.25, the lowest dimension. `bin/` holds about 30 entries: 6 launchers, 6 tool packages, 3 shared packages and 13 root modules. Two root modules are tools (`rank_todo.py`, `statusline.py`) and 11 are shared libraries, and nothing in the layout tells them apart; only README's import-root paragraph maps them. Candidate packages: git running and parsing, the todo table with `rank_todo.py`'s formula language and goal weighing, and the comprehension history with round titles. `rank_todo.py` keeps its path, which every project's rules name. The `.gitignore` allowlist and README follow the move. ### 21. Give `settings.json`'s model one writer, and sort its keys. @@ -234,15 +239,15 @@ Every write Claude Code makes to the file rewrites `"model"`, `claude plugin ins ### 65. Archive each judge reply the loop rejects. -A defect: goal 3, keeping the transcripts of unattended runs, does not hold while a rejected judge reply reaches only stderr. Raised by the principles audit of PR #215: the judge runs with `--no-session-persistence`, and the first two rejected replies reach only stderr, so the archive cannot answer the 3am question of why the loop rejected a verdict. +A defect: goal 3, keeping unattended runs' transcripts backed up, does not hold while a rejected judge reply reaches only stderr. Raised by the principles audit of PR #215: the judge runs with `--no-session-persistence`, so the archive cannot answer the 3am question of why the loop rejected a verdict. ### 80. State in README β†’ Install that every machine taking this checkout must be a sandbox, as `settings.json`'s auto mode assumes. -A defect: goal 2, keeping the setup shareable between computers, does not hold while a new machine is never told it must be a sandbox. Raised by the principles audit of PR #224. The `settings.json` decision is valid while every machine taking this checkout is a sandbox, but Install asks for a sandbox only for `loop-claude`, so a new machine is never told. +A defect: goal 2, keeping the setup shareable between computers, does not hold while a new machine is never told it must be a sandbox. Raised by the principles audit of PR #224. The `settings.json` decision is valid while every machine taking this checkout is a sandbox, but Install asks for a sandbox only for `loop-claude`. ### 119. Retitle the comprehension-floor decision so it says a chunk lifting a project towards the floor works first on its lowest-scoring dimension, and that the floor blocks nothing. -Today's title, "a project lifting itself to the comprehension floor starts at the lowest dimension", reads as either where the project scores or where work begins. Beside the title saying the check blocks no merge, a reader cannot tell whether `Floor:` means stop; a seat named `AGENTS.md:5` among the places it found hard. "First" means within such a chunk, not across a release: the decision's 2026-10-16 line has its items compete with the others like any item. +Today's title, "a project lifting itself to the comprehension floor starts at the lowest dimension", reads as either where the project scores or where work begins. Beside the title saying the check blocks no merge, a reader cannot tell whether `Floor:` means stop; a seat named `AGENTS.md:5` among the places it found hard. "First" means within such a chunk, not across a release: since the decision's 2026-10-16 line, items that lift the lowest dimension compete with the others like any item. ### 106. Make larv-review's "Do not over-read a clean result" cite a rule that says Renovate or Dependabot owns dependency CVEs, or drop the citation. @@ -294,7 +299,7 @@ Found by the principles audit of PR #242, against "Functional core, imperative s ### 156. Drop `rank_todo.py`'s ranking of an old-shape table once no project under `~/code` holds one. -Ranking two shapes keeps two sets of scoring rules alive across projects; goal 1.3 holds only while that lasts no longer than the projects take to reshape. Drop `OLD_SHAPE`'s weighing from `rank_todo.py`, `RESHAPE`, and the old shape's lines in `rank_todo.py --help` and `rules/todo-items.md`. Keep `todo_table` reading old tables: `score_outcomes` reads every past merge's `todo.md`. +While `rank_todo.py` ranks two shapes, projects follow two sets of scoring rules, against goal 1.3. Once every project has reshaped, drop `OLD_SHAPE`'s weighing from `rank_todo.py`, `RESHAPE`, and the old shape's lines in `rank_todo.py --help` and `rules/todo-items.md`. Keep `todo_table` reading old tables: `score_outcomes` reads every past merge's `todo.md`. ### 12. Run the test suite in CI on every PR, or record in `docs/decisions.md` why the local run is enough. @@ -330,7 +335,7 @@ Claude Code owns that file and writes it. `trust` reads it, changes it and write ### 73. Have each reviewer write its full report to a file and return the worker only its findings' one-line summaries. -2026-10-08, lilleman: rescored from A10/G8 to A4/G4 on the measurement below, so other items that lower token use go first. In the Moves column that is `1.4 by 4`. +2026-10-08, lilleman: rescored from A10/G8 to A4/G4 on the measurement below, so other items that lower token use go first. Measured over the 68 transcripts in loop-claude's archive on 2026-10-08, matching each Agent call to its tool result and to any `` naming its tool-use id. No report reached the worker twice: 813 arrived once as the hand-back, and 363 once as a notification after Claude Code ran the agent in the background. Reports took a median 19k tokens per chunk, 8% of the worker's peak context (24% at most). Lines carrying a severity mark are 9–24% of a reviewer's report, and the worker would still open the file for each πŸ”΄ or 🟑 it fixes. A third of the report volume is the comprehension seats', whose votes and places the worker copies into the history. File reads fill more of the worker's context: `sed -n` output is 30% of its Bash results and `grep` output 11%, which `reading-cost` targets.