Files
bzzz/docs/WEBHOOK_CALLS.md
anthonyrawlins 92779523c0 🚀 Complete BZZZ Issue Resolution - All 17 Issues Solved
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>
2025-08-29 12:39:38 +10:00

54 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Webhook Calls Reference (Model Selection & Escalation)
This note lists concrete call sites and related configuration for replacing external webhooks with local model logic. Paths include line numbers to jump directly in your editor.
## Model Selection Webhook
- project-queues/active/BZZZ/reasoning/reasoning.go
- L8792: `SetModelConfig` stores `models`, `webhookURL`, and default model.
- L94151: `selectBestModel(...)` chooses model via webhook; POST occurs at L115.
- L147151: `GenerateResponseSmart(...)` uses `selectBestModel` before calling Ollama.
- project-queues/active/BZZZ/main.go
- L809860: `selectBestModel(...)` variant (same behavior); POST occurs at L830.
- L893896: `reasoning.SetModelConfig(validModels, cfg.Agent.ModelSelectionWebhook, cfg.Agent.DefaultReasoningModel)` wires config into reasoning.
- project-queues/active/BZZZ/pkg/config/config.go
- L6668: `AgentConfig` includes `ModelSelectionWebhook` and `DefaultReasoningModel`.
- L272274: Default `ModelSelectionWebhook` and `DefaultReasoningModel` values.
## Chat Callback Webhook (N8N Chat Workflow)
- project-queues/active/BZZZ/cmd/chat-api/main.go
- L331350: `sendCallback(...)` posts execution results to `webhookURL` via `http.Client.Post` (N8N workflow callback).
- L171174: Callback trigger after task execution completes.
## Escalation Webhook (Human Escalation)
- project-queues/active/BZZZ/pkg/config/config.go
- L91101: `P2PConfig` includes `EscalationWebhook` and related thresholds.
- L288291: Default `EscalationWebhook` and escalation keywords.
- project-queues/active/BZZZ/pkg/config/defaults.go
- L63, L69, L75: Environmentspecific defaults for `EscalationWebhook`.
- Call sites in Go code
- No direct HTTP POST to `EscalationWebhook` found. Current escalation flows publish on PubSub and log:
- project-queues/active/BZZZ/github/integration.go
- L274292: On PR creation failure, builds an escalation reason; calls `requestAssistance(...)` (PubSub), not a webhook.
- L302317: `requestAssistance(...)` publishes `TaskHelpRequest` to the task topic.
- L260300, L319360: Collaboration handlers; `triggerHumanEscalation(...)` (L340sL350s region) logs instead of calling a webhook.
## Pointers for Local Replacement
- Replace webhook POSTs:
- reasoning: swap `http.Post(modelWebhookURL, ...)` at reasoning.go:L115 with direct local model selection (heuristics or local LLM call).
- main.go: same replacement at L830 if you retain this variant.
- chat-api: optionally bypass `sendCallback` (L331350) or point to a local HTTP receiver.
- Escalation: implement a small helper that calls your local model/service and invoke it from `github/integration.go` where escalation reasons are produced (around L280282), or from `pkg/coordination/meta_coordinator.go` escalation paths (see `escalateSession(...)`).
---
If you want, I can stub a `localselection` package and replace these call sites with a zerodependency selector that queries Ollama directly.