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 4d5024f8e5 build(agent): semicolon#54de0b iteration 2026-04-24 18:45:55 +02:00
src/solfuse build(agent): semicolon#54de0b iteration 2026-04-24 18:45:55 +02:00
tests build(agent): semicolon#54de0b iteration 2026-04-24 18:45:55 +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:45:55 +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
  • A federation bridge that packages solver rounds, audit records, and privacy-budget charges
  • Deterministic starter adapters for solar inverter and thermal storage controllers
  • 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.bridge: round orchestration and governance-aware packaging
  • solfuse.adapters: starter inverter and thermal controller adapters
  • 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.bridge import FederationBridge
from solfuse.adapters import SolarInverterAdapter, ThermalStorageAdapter

bridge = FederationBridge()
solar = SolarInverterAdapter().to_local_problem({"site_id": "solar-a", "forecast_kw": [4.0, 4.5]}, round_id=1)
thermal = ThermalStorageAdapter().to_local_problem({"site_id": "storage-b", "cooling_load_kw": [1.0, 1.5], "capacity_kw": 2.0}, round_id=1)
result = bridge.solve_round([solar, thermal], round_id=1)

print(result.solver_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