"""Steering Kernel Spine — single entry point v0.3.""" from __future__ import annotations from steering.kernel.attention import evaluate_attention from steering.kernel.binding import resolve_steering_binding from steering.eval_context import build_steering_eval_context from steering.kernel.horizon import resolve_horizon from steering.kernel.lifecycle import resolve_lifecycle_context from steering.kernel.models import SteeringEvaluation from steering.kernel.next_work import evaluate_next_work from steering.proposals.registry import compute_proposals from steering.read_models.registry import compute_read_models from tenant_context import TenantContext def evaluate_steering( ctx: TenantContext, *, initiative_id: str, next_work_limit: int = 10, attention_limit: int = 20, ) -> SteeringEvaluation: """ Herzmaschine — ein Wahrheitsmodell pro Vorhaben. Alle Initiative-Steuerung (Snapshot, Cockpit, API) muss hier durch. """ if next_work_limit < 1: next_work_limit = 1 if attention_limit < 1: attention_limit = 1 binding = resolve_steering_binding(ctx, initiative_id) lifecycle = resolve_lifecycle_context( ctx, initiative_id=initiative_id, binding=binding ) horizon = resolve_horizon( ctx, initiative_id=initiative_id, primary_method_key=binding.primary_method_key, composition_modifier=binding.composition_modifier, ) eval_ctx = build_steering_eval_context( ctx, initiative_id=initiative_id, binding=binding, horizon=horizon, lifecycle=lifecycle, ) next_work = evaluate_next_work( ctx, initiative_id=initiative_id, binding=binding, horizon=horizon, limit=next_work_limit, ) read_models = compute_read_models(eval_ctx) proposals = compute_proposals(eval_ctx, read_models=read_models) attention = evaluate_attention( ctx, initiative_id=initiative_id, binding=binding, horizon=horizon, next_work=next_work, read_models=read_models, proposals=proposals, eval_ctx=eval_ctx, limit=attention_limit, ) return SteeringEvaluation( initiative_id=initiative_id, binding=binding, horizon=horizon, lifecycle=lifecycle, next_work=next_work, attention=attention, read_models=read_models, proposals=proposals, )