mirror of
https://github.com/morluto/rea.git
synced 2026-11-09 16:26:36 +00:00
* fix(comparisons)!: preserve unknowns across partial observations Share absence and digest semantics, keep unobserved managed bodies unknown, and match unique managed type/name/signatures before structural fallback. BREAKING CHANGE: Managed comparison metadata adds exact-signature matching and its count, and name_matching now reports exact-signature-fallback. * fix(javascript): preserve projected result binding semantics Share syntax-aware property reads and assigned-result resolution. Retain destructuring paths and downgrade downstream whole-result relationships instead of resolving nested or wrapped calls as aliases. * fix(native)!: admit complete parser values and preserve typed failures Decode Mach headers by named columns, validate complete slice keys and lipo alignment, and preserve codesign runtime flags and tagged parser errors. Rename the Ghidra test dossier fixture and connect fake-backed suites to real verification lanes. BREAKING CHANGE: Native load-command results no longer contain the unused, always-null file_offset field. * fix(process): preserve host identity and actionable boundary failures Thread selected platform and environment through process and Doctor seams, stamp observed producer identity in Evidence, and retain PTY, filesystem, lease and lazy-provider failure causes. Drain cancelled lazy loads and omit exited descendants from verified lineage. * fix(browser): preserve cleanup and document-transition evidence Make V8 and Playwright teardown cancellation-aware, expose primary failures alongside incomplete cleanup, share frame-tree and navigation rules, and clear stale WebMCP registrations without pruning unrelated child frames. * fix(adapters): align managed targets and typed CLI outcomes Inspect managed PE/CLI targets independently of native provider selection, reuse successful managed selections, and keep evidence bound to the actual inspected target. Classify canonical CLI error envelopes and exhaustive setup/update/uninstall outcomes, audit registered CLI coverage, and assert platform-specific runtime results. * docs: refresh boundary contracts and shipped roadmap behavior
76 lines
2.8 KiB
TypeScript
76 lines
2.8 KiB
TypeScript
import type { AppConfig } from "../config.js";
|
|
import type { BinarySession } from "./BinarySession.js";
|
|
import { HopperProvider } from "../hopper/HopperProvider.js";
|
|
import { GhidraProvider } from "../ghidra/GhidraProvider.js";
|
|
import { silentLogger, type Logger } from "../logger.js";
|
|
import { GENERATED_AUXILIARY_PROVIDERS } from "../generatedMcpToolCatalog.js";
|
|
import { AnalysisProviderRegistry } from "./AnalysisProviderRegistry.js";
|
|
import { composeBinarySession } from "./BinarySessionComposition.js";
|
|
import { nativeHostCapabilities } from "../native/NativeHostCapabilities.js";
|
|
import { LazyAnalysisProvider } from "./LazyAnalysisProvider.js";
|
|
import { ManagedStaticProvider } from "../dotnet/ManagedStaticProvider.js";
|
|
import { SessionProviderRouter } from "./SessionProviderRouter.js";
|
|
|
|
/**
|
|
* Compose the target-switching runtime shared directly by CLI and MCP adapters.
|
|
* This is the sole production wiring point, so both adapters share identical
|
|
* provider selection, profile, lifecycle, and Evidence semantics.
|
|
*/
|
|
export const createBinarySession = (
|
|
config: AppConfig,
|
|
logger: Logger = silentLogger,
|
|
): BinarySession => {
|
|
const hopper = new HopperProvider(config, logger);
|
|
const ghidra = new GhidraProvider(config, logger);
|
|
const auxiliary = new Map(
|
|
GENERATED_AUXILIARY_PROVIDERS.map((provider) => [
|
|
provider.identity.id,
|
|
provider,
|
|
]),
|
|
);
|
|
const lazyProvider = (
|
|
id: string,
|
|
load: ConstructorParameters<typeof LazyAnalysisProvider>[0]["load"],
|
|
) => {
|
|
const generated = auxiliary.get(id);
|
|
if (generated === undefined)
|
|
throw new TypeError(`Missing generated provider metadata for ${id}`);
|
|
return new LazyAnalysisProvider({
|
|
...generated,
|
|
capabilities: nativeHostCapabilities(generated.capabilities),
|
|
load,
|
|
});
|
|
};
|
|
return composeBinarySession(
|
|
new AnalysisProviderRegistry([hopper, ghidra], config.analysisProvider),
|
|
[
|
|
lazyProvider("rea-artifact-graph", async () => {
|
|
const { ArtifactProvider } = await import(
|
|
"../artifacts/ArtifactProvider.js"
|
|
);
|
|
return new ArtifactProvider();
|
|
}),
|
|
lazyProvider("native-macos", async () => {
|
|
const { NativeMacOSProvider } = await import(
|
|
"../native/NativeMacOSProvider.js"
|
|
);
|
|
return new NativeMacOSProvider();
|
|
}),
|
|
lazyProvider("rea-dotnet-static", async () => {
|
|
const { ManagedStaticProvider } = await import(
|
|
"../dotnet/ManagedStaticProvider.js"
|
|
);
|
|
return new ManagedStaticProvider();
|
|
}),
|
|
],
|
|
);
|
|
};
|
|
|
|
/** Compose an execution-free managed session without native provider selection. */
|
|
export const createManagedBinarySession = (): BinarySession =>
|
|
composeBinarySession(
|
|
SessionProviderRouter.selectable(new AnalysisProviderRegistry([]), [
|
|
new ManagedStaticProvider(),
|
|
]),
|
|
);
|