Strange LoopsGrammarLawsEvidenceDecisions

Laws

124 laws have different kinds of evidence. Lean checks theorems on every build. Other rules hold by construction. Some cards cite partial vector evidence instead of a proof. They are grouped here by the question they answer, in plain sentences. What proves each one, the vectors that pin it and what its proof rests on are on the evidence page.

A law is one sentence

Name what may vary, and name what doesn't move when it does. Arrival order leaves a count, a sum and a state where they were. Repeats leave a winner or an extremum alone, but they move a count or a sum: those are limits. Holding fewer payloads leaves which records are heads alone, though each head comes back with its payload hidden, and an answer that needs a payload can turn unknown or unread. Spelling an envelope time another way, as the same span, leaves a test's answer alone.

Next and Previous step through the invariances, the laws of this shape, one at a time.

Change whether records are folded in parts or all at once, and the state stays.

incremental = batch

1 of 45

Every law at once

Each chip is a law, on the row of the layer it governs and marked with its shape. Every law takes one of six shapes; the last, limits, says where a guarantee stops as plainly as the others say where one holds.

Pick a shape to pick out its laws. Pick a law to read its sentence.

All124Invariance45Round trip10Refinement4Order7Exactness54Limit4

Tick

nothing built here yet, so nothing proved

State75

incremental = batch, Invariancecount.perm, Invariancelatest-by.set, Invariancelatest-by.repeats, Invariancelatest-by.converge, Invariancelatest.set, latest.repeats, Invariancesum.perm, Invarianceextrema.set, Invarianceacc.set, Invarianceacc.late, Invarianceheads.set, Invarianceheads.late, Invarianceselect.set, Invariancespec.set, Invarianceby.set, Invariancelatest-by.order, Orderheads.whole-view, Exactnesslatest.newest, Orderlatest.one-thing, Exactnessthing.one, Exactnessthing.local, Invariancething.mentions, Invariancespec.follow, Exactnesskeyed.live, Exactnesskeyed.fold, Exactnesskeyed.slots, Exactnesskeyed.whole-read, Exactnessby.after-admission, Exactnessspec.after-supersession, Exactnesswindow.heads, Exactnessresult.unread, Refinementresult.full, Refinementthing.slice, Invariancekeyed.witnessed, Exactnesskeyed.convex, Invariancekeyed.anchored, Invariancekeyed.heads, Exactnesskeyed.cut, Invariancekeyed.base, Invariancecut.prefix, Exactnesskeyed.slice, Invariancespec.select, Invariancekeyed.by, Exactnessby.accounting, Exactnessby.partition, Exactnessspec.slice, Invariancekeyed.spec-slice, Invariancetick.inputs, Invariancetick.withheld, Invariancetick.level, Invarianceresult.shown, Invariancewhere.time, Invariancewhere.set, Invariancepayload.read, Exactnessnumeric.safe-whole, Exactnesswhere.complements, Orderwhere.typed, Exactnesswhere.fields, Exactnesswhere.total, Exactnessspec.from-thing, Exactnesskeyed.select, Exactnesswindow.span, Exactnesstick.record, Exactnesstick.made, Exactnessspec.parse, Round tripspec.hash, Exactnessspec.no-commit, Exactnessspec.no-result, Exactnesstick.canonical, Round tripresult.exact, Round tripresult.canonical, Exactnessresult.no-commit, Exactnesscount.repeats, Limitsum.repeats, Limitheads.why, Limit
Invariance: change this, and that stays.changethe order the records arrive inABCCABBCAstaysthe state

Invariance

Change this, and that stays.

Round trip: render, then parse, gives the form back; parse, then render, gives its normal form.a formits texta formrenderparse=the same form

Round trip

Render, then parse, and you get the form back. Parse, then render, and you get its normal form.

Refinement: with less in, an answer stays, becomes unknown, or says how much it could not read.Fewer payloads held, step by step:all heldABCyesone withheldABCyestwo withheldABCunknownnonever

Refinement

With less in, an answer stays, becomes unknown, or says how much it could not read.

Order: any two distinct things compare one way, by one key, then the next where they tie.by one key, then the next where they tieAB<C<D<key 11222key 2577key 3cf

Order

Any two distinct things compare one way. With a held safe whole value and a numeric bound, exactly one of at-least and below holds. Present times obey the corresponding time law.

Exactness: where the line is, an if and only if or a guarantee on one side of it; where the law refuses, it says what it refuses with.ABCDacceptedACrefusedBa stated reasonDanother reason

Exactness

Where the line is: an if and only if where the law states one, otherwise a guarantee on one side of it. Where the law refuses, it says what it refuses with.

Limit: this one moves, or can't be done here, and here is who accounts for it.ABCmovesthe answerholdswho accounts for itWhoever the law names

Limit

This one moves, or can't be done here, and here is who accounts for it.

By the question they answer

  1. What if records arrive late, out of order, or twice?19
  2. Which record is current, and what if two disagree?19
  3. What if a reader doesn't hold every payload?30
  4. What if the same thing is written two ways?11
  5. What does a test on a record answer?11
  6. What is refused, and how is it said?12
  7. What survives a trip through text and back?19
  8. Where do the guarantees stop?3

Unless a law says otherwise, an id names one record, and each id is handed over once.

Question 1 of 8

What if records arrive late, out of order, or twice?

19 laws:Invariance 17Exactness 1Limit 1

Twice is different for a count or a sum: delivering records again moves them. That is a limit; where the guarantees stop says who accounts for it.

  1. Change whether records are folded in parts or all at once, and the state stays.

    Proved for Count and LatestBy. Sum, Min and Max are step folds, for which it holds by construction; folds over heads inherit it from LatestBy's state (heads.late).

    Invarianceincremental = batchEvidence

  2. Change the arrival order, and the count stays.

    Invariancecount.permEvidenceTry it

  3. Change how the records arrive, the set kept, and every thing's state (its heads and winner) stays.

    Within one store an id names one record.

    Invariancelatest-by.setEvidenceTry itWithout its premise

  4. Change how many times a record is delivered, and the state stays.

    Within one store an id names one record.

    Invariancelatest-by.repeatsEvidence

  5. Change which way two places sync, and the state both reach stays.

    Invariancelatest-by.convergeEvidence

  6. Change arrival order and repeats, and Latest's whole-reader heads and winner stay.

    Invariancelatest.set, latest.repeatsEvidence

  7. Change the arrival order, and the sum stays.

    The model, JS and Rust use unbounded integer sums. A future bounded port must refuse overflow with sum-overflow, never wrap.

    Invariancesum.permEvidence

  8. Change arrival order and repeats, and the min or the max stays.

    Invarianceextrema.setEvidence

  9. The read path hands each id over once. dedup leaves each id once. Where an id names one record, deduplication keeps the same records.

    Only dedup is proved; a fold called directly on a list with repeats counts them.

    Exactnessinput.distinctEvidence

  10. Change which place is read first, and the union stays.

    Invarianceinput.unionEvidence

  11. Change the order, for any step that commutes, and the state stays.

    Invarianceacc.setEvidence

  12. Change whether a late record, not yet folded, is folded onto the cached state or the whole set refolded, and the new state stays.

    Invarianceacc.lateEvidence

  13. Change how the records arrive, the set kept, and any answer worked out from the heads stays.

    Invarianceheads.setEvidence

  14. Change whether a late record is folded onto the cached heads or the whole set refolded, and any answer worked out from the new heads stays.

    Invarianceheads.lateEvidence

  15. Change the order the records arrive in, and the split into read and unread stays.

    Each id is handed over once (input.distinct).

    Invarianceselect.setEvidence

  16. Admission isn't monotone in arrival: a record admitted while its prev target is unknown is refused when the target arrives of another thing, and what it superseded is current again. No step from the admitted records' per-thing state can follow that.

    A conformant writer never emits such a record (prev-unknown, prev-unrelated). A reader that caches state across arrivals keeps the records such a revision supersedes, not only the heads (heads.late).

    Limitadmit.lateEvidence

  17. Change whether a record no held record names in prev is admitted onto the cached state or the whole set readmitted, and every earlier admission, and each thing's state, stepped by the arrival when it is admitted and of that thing stays.

    This is the condition admit.late needs: only the arrival of a record some held prev already names can retract an admission.

    Invarianceadmit.growsEvidence

  18. Change the order the records arrive in, and every slot of every spec stays.

    Each id is handed over once (input.distinct).

    Invariancespec.setEvidence

  19. Change the order the records arrive in, and every group of a slot with by, its keys, its unread and its ungrouped stays.

    The set of groups a record joins is a function of that record alone. Each group is the slot without by run over the whole held set, so it rests on acc.set without follow and on heads.set with it.

    Invarianceby.setEvidence

Try to break it

Each card shows the model's output: a vector it wrote, or a premise case from lake exe boundaries. With scripts on, a button varies what the law lets vary. The trail keeps the model's answer for each variant. A second button removes a law's premise and adds the model's answer. Some inputs cannot come from the protocol. Each case states whether its input can. Without scripts, a card lists every variant and every answer. Nothing is computed in your browser.

Change the arrival order, and the count stays.

Invariance: Deliver them in another order: A C B; C B A; B A C; and the count stays.changeDeliver them in another orderACBCBABACstaysthe count

order 1 of 3

A00:01:40
auth
C00:02:30
auth
B00:02:00
cache

order 2 of 3

C00:02:30
auth
B00:02:00
cache
A00:01:40
auth

order 3 of 3

B00:02:00
cache
A00:01:40
auth
C00:02:30
auth

the count

3
  1. order 1: 3
  2. order 2: 3
  3. order 3: 3

Same count for all 3 orders the vector holds.

count.perm, from vectors/fold/count/02-three.json (current main; may differ from this page's build). The model wrote the displayed vector.

Change how the records arrive, the set kept, and every thing's state (its heads and winner) stays.

Within one store an id names one record.

Invariance: Deliver them in another order: A B; B A; and every thing's state (its heads and winner) stays.changeDeliver them in another orderABBAstaysevery thing'sstate (itsheads andwinner)

order 1 of 2

A00:01:40
auth
B00:02:30
auth

order 2 of 2

B00:02:30
auth
A00:01:40
auth

premise within one store an id names one record

the heads and winner

topic:auth heads A B · winner B
  1. order 1: heads A B, winner B
  2. order 2: heads A B, winner B
  3. premise removed: winner first, then winner second Asked of: records first, second under one id: one order, then the other. With the premise: winner second either way. Two records under one id: a reader that doesn't check ids against content could hold them

Same heads and winner for all 2 orders the vector holds.

latest-by.set, from vectors/fold/latest-by/02-fork.json (current main; may differ from this page's build). The model wrote the displayed vector.

Question 2 of 8

Which record is current, and what if two disagree?

19 laws:Invariance 2Order 4Exactness 13

  1. The winner is a head: nothing about its thing names it in prev. It is newer than every other head by content order: span, then emitted, then id.

    Orderlatest-by.orderEvidence

  2. Any two records with different ids order one way: by span, then emitted, then id. Never by how a time is spelled.

    Ordercontent orderEvidence

  3. Whole-reader heads combine every thing's heads, once per id, in content order.

    Exactnessheads.whole-viewEvidence

  4. Latest chooses the newest whole-reader head. Its other heads stay in content order.

    Orderlatest.newestEvidence

  5. Latest equals the previous global LatestBy state on one-thing input.

    Holds when every record is of the same thing.

    Exactnesslatest.one-thingEvidence

  6. A record is refused exactly when it isn't entitled to its prev, and that depends only on the set.

    Exactnessadmit.setEvidence

  7. Every held record an admitted record's prev names is of the same thing, and may be replaced by it: prev never crosses things.

    A prev naming a record the reader doesn't hold is admitted: the reader can't judge it. A reader checks neither of-missing nor roots: a record with prev and no of is of its own id, so a held target is of another thing. A writer refuses a prev naming a record it doesn't hold (prev-unknown); a reader that lacks it admits the record.

    Exactnessadmit.no-crossEvidence

  8. A record is of exactly one thing: what its of names, read as written, or without of its own id. A thing's heads are records of it, so a record heads at most one thing.

    of is never resolved through another record, so a record's thing is a fact of its own envelope.

    Exactnessthing.oneEvidence

  9. Change the records not of this thing, once records are settled and admitted, and this thing's state stays.

    Admission and erasure can read records not of this thing, so this starts after them.

    Invariancething.localEvidence

  10. Change what records mention in about, and the things and each thing's heads stay.

    Each head comes back with its new about. where and collect still read about, so their answers can change.

    Invariancething.mentionsEvidence

  11. Count, sum, min and max that follow prev fold every current record and nothing else: the whole-reader heads, each id once. They choose heads as latest-by does: from and the envelope tests choose, the payload tests filter.

    The answer depends only on the set held, through each thing's heads (heads.set), never through the commuting step. Every head of a forked thing counts. Count counts an erased or withheld head by its envelope; sum, min and max count it unread.

    Exactnessspec.followEvidence

  12. A setter of a key is live for it when no record above it over prev sets the key. Every record sets the envelope, so live for the envelope is a head. A record is live exactly when it is live for some key, the envelope among them.

    Above is reached through the records held and admitted; a prev naming a record not held reaches nothing, and only which records are held decides it. A record with no sets is read whole and sets every key; "sets": [] sets none. So every head is live, a pure join too, and a record read whole is live until a record read whole is above it. An erased or withheld record keeps its envelope and still sets its keys.

    Exactnesskeyed.liveEvidence

  13. A latest-by that follows keys gives each thing an entry for every key some live record declares and no other, each holding exactly that key's live setters, records read whole among them; its live records read whole; and its heads.

    A pure join is listed only among the heads. For a thing whose records are all read whole there is no key, and the records read whole are the heads "follow": "prev" gives. The answer depends only on the set held. It lists ids and shown states, not values, and declares no conflict between two setters of one key.

    Exactnesskeyed.foldEvidence

  14. Count, sum, min, max and collect that follow keys read things. Count counts each selected thing once, however many of its heads are chosen. Sum, min and max read the field from its one live setter. Collect lists exactly the selected things' live records, a pure-join head among them; its limit counts things, each listed whole.

    A thing is selected as keyed.select selects one. With no live setter of the field, or two or more, also holding the same number, or one whose payload is not held or holds no safe whole number there, the thing is unread to sum, min and max: the core compares no values. A thing whose tests are unknown is unread, and each thing at most once in a slot. A thing forked across records read whole counts once, where "follow": "prev" counts each head. A collect with a limit lists every live record of at most that many things, those whose newest live records are newest, and no record of the rest.

    Exactnesskeyed.slotsEvidence

  15. When every record is read whole and every thing has one head, a count, sum, min, max or collect that follows keys gives what the same slot following prev gives, grouped or not.

    A thing's live records are then its one head, each field's live setter is that head, and its envelope is that head's. Latest-by is outside: following keys it gives each thing's keyed state.

    Exactnesskeyed.whole-readEvidence

  16. Settling, admission and the whole-reader heads are worked out once, over everything held, before any group. Each group is the unmodified slot over all of it, with its selection narrowed to the group.

    A group never settles, admits or finds heads on its own: an eraser or a successor in another group still counts, and a prev across things is refused whichever group the refused record would join.

    Exactnessby.after-admissionEvidence

  17. A slot over heads returns only records that remain heads of at least one thing. Each returned record passes from and every test.

    Holds when the store's rule for who may replace whom reads only envelopes. A record heads at most one thing. Under a view, each thing keeps the same heads, and each head shows only what the view shows.

    Exactnessspec.after-supersessionEvidence

  18. An envelope window filters each thing’s existing heads. A count following prev applies its window and other tests to the heads of the entire supplied pool.

    Exactnesswindow.headsEvidence

  19. Spans order by start, then end, an open end last, with no ties: any two stores that order by it agree.

    Orderoccurred.orderEvidence

Question 3 of 8

What if a reader doesn't hold every payload?

30 laws:Invariance 17Refinement 4Exactness 9

  1. Change which payloads a reader holds, and the set of heads, by id stays.

    Each head comes back in the view's form. A record superseded within a thing is never current there.

    Invarianceview.no-resurrectionEvidenceTry it

  2. Hide payloads and a where answer stays, or becomes unknown.

    Refinementview.refinesEvidence

  3. A fold does not guess. It counts the records whose test is unknown and the selected records it cannot read.

    Count can read every selected record. Latest-by counts each head once when its payload tests are unknown, after the source and envelope tests select it. Collect counts each unknown record once, before its limit. It counts heads when it follows replacements, and all records otherwise. Count, sum, min and max that follow replacements count each unknown chosen head once, as latest-by does. Max over heads counts each head whose n field lacks a readable safe whole value. Numeric folds count hidden, missing, nonnumeric, nonwhole and unsafe whole values as unread.

    Refinementresult.unreadEvidence

  4. When every test answers and every covered record is readable to the fold, unread is zero. The result equals the selected fold.

    A payload that is here but lacks the field, or holds it as text, isn't readable to a numeric fold.

    Refinementresult.fullEvidenceWithout its premise

  5. Change which place holds which form, and what the reader keeps (one record per id) stays.

    Holds when the forms of one id agree: the same envelope, and the same payload wherever it is held.

    Invariancesettle.setEvidence

  6. A payload any place holds is kept, unless it is erased.

    Exactnesssettle.keepsEvidence

  7. Once a record naming it in erases is held, every form of its target is erased.

    Exactnesssettle.erasedEvidence

  8. Change whether a reader holds everything, or only a slice for this thing, and this thing's state, after settling and admission stays.

    Holds when the store's rule for who may replace whom reads only envelopes; the forms of one id agree: the same envelope, and the same payload wherever it is held. This carries thing.local back across settling and admission, which read one hop out: the erases of other records, and the thing of each held prev target. The proof reads only the envelopes of the erasing and the named records, so a sender may withhold their payloads. Neither addition can be dropped: without the erasing record a slice reads a payload the whole has erased, and without the named record it admits a revision the whole refuses. A slot or spec that reads several things needs a slice for each.

    Invariancething.sliceEvidence

  9. A reader holding part of a thing's records reads each record it holds as live for a key, or not, as a reader of all of them does, exactly when the part is witnessed for the key: every held setter the whole reads as dead has a setter of the key above it, through held records.

    The envelope is one of the keys, so the same holds of heads. A part that is witnessed for every key and holds the thing's live records gives its whole keyed state (keyed.fold). The law has no premise: it says exactly which parts read rightly, and the laws after it give ways to be such a part. Holding less never makes a live record read as dead; what a part can get wrong is to read a replaced record as live, because the record that replaced it, or the path up to that record, is not held. This is about a part read alone: added to an older holding, a part that was witnessed need not stay so.

    Exactnesskeyed.witnessedEvidence

  10. Change whether a reader holds every record of a thing, or a part that holds its live records and every record between two records of the part, and the thing's keyed state stays.

    Holds when no record held is above itself over prev; real ids give this, since an id is a hash of an envelope that holds its prev, and the model's records do not. Such a part is witnessed (keyed.witnessed): a dead setter has a live setter above it, and the part holds the path between them. It is one way to be witnessed and not the least: a part can be witnessed and not convex, when a later setter names the dead one directly. On an ordinary history the convex part is nearly every record since the oldest live one.

    Invariancekeyed.convexEvidence

  11. Change whether a reader holds every record of a thing, or only its live records, when every record names every live record under it, and the thing's keyed state: each key's live setters, the live records read whole, and the heads stays.

    Holds when no record held is above itself over prev; real ids give this, since an id is a hash of an envelope that holds its prev, and the model's records do not. The names are what the D8c writer's rule leaves behind: an emit names in prev, beside what it builds on, every live record of the thing its writer holds. Every record sets the envelope, so every two records share a key. Then each dead setter is named by the live setter above it, and the live records are witnessed with nothing between them (keyed.witnessed). The rule gives such names only to a holding that is closed, one that holds what the writers of its records held; a holder missing a record keeps as live a record it cannot see replaced, and reads wrongly from its own live records. The rule over payload keys alone gives the payload keys, and not the heads (keyed.heads).

    Invariancekeyed.anchoredEvidence

  12. With anchored names, the live records of a thing read alone give its heads, and every live record is a head or is named by one.

    Holds when no record held is above itself over prev; real ids give this, since an id is a hash of an envelope that holds its prev, and the model's records do not. A head is live for the envelope, which every record sets (keyed.live), so this is keyed.anchored at that key. The heads list the slice: a reader that holds a thing's heads knows every other live record by name. With the rule over payload keys alone it fails: a record that sets title under two that set status is named by neither, and the live records read alone take it for a head.

    Exactnesskeyed.headsEvidence

  13. Change whether a reader holds a part closed downward of a closed holding whose writers followed the rule, or only that part's live records, and what the part reads: each key's live setters, and the heads stays.

    Holds when the store's rule for who may replace whom reads only envelopes; the forms of one id agree: the same envelope, and the same payload wherever it is held; no record held is above itself over prev; real ids give this, since an id is a hash of an envelope that holds its prev, and the model's records do not. A part is closed downward when it holds every held record one of its records names in prev. Such a part is a state the holding could have been in: it reads a record as live for a key exactly when no setter of the key in the part is above it in the whole, with nothing missing between them. It also holds what the writers of its records held, because a writer names every record it holds that is live there and every other record it holds is under one of those. So the writer's rule carries to it and keyed.anchored applies. The premise is the rule, over what each writer held. Anchored names in the whole would not do: they are about what is live now, and a holding can have them while a past of it does not. Behind settling and admission, such a part holds what each of its records names in prev, so it holds the target a record is refused for and refuses what the whole refuses: with every form of the records of a thing it holds, and what erases them, keyed.slice and keyed.spec-slice apply to it with nothing asked about admission. A cut is such a part, or a slice of one.

    Invariancekeyed.cutEvidence

  14. Change whether a writer writes from everything its store holds, or against a base: a part of it that holds what the writers of its records held, and that the store's names are anchored, so its live records read alone read every key as it does stays.

    Holds when no record held is above itself over prev; real ids give this, since an id is a hash of an envelope that holds its prev, and the model's records do not. An emit against a base names the records of the base that are live in the base. That is the emit a holder of exactly the base would have written, whatever the base is. The writer's rule has three parts: a writer names only what it holds, it names every record it holds that is live there, and it holds what the writers of its records held. The first two are the emit's. The third is the base's: it is a holding. A part closed downward of a closed holding is one (keyed.cut), and for that case the premise is that prev has no cycle. Then the store with the emit is closed and its writers followed the rule, so keyed.anchored applies to it. The base need not be closed downward itself: a part of a part closed downward that holds every record live in it will do, because it names what a holder of the closed part would name and nothing outside it. A thing's live records at a cut, alone, are such a base. A record live in the base and replaced in the store is named all the same: the emit then stands beside what replaced it as a second head, and a key both set shows as a conflict, which is what happened. An emit can name more than the base's live records: when what it adds is already under one of its names, the same records are above every record of the store, so the whole store reads every key as it would without the added names. Naming the live records of the base's closure in the store, and not of the bare base, is that, and the closure is a part closed downward. A base that is not closed breaks it: with a record that sets two keys, a second that sets one of them over it, and a base of the second alone, an emit of that key names the second and not the first, which is still live for its other key and is now under the emit unnamed; the live records read alone read the first as a live setter of the emit's key.

    Invariancekeyed.baseEvidence

  15. Every prefix, the records emitted before a time, is closed downward exactly when no record names a record with a later emitted.

    A time names a prefix, and a cut is a part closed downward (keyed.cut). Clocks disagree, so a record can name one emitted later by its writer's clock, and then some prefix holds a record without what it names. Two parts closed downward stand beside any part. Down is the part with every held record under it: the least part closed downward that holds it. Held back is the records of the part with every held record under them in it: the greatest part closed downward inside it. At a time, a record is held back exactly when it and everything held under it were emitted before it, so held back is the prefix of another clock, a record's own emitted or the latest under it, which is what a writer that never emits earlier than what it names would have written. A prefix that is not closed downward reads wrongly: of three records in a line, the middle one emitted by a clock five seconds fast, the prefix at two seconds holds the last, which replaced the first, and reads the first as live, because the path between them goes through the record it lacks. Down at that time holds all three. As of a time is down (ruled 2026-11-20).

    Exactnesscut.prefixEvidence

  16. Change whether a reader holds everything, or a witnessed part that holds every form of the thing's live records and what erases them, and the thing's keyed state, after settling and admission stays.

    Holds when the store's rule for who may replace whom reads only envelopes; the forms of one id agree: the same envelope, and the same payload wherever it is held; no record held is above itself over prev; real ids give this, since an id is a hash of an envelope that holds its prev, and the model's records do not. This carries keyed.witnessed back across settling and admission. For each record of the thing the part holds at all, it holds every form and every record that erases it, and it refuses the record when the whole does. With anchored names (keyed.anchored) the forms of the live records and what erases them are enough; that case is the one that needs prev to have no cycle. Nothing is owed for the prev targets of a record the whole admits: admission asks only about the targets held, so any part admits it. A record the whole refuses is admitted by a part that lacks the target it is refused for. Here it differs from thing.slice, which sends the targets. Under keys a target's envelope still sets its keys, so a target held without its witness can read as a live setter; a whole slice of the thing, which holds every record of it, gives the keyed state too. Without the eraser a part shows a payload the whole has erased.

    Invariancekeyed.sliceEvidence

  17. Change which payloads a reader holds, and the admitted records and each thing's heads by id stay.

    Holds when the store's rule for who may replace whom reads only envelopes. Every record comes back in the view's form; a record superseded in a thing is never current there.

    Invarianceview.no-resurrection (things)Evidence

  18. Under a view, a test and a where map keep their answer, or it becomes unknown.

    Refinementview.refines (where)Evidence

  19. Change which payloads a reader holds, and the set of records a spec's from takes stays.

    The selection holds exactly the input records the spec takes. Each comes back in the view's form. A where test on a payload can still answer unknown under a view (view.refines).

    Invariancespec.selectEvidence

  20. A slot with by that follows keys groups things. A payload key is read from each live setter of the field; an envelope key from each chosen head. Every selected thing, or one whose tests are unknown, is exactly one of grouped, ungrouped or unread.

    Each distinct member key across those lists gives one group. A live setter whose payload is not held makes a payload key unread; with no setter the thing is ungrouped. An envelope key is never unread: the envelope is read from the heads, so a later head moves a thing between groups, a forked thing is in the group of each chosen head once, and a pure-join head settles them. Each group is the slot without by over its things.

    Exactnesskeyed.byEvidence

  21. Every record a slot with by selects, or whose where is unknown, is exactly one of grouped, ungrouped or unread. The groups hold each grouped record once per key.

    The group sizes add up to memberships, not records: a record mentioning two projects is in both. When every selected record has at most one key they add up to records: always for kind and observer, and for a payload field with at most one distinct key per record. A group exists only where something was selected into it.

    Exactnessby.accountingEvidence

  22. A grouped count's groups, ungrouped and unread add up to the value and unread of the same count without by, when every selected record has at most one key.

    Kind and observer always give one key. A list field or a prefixed about can give several. Otherwise the group values add up to the keys of the selected records.

    Exactnessby.partitionEvidenceWithout its premise

  23. Change whether a reader holds everything, or only a slice for this spec, and every slot of the spec: its values, its current records with what is shown of each, and its unread counts stays.

    Holds when the store's rule for who may replace whom reads only envelopes; the forms of one id agree: the same envelope, and the same payload wherever it is held. thing.slice answers for one thing. A spec takes records by kind, by mention and by thing, so the records it takes need not be whole things, and two more kinds of record matter. A taken record is current only when no admitted record of its thing replaces it, and the replacing record may be one the spec does not take. That record replaces only when it is admitted, and admission reads the thing of each of its held prev targets. Admission reads what is held, not what is admitted, so nothing further out is read. The proof reads only the envelopes of everything but the taken records. Neither new kind can be dropped: without the successor a slice shows a record the whole has replaced, and without the successor's other target it admits a successor the whole refuses. So the records a spec takes are not by themselves enough to answer it. A slot that follows keys, of any fold type, is outside this law: it reads live setters the spec does not take. The slice for one keyed thing is keyed.slice, and keyed.spec-slice answers a spec with such a slot.

    Invariancespec.sliceEvidence

  24. Change whether a reader holds everything, or a spec slice with a cover of every thing the spec could select, and every slot of the spec, the slots that follow keys among them stays.

    Holds when the store's rule for who may replace whom reads only envelopes; the forms of one id agree: the same envelope, and the same payload wherever it is held; no record held is above itself over prev; real ids give this, since an id is a hash of an envelope that holds its prev, and the model's records do not. A slot that follows keys reads each thing it selects by its live setters, records the spec need not take, so spec.slice is not enough for it. A part covers a thing when its folded records of the thing are the whole's, hold the thing's live records, and are witnessed for every key (keyed.witnessed); it then reads the thing's heads, payload tests, setters, live records and group keys as the whole does. A thing need not be covered when neither reader can select it: the part folds no record of it the spec takes, and the whole has no head of it the spec takes. The cover alone answers a spec whose slots all follow keys. A part of the forms covers a thing as keyed.slice says, and with anchored names by the forms of its live records and what erases them; that case is the one that needs prev to have no cycle. A spec slice can bring, as a target, a record of a covered thing that the whole refuses; the part then holds what that record names in prev and so refuses it too, or it admits the record and reads the keys it sets. The law asks for what erases any record the part holds of a covered thing, a little more than a keyed slot reads.

    Invariancekeyed.spec-sliceEvidence

  25. Change which holder replays the claim, and the canonical result bytes stays.

    Holds when the forms of one id agree: the same envelope, and the same payload wherever it is held. Forms are jointly consistent. Both holders have a form for every covered id and local access to each required opening.

    Invariancetick.inputsEvidence

  26. Change which form a holder reads for a withheld id, and every slot of the claim stays.

    Holds when the two forms have the same envelope; the forms of one id agree: the same envelope, and the same payload wherever it is held. An exchange needs only the shared envelope and membership in withheld. Adding a further copy also uses consistency of the original holding and the presence of the original form.

    Invariancetick.withheldEvidence

  27. Change the forms outside the cover, and the claim when the ordered list of covered forms is unchanged stays.

    A covered tick contributes one record. Appending any forms outside the cover preserves every result slot.

    Invariancetick.levelEvidence

  28. Change what is shown of each record a result lists: its payload held, withheld or erased, and the canonical result's text, bytes, preimage and hash, for any hash stay.

    The canonical result lists each record by its id alone. A reading still says what its reader holds of each. A value read from a payload, such as a payload test or a sum, can still differ between readers; that is a different result, not a different spelling of one.

    Invarianceresult.shownEvidence

  29. Change whether the payload's opening is kept, and the id stays.

    Invariancerecord.erasureEvidenceTry it

  30. A record's own salt and payload open its commitment.

    Exactnessrecord.commitEvidence

Try to break it

Each card shows the model's output: a vector it wrote, or a premise case from lake exe boundaries. With scripts on, a button varies what the law lets vary. The trail keeps the model's answer for each variant. A second button removes a law's premise and adds the model's answer. Some inputs cannot come from the protocol. Each case states whether its input can. Without scripts, a card lists every variant and every answer. Nothing is computed in your browser.

Change which payloads a reader holds, and the set of heads, by id stays.

Each head comes back in the view's form. A record superseded within a thing is never current there.

Invariance: Deliver them in another order, the head's payload withheld: A B (payload not held); B (payload not held) A; and the set of heads, by id stays.changeDeliver them in another order, the head's payloadwithheldABBAstaysthe set ofheads, by id

order 1 of 2

A00:01:40
auth
B00:03:20
withheld
auth · after A

order 2 of 2

B00:03:20
withheld
auth · after A
A00:01:40
auth

the heads

heads B (withheld)max none · unread 1
  1. order 1: heads B (withheld), max none, unread 1
  2. order 2: heads B (withheld), max none, unread 1

Same heads, by id, for all 2 orders the vector holds, the head's payload withheld in each. Max and unread are the model's answer too; they are not what this card compares. The vector's README says: “With consistent forms, these are the same heads as the full reader's.”

The vector varies arrival order and withholds the head's payload in every variant. It holds no variant in which the reader holds every payload.

view.no-resurrection, from vectors/fold/view/01-withheld-head-still-supersedes.json (current main; may differ from this page's build). The model wrote the displayed vector.

Change whether the payload's opening is kept, and the id stays.

Invariance: Forget the payload's opening: A payload held; A (payload not held) payload erased; and the id stays.changeForget the payload's openingApayload heldApayload erasedstaysthe id

record A, stored, payload held

"env": {"about":["r:iivodlg66vgka…pu5g"}
"id": "r:oj2onnacl7rlc4tr81kj87g…lrr80"
"payload": {"body":"Called the custom…0100"}
"salt": "peebbe9eja4kldnvmq9k16use4"
"sig": {"ed25519":"hb0vo0vi1f3uka…2ebg"}

record A, erased: the commitment kept

"commit": "h:irqtqi3om2e84leelspjnju…f2cgg"
"env": {"about":["r:iivodlg66vgka…pu5g"}
"id": "r:oj2onnacl7rlc4tr81kj87g…lrr80"
"sig": {"ed25519":"hb0vo0vi1f3uka…2ebg"}

the id

id r:oj2onnacl7rlc4tr81kj…jlrr80
  1. payload held: id r:oj2onnacl7rlc4tr81kj…jlrr80
  2. payload erased: id r:oj2onnacl7rlc4tr81kj…jlrr80

Same id for both lines the vector holds.

Both lines are the vector's own; each carries this id. The id hashes the commitment, never the payload, so forgetting the opening can't move it.

record.erasure, from vectors/record/08-erasure.json (current main; may differ from this page's build). The model wrote the displayed vector.

A grouped count's groups, ungrouped and unread add up to the value and unread of the same count without by, when every selected record has at most one key.

Kind and observer always give one key. A list field or a prefixed about can give several. Otherwise the group values add up to the keys of the selected records.

Exactness: A grouped count's groups, ungrouped and unread add up to the value and unread of the same count without by, when every selected record has at most one key.ABCDin: all that fitACout: the restBD

premise holds

routes is the text a

premise removed

routes holds the list [a, b]

premise each selected record has at most one key

  1. premise holds: 1 grouped membership
  2. premise removed: 2 grouped memberships Asked of: routes holds the list [a, b]. With the premise: 1 grouped membership. One selected record in a count by routes

by.partition, from design/laws/boundaries.json, written by lake exe boundaries

When every test answers and every covered record is readable to the fold, unread is zero. The result equals the selected fold.

A payload that is here but lacks the field, or holds it as text, isn't readable to a numeric fold.

Refinement: When every test answers and every covered record is readable to the fold, unread is zero. The result equals the selected fold.When every test answers and every covered recordis readable to the fold, unread is zero. The…all heldABC0 unreadone withheldABC1 unreadtwo withheldABC2 unreadguessnever

premise holds

sum of est over a record holding est = 3

premise removed

the same record, its payload here but with no est

premise every record is readable to the fold

  1. premise holds: value 3 · unread 0
  2. premise removed: value 0 · unread 1 Asked of: the same record, its payload here but with no est. With the premise: value 3 · unread 0. A valid input: a payload can lack a field

result.full, from design/laws/boundaries.json, written by lake exe boundaries

Question 4 of 8

What if the same thing is written two ways?

11 laws:Invariance 6Order 1Exactness 4

These laws cover set order and repeats in about, prev and erases, and leaving out an absent of. They cover object member order and calendar-date spellings of the same occurred span. Each accepted instant has one spelling. They also cover test order and batch draft order. They promise no other spelling invariance.

  1. Two accepted instant texts with the same moment are equal.

    Holds when the actual instant reader accepts the text and returns the stated moment. The premises use the actual instant? parser on each String. The proof derives calendar and clock bounds from successful parsing. It assumes no parser injectivity.

    Exactnessinstant.uniqueEvidence

  2. Change an accepted envelope time or test time, while keeping its parsed span, and the answer stays.

    An instant has one accepted spelling. Date claims can retain the same span with different qualifiers. A time in a payload remains text.

    Invariancewhere.timeEvidence

  3. Change the order of a where map's tests, and its answer stays.

    Invariancewhere.setEvidence

  4. An acyclic batch has at most one meaning. Any two satisfying assignments of ids to its labels agree.

    Holds when the batch is acyclic: its labels can be ranked so that a draft uses only labels ranked below its own. A label may stand in about, of, prev or under, and each counts toward acyclicity. Vectors check resolver answers across draft rotations. The uniqueness theorem does not prove resolver correctness.

    Exactnessbatch.meaningEvidence

  5. Change the order of, and repeats in, about, prev, erases or sets, and the id stays.

    Invariancerecord.setsEvidenceTry it

  6. Change the order of an object's members, and its canonical bytes stay.

    Holds when the object's member names are distinct.

    Invariancerecord.member-orderEvidenceWithout its premise

  7. Any two distinct strings order one way, by UTF-16 code units.

    OrderUTF-16 orderEvidence

  8. Change the order of a written payload's members, and its commitment stays.

    Invariancewrite.member-orderEvidence

  9. Each accepted point gives its grammar-defined span, alone or open-ended. Two points form an interval when the second starts no earlier. Spans never end before their start.

    Which texts are points is the grammar itself, pinned by vectors, not proved.

    Exactnessoccurred.spanEvidence

  10. Change a qualifier on a date, ?, ~ or %, and the span stays.

    Instants take no qualifier.

    Invarianceoccurred.qualifierEvidenceTry it

  11. A parsed moment contains whole seconds and a fraction without trailing zeros. List comparison equals exact decimal comparison.

    Holds when the actual instant reader accepts the text and returns the stated moment. The comparison theorem takes two stripped fractions and a scale at least as long as both. Accepted instant fractions already have canonical spelling.

    Exactnessoccurred.momentEvidence

Try to break it

Each card shows the model's output: a vector it wrote, or a premise case from lake exe boundaries. With scripts on, a button varies what the law lets vary. The trail keeps the model's answer for each variant. A second button removes a law's premise and adds the model's answer. Some inputs cannot come from the protocol. Each case states whether its input can. Without scripts, a card lists every variant and every answer. Nothing is computed in your browser.

Change the order of, and repeats in, about, prev, erases or sets, and the id stays.

Invariance: Spell about another way: A [topic, svc, url]; A [url, topic, svc]; A [svc, topic, svc, url, topic]; and the id stays.changeSpell about another wayA[topic, svc, url]A[url, topic, svc]A[svc, topic, svc, url, topic]staysthe id

record A, spelling 1 of 3

A09:30:00
note
about
[topic:auth, svc:api, url:https://example.com/x]

record A, spelling 2 of 3

A09:30:00
note
about
[url:https://example.com/x, topic:auth, svc:api]

record A, spelling 3 of 3

A09:30:00
note
about
[svc:api, topic:auth, svc:api, url:https://example.com/x, topic:auth]

the id

id r:qfvokrar0to096s62uju…gtngd0
  1. spelling 1: id r:qfvokrar0to096s62uju…gtngd0
  2. spelling 2: id r:qfvokrar0to096s62uju…gtngd0
  3. spelling 3: id r:qfvokrar0to096s62uju…gtngd0

Same id for all 3 spellings the vector holds.

One id for every spelling: the envelope is written in its canonical form, sorted with repeats removed, before it is hashed. The JS writer computes the same id.

record.sets, from vectors/record/03-sets-are-sets.json (current main; may differ from this page's build). The model wrote the displayed vector.

Change a qualifier on a date, ?, ~ or %, and the span stays.

Instants take no qualifier.

Invariance: Qualify the date: 2009; 2009?; 2009~; 2009%; and the span stays.changeQualify the date20092009?2009~2009%staysthe span

spelling 1 of 4

2009

spelling 2 of 4

2009?

spelling 3 of 4

2009~

spelling 4 of 4

2009%

the span

2009-01-01T00:00:00Z → 2010-01-01T00:00:00Z
  1. spelling 1: 2009-01-01T00:00:00Z → 2010-01-01T00:00:00Z
  2. spelling 2: 2009-01-01T00:00:00Z → 2010-01-01T00:00:00Z
  3. spelling 3: 2009-01-01T00:00:00Z → 2010-01-01T00:00:00Z
  4. spelling 4: 2009-01-01T00:00:00Z → 2010-01-01T00:00:00Z

Same span for all 4 spellings this card picks from the vector.

occurred.qualifier, from vectors/occurred/03-qualifiers.json (current main; may differ from this page's build). The model wrote the displayed vector.

Change the order of an object's members, and its canonical bytes stay.

Holds when the object's member names are distinct.

Invariance: change the order of an object's members, and its canonical bytes stays.changethe order of an object's membersABCA′BC′A″B′Cstaysits canonicalbytes

premise holds

{"x":1,"y":2}, its members in both orders

premise removed

{"x":1,"x":2}, its members in both orders

premise member names are distinct

  1. premise holds: {"x":1,"y":2} and {"x":1,"y":2}
  2. premise removed: {"x":1} and {"x":2} Asked of: {"x":1,"x":2}, its members in both orders. With the premise: {"x":1,"y":2} and {"x":1,"y":2}. Refused at layer 0 (member-duplicate), so no record holds it

record.member-order, from design/laws/boundaries.json, written by lake exe boundaries

Question 5 of 8

What does a test on a record answer?

11 laws:Order 1Exactness 10

  1. A stored opening supplies the top-level fields of its payload. Reading depends only on that payload. A held non-object supplies no fields.

    Lookup in an object reads the value written under that name. Every member retained from a list can be named by an equality argument. An erased opening gives the erased view.

    Exactnesspayload.readEvidence

  2. Numeric slots read written safe-whole values only when the payload is here. Missing fields, lists and other values without a safe whole count as unread.

    An unreadable field leaves a sum as it was. Min and Max read a record exactly when its n is a held safe whole number.

    Exactnessnumeric.safe-wholeEvidence

  3. Where a test answers, not complements is; absent complements present. With a held safe whole value and a numeric bound, exactly one of at-least and below holds. Present times obey the corresponding time law.

    On a payload the reader doesn't hold, a payload test answers unknown, and so does its complement.

    Orderwhere.complementsEvidenceWithout its premise

  4. A test is accepted exactly when its operator and argument fit its field, and renders back as it was written.

    Numeric arguments and bounds are safe-whole. Lists satisfy neither bound. Integral decimals and exponents normalize to integers before parsing.

    Exactnesswhere.typedEvidence

  5. kind and observer read as their text; about, of, prev, under and erases as their members, of as written and absent on a root; emitted as its instant.

    A held payload field is present exactly when written. Lists test typed membership, including when they have no nameable members. occurred reads as its span (where.time).

    Exactnesswhere.fieldsEvidence

  6. A test answers for every record whose payload is here, and an envelope test for every record at all.

    Exactnesswhere.totalEvidence

  7. from's of takes exactly the records of the thing, a root by its own id. from's about takes exactly the records that mention it, as written.

    Exactnessspec.from-thingEvidence

  8. Heads choose, each alone: a thing is kept when from and the envelope tests choose one of its heads and its payload tests hold of the thing, with its whole keyed state. A payload test is asked of every live setter of its field; one answer from all of them is the answer.

    Two setters that answer differently, or one whose payload is not held, make the test unknown, and the thing is unread once. With no setter the field is absent, as a missing field in a held payload is. A record with sets is never asked about a key it does not declare. A declared null is present and an omitted field is absent. Each list is tested at its setter. The core compares test answers, never payload values.

    Exactnesskeyed.selectEvidence

  9. The window field reads the stated occurrence span, or the point at the emitted instant when occurred is absent.

    Exactnesswindow.spanEvidence

  10. A held tick opening gives the rules version and both hashes as text, each id list as a field with text members, and the spec and result as present fields without a scalar value.

    The writer omits an empty withheld list. The ordinary payload projection gives these fields for any envelope, salt and hash function.

    Exactnesstick.recordEvidence

  11. A tick made with a fitting spec checks same on the writer's holding, including after appending outside forms that erase no covered id.

    The check reads the serialized current-version payload under any hash giving 32 bytes on its two preimages. The reference SHA-256 supplies both widths by proof.

    Exactnesstick.madeEvidence

Try to break it

Each card shows the model's output: a vector it wrote, or a premise case from lake exe boundaries. With scripts on, a button varies what the law lets vary. The trail keeps the model's answer for each variant. A second button removes a law's premise and adds the model's answer. Some inputs cannot come from the protocol. Each case states whether its input can. Without scripts, a card lists every variant and every answer. Nothing is computed in your browser.

Where a test answers, not complements is; absent complements present. With a held safe whole value and a numeric bound, exactly one of at-least and below holds. Present times obey the corresponding time law.

On a payload the reader doesn't hold, a payload test answers unknown, and so does its complement.

Order: Where a test answers, not complements is; absent complements present. With a held safe whole value and a numeric bound, exactly one of at-least and below holds. Present times obey the corresponding time law.exactly one holds, where the test answersisnotACBDEpayload not held: both unknownat-least and below: only on a number or a time

premise holds

is and not "yes" on a record whose value is yes

premise removed

the same tests, the payload withheld

premise the test answers

  1. premise holds: is yes · not no
  2. premise removed: is unknown · not unknown Asked of: the same tests, the payload withheld. With the premise: is yes · not no. A valid input: a reader may hold an envelope without its payload

where.complements, from design/laws/boundaries.json, written by lake exe boundaries

Question 6 of 8

What is refused, and how is it said?

12 laws:Invariance 1Exactness 11

  1. Duplicate labels, missing labels and cycles are refused, a label in under among them. Drafts must pass write checks. Each prev target must be held, and so must each under target. An of naming a held record must name a root. Each held prev target must be of the record's thing.

    Exactnessbatch.refuseEvidence

  2. Change the draft order and the order each stage finds its refusals in, and the refusal reported stays.

    Across the batch: shape, then labels, then writing, then prev-unknown, then under-unknown, then of-not-root, then prev-unrelated. Raw shape checks all envelope keys, then that every envelope is an object, before any draft value, label or salt decode. The shape theorems permit arbitrary values, member reorderings and draft orders. Writing's priority is proved from the refusal set. Stage order is by construction, pinned by raw-input rotations.

    Invariancebatch.refuse-orderEvidence

  3. Malformed text, empty section ids and repeated section ids are refused.

    Exactnesslens.refuseEvidence

  4. A base that repeats a section id is refused with base-id-duplicate, before the text is read and whatever the text says.

    This is the public reader, read. What it accepts is the raw edit over distinct base ids, so lens.put-get then needs no promise about the base from the caller. The raw lookup still takes the first section with an id, unchecked.

    Exactnesslens.base-distinctEvidence

  5. sets holds key names, and absent and empty differ: the canonical envelope writes an empty sets as [], so it is not the envelope without one. An envelope the writer accepts declares only non-empty key names, or it is refused with sets-not-keys, after erases-not-record-id and before of-missing.

    sets names top-level payload keys. Nothing compares it with the payload, so a declared key the payload lacks is written, and the envelope stays checkable without its payload. A latest-by that follows keys reads it (keyed.live); no other fold, spec or lens does.

    Exactnessrecord.keysEvidence

  6. Only a root leaves of out: an envelope the writer accepts with prev states of, or it is refused with of-missing.

    of holds one typed reference, a record id or a natural key, and is left out when absent, so a record without it keeps its bytes and id.

    Exactnessrecord.ofEvidence

  7. Every envelope shape has a named refusal. An envelope that is not an object is refused with envelope-not-object, after any unknown key and before every value. A required field left out, or a field of the wrong JSON type, is refused with that field's own code, in its place. A salt that is not base32hex text is refused with salt-not-16-bytes.

    Proved: the reader reads such a field as empty text, an envelope holding it is refused, and no accepted or stored record holds it, though it can be hashed on the way to a refusal. Pinned by the vectors: which code it gets and its place in the order, and the order of the shape stage. A repeated envelope member name is malformed input, with no code.

    Exactnessrecord.shapeEvidence

  8. Text is Unicode scalar values. UTF-16 code units read as text exactly when their surrogates pair; a lone surrogate is no text, and nothing is put in its place.

    No string the model canonicalizes or hashes holds a lone surrogate. A payload text that is JSON but holds one, in a string or a member name, is refused with string-not-unicode: after raw shape, before every value check. Text that is not JSON has no refusal code.

    Exactnessrecord.unicodeEvidence

  9. Writing refuses a bad envelope, an invalid salt length, a repeated member name, or a nonfinite or out-of-range number. Every number's magnitude must be at most 253 − 1, whole or not.

    Raw unknown envelope keys refuse first, then an envelope that is not an object (record.shape), then a lone surrogate in a text payload (record.unicode), then these in order. A record input that lists several envelopes or payloads is answered by its first of each.

    Exactnessrecord.refuseEvidence

  10. write succeeds exactly when every check passes, and what it returns carries the proof.

    Exactnesswrite.checkedEvidence

  11. A number past binary64's range is refused by the writer's number check as number-out-of-range, and that check speaks last: only when the envelope, the salt and the member names pass.

    The number stays a number until that check; no reader refuses it earlier under another name. A spec refuses it where it refuses any number out of range. A reader's own records must hold finite numbers.

    Exactnesswrite.overflowEvidence

  12. A text the reader doesn't accept is refused with occurred-not-span, never guessed at.

    Exactnessoccurred.refuseEvidence

Question 7 of 8

What survives a trip through text and back?

19 laws:Invariance 2Round trip 10Order 1Exactness 6

  1. An id's digest has exactly 32 bytes. Reading these bytes gives the same id. Two ids have the same text only when they are equal.

    The model keeps every record id and reference below 2256. Reading any 32 bytes gives an id below 2256. Writing that id back gives the same 32 bytes. The model's SHA-256 returns 32 bytes. With the model's SHA-256, an id written from bytes equals the id written from the number. The model does not derive fold records from these hashes.

    Round tripid.digestEvidence

  2. The base32hex decoder accepts exactly the encoder image. Decoding encoded bytes recovers those bytes. Equal encoded texts have equal bytes.

    The encoder uses lowercase base32hex without padding characters. The decoder rejects nonzero unused bits. The fixed-width reader also requires the stated byte count. These results hold for every finite byte list and text, without a hash assumption.

    Round tripbase32.canonicalEvidence

  3. Actual String lexical order on id text equals numeric digest order.

    Both inputs have type RecordId. This type bounds each id below 2^256 and gives each digest exactly 32 bytes. The theorem uses Lean's existing String order, not a separate text-order relation. JS UTF-16 order and Rust byte order agree with Lean String order on ASCII; canonical id text is ASCII by construction.

    Orderid.text-orderEvidence

  4. Parse then render recovers the original accepted instant text, character for character.

    Holds when the actual instant parser accepts the text and returns these numeric fields. The premise uses the actual instantParts? parser. The renderer writes its numeric calendar and clock fields and its fraction. It does not retain the input text.

    Round tripinstant.round-tripEvidence

  5. An accepted spec's parsed form parses back to itself, and the parser gives exactly the specs that fit.

    Round tripspec.parseEvidence

  6. Two fitting parsed specs have equal preimages exactly when their versions agree and they differ only in the order of slots, fields within a where, and operators within a field. Such specs have equal hashes and give equal result bytes on every input.

    Holds when the spec names each slot once, as every spec the parser accepts does. For arbitrary JSON members the preimage determines the version and JCS text. The result equality holds for every common admission rule. The proofs assume no property of the hash function.

    Exactnessspec.hashEvidence

  7. Byte 17 of the spec preimage is v. A record commitment hashes a 16-byte salt followed by JSON, whose first byte cannot be v.

    Exactnessspec.no-commitEvidence

  8. Spec and result preimages differ at byte seven for every version, spec member and result.

    Exactnessspec.no-resultEvidence

  9. A fitting written payload reads back under its own rules in spec slot order, with listed ids shown here. Every successful common read excludes repeated names throughout. Equal JCS texts of finite accepted inputs have equal wire values, including array positions and scalar tokens.

    Holds when the JSON values have finite numbers throughout, as JCS requires; the spec names each slot once, as every spec the parser accepts does. The writer requires two 32-byte digests, strictly increasing id lists, every withheld id covered and distinct names in the spec and result. Typed payload reads preserve the input text. Reconstructing it from raw members also requires a known result label: the stated version is at most the reader's.

    Round triptick.canonicalEvidence

  10. An integer of any size is written as its decimal digits, with - before a negative one, and is never rounded or capped. The codec's reader accepts a text exactly when it is the text of an integer, and reads it as that integer.

    No integer in a canonical result is a JSON number, so binary64 never touches it: a sum past 253 keeps every digit. The reader takes no other spelling of an integer: not -0, not a leading zero, not +. An integer stands only at value, unread and ungrouped, so the position tells it from text.

    Round tripresult.exactEvidence

  11. Two runs of one spec, over any records and under any rule for who may replace whom, have the same canonical text, bytes and preimage of the hash exactly when their results agree once what is shown is set aside.

    Holds when the object's member names are distinct; the spec names each slot once, as every spec the parser accepts does. So the bytes lose shown and nothing else: every slot, a list's order, every count, id, thing, key and group key are in them. This result proof uses injectivity on the JSON the result codec writes: null, text, arrays, and objects whose members are in UTF-16 order, each named once. A count and a sum that hold the same number write the same JSON, so the bytes say which fold only together with the spec. The hash is a parameter: that different preimages hash apart is SHA-256's to give.

    Exactnessresult.canonicalEvidence

  12. A result hash's preimage is never a 16-byte salt followed by the canonical bytes of a JSON value, which is what a record's commitment hashes. So no record commits to a result hash's preimage, whatever its salt and payload.

    The label loops/result-hash/v1: is 21 bytes, so the preimage's 17th byte is h, and no canonical JSON text starts with h. The text prefixes also differ (res: for results, h: for commitments), and the label keeps the preimages apart. A 16-byte label would not keep them apart.

    Exactnessresult.no-commitEvidence

  13. Any body survives rendering and parsing, backslashes and all.

    Holds when the section id is nonempty.

    Round triplens.escapingEvidence

  14. Render, then parse, and you get back what you rendered.

    Holds when section ids are nonempty and distinct.

    Round triplens.round-tripEvidenceTry it

  15. Parse an unedited render and there is nothing to apply.

    Holds when section ids are nonempty and distinct.

    Round triplens.no-opEvidenceWithout its premise

  16. An edit that keeps exactly the base's sections, in the same order, applies exactly.

    Holds when the base's section ids are distinct.

    Round triplens.put-getEvidenceWithout its premise

  17. Every section is unchanged, accepted or reported; every dropped one is reported.

    Exactnesslens.nothing-droppedEvidence

  18. Change the text by dropping a section, and that section of the state stays.

    Absence is never an edit; the other sections' accepted edits still apply.

    Invariancelens.absence-not-editEvidenceTry it

  19. Change whether text that is already normal is normalized again, and the text stays.

    Invariancenormal formEvidence

Try to break it

Each card shows the model's output: a vector it wrote, or a premise case from lake exe boundaries. With scripts on, a button varies what the law lets vary. The trail keeps the model's answer for each variant. A second button removes a law's premise and adds the model's answer. Some inputs cannot come from the protocol. Each case states whether its input can. Without scripts, a card lists every variant and every answer. Nothing is computed in your browser.

Render, then parse, and you get back what you rendered.

Holds when section ids are nonempty and distinct.

Round trip: sections, render to text, parse, and the same sections.sectionstextsectionsrenderparse=the same sections

the state

decision:auth  Use OAuth device flow. / Revisit in Q3.
decision:cache  No cache until reads are slow.

the text

::: decision:auth
Use OAuth device flow.

Revisit in Q3.
:::
::: decision:cache
No cache until reads are slow.
:::

the sections

decision:auth  Use OAuth device flow. / Revisit in Q3.
decision:cache  No cache until reads are slow.
  1. the state: decision:auth, decision:cache
  2. the text, parsed: decision:auth, decision:cache

Parsing the render gives the sections back, exactly.

lens.round-trip, from vectors/lens/section/01-round-trip.json (current main; may differ from this page's build). The model wrote the displayed vector.

Change the text by dropping a section, and that section of the state stays.

Absence is never an edit; the other sections' accepted edits still apply.

Invariance: Drop a section from the text: decision:auth, decision:cache; decision:auth; and that section of the state stays.changeDrop a section from the textdecision:auth, decision:cachedecision:authstaysthat section of the state

the state

decision:auth  Use OAuth device flow. / Revisit in Q3.
decision:cache  No cache until reads are slow.

the text

::: decision:auth
Use OAuth device flow.

Revisit in Q3.
:::

the sections

decision:auth  Use OAuth device flow. / Revisit in Q3.
decision:cache  No cache until reads are slow.
  1. the state: decision:auth, decision:cache
  2. the text, parsed: decision:auth · absent decision:cache

Parsing reports decision:cache as absent; applying that leaves the section in the state as it was.

lens.absence-not-edit, from vectors/lens/section/06-dropped-section.json (current main; may differ from this page's build). The model wrote the displayed vector.

Parse an unedited render and there is nothing to apply.

Holds when section ids are nonempty and distinct.

Round trip: the base, render to unedited text, parse, and nothing to apply.the baseunedited textno editsrenderparsenothing to apply

premise holds

parse an unedited render of two sections

premise removed

the same, both sections keyed decision:auth

premise the base's section ids are distinct

  1. premise holds: nothing to apply
  2. premise removed: refused Asked of: the same, both sections keyed decision:auth. With the premise: nothing to apply. Not produced when each thing is rendered once

lens.no-op, from design/laws/boundaries.json, written by lake exe boundaries

An edit that keeps exactly the base's sections, in the same order, applies exactly.

Holds when the base's section ids are distinct.

Round trip: an edit, apply to the state, render, and the same, in normal form.an editthe statean editapplyrender=the same, in normalform

premise holds

edit decision:auth, keep decision:cache

premise removed

edit decision:auth, drop decision:cache

premise the edit keeps exactly the base's sections

  1. premise holds: decision:auth: Passkeys everywhere. · decision:cache: No cache. (the edit, exactly)
  2. premise removed: decision:auth: Passkeys everywhere. · decision:cache: No cache. (not the edit: the dropped section stays) Asked of: edit decision:auth, drop decision:cache. With the premise: decision:auth: Passkeys everywhere. · decision:cache: No cache. (the edit, exactly). A valid input: anyone may delete a section from the text

lens.put-get, from design/laws/boundaries.json, written by lake exe boundaries

Question 8 of 8

Where do the guarantees stop?

3 laws:Limit 3

  1. Deliver the whole set twice and each record is counted again: the count doubles. Any record delivered again is counted again. That is why the read path hands each id over once (input.distinct).

    Limitcount.repeatsEvidenceTry it

  2. For every numeric projection, delivering the list twice doubles the sum. Each readable value is added once per delivery. That is why the read path hands each id over once (input.distinct).

    Limitsum.repeatsEvidence

  3. Max's scalar state cannot maintain the maximum over changing heads. Folds over heads therefore keep LatestBy's state.

    Limitheads.whyEvidence

Try to break it

Each card shows the model's output: a vector it wrote, or a premise case from lake exe boundaries. With scripts on, a button varies what the law lets vary. The trail keeps the model's answer for each variant. A second button removes a law's premise and adds the model's answer. Some inputs cannot come from the protocol. Each case states whether its input can. Without scripts, a card lists every variant and every answer. Nothing is computed in your browser.

Deliver the whole set twice and each record is counted again: the count doubles. Any record delivered again is counted again. That is why the read path hands each id over once (input.distinct).

Limit: Deliver the whole set twice and each record is counted again: the count doubles. Any record delivered again is counted again. That is why the read path hands each id over once (input.distinct). Delivered: A C B A C B; the count doubles: 6; the count: 3.againACBACBmovesthe countdoubles: 6the count: 3who accounts for itThe read path hands each id over once(input.distinct)

each once

A00:01:40
auth
C00:02:30
auth
B00:02:00
cache

delivered again

A00:01:40
auth
C00:02:30
auth
B00:02:00
cache
A00:01:40
again · auth
C00:02:30
again · auth
B00:02:00
again · cache

the count moves

3
6
  1. each once: 3
  2. delivered again: 6

On this vector the count moves, 3 to 6.

count.repeats, from vectors/fold/count/03-repeats-counted.json (current main; may differ from this page's build). The model wrote the displayed vector.

What the laws don't promise

The laws about folds, views and specs are each about a given set of records. None says the set is complete, current, trusted or well dated. These are the edges, and the model's own simplifications, from protocol/laws.md as written.

Absence isn't visible.

A reader that lacks a successor can see its predecessor as current. It cannot count records it does not know exist. The laws promise convergence, not freshness.

Torn reads.

A reader must not see half a changeset. The planned place closes each changeset through atomic rename. Readers ignore a partial last line.

Time is the writer's word.

Content order breaks ties by claimed times, so a skewed clock picks a fork's winner. Every head of a fork is still shown.

Trust is step 3.

Fold laws do not check signatures or standing. They require an admitted record set in which each id names one record.

A checkpoint is a set.

"Since" means segments not yet seen, not an offset, or a late segment is missed.

Simplifications in the model

The model stores each id as a natural number. The digest laws require each id to be less than 2^256. This bound applies to a record's id and each id that it references. The protocol supplies the bound through its 32-byte SHA-256 digests. A number is not a hash of the record's envelope, so nothing in the model keeps a record's prev from naming itself or a record above it. The keyed slice laws that need prev to have no cycle state it as a premise (NoCycle); a real id gives it, since it is a hash of an envelope that holds its prev. The model does not derive fold records from stored records. No theorem connects a fold record's times to the checks on a stored record's envelope.

The model projects a stored opening to all its written top-level fields. Every name, including value and n, is looked up in the same list.

Fold records carry time text and its parsed values (Stamp, Claim). Their other envelope fields are direct inputs, not fields parsed from an envelope.

Text is a list of lines; splitting a file into lines is outside the model.