AP1.4e: Methodenprofile am Gate-Graph.
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Failing after 2m18s
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 43s
Test Suite / pytest-backend (push) Failing after 2m18s
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
generic_operating ohne harte Blockade, Reifegrad-Methoden mit Erfuellungsgrad; Attention gate_graph_blocked fuer gate-orientierte Methoden. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4f8725e234
commit
1fa61b2dac
14 files changed
+426
-36
No files matched your search
@@ -17,6 +17,7 @@ AttentionKind = Literal[
|
||||
"initiative_without_next_action",
|
||||
"stale_initiative",
|
||||
"milestone_at_risk",
|
||||
"gate_graph_blocked",
|
||||
"overdue_action",
|
||||
"review_due",
|
||||
"recurring_due",
|
||||
@@ -250,6 +251,71 @@ def _stale_initiatives(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
return [_serialize_attention(dict(r)) for r in cur.fetchall()]
|
||||
|
||||
|
||||
def _graph_blocked_gates(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
from steering.graph.profiles import enforce_gate_blocking_for_method
|
||||
from steering.graph.roadmap_engine import load_initiative_graph_state
|
||||
|
||||
cur.execute(
|
||||
"""
|
||||
SELECT sc.initiative_id, sc.method_key
|
||||
FROM steering_contexts sc
|
||||
JOIN initiatives i
|
||||
ON i.id = sc.initiative_id AND i.tenant_id = sc.tenant_id
|
||||
WHERE sc.tenant_id = %s AND i.status IN ('active', 'paused')
|
||||
ORDER BY i.updated_at DESC
|
||||
LIMIT 30
|
||||
""",
|
||||
(ctx.tenant_id,),
|
||||
)
|
||||
|
||||
items: list[dict[str, Any]] = []
|
||||
for row in cur.fetchall():
|
||||
method_key = row.get("method_key") or "generic_operating"
|
||||
if not enforce_gate_blocking_for_method(method_key):
|
||||
continue
|
||||
|
||||
initiative_id = str(row["initiative_id"])
|
||||
state = load_initiative_graph_state(
|
||||
tenant_id=ctx.tenant_id, initiative_id=initiative_id
|
||||
)
|
||||
for gate_id in state.get("blocked_items", []):
|
||||
cur.execute(
|
||||
"""
|
||||
SELECT title FROM roadmap_items
|
||||
WHERE id = %s AND tenant_id = %s
|
||||
""",
|
||||
(gate_id, ctx.tenant_id),
|
||||
)
|
||||
gate_row = cur.fetchone()
|
||||
if not gate_row:
|
||||
continue
|
||||
blocked_by = state["items"].get(gate_id, {}).get("blocked_by") or []
|
||||
summary = (
|
||||
"Graph-Voraussetzung noch nicht erreicht"
|
||||
if len(blocked_by) != 1
|
||||
else "Graph-Voraussetzung noch nicht erreicht"
|
||||
)
|
||||
items.append(
|
||||
{
|
||||
"kind": "gate_graph_blocked",
|
||||
"severity": "warning",
|
||||
"title": gate_row["title"],
|
||||
"summary": summary,
|
||||
"scope_type": "milestone",
|
||||
"scope_id": gate_id,
|
||||
"initiative_id": initiative_id,
|
||||
"action_id": None,
|
||||
"blocker_id": None,
|
||||
"milestone_id": gate_id,
|
||||
"reason_code": "gate_graph_blocked",
|
||||
"data_source": "roadmap_graph",
|
||||
}
|
||||
)
|
||||
if len(items) >= 20:
|
||||
return items
|
||||
return items
|
||||
|
||||
|
||||
def _milestones_at_risk(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
cur.execute(
|
||||
"""
|
||||
@@ -424,6 +490,7 @@ def get_attention_items(ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
items.extend(_unassigned_actions(cur, ctx))
|
||||
items.extend(_initiatives_without_next_action(cur, ctx))
|
||||
items.extend(_stale_initiatives(cur, ctx))
|
||||
items.extend(_graph_blocked_gates(cur, ctx))
|
||||
items.extend(_milestones_at_risk(cur, ctx))
|
||||
items.extend(_overdue_actions(cur, ctx))
|
||||
items.extend(_actions_review_required(cur, ctx))
|
||||
|
||||
Reference in new issue
Block a user