Kairo-Jinkendo/backend/steering/graph/profiles.py
Lars 1fa61b2dac
Some checks failed
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Failing after 2m18s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
AP1.4e: Methodenprofile am Gate-Graph.
generic_operating ohne harte Blockade, Reifegrad-Methoden mit Erfuellungsgrad; Attention gate_graph_blocked fuer gate-orientierte Methoden.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 08:06:42 +02:00

52 lines
1.6 KiB
Python

"""Method graph profiles — AP1.4e."""
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)
METHOD_GRAPH_PROFILES: dict[str, GraphMethodProfile] = {
"generic_operating": _LIGHT,
"queue_pull": _LIGHT,
"dispute_procedure": _LIGHT,
"continuous_product": _FULFILLMENT,
"maturity_progression": _FULFILLMENT,
"chapter_based_progression": _FULFILLMENT,
"product_milestone_driven": _STRICT,
"program_delivery": _STRICT,
"sequential_dependency": _STRICT,
"agile_iteration": _STRICT,
"recurring_control": _FULFILLMENT,
}
def get_graph_profile(method_key: str | None) -> GraphMethodProfile:
if not method_key:
return METHOD_GRAPH_PROFILES[DEFAULT_METHOD_KEY]
return METHOD_GRAPH_PROFILES.get(method_key, _STRICT)
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,
}