Repository navigation
chore(audit): pin the dead-code audit to [email protected] - #12165
Conversation
pnpm dlx knip@5 downloads and runs whatever the newest 5.x is at invocation time, outside lockfile integrity review — flagged P2 by the v1.4.165-rc.0 release scan. Pin the exact version, matching the [email protected] pattern one line up. Why dlx rather than a devDependency: knip 5.x peer-depends on typescript@^5, and this repo is on typescript 7.0.2 — installed as a devDependency, pnpm resolves knip against TS 7 and knip crashes at module load (verified: same knip against a TS 5 peer runs clean). The dlx sandbox auto-installs knip's own TS 5, which is the environment the original #12077 sweep actually ran in.
Greptile SummaryPins the
Confidence Score: 5/5Safe to merge — a one-token version pin in a manual-only audit script with no CI, release, or install-path involvement. The only changed file is Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| package.json | Single-token version pin: knip@5 → [email protected] in the manual audit:dead-code script; version is a legitimate published release with no known security issues. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Developer runs\npnpm audit:dead-code] --> B[pnpm dlx [email protected]]
B --> C[dlx fetches [email protected]\nwith its own TS 5 peer\nisolated sandbox]
C --> D[knip runs against\nconfig/knip.json]
D --> E{Findings?}
E -- Yes --> F[exit 1 + report]
E -- No --> G[exit 0]
style B fill:#90EE90,stroke:#228B22
style C fill:#fffbe6,stroke:#ccaa00
Reviews (1): Last reviewed commit: "chore(audit): pin the dead-code audit to..." | Re-trigger Greptile
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
pnpm dlx knip@5 downloads and runs whatever the newest 5.x is at invocation time, outside lockfile integrity review — flagged P2 by the v1.4.165-rc.0 release scan. Pin the exact version, matching the [email protected] pattern one line up. Why dlx rather than a devDependency: knip 5.x peer-depends on typescript@^5, and this repo is on typescript 7.0.2 — installed as a devDependency, pnpm resolves knip against TS 7 and knip crashes at module load (verified: same knip against a TS 5 peer runs clean). The dlx sandbox auto-installs knip's own TS 5, which is the environment the original stablyai#12077 sweep actually ran in.
Summary
Pins the manual dead-code audit script to an exact knip version:
pnpm dlx knip@5→pnpm dlx [email protected]. The floating major was a P2 in the v1.4.165-rc.0 prod release scan:dlxdownloads and executes whatever the newest matching release is at invocation time, outside lockfile integrity review. This matches the exact-pin pattern already used byaudit:react-doctor([email protected]) one line up. One-token change; the script is manual-only (not wired into CI, release, or install paths).Why not a devDependency (the otherwise-preferred fix): knip 5.x peer-depends on
typescript@^5, and this repo is on[email protected]. Installed as a devDependency, pnpm resolves knip's peer against the workspace TS 7 and knip crashes at module load (TypeErrorin itstimerifywrapper — it wraps a compiler-API function that no longer exists in the native TS 7). A/B-verified: the same knip 5.88.1 against a TS 5 peer runs clean. Thedlxsandbox auto-installs knip's own TS 5, which is the environment the original #12077 sweep actually ran in — sodlxhere is load-bearing, not laziness. If knip ships TS 7 support later, moving it intodevDependencies+ plainknipin the script becomes the right follow-up.Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildThe four package commands don't exercise this manual script. Direct verification instead:
pnpm dlx [email protected] --config config/knip.jsonruns against the repo and produces a normal findings report (exit 1 = findings present, knip's standard reporting behavior).[email protected]as peer → crashes at module load; identical setup withtypescript@^5→ runs clean. This is why the PR keepsdlx.AI Review Report
Reviewed as a follow-up from the v1.4.165-rc.0 prod release scan (security worker flagged the floating version). Risks checked: whether the devDependency route was viable (no — TS 7 peer crash, verified empirically rather than assumed), whether the pinned version works against
config/knip.json(yes, live run), and whether the script participates in CI/release paths (it does not; manual-only). Cross-platform: the script change is a version string inside an existingpnpm dlxinvocation; no shortcuts, paths, shell behavior, or Electron surface involved — behavior is identical on macOS, Linux, and Windows.Security Audit
This PR is itself a supply-chain hygiene fix: it closes the window where a compromised future
[email protected]release would run on a developer machine viapnpm dlx's fetch-and-execute. No new inputs, command execution, auth, secrets, or IPC surface. Residual:dlxstill auto-installs knip's transitive deps and TS 5 peer unpinned inside its sandbox at the pinned knip version — fully closing that requires the devDependency route, blocked on knip supporting TS 7. The$schemaURL inconfig/knip.json(unpkg.com/knip@5/schema.json) is editor-tooling metadata, never executed, and stays as-is.Notes
react-doctor.devDependencies+pnpm execso the lockfile owns the integrity hash end to end.