feat: standalone index for a linked worktree
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- developer-experience
Hướng nghiên cứu
Start by reading the worktree-index-fallback proposal and the implementation of codegraph sync, codegraph init, and codegraph githooks install; the issue does not name source files or tests. Reproduce the linked-worktree setup described in the issue, including a main checkout with its MCP server holding the store open. Done means a worktree can get a safe standalone index without a full build, and hook behavior when it has no index is documented or defined.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
A linked worktree borrows the main checkout's index through the worktree-index fallback (v0.19). Queries in the worktree then describe the main checkout's tree, not the worktree's edits. The notice says so, but the answers are still stale. Agents now do most of their work in linked worktrees, for example worktrunk wt worktrees under a shared root. So most agent sessions query a tree that is not theirs.
#119 ("worktree support beyond detect-and-warn") closed as completed. But the worktree-index-fallback proposal still lists "a per-worktree index, automatic init in a worktree, or an index keyed by worktree HEAD" as out of scope.
Request
Give a linked worktree its own index without a full build. Two possible shapes:
- A command such as
codegraph init --from-mainthat copies the main checkout's index into the worktree and syncs it to the worktree's tree. - The same step done on its own, the first time codegraph runs in a linked worktree that has no index.
The copy must be safe while the main checkout's MCP server holds the store open and writes to it.
What works today, and its limit
In a linked worktree of a 466-file repository:
cp -R <main>/.codegraph .codegraph
codegraph sync # reparsed=64 pruned=396, 1.2 s
codegraph status --json | jq .worktreeMismatch # null
The worktree then has a standalone index. The limit is the copy: cp -R of an open store can capture a write in progress. If the sync fails, the workaround falls back to codegraph index --force.
Related
codegraph githooks installkeeps an index current between sessions. The hooks live in the common.git/hooks, so they run in every worktree. The docs can state whatsyncdoes from a hook in a worktree that has no index of its own: skip in silence, or fail.
🤖 Generated with Claude Code
- Ngôn ngữ chính
- Go
- Star
- 0
- Fork
- 0
- Merge trung bình
- 7 giờ 42 phút
- Pull request đã merge (30 ngày)
- 111
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của seanb4t/codegraph-go
-
chore needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
seanb4t/codegraph-go#380 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
seanb4t/codegraph-go#379 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:query chore needs-triage spec-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
seanb4t/codegraph-go#377 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
seanb4t/codegraph-go#362 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:query bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
seanb4t/codegraph-go#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của seanb4t/codegraph-go
Issue tương tự
-
go-vulnerability security-scan
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
teslashibe/agent-go#35 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
alecthomas/chroma#1498 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 8 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày