1
0
This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Timmy-time-dashboard/src/lightning/__init__.py
Alexander Payne c5df954d44 feat: Lightning interface, swarm routing, sovereignty audit, embodiment prep
Lightning Backend Interface:
- Abstract LightningBackend with pluggable implementations
- MockBackend for development (auto-settle invoices)
- LndBackend stub with gRPC integration path documented
- Backend factory for runtime selection via LIGHTNING_BACKEND env

Intelligent Swarm Routing:
- CapabilityManifest for agent skill declarations
- Task scoring based on keywords + capabilities + bid price
- RoutingDecision audit logging to SQLite
- Agent stats tracking (wins, consideration rate)

Sovereignty Audit:
- Comprehensive audit report (docs/SOVEREIGNTY_AUDIT.md)
- 9.2/10 sovereignty score
- Documented all external dependencies and local alternatives

Substrate-Agnostic Agent Interface:
- TimAgent abstract base class
- Perception/Action/Memory/Communication types
- OllamaAdapter implementation
- Foundation for future embodiment (robot, VR)

Tests:
- 36 new tests for Lightning and routing
- 472 total tests passing
- Maintained 0 warning policy
2026-02-22 20:20:11 -05:00

27 lines
905 B
Python

"""Lightning Network payment backend interface.
This module provides a pluggable interface for Lightning Network operations,
allowing seamless switching between mock (development) and real LND backends.
Usage:
from lightning import get_backend, Invoice
backend = get_backend() # Uses LIGHTNING_BACKEND env var
invoice = backend.create_invoice(amount_sats=100, memo="API access")
paid = backend.check_payment(invoice.payment_hash)
Configuration:
LIGHTNING_BACKEND=mock # Default, for development
LIGHTNING_BACKEND=lnd # Real LND via gRPC
# LND-specific settings (when backend=lnd)
LND_GRPC_HOST=localhost:10009
LND_TLS_CERT_PATH=/path/to/tls.cert
LND_MACAROON_PATH=/path/to/admin.macaroon
"""
from lightning.base import Invoice, LightningBackend
from lightning.factory import get_backend
__all__ = ["Invoice", "LightningBackend", "get_backend"]