@openclaw/fs-safe 0.8.5 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.8.6 - 2026-09-07
4
+
5
+ **Highlights:** Clearer guidance for atomic writes on Windows exFAT, with a repeatable filesystem compatibility probe.
6
+
7
+ - Document the existing opt-in locked rename policy for Windows exFAT/FAT32 and add a built-package probe for identity drift, substitution handling, and temporary-prefix isolation; require a trusted, quiescent probe parent and verify its cleanup identity. Thanks @dongsheng123132.
8
+ - Refresh the native zstd decoder to 0.14.0 and compatible Rust and JavaScript development dependencies, and update the pnpm setup action to 6.1.0.
4
9
 
5
10
  ## 0.8.5 - 2026-09-07
6
11
 
Binary file
package/docs/atomic.md CHANGED
@@ -75,12 +75,37 @@ If `beforeRename` throws, the rename is skipped and the owned temp file is remov
75
75
 
76
76
  Identity checks and pathname rename/unlink remain separate syscalls, not atomic conditional mutations. Use an approved writable parent plus cooperative locking or OS isolation when arbitrary concurrent namespace mutation is in scope.
77
77
 
78
- ### FUSE mounts and unstable rename identity
78
+ ### FUSE, Windows exFAT/FAT32, and unstable rename identity
79
79
 
80
80
  Strict source-to-destination identity is the default. Some FUSE mounts assign a different inode to the destination during rename even without concurrency. Set `renameIdentity: "verify-content-with-lock"` to accept that boundary only when the re-opened no-follow destination has the exact requested SHA-256 content under an exclusive hashed sidecar lock in the destination parent. The newly accepted descriptor and identity remain pinned through parent sync and final verification. The synchronous helper provides the same policy with the synchronous lock implementation.
81
81
 
82
82
  This is the same explicit weaker contract available on `Root` writes: cooperating writers are serialized, stale locks fail closed, and mismatched content is rejected after publication without rollback. A same-authority actor that ignores the advisory lock can still substitute another file with identical bytes, so do not use this compatibility policy in directories writable by untrusted same-UID processes.
83
83
 
84
+ Windows exFAT/FAT32 volumes can also change file identity during rename, depending
85
+ on the source and destination names. The destination may already contain the
86
+ requested bytes when strict verification reports `path-mismatch`. A short
87
+ temporary name alone does not guarantee stable identity for a longer destination.
88
+ For an application-controlled directory on such a volume, callers can explicitly
89
+ select `renameIdentity: "verify-content-with-lock"` on `replaceFileAtomic` or
90
+ `replaceFileAtomicSync`. Keep strict mode for directories that require the
91
+ stronger identity contract; do not automatically retry every `path-mismatch`
92
+ with the weaker policy. Staging names remain random, including custom prefixes.
93
+
94
+ To verify the built package against an actual volume, run
95
+ `node scripts/atomic-rename-compat-proof.mjs EXISTING_PARENT` after `pnpm build`.
96
+ Use a trusted parent directory that no other process can rename or modify during
97
+ the entire run, including cleanup; do not point the probe at a shared writable
98
+ volume root. Cleanup checks the created directory's identity before recursive
99
+ removal, but the check and removal are not atomic. The probe does not test safety
100
+ against hostile concurrent namespace mutation.
101
+ The probe creates and cleans up its own child directory and emits JSON without
102
+ local paths. It compares default, strict, and locked policies in both async and
103
+ sync calls, checks real rename identities and file contents, injects different-
104
+ and identical-content substitutions, checks lock cleanup, and exercises custom
105
+ prefix isolation and validation. Callback staging remains strict and can still
106
+ report identity drift; the probe records that result separately. Filesystem type
107
+ must be recorded independently; the probe does not infer it from a drive letter.
108
+
84
109
  ### `EPERM` and copy fallback
85
110
 
86
111
  On systems where `rename` fails with `EPERM`/`EEXIST`, pass
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/fs-safe",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "Capability-style filesystem roots for Node.js apps that handle untrusted relative paths.",
5
5
  "keywords": [
6
6
  "filesystem",
@@ -156,13 +156,13 @@
156
156
  "archive:producer-smoke": "node scripts/archive-producer-smoke.mjs"
157
157
  },
158
158
  "optionalDependencies": {
159
- "@openclaw/fs-safe-darwin-arm64": "0.8.5",
160
- "@openclaw/fs-safe-darwin-x64": "0.8.5",
161
- "@openclaw/fs-safe-linux-arm64-gnu": "0.8.5",
162
- "@openclaw/fs-safe-linux-arm64-musl": "0.8.5",
163
- "@openclaw/fs-safe-linux-x64-gnu": "0.8.5",
164
- "@openclaw/fs-safe-linux-x64-musl": "0.8.5",
165
- "@openclaw/fs-safe-win32-x64-msvc": "0.8.5",
159
+ "@openclaw/fs-safe-darwin-arm64": "0.8.6",
160
+ "@openclaw/fs-safe-darwin-x64": "0.8.6",
161
+ "@openclaw/fs-safe-linux-arm64-gnu": "0.8.6",
162
+ "@openclaw/fs-safe-linux-arm64-musl": "0.8.6",
163
+ "@openclaw/fs-safe-linux-x64-gnu": "0.8.6",
164
+ "@openclaw/fs-safe-linux-x64-musl": "0.8.6",
165
+ "@openclaw/fs-safe-win32-x64-msvc": "0.8.6",
166
166
  "jszip": "^3.10.1"
167
167
  },
168
168
  "devDependencies": {