diff --git a/src/protocol.js b/src/protocol.js index fbbf3a8..fa916ed 100644 --- a/src/protocol.js +++ b/src/protocol.js @@ -1,12 +1,35 @@ // Lightweight protocol scaffold for Open-EnergyMesh 0.2 core ontology // This file provides tiny, versioned data contracts used by adapters. +// Privacy budget and audit trail primitives to support privacy-preserving +// aggregation and governance provenance in the MVP. +class PrivacyBudget { + constructor(limit = 0, allocated = 0) { + this.limit = limit; // maximum allowed budget (abstract unit) + this.allocated = allocated; // amount currently allocated/used + } +} + +class AuditLog { + constructor(entries = []) { + this.entries = entries; // array of audit entries + } + addEntry(entry) { + this.entries.push(entry); + } +} + +// Lightweight protocol scaffold for Open-EnergyMesh 0.2 core ontology +// This file provides tiny, versioned data contracts used by adapters. + class LocalProblem { constructor(version = '0.2') { this.version = version; this.variables = {}; // local optimization variables this.constraints = []; // local constraints this.objective = null; // objective description or function reference + this.privacyBudget = new PrivacyBudget(); + this.auditLog = new AuditLog(); } } @@ -27,5 +50,7 @@ class PlanDelta { module.exports = { LocalProblem, SharedVariables, - PlanDelta + PlanDelta, + PrivacyBudget, + AuditLog };