mirror of
https://github.com/morluto/rea.git
synced 2026-11-09 16:26:36 +00:00
fix(snapshot): retain one-shot Ghidra pseudocode results (#8089)
* fix(snapshot): retain one-shot Ghidra pseudocode results * test(snapshot): cover evidence-only pseudocode migration --------- Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
This commit is contained in:
1 parent
4d2aff2ec6
commit
ebea0f009f
8 files changed
+243
-6
No files matched your search
@@ -777,7 +777,9 @@ describe("analysis snapshot cache policy", () => {
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe("document-scoped snapshot admission", () => {
|
||||
it("retains caller observations without a document while refusing to replay them", () => {
|
||||
const descriptor: CapabilityDescriptor = {
|
||||
operation: "procedure_callers",
|
||||
@@ -829,6 +831,35 @@ describe("analysis snapshot cache policy", () => {
|
||||
document: "fixture",
|
||||
}),
|
||||
).toBe(true);
|
||||
const ghidra = {
|
||||
...pseudocode,
|
||||
provider: { ...pseudocode.provider, id: "ghidra" },
|
||||
};
|
||||
expect(
|
||||
isSnapshotCacheable("procedure_pseudo_code", ghidra, parameters),
|
||||
).toBe(false);
|
||||
expect(
|
||||
isSnapshotCacheable(
|
||||
"procedure_pseudo_code",
|
||||
ghidra,
|
||||
parameters,
|
||||
"one-shot-target",
|
||||
),
|
||||
).toBe(true);
|
||||
for (const refused of [
|
||||
pseudocode,
|
||||
{ ...ghidra, cachePolicy: "live" as const },
|
||||
{ ...ghidra, effects: { ...ghidra.effects, mutatesArtifact: true } },
|
||||
{ ...ghidra, effects: { ...ghidra.effects, changesPermissions: true } },
|
||||
])
|
||||
expect(
|
||||
isSnapshotCacheable(
|
||||
"procedure_pseudo_code",
|
||||
refused,
|
||||
parameters,
|
||||
"one-shot-target",
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user