Expand description
doctor-json: the eighteen checks behind the opencode-ctl-doctor skill (spec Skills).
The doctor COMPUTES the checks in a fixed order (ctl_home_override, binary, registration,
server_info, then the rest in id order) and EMITS them in id order. registration is read
before anything can start the service, so an ok_started cannot rewrite the file it reports on.
server_info is the ONE place that starts a stopped service, explicitly; every other check
leaves the service alone: wait_route never fetches the OpenAPI document itself (it reads the
table server.info already cached) and registration never calls server.info.
Every pair decision keys on the FILE NAMEβs id (pair.<id>.json), never on the id inside the
record: records_by_name enumerates the files itself and overwrites the recordβs inner id.
StructsΒ§
- Check
- Doctor
Ctx - Server
State π - Source
File - The two lines of
opencode-pair.exe.source:path=<staged path>andversion=<plugin semver>(spec install-launcher; split on the first=, any parse failure counts as absent).
EnumsΒ§
ConstantsΒ§
- BINARY_
NAMES π - CHECK_
IDS - The check ids, in emit order.
- MESSAGES π
- Every message the doctor can print, keyed by
(id, status, variant);<...>placeholders are filled bymessage. A check with several texts per status has one variant tag per text. - PROTECTED π
- The protected keys (spec Settings), in the order the doctor lists them.
- SIDES π
FunctionsΒ§
- binary_
check π - ctl_
home_ πoverride - default_
config_ file - The service configβs default location:
$OPENCODE_CONFIG_DIR/service.json(packages/util/src/global.ts:79), else$XDG_CONFIG_HOME/opencode/, else~/.config/opencode/. - default_
registration_ file - The registration fileβs default location:
$XDG_STATE_HOME/opencode/service.json, else~/.local/state/opencode/service.json(packages/util/src/global.ts:79 roots). - doctor_
json - The doctor report:
{"checks":[...], "notes":[...], "settings"?}. - env_
vs_ πuser_ file - first_
line π - hex π
- launcher_
link_ πcheck - launcher_
link_ status - POSIX: the
opencode-pairsymlinkβs target; Windows: the copy and its.sourcefile. - link_
name π - lock_
source_ πcheck - log_
check π - message π
- mtime_
ms π - name_
status π - Which kind of binary a staged or linked file name belongs to, relative to
host. - note_
json π - opencode_
password_ πset - orphaned_
controllers π - orphaned_
workers π - pairing_
check π - parse_
source_ file - reason_
words π - registration_
check π - resolved_
settings π - same_
path π - server_
info_ πcheck - server_
url_ πpassword - settings_
file_ πhash - settings_
notes π - side_
words π - source_
name π - stem_of π
- A file name with the
.exesuffix dropped, from either kind of separator. - version_
range_ πcheck - wait_
route_ πcheck - windows_
link_ status - The Windows rule on already-read inputs (pure, so it is tested on every platform):
Stalewhen the.sourcepath=differs from the running exe OR itsversion=differs fromversion. - windows_
source_ old_ check windows_source_oldon a given platform flag (so the Windows rule is tested everywhere): the copyβs.sourcefile must parse, and no.oldleftover may remain.