Mark refactor_claude_todo as done

All 46 files are under the cap and the gate is in place. The survey figures in
the body are the 2026-08-14 snapshot — they were already stale when this
started (39 listed, 46 actual) — so the note says to re-run the gate rather
than trust them, and keeps the rest as the record of what was asked for.

Also picks up a pre-existing markdown-formatter change to the file that was
sitting unstaged in the working tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CFSGeWxHPY5rHUGrPqhcmG
This commit is contained in:
Krzysztof Rudnicki 2026-08-22 15:59:17 +02:00
parent 4c734c1cea
commit 52048a41c1

View File

@ -1,5 +1,14 @@
# Refactor TODO — enforce the 250-line file cap # Refactor TODO — enforce the 250-line file cap
> **DONE 2026-08-22.** All 46 violations are split and the gate is live:
> `bash scripts/check_file_length.sh --all` exits 0, a local pre-commit hook
> blocks an over-cap commit (verified in both directions), and
> `.github/workflows/file-length.yml` runs the same check on push.
>
> The survey figures below are the 2026-08-14 snapshot and are now historical —
> re-run the gate rather than trusting them. Kept as the record of what the
> task asked for and how it was scoped.
> **This file is a ready-to-use prompt.** Paste it to Claude, or open this repo > **This file is a ready-to-use prompt.** Paste it to Claude, or open this repo
> and say "do refactor_claude_todo". It is self-contained: everything needed to > and say "do refactor_claude_todo". It is self-contained: everything needed to
> execute is below. Generated 2026-08-14 from a measured survey of every repo. > execute is below. Generated 2026-08-14 from a measured survey of every repo.
@ -13,7 +22,7 @@ enforced by a gate that fails the commit, not by a note anyone can ignore.
Why: a file that cannot be read in one piece forces re-reads and partial edits, Why: a file that cannot be read in one piece forces re-reads and partial edits,
which is the single largest avoidable cost in an LLM-assisted workflow. Aim by which is the single largest avoidable cost in an LLM-assisted workflow. Aim by
churn, not size alone — refactoring pays where code is read and changed often churn, not size alone — refactoring pays where code is read and changed often
(Fowler, *refactoring economic benefit*). (Fowler, _refactoring economic benefit_).
## Scope in this repo ## Scope in this repo
@ -21,6 +30,7 @@ churn, not size alone — refactoring pays where code is read and changed often
- **14,348 lines** sit in violation; longest file is **525 lines**. - **14,348 lines** sit in violation; longest file is **525 lines**.
Exempt (do NOT split these): Exempt (do NOT split these):
- generated files — `*.g.dart`, `*.freezed.dart`, `*.gr.dart`, `**/l10n/generated/**`, - generated files — `*.g.dart`, `*.freezed.dart`, `*.gr.dart`, `**/l10n/generated/**`,
anything with a `GENERATED` header anything with a `GENERATED` header
- markup — `.html`, `.css`, `.scss` - markup — `.html`, `.css`, `.scss`
@ -33,7 +43,7 @@ ROI = lines x commits in the last year. Work top-down; a long file nobody edits
has near-zero payoff and should not be first. has near-zero payoff and should not be first.
| lines | commits/yr | kind | file | | lines | commits/yr | kind | file |
|------:|-----------:|:-----|:-----| | ----: | ---------: | :--- | :----------------------------------------------------- |
| 515 | 6 | code | `gatelock/gatelock/_window.py` | | 515 | 6 | code | `gatelock/gatelock/_window.py` |
| 477 | 3 | code | `gatelock/gatelock/tests/test_recovery.py` | | 477 | 3 | code | `gatelock/gatelock/tests/test_recovery.py` |
| 259 | 5 | code | `crdt_sync_dart/lib/src/sync.dart` | | 259 | 5 | code | `crdt_sync_dart/lib/src/sync.dart` |