|
|
@@ -63,6 +63,11 @@ test("shows pipeline stages and resolves remote confirmations", async () => {
|
|
|
status: "running",
|
|
|
},
|
|
|
],
|
|
|
+ [
|
|
|
+ "tool_call",
|
|
|
+ { tool: "ReadFile", step: "lit-upstream", content: "{'file_path':'/run/idea-analysis/report.json'}" },
|
|
|
+ ],
|
|
|
+ ["tool_result", { tool: "ReadFile", step: "lit-upstream", content: "idea analysis report" }],
|
|
|
[
|
|
|
"confirm_required",
|
|
|
{
|
|
|
@@ -109,6 +114,24 @@ test("shows pipeline stages and resolves remote confirmations", async () => {
|
|
|
status: "running",
|
|
|
},
|
|
|
],
|
|
|
+ [
|
|
|
+ "tool_call",
|
|
|
+ {
|
|
|
+ tool: "ReadFile",
|
|
|
+ step: "paper-upstream",
|
|
|
+ content: '{"file_path":"/run/literature-review/report.json"}',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ ["tool_result", { tool: "ReadFile", step: "paper-upstream", content: "literature review report" }],
|
|
|
+ [
|
|
|
+ "tool_call",
|
|
|
+ {
|
|
|
+ tool: "WriteFile",
|
|
|
+ step: "paper-scratch",
|
|
|
+ content: '{"file_path":"/run/paper-writing/scratch.md","content":"later write /run/paper-writing/report.json"}',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ ["tool_result", { tool: "WriteFile", step: "paper-scratch", content: "[OK] Created scratch.md" }],
|
|
|
["tool_call", { tool: "WriteFile", step: 4, content: '{"file_path":"/run/paper-writing/artifacts/outline.json"}' }],
|
|
|
["tool_result", { tool: "WriteFile", step: 4, content: "[OK] Created outline.json" }],
|
|
|
[
|
|
|
@@ -125,11 +148,30 @@ test("shows pipeline stages and resolves remote confirmations", async () => {
|
|
|
'{"phase_dir":"/run/paper-writing","papers_selected_path":"/run/literature-review/artifacts/papers_selected.json"}',
|
|
|
},
|
|
|
],
|
|
|
- ["tool_result", { tool: "BuildResearchPaper", step: 6, content: '{"status":"completed","passed":true}' }],
|
|
|
- ["tool_call", { tool: "WriteFile", step: 7, content: '{"file_path":"/run/paper-writing/report.json"}' }],
|
|
|
- ["tool_call", { tool: "WriteFile", step: 7, content: '{"file_path":"/run/paper-writing/report.md"}' }],
|
|
|
- ["tool_result", { tool: "WriteFile", step: 7, content: "[OK] Created report.json" }],
|
|
|
- ["tool_result", { tool: "WriteFile", step: 7, content: "[OK] Created report.md" }],
|
|
|
+ ["tool_result", { tool: "BuildResearchPaper", step: 6, content: '{"status":"failed","passed":false}' }],
|
|
|
+ [
|
|
|
+ "tool_call",
|
|
|
+ {
|
|
|
+ tool: "WriteFile",
|
|
|
+ step: "paper-repair",
|
|
|
+ content: '{"file_path":"/run/paper-writing/artifacts/sections/abstract.tex"}',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ ["tool_result", { tool: "WriteFile", step: "paper-repair", content: "[OK] Updated abstract.tex" }],
|
|
|
+ [
|
|
|
+ "tool_call",
|
|
|
+ {
|
|
|
+ tool: "BuildResearchPaper",
|
|
|
+ step: 7,
|
|
|
+ content:
|
|
|
+ '{"phase_dir":"/run/paper-writing","papers_selected_path":"/run/literature-review/artifacts/papers_selected.json"}',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ ["tool_result", { tool: "BuildResearchPaper", step: 7, content: '{"status":"completed","passed":true}' }],
|
|
|
+ ["tool_call", { tool: "WriteFile", step: 8, content: '{"file_path":"/run/paper-writing/report.json"}' }],
|
|
|
+ ["tool_call", { tool: "WriteFile", step: 8, content: '{"file_path":"/run/paper-writing/report.md"}' }],
|
|
|
+ ["tool_result", { tool: "WriteFile", step: 8, content: "[OK] Created report.json" }],
|
|
|
+ ["tool_result", { tool: "WriteFile", step: 8, content: "[OK] Created report.md" }],
|
|
|
[
|
|
|
"stage_passed",
|
|
|
{
|
|
|
@@ -230,6 +272,16 @@ test("shows pipeline stages and resolves remote confirmations", async () => {
|
|
|
]),
|
|
|
}),
|
|
|
)
|
|
|
+ const litUpstream = updates.find(
|
|
|
+ (update) => update.metadata?.latest_event === "tool_result" && update.metadata.step === "lit-upstream",
|
|
|
+ )?.metadata?.research67_progress
|
|
|
+ expect(litUpstream).toMatchObject({
|
|
|
+ title: "Research67 · lit-searcher · 文献检索 · 制定检索计划",
|
|
|
+ rows: expect.arrayContaining([
|
|
|
+ expect.objectContaining({ id: "literature-review:plan", status: "running" }),
|
|
|
+ expect.objectContaining({ id: "literature-review:report", status: "pending" }),
|
|
|
+ ]),
|
|
|
+ })
|
|
|
expect(snapshots).toContainEqual(
|
|
|
expect.objectContaining({
|
|
|
footer: "正在进行 Guard / 阶段产物验收",
|
|
|
@@ -237,6 +289,55 @@ test("shows pipeline stages and resolves remote confirmations", async () => {
|
|
|
rows: expect.arrayContaining([expect.objectContaining({ id: "idea-analysis:report", status: "completed" })]),
|
|
|
}),
|
|
|
)
|
|
|
+ for (const step of ["paper-upstream", "paper-scratch"]) {
|
|
|
+ expect(
|
|
|
+ updates.find((update) => update.metadata?.latest_event === "tool_result" && update.metadata.step === step)
|
|
|
+ ?.metadata?.research67_progress,
|
|
|
+ ).toMatchObject({
|
|
|
+ title: "Research67 · paper-writer · 论文撰写 · 写作计划与大纲",
|
|
|
+ rows: expect.arrayContaining([
|
|
|
+ expect.objectContaining({ id: "paper-writing:outline", status: "running" }),
|
|
|
+ expect.objectContaining({ id: "paper-writing:compile", status: "pending" }),
|
|
|
+ expect.objectContaining({ id: "paper-writing:report", status: "pending" }),
|
|
|
+ ]),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ expect(
|
|
|
+ updates.find(
|
|
|
+ (update) =>
|
|
|
+ update.metadata?.latest_event === "tool_result" &&
|
|
|
+ update.metadata.latest_tool === "BuildResearchPaper" &&
|
|
|
+ update.metadata.step === 6,
|
|
|
+ )?.metadata?.research67_progress,
|
|
|
+ ).toMatchObject({
|
|
|
+ rows: expect.arrayContaining([
|
|
|
+ expect.objectContaining({ id: "paper-writing:compile", status: "failed" }),
|
|
|
+ expect.objectContaining({ id: "paper-writing:report", status: "pending" }),
|
|
|
+ ]),
|
|
|
+ footer: "当前操作失败,等待重试",
|
|
|
+ })
|
|
|
+ expect(
|
|
|
+ updates.find(
|
|
|
+ (update) => update.metadata?.latest_event === "tool_result" && update.metadata.step === "paper-repair",
|
|
|
+ )?.metadata?.research67_progress,
|
|
|
+ ).toMatchObject({
|
|
|
+ rows: expect.arrayContaining([
|
|
|
+ expect.objectContaining({ id: "paper-writing:compile", status: "pending" }),
|
|
|
+ expect.objectContaining({ id: "paper-writing:report", status: "pending" }),
|
|
|
+ ]),
|
|
|
+ footer: "论文源文件已更新,等待重新编译",
|
|
|
+ })
|
|
|
+ expect(
|
|
|
+ updates.find(
|
|
|
+ (update) =>
|
|
|
+ update.metadata?.latest_event === "tool_call" &&
|
|
|
+ update.metadata.latest_tool === "BuildResearchPaper" &&
|
|
|
+ update.metadata.step === 7,
|
|
|
+ )?.metadata?.research67_progress,
|
|
|
+ ).toMatchObject({
|
|
|
+ title: "Research67 · paper-writer · 论文撰写 · 编译双语 PDF",
|
|
|
+ rows: expect.arrayContaining([expect.objectContaining({ id: "paper-writing:compile", status: "running" })]),
|
|
|
+ })
|
|
|
expect(snapshots).toContainEqual(
|
|
|
expect.objectContaining({
|
|
|
rows: expect.arrayContaining([
|
|
|
@@ -451,11 +552,11 @@ test("preserves completed artifacts and forbids automatic reruns after failure",
|
|
|
updates.find((update) => update.metadata?.latest_event === "tool_result" && update.metadata.step === "repair")
|
|
|
?.metadata?.research67_progress,
|
|
|
).toMatchObject({
|
|
|
- title: "Research67 · paper-writer · 论文撰写 · 编译双语 PDF",
|
|
|
- footer: "当前操作失败,等待重试",
|
|
|
+ title: "Research67 · paper-writer · 论文撰写 · 英文稿与参考文献",
|
|
|
+ footer: "论文源文件已更新,等待重新编译",
|
|
|
rows: expect.arrayContaining([
|
|
|
- expect.objectContaining({ id: "paper-writing:english", status: "completed" }),
|
|
|
- expect.objectContaining({ id: "paper-writing:compile", status: "failed" }),
|
|
|
+ expect.objectContaining({ id: "paper-writing:english", status: "running" }),
|
|
|
+ expect.objectContaining({ id: "paper-writing:compile", status: "pending" }),
|
|
|
]),
|
|
|
})
|
|
|
const attemptStarts = updates.filter((update) => update.metadata?.latest_event === "stage_started")
|
|
|
@@ -485,7 +586,7 @@ test("preserves completed artifacts and forbids automatic reruns after failure",
|
|
|
workspace_path: workspacePath,
|
|
|
research67_progress: {
|
|
|
rows: expect.arrayContaining([
|
|
|
- expect.objectContaining({ id: "paper-writing:outline", status: "completed" }),
|
|
|
+ expect.objectContaining({ id: "paper-writing:outline", status: "failed" }),
|
|
|
expect.objectContaining({ id: "paper-writing:compile", status: "failed" }),
|
|
|
expect.objectContaining({ id: "paper-writing:report", status: "pending" }),
|
|
|
]),
|