mirror of
https://github.com/morluto/rea.git
synced 2026-11-09 16:26:36 +00:00
feat(kuna): preserve stored pointer references (#8851)
* feat(kuna): verify release 1.990 * feat(kuna): preserve stored pointer references * fix(kuna): group image-wide reference coverage gaps * fix(evidence): retain producer-required xref observations * fix(mcp): clarify xref address page scope * fix(kuna): preserve reference target aliases --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
1 parent
3e8a5f76d0
commit
f7dc5489b3
17 files changed
+692
-29
No files matched your search
@@ -864,6 +864,73 @@ describe("document-scoped snapshot admission", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("retains producer-required xrefs without replaying a filesystem-writing query", () => {
|
||||
const descriptor: CapabilityDescriptor = {
|
||||
operation: "xrefs",
|
||||
provider: ANALYSIS_SNAPSHOT_PROVIDER,
|
||||
available: true,
|
||||
reason: null,
|
||||
effects: {
|
||||
mutatesArtifact: false,
|
||||
launchesProcess: true,
|
||||
mayShowUi: false,
|
||||
mayAccessNetwork: false,
|
||||
mayWriteFilesystem: false,
|
||||
changesPermissions: false,
|
||||
requiresRoot: false,
|
||||
},
|
||||
limitations: [],
|
||||
};
|
||||
const xrefs = descriptor;
|
||||
expect(
|
||||
isSourceEvidenceRetainable("xrefs", xrefs, { address: "0x1000" }),
|
||||
).toBe(false);
|
||||
expect(isSnapshotCacheable("xrefs", xrefs, { address: "0x1000" })).toBe(
|
||||
false,
|
||||
);
|
||||
expect(isSourceEvidenceRetainable("xrefs", xrefs, {})).toBe(false);
|
||||
const writingXrefs = {
|
||||
...xrefs,
|
||||
effects: { ...xrefs.effects, mayWriteFilesystem: true },
|
||||
};
|
||||
expect(
|
||||
isSourceEvidenceRetainable("xrefs", writingXrefs, { address: "0x1000" }),
|
||||
).toBe(false);
|
||||
expect(
|
||||
isSourceEvidenceRetainable(
|
||||
"xrefs",
|
||||
writingXrefs,
|
||||
{ address: "0x1000" },
|
||||
{ requiresSourceEvidence: true },
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
isSourceEvidenceRetainable(
|
||||
"xrefs",
|
||||
writingXrefs,
|
||||
{},
|
||||
{ requiresSourceEvidence: true },
|
||||
),
|
||||
).toBe(false);
|
||||
expect(
|
||||
isSourceEvidenceRetainable(
|
||||
"xrefs",
|
||||
{
|
||||
...writingXrefs,
|
||||
effects: { ...writingXrefs.effects, mutatesArtifact: true },
|
||||
},
|
||||
{ address: "0x1000" },
|
||||
{ requiresSourceEvidence: true },
|
||||
),
|
||||
).toBe(false);
|
||||
expect(
|
||||
isSnapshotCacheable("xrefs", writingXrefs, {
|
||||
address: "0x1000",
|
||||
document: "fixture",
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
describe("analysis snapshot cache partitioning", () => {
|
||||
it.each<{
|
||||
operation: Exclude<AnalysisOperation, "health">;
|
||||
@@ -1490,13 +1557,43 @@ describe("executions that report truncated references", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("does not replay references when the snapshot would lose their classifications", () => {
|
||||
const cache = new AnalysisSnapshotCache();
|
||||
const parameters = { address: "0x1000", document: "fixture" };
|
||||
cache.record({
|
||||
target: ANALYSIS_SNAPSHOT_TARGET,
|
||||
profile: ANALYSIS_SNAPSHOT_PROFILE,
|
||||
operation: "xrefs",
|
||||
parameters,
|
||||
execution: createAnalysisExecution(["0x2000"], ANALYSIS_SNAPSHOT_PROVIDER, {
|
||||
referenceClassifications: [
|
||||
{
|
||||
sourceAddress: "0x2000",
|
||||
targetAddress: "0x1000",
|
||||
kind: "stored_pointer",
|
||||
provenance: "relocation",
|
||||
width: 8,
|
||||
},
|
||||
],
|
||||
}),
|
||||
});
|
||||
expect(
|
||||
cache.lookup(
|
||||
ANALYSIS_SNAPSHOT_TARGET,
|
||||
ANALYSIS_SNAPSHOT_PROFILE,
|
||||
"xrefs",
|
||||
parameters,
|
||||
),
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it("revises the trace_feature workflow profile so earlier results are not replayed", () => {
|
||||
const profile = ANALYSIS_SNAPSHOT_PROFILE;
|
||||
|
||||
expect(
|
||||
workflowAnalysisProfile(profile, "trace_feature").parameters
|
||||
.workflow_revision,
|
||||
).toBe(4);
|
||||
).toBe(8);
|
||||
|
||||
expect(workflowAnalysisProfile(profile, "trace_feature")).not.toEqual(
|
||||
workflowAnalysisProfile(profile),
|
||||
|
||||
Reference in new issue
Block a user