Repository navigation
fix(security): fence Root reads against root replacement - #424
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 16, 2026, 5:38 AM ET / 09:38 UTC (Revision 9). ClawSweeper reviewWhat this changesThe branch fences Root reads against replaced directories and files, makes no-clobber moves native-backed, and preserves isolated producer handoff across Windows deletion behavior. Merge readiness⛔ Blocked before merge - 4 items remain The read-fence work remains necessary on current main. No concrete introduced correctness defect was found, but current-revision behavior proof and the previously declared performance qualification remain incomplete. Priority: P2 Review scores
Verification
How this fits togetherRoot is fs-safe’s filesystem capability: it accepts paths beneath a captured directory and returns admitted file handles or contents. The branch also changes how guarded moves and temporary producer files reach their destination. flowchart TD
A[Caller paths] --> B[Captured Root identity]
B --> C[Open and verify file]
C --> D[Recheck root and canonical target]
D --> E[Return bytes or handle]
D --> F[Reject and close descriptor]
B --> G[Admit move or producer parents]
G --> H[Atomic move or pinned handoff]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the complete read fence and accepted atomic-move contract, with demonstrated upgrade behavior and acceptable measured read cost. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a concrete root-swap window between path resolution and file admission on main, and the branch supplies deterministic replacement/restoration regressions. This review did not execute them. Is this the best way to solve the issue? Yes, coupling captured-root checks with exact pathname and canonical-file identity is a focused repair; the included move changes follow the companion PR’s explicitly discussed fail-closed contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 59e85b8656ca. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
HistoryReview history (8 earlier review cycles)
|
|
Exact fail-before proof independently audited by GPT-6 Astra xhigh: ACCEPT.
The root-only mutant is decisive: restored-root and outside-alias cases return replacement bytes while persistent/tail root checks and unchanged controls pass. The final-stage sidecar suite also discriminates permitted exact-unlink recovery from linked/unknown/changed descriptors, ordinary Root reads, and changed ancestry. Candidate Windows Node 24 contention now passes 100/100 root-async acquisitions and 400/400 overall. Coverage and strict paired performance evidence remain pending, so this is not yet a merge decision. |
|
Performance HOLD for exact head Fresh independent GPT-6 Astra xhigh audits verified exact provenance and recomputed all raw gates:
All 36,288 raw samples were retained; controls and orders stayed independent, with no subtraction, exclusions, cross-order pooling, or selective reruns. Exact coverage attempt 2 passed all platforms and merged coverage. Do not merge this head. I am evaluating Astra's phase-fusion design to remove three duplicate filesystem observations while preserving the full final security fence. A replacement must repeat exact review, proof, CI, coverage, and performance evidence. |
|
Performance remains a hard HOLD after phase fusion. A fresh independent GPT-6 Astra xhigh audit of exact head
A separate Astra design consultation found no safely redundant final-fence observation: both pathname checks and both root checks protect distinct phases. I will not remove or merge around those guarantees. The current head |
|
Exact-head performance verdict: HOLD / FAIL. A fresh independent GPT-6 Astra xhigh audit of head
The unavailable cells are the macOS cached-reader control BAAB slice in run This is independently red even before the missing cells. Both root observations and both pathname observations protect distinct phases, so the PR remains open and unmerged rather than weakening the fence. |
Make no-clobber Root moves atomic through native rename primitives and preserve identity-pinned isolated producer handoff, including legacy Windows delete-pending behavior.
Keep boundary error codes and details primary when Windows descriptor disposal also fails. Retain combined-error behavior on POSIX and cover both root and parent admission with real closed-descriptor checks.
Fence Root reads against replacement of the captured root and final path, rejecting swapped trees before returning file contents or handles.
f62de0b to
5434276
Compare
Root reads could return data or handles from a replacement tree after the configured root was swapped. This change verifies the captured Root identity on both sides of final file admission and retains exact file identity through canonical-path checks before returning anything to the caller.
The shared descriptor-opening code is separated from Root-specific admission. Integration retains metadata observation guards and rejects Windows namespace aliases on the new final-canonicalization path before any alias lookup or read. These checks add the two root observations needed to protect the distinct admission boundaries.
The integrated package builds, 94 focused read, sidecar, and pathname-snapshot tests pass, and fresh independent review through P2 is clean. Head
54342760a4e97e23fac571f067251d676eed4d76passed the complete CI matrix, coverage, and the Linux/macOS/Windows mutation proof, then was fast-forwarded onto main.