feat(AP2.2c): A1 Reifegrad E2E, Stufen-/Rhythmus-Panels und Composition-Kernel
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
43d33d0edb
commit
02b6469c2d
11 files changed
+420
-4
No files matched your search
@@ -25,6 +25,8 @@ export function InitiativeCompositionSurface({
|
||||
() => ({
|
||||
initiativeId: ops.initiativeId,
|
||||
actions: ops.actions,
|
||||
roadmapItems: ops.roadmapItems,
|
||||
recurringItems: ops.recurringItems,
|
||||
steeringSnapshotLoading: ops.steeringSnapshotLoading,
|
||||
steeringSnapshotError: ops.steeringSnapshotError,
|
||||
steeringMethods: ops.steeringMethods,
|
||||
@@ -36,6 +38,8 @@ export function InitiativeCompositionSurface({
|
||||
[
|
||||
ops.initiativeId,
|
||||
ops.actions,
|
||||
ops.roadmapItems,
|
||||
ops.recurringItems,
|
||||
ops.steeringSnapshotLoading,
|
||||
ops.steeringSnapshotError,
|
||||
ops.steeringMethods,
|
||||
|
||||
@@ -57,6 +57,26 @@ export const COMPOSITION_PROVIDERS = [
|
||||
scopeTypes: ['initiative'],
|
||||
order: 10,
|
||||
},
|
||||
{
|
||||
key: 'steering.maturity_stage',
|
||||
kind: 'steering_element',
|
||||
steeringElement: 'maturity_stage',
|
||||
slotKeys: ['control.status.steering'],
|
||||
componentKey: 'MaturityStagePanel',
|
||||
requiresCapability: 'kairo.initiative.read',
|
||||
scopeTypes: ['initiative'],
|
||||
order: 15,
|
||||
},
|
||||
{
|
||||
key: 'steering.recurring_rhythm',
|
||||
kind: 'steering_element',
|
||||
steeringElement: 'recurring_rhythm',
|
||||
slotKeys: ['control.status.steering'],
|
||||
componentKey: 'RecurringRhythmPanel',
|
||||
requiresCapability: 'kairo.initiative.read',
|
||||
scopeTypes: ['initiative'],
|
||||
order: 16,
|
||||
},
|
||||
{
|
||||
key: 'steering.next_action',
|
||||
kind: 'steering_element',
|
||||
|
||||
@@ -2,6 +2,8 @@ import { Link } from 'react-router-dom'
|
||||
import { scopedPath } from '../utils/routes.js'
|
||||
import { SteeringSnapshotPanel } from '../components/SteeringSnapshotPanel.jsx'
|
||||
import { CriticalPathPanel } from '../components/CriticalPathPanel.jsx'
|
||||
import { MaturityStagePanel } from '../components/MaturityStagePanel.jsx'
|
||||
import { RecurringRhythmPanel } from '../components/RecurringRhythmPanel.jsx'
|
||||
import { AgentSlotsPanel } from '../components/AgentSlotsPanel.jsx'
|
||||
import { SteeringProposalsPanel } from '../components/SteeringProposalsPanel.jsx'
|
||||
import { NextActionWidget } from '../widgets/NextActionWidget.jsx'
|
||||
@@ -34,6 +36,8 @@ export function WidgetHost({ widget }) {
|
||||
export const PROVIDER_COMPONENTS = {
|
||||
SteeringSnapshotPanel,
|
||||
CriticalPathPanel,
|
||||
MaturityStagePanel,
|
||||
RecurringRhythmPanel,
|
||||
NextActionWidget,
|
||||
AgentSlotsPanel,
|
||||
SteeringProposalsPanel,
|
||||
|
||||
@@ -77,7 +77,14 @@ function resolveAgentSlots(input) {
|
||||
* @param {object | null | undefined} steeringSnapshot
|
||||
*/
|
||||
export function resolveNextActionUi(elements, steeringSnapshot) {
|
||||
const priority = ['critical_path', 'work_cycle_scope', 'gate_fulfillment', 'queue_inbox']
|
||||
const priority = [
|
||||
'critical_path',
|
||||
'recurring_rhythm',
|
||||
'work_cycle_scope',
|
||||
'maturity_stage',
|
||||
'gate_fulfillment',
|
||||
'queue_inbox',
|
||||
]
|
||||
const hasActiveSprint = Boolean(steeringSnapshot?.active_work_cycle)
|
||||
for (const key of priority) {
|
||||
if (key === 'work_cycle_scope' && !hasActiveSprint) continue
|
||||
@@ -165,6 +172,16 @@ export function buildProviderProps(provider, input) {
|
||||
scopeRoadmapItemId: kernel?.horizon?.gate_roadmap_item_id ?? null,
|
||||
}
|
||||
}
|
||||
case 'MaturityStagePanel':
|
||||
return {
|
||||
initiativeId: ops.initiativeId,
|
||||
roadmapItems: ops.roadmapItems || [],
|
||||
}
|
||||
case 'RecurringRhythmPanel':
|
||||
return {
|
||||
initiativeId: ops.initiativeId,
|
||||
recurringItems: ops.recurringItems || [],
|
||||
}
|
||||
case 'NextActionWidget': {
|
||||
const nextActionUi = resolveNextActionUi(elements, input.steeringSnapshot)
|
||||
return {
|
||||
|
||||
@@ -215,7 +215,33 @@ describe('resolveSteeringComposition', () => {
|
||||
expect(props.scopeRoadmapItemId).toBe('gate-1')
|
||||
})
|
||||
|
||||
it('buildProviderProps gates milestone horizon in snapshot panel', () => {
|
||||
it('activates maturity panels for A1 on control.status', () => {
|
||||
const result = resolveSteeringComposition({
|
||||
surfaceKey: 'control.status',
|
||||
scope: 'initiative',
|
||||
capabilities: CAPS,
|
||||
steeringElements: ['next_action_primary', 'maturity_stage', 'recurring_rhythm'],
|
||||
steeringSnapshot: { counts: {}, next_actions: [] },
|
||||
opsContext: { initiativeId: 'init-1', roadmapItems: [], recurringItems: [] },
|
||||
})
|
||||
const steering = result.slots['control.status.steering'] || []
|
||||
expect(steering.some((p) => p.key === 'steering.maturity_stage')).toBe(true)
|
||||
expect(steering.some((p) => p.key === 'steering.recurring_rhythm')).toBe(true)
|
||||
expect(steering.some((p) => p.key === 'steering.critical_path')).toBe(false)
|
||||
})
|
||||
|
||||
it('buildProviderProps uses recurring rhythm next-action copy', () => {
|
||||
const provider = COMPOSITION_PROVIDERS.find((p) => p.key === 'steering.next_action')
|
||||
const props = buildProviderProps(provider, {
|
||||
steeringElements: ['next_action_primary', 'recurring_rhythm', 'maturity_stage'],
|
||||
steeringSnapshot: { next_actions: [] },
|
||||
opsContext: { initiativeId: 'x', steeringSnapshotLoading: false },
|
||||
capabilities: CAPS,
|
||||
})
|
||||
expect(props.title).toContain('Rhythmus')
|
||||
})
|
||||
|
||||
it('buildProviderProps toggles gate horizon on steering snapshot', () => {
|
||||
const provider = COMPOSITION_PROVIDERS.find((p) => p.key === 'core.steering_snapshot')
|
||||
const withGate = buildProviderProps(provider, {
|
||||
steeringElements: ['gate_fulfillment', 'next_action_primary'],
|
||||
|
||||
Reference in new issue
Block a user