All posts

8 min readPost 31

Making obit doctor readable at a glance: a 1-day self-burying report, and three cross-platform boundaries

obit doctor used to dump 50+ lines of raw check output and obit init --show flooded 433 to 553 lines across 30 agents, hiding the single broken setting users needed to fix. Across 24–25 November we compressed CLI diagnostics into an instant summary backed by a 1-day self-burying local HTML report, merged our resident JSON obit list across all three OSes, and drew three honest cross-platform boundaries.

On this page
  1. Verdict first, details in a 1-day self-burying local HTML report
  2. Resident JSON obit list lands on main across all three OSes
  3. Three OS boundaries we refused to fake across platforms

When something looks wrong with Obituary's background daemon or an agent hook, the first command anyone runs is obit doctor. Yet after integrating 30 AI coding agents, three-platform supervision, context menus, and Docker checks, the tool meant to clarify problems had turned into a wall of noise:

A default obit doctor run dumped 50+ lines of mixed PASS, INFO, and WARN lines, while obit init --show flooded terminals with 433 to 553 lines of capability matrices. The one broken setting and its remedy sat buried beneath hundreds of healthy rows.

At the same time, we were landing our resident JSON obit list fast path and macOS/Linux desktop integration on main. Across 24–25 November, all of that work shared one principle: cut terminal noise without losing detail, and be honest about OS boundaries instead of faking identical behavior across Windows, macOS, and Linux.

Infographic showing obit doctor compressed from 50+ lines to a 1-line verdict, 8 area rows, and a 1-day self-burying HTML report alongside obit init --show cut from 433/553 lines to 19, plus cross-platform resident JSON obit list p95 bars well under 250 ms
Two deliveries from 24–25 November: dramatic terminal output compression above, and verified three-platform resident JSON obit list p95 latencies below.

Verdict first, details in a 1-day self-burying local HTML report ​

obit doctor now groups every check into 8 clean areas (installation, background runner, agents, right-click menu, data, hooks, folder policies, and Docker):

  • Line 1 states the verdict: everything is healthy, or exactly how many problems were found.
  • Each area takes one line showing its worst status.
  • Only areas needing attention expand with two indented lines: the first clause of the reason (truncated cleanly to 100 terminal columns using CJK-aware uniseg.StringWidth) plus a copyable fix command (such as obit daemon enable or obit init --context-menu --yes).

Full details still exist—rendered into a zero-JavaScript, zero-external-request, inline-CSS self-contained HTML report saved under <data-dir>/reports/doctor-YYYYMMDD-HHMMSS.html using O_CREATE|O_EXCL so even same-second runs never overwrite each other. Run obit doctor --open to inspect it in your browser, or obit doctor --verbose for the full plain-text dump without writing a file; --json and exit codes stay untouched.

obit init --show got the same haircut: uninstalled agents collapse onto a single summary line, moving per-agent matrices behind --agent <name> or --verbose and cutting default output from 433 / 553 lines down to 19 lines.

Real self-contained HTML diagnostic report generated by obit doctor in an isolated demo directory: verdict pill and metadata at top, eight collapsible check areas with highlighted fix commands, and footer noting automatic burial after 1 day
The real zero-JavaScript HTML report written by obit doctor in an isolated sample directory: expanding a failing area reveals copyable fix commands, and the footer records its 1-day automatic burial.

Eating our own cooking—with a surgical Guard exemption ​

Because every obit doctor invocation generates a fresh HTML report, leaving reports around indefinitely would recreate the exact clutter Obituary was built to prevent. So Obituary tracks its own reports just like any other scratch file—originally with a 7-day lifespan, then tightened the same day to 1 day (app.ReportLifespan = 24 * time.Hour) since fresh reports can always be regenerated on demand.

That ran straight into one of our own safety invariants: Obituary's data directory (OBIT_HOME) is protected against registration and burial so nobody can accidentally bury the ledger itself. Rather than weakening protection on the whole data directory, we added three tight constraints:

  • A narrow Exempt list in core/guard allows registration, burial, and resurrection only inside <data-dir>/reports, leaving the ledger and graveyard strictly protected.
  • Read-only runs never materialize a missing data directory: if OBIT_HOME does not exist yet, saveReport returns missingDataDirectory instead of creating one just to store a report.
  • Fail closed with self-cleanup: if the ledger cannot register the report's lifespan, Obituary immediately removes the newly written HTML file (and removes reports/ if this run created it) so an unexpiring orphan file is never left behind.

Resident JSON obit list lands on main across all three OSes ​

On 25 November we officially retired the SQLite migration branch and merged our v18 JSON resident single-writer and obit list fast path into main (d408865).

Cross-platform CI verified the exact same 1,000-active + 1,000-real-shape-grave benchmark (42 waves per level, confirming all 84 two-hook and 168 four-hook writes registered exactly once):

Platform & environmentSolo p952 hooks p954 hooks p9516-hook peak ref
Linux x86_64 (GitHub Actions)25.6 ms24.2 ms24.1 ms—
macOS arm64 (GitHub Actions)52.9 ms49.7 ms54.2 ms—
Windows 11 (idle dev host)84.2 ms86.1 ms80.1 ms139.0 ms

Every platform landed far below the 250 ms bar with zero schema migration, zero new dependencies, and byte-identical local fallback whenever the resident daemon is not running.

Three OS boundaries we refused to fake across platforms ​

Landing POSIX folder-policy expiry (e388a5d) and macOS/Linux file-manager integration (fab0e4f) on 25 November forced us to honor three platform realities honestly rather than pretending every OS offers identical primitives.

Boundary 1: 10-minute quiet window + open-FD checks for POSIX folder policies ​

Windows can open a watched file denying concurrent writers before burying it; Linux read leases (F_SETLEASE) and macOS flock cannot. POSIX folder policies therefore ship with two explicit modes under [watch] file_expiry:

  • Default quiet mode: after expiry, a file must stay untouched (unchanged size and mtime) for at least 10 minutes from first inspection, and pass an open-descriptor scan (walking Linux /proc/<pid>/task/*/fd per thread, or macOS kernel vnode descriptors) right before moving; any confirmed open handle resets the timer.
  • Pragmatic handling of unreadable processes: unprivileged Linux accounts cannot inspect system processes' /proc descriptors, so demanding 100% visibility would permanently stall automatic cleanup. Our rule requires every process owned by the file's owner to be readable, skipping unreadable other-user PIDs only when the file belongs to the current user with no group- or world-write bits. Live WSL verification proved that an unreadable same-UID process (PID 687) safely kept the closed sample untouched rather than guessing.
  • Opt-in propose mode: routes expired files into the review queue for individual confirmation while still blocking burial of any confirmed open file until the holder closes it.

Boundary 2: refusing ambiguous menus in KDE Dolphin ​

We added native file-manager actions and burial date tags for macOS Finder (Quick Actions), Linux Nautilus (Scripts), and KDE Dolphin (service menus).

Real desktop testing surfaced a Dolphin quirk: Dolphin passes the exact same single directory URL whether you right-click empty folder background or right-click one selected subfolder. Guessing whether the user wanted a folder policy on the parent or burial of the child would invite mistakes. So Dolphin registers file actions only for non-directories or multi-selections and folder policies only for multiple directories, pointing single-folder workflows cleanly to the CLI or Nautilus across all ten doc languages.

Testing Nautilus and Dolphin inside headless Ubuntu 24.04 Xvfb CI also taught us to abandon fragile OCR: GTK4 Nautilus popover items expose no accessible names yet respond reliably to AT-SPI click actions (verified against exact ledger lifespans), while Qt5 Dolphin never joins AT-SPI there and is driven by locating each newly spawned top-level X popup window, snapshotting screenshots and ledger state after every step.

Boundary 3: clean WSL DrvFS handoff with WSLENV /p ​

Linux obit refuses to manage files on WSL /mnt/c DrvFS mounts (which lack safe non-overwriting renames and durable identity) and directs users to Windows obit.exe. On 25 November we also documented clean cross-boundary testing (bdda6f0): invoking isolated Windows obit.exe from WSL passes WSLENV=OBIT_HOME/p:OBIT_CONFIG_DIR/p so Linux paths translate cleanly without ever touching the host ledger.

All posts