fix(storage): be-uwvs.1 wire less comparator into issueLiteProjection

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 <noreply@anthropic.com>
This commit is contained in:
Jim Wordelman 2026-07-24 21:30:58 -07:00
commit 64778027e1
3 changed files with 3 additions and 2 deletions

View file

@ -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,
}

View file

@ -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
}