docs: Archetyp-Vollspecs und Methodenkern vorlaeufig freigeben.
Deploy Development / deploy (push) Successful in 48s
Test Suite / pytest-backend (push) Failing after 3m23s
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) Successful in 48s
Test Suite / pytest-backend (push) Failing after 3m23s
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
Decision-Lock, Spec-D-Methoden und C1-Massstab-Vollspecs als Zielbild; Steering-Registry/Compat und Horizon-Tests an die Normierung anbinden. Implementierungsausreichendheit bleibt bewusst offen. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
005b371ac0
commit
753f178b0c
48 files changed
+5113
-531
No files matched your search
@@ -86,6 +86,32 @@ def test_create_initiative_b2b_starter_kit(client):
|
||||
assert "Betrieb" in titles
|
||||
|
||||
|
||||
def test_create_initiative_a2_starter_kit_includes_action(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
created = client.post(
|
||||
"/api/initiatives",
|
||||
json={
|
||||
"title": "Test Projekt",
|
||||
"archetype_key": "initiative.linear_project",
|
||||
},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert created.status_code == 201
|
||||
initiative_id = created.json()["id"]
|
||||
assert created.json()["starter_kit"]["applied"] is True
|
||||
|
||||
actions = client.get(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert actions.status_code == 200
|
||||
assert any(
|
||||
a["title"] == "Erster Schritt — Planung konkretisieren" for a in actions.json()
|
||||
)
|
||||
|
||||
|
||||
def test_starter_kit_skipped_when_structure_exists(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
"""AP2.2c — A2 sequential_dependency: Gate-Horizont + Agile-Komposition."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from tests.factories import provision_user_in_tenant
|
||||
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
||||
|
||||
|
||||
def _gate_ids(client, token, initiative_id):
|
||||
roadmap = client.get(
|
||||
f"/api/initiatives/{initiative_id}/roadmap/items",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert roadmap.status_code == 200
|
||||
items = roadmap.json()
|
||||
active = next(i for i in items if i.get("status") == "active")
|
||||
planned = next(i for i in items if i.get("title", "").startswith("G2"))
|
||||
return active["id"], planned["id"]
|
||||
|
||||
|
||||
def test_sequential_next_action_only_in_active_gate_horizon(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Horizon Test",
|
||||
archetype_key="initiative.linear_project",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
g1_id, g2_id = _gate_ids(client, token, initiative_id)
|
||||
|
||||
off_horizon = client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={
|
||||
"title": "Außerhalb Horizont",
|
||||
"status": "open",
|
||||
"roadmap_item_id": g2_id,
|
||||
"sort_order": 0,
|
||||
},
|
||||
headers=_auth(token),
|
||||
)
|
||||
on_horizon = client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={
|
||||
"title": "Im aktiven Gate",
|
||||
"status": "open",
|
||||
"roadmap_item_id": g1_id,
|
||||
"sort_order": 1,
|
||||
},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert off_horizon.status_code == 201 and on_horizon.status_code == 201
|
||||
|
||||
snap = client.get(
|
||||
f"/api/initiatives/{initiative_id}/steering-snapshot",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert snap.status_code == 200
|
||||
next_actions = snap.json().get("next_actions") or []
|
||||
assert next_actions
|
||||
next_ids = {n.get("action_id") for n in next_actions}
|
||||
assert off_horizon.json()["id"] not in next_ids
|
||||
assert on_horizon.json()["id"] in next_ids
|
||||
|
||||
|
||||
def test_agile_on_linear_delegates_primary_without_active_sprint(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Agile Primary",
|
||||
archetype_key="initiative.linear_project",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
g1_id, _ = _gate_ids(client, token, initiative_id)
|
||||
|
||||
action = client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={
|
||||
"title": "Gate Action",
|
||||
"status": "open",
|
||||
"roadmap_item_id": g1_id,
|
||||
},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert action.status_code == 201
|
||||
|
||||
snap = client.get(
|
||||
f"/api/initiatives/{initiative_id}/steering-snapshot",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert snap.status_code == 200
|
||||
assert snap.json().get("active_work_cycle") is None
|
||||
next_actions = snap.json().get("next_actions") or []
|
||||
assert next_actions[0]["action_id"] == action.json()["id"]
|
||||
assert next_actions[0]["reason_code"] in (
|
||||
"execution_ready",
|
||||
"execution_critical_path",
|
||||
)
|
||||
|
||||
|
||||
def test_agile_on_linear_sprint_intersects_gate_horizon(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Sprint Horizon",
|
||||
archetype_key="initiative.linear_project",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
g1_id, _ = _gate_ids(client, token, initiative_id)
|
||||
|
||||
cycle = client.post(
|
||||
f"/api/initiatives/{initiative_id}/work-cycles",
|
||||
json={"title": "Montage-Woche", "status": "active"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert cycle.status_code == 201
|
||||
cycle_id = cycle.json()["id"]
|
||||
|
||||
outside_sprint = client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={
|
||||
"title": "Nur Gate",
|
||||
"status": "open",
|
||||
"roadmap_item_id": g1_id,
|
||||
},
|
||||
headers=_auth(token),
|
||||
)
|
||||
in_sprint = client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={
|
||||
"title": "Im Sprint",
|
||||
"status": "ready",
|
||||
"roadmap_item_id": g1_id,
|
||||
"work_cycle_id": cycle_id,
|
||||
},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert outside_sprint.status_code == 201 and in_sprint.status_code == 201
|
||||
|
||||
snap = client.get(
|
||||
f"/api/initiatives/{initiative_id}/steering-snapshot",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert snap.status_code == 200
|
||||
assert snap.json().get("active_work_cycle")
|
||||
next_actions = snap.json().get("next_actions") or []
|
||||
assert next_actions
|
||||
assert next_actions[0]["action_id"] == in_sprint.json()["id"]
|
||||
assert next_actions[0]["reason_code"] == "work_cycle_ready"
|
||||
|
||||
|
||||
def test_operating_context_active_composition_modifier_with_sprint(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Composition Flag",
|
||||
archetype_key="initiative.linear_project",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
ctx_before = client.get(
|
||||
f"/api/initiatives/{initiative_id}/operating-context",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert ctx_before.json().get("active_composition_modifier") is None
|
||||
|
||||
client.post(
|
||||
f"/api/initiatives/{initiative_id}/work-cycles",
|
||||
json={"title": "S1", "status": "active"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
|
||||
ctx_after = client.get(
|
||||
f"/api/initiatives/{initiative_id}/operating-context",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert ctx_after.json().get("active_composition_modifier") == "agile_iteration"
|
||||
@@ -6,7 +6,28 @@ from tests.factories import provision_user_in_tenant
|
||||
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
||||
|
||||
|
||||
def test_update_method_queue_pull_on_linear_ok(client):
|
||||
def test_update_method_queue_pull_on_support_queue_ok(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Queue Override",
|
||||
archetype_key="initiative.support_queue",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
res = client.patch(
|
||||
f"/api/steering/initiatives/{initiative_id}/context",
|
||||
json={"method_key": "queue_pull"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert res.status_code == 200
|
||||
assert res.json()["method_key"] == "queue_pull"
|
||||
|
||||
|
||||
def test_update_method_queue_pull_on_linear_rejected(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
|
||||
@@ -23,8 +44,8 @@ def test_update_method_queue_pull_on_linear_ok(client):
|
||||
json={"method_key": "queue_pull"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert res.status_code == 200
|
||||
assert res.json()["method_key"] == "queue_pull"
|
||||
assert res.status_code == 400
|
||||
assert "kompatibel" in res.json()["detail"].lower()
|
||||
|
||||
|
||||
def test_update_method_maturity_on_product_rejected(client):
|
||||
@@ -55,8 +76,8 @@ def test_operating_context_reflects_method_slice_intersection(client):
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Queue Linear",
|
||||
archetype_key="initiative.linear_project",
|
||||
title="Queue Support",
|
||||
archetype_key="initiative.support_queue",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
|
||||
@@ -30,11 +30,33 @@ def test_continuous_product_ui_features_from_method():
|
||||
assert features["steeringSnapshotOnWorkSprint"] is True
|
||||
|
||||
|
||||
def test_list_compatible_methods_linear_includes_queue_pull():
|
||||
def test_list_compatible_methods_linear_excludes_queue_pull():
|
||||
methods = list_compatible_methods("initiative.linear_project")
|
||||
keys = {m.key for m in methods}
|
||||
assert "sequential_dependency" in keys
|
||||
assert "queue_pull" in keys
|
||||
assert "queue_pull" not in keys
|
||||
assert "agile_iteration" not in keys # modifier, not primary switch target
|
||||
|
||||
|
||||
def test_agile_iteration_composes_with_matrix():
|
||||
method = get_method("agile_iteration")
|
||||
assert method is not None
|
||||
assert method.composes_with == frozenset(
|
||||
{
|
||||
"continuous_product",
|
||||
"sequential_dependency",
|
||||
"recurring_control",
|
||||
}
|
||||
)
|
||||
assert "program_delivery" not in method.composes_with
|
||||
|
||||
|
||||
def test_list_composable_modifiers_for_linear():
|
||||
from steering.methods.registry import list_composable_modifiers
|
||||
|
||||
modifiers = list_composable_modifiers("sequential_dependency")
|
||||
assert len(modifiers) == 1
|
||||
assert modifiers[0].key == "agile_iteration"
|
||||
|
||||
|
||||
def test_list_compatible_methods_product_excludes_maturity():
|
||||
@@ -101,32 +123,43 @@ def test_steering_methods_filtered_by_archetype(client):
|
||||
assert product["is_default"] is True
|
||||
|
||||
|
||||
def test_queue_pull_on_linear_changes_steering_elements(client):
|
||||
from tests.factories import provision_user_in_tenant
|
||||
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
||||
|
||||
def test_queue_pull_rejected_on_linear(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Linear Queue",
|
||||
title="Linear Block Queue",
|
||||
archetype_key="initiative.linear_project",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
client.patch(
|
||||
res = client.patch(
|
||||
f"/api/steering/initiatives/{initiative_id}/context",
|
||||
json={"method_key": "queue_pull"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert res.status_code == 400
|
||||
assert "kompatibel" in res.json()["detail"].lower()
|
||||
|
||||
|
||||
def test_operating_context_composable_modifiers_linear(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Linear Modifiers",
|
||||
archetype_key="initiative.linear_project",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
ctx = client.get(
|
||||
f"/api/initiatives/{initiative_id}/operating-context",
|
||||
headers=_auth(token),
|
||||
)
|
||||
body = ctx.json()
|
||||
assert "queue_inbox" in body["steering_elements"]
|
||||
assert "critical_path" not in body["steering_elements"]
|
||||
assert body["ui_features"].get("criticalPathControl") is not True
|
||||
assert ctx.status_code == 200
|
||||
modifiers = ctx.json().get("composable_modifiers") or []
|
||||
assert any(m["key"] == "agile_iteration" for m in modifiers)
|
||||
Reference in new issue
Block a user