Commit graph

9 commits

Author SHA1 Message Date
vrubelroman
7f14fcbe33 fix(sftpfs): return fast from a cancel on a frozen link
When the ctx a remote file was opened with is cancelled while one of its
operations is still stuck, probe the connection after a short grace
period and tear it down if the keepalive goes unanswered. A cancel in the
middle of a file on a frozen network now returns in about 2 s with the
default keepalive instead of up to 40 s; a slow but live link is left
alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 04:16:44 +03:00
vrubelroman
2b1b9b0e95 feat(vfs/archivefs): read-only FS over an archive index; read-only conformance (5A.2)
archivefs mounts an archive by indexing it: no temp directory, virtual posix
paths, symlinks resolved inside the archive (absolute and escaping links are
broken), members opened directly (zip) or by a sequential scan (tar). All
mutations return ErrReadOnly (U-P0-2). vfstest.RunReadOnly checks any
read-only FS against a fixture tree; it runs on zip, tar and tar.gz mounts
and on vfs.ReadOnly(localfs). archive.OpenMember opens a single member.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 04:12:50 +03:00
vrubelroman
38e05c695f feat(vfs): add sftpfs over pooled SSH connections (2B.5)
SFTP implementation of vfs.FS on a conn.Lease: passes the conformance
suite on the in-process stand (and on a real sshd under the integration
tag), including RemoveTree on a symlink to a directory (N-P0-3).
Volume is the host key fingerprint (N-P0-5); metadata calls return on
ctx cancel, a watchdog probes hung calls; io.Copy uses concurrent
reads/writes (N-P1-6). Connection errors map to vfs.ErrConnLost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 03:59:47 +03:00
vrubelroman
1c57f92c42 feat(paths,atomicfile): XDG/sudo path rules and atomic local file writes (2C.1)
paths: config lookup -config → $VCOM_CONFIG → XDG → ~/.config (never the
working directory; StrayCwdConfig only reports one), state/cache/data dirs
of the effective user under sudo (inherited XDG_* ignored for writes),
run-<pid> dir with a sweep of dead processes' dirs (U-P1-15).
atomicfile: temp + fsync + rename + dir fsync; keeps the old file on any
error, writes through symlinks and keeps mode/owner of an existing file.
The trash now takes its home from paths.DataHome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:31:14 +03:00
vrubelroman
39e8264528 feat(vfs/localfs): freedesktop trash with topdir support (2A.4)
Items on another volume go to $topdir/.Trash/$uid (real, sticky .Trash only)
or $topdir/.Trash-$uid instead of failing with EXDEV (N-P2-12). The
.trashinfo is reserved with O_EXCL (collisions get a .N suffix and skip
orphans in files/), Path= is URL-encoded, DeletionDate is local time, and
under sudo the effective user's trash is used. The old UI's MoveToTrash now
delegates here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:28:31 +03:00
vrubelroman
9d5b6bf0c4 test(vfs/vfstest): conformance suite and FaultFS; run it on localfs (2A.3)
vfstest.Run checks any writable vfs.FS through the API only (so it also runs
over SFTP): Lstat/Stat/ReadDir with symlinks, Create Excl/Trunc, ReadAt,
Mkdir, Rename in both modes, Remove (file, link, empty and non-empty dir),
RemoveTree on a link to a directory, Chmod/Chtimes, RealPath, Sync and the
error mapping. FaultFS hooks every FS and File method; FailNth and Gate
cover ENOSPC on the n-th write and blocking ReadDir.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:26:28 +03:00
vrubelroman
5132daa292 feat(vfs): Walk, RemoveTree, DirSize, SameFile and Within helpers (2A.2)
One implementation for every FS. Walk and RemoveTree never follow symlinks,
so deleting a link to a directory removes only the link (N-P0-3). DirSize
returns the root error and counts unreadable subdirectories instead of
reporting a silent 0 B (N-P1-14). SameFile compares inodes locally and
RealPath on other volumes, so an alias directory is recognised (N-P0-6);
Within resolves symlinks on both sides and accepts a not-yet-existing child.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:24:12 +03:00
vrubelroman
c3de5a06ef feat(vfs/localfs): local vfs.FS with renameat2 NOREPLACE and lazy birth time (2A.1)
ReadDir has lstat semantics and resolves symlink targets (NavigableDir for
links to directories, Target=nil + LinkErr for broken links: U-P1-2 at the
data level). Birth time is only computed through BirthTimer. NoReplace falls
back to link+unlink, then to an Lstat check, when renameat2 is unsupported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:22:49 +03:00
vrubelroman
2db51e9385 feat(vfs): define the vfs.FS contract, sentinels, PathOps and ReadOnly wrapper (2.0)
Types and interfaces from design §2.1: FS, File, FileInfo, Caps, VolumeID,
RenameMode, CreateMode, PathOps (posix and native), Location.Same, the
optional Trasher/BirthTimer/Execer interfaces and ReadOnly(fs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:21:41 +03:00