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
@@ -0,0 +1,66 @@
|
||||
import { proposalReasonLabel, sprintProposalsForCycle } from '../utils/sprintCommitProposal.js'
|
||||
import { backlogKindLabel, resolveBacklogVocabulary } from '../utils/resolveBacklogVocabulary.js'
|
||||
import { PriorityBadge } from './PriorityBadge.jsx'
|
||||
|
||||
export function SprintCommitProposalPanel({
|
||||
proposals = [],
|
||||
selectedWorkCycleId = '',
|
||||
backlogVocabulary = null,
|
||||
canManage = false,
|
||||
onAcceptProposal,
|
||||
busy = false,
|
||||
}) {
|
||||
const filtered = sprintProposalsForCycle(proposals, selectedWorkCycleId)
|
||||
const vocabulary = resolveBacklogVocabulary(backlogVocabulary)
|
||||
|
||||
if (!selectedWorkCycleId || filtered.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card sprint-commit-proposals">
|
||||
<div className="section-header">
|
||||
<div>
|
||||
<h2>Sprint-Vorschläge</h2>
|
||||
<p className="section-lead muted">
|
||||
Vom Steuerungskern priorisiert — Accept committet ins Sprint-Backlog (kein Auto-Commit).
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<ol className="item-list sprint-commit-proposals__list">
|
||||
{filtered.map((proposal) => (
|
||||
<li key={proposal.scope_id} className="list-item card-list-item sprint-commit-proposal">
|
||||
<div className="list-item-main">
|
||||
<strong>
|
||||
{proposal.rank}. {proposal.title}
|
||||
</strong>
|
||||
<p className="list-item-sub muted">{proposalReasonLabel(proposal)}</p>
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
{proposal.item_kind && (
|
||||
<span className="badge badge--kind muted">
|
||||
{backlogKindLabel(vocabulary, proposal.item_kind)}
|
||||
</span>
|
||||
)}
|
||||
<PriorityBadge priority={proposal.priority} />
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm"
|
||||
disabled={busy}
|
||||
onClick={() =>
|
||||
onAcceptProposal?.(proposal.scope_id, {
|
||||
work_cycle_id: proposal.work_cycle_id,
|
||||
})
|
||||
}
|
||||
>
|
||||
In Sprint planen
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
import { useMemo } from 'react'
|
||||
import { useEffect, useMemo } from 'react'
|
||||
import { RequireInitiativeScope } from '../../components/RequireInitiativeScope.jsx'
|
||||
import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.jsx'
|
||||
import { WorkCyclesPanel } from '../../components/WorkCyclesPanel.jsx'
|
||||
import { SprintCommitProposalPanel } from '../../components/SprintCommitProposalPanel.jsx'
|
||||
import { InitiativeActionsHub } from '../../components/InitiativeActionsHub.jsx'
|
||||
import { LoadingState } from '../../components/LoadingState.jsx'
|
||||
import { useInitiativeOperations } from '../../context/InitiativeOperationsContext.jsx'
|
||||
@@ -47,8 +48,24 @@ function PlanSprintInner() {
|
||||
handleCreateBlockerForAction,
|
||||
handleMoveActionToSprint,
|
||||
handleUnplanAction,
|
||||
handleConvertBacklog,
|
||||
reloadSlices,
|
||||
steeringSnapshot,
|
||||
operatingContext,
|
||||
} = ops
|
||||
|
||||
useEffect(() => {
|
||||
reloadSlices(['steering_snapshot'])
|
||||
}, [reloadSlices])
|
||||
|
||||
const sprintCommitProposals = useMemo(
|
||||
() =>
|
||||
steeringSnapshot?.sprint_commit_proposals ||
|
||||
steeringSnapshot?.steering_kernel?.proposals?.sprint_commit ||
|
||||
[],
|
||||
[steeringSnapshot],
|
||||
)
|
||||
|
||||
const actionCountByCycleId = useMemo(
|
||||
() => countActionsByWorkCycle(actions, { hideDone }),
|
||||
[actions, hideDone],
|
||||
@@ -92,6 +109,19 @@ function PlanSprintInner() {
|
||||
onSelectSprint={setSelectedWorkCycleId}
|
||||
busy={formBusy}
|
||||
/>
|
||||
{selectedWorkCycleId && (
|
||||
<SprintCommitProposalPanel
|
||||
proposals={sprintCommitProposals}
|
||||
selectedWorkCycleId={selectedWorkCycleId}
|
||||
backlogVocabulary={operatingContext?.backlog_vocabulary}
|
||||
canManage={capabilities.has('kairo.backlog.manage')}
|
||||
onAcceptProposal={async (itemId, options) => {
|
||||
await handleConvertBacklog(itemId, options)
|
||||
await reloadSlices(['steering_snapshot', 'actions', 'backlog'])
|
||||
}}
|
||||
busy={formBusy}
|
||||
/>
|
||||
)}
|
||||
{selectedWorkCycleId && selectedWorkCycle && (
|
||||
<InitiativeActionsHub
|
||||
initiativeId={initiativeId}
|
||||
|
||||
@@ -1699,6 +1699,23 @@
|
||||
transition: width 0.2s ease;
|
||||
}
|
||||
|
||||
.sprint-commit-proposals {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.sprint-commit-proposals__list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sprint-commit-proposal {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.archetype-badge {
|
||||
background: var(--jk-surface-muted, #eef2f6);
|
||||
color: var(--jk-text-secondary, #445);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/** Sprint commit proposals from steering kernel (P6). */
|
||||
|
||||
export function sprintProposalsForCycle(proposals = [], workCycleId = '') {
|
||||
if (!workCycleId) return proposals || []
|
||||
return (proposals || []).filter(
|
||||
(item) => String(item.work_cycle_id) === String(workCycleId),
|
||||
)
|
||||
}
|
||||
|
||||
export function proposalReasonLabel(proposal) {
|
||||
const labels = {
|
||||
bug_critical: 'Kritischer Bug',
|
||||
bug_high_priority: 'Bug (hoch)',
|
||||
bug_default: 'Bug',
|
||||
issue_default: 'Issue',
|
||||
story_high_priority: 'Story (hoch)',
|
||||
story_ready: 'Story bereit',
|
||||
idea_default: 'Idee',
|
||||
}
|
||||
return labels[proposal?.reason_code] || proposal?.summary || 'Vorschlag'
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { proposalReasonLabel, sprintProposalsForCycle } from './sprintCommitProposal.js'
|
||||
|
||||
describe('sprintCommitProposal', () => {
|
||||
const proposals = [
|
||||
{ scope_id: 'b1', work_cycle_id: 'wc1', reason_code: 'bug_default' },
|
||||
{ scope_id: 's1', work_cycle_id: 'wc2', reason_code: 'story_ready' },
|
||||
]
|
||||
|
||||
it('filters by work cycle', () => {
|
||||
expect(sprintProposalsForCycle(proposals, 'wc1')).toHaveLength(1)
|
||||
expect(sprintProposalsForCycle(proposals, 'wc2')[0].scope_id).toBe('s1')
|
||||
})
|
||||
|
||||
it('labels reason codes', () => {
|
||||
expect(proposalReasonLabel({ reason_code: 'bug_critical' })).toBe('Kritischer Bug')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user