Artifact 0f3b6627f606d6f7a3710ba5bea6c67cea214997077b57fe0100d15f54634e27:
- File docs/manual/doctor.md — part of check-in [3d1eba80bc] at 2026-11-25 12:42:13 on branch remote-list — Phone lists only person-driven sessions; remote updates old journals (user: dmestas, size: 2188) [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; - reports, for each of git, zit and fossil that the project uses, whether
.pic/is covered by that version control's ignore file, and the line to add when it is not (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.
pic remote updates a workspace an older pic last used by itself, without stopping anything: it
waits for an older pic that has it open to close; 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.