feat(roundtable): 业务链条流程图改弹窗 + 每阶段「本阶段目标」注入总控

- 业务链条配置页流程图从底部内嵌改为按钮 + Dialog 弹窗查看
- 每个 Stage 新增可选「本阶段目标」文本框,告诉总控本阶段要产出
  什么、如何依赖上一阶段产出(仅分层 DAG 生效)
- StageGroups 重构为 StageGroup[]({seats, goal?}),goal 随 stage
  在增删改/重排中自动跟随;新增 stageGoals 持久化(与 stages 同下标对齐)
- 运行时注入:buildDagStageLeaderTask(总控派活,主)+ pickDagSeatTask
  (席位任务,兜底)
- 后端 roundtable_chains 加 stage_goals 列 + 校验 + Alembic 20260608_04
- 老链条/草稿无该字段时不注入,行为不变

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
董宏凯andClaude Opus 4.8 committed 2026-06-08 16:10:46 +08:00
1 parent ce431ee155
commit 834df64650
13 files changed
+486 -94

No files matched your search

@@ -24,6 +24,8 @@ export interface ChainCreatePayload {
seats: ChainSeat[];
/** Optional layered orchestration (agent_id groups). null/absent = linear. */
stages?: string[][] | null;
/** Optional per-stage goals aligned to `stages` (dag-only). null = none. */
stageGoals?: (string | null)[] | null;
}
/** Partial update — send only what changed. */
@@ -33,6 +35,8 @@ export interface ChainUpdatePayload {
seats?: ChainSeat[];
/** Send `null` to clear layering back to linear; omit to leave unchanged. */
stages?: string[][] | null;
/** Per-stage goals aligned to `stages`; send `null` to clear, omit to leave. */
stageGoals?: (string | null)[] | null;
/** 发布开关:true 发布为公共 / false 取消发布;omit 不改。仅 owner 生效。 */
isPublic?: boolean;
}
@@ -60,6 +64,7 @@ interface ServerChain {
description: string | null;
seats: ChainSeat[];
stages?: string[][] | null;
stage_goals?: (string | null)[] | null;
is_public?: boolean;
is_mine?: boolean;
created_at: string | null;
@@ -73,6 +78,7 @@ function toChain(s: ServerChain): BusinessChain {
description: s.description ?? undefined,
seats: Array.isArray(s.seats) ? s.seats : [],
stages: Array.isArray(s.stages) ? s.stages : null,
stageGoals: Array.isArray(s.stage_goals) ? s.stage_goals : null,
isPublic: s.is_public ?? false,
// 后端缺省时按「我的」处理(向后兼容旧响应)。
isMine: s.is_mine ?? true,
@@ -88,6 +94,7 @@ function fromCreate(p: ChainCreatePayload) {
...(p.description !== undefined ? { description: p.description } : {}),
seats: p.seats,
...(p.stages !== undefined ? { stages: p.stages } : {}),
...(p.stageGoals !== undefined ? { stage_goals: p.stageGoals } : {}),
};
}
@@ -98,6 +105,8 @@ function fromUpdate(p: ChainUpdatePayload) {
if (p.seats !== undefined) out.seats = p.seats;
// Forward stages even when explicitly null (clears layering server-side).
if (p.stages !== undefined) out.stages = p.stages;
// Forward stage goals even when explicitly null (clears goals server-side).
if (p.stageGoals !== undefined) out.stage_goals = p.stageGoals;
if (p.isPublic !== undefined) out.is_public = p.isPublic;
return out;
}