refactor(steering): Sprint-Vorschlaege mit austauschbarem Ranker und Abhaengigkeiten
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 4m8s
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 13s
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 4m8s
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 13s
Keine feste Bug-zuerst-Policy: heuristic_v0 als Fallback, agent_v1-Slot vorbereitet, parent_action-Abhaengigkeiten und factors[] fuer spaetere KI-Steuerung. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
20636f88d2
commit
1bbc5dbfce
13 files changed
+524
-134
No files matched your search
@@ -44,9 +44,9 @@ def test_steering_snapshot_includes_sprint_commit_proposals(client):
|
||||
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"
|
||||
assert proposals[0].get("ranker_key") == "heuristic_v0"
|
||||
assert "factors" in proposals[0]
|
||||
|
||||
attention_codes = [
|
||||
item.get("code") or item.get("reason_code")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Unit tests — sprint commit proposal (P6)."""
|
||||
"""Unit tests — sprint commit proposal rankers (P6)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -12,6 +12,7 @@ def _ctx(
|
||||
*,
|
||||
backlog_items: list,
|
||||
work_cycles: list,
|
||||
actions: list | None = None,
|
||||
vocabulary: dict | None = None,
|
||||
) -> SteeringEvalContext:
|
||||
binding = SteeringBinding(
|
||||
@@ -55,23 +56,50 @@ def _ctx(
|
||||
)
|
||||
eval_ctx._backlog_items = backlog_items
|
||||
eval_ctx._work_cycles = work_cycles
|
||||
eval_ctx._actions = actions or []
|
||||
return eval_ctx
|
||||
|
||||
|
||||
def test_sprint_commit_ranks_bugs_before_stories():
|
||||
def test_critical_story_can_rank_before_normal_bug():
|
||||
proposals = propose_sprint_commit(
|
||||
_ctx(
|
||||
work_cycles=[{"id": "wc-1", "title": "Sprint 1", "status": "planned", "sort_order": 0}],
|
||||
backlog_items=[
|
||||
{"id": "s1", "title": "Story", "item_kind": "story", "status": "accepted", "priority": "normal", "sort_order": 0},
|
||||
{"id": "b1", "title": "Bug", "item_kind": "bug", "status": "accepted", "priority": "normal", "sort_order": 1},
|
||||
{"id": "s1", "title": "Critical story", "item_kind": "story", "status": "accepted", "priority": "critical", "sort_order": 1},
|
||||
{"id": "b1", "title": "Minor bug", "item_kind": "bug", "status": "accepted", "priority": "normal", "sort_order": 0},
|
||||
],
|
||||
)
|
||||
)
|
||||
assert len(proposals) == 2
|
||||
assert proposals[0]["scope_id"] == "b1"
|
||||
assert proposals[0]["reason_code"] == "bug_default"
|
||||
assert proposals[0]["work_cycle_id"] == "wc-1"
|
||||
assert proposals[0]["scope_id"] == "s1"
|
||||
assert proposals[0]["ranker_key"] == "heuristic_v0"
|
||||
assert any(f["code"] == "priority" for f in proposals[0]["factors"])
|
||||
|
||||
|
||||
def test_dependency_blocked_bug_ranks_after_ready_story():
|
||||
proposals = propose_sprint_commit(
|
||||
_ctx(
|
||||
work_cycles=[{"id": "wc-1", "title": "Sprint 1", "status": "planned", "sort_order": 0}],
|
||||
backlog_items=[
|
||||
{"id": "s1", "title": "Ready story", "item_kind": "story", "status": "accepted", "priority": "normal", "sort_order": 1},
|
||||
{
|
||||
"id": "b1",
|
||||
"title": "Blocked bug",
|
||||
"item_kind": "bug",
|
||||
"status": "accepted",
|
||||
"priority": "critical",
|
||||
"sort_order": 0,
|
||||
"parent_action_id": "a-feature",
|
||||
},
|
||||
],
|
||||
actions=[
|
||||
{"id": "a-feature", "title": "Feature", "status": "in_progress", "work_cycle_id": None},
|
||||
],
|
||||
)
|
||||
)
|
||||
assert proposals[0]["scope_id"] == "s1"
|
||||
blocked = next(p for p in proposals if p["scope_id"] == "b1")
|
||||
assert blocked["dependency_blocked"] is True
|
||||
assert blocked["reason_code"] == "waiting_on_feature_action"
|
||||
|
||||
|
||||
def test_sprint_commit_empty_without_planable_cycle():
|
||||
|
||||
Reference in new issue
Block a user