Take LibStringSet from rain.deploy - #136
thedavidmeister wants to merge 5 commits into
Conversation
Whole-string membership over a list is not deploy machinery. It landed there as a test helper and was promoted into that repo's source tree for one caller. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
|
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 selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughChangesString membership
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The string membership utility is ready to merge with no identified current-head risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
The audited stack-name lookup cannot take a string, and a hand port of its technique failed its own tests. What moves is the code that has been running. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
|
Closing unmerged: the relocation is no longer the answer. rain.deploy deleted LibStringSet outright in rainlanguage/rain.deploy#210 and uses LibMemoryKV directly, so there is nothing to relocate. The reusable piece landed as has in rainlanguage/rain.lib.memkv#28. |
What
LibStringSet.holds, membership over astring[], and its twelve tests. Botharrive from rain.deploy, which is where they were written and is not where they
belong.
Why
Nothing about whole-string membership is deploy-specific. It landed in
rain.deploy as a test helper, was promoted into that repo's source tree when one
caller needed it, and has stayed there ever since as the only file in it with no
deploy semantics.
The org already has this shape.
LibParseStackNamein rainlang walks a linkedlist comparing name fingerprints, on the stated grounds that n is small so a
linear walk is cheap.
holdsis that argument with the truncation and the bloomfilter removed, for a caller that wants a yes or no rather than an index. The
character-mask primitives here answer a different question again, which is what
class a single byte is in; the readme's line about avoiding in-memory sets and
loops is about that, not about collections.
The consumer side follows once this releases: rain.deploy pins rain-string,
imports from here, and deletes its copy.
QA
at 12 passed, 0 failed. Each takes a concrete list and needle whose answer
comes from the definition of membership, not from the loop that implements it:
a match at every index, a single element list, a miss, an empty haystack, a
prefix and an extension and a same-length difference and a case change, a
difference past the first EVM word, the empty string as an ordinary member,
equality by value rather than by memory identity, and a match that later
misses do not undo.
tests existed, each killed by them. Compare by length instead of by hash,
killed by the whole-content case. Compare only the first word, killed by the
beyond-one-word case. Return true on an empty haystack, killed by the empty
case. Start the loop at index one, killed by the every-index case. Return
false on a match and keep scanning, killed by the later-misses case.
holdsas whether the listcontains the string, by hash over the whole content, with order not fixed.
Expected values are written out per case rather than computed by the same
expression the library uses.
it. The library is byte-identical to the one in rain.deploy; the tests are the
ones from Test LibStringSet.holds membership directly rain.deploy#175, which closes unmerged in favour of
this.
🤖 Generated with Claude Code
https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
Summary by CodeRabbit
New Features
Tests