Repository navigation
fix(temp): accept signed Node directory identities - #586
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 maintainer review before merge. Reviewed September 21, 2026, 9:15 PM ET / September 22, 2026, 01:15 UTC (Revision 3). ClawSweeper reviewWhat this changesAccept signed Node device and inode values during secure temporary-directory admission and repair, with matching documentation and regression coverage. Merge readiness✅ Ready for maintainer review This remains a useful, focused correction absent from current main and v0.18.0. No actionable correctness or security defect was found, and the refresh preserves the previously reviewed implementation. Priority: P2 Review scores
Verification
How this fits togetherThe secure temporary-directory resolver selects and checks directories used by temporary workspaces, file stores, and archive staging. It validates filesystem observations and repairs permissions through a pinned descriptor before returning a usable path. flowchart TD
A[Requested temporary directory] --> B[Read filesystem identity]
B --> C{Identity and owner valid?}
C -->|No| D[Reject directory]
C -->|Yes| E{Permissions need repair?}
E -->|Yes| F[Pinned descriptor repair and verification]
F --> G[Return usable directory]
E -->|No| G
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Use the additive signed-range correction while retaining raw identity equality and all existing ownership, permission, and descriptor safeguards. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main rejects negative bigint identities that Node's stat conversion can preserve. No real high-bit filesystem reproduction was executed in this review. Is this the best way to solve the issue? Yes. Adjusting the shared range guard is the narrowest repair; preserving raw comparisons avoids aliasing different adapter representations or breaking previously accepted positive values. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5a92ace38302. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
What Problem This Solves
Fixes secure temporary-directory admission rejecting valid negative device or inode observations returned by Node's bigint stat representation.
User Impact
Consumers can admit and repair directories whose raw Node identity has its sign bit set. Inode zero, values below the signed 64-bit minimum, unsafe ownership or permissions, symlinks, and changed identities remain refused.
Why This Change Was Made
Node exposes these stat fields through
BigInt64Array. The shared receipt guard now accepts its signed range while preserving every previously supported positive adapter value, including values above the unsigned 64-bit range. It keeps exact raw comparisons: signed and unsigned encodings of the same bits remain different identities. Descriptor ownership, no-follow opening, chmod, final verification, and close behavior are unchanged.This is an additive receipt-validation correction: production +6/-1 lines; tests +71/-7. No native implementation, public type, dependency, version, or release change.
Evidence
Direct actual-source red/green on Node 26.7.0, macOS arm64: the original guard rejects a high-bit identity projected through
BigInt64Array; the changed owner passes 78 checks covering admission, repair/finalization, malformed facts, and exact identity mismatches. These use descriptor adapters, not a real high-bit filesystem.Existing descriptor and race suites now cover signed bounds, uncapped positive compatibility, creation/repair, signed-versus-unsigned mismatches, bigint precision, replacement preservation, and close/error precedence.
File-size guard, changed TypeScript parse checks, and
git diff --checkpassed. Independent source and regression reviews plus scoped autoreview found no actionable issue.Canonical Linux Node 24 CI passed
pnpm check, including package checks: 12,098 tests passed and 3,505 were skipped. The five secure-temp suites contributed 316 passes and one Windows-only skip; the changed descriptor/race suites passed all 165/114 cases. This tested the original reviewed9580c4b3559d9ce5aef872f6d349f640d2a8dbddcomposition on Node 24.20.0 and pnpm 12.4.2; its result remains component evidence after the required base refresh. The Windows full check passed, but these POSIX-only descriptor/race cases were skipped there.The same 78 direct-owner assertions also passed on Bun 1.4.2, macOS arm64, using an isolated official binary authenticated against the release API digest and its published SHA-256 list. Source bytes remained unchanged. This proves the actual receipt/repair owner with adapters under Bun; full canonical Bun secure-temp suites and a real high-bit filesystem were not exercised.
Strict branch policy required refreshing the otherwise green original head onto canonical main
5a92ace383025ce7d4e0ae1431f1b3f9d66a11ce. Signed merge33436f37f3b4060784250eabdbea24ef05dee30fpreserves the four owner/test/docs postimages exactly and combines both changelog entries; the only main change is the already-landed lock option type refactor. Independent composition review and fresh scoped autoreview passed. All 24 strict required contexts passed on this exact head, including merged coverage and CodeQL. The latest exact-head ClawSweeper revision 3 reports no finding or before-merge action.Fresh composed-head Linux Node 24 proof passed
pnpm checkon syntheticaf7906ca8e4d28980627d1d41e7e0a2457875f00, whose source tree exactly matches reviewed33436f37f3b4060784250eabdbea24ef05dee30f. The changed descriptor/race suites again passed 165/114 cases; all five secure-temp files contributed 316 passes and one Windows-only skip. Windows platform/native/package checks passed, with the POSIX-only signed regression suites skipped there.The existing CI matrix supplies the current-head platform/package gates. No repository dependency installation or new workflow was added. No integrated application failure-cause claim is made.
Native FreeBSD owner proof passed on FreeBSD 15.1-RELEASE-p3 x64, Node 24.21.0, root. On the same real stat with device
-5291551583207762996, the old published receipt guard rejected the identity and this repaired owner admitted its raw values unchanged. Four real0777/0500× repair/finalization cases reached0700, preserving identity, parent and sentinel facts; each opened/closed once and verified the closed descriptor withEBADF. Source hashes matched, task cleanup removed its directory, and exit was zero. The repaired source is byte-identical in reviewed33436f37f3b4060784250eabdbea24ef05dee30fand landed9a0b7258043c599672f364b1f3aaed63db81e1f2. Independent terminal receipt audit passed (66,060 bytes, SHA-2568554a1ae5918459e9cabeb224b166870b11d0a9d2083992da07868f354bf73f3). This establishes direct native owner behavior, not integrated OpenClaw success or unique attribution of the earlier application throw. No release or downstream dependency update occurred.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