mirror of
https://github.com/morluto/rea.git
synced 2026-11-18 04:34:13 +00:00
feat(elf): inspect dynamic dependencies and required symbol versions
Add offline ELF dependency, search-path, symbol-version and import inspection with retained Evidence summaries and pages. Bound GNU-hash work and preserve cancellation, stable identity and caller-selected parameters across CLI/MCP. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
1 parent
af062e7a2d
commit
e9c72dbd1f
100 files changed
+7137
-89
No files matched your search
@@ -343,6 +343,7 @@ export const ENTRY_FILES = Object.freeze(
|
||||
"NativeMacOSProviderMetadata.ts",
|
||||
"NativeMacosProviderIdentity.ts",
|
||||
"apple/AppleIpsProvider.ts",
|
||||
"elf/ElfDependenciesProvider.ts",
|
||||
"elf/ElfNotesProvider.ts",
|
||||
"elf/ElfUnwindRangesProvider.ts",
|
||||
"elf/KernelBuildConfigProvider.ts",
|
||||
|
||||
@@ -55,6 +55,13 @@ let diagnosticsVerified = false;
|
||||
let lastTool;
|
||||
let catalogChecked = false;
|
||||
let catalogSize = null;
|
||||
// The native keyword search limit is uint8. Keep each query through partial
|
||||
// replies, then query missing canonical names and verify the complete union.
|
||||
const searchLimit = 255;
|
||||
const discovered = new Map();
|
||||
const searchedQueries = new Set();
|
||||
const discoveryPages = [];
|
||||
let pendingQuery = "rea";
|
||||
let schemasChecked = 0;
|
||||
let analysisRequested = false;
|
||||
let evidenceSeen = false;
|
||||
@@ -107,10 +114,6 @@ await withVerifierCleanup(async () => {
|
||||
`export function extra${index}() { return { index: ${index}, tag: "GROK_LARGE_FIXTURE" }; }`,
|
||||
).join("\n"),
|
||||
);
|
||||
assert(
|
||||
expectedNames.length <= 255,
|
||||
"Native search_tool limit is uint8; this full-catalog query cannot cover more than 255 tools",
|
||||
);
|
||||
const schemaValidator = new Ajv2020({
|
||||
strict: false,
|
||||
validateFormats: false,
|
||||
@@ -253,10 +256,34 @@ await withVerifierCleanup(async () => {
|
||||
diagnosticsVerified = true;
|
||||
}
|
||||
if (discovery?.status !== "ready")
|
||||
return call("search_tool", { query: "rea", limit: 255 });
|
||||
const inventory = discovery.results
|
||||
return call("search_tool", {
|
||||
query: pendingQuery,
|
||||
limit: searchLimit,
|
||||
});
|
||||
discoveryPages.push({ query: pendingQuery, response: discovery });
|
||||
searchedQueries.add(pendingQuery);
|
||||
for (const tool of discovery.results
|
||||
.filter((result) => result.server === "rea")
|
||||
.flatMap((result) => result.tools);
|
||||
.flatMap((result) => result.tools)) {
|
||||
const previous = discovered.get(tool.tool_name);
|
||||
if (previous !== undefined)
|
||||
assert.deepEqual(
|
||||
previous.input_schema,
|
||||
tool.input_schema,
|
||||
`${tool.tool_name}: native input schema changed between queries`,
|
||||
);
|
||||
discovered.set(tool.tool_name, tool);
|
||||
}
|
||||
const missing = expectedNames.filter((name) => !discovered.has(name));
|
||||
const nextQuery = missing.find((name) => !searchedQueries.has(name));
|
||||
if (nextQuery !== undefined) {
|
||||
pendingQuery = nextQuery;
|
||||
return call("search_tool", {
|
||||
query: pendingQuery,
|
||||
limit: searchLimit,
|
||||
});
|
||||
}
|
||||
const inventory = [...discovered.values()];
|
||||
catalogSize = inventory.length;
|
||||
assert.deepEqual(
|
||||
inventory.map((tool) => tool.tool_name).sort(),
|
||||
@@ -274,7 +301,10 @@ await withVerifierCleanup(async () => {
|
||||
);
|
||||
schemasChecked++;
|
||||
}
|
||||
await writeFile(join(lab, "native-discovery.json"), last);
|
||||
await writeFile(
|
||||
join(lab, "native-discovery.json"),
|
||||
JSON.stringify(discoveryPages),
|
||||
);
|
||||
catalogChecked = true;
|
||||
analysisRequested = true;
|
||||
return call("use_tool", {
|
||||
@@ -524,9 +554,10 @@ enabled = false
|
||||
discovery:
|
||||
"native GROK_HOME, isolated additional skill directory, disabled foreign compatibility sources; default OS-home skill discovery and Windows unverified",
|
||||
interface:
|
||||
"default native search_tool/use_tool with a complete explicit inventory query; asynchronous partial discovery may trigger native REA diagnosis; large MCP outputs are queried via native terminal",
|
||||
"default native search_tool/use_tool with bounded keyword queries checked against the complete catalog; asynchronous partial discovery may trigger native REA diagnosis; large MCP outputs are queried via native terminal",
|
||||
catalogChecked,
|
||||
catalogSize,
|
||||
discoveryQueries: discoveryPages.map((page) => page.query),
|
||||
schemasChecked,
|
||||
skillLoaded,
|
||||
diagnosticsRequested,
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"schemas": {
|
||||
"input compact": "6ecf88aeaa9d79da",
|
||||
"output compact": "4bda7c3651bfc579"
|
||||
},
|
||||
"patterns": {
|
||||
"input": ["^[^\\x00]*$"]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user