A file that explains its own entries
On paper, a records office writes on the folder itself: the reference, the office it came from, the date after which it may be destroyed. Scan the folder and that writing has nowhere left to go. Write it inside the file instead and something worse happens — the file quietly stops obeying the archiving rules it says it obeys, and the day somebody checks it, it comes back refused.
Every archiving rule knows a title and an author; a keep-until date belongs to you. So this file carries those entries and, beside each one, a description of it: what it is called, how it is to be read, who it is written for, what it means. That description is what a checker looks for first, and what it accepts information nobody but you invented on. The page prints the very same five entries as the record hidden inside — a reference, a department, a date in 2056, a classification and a sheet count — so what a person reads and what a machine reads cannot drift apart.
What this example shows
- Five entries a records office invented, among them a date in 2056 before which nothing may be destroyed.
- Each entry arriving with a description of itself, which is what a checker accepts it on.
- The page and the hidden record printed from one list, so they cannot disagree.
The source code, complete
Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library.
The third is the description itself: a plain list of what the page has to say, which is what the service is sent.
Read the Rust source
Read the Python source
Read the JSON source
The document itself
Open the document in English
Open the document in French