Skip to content

armgit / rea

Public Imported from GitHub
0

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

fix(setup): offer Hopper installation only where setup can install it (#4642)

Paritosh Lahre357100242264
diff --git a/docs/user-visible-errors.csv b/docs/user-visible-errors.csv
index e105cafe6..f0deb0df0 100644
--- a/docs/user-visible-errors.csv
+++ b/docs/user-visible-errors.csv
@@ -65,12 +65,12 @@ harm_rank,location,trigger,current_copy,user_risk,proposed_replacement,implement
52,src/application/Setup.ts:approval,Setup plan lacks approval,"Review the setup plan, then rerun interactively or with --yes.",Low risk; exact authorization recovery,Keep current copy,unchanged,verified by setup unit tests
53,src/application/Setup.ts:engine install,Approved analysis-engine installation returns no launcher,Hopper installation failed; install Hopper manually or rerun setup after resolving the reported system error.,Mentions component intentionally being installed and offers two bounded recovery paths,Keep current copy,unchanged,verified by setup unit test
54,src/application/Setup.ts:first-run choice,New macOS analysis-engine install requires a first-run choice,"Open Hopper, choose its demo mode or activate a license, then rerun rea doctor --json.",Low risk; exact demo-or-license choice and verification command,Keep current copy,unchanged,verified by setup unit test
-55,src/application/Setup.ts:optional engine,Setup completes without optional deep-analysis engine,Hopper is optional for non-Hopper providers. Rerun with --yes --install-hopper for deep native analysis.,Exposes provider terminology but this is an explanatory setup status rather than an error; recovery command is exact,Keep current copy,unchanged,verified by setup unit test
-56,src/application/Setup.ts:doctor fallback,Post-setup diagnostics remain unhealthy,Run rea doctor and apply each reported remediation.,Low risk; delegates to structured per-check recovery,Keep current copy,unchanged,verified by exact setup unit test
-57,src/application/Setup.ts:unsupported platform,Platform is neither macOS nor Linux,REA supports Hopper on macOS and selected 64-bit Linux distributions.,Low risk; states support boundary,Keep current copy,unchanged,verified by setup unit test
+55,src/application/Setup.ts:optional engine,Setup completes without optional deep-analysis engine on a host where automated Hopper installation is supported,Hopper is optional for non-Hopper providers. Rerun with --yes --install-hopper for deep native analysis.,Exposes provider terminology but this is an explanatory setup status rather than an error; recovery command is exact,Keep current copy,unchanged,verified by setup unit test
+56,src/application/Setup.ts:doctor fallback,Post-setup diagnostics remain unhealthy (including hosts where automated Hopper installation is unsupported),Run rea doctor and apply each reported remediation.,Low risk; delegates to structured per-check recovery,Keep current copy,unchanged,verified by exact setup unit test
+57,src/application/SetupPlan.ts:unsupported platform,Platform is neither macOS nor Linux,REA supports Hopper on macOS and selected x86_64 Linux distributions.,Low risk; states support boundary,Keep current copy,unchanged,verified by setup unit test
58,src/application/SetupHost.ts:unsupported Node,Runtime version cannot run setup,"Install Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+ and rerun setup.",Low risk; exact dependency and retry,Keep current copy,unchanged,verified by setup host tests
-59,src/application/Setup.ts:unsupported macOS,macOS version is missing or older than 12,Upgrade to macOS 12 or newer.,Low risk; exact support floor,Keep current copy,unchanged,verified by setup host tests
-60,src/application/SetupHost.ts:unsupported Linux,Linux distribution is outside supported set,"Automated Hopper setup supports Ubuntu 24.04+, Fedora 41+, Nobara 44+, 64-bit Arch Linux, CachyOS, and Omarchy; configure an existing supported provider instead.",Low risk; exact supported alternatives,Keep current copy,unchanged,verified by setup unit test
+59,src/application/SetupPlan.ts:unsupported macOS,"macOS version is missing, unparseable, or older than 12",Upgrade to macOS 12 or newer.,Low risk; exact support floor,Keep current copy,unchanged,verified by setup unit test
+60,src/application/SetupPlan.ts:unsupported Linux,Linux distribution is outside supported set,"Automated Hopper setup requires an x86_64 host running Ubuntu 24.04+, Fedora 41+, Nobara 44+, Arch Linux, CachyOS, or Omarchy; configure an existing supported provider instead.",Low risk; exact supported alternatives,Keep current copy,unchanged,verified by setup unit test
61,src/application/process/ProcessCli.ts:readJson read,Process scenario or evidence file cannot be read,Raw filesystem exception through CLI framework,Can expose local paths/codes and no recovery,"Process input file could not be read. Check that the path exists and is readable.",implemented,verified by focused CLI test
62,src/application/JsonInputFile.ts:memory admission,Projected process JSON value exceeds available heap headroom,Insufficient heap headroom to materialize the complete JSON value,Heap admission depends on live runtime capacity rather than a fixed 64 MiB file limit,"Provide a smaller valid JSON value. For Evidence workflows, re-analyze a smaller selection of the original target and use its complete Evidence; splitting JSON text or trimming Evidence fields does not produce valid workflow input.",implemented,Source verified against shared JSON reader and recovery constant; former fixed-size refusal is superseded
63,src/application/process/ProcessCli.ts:readJson parse,Process scenario or evidence file is malformed JSON,Raw JSON parser exception through CLI framework,Can expose parser implementation and lacks recovery,"Process input file is not valid JSON. Repair the file, then try again.",implemented,verified by focused CLI test
diff --git a/src/application/LinuxHopper.test.ts b/src/application/LinuxHopper.test.ts
index 7a2838e86..929be58da 100644
--- a/src/application/LinuxHopper.test.ts
+++ b/src/application/LinuxHopper.test.ts
@@ -9,6 +9,7 @@ import {
linuxPackageManagerCommands,
linuxSharedLibrariesAvailable,
parseLinuxDistribution,
+ readLinuxDistribution,
supportsReaHost,
LinuxHopperTemporaryCleanupOwner,
systemLinuxHopperInstallHost,
@@ -379,11 +380,14 @@ describe("Linux Hopper cleanup and failure details", () => {
const directory = await createTestTempDirectory("rea-hopper-status-");
const launcher = join(directory, "Hopper");
await writeFile(launcher, "fixture launcher");
- const host = systemLinuxHopperInstallHost({
- ...process.env,
- HOME: directory,
- XDG_CACHE_HOME: join(directory, "cache"),
- });
+ const host = systemLinuxHopperInstallHost(
+ {
+ ...process.env,
+ HOME: directory,
+ XDG_CACHE_HOME: join(directory, "cache"),
+ },
+ () => readLinuxDistribution(process.arch),
+ );
const command = vi
.spyOn(nativeCommands, "execFileOutput")
.mockResolvedValue({
diff --git a/src/application/LinuxHopperPackageRuntime.test.ts b/src/application/LinuxHopperPackageRuntime.test.ts
index 1acd97b6b..34bdf1eca 100644
--- a/src/application/LinuxHopperPackageRuntime.test.ts
+++ b/src/application/LinuxHopperPackageRuntime.test.ts
@@ -6,9 +6,12 @@ import { err, ok } from "../domain/result.js";
import * as pythonRuntime from "./LinuxHopperPython.js";
import {
linuxHopperInstallDisclosure,
+ readLinuxDistribution,
systemLinuxHopperInstallHost,
} from "./LinuxHopper.js";
+const hostDistribution = () => readLinuxDistribution(process.arch);
+
const missingPython = {
interpreter: "/usr/bin/python3",
version: [3, 14],
@@ -80,7 +83,10 @@ describe("Linux Hopper package runtime", () => {
const directory = await createTestTempDirectory(
"rea-linux-python-install-",
);
- const host = systemLinuxHopperInstallHost({ XDG_CACHE_HOME: directory });
+ const host = systemLinuxHopperInstallHost(
+ { XDG_CACHE_HOME: directory },
+ hostDistribution,
+ );
const command = vi
.spyOn(boundedCommands, "execFileBoundedOutput")
.mockResolvedValue(commandSuccess);
@@ -115,7 +121,10 @@ describe("Linux Hopper package runtime", () => {
const directory = await createTestTempDirectory(
"rea-linux-python-failure-",
);
- const host = systemLinuxHopperInstallHost({ XDG_CACHE_HOME: directory });
+ const host = systemLinuxHopperInstallHost(
+ { XDG_CACHE_HOME: directory },
+ hostDistribution,
+ );
const failed = {
exitCode: 67,
stdout: "original package output",
@@ -153,7 +162,10 @@ describe("Linux Hopper package mapping", () => {
"/usr/lib/x86_64-linux-gnu/libpython3.13.so.1.0",
])("keeps an unproven APT mapping unknown: %s", async (path) => {
const directory = await createTestTempDirectory("rea-python-package-map-");
- const host = systemLinuxHopperInstallHost({ XDG_CACHE_HOME: directory });
+ const host = systemLinuxHopperInstallHost(
+ { XDG_CACHE_HOME: directory },
+ hostDistribution,
+ );
const command = vi
.spyOn(boundedCommands, "execFileBoundedOutput")
.mockResolvedValue(commandSuccess);
@@ -201,7 +213,10 @@ describe("Linux Hopper package cancellation and disclosure", () => {
const directory = await createTestTempDirectory(
"rea-python-install-cancel-",
);
- const host = systemLinuxHopperInstallHost({ XDG_CACHE_HOME: directory });
+ const host = systemLinuxHopperInstallHost(
+ { XDG_CACHE_HOME: directory },
+ hostDistribution,
+ );
const controller = new AbortController();
const cause = new Error("caller cancelled at " + phase);
let commandCount = 0;
diff --git a/src/application/ReconstructionObligationCandidates.ts b/src/application/ReconstructionObligationCandidates.ts
index e9ab00155..7abc13d4d 100644
--- a/src/application/ReconstructionObligationCandidates.ts
+++ b/src/application/ReconstructionObligationCandidates.ts
@@ -444,10 +444,10 @@ const addCandidate = (
...current.authority_references,
...candidate.authority_references,
]),
- residual_unknown_ids: uniqueBy(
- [...current.residual_unknown_ids, ...candidate.residual_unknown_ids],
- (item) => item,
- ),
+ residual_unknown_ids: uniqueSorted([
+ ...current.residual_unknown_ids,
+ ...candidate.residual_unknown_ids,
+ ]),
// Each observation keeps its own unresolved authority and next steps.
unavailable_authority: uniqueSorted([
...current.unavailable_authority,
diff --git a/src/application/Setup.recovery.test.ts b/src/application/Setup.recovery.test.ts
index f6522eafe..34680d341 100644
--- a/src/application/Setup.recovery.test.ts
+++ b/src/application/Setup.recovery.test.ts
@@ -6,6 +6,10 @@ import { ConfigurationError } from "../domain/configurationErrors.js";
import { SUPPORTED_NODE_VERSION_PROSE } from "../domain/runtimeVersion.js";
import { FakeSetupHost, options } from "./Setup.fixture.js";
import { runSetup } from "./Setup.js";
+import {
+ parseLinuxDistribution,
+ type LinuxDistribution,
+} from "./LinuxHopper.js";
import type { SetupProgressEvent } from "./SetupTypes.js";
describe("setup workflow", () => {
@@ -347,3 +351,177 @@ describe("setup scoped readiness", () => {
});
});
});
+
+const unsupportedDebian = {
+ id: "debian",
+ versionId: "13",
+ packageFamily: "deb",
+ hopperSetupSupported: false,
+} as const;
+const supportedUbuntu = {
+ id: "ubuntu",
+ versionId: "24.04",
+ packageFamily: "deb",
+ hopperSetupSupported: true,
+} as const;
+const unsupportedLinux =
+ "Automated Hopper setup requires an x86_64 host running Ubuntu 24.04+, Fedora 41+, Nobara 44+, Arch Linux, CachyOS, or Omarchy; configure an existing supported provider instead.";
+const unhealthyManualClientHost = (
+ platform: NodeJS.Platform,
+ facts: {
+ readonly version?: string | undefined;
+ readonly distribution?: LinuxDistribution;
+ },
+) => {
+ const host = new FakeSetupHost(platform);
+ host.version = facts.version;
+ host.distribution = facts.distribution;
+ host.doctorHealthy = false;
+ host.clients = [
+ {
+ name: "grok_bot",
+ displayName: "Grok Bot",
+ configPath: "/fixture/home/.grokbot",
+ format: "unsupported",
+ },
+ ];
+ return host;
+};
+const manualClientSetup = {
+ ...options(true),
+ clientIds: ["grok_bot"],
+ installSkill: false,
+};
+const proposesHopper = async (host: FakeSetupHost) =>
+ (
+ await runSetup(
+ {
+ ...options(false),
+ proposeHopper: true,
+ dryRun: true,
+ clientIds: [],
+ installSkill: false,
+ },
+ host,
+ )
+ ).plannedActions.some(({ kind }) => kind === "install_hopper");
+
+describe("setup Hopper install eligibility", () => {
+ it.each([
+ {
+ label: "Windows",
+ platform: "win32",
+ refusal:
+ "REA supports Hopper on macOS and selected x86_64 Linux distributions.",
+ },
+ {
+ label: "macOS 11",
+ platform: "darwin",
+ version: "11.7",
+ refusal: "Upgrade to macOS 12 or newer.",
+ },
+ {
+ label: "macOS with an unknown version",
+ platform: "darwin",
+ version: undefined,
+ refusal: "Upgrade to macOS 12 or newer.",
+ },
+ {
+ label: "an unsupported Linux distribution",
+ platform: "linux",
+ distribution: unsupportedDebian,
+ refusal: unsupportedLinux,
+ },
+ {
+ label: "Ubuntu on arm64",
+ platform: "linux",
+ distribution: parseLinuxDistribution(
+ 'ID=ubuntu\nVERSION_ID="24.04"',
+ "arm64",
+ ),
+ refusal: unsupportedLinux,
+ },
+ {
+ label: "an unidentified Linux distribution",
+ platform: "linux",
+ refusal: unsupportedLinux,
+ },
+ ] as const)(
+ "neither offers nor accepts an unsupported Hopper installation on $label",
+ async ({ platform, refusal, ...facts }) => {
+ const host = unhealthyManualClientHost(platform, facts);
+
+ const advised = await runSetup(manualClientSetup, host);
+ expect(advised.status).toBe("needs_human");
+ expect(advised.remediation).not.toContain("--install-hopper");
+ expect(advised.remediation).toContain(
+ "Run rea doctor and apply each reported remediation.",
+ );
+ expect(advised.remediation).toContain("hosted computer");
+ expect(await proposesHopper(host)).toBe(false);
+
+ const requested = await runSetup(
+ { ...manualClientSetup, installHopper: true },
+ host,
+ );
+ expect(requested).toMatchObject({
+ status: "needs_human",
+ remediation: refusal,
+ appliedActions: [],
+ });
+ expect(host.hopperInstalls).toBe(0);
+ },
+ );
+
+ it.each([
+ { label: "macOS 14", platform: "darwin", version: "14.5" },
+ {
+ label: "a supported Linux distribution",
+ platform: "linux",
+ distribution: supportedUbuntu,
+ },
+ ] as const)(
+ "offers a Hopper installation that succeeds on $label",
+ async ({ platform, ...facts }) => {
+ const host = unhealthyManualClientHost(platform, facts);
+
+ const advised = await runSetup(manualClientSetup, host);
+ expect(advised.status).toBe("needs_human");
+ expect(advised.remediation).toContain(
+ "Rerun with --yes --install-hopper",
+ );
+ expect(advised.remediation).toContain("hosted computer");
+ expect(await proposesHopper(host)).toBe(true);
+
+ const followed = await runSetup(
+ { ...manualClientSetup, installHopper: true },
+ host,
+ );
+ expect(followed.appliedActions).toContain("installed_hopper");
+ expect(host.hopperInstalls).toBe(1);
+ },
+ );
+
+ it.each([
+ { version: "", installs: false },
+ { version: "14beta", installs: false },
+ { version: "12", installs: true },
+ { version: "12.0", installs: true },
+ ])(
+ "decides an explicit Hopper installation for macOS %j",
+ async ({ version, installs }) => {
+ const host = new FakeSetupHost("darwin");
+ host.version = version;
+
+ const result = await runSetup(options(true, true), host);
+
+ expect(result.appliedActions.includes("installed_hopper")).toBe(installs);
+ expect(host.hopperInstalls).toBe(installs ? 1 : 0);
+ if (!installs)
+ expect(result).toMatchObject({
+ status: "needs_human",
+ remediation: "Upgrade to macOS 12 or newer.",
+ });
+ },
+ );
+});
diff --git a/src/application/Setup.ts b/src/application/Setup.ts
index 3a5d99e6c..1a1432cb6 100644
--- a/src/application/Setup.ts
+++ b/src/application/Setup.ts
@@ -17,7 +17,11 @@ import {
} from "./SupportedClients.js";
import type { DoctorReport, DoctorScope } from "./Doctor.js";
import { configureDetectedClients } from "./SetupClients.js";
-import { discoverSetupState, planSetupActions } from "./SetupPlan.js";
+import {
+ discoverSetupState,
+ hopperInstallRefusal,
+ planSetupActions,
+} from "./SetupPlan.js";
import {
filterClientsNeedingConfigure,
hostRemediation,
@@ -105,7 +109,7 @@ const runSetupWorkflow = async (
...(await fail(error.remediation)),
code: "skill_install_failed",
});
- const unsupported = await hostRemediation(host, false);
+ const unsupported = hostRemediation(host);
if (unsupported !== undefined) return fail(unsupported);
const initialState = await host.initialSetupState(options.readinessScope);
let { hopperPath, providerEnvironment } = initialState;
@@ -226,11 +230,8 @@ const runSetupWorkflow = async (
});
plannedActions = planned.plannedActions;
if (planned.blocker !== undefined) return fail(planned.blocker);
- const hopperBlocker = await hostRemediation(
- host,
- planDiscovery.installHopper,
- );
- if (hopperBlocker !== undefined) return fail(hopperBlocker);
+ const hopperRefusal = hopperInstallRefusal(planDiscovery);
+ if (hopperRefusal !== undefined) return fail(hopperRefusal);
const planSelection = {
installHopper: planDiscovery.installHopper,
installSkill,
@@ -363,7 +364,8 @@ const runSetupWorkflow = async (
host.platform,
appliedActions.includes("installed_hopper"),
doctor.healthy,
- hopperPath,
+ // Offer --install-hopper only where the explicit installation gate accepts it.
+ hopperPath === undefined && planDiscovery.hopperInstall.supported,
),
hopperWarning,
manualRemediation,
@@ -524,12 +526,12 @@ const finalSetupRemediation = (
platform: NodeJS.Platform,
installedHopper: boolean,
healthy: boolean,
- hopperPath: string | undefined,
+ offerHopperInstall: boolean,
): string | undefined => {
if (platform === "darwin" && installedHopper)
return "Open Hopper, choose its demo mode or activate a license, then rerun rea doctor --json.";
if (healthy) return undefined;
- return hopperPath === undefined
+ return offerHopperInstall
? "Hopper is optional for non-Hopper providers. Rerun with --yes --install-hopper for deep native analysis."
: "Run rea doctor and apply each reported remediation.";
};
diff --git a/src/application/SetupHost.ts b/src/application/SetupHost.ts
index 9f6e2ceb7..63ef19616 100644
--- a/src/application/SetupHost.ts
+++ b/src/application/SetupHost.ts
@@ -21,7 +21,6 @@ import {
import { runDoctor, systemDoctorHost, type DoctorHost } from "./Doctor.js";
import {
installLinuxHopper,
- LINUX_HOPPER_SETUP_HOSTS,
LinuxHopperTemporaryCleanupOwner,
systemLinuxHopperInstallHost,
type LinuxHopperInstallHost,
@@ -121,25 +120,11 @@ export const filterClientsNeedingConfigure = async (
return detectedClients.filter((_, index) => needs[index]);
};
-export const hostRemediation = async (
- host: SetupHost,
- installHopper: boolean,
-): Promise<string | undefined> => {
- if (!supportsNodeVersion(host.nodeVersion))
- return `Install ${SUPPORTED_NODE_VERSION_PROSE} and rerun setup.`;
- if (!installHopper) return undefined;
- if (host.platform !== "darwin" && host.platform !== "linux")
- return "REA supports Hopper on macOS and selected x86_64 Linux distributions.";
- if (host.platform === "darwin") {
- const version = await host.macosVersion();
- return version === undefined || major(version) < 12
- ? "Upgrade to macOS 12 or newer."
- : undefined;
- }
- if ((await host.linuxDistribution())?.hopperSetupSupported === true)
- return undefined;
- return `Automated Hopper setup requires ${LINUX_HOPPER_SETUP_HOSTS}; configure an existing supported provider instead.`;
-};
+/** Refuse a Node.js runtime REA does not support before any setup work. */
+export const hostRemediation = (host: SetupHost): string | undefined =>
+ supportsNodeVersion(host.nodeVersion)
+ ? undefined
+ : `Install ${SUPPORTED_NODE_VERSION_PROSE} and rerun setup.`;
/** Production setup effects for Hopper, agent configuration, and the canonical skill directory. */
export const systemSetupHost = (
@@ -482,8 +467,6 @@ export const detectClients = async (
return detected;
};
-const major = (version: string): number =>
- Number.parseInt(version.split(".")[0] ?? "0", 10);
const clientEvidencePresent = async (client: SetupClient): Promise<boolean> => {
for (const path of clientEvidencePaths(client))
if (await exists(path)) return true;
diff --git a/src/application/SetupPlan.ts b/src/application/SetupPlan.ts
index 40b0035df..7a8405c12 100644
--- a/src/application/SetupPlan.ts
+++ b/src/application/SetupPlan.ts
@@ -1,6 +1,10 @@
import { classifyClientRegistrationCommand } from "./ClientRegistrationIdentity.js";
import type { LinuxPackageFamily } from "./HopperReleaseFeed.js";
-import { linuxHopperInstallDisclosure } from "./LinuxHopper.js";
+import {
+ linuxHopperInstallDisclosure,
+ LINUX_HOPPER_SETUP_HOSTS,
+ type LinuxDistribution,
+} from "./LinuxHopper.js";
import type { SkillDestination } from "./SetupSkill.js";
import { macHopperInstallDisclosure } from "./MacHopper.js";
import { macHopperUserApplicationPath } from "./MacHopperPaths.js";
@@ -21,10 +25,16 @@ import type { DoctorReport } from "./Doctor.js";
import { compareUnicodeCodePoints } from "../domain/unicodeCodePointOrder.js";
import { CURRENT_ENTRYPOINT_PATH } from "../process/CurrentEntrypointPath.js";
+/** Whether automated Hopper installation can run on this host, and why not. */
+export type HopperInstallEligibility =
+ | { readonly supported: true }
+ | { readonly supported: false; readonly remediation: string };
+
/** Read-only setup facts shared by client selection and preflight. */
export interface SetupDiscovery {
readonly initialDoctor: Awaited<ReturnType<SetupHost["doctor"]>>;
readonly installHopper: boolean;
+ readonly hopperInstall: HopperInstallEligibility;
readonly clients: readonly SetupClient[];
readonly detectedClientIds: readonly string[];
readonly defaultClientIds: readonly string[];
@@ -54,14 +64,16 @@ export const discoverSetupState = async (input: {
input.host.platform === "linux"
? await input.host.linuxDistribution()
: undefined;
- const hopperInstallSupported =
- (input.host.platform === "darwin" &&
- majorVersion((await input.host.macosVersion()) ?? "0") >= 12) ||
- (input.host.platform === "linux" &&
- linuxDistribution?.hopperSetupSupported === true);
+ const hopperInstall = hopperInstallEligibility(
+ input.host.platform,
+ input.host.platform === "darwin"
+ ? await input.host.macosVersion()
+ : undefined,
+ linuxDistribution,
+ );
const installHopper =
input.forceHopperInstall ||
- (hopperInstallSupported &&
+ (hopperInstall.supported &&
input.proposeHopper &&
(!input.providerConfigured || linuxHopperRepairNeeded));
const [clients, detectedClients] = await Promise.all([
@@ -118,6 +130,7 @@ export const discoverSetupState = async (input: {
return {
initialDoctor,
installHopper,
+ hopperInstall,
clients,
detectedClientIds: [...detectedIds],
defaultClientIds,
@@ -362,8 +375,47 @@ const linuxDisclosure = (family: LinuxPackageFamily) => {
};
};
-const majorVersion = (version: string): number =>
- Number.parseInt(version.split(".")[0] ?? "0", 10);
+/** Refuse a selected Hopper installation this host cannot run, before mutation. */
+export const hopperInstallRefusal = (
+ discovery: Pick<SetupDiscovery, "installHopper" | "hopperInstall">,
+): string | undefined =>
+ discovery.installHopper && !discovery.hopperInstall.supported
+ ? discovery.hopperInstall.remediation
+ : undefined;
+
+/**
+ * Decide automated Hopper installation once from the host facts read during
+ * discovery, so proposals, explicit requests, and recovery advice agree. An
+ * unknown or unparseable macOS version and an unidentified Linux distribution
+ * are not eligible.
+ */
+const hopperInstallEligibility = (
+ platform: NodeJS.Platform,
+ macosVersion: string | undefined,
+ linuxDistribution: LinuxDistribution | undefined,
+): HopperInstallEligibility => {
+ if (platform === "darwin") {
+ const major =
+ macosVersion === undefined
+ ? undefined
+ : /^(\d+)(?:\.|$)/u.exec(macosVersion)?.[1];
+ return major !== undefined && Number(major) >= 12
+ ? { supported: true }
+ : { supported: false, remediation: "Upgrade to macOS 12 or newer." };
+ }
+ if (platform === "linux")
+ return linuxDistribution?.hopperSetupSupported === true
+ ? { supported: true }
+ : {
+ supported: false,
+ remediation: `Automated Hopper setup requires ${LINUX_HOPPER_SETUP_HOSTS}; configure an existing supported provider instead.`,
+ };
+ return {
+ supported: false,
+ remediation:
+ "REA supports Hopper on macOS and selected x86_64 Linux distributions.",
+ };
+};
const clientConfigurationDetail = (
client: SetupClient,
diff --git a/src/application/pcap/PcapAnalysisService.test.ts b/src/application/pcap/PcapAnalysisService.test.ts
index b4ab7950f..b19295e42 100644
--- a/src/application/pcap/PcapAnalysisService.test.ts
+++ b/src/application/pcap/PcapAnalysisService.test.ts
@@ -44,9 +44,15 @@ const client = {
tshark_command: "/selected/tshark",
tshark_source: "environment",
tshark_version: "4.6.6",
+ tshark_resolved_path: null,
+ tshark_sha256: null,
+ tshark_identity_status: "unresolved",
capinfos_command: "/selected/capinfos",
capinfos_source: "environment",
capinfos_version: "4.6.6",
+ capinfos_resolved_path: null,
+ capinfos_sha256: null,
+ capinfos_identity_status: "unresolved",
};
const capture = {
client,
diff --git a/src/domain/browserScenarioDiff.test.ts b/src/domain/browserScenarioDiff.test.ts
index acc9d0ee6..e1ad0d375 100644
--- a/src/domain/browserScenarioDiff.test.ts
+++ b/src/domain/browserScenarioDiff.test.ts
@@ -1190,6 +1190,7 @@ const storageScenarioCapture = (
storage: {
state: "captured",
value: {
+ fingerprint_version: 2,
cookies: [],
local_storage: [],
session_storage: [],
diff --git a/src/ida/IdaSessionClient.test.ts b/src/ida/IdaSessionClient.test.ts
index 0de23b309..52947d673 100644
--- a/src/ida/IdaSessionClient.test.ts
+++ b/src/ida/IdaSessionClient.test.ts
@@ -579,10 +579,9 @@ describe("attached IDA regex supervision", () => {
pattern: "!$",
mode: "regex",
});
- expect(recovered.ok && recovered.value.result).toHaveLength(1);
- expect(recovered.ok && recovered.value.limitations).toContain(
- "Regex mode uses ECMAScript Unicode semantics in a cancellable worker with a 5-second matching deadline; matching failure leaves the service available.",
- );
+ expect(recovered.ok && recovered.value.result).toEqual([
+ expect.objectContaining({ address: "0x3000", value }),
+ ]);
} finally {
await client.close();
}