51 lines
1.1 KiB
Python
51 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
from typing import Any, Dict, List, Optional
|
|
|
|
|
|
@dataclass
|
|
class LocalProblem:
|
|
"""Canonical Local Problem representation for cross-domain optimization.
|
|
|
|
This lightweight structure is intended for MVP wiring between GridGuard and
|
|
interoperability bridges (CatOpt-like). It captures a per-asset planning task.
|
|
"""
|
|
|
|
asset_id: str
|
|
objective: Dict[str, Any]
|
|
bounds: Optional[Dict[str, Any]] = None
|
|
|
|
|
|
@dataclass
|
|
class SharedVariables:
|
|
"""Versioned shared signals between adapters/domains."""
|
|
|
|
version: int
|
|
signals: Dict[str, Any]
|
|
|
|
|
|
@dataclass
|
|
class PlanDelta:
|
|
"""Incremental plan updates to be applied by other domains."""
|
|
|
|
delta: Dict[str, Any]
|
|
version: int
|
|
|
|
|
|
@dataclass
|
|
class PolicyBlock:
|
|
"""Policy core for a contract: data-exposure, attestation, and limits."""
|
|
|
|
policy_id: str
|
|
data_exposure_limit: int
|
|
attestation_required: bool = True
|
|
|
|
|
|
@dataclass
|
|
class AttestationHint:
|
|
"""Hints binding proofs to contract permissions for an adapter/agent."""
|
|
|
|
agent_id: str
|
|
required: bool = True
|