fix(organize): resume original imports after episode corrections

This commit is contained in:
root committed 2026-10-13 16:50:51 +08:00
1 parent 679389f854
commit e874247e7c
17 files changed
+702 -26

No files matched your search

@@ -264,6 +264,25 @@ describe.skipIf(!pg)("整理真实文件的季集映射闭环", () => {
).rejects.toThrow("已对上的资源");
});
it("首次混合整理保留已对上的文件,纯文件偏移也要通过回归保护", async () => {
const entityId = await series();
await settleOrganizeEpisodeDecisions(h.ctx, h.db, {
recordId: randomUUID(),
entityId,
files: [await file(entityId, 1), await file(entityId, 40)],
});
const d = (await pending(entityId))[0]!;
expect(episodeFileSamples(d.evidence)).toHaveLength(2);
const simulation = await simulateForAgent(h.db, { decisionId: d.id, line: "S01 @ANi >> S02 EP-30" }, null);
expect(simulation.summary).toMatchObject({ samples: 2, resolved: 1, regressions: 1, ok: false });
await expect(
applyAgentEpisodeRule(h.ctx, { decisionId: d.id, line: simulation.line, reasons: ["同批文件"] }, ACTOR, null),
).rejects.toThrow("已对上的文件");
expect(
await h.db.selectFrom("identify_words").select("id").where("media_entity_id", "=", entityId).execute(),
).toHaveLength(0);
});
it("保存部分有效的映射保留未决文件与已解决样本,不误关闭事项", async () => {
const entityId = await series();
const files = [await file(entityId, 40), await file(entityId, 60)];