gabriel / musehub public
fix patch mwp-3 task/mwp-3-job-idempotency #6 / 10
AI Agent gabriel · 23 days ago · Jun 29, 2026 · Diff

fix(mwp-3): Phase 1 — fetch.mpack.prebuild self-coalescing via runtime branch-tip re-read

process_fetch_mpack_prebuild_job now queries MusehubBranch.head_commit_id at run time instead of trusting payload['tip_commit_ids'] verbatim. This makes the job self-coalescing: any number of pushes deduped into one pending job are all covered because the handler reads live branch state here, not what was captured at enqueue time.

payload['tip_commit_ids'] is retained for observability only; a diff against live tips is logged at INFO when the two sets diverge. The early-exit guard now fires on 'no live branch tips' rather than 'empty payload'.

Tests: MWP3_04 GREEN — empty payload but two live branches → wire_fetch_mpack called with want=[tipA, tipB] MWP3_05 GREEN — payload={tipA}, live DB={tipA, tipB} → both tips built MWP3_06 GREEN — cache rows written for BOTH tips after a stale-payload drain MWP3_02 GREEN — Phase 0 RED reproduction now passes FMC_18 GREEN — enqueue_push_intel still writes payload for observability

sha256:b63ee1a008d0af07b85f11351d22454611cb122a31530a6a9b06280cb609c1e0 sha
+4 ~1 symbols
sha256:7477909b65999910d31a3f577bd97b06a3e15bdc92c4c569d4512a41c65d2d46 snapshot
+4
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 5 symbols
~ tests/test_mwp3_job_idempotency.py .py 4 symbols added
+ MusehubFetchMPackCache import import MusehubFetchMPackCache L53–53
+ test_mwp3_04_handler_reads_live_tips_when_payload_empty function async_function test_mwp3_04_handler_reads_live_tips_when_payload_empty L302–353
+ test_mwp3_05_live_tips_supersede_stale_payload function async_function test_mwp3_05_live_tips_supersede_stale_payload L362–407
+ test_mwp3_06_cache_rows_written_for_all_live_tips function async_function test_mwp3_06_cache_rows_written_for_all_live_tips L416–476

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:b63ee1a008d0af07b85f11351d22454611cb122a31530a6a9b06280cb609c1e0 --body "your comment"