Repository navigation
feat(permissions): support private creation through existing verbs - #487
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 18, 2026, 6:48 PM ET / 22:48 UTC (Revision 4). ClawSweeper reviewWhat this changesAdds private permissions to existing Root creation operations and exclusive advanced creation APIs with owned file descriptors, platform ACL checks, and explicit publication outcomes. Merge readiness⛔ Blocked before merge - 4 items remain Keep open: the private-creation capability remains absent from main, and the branch contains useful, coherent work. No concrete blocking code defect was found, but the previous Windows authority-proof gap remains unresolved. Priority: P2 Review scores
Verification
How this fits togetherfs-safe guards filesystem operations requested by Node.js applications. These creation paths turn caller paths, permission options, and mutation-authority checks into new files or directories while preserving existing entries. flowchart TD
A[Caller path and creation options] --> B[Root or advanced creation API]
B --> C[Validate parent and mutation authority]
C --> D[Select platform permission checks]
D --> E[Create private directory or pinned file]
E --> F[Verify identity and publish exclusively]
F --> G[Return owned descriptor or completion]
F --> H[Report publication and cleanup failure]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep privacy opt-in on shared creation owners, preserve existing defaults and entries, and establish Windows access-denial and revoked-authority guarantees through the public APIs before landing. Do we have a high-confidence way to reproduce the issue? Not applicable: this adds creation guarantees and API options rather than reporting broken existing behavior; no concrete introduced failure was established. Is this the best way to solve the issue? Yes, extending existing verbs and guarded owners fits the linked request and avoids a competing private-only API family; the remaining concern is authority evidence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cf8299f85a44. LabelsLabel 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 (3 earlier review cycles) |
4e87525 to
93421f8
Compare
93421f8 to
03eeb95
Compare
What Problem This Solves
Consumers need private files and directories without copying platform-specific permissions, descriptor ownership, and cleanup logic into their applications.
User Impact
private: trueextends existing Root creation operations (mkdir,ensureRoot,create, andcreateJson). POSIX defaults are0700for directories and0600for files. Windows creation applies a protected current-user/System/Administrators DACL. Existing requested directories are validated and never silently repaired.The advanced entry point adds exclusive, nonrecursive
createDirectory,createDirectorySync, andcreateFileSync. The file operation returns an owned descriptor with idempotent disposal. ExistingcreatePrivateDirectorybehavior stays compatible.macOS private creation requires native descriptor ACL inspection and rejects inheritable ACLs that could override mode permissions. Parent ACLs that do not inherit remain usable. Native
offand unavailable inspection reject before creation. Private directory modes000/0200, including equivalent umask restrictions, are unsupported because their ACLs cannot be inspected without widening permissions; private file mode000remains supported.Windows private-file creation requires same-volume hardlinks. Native
offand missing-capabilityautouse the packaged Windows security command bridge;requirerejects missing capabilities before creating parents or staging files.Why This Change Was Made
Keep privacy as a creation option and reuse existing platform owners. Async creation awaits system commands and filesystem work; retained descriptors bind permission changes and publication to the created object. Recovery details distinguish an inner temporary file from the requested destination.
Real platform tests found two permission pitfalls. Elevated Windows tokens can assign Administrators ownership to a new file despite its private inherited DACL; the implementation normalizes current-user ownership through the verified handle and retains strict final validation. On macOS, inherited ACLs can permit reads despite mode
000; parent and object ACL checks prevent that exposure before writing content.Closes #482
Evidence
Final
pnpm checkpassed 13,744 tests with 591 platform skips, plus build, docs, package/import, boundary, and guest protocol checks. Head03eeb954has 31 successful checks and no failures: CI, coverage, and public mutation proof.Fresh installed npm/pnpm tests on macOS cover private/atomic/read-only creation with required flushing, inherited-ACL rejection, and missing-inspector refusal. Missing-addon off/auto installs still exercise ordinary creation.
A fresh AWS Linux machine passed native/WASM builds, 71 focused tests, and installed npm/pnpm creation scenarios with normal and omitted optional dependencies. Later platform-specific repairs receive final-head CI proof.
A fresh AWS Windows machine reproduced elevated-owner rejection, verified corrected ownership and a protected DACL with the original descriptor still writable, and passed 13 command-backend creation tests. Final native Windows CI and installed npm/pnpm package proof passed on Node 22.23.2 and 24.20.0. Downloaded artifacts match the tested commit and clean source tree; native-required and omitted-addon off/auto creation pass, while omitted-required calls refuse mutation.
Real benchmark coverage now includes the three new methods and descriptor disposal; native and fallback sweeps passed. Native buffer equality retains exact byte checks and removes coverage-instrumentation timeouts without increasing timeouts.
Independent reviews found no remaining actionable P0–P2 issues.
Tests added or updated when behavior changed
Security and compatibility impact considered
CHANGELOG.mdupdated when release-relevantNo credentials, private paths, private hosts, or sensitive contents included