Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
627c2682f1 | ||
|
|
69e097a8ca |
@@ -86,8 +86,22 @@ harm_rank,location,trigger,current_copy,user_risk,proposed_replacement,implement
|
|||||||
77,install.sh:node missing,node is absent,"Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+ is required; install it from nodejs.org and retry.",Low risk; exact versions and recovery,Keep current copy,unchanged,verified by shell branch inspection
|
77,install.sh:node missing,node is absent,"Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+ is required; install it from nodejs.org and retry.",Low risk; exact versions and recovery,Keep current copy,unchanged,verified by shell branch inspection
|
||||||
78,install.sh:npm missing,npm is absent,npm is required; install it with Node.js and retry.,Low risk; exact recovery,Keep current copy,unchanged,verified by shell branch inspection
|
78,install.sh:npm missing,npm is absent,npm is required; install it with Node.js and retry.,Low risk; exact recovery,Keep current copy,unchanged,verified by shell branch inspection
|
||||||
79,install.sh:node unreadable,node exists but does not report a parseable version,could not determine the active Node.js version.,No cause-local recovery,"The active Node.js version could not be read. Check that node works and is on PATH, then retry.",implemented,verified by exact unreadable-Node-version installer test
|
79,install.sh:node unreadable,node exists but does not report a parseable version,could not determine the active Node.js version.,No cause-local recovery,"The active Node.js version could not be read. Check that node works and is on PATH, then retry.",implemented,verified by exact unreadable-Node-version installer test
|
||||||
80,install.sh:Node 22 floor,Node 22 minor version is below 19,"Node.js VERSION is unsupported; use Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+.",Low risk; exact detected version and supported alternatives,Keep current copy,unchanged,verified by exact installer test using Node 20 and branch inspection
|
80,install.sh:Node 22 floor,Node 22 minor version is below 19,"Node.js VERSION is unsupported; use Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+.",No install guidance; operator must guess between nvm/fnm/system packages/nodejs.org,"Node.js VERSION is unsupported.
|
||||||
81,install.sh:Node 24 floor,Node 24 minor version is below 11,"Node.js VERSION is unsupported; use Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+.",Low risk; exact detected version and floor,Keep current copy,unchanged,verified by shell branch inspection
|
|
||||||
|
REA requires Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+. Install one via:
|
||||||
|
nvm: nvm install 24 && nvm use 24 (https://github.com/nvm-sh/nvm)
|
||||||
|
fnm: fnm install 24 && fnm use 24 (https://github.com/Schniz/fnm)
|
||||||
|
Direct download for OS/ARCH:
|
||||||
|
https://nodejs.org/dist/latest-v24.x/ (grab the OS-ARCH tarball)
|
||||||
|
Then rerun this installer.",implemented,verified by exact installer test using Node 20 against the `linux/x64` fake host and by shell branch inspection
|
||||||
|
81,install.sh:Node 24 floor,Node 24 minor version is below 11,"Node.js VERSION is unsupported; use Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+.",No install guidance; operator must guess between nvm/fnm/system packages/nodejs.org,"Node.js VERSION is unsupported.
|
||||||
|
|
||||||
|
REA requires Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+. Install one via:
|
||||||
|
nvm: nvm install 24 && nvm use 24 (https://github.com/nvm-sh/nvm)
|
||||||
|
fnm: fnm install 24 && fnm use 24 (https://github.com/Schniz/fnm)
|
||||||
|
Direct download for OS/ARCH:
|
||||||
|
https://nodejs.org/dist/latest-v24.x/ (grab the OS-ARCH tarball)
|
||||||
|
Then rerun this installer.",implemented,verified by shell branch inspection
|
||||||
82,install.sh:version syntax,Explicit version is not exact semantic version,version must be an exact semantic version.,Low risk; exact correction,Keep current copy,unchanged,verified by shell branch inspection
|
82,install.sh:version syntax,Explicit version is not exact semantic version,version must be an exact semantic version.,Low risk; exact correction,Keep current copy,unchanged,verified by shell branch inspection
|
||||||
83,install.sh:release lookup,Latest GitHub release request fails,could not resolve the latest GitHub release.,No fallback despite supporting pinned versions,"The latest REA release could not be resolved. Check network access or pass --version VERSION, then retry.",implemented,verified by exact release-lookup installer test
|
83,install.sh:release lookup,Latest GitHub release request fails,could not resolve the latest GitHub release.,No fallback despite supporting pinned versions,"The latest REA release could not be resolved. Check network access or pass --version VERSION, then retry.",implemented,verified by exact release-lookup installer test
|
||||||
84,install.sh:release response,Latest release response is not valid expected JSON,Node JSON parser stack followed by the safe release-response message,Leaks a parser stack and buries recovery guidance,The release response was invalid. Retry later or pass --version VERSION.,implemented,verified by exact malformed-release test with parser stderr suppressed
|
84,install.sh:release response,Latest release response is not valid expected JSON,Node JSON parser stack followed by the safe release-response message,Leaks a parser stack and buries recovery guidance,The release response was invalid. Retry later or pass --version VERSION.,implemented,verified by exact malformed-release test with parser stderr suppressed
|
||||||
|
|||||||
|
+33
-1
@@ -25,6 +25,38 @@ fail() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Resolve the current host's Node.js tarball label pair; a label we cannot map
|
||||||
|
# is kept verbatim so the operator can still read it. Falls back on the raw
|
||||||
|
# `uname` outputs rather than inventing a label the Node.js release index does
|
||||||
|
# not publish, so a mismatch is obvious instead of silently wrong.
|
||||||
|
node_host_labels() {
|
||||||
|
case "$(uname -m)" in
|
||||||
|
arm64|aarch64) node_arch_label="arm64" ;;
|
||||||
|
x86_64|amd64) node_arch_label="x64" ;;
|
||||||
|
*) node_arch_label="$(uname -m)" ;;
|
||||||
|
esac
|
||||||
|
case "$(uname -s)" in
|
||||||
|
Darwin) node_os_label="darwin" ;;
|
||||||
|
Linux) node_os_label="linux" ;;
|
||||||
|
*) node_os_label="$(uname -s | tr '[:upper:]' '[:lower:]')" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# Exit with actionable remediation when the active Node.js is unsupported.
|
||||||
|
# The engine floor stays in sync with package.json#engines.node — change both.
|
||||||
|
fail_node_version() {
|
||||||
|
local observed="$1"
|
||||||
|
node_host_labels
|
||||||
|
printf 'REA installation failed: Node.js %s is unsupported.\n\n' "$observed" >&2
|
||||||
|
printf 'REA requires Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+. Install one via:\n' >&2
|
||||||
|
printf ' nvm: nvm install 24 && nvm use 24 (https://github.com/nvm-sh/nvm)\n' >&2
|
||||||
|
printf ' fnm: fnm install 24 && fnm use 24 (https://github.com/Schniz/fnm)\n' >&2
|
||||||
|
printf ' Direct download for %s/%s:\n' "$node_os_label" "$node_arch_label" >&2
|
||||||
|
printf ' https://nodejs.org/dist/latest-v24.x/ (grab the %s-%s tarball)\n' "$node_os_label" "$node_arch_label" >&2
|
||||||
|
printf 'Then rerun this installer.\n' >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
Usage: install.sh [--version VERSION] [--dry-run] [--no-setup] [--no-prompt] [--verbose]
|
Usage: install.sh [--version VERSION] [--dry-run] [--no-setup] [--no-prompt] [--verbose]
|
||||||
@@ -78,7 +110,7 @@ main() {
|
|||||||
[[ "$node_major" =~ ^[0-9]+$ && "$node_minor" =~ ^[0-9]+$ ]] || fail "the active Node.js version could not be read. Check that node works and is on PATH, then retry."
|
[[ "$node_major" =~ ^[0-9]+$ && "$node_minor" =~ ^[0-9]+$ ]] || fail "the active Node.js version could not be read. Check that node works and is on PATH, then retry."
|
||||||
if ! [[ "$_node_patch" =~ ^[0-9]+(\+[0-9A-Za-z.-]+)?$ ]] ||
|
if ! [[ "$_node_patch" =~ ^[0-9]+(\+[0-9A-Za-z.-]+)?$ ]] ||
|
||||||
! ((node_major == 22 && node_minor >= 19 || node_major == 24 && node_minor >= 11 || node_major >= 26)); then
|
! ((node_major == 22 && node_minor >= 19 || node_major == 24 && node_minor >= 11 || node_major >= 26)); then
|
||||||
fail "Node.js $node_version is unsupported; use Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+."
|
fail_node_version "$node_version"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$version" ]]; then
|
if [[ -n "$version" ]]; then
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import { requireFunctionDossierOracle } from "../../dist/application/RealHopperAssertions.js";
|
|
||||||
|
/**
|
||||||
|
* `requireFunctionDossierOracle` is only used inside `verifyRealHopperFixture`,
|
||||||
|
* which runs against the real Hopper bridge after `build:cached`. Loading it
|
||||||
|
* lazily keeps this module importable from `test:fast` (which docs promise to
|
||||||
|
* run "without build" — see docs/testing.md § test scripts) so that mock-only
|
||||||
|
* callers such as `requireCurrentDocument` and `resolveFixtureProcedure` do
|
||||||
|
* not require `dist/`.
|
||||||
|
*/
|
||||||
|
const loadFunctionDossierOracle = () =>
|
||||||
|
import("../../dist/application/RealHopperAssertions.js").then(
|
||||||
|
(module) => module.requireFunctionDossierOracle,
|
||||||
|
);
|
||||||
|
|
||||||
/** Require truthful tri-state permissions from real Hopper memory regions. */
|
/** Require truthful tri-state permissions from real Hopper memory regions. */
|
||||||
export const requireTruthfulMemoryRegions = (segments) => {
|
export const requireTruthfulMemoryRegions = (segments) => {
|
||||||
@@ -87,6 +99,7 @@ export async function verifyRealHopperFixture({
|
|||||||
oracle,
|
oracle,
|
||||||
normalizedResult,
|
normalizedResult,
|
||||||
}) {
|
}) {
|
||||||
|
const requireFunctionDossierOracle = await loadFunctionDossierOracle();
|
||||||
const main = await resolveFixtureProcedure(
|
const main = await resolveFixtureProcedure(
|
||||||
client,
|
client,
|
||||||
options,
|
options,
|
||||||
|
|||||||
@@ -2,10 +2,17 @@ import { execFile } from "node:child_process";
|
|||||||
import { lstat } from "node:fs/promises";
|
import { lstat } from "node:fs/promises";
|
||||||
import { promisify } from "node:util";
|
import { promisify } from "node:util";
|
||||||
import { Ajv2020 } from "ajv/dist/2020.js";
|
import { Ajv2020 } from "ajv/dist/2020.js";
|
||||||
import {
|
|
||||||
requireMcpLifecycleResult,
|
/**
|
||||||
sortVerifierNames,
|
* `mcp-verifier-results.mjs` reaches into `dist/` at module load, so eager
|
||||||
} from "./mcp-verifier-results.mjs";
|
* importing it propagates that build dependency to every consumer in this
|
||||||
|
* file. `verifyCompleteToolCatalog` is the only consumer, so we lazy-load
|
||||||
|
* the module there and keep the other helpers (`exec`, `run`, `json`,
|
||||||
|
* `pathExists`) usable from `test:fast` callers that only need `dist/`-free
|
||||||
|
* utilities — see docs/testing.md § test scripts, which promises `test:fast`
|
||||||
|
* runs "without build".
|
||||||
|
*/
|
||||||
|
const loadMcpVerifierResults = () => import("./mcp-verifier-results.mjs");
|
||||||
|
|
||||||
/** Promisified child_process execution helper. */
|
/** Promisified child_process execution helper. */
|
||||||
export const exec = promisify(execFile);
|
export const exec = promisify(execFile);
|
||||||
@@ -35,6 +42,8 @@ export const json = (text) => JSON.parse(text);
|
|||||||
|
|
||||||
/** Verify schema validity and that the MCP catalog matches session metadata. */
|
/** Verify schema validity and that the MCP catalog matches session metadata. */
|
||||||
export const verifyCompleteToolCatalog = async (client, options) => {
|
export const verifyCompleteToolCatalog = async (client, options) => {
|
||||||
|
const { requireMcpLifecycleResult, sortVerifierNames } =
|
||||||
|
await loadMcpVerifierResults();
|
||||||
const listed = await client.listTools(undefined, options);
|
const listed = await client.listTools(undefined, options);
|
||||||
const ajv = new Ajv2020({ strict: false, validateFormats: false });
|
const ajv = new Ajv2020({ strict: false, validateFormats: false });
|
||||||
for (const tool of listed.tools) {
|
for (const tool of listed.tools) {
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ it("reads a bounded logcat dump with the caller count and buffer", async () => {
|
|||||||
const { binary } = await writeAdbStub(
|
const { binary } = await writeAdbStub(
|
||||||
shellStub({
|
shellStub({
|
||||||
logcat:
|
logcat:
|
||||||
"08-10 13:00:00.000 I/Tag( 123): first\\n08-10 13:00:01.000 I/Tag( 123): second\\n",
|
"08-10 13:00:00.000 I/Tag( 123): first\n08-10 13:00:01.000 I/Tag( 123): second\n",
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
const result = await evidenceResult(providerOver(binary), {
|
const result = await evidenceResult(providerOver(binary), {
|
||||||
@@ -903,7 +903,7 @@ it("resolves packages by case-insensitive substring", async () => {
|
|||||||
const { binary } = await writeAdbStub(
|
const { binary } = await writeAdbStub(
|
||||||
shellStub({
|
shellStub({
|
||||||
"pm:list":
|
"pm:list":
|
||||||
"package:/data/app/x/base.apk=com.whatsapp\\npackage:/data/app/y/base.apk=com.whatsapp.w4b\\npackage:/data/app/z/base.apk=com.example\\n",
|
"package:/data/app/x/base.apk=com.whatsapp\npackage:/data/app/y/base.apk=com.whatsapp.w4b\npackage:/data/app/z/base.apk=com.example\n",
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
const result = await evidenceResult(providerOver(binary), {
|
const result = await evidenceResult(providerOver(binary), {
|
||||||
@@ -1111,10 +1111,11 @@ it("quotes caller text before adb joins the remote shell command", async () => {
|
|||||||
const { binary, root } = await writeAdbStub(
|
const { binary, root } = await writeAdbStub(
|
||||||
(root) => `if [ "$1" = "version" ]; then ${VERSION_BLOCK}; exit 0; fi
|
(root) => `if [ "$1" = "version" ]; then ${VERSION_BLOCK}; exit 0; fi
|
||||||
shift 3
|
shift 3
|
||||||
# Model adb's remote command joining, then execute the resulting shell string.
|
# Model adb's remote command joining, then let the device shell parse the
|
||||||
printf '#!/bin/sh\nprintf "%%s" "$@" > "${join(root, "observed")}"\n' > "${join(root, "ls")}"
|
# joined string. Its \`sh\` records the arguments it receives.
|
||||||
chmod +x "${join(root, "ls")}"
|
printf '#!/bin/sh\nprintf "%%s\\\\000" "$@" > "${join(root, "observed")}"\n' > "${join(root, "sh")}"
|
||||||
PATH="${root}:$PATH" sh -c "$*"
|
chmod +x "${join(root, "sh")}"
|
||||||
|
PATH="${root}:$PATH" /bin/sh -c "$*"
|
||||||
`,
|
`,
|
||||||
);
|
);
|
||||||
const value = `/sdcard/a 'quoted'; touch ${join(root, "injected")}`;
|
const value = `/sdcard/a 'quoted'; touch ${join(root, "injected")}`;
|
||||||
@@ -1122,7 +1123,8 @@ PATH="${root}:$PATH" sh -c "$*"
|
|||||||
operation: "list_adb_directory",
|
operation: "list_adb_directory",
|
||||||
input: { serial: "device", device_path: value },
|
input: { serial: "device", device_path: value },
|
||||||
});
|
});
|
||||||
expect(await readFile(join(root, "observed"), "utf8")).toContain(value);
|
const observed = (await readFile(join(root, "observed"), "utf8")).split("\0");
|
||||||
|
expect(observed.slice(2, 4)).toEqual(["rea-list-directory", value]);
|
||||||
await expect(readFile(join(root, "injected"))).rejects.toThrow();
|
await expect(readFile(join(root, "injected"))).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,19 @@ import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
|||||||
|
|
||||||
const execFileAsync = promisify(execFile);
|
const execFileAsync = promisify(execFile);
|
||||||
|
|
||||||
|
// install.sh:fail_node_version emits this recovery block verbatim. The fake
|
||||||
|
// `uname` in createFixture reports `x86_64` / `Linux`, so the host labels
|
||||||
|
// resolve to `linux/x64`.
|
||||||
|
const UNSUPPORTED_NODE_RECOVERY_LINUX_X64 =
|
||||||
|
"REA installation failed: Node.js 20.0.0 is unsupported.\n" +
|
||||||
|
"\n" +
|
||||||
|
"REA requires Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+. Install one via:\n" +
|
||||||
|
" nvm: nvm install 24 && nvm use 24 (https://github.com/nvm-sh/nvm)\n" +
|
||||||
|
" fnm: fnm install 24 && fnm use 24 (https://github.com/Schniz/fnm)\n" +
|
||||||
|
" Direct download for linux/x64:\n" +
|
||||||
|
" https://nodejs.org/dist/latest-v24.x/ (grab the linux-x64 tarball)\n" +
|
||||||
|
"Then rerun this installer.\n";
|
||||||
|
|
||||||
describe("curl installer scenarios", { timeout: 20_000 }, () => {
|
describe("curl installer scenarios", { timeout: 20_000 }, () => {
|
||||||
it("installs only a pinned REA CLI with closed stdin", async () => {
|
it("installs only a pinned REA CLI with closed stdin", async () => {
|
||||||
const fixture = await createFixture();
|
const fixture = await createFixture();
|
||||||
@@ -87,7 +100,7 @@ describe("curl installer scenarios", { timeout: 20_000 }, () => {
|
|||||||
"unsupported Node",
|
"unsupported Node",
|
||||||
["--version", "0.3.0"],
|
["--version", "0.3.0"],
|
||||||
{ FAKE_NODE_VERSION: "20.0.0" },
|
{ FAKE_NODE_VERSION: "20.0.0" },
|
||||||
"REA installation failed: Node.js 20.0.0 is unsupported; use Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+.\n",
|
UNSUPPORTED_NODE_RECOVERY_LINUX_X64,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"unreadable Node version",
|
"unreadable Node version",
|
||||||
|
|||||||
Reference in New Issue
Block a user