Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

refactor: prune obsolete provider and verification code

morlutoe19879328a11
diff --git a/scripts/lib/real-ghidra-boundaries.mjs b/scripts/lib/real-ghidra-boundaries.mjs
index 83cc74b22..f6ee1527a 100644
--- a/scripts/lib/real-ghidra-boundaries.mjs
+++ b/scripts/lib/real-ghidra-boundaries.mjs
@@ -13,8 +13,6 @@ import { promisify } from "node:util";
import Ajv from "ajv/dist/2020.js";
import addFormats from "ajv-formats";
-import { analysisErrorProjectionSchema } from "../../dist/contracts/errorSchemas.js";
-
import { verifyLegacyGhidraReferenceSnapshot } from "./ghidra-reference-snapshot-e2e.mjs";
import { verifyGhidraSnapshotLifecycle } from "./real-ghidra-snapshot-lifecycle.mjs";
import { verifyGhidraTargetAdmission } from "./real-ghidra-target-admission.mjs";
diff --git a/scripts/verify-real-ghidra-com.mjs b/scripts/verify-real-ghidra-com.mjs
index aaba1871b..5fabc1b8b 100644
--- a/scripts/verify-real-ghidra-com.mjs
+++ b/scripts/verify-real-ghidra-com.mjs
@@ -158,7 +158,7 @@ try {
observations: {
...x.observations,
source_files: x.observations.source_files.map(
- ({ name, ...file }) => file,
+ ({ name: _name, ...file }) => file,
),
},
});
diff --git a/scripts/verify/apple/legacy-simulator.mjs b/scripts/verify/apple/legacy-simulator.mjs
index 6ccc10ae2..1d3110cf5 100644
--- a/scripts/verify/apple/legacy-simulator.mjs
+++ b/scripts/verify/apple/legacy-simulator.mjs
@@ -1,7 +1,6 @@
import assert from "node:assert/strict";
import { execFile } from "node:child_process";
-import { createHash } from "node:crypto";
-import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
+import { mkdtemp, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { promisify } from "node:util";
diff --git a/scripts/verify/architecture-guards.mjs b/scripts/verify/architecture-guards.mjs
index ea92bf9d2..967e210de 100644
--- a/scripts/verify/architecture-guards.mjs
+++ b/scripts/verify/architecture-guards.mjs
@@ -1,4 +1,3 @@
-import assert from "node:assert/strict";
import { readFile, readdir } from "node:fs/promises";
import { join, relative, sep } from "node:path";
import { fileURLToPath } from "node:url";
diff --git a/scripts/verify/firmware/analysis.mjs b/scripts/verify/firmware/analysis.mjs
index 71b40bdac..1f84681c9 100644
--- a/scripts/verify/firmware/analysis.mjs
+++ b/scripts/verify/firmware/analysis.mjs
@@ -100,7 +100,9 @@ const verifyRegions = (evidence) => {
);
assert.equal(gzip.reported_size, oracle.length);
assert.equal(gzip.size_basis, "provider_reported_validation_unknown");
- return result.regions.map(({ provider_id, ...region }) => region);
+ return result.regions.map(
+ ({ provider_id: _provider_id, ...region }) => region,
+ );
};
const verifyFiles = async (evidence) => {
const result = firmwareResultSchemas.extract_firmware.parse(
diff --git a/src/adb/AdbProvider.ts b/src/adb/AdbProvider.ts
index d4e353e30..eec316978 100644
--- a/src/adb/AdbProvider.ts
+++ b/src/adb/AdbProvider.ts
@@ -80,8 +80,6 @@ export const ADB_PROVIDER_IDENTITY = {
version: null,
} as const;
-const VERSION_TIMEOUT_MS = 10_000;
-const VERSION_MAX_OUTPUT_BYTES = 64 * 1024;
const DEVICES_TIMEOUT_MS = 20_000;
const DEVICES_MAX_OUTPUT_BYTES = 1024 * 1024;
const SHELL_TIMEOUT_MS = 30_000;
diff --git a/src/apktool/ApktoolProvider.ts b/src/apktool/ApktoolProvider.ts
index 699bccb9a..eaf21c3e6 100644
--- a/src/apktool/ApktoolProvider.ts
+++ b/src/apktool/ApktoolProvider.ts
@@ -1,5 +1,5 @@
import { createHash, randomUUID } from "node:crypto";
-import { createWriteStream, constants as fsConstants } from "node:fs";
+import { createWriteStream } from "node:fs";
import {
access,
chmod,
diff --git a/src/application/AnalysisContextQueries.ts b/src/application/AnalysisContextQueries.ts
index cdb008e1f..379ebc322 100644
--- a/src/application/AnalysisContextQueries.ts
+++ b/src/application/AnalysisContextQueries.ts
@@ -3,12 +3,11 @@ import type {
AnalysisOperation,
AnalysisOperationPort,
} from "./AnalysisProvider.js";
-import { AnalysisOutputError } from "../domain/analysisErrorCore.js";
import type { AnalysisError } from "../domain/analysisErrorBase.js";
import type { JsonValue } from "../domain/jsonValue.js";
import { analysisBookmarkSchema } from "../domain/hopperValues.js";
import { resolveAnalysisDocument } from "./AnalysisDocument.js";
-import { err, ok, type Result } from "../domain/result.js";
+import { ok, type Result } from "../domain/result.js";
type Facet =
| { readonly state: "available"; readonly value: JsonValue }
diff --git a/src/artifacts/apple/MachoLoadCommandReader.ts b/src/artifacts/apple/MachoLoadCommandReader.ts
index 8a0112fab..14b1aa070 100644
--- a/src/artifacts/apple/MachoLoadCommandReader.ts
+++ b/src/artifacts/apple/MachoLoadCommandReader.ts
@@ -234,7 +234,7 @@ const readFatSlices = async (
): Promise<MachoSlice[]> => {
const slices: MachoSlice[] = [];
for (const declaration of declarations) {
- const { index, offset, size: length, cpuType, cpuSubtype } = declaration;
+ const { offset, size: length, cpuType, cpuSubtype } = declaration;
const rangeIssue = validateFatSlice(declaration, size, tableEnd);
if (rangeIssue !== null)
throw new MachoFormatIssue(
diff --git a/src/browser/history/CaptureFailures.ts b/src/browser/history/CaptureFailures.ts
index 78a5f0a43..228541545 100644
--- a/src/browser/history/CaptureFailures.ts
+++ b/src/browser/history/CaptureFailures.ts
@@ -5,7 +5,6 @@ import {
AnalysisAccessDeniedError,
AnalysisArtifactChangedError,
AnalysisCancelledError,
- AnalysisCapabilityUnavailableError,
AnalysisInputError,
AnalysisOutputError,
AnalysisResourceConstraintError,
diff --git a/src/domain/apktool/apktoolResourceAnalysis.ts b/src/domain/apktool/apktoolResourceAnalysis.ts
index e4a19634b..df217d040 100644
--- a/src/domain/apktool/apktoolResourceAnalysis.ts
+++ b/src/domain/apktool/apktoolResourceAnalysis.ts
@@ -2,8 +2,6 @@ import { z } from "zod";
import { localPathStringSchema } from "../localPath.js";
import { digestSchema } from "../digests.js";
-/** Upper bound for one decoded resource projection in one response. */
-const MAX_MANIFEST_BYTES = 512 * 1024;
const MAX_STRINGS = 2_000;
/**
diff --git a/src/domain/apple/interfaceBuilderGraph.ts b/src/domain/apple/interfaceBuilderGraph.ts
index cfb80d91b..f25c8b9b1 100644
--- a/src/domain/apple/interfaceBuilderGraph.ts
+++ b/src/domain/apple/interfaceBuilderGraph.ts
@@ -30,8 +30,6 @@ export const interfaceBuilderAnalysisSchema = z.strictObject({
limitations: z.array(z.string()),
});
-type InterfaceBuilderAnalysis = z.infer<typeof interfaceBuilderAnalysisSchema>;
-
export interface InterfaceBuilderDocumentInput {
readonly relativePath: string;
readonly archiveSha256: string;
diff --git a/src/domain/native/nativeInvestigationGraph.ts b/src/domain/native/nativeInvestigationGraph.ts
index cc5073d79..0dd0dbe8b 100644
--- a/src/domain/native/nativeInvestigationGraph.ts
+++ b/src/domain/native/nativeInvestigationGraph.ts
@@ -38,10 +38,6 @@ export const nativeInvestigationNodeKindSchema = z.enum([
"unknown",
]);
-type NativeInvestigationNodeKind = z.infer<
- typeof nativeInvestigationNodeKindSchema
->;
-
/** One UI, dispatch, or value entity with optional decoded source location. */
export const nativeInvestigationNodeSchema = z.strictObject({
id: z.string().min(1),
@@ -51,7 +47,6 @@ export const nativeInvestigationNodeSchema = z.strictObject({
attributes: z.record(z.string(), jsonValueSchema),
evidence: z.array(nativeMetadataEvidenceSchema),
});
-type NativeInvestigationNode = z.infer<typeof nativeInvestigationNodeSchema>;
/** Relationship types preserve UI wiring, native dispatch, and value flow. */
export const nativeInvestigationRelationSchema = z.enum([
@@ -72,10 +67,6 @@ export const nativeInvestigationRelationSchema = z.enum([
"controls",
]);
-type NativeInvestigationRelation = z.infer<
- typeof nativeInvestigationRelationSchema
->;
-
/** An observed, inferred, or unresolved relationship between entities. */
export const nativeInvestigationEdgeSchema = z.discriminatedUnion(
"resolution",
diff --git a/src/domain/webRuntime.ts b/src/domain/webRuntime.ts
index 289d52325..57abb4835 100644
--- a/src/domain/webRuntime.ts
+++ b/src/domain/webRuntime.ts
@@ -3,7 +3,6 @@ import {
browserAllowedOriginsSchema,
browserEndpointSchema,
} from "./browserObservation.js";
-import { browserVersionSchema } from "./browserObservationSchemas.js";
import { jsonObjectSchema } from "./jsonValue.js";
// CDP positions are zero-based and relative to the resource named by url.
diff --git a/src/ghidra/GhidraInstallation.ts b/src/ghidra/GhidraInstallation.ts
index 4ff7a6868..ffdb2e083 100644
--- a/src/ghidra/GhidraInstallation.ts
+++ b/src/ghidra/GhidraInstallation.ts
@@ -28,7 +28,6 @@ import {
ghidraReleaseCompatibility,
ghidraReleaseLine,
ghidraVersionDetail,
- SUPPORTED_GHIDRA_JAVA_MAJOR,
SUPPORTED_GHIDRA_VERSION,
type GhidraApplicationProperties,
type GhidraJavaRequirement,
diff --git a/src/ghidra/GhidraProvider.ts b/src/ghidra/GhidraProvider.ts
index 3936d5c99..98564faeb 100644
--- a/src/ghidra/GhidraProvider.ts
+++ b/src/ghidra/GhidraProvider.ts
@@ -46,7 +46,6 @@ import {
CAPABILITIES,
windowsP0Capabilities,
GHIDRA_PROVIDER_IDENTITY,
- GHIDRA_OPERATIONS,
} from "./GhidraProviderCapabilities.js";
import {
createGhidraProviderClient,
diff --git a/src/native/NativeMacOSProvider.ts b/src/native/NativeMacOSProvider.ts
index 75227b02d..8ab92abac 100644
--- a/src/native/NativeMacOSProvider.ts
+++ b/src/native/NativeMacOSProvider.ts
@@ -36,7 +36,6 @@ import {
AnalysisResourceConstraintError,
AnalysisTimeoutError,
} from "../domain/analysisErrorCore.js";
-import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
import { BinaryTargetError } from "../domain/configurationErrors.js";
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
diff --git a/src/native/pwntools/PwntoolsDecoder.ts b/src/native/pwntools/PwntoolsDecoder.ts
index 4c1add09c..fef52bff9 100644
--- a/src/native/pwntools/PwntoolsDecoder.ts
+++ b/src/native/pwntools/PwntoolsDecoder.ts
@@ -27,7 +27,6 @@ import { ProviderAdapterError } from "../../domain/providerAdapterError.js";
import { ProviderCleanupError } from "../../domain/providerCleanupError.js";
import { err, ok, type Result } from "../../domain/result.js";
import { runOwnedCommand } from "../../process/OwnedCommand.js";
-import { OwnedCommandFailure } from "../../process/OwnedCommand.js";
import {
pwntoolsResourceLimitsSchema,
readPwntoolsFailureEvidence,
diff --git a/src/server/registerFirmwareTools.ts b/src/server/registerFirmwareTools.ts
index 7a1a95800..84aa1b394 100644
--- a/src/server/registerFirmwareTools.ts
+++ b/src/server/registerFirmwareTools.ts
@@ -1,7 +1,6 @@
import type { EvidenceMcpServer } from "./EvidenceMcpServer.js";
import type { FirmwareAnalysisService } from "../application/firmware/FirmwareAnalysisService.js";
import { toolContract } from "../contracts/toolContracts.js";
-import type { FirmwareOperation } from "../domain/firmware/firmwareAnalysis.js";
import type { Logger } from "pino";
import type { EvidenceWriter } from "../application/investigation/InvestigationRecordPort.js";
import type { WithAdmittedAnalysis } from "./analysisAdmission.js";
diff --git a/tests/boundary/mcp/reconstructionObligationLedgerMcp.test.ts b/tests/boundary/mcp/reconstructionObligationLedgerMcp.test.ts
index 572b18d63..653977a8f 100644
--- a/tests/boundary/mcp/reconstructionObligationLedgerMcp.test.ts
+++ b/tests/boundary/mcp/reconstructionObligationLedgerMcp.test.ts
@@ -40,10 +40,6 @@ describe("reconstruction obligation ledger MCP parity", () => {
summary: { total: 0 },
},
});
- expect(result.structuredContent).toHaveProperty(
- "normalized_result.schema",
- "ReconstructionObligationLedger",
- );
} finally {
await client.close();
await server.close();
diff --git a/tests/boundary/process/filesystemSnapshotFifoRace.test.ts b/tests/boundary/process/filesystemSnapshotFifoRace.test.ts
index 5843158e3..871a1d8ca 100644
--- a/tests/boundary/process/filesystemSnapshotFifoRace.test.ts
+++ b/tests/boundary/process/filesystemSnapshotFifoRace.test.ts
@@ -1,6 +1,5 @@
import { randomUUID } from "node:crypto";
import { tmpdir } from "node:os";
-import { join } from "node:path";
import { fileURLToPath } from "node:url";
import { expect, it } from "vitest";
diff --git a/tests/boundary/process/jadxIntegration.test.ts b/tests/boundary/process/jadxIntegration.test.ts
index 768438c0c..864808beb 100644
--- a/tests/boundary/process/jadxIntegration.test.ts
+++ b/tests/boundary/process/jadxIntegration.test.ts
@@ -525,7 +525,7 @@ it("rejects bytes changed after target admission without launching an engine", a
});
it("retains an uncertain workspace and blocks later launches after cleanup cannot be verified", async () => {
- const { service, apk, launches, provider } = await setup("cleanup-failure");
+ const { service, apk, launches } = await setup("cleanup-failure");
const outcome = await service.execute("inspect_android_package", {
path: apk,
});
diff --git a/tests/boundary/process/packagePackIsolation.test.ts b/tests/boundary/process/packagePackIsolation.test.ts
index 48c88eaf2..0ad8a900c 100644
--- a/tests/boundary/process/packagePackIsolation.test.ts
+++ b/tests/boundary/process/packagePackIsolation.test.ts
@@ -1,12 +1,5 @@
import { execFile } from "node:child_process";
-import {
- access,
- mkdir,
- readFile,
- readdir,
- rm,
- writeFile,
-} from "node:fs/promises";
+import { access, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
import { join, resolve } from "node:path";
import { promisify } from "node:util";
import { pathToFileURL } from "node:url";