fix(audit): reserve recovery evidence outside user deliverables

This commit is contained in:
2026-10-20 21:26:48 +01:00
parent 860615acb5
commit b56d6af180
5 changed files with 69 additions and 17 deletions
+4 -2
View File
@@ -165,12 +165,14 @@ export function isSystemArtifact(artifact) {
/** A visit's stage-produced artifacts: everything except the system files. */
export function stageArtifacts(step) {
return presentedArtifacts(step).filter((artifact) => !isSystemArtifact(artifact));
const repairs = new Set((step?.session_export_repairs ?? []).map((entry) => entry?.html).filter(Boolean));
return presentedArtifacts(step).filter((artifact) => !isSystemArtifact(artifact) && !repairs.has(artifact?.name));
}
/** A visit's system files, newest-listing order preserved. */
export function systemArtifacts(step) {
return presentedArtifacts(step).filter(isSystemArtifact);
const repairs = new Set((step?.session_export_repairs ?? []).map((entry) => entry?.html).filter(Boolean));
return presentedArtifacts(step).filter((artifact) => isSystemArtifact(artifact) || repairs.has(artifact?.name));
}
/** How many files the capture excluded for `step` (absent means none). */