Skip to content

feat: hive peer store with crypto signing, mDNS discovery, gossip protocol#369

Merged
elasticdotventures merged 11 commits into
mainfrom
feat/hive-peer-store-crypto-mdns
May 4, 2026
Merged

feat: hive peer store with crypto signing, mDNS discovery, gossip protocol#369
elasticdotventures merged 11 commits into
mainfrom
feat/hive-peer-store-crypto-mdns

Conversation

@elasticdotventures

Copy link
Copy Markdown
Owner

Summary

Hive peer discovery and trust infrastructure:

Cryptographic Peer Store

  • Ed25519 signing of peer facts via HiveIdentity (auto-generated keypair at ~/.b00t/hive-identity.key)
  • IrontologyPeerStore with SQLite backend, FactRecord model
  • Signature verification on load, tamper detection, legacy data fallback
  • PeerStore trait with FilePeerStore bootstrap fallback

mDNS Discovery & Gossip

  • b00t hive peers discover — real mDNS LAN scan via mdns-sd crate
  • advertise_hive_peer() — register this node as _b00t-hive._tcp.local
  • gossip_with_peer() — query random peer's list, merge unknown peers
  • start_gossip_loop() — background anti-entropy convergence

CLI & UX

  • b00t hive peers add <id> <address> — register in signed ledger
  • b00t hive peers remove <id> — remove from ledger
  • b00t hive peers prune --older-than 30d — garbage collect stale peers
  • b00t hive peers list --health — parallel health checks on all peers
  • 🥾 branding on all guard interposition output
  • JSONL structured output for --dry-run mode

Template Engine

  • {{ jinja }} expression resolution in .tomllmd configs via Tera
  • hostname() and env(name='VAR') template functions

Dependencies Added

  • mdns-sd (mDNS discovery)
  • ed25519-dalek + sha2 + hex + zeroize (crypto signing)
  • rand (random peer selection for gossip)

Copilot AI review requested due to automatic review settings May 4, 2026 02:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@elasticdotventures elasticdotventures force-pushed the feat/hive-peer-store-crypto-mdns branch from 520584d to 7fd406d Compare May 4, 2026 02:53
…, violation persistence

- Guard violation counter with JSONL persistence (~/.b00t/guard-violations.jsonl)
- 🦨→💩 escalation: Warn→Block when violation_count >= repeat_threshold
- check_guards() auto-persists violations on every match
- K0mmand3rStage guards: pattern = { stage = "pre_parse" } in hive-guards.hive.toml
- parser_stages wired into KmdLine::parse() at 7 phases
- b00t-ast CLI binary: b00t-ast dir <path> [--format json|mcp|counts]
- b00t-py: guard_check, emoji_lookup, register_stage_guard bindings
- KmdLine fields made pub for serde serialization
- Schema datums moved to _b00t_/schema/ (uppercase convention)
- k0mmand3r crate edition 2024, clean lints
- Rust 2024: #![allow]→removed, set_var unsafe wrappers
- b00t_env_backend.py promoted from DESIGN to working Python backend
- Hermes backend symlinked: just hermes-backend-enable
…ite patch

Vendor submodule pointing to PromptExecution/hermes-agent-b00t on
feat/pre-tool-rewrite-hook branch. Contains the get_pre_tool_call_directives()
patch required for b00t guard interposition via Hermes plugin hooks.

Upstream PR: NousResearch/hermes-agent#19305
Internal PR: PromptExecution/hermes-agent-b00t#1
…ventional commits

New hive guards block or warn before git commands reach the shell:
- BLOCK: git checkout main/master — use feature branches
- BLOCK: git push origin main — use PRs instead
- BLOCK: git merge main — use gh pr merge
- WARN: git checkout -b without type/ — use feat/fix/chore/ prefix
- WARN: git commit -m without colon — use Conventional Commits format
- Registered regex_match(cmd, pattern) on Rhai engine in hive.rs
  for future guard pattern matching
- Added 5 SCM guards to hive-guards.hive.toml:
  BLOCK: git checkout main/master, git push origin main, git merge main
  WARN: branch without type/ prefix, commit without conventional format
- All guards use simple cmd.contains() — readable, no escaping hell
Bumps vendor/hermes-agent-b00t to include the new plugins/b00t/
directory with pre_tool_call hook that routes terminal commands
through b00t hive run --dry-run guard evaluation.
@elasticdotventures elasticdotventures force-pushed the feat/hive-peer-store-crypto-mdns branch from fcd3926 to 6e0bacf Compare May 4, 2026 02:55
@elasticdotventures

Copy link
Copy Markdown
Owner Author

@copilot MECE good-faith critical review of code only

Copilot AI and others added 2 commits May 4, 2026 03:10
@elasticdotventures elasticdotventures merged commit 9b58884 into main May 4, 2026
3 of 4 checks passed
@elasticdotventures elasticdotventures deleted the feat/hive-peer-store-crypto-mdns branch May 4, 2026 03:11
Copilot stopped work on behalf of elasticdotventures due to an error May 4, 2026 03:11
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.

3 participants