Kapitol World

The law of the ledger

Nothing is ever deleted

World's ledger is its record of every movement of money or goods. A wrong line in it is never erased or overwritten. It is corrected by new lines, and the old ones stay. The database enforces this in every world, every day. The rules are Dimitar Hrisafov's: he wrote them on 17 August 2026, before World existed, as commands for QL68, a Sinclair QL emulator he built.

The public demo is a copy that starts again from its template every night: the whole copy is replaced, and no line inside a ledger is deleted.

Negate what adds up. Leave what identifies. Re-derive what maximizes.The law, in one line

A storno, not an eraser

A wrong figure is never overwritten. It is corrected by writing its exact opposite, a storno, and then the right figure (storno is the bookkeepers' word). All three lines stay on the file, so anyone can see what was wrong, who corrected it, and when.

How a correction is written An example. The first line sells 90 bottles for 1,197 dollars. The storno line has the same order, customer and product, with minus 90 bottles and minus 1,197 dollars. The third line has the right figure, 80 bottles for 1,064 dollars. The total is 80 bottles and 1,064 dollars, and all three lines remain. ORDERCUSTOMERPRODUCT QUANTITYAMOUNTLINE OR000761Ernst HandelSasquatch Ale 90$1,197.00the sale OR000761Ernst HandelSasquatch Ale -90-$1,197.00the storno OR000761Ernst HandelSasquatch Ale 80$1,064.00the right one 80$1,064.00the total Leave what identifies: the order, the customer, the product. Negate what adds up: the quantity and the amount.
An example of the form: the numbers on the second and third lines are made up to show the shape. A storno keeps the original's actor, and names who reversed it.

Negate what adds up

Quantities and amounts get their exact opposite, so every total stays right at every moment.

Leave what identifies

The order, the customer, the product and the actor stay as they were. A storno says which line it cancels by being its mirror.

Re-derive what maximizes

A "last changed" or a "highest" is never stamped and overwritten. It is worked out again from the events - which also stopped writers of one order from blocking each other (see Tested).

A sale is corrected by two people

A sale is an agreement with a customer, so one person may not correct it alone. One person claims a correction; a second proves it, with evidence; no actor can prove its own claim. Only then may it be applied - as a storno and a new line.

Claim, prove, apply Michael Suyama claims a correction: amendment AM000001 is CLAIMED. Andrew Fuller, a second person, proves it with the order's code as evidence: it is PROVED. Applying it writes a storno and the corrected line. If the same person tries to prove their own claim, the database refuses. CLAIMED Michael Suyama claims a correction verb AMEND PROVED Andrew Fuller a second person, with evidence verb PROVE APPLIED a storno + the right line the original stays on the file verb APPLY the same actor proving its own claim: refused by the database
The first amendment, AM000001: order OR000761, 90 bottles of Sasquatch Ale for Ernst Handel, $1,197.00. Michael Suyama and Andrew Fuller are the demo's fictional employees, and the database checks actors: the one who proves must not be the one who claimed. The claim was entered from the project manager's sign-in, which holds Michael Suyama's key. On 3 November 2026 at 8:11 PM Dimitar Hrisafov, under his own sign-in, which holds Andrew Fuller's key, proved it, with the order's code as the evidence. On the demo one visitor can play both parts, signing in as each in turn, step by step from How To Start: the database checks that the two actors differ, not who sits at the keyboard.

Corrections cannot pile up into long chains, either: a storno can never itself be reversed, and a line can be reversed only once. If the corrected line is wrong too, it gets its own storno and a newer line - the file stays flat, never a reversal of a reversal.

A wrong reading is withdrawn, never erased

The same law reached the hospital ward's readings on 27 and 28 November 2026. A sensor that reports a wrong value - say 85.0 °C, the value a room sensor sends when it powers on - is not erased or written over.

Withdraw it

The engineer withdraws the reading. It stays on the file, marked; the reading "now" falls back to the one before.

Or substitute it

A substitute names the line it replaces and how the new value was found - one of four ways, the four his QL68 command TSUBST names: a control meter, a computation, an estimate, or the building's control system (SCADA).

A press is an act

A call button's press is not a measurement. It stands as it was pressed. And while a value stays out of its limits, it raises one alarm, not one every quarter hour.

Once a day the ward's simulated sensors send that 85.0 °C on purpose, so a visitor always has one wrong reading to correct.

Every line sealed

The ledger seal Each ledger line has its own SHA-256 fingerprint in a table that can only grow. If a line is rewritten, its fingerprint no longer matches, and the check finds it. line 288,8063f9a...c21e line 288,807b07d...91fa line 288,808 - rewrittene5c0...07b3 The seal a table that only grows 3f9a...c21e equal b07d...91fa equal e5c0 ≠ 8a41 caught Every ledger line gets a SHA-256 fingerprint. A delete is refused. A rewrite, even by an administrator, no longer matches its fingerprint. Each night a digest goes to the backup.
An example: the fingerprints are shortened and the rewrite is imagined. On 8 November 2026 all 288,808 ledger lines of World were sealed in 15.8 seconds; the monthly restore test checks the seal again (2 December 2026: 15 of 15).

An administrator of a database cannot be stopped - that is what an administrator is. World does not prevent it; it detects it. A rewritten line no longer matches its fingerprint. The fingerprints are themselves kept in a SQL Server ledger table whose digest leaves the machine every night, so rewriting them too would not match either. And the audit records every statement, with its text, of one who switches a guard off - switching the audit itself off is recorded too.