diff --git a/AGENTS.md b/AGENTS.md index 7a1e3b6a..d904f846 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,11 +6,13 @@ Decisions live in `docs/decisions.md`: - loop-claude: a judge decides interrupts, not the worker's self-report - loop-claude: one session per project, at a fixed id - loop-claude: the trust file is rewritten before an interrupt -- loop-claude: a reload into an older file is unsupported - loop-claude: a wrong-shape trust file gets one message, naming the shape +- bin/: the Python floor is README's Install prerequisite - bin/: host python, no container -- comprehension floor: the 2026-09-25 four-seat score is the ratchet, and 0.1.0 waits on what caps it -- larv-review: a re-entered loop takes a fresh round cap +- comprehension floor: every dimension and the overall at 7.0 or above, and 0.1.0 waits on it +- loop-claude: the five section headers stay - vocabulary: the concept words are defined under `CLAUDE.md` โ†’ "Vocabulary" and cited by a bare link +- larv-review: a re-entered loop takes a fresh round cap +- loop-claude: a reload into an older file is unsupported - loop-claude: a CR-only README.md is reported at line 1 - loop-claude: each project's model lives in loop-claude's own file diff --git a/CHANGELOG.md b/CHANGELOG.md index d1a03830..340f37e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,3 +14,4 @@ - `loop-claude` runs every claude it starts, the interrupt included, on the project's model, saved in `~/.claude/loop-claude-models.json`. A project without an entry is asked for one on the terminal, from Claude Code's model catalog, and exits 2 without a terminal; delete the entry to pick again. `LOOP_CLAUDE_WORKER_MODEL` and `LOOP_CLAUDE_JUDGE_MODEL` override it; with both set, nothing is asked. - `settings.json`, the agents and the status line run on any machine unedited; the status line shows reset times in the machine's own time zone. - `loop-claude`'s no-premises exit names what is wrong: `README.md` unopenable or not UTF-8, a `## Goals` or `## Audience` heading missing or repeated, or nothing under one. +- `bin/` runs on Python 3.11 or newer. diff --git a/README.md b/README.md index 97e6dcb3..1163dfcb 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Me, on my own machines, which take tagged releases. Nobody else depends on it. ## Install -Check out the latest tag in `~/.claude`. Link the tool onto `PATH`: `ln -s ~/.claude/bin/loop-claude ~/.local/bin/loop-claude`. +Check out the latest tag in `~/.claude`, with Python 3.11 or newer as `python3` on `PATH`. Link the tool onto `PATH`: `ln -s ~/.claude/bin/loop-claude ~/.local/bin/loop-claude`. ## Release @@ -25,7 +25,7 @@ Rename `## Unreleased` in `CHANGELOG.md` to the version, commit, and tag that co - `loop-claude ` runs a project's next chunk cycle after cycle; `loop-claude --help` states its contract. -Test: `python3 -m unittest discover -s bin -p 'test_*.py'` +Test, with `uv` on `PATH`: `python3 -m unittest discover -s bin -p 'test_*.py'` ## Tracking a new file diff --git a/agents/review-protocol.md b/agents/review-protocol.md index 7638993c..2f52e4d2 100644 --- a/agents/review-protocol.md +++ b/agents/review-protocol.md @@ -28,7 +28,7 @@ A review's first line, derived mechanically from the findings: ## Declining -Anything below ๐Ÿ”ด the caller may decline where the reason is sound, sits consistently with the repo's goals, and confidence is very high; the decline, its reason and the goal it rests on go to `docs/decisions.md`. A reason that contradicts a goal, or that no goal speaks to and you are not confident in, is a gap in the goals: propose the goal or rule that settles the whole class, show what falls out of it for this instance, and take the human's answer โ€” or fix the finding. Never a silent drop, and never a decline argued from convenience or the size of the fix. +Anything below ๐Ÿ”ด the caller may decline where the reason is sound, sits consistently with the repo's goals, and confidence is very high; the decline, its reason and the goal it rests on go to `docs/decisions.md`. A reason that contradicts a goal, or that no goal speaks to and you are not confident in, is a gap in the goals, taken per `~/.claude/CLAUDE.md` โ†’ "Working loop", "Ask, don't guess" โ€” or fix the finding. Never a silent drop, and never a decline argued from convenience or the size of the fix. A reviewer honours an accepted risk in `docs/decisions.md` and a finding declined this way: it stays declined and is not raised again. diff --git a/bin/test_python_floor.py b/bin/test_python_floor.py new file mode 100644 index 00000000..1c5e0ef4 --- /dev/null +++ b/bin/test_python_floor.py @@ -0,0 +1,23 @@ +import pathlib +import re +import shutil +import subprocess +import sys +import unittest + +ROOT = pathlib.Path(__file__).resolve().parents[1] +FLOOR = re.compile(r"Python 3\.(\d+) or newer") + + +class PythonFloor(unittest.TestCase): + def test_the_suite_passes_on_the_python_the_readme_names_as_floor(self): + named = FLOOR.search((ROOT / "README.md").read_text(encoding="utf-8")) + self.assertIsNotNone(named, "README.md's Install names `Python 3.N or newer`") + floor = (3, int(named.group(1))) + if sys.version_info[:2] == floor: + self.skipTest("this run is on the floor") + if shutil.which("uv") is None: + self.fail("uv on PATH fetches the floor interpreter; see README.md's Test line") + suite = ["python", "-m", "unittest", "discover", "-s", "bin", "-p", "test_*.py"] + ran = subprocess.run(["uv", "run", "--no-project", "--python", "%d.%d" % floor, *suite], capture_output=True, cwd=ROOT, text=True) + self.assertEqual(ran.returncode, 0, ran.stderr) diff --git a/docs/decisions.md b/docs/decisions.md index 9a7485e7..4ba36ae2 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -18,15 +18,23 @@ ## loop-claude: a wrong-shape trust file gets one message, naming the shape -2026-09-26, larv-review, declining a product-owner nit. Serves goal 4 through the comprehension floor below. `trust` says `not an object whose "projects" maps paths to objects` for every wrong shape; naming the failing path would add a branch to `trust`, the unit three of four seats least want to modify, and the interrupt still lands in Claude Code's own dialog. Valid while `trust` caps the floor. +2026-09-26, larv-review, declining a product-owner nit. Serves goal 4. `trust` says `not an object whose "projects" maps paths to objects` for every wrong shape; naming the failing path would add a branch to `trust`, and the interrupt still lands in Claude Code's own dialog, which shows the path. The 2026-09-25 panel's `trust` as the unit least wanted to modify was the first reason; the 2026-09-26 panel named `typed`, so the entry rests on the dialog. Valid while the interrupt lands in that dialog. + +## bin/: the Python floor is README's Install prerequisite + +2026-09-26, larv-review, carrying the floor the 2026-09-26 stability round assumed and verified its f-string fix under. Serves goal 1. The suite reruns itself on a `uv`-fetched interpreter of the version Install names: `ast.parse(feature_version=)` on the host's Python accepts the nested f-string 186181a fixed, a compile check passes a 3.11-only call like `contextlib.chdir`, and a `python3.N` on `PATH` is installed by hand on every machine and again at each bump. Valid while no machine taking the checkout ships an older Python. ## bin/: host python, no container 2026-09-24, larv-review. Serves goals 1 and 4. The tools drive the host's claude CLI and read the host's session files, which a container cannot see; the tests run the same way. Valid while claude runs on the host. -## comprehension floor: the 2026-09-25 four-seat score is the ratchet, and 0.1.0 waits on what caps it +## comprehension floor: every dimension and the overall at 7.0 or above, and 0.1.0 waits on it -2026-09-25, larv-review, carrying lilleman's 2026-09-24 target of every dimension at 7.0 or above. Serves goal 4. Junior A, Mid A, the maintainability senior and the inherited architect, depth 1 over every non-test file, blind to `todo.md` and this log: Navigation 8.0, Locality 6.0, Shape 7.0, Self-sufficiency 6.5, overall 7.0; on 2026-09-24 they were 8.0, 5.75, 7.5, 6.0, 6.75. Every seat scored Locality 6 and every overall sits on that cap; three of four named `trust` as the unit they would least want to modify. Shape fell 0.5 on the flat 36-name namespace in `bin/loop-claude`, the 18-item bar in `agents/systems-architect.md` and `trigger` meaning three things. The places named sit in `todo.md` under 0.1.0, and a later chunk may not lower any dimension. 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-26 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.75, Locality 6.25, Shape 7.0, Self-sufficiency 6.75, overall 6.75; on 2026-09-25 they were 8.0, 6.0, 7.0, 6.5, 7.0. Every overall sits on the Locality cap, and three of four seats named `typed` as the unit they would least want to modify. The chunk that ran it shipped under the floor by lilleman's decision of 2026-09-27; the places named sit in `todo.md` under 0.1.0, and a later chunk may not lower any dimension. Valid until the next scoring run, which uses the same four seats. + +## loop-claude: the five section headers stay + +2026-09-26, larv-review, declining a prose-pass deletion under `CLAUDE.md` โ†’ "Comments and documentation". Serves goal 4. Two seats of the 2026-09-26 panel credit Navigation 8 to `# The transcript file` and its four siblings indexing the script by the Claude Code internal each group touches. Valid until a scoring run scores Navigation without them. ## vocabulary: the concept words are defined under `CLAUDE.md` โ†’ "Vocabulary" and cited by a bare link diff --git a/principles/README.md b/principles/README.md deleted file mode 100644 index 194b7ab2..00000000 --- a/principles/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Principles - -The technical principles the reviewer agents in `../agents/` hold every project to. - -Each applies them through its own lens: -- `../agents/stability-reviewer.md` โ€” enforces them at code level, per PR. -- `../agents/systems-architect.md` โ€” treats them as baseline constraints on every design. -- `../agents/product-owner-reviewer.md` โ€” checks the externally-visible ones (`rest-apis.md`, `frontend.md`, and what surfaces from `technical-principles.md`) from the customer's perspective. diff --git a/principles/frontend.md b/principles/frontend.md index 2f54420c..ec4895eb 100644 --- a/principles/frontend.md +++ b/principles/frontend.md @@ -1,9 +1,5 @@ # Frontend principles -Follow all of them. The two groups below are for orientation, not permission to skip the -second one: **foundational stances** are structural bets that are expensive to reverse; -**quality attributes** are the -ilities and UX outcomes you uphold continuously. - General principles (KISS, DRY, โ€ฆ) live in `technical-principles.md` and apply here too. ## Foundational stances diff --git a/principles/logging.md b/principles/logging.md index 45b5bdd1..236c53e0 100644 --- a/principles/logging.md +++ b/principles/logging.md @@ -4,7 +4,7 @@ Log levels have a standard, RFC5424: { emerg: 0, alert: 1, crit: 2, error: 3, warning: 4, notice: 5, info: 6, debug: 7 }. -We follow a simplified variant (sadly with non-matching numbers atm): +We follow a simplified variant: * **0: Error** - Crash or equivalent catastrophe that needs fairly immediate action. * **1: Warning** - The app works, for now, but something is wrong and needs to be fixed. diff --git a/skills/comprehension-panel/SKILL.md b/skills/comprehension-panel/SKILL.md index 3bca6465..016b6bc6 100644 --- a/skills/comprehension-panel/SKILL.md +++ b/skills/comprehension-panel/SKILL.md @@ -64,7 +64,7 @@ handful of units with the files around them. **3. Full sweep, on request.** Every line, tests included, in as many passes as it takes. Slow and expensive, and the only depth that can say a place is clear because somebody read it. Reserve it for a deliberate in-depth audit โ€” a number about to be published, a handover being priced, a -sampled score under dispute. A review gate never runs it: gates run depth 1 or 2. +sampled score under dispute. ## The seats @@ -240,5 +240,4 @@ it apart; it does not by itself prove a ceiling worthless against future drift. Panelists also surface real defects in passing โ€” dead values, unstated invariants, doc gaps. Verify each in the code yourself before reporting it; a panelist's incidental claim is a lead, not -a finding. Everything that survives lands where the project's own working loop puts findings โ€” a -plan item under a release, a decision entry โ€” never in chat alone. +a finding. Everything that survives lands per `~/.claude/CLAUDE.md` โ†’ "Working loop". diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index 04b10f8b..594ca675 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -17,7 +17,7 @@ Words: `~/.claude/CLAUDE.md` โ†’ "Vocabulary". Verdicts, severities, round caps, - Someone else's PR, or the user asked for opinions only โ†’ single stability pass, report findings, done (skip shipping, fixing, the loops and the merge). - Prose only โ€” markdown, docs, comments, no code โ€” โ†’ the reviewer loops add nothing: ship the branch (ยง1), the prose pass (ยง8), green gate (ยง9), merge (ยง11). Say so in the summary. Prose an outside reader lands on โ€” public API docs, README, CHANGELOG, error or deprecation text โ€” still takes ยง6's product-owner pass. - Issue trackers are project-specific โ€” the project's own docs say whether it has one. When it does and the work has a ticket, follow that tracker's conventions for assignment and status. -- **Nothing merges and nothing is reported done without premises**, which `~/.claude/CLAUDE.md` โ†’ "Working loop" holds all planned work on. Premises missing, or too vague to settle a decision โ†’ this chunk cannot be judged: stop, say so, and write them with the user as the chunk instead. That chunk's whole review is the human's approval, since a reviewer's findings on it could only be declined by citing the goals it exists to write; a later change to a goal takes the full review. The same content in `AGENTS.md`, in `docs/` or in a decision log does not satisfy it, and neither does an earlier chunk having passed it. Only what that section lets through without them reaches review. +- **Premises first**, per `~/.claude/CLAUDE.md` โ†’ "Working loop". Missing, or too vague to settle a decision โ†’ this chunk cannot be judged: stop, say so, and write them with the user as the chunk instead. That chunk's whole review is the human's approval, since a reviewer's findings on it could only be declined by citing the goals it exists to write; a later change to a goal takes the full review. Only what that section lets through without them reaches review. ## 1. Ship the branch (idempotent โ€” skip whatever already exists) @@ -65,7 +65,7 @@ Run the built-in **`/security-review`** skill over the branch diff. It is the pa - **HIGH** โ†’ verify it is real, then fix it before this chunk ships: inside this chunk's blast radius it is fixed here, outside it on its own branch and PR with this chunk waiting behind it. Say which. A verified HIGH is never filed for later and never put to the human as a question. Verification showing it is not real is no decline but a disproof โ€” record what disproved it, since a finding that is factually wrong needs no goal to reject. - **MEDIUM** โ†’ fix in this chunk, under the protocol's Declining section. - **LOW** โ†’ treat as a ๐ŸŸข. -- A **MEDIUM or LOW** outside this chunk's scope โ†’ a `todo.md` item at the top under `## Security`, naming the exposure and the path it reaches, per `~/.claude/CLAUDE.md` โ†’ "Todo items". Say whether it is in this chunk's blast radius; filing it is not fixing it. +- A **MEDIUM or LOW** outside this chunk's scope โ†’ a `todo.md` item per `~/.claude/CLAUDE.md` โ†’ "Todo items"; filing it is not fixing it. **Escalate to a full scan** โ€” the `claude-security` plugin (`/claude-security` โ†’ "Scan changes"), first-party and agent-verified โ€” when the change touches authn/authz, secrets or crypto, a new untrusted-input boundary, or a new external surface. Same shape of judgment as ยง2's trigger: a signal with no record behind it, and a user reachable, is an ask. The plugin is not enabled by default; unavailable โ†’ say so in the summary rather than substituting a hand-rolled pass. diff --git a/statusline.sh b/statusline.sh index a5edcdef..3ec20c86 100755 --- a/statusline.sh +++ b/statusline.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# Claude Code status line. Input: statusline JSON on stdin. set -uo pipefail input=$(cat) @@ -40,7 +39,6 @@ humanize_tokens() { fi } -# " 2h15m left (01:23)" for a reset epoch. Weekday shown when it lands on another day. reset_suffix() { local epoch=$1 secs at fmt epoch=$(printf '%.0f' "$epoch") diff --git a/todo.md b/todo.md index 48402339..0df7d6dc 100644 --- a/todo.md +++ b/todo.md @@ -1,7 +1,38 @@ # todo +## Security + +- Write `~/.claude.json` in `trust` and the models file in `bin/loop-claude` back with their own mode, today each staged copy takes the process umask, so a 0600 `~/.claude.json` holding the account email comes back 0644. + ## 0.1.0 -Ordered by how many seats of the 2026-09-25 scoring panel (`docs/decisions.md`) named the place; each is one chunk. +Ships when a four-seat scoring run puts every dimension and the overall at 7.0 or above (`docs/decisions.md`). Ordered by the dimension each item lifts, lowest first, per the 2026-09-26 panel; each is one chunk. -- State in `docs/decisions.md` the oldest Python `bin/` must parse on, today unstated and 3.11 by the last review. +Locality, 6.25: + +- Build and validate the reload state in one unit, today spelled in `main`, `reload_if_edited` and `reloaded_state`. +- Return every failure to `main` and exit only there, today `run_cycle`, `reloaded_state`, `checkout_root`, `read_premises`, `judge` and the models file exit from leaves. +- Put the three-strikes rule in one place, today `main` for the worker and `judge` for the judge. +- Say in `run_cycle` that the interrupt appends to the transcript under the loop and that `archive` skips a stamp already written, today inferred from `archive`. +- Name each clause of `typed` for the entry kind it drops, so one edit cannot silently change what both `human_turns` and `render` see. + +Self-sufficiency, 6.75: + +- Record in `docs/decisions.md` why every worktree of the checkout is trusted before an interrupt. +- Say at `judge` what `--tools ""` and `--no-session-persistence` buy, and at `archive` why the stamp is the transcript's mtime. +- Give `worker` and `judge` Vocabulary entries, and the interrupt one spelling across `ask`, `needs input` and `interrupt`. +- Reword `CHANGELOG.md` โ†’ `## Unreleased` so no line restates `loop-claude --help`. + +Shape, 7.0: + +- Rename `granted` in `trust` for the paths it holds before the write, and `model` and `project` for what they return. +- Move `agents/review-protocol.md` out of `agents/`, beside what binds to it. +- Split `larv-review` ยง7 so a fix's re-entry reads without the whole skill open. +- Keep the fits-in-a-head thresholds in one place in `agents/systems-architect.md`, today four. + +Then: + +- Gate the comprehension floor in `larv-review` ยง3 on every dimension and the overall at 7.0 or above, today the overall alone. +- Fold `CLAUDE.md` โ†’ "One spelling per goal"'s prose-copy bullet into "Comments and documentation", today both say a copy is deleted. +- Close every file `bin/loop-claude` and `bin/test_loop_claude.py` open, so the suite runs without a ResourceWarning. +- Rerun the four-seat panel and score every dimension and the overall at 7.0 or above; a dimension under it gets its places filed above and this item stays last.