Answer the architecture and stability reviews' first round: exempt rows, restored item 6, retired decisions
This commit is contained in:
@@ -17,8 +17,6 @@ Decisions live in `docs/decisions.md`:
|
||||
- loop-claude: a `claude` that cannot start is a failed worker run, retried
|
||||
- review: an ask no user answers leaves the PR unmerged
|
||||
- loop-claude: every claude it starts bypasses permissions inside its sandbox
|
||||
- loop-claude: the planned stats line goes in the transcript archive, off the remote
|
||||
- workflow changes: once the bench runs, a change merges only after three benches rule it better
|
||||
- review: `/security-review` is the security pass of record
|
||||
- review: the premises chunk's whole review is the human's approval
|
||||
- workflow-bench/: the remote may show the bench cases' names and commit SHAs
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
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.
|
||||
- **Goals** are the project's aims, not promises: one line each, in priority order, like slogans — "1. Blazing fast performance. 2. Correctness is more important than many features." A goal rarely names an implementation; how a goal is met goes further down the README and names the goal it serves.
|
||||
- **Goals** are the project's aims, not promises: one numbered line each, in priority order, a sub-goal indented under its goal, like slogans — "1. Blazing fast performance. 2. Correctness is more important than many features." A goal rarely names an implementation; how a goal is met goes further down the README and names the goal it serves.
|
||||
- **Audience** names who depends on the project and what they may rely on.
|
||||
- **Plan `todo.md` as one scored table** ("Todo items"): every item names the release that ships it. If `todo.md` has another shape, reshaping it is the chunk, and the human approves it.
|
||||
- **When the next release has no items and no work has landed towards it, plan it as this chunk.** Weigh the unscheduled items against the goals, put them in order, and get the human's approval before writing any code.
|
||||
- **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, what is unreleased (`CHANGELOG.md` → `## Unreleased`, or else the log since the last tag), and the release this chunk ships into. A repo that publishes nothing says so once.
|
||||
- **Work one chunk at a time, and make it as large as one purpose allows.** Every review has a fixed cost, so a chunk takes the next plan item plus every other item for which three things hold: one PR title states what they achieve together, without listing them; they sit under one release; and they fire the same review passes (`larv-review` §3). Tiny items, a few lines of change each, need neither a shared purpose nor the same passes: bundle up to ten from one release into one chunk. Split a milestone into items in `todo.md` before starting it. Fix a finding in the chunk's own change within the chunk. File a finding about anything else in `todo.md`, scored, unless it scores under the bar.
|
||||
@@ -19,16 +19,16 @@ How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The
|
||||
- **Releases follow semver read strictly** (`~/.claude/principles/technical-principles.md`).
|
||||
|
||||
### Todo items (`todo.md`, tickets, plans)
|
||||
- **`todo.md` is mandatory in every project, in one shape**, which `~/.claude/bin/rank_todo.py` checks and ranks (its `--help` states the format): `## Scoring` holds the formula, the bar and the goal weights; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. The formula, bar and weights are the project's own to tune.
|
||||
- **`todo.md` is mandatory in every project, in one shape**, which `~/.claude/bin/rank_todo.py` checks and ranks (its `--help` states the format): `## Scoring` holds the formula, the bar and the goal weights; `## Items` is one table of every item; `## Details` holds each item's detail under its ID. A new item takes the next unused ID, never a deleted one's; cite an item by its ID. The formula, bar and weights are the project's own to tune.
|
||||
- **Score an item when it is filed or edited, then run `rank_todo.py`.** A deletion needs no run. Each score is a whole number from 1 to 10:
|
||||
- **R** — the risk that the change creates serious bugs or issues.
|
||||
- **S** — the size of the change.
|
||||
- **A** — its value to the audience in `README.md` → `## Audience`.
|
||||
- **G** — its value to the goals it cites in the Goals column; W is the weight of the heaviest of them.
|
||||
- **An item scoring under the bar is not kept:** a finding under it is named in the chunk's summary, not filed, and an item that falls under it is deleted.
|
||||
- **Goal weights default to position:** W = (n + 1 − p) / n for the goal on line p of n numbered goals and sub-goals under `## Goals`. `rank_todo.py` prints that table whenever the weights stop listing the README's goals.
|
||||
- **An item scoring under the bar is not kept, unless its Exempt cell says why:** `security` for a security finding, `question` for a question only the human can answer, `decision` for an item a decision in `docs/decisions.md` names. Otherwise a finding under the bar is named in the chunk's summary, not filed, and an item that falls under it is deleted, together with any item that needs it.
|
||||
- **Goal weights default to position, the first goal weighing most;** `rank_todo.py` prints that table whenever the weights stop listing the README's goals.
|
||||
- Open each item with a bold one-sentence tagline, so the taglines alone say what a release holds; detail follows it. The tagline states the target state, checkable when done: an imperative verb plus what holds afterwards. A present-tense fact reads as the current state and says nothing about what to do. Add "today X" only where the direction is otherwise ambiguous. GOOD: `**Accept undefined in MetadataValue and drop such keys on output.**` BANNED: `MetadataValue accepts undefined; such keys are dropped on output`.
|
||||
- A security finding — a leaked credential, secret or PII, an auth bypass, an injection — is filed the moment it is found, at the top of the list under its own `## Security` heading, naming the exposure and the path it reaches. Never among additive or nice-to-have items, never only in a chunk's summary, and never as a question about where it belongs: file it, say you did, and I will move it down if I disagree. Fixing it inside an unrelated change is a separate call — say whether it is in the blast radius.
|
||||
- A security finding — a leaked credential, secret or PII, an auth bypass, an injection — is filed the moment it is found, as a row marked `security`, which `rank_todo.py` ranks first in its release, naming the exposure and the path it reaches. Never among additive or nice-to-have items, never only in a chunk's summary, and never as a question about where it belongs: file it, say you did, and I will move it down if I disagree. Fixing it inside an unrelated change is a separate call — say whether it is in the blast radius.
|
||||
|
||||
## Quality
|
||||
|
||||
|
||||
+46
-18
@@ -4,20 +4,24 @@
|
||||
usage: rank_todo.py [--check] [todo.md]
|
||||
|
||||
Reads todo.md (default: ./todo.md) and the README.md beside it. Rewrites each item's Score from
|
||||
`Score = <formula>` under ## Scoring, sorts the ## Items table by release, then score from highest,
|
||||
then ID, and orders ## Details to match, each heading `### <ID>. <tagline>`. --check writes nothing
|
||||
and fails when the file is not ranked as it would be.
|
||||
`Score = <formula>` under ## Scoring, sorts the ## Items table by release, then exempt items first,
|
||||
then score from highest, then ID, and orders ## Details to match, each heading `### <ID>. <tagline>`.
|
||||
An item's Exempt cell is empty, or names why the bar does not apply to it: security, question or
|
||||
decision. --check writes nothing and fails when the file is not ranked as it would be.
|
||||
|
||||
Exit 1, saying why, when todo.md breaks the format, its goal weights do not list README.md's goals,
|
||||
an item scores under the `Bar = <number>` it states, or --check finds it unranked.
|
||||
an item that is not exempt scores under the `Bar = <number>` it states, judged on the Score as
|
||||
shown, or --check finds it unranked.
|
||||
"""
|
||||
import ast
|
||||
import dataclasses
|
||||
import math
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
|
||||
ITEMS_HEADER = "| ID | Release | Item | R | S | A | G | Goals | Score |"
|
||||
EXEMPTIONS = ("", "decision", "question", "security")
|
||||
ITEMS_HEADER = "| ID | Release | Exempt | Item | R | S | A | G | Goals | Score |"
|
||||
WEIGHTS_HEADER = "| Goal | W |"
|
||||
VARIABLES = ("A", "G", "R", "S", "W")
|
||||
|
||||
@@ -26,6 +30,7 @@ VARIABLES = ("A", "G", "R", "S", "W")
|
||||
class Item:
|
||||
id: int
|
||||
release: tuple[int, int, int]
|
||||
exempt: str
|
||||
tagline: str
|
||||
scores: dict[str, int]
|
||||
goals: tuple[str, ...]
|
||||
@@ -49,8 +54,8 @@ def main(argv: list[str]) -> int:
|
||||
text = todo.read_text(encoding="utf-8")
|
||||
readme = (todo.parent / "README.md").read_text(encoding="utf-8")
|
||||
ranked, under_bar = rank(text, readme_goals(readme))
|
||||
except (OSError, Malformed) as failure:
|
||||
print(f"{todo}: {getattr(failure, 'strerror', None) or failure}", file=sys.stderr)
|
||||
except (OSError, UnicodeDecodeError, Malformed) as failure:
|
||||
print(failure if isinstance(failure, OSError) else f"{todo}: {failure}", file=sys.stderr)
|
||||
return 1
|
||||
if check and ranked != text:
|
||||
print(f"{todo}: not ranked; run rank_todo.py on it", file=sys.stderr)
|
||||
@@ -70,13 +75,15 @@ def rank(text: str, goals: list[str]) -> tuple[str, list[str]]:
|
||||
weights = parse_weights(lines, goals)
|
||||
start, end = table_rows(lines, ITEMS_HEADER)
|
||||
items = [parse_item(row, weights) for row in lines[start:end]]
|
||||
if any(line.startswith("|") for line in section_lines(lines, end)):
|
||||
raise Malformed("## Items holds a row outside its table; keep the rows together under the header")
|
||||
if len({item.id for item in items}) < len(items):
|
||||
raise Malformed("two items share an ID")
|
||||
scored = sorted(((item, score(formula, item, weights)) for item in items), key=lambda pair: (pair[0].release, -pair[1], pair[0].id))
|
||||
scored = sorted(((item, score(formula, item, weights)) for item in items), key=lambda pair: (pair[0].release, not pair[0].exempt, -pair[1], pair[0].id))
|
||||
lines[start:end] = [render_item(item, value) for item, value in scored]
|
||||
text = "\n".join(lines)
|
||||
text = rank_details(text, [item for item, _ in scored])
|
||||
under_bar = [f"item {item.id} scores {value:.1f}, under the bar {bar:g}; rescore it or delete it" for item, value in scored if round(value, 1) < bar]
|
||||
under_bar = [f"item {item.id} scores {value:.1f}, under the bar {bar:g}; rescore it or delete it" for item, value in scored if not item.exempt and round(value, 1) < bar]
|
||||
return text, under_bar
|
||||
|
||||
|
||||
@@ -87,13 +94,15 @@ def readme_goals(readme: str) -> list[str]:
|
||||
raise Malformed("README.md has no ## Goals")
|
||||
goals: list[str] = []
|
||||
path: list[tuple[int, str]] = []
|
||||
for indent, number in re.findall(r"^( *)(\d+)\. ", section.group(1), re.M):
|
||||
for indent, number in re.findall(r"^([ \t]*)(\d+)\. ", section.group(1).expandtabs(4), re.M):
|
||||
while path and path[-1][0] >= len(indent):
|
||||
path.pop()
|
||||
path.append((len(indent), number))
|
||||
goals.append(".".join(part for _, part in path))
|
||||
if not goals:
|
||||
raise Malformed("README.md's ## Goals has no numbered goal")
|
||||
if len(set(goals)) < len(goals):
|
||||
raise Malformed(f"README.md's ## Goals numbers {', '.join(goals)}; number each goal by its position")
|
||||
return goals
|
||||
|
||||
|
||||
@@ -146,14 +155,20 @@ def evaluate(node: ast.AST, values: dict[str, float]) -> float:
|
||||
|
||||
def score(formula: ast.Expression, item: Item, weights: dict[str, float]) -> float:
|
||||
# An item serving several goals is weighed by the heaviest; summing them would reward citing more.
|
||||
return evaluate(formula, {**item.scores, "W": max(weights[goal] for goal in item.goals)})
|
||||
try:
|
||||
return evaluate(formula, {**item.scores, "W": max(weights[goal] for goal in item.goals)})
|
||||
except ZeroDivisionError:
|
||||
raise Malformed(f"the formula divides by zero for item {item.id}") from None
|
||||
|
||||
|
||||
def number(text: str, what: str) -> float:
|
||||
try:
|
||||
return float(text)
|
||||
value = float(text)
|
||||
except ValueError:
|
||||
raise Malformed(f"{what} {text!r} is not a number") from None
|
||||
value = math.nan
|
||||
if not math.isfinite(value):
|
||||
raise Malformed(f"{what} {text!r} is not a finite number")
|
||||
return value
|
||||
|
||||
|
||||
def parse_weights(lines: list[str], goals: list[str]) -> dict[str, float]:
|
||||
@@ -181,6 +196,14 @@ def table_rows(lines: list[str], header: str) -> tuple[int, int]:
|
||||
return start, end
|
||||
|
||||
|
||||
def section_lines(lines: list[str], start: int) -> list[str]:
|
||||
"""The lines from start up to the next ## heading."""
|
||||
end = start
|
||||
while end < len(lines) and not lines[end].startswith("## "):
|
||||
end += 1
|
||||
return lines[start:end]
|
||||
|
||||
|
||||
def cells(row: str, count: int) -> list[str]:
|
||||
found = [cell.strip() for cell in re.split(r"(?<!\\)\|", row.strip())[1:-1]]
|
||||
if len(found) != count:
|
||||
@@ -189,29 +212,31 @@ def cells(row: str, count: int) -> list[str]:
|
||||
|
||||
|
||||
def parse_item(row: str, weights: dict[str, float]) -> Item:
|
||||
id_, release, tagline, r, s, a, g, goals, _ = cells(row, 9)
|
||||
if not id_.isdigit() or int(id_) < 1:
|
||||
id_, release, exempt, tagline, r, s, a, g, goals, _ = cells(row, 10)
|
||||
if not re.fullmatch(r"[0-9]+", id_) or int(id_) < 1:
|
||||
raise Malformed(f"the ID {id_!r} is not a positive whole number: {row}")
|
||||
if not re.fullmatch(r"\d+\.\d+\.\d+", release):
|
||||
raise Malformed(f"item {id_}'s release {release!r} is not a semver version")
|
||||
if exempt not in EXEMPTIONS:
|
||||
raise Malformed(f"item {id_}'s Exempt {exempt!r} is not empty or one of {', '.join(EXEMPTIONS[1:])}")
|
||||
if not re.fullmatch(r"\*\*[^*].*[^*]\*\*", tagline):
|
||||
raise Malformed(f"item {id_}'s Item cell is not one bold tagline: {tagline}")
|
||||
scores = {}
|
||||
for name, value in zip("RSAG", (r, s, a, g)):
|
||||
if not value.isdigit() or not 1 <= int(value) <= 10:
|
||||
if not re.fullmatch(r"[0-9]+", value) or not 1 <= int(value) <= 10:
|
||||
raise Malformed(f"item {id_}'s {name} {value!r} is not a whole number from 1 to 10")
|
||||
scores[name] = int(value)
|
||||
cited = tuple(goal.strip() for goal in goals.split(","))
|
||||
if unknown := [goal for goal in cited if goal not in weights]:
|
||||
raise Malformed(f"item {id_} cites goal {', '.join(unknown)}, which the goal weights do not list")
|
||||
major, minor, patch = (int(part) for part in release.split("."))
|
||||
return Item(int(id_), (major, minor, patch), tagline, scores, cited)
|
||||
return Item(int(id_), (major, minor, patch), exempt, tagline, scores, cited)
|
||||
|
||||
|
||||
def render_item(item: Item, value: float) -> str:
|
||||
release = ".".join(str(part) for part in item.release)
|
||||
scores = " | ".join(str(item.scores[name]) for name in "RSAG")
|
||||
return f"| {item.id} | {release} | {item.tagline} | {scores} | {', '.join(item.goals)} | {value:.1f} |"
|
||||
return f"| {item.id} | {release} | {item.exempt} | {item.tagline} | {scores} | {', '.join(item.goals)} | {value:.1f} |"
|
||||
|
||||
|
||||
def rank_details(text: str, items: list[Item]) -> str:
|
||||
@@ -219,6 +244,9 @@ def rank_details(text: str, items: list[Item]) -> str:
|
||||
if section is None:
|
||||
return text
|
||||
body = section.group(1)
|
||||
# A fenced line such as "## Goals" or "### 2. x" would read as a heading and split a detail.
|
||||
if re.search(r"^ {0,3}(```|~~~)", body, re.M):
|
||||
raise Malformed("## Details holds a fenced code block; indent quoted markdown by four spaces instead")
|
||||
parts = re.split(r"^### (\d+)\. [^\n]*\n", body, flags=re.M)
|
||||
if parts[0].strip():
|
||||
raise Malformed("## Details holds text before its first ### <ID>. heading")
|
||||
|
||||
+33
-13
@@ -1,3 +1,5 @@
|
||||
import contextlib
|
||||
import io
|
||||
import pathlib
|
||||
import sys
|
||||
import tempfile
|
||||
@@ -26,11 +28,12 @@ TODO = """# todo
|
||||
|
||||
## Items
|
||||
|
||||
| ID | Release | Item | R | S | A | G | Goals | Score |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| 1 | 0.2.0 | **Ship the later thing.** | 1 | 1 | 9 | 9 | 1 | 0 |
|
||||
| 2 | 0.1.0 | **Tighten the tests.** | 2 | 4 | 5 | 5 | 2.1 | 0 |
|
||||
| 3 | 0.1.0 | **Make it fast.** | 3 | 8 | 6 | 8 | 2.1, 1 | 0 |
|
||||
| ID | Release | Exempt | Item | R | S | A | G | Goals | Score |
|
||||
|---|---|---|---|---|---|---|---|---|---|
|
||||
| 1 | 0.2.0 | | **Ship the later thing.** | 1 | 1 | 9 | 9 | 1 | 0 |
|
||||
| 2 | 0.1.0 | | **Tighten the tests.** | 2 | 4 | 5 | 5 | 2.1 | 0 |
|
||||
| 3 | 0.1.0 | | **Make it fast, `a \| b`.** | 3 | 8 | 6 | 8 | 2.1, 1 | 0 |
|
||||
| 4 | 0.1.0 | security | **Rotate the leaked key.** | 9 | 2 | 1 | 1 | 2.1 | 0 |
|
||||
|
||||
## Details
|
||||
|
||||
@@ -41,6 +44,10 @@ Later detail.
|
||||
### 3. Make it fast.
|
||||
|
||||
Fast detail.
|
||||
|
||||
## Notes
|
||||
|
||||
Kept as written.
|
||||
"""
|
||||
|
||||
|
||||
@@ -50,11 +57,12 @@ class Rank(unittest.TestCase):
|
||||
|
||||
def test_scores_and_sorts_by_release_then_score_and_orders_the_details_to_match(self):
|
||||
text, under_bar = self.ranked()
|
||||
self.assertIn("""| 3 | 0.1.0 | **Make it fast.** | 3 | 8 | 6 | 8 | 2.1, 1 | 23.0 |
|
||||
| 2 | 0.1.0 | **Tighten the tests.** | 2 | 4 | 5 | 5 | 2.1 | 10.3 |
|
||||
| 1 | 0.2.0 | **Ship the later thing.** | 1 | 1 | 9 | 9 | 1 | 34.8 |
|
||||
self.assertIn("""| 4 | 0.1.0 | security | **Rotate the leaked key.** | 9 | 2 | 1 | 1 | 2.1 | -6.8 |
|
||||
| 3 | 0.1.0 | | **Make it fast, `a \\| b`.** | 3 | 8 | 6 | 8 | 2.1, 1 | 23.0 |
|
||||
| 2 | 0.1.0 | | **Tighten the tests.** | 2 | 4 | 5 | 5 | 2.1 | 10.3 |
|
||||
| 1 | 0.2.0 | | **Ship the later thing.** | 1 | 1 | 9 | 9 | 1 | 34.8 |
|
||||
""", text)
|
||||
self.assertTrue(text.endswith("## Details\n\n### 3. Make it fast.\n\nFast detail.\n\n### 1. Ship the later thing.\n\nLater detail.\n"))
|
||||
self.assertTrue(text.endswith("## Details\n\n### 3. Make it fast, `a \\| b`.\n\nFast detail.\n\n### 1. Ship the later thing.\n\nLater detail.\n\n## Notes\n\nKept as written.\n"))
|
||||
self.assertEqual(under_bar, [])
|
||||
self.assertEqual(self.ranked(text), (text, []))
|
||||
|
||||
@@ -64,6 +72,9 @@ class Rank(unittest.TestCase):
|
||||
|
||||
def test_reads_goals_and_sub_goals_in_reading_order(self):
|
||||
self.assertEqual(rank_todo.readme_goals(README), ["1", "2", "2.1"])
|
||||
self.assertEqual(rank_todo.readme_goals(README.replace(" 1.", "\t1.")), ["1", "2", "2.1"])
|
||||
with self.assertRaises(rank_todo.Malformed):
|
||||
rank_todo.readme_goals(README.replace("2. Correct.", "1. Correct."))
|
||||
|
||||
def test_prints_the_positional_weights_when_they_stop_listing_the_readmes_goals(self):
|
||||
with self.assertRaises(rank_todo.Malformed) as raised:
|
||||
@@ -76,11 +87,16 @@ class Rank(unittest.TestCase):
|
||||
self.ranked(TODO.replace("-R - S/4 + 2*A + 2*G*W", formula))
|
||||
|
||||
def test_refuses_a_row_or_detail_off_the_format(self):
|
||||
row = "| 2 | 0.1.0 | | **Tighten the tests.** | 2 | 4 | 5 | 5 | 2.1 | 0 |"
|
||||
broken = {
|
||||
"| 2 | 0.1.0 | **Tighten the tests.** | 2 | 4 | 5 | 5 | 2.1 | 0 |": "| 2 | 0.1 | **Tighten the tests.** | 2 | 4 | 5 | 5 | 2.1 | 0 |",
|
||||
"| 3 | 0.1.0 | **Make it fast.** | 3 | 8 | 6 | 8 | 2.1, 1 | 0 |": "| 3 | 0.1.0 | Make it fast. | 3 | 11 | 6 | 8 | 7 | 0 |",
|
||||
"### 3. Make it fast.": "### 4. Make it fast.",
|
||||
"`Bar = 9`": "",
|
||||
row: row.replace("0.1.0", "0.1"),
|
||||
row + "\n": row.replace("5 | 5", "5 | ²") + "\n",
|
||||
"| 2.1 | 0 |\n\n## Details": "| 2.1 | 0 |\n\n| 9 | 0.1.0 | | **Stray.** | 1 | 1 | 1 | 1 | 1 | 0 |\n\n## Details",
|
||||
"| 4 | 0.1.0 | security |": "| 4 | 0.1.0 | later |",
|
||||
"Fast detail.": "```\n## Goals\n```",
|
||||
"### 3. Make it fast.": "### 5. Make it fast.",
|
||||
"`Bar = 9`": "`Bar = nan`",
|
||||
"-R - S/4 + 2*A + 2*G*W": "R / (S - 2)",
|
||||
}
|
||||
for old, new in broken.items():
|
||||
with self.subTest(new=new), self.assertRaises(rank_todo.Malformed):
|
||||
@@ -97,6 +113,10 @@ class Main(unittest.TestCase):
|
||||
self.assertEqual(todo.read_text(), TODO)
|
||||
self.assertEqual(rank_todo.main([str(todo)]), 0)
|
||||
self.assertEqual(rank_todo.main(["--check", str(todo)]), 0)
|
||||
pathlib.Path(temp, "README.md").unlink()
|
||||
with contextlib.redirect_stderr(io.StringIO()) as said:
|
||||
self.assertEqual(rank_todo.main([str(todo)]), 1)
|
||||
self.assertIn("README.md", said.getvalue())
|
||||
|
||||
|
||||
class ThisRepo(unittest.TestCase):
|
||||
|
||||
+3
-11
@@ -18,7 +18,7 @@
|
||||
|
||||
2026-09-24, lilleman, extending it to every worktree. `claude --resume` re-enters the worktree the worker last entered, recorded in the transcript's `worktree-state` entry, and Claude Code asks trust per path, so trusting the checkout alone still lands the human in the dialog; trusting every worktree `git worktree list` names spares reading which one from the transcript. Valid while resume re-enters a recorded worktree and trust is kept per path.
|
||||
|
||||
2026-09-30, lilleman: Claude Code owns and writes that file, so `loop-claude` is to move out of it, bringing each case that must stay to the human. Stands until `todo.md`'s "Move what `loop-claude` writes out of `~/.claude.json`" ends it.
|
||||
2026-09-30, lilleman: Claude Code owns and writes that file, so `loop-claude` is to move out of it, bringing each case that must stay to the human. Stands until `todo.md` item 6 ends it.
|
||||
|
||||
## bin/: the tests rerun themselves on a `uv`-fetched Python at README Install's floor
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
## comprehension floor: every dimension and the overall at 7.0 or above, and 0.1.0 waits on it
|
||||
|
||||
2026-09-27, lilleman, restating the 2026-09-24 target and extending it to the overall. Serves goal 4. The 2026-09-28 run, Junior A, Mid A, the maintainability senior and the inherited architect at depth 1 over every non-test file, blind to `todo.md` and this log, scored Navigation 7.25, Locality 6.0, Shape 6.5, Self-sufficiency 6.25, overall 6.25; on 2026-09-26 they were 7.75, 6.25, 7.0, 6.75, 6.75. Every seat scored Locality 6, and three of four named `run_cycle`'s three-way return and larv-review's re-entry rules, split across the passes on 2026-09-28. The same seats on `rebuild` scored 7.5, 6.63, 6.88, 6.5, 7.0 at 37edc9a, later that day, 7.5, 6.75, 6.88, 6.75, 7.0 at 7f9de5c, 7.38, 6.25, 6.88, 6.75, 6.88 at 2f9ab2f on 2026-09-29, Locality lowest again and every seat naming the reload state and the two retry counters, and 7.5, 7.0, 7.25, 6.75, 7.13 at 2c74bbc later that day, Self-sufficiency lowest and every seat naming the round's definition split across larv-review's two files, and 7.38, 6.75, 7.25, 6.5, 6.88 at 8585257 on 2026-10-01, lowering every dimension but Shape, and the overall, Self-sufficiency lowest and every seat naming larv-review §3's round rules; the places it named under Self-sufficiency and Locality are filed in `todo.md` under 0.1.0, and a later scoring run may not score any dimension or the overall below its best run on `rebuild`, 2026-10-01, lilleman. `rebuild` merged into main under the floor at 8585257's scores, 2026-10-01, lilleman. The 2026-10-01 run on PR #182 (the loop state machine) scored 7.5, 6.5, 6.88, 6.25, 6.38; lilleman shipped that PR under the floor and below `rebuild`'s best run the same day, its places filed in `todo.md` under 0.1.0. The 2026-10-02 run on PR #187 (`loop_claude`'s names, the exit contract) scored 7.75, 7.25, 7.38, 6.88, 7.25 at 70362d0, every seat naming larv-review §3 under Self-sufficiency, and 7.63, 7.13, 7.38, 7.0, 7.13 at 1971dba later that day, the first run at the floor, with no dimension or the overall below its best run on `rebuild`. The 2026-10-02 runs on PR #191 (the status line in Python) scored 7.5, 7.0, 7.13, 6.88, 7.13; 7.25, 6.75, 7.25, 6.88, 7.0; 7.63, 6.88, 7.38, 7.0, 7.13; and 7.63, 7.0, 7.25, 6.75, 7.25. Every seat rated the status line easy. The places they named under Locality and Self-sufficiency are filed in `todo.md` under 0.1.0, except `entries.py`'s heuristics over Claude Code's transcript format, which the seats scored as the problem's own difficulty. lilleman decided the same day to ship that PR under the floor. The 2026-10-02 runs on PR #194 (each cycle's transcript archived) scored 8.0, 7.25, 7.38, 7.13, 7.5 at 6ccd5b1 and 7.75, 7.13, 7.25, 7.0, 7.25 at d104ea0, both at the floor, every seat naming `archive` as the unit it would least want to modify. Valid until the next scoring run, which uses the same four seats.
|
||||
2026-09-27, lilleman, restating the 2026-09-24 target and extending it to the overall. Serves goal 4. The 2026-09-28 run, Junior A, Mid A, the maintainability senior and the inherited architect at depth 1 over every non-test file, blind to `todo.md` and this log, scored Navigation 7.25, Locality 6.0, Shape 6.5, Self-sufficiency 6.25, overall 6.25; on 2026-09-26 they were 7.75, 6.25, 7.0, 6.75, 6.75. Every seat scored Locality 6, and three of four named `run_cycle`'s three-way return and larv-review's re-entry rules, split across the passes on 2026-09-28. The same seats on `rebuild` scored 7.5, 6.63, 6.88, 6.5, 7.0 at 37edc9a, later that day, 7.5, 6.75, 6.88, 6.75, 7.0 at 7f9de5c, 7.38, 6.25, 6.88, 6.75, 6.88 at 2f9ab2f on 2026-09-29, Locality lowest again and every seat naming the reload state and the two retry counters, and 7.5, 7.0, 7.25, 6.75, 7.13 at 2c74bbc later that day, Self-sufficiency lowest and every seat naming the round's definition split across larv-review's two files, and 7.38, 6.75, 7.25, 6.5, 6.88 at 8585257 on 2026-10-01, lowering every dimension but Shape, and the overall, Self-sufficiency lowest and every seat naming larv-review §3's round rules; the places it named under Self-sufficiency and Locality are filed in `todo.md` under 0.1.0, and a later scoring run may not score any dimension or the overall below its best run on `rebuild`, 2026-10-01, lilleman. `rebuild` merged into main under the floor at 8585257's scores, 2026-10-01, lilleman. The 2026-10-01 run on PR #182 (the loop state machine) scored 7.5, 6.5, 6.88, 6.25, 6.38; lilleman shipped that PR under the floor and below `rebuild`'s best run the same day, its places filed in `todo.md` under 0.1.0. The 2026-10-02 run on PR #187 (`loop_claude`'s names, the exit contract) scored 7.75, 7.25, 7.38, 6.88, 7.25 at 70362d0, every seat naming larv-review §3 under Self-sufficiency, and 7.63, 7.13, 7.38, 7.0, 7.13 at 1971dba later that day, the first run at the floor, with no dimension or the overall below its best run on `rebuild`. The 2026-10-02 runs on PR #191 (the status line in Python) scored 7.5, 7.0, 7.13, 6.88, 7.13; 7.25, 6.75, 7.25, 6.88, 7.0; 7.63, 6.88, 7.38, 7.0, 7.13; and 7.63, 7.0, 7.25, 6.75, 7.25. Every seat rated the status line easy. The places they named under Locality and Self-sufficiency are filed in `todo.md` under 0.1.0, except `entries.py`'s heuristics over Claude Code's transcript format, which the seats scored as the problem's own difficulty. lilleman decided the same day to ship that PR under the floor. The 2026-10-02 runs on PR #194 (each cycle's transcript archived) scored 8.0, 7.25, 7.38, 7.13, 7.5 at 6ccd5b1 and 7.75, 7.13, 7.25, 7.0, 7.25 at d104ea0, both at the floor, every seat naming `archive` as the unit it would least want to modify. On 2026-10-02 the bar of `todo.md` purged the places these runs filed, except `todo.md` items 13 and 17. Valid until the next scoring run, which uses the same four seats.
|
||||
|
||||
## loop-claude: each project's model lives in `~/.claude/loop-claude-models.json`, which only loop-claude writes
|
||||
|
||||
@@ -64,14 +64,6 @@
|
||||
|
||||
2026-09-30, lilleman. Applies "Always grant explicit access to data": the sandbox `loop-claude` runs in is where access is granted, so the worker and the interrupt run with `bypassPermissions`. The worker may read `~/.claude/.credentials.json`: it holds Claude Code's own credentials, which claude reads to run anyway. Its one seam to production is the forge: what it pushes or merges can publish through CI. Valid while `loop-claude` runs only in the sandbox README → Install names.
|
||||
|
||||
## loop-claude: the planned stats line goes in the transcript archive, off the remote
|
||||
|
||||
2026-10-01, lilleman. Serves goals 3 and 4.4. The numbers show whether a change to the workflow raised quality or only cost. Each line names another project and its chunk, so the file stays off this repo's remote. `loop-claude` writes the line: the tokens, cycles and interrupts it counts, and the review's numbers from the summary larv-review ends with. Valid while the transcript archive stays off the remote.
|
||||
|
||||
## workflow changes: once the bench runs, a change merges only after three benches rule it better
|
||||
|
||||
2026-10-01, lilleman. 2026-10-02, lilleman: binding once `todo.md`'s "Bench about one chunk in ten against an open PR that changes the workflow" lands. Serves goals 4.1 and 4.4. The 2026-09-30 bench showed one run cannot tell a workflow's effect from the variance between runs. One bench ruling it worse closes the PR, since quality comes first (goal 4.1), and `docs/workflow-learnings.md` keeps what the PR changed and why it lost. Three is a starting number, to be evaluated against the stats. Valid until that evaluation changes the number.
|
||||
|
||||
## review: `/security-review` is the security pass of record
|
||||
|
||||
2026-09-20, lilleman. Serves goal 4.1. Its value is a tuned exclusion list and a ≥0.8 confidence floor, which a hand-written reviewer would reproduce worse. Valid while `/security-review` ships both.
|
||||
@@ -86,4 +78,4 @@
|
||||
|
||||
## todo.md: one table of items scored by the formula, bar and goal weights it states, ranked by `bin/rank_todo.py`
|
||||
|
||||
2026-10-02, lilleman. Serves goal 4: findings were filed faster than chunks closed them, so the plan grew without telling what mattered. Each item scores R (the risk the change creates serious bugs), S (size), A (value to the audience) and G (value to its goals, weighted by goal position); this repo's formula, `-R - S/4 + 2*A + 2*G*W`, 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. The format is mandatory in every project, as the premises are (goal 4.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. Valid while one human sets the bar and reads the ranking.
|
||||
2026-10-02, lilleman. Serves goal 4: findings were filed faster than chunks closed them, so the plan grew without telling what mattered. Each item scores R (the risk the change creates serious bugs), S (size), A (value to the audience) and G (value to its goals, weighted by goal position); this repo's formula, `-R - S/4 + 2*A + 2*G*W`, 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 to reach the human: a security finding, a question for the human, an item a decision names. The purge retired two decisions whose plans it removed: the stats line in the transcript archive, and three benches before a workflow change merges. `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 4.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. Valid while one human sets the bar and reads the ranking.
|
||||
|
||||
@@ -61,11 +61,11 @@ A comment is prose, not code. Passes run in this order: line-level polish on cod
|
||||
|
||||
**Findings.**
|
||||
|
||||
1. A finding outside the chunk's change, whatever its pass or severity, is scored per `~/.claude/CLAUDE.md` → "Todo items" and filed in `todo.md`, unless it scores under the bar; the summary names each one left out, with its score. A verified security HIGH is handled per "Security".
|
||||
2. A fix that would change a goal, or a decision the repo held before the chunk began, is asked; no user reachable → filed, the goal or decision left as is.
|
||||
1. A finding outside the chunk's change, whatever its pass or severity, is scored and filed in `todo.md` per `~/.claude/CLAUDE.md` → "Todo items"; one under the bar and not exempt is named in the summary with its score instead. A verified security HIGH is handled per "Security".
|
||||
2. A fix that would change a goal, or a decision the repo held before the chunk began, is asked; no user reachable → filed as a `question`, the goal or decision left as is.
|
||||
3. A 🔴 is fixed, or shown factually wrong, and what disproved it recorded per `~/.claude/CLAUDE.md` → "Decisions: one home, each linked to a goal or a technical principle": in a comment at the code the finding concerns, or in `docs/decisions.md` when it concerns more than one place. Never declined.
|
||||
4. A 🟡 is fixed, shown factually wrong like a 🔴, or declined. Decline one only where the reason is sound, consistent with the goals and the technical principles, and confidence is very high; the decline and its reason are recorded the same way. A reason neither speaks to is a gap in the goals: fix the finding, or ask per `~/.claude/CLAUDE.md` → "Working loop", "Ask, don't guess"; no user reachable → fix. Never drop one silently, and never decline one for convenience or the size of the fix.
|
||||
5. A 🟢 or ❓ is fixed, answered, declined in the summary with its reason, or filed. Answer one where the code, a test or a record settles it, and quote what in the summary. A ❓ only the user can answer is asked; no user reachable → filed.
|
||||
5. A 🟢 or ❓ is fixed, answered, declined in the summary with its reason, or filed. Answer one where the code, a test or a record settles it, and quote what in the summary. A ❓ only the user can answer is asked; no user reachable → filed as a `question`.
|
||||
6. A 🔀 runs the named pass once the current pass is done.
|
||||
7. Other reviewers map onto this scale: `/security-review`'s HIGH is 🔴, MEDIUM 🟡, LOW 🟢; what a forge's auto-reviewer marks blocking is 🔴. A finding of theirs repeating one declined or filed does not stand.
|
||||
|
||||
@@ -100,7 +100,7 @@ Launch prose-reviewer with what the diff touched and every section this review c
|
||||
|
||||
## 4. Gate
|
||||
|
||||
1. Run the project's test suite locally unless the last stability round already left it verified green.
|
||||
1. Run the project's test suite locally unless the last stability round already left it verified green, and `~/.claude/bin/rank_todo.py --check todo.md`.
|
||||
2. Watch the forge's checks until every one passes. A red check is a finding.
|
||||
3. No CI configured → the gate is local tests only; note it in the summary.
|
||||
4. Everything green → mark the PR ready, dropping any `WIP:`/`Draft:` title prefix.
|
||||
|
||||
@@ -20,28 +20,32 @@
|
||||
|
||||
## Items
|
||||
|
||||
| ID | Release | Item | R | S | A | G | Goals | Score |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| 1 | 0.1.0 | **Copy the transcript archive off the machine, or say in README how it is backed up.** | 3 | 5 | 8 | 9 | 2, 3 | 27.8 |
|
||||
| 2 | 0.1.0 | **Add a test that `.gitignore` keeps credentials, transcripts and memory files out.** | 1 | 2 | 6 | 9 | 3 | 24.5 |
|
||||
| 3 | 0.1.0 | **Wait out a usage limit and retry however long it lasts, without counting it as a failed run.** | 4 | 5 | 9 | 8 | 4 | 23.5 |
|
||||
| 7 | 0.1.0 | **Give the judge the project's recorded decisions, and ask it whether anything the project records settles a choice.** | 3 | 4 | 8 | 8 | 4.2 | 19.0 |
|
||||
| 9 | 0.1.0 | **Give principles-auditor and prose-reviewer a way to list the project's files.** | 1 | 2 | 5 | 7 | 4.1 | 16.3 |
|
||||
| 8 | 0.1.0 | **Judge a cycle on more than the transcript's last 40,000 characters.** | 4 | 5 | 7 | 8 | 4.2 | 15.8 |
|
||||
| 13 | 0.1.0 | **Make larv-review §3 applicable on its own, cite its rules by name, and say where a pass's round count is recorded.** | 3 | 5 | 6 | 7 | 4.1 | 15.6 |
|
||||
| 23 | 0.1.0 | **Launch a principles auditor only for a principles file the project shows applies, and rerun only the reviewer whose finding a fix answers.** | 3 | 4 | 7 | 8 | 4.4 | 13.5 |
|
||||
| 10 | 0.1.0 | **Give the reviewer agents only the tools they need.** | 1 | 1 | 4 | 6 | 4.1 | 13.5 |
|
||||
| 21 | 0.1.0 | **Give `settings.json`'s model one writer, and sort its keys.** | 3 | 3 | 6 | 7 | 4.3 | 12.9 |
|
||||
| 20 | 0.1.0 | **Enable the `claude-security` plugin in `settings.json`, or drop larv-review's full-scan row.** | 1 | 1 | 4 | 5 | 4.1 | 12.4 |
|
||||
| 12 | 0.1.0 | **Run the test suite in CI on every PR, or record in `docs/decisions.md` why the local run is enough.** | 2 | 4 | 4 | 6 | 4.1 | 11.7 |
|
||||
| 5 | 0.1.0 | **Key a project on its checkout's full path, and refuse to start while another session uses that key.** | 5 | 5 | 5 | 6 | 4.1 | 10.5 |
|
||||
| 4 | 0.1.0 | **Name each chunk's archive folder by the chunk's start time, so `<key>/` lists chunks in the order they ran.** | 3 | 2 | 4 | 3 | 2 | 9.8 |
|
||||
| 26 | 0.1.0 | **Write a `workflow-review` skill that reads the stats and files each change it proposes to the workflow as a plan item, and have `AGENTS.md` run it on the chunk shipping a release's last item.** | 2 | 6 | 5 | 6 | 4.4 | 9.1 |
|
||||
| 29 | 0.1.0 | **Make the small changes filed against the review's rules.** | 2 | 2 | 3 | 5 | 4.1, 4.4 | 9.1 |
|
||||
| 17 | 0.1.0 | **Make `JUDGE_RULES` and the Claude Code flags `loop-claude` passes readable without `CLAUDE.md` or Claude Code's docs open.** | 1 | 2 | 3 | 4 | 4.1 | 9.0 |
|
||||
| ID | Release | Exempt | Item | R | S | A | G | Goals | Score |
|
||||
|---|---|---|---|---|---|---|---|---|---|
|
||||
| 6 | 0.1.0 | decision | **Move what `loop-claude` writes out of `~/.claude.json`, and ask the human about each write that must stay.** | 5 | 5 | 4 | 5 | 4.1 | 7.4 |
|
||||
| 1 | 0.1.0 | | **Copy the transcript archive off the machine, or say in README how it is backed up.** | 3 | 5 | 8 | 9 | 2, 3 | 27.8 |
|
||||
| 2 | 0.1.0 | | **Add a test that `.gitignore` keeps credentials, transcripts and memory files out.** | 1 | 2 | 6 | 9 | 3 | 24.5 |
|
||||
| 3 | 0.1.0 | | **Wait out a usage limit and retry however long it lasts, without counting it as a failed run.** | 4 | 5 | 9 | 8 | 4 | 23.5 |
|
||||
| 7 | 0.1.0 | | **Give the judge the project's recorded decisions, and ask it whether anything the project records settles a choice.** | 3 | 4 | 8 | 8 | 4.2 | 19.0 |
|
||||
| 9 | 0.1.0 | | **Give principles-auditor and prose-reviewer a way to list the project's files.** | 1 | 2 | 5 | 7 | 4.1 | 16.3 |
|
||||
| 8 | 0.1.0 | | **Judge a cycle on more than the transcript's last 40,000 characters.** | 4 | 5 | 7 | 8 | 4.2 | 15.8 |
|
||||
| 13 | 0.1.0 | | **Make larv-review §3 applicable on its own, cite its rules by name, and say where a pass's round count is recorded.** | 3 | 5 | 6 | 7 | 4.1 | 15.6 |
|
||||
| 23 | 0.1.0 | | **Launch a principles auditor only for a principles file the project shows applies, and rerun only the reviewer whose finding a fix answers.** | 3 | 4 | 7 | 8 | 4.4 | 13.5 |
|
||||
| 10 | 0.1.0 | | **Give the reviewer agents only the tools they need.** | 1 | 1 | 4 | 6 | 4.1 | 13.5 |
|
||||
| 21 | 0.1.0 | | **Give `settings.json`'s model one writer, and sort its keys.** | 3 | 3 | 6 | 7 | 4.3 | 12.9 |
|
||||
| 20 | 0.1.0 | | **Enable the `claude-security` plugin in `settings.json`, or drop larv-review's full-scan row.** | 1 | 1 | 4 | 5 | 4.1 | 12.4 |
|
||||
| 12 | 0.1.0 | | **Run the test suite in CI on every PR, or record in `docs/decisions.md` why the local run is enough.** | 2 | 4 | 4 | 6 | 4.1 | 11.7 |
|
||||
| 5 | 0.1.0 | | **Key a project on its checkout's full path, and refuse to start while another session uses that key.** | 5 | 5 | 5 | 6 | 4.1 | 10.5 |
|
||||
| 4 | 0.1.0 | | **Name each chunk's archive folder by the chunk's start time, so `<key>/` lists chunks in the order they ran.** | 3 | 2 | 4 | 3 | 2 | 9.8 |
|
||||
| 29 | 0.1.0 | | **Make the small changes filed against the review's rules.** | 2 | 2 | 3 | 5 | 4.1, 4.4 | 9.1 |
|
||||
| 17 | 0.1.0 | | **Make `JUDGE_RULES` and the Claude Code flags `loop-claude` passes readable without `CLAUDE.md` or Claude Code's docs open.** | 1 | 2 | 3 | 4 | 4.1 | 9.0 |
|
||||
|
||||
## Details
|
||||
|
||||
### 6. Move what `loop-claude` writes out of `~/.claude.json`, and ask the human about each write that must stay.
|
||||
|
||||
Claude Code owns that file and writes it. `trust` reads it, changes it and writes it back, so a write that lands in between is lost.
|
||||
|
||||
### 1. Copy the transcript archive off the machine, or say in README how it is backed up.
|
||||
|
||||
It lives under `~/.claude`, which `.gitignore` keeps from the remote, so a lost disk loses every unattended run's record. Back it up only to a destination private to me and encrypted at rest: the worker runs with permissions bypassed, so the archived tool results can hold credentials it read.
|
||||
@@ -98,10 +102,6 @@ The key names the project's session, archive folder and models entry. `project_k
|
||||
|
||||
Today the folder is the SHA-256 of the transcript's first timestamped line, which tells the human nothing; that line carries the start time. Drop the fallback to the first line, which every chunk of a project shares, and give the tests' fake transcripts ISO timestamps.
|
||||
|
||||
### 26. Write a `workflow-review` skill that reads the stats and files each change it proposes to the workflow as a plan item, and have `AGENTS.md` run it on the chunk shipping a release's last item.
|
||||
|
||||
The workflow is `CLAUDE.md`, `principles/`, the skills, the agents and `loop-claude`. The skill's signals: findings outside the chunk's diff and comprehension scores per release, both from the stats; fixes after merge, from git; and the human's corrections, from the archived transcripts.
|
||||
|
||||
### 29. Make the small changes filed against the review's rules.
|
||||
|
||||
- Make the contributor a standing member of every project's audience. A project drops them only where its `## Audience` says maintainability does not matter. State that in `CLAUDE.md`'s goals-and-audience rule, and have larv-review's comprehension floor name the contributor as the reader it serves. The floor then gates every chunk while the contributor stands, and a project that drops them skips it.
|
||||
|
||||
Reference in New Issue
Block a user