On this page· 3
What a pack is
- file format 6
- Rust SDK 1.0 preview
A pack is one PLXI file. It holds records about some things, the links between them, and, when recorded, where each came from. It is also sealed: its footer carries a digest of its contents, so a reader can tell whether anything changed.
Read from the first byte to the last, a pack has up to seven kinds of part. Each has a plain name on PLXI help and an exact name in the specification.
Figure 1 A pack, as a parcel and as bytes
| # | Plain name (PLXI help) | In the file | What it holds |
|---|---|---|---|
| 1 | cover line | header line, bytes 0 to 256 | six tokens: the format version, the record count, where the appendix is, and the digest |
| 2 | cover note | a meta record, written first | when the pack was made and from what source |
| 3 | cards | ent records | one thing each: an id, a type, and optional members such as a name |
| 4 | links | rel records | a named link from one thing to another |
| 5 | tags | prov records | where a fact came from: the subject, the agent, the method and the time |
| 6 | finder | the appendix | binary data that does not fit a JSON line, such as embedding rows |
| 7 | seal | the footer, the last 96 bytes | counts, offsets, and the SHA-256 digest of everything between the header line and the footer |
Records are written in a fixed order by kind, so the meta record comes before the entities and the prov records come after the relations.
A pack does not need every part. The quickstart's pack has three records, two entities and one relation, and no appendix.
Everything a person can read is text: the header line is ASCII, and each record is one JSON object on one line. Binary data, when there is any, sits after the text, in one block aligned to 64 bytes.
A record can also point at binary data in another file, through a csdt_ref record. The Rust SDK reads such pointers but does not follow them. The appendix
- Not signed. The digest shows that bytes changed. It does not show who wrote the pack.
- Not encrypted. Revision 6.0 of the format defines no encryption.
- Not a database. A pack is written whole and read whole; the Rust SDK holds the whole pack in memory.