fix: preserve launcher errors when package probes fail - #136
Conversation
Fail closed on filesystem probe errors without replacing the original installer diagnostic. Preserve and test global lookup semantics. Add real malformed-path and controlled permission regressions for issue #135.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideThe canonical launcher now fails closed when package-presence probes encounter inconclusive filesystem errors, preserving the original installer resolution diagnostic while retaining global Node lookup behavior. Documentation and comprehensive launcher regressions cover malformed permissions, path traversal failures, and NODE_PATH cases. Sequence diagram for preserving launcher resolution errorssequenceDiagram
participant Launcher
participant Resolver
participant Filesystem
Launcher->>Resolver: resolve(pm-ops/package.json)
Resolver-->>Launcher: resolution error
Launcher->>Resolver: resolve.paths(pm-ops/package.json)
Resolver-->>Launcher: Node lookup paths including NODE_PATH
loop each lookup path
Launcher->>Filesystem: lstatSync(path to pm-ops, throwIfNoEntry false)
alt package path exists
Filesystem-->>Launcher: filesystem entry
else path is absent
Filesystem-->>Launcher: undefined
else probe is inconclusive
Filesystem-->>Launcher: filesystem error
Launcher-->>Launcher: retain packagePresent
end
end
alt package is present or probe is inconclusive
Launcher-->>Launcher: rethrow original resolution error
else package is absent
Launcher-->>Launcher: skip optional package
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
@sourcery-ai the review-budget notice is acknowledged (down-voted only because it carries no finding). @greptile-apps / @coderabbitai thanks — the 5/5 confidence summary and walkthrough match the launcher change; branch updated onto main after #132/#134 merged, waiting for checks. |
|
Tip For best results, initiate chat on the files or code changes.
You are interacting with an AI system. |
Fixes #135.
Canonical launcher catches inconclusive filesystem probe errors and preserves the original resolution diagnostic. Existing global lookup behavior is deliberately unchanged and documented.
PM item: ops-85at (available on main after merge).
Validation: 19 launcher cases pass on Node22.18/24.19/26.10; eight new regression cases fail before the fix. Full coverage on Node22.18 and26.10:455 passed,0failed,2existing skips,100% statements/branches/functions/lines across23sources. Typechecks,lint,duplication,docstrings,package,changelog,release-policy and PM health pass. Coverage used cached optional metadata and a temporary outside-repo launcher disabling implicit npm audits; no repository gate changes.
Pending: explicit production audit awaits user approval to transmit dependency metadata to npm; hosted CI/reviews still required. No release or downstream template propagation yet. Independent gate PRs #132/#134 are untouched.
Summary by Sourcery
Preserve launcher resolution errors when package presence checks cannot conclusively determine whether pm-ops is installed.
Bug Fixes:
Documentation:
Tests:
Summary by cubic
Fixes #135 by preserving the original installer resolution diagnostic when the launcher's package presence probe cannot conclusively determine whether
pm-opsis installed.Previously, an unreadable or malformed lookup path (e.g.
ENOTDIR,ELOOP,EACCES,EPERM) raised a secondary filesystem error that replaced the originalMODULE_NOT_FOUNDmessage and could incorrectly trigger the omit-dev skip path. The probe now fails closed on inconclusive filesystem errors; Node's global lookup behavior, includingNODE_PATH, is intentionally unchanged and documented.Tests
ENOTDIR/ELOOPfailures, controlledEACCES/EPERMprobe failures, and global absent, broken, and working package behavior.Written for commit e3e9618. Summary will update on new commits.