Integrate BACKBEAT SDK and resolve KACHING license validation

Major integrations and fixes:
- Added BACKBEAT SDK integration for P2P operation timing
- Implemented beat-aware status tracking for distributed operations
- Added Docker secrets support for secure license management
- Resolved KACHING license validation via HTTPS/TLS
- Updated docker-compose configuration for clean stack deployment
- Disabled rollback policies to prevent deployment failures
- Added license credential storage (CHORUS-DEV-MULTI-001)

Technical improvements:
- BACKBEAT P2P operation tracking with phase management
- Enhanced configuration system with file-based secrets
- Improved error handling for license validation
- Clean separation of KACHING and CHORUS deployment stacks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-09-06 07:56:26 +10:00
parent 543ab216f9
commit 9bdcbe0447
4730 changed files with 1480093 additions and 1916 deletions

View File

@@ -5,25 +5,25 @@ import (
"fmt"
)
// GossipPublisher is a thin wrapper around the BZZZ PubSub system that
// GossipPublisher is a thin wrapper around the CHORUS 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.
// NewGossipPublisher creates a new HMMM adapter for the CHORUS 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.
// routing logic and CHORUS'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.
// 1. Joins the dynamic topic (e.g., "CHORUS/meta/issue/42") to ensure message delivery.
// 2. Publishes the byte payload directly, bypassing the standard CHORUS 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.

View File

@@ -128,12 +128,12 @@ func NewPubSub(ctx context.Context, h host.Host, bzzzTopic, hmmmTopic string) (*
// NewPubSubWithLogger creates a new PubSub instance with hypercore logging
func NewPubSubWithLogger(ctx context.Context, h host.Host, bzzzTopic, hmmmTopic string, logger HypercoreLogger) (*PubSub, error) {
if bzzzTopic == "" {
bzzzTopic = "bzzz/coordination/v1"
bzzzTopic = "CHORUS/coordination/v1"
}
if hmmmTopic == "" {
hmmmTopic = "hmmm/meta-discussion/v1"
}
contextTopic := "bzzz/context-feedback/v1"
contextTopic := "CHORUS/context-feedback/v1"
pubsubCtx, cancel := context.WithCancel(ctx)
@@ -269,19 +269,19 @@ func (p *PubSub) JoinRoleBasedTopics(role string, expertise []string, reportsTo
// Join role-specific topic
if role != "" {
roleTopic := fmt.Sprintf("bzzz/roles/%s/v1", strings.ToLower(strings.ReplaceAll(role, " ", "_")))
roleTopic := fmt.Sprintf("CHORUS/roles/%s/v1", strings.ToLower(strings.ReplaceAll(role, " ", "_")))
topicsToJoin = append(topicsToJoin, roleTopic)
}
// Join expertise-specific topics
for _, exp := range expertise {
expertiseTopic := fmt.Sprintf("bzzz/expertise/%s/v1", strings.ToLower(strings.ReplaceAll(exp, " ", "_")))
expertiseTopic := fmt.Sprintf("CHORUS/expertise/%s/v1", strings.ToLower(strings.ReplaceAll(exp, " ", "_")))
topicsToJoin = append(topicsToJoin, expertiseTopic)
}
// Join reporting hierarchy topics
for _, supervisor := range reportsTo {
supervisorTopic := fmt.Sprintf("bzzz/hierarchy/%s/v1", strings.ToLower(strings.ReplaceAll(supervisor, " ", "_")))
supervisorTopic := fmt.Sprintf("CHORUS/hierarchy/%s/v1", strings.ToLower(strings.ReplaceAll(supervisor, " ", "_")))
topicsToJoin = append(topicsToJoin, supervisorTopic)
}
@@ -303,7 +303,7 @@ func (p *PubSub) JoinProjectTopic(projectID string) error {
return fmt.Errorf("project ID cannot be empty")
}
topicName := fmt.Sprintf("bzzz/projects/%s/coordination/v1", projectID)
topicName := fmt.Sprintf("CHORUS/projects/%s/coordination/v1", projectID)
return p.JoinDynamicTopic(topicName)
}
@@ -353,7 +353,7 @@ func (p *PubSub) PublishToDynamicTopic(topicName string, msgType MessageType, da
}
// PublishRaw publishes a raw JSON payload to the given topic name without
// wrapping it in the BZZZ Message envelope. Intended for HMMM per-issue rooms
// wrapping it in the CHORUS Message envelope. Intended for HMMM per-issue rooms
// or other modules that maintain their own schemas.
func (p *PubSub) PublishRaw(topicName string, payload []byte) error {
// Dynamic topic
@@ -645,7 +645,7 @@ func (p *PubSub) processBzzzMessage(msg Message, from peer.ID) {
"from_short": from.ShortString(),
"timestamp": msg.Timestamp,
"data": msg.Data,
"topic": "bzzz",
"topic": "CHORUS",
}
// Map pubsub message types to hypercore log types

View File

@@ -7,7 +7,7 @@ import (
// Note: This is a light test around name routing; full pubsub requires network.
func TestPublishRaw_NameRouting_NoSubscription(t *testing.T) {
// Build a minimal PubSub with names set but no subscriptions.
p := &PubSub{ bzzzTopicName: "bzzz/coordination/v1", hmmmTopicName: "hmmm/meta-discussion/v1", contextTopicName: "bzzz/context-feedback/v1" }
p := &PubSub{ bzzzTopicName: "CHORUS/coordination/v1", hmmmTopicName: "hmmm/meta-discussion/v1", contextTopicName: "CHORUS/context-feedback/v1" }
if err := p.PublishRaw("nonexistent/topic", []byte("{}")); err == nil {
t.Fatalf("expected error for unknown topic")
}