fix(analysis): preserve relationship coverage across evidence and replay

Separate observed relationship coverage from general provider caveats. Authenticate and replay coverage without changing legacy Evidence IDs; expose unknown and capped relationship sets through CLI/MCP graphs and traces.

Validated focused domain, snapshot, IDA/Ghidra boundary, MCP, schema, package and static checks. Provider fixtures establish contract behavior; licensed engine behavior was not reverified.
This commit is contained in:
morluto
2026-10-12 05:57:35 +08:00
parent f1924cf9c1
commit 9c8511409c
24 changed files with 469 additions and 55 deletions
@@ -34,6 +34,11 @@ import type {
import { OFFICIAL_TOOL_CONTRACTS } from "../../contracts/officialToolContracts.js";
import { compareUnicodeCodePoints } from "../../domain/unicodeCodePointOrder.js";
const RELATIONSHIP_OPERATIONS: ReadonlySet<AnalysisOperation> = new Set([
"procedure_callers",
"procedure_callees",
]);
const STATEFUL_OPERATIONS: ReadonlySet<AnalysisOperation> = new Set([
"health",
"current_address",
@@ -241,6 +246,7 @@ export class AnalysisSnapshotCache {
readonly provider: AnalysisExecution["provider"];
readonly analysisProfile: AnalysisProfileCommitment;
readonly limitations: readonly string[];
readonly relationshipCoverage?: AnalysisExecution["relationshipCoverage"];
readonly locations: AnalysisExecution["locations"];
readonly subject: AnalysisExecution["subject"];
};
@@ -302,6 +308,19 @@ export class AnalysisSnapshotCache {
...cached.execution.limitations,
"Loaded from a local REA analysis snapshot; this call did not re-run the provider.",
],
...(cached.execution.relationship_coverage === null &&
RELATIONSHIP_OPERATIONS.has(operation)
? {
relationshipCoverage: {
status: "unknown",
reason: "Snapshot entry does not report relationship coverage.",
},
}
: cached.execution.relationship_coverage === null
? {}
: {
relationshipCoverage: cached.execution.relationship_coverage,
}),
locations: cached.execution.locations,
subject,
});