Skip to content

Architecture Overview

fialr is local-only archival infrastructure. Every design decision traces back to seven ordered principles. This page documents those principles, the platform adapter layer, the configuration system, and the two-layer metadata architecture.

Ordered by priority. When principles conflict, the higher-ranked principle wins.

#PrincipleImplementation
1Provenance over convenienceAppend-only operation ledger. Original state always recoverable.
2Content hash as identityBLAKE3 primary, SHA256 secondary. Filenames and paths are mutable metadata.
3SQLite as ledger, XATTRs as cacheSQLite is authoritative on every platform. XATTRs are silently omitted where unsupported.
4Local-only enrichmentOllama on localhost only. Abstracted behind inference.py so cloud endpoints cannot be configured.
5Safety by defaultDry-run on. Explicit flag to execute. No destructive operation runs without human approval.
6Schema as versioned documentschema.yaml carries a version field. Migrations committed before files move.
7Portability over lock-inSQLite, TOML, YAML, standard Python, no proprietary stores.

Core modules never contain platform-specific code. No if sys.platform outside platform/. Core imports from platform/base.py and receives the correct adapter at runtime.

CapabilitymacOSLinuxWindows
Extended attributescom.fialr.* via xattruser.fialr.* via pyxattrNTFS ADS (limited)
Default vaultAPFS encrypted sparse bundleVeraCryptVeraCrypt
Sync pausebrctl pause com.apple.CloudDocsN/AN/A
StatusImplementedPlannedPlanned

macOS is the primary platform. Linux and Windows adapters are defined but not yet fully tested.


fialr uses three configuration files, all in the config/ directory:

FileFormatPurpose
fialr.tomlTOMLPrimary runtime configuration: hash algorithm, buffer size, checkpoint interval, enrichment model, exclusions, naming rules
schema.yamlYAMLVersioned directory schema: category-to-directory mapping, operational directories, retention policies
sensitivity.yamlYAMLTier classification rules: path patterns, filename patterns, extensions for each tier

Configuration is loaded by utils/config.py. The fialr config command reads, validates, and modifies fialr.toml.

[general]
hash_algorithm = "blake3"
secondary_hash = "sha256"
[inventory]
buffer_size = 262144
checkpoint_interval = 50
[exclusions]
directories = []
patterns = []
[enrichment]
model = "llama3.2"
endpoint = "http://localhost:11434"
confidence_threshold = 0.7
[vault]
path = ""

Metadata is stored in two layers with clear authority:

The SQLite database (.fialr/fialr.db) is the source of truth for all metadata and audit history on every platform.

TablePrimary KeyPurpose
filescontent_hash (BLAKE3)Canonical record per unique file
pathshash + pathAll current and historical paths
operationsop_uuidAppend-only audit ledger (non-rebuildable)
jobsjob_uuidJob metadata and config snapshots
duplicatesgroup_idDuplicate groups with canonical selection
review_queuehashFiles pending human review
schema_metaversionSchema migration history

The operations table is append-only. It is the audit ledger. It is never truncated, never rebuilt, never modified after write.

Extended attributes are a derived cache layer. They are rebuilt from SQLite, never the reverse.

AttributemacOS KeyLinux Key
Content hashcom.fialr.hashuser.fialr.hash
Secondary hashcom.fialr.hash_sha256user.fialr.hash_sha256
Sensitivitycom.fialr.sensitivityuser.fialr.sensitivity
Categorycom.fialr.categoryuser.fialr.category
Entitycom.fialr.entityuser.fialr.entity
Tagscom.fialr.tagsuser.fialr.tags
Reviewedcom.fialr.revieweduser.fialr.reviewed
Original namecom.fialr.original_nameuser.fialr.original_name
Original pathcom.fialr.original_pathuser.fialr.original_path
Job UUIDcom.fialr.job_uuiduser.fialr.job_uuid
Enriched atcom.fialr.enriched_atuser.fialr.enriched_at
Exclude flagcom.fialr.excludeuser.fialr.exclude

When XATTRs are unsupported (FAT32, exFAT, network mounts), fialr writes to SQLite only. The skip is logged. No error is raised. No functionality is lost. The system degrades gracefully because SQLite is always authoritative.