AP0.10a: OM-Integration — Steering-Snapshot, Transitions, Verknüpfungen
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Failing after 1m10s
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 1s
Test Suite / compose-smoke (push) Has been skipped
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Failing after 1m10s
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 1s
Test Suite / compose-smoke (push) Has been skipped
Beantwortet die Lücke zwischen parallelen Tabellen und späterem Steering Core: Graph-Read-Model, minimale Flows, sichtbarer Steuerungszustand. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a025542545
commit
e25ff86420
17 files changed
+1034
-5
No files matched your search
@@ -8,6 +8,10 @@ export function getInitiative(id) {
|
||||
return apiFetch(`/api/initiatives/${id}`)
|
||||
}
|
||||
|
||||
export function getInitiativeSteeringSnapshot(id) {
|
||||
return apiFetch(`/api/initiatives/${id}/steering-snapshot`)
|
||||
}
|
||||
|
||||
export function createInitiative(payload) {
|
||||
return apiFetch('/api/initiatives', {
|
||||
method: 'POST',
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
import { PHASE_LABELS } from '../constants/operating.js'
|
||||
|
||||
export function SteeringSnapshotPanel({ snapshot }) {
|
||||
if (!snapshot) return null
|
||||
|
||||
const { operating_phase, phase_signals, counts } = snapshot
|
||||
const phaseLabel = PHASE_LABELS[operating_phase] || operating_phase
|
||||
|
||||
return (
|
||||
<section className="card steering-snapshot">
|
||||
<div className="section-header">
|
||||
<h2>Steuerungszustand</h2>
|
||||
<span className="badge status-badge status-active">{phaseLabel}</span>
|
||||
</div>
|
||||
{phase_signals?.length > 0 && (
|
||||
<p className="muted snapshot-signals">
|
||||
Signale: {phase_signals.join(' · ')}
|
||||
</p>
|
||||
)}
|
||||
<dl className="snapshot-counts">
|
||||
<div>
|
||||
<dt>Offene Maßnahmen</dt>
|
||||
<dd>{counts.actions_open}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Blockiert</dt>
|
||||
<dd>{counts.actions_blocked}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Review nötig</dt>
|
||||
<dd>{counts.actions_review_required}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Offene Blocker</dt>
|
||||
<dd>{counts.blockers_open}</dd>
|
||||
</div>
|
||||
{(counts.unlinked_blockers > 0 || counts.unlinked_evidence > 0) && (
|
||||
<div className="snapshot-warn">
|
||||
<dt>Unverknüpft</dt>
|
||||
<dd>
|
||||
{counts.unlinked_blockers} Blocker, {counts.unlinked_evidence} Evidence
|
||||
</dd>
|
||||
</div>
|
||||
)}
|
||||
</dl>
|
||||
<p className="muted snapshot-hint">
|
||||
Kanonischer Operating Cycle — noch heuristisch, später methodengeführt über Steering Core.
|
||||
</p>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
export const OPERATING_PHASES = [
|
||||
'capture',
|
||||
'triage',
|
||||
'structure',
|
||||
'commit',
|
||||
'execute',
|
||||
'verify',
|
||||
'review',
|
||||
'adapt',
|
||||
'closure',
|
||||
]
|
||||
|
||||
export const PHASE_LABELS = {
|
||||
capture: 'Erfassung',
|
||||
triage: 'Einordnung',
|
||||
structure: 'Struktur',
|
||||
commit: 'Commit',
|
||||
execute: 'Umsetzung',
|
||||
verify: 'Nachweis',
|
||||
review: 'Review',
|
||||
adapt: 'Anpassung',
|
||||
closure: 'Abschluss',
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useState } from 'react'
|
||||
import { Link, useParams } from 'react-router-dom'
|
||||
import {
|
||||
getInitiative,
|
||||
getInitiativeSteeringSnapshot,
|
||||
listInitiativeActions,
|
||||
createInitiativeAction,
|
||||
} from '../api/initiatives.js'
|
||||
@@ -60,6 +61,7 @@ import { EvidenceSection } from '../components/EvidenceSection.jsx'
|
||||
import { DecisionsSection } from '../components/DecisionsSection.jsx'
|
||||
import { ReviewsSection } from '../components/ReviewsSection.jsx'
|
||||
import { RecurringSection } from '../components/RecurringSection.jsx'
|
||||
import { SteeringSnapshotPanel } from '../components/SteeringSnapshotPanel.jsx'
|
||||
import { EmptyState } from '../components/EmptyState.jsx'
|
||||
import { ErrorState } from '../components/ErrorState.jsx'
|
||||
import { LoadingState } from '../components/LoadingState.jsx'
|
||||
@@ -88,6 +90,7 @@ export function InitiativeDetailPage() {
|
||||
const [decisions, setDecisions] = useState([])
|
||||
const [reviews, setReviews] = useState([])
|
||||
const [recurringItems, setRecurringItems] = useState([])
|
||||
const [steeringSnapshot, setSteeringSnapshot] = useState(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
const [showActionForm, setShowActionForm] = useState(false)
|
||||
@@ -119,6 +122,11 @@ export function InitiativeDetailPage() {
|
||||
loads.push(listInitiativeDecisions(id).then(setDecisions).catch(() => setDecisions([])))
|
||||
loads.push(listInitiativeReviews(id).then(setReviews).catch(() => setReviews([])))
|
||||
loads.push(listInitiativeRecurring(id).then(setRecurringItems).catch(() => setRecurringItems([])))
|
||||
loads.push(
|
||||
getInitiativeSteeringSnapshot(id)
|
||||
.then(setSteeringSnapshot)
|
||||
.catch(() => setSteeringSnapshot(null))
|
||||
)
|
||||
}
|
||||
await Promise.all(loads)
|
||||
} catch (err) {
|
||||
@@ -136,6 +144,10 @@ export function InitiativeDetailPage() {
|
||||
? actions.filter((a) => a.status !== 'done' && a.status !== 'discarded')
|
||||
: actions
|
||||
|
||||
const actionContextById = Object.fromEntries(
|
||||
(steeringSnapshot?.actions || []).map((a) => [a.id, a])
|
||||
)
|
||||
|
||||
async function handleCreateAction(payload) {
|
||||
setFormBusy(true)
|
||||
try {
|
||||
@@ -200,6 +212,23 @@ export function InitiativeDetailPage() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCreateBlockerForAction(actionId) {
|
||||
if (!capabilities.has('kairo.blocker.manage')) return
|
||||
setFormBusy(true)
|
||||
try {
|
||||
await createInitiativeBlocker(id, {
|
||||
title: 'Blocker',
|
||||
action_id: actionId,
|
||||
set_action_blocked: true,
|
||||
})
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setFormBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleBlockerStatus(blockerId, status) {
|
||||
try {
|
||||
await updateBlocker(blockerId, { status })
|
||||
@@ -453,6 +482,10 @@ export function InitiativeDetailPage() {
|
||||
|
||||
{error && <p className="error">{error}</p>}
|
||||
|
||||
{capabilities.has('kairo.initiative.read') && (
|
||||
<SteeringSnapshotPanel snapshot={steeringSnapshot} />
|
||||
)}
|
||||
|
||||
<section className="card">
|
||||
<div className="section-header">
|
||||
<h2>Maßnahmen</h2>
|
||||
@@ -498,7 +531,9 @@ export function InitiativeDetailPage() {
|
||||
)}
|
||||
|
||||
<ul className="item-list actions-detail-list">
|
||||
{visibleActions.map((action) => (
|
||||
{visibleActions.map((action) => {
|
||||
const ctx = actionContextById[action.id]
|
||||
return (
|
||||
<li key={action.id} className="list-item card-list-item">
|
||||
{editingAction === action.id ? (
|
||||
<ActionForm
|
||||
@@ -530,6 +565,13 @@ export function InitiativeDetailPage() {
|
||||
Fällig: {new Date(action.due_at).toLocaleString('de-DE')}
|
||||
</p>
|
||||
)}
|
||||
{ctx && (ctx.open_blocker_count > 0 || ctx.evidence?.length > 0 || ctx.reviews?.length > 0) && (
|
||||
<p className="muted list-item-sub action-links">
|
||||
{ctx.open_blocker_count > 0 && `${ctx.open_blocker_count} Blocker · `}
|
||||
{ctx.evidence?.length > 0 && `${ctx.evidence.length} Evidence · `}
|
||||
{ctx.reviews?.length > 0 && `${ctx.reviews.length} Review(s)`}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge status={action.status} />
|
||||
@@ -548,6 +590,16 @@ export function InitiativeDetailPage() {
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{capabilities.has('kairo.blocker.manage') && action.status !== 'done' && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => handleCreateBlockerForAction(action.id)}
|
||||
disabled={formBusy}
|
||||
>
|
||||
Blocker
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
@@ -564,7 +616,8 @@ export function InitiativeDetailPage() {
|
||||
</>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -597,3 +597,38 @@
|
||||
font-size: 9px;
|
||||
}
|
||||
}
|
||||
|
||||
.steering-snapshot .snapshot-counts {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
|
||||
gap: 0.75rem 1rem;
|
||||
margin: 0.75rem 0 0;
|
||||
}
|
||||
|
||||
.steering-snapshot .snapshot-counts div {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.steering-snapshot .snapshot-counts dt {
|
||||
font-size: 0.75rem;
|
||||
color: var(--jk-muted, #666);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.steering-snapshot .snapshot-counts dd {
|
||||
margin: 0.15rem 0 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.steering-snapshot .snapshot-warn dd {
|
||||
color: var(--jk-warning, #b45309);
|
||||
}
|
||||
|
||||
.steering-snapshot .snapshot-hint {
|
||||
font-size: 0.8rem;
|
||||
margin: 0.75rem 0 0;
|
||||
}
|
||||
|
||||
.action-links {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
Reference in new issue
Block a user