Some checks failed
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Failing after 4m15s
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
K-Ext-4/P8 deklarative Agent-Slots; P7 tech_debt Read Model und Vokabular; Review-Attention in den Kernel verlagert. Co-authored-by: Cursor <cursoragent@cursor.com>
44 lines
1.4 KiB
Python
44 lines
1.4 KiB
Python
"""Attention evaluation (Q5) — method- and horizon-aware for one initiative."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from steering.kernel.models import HorizonMarker, SteeringBinding
|
|
from tenant_context import TenantContext
|
|
|
|
# Side-effect: register contributors
|
|
import steering.attention.contributors.core # noqa: F401
|
|
import steering.attention.contributors.gates # noqa: F401
|
|
import steering.attention.contributors.read_models # noqa: F401
|
|
import steering.attention.contributors.reviews # noqa: F401
|
|
|
|
|
|
def evaluate_attention(
|
|
ctx: TenantContext,
|
|
*,
|
|
initiative_id: str,
|
|
binding: SteeringBinding,
|
|
horizon: HorizonMarker,
|
|
next_work: list[dict[str, Any]],
|
|
read_models: dict[str, Any] | None = None,
|
|
proposals: dict[str, Any] | None = None,
|
|
eval_ctx=None,
|
|
limit: int = 20,
|
|
) -> list[dict[str, Any]]:
|
|
"""Kernel attention — contributors via registry (K-Ext-2)."""
|
|
from steering.attention.context import AttentionEvalContext
|
|
from steering.attention.contributors.registry import collect_attention_items
|
|
|
|
actx = AttentionEvalContext(
|
|
tenant_ctx=ctx,
|
|
initiative_id=initiative_id,
|
|
binding=binding,
|
|
horizon=horizon,
|
|
next_work=next_work,
|
|
read_models=read_models or {},
|
|
proposals=proposals or {},
|
|
eval_ctx=eval_ctx,
|
|
)
|
|
return collect_attention_items(actx)[:limit]
|