feat: auto-provision companion Dolt DBs from git.sr.ht pushes
Add a service-to-service path so pushing a git.sr.ht repo creates a matching
Dolt database at ~owner/name, ready before the user's first `dolt push`.
- web: POST /internal/repos, guarded by internal-IP + network-key `Internal`
auth (not the browser cookie/CSRF). Resolves/mirrors the owner via
auth.LookupUser, then CreateRepo + InitStore, rolling back the row if the
store init fails. Idempotent: an existing companion returns 200, a fresh one
201 — safe to call on every push.
- cmd/dolt-git-hook: the git.sr.ht post-update-script. Delegates every hook
stage to the stock /usr/bin/git.sr.ht-update-hook unchanged (argv[0], stdin,
env, exit code preserved; fail-closed if the delegate is missing), then on
post-update POSTs the companion create and prints a one-time clone notice.
Best-effort: never fails a push, degrades to a warning on any misconfig.
Tests cover the endpoint (provision/idempotent/rollback/bad-input) and the hook
(signed request round-trips through the guard's decryption, notice only on 201).
feat(web): pluggable alternative-view registry for repositories
A repository can now expose specialized, read-only "views" chosen by the
shape of its tables, while the generic table browser stays available as a
fallback. A View fingerprints the tables (Applies), builds a model from
the browse layer (Build), and renders its own template; views register at
init time via RegisterView and are dispatched by slug at
/~user/db/view/{slug}. The overview shows a tab per applicable view.
The template loader parses each registered view's template with the
shared chrome, so a new view plugs in by adding two files (its .go with
init()+RegisterView and its .html) plus nothing else — no edits to the
registry, router, loader, or handlers. Build receives the request query
values so a view can offer sub-modes (e.g. a detail pane). No SQL engine
is involved; views read through the existing BrowseSession surface.
rename module to sourcecraft.dev/bigbes/sr-ht-dolt; depend on sourcecraft sr-ht-core
web: router, handlers, and sourcehut chrome
Chi route table per plan, SourceHut chrome port (nav/layout from
core.sr.ht Bootstrap structure), dual-flow clone box, dolt-key
association page with hash-fragment prefill, same-origin CSRF checks.
Handlers depend on small injected interfaces (StoreManager, RepoStore,
BrowseOpener, UserResolver) with production adapters included.