README: describe every constant LibCodeGen emits, not only function pointers - #122
Conversation
…ointers The opening said the library hosts the constant caches for prebuilt function-pointer tables. Function pointers are 5 of the 11 emitting functions in LibCodeGen, and the committed example artifact src/generated/CodeGennable.sol holds a bytecode hash and two bytes constants and no function pointers at all. test/src/lib/LibCodeGen.readme.t.sol scans the emitting declarations out of src/lib/LibCodeGen.sol and asserts the README's opening names a phrase for each, so a new emitter with no prose fails rather than passing silently. foundry.toml grants the two reads that test needs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 30 seconds Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Drops a fixed upper bound and the assertion guarding it, which no input in this repo reaches and no test can therefore cover. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Deletes test/src/lib/LibCodeGen.readme.t.sol and reverts the two fs_permissions read grants (README.md, src/lib/LibCodeGen.sol) it needed. The README edit this PR exists for is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Closes #87
What was wrong
The README's opening said the library "hosts the constant caches for prebuilt
function-pointer tables". That is one of several things
LibCodeGenemits, andit is not what the repo's own committed example produces.
Confirmed against the source rather than taken from the issue:
src/lib/LibCodeGen.soldeclares 11 emitting functions (the*ConstantStringset).
handler, sub parser word parsers, integrity). The other 6 emit a
deployed-bytecode hash, a described-by meta hash, and generic
address,uint8,bytes32andbytesconstants.src/generated/CodeGennable.sol, the only committed example output and theartifact the README itself tells you to regenerate, holds a
BYTECODE_HASHand two
bytesconstants and zero function pointers.What changed
README.mdopening paragraph, and nothing else:No test guards this, and it can regress silently
This change is not covered by any test and can regress silently. If someone
adds a twelfth emitter to
LibCodeGen, or edits this paragraph back toward thefunction-pointer-only description, or deletes it, the suite stays green and CI
stays green. Nothing in this repo compares the README against the emitter set.
The only thing standing between that drift and a reader is review of the diff.
This is not being rehomed.
rainlanguage/rainix#317collects the checks fromthis sweep that a generic
rainix-staticlint could express; a hand-written mapfrom
LibCodeGen's emitter names to English phrases in this repo's README is notone of them, so #317 is not its home either. There is no follow-up issue and no
deferred coverage — the documentation fix lands unguarded, deliberately.
What this PR previously carried, and why it is gone
An earlier revision of this branch added
test/src/lib/LibCodeGen.readme.t.sol(252 lines) plus two
fs_permissionsread grants (README.md,src/lib/LibCodeGen.sol) so it couldvm.readFileboth. That test has beendeleted and both grants reverted, so
foundry.tomlis now byte-identical tomain.It was written because the brief driving this fleet of fixes said every fix
ships a test and verify-by-hand is never acceptable, with no exemption for
changes that have no behaviour. That instruction was wrong and has been
corrected. A README wording fix has no behaviour to test, and the test it
produced was hand-rolled static analysis written in Solidity:
3 test functions asserted on those helpers rather than on anything in
src/.than protecting the library.
LibCodeGen's declaration list asEXPECTED_EMITTER_COUNT = 11plus an order-sensitive name list, so reordering two functions — a change with
no behaviour at all — would have turned the suite red.
QA
nix develop -c forge test:Before the strip (same merge commit, test file and grants still present):
Ran 19 test suites: 145 tests passed, 0 failed, 0 skipped (145 total tests)—the drop is exactly the 3 functions removed, and every remaining test passes.
nix develop -c forge fmt --check: exit 0, no diff.pre-commit(
no-consumer-prettier,taplo,denofmt): Passed on the commit.origin/mainis merged in (merge commit, not a rebase); the branch predatedmerged PRs #110 and #124.