Some checks failed
Deploy Development / deploy (push) Successful in 48s
Test Suite / pytest-backend (push) Failing after 3m33s
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
evaluate_steering() vereinheitlicht Horizon, Next Work und Attention; Snapshot und Signal Engine delegieren dorthin; slot_map deklarativ fuer sequential_dependency und generic_operating. Co-authored-by: Cursor <cursoragent@cursor.com>
38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
"""Next work evaluation (Schlitz 5) — routes to registered strategies only."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from steering.kernel.models import HorizonMarker, SteeringBinding
|
|
from steering.strategies.next_action.default_strategy import default_strategy
|
|
from steering.strategies.next_action.registry import get_next_action_strategy
|
|
from tenant_context import TenantContext
|
|
|
|
|
|
def evaluate_next_work(
|
|
ctx: TenantContext,
|
|
*,
|
|
initiative_id: str,
|
|
binding: SteeringBinding,
|
|
horizon: HorizonMarker,
|
|
limit: int,
|
|
) -> list[dict[str, Any]]:
|
|
"""Invoke the bound next-work strategy (primary or composition)."""
|
|
if limit < 1:
|
|
limit = 1
|
|
|
|
strategy = get_next_action_strategy(binding.next_work_strategy_key) or default_strategy
|
|
candidates = strategy.evaluate(
|
|
ctx, initiative_id=initiative_id, limit=limit
|
|
)
|
|
|
|
for item in candidates:
|
|
item.setdefault("data_source", "steering_kernel")
|
|
if horizon.gate_roadmap_item_id:
|
|
item.setdefault("horizon_gate_id", horizon.gate_roadmap_item_id)
|
|
if horizon.work_cycle_id:
|
|
item.setdefault("horizon_work_cycle_id", horizon.work_cycle_id)
|
|
|
|
return candidates[:limit]
|