Erfassen und Transparent: Archetyp, Methode und Auspraegung in der UI sichtbar.
Test Suite / pytest-backend (push) Failing after 2s
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
Deploy Development / deploy (push) Failing after 50s
Test Suite / pytest-backend (push) Failing after 2s
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
Deploy Development / deploy (push) Failing after 50s
Method-Profiles-API und Auswahl beim Anlegen/Profil; Steuerungs-Meta in Listen und Plan; Projekt-Archetyp-Spiegel, Next-Action-Links und Umlaut-Fix fuer testbare Guidance. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
95b743d6fd
commit
efb45a3ee6
31 files changed
+965
-65
No files matched your search
@@ -22,10 +22,23 @@ def get_steering_context_dto(
|
||||
initiative_id=initiative_id,
|
||||
)
|
||||
method = get_method(row["method_key"])
|
||||
metadata = row.get("lifecycle_metadata") or {}
|
||||
if isinstance(metadata, str):
|
||||
metadata = {}
|
||||
method_profile_key = metadata.get("method_profile_key")
|
||||
method_profile_label = None
|
||||
if method_profile_key:
|
||||
from method_profiles.registry import get_method_profile
|
||||
|
||||
profile = get_method_profile(method_profile_key)
|
||||
if profile:
|
||||
method_profile_label = profile.get("label")
|
||||
return {
|
||||
**row,
|
||||
"lifecycle_label": lifecycle_label(row["lifecycle_state"]),
|
||||
"method_label": method.label if method else row["method_key"],
|
||||
"method_profile_key": method_profile_key,
|
||||
"method_profile_label": method_profile_label,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ def _blocked_actions(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
'blocked_action' AS kind,
|
||||
'critical' AS severity,
|
||||
a.title AS title,
|
||||
'Maßnahme ist blockiert' AS summary,
|
||||
'Maßnahme ist blockiert' AS summary,
|
||||
'action' AS scope_type,
|
||||
a.id AS scope_id,
|
||||
a.initiative_id,
|
||||
@@ -136,7 +136,7 @@ def _high_priority_actions(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
'high_priority_action' AS kind,
|
||||
'warning' AS severity,
|
||||
a.title AS title,
|
||||
'High-Priority Maßnahme offen' AS summary,
|
||||
'High-Priority Maßnahme offen' AS summary,
|
||||
'action' AS scope_type,
|
||||
a.id AS scope_id,
|
||||
a.initiative_id,
|
||||
@@ -165,7 +165,7 @@ def _unassigned_actions(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
'unassigned_action' AS kind,
|
||||
'warning' AS severity,
|
||||
a.title AS title,
|
||||
'Maßnahme ohne Zuweisung' AS summary,
|
||||
'Maßnahme ohne Zuweisung' AS summary,
|
||||
'action' AS scope_type,
|
||||
a.id AS scope_id,
|
||||
a.initiative_id,
|
||||
@@ -196,7 +196,7 @@ def _initiatives_without_next_action(cur, ctx: TenantContext) -> list[dict[str,
|
||||
'initiative_without_next_action' AS kind,
|
||||
'info' AS severity,
|
||||
i.title AS title,
|
||||
'Keine offene nächste Maßnahme' AS summary,
|
||||
'Keine offene nächste Maßnahme' AS summary,
|
||||
'initiative' AS scope_type,
|
||||
i.id AS scope_id,
|
||||
i.id AS initiative_id,
|
||||
@@ -229,7 +229,7 @@ def _stale_initiatives(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
'stale_initiative' AS kind,
|
||||
'info' AS severity,
|
||||
i.title AS title,
|
||||
'Vorhaben seit über 14 Tagen unverändert' AS summary,
|
||||
'Vorhaben seit über 14 Tagen unverändert' AS summary,
|
||||
'initiative' AS scope_type,
|
||||
i.id AS scope_id,
|
||||
i.id AS initiative_id,
|
||||
@@ -284,7 +284,7 @@ def _actions_review_required(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
'action_review_required' AS kind,
|
||||
'warning' AS severity,
|
||||
a.title AS title,
|
||||
'Ma├ƒnahme wartet auf Review ÔÇö kein geplantes Review verkn├╝pft' AS summary,
|
||||
'Maßnahme wartet auf Review — kein geplantes Review verknüpft' AS summary,
|
||||
'action' AS scope_type,
|
||||
a.id AS scope_id,
|
||||
a.initiative_id,
|
||||
@@ -319,7 +319,7 @@ def _overdue_actions(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
'overdue_action' AS kind,
|
||||
'warning' AS severity,
|
||||
a.title AS title,
|
||||
'Maßnahme überfällig' AS summary,
|
||||
'Maßnahme überfällig' AS summary,
|
||||
'action' AS scope_type,
|
||||
a.id AS scope_id,
|
||||
a.initiative_id,
|
||||
@@ -350,7 +350,7 @@ def _reviews_due(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
'review_due' AS kind,
|
||||
'warning' AS severity,
|
||||
r.title AS title,
|
||||
'Review fällig' AS summary,
|
||||
'Review fällig' AS summary,
|
||||
'review' AS scope_type,
|
||||
r.id AS scope_id,
|
||||
r.initiative_id,
|
||||
@@ -388,7 +388,7 @@ def _recurring_due(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
'recurring_due' AS kind,
|
||||
'info' AS severity,
|
||||
re.title AS title,
|
||||
'Wiederkehrendes Element fällig' AS summary,
|
||||
'Wiederkehrendes Element fällig' AS summary,
|
||||
'recurring_element' AS scope_type,
|
||||
re.id AS scope_id,
|
||||
re.initiative_id,
|
||||
@@ -413,7 +413,7 @@ def _recurring_due(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
|
||||
|
||||
def get_attention_items(ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
"""Regelbasierte Attention Items ÔÇö tenant-scoped, erkl├ñrbar."""
|
||||
"""Regelbasierte Attention Items — tenant-scoped, erklärbar."""
|
||||
conn = get_connection()
|
||||
try:
|
||||
with conn.cursor(cursor_factory=RealDictCursor) as cur:
|
||||
@@ -439,7 +439,7 @@ def get_attention_items(ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
def get_next_action_candidates(
|
||||
ctx: TenantContext, *, limit: int = 10
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Regelbasierte NextActionCandidates ÔÇö limitiert, tenant-scoped."""
|
||||
"""Regelbasierte NextActionCandidates — limitiert, tenant-scoped."""
|
||||
if limit < 1:
|
||||
limit = 1
|
||||
if limit > 50:
|
||||
@@ -454,7 +454,7 @@ def get_next_action_candidates(
|
||||
SELECT
|
||||
'resolve_blocker' AS kind,
|
||||
b.title AS title,
|
||||
'Blocker klären oder Status aktualisieren' AS summary,
|
||||
'Blocker klären oder Status aktualisieren' AS summary,
|
||||
b.initiative_id,
|
||||
b.action_id,
|
||||
NULL::uuid AS backlog_item_id,
|
||||
@@ -486,7 +486,7 @@ def get_next_action_candidates(
|
||||
a.id AS action_id,
|
||||
NULL::uuid AS backlog_item_id,
|
||||
'action_unassigned' AS reason_code,
|
||||
'Maßnahme zuweisen' AS recommended_action
|
||||
'Maßnahme zuweisen' AS recommended_action
|
||||
FROM actions a
|
||||
WHERE a.tenant_id = %s
|
||||
AND a.status IN ('open', 'ready', 'in_progress')
|
||||
@@ -512,12 +512,12 @@ def get_next_action_candidates(
|
||||
SELECT
|
||||
'convert_backlog' AS kind,
|
||||
bi.title AS title,
|
||||
'Freigegebenes Backlog-Item in Maßnahme umwandeln' AS summary,
|
||||
'Freigegebenes Backlog-Item in Maßnahme umwandeln' AS summary,
|
||||
bi.initiative_id,
|
||||
NULL::uuid AS action_id,
|
||||
bi.id AS backlog_item_id,
|
||||
'backlog_accepted_not_converted' AS reason_code,
|
||||
'In Maßnahme umwandeln' AS recommended_action
|
||||
'In Maßnahme umwandeln' AS recommended_action
|
||||
FROM backlog_items bi
|
||||
WHERE bi.tenant_id = %s
|
||||
AND bi.status = 'accepted'
|
||||
@@ -540,12 +540,12 @@ def get_next_action_candidates(
|
||||
SELECT
|
||||
'create_action' AS kind,
|
||||
i.title AS title,
|
||||
'Nächste Maßnahme für Vorhaben anlegen' AS summary,
|
||||
'Nächste Maßnahme für Vorhaben anlegen' AS summary,
|
||||
i.id AS initiative_id,
|
||||
NULL::uuid AS action_id,
|
||||
NULL::uuid AS backlog_item_id,
|
||||
'initiative_no_open_action' AS reason_code,
|
||||
'Maßnahme anlegen' AS recommended_action
|
||||
'Maßnahme anlegen' AS recommended_action
|
||||
FROM initiatives i
|
||||
WHERE i.tenant_id = %s
|
||||
AND i.status IN ('active', 'paused')
|
||||
@@ -573,7 +573,7 @@ def get_next_action_candidates(
|
||||
def get_next_action_candidates_for_initiative(
|
||||
ctx: TenantContext, *, initiative_id: str, limit: int = 5
|
||||
) -> list[dict[str, Any]]:
|
||||
"""NextActionCandidates f├╝r ein Vorhaben ÔÇö tenant-scoped."""
|
||||
"""NextActionCandidates für ein Vorhaben — tenant-scoped."""
|
||||
if limit < 1:
|
||||
limit = 1
|
||||
if limit > 20:
|
||||
@@ -588,7 +588,7 @@ def get_next_action_candidates_for_initiative(
|
||||
SELECT
|
||||
'resolve_blocker' AS kind,
|
||||
b.title AS title,
|
||||
'Blocker klären oder Status aktualisieren' AS summary,
|
||||
'Blocker klären oder Status aktualisieren' AS summary,
|
||||
b.initiative_id,
|
||||
b.action_id,
|
||||
NULL::uuid AS backlog_item_id,
|
||||
@@ -621,7 +621,7 @@ def get_next_action_candidates_for_initiative(
|
||||
a.id AS action_id,
|
||||
NULL::uuid AS backlog_item_id,
|
||||
'action_unassigned' AS reason_code,
|
||||
'Maßnahme zuweisen' AS recommended_action
|
||||
'Maßnahme zuweisen' AS recommended_action
|
||||
FROM actions a
|
||||
WHERE a.tenant_id = %s AND a.initiative_id = %s
|
||||
AND a.status IN ('open', 'ready', 'in_progress')
|
||||
@@ -647,12 +647,12 @@ def get_next_action_candidates_for_initiative(
|
||||
SELECT
|
||||
'convert_backlog' AS kind,
|
||||
bi.title AS title,
|
||||
'Freigegebenes Backlog-Item in Maßnahme umwandeln' AS summary,
|
||||
'Freigegebenes Backlog-Item in Maßnahme umwandeln' AS summary,
|
||||
bi.initiative_id,
|
||||
NULL::uuid AS action_id,
|
||||
bi.id AS backlog_item_id,
|
||||
'backlog_accepted_not_converted' AS reason_code,
|
||||
'In Maßnahme umwandeln' AS recommended_action
|
||||
'In Maßnahme umwandeln' AS recommended_action
|
||||
FROM backlog_items bi
|
||||
WHERE bi.tenant_id = %s AND bi.initiative_id = %s
|
||||
AND bi.status = 'accepted'
|
||||
@@ -693,12 +693,12 @@ def get_next_action_candidates_for_initiative(
|
||||
{
|
||||
"kind": "create_action",
|
||||
"title": init_row["title"],
|
||||
"summary": "Nächste Maßnahme für Vorhaben anlegen",
|
||||
"summary": "Nächste Maßnahme für Vorhaben anlegen",
|
||||
"initiative_id": initiative_id,
|
||||
"action_id": None,
|
||||
"backlog_item_id": None,
|
||||
"reason_code": "initiative_no_open_action",
|
||||
"recommended_action": "Maßnahme anlegen",
|
||||
"recommended_action": "Maßnahme anlegen",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user