[GH-ISSUE #3954] [Bug] Process capture preparation prompt returns execution-oriented guidance #1562

Closed
opened 2026-10-16 21:07:11 +00:00 by bsakaguchi · 2 comments
Owner

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

Before submitting

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

Area

MCP or agent integration

Observed behavior

Observed on both valid requests: the response retains the preparation description but returns this objective and first optional starting point:

Objective: Run a caller-selected process experiment that can answer the stated behavioral question.

- Run the caller-provided scenario. Explain command lookup, effective working directory, inherited environment, optional filesystem observations, and that the target runs with the current user's permissions.
  Tools: `capture_process_scenario`

The response also says the suggestions are optional and not a required sequence, and requested context is "never as authorization." These qualifications limit the observed defect to contradictory wording. No capture tool was called in either reproduction. A request missing the executable and working-directory arguments was rejected, and an unrelated investigation prompt returned its own expected objective.

Reproduction

  1. From the baseline checkout with its dependencies installed and runtime built, use the pinned Node.js version.
  2. Run this script from the repository root. It starts the supported stdio MCP server with an isolated home, retrieves the prompt, prints the result, closes the server, and removes the isolated home. The executable argument is selection data and is not run by this script.
node --input-type=module <<'NODE'
import { Client } from '@modelcontextprotocol/client';
import { StdioClientTransport } from '@modelcontextprotocol/client/stdio';
import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';

const home = await mkdtemp(join(tmpdir(), 'rea-prompt-review-'));
const client = new Client({ name: 'prompt-review', version: '1' });
const transport = new StdioClientTransport({
  command: process.execPath,
  args: ['scripts/rea.mjs', 'mcp'],
  cwd: process.cwd(),
  env: { PATH: process.env.PATH, HOME: home, REA_LOG_LEVEL: 'silent' },
  stderr: 'pipe',
});
try {
  await client.connect(transport);
  const result = await client.getPrompt({
    name: 'prepare_bounded_process_capture',
    arguments: {
      behavior_question: 'Does the process write a cache file?',
      executable: '/usr/bin/true',
      working_directory: '/',
    },
  });
  console.log(JSON.stringify(result, null, 2));
} finally {
  await client.close();
  await transport.close();
  await rm(home, { recursive: true, force: true });
}
NODE
  1. Compare the returned description with the objective and first optional starting point in the returned text.

Expected behavior

The documented purpose is to "Design a bounded controlled process experiment before execution." The advertised description says to choose a command, inputs, observations, and stopping conditions. For the valid supplied arguments, the returned guidance should support that preparation task consistently with the description.

Impact and scope

Two valid prompt retrievals returned wording that conflicts with the advertised preparation purpose. Prompt retrieval did not call a capture tool, and no consequential downstream behavior was observed. This assessment covers the wording defect; consuming-agent effects remain untested.

Workaround: The returned text explicitly permits skipping suggestions, so a caller can omit the run suggestion and choose the command, inputs, observations, and stopping conditions described by the prompt's advertised purpose without executing a target.

REA version

rea 6.5.0 at source commit 4692bb3330; current-main source checked at 22ec8bdb2f

Runtime and platform

Node 24.18.0; macOS arm64

Target and artifact context

prepare_bounded_process_capture prompt with behavior_question, /usr/bin/true executable selection, and working_directory /. No target was executed.

Interface

MCP

Earliest failure stage

Transport or result projection

Relevant output or evidence

docs/mcp-prompts.md:16 promises preparation before execution; src/contracts/promptContracts.ts:365-366 advertises selection of command, inputs, observations and stopping conditions. Lines 367-388 supply the execution-oriented objective and suggestion; src/server/registerPrompts.ts:100-119 renders them. Two valid production stdio MCP requests returned the mismatch. Missing-argument rejection and an unrelated investigation-prompt control behaved as expected.

Typed outcome or recovery expected

Align the description, objective and optional suggestions around preparation before execution. Preserve optional suggestions, selection-versus-authorization wording and required-argument rejection.

Analysis or suspected cause

The contract text itself is inconsistent. Prompt retrieval does not invoke capture_process_scenario. The response retains optional suggestions and the statement that context is never authorization. No consuming-agent behavior or automatic execution was observed.

Additional context

This is a wording defect. A focused prompt-rendering test passed with zero fake-session analysis executions; it does not establish how a consuming agent interprets the text.

Freshness check: the failing source is unchanged on current upstream main at 22ec8bdb2f. The only change among the cited files is unrelated CLI output-flag normalization. Runtime observations above are from the stated baseline; current-main persistence is source-derived.

Originally created by @coygeek on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/3954 ### 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 MCP or agent integration ### Observed behavior Observed on both valid requests: the response retains the preparation description but returns this objective and first optional starting point: ```text Objective: Run a caller-selected process experiment that can answer the stated behavioral question. - Run the caller-provided scenario. Explain command lookup, effective working directory, inherited environment, optional filesystem observations, and that the target runs with the current user's permissions. Tools: `capture_process_scenario` ``` The response also says the suggestions are optional and not a required sequence, and requested context is "never as authorization." These qualifications limit the observed defect to contradictory wording. No capture tool was called in either reproduction. A request missing the executable and working-directory arguments was rejected, and an unrelated investigation prompt returned its own expected objective. ### Reproduction 1. From the baseline checkout with its dependencies installed and runtime built, use the pinned Node.js version. 2. Run this script from the repository root. It starts the supported stdio MCP server with an isolated home, retrieves the prompt, prints the result, closes the server, and removes the isolated home. The executable argument is selection data and is not run by this script. ```sh node --input-type=module <<'NODE' import { Client } from '@modelcontextprotocol/client'; import { StdioClientTransport } from '@modelcontextprotocol/client/stdio'; import { mkdtemp, rm } from 'node:fs/promises'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; const home = await mkdtemp(join(tmpdir(), 'rea-prompt-review-')); const client = new Client({ name: 'prompt-review', version: '1' }); const transport = new StdioClientTransport({ command: process.execPath, args: ['scripts/rea.mjs', 'mcp'], cwd: process.cwd(), env: { PATH: process.env.PATH, HOME: home, REA_LOG_LEVEL: 'silent' }, stderr: 'pipe', }); try { await client.connect(transport); const result = await client.getPrompt({ name: 'prepare_bounded_process_capture', arguments: { behavior_question: 'Does the process write a cache file?', executable: '/usr/bin/true', working_directory: '/', }, }); console.log(JSON.stringify(result, null, 2)); } finally { await client.close(); await transport.close(); await rm(home, { recursive: true, force: true }); } NODE ``` 3. Compare the returned description with the objective and first optional starting point in the returned text. ### Expected behavior The documented purpose is to "Design a bounded controlled process experiment before execution." The advertised description says to choose a command, inputs, observations, and stopping conditions. For the valid supplied arguments, the returned guidance should support that preparation task consistently with the description. ### Impact and scope Two valid prompt retrievals returned wording that conflicts with the advertised preparation purpose. Prompt retrieval did not call a capture tool, and no consequential downstream behavior was observed. This assessment covers the wording defect; consuming-agent effects remain untested. Workaround: The returned text explicitly permits skipping suggestions, so a caller can omit the run suggestion and choose the command, inputs, observations, and stopping conditions described by the prompt's advertised purpose without executing a target. ### REA version rea 6.5.0 at source commit 4692bb33300c7cb77b095b6cc0c33da861c1b860; current-main source checked at 22ec8bdb2f7d4626587f23b1eed4a207df600386 ### Runtime and platform Node 24.18.0; macOS arm64 ### Target and artifact context prepare_bounded_process_capture prompt with behavior_question, /usr/bin/true executable selection, and working_directory /. No target was executed. ### Interface MCP ### Earliest failure stage Transport or result projection ### Relevant output or evidence `docs/mcp-prompts.md:16` promises preparation before execution; `src/contracts/promptContracts.ts:365-366` advertises selection of command, inputs, observations and stopping conditions. Lines 367-388 supply the execution-oriented objective and suggestion; `src/server/registerPrompts.ts:100-119` renders them. Two valid production stdio MCP requests returned the mismatch. Missing-argument rejection and an unrelated investigation-prompt control behaved as expected. ### Typed outcome or recovery expected Align the description, objective and optional suggestions around preparation before execution. Preserve optional suggestions, selection-versus-authorization wording and required-argument rejection. ### Analysis or suspected cause The contract text itself is inconsistent. Prompt retrieval does not invoke capture_process_scenario. The response retains optional suggestions and the statement that context is never authorization. No consuming-agent behavior or automatic execution was observed. ### Additional context This is a wording defect. A focused prompt-rendering test passed with zero fake-session analysis executions; it does not establish how a consuming agent interprets the text. Freshness check: the failing source is unchanged on current upstream main at 22ec8bdb2f7d4626587f23b1eed4a207df600386. The only change among the cited files is unrelated CLI output-flag normalization. Runtime observations above are from the stated baseline; current-main persistence is source-derived.
Author
Owner

@z2Ace0107 commented on GitHub (Oct 15, 2026):

I'd like to take this on. I reproduced the wording mismatch through the stdio MCP server on Windows: prepare_bounded_process_capture describes preparation, but its objective and first suggestion tell the caller to run the scenario. No target was executed. I'll align the returned guidance with planning the command, observations, limits and stopping conditions before execution, and add focused prompt regression coverage.

<!-- gh-comment-id:6187045570 --> @z2Ace0107 commented on GitHub (Oct 15, 2026): I'd like to take this on. I reproduced the wording mismatch through the stdio MCP server on Windows: prepare_bounded_process_capture describes preparation, but its objective and first suggestion tell the caller to run the scenario. No target was executed. I'll align the returned guidance with planning the command, observations, limits and stopping conditions before execution, and add focused prompt regression coverage.
Author
Owner

@coygeek commented on GitHub (Oct 24, 2026):

Checked the reported fix on main at d87e73f2db.

The prompt objective now explicitly designs an experiment before execution; its first step says Prepare the scenario without running it and covers observations, timeout and cleanup. It states selected command/directory do not authorize execution and comparison is planned after separately requested capture. Registered-MCP prompt regression asserts these statements, absence of Run the caller-provided scenario, unchanged optional/Evidence discipline and zero executions.

Implementation: promptContracts.ts, promptContracts.ts.

The relevant regression checks in promptMcp.test.ts passed in the focused test run on this revision. This closure is based on the current source and those checks; provider fixtures do not establish a real-engine run. Closing as completed on main.

<!-- gh-comment-id:6380760301 --> @coygeek commented on GitHub (Oct 24, 2026): Checked the reported fix on `main` at d87e73f2db50be72d33a4b3c7199af35518b441c. The prompt objective now explicitly designs an experiment before execution; its first step says Prepare the scenario without running it and covers observations, timeout and cleanup. It states selected command/directory do not authorize execution and comparison is planned after separately requested capture. Registered-MCP prompt regression asserts these statements, absence of Run the caller-provided scenario, unchanged optional/Evidence discipline and zero executions. Implementation: [promptContracts.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/contracts/promptContracts.ts#L367), [promptContracts.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/contracts/promptContracts.ts#L388). The relevant regression checks in [promptMcp.test.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/tests/boundary/mcp/promptMcp.test.ts) passed in the focused test run on this revision. This closure is based on the current source and those checks; provider fixtures do not establish a real-engine run. Closing as completed on main.
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#1562
No description provided.