fix(install): deduplicate binary aliases - #963
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR deduplicates competing Hunk aliases using canonical executable identities and uses those identities to calculate PATH shadowing through symlinked directories.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking issue where alias-first PATH ordering can degrade package-manager-specific remediation. Canonical deduplication and shadowing behavior are covered by focused tests, but discarding later recognizable physical paths can cause the installer to classify a known installation as generic. Files Needing Attention: install.sh Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
PATH[PATH entries and managed-tool scans] --> Candidate[Candidate executable path]
Candidate --> Canonical[Resolve canonical executable identity]
Canonical --> Seen{Identity already seen?}
Seen -->|Yes| Skip[Suppress duplicate alias]
Seen -->|No| Store[Store identity and first display path]
Store --> Shadow[Compare canonical PATH positions]
Store --> Classify[Classify retained display path]
Classify --> Remediation[Render conflict remediation]
Prompt To Fix All With AI### Issue 1
install.sh:184-190
**Alias retention degrades remediation**
When a symlinked alias appears before a recognizable Homebrew, npm, nvm, or mise path for the same executable, canonical deduplication retains only the alias for channel classification, producing generic package-manager removal guidance instead of the available channel-specific remediation.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(install): deduplicate binary aliases" | Re-trigger Greptile |
| if [ -n "$hunk_candidate_identities" ] && printf '%s\n' "$hunk_candidate_identities" | grep -Fqx "$candidate_identity"; then | ||
| return 0 | ||
| fi | ||
| hunk_candidate_identities="${hunk_candidate_identities}${hunk_candidate_identities:+ | ||
| }${candidate_identity}" | ||
| hunk_candidates="${hunk_candidates}${hunk_candidates:+ | ||
| }${candidate}" |
There was a problem hiding this comment.
Alias retention degrades remediation
When a symlinked alias appears before a recognizable Homebrew, npm, nvm, or mise path for the same executable, canonical deduplication retains only the alias for channel classification, producing generic package-manager removal guidance instead of the available channel-specific remediation.
Prompt To Fix With AI
This is a comment left during a code review.
Path: install.sh
Line: 184-190
Comment:
**Alias retention degrades remediation**
When a symlinked alias appears before a recognizable Homebrew, npm, nvm, or mise path for the same executable, canonical deduplication retains only the alias for channel classification, producing generic package-manager removal guidance instead of the available channel-specific remediation.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Fixed in ff89c3e. Deduplication still uses canonical executable identity, but diagnostics now retain every discovered alias and prefer a manager-shaped alias with the same identity for channel classification and removal guidance. The regression test models npm’s real nvm bin/hunk symlink into lib/node_modules/hunkdiff/bin/hunk.cjs and verifies the version-specific npm command is retained.
Responded by Pi using openai/gpt-5.6-sol.
This comment was generated by Pi using GPT-5.6 Sol
Summary
Follow-up to #960.
Validation
bun test scripts/install-sh.test.ts— 16 passedbun run typechecksh -n install.shshellcheck -s sh install.shbunx oxfmt --check scripts/install-sh.test.tsgit diff --checkThis PR description was generated by Pi using GPT-5.6 Sol