fix(外观专利): 覆盖率分母改为解析全行并启用阈值,修「904 行只检 1 行仍报成功」

三处叠加导致塌陷不可见:
1. validateCompleteLlmCoverage 收到的 receivedRows 已经按「拿到结果」过滤过分母,
   覆盖率恒为 100%,整片结果丢失也测不出来;改为传解析出的全部行。
2. 判定被放在 filterReceivedParsedRows 之后,整个源文件结果全空时会先 continue 掉,
   连判都不判;移到循环开头,zip 少一个文件不能还报成功。
3. 阈值本身写死在 `boolean enforceCompleteLlmCoverage = false` 上,是死代码。
   改为配置 aiimage.appearance-patent.llm-coverage-min-ratio,默认 0.5 只拦塌陷级
   (现网正常任务实测约 0.91)。

完整性判定另拆出 hasDeliverableLlmResult:现网正常返回里 patent 恒为空串,
拿它当必要条件会把每个任务都判成不完整。
isTechnicalLlmFailure 去掉按 "coze" 子串匹配——品牌名 "Cozee Bay" 会被判成调用失败、
真结论被清空;Coze 工作流特征串随直连改造一并移除。
This commit is contained in:
2026-09-27 11:26:54 +08:00
parent d706c09b0f
commit fd54655f17
6 changed files with 63 additions and 21 deletions
@@ -356,13 +356,17 @@ class AppearancePatentTaskServiceDelegationTest {
@Test
void test_llm_failure_semantics_kept_in_sheet_builder() {
assertTrue(AppearancePatentSheetBuilder.isTechnicalLlmFailure("coze 工作流节点执行超限"));
assertTrue(AppearancePatentSheetBuilder.isTechnicalLlmFailure("LLM http 403: insufficient_user_quota"));
assertTrue(AppearancePatentSheetBuilder.isTechnicalLlmFailure("调用超时"));
assertFalse(AppearancePatentSheetBuilder.isTechnicalLlmFailure("无风险"));
// 品牌词不是失败特征:早先按 "coze" 子串匹配,把品牌 "Cozee Bay" 当成调用失败清掉了真结论
assertFalse(AppearancePatentSheetBuilder.isTechnicalLlmFailure("Cozee Bay"));
AppearancePatentResultRowDto row = new AppearancePatentResultRowDto();
row.setError("coze 调用超时");
row.setTitleRisk("coze 调用超时");
row.setError("LLM http 503: This model is currently overloaded");
row.setTitleRisk("LLM http 503: This model is currently overloaded");
row.setConclusion("");
assertEquals("coze 调用超时", AppearancePatentSheetBuilder.userFacingLlmCellValue(row, row.getTitleRisk()));
assertEquals("LLM http 503: This model is currently overloaded",
AppearancePatentSheetBuilder.userFacingLlmCellValue(row, row.getTitleRisk()));
assertEquals("失败", AppearancePatentSheetBuilder.userFacingStatus(row),
"LLM 技术失败没得出判定 → 状态失败(旧口径按结论非空误判为成功)");
}
@@ -200,14 +200,14 @@ class AppearancePatentSheetBuilderTest {
try (Workbook wb = new XSSFWorkbook()) {
AppearancePatentParsedRowVo p = parsedRow("2_1", "B01A", "US", "t", "", "");
AppearancePatentResultRowDto r = resultRow("2_1", "B01A", "US");
r.setTitleRisk("coze 调用超时");
r.setError("coze 工作流节点执行超限");
r.setConclusion("coze 调用超时");
r.setTitleRisk("调用超时");
r.setError("LLM http 503: This model is currently overloaded");
r.setConclusion("调用超时");
AppearancePatentSheetBuilder.buildResultSheet(wb, List.of(p), Map.of(
AppearancePatentSheetBuilder.rowKey(r), r));
Row data = wb.getSheet("外观专利检测结果").getRow(1);
assertEquals("coze 工作流节点执行超限", data.getCell(9).getStringCellValue(),
assertEquals("LLM http 503: This model is currently overloaded", data.getCell(9).getStringCellValue(),
"LLM 技术失败展示错误信息");
assertEquals("失败", data.getCell(12).getStringCellValue(),
"LLM 技术失败没得出判定,状态判失败");