fix(installer): preserve comments and key order when editing agent configs - #9
Merged
Merged
Conversation
…nfigs The installer rewrote agent config files with serde_json::to_string_pretty, which dropped all JSONC comments and re-sorted keys alphabetically — scrambling users' hand-maintained configs even when only adding the codegraph entry. Edit existing configs surgically with jsonc-parser's CST API (upsert_nested_key_jsonc / remove_nested_key_jsonc): only the codegraph property is inserted, updated, or removed, leaving every comment, key order, and the file's formatting intact. Re-runs short-circuit to Unchanged (no churn). Fresh files are still seeded with the canonical shape. All six targets and the uninstall path go through the surgical helpers.
KNOWN_DIFFS.md is an internal upstream-diff ledger (deferred colby resolvers, Tier-3 allowed diffs), not user-facing. No code loads it at runtime. Move it under docs/upstream-sync/ (already gitignored, alongside UPSTREAM.md) so it stays local and out of the public repo.
KNOWN_DIFFS.md moved to the internal gitignored ledger, so its public-doc hyperlinks would 404. Delink the mentions in README, architecture.md, and the zh-CN README; also drop the inaccurate 'read at runtime by the equivalence oracle' claim (no code loads the file by path).
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
The installer rewrote agent config files with serde_json::to_string_pretty, which dropped all JSONC comments and re-sorted keys alphabetically, scrambling users' hand-maintained configs even when only adding the codegraph entry.
Fix
upsert_nested_key_jsonc/remove_nested_key_jsonc): only the codegraph property is inserted/updated/removed; every comment, key order, and the file formatting stay intact.Verification