Relate by Neo4j hackathonv0.1.0

Witness cross-examines the graph until only the evidence remains.

22 of 57,645 relationships, each proven needed.

The witness: 22 relationships among 12 nodes (10 airports, 2 countries), the 13 routes carry numbered exhibit tags, the 9 country links show as country codes UPNMX QROMX PBCMX TLCMX LAXUS TIJMX DFWUS LASUS ACAMX MEX 1 3 5 7 9 10 12 13 15 17 18 20 21
uv run witness demo
WITNESS  22 relationships · 12 nodes, out of 57,645 · 3,748  68 relationships match the answer rows; 22 of them sufficeCHECK  22 of 22 change the answer (22 of 22 relationships, 0 of 0 isolated nodes)  relate CLI: sufficiency + 22 of 22 necessity probes cross-checkedPROVE ONE  delete exhibit 9 (PBC)-[:HAS_ROUTE]->(DFW) from a copy of W, re-run  CHANGED: 4 rows → 3 rows (PBC drops out)
Recorded 2026-11-24 00:58:52 UTC · evidence/demo-2026-11-24.txt · lines selected, order kept
Witness · v0.1.0 · witness-wheat.vercel.app1 / 10

The problem

Graph answers are taken on trust.

A reviewer cannot read 57,645 relationships. “Show the path” is not enough either: a path can include relationships that change nothing.

The air-routes graph in frame: 1,565 airport pairs

57,645 relationships · 3,748 nodes · air-routes, drawn: 1,565 airport pairs in frame

Witness · v0.1.0 · witness-wheat.vercel.app2 / 10

The question · queries/two-hub.cypher

One question, three hard parts.

NOT EXISTSOPTIONAL MATCHaggregation

// Which airports of $country have no direct flight to $dest, yet would still reach it in two flights if any one hub closed?
MATCH (a:Airport)-[:IN_COUNTRY]->(:Country {code: $country})
WHERE a.iata <> $dest
  AND NOT EXISTS { MATCH (a)-[:HAS_ROUTE]->(:Airport {iata: $dest}) }
MATCH (a)-[:HAS_ROUTE]->(hub:Airport)-[:HAS_ROUTE]->(:Airport {iata: $dest})
OPTIONAL MATCH (hub)-[:IN_COUNTRY]->(hc:Country)
WITH a, count(DISTINCT hub) AS hubs, coll.sort(collect(DISTINCT hc.code)) AS hub_countries
WHERE hubs >= 2
RETURN a.iata AS airport, hub_countries
ORDER BY airport

The answer · full graph

airporthub_countries
PBC[MX, US]
QRO[MX, US]
TLC[MX, US]
UPN[MX, US]
Witness · v0.1.0 · witness-wheat.vercel.app3 / 10

The reduction · from the trace

Delete, re-run, roll back. 371 trials.

Relationships22
Trial371

Trial 371: the witness, every relationship needed.

The witness: 22 relationships among 12 nodes (10 airports, 2 countries), the 13 routes carry numbered exhibit tags, the 9 country links show as country codes UPNMX QROMX PBCMX TLCMX LAXUS TIJMX DFWUS LASUS ACAMX MEX 1 3 5 7 9 10 12 13 15 17 18 20 21

Tall tick: answer kept, deletion applied (86). Short: answer changed, rolled back (285).

Witness · v0.1.0 · witness-wheat.vercel.app4 / 10

Exhibit A · pull a tag

Pull any tag. The answer moves.

The witness: 22 relationships among 12 nodes (10 airports, 2 countries), the 13 routes carry numbered exhibit tags, the 9 country links show as country codes UPNMX QROMX PBCMX TLCMX LAXUS TIJMX DFWUS LASUS ACAMX MEX 1 3 5 7 9 10 12 13 15 17 18 20 21
Answer with exhibit 15 pulledChanged
airporthub_countries
PBC[MX, US]
QRO[MX, US]
TLC[MX, US]
UPN[MX, US]

Exhibit 15 pulled: (TIJ)-[:HAS_ROUTE]->(MEX) · PBC, QRO and UPN drop out.

22 of 22 change the answer
Witness · v0.1.0 · witness-wheat.vercel.app5 / 10

Relate is the engine

The loop runs inside Relate, and the proof is a Relate file.

1begin_transaction · rollback_transactionthe inner loop: 371 trials in the headline run
  1. 2QueryResult.query_typerefuse writes
  2. 3EXPLAINprune unreachable types
  3. 4read_only=Truereruns cannot write
  4. 5single-file .rlthe evidence format
  5. 6relate pullfixture mode
  6. 7relate query --mode jsonindependent re-check
  7. 8MCP · why · checkWitness's own tools, beside relate serve --mcp
Witness · v0.1.0 · witness-wheat.vercel.app6 / 10

The proof

Checked twice, on two surfaces.

22of22change the answer, on relate-db and on the Relate CLIwitnesses/two-hub.manifest.json
2runsbyte-identical rebuild script (.cypher) from the same query and seedevidence/determinism.json
517tests on real Relate, 100% line and branch coverageevidence/pytest-2026-11-27.txt
Witness · v0.1.0 · witness-wheat.vercel.app7 / 10

Speed

Same loop, two engines.

Trials per second

Relate, in-process366.8
Neo4j 2026.10.2, Docker90.2

p50 trial, ms

Relate2.54
Neo4j6.48

Median of 3 runs, one machine. An embedded engine versus a Dockerised server: it says nothing about Neo4j's query engine.

Witness · v0.1.0 · witness-wheat.vercel.app8 / 10

For agents · MCP

An agent asks why, and gets the evidence.

witness · why5.605 s
Answer (4 rows): PBC, ['MX', 'US']; QRO, ['MX', 'US']; TLC, ['MX', 'US']; UPN, ['MX', 'US']Evidence: 22 relationships (of 57,645) reproduce it; 22 of 22 change the answer — verified deletion-minimal.verified=True · trials=371 · reduction 1.359 s · ledger r-20261126-193623-ae64b5f6
witness · why · a write0.951 s
// statement: MATCH (a:Airport) DETACH DELETE a RETURN 1{  "error": {    "kind": "query",    "message": "write keyword DETACH (read-only queries only)"  },  "verified": false}

Excerpted from evidence/mcp-transcript.md (the exhibit list and the re-run path line are omitted; the // statement: line is from mcp-transcript.json) · scripted MCP client, no model in the loop, its own run (timings vary run to run) · recorded 2026-11-26 19:36 UTC · with a real model: evidence/mcp-agent-session.md

Witness · v0.1.0 · witness-wheat.vercel.app9 / 10

Run it

File the evidence, not the whole house.

git clone https://github.com/edycutjong/witness
cd witness && uv run witness demo

Needs uv. The repository opens at submission; until then the clone does not resolve.

Deletion-minimal, never “smallest”: every kept relationship is needed.

witness-wheat.vercel.app
Witness · v0.1.0 · witness-wheat.vercel.app10 / 10