Repository navigation
fix(codex): safely unlink generated profiles - #7021
Conversation
Refuse final-component profile symlinks before configuration or recovery journal changes. Unlink the checked regular entry under its canonical parent and preserve recovery evidence when its destination changes. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
✅ Deterministic PR hygiene checks passed. |
Carry the verified rollback, dangling-link and ENOENT follow-up with focused journal regressions. Preserve the existing configuration lock and document its pathname race boundary. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 798080e9ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thanks @luvs01! Reviewed: this fixes a real bug: profile removal passed the realpath to unlink, so a symlinked generated profile deleted its target. Removal now refuses a final-component symlink, unlinks only the verified entry under the canonical parent, journal replay refuses symlinked profiles before touching config or evidence, and config publication is rolled back from the same preimage bytes if a later step throws. Maintainer integration into |
Summary
Generated-profile cleanup refuses final-component symlinks before changing Codex configuration or recovery evidence. Regular profile removal uses the held configuration lock, canonical parent and identity rechecks; pathname unlink is not atomic against writers that ignore that lock.
Journal replay preserves the config/profile pair and recovery evidence for eligible symlinked profiles, including dangling generated links. ENOENT at the final type observation is treated as absence. Profile removal after config publication is covered by
withConfigWriteRecovery, so a later refusal restores the owned config preimage.The follow-up commit
798080e9ed39cc0d3ab4a86c1871fa13d65667caretains the maintainer'sd192960111a4a338da7ec17704fbe6af2ea4b55dmerge of dev and adds the missing recovery cases. All seven files in the complete proposal match the verified source atcc7897e4576d159782cb26ef916dd84da4758d8cbyte for byte.Verification
On the final candidate contents, Windows and Bun 1.4.3 (
c6da4a4d3):bun test --isolate --timeout 60000 tests/codex-integration/codex-journal.test.ts tests/codex-integration/codex-journal-recovery.test.ts: 52 passed, 6 POSIX-only skipped, 0 failed; 318 assertions, 204.98 seconds.bun run typecheck,bun run structure:check,bun run privacy:scan, andgit diff --checkpassed.Keep this PR in Draft pending current-head CI and independent maintainer security review. No installed app, real account or user service was exercised.
Checklist
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Summary by CodeRabbit
Bug Fixes
Documentation