Add CLAUDE.md - #12
Merged
Merged
Conversation
Captures what is not discoverable by reading any single file: the reason fetchPage() never interprets a cursor (which is why the Offset namespace needed no engine change), the yield-before-loop-detection ordering in pages(), the deliberate placement of Walk misuse outside the CursorWalkException hierarchy, and the fetcher-unit rule for which total to report. Also records the environment traps that cost time to rediscover: php-cs-fixer needing --sequential locally, coverage and mutation being unrunnable without a coverage driver, and .gitattributes eol=lf being load-bearing rather than incidental. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NzT1u3EN6X7hoHiage9HxK
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.
Problem
There was no
CLAUDE.md,AGENTS.md,CONTRIBUTING.md, ordocs/tree, and no Cursor or Copilotrules. The conventions are real but distributed: the contracts live in class docblocks, the recipes
in
README.md, the behavioural record inCHANGELOG.md, and the gates incomposer.jsonscriptsplus four tool configs. Reconstructing that costs a full pass over the repo, and the parts that are
easiest to break are precisely the ones no single file states.
Change
One new file,
CLAUDE.md. No code touched.It deliberately does not restate the file tree, the README, or generic PHP practice. What it
does carry:
--flag-forwarding convention.fetchPage(?string $cursor)never says whata cursor means, which is why
src/Offset/needed no engine change — flagged so a future changedoesn't quietly regress it.
pages()'s budget-before-fetch andyield-before-loop-detection ordering;
Walkmisuse raising a bare\LogicExceptionoutsideCursorWalkExceptionon purpose;Walksettingfinishedbefore throwing so a driver thatswallows the exception cannot keep walking;
hasNext()not meaning "the next draw will succeed";slice()anchoringendCursorto the last upstream page for O(1) load-more; the fetcher-unitrule for
totalPagesvstotalItems.locally,
coverage/mutationbeing unrunnable without a coverage driver (so CI is the onlycheck), and
.gitattributeseol=lfbeing load-bearing rather than incidental.tests/Support/fixtures,failOnRiskymaking an assertion-free test a failure, the 100% coverage floor, and why the MSIfloor sits at 85 rather than being chased upward.
Verification
vendor/bin/phpunitcomposer stan(level max)composer cs -- --sequentialphpstan-phpunitgrep composer.jsonversionfieldgrep composer.jsondocs/treels -d docsls tests/Support/grepfor the section commentstests/andtests/Offset/gh api .../branches/main/protectionstrict,enforce_admins: true, 0 approvals — as documentedEvery factual claim in the file was checked against the repo rather than written from memory; rows
4–9 are the ones that were not already obvious from this session's work.
Notes
prettierstep to run on it.composer cs -- --sequentialas the local invocation. CI runsplain
composer csand is unaffected — the parallel runner only hangs in some Windows sandboxes.Risk: 🟢 low — a new documentation file; no shipped code, no config, no CI change.
🤖 Generated with Claude Code