feat: standalone index for a linked worktree
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- developer-experience
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Go
- Stelle
- 0
- Fork
- 0
- Merge medio
- 7h 42m
- PR unite (30g)
- 111
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di seanb4t/codegraph-go
-
chore needs-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
seanb4t/codegraph-go#380 ·
I maintainer di solito rispondono entro 1 giorno
-
chore needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
seanb4t/codegraph-go#379 ·
I maintainer di solito rispondono entro 1 giorno
-
area:query chore needs-triage spec-needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
seanb4t/codegraph-go#377 ·
I maintainer di solito rispondono entro 1 giorno
-
chore needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
seanb4t/codegraph-go#362 ·
I maintainer di solito rispondono entro 1 giorno
-
area:query bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
seanb4t/codegraph-go#355 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di seanb4t/codegraph-go
Issue simili
-
go-vulnerability security-scan
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
teslashibe/agent-go#35 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
alecthomas/chroma#1498 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 8 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno