AP1.2 + AP1.4: Signals konsolidieren, RoadmapItem mit Gate-Verify
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Failing after 1m30s
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
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Failing after 1m30s
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
Entfernt operating_phase aus dem Snapshot zugunsten von Lifecycle + signals. Führt methodenneutrale RoadmapItems (Migration 010), Verify-Pfad und Plan-UI ein. Milestone-API bleibt als Compat-Wrapper; Version 0.13.0-ap1.4. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a5d9eeb338
commit
09433b5d28
25 files changed
+1582
-343
No files matched your search
@@ -256,19 +256,20 @@ def _milestones_at_risk(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
SELECT
|
||||
'milestone_at_risk' AS kind,
|
||||
'warning' AS severity,
|
||||
m.title AS title,
|
||||
'Meilenstein als gefährdet markiert' AS summary,
|
||||
ri.title AS title,
|
||||
'Plan-Element als gefährdet markiert' AS summary,
|
||||
'milestone' AS scope_type,
|
||||
m.id AS scope_id,
|
||||
m.initiative_id,
|
||||
ri.id AS scope_id,
|
||||
r.initiative_id,
|
||||
NULL::uuid AS action_id,
|
||||
NULL::uuid AS blocker_id,
|
||||
m.id AS milestone_id,
|
||||
ri.id AS milestone_id,
|
||||
'milestone_at_risk' AS reason_code,
|
||||
'milestones' AS data_source
|
||||
FROM milestones m
|
||||
WHERE m.tenant_id = %s AND m.status = 'at_risk'
|
||||
ORDER BY m.updated_at DESC
|
||||
'roadmap_items' AS data_source
|
||||
FROM roadmap_items ri
|
||||
JOIN roadmaps r ON r.id = ri.roadmap_id AND r.tenant_id = ri.tenant_id
|
||||
WHERE ri.tenant_id = %s AND ri.status = 'at_risk'
|
||||
ORDER BY ri.updated_at DESC
|
||||
LIMIT 20
|
||||
""",
|
||||
(ctx.tenant_id,),
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
"""Initiative snapshot signals — erklärbare Heuristiken ohne operating_phase (AP1.2)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def derive_initiative_signals(
|
||||
*,
|
||||
initiative_status: str,
|
||||
open_actions: int,
|
||||
blocked_actions: int,
|
||||
review_required_actions: int,
|
||||
open_blockers: int,
|
||||
backlog_new: int,
|
||||
planned_reviews_due: int,
|
||||
) -> list[str]:
|
||||
"""Regelbasierte Signale für Steuerungs-Snapshot — kein Lifecycle-Ersatz."""
|
||||
if initiative_status in ("completed", "archived"):
|
||||
return ["initiative_terminal"]
|
||||
|
||||
signals: list[str] = []
|
||||
|
||||
if open_actions == 0 and backlog_new > 0:
|
||||
signals.append("backlog_awaiting_commit")
|
||||
return signals
|
||||
|
||||
if open_actions == 0 and backlog_new == 0:
|
||||
signals.append("no_open_work")
|
||||
return signals
|
||||
|
||||
if blocked_actions > 0:
|
||||
signals.append("actions_blocked")
|
||||
if open_blockers > 0:
|
||||
signals.append("open_blockers")
|
||||
if blocked_actions > 0 or open_blockers > 0:
|
||||
return signals
|
||||
|
||||
if review_required_actions > 0:
|
||||
signals.append("actions_need_review")
|
||||
if planned_reviews_due > 0:
|
||||
signals.append("reviews_due")
|
||||
if review_required_actions > 0 or planned_reviews_due > 0:
|
||||
return signals
|
||||
|
||||
if open_actions > 0:
|
||||
signals.append("work_in_progress")
|
||||
|
||||
return signals
|
||||
@@ -36,20 +36,22 @@ class ProductMilestoneDrivenStrategy:
|
||||
"""
|
||||
SELECT
|
||||
'review_milestone' AS kind,
|
||||
m.title AS title,
|
||||
'Meilenstein prüfen oder Status aktualisieren' AS summary,
|
||||
m.initiative_id,
|
||||
ri.title AS title,
|
||||
'Plan-Element prüfen oder Status aktualisieren' AS summary,
|
||||
r.initiative_id,
|
||||
NULL::uuid AS action_id,
|
||||
NULL::uuid AS backlog_item_id,
|
||||
'milestone_at_risk_or_active' AS reason_code,
|
||||
'Meilenstein prüfen' AS recommended_action
|
||||
FROM milestones m
|
||||
WHERE m.tenant_id = %s AND m.initiative_id = %s
|
||||
AND m.status IN ('at_risk', 'active')
|
||||
'Plan-Element prüfen' AS recommended_action
|
||||
FROM roadmap_items ri
|
||||
JOIN roadmaps r ON r.id = ri.roadmap_id AND r.tenant_id = ri.tenant_id
|
||||
WHERE ri.tenant_id = %s AND r.initiative_id = %s
|
||||
AND ri.item_type = 'milestone'
|
||||
AND ri.status IN ('at_risk', 'active')
|
||||
ORDER BY
|
||||
CASE m.status WHEN 'at_risk' THEN 0 ELSE 1 END,
|
||||
m.target_date ASC NULLS LAST,
|
||||
m.updated_at DESC
|
||||
CASE ri.status WHEN 'at_risk' THEN 0 ELSE 1 END,
|
||||
ri.target_date ASC NULLS LAST,
|
||||
ri.updated_at DESC
|
||||
LIMIT %s
|
||||
""",
|
||||
(ctx.tenant_id, initiative_id, limit),
|
||||
|
||||
Reference in new issue
Block a user