(** The session worker: process the stale markers once. *) type outcome = { built : string list; failed : string list } val log : Switch.t -> string -> unit (** Append a timestamped line to the switch's odd log. Best-effort; never raises. *) val sync : ?driver:Bos.Cmd.t -> Switch.t -> (outcome, [ `Msg of string ]) result (** Rebuild every package with a stale marker ({!Pending}), in dependency order, each erased then rebuilt via the driver (default [odd-driver]), and regenerate the landing page. A successful build clears the marker (the erase removes it); a failed one re-marks the package so the next session retries. Removals are not handled here — the post-remove hook deletes the docs directly — but the landing page is regenerated every session so removed packages drop off it. Runs under a lock file; driver output goes to the log. *) val summary : outcome -> string (** One line, e.g. ["2 built, 0 failed"]. *)