From 5c82464042bff1249cf94d125e9e542125ba657e Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 15 Nov 2026 13:27:05 +0100 Subject: [PATCH] Read the large files by section: one awk call per section, titles for tests and legs, and reset the reading-cost trend --- AGENTS.md | 9 ++++++--- docs/reading-cost.md | 19 +++++++++++++++++++ todo.md | 9 --------- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 16c45a9..942272a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -181,13 +181,16 @@ Per chunk: the PR summary names each fix no round reviewed. 3. Merge the PR (standing authorization, this repo only, granted by the maintainer), report, stop. -A chunk reads these files in part, with `grep -n '^#'` for the headings and a ranged read for -the rest: +A chunk reads these files in part. One call prints a `## ` section by a fragment of its title: +`awk -v h='' '/^## /{p=index($0,h)>0} p' <file> | head -80`. - `CHANGELOG.md`: `## Unreleased` only, the one section a chunk edits. - `MIGRATION.md`: the top `## From` section, the release being built. - `README.md`: `## Goals`, `## Audience` and the sections the chunk changes or cites. -- `spec/flavour.md`: the sections the chunk changes or cites. +- `docs/decisions.md`: the entries the chunk cites, found by the titles indexed above, never the file. +- `spec/flavour.md`, `spec/html.md`: the sections the chunk changes or cites. +- A test file or `ci.sh`: its titles or legs, from `grep -n '^test(\|^leg' <file> | cut -c1-110`, + then a ranged read of the ones the chunk touches. Reserved for the maintainer whatever any rule here says: changing `version` in `package.json` (a bump on `main` publishes, `docs/decisions.md` §Publish on a version bump — every release is the diff --git a/docs/reading-cost.md b/docs/reading-cost.md index 8df50aa..d913977 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -1144,3 +1144,22 @@ Read most (opens and searches): - `README.md` 8 - `docs/feature-table.md` 8 - `src/html/emit/adf-to-html.ts` 7 + +## Reading cost, chunk 8c9a535ea3b1, finished 2026-11-15T12:25:26Z + +200626 new input tokens before the first commit. + +Read most (opens and searches): + +- `docs/decisions.md` 9 +- `src/html/parse/html-to-adf.test.ts` 9 +- `spec/html.md` 8 +- `README.md` 7 +- `MIGRATION.md` 6 +- `src/html/parse/inline.ts` 4 +- `CHANGELOG.md` 3 +- `src/html/cell-element.ts` 3 +- `src/html/escaping.ts` 3 +- `src/html/mark-elements.ts` 3 + +## Reading cost reset, 2026-11-15T12:26:57Z diff --git a/todo.md b/todo.md index f9e8f4d..3d36481 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 189 | 0.4.0 | | | **Lower the reading cost of the files a chunk reads most before its first commit.** | 2 | 1 | 1 | 2 | 3 | code health by 3 | 15.9 | | 46 | 0.4.0 | | | **Publish the bundle size in the README, failing the release pipeline when it drifts.** | 2 | 2 | 1 | 3 | 4 | 3 by 3 | 2.6 | | 174 | 0.4.0 | | defect | **Bound the passes `trimmedEdges` takes by a constant, so a line of alternating code and emphasized blanks trims in linear time.** | 3 | 1 | 2 | 4 | 7 | 9 by 3 | 1.9 | | 51 | 0.4.0 | | | **Match a reference label to its definition under Unicode case folding.** | 2 | 1 | 2 | 3 | 4 | 4 by 2 | 1.7 | @@ -47,14 +46,6 @@ ## Details -### 189. Lower the reading cost of the files a chunk reads most before its first commit. - -The last 5 chunks' median is 155854 new input tokens before their first commit, the 5 before them 92724 (`~/.claude/bin/reading-cost`, `docs/reading-cost.md`). - -Read most over the last 5 chunks (opens and searches): `README.md` 43, `docs/decisions.md` 29, `todo.md` 22, `CHANGELOG.md` 9, `ci.sh` 9, `src/html/emit/adf-to-html.test.ts` 9, `spec/html.md` 7. - -Cut what a chunk reads of those files: split or index the parts it reads whole, and run `~/.claude/bin/reading-cost --reset` in the chunk that ships this. - ### 46. Publish the bundle size in the README, failing the release pipeline when it drifts. The HTML items change the size. The quantity is what a consumer downloads and loads: the