TETHESIS
BITEMPORAL

Two clocks: valid time and recorded time

Every fact in Tethesis carries two times: valid time — when it was true in the world — and recorded time — when the system recorded it. The two can differ, for example when a change is recorded after it took effect.

The same question can be asked at any combination of the two. That is how a decision made in the past can be reconstructed exactly as it stood then, even after the facts behind it change.

Read the quickstartCypher referenceInteractive below · drag the two clocks

Illustrative example. Drag the two controls. The top one sets recorded time — when the system recorded the fact. The bottom one sets valid time — when the fact was true in the world. The query under the chart updates to match.

The same query. The LOW_RISK revision was recorded on 2026-06-03, for a KYC verified on 2026-06-01. Ask what the system had recorded before the revision → HIGH_RISK 0.70. Ask what it recorded after → LOW_RISK 0.95. Neither answer overwrites the other.

THE TWO CLOCKS

Valid time and recorded time

The foundation stores two times on every node and relationship version: when the fact was true, and when it was recorded.

Clock 1 · Valid time

When it was true in the world.

A customer's KYC status became verified on 2026-06-01. That is a fact about the world — it happened whether or not any system captured it in the same instant.

Valid time answers “what was true then?” You can set the start of a fact's valid time to a past or future date with the AT VALID write prefix. A later AT VALID write ends the earlier value's valid time at the new date. Every change is kept in the history log.

// Verified in the world on:2026-06-01T09:15:00Z
Clock 2 · Recorded time

When the system learned it.

The KYC document did not reach the risk service until 2026-06-03 at 14:22 UTC — two days later. That is a fact about record-keeping, not the world.

Recorded time answers “what had the system recorded?” The server sets it when the write is applied, and it cannot be backdated. A correction adds a new version; the earlier version stays in the hash-chained history log.

// First recorded on:2026-06-03T14:22:41Z

One query, four combinations of the two clocks

Fix one time and vary the other, and the answer changes accordingly.

 
VALID = March 11
VALID = today
RECORDED = March 5
HIGH_RISK · conf 0.70
what we believed then, about then
HIGH_RISK · conf 0.70
what we believed then, about today
RECORDED = today
HIGH_RISK · conf 0.70
what we believe now, about then
LOW_RISK · conf 0.95
what we believe now, about today
THE QUERY LANGUAGE

AT VALID and AT RECORDED

Attach AT VALID, AT RECORDED, or both to a MATCH pattern. The pattern is matched against the record as it stood at that time. (Queries run on the InvariantDB foundation, in Cypher.)

// belief-99 as the system knew it on March 5. MATCH (b:Belief {id: "belief-99"}) AT RECORDED "2026-03-05T00:00:00Z" RETURN b.claim, b.confidence;
// What did we know on March 5, about the world as it was on March 11? MATCH (b:Belief {id: "belief-99"}) AT RECORDED "2026-03-05" AT VALID "2026-03-11" RETURN b.claim, b.confidence;
// Backdate a write: record when the fact became true. AT VALID '2025-01-01' MATCH (c:Customer {id: 'c-42'}) SET c.kycStatus = 'verified';
Where they attach. AT VALID and AT RECORDED bind to a MATCH pattern — they rewind the record before the pattern runs. They do not attach to WITH, WHERE or RETURN; put filters and projections after the temporal clauses. Add OVER VALID BETWEEN a AND b (or OVER RECORDED BETWEEN) to return one row per version that overlaps a window. A backdated AT VALID write that would overwrite later-dated values is refused by default, as is a write dated before the record’s first version — use FOR PORTION OF for those cases.
ANATOMY OF A DECISION

A decision on March 5, reviewed later

Illustrative example. On March 5 the risk service returned HIGH_RISK and the application declined the customer. After KYC completed on June 1, the same customer is LOW_RISK. Both values are stored; the later one does not erase the earlier one.

What the system knew at the time.

Rewind the record to March 5. The KYC document had not arrived. belief-99 was on revision 1, backed by two source episodes. The service returned HIGH_RISK at 0.70 — and the decline queue kicked in.

→ claim = HIGH_RISK · confidence 0.70 · recorded rev 1

What the system knows today.

With no temporal clause, the query returns the current value, recorded on June 3 for a KYC verified on June 1. Confidence is 0.95. The earlier value is still in the history log, readable with AT RECORDED.

→ claim = LOW_RISK · confidence 0.95 · recorded rev 2
Which query answers which question. The March 5 query explains the decline. The query without a temporal clause shows the customer's current state. The history log holds every recorded version between them.

Decisions you can reconstruct