Artifact c8f3a9e0436718edf72869d9bf738b9e43a88b8ac47cc4ce0adc7d46df292317:
- File docs/manual/doctor.md — part of check-in [9e408ec0ef] at 2026-11-24 12:43:12 on branch pic-folder — Self-ignoring .pic, 0600 journal files, dotfiles warning (user: dmestas, size: 2165) [annotate] [blame] [check-ins using] [more...]
Updating a journal: pic doctor
Each workspace keeps its conversations in a journal, .pic/journal.sqlite. A newer pic sometimes
changes how the journal is laid out, and updates it the first time it opens it. It can only do that
while no other pic has the journal open, so an older pic still running in the workspace, a
pic remote started before you installed the newer pic, or a terminal pic left open, is in the
way.
Most of the time nothing needs doing. pic remote and a terminal pic's follower of a conversation
let go of the journal when a newer pic asks, and the update goes ahead. When something else keeps
it, the error names each process: its pid, what it is and since when, and the command that ends
it.
pic doctor fixes it in one step. Run in the workspace, it:
- says the journal is up to date when it is, and changes nothing;
- updates a journal an older pic last used, first letting the pics that step aside do so, then stopping the older pics that keep it open (a polite signal, then a forceful one after five seconds), and says which it stopped;
- finds older pics that do not say they hold the journal, with
lsofwhere the system has it, and stops them too when they are pics; anything else holding the file is named and left alone; - warns when a fossil or zit checkout with
dotfileson would list.pic/as files to add, and gives the line that ignores it (the.picfolder); - reports a journal written by a newer pic than this one, which it cannot read: update pic.
It never stops itself or the process that started it. pic doctor --json prints one line,
{"type":"doctor","ok":BOOL,"state":STATE,"message":TEXT}, with STATE one of none, current,
updated, newer, blocked and damaged.
From a phone, a workspace an older pic last used shows "it was last used with an older pic" with
Fix it, which runs pic doctor for that workspace on the computer; see
remote control.
If pic remote was one of the processes stopped, it starts again by itself when it was installed
to start at login (pic remote install); otherwise turn it on again with /rc or pic remote.