Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
587f982
Merge pull request #56 from hexdaemon/hardening/phase-b-c-version-ide…
santyr Feb 6, 2026
4e47279
Merge pull request #57 from hexdaemon/hardening/phase-b-c-version-ide…
santyr Feb 6, 2026
b87d717
Merge pull request #58 from lightning-goats/hardening/phase-b-c-versi…
santyr Feb 7, 2026
6571efb
Add image to THE_HIVE_ARTICLE.md
santyr Feb 7, 2026
af4483a
Merge pull request #61 from lightning-goats/hardening/phase-b-c-versi…
santyr Feb 7, 2026
4ad5107
Merge pull request #62 from lightning-goats/hardening/phase-b-c-versi…
hexdaemon Feb 7, 2026
a7256fa
fix: resolve stale member stats and null addresses (#59, #60)
santyr Feb 7, 2026
97b4ff8
fix: include uptime_pct and contribution_ratio in hive-status membership
santyr Feb 7, 2026
dc00090
Merge pull request #63 from lightning-goats/fix/issue-59-60-member-st…
hexdaemon Feb 7, 2026
66198cc
fix: routing pool and settlement bugs — formula alignment, period for…
santyr Feb 7, 2026
0f089db
fix: protocol security hardening — timestamp freshness, signature ver…
santyr Feb 7, 2026
752fd59
fix: RPC safety hardening — thread-safe proxying, crash-safe dict access
santyr Feb 7, 2026
e761bbe
fix: coordination logic hardening — race conditions, crashes, thread …
santyr Feb 7, 2026
c4ffbfc
feat: replace trustedcoin with vitality plugin
santyr Feb 8, 2026
6df2beb
docs: update .env.example - replace trustedcoin with vitality docs
santyr Feb 8, 2026
35c64f9
docs: update CHANGELOG for vitality/trustedcoin changes
santyr Feb 8, 2026
029cffd
fix: hardening across 12 untouched modules — crashes, logic errors, c…
santyr Feb 8, 2026
61c4d65
fix: thread safety, cache bounds, governance bypass, outbox retry
santyr Feb 8, 2026
d871c61
docs: update CHANGELOG for v2.2.8 release
santyr Feb 8, 2026
06cc7e2
chore: bump Docker image version to 2.2.8
santyr Feb 8, 2026
fb9c471
fix: repair broken pheromone fee learning loop between cl-hive and cl…
santyr Feb 8, 2026
656466e
fix: 10 bugs in cooperative rebalancing — crashes, thread safety, rou…
santyr Feb 8, 2026
64c9c0d
fix: 6 MCF coordination bugs — TypeError crashes, missing permission,…
santyr Feb 8, 2026
f8f07f3
fix: 7 HiveMap + Planner bugs — feerate gate, validation, freshness, …
santyr Feb 8, 2026
d818771
fix: add capabilities field validation in state_manager._validate_sta…
santyr Feb 8, 2026
cf37109
fix: replace private _mcf_assignments access with public get_all_assi…
santyr Feb 8, 2026
f82266c
feat(docker): add vitality config for Amboss pinging
santyr Feb 8, 2026
f267170
chore(docker): simplify vitality config to amboss-only
santyr Feb 8, 2026
6423375
fix: Intent Lock + MCF bugs — thread safety, TOCTOU race, TypeError, …
santyr Feb 8, 2026
4ecabac
fix: Anticipatory Liquidity + NNLB bugs — thread safety, AttributeErr…
santyr Feb 8, 2026
e1660c7
fix: Coordinated Splicing — 6 bugs across 3 modules
santyr Feb 8, 2026
e94f63f
fix: hive coordination bugs — ban enforcement, stigmergic markers, th…
santyr Feb 8, 2026
4f47ab6
docs: update README, CLAUDE.md, and CHANGELOG for current feature set
santyr Feb 8, 2026
83a3695
fix: add sling stats retention settings to CLN startup config
santyr Feb 9, 2026
7c4b237
feat: route hive rebalances through sling via bridge delegation
santyr Feb 9, 2026
2a605b0
fix: return source_eligible_members in fleet path response
santyr Feb 9, 2026
aff7885
fix: 8 reporting bugs in MCP server and monitor — wrong keys, hardcod…
santyr Feb 9, 2026
498338d
fix: advisor data pipeline bugs — broken outcomes, zero balances, dep…
santyr Feb 9, 2026
f0e408a
fix: goat feeder zero-data pollution and profitability error detection
santyr Feb 10, 2026
966d5fe
refactor: remove goat feeder/LNbits code from MCP server
santyr Feb 10, 2026
4bea71b
feat: add 5 MCP diagnostic tools for data pipeline health checks
santyr Feb 10, 2026
aaa4652
fix: advisor feedback loop, rebalance bleeding, and decision queue hy…
santyr Feb 10, 2026
5da05cd
feat: predicted benefit pipeline, test coverage, and RPC parallelization
santyr Feb 10, 2026
2a47949
fix: fee outcome measurement, rejection tracking, and expansion loop cap
santyr Feb 10, 2026
5813623
fix: address 5 High and 8 Medium audit findings from full audit 2026-…
santyr Feb 10, 2026
a153b5b
fix: use correct column name (timestamp) in recover_stuck_intents query
santyr Feb 10, 2026
fc9d9e6
fix: 6 HiveMap state manager bugs (race conditions, stale data, threa…
santyr Feb 10, 2026
1f31952
fix: 8 Intent Lock Protocol design limitations (validation, audit, Do…
santyr Feb 10, 2026
e21276b
fix: 5 planner bugs (dead code, O(n) RPC, capacity misuse, budget ord…
santyr Feb 10, 2026
1b1cfc0
fix: time-bound consecutive rejection counter to prevent permanent pl…
santyr Feb 10, 2026
dbe4984
fix: 8 fee coordination bugs (hardcoded fee, missing locks, unwired c…
santyr Feb 10, 2026
6e21a74
fix: 7 MCF bugs + Dijkstra upgrade (dead topology builder, cost trunc…
santyr Feb 10, 2026
e6f4210
fix: MCF duplicate edges, election cache bypass, outdated docstring
santyr Feb 10, 2026
7d9e8d1
fix: 13 anticipatory liquidity bugs (dead code, hardcoded capacity, s…
santyr Feb 10, 2026
a75a197
fix: anticipatory liquidity polish (monthly pattern names, summary co…
santyr Feb 10, 2026
de68043
fix: 16 fee coordination bugs (dead fleet hints, thread safety, memor…
santyr Feb 10, 2026
58cd9c8
fix: 8 settlement system bugs (plan consistency, completion liveness,…
santyr Feb 10, 2026
6e83635
fix: 7 outbox/idempotency bugs (retry budget, duplicate ACK, splice d…
santyr Feb 10, 2026
ef51641
fix: 10 routing intelligence bugs (path signing, relay rejection, cac…
santyr Feb 10, 2026
8fbd729
fix: dispatch custommsg handlers to background threads
santyr Feb 10, 2026
b3754a5
fix: 17 bugs across cost_reduction, liquidity_coordinator, splice_coo…
santyr Feb 10, 2026
1137d3c
fix: add 20ms yield between sendcustommsg broadcasts to prevent RPC s…
santyr Feb 10, 2026
5dc43ea
fix: 41 bugs across 19 modules (1 critical, 9 high, 31 medium)
santyr Feb 10, 2026
c6978d6
fix: ~60 LOW/INFO bugs across 25 modules + deadlock fix
santyr Feb 10, 2026
26851cb
fix: eliminate empty error messages from MCP approve/reject actions
santyr Feb 11, 2026
ae44f19
fix: 15 bugs in MCP server + RPC handlers from audit
santyr Feb 11, 2026
88cb585
feat: expose 15 missing RPC methods as MCP tools
santyr Feb 11, 2026
73863f4
fix: 14 LOW/INFO bugs in RPC handlers and MCP server
santyr Feb 11, 2026
35363dd
feat(mcp): Add Phase 3 Automation Tools
santyr Feb 11, 2026
5f4e421
feat(mcp): Add Phase 4-5 membership & monitoring automation tools
santyr Feb 11, 2026
d667797
fix(mcp): Register missing Phase 2 automation tool handlers
santyr Feb 11, 2026
aa35425
fix: Remove duplicate Tool/handler definitions
santyr Feb 11, 2026
fa10357
refactor(advisor): Streamline prompts to use enhanced automation tools
santyr Feb 11, 2026
28b1d52
fix: implement stagnant channel handler for auto-safe opportunity exe…
santyr Feb 11, 2026
1430042
feat: add hive-get-routing-intelligence RPC for Thompson sampling int…
santyr Feb 11, 2026
658d5c1
feat: Add 7 revenue-ops integration RPCs for comprehensive data sharing
santyr Feb 11, 2026
4647dda
config: extend pheromone persistence for low-traffic nodes
santyr Feb 11, 2026
b3c02c0
config: extend MAX_MARKER_AGE_HOURS to match half-life
santyr Feb 11, 2026
bfbb118
fix(mcp): Deduplicate NNLB struggling members across nodes
santyr Feb 11, 2026
31b140b
fix(rpc): Implement hive-get-* integration methods for revenue_ops
santyr Feb 11, 2026
12b3eab
feat: Persist pheromone levels and stigmergic markers to SQLite
santyr Feb 12, 2026
398b6c8
feat: Persist defense warnings, remote pheromones, and fee observatio…
santyr Feb 12, 2026
3a2e4db
Add config adjustment tracking for advisor learning
santyr Feb 12, 2026
8035e93
Update production.example with config tuning workflow
santyr Feb 12, 2026
d586d51
Expand config tuning: Tier 1+2 params with learning loop
santyr Feb 12, 2026
37374ca
Sync production.example with expanded config tuning
santyr Feb 12, 2026
cc22ff2
chore: Remove (Phase ...) tags from startup log messages
santyr Feb 12, 2026
e7c155c
Sync all production files to production.example (sanitized)
santyr Feb 12, 2026
24a527d
Add Tier 3+4 config tuning with isolation and learning
santyr Feb 12, 2026
31967f5
Sync production.example with Tier 3+4 config tuning
santyr Feb 12, 2026
d1e113a
Add Archon integration design for governance messaging
santyr Feb 12, 2026
0693284
Expand Archon integration plan with Docker wizard and 7 phases
santyr Feb 12, 2026
aaa7d28
Relax health tier thresholds to reduce over-conservative classifications
santyr Feb 12, 2026
24723da
Relax hive member health thresholds to align with NNLB tiers
santyr Feb 12, 2026
a0267e0
Update Archon integration design based on RFC feedback
santyr Feb 12, 2026
99f2416
Add Morningstar's ban vote credential schemas
santyr Feb 12, 2026
2279cae
Add tiered participation model and Archon Polls integration
Feb 12, 2026
dd25b82
fix: remove unnecessary budget constraint from advisor
santyr Feb 12, 2026
09e2e3c
fix: add strict anti-hallucination guardrails to advisor
santyr Feb 12, 2026
2945adb
fix: advisor script uses stdin pipe to avoid shell escaping issues
santyr Feb 12, 2026
9c06a10
fix: fleet_health_summary uses revenue-profitability summary data
santyr Feb 12, 2026
281a0c6
fix: prevent advisor from generating duplicate reports
santyr Feb 12, 2026
e5fe67b
fix: validate action parameter in revenue_config and revenue_policy h…
santyr Feb 12, 2026
7ad4946
fix: escalate instead of auto-reject when graph lookup fails
santyr Feb 13, 2026
758d865
fix: don't set channel_count=0 when listchannels RPC fails
santyr Feb 13, 2026
09640a6
fix: properly extract target pubkey from pending action payload
santyr Feb 13, 2026
c1debce
feat: fix defense-status response format and add stigmergic marker de…
santyr Feb 13, 2026
477303d
feat: wire rebalancing coordination gaps (activity tracking, enriched…
santyr Feb 13, 2026
b95d294
fix: schema mismatch, empty-list falsy bug, and missing transaction i…
santyr Feb 13, 2026
f06832e
fix: input validation in RPC handlers — int() crashes, SCID format check
santyr Feb 13, 2026
c375442
fix: wrap bulk save methods in transactions to prevent data loss
santyr Feb 13, 2026
2521538
fix: settlement gaming crash, marker double-decay, missing expires_at…
santyr Feb 13, 2026
427e0cd
fix: MCP server or-falsy on fee fields could violate zero-fee invariant
santyr Feb 13, 2026
9b9ee42
fix: update test expectations to match relaxed health tier boundaries
santyr Feb 13, 2026
35cc01a
feat: add revenue_fee_anchor MCP tool for advisor fee anchors
santyr Feb 14, 2026
859d764
docs: DID + L402 remote fleet management design proposal
santyr Feb 14, 2026
19d9baa
docs: DID Reputation Schema spec + reference from L402 fleet management
santyr Feb 14, 2026
c7903e7
docs: comprehensive task taxonomy and danger scoring for fleet manage…
santyr Feb 14, 2026
d409dcf
docs: DID + Cashu task escrow protocol spec
santyr Feb 14, 2026
79cffbd
docs: DID Hive Settlements spec — trustless multi-operator fleet econ…
santyr Feb 14, 2026
7f96280
docs: audit fixes — all specs hardened through iterative review
santyr Feb 14, 2026
961d4f3
docs: implement remaining audit suggestions across all specs
santyr Feb 14, 2026
ec81a65
docs: reference canonical Archon reputation schemas (archetech/schemas)
santyr Feb 14, 2026
caf3013
docs: DID Hive Marketplace spec — service advertising, discovery, and…
santyr Feb 14, 2026
c1bd571
docs: marketplace spec hardened through iterative audit
santyr Feb 14, 2026
c2d5d1c
docs: DID Hive Client spec + public marketplace extension
santyr Feb 14, 2026
75bafbc
docs: DID abstraction, payment flexibility, Archon tiers — all specs …
santyr Feb 14, 2026
d3ace74
docs: DID abstraction layer + payment flexibility (Bolt11/Bolt12/L402…
santyr Feb 14, 2026
b82dbdf
docs: DID Hive Liquidity spec — liquidity-as-a-service marketplace
santyr Feb 14, 2026
a34f84a
docs: unified client architecture + Nostr-first marketplace for liqui…
santyr Feb 14, 2026
c5f54e6
docs: ecosystem propagation dynamics + DID-NOSTR-MARKETPLACE.md forwa…
santyr Feb 14, 2026
5accf93
docs: NIP-15/NIP-99 compatibility for Nostr liquidity marketplace
santyr Feb 14, 2026
2cb023a
docs: DID Nostr Marketplace spec — unified Nostr integration for advi…
santyr Feb 15, 2026
87f9890
Update specs for cl-hive plugin architecture
santyr Feb 15, 2026
0385b60
Add backup/recovery section to Client spec (6 scenarios, Shamir thres…
santyr Feb 15, 2026
864558d
Remove audit report artifacts
santyr Feb 15, 2026
7a982cd
docs: standalone plugin design docs (cl-hive-comms, cl-hive-archon, c…
santyr Feb 15, 2026
f80cfc9
feat: Hex-as-advisor — OpenClaw cron replaces Claude Code advisor runs
santyr Feb 15, 2026
671ed81
mcf: slow fee optimization cycle to 30 minutes
santyr Feb 15, 2026
966730b
mcp-hive-server: record failed revenue_rebalance attempts for learning
santyr Feb 15, 2026
e6d5961
mcp-hive-server: default ADVISOR_DB_PATH to production advisor.db whe…
santyr Feb 15, 2026
9d587ee
mcp-hive-server: treat structured error results from revenue-rebalanc…
santyr Feb 15, 2026
8e43629
mcp-hive-server: auto-clear stale sling job locks and retry market re…
santyr Feb 15, 2026
e96b75a
mcp-hive-server: add askrene constraints/reservations MCP tools
santyr Feb 15, 2026
6f2a54a
advisor.db: add maintenance script (retention + WAL checkpoint)
santyr Feb 15, 2026
b1c0aba
mcp-hive-server: include sling-stats verification in revenue_rebalanc…
santyr Feb 15, 2026
2d9df3e
physarum: fix unbound now in execute_physarum_cycle
santyr Feb 15, 2026
41ff930
Route Boltz MCP tools via revenue-ops
santyr Feb 16, 2026
42e68d7
audit: enforce hive RPC wrappers
santyr Feb 16, 2026
a7d02dc
feat: add boltz loop-in MCP tool
santyr Feb 16, 2026
b85eb3d
audit: enforce hive RPC wrappers for sling/askrene/setchannel, fix ru…
santyr Feb 16, 2026
99835e6
feat: EV-based opportunity scoring, learning engine fixes, revenue pr…
santyr Feb 16, 2026
4892db7
feat: RPC connection pool + lightweight health endpoint
santyr Feb 16, 2026
ad551a7
fix: defer RPC pool proxy install until after init completes
santyr Feb 16, 2026
72aeea9
fix: guard plugin.run() for spawn workers, fix bridge socket resolution
santyr Feb 17, 2026
b0c7746
fix: use rpc.call() in pool workers to bypass method signature mismatch
santyr Feb 17, 2026
7ea8366
fix: RPC pool worker dispatch — use getattr with TypeError fallback
santyr Feb 17, 2026
7c1a955
fix: auto-backfill routing intelligence when data is stale (>24h)
santyr Feb 17, 2026
2c724ee
fix: RPC pool double-restart bug — TimeoutError caught by OSError han…
santyr Feb 17, 2026
b4d2246
audit: harden RPC pool, protocol handlers, DB bounds, and thread safety
santyr Feb 17, 2026
6271807
docs: DID ecosystem implementation plan (Phases 1-3)
santyr Feb 17, 2026
549016a
docs: DID ecosystem implementation plan (Phases 4-6)
santyr Feb 17, 2026
55a0a5a
docs: add Hive Node Provisioning spec — autonomous VPS lifecycle
santyr Feb 17, 2026
c56ed6c
docs: number and index planning documents logically
santyr Feb 17, 2026
e297969
audit: fix 40 issues in DID implementation plans
santyr Feb 17, 2026
8e62318
audit: second-pass fixes for DID implementation plans
santyr Feb 17, 2026
5853263
audit: fix 16 issues in Node Provisioning spec
santyr Feb 17, 2026
ce195fc
fix: replace IBD with assumeutxo for viable node provisioning
santyr Feb 17, 2026
12ff8e9
audit: fix 3 VPS showstoppers in Node Provisioning spec
santyr Feb 17, 2026
3c16ebf
fix: use Archon IPFS for assumeutxo snapshot hosting
santyr Feb 17, 2026
cd4c60a
feat: implement DID credential foundation (Phase 1)
santyr Feb 17, 2026
b1264c1
docs: update index and CLAUDE.md for Phase 1 DID implementation
santyr Feb 17, 2026
21b32b5
feat: implement management schemas + danger scoring (Phase 2)
santyr Feb 17, 2026
d952e05
audit: fix 16 security/correctness issues in DID Phase 1+2
santyr Feb 17, 2026
f09c6f9
fix(critical): add missing `global did_credential_mgr` in init()
santyr Feb 17, 2026
d6c6d4f
audit: fix DB layer issues — FK enforcement, revoke rowcount
santyr Feb 17, 2026
b307169
audit: fix protocol-layer issues in DID credential validation
santyr Feb 17, 2026
4618659
fix: boltz-loopout.py — 3 bugs found during first live swap
santyr Feb 17, 2026
2db953d
feat: implement Phase 3 — Credential Exchange Protocol
santyr Feb 17, 2026
0794f83
fix: boltz-loopout — use pay not xpay, fix status endpoint, strip sec…
santyr Feb 17, 2026
6b9c748
audit: fix 5 CRITICAL/HIGH issues in DID Phases 1-3
santyr Feb 17, 2026
259ee68
audit: fix NameError — safe_rpc undefined in DID/MGMT init
santyr Feb 17, 2026
b3a55f4
Phase 1-5 sync bundle (#71)
hexdaemon Feb 18, 2026
72a8bc8
Fix settlement pool accounting and distributed proposal integrity (#72)
hexdaemon Feb 18, 2026
f3c8ae7
fix(routing-pool): normalize uptime and correct snapshot capacity log…
hexdaemon Feb 18, 2026
e9ceb2b
Add planning overview and clarify Phase 6 marketplace boundaries
santyr Feb 19, 2026
135db08
docs: add docs-repo migration plan and subtree export tooling
santyr Feb 19, 2026
488f65b
docs: mark hive-docs repo migration as in progress
santyr Feb 19, 2026
d0d9ff1
feat(docker): add Boltz client v2.11.0 for submarine/reverse swaps
santyr Feb 19, 2026
ce2e0d5
docs: complete migration to hive-docs repo
santyr Feb 19, 2026
73a7231
Add full cl_revenue_ops revenue RPC parity to MCP server (#75)
hexdaemon Feb 19, 2026
3d6ab6d
feat(docker): optional Phase 6 plugin scaffolding (comms + archon) (#77)
hexdaemon Feb 20, 2026
016cfa0
feat(mcp): add boltz backup and mnemonic verify tools (#76)
hexdaemon Feb 20, 2026
40795f0
fix(docker): boltz tarball path mismatch, add PyNaCl, update plugin p…
hexdaemon Feb 20, 2026
75a6167
fix: add BatchedLogWriter to prevent IO thread starvation from write_…
hexdaemon Feb 20, 2026
a305dcc
perf(mcp): parallelize sequential RPC calls in 8 hot-path handlers
hexdaemon Feb 21, 2026
6b376bb
perf(mcp): parallelize remaining high-severity sequential RPC handlers
hexdaemon Feb 21, 2026
a508c17
perf(mcp): parallelize medium-severity sequential RPC handlers
hexdaemon Feb 21, 2026
7a57607
perf(mcp): parallelize low-severity sequential RPC handlers
hexdaemon Feb 21, 2026
11b3d3c
fix: offload forward_event and connect handlers from IO thread
hexdaemon Feb 21, 2026
18927e0
fix(settlement): critical bug fixes from audit 2026-02-23
hexdaemon Feb 23, 2026
54b31d7
fix: shutdown _msg_executor to prevent process hang on SIGTERM
hexdaemon Feb 23, 2026
7f8ec9f
fix: Docker build and runtime fixes (#79)
macterra Feb 23, 2026
43374b9
fix: add defaults to hive report/broadcast handler params
hexdaemon Feb 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

All notable changes to cl-hive will be documented in this file.

## [Unreleased]

### Fixed
- **Ban Enforcement**: Fixed ban enforcement race conditions and stigmergic marker thread safety (e94f63f)
- **Coordinated Splicing**: Fixed 6 bugs across splice_manager, splice_coordinator, and PSBT exchange (e1660c7)
- **Anticipatory Liquidity + NNLB**: Thread safety fixes, AttributeError on missing keys, key mismatch in pattern detection (4ecabac)
- **Intent Lock + MCF**: Thread safety, TOCTOU race condition, TypeError and AttributeError fixes (6423375)
- **HiveMap + Planner**: Feerate gate validation, freshness checks, defensive copies (f8f07f3)
- **MCF Coordination**: TypeError crashes, missing permission checks, encapsulation violations (64c9c0d)
- **Cooperative Rebalancing**: 10 bugs in crashes, thread safety, routing, MCF (656466e)
- **Pheromone Fee Learning**: Repaired broken loop between cl-hive and cl-revenue-ops (fb9c471)
- **State Manager**: Added capabilities field validation in state entries (d818771)
- **MCF Assignments**: Replaced private _mcf_assignments access with public API (cf37109)

## [2.2.8] - 2026-02-07

### Added
- vitality plugin v0.2.3 for automatic plugin health monitoring and restart
- Thread safety locks in 7 coordination modules (AdaptiveFeeController, StigmergicCoordinator, MyceliumDefenseSystem, TimeBasedFeeAdjuster, FeeCoordinationManager, VPNTransportManager)
- Cache bounds to prevent memory bloat (500-1000 entry limits on peer/route caches)
- Docker image version 2.2.8

### Fixed
- **Thread Safety**: Fixed race conditions in concurrent modification of shared state
- **Governance Bypass**: task_manager expansion now routes through governance engine (security)
- **Outbox Retry**: Parse/serialization errors now fail permanently instead of infinite retry
- **P0 Crashes**: Fixed AttributeError on _get_topology_snapshot() and None handling in task execution
- **P1 Logic Errors**: Fixed analyzer references, field names, method calls across 12 modules
- **P2 Edge Cases**: MCF solution validation, force_close counting, yield metric clamping

### Removed
- trustedcoin plugin (explorer-only Bitcoin backend no longer needed)

### Changed
- Updated .env.example documentation to reflect vitality instead of trustedcoin

## [1.9.0] - 2026-01-24

### Added
Expand Down
105 changes: 93 additions & 12 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Core Lightning
- **cl-revenue-ops**: Executes fee policies and rebalancing (called via RPC)
- **Core Lightning**: Underlying node operations and HSM-based crypto

### Module Organization
### Module Organization (41 modules)

| Module | Purpose |
|--------|---------|
Expand All @@ -56,12 +56,36 @@ Core Lightning
| `contribution.py` | Forwarding stats and anti-leech detection |
| `planner.py` | Topology optimization - saturation analysis, expansion election, feerate gate |
| `splice_manager.py` | Coordinated splice operations between hive members (Phase 11) |
| `splice_coordinator.py` | High-level splice coordination and recommendation engine |
| `mcf_solver.py` | Min-Cost Max-Flow solver for global fleet rebalance optimization |
| `liquidity_coordinator.py` | Liquidity needs aggregation and rebalance assignment distribution |
| `cost_reduction.py` | Fleet rebalance routing with MCF/BFS fallback |
| `anticipatory_manager.py` | Kalman-filtered flow prediction, intra-day pattern detection |
| `anticipatory_liquidity.py` | Kalman-filtered flow prediction, intra-day pattern detection |
| `fee_coordination.py` | Pheromone-based fee coordination + stigmergic markers |
| `fee_intelligence.py` | Fee intelligence aggregation and sharing across fleet |
| `cooperative_expansion.py` | Fleet-wide expansion election protocol (Nominate→Elect→Open) |
| `budget_manager.py` | Autonomous/failsafe mode budget tracking and enforcement |
| `idempotency.py` | Message deduplication via event ID tracking |
| `outbox.py` | Reliable message delivery with retry and exponential backoff |
| `routing_intelligence.py` | Routing path intelligence sharing across fleet |
| `routing_pool.py` | Routing pool management for fee distribution |
| `settlement.py` | BOLT12 settlement system - proposal/vote/execute consensus |
| `health_aggregator.py` | Fleet health scoring and NNLB status |
| `network_metrics.py` | Network-level metrics collection |
| `peer_reputation.py` | Peer reputation tracking and scoring |
| `quality_scorer.py` | Peer quality scoring for membership decisions |
| `relay.py` | Message relay logic for multi-hop fleet communication |
| `rpc_commands.py` | RPC command handlers for all hive-* commands |
| `channel_rationalization.py` | Channel optimization recommendations |
| `strategic_positioning.py` | Strategic network positioning analysis |
| `task_manager.py` | Background task coordination and scheduling |
| `vpn_transport.py` | VPN transport layer (WireGuard integration) |
| `yield_metrics.py` | Yield tracking and optimization metrics |
| `governance.py` | Decision engine (advisor/failsafe mode routing) |
| `config.py` | Hot-reloadable configuration with snapshot pattern |
| `database.py` | SQLite with WAL mode, thread-local connections |
| `did_credentials.py` | DID credential issuance, verification, reputation aggregation (Phase 16) |
| `management_schemas.py` | 15 management schema categories, danger scoring, credential lifecycle (Phase 2) |
| `database.py` | SQLite with WAL mode, thread-local connections, 50 tables |

### Key Patterns

Expand All @@ -87,14 +111,25 @@ Core Lightning
- "Peek & Check" pattern in custommsg hook
- JSON payload, max 65535 bytes per message

**Idempotent Delivery**:
- All protocol messages carry unique event IDs
- `proto_events` table tracks processed events
- `proto_outbox` table enables reliable retry with exponential backoff

**Relay Protocol**:
- Multi-hop message relay for peers not directly connected
- Relay logic in `relay.py` with TTL-based loop prevention

### Governance Modes

| Mode | Behavior |
|------|----------|
| `advisor` | **Primary mode** - Queue to pending_actions for AI/human approval via MCP server |
| `failsafe` | Emergency mode - Auto-execute only critical safety actions (bans) within strict limits |

### Database Tables
### Database Tables (50 tables)

Key tables (see `database.py` for complete schema):

| Table | Purpose |
|-------|---------|
Expand All @@ -103,10 +138,29 @@ Core Lightning
| `hive_state` | Key-value store for persistent state |
| `contribution_ledger` | Forwarding contribution tracking |
| `hive_bans` | Ban proposals and votes |
| `promotion_requests` | Pending promotion requests |
| `ban_proposals` / `ban_votes` | Distributed ban voting |
| `promotion_requests` / `promotion_vouches` | Promotion workflow |
| `hive_planner_log` | Planner decision audit log |
| `pending_actions` | Actions awaiting approval (advisor mode) |
| `splice_sessions` | Active and historical splice operations (Phase 11) |
| `splice_sessions` | Active and historical splice operations |
| `peer_fee_profiles` | Fee profiles shared by fleet members |
| `fee_intelligence` | Aggregated fee intelligence data |
| `fee_reports` | Fee earnings for settlement calculations |
| `liquidity_needs` / `member_liquidity_state` | Liquidity coordination |
| `pool_contributions` / `pool_revenue` / `pool_distributions` | Routing pool management |
| `settlement_proposals` / `settlement_ready_votes` / `settlement_executions` | BOLT12 settlement |
| `flow_samples` / `temporal_patterns` | Anticipatory liquidity data |
| `peer_reputation` | Peer reputation scores |
| `member_health` | Fleet member health tracking |
| `budget_tracking` / `budget_holds` | Budget enforcement |
| `proto_events` | Processed event IDs for idempotency |
| `proto_outbox` | Reliable message delivery outbox |
| `peer_presence` | Peer online/offline tracking |
| `peer_capabilities` | Peer protocol capabilities |
| `did_credentials` | DID reputation credentials (issued and received) |
| `did_reputation_cache` | Cached aggregated reputation scores |
| `management_credentials` | Management credentials (operator → agent permission) |
| `management_receipts` | Signed receipts of management action executions |

## Safety Constraints

Expand Down Expand Up @@ -162,7 +216,7 @@ Note: Sling IS required for cl-revenue-ops itself.
- Only external dependency: `pyln-client>=24.0`
- All crypto done via CLN HSM (signmessage/checkmessage) - no crypto libs imported
- Plugin options defined at top of `cl-hive.py` (30 configurable parameters)
- Background loops: intent_monitor_loop, membership_loop, planner_loop, gossip_loop
- Background loops (9): gossip_loop, membership_maintenance_loop, planner_loop, intent_monitor_loop, fee_intelligence_loop, settlement_loop, mcf_optimization_loop, outbox_retry_loop, did_maintenance_loop

## Testing Conventions

Expand All @@ -176,29 +230,56 @@ Note: Sling IS required for cl-revenue-ops itself.
```
cl-hive/
├── cl-hive.py # Main plugin entry point
├── modules/
├── modules/ # 41 modules
│ ├── protocol.py # Message types and encoding
│ ├── handshake.py # PKI authentication
│ ├── state_manager.py # Distributed state
│ ├── state_manager.py # Distributed state (HiveMap)
│ ├── gossip.py # Gossip protocol
│ ├── intent_manager.py # Intent locks
│ ├── bridge.py # cl-revenue-ops bridge
│ ├── bridge.py # cl-revenue-ops bridge (Circuit Breaker)
│ ├── clboss_bridge.py # Optional CLBoss bridge
│ ├── membership.py # Member management
│ ├── contribution.py # Contribution tracking
│ ├── planner.py # Topology planner
│ ├── cooperative_expansion.py # Fleet expansion elections
│ ├── splice_manager.py # Coordinated splice operations
│ ├── splice_coordinator.py # Splice coordination engine
│ ├── mcf_solver.py # Min-Cost Max-Flow solver
│ ├── liquidity_coordinator.py # Liquidity needs aggregation
│ ├── cost_reduction.py # Fleet rebalance routing
│ ├── anticipatory_liquidity.py # Kalman-filtered flow prediction
│ ├── fee_coordination.py # Pheromone-based fee coordination
│ ├── fee_intelligence.py # Fee intelligence sharing
│ ├── settlement.py # BOLT12 settlement system
│ ├── routing_intelligence.py # Routing path intelligence
│ ├── routing_pool.py # Routing pool management
│ ├── budget_manager.py # Budget tracking and enforcement
│ ├── idempotency.py # Message deduplication
│ ├── outbox.py # Reliable message delivery
│ ├── relay.py # Message relay logic
│ ├── health_aggregator.py # Fleet health scoring
│ ├── network_metrics.py # Network metrics collection
│ ├── peer_reputation.py # Peer reputation tracking
│ ├── quality_scorer.py # Peer quality scoring
│ ├── channel_rationalization.py # Channel optimization
│ ├── strategic_positioning.py # Network positioning
│ ├── yield_metrics.py # Yield tracking
│ ├── task_manager.py # Background task coordination
│ ├── vpn_transport.py # VPN transport layer
│ ├── rpc_commands.py # RPC command handlers
│ ├── governance.py # Decision engine (advisor/failsafe)
│ ├── did_credentials.py # DID credential issuance + reputation (Phase 16)
│ ├── management_schemas.py # Management schemas + danger scoring (Phase 2)
│ ├── config.py # Configuration
│ └── database.py # Database layer
│ └── database.py # Database layer (50 tables)
├── tools/
│ ├── mcp-hive-server.py # MCP server for Claude Code integration
│ ├── hive-monitor.py # Real-time monitoring daemon
│ └── ai_advisor.py # AI advisor utility
├── config/
│ ├── nodes.rest.example.json # REST API config example
│ └── nodes.docker.example.json # Docker/Polar config example
├── tests/ # Test suite
├── tests/ # 1,918 tests across 48 files
├── docs/ # Documentation
│ ├── design/ # Design documents
│ ├── planning/ # Implementation plans
Expand Down
2 changes: 1 addition & 1 deletion MOLTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,5 @@ See `CLAUDE.md` for detailed development guidance.
## Related Documentation

- [MCP_SERVER.md](docs/MCP_SERVER.md) — Full tool reference
- [ARCHITECTURE.md](docs/ARCHITECTURE.md) — Protocol specification
- [hive-docs](https://github.com/lightning-goats/hive-docs) — Full documentation (architecture, specs, planning)
- [CLAUDE.md](CLAUDE.md) — Development guidance
54 changes: 43 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,30 @@ Global fleet-wide rebalancing optimization using Successive Shortest Paths algor
### Anticipatory Liquidity Management
Predictive liquidity positioning using Kalman-filtered flow velocity estimation and intra-day pattern detection. Detects temporal patterns (surge, drain, quiet periods) and recommends proactive rebalancing before demand spikes.

### Stigmergic Markers & Pheromone Trails
Bio-inspired coordination using pheromone-based fee signals. Nodes deposit "scent markers" on channels they route through, creating emergent fee corridors that the fleet collectively optimizes without central planning — similar to how ant colonies find optimal paths.

### Settlement System (BOLT12)
Decentralized fee distribution using BOLT12 offers. Members propose settlements for completed periods, auto-vote when data hashes match (51% quorum), and each node pays their share. Period-based idempotency prevents double settlement.

### Idempotent Message Delivery & Reliable Outbox
Deduplication of all protocol messages via event ID tracking. Reliable delivery with automatic retry and exponential backoff ensures messages reach all peers even through transient disconnections.

### Routing Intelligence
Fleet-wide routing path intelligence sharing. Nodes share probe results and failure data to collectively build a superior view of the network graph, improving payment success rates for the entire fleet.

### Budget Manager
Autonomous mode budget tracking with per-day spend limits, reserve percentage enforcement, and per-channel spend caps. Prevents runaway spending in failsafe mode.

### VPN Transport Support
Optional WireGuard VPN integration for secure fleet communication.

## Governance Modes

| Mode | Behavior |
|------|----------|
| `advisor` | Log recommendations and queue actions for manual approval (default) |
| `autonomous` | Execute actions automatically within strict safety bounds |
| `advisor` | Log recommendations and queue actions for AI/human approval via MCP server (default) |
| `failsafe` | Emergency mode - auto-execute only critical safety actions (bans) within strict limits |

## Join the Lightning Hive

Expand All @@ -84,12 +99,14 @@ See [Joining the Hive](docs/JOINING_THE_HIVE.md) for the complete guide.

### Prerequisites
- Core Lightning (CLN) v23.05+
- Python 3.8+
- Python 3.10+ (required for `match` statements used in newer modules)
- `cl-revenue-ops` v1.4.0+ (Recommended for full functionality)

### Optional Integrations
- **CLBoss**: Not required. If installed, cl-hive coordinates to prevent redundant channel opens.
- **Sling**: Not required for cl-hive. Rebalancing is handled by cl-revenue-ops.
- **cl-hive-comms**: Optional Phase 6 sibling plugin (detected automatically when installed).
- **cl-hive-archon**: Optional Phase 6 Archon sibling plugin. If active without comms, `hive-phase6-plugins` reports a warning.

### Setup

Expand All @@ -105,6 +122,8 @@ pip install -r requirements.txt
lightningd --plugin=/path/to/cl-hive/cl-hive.py
```

Phase 6 planning references: see [hive-docs](https://github.com/lightning-goats/hive-docs)

## RPC Commands

### Hive Management
Expand All @@ -116,9 +135,10 @@ lightningd --plugin=/path/to/cl-hive/cl-hive.py
| `hive-join <ticket>` | Join an existing Hive using an invitation ticket |
| `hive-leave` | Leave the current Hive |
| `hive-status` | Get current membership tier, fleet size, and governance mode |
| `hive-phase6-plugins` | Show detected optional sibling plugin status (`cl-hive-comms`, `cl-hive-archon`) |
| `hive-members` | List all Hive members and their current stats |
| `hive-config` | View current configuration |
| `hive-set-mode <mode>` | Change governance mode (advisor/autonomous/oracle) |
| `hive-set-mode <mode>` | Change governance mode (advisor/failsafe) |

### Membership & Governance

Expand Down Expand Up @@ -259,7 +279,7 @@ All options can be set in your CLN config file or passed as CLI arguments. Most
| Option | Default | Description |
|--------|---------|-------------|
| `hive-db-path` | `~/.lightning/cl_hive.db` | SQLite database path (immutable) |
| `hive-governance-mode` | `advisor` | Governance mode: advisor, autonomous, oracle |
| `hive-governance-mode` | `advisor` | Governance mode: advisor, failsafe |
| `hive-max-members` | `50` | Maximum Hive members (Dunbar cap) |

### Membership Settings
Expand Down Expand Up @@ -335,20 +355,19 @@ See:

## Documentation

Full docs: **https://github.com/lightning-goats/hive-docs**

| Document | Description |
|----------|-------------|
| [Joining the Hive](docs/JOINING_THE_HIVE.md) | How to join an existing hive |
| [MOLTY.md](MOLTY.md) | AI agent instructions |
| [MCP Server](docs/MCP_SERVER.md) | MCP server setup and tool reference |
| [Cooperative Fee Coordination](docs/design/cooperative-fee-coordination.md) | Fee coordination design |
| [VPN Transport](docs/design/VPN_HIVE_TRANSPORT.md) | VPN transport design |
| [Liquidity Integration](docs/design/LIQUIDITY_INTEGRATION.md) | cl-revenue-ops integration |
| [Architecture](docs/ARCHITECTURE.md) | Complete protocol specification |
| [MOLTY.md](MOLTY.md) | AI agent instructions |
| [Docker Deployment](docker/README.md) | Docker deployment guide |
| [Threat Model](docs/security/THREAT_MODEL.md) | Security threat analysis |

## Testing

1,340 tests across 46 test files covering all modules.

```bash
# Run all tests
python3 -m pytest tests/
Expand All @@ -360,6 +379,19 @@ python3 -m pytest tests/test_planner.py
python3 -m pytest tests/ -v
```

## Recent Hardening

Extensive security and stability work across the codebase:

- **Thread safety**: Locks added to all shared mutable state in coordination modules (fee controllers, stigmergic coordinator, defense system, VPN transport)
- **Cache bounds**: All peer/route caches bounded to 500-1000 entries to prevent memory bloat
- **Governance enforcement**: All expansion paths now route through governance engine
- **Outbox reliability**: Parse/serialization errors fail permanently instead of infinite retry
- **Crash fixes**: AttributeError, TypeError, and None-handling fixes across 12+ modules
- **MCF hardening**: Solution validation, force-close counting, coordinator election staleness failover
- **Splicing fixes**: 6 bugs fixed across splice manager, coordinator, and PSBT exchange
- **Anticipatory liquidity**: Thread safety, AttributeError fixes, key mismatch corrections

## License

MIT
Loading