feat(roundtable): 深链接业务链抽取规范 + 总结报告文件干净/对话强制核对
深链接会商(taskId+goPath,businessCode)下按所选业务链完整层级强制校正 结构化抽取(flow-json) 与 方案总结报告: - 新增 harness 层 extraction_spec(app+harness 共用,单份领域知识两角色用法): build_structure_directive / build_summary_directive 按 businessCode 取 · rwfx(6BF):线性 任务→目的→行为体→预期行为→驱动因素→叙事;预期行为↔驱动因素 1:1、余 1:N · xdfx(7BF):分叉汇聚 DAG,根=行动;行动→受众目标/关键传播节点(1:N)→脆弱点(1:N)→策略(多对一) · 其余业务通用规范(强约束完整性+命名+取数、不套固定模板);business_code 空→零副作用 - 结构化抽取:flow_extract._hierarchy_hint + _validate_messages 用 structure_directive 权威覆盖默认层级(根治"无论什么业务都按目的→行为体抽/停在行为体");前端 streamFlowExtract 传 business_code(源 ingestBusinessCode) - 方案总结报告:前台 multi_agent._special_run(summary) + 后台 build_summary_prompt 注入 business 完整性核对(StartJobRequest/StartParams 透传) - 报告产物策略:.md 报告文件保持完整、干净、无需修改(不写 待补充/不足/⚠️); 「核对说明」(意图对齐+业务链完整性+不足/可补充)改为只在对话回复正文、且每次必出 - 种子 roundtable-structure SOUL 层级顺序改 spec-driven、去 rwfx 写死示例 Tests: test_roundtable_extraction_spec / test_roundtable_summary_prompt Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3ab674e438
commit
b1b1ff98f5
17 files changed
+378
-25
No files matched your search
@@ -82,6 +82,8 @@ export interface FlowExtractRequest {
|
||||
chainLevels?: string[];
|
||||
/** 业务链总控编排提示(写明层级时优先用它)。 */
|
||||
coordinatorPrompt?: string | null;
|
||||
/** 深链接业务码(rwfx→6BF 等)。非空 → 后端按业务链抽取规范强制注入完整层级。 */
|
||||
businessCode?: string | null;
|
||||
/** 推理模型名(沿用第三步所选)。 */
|
||||
model?: string;
|
||||
/** Phase 2 问答修改:当前流程图 + 指令 → 按指令改图(其余不变)。 */
|
||||
@@ -109,6 +111,7 @@ export async function streamFlowExtract(req: FlowExtractRequest): Promise<FlowGr
|
||||
seat_deliveries: (req.seatDeliveries ?? []).map((s) => ({ sender: s.sender, content: s.content })),
|
||||
chain_levels: req.chainLevels ?? [],
|
||||
coordinator_prompt: req.coordinatorPrompt ?? null,
|
||||
business_code: req.businessCode ?? null,
|
||||
model: req.model,
|
||||
current_graph: req.currentGraph ?? null,
|
||||
instruction: req.instruction ?? null,
|
||||
|
||||
@@ -240,6 +240,11 @@ export interface StreamMultiAgentRequest {
|
||||
* 与该席位 agent 自身 config.yaml 的同名开关取 OR。省略 = false(关)。
|
||||
*/
|
||||
seatSkillDirective?: boolean;
|
||||
/**
|
||||
* 深链接业务码(rwfx→6BF 等)。**仅方案总结报告(summary)单例消费**:非空 → 后端按业务链抽取规范
|
||||
* 强制注入「完整性核对」指令,让总结核对产出相对业务链完不完整。普通会商省略 = 不注入。
|
||||
*/
|
||||
businessCode?: string | null;
|
||||
skillStopNames?: string[];
|
||||
/**
|
||||
* 仅 leader 用。置 true 表示这是「派活后让总控判断继续/综合」的轮次:后端会把各已交付
|
||||
@@ -493,6 +498,8 @@ export async function streamMultiAgent(
|
||||
subagent_enabled: req.subagentEnabled,
|
||||
// 仅 special 用;会商技能识别强化(沿用所选业务链条开关)。省略 → 后端按 false(关)处理。
|
||||
seat_skill_directive: req.seatSkillDirective ?? false,
|
||||
// 仅 summary 单例用;深链接业务码 → 后端注入业务链完整性核对。省略/空 → 不注入。
|
||||
business_code: req.businessCode ?? null,
|
||||
skill_stop_names: req.skillStopNames ?? [],
|
||||
// 仅 leader 用;综合轮让后端注入各席位完整交付正文。省略 → 后端按 false 处理。
|
||||
synthesis_mode: req.synthesisMode ?? false,
|
||||
|
||||
@@ -108,6 +108,8 @@ function toStartBody(p: StartJobPayload) {
|
||||
),
|
||||
// 研讨前并行取数开关(来源链条 gatherFirst):true = 后台研讨前先并行取数再研讨。缺省 false。
|
||||
gather_first: p.gatherFirst ?? false,
|
||||
// 深链接业务码:后台总结报告据此做业务链完整性核对(写实业务如 rwfx 才生效)。空 → 不注入。
|
||||
business_code: p.businessCode ?? null,
|
||||
...(seat
|
||||
? {
|
||||
thinking_enabled: seat.thinking_enabled,
|
||||
|
||||
@@ -321,8 +321,10 @@ function buildSummaryPrompt(opts: {
|
||||
"【动笔前必做:意图对齐与缺口核对】各席位可能由能力较弱的模型产出,未必扣住用户意图、未必充分。" +
|
||||
"你是这份总结的质量兜底,不能只把各席位交付简单拼接。请先把上面的「任务意图」(目标/约束/关键假设)拆成" +
|
||||
"用户核心诉求清单(编排提示对最终产出的要求也并入),逐条核对各席位交付+共识是否覆盖、够不够、有无跑题或矛盾;" +
|
||||
"再据此组织并按护栏补强:① 能从已有原料重组/推理补上的→直接补全讲透;② 属于你自己的推断/建议→显式标注「(综合推断)」;" +
|
||||
"③ 缺真实信息、靠现有原料补不了的→绝不凭空编,用一行『> ⚠️ 待补充:<具体缺什么>。可在对话里让我补全』标出,交给用户。" +
|
||||
"再据此组织:① 能从已有原料重组/推理补上的→直接补全讲透;② 缺真实信息补不了的→绝不凭空编。" +
|
||||
"**写进 .md 报告文件的必须是一份完整、干净、可直接使用、无需用户修改的报告——不要在报告文件里写「待补充/不足/⚠️」之类提示或占位**。" +
|
||||
"**但在对话回复正文、报告之后,必须追加一段简短「核对说明」**(只在对话里、**不写进 .md 文件**):逐条说明产出是否覆盖了用户意图、哪些充分/哪些不足/有哪些可补充(可在对话里让我补全);" +
|
||||
"**即便都已覆盖、无明显缺口,也要明确写一句「已核对:各诉求均已覆盖,无明显缺口」,这段核对说明任何时候都不要省略。**" +
|
||||
"最终产出要明显比各席位交付的简单拼接更扣用户意图。",
|
||||
);
|
||||
if (opts.flowMode) {
|
||||
@@ -1041,6 +1043,8 @@ export function useStep3Summary(
|
||||
dAgentThreadId: { [agentName]: threadId },
|
||||
displayName: "方案总结报告",
|
||||
newMessage: prompt,
|
||||
// 深链接业务码:后端为 summary 单例注入「业务链完整性核对」(核对产出相对业务链完不完整)。
|
||||
businessCode: ingestBusinessCodeRef.current,
|
||||
model: selectedModel || undefined,
|
||||
files: files && files.length > 0 ? files : undefined,
|
||||
signal: aborter.signal,
|
||||
@@ -1136,6 +1140,8 @@ export function useStep3Summary(
|
||||
seatDeliveries,
|
||||
chainLevels,
|
||||
coordinatorPrompt,
|
||||
// 深链接业务码:后端按业务链抽取规范强制注入完整层级(根治"无论什么业务都按目的→行为体抽")。
|
||||
businessCode: ingestBusinessCodeRef.current,
|
||||
model: selectedModel || undefined,
|
||||
currentGraph: opts?.currentGraph ?? null,
|
||||
instruction: opts?.instruction,
|
||||
|
||||
@@ -147,6 +147,11 @@ export interface StartJobPayload {
|
||||
* 在 `toStartBody` 里下发为后端 `gather_first`。缺省 false。
|
||||
*/
|
||||
gatherFirst?: boolean;
|
||||
/**
|
||||
* 深链接业务码(rwfx→6BF 等)。透传给后台总结报告的「业务链完整性核对」(写实业务如 rwfx 才生效)。
|
||||
* 普通会商省略。`toStartBody` 里下发为后端 `business_code`。
|
||||
*/
|
||||
businessCode?: string | null;
|
||||
}
|
||||
|
||||
/** 终态集合——SSE/轮询判定作业是否结束。 */
|
||||
|
||||
@@ -1546,6 +1546,7 @@ export default function RoundtablePlanningPage() {
|
||||
seatSkillDirectives, // 每席位技能识别强化沿用所选业务链条里各席位的开关
|
||||
seatModes, // 每席位推理深度覆盖沿用所选业务链条里各席位的配置
|
||||
gatherFirst, // 研讨前并行取数沿用所选业务链条的开关
|
||||
businessCode: prefillRef.current?.businessCode ?? undefined, // 深链接业务码 → 后台总结业务链完整性核对
|
||||
// 后台作业引擎支持 dag(后端 _run_dag:stage 串行 / stage 内并行)——
|
||||
// 直接把当前编排模式透传,业务链的分层 / 并行 / 阶段目标 / 总控提示词全部保留。
|
||||
orchestrationMode,
|
||||
@@ -1628,6 +1629,7 @@ export default function RoundtablePlanningPage() {
|
||||
seatSkillDirectives: seatSkillDirectivesSnap,
|
||||
seatModes: seatModesSnap,
|
||||
gatherFirst: gatherFirstSnap,
|
||||
businessCode: prefillRef.current?.businessCode ?? undefined,
|
||||
orchestrationMode: mode,
|
||||
chain: chainSnap,
|
||||
orchestrationPlan: planSnap,
|
||||
@@ -1697,6 +1699,7 @@ export default function RoundtablePlanningPage() {
|
||||
seatSkillDirectives,
|
||||
seatModes,
|
||||
gatherFirst,
|
||||
businessCode: prefillRef.current?.businessCode ?? undefined,
|
||||
orchestrationMode,
|
||||
chain: chainMeta,
|
||||
orchestrationPlan: orchestrationMode === "dag" ? orchestrationPlan : null,
|
||||
|
||||
Reference in new issue
Block a user