Commit Graph

9 Commits

Author SHA1 Message Date
Kaoru0822 18aa9af2b2 fix(setup): admit only strict JSON for Claude Code configuration (#4944)
Claude Code shared the generic `json` client format, which the shared
configuration reader admits through JSONC parsing with comments and
trailing commas enabled. Native Claude Code reads `.claude.json` with a
strict JSON parser (after a UTF-8 BOM), so setup reported `ready`, wrote
a registration into a file the client rejects as corrupt, and doctor
reported it `aligned`.

Give Claude Code its own `claude_code` configuration format and parse it
at the owning boundary with strict JSON.parse after removing a leading
BOM. Setup, doctor, and uninstall all consume that parser, so comment or
trailing-comma documents are now refused as malformed before any backup
or write, while plain and BOM-prefixed JSON still configure. Clients that
natively accept JSONC keep the `json` format and its behavior.

Fixes #4940

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 19:57:28 -07:00
morluto 4fd28fc9e0 fix(setup): preserve JSONC trivia when removing registrations
Remove properties and their separators using parsed JSONC token spans. Preserve unrelated comments, BOM, CRLF, backups, and repeated removal behavior.

Refs: #4244, #4284

Co-authored-by: alfredo1491 <208325033+alfredo1491@users.noreply.github.com>
2026-10-16 08:14:50 +08:00
morluto a154b9752c test(setup): use verified invocations in uninstall fixtures
Update byte-preservation fixtures for the fail-closed command ownership contract. Unknown path retention remains covered.

Validation: both filesystem boundary files pass, including BOM restoration and idempotent removal.
2026-10-14 16:54:07 +08:00
morluto 63bf91405c refactor!: enforce canonical evidence and provider boundaries
Deliver complete Evidence directly through MCP with required nullable analysis profiles and immutable per-server delivery settings. Bind selected environments at construction and require typed cleanup outcomes with retained retry ownership.

Remove test-only routing, duplicate session and snapshot metadata, producer-field repairs, and ambiguous provider arguments. Separate artifact byte identity from occurrence classification and retain typed source-map and partial native facts across CLI, MCP, and verifier consumers.

BREAKING CHANGE: obsolete Evidence envelopes, session aliases, incomplete snapshots, and missing normalized producer facts are no longer accepted.
2026-10-09 20:18:52 +08:00
lalo adrian morales 9fd65ce071 fix(setup): treat empty client config files as new documents (#1117)
* fix(setup): treat empty client config files as new documents

An empty MCP config file (for example Antigravity's mcp_config.json, which
the client can create with zero bytes) was reported as malformed, which
blocked rea setup from configuring every other detected agent. Parse a
whitespace- or BOM-only JSON/JSONC file as an empty document and write a
fresh document over it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(setup): use explicit unicode escape for BOM-only empty config case

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-10-09 06:30:46 +08:00
morluto fe48e779c2 test(setup): scope removal regression to its fixture client 2026-10-09 02:58:03 +08:00
morluto 5945915f91 test: prune redundant cases and promote configuration lifecycle coverage 2026-10-09 02:58:03 +08:00
morluto d88d6c1897 test(cli): reduce repeated startup and filesystem setup 2026-10-08 04:03:24 +08:00
Kaoru0822 fe843ec0b1 fix(setup): accept leading BOM in JSON client configs 2026-10-06 03:40:42 -07:00