Files
FusionAGI/fusionagi/maa/layers/machine_binding.py
defiQUG c052b07662
Some checks failed
Tests / test (3.10) (push) Has been cancelled
Tests / test (3.11) (push) Has been cancelled
Tests / test (3.12) (push) Has been cancelled
Tests / lint (push) Has been cancelled
Tests / docker (push) Has been cancelled
Initial commit: add .gitignore and README
2026-02-09 21:51:42 -08:00

34 lines
1.1 KiB
Python

"""Layer 6 — Machine Binding & Personality Profiles."""
from typing import Any
from pydantic import BaseModel, Field
class MachineProfile(BaseModel):
"""Machine personality profile: limits, historical deviation models."""
machine_id: str = Field(..., description="Bound machine id")
limits_ref: str | None = Field(default=None)
deviation_model_ref: str | None = Field(default=None)
metadata: dict[str, Any] = Field(default_factory=dict)
class MachineBinding:
"""Each design binds to a specific machine with known limits. No abstraction without binding."""
def __init__(self) -> None:
self._profiles: dict[str, MachineProfile] = {}
def register(self, profile: MachineProfile) -> None:
"""Register a machine profile."""
self._profiles[profile.machine_id] = profile
def get(self, machine_id: str) -> MachineProfile | None:
"""Return profile for machine or None."""
return self._profiles.get(machine_id)
def resolve(self, machine_id: str) -> MachineProfile | None:
"""Resolve machine binding; reject if unknown (no abstraction)."""
return self.get(machine_id)