[GH-ISSUE #7595] [Bug] WABT relative-directory error omits the supplied selection #4526

Open
opened 2026-10-31 00:50:30 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @coygeek on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/7595

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Provider or capability discovery

Observed behavior

Running node scripts/rea.mjs inspect-wasm-artifact "$module" --format json with REA_WABT_BIN_DIRECTORY=wabt/bin correctly refuses the relative tool directory, but the returned error contains no wabt/bin value. Its remediation refers to a reported tool path even though this error reports none.

The command exits 1 with empty stderr. Selecting a nonexistent absolute directory instead also exits 1, but its error preserves the selected location in the missing-executable message.

Reproduction

  1. From the built source baseline below, put Node.js 24.22.1 on PATH. Run this inline script with Python 3. It creates its own empty WASM module, isolates writable state, executes the CLI, and deletes its fixtures when finished. No WABT installation is required.
python3 -I - <<'PYTHON'
import json, os, pathlib, subprocess, tempfile
with tempfile.TemporaryDirectory(prefix="wabt-selection-") as directory:
    root = pathlib.Path(directory).resolve()
    env = {"PATH": os.environ["PATH"]}
    for key in ("HOME", "XDG_CONFIG_HOME", "XDG_CACHE_HOME",
                "XDG_DATA_HOME", "XDG_STATE_HOME", "TMPDIR"):
        selected = root / key.lower()
        selected.mkdir()
        env[key] = str(selected)
    module = root / "empty.wasm"
    module.write_bytes(bytes.fromhex("0061736d01000000"))
    for attempt in range(2):
        for value in ("wabt/bin", str(root / "missing-wabt")):
            result = subprocess.run(
                ["node", "scripts/rea.mjs", "inspect-wasm-artifact",
                 str(module), "--format", "json"],
                env=env | {"REA_WABT_BIN_DIRECTORY": value},
                capture_output=True, text=True, timeout=30)
            print(json.dumps({"attempt": attempt + 1,
                              "relative": value == "wabt/bin",
                              "exit": result.returncode,
                              "value_returned": value in result.stdout + result.stderr,
                              "stderr": result.stderr}))
            print(result.stdout, end="")
PYTHON
  1. Both relative attempts print exit: 1, value_returned: false, and empty stderr. Both absolute missing-directory controls print exit: 1, value_returned: true, and empty stderr. Each case reproduced twice with this script; an earlier independent fixture run produced the same results twice per case.

Expected behavior

Preserve the supplied directory value when explaining its rejection, while retaining the absolute-path requirement and capability refusal. The repository's caller-input invariant explicitly includes paths. The WASM guide also tells callers to correct the reported directory. A message or structured diagnostic identifying wabt/bin would retain that selection without changing admission behavior.

Impact and scope

P3 under triage/v1: a diagnostic value is omitted and the recovery text refers to a path that is absent. The error still names the setting, absolute-path constraint, and shell/MCP configuration repair boundary. No consequential analysis failure beyond the correct refusal of invalid configuration was demonstrated. Callers can inspect their launch configuration to recover the selected spelling.

Observed through the CLI on macOS arm64. MCP projection, other operating systems, valid real-tool inspection, and effects on agent recovery success were not exercised.

REA version

Exact node scripts/rea.mjs --version stdout:

6.8.0

Source baseline: 65f1c447344a423fa2785847dbcea1e9a9e2454a.

Runtime and platform

Node.js v24.22.1; macOS 27.0.1; arm64. No WABT tool was needed or executed.

Target and artifact context

An independently generated 8-byte empty WebAssembly module, hexadecimal 0061736d01000000. Source inspection places this configuration refusal before module reading; no module-validation claim follows from it.

Interface

CLI

Earliest failure stage

Setup or provider admission

Relevant output or evidence

The relative selection returned this complete JSON document on stdout, with exit 1 and empty stderr:

{"code":"capability_unavailable","category":"unsupported_provider","message":"REA_WABT_BIN_DIRECTORY must be an absolute tool directory.","retryable":false,"remediation":{"action":"Set absolute REA_WABT_BIN_DIRECTORY to a directory that contains wasm-validate, wasm-objdump and wasm2wat from WABT 1.0.42; each --version must report 1.0.42 on stdout with empty stderr. Correct the reported tool path, access or release before retrying, not the WASM input. Set this in the shell for the next CLI call, or in the MCP server launch environment and restart that server; a shell export does not update a running MCP server. Do not repeat the unchanged call or install tools implicitly."},"details":{"provider_id":"wabt-artifact","operation":"inspect_wasm_artifact","reason":"REA_WABT_BIN_DIRECTORY must be an absolute tool directory."}}

The relative string is absent from every field. In the absolute missing-directory control, the message instead contains the selected directory followed by /wasm-validate in its realpath error.

At the stated baseline, AGENTS.md:13 requires preservation of caller-selected paths. docs/wasm-artifacts.md:21-38 establishes the absolute-directory requirement and configuration recovery guidance; its promise of tool/version diagnostic fields specifically applies to rejected version probes.

The supported entry point is registered in src/cli/wasmCommands.ts:50-89, reaches the service in src/application/wasm/WasmArtifactService.ts:33-52, and uses the environment-backed provider constructed by src/composition/wasm.ts:7-11. src/wasm/WabtArtifactProvider.ts:216-220 rejects the directory before tool selection without including the value. src/wasm/WabtFailures.ts:240-250 projects that reason and shared recovery text without adding the selected directory.

Typed outcome or recovery expected

Continue returning capability_unavailable with retryable: false. Include the rejected directory value in the message or details. This early refusal does not need executable/version-probe facts that have not yet been collected.

Analysis or suspected cause

Source-derived explanation: the relative-directory guard constructs an error containing only the setting name and constraint. The configuration failure wrapper has no retained selection to add. Version-probe attribution is created later, at src/wasm/WabtArtifactProvider.ts:339-346, so those diagnostics cannot cover this branch.

Additional context

Related closed issue #5767 and merged PR #5768 addressed rejected version-probe output/identity and configuration recovery instructions. The issue's closure comment attributes those fixes to that PR. Its diff leaves the relative-directory guard unchanged, although its validation notes mention probing relative configuration. This report concerns the omitted value in that earlier branch; no previously working value-retention behavior was established.

Originally created by @coygeek on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/7595 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Provider or capability discovery ### Observed behavior Running `node scripts/rea.mjs inspect-wasm-artifact "$module" --format json` with `REA_WABT_BIN_DIRECTORY=wabt/bin` correctly refuses the relative tool directory, but the returned error contains no `wabt/bin` value. Its remediation refers to a reported tool path even though this error reports none. The command exits 1 with empty stderr. Selecting a nonexistent absolute directory instead also exits 1, but its error preserves the selected location in the missing-executable message. ### Reproduction 1. From the built source baseline below, put Node.js 24.22.1 on PATH. Run this inline script with Python 3. It creates its own empty WASM module, isolates writable state, executes the CLI, and deletes its fixtures when finished. No WABT installation is required. ```sh python3 -I - <<'PYTHON' import json, os, pathlib, subprocess, tempfile with tempfile.TemporaryDirectory(prefix="wabt-selection-") as directory: root = pathlib.Path(directory).resolve() env = {"PATH": os.environ["PATH"]} for key in ("HOME", "XDG_CONFIG_HOME", "XDG_CACHE_HOME", "XDG_DATA_HOME", "XDG_STATE_HOME", "TMPDIR"): selected = root / key.lower() selected.mkdir() env[key] = str(selected) module = root / "empty.wasm" module.write_bytes(bytes.fromhex("0061736d01000000")) for attempt in range(2): for value in ("wabt/bin", str(root / "missing-wabt")): result = subprocess.run( ["node", "scripts/rea.mjs", "inspect-wasm-artifact", str(module), "--format", "json"], env=env | {"REA_WABT_BIN_DIRECTORY": value}, capture_output=True, text=True, timeout=30) print(json.dumps({"attempt": attempt + 1, "relative": value == "wabt/bin", "exit": result.returncode, "value_returned": value in result.stdout + result.stderr, "stderr": result.stderr})) print(result.stdout, end="") PYTHON ``` 2. Both relative attempts print `exit: 1`, `value_returned: false`, and empty `stderr`. Both absolute missing-directory controls print `exit: 1`, `value_returned: true`, and empty `stderr`. Each case reproduced twice with this script; an earlier independent fixture run produced the same results twice per case. ### Expected behavior Preserve the supplied directory value when explaining its rejection, while retaining the absolute-path requirement and capability refusal. The repository's caller-input invariant explicitly includes paths. The WASM guide also tells callers to correct the reported directory. A message or structured diagnostic identifying `wabt/bin` would retain that selection without changing admission behavior. ### Impact and scope P3 under triage/v1: a diagnostic value is omitted and the recovery text refers to a path that is absent. The error still names the setting, absolute-path constraint, and shell/MCP configuration repair boundary. No consequential analysis failure beyond the correct refusal of invalid configuration was demonstrated. Callers can inspect their launch configuration to recover the selected spelling. Observed through the CLI on macOS arm64. MCP projection, other operating systems, valid real-tool inspection, and effects on agent recovery success were not exercised. ### REA version Exact `node scripts/rea.mjs --version` stdout: ```text 6.8.0 ``` Source baseline: `65f1c447344a423fa2785847dbcea1e9a9e2454a`. ### Runtime and platform Node.js v24.22.1; macOS 27.0.1; arm64. No WABT tool was needed or executed. ### Target and artifact context An independently generated 8-byte empty WebAssembly module, hexadecimal `0061736d01000000`. Source inspection places this configuration refusal before module reading; no module-validation claim follows from it. ### Interface CLI ### Earliest failure stage Setup or provider admission ### Relevant output or evidence The relative selection returned this complete JSON document on stdout, with exit 1 and empty stderr: ```json {"code":"capability_unavailable","category":"unsupported_provider","message":"REA_WABT_BIN_DIRECTORY must be an absolute tool directory.","retryable":false,"remediation":{"action":"Set absolute REA_WABT_BIN_DIRECTORY to a directory that contains wasm-validate, wasm-objdump and wasm2wat from WABT 1.0.42; each --version must report 1.0.42 on stdout with empty stderr. Correct the reported tool path, access or release before retrying, not the WASM input. Set this in the shell for the next CLI call, or in the MCP server launch environment and restart that server; a shell export does not update a running MCP server. Do not repeat the unchanged call or install tools implicitly."},"details":{"provider_id":"wabt-artifact","operation":"inspect_wasm_artifact","reason":"REA_WABT_BIN_DIRECTORY must be an absolute tool directory."}} ``` The relative string is absent from every field. In the absolute missing-directory control, the message instead contains the selected directory followed by `/wasm-validate` in its `realpath` error. At the stated baseline, `AGENTS.md:13` requires preservation of caller-selected paths. `docs/wasm-artifacts.md:21-38` establishes the absolute-directory requirement and configuration recovery guidance; its promise of tool/version diagnostic fields specifically applies to rejected version probes. The supported entry point is registered in `src/cli/wasmCommands.ts:50-89`, reaches the service in `src/application/wasm/WasmArtifactService.ts:33-52`, and uses the environment-backed provider constructed by `src/composition/wasm.ts:7-11`. `src/wasm/WabtArtifactProvider.ts:216-220` rejects the directory before tool selection without including the value. `src/wasm/WabtFailures.ts:240-250` projects that reason and shared recovery text without adding the selected directory. ### Typed outcome or recovery expected Continue returning `capability_unavailable` with `retryable: false`. Include the rejected directory value in the message or details. This early refusal does not need executable/version-probe facts that have not yet been collected. ### Analysis or suspected cause Source-derived explanation: the relative-directory guard constructs an error containing only the setting name and constraint. The configuration failure wrapper has no retained selection to add. Version-probe attribution is created later, at `src/wasm/WabtArtifactProvider.ts:339-346`, so those diagnostics cannot cover this branch. ### Additional context Related closed [issue #5767](https://github.com/morluto/rea/issues/5767) and merged [PR #5768](https://github.com/morluto/rea/pull/5768) addressed rejected version-probe output/identity and configuration recovery instructions. The issue's closure comment attributes those fixes to that PR. Its diff leaves the relative-directory guard unchanged, although its validation notes mention probing relative configuration. This report concerns the omitted value in that earlier branch; no previously working value-retention behavior was established.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4526
No description provided.