Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Commands

The frontend calls these over POST /api/<cmd> (JSON args, camelCase). Each is a function in crates/fm-app/src/commands.rs (except the git/restic ones — commit, push, pull, backup, backup_status, set_git_remote — which are the OS seam, not Store operations, so fm-core is called directly; the vault-registry and .view arms likewise live in crates/fm-app/src/vaults.rs and crates/fm-app/src/views.rs). Args map to Rust snake_case.

Every one of them is reached through fm_app::dispatch, the single command surface. fm-serve is an HTTP shell over it — it parses a request into (cmd, args, body), calls dispatch, and frames the answer. Adding a frontend means writing a new shell, not a second copy of the table below.

All 172 of them are below, grouped by what they are for. If you add an arm to dispatch_inner, add its row here — ci/checks.sh counts the two and fails when they disagree, because a reference that is nearly complete is one a reader stops trusting. (That sentence was itself untrue until 2026-09-05: the check tested membership only, never counted, and this line said 81 while there were 85. It now checks the count and both directions, so a documented command dispatch no longer has fails too.)

Reading the vault

CommandArgsReturnsNotes
boardgroupByBoard (columns)group by any property
agenda—ObjectMeta[]dated & not done, soonest first
remindersfrom (YYYY-MM-DD), days? (default 14, at most 60)Reminder[]read-only: the moments at which an unfinished note is due to be said — per note and per date (start, due) its at (YYYY-MM-DDTHH:MM, the note’s time or 09:00 of its day, less its remind minutes), what, when (the note’s own time where the reminder is earlier) and all_day. remind: off leaves a note out. Nothing is stored: the page asks again and hands the list to whatever shows it
recent—ObjectMeta[]all notes, newest-created first
gallery—ObjectMeta[]assets, newest first. No renderer draws it — the Gallery view was removed and a .view asking for gallery is listed as broken and says what to change it to; the command stays because fm-cli and the asset pickers use it
searchqueryObjectMeta[]FTS5; empty query → []
getidNoteDetail | nullmeta + full body
backlinksidObjectMeta[]every note whose body carries a note: link to this one
highlightsnear, limitHighlight[]every ==highlight== in the notes, those in near first; for the editor’s ((
reviewstodayObjectMeta[]notes whose review day is today or earlier, longest-waiting first (at most 50)
highlight_pdfreference, text{note, title, page, line, made}a PDF’s words as a line with their page in the PDF’s note (made if none points at the PDF); from formicaria’s browser
highlight_pageurl, text, before{note, title}a web page’s words marked in the note keeping that page; note: null when none holds them
highlight_undonote, text, line{ok}a browser highlight taken back: the last highlight reading text unmarked, or the line line removed
templates—ObjectMeta[]the notes tagged as templates, for the new-note picker
stalesinceObjectMeta[]notes untouched in git since since (a --since value, default 90 days ago), oldest first. Derived from git, stored nowhere; a vault with no history is skipped, not reported as wholly stale
activitysinceEditEvent[]who last edited what, straight from git log. since defaults to 1 year ago
duplicates (also documented with prune_duplicates under Vaults)—DuplicateFamily[]notes grouped by identical body, and what pruning them would remove. A read: it changes nothing
config—Configversion, the vault list’s path and whether it is writable, what is installed, and which FM_* variables are set — facts about the machine, not about any vault. It carried a copy of the vault list and a second list of restic repos until 2026-09-08; both came from list_vaults’ producer, so this answered nothing it was the source of. Now takes no lock and spawns no git. The one call a support question can start from
pingsince{changed, git, clock}the 15 s visible-tab reindex poll; carries the app’s clock, so a change of zone reaches every page within one beat
clock—Clockthe app’s clock (2026-10-24): the zone every view shows and counts days in — v, zone (or null when it cannot be read), iana, offset, offset_seconds, now (UTC), today, source (automatic/chosen), chosen, system, instants. What the UI and the assistant read; fields are only ever added
set_clockzone (a name, an offset, or "" for Automatic)Clockchoose this device’s zone (config_dir()/formicaria/clock.json); refused to a paired device
privacy—Privacythis device’s privacy switches (2026-11-17, config_dir()/formicaria/privacy.json): search, trackers, ads, cookies, clean_links, gpc, https_only, app_trackers, sites_off, fired, v, and the engines to choose from
set_privacyany of those switches; site_off/site_on (a site); fire: truePrivacychange them (only what is given, each checked); refused to a paired device
diary_status—{on, bytes, days, since, dir, keep_days}this device’s usage diary (2026-11-20, fm_app::diary, config_dir()/formicaria/diary/): on or off, how much is kept; refused to a paired device
diary_setonthe samethe switch: off writes nothing more
diary_forget—the sameDelete it: every line, and the browser’s own output
diary_noteevents: [{kind, …}]{}what a page, the browser’s kit or the add-on tells the diary, held to diary::from_pages’s kinds (page, error, browser, act) and fields; anything else dropped

Writing notes

CommandArgsReturnsNotes
capturebody, vaultObjectMetacreates a note
set_propertyid, key, value{ previous }writes one frontmatter field (see the table below), and answers the value it replaced (null if none), in the form it reads back — what undo sets again
set_propertiesid, props{ previous }several fields of one note in one write; an empty value removes a field. previous maps each key to the value it had (null if none). Nothing is written unless every key is accepted
create_notesnotes, vaultObjectMeta[]several notes in one call, each made whole: { title, body, tags, start, props }. Every note is checked before any is written. A number in props must be whole. The only way to set log
update_bodyid, body, basethe new versionbyte-for-byte body write; base is the version you last saw — a mismatch is refused (see below). '' opts out
deleteidDeletedNoteunlinks the file and both index rows, and answers the note’s file and notebook so the UI’s undo can put it back
discard_if_blankid{ discarded }deletes the note only if it holds nothing — no text, title or property; the editor asks it on leaving a note
restore_notevault, fileObjectMetaput a deleted note back from its file; refused if a note with that id exists again
put_back_tutorialsvault?ObjectMeta[]Help → Put the tutorials back: write again each shipped tutorial missing from the notebook; one that is there, changed or not, is left
deleted_notesdays (default 30)DeletedRow[]read-only: notes deleted in the last days, read from each notebook’s own history (git, or libgit2 on the phone), skipping ones that exist again
restore_deletedvault, id, daysObjectMetabring back a note listed by deleted_notes, exactly as it was before it was deleted
create_paperinput, vaultObjectMetaa note from a pasted BibTeX entry, DOI, arXiv id, URL or bare title — parsed locally, never looked up online
clip_saveurl, title, body, tags, props, bibtex, snapshot, vaultObjectMetakeeps a page from formicaria’s browser: the note the add-on built, and the page’s copy as an asset linked at its end; with bibtex, the note is made as create_paper makes one. Fetches nothing; only http(s) pages. Stamps the source contract (source: web, source_id, captured, recorded: copied) where the add-on did not
page_notesurl[{id, title, context}]the notes that name a page, matched by its address with the scheme, www., fragment, tracking parameters and trailing slash ignored; context is the line that names it. Read-only; the browser’s toolbar count
kinds—[{key, label, mark, views, sources, place, out}]the library’s kinds of notes (fm_app::kinds): each kind’s views, sources, default place and hand-offs; every listed note carries its kind_key. Read-only
sections—[{key, label, icon, mark, purpose, order, page, types, views, new}]the library’s sections (fm_app::sections, from the shipped .kind files): what a person navigates, each a rule over notes, its views (builtin, view, special or renderer) and what + makes. Read-only
note_historyid, limit? (50)[{commit, author, time}]the commits that changed the note’s file, newest first, from its vault’s git (⋯ → History). Read-only; empty without git
note_versionid, commit{text, body}the note’s file as that commit left it, and its body (null when it did not exist there). Read-only
note_fileid{text, title}the note’s file as the store writes it (⋯ → Export → Markdown). Read-only
taggedtag, limit? (50)[ObjectMeta]the notes carrying a tag, newest first (the Home note is tagged home). Read-only
section_noteskey, limit? (500, at most 5000)[ObjectMeta]a section’s notes, newest first: what its list, table and gallery views draw. Read-only
section_summaryhidden? (vault names), days? (35, at most 400)[{key, count, latest, recent}]per section (leaving out the vaults in hidden, the rail’s vault chooser), how many notes it holds, its newest (ObjectMeta or null), and when each note of the last days days was made, newest first (Home’s figures and heatmaps), from one read of the store. Read-only
journalon_or_before (YYYY-MM-DD), limit? (14)[ObjectMeta]the journal: notes tagged journal titled with a day, newest day first, from that day back. Read-only
actions—[{key, label, takes, makes, runs, agent}]what formicaria can do, declared once (fm_app::actions): each action, where it runs (server, hand-off, open), and the assistant’s permission (off for each). Read-only
putto: {note, at?} | {new: {title, shelf?}}, md, base?{id, version?} (a new note: its metadata)the one way content moves into a note (fm_app::actions::put): at its end or the end of a heading’s section (at: "after:<heading>"), whether or not it is open; base guards the version read. Or a new note on a shelf
recipe_from_pageurl (query); body = the pageWebRecipereads a recipe out of a page the browser already has — recipe_from_link’s reader with no fetch
paper_bibtexidStringthat note’s frontmatter rendered back as a BibTeX entry

Discussions

CommandArgsReturnsNotes
replyid, body, authorName, authorEmailObjectMetapost a discussion message on a note (or another message — it re-roots to the same thread). One file, ULID-named, in the target’s vault. No vault arg: a reply joins the audience of the note it is about
threadidThreadViewa note’s discussion — {root, count, messages[]}, each message with a server-computed depth. root: null when the note itself was deleted (the discussion survives it)
thread_roots—ThreadRoot[]every note that has a discussion, with its message count — what puts the badge on a card
create_discussiontitle, vaultObjectMetacreate a first-class discussion — a note that is the root of its own thread (thread_of points at itself). A dedicated command because set_property refuses thread_of
discussions—DiscussionSummary[]every first-class discussion across vaults, most-recently-active first: {…root, count, last_activity, participants}. Participants come from git authorship. Comment threads on an ordinary note are not here — they stay with their note

Proposals

A proposal is a note carrying proposes: branch:<name>; the change itself lives on that git branch. Nothing here writes to main.

CommandArgsReturnsNotes
proposals—ObjectMeta[]every open proposal across vaults, newest first. A store query like recent, not a git read — it lists proposal notes; branch state is derived elsewhere
create_proposalid, body, why, kind, tool, query, authorName, authorEmail, propsObjectMetawrite the draft to a review branch and the proposal note beside it. props (start/due/location/addTags) sets the note’s details too; on a revision it goes over the details the proposal already carries, key by key. kind/tool/query record how it was produced — a model’s /propose, /research or /transcribe, and what it searched for
proposal_foridObjectMeta | nullthe open proposal against this note, if there is one
proposal_diffida unified diffwhat accepting would change, read off the branch
proposal_contentid{body, …} or nullthe proposed body itself, for the side-by-side review, with the start/due/location it sets and the note’s current ones (wasStart/wasDue/wasLocation). null when the id does not resolve
proposal_shownid—records that a human actually looked at it. Idempotent, fire-and-forget: it must never fail the screen it is reporting about, and it is what separates left alone from never displayed
accept_proposalid{outcome}merge the proposal’s branch and close it — not a body copy. outcome is merged, conflicted or already_gone; a proposal its author declined is refused
reject_proposalid, why—close it with a reason. The outgoing commit is kept, so the accepted/rejected label stays true later

Assets and media

CommandArgsReturnsNotes
ingest(binary body) ?name=, vaultObjectMetaupload → asset note; raw bytes, held whole in memory
ingest_chunk(binary body) session, seq, vault{session, received}one slice of a chunked upload, appended to <vault>/.fm-ingest/<session>/part. seq is checked: a lost or repeated chunk is refused where it happens, because the alternative assembles a file that hashes fine and is quietly wrong
ingest_finishsession, name, vaultObjectMetaingest the assembled file through BlobStore::put_file (which streams in 64 KB reads) and write the same asset note ingest writes. The content address is identical either way — chunks are transport, and the hash is taken once over the whole file
ingest_cancelsession, vault—abandon an upload and reclaim its bytes now. Not needed for correctness — abandoned sessions are swept at boot, by age — but a cancel that leaves a gigabyte on a phone until tomorrow is not a cancel
resolve_assetreference, kindbytes (ArrayBuffer)kind = full | thumb; whole blob in memory — prefer GET /api/blob/<ref>, which streams and honours Range
asset_statusreference{has_blob,has_thumb,mime}sniffed MIME
open_externalreference—opens the blob in the OS default app

Recording and syncing (git)

CommandArgsReturnsNotes
commitmessage, vault{committed, conflicts}git-commit the vault. committed: false with conflicts non-empty is not “nothing to do” — the vault is mid-merge and nothing will be committed until those notes are settled
pushmessage, vaultu32squash the unpushed window → push; returns commits squashed (0 on the first push)
pullvault{merged, conflicts}fetch + merge through the .md driver; conflicts is a result, not an error
set_git_remotevault, url, name, email—sets the vault’s origin, and its git identity when name/email are non-empty (asked only of a vault git has never met); blank URL refused
set_identityvault, name, email—the git identity alone, for a vault that already has a remote
set_git_assets_maxvault, maxVaultInfo[]the size ceiling on attachments a push may carry. Above it, media stays local and only the notes travel
music_notes—AudioNote[]notes holding sound files (songs excepted): {id, title, vault, tracks:[{reference, title, song}]}; a file counts as sound by its first bytes, and song is the song with the same file, if any
songs_from_notenotestring[]a note’s sound files as songs, made once (the same file, the note named in the song’s text, its title as album): the songs’ ids in the note’s order
storage_unusedvaultStorageReportattachments no note uses: {nothing, attachment_only, held} — nothing points at the first; only their own attachment entry at the second; held is what was put aside (30 days). A note in the Deleted list (30 days) still counts as using its files
storage_removevault, hashes{files, bytes}puts those aside, if still unused: held in .fm-held/ for 30 days, their attachment entries to the Deleted list. Not from a paired device
storage_restorevault, hashes{files}puts held files back where they were. Not from a paired device
set_git_mediavault, sound, videoVaultInfo[]whether sound and video travel too, under that ceiling (vault.json’s git_sound, git_video; off by default). Told apart by a file’s first bytes
unrecorded—Unrecorded[]per vault, the notes on disk that git does not have — split by kind, with a bounded sample. The count alone was not a diagnosis: 146 could mean 146 notes existing nowhere else, or 146 something was needlessly rewriting
record_unrecordedvault{recorded}commit exactly those
duplicates / prune_duplicatesvault (prune only)DuplicateFamily[] / {pruned}prune refuses while any copy is still unrecorded, and always keeps the oldest of each family. Deleting an untracked note is unrecoverable; a tracked one is a git checkout away, so the order is forced rather than warned about

Conflicts and unreadable notes

CommandArgsReturnsNotes
conflicts—ConflictInfo[]conflicts with their kind, because “open it and keep the text you want” is true of exactly one kind. Git is authoritative; notes whose text still carries markers are unioned in
resolve_conflictvault, path, keep{resolved}keep = theirs | mine | edited. edited means “I reconciled both in the editor” and is refused while markers remain
read_skipped / resolve_skippedvault, name, text (resolve only)the raw text / {parses}the in-app raw editor for a note that will not parse. Works on any device, unlike open_skipped
open_skippedvault, name—hands the same file to the OS editor. Desktop only, by nature
kept_notes / kept_seen—KeptNote[] / {seen}notes a merge brought back after the other device deleted them while this one was editing — read out of the merge commits that recorded it, so the answer outlives the sync run, a restart, and a fresh clone. id/title are null for a kept path that is not a note (a saved view, manifest.json): reported honestly, and given no button, because “delete it again” is delete and that is a note command. Two terminators, neither needing state: deleting the note again drops the row everywhere, and kept_seen moves a per-device watermark — the device that kept a note and the device that deleted it are not asking the same question, so acknowledging on one must not answer for the other
demoted—DemotedField[]fields two devices set differently, where the merge kept both: what the note shows now and what the other device said. A read, and stateless — the loser is a conflict-<field> key in the note’s own frontmatter, so this is correct after a restart and readable in any text editor

Vaults

CommandArgsReturnsNotes
list_vaults—VaultInfo[][] is the first-run signal. The one producer of what a vault is: name, path, default, label, identity, attachment limit, supervision and restic repo — every cheap local fact, so no other arm has to re-derive one. Scoped — the one place the scope is visible to a user, because listing a vault the caller cannot read would leak its name
check_path / create_vaultname, pathPathCheck / VaultInfo[]the surface owns the verdict, not the form
clone_vaulturl, name, path, gitName, gitEmailVaultInfo[]clone a collaborator’s vault and register it
forget_vaultnameVaultInfo[]removes it from the list. The files are left alone — forgetting is not deleting
check_move_vaultvault, pathMoveCheckwhether the vault’s folder can move there, and how much would move. Asked per keystroke; changes nothing. Host-only
move_vaultvault, pathMovedmoves the vault’s folder, keeping its name, its place in the list and its settings: one rename on the same disk, a copy verified byte for byte across disks. A failure leaves it where it was. Host-only
recoverable_vaults—Recoverable[]vault folders on this device that are not in the list, with a note count — the way back from a forget_vault nobody meant. Empty without a managed vault root, and empty for a scoped caller
restore_vaultname, path, repoVaultInfo[]rebuild a vault from a restic repository
copy_note / copy_status / uncopy_noteid, vault; with_assets (copy) ; blobs (uncopy)CopyResult / CopyStatus / CopyResultcross-vault copy, its pre-check, and its undo. with_assets opts in to carrying the note’s first-degree blobs; blobs names the ones an undo may take back
set_supervisionvault, collect, publishVaultInfo[]the two supervision-corpus consents, always written together — an absent key and a deliberate no must not look the same to whoever answers for it later

Import

CommandArgsReturnsNotes
check_importsource, path, vault, nameImportCheckwhat is there and what would happen — attachments by kind, whether they will be linked or copied, and which vaults already hold this folder. Asked on every keystroke while someone types a folder, so it is a pure read
run_importsource, path, vault, name, stubs, replace, maxMb, skipKindsImportResultconvert a Logseq or Obsidian folder into notes. replace rewrites an earlier import’s notes except those edited or deleted since; maxMb/skipKinds leave attachments out (each still named in its note)
fit_previewpath, vaultFitReportwhat a folder of watch files (.fit, or one file) would become in the training log: the activities and sets that are new, files imported before, the same file with other contents (reported, never overwritten), near-duplicates (proposed, never merged), damaged files (refused and named) and files that are not activities. Reads the folder and the vault; writes nothing. Host-only
import_fitpath, vaultFitReportthe same, written: one log: workout entry per activity, one set note per strength set the watch counted, each file kept as a blob its entry names (source_fit), all in one commit. A second run of the same folder writes nothing and makes no commit. The folder is only read. Host-only
import_fit_filesfiles ([{session, name}]), vaultFitReportthe phone’s route for watch files: each file shared to formicaria or found in the one folder the person granted is first sent as a chunked upload (ingest_chunk), then this imports them all exactly as import_fit does — the same notes, keys, refusals and one commit — and writes no attachment note (it never goes through ingest). Each upload is discarded afterwards. Not host-only: it reads only the vault’s own uploads
workout_fitidWorkoutFile (name, data base64, steps, open, notes)a planned training session as a FIT workout file for a watch: its steps from the body’s - Warm-up: … lines (time, distance, repetitions, weight; heart rate in bpm and pace as absolute targets, never a percentage), a repeat for 4 x …; a line with no number is an open step carrying its words. Refuses an entry that is not a planned session. Writes nothing
calendar_syncvault, source; body = iCalendar text (times are put on the app’s clock; a sent offset is ignored since 2026-10-24)CalendarReportyour own calendar into a vault: new meetings become notes, a newer SEQUENCE moves one, a cancellation tags it. No model, no network — fm-serve reads the private address and hands the bytes in
mail_syncvault; body = JSON array of Gmail messages (format=full) (times are put on the app’s clock since 2026-10-24)MailReportGmail into a vault: one note per conversation (subject, last sender, when — never the text), and every invite read exactly as calendar_sync reads a calendar. No model, no network — fm-serve reads Gmail with a gmail.readonly token and hands the messages in
mail_conversations—MailConversationsread-only: every email conversation (id, title, when its latest message arrived, its current start), the starts already on the agenda, and the meeting notes linked to each conversation — what the assistant’s meeting pass reads
propose_noteabout, title, body, start, due, location, tags, author + supervision fieldsObjectMetapropose a new note linked to about (meeting_of): it exists only on its proposal/<id> branch until accepted. The assistant uses it for a further meeting fixed in an email exchange

Backup

CommandArgsReturnsNotes
backup_status—BackupStatus{vaults, git, restic, restic_password_set}; each vault carries {name, remote, unpushed, remote_moved, conflicts, restic_ready} — only what this command alone can answer, all of it paid for with a per-vault network ls-remote. identity, git_assets_max and restic_repo are local reads and live on VaultInfo; they were reported here as well until 2026-09-08, so two screens could disagree about one field. The password only ever as a bool, never by value
asset_batchesvault, budgetAssetBatch[]how a backlog of attachments would be sent, in steps. A device that has never sent attachments stages every one it holds the first time it can — the rule is a filter over the blob store, not a diff against the remote — so the first backup can be one pack a phone connection cannot finish. Each step is a rising size limit, so a step re-stages what is already sent (a no-op) and adds only what its raise newly admits. Local and read-only: a walk and a stat per file, no network and no repository access
last_commits—LastCommit[]when each vault last saved anything, as epoch seconds — null for a vault that has never been committed, which is a state and not a zero. Its own answer rather than a field on backup_status for the same reason backup_latest is: one git log -1 per vault, local and offline, so a phone can be told at first paint that nothing has been saved in five weeks. Scoped like list_vaults — how stale a vault is is itself a disclosure. No threshold: when silence is worth mentioning is a display policy
backup_latestvaultLatestBackupwhen this vault was last snapshotted. Deliberately not a field on backup_status, which polls every 45 s and already spawns a process per vault. Three distinct answers: a snapshot (id + time + the source paths it recorded), id: null with no unavailable — the repository opened and has never been written to — and unavailable with a reason, meaning this machine cannot tell you. An unreadable repository is reported, not raised
backupvaultBackupRunrestic snapshot of the vault’s notes directory and blobs/ — never the vault root, so no .git, views/, themes/ or vault.json; repo per vault, password from RESTIC_PASSWORD or the stored one. Answers what the snapshot held: {vault, notes_dir, blobs, contents}, where notes_dir is the directory it actually took (docs for a vault that moved it) and blobs says whether there were any — a vault with no attachments yet must not be described as carrying them. contents is restic’s own summary ({id, files_new, files_changed, files_unmodified, bytes_processed, bytes_added}) and is null when restic wrote the snapshot without describing it, which is not the same as a snapshot that held nothing
set_restic_repovault, repoBackupStatuspoint one vault’s snapshot (notes + attachments) at a repository; empty repo clears it
set_restic_password / clear_restic_passwordpassword / —BackupStatusthe one password every restic repo here uses; written 0600 beside the vault list, never into it

Credentials

CommandArgsReturnsNotes
probe_remoteurlRemoteProbecan this URL be reached, and does it need credentials
git_authurl{stored, …}whether a credential for that host is already held
set_git_credential / clear_git_credentialurl, username, token / url{…}delegated to the OS credential helper wherever git exists; stored by the app only on a device that has none — which is the phone

Views and themes

Both are files in the vault (views/*.view, themes/*.css), so both travel to collaborators over git. The view-authoring buttons were withdrawn from the UI on 2026-08-31; these commands stayed, and so did their tests. See Views.

CommandArgsReturnsNotes
list_views / run_viewname (run only)ViewInfo[] / ViewResultsaved .view files; no Query crosses the wire. A file with a mistake is still listed, with its parse error. The views that come with the app are listed after a vault’s own, marked shipped
log_daysview, from, to, rows{ days }a span of days of one log, asked for by the name of a totals view. Each day: sums ({ sum, n } per metric, n being how many entries carried it), of (entries that day), targets, times (occasions, first, last — for entries that carry a time), a low and high beside a sum when an amount was a range, and its entries when rows. With a food view, references: for each value it shows as a detail, the nutrients sheet’s reference for the person and its limit, for what to fill towards when no target was set
health_trackers—Tracker[]what the person tracks in the Health diary: every key on their Health templates (tag: template, group: Health) whose ending says its kind — _0to3, _0to10, _0to100, _yes, _count/_doses, a unit (_min, _ml, _mg, _g, _mmhg, _pct, _c), _score. Each: key, label, kind (and unit)
health_daysfrom, to, weeks{ template, trackers, days, counts, weeks }the Health diary over a span of at most 400 days; template is the Health template new trackers are written into (the oldest), or null. Each day: values by tracker key (a key absent was not recorded), the day note’s id, and late when it was written more than a day after. counts per tracker: of, recorded, days (at or above 1), moderate_or_severe (at or above 2, severities only), odd (values not counted). With weeks, per tracker its ISO weeks (from Monday): of, recorded, days, sum — a mean is sum / recorded
health_guidanceday{ nhs_credit, cards, followed }the Health group’s cards (shipped/health-cards.json), each in its sources’ own words, and the ones followed on day — a program: health note naming the card in plan, with what the person chose in p_<choice> — each check counted: value, the days it was counted over (of, recorded, from, to), the body’s number (min, max or at_or_over), within, and unchosen when it reads keys not yet chosen
health_record—{ items, templates }the health record: templates names the record kinds that already have a template; items is every note (not a template) with a record kind (medicine, allergy, condition, result, visit, immunization, procedure, device, contact, none_known), in that order. Each: id, kind, title, status (record_status), start, due, about (for none known) and its other properties as written in fields, a result’s lab range among them
log_recentview, slot, q, limitRecentItem[]what a log holds already, one line per distinct thing, most used in slot first, each with the values it had the last time
music_library—ObjectMeta[]every song (log: music), sorted by title, in one pass: the Songs screen filters it as the person types
music_playlists—Playlist[]every note tagged playlist, by title, with its songs’ note ids in the body’s order (repeats kept)
video_library—ObjectMeta[]every video (log: video, 2026-11-17), sorted by title
video_collections—Playlist[]every note tagged collection, by title, with its videos’ note ids in the body’s order
log_recipesviewRecipe[]the recipes saved in a log, by name. Each: servings, its ingredient entries, of (how many), and sums — every whole-number value the ingredients carry, added up, with how many of them carried it. Nothing is adjusted for cooking
log_nutrientsview, dayNutrientsevery vitamin and mineral of one day: per value its sum, how many entries carried it, the reference for an adult of the person’s sex and age where there is one figure (EFSA 2017), an upper level where it applies to food, and the day’s entries. needs_sex when figures were left out for want of it. drinks: water (beside EFSA’s total water), caffeine (beside its 400 mg) and alcohol (alone), the same way. on_day: the keys Day shows now, the person’s pins or the view’s own; most_on_day; profile, the note that keeps the pins (day_values)
exercise_library—{ seen, sources, exercises, videos, videos_seen }how each exercise is done, as its source wrote it: per card its steps, and about, start, dose, notes where the source has them, its page and reference, and where the app files it (equipment, area). sources carry each body’s credit line and licence. videos are links, each a known body’s (tier: body) or a trainer’s (tier: trainer)
recipe_librarybook?{ key, label, source, home, seen, recipes }one collection carried in the app, by its key (none: the first), as published: each recipe with its ingredients and steps word for word and its page; NHLBI’s carry their publisher’s values per_serving, Italian Wikibooks’ (wikibooks, CC BY-SA 4.0) carry text, notes, yield/servings, region, times, image as a link, authors_url — and no values
recipe_libraries—the same, one per collectionevery collection carried in the app, in the order offered; each names itself (key starts a logged serving’s source, <key>/<id>; label labels its rows)
log_kitchen—{ id, title }[]what the person says they have at home: notes carrying kitchen, by name. No amounts
log_products—Product[]the packaged foods a person wrote down from their labels: notes carrying product, each with its per100 values (the keys every food uses), and barcode and serving_g when given. In no log and no day. unit is ml for a food measured in millilitres and each for one counted in pieces, with piece saying what one is (tablet, capsule); its per100 is then per 100 pieces
log_routinesviewRoutine[]the sessions kept under a name in a log: each with the weekdays it is meant for (mon … sun) and its sets — entries that name the routine instead of a day, so they are in no day until planned onto one
plan_librarygroup{ plans, activities, weeks, hidden }the diets (food) or regimes (fitness) that can be followed, as carried in the app: each with what it rests on, its sources, its checks, what cannot be measured, and links to how it is done. activities (fitness only) are activities a named body counts, with what each counts as; weeks (fitness only) are example weeks a public body lays out day by day; each card also says its kind, the question it answers, whether to start_here, how it relates to the others, and its notes per flag. Cards whose not_for matches the profile’s flags are left out and named in hidden
plan_profile—Profilea person’s own measurements — sex, born, height_cm, weight_g, pal_x10, and the opt-in flags (pregnant, breastfeeding, postmenopausal, kidney, diabetes_meds, eating_disorder) — from the note carrying a profile property, or all empty
plan_previewid, dayPreviewone option with its numbers worked out for this person: the bounds per check, the energy estimate when it uses one, and which measurements are still missing. Writes nothing
plan_progressgroup, dayProgressthe plans in force on day — one per question, in followed; the first also as plan, checks and the other top-level fields — and the week holding it (Monday to Sunday) measured against each: per check its bounds, the value so far, met / under / over / none, each day’s value, and a four-week trend. A check the profile now hides is not measured. Empty when nothing is followed
plan_watchgroup, dayWatchthe “worth watching” set of the group, measured on the week holding day whichever plan is followed or none: per line its bounds for this person, the value, the state, the days and a four-week trend. A line the profile hides is left out. Writes nothing
coachday, from, toCoachAnswerFitness → Coach: the Coach plans in force on day (program: coach notes, the latest first, each with its library plan, week, goal and event_date) and the Coach’s own calendar from from to to (at most 62 days): per day the training log’s entries (planned, done, skipped), the Menu’s planned meals and the meetings the calendar sync wrote. The Agenda and the board are untouched. Writes nothing
coach_progressday, weeksWeekProgress[]each of weeks weeks (1–26, default 8) up to the one holding day: per sport, sessions planned, done and skipped, minutes planned (kept in planned_minutes once done) and done, and distance done. A day’s sets are one strength session. Measured facts only: no load, zone or line across sports. Writes nothing
match_plannedday (optional)Matchesimported watch sessions (source_key fit:…) with no plan link, each with the planned entries on its day that count as the same: exactly one is a proposal; several (or none, when day is given) are listed. A planned entry two imports could both be is proposed for neither. Writes nothing
accept_matchplanned, importedFoldedthe person accepted a proposal: the planned entry keeps what was planned as planned_*, takes the session’s done values, stops being planned, and the imported note is folded into it (its source_key, source_fit, file and body tables kept) and removed — one note per session, recorded as one step. Answers what changed, so it can be taken back
food_searchq, limitFoodHit[]foods in the food list whose name has a word beginning with each word typed, the plain food first: the word whole before a word it begins, the food before a dish named after it, the food as it comes (raw, plain, a table’s average) before what was done to it. The list is carried in the app and unpacked on first use
food_getidFoodDetail or nullone food: every value per 100 g, its household portions — or, where it has none, the same food’s from another table, named with it (1 portion · CREA (Italy)) — and the list it came from. id may be an entry’s source
pack_status—PackStatusthe food list this app carries: what it says about itself and what it takes on this device, or why it could not be put in place
save_viewvault, name, view, group_by, tagViewInfo[]writes the file. A view filtered by hand keeps its filter — saving over it is refused rather than quietly dropping what a screen cannot describe
rename_viewvault, from, toViewInfo[]moves the file and leaves its contents alone — which is why it is a rename and not “save under the new name, delete the old”
delete_viewvault, nameViewInfo[]removes only the view; the notes it was showing are untouched
list_themes / read_themevault, name (read only)ThemeInfo[] / the CSSreading a theme changes nothing
save_theme / rename_theme / delete_themevault, name/from,to, cssThemeInfo[]deliberately not read-only: the generation bump is what makes the other pane, and the other machine, notice a theme edit without a timer

Property values (set_property)

set_property’s value is parsed per key:

keyvalue formatempty value
typeasset → asset; anything else → note (Kind::from_str is lenient, so legacy task/meeting frontmatter migrates silently)→ note
statusany stringclears
titleany stringclears
startYYYY-MM-DD or YYYY-MM-DDTHH:MMclears
dueYYYY-MM-DD or YYYY-MM-DDTHH:MMclears
logrefused — what kind of logged entry a note is, is set when create_notes makes itrefused
hardtrue/yes/1 → true, else false→ false
tagscomma-separated; a tag may contain spacesclears
(other)free text → a custom frontmatter propertyremoves it

The lost-update guard (update_body’s base)

An editor that has been open a while may be holding a version of the note that no longer exists — most obviously when a pull merged someone else’s edit into it. Saving then would overwrite their text and leave a history saying you wrote it.

FileStore::put already refuses a write whose file moved on disk since we indexed it, but that check cannot see this case: pull merges and then reindexes (a merge is invisible until it does), which records the post-merge mtime and stands the guard down exactly when it mattered. The staleness is in the client, so the client declares what it edited: send the version you last saw (it comes back on get) as base, and hold the one update_body returns for your next write.

A mismatch returns this note changed on disk since you opened it — reload before saving. The UI reloads and puts your unsaved draft back below the merged text with conflict markers — the same stance as the .md merge driver: both versions where a human can see them, never a silent choice.

The token is the sha256 of the body, not the updated stamp. A stamp only moves for writers that bump it — the app does and the merge driver does, but hand-editing in Vim does not — so a stamp left exactly the case put’s mtime guard could not cover. Content cannot lie about whether the body moved. It costs ~1.6 ms on the largest body there is (a whiteboard scene), against a save debounce that then writes and fsyncs that same body.

Asset references

An asset is referenced as asset:sha256-<hex> (canonical, in Markdown) or sha256:<hex>. resolve_asset/asset_status accept either, plus a bare hash.

Routes that are not commands

A command answers with a value. These cannot, so they live in the transport instead — putting them in dispatch would push an HTTP concern into the shared surface.

POST /api/alive

Liveness, and only liveness: the UI beats it every 15 s so the auto-shutdown watchdog knows a tab is open. It takes no lock, reads no files, and never reaches dispatch. It is separate from ping because a hidden tab must keep the app alive without making it reindex a vault nobody is looking at — and because the watchdog belongs to this server, so a frontend without one would never call it.

POST /api/remind_set and POST /api/rest_end

The desktop program’s side of reminders. remind_set takes { items: [{ title, text, at }] } (at in milliseconds), the list the page worked out from reminders; the program keeps it in <config>/formicaria/reminders.json and says each through the system’s notification when its moment comes and no page is open. While one is still waiting, the program rests instead of stopping when its last page closes: it answers 503 to the assistant, which then stops its model. rest_end is how a newer copy asks a resting one to make way; a program somebody is using answers 409. Both are host-only, and neither is a command: they are about this process.

POST /api/browser_status, browser_setup, browser_set, browser_open

formicaria’s own browser on a computer (Linux for now): its state, setting it up (Firefox ESR downloaded from Mozilla, checked against Mozilla’s signature and the pinned SHA-512, made formicaria’s by the kit, into <config>/formicaria/browser/), the person’s two choices (open_in_it, block_ads), and opening formicaria in it. Host-only, like the updater’s routes: they are about this computer, not a vault.

The browser’s add-on reaches eight routes and no others — clip_save, recipe_from_page, list_vaults, for a download kept in formicaria ingest, create_notes and music_library, and the read-only page_notes and search (the toolbar’s count and fm in the address bar) — and only from a moz-extension:// origin carrying this computer’s key (X-Formicaria-Key, kept 0600 in that folder). Any other extension is refused by the same cross-origin guard that refuses a web page. Once it has, and until the program stops, the app’s pages may be framed by that add-on and nothing else (frame-ancestors moz-extension://<its id>, otherwise 'none'): its sidebar and new-tab page.

GET /api/blob/<reference>

Blob bytes, streamed from disk with the sniffed Content-Type, Accept-Ranges: bytes and honest Range support (206 with Content-Range, 416 when unsatisfiable). This is what <img>/<video>/<iframe> point at, so opening a note with a large attachment costs no memory and seeking a video costs one range request instead of a whole-file download.

It is a route rather than a command because a command answers with a Vec<u8> — the shape that forces the whole file into memory in the first place.

Two response headers are load-bearing, not decoration. X-Content-Type-Options: nosniff stops the browser second-guessing the sniffed type. And anything outside an inline-safe allowlist (image/* except SVG, video/*, audio/*, application/pdf) is sent Content-Disposition: attachment: blobs arrive from collaborators, and a blob is now at a URL the browser can navigate to, so an SVG or HTML attachment rendered as a top-level document would run its script in the app’s own origin. Subresource loads ignore the disposition, so inline SVG images still render.