Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

fix(cache): invalidate snapshots that lack source caveat semantics

morluto937b4e69c8e8
diff --git a/src/application/InvestigationProviders.ts b/src/application/InvestigationProviders.ts
index a4c4d1458..510111d92 100644
--- a/src/application/InvestigationProviders.ts
+++ b/src/application/InvestigationProviders.ts
@@ -18,6 +18,7 @@ export const workflowAnalysisProfile = (
): AnalysisProfileCommitment =>
createAnalysisProfile(REA_WORKFLOW_PROVIDER, {
upstream_analysis_profile: upstream,
+ source_limitations: "provider-operation-caveats-v1",
...(operation === "binary_overview"
? { workflow_revision: 4 }
: operation === "batch_decompile" ||
diff --git a/src/ghidra/GhidraAnalysisProfile.ts b/src/ghidra/GhidraAnalysisProfile.ts
index 7d6a8e122..9c7f0b254 100644
--- a/src/ghidra/GhidraAnalysisProfile.ts
+++ b/src/ghidra/GhidraAnalysisProfile.ts
@@ -42,6 +42,7 @@ import {
} from "../domain/native/nativeAotPe.js";
const callRelationshipCoverage = "function-body-call-coverage-v5";
+const functionBoundaryObservations = "ghidra-function-boundary-limitations-v4";
const instructionReferenceCoverage =
"exact-address-incoming-without-synthetic-entry-v2";
@@ -139,8 +140,7 @@ export const resolveGhidraAnalysisProfile = async (
"address-first-unique-target-source-mapping-v2",
instruction_flow_evidence: "decoded-return-pcode-v1",
instruction_references: instructionReferenceCoverage,
- function_boundary_observations:
- "ghidra-function-boundary-limitations-v3",
+ function_boundary_observations: functionBoundaryObservations,
no_return_repair:
installation.platform === "win32"
? "disabled-windows-p0"
@@ -239,8 +239,7 @@ export const resolveGhidraAnalysisProfile = async (
"address-first-unique-target-source-mapping-v2",
instruction_flow_evidence: "decoded-return-pcode-v1",
instruction_references: instructionReferenceCoverage,
- function_boundary_observations:
- "ghidra-function-boundary-limitations-v3",
+ function_boundary_observations: functionBoundaryObservations,
no_return_repair:
installation.platform === "win32"
? "disabled-windows-p0"
diff --git a/src/ghidra/GhidraSnapshotCache.test.ts b/src/ghidra/GhidraSnapshotCache.test.ts
index 16dad277d..5ed8c319f 100644
--- a/src/ghidra/GhidraSnapshotCache.test.ts
+++ b/src/ghidra/GhidraSnapshotCache.test.ts
@@ -190,6 +190,11 @@ describe("Ghidra relationship coverage replay", () => {
describe("Ghidra snapshot profile admission", () => {
it.each([
+ {
+ parameter: "function_boundary_observations",
+ current: "ghidra-function-boundary-limitations-v4",
+ legacy: "ghidra-function-boundary-limitations-v3",
+ },
{
parameter: "instruction_references",
current: "exact-address-incoming-without-synthetic-entry-v2",
diff --git a/tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts b/tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts
index 332ccd441..3782509aa 100644
--- a/tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts
+++ b/tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts
@@ -470,14 +470,14 @@ const verifyWindowsSnapshotAdmission = async (
};
it.each([
- { tool: "binary_overview", arguments: {}, priorRevision: 3 },
+ { tool: "binary_overview", arguments: {}, priorRevision: 4 },
{
tool: "inspect_native_api",
arguments: { procedure: "0x1000" },
- priorRevision: undefined,
+ priorRevision: 1,
},
] as const)(
- "refreshes pre-coverage $tool Evidence and replays the current revision",
+ "refreshes unattributed $tool Evidence and replays the current revision",
async (scenario) => {
const fixture = await createSnapshotReplayFixture("rea-prior-coverage-");
const limitation = "Original PDB names may be missing.";
@@ -523,7 +523,9 @@ it.each([
options,
),
);
- expect(refreshed.limitations).toContain(limitation);
+ expect(refreshed.limitations).toEqual(
+ expect.arrayContaining(first.limitations),
+ );
expect(refreshed.analysis_profile?.digest).not.toBe(priorProfile.digest);
expect(refreshed.normalized_result).toEqual(first.normalized_result);
const starts = [...fixture.starts];
diff --git a/tests/boundary/mcp/ghidraEvidenceMcp.test.ts b/tests/boundary/mcp/ghidraEvidenceMcp.test.ts
index 6fd793b12..2a7b54efc 100644
--- a/tests/boundary/mcp/ghidraEvidenceMcp.test.ts
+++ b/tests/boundary/mcp/ghidraEvidenceMcp.test.ts
@@ -189,7 +189,7 @@ it("retains terminal-call qualifications across function views and snapshot repl
expect(evidence.limitations, name).toContain(limitation);
expect(evidence.analysis_profile?.parameters).toMatchObject({
function_boundary_observations:
- "ghidra-function-boundary-limitations-v3",
+ "ghidra-function-boundary-limitations-v4",
});
const replay = await harness.session.execute(name, evidence.parameters);
if (!replay.ok) throw replay.error;