BEE-003: the repo is an axis of the target — pager and http serve every local repo

Now
OPEN
Sev
MED
Ask
gritzko
Rep
///bee
On1
BEE-001
See
BEE-002
See
LITE-034

A page in one repo links a page in another — the wiki links tickets, tickets link code — but in bee the repo is PROCESS STATE, not part of the address: http.js opens the cwd's repo ONCE and chdirs to its root, and the door resolves every partial at io.cwd()'s repo. So a cross-repo ref renders as a link into the serving tree and 404s, or resolves to a same-named local file, and neither the pager nor the server can switch repos at all. BEE-002 makes the BACKLINK direction cross the boundary; this makes the repo an axis of the TARGET, which is what lets both apps serve every registered repo.

Input

Context

http.js takes the door's openPath/seatOf/statOf and serves paths of one repo; render/html.js turns a ref token into an href; index/resolve.js resolves a partial path against ONE tip tree.

Goals

The pager and bee http both serve every registered repo, and a cross-repo ref opens the right page in the right repo instead of a same-named local file.

Constraints

WIP

Design decisions

  1. RULED: the repo is a field of the TARGET, carried in an AMBIENT context per run / per request / per view — {repo, path, anchor}, be's be.repo (shared/ambient.js) in bee's shape. The process cwd stops being the repo and the http.js chdir retires. The pager's back stack holds (repo, path, anchor) triples, so a cross-tree hop pops back cleanly.
  2. RULED: the URL CARRIES the repo — /<repo-name>/<path> — and the registry is the mount table, so a request resolves from the URL alone and the server keeps no current-repo state. A bare repo-less URL 301s to the prefixed form; it does NOT keep working silently, or old links never converge on the addressable shape.
  3. RULED: a partial ref resolves in ONE fixed order — the DIR of the file being read, then the current repo at HEAD, then every registered repo (recursing submodules, BEE-006) — and a miss is a WORDED refusal that names what was searched ("no registered repo holds abc/TCP.c"), since the useful next move is bee install on the repo that owns it.
  4. RULED: several hits land in the CHOOSER hunk the resolver already builds for ambiguous partials, each row naming its repo — deduped by blob sha and mount identity, so a submodule file reached through the parent AND through its own lane is ONE row, not two.
  5. RULED: a submodule file is canonically addressed THROUGH the parent — /quickjab/dog/abc/TCP.c — and served at the commit the parent's gitlink PINS, not at the sub's own HEAD (they differ whenever the sub is ahead). The sub's own mount is the same bytes at another commit: it redirects, or is marked as the origin, but both are not live addresses for one file.
  6. OPEN: repo NAMES collide already (bee and bee2, plus worktrees of one repo). The registry basename is the default name; the disambiguator when two entries share one is unruled.
  7. RULED (was candidate 2): a relative ref that climbs out of its repo root is resolved by the resulting absolute path against the registry; no registered repo contains it → the link renders dead, in plain words.
  8. RULED: the per-repo lookup is FSEG (LITE-011, index/resolve.js), never the REV lane. path_hl hashes the WHOLE path, so no REV row is findable from a suffix; FSEG is keyed fn_hl:40|prnt_hl:20 — the shape a partial actually gives — and its ancestor segment hashes prune the tree descent to a line, recovering real TEXT at the bottom and answering ambiguity with several paths. Fanning that scan over the registry is a prefix scan plus a pruned descent per repo, no blob reads. REV-PARS stays the weave's DAG edges (BEE-005), a different question.

TODOs

Blockers and bummers

Outcome

(open)