fix(audit): expose verified visit exports and export-only recovery

This commit is contained in:
2026-10-20 21:20:06 +01:00
parent f87e1ed488
commit ca78b24f47
14 changed files with 359 additions and 59 deletions
+16
View File
@@ -0,0 +1,16 @@
import test from "node:test";
import assert from "node:assert/strict";
import { PipelinesRepository } from "../src/repository.js";
test("web export retry names the exact recorded visit and sends no execution request", async () => {
const sent=[];const detail={id:19,status:"succeeded"};
const repo=new PipelinesRepository({call:async frame=>{sent.push(frame);return {run_detail:detail};}});
assert.equal(await repo.repairSessionExport(19,4),detail);
assert.deepEqual(sent,[{type:"repair_session_export",run_id:19,export_sequence:4}]);
});
test("web export retry refuses an unknown run or visit before any request", async () => {
let calls=0;const repo=new PipelinesRepository({call:async()=>{calls++;}});
for(const [id,sequence] of [[0,1],[19,0],[19,-1],[19,1.5]]) await assert.rejects(repo.repairSessionExport(id,sequence));
assert.equal(calls,0);
});