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>
39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
"""Signal Engine — delegates initiative steering to Kernel Spine v0.1."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Literal
|
|
|
|
from steering.kernel import evaluate_steering
|
|
from steering.signals import default_rules
|
|
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
|
|
|
|
SignalKind = Literal["attention", "next_action"]
|
|
|
|
|
|
def evaluate(
|
|
ctx: TenantContext,
|
|
kind: SignalKind = "attention",
|
|
*,
|
|
limit: int = 10,
|
|
initiative_id: str | None = None,
|
|
) -> list[dict[str, Any]]:
|
|
if initiative_id:
|
|
evaluation = evaluate_steering(
|
|
ctx,
|
|
initiative_id=initiative_id,
|
|
next_work_limit=limit,
|
|
attention_limit=max(limit, 10),
|
|
)
|
|
if kind == "next_action":
|
|
return evaluation.next_work
|
|
return evaluation.attention
|
|
|
|
if kind == "attention":
|
|
return default_rules.get_attention_items(ctx)
|
|
|
|
strategy = get_next_action_strategy("default") or default_strategy
|
|
return strategy.evaluate(ctx, initiative_id=None, limit=limit)
|