Skip to content

fix(temp): accept signed Node directory identities - #586

Merged
vincentkoc merged 2 commits into
mainfrom
fix/signed-temp-directory-identity
Sep 22, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/signed-temp-directory-identity

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

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 --check passed. 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 reviewed 9580c4b3559d9ce5aef872f6d349f640d2a8dbdd composition 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 merge 33436f37f3b4060784250eabdbea24ef05dee30f preserves 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 check on synthetic af7906ca8e4d28980627d1d41e7e0a2457875f00, whose source tree exactly matches reviewed 33436f37f3b4060784250eabdbea24ef05dee30f. 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 real 0777/0500 × repair/finalization cases reached 0700, preserving identity, parent and sentinel facts; each opened/closed once and verified the closed descriptor with EBADF. Source hashes matched, task cleanup removed its directory, and exit was zero. The repaired source is byte-identical in reviewed 33436f37f3b4060784250eabdbea24ef05dee30f and landed 9a0b7258043c599672f364b1f3aaed63db81e1f2. Independent terminal receipt audit passed (66,060 bytes, SHA-256 8554a1ae5918459e9cabeb224b166870b11d0a9d2083992da07868f354bf73f3). 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.md updated when release-relevant

  • No credentials, private paths, private hosts, or sensitive contents included

@vincentkoc vincentkoc self-assigned this Sep 22, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 22, 2026 00:48
@vincentkoc
vincentkoc requested a review from a team as a code owner September 22, 2026 00:48
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 9:15 PM ET / September 22, 2026, 01:15 UTC (Revision 3).

ClawSweeper review

What this changes

Accept 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
Reviewed head: 33436f37f3b4060784250eabdbea24ef05dee30f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, compatible correction with meaningful boundary coverage and no actionable review findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the ordinary contributor proof gate. Reported Node/Bun adapter runs exercise the changed receipt and repair owner, but do not establish real high-bit filesystem behavior; inspection found no unresolved authority violation requiring additional final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the ordinary contributor proof gate. Reported Node/Bun adapter runs exercise the changed receipt and repair owner, but do not establish real high-bit filesystem behavior; inspection found no unresolved authority violation requiring additional final-effect proof.
Evidence reviewed 9 items Introduced change: The pinned delta changes only the identity range guard, two regression suites, documentation, and the Unreleased changelog. Exact identity comparisons, owner checks, no-follow opening, descriptor chmod, and closing remain intact.
Current main still rejects signed identities: The current-main receipt guard rejects every negative device or inode value, so the central correction is still necessary.
Latest release lacks the correction: The supplied latest release, v0.18.0, contains the same nonnegative-only device and positive-only inode guard.
Findings None None.
Security None None.

How this fits together

The 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
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta Production +6/-1; tests +71/-7 The small production expansion corrects a verified runtime representation mismatch and preserves positive-value compatibility.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This fixes a bounded temporary-directory admission failure for signed filesystem identities without evidence of an urgent widespread outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the ordinary contributor proof gate. Reported Node/Bun adapter runs exercise the changed receipt and repair owner, but do not establish real high-bit filesystem behavior; inspection found no unresolved authority violation requiring additional final-effect proof.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 6821485 adds src/secure-temp-repair.ts:49 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6821485a50cf; files: src/secure-temp-repair.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-22T00:52:37.751Z sha 9580c4b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-22T01:04:51.450Z sha 9580c4b :: needs maintainer review before merge. :: none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant