Kairo-Jinkendo/backend/steering/kernel/evaluate.py
Lars 75a6a63665
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
feat(steering): Kernel Spine v0.1.1 als zentraler Initiative-Einstieg
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>
2026-07-26 16:08:58 +02:00

67 lines
1.8 KiB
Python

"""Steering Kernel Spine — single entry point v0.1."""
from __future__ import annotations
from steering.kernel.attention import evaluate_attention
from steering.kernel.binding import resolve_steering_binding
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 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,
)
next_work = evaluate_next_work(
ctx,
initiative_id=initiative_id,
binding=binding,
horizon=horizon,
limit=next_work_limit,
)
attention = evaluate_attention(
ctx,
initiative_id=initiative_id,
binding=binding,
horizon=horizon,
next_work=next_work,
limit=attention_limit,
)
return SteeringEvaluation(
initiative_id=initiative_id,
binding=binding,
horizon=horizon,
lifecycle=lifecycle,
next_work=next_work,
attention=attention,
)