The atom format

The atom format

Everything in strands/ is plain markdown. Git is the source of truth; the CLI is one consumer of it. If the tool ever dies, the material is still readable and greppable.

A file

---
strand: countries
group: Europe / Nordic
tags: europe, nordic
---

Free prose before the first `###` is commentary and is ignored by the parser.
Use it to explain why a file is grouped the way it is.

### dk.capital
kind: capital
subject: Denmark
answer: Copenhagen
peg: A COPPER HEN roosting on a Danish pastry — copper-hen, Copenhagen.
peg_source: suggested

Referring to another peg

An image built on a number peg writes {{89}}, not the word. The peg table fills it in when the corpus is loaded.

peg: Four o'clock. 89 = f-p = {{89}}. A {{89:lower}} cloud hanging across
     the Bastille gate — the crowd walks straight through it.

{{89}} gives the word as stored (VAPE) and {{89:lower}} gives it lower case, because most images read "a vape cloud" rather than "a VAPE cloud".

This is not decoration. Before it, every image that used a peg carried its own copy of that peg's word — a second source of truth, and it drifted: eight pegs were quoting words the table had not said for months, and nothing noticed. lint now rejects a peg that writes a table word out in full.

What a reference cannot do is rewrite the prose around it. Change 89 from VAPE to FOB and "a fob cloud" is grammatical nonsense — but it is visible nonsense, and akasha peg prints every peg that builds on the one you changed so you know which images to look at.

Keys

keymeaning
kindone of the keys in TEMPLATES — see the table below
subjectwhat the atom is about — supplies {subject} to templates, and is the default answer for reverse cards
answerrequired
askoverrides the kind's question template; required for fact, contrast and causal
reverseoverrides the reverse template; reverse: none suppresses the reverse card
reverse_answeroverrides subject as the reverse card's answer
pegthe mnemonic image; {{89}} references the peg table
peg_sourcesuggested (written for you), own (yours), none (no image)
spana period, for era atoms — generates its own ~s card
cuea one-line description that identifies the subject without naming it — generates a ~c recognition card
date_ask / span_askoverride the generated date / span question
tagscomma-separated
noteshown during review, never tested
sourceprovenance, if worth recording

Atoms versus cards

An atom is a fact. A card is a directional recall test, and scheduling state is keyed per card, because knowing "capital of Denmark → Copenhagen" does not mean you know "Copenhagen → which country". Those decay separately and so they are scheduled separately.

cards_for() expands one atom into up to five cards, one per direction:

suffixdirectiongenerated when
(none)forwardalways
~rreversethe kind has a reverse template, unless reverse: none
~ddatethe atom has a date
~sspanthe atom has a span
~ccuethe atom has a cue

So dk.capital and dk.capital~r for a country, and E01, E01~r, E01~s and E01~c for an era. Each card tests exactly one thing. A compound question — the era card used to ask for the name, the span and the organising condition at once — cannot be caught decaying in one part, and in that case did not even answer one of the three.

Question templates

The files hold facts; the wording of questions lives in one place, TEMPLATES in akasha/parse.py:

kindforwardreverse
capitalWhat is the capital of {subject}?{answer} is the capital of which country?
flagDescribe the flag of {subject}.Which country flies this flag: {answer}
locationWhere is {subject}? Region, neighbours, coastline.—
population / areaRoughly what is the … of {subject}?—
eraEra {era}: what is it called, and what holds it together as one era?Which era is {subject}? Give its number.
event{subject} — which era and slot, and what does it change?Era {era}, slot {slot} — what sits there?
deep{subject} — how long ago, and what did it make possible?—
invention{subject} — what did it make possible, and which era?—
person{subject} — what did they change, and when?Who is this: {answer}
majorMajor System: what is the peg for {subject}?Major System: which number is {answer}?
fact / contrast / causal / tour / ringexplicit ask: required—

Rewording every capital question is therefore a one-line change, not a 147-file sweep.

Adding a kind

Add an entry to TEMPLATES. Use (None, None) if the kind always needs an explicit ask:. lint will then accept it.

Ids

Convention, not enforcement:

Ids are the scheduling key. Renaming an id orphans its review history — akasha prune will show you the orphan; there is deliberately no rename command, because silently moving a decade of review history is worse than making you think about it.