[GH-ISSUE #7587] [Bug] Format-specific binary CLI inspections omit the promised caller_input_path #4520

Closed
opened 2026-10-31 00:50:28 +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/7587

Before submitting

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

Area

CLI

Observed behavior

node scripts/rea.mjs inspect-model-artifact ./model.safetensors --json and node scripts/rea.mjs inspect-elf-notes ./sample.elf --json both succeed on valid local fixtures but omit caller_input_path. Their complete Evidence keeps an absolute parameters.path; the exact relative argument is absent from the serialized result. The ELF inspection correctly decodes its GNU build ID, so this is successful analysis losing request provenance.

A control, node scripts/rea.mjs inspect-artifact ./sample.zip --json, succeeds and returns caller_input_path: "./sample.zip".

Reproduction

  1. Use the built baseline checkout with its locked dependencies and Node v24.22.1 on PATH.
  2. From the checkout root, run this Python recipe. It creates inert fixtures and isolates HOME, XDG configuration/data/cache/state, and temporary files for each REA process. It needs no external analysis engine or GUI:
import json, os, pathlib, struct, subprocess, tempfile, zipfile
repo = pathlib.Path.cwd()
with tempfile.TemporaryDirectory(prefix="rea-caller-path-") as directory:
    work = pathlib.Path(directory)
    env = {k: v for k, v in os.environ.items()
           if not k.startswith(("REA_", "HOPPER_", "GHIDRA_"))}
    for key in ("HOME", "XDG_CONFIG_HOME", "XDG_DATA_HOME",
                "XDG_CACHE_HOME", "XDG_STATE_HOME", "TMPDIR"):
        folder = work / key.lower()
        folder.mkdir()
        env[key] = str(folder)
    header = json.dumps({"w": {"dtype": "F32", "shape": [1],
                              "data_offsets": [0, 4]}}).encode()
    (work / "model.safetensors").write_bytes(
        struct.pack("<Q", len(header)) + header + bytes(4))
    ident = b"\x7fELF\x02\x01\x01" + bytes(9)
    note = struct.pack("<III", 4, 20, 3) + b"GNU\0" + bytes.fromhex(
        "0123456789abcdef0123456789abcdef01234567")
    elf = struct.pack("<16sHHIQQQIHHHHHH", ident, 2, 62, 1, 0, 64, 0,
                      0, 64, 56, 1, 64, 0, 0)
    elf += struct.pack("<IIQQQQQQ", 4, 4, 120, 0, 0, len(note), len(note), 4)
    (work / "sample.elf").write_bytes(elf + note)
    with zipfile.ZipFile(work / "sample.zip", "w") as archive:
        archive.writestr("payload.txt", "synthetic fixture")
    for command, target in (("inspect-model-artifact", "./model.safetensors"),
                            ("inspect-elf-notes", "./sample.elf"),
                            ("inspect-artifact", "./sample.zip")):
        result = subprocess.run(
            ["node", str(repo / "scripts/rea.mjs"), command, target, "--json"],
            cwd=work, env=env, capture_output=True, text=True, timeout=60,
            check=True)
        evidence = json.loads(result.stdout)
        print(command, "exit=0", "caller_input_path=",
              evidence.get("caller_input_path"), "verbatim_present=",
              target in json.dumps(evidence))
  1. Observe the comparison output below. This exact three-command recipe was executed once; both omissions also appeared in earlier independent CLI runs. All three final recipe commands exited 0.

Expected behavior

Successful one-shot binary CLI Evidence should include the exact selected argument in caller_input_path, while retaining the inspected file identity separately. Both the CLI documentation and the general tool-design contract explicitly promise this field for one-shot binary CLI analysis, including relative spelling. Neither passage limits that promise to the artifact or native-provider route. An ELF image inspected through a format-specific CLI is within that wording.

Impact and scope

P2: saved Evidence from these successful inspections cannot establish the verbatim argument used to select the input. An agent consuming the documented field receives different provenance depending on which inspection command it calls. Retaining the command in a separate invocation log is a practical workaround for future calls; the normalized path alone cannot recover the original spelling. No incorrect decoding, target execution, data loss or security boundary crossing was established.

Additional successful CLI runs confirmed the missing field for inspect-devicetree ./board.dtb, inspect-kernel-module ./demo.ko, inspect-sqlite-database ./data.sqlite, and inspect-byte-entropy ./bytes.bin, each with --json. The model command's --detail summary --evidence_output model-evidence.json --json also returned nested summary Evidence without the field. Python bytecode, WASM and other platforms were not tested. JavaScript analysis is excluded: its separate contract retains an anchored selection in parameters.input_path.

REA version

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

6.8.0

Source commit: 65f1c447344a423fa2785847dbcea1e9a9e2454a.

Runtime and platform

Node.js v24.22.1; macOS 27.0.1; arm64. No Hopper, Ghidra or GUI application was started. SQLite's worker completed successfully in the additional check.

Target and artifact context

Inline synthetic safetensors header with one F32 tensor, ELF64 image with one GNU build-ID note, and ZIP containing a text entry. Additional checks used synthetic DTB, kernel-module, SQLite and byte-array fixtures.

Interface

CLI

Earliest failure stage

Artifact or evidence registration

Relevant output or evidence

The final inline recipe printed:

inspect-model-artifact exit=0 caller_input_path= None verbatim_present= False
inspect-elf-notes exit=0 caller_input_path= None verbatim_present= False
inspect-artifact exit=0 caller_input_path= ./sample.zip verbatim_present= True

verbatim_present searches the complete parsed Evidence serialization for the exact relative argument. A separate ELF check decoded build ID 0123456789abcdef0123456789abcdef01234567 and returned the absolute fixture path in parameters.path.

Contract locators at the baseline: docs/cli.md:479–484 and docs/tool-design.md:54–61. AGENTS.md, Product and Authority, also requires preserving caller-selected paths.

Source-derived producing boundaries: src/cli/modelCommands.ts:71–95 and src/cli/binaryDiagnosticsCommands.ts:66–80 replace the CLI argument with an absolute path before invoking the services. src/domain/model/modelArtifactEvidence.ts:19–36 and src/application/binaryDiagnostics/ElfNotesService.ts:82–101 construct Evidence from those parameters without binding the original spelling. src/domain/evidence.ts:93–96 defines the optional metadata field; src/domain/evidence.ts:319–333 owns the existing binding helper.

Analysis or suspected cause

Source-derived: the format-specific services construct their Evidence outside the DirectAnalysis routes that attach caller_input_path. Their CLI adapters have already discarded the relative spelling before construction. The result is consistent with the successful runtime comparisons above. No particular implementation change is prescribed here.

Additional context

Related closed #5479 concerns artifact/native caller-path loss. Its original artifact alias case succeeds on this baseline and retains caller_input_path; this report covers uncovered format-specific routes. Commits 535926ca2 and 9b3a63329 extended the original fix and established the current general documentation wording.

Closed #5258 and PR #5261 cover JavaScript's separate selected-path parameter. PR #7035 covers managed-route test assertions, and merged PR #7039 covers current versus historical retained-summary paths. Searches of open/closed issues, open/merged/closed PRs and relevant comments found no existing report for the successful format-specific omission described here. No last known good release is established.

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: Successful binary inspections omit documented verbatim request metadata, preventing Evidence alone from establishing the original invocation spelling; analysis remains available and decoding was correct in the ELF control.
  • Workaround status: available
  • Workaround basis: Callers can record the exact command argument in a separate invocation log before inspecting the file; the already returned normalized path cannot reconstruct that spelling.
Originally created by @coygeek on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/7587 ### 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 CLI ### Observed behavior `node scripts/rea.mjs inspect-model-artifact ./model.safetensors --json` and `node scripts/rea.mjs inspect-elf-notes ./sample.elf --json` both succeed on valid local fixtures but omit `caller_input_path`. Their complete Evidence keeps an absolute `parameters.path`; the exact relative argument is absent from the serialized result. The ELF inspection correctly decodes its GNU build ID, so this is successful analysis losing request provenance. A control, `node scripts/rea.mjs inspect-artifact ./sample.zip --json`, succeeds and returns `caller_input_path: "./sample.zip"`. ### Reproduction 1. Use the built baseline checkout with its locked dependencies and Node v24.22.1 on PATH. 2. From the checkout root, run this Python recipe. It creates inert fixtures and isolates HOME, XDG configuration/data/cache/state, and temporary files for each REA process. It needs no external analysis engine or GUI: ```python import json, os, pathlib, struct, subprocess, tempfile, zipfile repo = pathlib.Path.cwd() with tempfile.TemporaryDirectory(prefix="rea-caller-path-") as directory: work = pathlib.Path(directory) env = {k: v for k, v in os.environ.items() if not k.startswith(("REA_", "HOPPER_", "GHIDRA_"))} for key in ("HOME", "XDG_CONFIG_HOME", "XDG_DATA_HOME", "XDG_CACHE_HOME", "XDG_STATE_HOME", "TMPDIR"): folder = work / key.lower() folder.mkdir() env[key] = str(folder) header = json.dumps({"w": {"dtype": "F32", "shape": [1], "data_offsets": [0, 4]}}).encode() (work / "model.safetensors").write_bytes( struct.pack("<Q", len(header)) + header + bytes(4)) ident = b"\x7fELF\x02\x01\x01" + bytes(9) note = struct.pack("<III", 4, 20, 3) + b"GNU\0" + bytes.fromhex( "0123456789abcdef0123456789abcdef01234567") elf = struct.pack("<16sHHIQQQIHHHHHH", ident, 2, 62, 1, 0, 64, 0, 0, 64, 56, 1, 64, 0, 0) elf += struct.pack("<IIQQQQQQ", 4, 4, 120, 0, 0, len(note), len(note), 4) (work / "sample.elf").write_bytes(elf + note) with zipfile.ZipFile(work / "sample.zip", "w") as archive: archive.writestr("payload.txt", "synthetic fixture") for command, target in (("inspect-model-artifact", "./model.safetensors"), ("inspect-elf-notes", "./sample.elf"), ("inspect-artifact", "./sample.zip")): result = subprocess.run( ["node", str(repo / "scripts/rea.mjs"), command, target, "--json"], cwd=work, env=env, capture_output=True, text=True, timeout=60, check=True) evidence = json.loads(result.stdout) print(command, "exit=0", "caller_input_path=", evidence.get("caller_input_path"), "verbatim_present=", target in json.dumps(evidence)) ``` 3. Observe the comparison output below. This exact three-command recipe was executed once; both omissions also appeared in earlier independent CLI runs. All three final recipe commands exited 0. ### Expected behavior Successful one-shot binary CLI Evidence should include the exact selected argument in `caller_input_path`, while retaining the inspected file identity separately. Both the CLI documentation and the general tool-design contract explicitly promise this field for one-shot binary CLI analysis, including relative spelling. Neither passage limits that promise to the artifact or native-provider route. An ELF image inspected through a format-specific CLI is within that wording. ### Impact and scope P2: saved Evidence from these successful inspections cannot establish the verbatim argument used to select the input. An agent consuming the documented field receives different provenance depending on which inspection command it calls. Retaining the command in a separate invocation log is a practical workaround for future calls; the normalized path alone cannot recover the original spelling. No incorrect decoding, target execution, data loss or security boundary crossing was established. Additional successful CLI runs confirmed the missing field for `inspect-devicetree ./board.dtb`, `inspect-kernel-module ./demo.ko`, `inspect-sqlite-database ./data.sqlite`, and `inspect-byte-entropy ./bytes.bin`, each with `--json`. The model command's `--detail summary --evidence_output model-evidence.json --json` also returned nested summary Evidence without the field. Python bytecode, WASM and other platforms were not tested. JavaScript analysis is excluded: its separate contract retains an anchored selection in `parameters.input_path`. ### REA version Exact `node scripts/rea.mjs --version` output: ```text 6.8.0 ``` Source commit: `65f1c447344a423fa2785847dbcea1e9a9e2454a`. ### Runtime and platform Node.js v24.22.1; macOS 27.0.1; arm64. No Hopper, Ghidra or GUI application was started. SQLite's worker completed successfully in the additional check. ### Target and artifact context Inline synthetic safetensors header with one F32 tensor, ELF64 image with one GNU build-ID note, and ZIP containing a text entry. Additional checks used synthetic DTB, kernel-module, SQLite and byte-array fixtures. ### Interface CLI ### Earliest failure stage Artifact or evidence registration ### Relevant output or evidence The final inline recipe printed: ```text inspect-model-artifact exit=0 caller_input_path= None verbatim_present= False inspect-elf-notes exit=0 caller_input_path= None verbatim_present= False inspect-artifact exit=0 caller_input_path= ./sample.zip verbatim_present= True ``` `verbatim_present` searches the complete parsed Evidence serialization for the exact relative argument. A separate ELF check decoded build ID `0123456789abcdef0123456789abcdef01234567` and returned the absolute fixture path in `parameters.path`. Contract locators at the baseline: `docs/cli.md:479–484` and `docs/tool-design.md:54–61`. `AGENTS.md`, Product and Authority, also requires preserving caller-selected paths. Source-derived producing boundaries: `src/cli/modelCommands.ts:71–95` and `src/cli/binaryDiagnosticsCommands.ts:66–80` replace the CLI argument with an absolute path before invoking the services. `src/domain/model/modelArtifactEvidence.ts:19–36` and `src/application/binaryDiagnostics/ElfNotesService.ts:82–101` construct Evidence from those parameters without binding the original spelling. `src/domain/evidence.ts:93–96` defines the optional metadata field; `src/domain/evidence.ts:319–333` owns the existing binding helper. ### Analysis or suspected cause Source-derived: the format-specific services construct their Evidence outside the `DirectAnalysis` routes that attach `caller_input_path`. Their CLI adapters have already discarded the relative spelling before construction. The result is consistent with the successful runtime comparisons above. No particular implementation change is prescribed here. ### Additional context Related closed [#5479](https://github.com/morluto/rea/issues/5479) concerns artifact/native caller-path loss. Its original artifact alias case succeeds on this baseline and retains `caller_input_path`; this report covers uncovered format-specific routes. Commits `535926ca2` and `9b3a63329` extended the original fix and established the current general documentation wording. Closed [#5258](https://github.com/morluto/rea/issues/5258) and [PR #5261](https://github.com/morluto/rea/pull/5261) cover JavaScript's separate selected-path parameter. [PR #7035](https://github.com/morluto/rea/pull/7035) covers managed-route test assertions, and merged [PR #7039](https://github.com/morluto/rea/pull/7039) covers current versus historical retained-summary paths. Searches of open/closed issues, open/merged/closed PRs and relevant comments found no existing report for the successful format-specific omission described here. No last known good release is established. ## Triage assessment - Impact level: P2 - Assessment status: supported - Impact basis: Successful binary inspections omit documented verbatim request metadata, preventing Evidence alone from establishing the original invocation spelling; analysis remains available and decoding was correct in the ELF control. - Workaround status: available - Workaround basis: Callers can record the exact command argument in a separate invocation log before inspecting the file; the already returned normalized path cannot reconstruct that spelling.
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#4520
No description provided.