feat(mwp4/phase2): claim-layer dependency barrier in claim_next_job
Add correlated NOT EXISTS barrier: fetch.mpack.prebuild is not claimable while any mpack.index for the same repo_id is pending or running.
Implementation: aliased subquery on MusehubBackgroundJob joined by repo_id, filtered to job_type='mpack.index' and status IN ('pending','running'). The EXISTS check is read-only; FOR UPDATE SKIP LOCKED locks only the outer selected row — no extra lock contention.
MWP4_04 GREEN: barrier blocks prebuild while index is pending (was MWP4_01 RED). MWP4_05 GREEN: done index does not gate the prebuild. MWP4_06 GREEN: running index gates the prebuild (claim returns None). MWP4_07 GREEN: failed/quarantined index does not gate the prebuild. MWP4_08 GREEN: barrier is scoped per repo_id — no cross-repo blocking. MWP4_09 GREEN: only fetch.mpack.prebuild is filtered; all other types unaffected. MWP4_01 GREEN: original RED test now passes with the barrier in place. 9/9 MWP4 tests green. 36 adjacent tests green, zero regressions.
Issue: musehub#109, master: muse#58
Semantic Changes
16 symbols
0 comments
muse hub commit comment sha256:9e522d1d8fdb969514e26b71d13470b8f18e67ad010084764d67c1ac08b779de --body "your comment"
No comments yet. Be the first to start the discussion.