Repository navigation
fix(setup): retain Hermes YAML scalar source during updates - #3568
Merged
Merged
Conversation
Replacing a registration discarded quoting on unchanged YAML 1.2 string keys. Hermes' YAML 1.1 C reader could then reject duplicate boolean keys and fall back to its directive-aware pure reader, changing how unrelated settings were interpreted. Retain unchanged scalar nodes and string-key source at the YAML owner, using linear mapping lookup. Quote newly created YAML 1.2 strings for YAML 1.1 compatibility and preserve direct numeric edit formatting. Cover both existing reader-selection directions through public CLI tests and independently verify with the actual Hermes Python loader. Co-authored-by: Kaoru0822 <[email protected]> Co-authored-by: gensokyo-dev <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
|
Prove registration replacement keeps a caller-selected quoted argument and explicit string tags on unchanged environment keys and values. Both goldens fail against unchanged main and pass with the source-owner fix. Co-authored-by: Kaoru0822 <[email protected]> Co-authored-by: gensokyo-dev <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updating a Hermes registration could discard quoting on unchanged YAML 1.2 string keys such as
"ON"and"YES". The actual Hermes C loader then saw duplicate boolean keys and switched to its pure fallback. Unchangednotifications: onconsequently changed from booleanTrueto string"on", despite its source bytes remaining identical.Follow-up to #3102 and main's independent fix 66536d0. This addresses a separately reproduced representation loss, not the already-fixed default YAML 1.1
offcase.Change and scope
HermesConfigurationYaml, the existing format owner.No new CLI/MCP, Evidence, package or target-execution contract. This is an ordinary configuration fix within existing scope; no additional capability decision is applicable. Writes retain the existing setup approval, backup and idempotence boundaries.
Executed evidence
Linux; Node 24.18.0 / npm 11.16.0; real Hermes loader with ruamel.yaml 0.18.16 / C extension 0.2.15. Upstream's current main had the identical loader blob when checked.
safe_loadobservedTrue→"on". The new CLI regression failed against main's compiled runtime with duplicate YAML 1.1 keys. The initial quote-only experiment also failed the reverse direction; retaining source nodes fixes that producing boundary.npm run checkpassed all six tasks and architecture guards. After rebasing onto fresh main 569ef41, changed production/test files remained byte-identical andnpm run check:fastpassed; it also passed again after the final test-only commit.9876543210987654321, timestamp precision/offset, original backup and repeated-setup bytes. Three non-string env cases returnedneeds_human/exit 1 without changing the configuration or creating a backup.Performance and limitations
Mapping reconciliation is linear in the replaced mapping and traverses existing YAML nodes. No new tool fields, analysis payload or cache are introduced. Agent tokens were not measured. Single fresh-process CLI observations: first plan 2.15 s; repeated setup 1.88 s; JSON output 5.3–10.5 KB. The equivalent completed default-1.1 four-call workflow took 8.39 s on main and 8.57 s with the fix; all four stdout byte counts were unchanged. These single trials are observations rather than a speedup claim.
Serial two-CPU / 8 GiB validation: related suites peaked at 3.11 GiB, static checks at 4.33 GiB; 15-call CLI probe took 33.90 s, user/system CPU 33.99/7.32 s and sampled peak family RSS 415 MiB. No guard stop or OOM.
Existing upstream limitation: removing a configuration block that made the C loader reject can still switch Hermes's reader and alter interpretation of other ambiguous YAML 1.2 scalars. A production-serializer removal probe with the actual Python loader reproduced this on both unchanged main and this patch; the public uninstall CLI was not exercised for that explicit-1.2 case. This PR prevents source loss during registration replacement; it does not establish universal equivalence between Hermes's C and pure readers.
Author readiness
Human owner: @N0zoM1z0
Recorded from the owner's explicit standing declarations for the remaining approved bug-fix batch. Technical review and the executed evidence above were performed by the agent; ownership remains with the named human.