feat(start): a worktree builds its search index when its main checkout has one #545
No reviewers
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli!545
Loading…
Reference in a new issue
No description provided.
Delete branch "wip/zg-index-setup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
iw startandiw opennow start building a worktree's zvec-grep search index when the repository's main checkout has one.ZvecGrepIndexSetup, runs next toDirenvSetup.zg index '<worktree>' --embedding <model>, with the model named in the main index'smanifest.json.zgis not on PATH, where the main checkout has no index, or where the worktree already has one.Why
Semantic search must answer from the worktree's own content. A branch and
maindiverge quickly: we measured up to 449 files between a procedures worktree andmain. An index per worktree keeps results correct, and building it by hand in every worktree is the step people forget.Design
WorktreeSearchIndex.buildCommandincore/model. It refuses a model name or a worktree path it cannot quote safely for the shell.zgexists.GitWorktreeAdapter.repoRootfinds a worktree's main checkout from git's common dir.LiveHerdrOps.repoRootOfnow uses it instead of its own copy of the same git call.zg indexwaits until the build ends and the session must not wait with it.Tests
WorktreeSearchIndexTestcovers every condition that suppresses the command, shell safety, and manifest parsing.ZvecGrepIndexSetupTestuses real git worktrees and real manifest files.GitWorktreeAdapterTesthas threerepoRootcases.SessionHooksTestcase goes throughSessionHooks.run. It is skipped wherezgis not on PATH.start.batscases run a realiw startagainst a real zg index, in direct mode, and are skipped withoutzg. One case checks that the worktree gets an index. The other checks that nothing reaches the pane when the main checkout has no index.Local gate: format check, Scalafix,
core.test(3,451 tests),dashboard.test,dashboard.itest.testForked, command compilation and all BATS files pass.The first gate run had 17 dashboard failures. They came from a Mill daemon started without
WEBAWESOME_NPM_TOKEN, not from this change: the same cases passed on an untouchedmainand after the daemon restarted with the token. Filed as #544.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01UZkyNf4ufQzdFP99htcgNw