27 lines
755 B
Python
27 lines
755 B
Python
|
|
"""Signal Engine — delegates to default rule provider (AP1.0)."""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typing import Any, Literal
|
||
|
|
|
||
|
|
from steering.signals import default_rules
|
||
|
|
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 kind == "attention":
|
||
|
|
return default_rules.get_attention_items(ctx)
|
||
|
|
if initiative_id:
|
||
|
|
return default_rules.get_next_action_candidates_for_initiative(
|
||
|
|
ctx, initiative_id=initiative_id, limit=limit
|
||
|
|
)
|
||
|
|
return default_rules.get_next_action_candidates(ctx, limit=limit)
|