fix(snapshot): bind replayed subjects to the selected target path

Rebind display paths only for matching artifact identities in primitive and composed replay. Preserve semantic Evidence IDs, payloads, and historical snapshot provenance. Classify snapshot filesystem workflows as boundary tests.

Validation: cache, direct workflow, MCP replay, and Evidence tests; combined checks and temporary-directory hygiene. Provider interactions are simulated for replay verification.
This commit is contained in:
morluto
2026-10-12 05:24:20 +08:00
parent 2260887f20
commit c002b89e2d
6 changed files with 239 additions and 36 deletions
+5 -1
View File
@@ -27,6 +27,7 @@ import {
} from "./evidenceBundle.js";
import {
evidenceLocationSchema,
rebindEvidenceToTargetPath,
type Evidence,
type EvidenceLocation,
type EvidenceSubjectTarget,
@@ -411,7 +412,7 @@ export const snapshotEvidenceForQuery = (
(candidate) => candidate.query_id === queryId,
);
if (entry === undefined && workflowEntry === undefined) return undefined;
return snapshot.evidence_bundle.records.find(
const evidence = snapshot.evidence_bundle.records.find(
(record) =>
record.subject?.digest.sha256 === target.sha256 &&
record.operation === operation &&
@@ -425,6 +426,9 @@ export const snapshotEvidenceForQuery = (
(workflowEntry !== undefined &&
evidenceMatchesWorkflowEntry(record, workflowEntry, snapshot))),
);
return evidence === undefined
? undefined
: rebindEvidenceToTargetPath(evidence, target);
};
/** Create one exact replay record for a derived application workflow result. */