Gap: A missing, practical platform to federate optimization across microgrids that combine solar, wind, and thermal storage with cross-utility assets, while preserving data locality, enabling offline islanding, and providing auditable governance. Sol
Go to file
agent-54de0bcc6a17828b 434601d06d build(agent): semicolon#54de0b iteration 2026-04-24 18:39:37 +02:00
src/solfuse build(agent): semicolon#54de0b iteration 2026-04-24 18:39:37 +02:00
tests build(agent): semicolon#54de0b iteration 2026-04-24 18:39:37 +02:00
.gitignore build(agent): semicolon#54de0b iteration 2026-04-24 18:39:37 +02:00
AGENTS.md build(agent): semicolon#54de0b iteration 2026-04-24 18:39:37 +02:00
README.md build(agent): semicolon#54de0b iteration 2026-04-24 18:39:37 +02:00
pyproject.toml build(agent): semicolon#54de0b iteration 2026-04-24 18:39:37 +02:00
test.sh build(agent): semicolon#54de0b iteration 2026-04-24 18:39:37 +02:00

README.md

SolFuse

SolFuse is a privacy-preserving federation layer for hybrid microgrids. It coordinates solar, wind, and thermal storage sites through summarized signals, incremental plan deltas, and auditable governance instead of raw data exchange.

What It Provides

  • Canonical protocol primitives for local optimization, shared signals, dual variables, and plan deltas
  • A SQLite-backed graph-of-contracts registry for adapter versioning and schema conformance
  • An ADMM-lite solver for federated dispatch planning
  • Signed message envelopes and DID-style identities for short-lived trust
  • Audit logging and privacy-budget accounting
  • Delta-sync journaling for islanded/offline operation

Package Layout

  • solfuse.models: protocol objects and canonical payload schemas
  • solfuse.identity: identity generation, signing, and verification
  • solfuse.registry: adapter registry and schema conformance checks
  • solfuse.solver: federated consensus solver
  • solfuse.delta_sync: incremental plan journal and replay helpers
  • solfuse.governance: audit log and privacy budget ledger
  • solfuse.transport: canonical envelope serialization and TLS context helpers
  • solfuse.cli: small demo entry point

Quick Start

python3 -m pip install -e .[dev]
pytest
solfuse demo

Minimal Example

from solfuse.models import LocalProblem
from solfuse.solver import ADMMLiteSolver

solver = ADMMLiteSolver(rho=1.0, tolerance=1e-6, max_iterations=100)
result = solver.solve([
    LocalProblem(site_id="solar-a", preferred_dispatch=[4.0, 4.5], quadratic_weight=2.0),
    LocalProblem(site_id="storage-b", preferred_dispatch=[1.0, 1.5], quadratic_weight=1.5),
])

print(result.consensus)

Governance Model

Each message can be wrapped in a signed envelope, recorded in the audit ledger, and charged against a privacy budget. Contract adapters are versioned and validated against JSON Schema so controllers can be swapped without changing the federation core.

Testing And Build

  • bash test.sh
  • pytest
  • python3 -m build