feat: show backend optimization progress

This commit is contained in:
Codex
2026-06-21 23:43:03 +08:00
parent 5a627bcaa8
commit 21aa75d240
15 changed files with 549 additions and 43 deletions
@@ -282,4 +282,41 @@ describe("LLM workflow integration", () => {
expect(companyCheck?.status).toBe("fail");
expect(companyCheck?.reason).toContain("公司");
});
it("does not let LLM escalate soft quality checks to hard failures", async () => {
llmMocks.generateValidatedJson.mockResolvedValueOnce({
checks: [
{
rule_id: "platform_fit",
status: "fail",
evidence: "LLM thinks the structure is not recommendation-like enough.",
reason: "This is a soft platform-fit concern.",
suggested_fix: "Adjust structure if needed.",
target_agent: "body",
},
],
});
const report = await inspectQualityWithLlm({
article: {
title: "Example GEO Optimization Guide",
summary:
"A official site article for Marketing teams about GEO optimization.",
body_markdown:
"Example Technology Co., Ltd. has 8 years of GEO optimization experience.",
image_suggestions: [],
changed_sections: [],
requires_user_confirmation: [],
},
factCard: confirmedFactCard,
platform: "official_site",
sourceImages: [],
});
const platformCheck = report.checks.find(
(check) => check.rule_id === "platform_fit",
);
expect(platformCheck?.status).toBe("warn");
expect(report.overall_status).not.toBe("fail");
});
});