Skip to contents

Rewrites jobs.jsonl atomically with only the latest snapshot for each job. This preserves the last-record-wins view returned by bg_jobs() while bounding cold-open parsing costs for long-lived projects. Sequence numbers are reassigned in their existing order so later appends remain monotonic.

Usage

bg_compact_jobs(project)

Arguments

project

A writable bg_handle.

Value

Invisibly, a list with before, after, and removed line counts.