Kairo-Jinkendo/backend/steering/effective_contract.py
Lars a3b14d9c00
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 3m56s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 19s
Test Suite / playwright-smoke (push) Successful in 13s
feat(steering): Backlog-Vokabular aus Methoden-Vertrag (ADP P3)
backlog_epic_hierarchy als Steuerungselement, effektive steering_elements im Operating Context, Backend-Guards und UI ohne Slice-Ifs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 10:44:38 +02:00

37 lines
1.2 KiB
Python

"""Effective method contract — primary + composition modifier (AP2.4)."""
from __future__ import annotations
from steering.methods.registry import get_method
PLAN_PHASE_MODIFIER_KEY = "agile_iteration"
def resolve_effective_steering_elements(
primary_method_key: str,
*,
data_slices: list[str],
active_composition_modifier: str | None,
) -> frozenset[str]:
"""
Primärmethode + aktiver Modifier; Plan-Phase: agile_iteration wenn work_cycles
Slice aktiv und Methode komponierbar (Epic-Planung vor aktivem Sprint).
"""
primary = get_method(primary_method_key)
elements: set[str] = set(primary.steering_elements if primary else [])
modifier_keys: list[str] = []
if active_composition_modifier:
modifier_keys.append(active_composition_modifier)
elif "work_cycles" in data_slices:
agile = get_method(PLAN_PHASE_MODIFIER_KEY)
if agile and primary_method_key in agile.composes_with:
modifier_keys.append(PLAN_PHASE_MODIFIER_KEY)
for modifier_key in modifier_keys:
modifier = get_method(modifier_key)
if modifier:
elements.update(modifier.steering_elements)
return frozenset(elements)