Repository navigation
Promote shared Codex entries without replacing the destination - #1860
Conversation
Architecture-Review: unchanged; account mirroring retains its lock and layout while refusing concurrent destination replacement. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 2caa6acaa6458180e1631a9594fee3903e50464b, 23.6s: request_changes (0 critical, 1 important, 1 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
|
|
||
| def _rename_noreplace(source: Path, target: Path) -> None: | ||
| """Publish a shared entry atomically, including directories.""" | ||
| libc = ctypes.CDLL(None, use_errno=True) |
There was a problem hiding this comment.
suggestion: libc handle and renameat2 lookup are repeated for every entry
ctypes.CDLL(None, use_errno=True) and the renameat2 lookup run on every promoted entry. Resolve them once, either lazily at module level or with functools.cache, and set argtypes/restype (c_int, c_char_p, c_int, c_char_p, c_uint) so the call ABI is explicit and does not depend on ctypes' default int conversion. This also gives one place to decide the unsupported-platform behaviour raised in the other finding.
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on a6a2a19b89ded73aac7d7b4ff3bf51a4c02661a5, 19.5s: approve (0 critical, 0 important, 2 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| _rename_noreplace(entry, target) | ||
| except OSError as exc: | ||
| # A competing writer or unsupported no-replace operation leaves the source local. | ||
| if exc.errno not in {errno.EEXIST, errno.ENOENT, errno.ENOSYS, errno.EINVAL, |
There was a problem hiding this comment.
suggestion: Unsupported no-replace silently stops promotion with no warning
If renameat2 is missing (ENOSYS) or the filesystem rejects RENAME_NOREPLACE (EINVAL/EOPNOTSUPP), or the homes are on different filesystems (EXDEV), every shared entry created in an extra home stays local on every sync. Nothing tells the user, so the homes can drift apart permanently while sync appears to succeed. Leaving the entry in place is the safe choice. But these errnos mean the setup can't promote, not that another writer got there first. The smallest fix is to keep swallowing EEXIST/ENOENT silently and print a one-line warning to stderr for the unsupported or cross-device errnos.
| def create_destination(entry, target): | ||
| if entry == source: | ||
| target.mkdir() | ||
| if unsupported: |
There was a problem hiding this comment.
suggestion: Unsupported-errno cases only run with a destination that already exists
In the ENOSYS/EINVAL cases, the stub creates target and then raises. So the test never covers the main unsupported scenario: the destination is still absent and promotion fails. In that case the source should stay local and unlinked, and other entries should still be mirrored. Add one case where the stub raises before creating the target, then check that source is still a real directory in the extra home, nothing was created in CODEX_MAIN, and notes is still promoted.
|
@Mergifyio queue |
🚫 Left the queue · conflict with base branch4 min in the queue, with no time running CI. So far
Reason The pull request conflicts with Conflicting files: Before this, the pull request was held in the queue behind 2 pull requests ahead of it. To get back in the queue
Times in UTC · dashboard · how the merge queue works |
|
No description provided. |
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on 0bbcd8fffd989e1527e5fc2482e0e68c81d088c0, 22.7s: approve (0 critical, 0 important, 1 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Findings without a file location:
- suggestion: No test for a destination that appears during cross-device promotion — The merge now sends the staged cross-device publish through
_rename_noreplace. That correctly changes main's silentreturnon EEXIST into an EEXIST that the outer handler swallows, and the staged copy is cleaned up. No test covers this path, though.test_account_env_moves_shared_entry_across_devicesonly covers a successful publish and a failed copy.test_sync_preserves_a_shared_directory_created_during_promotiononly covers a same-device rename. If a later change stopped_copy_across_devicesfrom raising EEXIST beforeentry.unlink()/shutil.rmtree(entry)runs, it would delete the local source after losing the race, and no test would fail. Smallest fix: add an"exists"outcome to the cross-device test that createsPath(main) / entry.nameinside the patchedcopy2. Then assert that the local entry is still a regular file with its original content and that the main entry is unchanged.
Native Claude output is retained in the restricted local review receipt.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Promote shared Codex entries without replacing the destination
Context and goal
Closes #1541.
Acceptance
Validation
Recorded for
0bbcd8fffd98uv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Review
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.