Update llms.txt and AGENTS.md
This commit is contained in:
22
AGENTS.md
22
AGENTS.md
@@ -278,10 +278,30 @@ Two helper functions in `newServer.go` handle context cancellation during stream
|
|||||||
- **Regular files**: streamed into tar archive with content
|
- **Regular files**: streamed into tar archive with content
|
||||||
- **Directories**: included as tar directory entries
|
- **Directories**: included as tar directory entries
|
||||||
- **Symlinks**: stored as symlink entries (target path preserved). Backer never resolves or follows symlinks during directory traversal — it uses `os.Lstat` and `filepath.WalkDir` which do not follow symlinks. This means symlink cycles are impossible to occur.
|
- **Symlinks**: stored as symlink entries (target path preserved). Backer never resolves or follows symlinks during directory traversal — it uses `os.Lstat` and `filepath.WalkDir` which do not follow symlinks. This means symlink cycles are impossible to occur.
|
||||||
|
- **Broken symlinks**: archived with their target path (even if target doesn't exist)
|
||||||
- **Device files** (char/block): included with correct major/minor
|
- **Device files** (char/block): included with correct major/minor
|
||||||
- **Named pipes**: included (header only, no data)
|
- **Named pipes (FIFOs)**: included (header only, no data)
|
||||||
- **Sockets**: skipped (not archivable)
|
- **Sockets**: skipped (not archivable)
|
||||||
- **Hard links**: deduplicated — if multiple files share the same inode, only the first is stored with content, subsequent hard links are stored as link entries pointing to the original
|
- **Hard links**: deduplicated — if multiple files share the same inode, only the first is stored with content, subsequent hard links are stored as link entries pointing to the original
|
||||||
|
- **GNU tar format**: archives use GNU tar format (`header.Format = tar.FormatGNU`) for compatibility with GNU tar utility
|
||||||
|
|
||||||
|
### Archive Test Coverage
|
||||||
|
|
||||||
|
All entity types are tested in `internal/backer/utils_test.go`:
|
||||||
|
|
||||||
|
| Entity Type | Test Function |
|
||||||
|
|------------|---------------|
|
||||||
|
| Regular file | `TestCreateTarGzStreamBasic` |
|
||||||
|
| Empty file | `TestCreateTarGzStreamEmptyFile` |
|
||||||
|
| Directory | `TestCreateTarGzStreamDirectory` |
|
||||||
|
| Symlink | `TestCreateTarGzStreamSymlink` |
|
||||||
|
| Broken symlink | `TestCreateTarGzStreamBrokenSymlink` |
|
||||||
|
| Symlink to directory | `TestCreateTarGzStreamSymlinkToDirectory` |
|
||||||
|
| Hard link | `TestCreateTarGzStreamHardLink` |
|
||||||
|
| Character device | `TestCreateTarGzStreamDeviceFile` (falls back to char device) |
|
||||||
|
| Named pipe (FIFO) | `TestCreateTarGzStreamNamedPipe` |
|
||||||
|
| Special characters in names | `TestCreateTarGzStreamSpecialCharacters` |
|
||||||
|
| Nested files | `TestCreateTarGzStreamNestedFiles` |
|
||||||
|
|
||||||
### Pipe Error Recovery
|
### Pipe Error Recovery
|
||||||
|
|
||||||
|
|||||||
18
llms.txt
18
llms.txt
@@ -133,12 +133,18 @@ Skips files that can't be read (logs warning, continues backup).
|
|||||||
Backup filenames include timestamp and configured prefix: `backup-20060102-150405.tar.gz` (extension depends on compression_algorithm).
|
Backup filenames include timestamp and configured prefix: `backup-20060102-150405.tar.gz` (extension depends on compression_algorithm).
|
||||||
|
|
||||||
### Special File Types
|
### Special File Types
|
||||||
- **Device files** (character/block) are included with correct major/minor numbers.
|
- **Regular files**: streamed into tar archive with content
|
||||||
- **Sockets** are skipped (no entry created).
|
- **Directories**: included as tar directory entries
|
||||||
- **Symlinks** are stored as symlinks (target path stored) - uses os.Lstat, no cycles possible.
|
- **Symlinks**: stored as symlink entries (target path preserved) - uses os.Lstat, no cycles possible
|
||||||
- **Named pipes** and other special files are included (tar header created).
|
- **Broken symlinks**: archived with their target path (even if target doesn't exist)
|
||||||
- **Hard links** are deduplicated - first occurrence stored with content, subsequent as link entries.
|
- **Device files** (char/block): included with correct major/minor numbers
|
||||||
- **Regular files** are compressed; other file types have no data section.
|
- **Named pipes (FIFOs)**: included (header only, no data)
|
||||||
|
- **Sockets**: skipped (not archivable)
|
||||||
|
- **Hard links**: deduplicated - first occurrence stored with content, subsequent as link entries
|
||||||
|
- **GNU tar format**: uses `header.Format = tar.FormatGNU` for GNU tar compatibility
|
||||||
|
|
||||||
|
### Test Coverage
|
||||||
|
All entity types are tested: regular files, empty files, directories, symlinks, broken symlinks, symlinks to directories, hard links, device files, named pipes (FIFOs), special characters in filenames.
|
||||||
|
|
||||||
### Error Recovery
|
### Error Recovery
|
||||||
- `writeWithContext` checks context before calling fn.
|
- `writeWithContext` checks context before calling fn.
|
||||||
|
|||||||
Reference in New Issue
Block a user