AP1.2 + AP1.4: Signals konsolidieren, RoadmapItem mit Gate-Verify
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Failing after 1m30s
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

Entfernt operating_phase aus dem Snapshot zugunsten von Lifecycle + signals.
Führt methodenneutrale RoadmapItems (Migration 010), Verify-Pfad und Plan-UI ein.
Milestone-API bleibt als Compat-Wrapper; Version 0.13.0-ap1.4.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-05 18:45:36 +02:00
1 parent a5d9eeb338
commit 09433b5d28
25 files changed
+1582 -343

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
import { apiFetch } from './client.js'
export function listInitiativeRoadmapItems(initiativeId) {
return apiFetch(`/api/initiatives/${initiativeId}/roadmap/items`)
}
export function createInitiativeRoadmapItem(initiativeId, body) {
return apiFetch(`/api/initiatives/${initiativeId}/roadmap/items`, {
method: 'POST',
body: JSON.stringify(body),
})
}
export function updateRoadmapItem(itemId, body) {
return apiFetch(`/api/roadmap-items/${itemId}`, {
method: 'PATCH',
body: JSON.stringify(body),
})
}
export function deleteRoadmapItem(itemId) {
return apiFetch(`/api/roadmap-items/${itemId}`, { method: 'DELETE' })
}
export function verifyRoadmapItemReached(itemId) {
return apiFetch(`/api/roadmap-items/${itemId}/verify-reached`, {
method: 'POST',
})
}
export function listRoadmapItemDependencies(itemId) {
return apiFetch(`/api/roadmap-items/${itemId}/dependencies`)
}
export function addRoadmapItemDependency(itemId, body) {
return apiFetch(`/api/roadmap-items/${itemId}/dependencies`, {
method: 'POST',
body: JSON.stringify(body),
})
}
@@ -4,7 +4,7 @@ const AREAS = [
{
to: 'plan',
title: 'Plan',
description: 'Meilensteine und Roadmap — überprüfbare Zielpunkte pflegen.',
description: 'Roadmap, Gates und Plan-Ist — methodenneutral pflegen.',
},
{
to: 'execution',
@@ -34,8 +34,8 @@ export function InitiativeNavCards({ initiativeId, counts = {} }) {
? `${counts.backlog} Backlog`
: area.to === 'execution' && counts.actionsOpen
? `${counts.actionsOpen} offen`
: area.to === 'plan' && counts.milestones
? `${counts.milestones} Meilensteine`
: area.to === 'plan' && counts.roadmapItems
? `${counts.roadmapItems} Plan-Elemente`
: null
return (
<Link
@@ -0,0 +1,220 @@
import { useState } from 'react'
import {
MILESTONE_STATUSES,
MILESTONE_STATUS_LABELS,
ROADMAP_ITEM_TYPE_LABELS,
SEQUENCING_MODE_LABELS,
} from '../constants/status.js'
import { StatusBadge } from './StatusBadge.jsx'
import { EmptyState } from './EmptyState.jsx'
const ITEM_TYPES = ['milestone', 'review_gate', 'maturity_stage']
const SEQUENCING_MODES = ['sequential', 'parallel', 'optional']
const EDITABLE_STATUSES = MILESTONE_STATUSES.filter(
(s) => !['reached', 'moved', 'discarded'].includes(s)
)
function formatDate(value) {
if (!value) return null
try {
return new Date(value.includes('T') ? value : `${value}T12:00:00`).toLocaleDateString(
'de-DE'
)
} catch {
return value
}
}
export function RoadmapPlanSection({
items,
canManage,
onCreate,
onUpdateStatus,
onUpdateItem,
onVerifyReached,
onDelete,
busy,
}) {
const [title, setTitle] = useState('')
const [goalDescription, setGoalDescription] = useState('')
const [targetDate, setTargetDate] = useState('')
const [itemType, setItemType] = useState('milestone')
const [sequencingMode, setSequencingMode] = useState('sequential')
const [showForm, setShowForm] = useState(false)
async function handleSubmit(e) {
e.preventDefault()
if (!title.trim()) return
await onCreate({
title: title.trim(),
goal_description: goalDescription.trim(),
target_date: targetDate || undefined,
item_type: itemType,
sequencing_mode: sequencingMode,
})
setTitle('')
setGoalDescription('')
setTargetDate('')
setItemType('milestone')
setSequencingMode('sequential')
setShowForm(false)
}
return (
<section className="card">
<div className="section-header">
<div>
<h2>Plan</h2>
<p className="section-lead muted">
Roadmap-Elemente methodenneutral — Gates, Reifegrade oder Review-Punkte.
Erreicht nur über Verify (Evidence, Review oder Decision).
</p>
</div>
{canManage && (
<button
type="button"
className="btn btn-primary btn-block-mobile"
onClick={() => setShowForm((v) => !v)}
>
{showForm ? 'Abbrechen' : 'Plan-Element'}
</button>
)}
</div>
{showForm && canManage && (
<form className="inline-form-block milestone-form" onSubmit={handleSubmit}>
<label>
Typ
<select value={itemType} onChange={(e) => setItemType(e.target.value)}>
{ITEM_TYPES.map((t) => (
<option key={t} value={t}>
{ROADMAP_ITEM_TYPE_LABELS[t] || t}
</option>
))}
</select>
</label>
<label>
Titel
<input
value={title}
onChange={(e) => setTitle(e.target.value)}
maxLength={255}
required
placeholder="z. B. MVP nutzbar im Alltag"
/>
</label>
<label>
Ziel / Definition of Done
<textarea
value={goalDescription}
onChange={(e) => setGoalDescription(e.target.value)}
rows={3}
placeholder="Woran erkennst du, dass dieses Element erreicht ist?"
/>
</label>
<label>
Abfolge
<select
value={sequencingMode}
onChange={(e) => setSequencingMode(e.target.value)}
>
{SEQUENCING_MODES.map((m) => (
<option key={m} value={m}>
{SEQUENCING_MODE_LABELS[m] || m}
</option>
))}
</select>
</label>
<label>
Zieltermin
<input
type="date"
value={targetDate}
onChange={(e) => setTargetDate(e.target.value)}
/>
</label>
<button type="submit" className="btn btn-primary" disabled={busy}>
Anlegen
</button>
</form>
)}
{items.length === 0 && (
<EmptyState message="Noch kein Plan — strukturiere das Vorhaben in überprüfbare Roadmap-Elemente." />
)}
<ul className="item-list milestone-list">
{items.map((item) => (
<li key={item.id} className="list-item card-list-item milestone-list-item">
<div className="list-item-main">
<strong>{item.title}</strong>
<p className="muted list-item-sub">
{ROADMAP_ITEM_TYPE_LABELS[item.item_type] || item.item_type}
{' · '}
{SEQUENCING_MODE_LABELS[item.sequencing_mode] || item.sequencing_mode}
</p>
{item.goal_description && (
<p className="list-item-desc">{item.goal_description}</p>
)}
{item.target_date && (
<p className="muted list-item-sub">
Zieltermin: {formatDate(item.target_date)}
</p>
)}
</div>
<div className="list-item-meta action-controls">
<StatusBadge kind="milestone" status={item.status} />
{canManage && item.status !== 'reached' && (
<>
<select
className="inline-select"
value={item.status}
onChange={(e) => onUpdateStatus(item.id, e.target.value)}
aria-label="Plan-Status"
>
{EDITABLE_STATUSES.map((s) => (
<option key={s} value={s}>
{MILESTONE_STATUS_LABELS[s]}
</option>
))}
</select>
<select
className="inline-select"
value={item.sequencing_mode}
onChange={(e) =>
onUpdateItem(item.id, { sequencing_mode: e.target.value })
}
aria-label="Abfolge"
>
{SEQUENCING_MODES.map((m) => (
<option key={m} value={m}>
{SEQUENCING_MODE_LABELS[m]}
</option>
))}
</select>
{['planned', 'active', 'at_risk'].includes(item.status) && (
<button
type="button"
className="btn btn-primary"
disabled={busy}
onClick={() => onVerifyReached(item.id)}
>
Verify → erreicht
</button>
)}
<button
type="button"
className="btn btn-secondary"
onClick={() => onDelete(item.id)}
>
Löschen
</button>
</>
)}
</div>
</li>
))}
</ul>
</section>
)
}
@@ -1,7 +1,5 @@
import {
LIFECYCLE_LABELS,
PHASE_LABELS,
PHASE_DESCRIPTIONS,
SIGNAL_LABELS,
NEXT_ACTION_KIND_LABELS,
} from '../constants/operating.js'
@@ -51,9 +49,7 @@ export function SteeringSnapshotPanel({
lifecycle_label,
method_key,
method_label,
operating_phase,
operating_phase_deprecated,
phase_signals,
signals = [],
counts,
upcoming_milestones = [],
next_actions = [],
@@ -61,12 +57,7 @@ export function SteeringSnapshotPanel({
const displayLabel =
lifecycle_label ||
LIFECYCLE_LABELS[lifecycle_state] ||
PHASE_LABELS[operating_phase] ||
lifecycle_state ||
operating_phase
const phaseDesc = lifecycle_state
? null
: PHASE_DESCRIPTIONS[operating_phase] || ''
lifecycle_state
const statPills = [
{ label: 'Offen', value: counts.actions_open, warn: false },
@@ -126,11 +117,9 @@ export function SteeringSnapshotPanel({
</ul>
</div>
{phaseDesc && <p className="steering-phase-desc">{phaseDesc}</p>}
{phase_signals?.length > 0 && (
{signals?.length > 0 && (
<p className="muted snapshot-signals">
{phase_signals.map((s) => SIGNAL_LABELS[s] || s).join(' · ')}
{signals.map((s) => SIGNAL_LABELS[s] || s).join(' · ')}
</p>
)}
+12
View File
@@ -60,6 +60,18 @@ export const MILESTONE_STATUS_LABELS = {
discarded: 'Verworfen',
}
export const ROADMAP_ITEM_TYPE_LABELS = {
milestone: 'Meilenstein / Gate',
review_gate: 'Review-Gate',
maturity_stage: 'Reifegrad-Stufe',
}
export const SEQUENCING_MODE_LABELS = {
sequential: 'Sequenziell',
parallel: 'Parallel',
optional: 'Optional',
}
export const EVIDENCE_STATUS_LABELS = {
submitted: 'Eingereicht',
accepted: 'Akzeptiert',
@@ -28,11 +28,12 @@ import {
convertBacklogToAction,
} from '../api/backlog.js'
import {
listInitiativeMilestones,
createInitiativeMilestone,
updateMilestone,
deleteMilestone,
} from '../api/milestones.js'
listInitiativeRoadmapItems,
createInitiativeRoadmapItem,
updateRoadmapItem,
deleteRoadmapItem,
verifyRoadmapItemReached,
} from '../api/roadmap.js'
import {
listInitiativeEvidence,
createInitiativeEvidence,
@@ -74,7 +75,7 @@ export function InitiativeOperationsProvider({ children }) {
const [actions, setActions] = useState([])
const [blockers, setBlockers] = useState([])
const [backlogItems, setBacklogItems] = useState([])
const [milestones, setMilestones] = useState([])
const [roadmapItems, setRoadmapItems] = useState([])
const [evidenceItems, setEvidenceItems] = useState([])
const [decisions, setDecisions] = useState([])
const [reviews, setReviews] = useState([])
@@ -110,7 +111,7 @@ export function InitiativeOperationsProvider({ children }) {
if (canReadOm) {
loads.push(listInitiativeBlockers(id).then(setBlockers).catch(() => setBlockers([])))
loads.push(listInitiativeBacklog(id).then(setBacklogItems).catch(() => setBacklogItems([])))
loads.push(listInitiativeMilestones(id).then(setMilestones).catch(() => setMilestones([])))
loads.push(listInitiativeRoadmapItems(id).then(setRoadmapItems).catch(() => setRoadmapItems([])))
loads.push(listInitiativeEvidence(id).then(setEvidenceItems).catch(() => setEvidenceItems([])))
loads.push(listInitiativeDecisions(id).then(setDecisions).catch(() => setDecisions([])))
loads.push(listInitiativeReviews(id).then(setReviews).catch(() => setReviews([])))
@@ -316,10 +317,10 @@ export function InitiativeOperationsProvider({ children }) {
}
}
async function handleCreateMilestone(body) {
async function handleCreateRoadmapItem(body) {
setFormBusy(true)
try {
await createInitiativeMilestone(id, body)
await createInitiativeRoadmapItem(id, body)
await load()
} catch (err) {
setError(err.message)
@@ -328,24 +329,50 @@ export function InitiativeOperationsProvider({ children }) {
}
}
async function handleMilestoneStatus(milestoneId, status) {
async function handleRoadmapItemStatus(itemId, status) {
try {
await updateMilestone(milestoneId, { status })
await updateRoadmapItem(itemId, { status })
await load()
} catch (err) {
setError(err.message)
}
}
async function handleDeleteMilestone(milestoneId) {
async function handleUpdateRoadmapItem(itemId, body) {
try {
await deleteMilestone(milestoneId)
await updateRoadmapItem(itemId, body)
await load()
} catch (err) {
setError(err.message)
}
}
async function handleVerifyRoadmapItem(itemId) {
setFormBusy(true)
try {
await verifyRoadmapItemReached(itemId)
await load()
} catch (err) {
setError(err.message)
} finally {
setFormBusy(false)
}
}
async function handleDeleteRoadmapItem(itemId) {
try {
await deleteRoadmapItem(itemId)
await load()
} catch (err) {
setError(err.message)
}
}
const milestones = useMemo(
() => roadmapItems.filter((item) => item.item_type === 'milestone'),
[roadmapItems]
)
async function handleCreateEvidence(body) {
setFormBusy(true)
try {
@@ -474,6 +501,7 @@ export function InitiativeOperationsProvider({ children }) {
blockers,
unlinkedBlockers,
backlogItems,
roadmapItems,
milestones,
evidenceItems,
decisions,
@@ -513,9 +541,14 @@ export function InitiativeOperationsProvider({ children }) {
handleBacklogStatus,
handleConvertBacklog,
handleDeleteBacklog,
handleCreateMilestone,
handleMilestoneStatus,
handleDeleteMilestone,
handleCreateRoadmapItem,
handleRoadmapItemStatus,
handleUpdateRoadmapItem,
handleVerifyRoadmapItem,
handleDeleteRoadmapItem,
handleCreateMilestone: handleCreateRoadmapItem,
handleMilestoneStatus: handleRoadmapItemStatus,
handleDeleteMilestone: handleDeleteRoadmapItem,
handleCreateEvidence,
handleEvidenceStatus,
handleDeleteEvidence,
@@ -16,6 +16,7 @@ export function InitiativeOverviewPage() {
capabilities,
handleMethodChange,
backlogItems,
roadmapItems,
milestones,
} = useInitiativeOperations()
@@ -69,7 +70,7 @@ export function InitiativeOverviewPage() {
initiativeId={initiativeId}
counts={{
backlog: backlogItems.length,
milestones: milestones.length,
roadmapItems: roadmapItems.length,
actionsOpen: counts.actions_open,
}}
/>
@@ -1,14 +1,16 @@
import { useInitiativeOperations } from '../../context/InitiativeOperationsContext.jsx'
import { MilestonesSection } from '../../components/MilestonesSection.jsx'
import { RoadmapPlanSection } from '../../components/RoadmapPlanSection.jsx'
export function InitiativePlanPage() {
const {
milestones,
roadmapItems,
capabilities,
formBusy,
handleCreateMilestone,
handleMilestoneStatus,
handleDeleteMilestone,
handleCreateRoadmapItem,
handleRoadmapItemStatus,
handleUpdateRoadmapItem,
handleVerifyRoadmapItem,
handleDeleteRoadmapItem,
error,
} = useInitiativeOperations()
@@ -19,12 +21,14 @@ export function InitiativePlanPage() {
return (
<>
{error && <p className="error">{error}</p>}
<MilestonesSection
milestones={milestones}
<RoadmapPlanSection
items={roadmapItems}
canManage={capabilities.has('kairo.milestone.manage')}
onCreate={handleCreateMilestone}
onUpdateStatus={handleMilestoneStatus}
onDelete={handleDeleteMilestone}
onCreate={handleCreateRoadmapItem}
onUpdateStatus={handleRoadmapItemStatus}
onUpdateItem={handleUpdateRoadmapItem}
onVerifyReached={handleVerifyRoadmapItem}
onDelete={handleDeleteRoadmapItem}
busy={formBusy}
/>
</>