Tiramemsu

Layered Bitemporal Graphs

Papers · paper 1 of 3 · Statement Identity, Two Clocks, and Metagraphs as Tags · Volodymyr Pavlyshyn · Revision 4, 3 October 2026 · Draft preprint, CC BY 4.0

This paper writes down the model behind tiramemsu precisely and proves what its operations guarantee. A statement has its own id, so other statements can point at it. Every statement has two clocks: when the database knew it, and when it was true. The paper asks what it means for such a memory to stay consistent when facts are retracted, corrected and read in the past.

Download the PDF (revision 4, 22 pages) Read the companion article Zenodo · DOI 10.5281/zenodo.23139228 LaTeX source

Abstract

Agent memory needs durable statement identity, provenance, and a distinction between when a claim held and when the system recorded it. We study layered bitemporal graphs, in which statement occurrences can reference other occurrences and carry both transaction-time lifetimes and valid-time intervals. On a referentially complete history, reference-closed sets form an Alexandrov topology. Its interior operator, the ground core, characterises minimal retraction cascades, grounded snapshots, and effective valid-time intervals. We give a correction contract that preserves structural closure under explicit patch and lineage conditions; preservation of references excludes changes made to the corrected root. A typed anchor-and-role encoding of metagraphs commutes with well-formed bitemporal snapshots. Compact binary encodings require additional acyclicity for insertion under a live-reference discipline. The calculus is realised in Tiramemsu, an embedded SQLite graph database. Retained checks identified four implementation gaps; endpoint validation, closed retention and transaction-date guards now prevent those counterexamples. These checks support selected contracts rather than certifying the entire implementation. Our contribution is an operational account of recursive temporal reference integrity, rather than a new theory of temporal databases or finite topologies.

The main results

Grounded

One operator

The ground core keeps the statements whose whole support is present. It is the interior operator of a topology, and the other results follow from it.

Cascade

Retraction is forced

The cascade is the least retraction that leaves memory grounded. It takes everything it must and nothing more.

Two clocks

Lifetimes nest

Every as-of view is grounded exactly when lifetimes nest along layers. Valid time is a claim, so the reader takes its grounded slice through effective validity.

Metagraphs

Bitemporal lifting

For well-formed temporal metagraphs, taking a snapshot commutes with the encoding. Metagraphs get time travel without a temporal theory of their own.

Who it is for

Readers who want to know why tiramemsu behaves as it does: why a retraction takes a fact's layers with it, why the past never changes once written, why a valid-time slice can hold a layer whose fact was not valid then, and why a correction keeps everything that was said about the fact. If you want the ideas without the proofs, start with the companion article.

Status

This is a draft preprint, archived on Zenodo (DOI 10.5281/zenodo.23139228) and prepared for arXiv (primary category cs.DB), not yet submitted there. It has not been peer reviewed. The source, the bibliography, a retained verification artifact and the arXiv upload package are in the repository.

Paper and engine. Checking the engine against the paper found gaps where it did not meet the paper's assumptions. Revision 4 describes repairs for them: writes that require live statement endpoints, corrections that drop the layers of dropped memberships, and transaction-date guards. Those repairs shipped in tiramemsu 0.4.0, with the date guards as storage format 4. A file opened by 0.4.0 migrates to format 4 and no longer opens in 0.3.0. On 0.3.0 and earlier, the companion article lists what the engine does not guarantee, and the ground core of a view is always a grounded reading.

Cite

@misc{pavlyshyn2026layered,
  author = {Pavlyshyn, Volodymyr},
  title  = {Layered Bitemporal Graphs: Statement Identity, Two Clocks,
            and Metagraphs as Tags},
  year   = {2026},
  note   = {Draft preprint, revision 4. CC BY 4.0},
  doi    = {10.5281/zenodo.23139228},
  url    = {https://doi.org/10.5281/zenodo.23139228}
}

Next paper: Metagraph Encodings over Identified Triples →