Repository navigation
feat(acfs): add a limit to list - #27
Closed
neurekadev wants to merge 1 commit into
Closed
neurekadev wants to merge 1 commit into
neurekadev wants to merge 1 commit into
Conversation
`acfs list --limit N` and the new Root.ListEachBounded and Root.ListBounded stop after N entries. Names are still read and sorted for the order, but only the emitted entries and one more are inspected, so the helper's temporary output and stat calls are bounded by the caller's cap instead of the folder size. A limited response adds "truncated":true when entries were left out. Without --limit the output is byte-identical, so the protocol stays at version 2. ListEach and List keep their signatures.
Contributor
Author
🔍 Code ReviewPR #27 · 🤖 Claude Opus 5.5 (High) · T3 Code (Claude Code) · Round 1 of 3 |
Member
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.
Adds an optional
--limit Ntoacfs list, so a caller that caps a folder also caps the helper's work.Changes
acfs list --limit Nemits at mostNentries in name order. When entries were left out, the response is{"entries":[...],"truncated":true,"version":2}.Root.ListEachBoundedandRoot.ListBoundedtaketypes.ListOptions{Limit}and returntypes.ListResult{Count, Truncated}.ListEachandListkeep their signatures and now wrap these.lstated. The temporary output holds at mostNentries.--limit(or with0), the output is byte-identical, soProtocolVersionstays at 2.types.ListResponsegainsTruncatedwithomitempty.Measurements
One folder with 200,000 empty files, local build:
acfs listacfs list --limit 10000What's left is reading and sorting the names.
Checks
just format go --check,golangci-lint runforacfs, andgo test -race ./...inacfspass. ExtendedTestListBoundedandTestListLimitcover truncation, a limit equal to the count, reserved temporary names, and negative limits.Closes #26
Drafted with Claude Code (Claude Opus 5.5).