Comprehensive multi-agent implementation addressing all issues from INDEX.md: ## Core Architecture & Validation - ✅ Issue 001: UCXL address validation at all system boundaries - ✅ Issue 002: Fixed search parsing bug in encrypted storage - ✅ Issue 003: Wired UCXI P2P announce and discover functionality - ✅ Issue 011: Aligned temporal grammar and documentation - ✅ Issue 012: SLURP idempotency, backpressure, and DLQ implementation - ✅ Issue 013: Linked SLURP events to UCXL decisions and DHT ## API Standardization & Configuration - ✅ Issue 004: Standardized UCXI payloads to UCXL codes - ✅ Issue 010: Status endpoints and configuration surface ## Infrastructure & Operations - ✅ Issue 005: Election heartbeat on admin transition - ✅ Issue 006: Active health checks for PubSub and DHT - ✅ Issue 007: DHT replication and provider records - ✅ Issue 014: SLURP leadership lifecycle and health probes - ✅ Issue 015: Comprehensive monitoring, SLOs, and alerts ## Security & Access Control - ✅ Issue 008: Key rotation and role-based access policies ## Testing & Quality Assurance - ✅ Issue 009: Integration tests for UCXI + DHT encryption + search - ✅ Issue 016: E2E tests for HMMM → SLURP → UCXL workflow ## HMMM Integration - ✅ Issue 017: HMMM adapter wiring and comprehensive testing ## Key Features Delivered: - Enterprise-grade security with automated key rotation - Comprehensive monitoring with Prometheus/Grafana stack - Role-based collaboration with HMMM integration - Complete API standardization with UCXL response formats - Full test coverage with integration and E2E testing - Production-ready infrastructure monitoring and alerting All solutions include comprehensive testing, documentation, and production-ready implementations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
package pubsub
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
// GossipPublisher is a thin wrapper around the BZZZ PubSub system that
|
|
// satisfies the hmmm.PubSubAdapter interface. It ensures that HMMM messages
|
|
// are published as raw JSON payloads to dynamic, per-issue topics.
|
|
type GossipPublisher struct {
|
|
ps *PubSub
|
|
}
|
|
|
|
// NewGossipPublisher creates a new HMMM adapter for the BZZZ pubsub system.
|
|
func NewGossipPublisher(ps *PubSub) *GossipPublisher {
|
|
return &GossipPublisher{ps: ps}
|
|
}
|
|
|
|
// Publish ensures the agent is subscribed to the per-issue topic and then
|
|
// publishes the raw payload. This method is the primary bridge between HMMM's
|
|
// routing logic and BZZZ's underlying gossipsub network.
|
|
//
|
|
// It performs two key actions:
|
|
// 1. Joins the dynamic topic (e.g., "bzzz/meta/issue/42") to ensure message delivery.
|
|
// 2. Publishes the byte payload directly, bypassing the standard BZZZ message envelope.
|
|
func (g *GossipPublisher) Publish(ctx context.Context, topic string, payload []byte) error {
|
|
// 1. Ensure the node is subscribed to the dynamic topic.
|
|
// This is idempotent and safe to call multiple times.
|
|
if err := g.ps.JoinDynamicTopic(topic); err != nil {
|
|
return fmt.Errorf("hmmm adapter failed to join dynamic topic %s: %w", topic, err)
|
|
}
|
|
|
|
// 2. Publish the raw message payload to the topic.
|
|
if err := g.ps.PublishRaw(topic, payload); err != nil {
|
|
return fmt.Errorf("hmmm adapter failed to publish raw message to topic %s: %w", topic, err)
|
|
}
|
|
|
|
return nil
|
|
}
|