Skip to content

feat(base): HIP-0110 ZAP server for forward + reverse push#7

Open
hanzo-dev wants to merge 4 commits into
mainfrom
feat/hip-0110-gateway-edge-process
Open

feat(base): HIP-0110 ZAP server for forward + reverse push#7
hanzo-dev wants to merge 4 commits into
mainfrom
feat/hip-0110-gateway-edge-process

Conversation

@hanzo-dev
Copy link
Copy Markdown
Member

Summary

  • Adds internal/zap/server.go — the HIP-0110 surface on top of base's existing plugins/zap socket.
  • Two handlers registered on upper-half message IDs that don't collide with the legacy plugins/zap IDs:
    • MsgTypeForward (0x1010) — decodes the gateway→base envelope and delegates to a pluggable Dispatcher.
    • MsgTypeSubscribe (0x1030) — records (ConnID, collection) → gateway peer ID for reverse-push routing.
  • Server.BroadcastRecord produces MsgTypePush envelopes when a record changes — pre-encoded SSE / WS frame, no JSON re-marshaling.
  • Reuses base's realtime subscription pattern; introduces no new pubsub.

Test plan

  • go build ./internal/zap/...
  • Unit test for Forward decode + dispatcher call
  • Integration: gateway dials base ZAP socket, sends Subscribe, base broadcasts Push back, gateway delivers to in-memory PushSink

hanzo-dev added 4 commits May 19, 2026 11:15
Replace dirs broke CI because sibling repos don't exist on the runner.
Switch to:
- hanzoai/zip v0.2.0 (tagged release)
- hanzoai/cloud v0.1.1-0.20260519183759-098489930d01 (resolvable pseudo-version from main)

Transitive bumps from go mod tidy:
- luxfi/age v1.4.0 → v1.5.0
- luxfi/math v1.2.3 → v1.2.4
- luxfi/metric v1.5.0 → v1.5.1
- hanzoai/dbx v1.15.0 → v1.16.0
- cloud.google.com/go/storage v1.51.0 → v1.59.2
- otel v1.40.0 → v1.43.0
- modernc.org/sqlite v1.49.1 → v1.50.0

Local dev still works via either a workspace go.work or explicit `go work init`
plus a directory replace in their own go.work — no longer baked into go.mod.
Aligns base internal/zap/server.go with github.com/hanzoai/gateway/zap_wire.go.
Constants were 0x1010/0x1020/0x1030; zap.FinishWithFlags shifts type<<8 into
the upper byte of a uint16, so types > 0xFF overflow. Repinned to 0x80/0x81/0x82
to match the gateway side.
@hanzo-dev hanzo-dev force-pushed the feat/hip-0110-gateway-edge-process branch from a06704f to d644b8e Compare May 29, 2026 19:57
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.

1 participant