feat(steering): Kernel Spine v0.1.1 als zentraler Initiative-Einstieg
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
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>
This commit is contained in:
1 parent
753f178b0c
commit
75a6a63665
20 files changed
+923
-51
No files matched your search
@@ -1,11 +1,10 @@
|
||||
"""Signal Engine — method-aware NextAction (AP1.1)."""
|
||||
"""Signal Engine — delegates initiative steering to Kernel Spine v0.1."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Literal
|
||||
|
||||
from services import steering_context as sc_service
|
||||
from steering.methods.registry import get_method
|
||||
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
|
||||
@@ -14,43 +13,6 @@ from tenant_context import TenantContext
|
||||
SignalKind = Literal["attention", "next_action"]
|
||||
|
||||
|
||||
def _resolve_method_key(ctx: TenantContext, initiative_id: str | None) -> str:
|
||||
if not initiative_id:
|
||||
return "generic_operating"
|
||||
row = sc_service.get_steering_context(
|
||||
tenant_id=ctx.tenant_id, initiative_id=initiative_id
|
||||
)
|
||||
if row:
|
||||
return row["method_key"]
|
||||
return "generic_operating"
|
||||
|
||||
|
||||
def _primary_composes_with_agile(method_key: str) -> bool:
|
||||
agile = get_method("agile_iteration")
|
||||
if not agile:
|
||||
return False
|
||||
return method_key in agile.composes_with
|
||||
|
||||
|
||||
def _resolve_next_action_strategy_key(
|
||||
ctx: TenantContext, initiative_id: str | None
|
||||
) -> str:
|
||||
method_key = _resolve_method_key(ctx, initiative_id)
|
||||
method = get_method(method_key)
|
||||
strategy_key = method.next_action_strategy_key if method else default_strategy.key
|
||||
if not initiative_id:
|
||||
return strategy_key
|
||||
|
||||
from services.work_cycle import get_active_work_cycle
|
||||
|
||||
active = get_active_work_cycle(tenant_id=ctx.tenant_id, initiative_id=initiative_id)
|
||||
if active and _primary_composes_with_agile(method_key):
|
||||
agile = get_next_action_strategy("agile_iteration")
|
||||
if agile:
|
||||
return agile.key
|
||||
return strategy_key
|
||||
|
||||
|
||||
def evaluate(
|
||||
ctx: TenantContext,
|
||||
kind: SignalKind = "attention",
|
||||
@@ -58,9 +20,19 @@ def evaluate(
|
||||
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_key = _resolve_next_action_strategy_key(ctx, initiative_id)
|
||||
strategy = get_next_action_strategy(strategy_key) or default_strategy
|
||||
return strategy.evaluate(ctx, initiative_id=initiative_id, limit=limit)
|
||||
strategy = get_next_action_strategy("default") or default_strategy
|
||||
return strategy.evaluate(ctx, initiative_id=None, limit=limit)
|
||||
Reference in new issue
Block a user