monopam: bootstrap UX overhaul — clone command, auto git-init, ref pinning
Onboarding was rough: hand-write sources.toml, git init, hope init
commits the imports (it didn't, due to a stale-index bug in
Root.regenerate's commit_index path that silently dropped subtrees
from HEAD). This adds `monopam clone <url> --handle <you>`, makes
init auto git-init, and fixes Deps.run to pin resolved SHAs into
sources.toml + actually commit imported subtrees. Also drops the
legacy `monopam add <mono.lock>` path and the Mono_lock module.
Clone specifics:
- Auto-detects the remote's default branch via ls-remote --symref so
master/trunk repos don't need --branch.
- Renames cloned origin → upstream so a bare git push won't publish
to the source repo; prints a hint about adding own origin.
- Strips the cloned sources.toml's origin field so a later
`monopam init --handle <missing>` can't silently re-derive the
original author's identity for the new owner.
- Falls through to bootstrap on existing target dir (idempotent
re-run after interrupted clone).
Init specifics:
- ensure_git_repo creates the dir + git init + empty initial commit
so subtree.add has a HEAD to graft on.
- Smart Next: hint based on Deps.stats: `dune build && dune test`
after a real bootstrap, the old add/pull hint when nothing was
imported.
Output hygiene:
- Verse and Deps log lines lost the hardcoded `[init]` prefix; the
calling command tags its own lines via a ~prefix arg on
Init.workspace_setup. No more `[init] subtree foo:` leaking out
of `monopam clone`.
- Init and clone both print `[<cmd>] target: <path>` (was inconsistent
`root:` vs `target:`).
- Concise git-clone errors: extract git's actual `fatal:` line
instead of pp_error's wrapping `Command failed: ... (exit 128)
stdout: ... stderr: ...`.
Help and docs:
- Top-level QUICK START leads with `monopam clone` for onboarding,
then `monopam init` for from-scratch.
- TYPICAL SESSION uses `git add <paths>` instead of `git add -A`,
matching project doctrine.
- Generated CLAUDE.md leads with an imperative pointer to
.claude/CLAUDE.md (project doctrine), replacing a passive note
that contradicted itself about committed-vs-gitignored.
Tests: each scenario gets its own cram file, no mixed concerns.
bootstrap.t — hand-written sources.toml → init bootstraps
clone.t — thin remote (sources.toml only) onboarding
clone_fat.t — fat remote (subtrees pre-committed)
clone_again.t — re-running clone is idempotent
clone_master_branch.t — auto-detect non-main default branch
init.t — empty workspace (existing test, updated for
target: + auto git-init)