Repository navigation
fix: harden filesystem safety variants under stress - #113
Merged
Merged
Conversation
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix: harden filesystem safety variants under stress This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes a set of reproducible edge cases where consumers exercising concurrent writers, replacement races, alternate native/fallback paths, hostile archive/path inputs, or packed-package variants could see backend-dependent failures, incomplete cleanup, unsafe diagnostics, or missing package assets.
The failures span Root confinement and identity, atomic publication, archives, stores and queues, locks, secrets and permissions, bounded reads, utility paths, native pinned writes, and package assembly. Each was minimized into deterministic regression coverage; the permanent seeded property suite also covers 47,760 path/archive/filename cases across five recorded seeds.
Why This Change Was Made
The fixes keep mutation ownership at the primitive that can prove it: same-target operations serialize before destination inspection, cleanup is identity-conditioned, publication applies modes before commit through descriptors, and Root handles remain pinned to their original directory identity. Archive and diagnostic validation is centralized so JavaScript/native and filesystem-normalization variants fail consistently.
No public API is added. Existing fail-closed confinement, symlink/hardlink policy, error-code, exact-mode, and packaging contracts are preserved; docs and
Unreleasednotes describe the observable changes.User Impact
Consumers can safely overlap ordinary Root/FileStore writes without spurious
path-mismatch, rely on cleanup not deleting swapped-in replacements, get consistent native/fallback collision and mode behavior, and receive portable archive collision rejection and sanitized path diagnostics. The packed README now includes its banner asset, and package smoke no longer leaks pnpm-only configuration warnings into npm subprocesses.Evidence
pnpm check: 89 files passed, 927 tests passed, 59 platform/optional skips; build, docs, filesystem-boundary lint, file-size lint, and pack check passed.JavaScript-only
pnpm test:coverage: 89 files passed, 926 tests passed, 59 skips; statements 85.64%, branches 78.93%, functions 86.71%, lines 87.13%.Native-enabled
pnpm test:coverage: 90 files passed, 988 tests passed, 23 skips; statements 88.97%, branches 81.76%, functions 88.59%, lines 90.57%.Native mode smokes:
auto,require, andoffpassed on darwin-arm64; Rust native suite passed 16/16.Stability lane: 16 shuffled full-suite runs across worker counts 1/2/4/8 and 32 shuffled focused repeats passed. The integration-found same-target resolution race then passed 10 focused repetitions plus native coverage after its fix.
Package matrix: all 21 public subpaths, Node 24/26, normal/production/omit-optional install shapes, declarations, tree-shaking, README asset, and host native package modes passed. GitHub CI covers Node 22 and foreign platforms.
Source-blind packed-artifact contract: 21 subpaths imported; 32 overlapping Root writes, 12 copies, and public/private store overlaps completed with intact bytes; traversal preserved the outside sentinel; permission remediation and NUL diagnostics matched contract.
Final autoreview: TruffleHog clean; no accepted/actionable findings (0.95).
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