forked from lidge-jun/opencodex
-
Notifications
You must be signed in to change notification settings - Fork 0
[WRONG BRANCH] fix(codex): restore unprobeable launcher on shim rollback #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+46
−3
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: luvs01/opencodex
Length of output: 195
🏁 Script executed:
Repository: luvs01/opencodex
Length of output: 44682
🌐 Web query:
Bun node:fs existsSync dangling symlink behavior lstatSync💡 Result:
In Bun, the behavior of fs.existsSync and fs.lstatSync regarding symbolic links is consistent with Node.js [1][2]. fs.existsSync The fs.existsSync function checks for the existence of a file by following symbolic links [3]. If a path is a dangling (broken) symbolic link—meaning the symlink itself exists, but its target does not—fs.existsSync will return false [4]. Because it follows the link to the target, it effectively tests for the existence of the target, not the symlink itself [3]. fs.lstatSync The fs.lstatSync function does not follow symbolic links [5]. It retrieves the file status (metadata) of the symbolic link itself [6][7]. Therefore, if you use lstatSync on a dangling symbolic link, it will successfully return an fs.Stats object for the link itself, rather than throwing an error or attempting to access the missing target [5][6]. You can confirm a path is a symbolic link using the isSymbolicLink method on the returned stats object [5][8]. Summary for Differentiating To determine if a path is a dangling symlink, you can combine these two behaviors: if lstatSync succeeds (indicating the path exists) but existsSync returns false (indicating the target is missing), the path is a dangling symbolic link [4].
Citations:
Detect backup entries without following symlinks.
At
src/codex/shim.ts:840-843,existsSync()returnsfalsefor a dangling symlink in Bun. The rollback then skips the backup, leaving the original launcher attarget.backupPath. UselstatSync()to detect the entry and treat an unfingerprintable backup as a validation failure.🤖 Prompt for AI Agents