All checks were successful
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 4m11s
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 18s
Test Suite / playwright-smoke (push) Successful in 15s
Erweitert evaluate_steering um read_models und proposals, migriert epic_rollup auf Registry, liefert sprint_commit-Vorschlaege und UI auf Plan-Sprint. Co-authored-by: Cursor <cursoragent@cursor.com>
76 lines
2.4 KiB
Python
76 lines
2.4 KiB
Python
"""AP2.2i — Sprint commit proposals via Kernel v0.3 (P6)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from tests.factories import provision_user_in_tenant
|
|
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
|
|
|
|
|
def test_steering_snapshot_includes_sprint_commit_proposals(client):
|
|
user = provision_user_in_tenant(tenant_role="admin")
|
|
token = _login(client, user)
|
|
|
|
created = _create_initiative(
|
|
client,
|
|
token,
|
|
title="Sprint Proposal",
|
|
archetype_key="initiative.product",
|
|
)
|
|
initiative_id = created.json()["id"]
|
|
|
|
client.post(
|
|
f"/api/initiatives/{initiative_id}/work-cycles",
|
|
json={"title": "Sprint R2", "status": "planned"},
|
|
headers=_auth(token),
|
|
)
|
|
|
|
client.post(
|
|
f"/api/initiatives/{initiative_id}/backlog",
|
|
json={"title": "Fix login", "item_kind": "bug", "status": "accepted", "priority": "high"},
|
|
headers=_auth(token),
|
|
)
|
|
client.post(
|
|
f"/api/initiatives/{initiative_id}/backlog",
|
|
json={"title": "Checkout story", "item_kind": "story", "status": "accepted"},
|
|
headers=_auth(token),
|
|
)
|
|
|
|
snapshot = client.get(
|
|
f"/api/initiatives/{initiative_id}/steering-snapshot",
|
|
headers=_auth(token),
|
|
)
|
|
assert snapshot.status_code == 200
|
|
body = snapshot.json()
|
|
assert body["steering_kernel"]["data_source"] == "steering_kernel_v0.3"
|
|
proposals = body.get("sprint_commit_proposals") or []
|
|
assert len(proposals) >= 2
|
|
assert proposals[0]["item_kind"] == "bug"
|
|
assert proposals[0]["scope_type"] == "backlog_item"
|
|
assert proposals[0]["proposal_key"] == "sprint_commit"
|
|
|
|
attention_codes = [
|
|
item.get("code") or item.get("reason_code")
|
|
for item in body.get("attention_items", [])
|
|
]
|
|
assert "sprint_commit_suggested" in attention_codes
|
|
|
|
|
|
def test_linear_initiative_has_no_sprint_proposals(client):
|
|
user = provision_user_in_tenant(tenant_role="admin")
|
|
token = _login(client, user)
|
|
|
|
created = _create_initiative(
|
|
client,
|
|
token,
|
|
title="Linear Proposals",
|
|
archetype_key="initiative.linear_project",
|
|
)
|
|
initiative_id = created.json()["id"]
|
|
|
|
snapshot = client.get(
|
|
f"/api/initiatives/{initiative_id}/steering-snapshot",
|
|
headers=_auth(token),
|
|
)
|
|
assert snapshot.status_code == 200
|
|
assert snapshot.json().get("sprint_commit_proposals") == []
|