feat(steering): Kernel v0.3 mit Read-Model- und Proposal-Registry (K-Ext-1, P6)
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 4m11s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 15s
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 4m11s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 15s
Erweitert evaluate_steering um read_models und proposals, migriert epic_rollup auf Registry, liefert sprint_commit-Vorschlaege und UI auf Plan-Sprint. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
c5e2c69b1e
commit
20636f88d2
22 files changed
+779
-56
No files matched your search
@@ -1,6 +1,5 @@
|
||||
"""Steering Kernel Spine — universal runtime entry for initiative steering."""
|
||||
|
||||
from steering.kernel.evaluate import evaluate_steering
|
||||
from steering.kernel.models import HorizonMarker, LifecycleContext, SteeringBinding, SteeringEvaluation
|
||||
|
||||
__all__ = [
|
||||
@@ -10,3 +9,10 @@ __all__ = [
|
||||
"SteeringEvaluation",
|
||||
"evaluate_steering",
|
||||
]
|
||||
|
||||
|
||||
def evaluate_steering(*args, **kwargs):
|
||||
"""Lazy import avoids circular dependency with extension registries."""
|
||||
from steering.kernel.evaluate import evaluate_steering as _evaluate
|
||||
|
||||
return _evaluate(*args, **kwargs)
|
||||
@@ -24,6 +24,9 @@ def evaluate_attention(
|
||||
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 for a single initiative — no fake next when planning debt."""
|
||||
@@ -129,25 +132,28 @@ def evaluate_attention(
|
||||
)
|
||||
)
|
||||
|
||||
from services.operating_context import get_operating_context
|
||||
from services import backlog as backlog_service
|
||||
from steering.read_models.epic_rollup import (
|
||||
compute_epic_rollup,
|
||||
epic_rollup_attention_items,
|
||||
)
|
||||
read_models = read_models or {}
|
||||
proposals = proposals or {}
|
||||
|
||||
operating = get_operating_context(
|
||||
tenant_id=ctx.tenant_id, initiative_id=initiative_id
|
||||
)
|
||||
if operating.get("backlog_vocabulary", {}).get("capabilities", {}).get(
|
||||
"epic_hierarchy"
|
||||
):
|
||||
backlog_items = backlog_service.list_backlog_for_initiative(
|
||||
tenant_id=ctx.tenant_id, initiative_id=initiative_id
|
||||
)
|
||||
rollups = compute_epic_rollup(backlog_items=backlog_items, actions=actions)
|
||||
from steering.read_models.epic_rollup import epic_rollup_attention_items
|
||||
from steering.proposals.sprint_commit import sprint_commit_attention_items
|
||||
|
||||
epic_rollups = read_models.get("epic_rollup")
|
||||
if epic_rollups:
|
||||
items.extend(
|
||||
epic_rollup_attention_items(initiative_id=initiative_id, rollups=rollups)
|
||||
epic_rollup_attention_items(
|
||||
initiative_id=initiative_id, rollups=epic_rollups
|
||||
)
|
||||
)
|
||||
|
||||
sprint_proposals = proposals.get("sprint_commit")
|
||||
if sprint_proposals:
|
||||
items.extend(
|
||||
sprint_commit_attention_items(
|
||||
initiative_id=initiative_id,
|
||||
proposals=sprint_proposals,
|
||||
actions=actions,
|
||||
)
|
||||
)
|
||||
|
||||
if (
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
"""Steering Kernel Spine — single entry point v0.1."""
|
||||
"""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
|
||||
|
||||
|
||||
@@ -39,6 +42,14 @@ def evaluate_steering(
|
||||
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,
|
||||
@@ -47,12 +58,18 @@ def evaluate_steering(
|
||||
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,
|
||||
)
|
||||
|
||||
@@ -63,4 +80,6 @@ def evaluate_steering(
|
||||
lifecycle=lifecycle,
|
||||
next_work=next_work,
|
||||
attention=attention,
|
||||
read_models=read_models,
|
||||
proposals=proposals,
|
||||
)
|
||||
@@ -65,7 +65,9 @@ class SteeringEvaluation:
|
||||
lifecycle: LifecycleContext
|
||||
next_work: list[dict[str, Any]] = field(default_factory=list)
|
||||
attention: list[dict[str, Any]] = field(default_factory=list)
|
||||
data_source: str = "steering_kernel_v0.2"
|
||||
read_models: dict[str, Any] = field(default_factory=dict)
|
||||
proposals: dict[str, Any] = field(default_factory=dict)
|
||||
data_source: str = "steering_kernel_v0.3"
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
return {
|
||||
@@ -77,5 +79,7 @@ class SteeringEvaluation:
|
||||
"lifecycle": self.lifecycle.to_dict(),
|
||||
"next_work": self.next_work,
|
||||
"attention": self.attention,
|
||||
"read_models": self.read_models,
|
||||
"proposals": self.proposals,
|
||||
"data_source": self.data_source,
|
||||
}
|
||||
Reference in new issue
Block a user