refactor(assets): put the rules on a line budget - #16
Merged
Conversation
Every rule is preloaded into every request of the session on a harness that reads `rules/`, so a line here is not paid once — it is paid continuously. The set was 651 lines / 28.6 KB and is now 554 / 25.6 KB, with no rule and no reason removed: what went was repetition, ceremony, and prose that restated the table above it. Seven of ten files now sit at or under 55 lines. Three do not, and the test grandfathers them at their current size rather than pretending otherwise: specs.md and knowledge-base.md are roughly half table and fenced example — 45 and 46 lines of structure — so cutting them to 55 would leave under ten lines of prose across six sections. That is enough to state a rule and not enough to say why, and a rule whose reason was deleted is one an agent quietly deviates from. delivery.md is at 62 with dense prose and no structure to blame. The test enforces the budget in both directions: a new rule over 55 fails, and a grandfathered file that shrinks below its cap fails too, so the gain gets locked in instead of drifting back. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J54qbk8RpC2tZH8LBz6T2b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #15, which merged while this was being written.
Every rule is preloaded into every request of the session on a harness that reads
rules/— so a line here is not paid once, it is paid continuously.651 lines / 28.6 KB → 554 / 25.6 KB. No rule and no reason was removed; what went was repetition, ceremony, and prose that restated the table above it.
Where it landed
specs.mdknowledge-base.mddelivery.mdmethodology.mdtasks.mdrouting.md·autonomy.md·code-search.md·project.md·verification.mdSeven of ten now sit at or under 55 lines.
Why three do not, and what the test does about it
specs.mdandknowledge-base.mdare roughly half table and fenced example. Measured:Structure here is blank lines, headings, the EARS pattern table, the design table, the delta example, the ADR and glossary blocks — none of it compressible without losing the thing it shows. Cutting either to 55 would leave under ten lines of prose across six sections: enough to state a rule, not enough to say why. A rule whose reason was deleted is one an agent quietly deviates from, which costs more than the bytes save.
delivery.mdis at 62 with only 20 structural lines — its prose is simply dense now, and further edits re-wrap to the same line count rather than removing content.So
TestRulesStayShortEnoughToBePreloadedenforces 55 for any new rule and grandfathers those three at their current size, in both directions: a grandfathered file that grows fails, and one that shrinks below its cap also fails, with a message telling you to lower the cap. The gain gets locked in instead of drifting back.Whether those three are worth cutting further is a judgment about the methodology rather than about bytes, and it is yours — say the word and I will take them to 55.
Verification
gofmt -l,go vet ./...,go test ./...green. A scaffolded workspace validates clean, so no rule trips a validator after the rewrite:🤖 Generated with Claude Code
https://claude.ai/code/session_01J54qbk8RpC2tZH8LBz6T2b