The filesystem layout is a convention.
The essential form of a Catalog is just a series of IPLD objects. We project them into a filesystem layout based on some of their properties, for convenience and ease-of-splunking.
Everything is also linked by hash, and the filesystem paths shown here have nothing to do with that merkle tree. (That a git merkle tree can be computed over the filesystem projection is true, but generally considered incidental.)
Example catalog filesystem outline:
{catalogroot}/{moduleName}/_module.json
{catalogroot}/{moduleName}/_releases/{releasename}.json
{catalogroot}/{moduleName}/_mirrors.json
{catalogroot}/{moduleName}/_replays/{HASH}
_module.json
contains the CataloguedModule
object — which contains the module name (remember, the filesystem path is a projection only, so what’s in the file is the actual canonical info), and a list of tuples of releaseName and CID of release data._releases/*.json
files contain one ReleaseInfo
object each. (Note that the CataloguedModule
object linked to these by CID — but yes, the filesystem projection uses the releaseName rather than the CID. It’s a concession to human convenience. Warpforge will still check that the CID link is correct!)_mirrors.json
file contains... well, you know._replays
directory optionally contains replay documents. If present, they should've been referenced by metadata in the release objects. These are in files named by CID.
_
..json
extensions rather than .wf
?
.wf
for filenames that are major landmarks (ex: module.wf
). But these files in a catalog... they aren’t landmarked by the filename, so that reason doesn’t apply here. (We already know what they are because of other landmark filenames that highlighted the directories above these files; namely, ./.warpforge/_catalog{/,s/*/}
) So, shrug; but we had no reason not to go with a json extension.
ReleaseEntry
object worthy of human readable names?
_module.json
file is a document containing tuples of both release names and also the cid? What? Why?
list[struct{name, cid}]
is necessary, because remember, the canonical form of this data doesn't count the filesystem info; the filesystem info is a projection: therefore, we needed links here; those are the canonical form of the data. Also: we need a list because it needs to be ordered!