~bigbes/agents-dev · memory

main · last commit 13 days ago · 7g0stsfu

Clear
9 entries sort: slug · age

beads-storage-api-enumeration

written 13 days ago · t83a8sfm

beads v1.1.2 Storage API enumeration semantics, measured 2026-08-05 (ah-wd4.1 spike, agents-dev): SearchIssues(ctx, "", IssueFilter{}) is an HONEST FULL enumeration — Limit is a plain int gated on >0, so the zero value emits no LIMIT clause at all; verified exact at 87, 700 and 2500 issues with no default page size. It returns EVERY status incl. closed/deferred: the hiding of closed/pinned/done/frozen is entirely CLI-side (cmd/bd/list_filter.go). FOUR TRAPS: (1) IssueFilter.Offset is DEAD on the embedded-Dolt read path — zero uses in issueops/sqlbuild, Offset:5 and :10 both return page 0, so a Limit+Offset pager loops forever; (2) with Limit>0 the limit is applied PER TABLE (issues, wisps) then merged, so Limit:100 can return 140; (3) Statistics.TotalIssues is COUNT(*) FROM issues ONLY and excludes the wisps merge, so len(list)==TotalIssues is a WRONG completeness assertion that passes today only because our wisps table is empty — use Storage.CountIssues, which mirrors the merge semantics (parity verified across 15 filter shapes); (4) a cross-table duplicate ID makes CountIssues exceed SearchIssues by the dup count, and count.go's comment claiming SearchIssues 'errors loudly' on that is STALE — search.go silently prefers the wisp record. RunInTransaction CANNOT wrap count+list: Transaction exposes no count primitive, and embedded Dolt's process-exclusive lock makes store-level calls from inside the callback fail with 'the database is locked by another dolt process'. Don't set SkipWisps by default — NoHistory beads live in wisps with ephemeral=0. Building against the beads module needs CGO_ENABLED=1 AND ICU headers (go-icu-regex wants unicode/regex.h; on this mac /opt/homebrew/opt/icu4c@77).