.be kind tests, creators, store scansOpus sweep over beagle/ (keeper, dog, graf, sniff, spot, mark,
woof, bro, beagle/), 2026-07-24. Sites where .be-dir ⇒ full store /
.be-file ⇒ flat wt is assumed, plus creators and store-side scans.
home_walk_up: the discovery scan-up. REG ⇒ secondary
wt; DIR ⇒ wt iff .be/wtlog is reg OR shield-like (≤1 subdir).
A flat .be/ dir anchors as store==wt via the wtlog branch.home_anchor_resolve: sets h->root. REG (L651) ⇒
row-0 redirect to the real store; DIR (L708) ⇒ h->root=h->wt.
THE core break — a flat wt's store is elsewhere.home_be_subdirs/home_dir_shieldlike/
home_single_shard: .be/ subdir census ⇒ shield vs multi-
project store; a flat .be/ (files only) reads shield-like —
passes, but for the wrong reason.home_shard_title / L865–920
home_resolve_project_dir: iterate .be/<shard>/refs row-0
titles (harmless-but-wasteful on a flat dir).home_ensure_markers: rw bootstrap CREATES .be/ dir
+ wtlog. L160–199 HOMEBeDir/HOMEMakeBeDir/
HOMEProjectExists: path composers (kind test on the SHARD).home_peek_repo_uri: mmaps a given path as a FILE
(secondary .be or primary .be/wtlog) — caller chooses.SNIFFWtlogPath: REG ⇒ the .be file IS the
wtlog; else <wt>/.be/wtlog. Yields the right FILE for a flat
dir — but the store root (HOME) is what breaks upstream.FILEStat(<store>/.be/<branch>) DIR
probes (store-side). L128–158 sniff_write_repo_row: CREATES
<wt>/.be/<project>/ shard + colocated row-0 anchor. L174–190
pre-mkdir <wt>/.be/ on fresh primary.at_dirty_scan_cb: prunes a subdir iff its .be
is REG ("beagle's own sub-mount shape (a regular .be file)") —
a flat-dir sub is NOT pruned, its files scan into the parent.
DIRECT break.SNIFFSubIsMount: mount ⇔ .be is REG — a
flat-dir sub reports NOT-a-mount. DIRECT break.subs_path_is_be_store: FILEisdir(<p>/.be) ⇒
"a beagle store" — a flat wt classifies as a store source..be name refusal; L265–297/786–831 seed
refs+wtlog under sub-store dirs (creators, store-side).put_is_sub_add_candidate: .be present (ANY
kind) ⇒ candidate — kind-agnostic, tolerant.RECVCaptureWtPath: S_ISREG(<wt>/.be/wtlog) ⇒
primary wt with store HERE ("a dir there means a bare store");
triggers the colocated be get ? advance. A flat .be/ dir
passes the gate with a REMOTE store — wrong advance. (Same-dir
invariant at L452–462/476–485.)FILEisdir(<src>/.be) ⇒ primary
store; REG ⇒ secondary wt; basename .be ⇒ store. Flat-dir
source reads as a primary store..be dir in cwd ⇒ "clone-destination store,
defer to keeper (NOT a worktree)"; REG ⇒ existing wt switch.
Flat-dir cwd treated as a bare clone destination..be/wtlog, secondary from
the .be FILE.BEEnsureProjectRepo: REG ⇒ secondary, skip shard
init — flat dir falls through to shard creation. L2599–2643
shard-dup guard + CREATES <cwd>/.be/<proj>/ + .be/wtlog.be_sub_shard_setup: seeds the sub shard, then
CREATES <cwd>/.be as a regular FILE (L2876) with the
secondary row-0 anchor — the current flat-wt writer that the
planned change replaces.bepost_wt_project: DIR ⇒ push wtlog, else mmap
the .be file directly.BEGetSubUnmount: FILEUnLink(<sub>/.be) — assumes a
FILE; a flat-sub .be/ dir is not removed (needs rm -r).
DIRECT break for the drop path..be/ (unaffected except via HOME root)<root>/.be/<project> shard).
GRAF.c L82–92 deep-scan *.graf.idx; L119–124/168–198 compose/
create shard, .lock. GRAF.exe.c:279 diagnostic.keep_scan_branch_dir, L100–123
keep_global_max_seqno (deep-scan .keeper[.idx]), L587–606
KEEPInitShard (creator). WALK.c L76–97 skips the .be TREE
ENTRY unless WALK_INCL_ANCHOR (git-tree, not fs). REFADV.c:
150, RESOLVE.c:88–93, WIRE.c:145 store path composition.
WIRECLI.c L243–255 detects GIT layouts (not .be).spot_branch_dir/spot_dir_exists
(store .be/ compose via HOMEBeDir); CAPO.h:27 CAPO_DIR.<repo>/.be/static/ (compose
only; writes nothing under .be/).DOG_BE_NAME/DOG_WTLOG_NAME; L100–144 layout
doc — L131 "<wt>/.be regular file = the wtlog" vs L100
"<wt>/.be/ store directory": the documented dichotomy.DOGRepoFromBe/DOGProjectFromBe/
DOGBranchFromBe: string splits on /.be/ (no fs kind).DOGPup*: mmap pups in shard dirs (store-side).igno_is_meta: skips .be by NAME (kind-
agnostic, survives); L317–319 the ..be.idx sidecar rule goes
dead for dir-shaped flat wts (index moves inside .be/).K_DIR: .be/ dir + empty wtlog; K_FILE: empty .be file); pins
".be/ dir is a repo", single-shard detection, $HOME/.be..be/ DIR
under a subdir is NOT a sub-mount (only a FILE is) — exactly
the assumption BE-055 inverts./.be/ splitters incl. doubled);
dog/test/ULOG.c:1030–1086 (.be/wtlog wipe regression);
keeper/test/KEEP.c:366–595, DELTA_ROUND.c:248/496,
RECEIVEPACK.c:409 (store layouts); dog/test/DPATH.c:69.