Improve bd where performance in worktree fallback#3195
Open
osamu2001 wants to merge 11 commits intogastownhall:mainfrom
Open
Improve bd where performance in worktree fallback#3195osamu2001 wants to merge 11 commits intogastownhall:mainfrom
osamu2001 wants to merge 11 commits intogastownhall:mainfrom
Conversation
intent(where): timber-7z reproduces bd where at roughly three seconds while list and show stay under a tenth of a second decision(where): treat where like context so it resolves beads_dir and database_path without opening the store rejected(where-prefix): live issue_prefix lookup from the server-backed config because it reintroduced the same multi-second roundtrip; follow-up is tracked in beads-ayf constraint(where): the fast path can only show prefix when issue-prefix is configured in config.yaml
intent(where): losing prefix in bd where was a functional regression even though the command became fast decision(where-prefix): reopen a scoped read-only store from the resolved dbPath so issue_prefix comes back without re-running the old worktree discovery path constraint(where): prefix recovery still has to stay cheap enough for timber-7z bare-parent worktrees; cold runs stay around one second and warm runs around five hundredths learned(where): the slow part was the old command path resolution, not the narrow read-only config lookup once dbPath was already known
33ea6ed to
c9eb8ec
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
intent(where): keep selected-db routing inspectable through `bd where` even when only metadata is available for the target workspace decision(where-prefix): trust config.yaml for selected server-mode workspaces and skip read-only store reopen unless the metadata indicates embedded storage constraint(where-tests): explicit-db routing coverage executes real bd subprocesses, so the fixture runner now uses a timeout to fail fast on regressions instead of hanging indefinitely
intent(where-routing): preserve the same explicit-selector precedence guarantees that `context` already documents for selected no-db commands decision(where-tests): add the missing `BEADS_DB > BD_DB` CLI case instead of broadening helper assertions so the precedence contract stays visible at the command boundary constraint(where-routing): these regressions only show up when `bd` is executed as a subprocess with real env vars, so the test stays end-to-end rather than unit-only
…ekl.2) intent(init): lock down the dotted-prefix sanitization path that now relies on config-derived prefix normalization before DoltDatabase is chosen decision(init-tests): seed `.beads/config.yaml` before `bd init` instead of reusing `--prefix` coverage so the regression test exercises the config lookup branch directly constraint(init-embedded): the normalization contract only matters once embedded init actually creates the store, so validation runs under the CGO embedded test path
…eads-yi0o) intent(where-tests): make the explicit-db routing suite easier to extend without changing the command scenarios it exercises decision(where-tests): extract a small package-local assertion helper instead of abstracting repo fixture setup so each case still shows its env and flag inputs inline constraint(behavior): preserve the existing `where --json` contract checks for path, database_path, and prefix omission/presence exactly as before
intent(where-tests): increase confidence that selected workspace routing keeps the server-mode no-reopen guard while still allowing embedded and metadata-missing fallbacks decision(where-tests): add focused unit cases around `shouldReadWherePrefixFromStore` instead of expanding slower subprocess coverage because the branching logic is package-local and deterministic constraint(where-tests): clear server-mode env overrides inside the test so the expected metadata-driven decisions stay stable across developer environments
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.
Summary
bd whereon the lightweight diagnostic path in worktree fallback casesbd whereoutput without triggering full direct-mode initialization on lookupissue_prefixstays aligned with the Dolt database name, and add regression coverageValidation
./scripts/test.sh ./cmd/bd -run '^(TestResolveWhere|TestIsSelectedNoDBCommand_Where)$'BEADS_TEST_EMBEDDED_DOLT=1 ./scripts/test-cgo.sh -run '^TestEmbeddedWhere$' ./cmd/bdBEADS_TEST_EMBEDDED_DOLT=1 ./scripts/test-cgo.sh -run '^TestEmbeddedInit/(prefix_dot_sanitized|auto_detect_dotted_dirname)$' ./cmd/bdBEADS_TEST_EMBEDDED_DOLT=1 ./scripts/test-cgo.sh -run '^TestEmbeddedInit$' ./cmd/bd/Users/osamu/.local/share/tb/timber-7zbd where --json: about0.10s