From 50a6ab9b9f053f341bc59ff0ce48ded264e0a26f Mon Sep 17 00:00:00 2001 From: jiayiyan <43424880@qq.com> Date: Mon, 18 May 2026 16:11:24 +0800 Subject: [PATCH] refactor: remove explanatory comment and unspecified mode guard in differ adapter --- workflows/adapters/differ-adapter.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/workflows/adapters/differ-adapter.ts b/workflows/adapters/differ-adapter.ts index aae8695..497c0ce 100644 --- a/workflows/adapters/differ-adapter.ts +++ b/workflows/adapters/differ-adapter.ts @@ -23,10 +23,7 @@ export function createDifferAdapter( throw new Error("differ: office step not found in ctx.steps (invariant violation)"); } - const officeMeta = officeStep.meta as { mode: string; outputDocx: string; sourceDocx: string | null }; - if (officeMeta.mode !== "edit" || officeMeta.sourceDocx === null) { - throw new Error("differ: office step is not in edit mode"); - } + const officeMeta = officeStep.meta as { outputDocx: string; sourceDocx: string }; const { outputDocx, sourceDocx } = officeMeta; const reportPath = join(dirname(outputDocx), "diff_report.html"); @@ -40,7 +37,6 @@ export function createDifferAdapter( if (!result.ok) { const e = result.error; if (e.kind === "non_zero_exit" && e.exitCode === 1) { - // exit 1 means "documents differ" — the normal success case for docx-diff } else if (e.kind === "non_zero_exit") { throw new Error(`differ: docx-diff failed (exit ${e.exitCode}): ${e.stderr}`); } else if (e.kind === "timeout") {