2026-07-25 11:27:59 +02:00
|
|
|
"""Method graph profiles — AP1.4e / AP2.4 (via MethodDefinition)."""
|
2026-07-11 08:06:42 +02:00
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
|
|
|
|
DEFAULT_METHOD_KEY = "generic_operating"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
|
|
|
class GraphMethodProfile:
|
|
|
|
|
"""Steuert Graph-Read-Models pro steering_context.method_key."""
|
|
|
|
|
|
|
|
|
|
enforce_gate_blocking: bool
|
|
|
|
|
emphasize_fulfillment: bool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_STRICT = GraphMethodProfile(enforce_gate_blocking=True, emphasize_fulfillment=False)
|
|
|
|
|
_FULFILLMENT = GraphMethodProfile(enforce_gate_blocking=False, emphasize_fulfillment=True)
|
|
|
|
|
_LIGHT = GraphMethodProfile(enforce_gate_blocking=False, emphasize_fulfillment=False)
|
|
|
|
|
|
2026-07-25 11:27:59 +02:00
|
|
|
STRICT = _STRICT
|
|
|
|
|
FULFILLMENT = _FULFILLMENT
|
|
|
|
|
LIGHT = _LIGHT
|
2026-07-11 08:06:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_graph_profile(method_key: str | None) -> GraphMethodProfile:
|
|
|
|
|
if not method_key:
|
2026-07-25 11:27:59 +02:00
|
|
|
return LIGHT
|
|
|
|
|
from steering.methods.registry import get_method
|
|
|
|
|
|
|
|
|
|
method = get_method(method_key)
|
|
|
|
|
if method:
|
|
|
|
|
return method.graph_profile
|
|
|
|
|
return _STRICT
|
2026-07-11 08:06:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def enforce_gate_blocking_for_method(method_key: str | None) -> bool:
|
|
|
|
|
return get_graph_profile(method_key).enforce_gate_blocking
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def graph_profile_as_dict(profile: GraphMethodProfile) -> dict[str, bool]:
|
|
|
|
|
return {
|
|
|
|
|
"enforce_gate_blocking": profile.enforce_gate_blocking,
|
|
|
|
|
"emphasize_fulfillment": profile.emphasize_fulfillment,
|
|
|
|
|
}
|