Skip to content
Alpha: see what works today →
Menu

decisions/files-held-in-archives.md on GitHub, at the commit these pages were built from

Where a host keeps a pod's files

Status: ruled, 2026-11-20, by Jay on a pod that is fast at any size, cascade-runtime-js#819, from the design pass in the storage design. Amends X1, N9, W1, S1 and the kit's check 5, which until now each said "No note rules this", and settles the packfiles question performance.md left open as the runtime's. The row "what reading a pod requires" and rule O4 were added on 2026-11-20 from the review of the reader, cascade-runtime-js#937, which measured what a runtime without it does with a pod held in archives. Depends on naming.md (what names a file) and performance.md (the ten-year pod). Every figure says measured or estimate; laptop means Jay's Windows 11 machine (i5-8257U, NTFS, Defender on), shared with other work, one sitting.

Question

A pod is a folder of files, and its RDF files are its truth: a reader builds every view from them, two writers sync by copying the files one lacks, and each act's snapshot hashes the set of them by path and bytes. Each record, version, revision, judgment and act is a file of its own. A fresh import of a 16,833-record Synthea record writes 27,223 RDF files; the ten-year pod of performance.md holds about 465,000. On the laptop, writing those 27,223 files takes 28.8 s of an 85.7 s import (measured), and listing and reading them back takes 3.5 to 7.0 s (measured). The pod has no server of record, so whatever stores the files cheaper must leave every name, graph name, snapshot and set hash as it is, and a pod written one way must be read by every runtime and synced with every writer.

What others do

Sources: git's objects and packfiles (https://git-scm.com/book/en/v2/Git-Internals-Packfiles) and fetch.unpackLimit and transfer.unpackLimit (https://git-scm.com/docs/git-config); ISO/IEC 21320-1 as the Library of Congress describes it (https://www.loc.gov/preservation/digital/formats/fdd/fdd000361.shtml), ZIP (https://www.loc.gov/preservation/digital/formats/fdd/fdd000354.shtml); the IANA registration of application/zip (https://www.iana.org/assignments/media-types/application/zip); FHIR Bulk Data's export (https://hl7.org/fhir/uv/bulkdata/export.html); TriG (https://www.w3.org/TR/trig/); SQLite as an application file format (https://www.sqlite.org/appfileformat.html); git's repository format versions (https://git-scm.com/docs/repository-version); DCMI's dcterms:requires (https://www.dublincore.org/specifications/dublin-core/dcmi-terms/terms/requires/). The research this note rests on, with the prototype, its result files and every measurement: the storage design; the rulings: the decisions comment.

Choice

thing prior art what we do borrowed or diverged Rules that cite it
a file git: an object is the same object loose or packed a file of the pod is its path and its bytes, wherever a host keeps it: at its own path, or as the entry at that path of an archive. The files stay the pod's truth, and "no file, once written, changes or goes" stays a promise about each file (runtime/nothing-is-edited.feature, X1) borrowed from git
an archive ISO/IEC 21320-1, as EPUB, OOXML and ODF use it a ZIP in that profile, entries stored or deflated, paths in UTF-8 in byte order, one entry a path, every date 1980-01-01 00:00, no ZIP64, in the folder runtime/pod-layout.ttl gives cascade:holdsFilesInArchivesOfMediaType. It holds only files of the layout's folders, never a view nor a stored document, and is no file of the pod; a file held twice holds the same bytes in both (X1) borrowed; diverged from git's own pack format, whose objects are named by their bytes' hash where a pod's file is named by its path
an archive's name git names a pack by a hash the SHA-256 of the archive's bytes in lowercase hex, adding .zip; an archive that does not match its name, or has no end record, is refused and nothing is read from it (runtime/naming.feature, N9) borrowed
a step's archive git's fetch keeps 100 objects or more as one pack (transfer.unpackLimit) a host that keeps files in archives writes a step's new stored documents first at their paths, then every other new file an archive may hold, the act's among them, as one archive, flushed and renamed into place, then the files that change in place (runtime/write-order.feature, W1) borrowed from git's fetch; ours in doing it for every step, a single judgment too
a sync git's fetch which files a writer lacks is decided by path; the receiver writes what arrived as W1 writes a step, or keeps whole archives it lacks as they are (runtime/sync.feature, S1) borrowed
clean-up git gc a host may write the files of several archives, or loose files, into a new archive and then remove what they came from, each entry's bytes copied unchanged and the new archive in place first (X1) borrowed from git
a loose folder git reads loose and packed objects alike a reader takes every file at its own path and every entry of every archive, so a hand-made, example, fixture or older pod stays a pod as it is (X1) borrowed
the kit's check a file is where the layout says when its path is, at that path or in an archive (runtime/the-kit.feature, Check 5) ours
what reading a pod requires git's extensions.*, which a git that lacks one refuses a pod says each thing a runtime must be able to do to read it whole, cascade:ReadingFilesHeldInArchives first, as a file of its own in the folder the layout gives cascade:holdsRequirementsForReadingAPod, named by the SHA-256 of the requirement's IRI and stating that the pod dct:requires it. It is written before the first file that needs it and is never changed nor removed; it is no file of the pod, and no archive holds it. Every runtime lists the folder at every open and refuses, naming the requirement, a pod that requires what it cannot do (runtime/opening.feature, O4; W1, X1, N9, S1) borrowed from git's refusal; diverged in a file a requirement, never changed nor removed, and in no version number
the snapshot's set a file is in the set by its path wherever a host keeps it, and an archive is not in it, so no snapshot and no set hash changes (ontologies/cascade.ttl) ours No rule cites this row.

Why

One file each was never chosen against an alternative. (row "a file") The first example pod, on 2026-09-30, was a folder a Python script wrote into this repository, a Solid-style tree with one Turtle file per thing so that a reviewer could read each in a pull request. On 2026-10-05 the layout moved into runtime/pod-layout.ttl (#42), describing the folders that already existed. X1, N9 and W1 each said "No note rules this": they described what the runtime did. Packfiles were listed as a lesson from git "not yet taken" on 2026-10-21 (#198), and performance.md left them open as the runtime's on 2026-10-22. No pod of size was measured until 2026-11-17. The cost stayed out of sight because every pod was small and every measurement ran on Linux, where a small file costs about a tenth of what it costs on the laptop.

The cost is the number of files, not what is in them. (rows "an archive", "a step's archive") Writing the large pod's 27,224 files as today took 28.8 s on the laptop and 10.0 s in a Linux container on the same laptop; written as one ZIP of the same files, the stored document beside it, flushed, it took 0.21 s (−99.3%, 137×) and 0.33 s (−96.7%, 30×) (measured, median of 3). Reading them all back went from 3.0 to 6.5 s to 0.07 s, and listing from 0.53 s to 0.02 s for the archive's directory (measured). The Linux container is not CI, and macOS was not measured; the runtime's step 0 measures both. The saving phase of the laptop's import, 27.3 s of 85.7 s, is estimated to fall to about 3 s.

Every name stays, because no name depends on where a file is kept. (rows "a file", "the snapshot's set") A record is named from its source's identity, a version by its content, a revision by its own statements, an act by a random UUID (naming.md); a graph is named by its file's path; the set hash is over each file's path and the SHA-256 of its bytes. None reads where a host keeps the file. Two pods made separately from the same document share 1,151 of their 1,726 record and version paths byte for byte, in the 400 compared (measured). So an archive can be written, merged or rewritten without changing a name, a graph name, a snapshot, a set hash or a judgment, which is the property git relies on to repack.

ZIP, because each entry is today's file. (row "an archive") The central directory at the end is the index: one file is one ranged read (0.27 ms, measured), and listing a pod is reading each archive's directory. An archive that was torn has no end record and is refused. A ZIP opens in Explorer, Finder, 7-Zip and unzip, and each entry is the Turtle file a person reads today. The rules keep the word "file" and stay true as written. The profile is the one three document formats share, so no ZIP feature a reader might lack appears. Leaving out ZIP64 keeps every reader simple, at a limit of 65,535 entries and 4 GiB an archive, past which a step writes more than one. A fixed date and path order make two hosts that pack the same files the same way write the same bytes, so the same archive arriving twice is one file.

One archive a step, because a step already knows its files. (row "a step's archive") A step computes the files the pod lacks before it writes any; that list is the archive. A repeat writes none: the same document again took 0.12 s and wrote 0 files on the 647-record record, before archives and after (measured). The act's file lands with the revisions it names, so the case W1 guards, a step stopped partway, shrinks to an archive that is whole or absent. A step of 3 files took 5 ms loose and 7 ms as one flushed archive (measured), so one write path serves every step. One flush a step is durability the pod never had: no write was flushed before.

Stored documents stay at their own paths. (row "an archive") Each is already one file, often large (38.1 MB for the large record), and it is the first thing a removal would touch, if one is ever ruled. Whether they are kept compressed is a later question.

A loose folder stays a pod. (row "a loose folder") Fixture and example pods in a repository stay readable in a pull request, and a pod written before this note opens without conversion; the clean-up packs it when a host chooses. The cost is two read paths, which git has carried since 2005.

A host may keep files either way. (rows "a step's archive", "a sync", "the kit's check") A browser host keeps a step in one IndexedDB transaction and never had many operating-system files; it keeps doing so. The rules say how a host that keeps archives writes them and how every reader reads them, and require no host to keep them.

A runtime that cannot read archives must refuse, and only the pod can tell it to. (row "what reading a pod requires") A runtime without the reader, opening the 647-record pod with its subject's file loose and its other 1,728 files in one archive, saw 8 of 1,743 graphs and refused nothing (measured, cascade-runtime-js#937's review); with the subject's file archived too and its own description of the pod beside it, 7 (measured, #937). It then writes acts and revisions against a pod it sees in part, and X1 never lets them be removed. The runtimes already shipped cannot be changed, so the rule is for this runtime and every one after it: each lists one folder at every open, and refuses what it cannot do. Every later format, one seal an archive, stored documents kept compressed, joins as one more requirement with no change to this rule. A file a requirement, never changed nor removed, keeps X1's promise for the one thing a pod says about how it is kept, lets two hosts add requirements without reading each other's, and costs a runtime that meets them one listing and no read: the name says which requirement a file states. The pod, not the runtime's state beside it, says it, so a pod copied whole by a file-sync tool or a backup takes its requirements with it. The requirement is how a host keeps the files, not what they say, so it is in no snapshot's set and a sync does not carry it: the same files kept loose by one writer and in archives by another make the same snapshots, and each writer's pod requires what its own host needs. DCMI's dcterms:requires, "a related resource that is required by the described resource to support its function, delivery, or coherence", says the statement, so no cascade# property is minted for it; the requirements themselves are ours, since nothing outside the protocol names what a Cascade runtime must be able to do.

Alternatives that lost

Still open

What would change our mind

A measured open of a ten-year pod in which reading the archives' directories costs more than listing loose files did would reopen how archives are merged, not whether to keep them. A reader outside the runtime that must walk a pod's folder, such as a Solid server serving it as it is, would need unpack or a second layout. A ruling that removal is routine, per record, would weigh against putting many records in one archive.