Replace LibStringSet with LibMemoryKV - #210
Conversation
LibStringSet was a linear keccak scan over a string[], doing what rain-lib-memkv already does. 0.1.4 adds has, which reports membership as a bool rather than through a tuple, so the shared library can be called from inside an assertion and the local one has nothing left of its own. Each of the sixteen call sites folds its list into a MemoryKV and asks that. Nothing replaces the deleted library: carrying one fewer is the point. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
|
Warning Review limit reachedNext included review available in 18 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe project adds ChangesMemoryKV membership migration
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to The membership migration has no established correctness or merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
It declares a permissive pragma that the solc-version detector flags, the same reason forge-std is already filtered. Analysing a published dependency says nothing about this repo. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
What
src/lib/LibStringSet.solis deleted. Its sixteen call sites useLibMemoryKVfrom rain-lib-memkv 0.1.4, newly pinned, which is the org's memory key/value
store.
A string becomes a key as its content hash. A list becomes a set by folding
setover it from an empty store, and a question ishas, the bool read addedin rainlanguage/rain.lib.memkv#28. Where a test asks the same list more than
once the set is built once; a both-direction pair builds one set per side.
Why
Nothing about whole-string membership is deploy machinery. The library arrived
here as a test helper, was promoted into the published source tree when the
snapshot verifier needed it, and was the only file in that tree with no deploy
semantics. Every consumer of this package received it.
It was also not the only copy. raindex hand-rolls the same nested scan twice in
its own build test, which is the second consumer that makes this a primitive
rather than a helper.
The store is the right home because a set is a map whose values carry nothing.
It is audited, it is already a dependency of rainlang, and its lookup is a
linked list spread across fifteen of them rather than a linear scan. Nothing in
this diff walks a list or compares a key, so a lookup bug is a bug there, under
that library's own tests, rather than a second implementation of the same idea
kept in step by hand.
No replacement helper was added, in
srcor intest. The fold sits at eachcall site, because the point of the change is to remove a library rather than
move one.
QA
existing assertions, whose messages and meanings are byte-identical before and
after. The tests that already covered each site are named in the table below,
and they are the discriminators: each fails under a mutation of the fold that
replaced the call.
differently. M01 and M02 target
src/abstract/RainDeployVerifySnapshot.soland are coverage evidence in the ordinary sense. M03 to M15 target folds that
now sit inside test files, so breaking one makes that test fail by
construction. They are EXECUTION PROBES, not coverage: each shows its
converted site is reached and that the surrounding assertion depends on the
set being built correctly. Counting them as coverage would overstate this
change, which adds no test.
Probe suite excluded the fork tests, so a rate-limited endpoint could not be
scored as a kill. Its baseline was green at 419 passed.
get, which states that a key set to zeroand a key never set are indistinguishable by value and that existence must be
read separately. That is why every member is stored against a zero value and
every question reads
hasrather than comparing a value.gone from
src, fromtest, and from every other reference: REUSE metadata,the slither configuration, the workflows and the README were all checked and
hold none. No helper replaced it.
481 passed, 0 failed, 0 skipped across 22 suites. The run before the change
showed 18 failures, every one an HTTP 429 from a public endpoint.
🤖 Generated with Claude Code
https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
Summary by CodeRabbit
Bug Fixes
Refactor
Chores