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

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:
LarsandCursor committed 2026-07-11 08:06:42 +02:00
1 parent 4f8725e234
commit 1fa61b2dac
14 files changed
+426 -36

No files matched your search

+27
View File
@@ -242,3 +242,30 @@ def test_initiative_roadmap_graph_state(client):
assert body["items"][gate_a["id"]]["blocked"] is True
assert gate_b["id"] in body["items"][gate_a["id"]]["blocked_by"]
assert gate_a["id"] not in body["ready_items"]
def test_graph_blocked_attention_for_gate_enforcing_method(client):
user = provision_user_in_tenant(tenant_role="member")
token = _login(client, user)
initiative_id = _create_initiative(client, token).json()["id"]
client.patch(
f"/api/steering/initiatives/{initiative_id}/context",
json={"method_key": "product_milestone_driven"},
headers=_auth(token),
)
gate_a = _create_roadmap_item(client, token, initiative_id, title="Gate A", sort_order=0).json()
gate_b = _create_roadmap_item(client, token, initiative_id, title="Gate B", sort_order=1).json()
client.post(
f"/api/roadmap-items/{gate_a['id']}/dependencies",
json={"to_item_id": gate_b["id"], "dependency_type": "requires"},
headers=_auth(token),
)
attention = client.get("/api/workspace/attention", headers=_auth(token))
assert attention.status_code == 200
assert any(
i["kind"] == "gate_graph_blocked" and i["milestone_id"] == gate_a["id"]
for i in attention.json()
)
@@ -0,0 +1,70 @@
"""Unit tests for graph method profiles (AP1.4e)."""
from steering.graph.profiles import get_graph_profile
from steering.graph.roadmap_engine import (
apply_graph_method_profile,
compute_initiative_graph_state,
compute_initiative_graph_state_with_profile,
)
def _item(item_id: str, status: str = "planned", **kwargs):
return {
"id": item_id,
"status": status,
"sort_order": kwargs.get("sort_order", 0),
"sequencing_mode": kwargs.get("sequencing_mode", "sequential"),
}
def test_generic_operating_does_not_enforce_blocking():
items = [
_item("first", "planned", sort_order=0),
_item("second", "planned", sort_order=1),
]
state = compute_initiative_graph_state_with_profile(
items=items,
dependencies=[],
method_key="generic_operating",
)
assert state["graph_profile"]["enforce_gate_blocking"] is False
assert state["items"]["second"]["would_block"] is True
assert state["items"]["second"]["blocked"] is False
assert state["items"]["second"]["ready"] is True
assert state["blocked_items"] == []
def test_product_milestone_enforces_blocking():
items = [
_item("first", "planned", sort_order=0),
_item("second", "planned", sort_order=1),
]
state = compute_initiative_graph_state_with_profile(
items=items,
dependencies=[],
method_key="product_milestone_driven",
)
assert state["graph_profile"]["enforce_gate_blocking"] is True
assert state["items"]["second"]["blocked"] is True
assert "second" in state["blocked_items"]
def test_maturity_progression_emphasizes_fulfillment():
profile = get_graph_profile("maturity_progression")
assert profile.emphasize_fulfillment is True
assert profile.enforce_gate_blocking is False
def test_initiative_fulfillment_ratio_average():
items = [_item("a", "active"), _item("b", "active")]
base = compute_initiative_graph_state(
items=items,
dependencies=[],
criteria_progress={
"a": {"total": 2, "closed": 2, "open": 0},
"b": {"total": 4, "closed": 2, "open": 2},
},
)
profile = get_graph_profile("maturity_progression")
state = apply_graph_method_profile(base, profile)
assert state["initiative_fulfillment_ratio"] == 0.75