The log is the approval
Status: verified by test 2 min read -
The idea
Most systems keep two things: a record that something was approved, and a log of what happened. They can drift apart. The Citadel's warrant keeps one thing, a trail, and the trail is the approval.
How it works
A warrant's state is never stored as a row to update. It is worked out by folding over the trail. Granting, redeeming and revoking each append an entry, and the state is whatever the entries add up to. There is no approval flag that could disagree with the log, because there is no flag.
What a warrant covers
Its key is the whole act: the verb, the target and every argument, encoded the same way every time. Names are sorted, values are length-prefixed, the encoding is versioned and duplicate names are refused. Change one argument and it is a different act, and the warrant does not apply. Argument values are short handles, and a long payload is passed as its hash.
What a model cannot do
Redeeming a warrant takes no warrant id. There is nothing to pass, so a model cannot write an approval into a tool argument. Granting is something a person does at a shell. It is not a registered tool.
Time
A warrant lives at most twelve hours, and there is no way to ask for more. Expiry is checked when the warrant is redeemed, not by a sweep, and a recorded expiry binds, so turning the clock back does not revive one.
Tamper evidence
The database refuses updates and deletes on the trail, and every entry is hash-chained to the one before it, so an edited or removed entry shows. A head row witnesses truncation.
A forgery that was closed
An entry inserted at sequence zero was invisible to the verifier but visible to the code that redeems. It was closed three ways: a database trigger, a condition in the fold, and a count in the verifier.
If the log and the approval are one thing, they cannot disagree.
Corvin
