Time Agnostic Room DAG Inspection Service
  • TypeScript 70.9%
  • JavaScript 12.4%
  • Python 8.2%
  • CSS 3%
  • HTML 1.7%
  • Other 3.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-10-14 15:48:07 +01:00
.github/workflows Test the shim in CI (#62) 2025-10-10 15:02:05 +01:00
cmd/wasm Use GMSL to generate compliant event IDs 2024-10-28 15:37:50 +00:00
helm/tardis Add helm chart for tardis shims 2024-11-12 12:35:04 +00:00
img Update to synapse 1.139.2 2025-10-10 14:07:47 +01:00
public Support v12 rooms (#63) 2025-10-14 14:09:01 +01:00
shims/synapse Implement conflicted subgraph (#64) 2025-10-14 15:48:07 +01:00
src Support v12 rooms (#63) 2025-10-14 14:09:01 +01:00
.gitignore Switch from Webpack to Vite 2024-09-30 13:36:01 +02:00
biome.json Linting, ts types, general tidy 2024-12-10 12:17:09 +00:00
build.sh Add build.sh 2024-10-31 14:19:34 +00:00
Dockerfile Basic install/build test 2024-10-16 11:41:51 +01:00
go.mod Support v12 rooms (#63) 2025-10-14 14:09:01 +01:00
go.sum Support v12 rooms (#63) 2025-10-14 14:09:01 +01:00
index.html Remove auth dag option; show auth chain in a very hacky way 2025-06-20 16:09:22 +01:00
jest.config.js biome check --fix --unsafe 2024-10-17 10:02:30 +01:00
LICENSE Apache 2 2024-10-16 10:37:42 +01:00
package.json Prettify viewing event JSON 2025-06-20 15:21:26 +01:00
README.md Update README.md 2025-01-15 09:30:22 +00:00
style.css Linting 2025-06-20 15:28:16 +01:00
tsconfig.json Fix some tyepscript/lint problems 2025-06-20 11:41:20 +01:00
yarn.lock Prettify viewing event JSON 2025-06-20 15:21:26 +01:00

TARDIS - Time Agnostic Room DAG Inspection Service

TARDIS is a time-travelling debugger for Matrix room DAGs, which reads a plaintext file to graphically visualise a room using d3-dag for debugging purposes. It can then perform state resolution at any given event on the DAG via a shim server. TARDIS comes with a Synapse shim server, which needs to be run in addition to TARDIS. See shims/synapse.

Generates stuff like this:

To use:

Requires node 20+ for global crypto variables.

yarn install
yarn run start

or:

docker build -t tardis .
docker run --rm -p 5173:5173 tardis

Loading events

..via existing events in a database

Provide a new-line delimited JSON file which contains events to render in the full federation format (with prev_events, etc). To get such a file for Synapse installations on Postgres, run the following (assuming matrix is the name of your DB):

$ psql matrix
matrix=> \t
Tuples only is on.
matrix=> \o the-file.ndjson
matrix=> select jsonb_insert(json::JSONB, '{event_id}', ('"' || event_id || '"')::JSONB) from event_json where event_id in 
    (select event_id from events where
        room_id='!THE_ROOM_ID' and
        stream_ordering < (select stream_ordering from events where event_id='$LATEST_EVENT_ID') and 
        stream_ordering > (select stream_ordering from events where event_id='$EARLIEST_EVENT_ID')
        order by stream_ordering asc
    );

For SQLite3 use select '{"event_id":"' || event_id || '",' || substr(json, 2) from event_json.

You can drop the stream_ordering clauses if the room is small and you want to see the entire thing.

It is important that the events are sorted in causal order. To do this with jq: just do:

cat the-file.ndjson | jq -s 'sort_by(.depth)' > sorted-file.ndjson

The file created by these commands can be dropped as-is into TARDIS.

..via scenario JSON5 files

Provide a JSON5 file which contains the scenario to run. See the examples directory for examples on the keys available.

Developing

Building WASM

Sometimes we want to create mock scenarios which don't exist in databases. We use placeholder event IDs in this case. However, state resolution demands that they are actual event IDs. Tardis uses the same code paths as Dendrite (via wasm) to generate the correct event IDs. To build the wasm, you need tinygo installed and then:

GOOS=js GOARCH=wasm tinygo build -o ./public/gmsl.wasm --no-debug ./cmd/wasm/main.go

A working version is already supplied with this repository.