mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00:00
test: preserve method-free IL2CPP overflow verification
This commit is contained in:
1 parent
d5e2d59eb6
commit
86b1b1431a
2 files changed
+39
-11
No files matched your search
@@ -6,6 +6,7 @@ import { Client } from "@modelcontextprotocol/client";
|
||||
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
|
||||
import { absoluteCallerPath } from "../dist/filesystem/callerPath.js";
|
||||
import { toolContract } from "../dist/contracts/toolContracts.js";
|
||||
import { il2cppMetadataViewRequestSchema } from "../dist/domain/analysisView/il2cppMetadataView.js";
|
||||
import { ArtifactResourceScope } from "../dist/artifacts/ArtifactResourceScope.js";
|
||||
import {
|
||||
requireMcpOutput,
|
||||
@@ -79,24 +80,32 @@ await withVerifierCleanup(async () => {
|
||||
assert.equal(error.code, "resource_constraint");
|
||||
assert.equal(error.details.reported_limits.boundary, "mcp-response");
|
||||
assert.match(error.details.reported_limits.evidence_id, /^ev_/u);
|
||||
const collections = il2cppMetadataViewRequestSchema.options.map(
|
||||
(option) => option.shape.collection.value,
|
||||
);
|
||||
const collection =
|
||||
["methods", ...collections].find(
|
||||
(name) => Array.isArray(report[name]) && report[name].length > 0,
|
||||
) ?? "methods";
|
||||
const expectedRows = report[collection].slice(0, 16);
|
||||
const retained = (
|
||||
await call("inspect_analysis_view", {
|
||||
source: {
|
||||
kind: "retained-evidence",
|
||||
evidence_id: error.details.reported_limits.evidence_id,
|
||||
},
|
||||
view: { kind: "il2cpp-metadata", collection: "methods", limit: 16 },
|
||||
view: { kind: "il2cpp-metadata", collection, limit: 16 },
|
||||
})
|
||||
).normalized_result;
|
||||
assert.ok(
|
||||
report.methods.length > 0,
|
||||
"Overflow retention needs a nonempty method oracle",
|
||||
);
|
||||
assert.deepEqual(
|
||||
retained.items,
|
||||
report.methods.slice(0, 16).map((row, index) => ({ ...row, index })),
|
||||
expectedRows.map((row, index) => ({ ...row, index })),
|
||||
"Failed complete delivery must retain its exact Evidence before reanalysis",
|
||||
);
|
||||
if (expectedRows.length === 0)
|
||||
console.log(
|
||||
"[unverified] Retention lookup succeeded, but empty queryable tables provide no nonempty row-content witness",
|
||||
);
|
||||
console.log(
|
||||
`[ok] MCP complete delivery refused at the stdio budget (${error.details.reported_limits.response_bytes_at_least} bytes) with retained Evidence`,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user