refactor(domain): compare snapshot targets through one target identity key (#11341)

* refactor(domain): compare snapshot targets through one target identity key

* fix(domain): refuse snapshot targets whose kind their format cannot have
This commit is contained in:
morluto authored and GitHub committed 2026-11-16 03:07:22 +08:00
1 parent 15dc40e2bf
commit aba42b47b9
7 files changed
+301 -76

No files matched your search

@@ -24,6 +24,7 @@ import {
snapshotBindingMismatch,
snapshotMatchesProfile,
snapshotTarget,
snapshotTargetIdentity,
parseAnalysisSnapshot,
immutableAnalysisSnapshot,
type AnalysisSnapshot,
@@ -47,6 +48,7 @@ import {
snapshotReplayBinding,
type SnapshotReplayBinding,
} from "./AnalysisSnapshotReplayBinding.js";
import { sameTargetIdentity } from "../../domain/targetIdentity.js";
import { createInvestigationEvidenceClosureChecker } from "../investigation/InvestigationEvidence.js";
const RELATIONSHIP_OPERATIONS: ReadonlySet<AnalysisOperation> = new Set([
@@ -226,7 +228,10 @@ export class AnalysisSnapshotCache {
snapshot = immutableAnalysisSnapshot(snapshot);
if (
(this.#target !== undefined &&
JSON.stringify(this.#target) !== JSON.stringify(snapshot.target)) ||
!sameTargetIdentity(
snapshotTargetIdentity(this.#target),
snapshotTargetIdentity(snapshot.target),
)) ||
(this.#binding !== undefined &&
!snapshotMatchesProfile(
this.#binding,