fix!: restore caching, preserve failures, and verify fixture claims (#1211)
Restore profile-bound Ghidra snapshot reuse, preserve direct-analysis results through cleanup failures, and grade configured agent fixture claims against returned evidence. Register the compiled agent-evaluation fixture entry for static analysis. Co-authored-by: YouWish <29498139+Y0UW1SH@users.noreply.github.com> Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com>
This commit is contained in:
@@ -141,6 +141,74 @@ describe("analysis snapshot cache capacity", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("analysis snapshot cache policy", () => {
|
||||
it.each<{
|
||||
policy?: CapabilityDescriptor["cachePolicy"];
|
||||
operation?: CapabilityDescriptor["operation"];
|
||||
effects?: Partial<CapabilityDescriptor["effects"]>;
|
||||
parameters?: Record<string, string>;
|
||||
cacheable: boolean;
|
||||
}>([
|
||||
{ cacheable: false },
|
||||
{ policy: "snapshot", cacheable: true },
|
||||
{ policy: "live", cacheable: false },
|
||||
{
|
||||
policy: "live",
|
||||
effects: { mayWriteFilesystem: false },
|
||||
cacheable: false,
|
||||
},
|
||||
{
|
||||
policy: "snapshot",
|
||||
effects: { mutatesArtifact: true },
|
||||
cacheable: false,
|
||||
},
|
||||
{
|
||||
policy: "snapshot",
|
||||
effects: { changesPermissions: true },
|
||||
cacheable: false,
|
||||
},
|
||||
{ policy: "snapshot", operation: "list_documents", cacheable: false },
|
||||
{ policy: "snapshot", operation: "list_strings", cacheable: false },
|
||||
{
|
||||
policy: "snapshot",
|
||||
operation: "address_name",
|
||||
parameters: { document: "fixture" },
|
||||
cacheable: false,
|
||||
},
|
||||
])(
|
||||
"keeps explicit cache policy within immutable and state-independent boundaries: %j",
|
||||
({
|
||||
policy,
|
||||
operation = "analyze_function",
|
||||
effects,
|
||||
parameters = {},
|
||||
cacheable,
|
||||
}) => {
|
||||
const descriptor: CapabilityDescriptor = {
|
||||
provider: ANALYSIS_SNAPSHOT_PROVIDER,
|
||||
operation,
|
||||
available: true,
|
||||
reason: null,
|
||||
...(policy === undefined ? {} : { cachePolicy: policy }),
|
||||
effects: {
|
||||
mutatesArtifact: false,
|
||||
launchesProcess: true,
|
||||
mayShowUi: false,
|
||||
mayAccessNetwork: false,
|
||||
mayWriteFilesystem: true,
|
||||
changesPermissions: false,
|
||||
requiresRoot: false,
|
||||
...effects,
|
||||
},
|
||||
limitations: [],
|
||||
};
|
||||
expect(isSnapshotCacheable(operation, descriptor, parameters)).toBe(
|
||||
cacheable,
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe("analysis snapshot cache partitioning", () => {
|
||||
it.each<{
|
||||
operation: Exclude<AnalysisOperation, "health">;
|
||||
|
||||
Reference in New Issue
Block a user