A free app can disappear one day, for any number of ordinary reasons. P-Lens is built on the assumption that it will, and that the book must not disappear with it. The README opens with it (README.md):
The book of record is the journal files on your device. If P-Lens disappears, hledger -f main.journal still reads them as they are.
Inside the browser the files are kept in IndexedDB, used as a container and nothing more. The first of the design document's invariants:
The journal text is the only source of truth. IndexedDB holds journal files; it is a container, never a second record. Nothing hledger can answer — a balance, a total, a count — is stored.
With one record, there is no difference between the data in the app and the data exported from it. The files also say what they are, for whoever is handed them alone, a person or a program. A book's main.journal opens with a comment; the test fixture's (main.journal):
; A P-Lens book: pachinko and pachislot play, kept as a plain-text hledger journal.
; Made with P-Lens, open source at https://github.com/p-lens-dev/p-lens
; Read and checked by hledger, with thanks: https://github.com/simonmichael/hledger
;
; What is where:
; accounts.journal commodities and accounts; a parlor is the savings accounts tagged parlor-id
; prices.journal P directives: what a parlor's tokens exchange for, by day
; transactions/2026.journal one entry per play, tagged play-id, game-kind and machine: a file a year, by the entry's date
; pachinko-play/ a pachinko play's readings as JSON Lines, in a file named by its play-id
; pachislot-play/ a pachislot play's, the same
; Each parlor-id, with the parlor's name, is the one the open parlor list gives: https://github.com/p-lens-dev/p-lens-parlors
; (app.p-lens.jp reads that list as it is published at https://parlors.p-lens.jp). Machines are named as P-Lens's catalog names them.
; The layout, the accounts and every tag are described in ARCHITECTURE.md in the P-Lens repository.
;
; Point hledger at this file: hledger -f main.journal bal
- Backup is the book's files as they are kept, in a zip, beside a small manifest (ARCHITECTURE.md): "No journal includes it, so the zip unpacked is a book desktop hledger opens." It is not encrypted, and the screen says so: an archive sealed with a key is lost with the key.
- Export writes the whole book as one journal, which "hledger opens it by itself and reads it to the same figures" (ARCHITECTURE.md), as a test checks; or the plays as a CSV a spreadsheet opens.
What this does not cover is the device itself. A book cleared with the browser's data, or lost with the phone, comes back only from a backup or from another device it is synced with. The app asks the browser to keep its storage, and whether that is granted is the browser's decision.