The adoption step: AD1 to AD4
Put to Kyle in DECISIONS.md on 2026-11-22 and ruled on 2026-11-23, each for its recommendation with additions. The entries are kept here as they were put, with the ruling at the head of each. "Recommended", "today" and "not built" in the text are as written then.
AD3, two details that the import's plan found open, was put on 2026-11-23 and ruled the same day for its recommendation. AD4, found by the first real import, was put and ruled on 2026-11-23; it is the last section.
The ruling is recorded in the changelog under 2026-11-23. The step itself was ruled on 2026-11-21 (W1).
What the entries said of the step. You ruled on 2026-11-21 (W1) that the adoption step's CLI pieces are built beside the tick work. A worker planned them on 2026-11-22. The pieces that are the CLI's alone are being built: loops ls, a scan by the start of a name, a plain-text view with relative times, a --version, and the cache of checked segments (W2). Two pieces need you first. AD1 is one. The other is AD2, the import of your old stores as a shadow.
A trial before the ruling
Between the entries and the ruling, the coordinator imported a copy of four of Kyle's old stores into scratch stores, writing each fact as AD2's recommended column says. The stores are private; only counts are given here.
2,912 facts, every one with a text key, every payload value text. None was refused, and each new store passes
loops check.188 facts had an empty observer. That is addition (a).
One store held 425 facts of four kinds its vertex no longer names: they had been moved to another store. That is addition (d).
For every thing held by one store, 1,881 of them, the new reading equals the old tool's in every field.
For the 226 things held by two stores, the old tool gives one value, the later by time, and the new tool reads two heads. Addition (d) removes 209 of these. The 17 that remain are of a kind both stores name; under row 8 they are two records, counted.
About 2,280 references in two of the stores point into a third. Reading them needs AD1. The old stores did this with a vertex that names the vertex files beside it; that is the layout the optional
stores.jsonis for.
AD1: how a spec finds the stores it names
Ruled by Kyle, 2026-11-23: A and A, with two additions.
A name is bound in the per-user list. A name bound to nothing refuses the whole read with
store-unknown.--store <name>=<dir>on the command binds a name for that run and overrides the lists.An optional
stores.jsonkept with a group of stores binds names for the stores beside it. It is for a hub store with stores around it that refer to each other, kept together in one directory.
Question. A spec's from names a store for each source. Today the name is ignored. When a read may span several stores, how is a name turned into a directory, and what does a read answer when a name leads nowhere?
Example, run on today's binary. Two stores: workshop holds one task and one note, yard holds one task. One spec, morning:
from: store workshop, kind task
store yard, kind note
fold: items = count
| Run in | Today's answer | Why |
|---|---|---|
workshop | 2 | It counts the task and the note it holds. yard is never opened. |
yard | 1 | The same spec, another answer: it counts its own task. |
workshop, with the one store name changed to no-such-store | 2 | A name bound to nothing is answered from the directory all the same. |
What the answer should be is already ruled: a fold across stores takes the union of the named stores first and runs every source over it (the tick record note, section 9, and protocol/spec.md). Here that is 3: both tasks and the note, each record once. What is open is how the names resolve.
Options for finding a store.
| A name means | Cost | |
|---|---|---|
| A (recommended) | An entry in a per-user list of names and directories (~/.config/loops/stores.json). The spec travels between machines unchanged; each machine says where its stores are. | You bind each name once per machine. Your existing specs name stores that are bound nowhere yet. |
| B | A directory beside the current one with that name. | Renaming a directory changes what a spec reads. Stores that live apart cannot be named. |
| C | A path written in the spec. | The path is part of the spec, so its hash, and every tick of it, differs between machines. |
Options for a name that leads nowhere.
| The read answers | ||
|---|---|---|
| A (recommended) | Nothing on standard output, and a refusal that names the store (store-unknown). | A missing store is never mistaken for an empty one. Needs the new refusal code. |
| B | What the stores that were found give, with a note. | The same spec gives another answer on a machine that lacks a store, as it does today. |
What changes for you. Under A and A, a spec that names one store today keeps its answer once that name is bound to its directory, and refuses until then. I would bind the names your existing vertices use before the strict rule is switched on, and list them for you first.
Not asked. loops tick and loops tick --check stay on the one store in the directory. A tick across stores would cover other records and is its own piece.
AD2: how an old store becomes records
Ruled by Kyle, 2026-11-23: the recommended column in all eight rows, with four additions.
(a) An empty observer gets no mention. An old fact whose observer is empty is imported without
observer:…inabout.observer:with nothing after it is not a typed reference.(b) The order of revisions (row 3) is the old store's arrival number where it keeps one, and its row order where it does not.
(c) A fact of a keyed kind that lacks its key field is a root, and is counted.
(d) A kind the vertex does not name is left out by default, and counted. A flag brings such kinds in. This amends row 2 for them. The reason: a store can still hold the facts of kinds that were moved to another store, and importing them would bring a second, stale history of each thing into every read across the two stores.
Question. The shadow import copies an old store into a new one, to be read beside the old tool. Each old fact becomes one signed record. Which record? The answers decide the id of every imported record, so they are yours, and they are cheap to change only before the first real import.
What an old store holds (the shape of yours; the values below are made up). A table of facts, each with an id, a kind, a time, an observer written as text, and a JSON payload. A vertex file says how each kind is read: thread by name, log collected. So three facts:
01ab thread 2026-10-01 09:00 relay {"name":"kiln","status":"open","message":"Repair kiln"}
01ac thread 2026-10-03 16:30 relay {"name":"kiln","status":"done"}
01ad log 2026-10-03 16:31 relay {"message":"fired the kiln"}
The old tool reads thread kiln as status done, message Repair kiln: a later fact of the same name overlays the fields it carries.
Example, run on the binary with the plain view (2026-11-22). The three facts written by hand as the recommended column below would write them (loops emit - --fill, with a key made for the import):
$ loops ls --plain
KIND RECORDS
log 1
thread 2
$ loops ls thread: --fields name,status,message --plain
THING HEAD KINDS RECORDS HEADS name status message
thread:kiln thread 2 1 kiln done Repair kiln
The second record names the first in prev and sets only status, so message still reads from the first. That is the old tool's answer.
The choices.
| Choice | Recommended | The other way | |
|---|---|---|---|
| 1 | What a keyed fact is of. A kind the vertex reads "by" a field. | The thing <kind>:<value of that field>, here thread:kiln. A later fact of the same name is a revision: it names what is live in prev and sets the fields it carries. | Every fact a root of its own. Then nothing overlays, and each read needs a spec that groups by the field. |
| 2 | A kind the vertex collects, or does not name. | A root, as log above. | A thing per kind. |
| 3 | The order of revisions. | The order in which the old store took the facts in (it keeps one). That is what the old tool's reading saw. | The facts' own times. Two facts with one time need a tie-break, and a backfilled fact would land in the past. |
| 4 | The times. | The old time becomes occurred. emitted is the time of the import. A window on env.when then reads the old time. | The old time as emitted: the record would claim to have been written then, by a key that did not exist. |
| 5 | Who signs. | A key made for the import. Every imported record says so in its observer, and can be told from what you write afterwards. | Your own key. Imported and new records look alike. |
| 6 | Where the old observer and the old id are kept. | The old observer as a mention, observer:relay. The old id in a file beside the import, which also makes a second run write nothing. The payload is the old payload, untouched. | The old id as a mention on each record, or both as extra payload fields. Extra fields change what a spec reads. |
| 7 | The old ticks. | Left out and counted. They are the old tool's own, and as kind tick the new check would call each "not a tick". | Imported under another kind, for the record. |
| 8 | A fact held by two old stores. | Imported into each new store it was in, with the same salt and time for the same old id, from the import's file. Where the fact has the same history in both stores, the two copies are then one record, and a read across the stores counts it once. Where the histories differ they are two records; I will count how often that happens in your stores before the import. | Imported once, into one store. |
What I am not sure of, and will check before anything is built: whether your old stores hold kinds the vertex does not name, facts whose key field is missing, and payloads the new writer refuses (a number out of range, a repeated name). The import will count each and stop on the last kind; it will not guess.
Not asked. The import's verb and flags, its batches, and how the copy is compared with the old tool's reading are the implementer's. The old store is never written.
AD3: two details of the import
Ruled by Kyle, 2026-11-23: the recommended column in both rows. A fact of a kind the vertex does not name, brought in with --include-unnamed, is a root. The old time is kept to the microsecond. The build already followed both, so no code changed. Put on 2026-11-23 after the import's plan, and ruled the same day.
Question. A worker planned the import on 2026-11-23, and its plan found two places where AD2 does not say which record is written. Both decide record ids, so they are cheap to change only before the first real import. What should each be?
The build follows the recommended column until you rule otherwise. Nothing real is imported before you do.
| The case | Example | Recommended | The other choice | |
|---|---|---|---|---|
| 1 | A kind the vertex does not name, brought in with the flag. Your addition (d) leaves such facts out unless asked for. When you ask, what is each one? | The workshop's vertex no longer names repair. The old store still holds two repair facts, both with name kiln: status open, then status done. | Two roots, as row 2 of AD2 says for a kind the vertex does not read by a field. Nothing overlays: both facts can be read, and there is no thing repair:kiln. | Keyed by name, as the store's other kinds are: one thing repair:kiln that reads done. In a read across stores this is a second history of the thing beside the store that now holds the kind: the case (d) was added to prevent. |
| 2 | How fine the old time is. The old store keeps a time as a number of seconds with a fraction. It becomes the text of occurred (row 4). | The stored number 1793610000.1234567. A number of this size can only step by about 0.24 millionths of a second. | To the microsecond: 2026-11-02T09:00:00.123457Z. That is as fine as the number is, and it is what the old tool shows. | To the nanosecond: 2026-11-02T09:00:00.123456717Z. The last three digits are an effect of how the number is stored, not a time anyone wrote. |
Row 1, run on today's binary (written by hand both ways, with a scratch key):
as roots keyed by name
$ loops ls --plain $ loops ls repair: --fields name,status --plain
KIND RECORDS THING RECORDS HEADS name status
repair 2 repair:kiln 2 1 kiln done
$ loops ls repair: --plain
(nothing: no thing is named repair:…)
What it costs to change later. Either row changes the id of every record it touches. After a real import, changing one means a fresh shadow store.
Not asked; the plan settled these under your rulings, and they go in the changelog when built.
The import stops and does not guess when a fact it would bring in has a key field that is empty,
nullor not text; a kind that is literallytick; a payload that is not an object; a repeated member name; or a number out of range. It checks the whole of every store first and writes nothing if any such fact is found. None of these occurs in the four stores of the trial.A revision sets every field its payload carries, the key field too. The example in AD2 said the second
kilnrecord "sets onlystatus"; it carriesnameas well and sets both. The reading is the same.A shadow store is the import's alone until you cut over. A later run brings in what the old store has gained since. It refuses a shadow that holds records it did not write, and it refuses an old store whose earlier facts have changed. So during the shadow period you write with the old tool and read with either; when you start writing with the new one, importing into that store ends.
How the old store is read: a small Python script in the repository exports the facts and the vertex's kinds to two text files, and the Rust import reads those. No SQLite library is added to the binary.
AD4: references in the old payloads
Ruled by Kyle (with Neon), 2026-11-23: rows 1 to 3 as recommended; row 4 the other way, a clean payload; and one rule for old ids. The full ruling is in the changelog under 2026-11-23. "Today" and "recommended" in the text are as written then.
Question. The first real import, of the six homelab stores on 2026-11-23, reads as the old tool does in every field but one. But the old stores refer from one fact to another in two ways that the import, which keeps every payload untouched as AD2 says, carries only as text. Should those references also become mentions (about)?
The two forms, counted in the six stores (11,072 facts).
A field
ref: a comma-separated list, such asref=thread:firing,decision/glaze. The old tool takes it out of the payload and gathers its parts across all of a thing's revisions. 894 facts carry it, with 933 references: 921 writtenkind:keyorkind/key(906 of them name a thing the stores hold), and 12 old fact ids. 53 things read fewer references in the shadow than the old tool shows, because only the latestrefis read.A field
<name>_ref: written by the old tool when an emit saysowner=person/potter; it keepsowner: person/potterand addsowner_refholding the old id of potter's fact. 8,363 facts carry such fields, with 14,685 old ids. Every one names a fact of a keyed thing the stores hold; 28 name a fact in another of the six stores. The old tool reads these as plain fields too, so both readings show the same text, but in the shadow an old id names nothing: the only map from old ids to records is the import's private journal.
Example, run on both tools today. An invented old store, written with the old tool: a person potter, then a task kiln twice, first status=open owner=person/potter ref=thread:firing, then status=done ref=decision/glaze.
$ sl read workshop.vertex --json --all (the old tool; the task's row, shortened)
payload {"name": "kiln", "status": "done", "owner": "person/potter", "owner_ref": "01M858Z8H3HM…"}
refs ["decision/glaze", "thread:firing"]
$ loops of task:kiln --plain (exported and imported with today's tools)
owner person/potter
owner_ref 01M858Z8H3HM…
ref decision/glaze
status done
about observer:clerk
$ loops fold mentions.json --plain (records that mention thread:firing)
records 0
| The case | Recommended | The other choice | |
|---|---|---|---|
| 1 | A reference in ref, kind:key or kind/key. | It also becomes a mention, kind:key, on its record. A spec with "about": "thread:firing" then finds every record that referred to the thread, which the old tool counted as the thread's inbound references. | Payload only, as imported today. Finding what refers to the thread needs a test on the whole text of ref, which cannot pick one reference out of several. |
| 2 | An old id in a <name>_ref field, or in ref. | It becomes a mention of the thing that fact belongs to, through the journal: owner_ref naming potter's fact gives person:potter. Every one of the 14,697 names a keyed thing. | Payload only. The id names nothing in the new store. |
| 3 | What a revision mentions. The old tool gathers ref across revisions and keeps the latest value of each <name>_ref field. | Each record mentions what its thing refers to after it, read as the old tool would: every ref so far, and the current value of each <name>_ref field, but only its own observer. Then loops of task:kiln shows decision:glaze observer:clerk person:potter thread:firing. Written by hand that way today, both records count as mentioning the thread. It is also what loops emit does for a revision: run without --about, it copies the head's mentions. | Each record mentions only the references its own fact wrote. The thing shows the latest fact's; all of them are a read over its records. |
| 4 | The payload. | Untouched, as AD2 ruled: ref, owner and owner_ref stay as written. The mentions are added beside them. | Take ref out once its references are mentions, as the old tool did, and rewrite old ids to record ids. The payload is then no longer the old payload. |
What it costs to change later. Rows 1 to 3 change the bytes and id of almost every record: 8,400 facts or more carry a reference. The six shadows written today follow the other column. Importing them again into fresh shadows takes about 3 seconds; nothing reads them yet.
Not asked. The comparison tool learns to compare the old tool's refs with a thing's mentions once this is ruled. A reference whose kind no vertex declares (4 of them) is still a valid mention and is treated as row 1 says. Facts without their key field (37 here) are roots under AD2 (c); the old tool does not show them, and the comparison counts them apart.