[GH-ISSUE #7697] [Bug] Invalid registration remediation repeats the constraint's final period #4619

Closed
opened 2026-10-31 00:51:26 +00:00 by bsakaguchi · 1 comment
Owner

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

Before submitting

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

Area

Setup, packaging, or upgrade

Observed behavior

A Claude Code registration containing env.REA_MCP_TOOL_FAMILIES: "bogus" produces a remediation ending in session.. Repair it before rerunning setup. when running:

node scripts/rea.mjs setup --client claude_code --yes --format json
node scripts/rea.mjs doctor --client claude_code --json

Both commands exit 1. Setup reports needs_human and no planned or applied actions. Its top-level remediation, its nested doctor registration remediation, and the separate doctor's registration remediation all repeat the period. The invalid value is correctly rejected; the defect is the extra punctuation before the repair instruction.

Reproduction

  1. Use the built source baseline below with Node.js 24.22.1 first on PATH.
  2. Run this shell block from the checkout root without shell errexit, because both fixtures intentionally produce failing readiness results. It isolates the caller environment, supplies recording package-manager fixtures, exercises the invalid value and a valid-family control, and removes its temporary files on exit.
node_dir=$(dirname "$(command -v node)")
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
mkdir -p "$work/bin" "$work/home"
: > "$work/calls.log"
cat > "$work/bin/npm" <<'FIXTURE'
#!/bin/sh
printf '%s\n' "${0##*/}" >> "$VERIFY_CALLS"
exit 97
FIXTURE
cp "$work/bin/npm" "$work/bin/npx"
cp "$work/bin/npm" "$work/bin/bun"
chmod +x "$work/bin/npm" "$work/bin/npx" "$work/bin/bun"
run_rea() {
  env -i PATH="$work/bin:$node_dir:/usr/bin:/bin" \
    HOME="$work/home" USERPROFILE="$work/home" TMPDIR="$work/home" \
    XDG_CONFIG_HOME="$work/home/config" XDG_DATA_HOME="$work/home/data" \
    XDG_CACHE_HOME="$work/home/cache" XDG_STATE_HOME="$work/home/state" \
    DSH_HOME="$work/home/.dsh" DSH_AGENTS_HOME="$work/home/.agents" \
    VERIFY_CALLS="$work/calls.log" node scripts/rea.mjs "$@"
}
run_rea --version
for family in bogus direct; do
  printf '{"mcpServers":{"rea":{"command":"rea","args":["--mcp"],"env":{"REA_MCP_TOOL_FAMILIES":"%s"}}}}' "$family" > "$work/home/.claude.json"
  cp "$work/home/.claude.json" "$work/before.json"
  run_rea setup --client claude_code --yes --format json > "$work/setup.json"
  printf '%s setup_exit=%s\n' "$family" "$?"
  run_rea doctor --client claude_code --json > "$work/doctor.json"
  printf '%s doctor_exit=%s\n' "$family" "$?"
  node --input-type=module - "$work" "$family" <<'CHECK'
import {readFileSync} from 'node:fs';
const [root, family] = process.argv.slice(2);
const setup = JSON.parse(readFileSync(root + '/setup.json', 'utf8'));
const doctor = JSON.parse(readFileSync(root + '/doctor.json', 'utf8'));
const messages = [setup.remediation, setup.doctor.identity.registrations[0].remediation,
  doctor.identity.registrations[0].remediation];
console.log(JSON.stringify({family, setup_status: setup.status,
  doubled_period: messages.map(value => value.includes('session.. Repair it')),
  foreign_ownership: messages.map(value => value.includes('foreign ownership')),
  config_unchanged: readFileSync(root + '/before.json').equals(readFileSync(root + '/home/.claude.json'))}));
CHECK
done
printf 'package_manager_calls=%s\n' "$(wc -l < "$work/calls.log" | tr -d ' ')"
  1. For bogus, the printed doubled_period array is [true,true,true]. For direct, it is [false,false,false]; the foreign_ownership array becomes [true,true,true]. All four command exit statuses are 1, both configuration comparisons are true, and package_manager_calls=0.

This shell replay and an independent subprocess replay each reproduced the invalid result once through setup and once through doctor, followed by the valid-family control: two reproductions per affected command.

Expected behavior

Preserve the rejected setting, its constraint and repair advice, with one period between the constraint and the next sentence. Setup and doctor should continue rejecting the invalid stored setting before setup writes files, as the installation guide promises.

The punctuation expectation is ordinary readable prose; no documented guarantee of exact remediation bytes is claimed. The relevant documentation and producing source are identified below.

Impact and scope

P3 cosmetic defect in the remediation shown to callers diagnosing an invalid stored registration setting. The diagnostic remains understandable, rejection remains correct, and every exercised run preserved the configuration bytes. A caller can read the guidance while ignoring the duplicate period.

Observed scope is Claude Code registration diagnostics on macOS for the unknown tool family bogus. Other settings, clients, platforms and human-format output were not exercised. Replacing the family with direct removed the affected environment message, but the same bare rea launcher then failed a separate ownership check; this control does not establish ready status.

REA version

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

6.8.0

Source baseline: 65f1c447344a423fa2785847dbcea1e9a9e2454a.

Runtime and platform

Node.js v24.22.1; Darwin 27.0.0, macOS 27.0.1, arm64. npm, npx and bun were recording fixtures placed first on PATH; none was invoked.

Target and artifact context

No analysis target or provider session. The input was an isolated Claude Code configuration with a mcpServers.rea entry and one invalid environment override. HOME, XDG roots and Harness configuration roots were isolated before starting REA.

Interface

CLI

Earliest failure stage

Transport or result projection

Relevant output or evidence

The invalid setup and doctor commands returned this registration remediation; only the disposable configuration directory is replaced with <home>:

Configuration <home>/.claude.json has an invalid REA server environment: REA_MCP_TOOL_FAMILIES: REA_MCP_TOOL_FAMILIES must be a non-empty comma-separated subset of the tool family ids: direct, enhanced, native, artifact, managed, firmware, android, pcap, flutter, frida, apktool, jeb, adb, browser, electron, javascript-runtime, application, session.. Repair it before rerunning setup.

Setup's top-level remediation adds Claude Code: to that text. The unprefixed value appears at doctor.identity.registrations[0].remediation in setup and identity.registrations[0].remediation in scoped doctor. Both invalid commands had empty stderr, and setup's action arrays were empty.

Baseline source and contract locators, inspected during verification:

  • docs/installation.md:94-105 explicitly names tool-family overrides and promises invalid-environment diagnostics before setup writes files.
  • src/config/mcpToolFamilies.ts:14 defines a constraint ending in one period; lines 41-57 return that constraint for the invalid family.
  • src/application/ClientConfigurationFiles.ts:22-29 adds another period before its repair sentence. Lines 105-124 reach this formatter when stored environment validation fails.
  • src/application/SetupClientConfiguration.ts:528 reads the configuration through that owner.
  • src/application/ClientRegistrationStatus.ts:184-201 forwards a configuration-read failure's detail to the registration remediation.
  • src/application/Update.ts:116-131 contains the independent update-specific templates discussed in #7638; the setup formatter does not call them or a shared sentence-joining helper.

Typed outcome or recovery expected

Keep the invalid-registration result, no-write behavior and named-setting advice. Remove only the redundant sentence terminator from the composed remediation.

Analysis or suspected cause

Source-derived: the constraint supplies a complete sentence, and the registration error formatter unconditionally contributes another period before appending its repair sentence. Both public commands consume the same resulting detail. No change to setting admission is needed to restore the punctuation expectation.

Additional context

Read-only duplicate searches covered open and closed issues, open/closed/merged PRs, and issue comments using doubled-period, terminal-period, punctuation, invalid-environment and the exact repair-advice wording.

Issue #7638 reports the same visual symptom in update release-lookup remediation, but its inline update templates are a different producer with an independent closure signal. Fixing those templates leaves this registration formatter unchanged. There is no existing shared sentence-joining helper causing both defects.

Issue #7548 concerns attributing invalid launch-only values to a destination file. Here the invalid value is actually stored in the named file, so attribution is correct. Correcting source attribution alone would leave the extra period on this stored-setting path.

Closed issue #2665 and closed PR #2769 concern invalid registrations being accepted as aligned. Rejection works in this reproduction, and neither record claims this punctuation repair. No known-good-version regression is asserted.

Triage assessment

  • Impact level: P3
  • Assessment status: supported
  • Impact basis: Both exercised public diagnostic commands repeated a period while correctly rejecting the stored value and preserving the configuration.
  • Workaround status: available
  • Workaround basis: The setting, constraint and repair instruction remain readable; ignoring the extra period preserves the diagnostic information.
Originally created by @coygeek on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/7697 ### 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 Setup, packaging, or upgrade ### Observed behavior A Claude Code registration containing `env.REA_MCP_TOOL_FAMILIES: "bogus"` produces a remediation ending in `session.. Repair it before rerunning setup.` when running: ```sh node scripts/rea.mjs setup --client claude_code --yes --format json node scripts/rea.mjs doctor --client claude_code --json ``` Both commands exit 1. Setup reports `needs_human` and no planned or applied actions. Its top-level remediation, its nested doctor registration remediation, and the separate doctor's registration remediation all repeat the period. The invalid value is correctly rejected; the defect is the extra punctuation before the repair instruction. ### Reproduction 1. Use the built source baseline below with Node.js 24.22.1 first on PATH. 2. Run this shell block from the checkout root without shell errexit, because both fixtures intentionally produce failing readiness results. It isolates the caller environment, supplies recording package-manager fixtures, exercises the invalid value and a valid-family control, and removes its temporary files on exit. ```sh node_dir=$(dirname "$(command -v node)") work=$(mktemp -d) trap 'rm -rf "$work"' EXIT mkdir -p "$work/bin" "$work/home" : > "$work/calls.log" cat > "$work/bin/npm" <<'FIXTURE' #!/bin/sh printf '%s\n' "${0##*/}" >> "$VERIFY_CALLS" exit 97 FIXTURE cp "$work/bin/npm" "$work/bin/npx" cp "$work/bin/npm" "$work/bin/bun" chmod +x "$work/bin/npm" "$work/bin/npx" "$work/bin/bun" run_rea() { env -i PATH="$work/bin:$node_dir:/usr/bin:/bin" \ HOME="$work/home" USERPROFILE="$work/home" TMPDIR="$work/home" \ XDG_CONFIG_HOME="$work/home/config" XDG_DATA_HOME="$work/home/data" \ XDG_CACHE_HOME="$work/home/cache" XDG_STATE_HOME="$work/home/state" \ DSH_HOME="$work/home/.dsh" DSH_AGENTS_HOME="$work/home/.agents" \ VERIFY_CALLS="$work/calls.log" node scripts/rea.mjs "$@" } run_rea --version for family in bogus direct; do printf '{"mcpServers":{"rea":{"command":"rea","args":["--mcp"],"env":{"REA_MCP_TOOL_FAMILIES":"%s"}}}}' "$family" > "$work/home/.claude.json" cp "$work/home/.claude.json" "$work/before.json" run_rea setup --client claude_code --yes --format json > "$work/setup.json" printf '%s setup_exit=%s\n' "$family" "$?" run_rea doctor --client claude_code --json > "$work/doctor.json" printf '%s doctor_exit=%s\n' "$family" "$?" node --input-type=module - "$work" "$family" <<'CHECK' import {readFileSync} from 'node:fs'; const [root, family] = process.argv.slice(2); const setup = JSON.parse(readFileSync(root + '/setup.json', 'utf8')); const doctor = JSON.parse(readFileSync(root + '/doctor.json', 'utf8')); const messages = [setup.remediation, setup.doctor.identity.registrations[0].remediation, doctor.identity.registrations[0].remediation]; console.log(JSON.stringify({family, setup_status: setup.status, doubled_period: messages.map(value => value.includes('session.. Repair it')), foreign_ownership: messages.map(value => value.includes('foreign ownership')), config_unchanged: readFileSync(root + '/before.json').equals(readFileSync(root + '/home/.claude.json'))})); CHECK done printf 'package_manager_calls=%s\n' "$(wc -l < "$work/calls.log" | tr -d ' ')" ``` 3. For `bogus`, the printed `doubled_period` array is `[true,true,true]`. For `direct`, it is `[false,false,false]`; the `foreign_ownership` array becomes `[true,true,true]`. All four command exit statuses are 1, both configuration comparisons are true, and `package_manager_calls=0`. This shell replay and an independent subprocess replay each reproduced the invalid result once through setup and once through doctor, followed by the valid-family control: two reproductions per affected command. ### Expected behavior Preserve the rejected setting, its constraint and repair advice, with one period between the constraint and the next sentence. Setup and doctor should continue rejecting the invalid stored setting before setup writes files, as the installation guide promises. The punctuation expectation is ordinary readable prose; no documented guarantee of exact remediation bytes is claimed. The relevant documentation and producing source are identified below. ### Impact and scope P3 cosmetic defect in the remediation shown to callers diagnosing an invalid stored registration setting. The diagnostic remains understandable, rejection remains correct, and every exercised run preserved the configuration bytes. A caller can read the guidance while ignoring the duplicate period. Observed scope is Claude Code registration diagnostics on macOS for the unknown tool family `bogus`. Other settings, clients, platforms and human-format output were not exercised. Replacing the family with `direct` removed the affected environment message, but the same bare `rea` launcher then failed a separate ownership check; this control does not establish `ready` status. ### REA version Exact `node scripts/rea.mjs --version` stdout: ```text 6.8.0 ``` Source baseline: `65f1c447344a423fa2785847dbcea1e9a9e2454a`. ### Runtime and platform Node.js `v24.22.1`; Darwin `27.0.0`, macOS `27.0.1`, `arm64`. npm, npx and bun were recording fixtures placed first on PATH; none was invoked. ### Target and artifact context No analysis target or provider session. The input was an isolated Claude Code configuration with a `mcpServers.rea` entry and one invalid environment override. HOME, XDG roots and Harness configuration roots were isolated before starting REA. ### Interface CLI ### Earliest failure stage Transport or result projection ### Relevant output or evidence The invalid setup and doctor commands returned this registration remediation; only the disposable configuration directory is replaced with `<home>`: ```text Configuration <home>/.claude.json has an invalid REA server environment: REA_MCP_TOOL_FAMILIES: REA_MCP_TOOL_FAMILIES must be a non-empty comma-separated subset of the tool family ids: direct, enhanced, native, artifact, managed, firmware, android, pcap, flutter, frida, apktool, jeb, adb, browser, electron, javascript-runtime, application, session.. Repair it before rerunning setup. ``` Setup's top-level remediation adds `Claude Code: ` to that text. The unprefixed value appears at `doctor.identity.registrations[0].remediation` in setup and `identity.registrations[0].remediation` in scoped doctor. Both invalid commands had empty stderr, and setup's action arrays were empty. Baseline source and contract locators, inspected during verification: - `docs/installation.md:94-105` explicitly names tool-family overrides and promises invalid-environment diagnostics before setup writes files. - `src/config/mcpToolFamilies.ts:14` defines a constraint ending in one period; lines 41-57 return that constraint for the invalid family. - `src/application/ClientConfigurationFiles.ts:22-29` adds another period before its repair sentence. Lines 105-124 reach this formatter when stored environment validation fails. - `src/application/SetupClientConfiguration.ts:528` reads the configuration through that owner. - `src/application/ClientRegistrationStatus.ts:184-201` forwards a configuration-read failure's detail to the registration remediation. - `src/application/Update.ts:116-131` contains the independent update-specific templates discussed in #7638; the setup formatter does not call them or a shared sentence-joining helper. ### Typed outcome or recovery expected Keep the invalid-registration result, no-write behavior and named-setting advice. Remove only the redundant sentence terminator from the composed remediation. ### Analysis or suspected cause Source-derived: the constraint supplies a complete sentence, and the registration error formatter unconditionally contributes another period before appending its repair sentence. Both public commands consume the same resulting detail. No change to setting admission is needed to restore the punctuation expectation. ### Additional context Read-only duplicate searches covered open and closed issues, open/closed/merged PRs, and issue comments using doubled-period, terminal-period, punctuation, invalid-environment and the exact repair-advice wording. [Issue #7638](https://github.com/morluto/rea/issues/7638) reports the same visual symptom in update release-lookup remediation, but its inline update templates are a different producer with an independent closure signal. Fixing those templates leaves this registration formatter unchanged. There is no existing shared sentence-joining helper causing both defects. [Issue #7548](https://github.com/morluto/rea/issues/7548) concerns attributing invalid launch-only values to a destination file. Here the invalid value is actually stored in the named file, so attribution is correct. Correcting source attribution alone would leave the extra period on this stored-setting path. Closed [issue #2665](https://github.com/morluto/rea/issues/2665) and closed [PR #2769](https://github.com/morluto/rea/pull/2769) concern invalid registrations being accepted as aligned. Rejection works in this reproduction, and neither record claims this punctuation repair. No known-good-version regression is asserted. ## Triage assessment - Impact level: P3 - Assessment status: supported - Impact basis: Both exercised public diagnostic commands repeated a period while correctly rejecting the stored value and preserving the configuration. - Workaround status: available - Workaround basis: The setting, constraint and repair instruction remain readable; ignoring the extra period preserves the diagnostic information.
Author
Owner

@gensokyo-dev commented on GitHub (Oct 29, 2026):

Verified fixed on current main (tested d39b3000e via a documentation-only worktree). The producer was corrected in 16cfe30dab: the environment diagnostic appends a period only when the constraint lacks one; setup and doctor reuse that diagnostic.

Executed the isolated public CLI replay for both bogus and direct, through setup and doctor (4 commands, Node 24.22.1 / Linux x64). All exited 1, preserved configuration bytes, and invoked no package manager. Both bogus commands returned session. Repair it before rerunning setup. with one period. This verifies the reported punctuation defect; native macOS execution was not repeated.

<!-- gh-comment-id:6488979965 --> @gensokyo-dev commented on GitHub (Oct 29, 2026): Verified fixed on current main (tested d39b3000e via a documentation-only worktree). The producer was corrected in [16cfe30dab](https://github.com/morluto/rea/commit/16cfe30dab): the environment diagnostic appends a period only when the constraint lacks one; setup and doctor reuse that diagnostic. Executed the isolated public CLI replay for both `bogus` and `direct`, through setup and doctor (4 commands, Node 24.22.1 / Linux x64). All exited 1, preserved configuration bytes, and invoked no package manager. Both `bogus` commands returned `session. Repair it before rerunning setup.` with one period. This verifies the reported punctuation defect; native macOS execution was not repeated.
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#4619
No description provided.