Kairo-Jinkendo/backend/steering/methods/registrations/_helpers.py
Lars 3bd983297b
Some checks failed
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Failing after 2m2s
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 3s
Test Suite / compose-smoke (push) Has been skipped
AP2.0: Archetyp-Katalog, Method-Stubs und sichtbare Steuerung in Kontrolle.
PO-Dokumente (ADP v0.2, MVP v0.3) und Minimal Complete Slice: Registry-Methoden, Initiative/Project-Spiegel, Default-Methode bei Anlage, Lagebild mit Archetyp und Guidance.

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

71 lines
1.5 KiB
Python

"""Shared registration helper for AP2.0 method stubs."""
from __future__ import annotations
from steering.lifecycle.states import STANDARD_LIFECYCLE_STEPS
from steering.methods.registry import MethodDefinition, get_method, register_method
_PRODUCT_LIKE_STEPS = (
"intake",
"method_selection",
"structure_setup",
"planning",
"action_selection",
"assignment",
"waiting",
"result_intake",
"validation",
"review",
"adaptation",
"closure",
)
_LIGHT_STEPS = (
"intake",
"structure_setup",
"action_selection",
"assignment",
"waiting",
"review",
"adaptation",
"closure",
)
def register_stub_method(
*,
key: str,
label: str,
description: str,
next_action_strategy_key: str = "default",
lifecycle_steps: tuple[str, ...] | None = None,
) -> None:
if get_method(key):
return
register_method(
MethodDefinition(
key=key,
version="0.1.0",
label=label,
description=description,
default_lifecycle_steps=lifecycle_steps or STANDARD_LIFECYCLE_STEPS,
next_action_strategy_key=next_action_strategy_key,
)
)
def register_product_like_method(
*,
key: str,
label: str,
description: str,
next_action_strategy_key: str,
) -> None:
register_stub_method(
key=key,
label=label,
description=description,
next_action_strategy_key=next_action_strategy_key,
lifecycle_steps=_PRODUCT_LIKE_STEPS,
)