@startuml title Objects found inside Ugarit vaults !define ATAG << (t,#CCAAAA) abstract tag >> #DDBBBB !define TAG << (T,#CCAAAA) tag >> #CCAAAA !define ABLK << (b,#BBBBBB) abstract block >> #BBBBBB !define BLK << (B,#BBBBBB) block >> #AAAAAA !define ASXP << (s,#AACCAA) abstract sexpr >> #BBDDBB !define SXP << (S,#AACCAA) sexpr >> #AACCAA abstract class Tag ATAG { name } abstract class Block ABLK { key } note left of Block All blocks are identified by a key (which is a hash of their contents and type), a type, and the actual contents. end note class SnapshotTag TAG class ArchiveTag TAG class Vault << (V,Wheat) >> Vault "1" o-- "*" Tag Vault "1" o-- "*" Block Tag <|-- SnapshotTag Tag <|-- ArchiveTag note right of Tag To provide roots into the DAG of blocks, tags are mutable (typed) pointers from a name to a block end note SnapshotTag o-- "1" snapshot ArchiveTag o-- "1" archive Block <|-- snapshot snapshot o-- snapshot : previous snapshot o-- FileSystem : contents snapshot o-- "f/fi" : log note on link Every snapshot block has a reference to a file containing a log of events that occurred during the snapshot. end note class snapshot BLK { properties } note left of snapshot A snapshot tag points to a chain of snapshots of a filesystem, forming a history. end note Block <|-- archive archive o-- archive : previous archive o-- "a/ai" : contents archive o-- "f/fi" : log note on link Every archive import block has a reference to a file containing a log of events that occurred during the snapshot. end note class archive BLK { properties } note left of "a/ai" Each archive import contains a series of ArchiveEntry sexprs, stored as a tree of direct (a) and indirect (ai) blocks. end note note right of archive An archive tag points to a chain of archive imports, preserving the history of the archive as it grows and changes. end note class "a/ai" BLK Block <|-- "a/ai" class ArchiveEntry SXP { metadata } note left of ArchiveEntry Each ArchiveEntry associates a FileSystem object in the vault (a file or a directory tree) with some metadata. end note "a/ai" *-- ArchiveEntry ArchiveEntry o-- "1" FileSystem : archived object Block <|-- FileSystem abstract class FileSystem ABLK class "d/di" BLK note right of "d/di" A directory is represented as a series of DirectoryEntry sexprs, stored as a tree of direct (d) and indirect (di) blocks. end note class "f/fi" BLK { data } note right of "f/fi" { Actual file data is stored in a tree of file data (f) and indirect (fi) blocks. } FileSystem <|-- "d/di" FileSystem <|-- "f/fi" "d/di" *-- DirectoryEntry abstract class DirectoryEntry ASXP { name atime ctime mtime type mode uid gid } DirectoryEntry <|-- SubdirectoryEntry SubdirectoryEntry o-- "1" "d/di" : contents class SubdirectoryEntry SXP { total-files total-bytes } DirectoryEntry <|-- FileEntry class FileEntry SXP { size } FileEntry o-- "1" "f/fi" : contents DirectoryEntry <|-- BlockDeviceEntry class BlockDeviceEntry SXP { number } DirectoryEntry <|-- CharacterDeviceEntry class CharacterDeviceEntry SXP { number } DirectoryEntry <|-- SymlinkEntry class SymlinkEntry SXP { target } DirectoryEntry <|-- FIFOEntry class FIFOEntry SXP @enduml