Documentation / Architecture

Architecture

A small Swift package with no third-party dependency. The engine has no user-interface code, so the app, the command line and the Finder extension all use the same core.

Modules

ModuleRole
ColdpackCorePolicy, watcher, scanner, state store, format learner, the writer for the compressed format, journal, recovery and the engine.
coldpackThe command-line tool.
ColdpackAppThe menu-bar app, written in SwiftUI.
ColdpackFinderThe Finder extension. The bundle script packages it as an app extension.

Coldpack uses only system frameworks and libraries.

Layers of the core

The compressed format

Coldpack writes the format that APFS already understands: a small attribute with a header (magic, type and size), and either the data inline or a resource fork of blocks of 64 KiB, compressed with LZFSE. It sets the compressed flag and releases the plain data. The kernel then expands the data when anything reads the file.

Tests

The suite has more than 350 tests that run against the real file system. Crash tests stop the process at every step of compression and decompression, and check that recovery restores the file. Other tests cover writes during an operation, hard links, links, empty and immutable files, partial clones, the dates, and Git's reaction to a changed change time. Each test names the bug it would catch. A set of render tests draws the app screens to images for review.

Releases

A release build is signed with a Developer ID from the inside out (the tool, the Finder extension, then the app), with the hardened runtime, notarized and stapled.