feat: add realpath command for resolving canonical virtual filesystem paths - #447
felixarntz wants to merge 13 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 auto-maintain reviewAutomated, advisory triage for
Review panel: 🟡 medium highest severity just-bash maintainer code review: 🟡 medium
General code review: 🟡 medium
Adversarial security: 🟢 low
Adversarial security (second opinion): 🟡 medium
Standard Bash and host portability: 🟡 medium
Posted by auto-maintain. This automated code review is advisory; a human maintainer makes the call. |
|
A new push changed this PR and the review now contains a higher-severity finding. See the updated review comment above. |
…erent fs implementations
|
@cramforce I addressed the auto-maintain feedback from #447 (comment) and the security feedback from #447 (comment) and #447 (comment) one thing worth highlighting: there's now a new |
Adds a native
realpath FILE...command to just-bash. This removes the need for consumers to seed areadlink-based workaround, as described in vercel/ai#20989.just-bashalready provided the foundation forrealpath, but not an actual command for it.The command delegates canonicalization to the filesystem abstraction, supports multiple operands,
--help, and--, and preserves exact canonical path strings, including whitespace and newlines. In-memory path resolution now follows chained intermediate symlinks so command output and filesystem operations agree.Given security considerations and edge-cases, achieving parity with the real Bash
realpathcommand uncovered flaws in the underlyingIFileSystemimplementations, which this PR addresses (see intermediate agent reviews). To avoid increasing complexity in duplicate implementations, several chunks of common logic shared across the implementations were broken out into shared utility functions.