Expand description
§12 substrate — prime’s bootstrap-on-miss, the retired init.
Founding is not a separate verb: it is the local-miss branch of idempotent
prime (§12). The two-branch substrate (§2) is founded in TWO steps, on two
different schedules:
found_landinglays the landing (balls/config, holdingconfig/) as the repo’s first worktree EAGERLY —primeneeds itsconfig/to know the plugin chain and the configuredtasks_branchbefore it can do anything.materializelays the store (tasks_branch, holdingtasks/) LAZILY, betweenprime’s pre and post phases (bl-0a23): it checks out the branch if a ref already exists — a remote one theprime/pretracker just cloned in (§12) — and founds a fresh orphan ONLY when no such ref exists (the genuine no-remote bootstrap). Founding eagerly would create a divergent orphan that an established remote could not fast-forward onto, the unrelated-histories bug bl-fa00 had to reset away; materializing after the tracker’s clone-in means that divergence is never CREATED.
One repo, two branches, two real checkouts — no symlink indirection, no chain
to resolve (§1). Core knows nothing of remotes here (§0); it only ensures the
two checkouts exist and seeds the landing’s config/ from the app
default-config (crate::seed). Re-running prime skips both steps (the
landing is already a landing, the store checkout already sits on the
configured tasks_branch — the §12 predicate, not “a store dir exists”,
bl-eb52), so the whole verb converges to a no-op — there is no --reinit.
Functions§
- found_
landing - Found the landing half of the substrate (§2 bootstrap-on-miss): the
balls/configbranch atlanding, itsconfig/SEEDED from the app default-config (theballs.toml+ theplugins.tomlhook schedule, with each named plugin found besideblinexe_dirbound and every absent-binary entry pruned, §12). Returns the seed’s rendered prune notes (a pruned name with a[source]hint, bl-5b09) forprimeto emit through the op log once it has one — founding necessarily precedes the log’s threshold read. The caller guaranteesis_landingis false, so this never clobbers an established checkout. - is_
landing - Is the landing already founded? A founded landing has a COMMIT on the
balls/configbranch (§12) — founding’s ONE commit point, not theconfig/folderfound_landingcreates on its way there (bl-ffbf). - materialize
- Ensure the configured
tasks_branchnameIS the store checkout atstore— the lazy “a branch is a disk path” primitiveprimedrives between its phases (bl-0a23). Two invariants, each established only when missing, so a re-prime converges to a no-op: - warn_
founded_ ancestor - The bl-b915 founding advisory: report-only scrutiny, zero mechanism added to
resolution — never a refusal, never a redirect. Call only on the miss branch
of
prime, right beforefound_landing: the caller is ABOUT to found a brand-new store atinvocation_path, so if a founded store already sits at some ANCESTOR directory (balls’ own record —Xdg::nearest_founded_ancestorstats the ancestor’s own clone dir, git never consulted), that is almost always the bl-0bd8 invisible-sibling-substrate footgun rather than a deliberate nested/sibling store: warn on stderr, naming the-Cescape hatch (bl-c620), and let founding proceed regardless.