Some checks failed
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Failing after 4m15s
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
K-Ext-4/P8 deklarative Agent-Slots; P7 tech_debt Read Model und Vokabular; Review-Attention in den Kernel verlagert. Co-authored-by: Cursor <cursoragent@cursor.com>
99 lines
2.7 KiB
Python
99 lines
2.7 KiB
Python
"""Profilgebundenes Backlog-Vokabular — ADP P3 / AP2.4 Methoden-Vertrag."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
_EMPTY: dict[str, Any] = {
|
|
"profile_key": "none",
|
|
"kinds": [],
|
|
"labels": {},
|
|
"default_kind": "story",
|
|
"epic_hierarchy": False,
|
|
"convertible_kinds": [],
|
|
"capabilities": {
|
|
"sprint_commit": False,
|
|
"epic_hierarchy": False,
|
|
},
|
|
}
|
|
|
|
_AGILE_INTAKE: dict[str, Any] = {
|
|
"profile_key": "agile_intake",
|
|
"kinds": ["epic", "story", "bug", "issue", "tech_debt"],
|
|
"labels": {
|
|
"epic": "Epic",
|
|
"story": "Story",
|
|
"bug": "Bug",
|
|
"issue": "Issue",
|
|
"tech_debt": "Technische Schuld",
|
|
},
|
|
"default_kind": "story",
|
|
"epic_hierarchy": True,
|
|
"convertible_kinds": ["story", "bug", "issue", "tech_debt"],
|
|
}
|
|
|
|
_CONTINUOUS_INTAKE: dict[str, Any] = {
|
|
"profile_key": "continuous_intake",
|
|
"kinds": ["story", "bug", "issue", "tech_debt"],
|
|
"labels": {
|
|
"story": "Idee",
|
|
"bug": "Bug",
|
|
"issue": "Störung",
|
|
"tech_debt": "Technische Schuld",
|
|
},
|
|
"default_kind": "story",
|
|
"epic_hierarchy": False,
|
|
"convertible_kinds": ["story", "bug", "issue", "tech_debt"],
|
|
}
|
|
|
|
_STANDARD_INTAKE: dict[str, Any] = {
|
|
"profile_key": "standard_intake",
|
|
"kinds": ["story", "bug", "issue", "tech_debt"],
|
|
"labels": {
|
|
"story": "Story",
|
|
"bug": "Bug",
|
|
"issue": "Issue",
|
|
"tech_debt": "Technische Schuld",
|
|
},
|
|
"default_kind": "story",
|
|
"epic_hierarchy": False,
|
|
"convertible_kinds": ["story", "bug", "issue", "tech_debt"],
|
|
}
|
|
|
|
|
|
def _with_capabilities(
|
|
vocabulary: dict[str, Any],
|
|
*,
|
|
steering_elements: frozenset[str],
|
|
) -> dict[str, Any]:
|
|
result = dict(vocabulary)
|
|
sprint_commit = "work_cycle_scope" in steering_elements
|
|
epic_hierarchy = "backlog_epic_hierarchy" in steering_elements
|
|
result["epic_hierarchy"] = epic_hierarchy
|
|
result["capabilities"] = {
|
|
"sprint_commit": sprint_commit,
|
|
"epic_hierarchy": epic_hierarchy,
|
|
}
|
|
return result
|
|
|
|
|
|
def resolve_backlog_vocabulary(
|
|
*,
|
|
data_slices: list[str],
|
|
method_key: str,
|
|
steering_elements: frozenset[str],
|
|
) -> dict[str, Any]:
|
|
"""Backlog-Typen/Labels aus effektivem Methoden-Vertrag — nicht aus Page-Ifs."""
|
|
if "backlog" not in data_slices:
|
|
return dict(_EMPTY)
|
|
|
|
if "backlog_epic_hierarchy" in steering_elements:
|
|
return _with_capabilities(dict(_AGILE_INTAKE), steering_elements=steering_elements)
|
|
|
|
if method_key == "continuous_product":
|
|
return _with_capabilities(
|
|
dict(_CONTINUOUS_INTAKE), steering_elements=steering_elements
|
|
)
|
|
|
|
return _with_capabilities(dict(_STANDARD_INTAKE), steering_elements=steering_elements)
|