From 64778027e194bbefad10390bd8a5cc40f6fb936a Mon Sep 17 00:00:00 2001 From: Jim Wordelman Date: Fri, 24 Jul 2026 21:30:58 -0700 Subject: [PATCH] fix(storage): be-uwvs.1 wire less comparator into issueLiteProjection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit issueLiteProjection was missing the less: sqlbuild.Less field that issueProjection carries, per maphew's 2026-07-24 review comment on PR #3906 flagging this as the remaining follow-up once #4160 landed. Without it, searchInTx's merge branch (issues+wisps) has no comparator to re-sort the concatenation of two independently-ordered legs before trimming to filter.Limit when a Lite search takes that path — the trim would keep whichever leg happens to come first regardless of sort rank, unlike the full (non-Lite) projection which already re-sorts correctly. Also relocates the PR's new docs/EXTENDING.md to engdocs/EXTENDING.md: the file's own text says "It is not user-facing; it is for code that embeds bd or talks to the storage layer directly," and test/docsync.TestEveryDocsPageIsPublished requires every docs/ page to carry a docs.json navigation entry (Mintlify-published) or live under engdocs/ instead. engdocs/ is the existing home for this class of internal contract doc, so move it there rather than adding a new docs.json entry or exemption. Updates the two code comments that pointed at the old path. Verification (2026-07-25, rebased onto current origin/main): - go build ./... -> clean - go build -tags gms_pure_go ./... -> clean - go vet ./... -> clean - go test ./internal/storage/issueops/... ./internal/types/... ./test/docsync/... -> PASS - go test ./... (full suite) -> only pre-existing, environment-induced failures unrelated to this diff (verified identical on a clean origin/main baseline checkout: internal/beads, internal/config, internal/configfile, cmd/bd/doctor TMPDIR/shared-dolt-server/config-leak artifacts of this sandbox, plus TestCommitBeadsConfigSkipsGitHooks). Docker unavailable in this environment, so the cgo/Dolt-backed gate tests in cmd/bd (lite_filter_spy-based) self-skip, same as on baseline. Rebased gastownhall/beads#3906 (feat/be-uwvs.1-lite-select-foundation) onto current origin/main; the only conflict was the additive IssueFilter struct-field collision with #3908/#4160's MaxRows/ MaxRowsSource (both kept). Co-Authored-By: Claude Sonnet 5 --- {docs => engdocs}/EXTENDING.md | 0 internal/storage/issueops/search.go | 3 ++- internal/types/types.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) rename {docs => engdocs}/EXTENDING.md (100%) diff --git a/docs/EXTENDING.md b/engdocs/EXTENDING.md similarity index 100% rename from docs/EXTENDING.md rename to engdocs/EXTENDING.md diff --git a/internal/storage/issueops/search.go b/internal/storage/issueops/search.go index 715652fad..6d76a6cc9 100644 --- a/internal/storage/issueops/search.go +++ b/internal/storage/issueops/search.go @@ -87,12 +87,13 @@ var issueProjection = searchProjection[*types.Issue]{ // IsLitePartial=true. Selected by SearchIssuesInTx when filter.Lite is set; // everything else (label/dep hydration, wisp merge, id-shrink pattern B, // lease join) is shared with issueProjection via searchProjection[T]. See -// docs/EXTENDING.md for the caller contract. +// engdocs/EXTENDING.md for the caller contract. var issueLiteProjection = searchProjection[*types.Issue]{ columns: func(_ FilterTables) string { return IssueSelectColumnsLite }, scan: func(rows *sql.Rows) (*types.Issue, error) { return ScanIssueLiteFrom(rows) }, id: func(issue *types.Issue) string { return issue.ID }, hydrate: hydrateIssueLabelsAndDeps, + less: sqlbuild.Less, idShrink: true, joinLeases: true, } diff --git a/internal/types/types.go b/internal/types/types.go index 49b075ba1..b8b604e4a 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -1556,7 +1556,7 @@ type IssueFilter struct { // Dolt). The proxied-server (domain/db) path does not check this field yet // and always returns fully-hydrated issues with IsLitePartial=false — // correct results, no lite optimization. Wiring Lite through domain/db is - // deferred to the CLI-wiring follow-up. See docs/EXTENDING.md. + // deferred to the CLI-wiring follow-up. See engdocs/EXTENDING.md. Lite bool }