Repository navigation
Commit 836faa7
fix(drivers): fail closed on an unavailable cwd, and keep a root path absolute
Two narrow fixes from the latest review round.
**The workspace exclusion failed open when `process.cwd()` was unavailable.**
`isWorkspaceRoot` returned false with no working directory to compare against,
so every `node_modules` root an error happened to name was admitted — turning
the one case where the process cannot see its own filesystem into the case with
no boundary at all. It now fails closed: no cwd means no harvested roots. This
was introduced by the guard added two commits ago, which is exactly the sort of
thing a fail-open default hides.
**A filesystem root lost its leading separator when deriving the lock path.**
`installLockPath` stripped every trailing separator, so `/` became the relative
`.lock` and `C:\` the drive-relative `C:.lock`. Two processes started from
different working directories would then take different locks while installing
into the same directory, which is the concurrent-npm mutation the lock exists to
prevent. Roots are now left intact; trailing separators are still stripped
everywhere else so `<dir>/` and `<dir>` agree on one lock.
Gates: typecheck 13/13 (forced); marker check ok; lint 5903 warnings and 1 error,
identical to `main`'s baseline; `packages/drivers` 258 pass; `test/altimate` 4226
pass.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ1 parent 53a196d commit 836faa7
3 files changed
Lines changed: 47 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
1011 | 1015 | | |
1012 | 1016 | | |
1013 | 1017 | | |
1014 | | - | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
1015 | 1026 | | |
1016 | 1027 | | |
1017 | 1028 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
42 | 57 | | |
43 | 58 | | |
44 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
341 | 360 | | |
342 | 361 | | |
343 | 362 | | |
| |||
0 commit comments