50 lines
2.3 KiB
Markdown
50 lines
2.3 KiB
Markdown
# GridVerse DSL Sketch (Conceptual)
|
|
|
|
This document outlines a tiny, human-friendly DSL to describe a LocalProblem
|
|
and its associated SharedVariables that GridVerse adapters will map into a
|
|
canonical bundle for cross-domain optimization.
|
|
|
|
Core concepts
|
|
- LocalProblem (Objects): a local optimization task at a site with a set of
|
|
tunable variables.
|
|
- SharedVariables (Morphisms): signals exchanged with other sites or global
|
|
constraints.
|
|
- PlanDelta: incremental actions derived from solving the local/global problem.
|
|
- Governance/Audit: lightweight metadata for traceability (version/timestamp).
|
|
|
|
Tiny DSL example
|
|
site_id=siteA
|
|
description=DER and building load coordination
|
|
variables=pv_capacity=5,load=10,storage=2
|
|
variables=another_key=42
|
|
|
|
Notes
|
|
- This DSL is intentionally minimal to bootstrap interoperability without
|
|
introducing a full language runtime.
|
|
- A real system would support richer types, validation, and versioning hooks.
|
|
|
|
EnergiaBridge notes
|
|
- Bridge: Canonical GridVerse -> vendor-agnostic form; map LocalProblem/SharedVariables/PlanDelta to interoperable contracts.
|
|
- The registry keeps contract schemas and adapter descriptors with per-message metadata (version, timestamp, nonce).
|
|
- A minimal example showing a translated LocalProblem into a CanonicalBundle via the EnergiaBridge.
|
|
|
|
### Minimal Cross-Domain DSL Snippet (Expanded)
|
|
- LocalProblem { id, domain, assets, objective, constraints }
|
|
- SharedVariables { forecasts, priors, version }
|
|
- PlanDelta { delta, timestamp, author, contract_id, signature }
|
|
- DualVariables { multipliers }
|
|
- PrivacyBudget { signal, budget, expiry }
|
|
- AuditLog { entry, signer, timestamp, contract_id }
|
|
- GovernanceBlock { policy, risk_limit }
|
|
|
|
Example:
|
|
```
|
|
LocalProblem { id: "lp-01", domain: "district_heating", assets: ["boiler-1"], objective: "min_cost", constraints: ["mesh_energy"] }
|
|
SharedVariables { forecasts: {demand: 1000}, priors: {temp: 21}, version: "0.2" }
|
|
PlanDelta { delta: { add_adapter: ["rover_planner"] }, timestamp: 1700000000, author: "system", contract_id: "lp-01", signature: "abc123" }
|
|
DualVariables { multipliers: { mu: 1.0 } }
|
|
PrivacyBudget { signal: "energy", budget: 0.01, expiry: 3600 }
|
|
AuditLog { entry: "bootstrap", signer: "system", timestamp: 1700000000, contract_id: "lp-01" }
|
|
GovernanceBlock { policy: "safety", risk_limit: 0.05 }
|
|
```
|