feat(steering): Kernel Spine v0.2 — Events, Slot-Provider, continuous_product
Deploy Development / deploy (push) Successful in 50s
Test Suite / pytest-backend (push) Successful in 3m49s
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 19s
Test Suite / playwright-smoke (push) Successful in 12s

apply_steering_event an Action done, Gate verify/reopen und Blocker resolve; lifecycle-Ketten methodenaware via slot_map; continuous_product slot_map; pytest v0.2.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-26 16:33:00 +02:00
1 parent 606dd960b8
commit fe1edb84f8
18 files changed
+595 -34

No files matched your search

+14
View File
@@ -492,6 +492,20 @@ def update_action(
"to_status": status,
},
)
if status == "done":
from services.steering_events import emit_steering_event
emit_steering_event(
tenant_id=tenant_id,
initiative_id=str(existing["initiative_id"]),
event_kind="actor_result",
payload={
"action_id": action_id,
"from_status": old_status,
"to_status": status,
},
user_id=user_id,
)
return result
+5 -6
View File
@@ -99,14 +99,13 @@ def after_blocker_status_change(
user_id=user_id,
)
if initiative_id and user_id:
from steering.lifecycle.orchestrator import transition
from services.steering_events import emit_steering_event
transition(
None,
initiative_id,
"action_selection",
reason="blocker_resolved",
emit_steering_event(
tenant_id=tenant_id,
initiative_id=initiative_id,
event_kind="situational",
payload={"reason": "blocker_resolved", "blocker_id": blocker_id},
user_id=user_id,
)
+39
View File
@@ -719,6 +719,27 @@ def verify_reached(
)
if transition:
row["maturity_transition"] = transition
elif row.get("item_type") != "work_cycle":
from services.steering_events import emit_steering_event
steering = emit_steering_event(
tenant_id=tenant_id,
initiative_id=initiative_id,
event_kind="gate_verified",
payload={
"roadmap_item_id": item_id,
"item_type": row.get("item_type"),
"verify_reason": verify_reason,
},
user_id=user_id,
)
row["steering_event"] = {
"handled": steering.get("handled"),
"lifecycle_chain": steering.get("lifecycle_chain"),
"lifecycle_state": steering.get("evaluation", {})
.get("lifecycle", {})
.get("current_state"),
}
return row
@@ -773,4 +794,22 @@ def reopen_roadmap_item(
"to_status": "active",
},
)
if row.get("item_type") != "work_cycle":
from services.steering_events import emit_steering_event
steering = emit_steering_event(
tenant_id=tenant_id,
initiative_id=str(row["initiative_id"]),
event_kind="gate_reopened",
payload={
"roadmap_item_id": item_id,
"item_type": row.get("item_type"),
"reason": reason.strip() or None,
},
user_id=user_id,
)
row["steering_event"] = {
"handled": steering.get("handled"),
"lifecycle_chain": steering.get("lifecycle_chain"),
}
return row
+26
View File
@@ -0,0 +1,26 @@
"""Emit steering kernel events from OM mutations — Spine v0.2."""
from __future__ import annotations
from typing import Any, Optional
from steering.kernel.context import resolve_minimal_tenant_context
from steering.kernel.events import apply_steering_event
from steering.lifecycle.event_transitions import EventKind
def emit_steering_event(
*,
tenant_id: str,
initiative_id: str,
event_kind: EventKind,
payload: dict[str, Any] | None = None,
user_id: Optional[str] = None,
) -> dict[str, Any]:
ctx = resolve_minimal_tenant_context(tenant_id=tenant_id, user_id=user_id)
return apply_steering_event(
ctx,
initiative_id=initiative_id,
event_kind=event_kind,
payload=payload,
)