feat(opf): scan in a background worker that delivers what it scanned

Commit

peyton-alt6d ago

The pre-push hook no longer runs the OPF model. It rewrites checkpoints from the span cache and holds back anything not scanned yet: on git-refs those refs stay queued while scanned siblings ship, on git-branch v1 is not pushed this time. Either way the user's push completes and a detached entire __opf_scan <remote> worker is started.

The worker takes a per-repo lock for its whole run, collects the checkpoint commits still lacking the OPF trailer on the primary backend (queued refs on git-refs, the unpushed v1 chain on git-branch), scans what the cache lacks, and then runs the same pre-push delivery for the remote the spawning push named, with that push's OPF decision and non-interactive git. Units over a cap are skipped, the loop repeats only while new work appears, and a delivery that fails leaves everything queued for the next push.

The explicit migration push still scans synchronously, since it promises an immediate push.

Also carries two fixes the worker depends on: SpawnDetached gives children the null device instead of a pipe (a pipe drained by the exiting parent killed the child on its first stderr write), and the spawn-throttle marker moves into a shared spawnmarker package.

Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com Entire-Checkpoint: 01M3SQFKMHPMBCMBFZZJFSD4G5

Checkpoints

Fix OPF Byte Cap Scope Per Checkpoint Ref

Claude CodeOpus 5.5
View session
Checkpoint 1