[PR #3102] [CLOSED] fix(setup): preserve Hermes YAML string values #5616

Closed
opened 2026-10-31 01:08:01 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3102
Author: @shoyann
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/hermes-yaml-string-roundtrip


📝 Commits (2)

  • f3e34d8 fix(setup): preserve Hermes YAML string values
  • 6b0c80d Merge remote-tracking branch 'origin/main' into HEAD

📊 Changes

5 files changed (+187 additions, -21 deletions)

View changed files

📝 src/application/ClientConfigurationDocument.ts (+2 -2)
📝 src/application/HermesConfigurationYaml.test.ts (+22 -2)
📝 src/application/HermesConfigurationYaml.ts (+54 -14)
📝 tests/acceptance/setup/hermesClientSetup.test.ts (+71 -0)
📝 tests/boundary/filesystem/hermesClientConfiguration.test.ts (+38 -3)

📄 Description

Summary

Updating a Hermes registration could turn a valid string environment setting into a boolean. For example, REA_MCP_OUTPUT_SCHEMA_PROFILE: "off" became unquoted off; Hermes read false, while REA setup reported ready and doctor reported aligned. Keep the same value and type through setup by using Hermes's YAML rules for both parsing and writing.

No separate issue: this was reproduced through the public CLI while checking configuration round trips.

Problem and expected behavior

Seed a Hermes config.yaml with a stale REA command and the quoted environment value above, then run rea setup --client hermes --skill=false --yes --json. On the base revision, the written value becomes a boolean under Hermes's YAML 1.1 loader. Repeating setup does not repair it.

Expected: preserve string environment values, unrelated settings and the original backup; reject an already non-string environment value before writing.

Change and scope

  • Make HermesConfigurationYaml own the default YAML 1.1 policy for existing and new files. Honor explicit version directives; include the standard timestamp tag because Hermes also resolves dates under YAML 1.2.
  • Keep numeric and timestamp source spellings, including large IDs, octal values, timestamp precision and offsets. Recognize equivalent boolean keys as duplicates.
  • Create ordinary mapping parents when adding an absent server table, avoiding YAML 1.1 ordered-map tags.
  • Route the fresh-file serializer through the same owner. Other client formats are unchanged.

This is an ordinary configuration-correctness fix within existing contribution scope; a new capability scope decision is not applicable.

Contract and boundary impact

  • Semantic owner: HermesConfigurationYaml, used by configuration parsing, editing and fresh serialization.
  • CLI/MCP contract: no new commands, flags or schemas. Invalid typed Hermes environment values now produce the existing invalid-configuration diagnostic.
  • Provider/platform compatibility: Hermes configuration only; no analysis-provider change.
  • Evidence/provenance: no analysis Evidence changes.
  • Authority and cleanup: existing setup approval, backup and write boundaries remain in place.
  • Generated metadata/package impact: no generated or release metadata changes; installed setup behavior is corrected.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

The changed behavior reads and writes the selected Hermes configuration through the existing setup workflow.

Evidence and regression coverage

  • Public CLI regression: quoted boolean-like strings, dates, sexagesimal values, numbers, null-like strings and boolean-like keys survive setup; unrelated scalar text and backup remain exact; doctor is aligned and repeated setup makes no changes.
  • Filesystem regressions: a fresh registration preserves off; already typed boolean/date/time environment values are refused without changing the file or creating a backup.
  • Producer coverage: explicit YAML 1.2 directives, timestamp source precision, duplicate boolean keys and edited numbers.
  • Base reproduction: five new regression checks failed against unchanged production at b3c5672c; existing checks passed.
  • Independent consumer check: Hermes's actual safe_load, using isolated ruamel.yaml 0.18.16, reads the pre-fix CLI output as boolean false and the fixed output as string off. PyYAML 6.0.3 agrees for this default-schema case.
  • Remaining proof gap: no running Hermes agent or model request; loader compatibility and actual REA CLI/filesystem behavior were exercised.

Validation performed

  • Pinned Node 24.18.0 / npm 11.16.0 in WSL Ubuntu.
  • Relevant Hermes, setup environment and client lifecycle suites: 119 tests passed.
  • npm run check: passed, including typecheck, lint, formatting, knip, metadata and architecture guards.
  • npm run verify:package: passed, including isolated installation/update, CLI/setup/uninstall and MCP workflows. The first attempt hit the host proxy for a loopback registry fixture; rerunning with loopback-only NO_PROXY/npm noproxy exclusions passed without code or test changes.
  • npm pack --dry-run: passed.
  • git diff --check: passed.

Compatibility, safety, and release

No new dependency, release metadata change or target-execution capability. Previously malformed non-string environment values need to be quoted or otherwise corrected, with the existing source-specific diagnostic. Verification used isolated synthetic homes; no personal client configuration was changed. Linux CLI and the upstream Python loader were exercised; native client sessions on Windows/macOS remain unverified.

Before merge

  • This PR addresses a concrete problem within existing scope.
  • The PR has one focused outcome and a Conventional Commit title.
  • The reason for not linking an issue is stated above.
  • Tests cover observable changes and meaningful failure paths.
  • No public contract or generated documentation update is required.
  • Representative CLI and consumer readback evidence is included.
  • The diff was checked for unrelated changes and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3102 **Author:** [@shoyann](https://github.com/shoyann) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/hermes-yaml-string-roundtrip` --- ### 📝 Commits (2) - [`f3e34d8`](https://github.com/morluto/rea/commit/f3e34d8fea8e7fab2a696fdaf1da093209f94992) fix(setup): preserve Hermes YAML string values - [`6b0c80d`](https://github.com/morluto/rea/commit/6b0c80d85d389482bc8b2e2af4c3b3b7007fbde8) Merge remote-tracking branch 'origin/main' into HEAD ### 📊 Changes **5 files changed** (+187 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ClientConfigurationDocument.ts` (+2 -2) 📝 `src/application/HermesConfigurationYaml.test.ts` (+22 -2) 📝 `src/application/HermesConfigurationYaml.ts` (+54 -14) 📝 `tests/acceptance/setup/hermesClientSetup.test.ts` (+71 -0) 📝 `tests/boundary/filesystem/hermesClientConfiguration.test.ts` (+38 -3) </details> ### 📄 Description ## Summary Updating a Hermes registration could turn a valid string environment setting into a boolean. For example, `REA_MCP_OUTPUT_SCHEMA_PROFILE: "off"` became unquoted `off`; Hermes read `false`, while REA setup reported `ready` and doctor reported `aligned`. Keep the same value and type through setup by using Hermes's YAML rules for both parsing and writing. No separate issue: this was reproduced through the public CLI while checking configuration round trips. ## Problem and expected behavior Seed a Hermes `config.yaml` with a stale REA command and the quoted environment value above, then run `rea setup --client hermes --skill=false --yes --json`. On the base revision, the written value becomes a boolean under Hermes's YAML 1.1 loader. Repeating setup does not repair it. Expected: preserve string environment values, unrelated settings and the original backup; reject an already non-string environment value before writing. ## Change and scope - Make `HermesConfigurationYaml` own the default YAML 1.1 policy for existing and new files. Honor explicit version directives; include the standard timestamp tag because Hermes also resolves dates under YAML 1.2. - Keep numeric and timestamp source spellings, including large IDs, octal values, timestamp precision and offsets. Recognize equivalent boolean keys as duplicates. - Create ordinary mapping parents when adding an absent server table, avoiding YAML 1.1 ordered-map tags. - Route the fresh-file serializer through the same owner. Other client formats are unchanged. This is an ordinary configuration-correctness fix within existing contribution scope; a new capability scope decision is not applicable. ## Contract and boundary impact - Semantic owner: `HermesConfigurationYaml`, used by configuration parsing, editing and fresh serialization. - CLI/MCP contract: no new commands, flags or schemas. Invalid typed Hermes environment values now produce the existing invalid-configuration diagnostic. - Provider/platform compatibility: Hermes configuration only; no analysis-provider change. - Evidence/provenance: no analysis Evidence changes. - Authority and cleanup: existing setup approval, backup and write boundaries remain in place. - Generated metadata/package impact: no generated or release metadata changes; installed setup behavior is corrected. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [x] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. The changed behavior reads and writes the selected Hermes configuration through the existing setup workflow. ## Evidence and regression coverage - Public CLI regression: quoted boolean-like strings, dates, sexagesimal values, numbers, null-like strings and boolean-like keys survive setup; unrelated scalar text and backup remain exact; doctor is aligned and repeated setup makes no changes. - Filesystem regressions: a fresh registration preserves `off`; already typed boolean/date/time environment values are refused without changing the file or creating a backup. - Producer coverage: explicit YAML 1.2 directives, timestamp source precision, duplicate boolean keys and edited numbers. - Base reproduction: five new regression checks failed against unchanged production at `b3c5672c`; existing checks passed. - Independent consumer check: [Hermes's actual `safe_load`](https://github.com/NousResearch/hermes-agent/blob/d97007c32d6340f7ba79ac1dfb5773cc00846448/hermes_yaml.py#L20-L34), using isolated ruamel.yaml 0.18.16, reads the pre-fix CLI output as boolean `false` and the fixed output as string `off`. PyYAML 6.0.3 agrees for this default-schema case. - Remaining proof gap: no running Hermes agent or model request; loader compatibility and actual REA CLI/filesystem behavior were exercised. ## Validation performed - Pinned Node 24.18.0 / npm 11.16.0 in WSL Ubuntu. - Relevant Hermes, setup environment and client lifecycle suites: **119 tests passed**. - `npm run check`: passed, including typecheck, lint, formatting, knip, metadata and architecture guards. - `npm run verify:package`: passed, including isolated installation/update, CLI/setup/uninstall and MCP workflows. The first attempt hit the host proxy for a loopback registry fixture; rerunning with loopback-only `NO_PROXY`/npm `noproxy` exclusions passed without code or test changes. - `npm pack --dry-run`: passed. - `git diff --check`: passed. ## Compatibility, safety, and release No new dependency, release metadata change or target-execution capability. Previously malformed non-string environment values need to be quoted or otherwise corrected, with the existing source-specific diagnostic. Verification used isolated synthetic homes; no personal client configuration was changed. Linux CLI and the upstream Python loader were exercised; native client sessions on Windows/macOS remain unverified. ## Before merge - [x] This PR addresses a concrete problem within existing scope. - [x] The PR has one focused outcome and a Conventional Commit title. - [x] The reason for not linking an issue is stated above. - [x] Tests cover observable changes and meaningful failure paths. - [x] No public contract or generated documentation update is required. - [x] Representative CLI and consumer readback evidence is included. - [x] The diff was checked for unrelated changes and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:08:01 +00:00
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#5616
No description provided.