Step 4: the cut, design note
Moved here from ROADMAP.md on 2026-11-21, unchanged but for links. Every section is ruled (2026-11-20). What is ruled and not yet built is listed in the roadmap.
Draft by margins-claude, 2026-11-15, for Kyle's rulings before any code. Nothing here is built. Section 8 was added the same day, after the lens experiment.
Every choice that is Kyle's is marked Open, with a recommendation and the alternatives, or Ruled with the date.
Kyle ruled on 2026-11-20 on every section, each time for the recommendation. None is open.
The coordinator asked the questions; the experiment and the proofs are in the margins repo: sl-py/cut.py (seed cut-1, 200 stores for each configuration) and lean/Convex.lean, section Cut.
The stores are two or three keyed things written by three replicas that sync, with pure joins, whole-read emits, erasures and now and then a prev that crosses things.
Each replica's clock is off by up to a stated number of minutes, and an emit comes every one to six minutes.
The problem. A tick is a fold at a cut, and step 4's exit is a content tick that recomputes to the same hash on two machines.
The fold laws say the set decides. None says which sets are worth folding, and D8c made that matter: a part of a keyed thing can read a record as live that the whole has replaced.
emitted is the writer's claim, so a record can name in prev a record with a later emitted, and then the records emitted by some time hold a record without what it was written on.
Terms. A part is some of what a store holds. A part is closed downward when it holds every held record that one of its members names in prev.
The prefix at T is the records emitted before T. Down is the prefix and everything it reaches through prev: the least part closed downward that holds the prefix. Held back is the records of the prefix whose whole ancestry is in it: the greatest such part inside the prefix.
1. A cut is a part closed downward
Proved (
down_reads): a part closed downward reads a record as live for a key exactly when no setter of the key in the part is above it in the whole. That is what a holder of exactly those records reads, with nothing missing between them. It is a state the store could have been in.Proved (
down_closed,cut_slice_reads): under the writer's rule with the envelope as a key, a part closed downward holds what the writers of its records held, sokeyed.anchoredapplies to it: its live records, read alone, read as it does.keyed.sliceandkeyed.spec-slicethen apply as to any holding.The law is over the rule, not over
Anchored.Anchoredsays every record names every record under it that is live now. A holding can be anchored now and have a past that is not (cut.py, by hand: four records).Anchoringis the premise that carries to a cut, so the law to state is "Anchoring, and a part closed downward, giveClosedOver", besideanchored_of_written.Admission agrees. A part closed downward holds the target a record is refused for, so it refuses what the whole refuses (down and held back, with anchored writers: 0 of 28,414 cuts; a bare prefix admitted such a record in 3 of 3,504 cuts at an hour's skew).
A slice holds the present. A holder of live records alone cannot answer for a past: what was live then is not in what is live now. A cut needs the history up to it.
Ruled, 2026-11-20: a cut is a part closed downward over
prev, or a slice of one as the slice laws define it. The alternative was to let a tick fold any set and say nothing of what it reads. Kyle: this fits "reality happened", and a fold of any set would still need a bound in time, with nothing gained.Built, 2026-11-20: the law over the model (
keyed.cut, inmodel/Laws/LiveSlice.lean, margins-claude).Down S Wis a part ofWthat holds every record ofWits records name.down_readsis the reading above, over the model's liveness.closedOver_of_down: withAnchoringover a closed holding with no cycle, a part closed downward is closed, because a writer names every record it holds that is live there and every other record it holds is under one of those.anchored_of_downthen gives the part anchored names, soanchored_sliceapplies to it.KeyedPart.of_down: such a part holds what its records name, so with the forms and erasers of the records of a thing it holds it is aKeyedPart, and the slice laws ask nothing more about admission. The port needed no premise the note does not state.downand held back are under 2.
2. "As of emitted"
With anchored writers and wall clocks:
| clocks off by up to | cuts | prefix not closed downward | prefix reads a record live under a setter it holds | down or held back does |
|---|---|---|---|---|
| 0 min | 3,702 | 0 | 0 | 0 |
| 2 min | 3,521 | 0 | 0 | 0 |
| 10 min | 3,562 | 15 | 3 | 0 |
| 60 min | 3,504 | 480 | 96 | 0 |
Proved (
prefix_down,mono_of_prefixes): every prefix is closed downward exactly when no record names a record with a lateremitted.Where the prefix is not closed downward, down and held back each give other answers than it (480 and 478 of the 480 cuts), and they are two different parts. Down includes records emitted after T that a record of the prefix builds on. Held back leaves out records emitted before T that build on a later one.
Held back is the prefix of another clock (
heldOf_prefix): a record's ownemittedor the latest in its ancestry, whichever is later. That is what a writer rule "never emit earlier than what you name" would have written. With that rule in the writers, every prefix was closed downward (0 of 14,125).The cut is about claims either way. With clocks two minutes off, no prefix was open, and 1,011 of 3,521 cuts still were not the keyed state the writers together had at that minute. No choice here makes
emittedthe time.Ruled, 2026-11-20: as of T is down. It trusts the claims it is asked about: a record emitted before T was written on what it names, so that was there too, whatever its own clock said. It changes no record, no writer and no refusal. Its heads are all records of the prefix.
Built, 2026-11-20: the laws over the model (
cut.prefix, inmodel/Laws/Cut.lean, margins-claude).upTo W Tis the prefix, overemittedas the model compares it.prefix_down_iff: every prefix is closed downward exactly when no record names a record with a lateremitted.downOf W PisPwith every held record under it, closed downward and the least such part that holdsP(downOf_down,downOf_least).heldOf W Pis the records ofPwith every held record under them inP, closed downward and the greatest such part insideP(heldOf_down,heldOf_greatest).heldOf_prefix: a record is held back at T exactly when it and everything held under it were emitted before T. These are sets of records with no fold behind them: nothing in the model computes "as of" yet.prefix_reads_wronglyis the witness: 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, where down holds all three. The alternatives were:Held back in the reader: also closed downward, and a backdated record gains nothing by it. One record with a clock far ahead hides everything built on it from every earlier cut.
A writer rule on
emitted: binds honest writers only, and makesemittedsomething other than the observer's now. A record with a clock far ahead pulls theemittedof everything built on it forward for good.An admission rule (refuse a record that names a later-emitted one): binds readers, drops an honest record for another writer's clock, and is a new refusal, so a slice must carry the targets of what it refuses, as
keyed.spec-slicelearned forprev-unrelated.The bare prefix, with the artefact stated: 96 of 3,504 cuts at an hour's skew read a state no holder could have read, and 13 held a thing that was not anchored.
The bound should read as
belowdoes, as a window's end is. The experiment took T itself in, which changes nothing here.2026-11-22: the model's
upTotook T itself in too. It is strict now, sodownOf W (upTo W T)is whatloops tick --as-ofbuilds, at the boundary as well. The laws are unchanged but for the bound; the witness moved from one second to two.
3. emitted against holding, and what a content tick folds
They are two questions. With true clocks, what a replica held at a minute and the
emittedprefix of what it holds now were different sets in 5,539 of 12,892 (replica, minute) pairs, every one by late arrivals, and gave another keyed state in 5,514. With clocks ten minutes off it was 7,360 of 12,747, and 2,263 of those held a record claimed after the minute.Holding is not a fold's parameter. Nothing in a record says when it arrived, and a place keeps its segments as a set, not in an order (place). So "what did this store hold at T" has an answer only where a witness tick was taken at T. Its
coversis the answer.What was held need not be closed downward. When a sync appends in the order written, every prefix of a place's own order was (0 of 6,563). In any order, 1,208 of 6,683 were not. A slice is not closed downward on purpose. A witness tick records what was held and claims no more, as the design says.
Ruled, 2026-11-20: a content tick folds a set named outright. Its
coversis a cut or a slice of one, chosen by the records: the closure of what a record cites, what a marker record names, a window (5), or "as ofemitted" by the rule of 2. A cut that a record names needs no clock at all: it is down of the ids named. Thenemittedis one way to choosecoversand never a parameter of a fold.So no fold changes. "Folds take as of for both times" (horizons) costs one function on the held set, applied before settling, and the
whereof 5. Every slot, the keyed ones included, runs as built over the cut.
4. An erasure after the cut
The built rule covers it. Settling inside the cut reads a form held without its payload, and with no eraser in the set, as withheld. Envelope folds count it and payload folds leave it unread. Nothing new is needed.
Equal openings give equal results, by
settle.set: a holder that lost a payload to a later eraser and one that never received it hold the same form. Of 396 cuts with a covered record erased after the cut, a holder that settles everything it holds and then cuts differed in 331 from one that cuts and then settles, and only in the word:erasedwhere the other sayswithheld. Cutting first agrees with Kyle's ruling of 2026-11-10 that withheld is in the end the same state as erased.coversnames ids, not openings. A holder before the erasure and one after it computed different results for the samecoversin 342 of the 396 cuts. Withshownleft out of the result it was 299, and never in a slot that lists ids (latest-by with no payload test, collect); only where a value reads a payload (a payload test, a sum,byon a payload field).The design expects the first kind to survive: "a result made of references still can be [recomputed]" (resolution), "erasing the note in the team store changed nothing in any tick" (example), and the five states of a reference in the context walk are the reader's, not the tick's. As built, every listed id carries
shown, so every listing result changes on erasure.Ruled, 2026-11-20: the canonical result (D7) lists ids without
shown; a reading says what its reader holds. And the input key names which covered ids were folded open, so one key never names two results. The alternative keptshownin the hashed result; then no result with a list in it outlives an erasure of a listed record, and the two design sentences above would need changing.
5. The second time
The
occurredcut acts after the heads, theemittedcut before settling. A window is a test on the current records, which is what awhereonenv.occurredalready is. "What did we believe in 2019 about 2009" is the cut of 2 at 2019 and then thatwhere.A window taken first is wrong. Folding "the records whose occurred starts in the span" gave another answer than the
wherein 601 of 660 (store, window) pairs, and in 428 showed as current a record that a revision had moved out of the window. Withspec.slice's additions (erasers, targets, successors, their targets) every slot that reads records as written or by heads agreed, and the keyed slots differed in 383. With every record of the things touched, none differed.So the "By window" row in resolution names what the window selects. Its
coversis the slice of that, asspec.sliceandkeyed.spec-slicegive it. A late record still ticks again, and so does a revision that moves a covered thing out.Ruled, 2026-11-20: how a window is spelled. An
env.occurredtest passes neither bound on a record withoutoccurred, and record says a window places such a record at itsemitted. A window is awhereon the span content order already uses, under its own field name; the alternative madewindowa second mechanism besidewhere. The field's name is not chosen. Not built.Ruled, 2026-11-20:
occurredon a keyed thing. The envelope is read from the heads, andloops emitcopiesaboutfrom them but notoccurred. So settingstatuson a thing that occurred in 2009 moves it to the minute of the update, out of every window on 2009.loops emitis to copyoccurredasaboutis copied, when the heads agree, with a flag to state another or none. Kyle: an emit in 2019 over an ADR of 2009 is a new occurrence when its writer states one; when it states none, the earlieroccurredcarries, because nothing about it changed. The alternative said a record'soccurredis that record's alone, and a writer restates it. Not built.
6. D7 and the shapes that exist
Every result in vectors/spec/run is made of these: an object with fixed member names; a map by thing, group key or payload key; a list of {"id", "shown"}; an integer; and null.
An integer sits in three places:
value,unreadandungrouped.valueisnullfor a min or max that read nothing. No position holds an integer and also text.No result holds a payload value, a fraction, or a boolean. A group key is already text ("1" for the number and the text).
So decimal integer strings under JCS cover keyed state (
keys,whole,heads), groups withungroupedandunread, and every other shape, and position alone tells an integer from text: no tag is needed. JCS's member order is the ordergroupsandkeysare already written in. A list's order is part of the result.Outside: the CLI's
--valuesview puts payloads in the answer. If it ever becomes protocol, a position would hold text or a number, and then the codec needs a tag and the number rule of layer 0.Ruled, 2026-11-20: no tag. If "typed" in the ruling means a tag on each integer, none is needed yet, and the codec carries none. By 4,
shownis not in the bytes.The hashed result is a vertex's whole result, every slot. A per-slot hash is finer and nothing asks for it.
7. Unanchored records
emit - fills nothing in (ruled 2026-11-13), so a collector writing through it leaves unanchored records, and the horizons want collectors in any language.
With writers that name only what they build on, the live records of a thing read otherwise alone than with the rest in 1,602 of 3,701 cuts, with true clocks. With anchored writers, down and held back: 0 of 28,414 cuts.
So a tick over such a thing cannot take its live records for
covers. It needs every record between them (keyed.convex), which grows with the history. That is the cost of the ruling once ticks exist, and it is paid for each thing a collector writes.Ruled, 2026-11-20: keep
emit -as ruled, and give the changeset path a way to ask for the filler (loops_place::fillalready holds it), so a collector that wants compact ticks states one option. The alternatives were: nothing, and such things are covered whole; oremit -fills by default, which unrules 2026-11-13. Built on 2026-11-21 asloops emit - --fill.
8. An emit against a base
loops emit names every live record of the thing that the store holds now (place, choice 11).
The slice laws ask less and something else: that an emit name what is live in what its writer saw (Anchoring's saw).
For one person in one store the two are the same.
They part when a holder writes on a read older than its holding: a lens applying an edit against the tick its file names, an agent acting on a context it was given by tick id, and once stores share, anyone whose store took in a peer's record between their read and their emit.
What the default does today: loops emit task --of task:1 status=done, run after a sync, replaces a status that a peer set and the writer has not read, and nothing shows that it did.
Measured in margins (sl-py/lenskeys.py, seed lenskeys-1, 300 stores; notes/2026-11-15-lenskeys.md).
A replica reads a keyed thing from a base (what it held at some earlier minute, a part closed downward), changes some keys, and writes one emit that sets them into what it holds now.
6,450 emits set 10,127 keys; 3,047 of the emits were against a base the holding had passed.
This is the coordinator's second suggestion, the lens laws, and it needs no lens: it is a replica that syncs and then sets a key without reading. A lens adds the render and the parse.
prev names | the base's live records | what is live now (as built) | the base's heads |
|---|---|---|---|
| keys that read back as set, alone | 7,152 | 10,127 | 7,152 |
| ... having replaced a setter the base did not hold | 0 | 2,975 | 0 |
| keys in conflict with setters the base did not hold | 2,975 | 0 | 2,975 |
| keys that read any other way | 0 | 0 | 0 |
| emits after which an untouched key changed | 0 | 0 | 0 |
| emits after which the live records alone read otherwise | 0 | 0 | 1,835 |
| emits leaving two heads | 3,047 | 0 | 3,047 |
Against the base, the lens laws hold. A key reads back as set, or as a conflict between the emit and setters the base did not hold: "a stale base makes a visible fork instead of overwriting" (horizons). So put-get has a premise, that no record outside the base sets the key. The cases expected to bite did not: two live setters at the read, an erased or withheld live setter, a pure-join head, a key unset.
As built, the fork is not made. The same 2,975 keys replaced a setter the writer never read.
--prevdoes not help: it is kept beside what is filled in."Facet records, prev = heads" is not enough. With the base's heads alone a reader of everything gets the same answers, and the live records alone read otherwise after 1,835 emits. The walk should say the base's live records of the thing. By 3 that is the base tick's
coversfor the thing, so a tick lists what an emit against it must name.No new law. An emit that names the base's live records follows the writer's rule with
sawread as the base, and a base closed downward is a world (1). Liveness only shrinks as a holding grows, so what is live now under the emit was live in the base and is named.Stated and proved all the same on 2026-11-22, as
keyed.base(anchored_emit_down), with the witness for a base that is not closed downward (base_closed_needed): there a record outside the base, still live and under the emit, goes unnamed.
Such an emit forks the envelope. Every one of the 3,047 left two heads, 613 of them with no key in conflict. The walk's two edits of different facets from one tick ("the store has no fork") leave no key forked and two heads; a slot that follows
prevshows a fork until an emit names both.A render keeps five states apart: a value, empty (a live setter declares the key and holds nothing for it), a conflict, unknown (the one live setter is erased or withheld), and no section. Unknown shown as empty hides "clear it" from the diff. And 1,130 of 5,616 conflicts had sides showing the same value: a lens that prints one value there can never settle it, since retyping the value is no edit, while a sum reads the key as unread.
The bases here are old by construction (any earlier minute against the last), so the counts say how the cases split and not how often they come up.
Ruled, 2026-11-20: the filler takes a base. Wherever the filler runs (
loops emit, and the changeset path if 7 is taken), a writer may state a base, a tick or ids, and the filler names that base's live records of the thing and copiesaboutfrom its heads. With no base stated it does what it does now, and that is said plainly: an emit with no base claims its writer read everything the store holds. The alternatives were: the single-record path stays as built and anything that writes from a base usesemit -and works out the base's live records itself, in whatever language it is written; or the filler always wants a base, and a person at the CLI has none to give. Built on 2026-11-22 as--base <tick>and--base-id <id>onloops emit,loops emit - --fillandloops tick. What the filler does with a base that does not hold what is under it is TK11, ruled on 2026-11-22 for option C: the base is taken together with what is under it, and the writer is told.Left for step 3. Kyle asked on 2026-11-20 whether a base is a property of a strict store, so that an emit behind what the store holds would warn, fail, or be let through as the conflict, and then left it for later. What margins-claude answered, for when it comes up:
The base is the write's. A store is a union and has read nothing; the base reaches it only as
prev. What a place can have is a policy for a write whose base is behind what it holds.The policy needs this ruling first. As built, an overwrite of a setter the writer never saw is the same bytes as an informed one.
From
prevalone a store can tell that an emit is stale (a head it holds is not at or under the emit'sprev) and that it conflicts (a live setter it holds of a key the emit sets is not under it). 613 of the 3,047 stale emits conflicted on no key, so the policy should be about the conflict."Fail" can only be the local write path declining to write, checked before the record is made. As an admission rule it would depend on the order of arrival, and two copies of one union would differ. So a strict place writes no conflict knowingly, and the union of two strict places can still hold one.
A base taken from the last read needs a read that writes and a reader the place can tell from another. Until then
loops emitcould print the setters it is about to replace.
Not here
under. A record under a grant with a lateremittedraises the same question for standing (step 3): does a cut hold the grant.The slice of a cut across things. A cut closed downward is a holding like any other, so
spec.sliceandkeyed.spec-slicesay what itscoversis. The sweeps were not rerun over cuts.Boundaries and markers, the runner, and what verifying a deep tick tree costs.
The lens at the text level (the conflict block, normal form), several lens files in one transaction, and a base that is not closed downward.