BEE-009: a linked worktree is not a repo — register and index the ORIGINAL

Now
OPEN
Sev
MED
Ask
gritzko
Rep
///bee
On1
BEE-001
See
BEE-003

BEE-001 ruled that bee knows a repo BY ITS PATH and made bee install refuse a linked worktree, the tell being <gitdir>/commondir. The OTHER registration door was left open: index() calls track(ctx.repo, opts.home) on its own (index/index.js:924), so a bare bee run inside a worktree registers that worktree. $HOME/.config/bee/repos now carries /home/gritzko/src/bee, /home/gritzko/src/bee2 and /home/gritzko/src/bee3 — ONE repository in three checkouts, each with its own lane — so every ordinary filename in a cross-repo ref resolves three times, reaches the chooser, and http paints it PLAIN. The fix follows BEE-001's own ruling: when the path handed in is a linked worktree, register and index THE ORIGINAL — the main worktree named by commondir (index/refs.js:37) — if it is not registered yet.

Input

Context

The symptom is a page full of dead names: /bee-journal/todo/LITE/LITE-045.mkd paints render/html.js, main.js, door.js, theme.js as plain text while ticket codes on the same page link, because a ticket lives in ONE repo and a filename lives in three.

Goals

Registration names the ORIGINAL, so one repository is one registry line, one lane and one answer in the cross-repo fan-out.

Constraints

WIP

Design decisions

  1. BEE-001's ruling STANDS: the path is the identity, and a linked worktree is a second path over one history — so it is never the registered one.
  2. index/track REDIRECT rather than refuse: a bare bee inside a worktree must keep working, and registering the original is what the reader meant.
  3. The registry is append-only from bee's side; a legacy worktree line is neutralised at RESOLVE time (mount.js folds a family to one mount), never by rewriting the user's file behind their back.
  4. GRITZKO'S CALL, taken as BEE-001's refusal KEPT: install is the verb you TYPE, so a repo that is not the one bee would take is worth a word; the refusal now NAMES the original (commondir), so the next move is a copy- paste. index and the bare run are incidental and redirect in silence, save one phrase on the summary line. Flip it to a silent redirect if you would rather install just do the right thing — one if in merge.js.
  5. The fold keeps the family's FIRST registry line's NAME while pointing its root at the ambient checkout, so ///bee/x.js still resolves while the reader stands in bee2 — a name that followed the root would break it.

TODOs

Blockers and bummers

Outcome

Landed in an isolated worktree, uncommitted — gritzko commits.