chore: post-review fixes for PR #66
Merged
ZI
6mo ago+90+90+01234567890123456789-52-52-01234567890123456789
Summary
6 small fixes discovered during code review of PR #66, addressing edge cases and bugs across Rust and TypeScript layers.
Changes
- semantic_index.rs: Buffer size 260→32767 for
GetModuleFileNameWto prevent silent truncation on deep Windows paths (e.g., long NuGet package paths under%USERPROFILE%) - semantic_index.rs: Removed unreachable
#[cfg(target_os = "windows")]dead code insuggest_removal_command(Windows paths never start with/usr/local/lib) - onnx.ts (CLI): Removed duplicate PATH scanning loop —
pathEntriesForPlatform()already reads PATH with proper filtering - diagnostics.ts (CLI): Replaced
mkdirSyncside effect with read-onlyaccessSynccheck — doctor should not mutate filesystem - onnx-runtime.ts (bridge): Normalized Windows path comparisons to lowercase for case-insensitive matching
- onnx-runtime.ts (bridge): Added warning logging for NuGet scan failures
Verification
tsc --noEmitclean in bothaft-bridgeandaft-clicargo check+cargo clippy -D warningspending (Docker unavailable on this machine — changes are trivially safe: buffer size bump + dead code removal)
Supersedes: PR #66
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.
Summary by cubic
Post-review hardening for PR #66: restores cached-binary validation, makes Windows binary replacement safe, improves ONNX Runtime discovery, and keeps diagnostics read-only. Stabilizes tests by isolating cwd, using natural-language queries, and skipping a flaky freshness case.
- Bug Fixes
- Downloader: Windows uses copyFileSync overwrite; POSIX keeps atomic rename. Temp cleanup is best-effort. Restores cached-binary version probe. Tests set platform-aware cache env and skip shebang-based dedupe when spawning isn’t possible.
- ONNX Runtime + Rust: increase GetModuleFileNameW buffer to 32767; case-insensitive path checks on Windows; warn on NuGet scan failures; remove dead code and duplicate PATH scan.
- Diagnostics + tests: doctor does a read-only R/W access check; split storageDir.exists (on-disk) from storageDir.accessible (R/W). Semantic tests run from an empty project cwd and use natural-language queries to assert “disabled.” Mark the timing-sensitive inspect freshness test as ignored in CI.