Plan item 73: measure first, then choose between write access and a wrapper #227

Merged
lilleman merged 2 commits from item-73-detail into main 2026-10-08 19:47:22 +02:00
+9
View File
@@ -61,6 +61,15 @@ The human ranks review cost first, and wants the project as a whole measured, si
The human ranks review cost first. Across 54 archived chunks the worker's own thread was 54% of spend, mostly cache reads: its context averaged about 350k tokens a turn and peaked near 700k, filled by reviewer reports, each of which arrived twice (the spawn result and the task notification).
The reports would live in the session's scratchpad, such as `<scratchpad>/larv-review/prose-round-1.md`, so no project's checkout sees them, and round counting and the `Answer <pass> round <n>:` commits stay as they are. A later round gets the path of that pass's earlier report in place of the findings pasted in. The worker opens the file only for the findings it fixes.
Measure first, from loop-claude's archive: how often a report still reaches the worker twice (PR #226's prose report, on 2026-10-08, arrived once), and how much of each report the worker acts on. Then choose how a report reaches the file:
- **Write access.** Grant each reviewer Write. No reviewer under `agents/` holds it today, and an agent's tool list cannot confine Write to one folder. Check whether a PreToolUse hook can tell a subagent's call from the worker's and deny a Write outside the scratchpad; without such a hook, only the prompt keeps its writes inside the scratchpad.
- **A wrapper.** A general-purpose subagent launches the reviewer with its tools unchanged, saves the report and returns only the summary lines. Claude Code's documentation says a subagent cannot start another; drop this route unless a test shows one can.
This risks goal 1.1: a worker fixing from a one-line summary can miss context it needs.
### 77. Measure each project with cheap static metrics — cognitive complexity, how far a change spreads, state shared or mutated across methods — and keep only those the panel's history shows tracking comprehension.
The human wants these explored and benched against the panel, with a global push toward a good state in every project. Candidates: cognitive complexity per function; how far a change spreads (files and modules a typical chunk touches, and files that change together in git history); state shared or mutated across methods (fields written by more than one method of a type, package-level variables written outside init, lack of cohesion between methods). Function and file length are warnings to look into, never limits: a plain long function can be simple, and a hard one may need five-line pieces. One harness under `bin/` serves every project; which metrics a project tracks may differ by project.