Repository navigation
feat(advanced): retain symlink identity through no-replace publication - #682
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 25, 2026, 2:27 PM ET / 18:27 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch adds an advanced POSIX API that retains a caller-staged symlink through no-replace publication and explicit recovery, with native support, tests, documentation, benchmarks, and CI coverage. Merge readiness⛔ Blocked before merge - 6 items remain Keep open. Current main and v0.19.0 lack the capability, and the linked issue remains open. The branch has useful, focused coverage, but a security contract decision from the previous review remains unresolved, and cleanup has an actionable absence-settlement defect. Priority: P2 Review scores
Verification
How this fits togetherThe advanced package accepts a staged filesystem entry, caller-captured identity, and a synchronous authority check. Native operations use retained directory and symlink handles to publish or remove an entry, then return receipts describing the outcome. flowchart LR
A[Caller-staged symlink] --> B[Captured identity and authority]
B --> C[Retained parent and link handles]
C --> D{Checks still pass?}
D -->|yes| E[No-replace publication or recovery]
D -->|no| F[Failure or preservation receipt]
E --> G[Publication or cleanup receipt]
Decision needed
Why: The API cannot make its identity check and pathname syscall atomic, and the previous review requested an explicit decision on that security boundary. Before merge
Findings
Agent review detailsSecurityNeeds attention: The new filesystem authority path depends on a cooperative-writer boundary that still needs explicit acceptance and final-effect evidence. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Ship the narrow API with an approved cooperative-writer contract and demonstrated caller coordination through native I/O; make recovery report an absent name accurately. Do we have a high-confidence way to reproduce the issue? Yes for the review finding, from source: have the synchronous authority callback remove the name after recovery's first match; the second match throws ENOENT instead of returning name-absent. This read-only review did not execute the scenario. Is this the best way to solve the issue? Unclear: retained handles and native no-replace publication are a focused implementation, but the public cooperative-writer boundary needs approval and recovery needs the absence fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e4178ee5393a. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Summary
retainSymlinkInDirectory()to the advanced POSIX surface, admitting an already-staged caller-owned symlink against exact captured identity, ownership, change time and target.Closes #681.
Boundaries
This is a narrow retained-symlink lifetime, not a general rename session, a change to
Root.move(), or a symlink-creation API. The caller coordinates creation/capture/admission and supplies a synchronous authority assertion. The native handle pins identity after admission. Identity prechecks plus rename/unlink are not CAS; the documented final syscall gap still requires cooperative writers. Native-off, unavailable/older bindings and Windows fail before namespace mutation. No package release or crash-recovery guarantee is included.The retained installer is the consumer. This prerequisite deliberately adopts the documented cooperative-writer contract through the final check-to-syscall gap; it does not promise adversarial CAS. Downstream installer acceptance must establish that coordination. Package release and downstream full-state update/recovery acceptance remain separate gates.
Validation
ab7f5f57d9c369d09ab226aa09a974873e3c0672. It statically reviewed source and entire touched tests; it did not independently rerun tests. An earlier macOS special-file admission finding was fixed with no-follow preflight, exact opened-identity verification and metadata-only/no-controlling-terminal flags.pnpm checkwas attempted: initial docs/toolchain failures were fixed; the later run encountered six unrelated 5-second test timeouts. The serialized full run completed 15,909 tests successfully with two 5-second timeouts in unchanged queue/lock suites. Both exact suites then passed all 125 tests in isolation with unchanged timeouts; the final installed-package/export/declaration/error-code check passed. All other local check constituents passed. No all-green local aggregate is claimed. All 24 required exact-head hosted checks passed, including the default-concurrency checks, native Linux/musl/macOS/Windows, package smoke on all six OS/Node combinations, CodeQL, and merged coverage. CI · Coverage · CodeQL.The new real-filesystem cases are included in the existing native Linux/macOS and musl CI lanes. Draft #665 remains independently owned; this change adds only its own module registration in
native/src/lib.rsand does not alter #665’s directory-observation declarations/functions.