Skip to content

feat(cloud-mount): port commerce to HIP-0106 Mount(*zip.App, cloud.Deps)#28

Merged
hanzo-dev merged 3 commits into
mainfrom
feat/cloud-mount
May 19, 2026
Merged

feat(cloud-mount): port commerce to HIP-0106 Mount(*zip.App, cloud.Deps)#28
hanzo-dev merged 3 commits into
mainfrom
feat/cloud-mount

Conversation

@hanzo-dev
Copy link
Copy Markdown
Member

Summary

  • Add pkg/commerce/Mount(*zip.App, cloud.Deps) error (build tag cloud) per HIP-0106.
  • The legacy gin engine is brought up via the existing Embed() and adapted under /v1/commerce + /_/commerce via zip.AdaptNetHTTP — one trust boundary, one route surface, no rewrites of every handler.
  • Native zip /_/commerce/healthz is independent of the gin engine so probes survive a router-wide outage.
  • PCI scope guard: Mount() warns loudly on startup if deps.Payments / deps.Vault is nil — commerce is a LIGHT ROUTER, NOT in PCI-DSS scope per HIP-0106. Token handling only.

Wiring

  • init() registers ("commerce", order=100) in cloud.Registry.
  • DataDir flows from deps.DataDir for per-tenant SQLite per HIP-0302.
  • Imports gated by //go:build cloud so the standalone cmd/commerce + cmd/commerced binaries keep building without pulling hanzoai/cloud + hanzoai/zip.

Build hygiene

Two unrelated transitive failures fixed (commerce was broken at HEAD before this PR — go mod tidy would not complete):

  • Pin github.com/luxfi/lens v0.1.4 and github.com/luxfi/pulsar v1.0.9 via replace; the chain through luxfi/threshold was pulling unpublished rc tags (v0.1.0-rc1-pq-consensus-freeze).
  • Local ../cloud and ../zip replaces so the Mount signature evolves in lockstep.

Test plan

  • go build ./... clean
  • go build ./cmd/commerce ./cmd/commerced clean (legacy binaries unaffected)
  • go test ./pkg/commerce/... — existing TestEmbed* still pass
  • go test -tags=cloud ./pkg/commerce/... — new TestMount_RegistersHealth passes; native /_/commerce/healthz returns 200 with {"service":"commerce"}.
  • Smoke-test inside ~/work/hanzo/cloud once the matching cmd/cloud import lands (other-agent territory per the task brief).

zatsch added 3 commits May 18, 2026 22:12
Add pkg/commerce/mount.go exposing the canonical HIP-0106 contract so
the unified hanzoai/cloud binary can co-resident the checkout router
without reimplementing every handler. The legacy gin engine is brought
up via the existing Embed() and adapted under /v1/commerce and
/_/commerce via zip.AdaptNetHTTP — one trust-boundary, one route surface.

PCI scope guard: commerce is a LIGHT ROUTER, NOT in PCI-DSS scope.
Mount() warns loudly on startup if deps.Payments / deps.Vault are nil
(payment paths fail closed; tenant config + admin still served).

Wiring:
- init() registers ("commerce", order=100) in cloud.Registry
- /_/commerce/healthz is native zip — independent of the gin engine
- DataDir flows from deps.DataDir for per-tenant SQLite per HIP-0302

Build hygiene:
- pin github.com/luxfi/lens v0.1.4 + github.com/luxfi/pulsar v1.0.9 via
  replace; the transitive chain through luxfi/threshold pulled unpublished
  rc tags ("v0.1.0-rc1-pq-consensus-freeze") that broke `go mod tidy` for
  every caller.
- pin github.com/hanzoai/cloud + github.com/hanzoai/zip via local ../
  replace so the Mount signature evolves in lockstep.

Tests:
- new TestMount_RegistersHealth boots a fresh zip.App, mounts commerce,
  asserts the /_/commerce/healthz route answers via fiber.
- existing TestEmbed* still pass; cmd/commerce + cmd/commerced still build.

Schema: schema/commerce.zap describes Health + Tenant service for the
zapc codegen path.
Subsystem code lives in package commerce at repo root. Importers now use
`github.com/hanzoai/commerce` (no /pkg/commerce/ nesting). Standalone shim moved
to cmd/commerce/ where applicable.

Per Hanzo Go-stdlib pattern: repo IS the package.
@hanzo-dev hanzo-dev merged commit 7bdaaad into main May 19, 2026
2 of 3 checks passed
@hanzo-dev hanzo-dev deleted the feat/cloud-mount branch May 19, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants