mirror of
https://github.com/hanzoai/base.git
synced 2026-10-21 03:41:50 +00:00
* feat(base): cloud.Mount entry point per HIP-0106 Adds pkg/base/mount.go exposing the canonical Mount(app *zip.App, deps cloud.Deps) error contract. cmd/cloud imports this package via the blank-import side-effect; init() registers base with cloud.Registry at order 60 — after iam (50) and kms (10) so the per-tenant SQLite substrate is up before subsystems that need it. The mount strategy is "wrap, don't rewrite": Mount constructs a Base instance with the per-deployment data dir, runs the existing Bootstrap (data + aux DB, migrations, cached collections, settings reload), builds the http.Handler from apis.NewRouter(app).BuildMux(), and attaches it under /v1/base/* + /healthz via zip's net/http adaptor. /v1/base/health and /v1/base/readyz are native zip handlers so probes work even when Bootstrap refuses to boot. DATA_DIR and BASE_API_PREFIX env vars are set inside Mount so Base's NewWithConfig path picks up the cloud-scoped data directory and the /v1/base prefix without any flag wiring. go.mod gains require + replace stanzas for hanzoai/cloud and hanzoai/zip; matches the kms / vfs convention. The standalone base binary is unchanged. schema/base.zap declares the minimum ZAP-typed surface (Health) needed by the Mount contract; richer ZAP handlers will land alongside the in-process BaseClient interface from cloud/pkg/cloud/deps.go. * refactor: collapse pkg/base/ → root for clean import path Subsystem code lives in package base at repo root. Importers now use `github.com/hanzoai/base` (no /pkg/base/ nesting). Standalone shim moved to cmd/base/ where applicable. Per Hanzo Go-stdlib pattern: repo IS the package. * refactor: flatten import path — github.com/hanzoai/cloud (drop /pkg/cloud)