AP1.16d + AP1.9c: Planning Debt in Attention und Cockpit-Signale.
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 2m18s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 19s
Test Suite / playwright-smoke (push) Successful in 12s
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 2m18s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 19s
Test Suite / playwright-smoke (push) Successful in 12s
Attention-Regeln planning_debt/execution_waiting; Portfolio-Kacheln zeigen Steuerungssignale. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
8546c7021b
commit
b9bfa9e5bd
13 files changed
+352
-12
No files matched your search
@@ -18,6 +18,8 @@ AttentionKind = Literal[
|
||||
"stale_initiative",
|
||||
"milestone_at_risk",
|
||||
"gate_graph_blocked",
|
||||
"planning_debt",
|
||||
"execution_waiting",
|
||||
"overdue_action",
|
||||
"review_due",
|
||||
"recurring_due",
|
||||
@@ -316,6 +318,61 @@ def _graph_blocked_gates(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
return items
|
||||
|
||||
|
||||
def _execution_plan_attention(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
"""Planning Debt + Execution-Waiting — AP1.16d / Execution-Graph."""
|
||||
from services import actions as action_service
|
||||
from services import roadmap as roadmap_service
|
||||
from steering.graph.execution_engine import (
|
||||
compute_execution_graph_state,
|
||||
compute_planning_debt,
|
||||
execution_waiting_to_attention_items,
|
||||
planning_debt_to_attention_items,
|
||||
)
|
||||
from services.execution_plan import list_dependencies_for_initiative
|
||||
|
||||
cur.execute(
|
||||
"""
|
||||
SELECT id FROM initiatives
|
||||
WHERE tenant_id = %s AND status IN ('active', 'paused')
|
||||
ORDER BY updated_at DESC
|
||||
LIMIT 30
|
||||
""",
|
||||
(ctx.tenant_id,),
|
||||
)
|
||||
|
||||
items: list[dict[str, Any]] = []
|
||||
for row in cur.fetchall():
|
||||
initiative_id = str(row["id"])
|
||||
actions = action_service.list_actions_for_initiative(
|
||||
tenant_id=ctx.tenant_id, initiative_id=initiative_id
|
||||
)
|
||||
roadmap_items = roadmap_service.list_roadmap_items_for_initiative(
|
||||
tenant_id=ctx.tenant_id, initiative_id=initiative_id
|
||||
)
|
||||
debts = compute_planning_debt(actions=actions, roadmap_items=roadmap_items)
|
||||
items.extend(
|
||||
planning_debt_to_attention_items(initiative_id=initiative_id, debts=debts)
|
||||
)
|
||||
|
||||
dependencies = list_dependencies_for_initiative(
|
||||
tenant_id=ctx.tenant_id, initiative_id=initiative_id
|
||||
)
|
||||
graph_state = compute_execution_graph_state(
|
||||
actions=actions, dependencies=dependencies
|
||||
)
|
||||
items.extend(
|
||||
execution_waiting_to_attention_items(
|
||||
initiative_id=initiative_id,
|
||||
actions=actions,
|
||||
graph_state=graph_state,
|
||||
)
|
||||
)
|
||||
|
||||
if len(items) >= 30:
|
||||
return items[:30]
|
||||
return items
|
||||
|
||||
|
||||
def _milestones_at_risk(cur, ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
cur.execute(
|
||||
"""
|
||||
@@ -491,6 +548,7 @@ def get_attention_items(ctx: TenantContext) -> list[dict[str, Any]]:
|
||||
items.extend(_initiatives_without_next_action(cur, ctx))
|
||||
items.extend(_stale_initiatives(cur, ctx))
|
||||
items.extend(_graph_blocked_gates(cur, ctx))
|
||||
items.extend(_execution_plan_attention(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