Skip to content

fix: harden filesystem safety variants under stress - #113

Merged
steipete merged 11 commits into
mainfrom
fix/stress-all-variants
Aug 3, 2026
Merged

steipete merged 11 commits into
mainfrom
fix/stress-all-variants

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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 Unreleased notes 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, and off passed 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.md updated when release-relevant

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

@steipete
steipete requested a review from a team as a code owner August 3, 2026 02:32
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
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.

@steipete
steipete merged commit 2958fb5 into main Aug 3, 2026
22 checks passed
@steipete
steipete deleted the fix/stress-all-variants branch August 3, 2026 02:50
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant