Zero-dependency Block Buzz Nostr relay messaging, NIP-01/NIP-19 secp256k1 key hygiene, 6-surface relay health audit, and hash-locked publishing CLI (legends-buzz) for coding agents: route all 26 Block Buzz domains and 108 subcommands without an ambient MCP daemon, diagnose NIP-OA vs NIP-FI channel membership 403s, reconstruct connected kind:9 reply threads, inspect untrusted media across five security gates, and attach operational relay runbooks to legends-empire.
Install or update legends-buzz via cto-legends (https://github.com/avalonreset/cto-legends): run `cto-legends install legends-buzz --apply`, then `cto-legends handoff legends-buzz` and follow the returned JSON recipe to verify `legends-buzz doctor --json`.
Teams and coding agents deploying or automating self-hosted Block Buzz and Block Buzz App Nostr relays run into four operational traps:
- Ambient MCP daemon overhead and secret key sprawl: Loading a persistent 30-tool chat MCP server per repository burns thousands of startup context tokens, duplicates Nostr private key state across background processes, and breaks when switching relays. Meanwhile, the native
buzzCLI already exposes all 26 command domains and 108 subcommands with token-compact--format agentoutput. - Residual HTTP
403on private channels despite valid cryptographic auth: A validBUZZ_PRIVATE_KEY(NIP-OA/NIP-42) passes cryptographic verification while/_readinessand/healthreturn200 OK, yet channel reads fail with exit code3(403 relay_membership_required) when a relay admin's pubkey is missing from the per-channelNIP-FI(kind:39002) member list or has not redeemed an/invite/<token>onboarding link. - Windows NTFS
Buzz.exevsbuzz.exebinary collisions: When the Tauri GUI desktop app (Buzz.exe,IMAGE_SUBSYSTEM_WINDOWS_GUI) and the headless Rust CLI (buzz.exe,IMAGE_SUBSYSTEM_WINDOWS_CUI) share a case-insensitive Windows NTFS directory, installing the desktop client overwrites the CLI binary and causes automated agent calls to pop open a GUI window and hang. - Floating
:latestcontainer downgrades and untrusted channel attachments: Pulling floatingghcr.io/block/buzz:latestimages against a PostgreSQL 17 database with newer SQLx migrations causesbuzz-relayto crash-loop withMigrateError::VersionMissing, while opening raw channel attachments withoutimetahash binding or XML/ZIP guards exposes agents to spoofed payloads.
legends-buzz solves these with a zero-dependency Python 3.11+ standard-library CLI that enforces BIP-173 Bech32 nsec1/npub1 and 64-character hex key hygiene, Windows PE subsystem verification, SSRF-hardened 6-surface relay probes, connected kind:9 reply thread isolation, 5-gate zero-trust attachment inspection, preview-first SHA-256 mutation locks, and an attachable legends-empire knowledge pack.
Once cto-legends is installed, you ask your coding agent in plain english. It maps the exact buzz CLI route, probes the relay or reconstructs the thread read-only first, and locks any live canary write behind a SHA-256 confirmation hash:
Before invoking a single relay operation, legends-buzz enforces strict local credential, binary, and routing boundaries:
- Full BIP-173 Bech32 and hex64 key validation with automatic output scrubbing:
classify_key()andnormalize_pubkey()validate mixed-case rules, exact 63-character lengths, BIP-173 polymod checksums, and 64-character hex public keys (nsec1...,npub1..., andhex64). Secret keys (BUZZ_PRIVATE_KEY,BUZZ_NSEC,BUZZ_PRIVATE_KEY_HEX) and federated identity tokens (BUZZ_FEDERATED_IDENTITY_TOKEN) are passed strictly via child process environment variables (shell=False), never via CLI flags, andscrub_secrets()redacts them from all stdout, stderr, and error traces. - Pre-resolve symlink refusal and Windows PE subsystem verification (
legends_buzz/desktop.py): Before executingbuzz.exeon Windows,legends-buzzinspects the Portable Executable Optional HeaderSubsystemfield. If a binary reportsIMAGE_SUBSYSTEM_WINDOWS_GUI(2) instead ofIMAGE_SUBSYSTEM_WINDOWS_CUI(3),legends-buzzrefuses to launch the GUI executable, falls back tobin\buzz.exe, and flagsntfs_buzz_exe_case_collisionindesktop-auditanddoctor.
Every subcommand in legends-buzz emits deterministic JSON (--json) or Markdown (--format markdown) with canonical channel UUID and 64-character hex event validation to prevent subprocess option injection:
| Surface | legends-buzz Subcommands |
What It Does |
|---|---|---|
| Runtime, Grammar & PE Audit | doctor, resources, cli-inventory, desktop-audit |
Verifies Python 3.11+ readiness, packaged knowledge-pack hashes, installed buzz CLI grammar (--format agent and NIP-FI support), Windows PE CUI vs GUI headers, and embedded WebView assets. |
| 26-Domain MCP-to-CLI Router | mcp-map [--domain <d>] [--intent <q>] |
Maps all 26 Block Buzz command domains and 108 subcommands (messages, channels, projects, repos, mem, sidebar, huddles, moderation, workflows, notes) to exact buzz CLI calls (--format agent) and exit codes (0..5). |
| 6-Surface SSRF-Guarded Probe | relay-probe --relay <url> |
Pinned-IP HTTPS/WSS probe verifying /_readiness, /health, NIP-11 relay metadata (Accept: application/nostr+json), Tauri WebView CORS (Origin: tauri://localhost), /invite/* CSP onboarding edge, and /pair RFC 6455 WebSocket 101 Switching Protocols (buzz-pair-relay) without following redirects. |
| Membership & Owner Governance | membership-check, owner-access-audit |
Distinguishes active member access from residual_403 (relay_membership_required needing /invite/<token>) and nip_fi_required, and audits explicit owner/admin role coverage across visible channels using Bech32 npub1... or 64-character hex pubkeys. |
Channel Snapshots & kind:9 Threads |
channel-snapshot, thread-context |
Captures channel metadata, member rosters, collaborative Markdown canvases, and recent messages, or walks Nostr kind:9 ["e", "<parent_id>"] reply tags to isolate the exact connected conversation component without unrelated shared-channel chatter. |
| 5-Gate Zero-Trust Media Inspector | media-inspect |
Verifies same-relay HTTPS origin, /media/<64hex> path binding, event NIP-92 imeta tag binding, SHA-256 digest, and magic bytes before bounded .docx/.xlsx/.csv/.json/.md extraction with full-buffer Expat XXE and zip-bomb stream ceilings. |
| Hash-Locked Canary & Blueprints | message-canary, relay-upgrade-plan, blueprint |
Computes a zero-write plan_sha256 preview before executing send -> get -> reactions add -> reactions remove -> delete with guaranteed finally: cleanup, generates 8-gate isolated --internal Docker Postgres 17 migration plans, and emits 9 server/ACP blueprints. |
- 9 production relay and ACP agent blueprints (
legends-buzz blueprint): Emit ready-to-review configurations fordocker-compose-traefik,docker-compose-caddy,mobile-invite-edge,postgres-migration-49-60-preflight,stage-upgrade-verify,acp-subscription-agent,isolated-subscription-acp-launcher,durable-bridge-guard, andsystemd-alert-timer. - Attachable
legends-empireknowledge pack (knowledge/buzz/pack.json): Ships with alegends.knowledge-pack/v1operational library and wiki/index.md covering 26-domain CLI routing,NIP-OAvsNIP-FIidentity troubleshooting, zero-downtime Postgres 17 relay upgrades, and private operation receipt templates (templates/private-operation-receipt.md).
# 1. Verify offline readiness, CLI capability inventory, and Windows Desktop PE safety
legends-buzz doctor --json
legends-buzz resources --json
legends-buzz cli-inventory --json
legends-buzz desktop-audit --json
# 2. Query the 26-domain / 108-subcommand MCP-to-CLI router
legends-buzz mcp-map --intent "unread channels and thread replies"
legends-buzz mcp-map --domain projects --format markdown
legends-buzz mcp-map --domain mem --format markdown
# 3. Probe all 6 relay surfaces and check authenticated channel membership
legends-buzz relay-probe --relay https://buzz.example.com --json
legends-buzz membership-check --relay https://buzz.example.com --env-file buzz.env --json
# 4. Audit owner governance, snapshot a channel, isolate a kind:9 thread, and inspect media
legends-buzz owner-access-audit --relay https://buzz.example.com --env-file buzz.env --expected-pubkey <owner-npub-or-hex> --json
legends-buzz channel-snapshot --relay https://buzz.example.com --env-file buzz.env --channel <channel-uuid> --limit 10 --json
legends-buzz thread-context --relay https://buzz.example.com --env-file buzz.env --channel <channel-uuid> --event <64hex-event-id> --limit 20
legends-buzz media-inspect --relay https://buzz.example.com --env-file buzz.env --channel <channel-uuid> --event <64hex-event-id> --url https://buzz.example.com/media/<64hex-sha256>.csv --sha256 <64hex-sha256> --mime text/csv --extract-mode data
# 5. Preview and apply a hash-locked disposable message canary
legends-buzz message-canary --relay https://buzz.example.com --env-file buzz.env --channel <test-channel-uuid>
legends-buzz message-canary --relay https://buzz.example.com --env-file buzz.env --channel <test-channel-uuid> --apply --confirm-plan <plan_sha256>
# 6. Generate an 8-gate relay upgrade plan and inspect production blueprints
legends-buzz relay-upgrade-plan --relay https://buzz.example.com --target-digest ghcr.io/block/buzz@sha256:<digest> --format markdown
legends-buzz blueprint --list
legends-buzz blueprint --name docker-compose-traefik --output docker-compose.ymlKnowledge vault, relay runbooks, and legends-empire integration
Start at wiki/index.md or attach the versioned knowledge pack at knowledge/buzz/pack.json (legends.knowledge-pack/v1). Attach into a legends-empire vault or read it directly as plain Markdown.
- Operational runbooks: Block Buzz Knowledge Vault Index, Knowledge Pack & Empire Attachment Guide, Release & Verification Procedure, and Primary Sources & Citations.
- Private operating templates: Use templates/private-operation-receipt.md, templates/relay-upgrade-receipt.md, and templates/canary-verification-receipt.md to keep private relay inventories, migration rehearsals, and canary receipts in your own vault outside public repositories.
Agent setup (via cto-legends) and standalone installation
Part of the cto-legends ecosystem. cto-legends is the only registered skill; this repository vendors a pinned copy at skills/cto-legends/SKILL.md.
The product, repository, Python distribution, and catalog ID are legends-buzz.
Install with cto-legends install legends-buzz, then follow the module recipe the router loads (docs/AGENT-RECIPE.md). Do not register this module as its own standalone skill.
git clone https://github.com/avalonreset/legends-buzz.git
cd legends-buzz
python -m pip install -e .
legends-buzz doctor --json
legends-buzz resources --jsonPass BUZZ_PRIVATE_KEY (nsec1... or 64-character hex) and BUZZ_RELAY_URL via the process environment or --env-file <path>. Never pass private keys on command-line flags.
Repository layout, verification, and FAQ
Operator / Agent
-> legends-buzz CLI (doctor, resources, mcp-map, cli-inventory, desktop-audit, relay-probe)
-> Read-only governance & thread isolation (membership-check, owner-access-audit, channel-snapshot, thread-context, media-inspect)
-> Preview-first canary plan builder (plan_sha256, writes_sent=0) + explicit --apply --confirm-plan
-> Guaranteed finally: cleanup delete + attachable legends-empire knowledge pack
legends_buzz/: Zero-dependency Python 3.11+ CLI (cli.py), SSRF-hardened relay probes and 5-gate media inspector (api.py), 26-domain MCP-to-CLI reference router (mcp_map.py), Windows PE and WebView asset auditor (desktop.py), 9 production blueprints (blueprints.py), and packaged resource resolver (resources.py).wiki/andknowledge/buzz/: Source-cited Block Buzz and Nostr NIP-29/NIP-OA/NIP-FI runbooks and attachablelegends-empireknowledge pack.docs/: Agent Operating Recipe, Knowledge Pack & Empire Attachment Guide, and Release & Verification Procedure.
python -m unittest discover -s tests -v
python scripts/check_release.py- Do I need an ambient MCP daemon to let AI agents use Block Buzz? No. The standalone
buzzCLI natively supports all 26 command domains and 108 subcommands with--format agent(stripping 64-byte Schnorr signatures andNIP-OAauth boilerplate while foldingNIP-10thread markers intoreply_toandthread_root).legends-buzz mcp-mapgives any agent instant lookup of exact CLI syntax and exit code semantics (0..5). - How does
legends-buzzprevent the WindowsBuzz.exevsbuzz.execollision? Before invokingbuzz.exeon Windows,legends-buzzinspects its Portable Executable Optional HeaderSubsystemfield and refuses to executeIMAGE_SUBSYSTEM_WINDOWS_GUI(2) binaries as a CLI subprocess.
See CONTRIBUTING.md, SUPPORT.md, CODE_OF_CONDUCT.md, SECURITY.md, and CHANGELOG.md.
MIT License. See LICENSE, NOTICE.md, and THIRD_PARTY_NOTICES.md.
Paste the agent handoff block at the top of this page into your coding agent, let it wire the cto-legends router skill, and speak your task in plain English.
Running a company and not a terminal? Founders and operators who want this way of working applied directly to their own business stack have one route: message Avalon Reset at cto-legends.com/dm or start with a 48-hour diagnostic at cto-legends.com/home#home-offer. The desk is async, so the conversation starts the moment you write and nobody forces you onto a sales call.
Specification & benchmarks on cto-legends.com:
- Module specification & architecture matrix: cto-legends.com/modules/legends-buzz
- Related engineering dispatches: MCP vs CLI: The 46x Token Tax & Prompt-Cache Architecture · AI Agent Governance: PreToolUse Kernel Gates & Context Compaction · Hetzner vs DigitalOcean: Sovereign Bare-Metal & Coolify TCO
- Ecosystem hub: cto-legends.com/home
