| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(doctor): install diagnostics parity and guards Seven round-6 findings in the doctor install path: - Empty binary guard: DetectDistribution with an empty binary path read .gitcode-install.json from the current working directory (filepath.Dir of "" is "."), so running doctor from an npm package root could misreport the channel. It now short-circuits to the documented archive-or-source default. - JSON contract: commands.<name>.candidates serialized as null when nothing was found — the not-on-PATH case is doctor's main diagnostic path. commandCandidates now returns a non-nil slice. - PATHEXT parity: the Windows extension probe used a hardcoded order (.exe before .com) that contradicts cmd.exe's documented PATHEXT resolution. Both sides now expand the user's PATHEXT (fallback .com/.exe/.bat/.cmd), always append .ps1 (npm writes ps1 shims on every install), and keep the extensionless form last so Git Bash sh shims stay visible. - Symlink parity: distribution detection resolved symlinks before reading the adjacent manifest, but the bootstrap on-PATH check read the manifest next to the unresolved path — a symlinked invocation reported the channel from the resolved manifest while silently skipping the on-PATH diagnostic. Inspect now resolves once and feeds both consumers (Report.Binary keeps the invoked path). - Human output: doctor install --json always carried version/commit/ built and COMMANDS.md documents them, but the human output omitted all three; they now lead the report ((not found) placeholders when the build metadata is empty). - JS pathEntries split PATH on every separator, including inside quotes — a legal "C:\tools;a" entry produced phantom candidates and disagreed with the Go side (filepath.SplitList is quote-aware). It now mirrors the Go semantics. - Tests: the npm-prefix conflict branch (both outcomes, both goos variants — single-entry PATHs because SplitList is host-aware), the candidates-are-arrays JSON contract, the human version header, the symlinked-bootstrap on-PATH check, and the CWD-manifest guard; the JS side locks the quote-aware split and the PATHEXT expansion. Co-Authored-By: Claude Code <noreply@anthropic.com> | 1 个月前 | |
fix(ci): remove unused truncate leftover; JSON-encode paths in doctor test manifests Two CI failures on the first run of this batch: - Lint: the C7 rewiring replaced the call site but the local truncate body in release/list survived (a scripted replacement missed silently); golangci-lint's unused check caught it. Removed. The full-repo lint run is now part of this batch's verification (it was previously only run per-directory). - Test (windows): the npm-prefix conflict fixture interpolated the temp-dir path into the manifest JSON raw — on Windows those paths carry backslashes, which are invalid JSON escape sequences, so json.Unmarshal failed, npmPrefix returned empty, and the conflict branch under test silently never ran (green on Linux, where paths have no backslashes). Both path-carrying manifests in the file now use json.Marshal, which cannot emit invalid JSON. Co-Authored-By: Claude Code <noreply@anthropic.com> | 1 个月前 |