diff --git a/README.md b/README.md index 4bd65bd..ae7f046 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,11 @@ Key concepts (canonical primitives): - DualVariables, AuditLog, PrivacyBudget: governance/provenance extensions for auditable operation - Graph-of-Contracts (GoC): registry of adapters and data schemas with per-message metadata to support replay/provenance +Provenance Enhancements +- PlanDelta now includes extended provenance fields: version (IR schema version), nonce (replay protection), and signer (provenance/identity). +- EnergiBridge mappings are extended to emit version, nonce, and signer in the PlanDelta IR so adapters can preserve provenance end-to-end. +- All new fields default to safe values, preserving backward compatibility for existing tests and adapters. + Architecture overview - ARBSphere primitives live in arbsphere/primitives.py and arbsphere/coordinator.py for the toy two-venue demo. - A lightweight EnergiBridge (arbsphere/energi_bridge.py) translates primitives into a canonical IR for adapters. diff --git a/arbsphere/coordinator.py b/arbsphere/coordinator.py index f17598f..d3cc5fe 100644 --- a/arbsphere/coordinator.py +++ b/arbsphere/coordinator.py @@ -15,6 +15,13 @@ class PlanDelta: timestamp: float | None = None parent_delta_id: str | None = None signature: str | None = None + # Extended provenance fields for stronger auditability and replay + # Versioning to denote IR schema version for adapters and registries + version: int = 1 + # Optional per-delta nonce to prevent replay of identical deltas + nonce: str | None = None + # Optional signer/identity for provenance + signer: str | None = None def _deterministic_id(inputs: List[LocalArbProblem], shared: SharedSignals) -> str: diff --git a/arbsphere/energi_bridge.py b/arbsphere/energi_bridge.py index 2240cb9..baed629 100644 --- a/arbsphere/energi_bridge.py +++ b/arbsphere/energi_bridge.py @@ -44,6 +44,10 @@ class EnergiBridge: "timestamp": getattr(delta, "timestamp", None), "parent_delta_id": getattr(delta, "parent_delta_id", None), "signature": getattr(delta, "signature", None), + # New provenance fields + "version": getattr(delta, "version", None), + "nonce": getattr(delta, "nonce", None), + "signer": getattr(delta, "signer", None), }