Checking a Mandate Record

An export your firm keeps, checked with Python alone

The OV Risk Terminal keeps a dated record for each mandate: the measurements of every session, the notes written against them, each change to what the mandate is measured against, the period reviews and the client notices the firm recorded. Every entry carries a SHA-256 digest of its own fields and of the entry before it, so an entry changed after it was written no longer recomputes to its digest.

The firm's administrator exports the whole record from the terminal's EXPORTS panel, as one ZIP: every mandate, every year, books deleted since included. The account page's EXPORT EVERYTHING carries the same file, with the firm's books and settings, in one archive. It is a mandate measurement record the firm may file. It states no conclusion about any mandate.

What the file holds

  • manifest.json: the export's time, and per book its entry count and last digest.
  • entries.jsonl: one line per entry, exactly as recorded, with the fields it is hashed over.
  • books/<book>.csv: every hashed field in a column of its own, for a spreadsheet.
  • books/<book>-period.csv: the period's counts for each book.
  • ov_verify_record.py, the checker, and README.txt, these steps.

The steps

  1. Have Python 3.9 or later. The checker uses its standard library only and needs no network; it reads the file and changes nothing.
  2. Check the checker: its SHA-256 is 75d8f124ef12a129d167f2b23940f96f6dd161b25b59fe478bea6a65f8fe8f02. The export carries the same file and its digest; the one published here is /tools/ov_verify_record.py.
  3. Run python ov_verify_record.py ov-mandate-record-YYYY-MM-DD.zip. It recomputes every entry's digest from the entry before it and the fields its type is hashed over, checks every link of every book's chain and each chain's last digest against the manifest, and prints OK or FAIL for each book. It exits 0 when every check passed, 1 when one failed and 2 when the file could not be read.
  4. Keep each export's manifest.json. A chain cut short at its end still verifies on its own: only a copy kept outside the record shows it. Next time, run python ov_verify_record.py <new>.zip --previous-heads <earlier>.zip and every chain must still hold the earlier export's entries, unchanged.

A record statement

A firm may hand its client or its audit firm a record statement: one mandate, one period, the rules the firm wrote before it and what the record shows followed them, with the head digest of the record at the period's end. Ask the firm for its export as well. The mandate's last digest in the export's manifest.json is that head digest or chains onto it, and the checker verifies the chain. The statement carries no regime value, no return figure and no score.

Once a month Oneiros Vision writes every record chain's head digest and entry count, and nothing that names a firm, to a witness file timestamped by freeTSA, an independent RFC 3161 timestamp authority. A head that appears in a timestamped file existed by the time the signed reply states, and so did every entry before it in its chain: a statement's head is covered when it, or a later head of the same chain, appears in the file; the stamped record-heads file is sent on request, and openssl ts -verify checks the reply against freeTSA's published certificates. A timestamp from an authority that is not qualified is evidence, not a legal presumption.

The rule each digest follows

The digest is the SHA-256 of the previous entry's digest, a |, and the entry's fields in order joined by |; a book's first entry is chained onto sixty-four zeros. A field is written as nothing for a null; True or False; a decimal number to 12 significant digits; an object or a list as JSON with its keys sorted, , and : as the only separators and every character beyond ASCII escaped; anything else as its text. Which fields each kind of entry is hashed over is listed in the export's README.txt and in manifest.json, and the checker refuses an entry that lists other fields than its kind and version are hashed over.