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

test(mwp-3): Phase 0 RED reproduction tests — MWP3_01, MWP3_02, MWP3_03

MWP3_01 RED: two enqueue_push_intel calls with distinct mpack_keys produce only one pending mpack.index row today — coarse (repo_id, job_type, pending) dedup silently drops push B's index job. Asserts Face 1 of RC-3.

MWP3_02 RED: process_fetch_mpack_prebuild_job runs with a stale payload (tip_commit_ids=[tipA]) while MusehubBranch has tipB live. wire_fetch_mpack is called with want=[tipA] only; tipB is absent. Asserts Face 2 of RC-3.

MWP3_03 GREEN: a single push enqueues exactly one mpack.index and one fetch.mpack.prebuild — no duplicate explosion. This guard must stay GREEN through all subsequent phases.

No production code changed. Phase 0 exit criteria met.

sha256:78ce8754bfa2b035d2b5dcb3266b589aa313c93dfa887478ae47e49b07d65570 sha
+23 symbols
sha256:9c0f9113962510b2162ee0cbf6912d8c613f462012523311e3faea299caf09bc snapshot
+23
symbols added
0
dead code introduced
Semantic Changes 23 symbols
~ tests/test_mwp3_job_idempotency.py .py 23 symbols added
+ _fake_commit_id function function _fake_commit_id L63–64
+ _fake_mpack_key function function _fake_mpack_key L67–68
+ _insert_prebuild_job function async_function _insert_prebuild_job L75–97
+ _now function function _now L71–72
+ AsyncMock import import AsyncMock L45–45
+ AsyncSession import import AsyncSession L49–49
+ MusehubBackgroundJob import import MusehubBackgroundJob L52–52
+ annotations import import annotations L41–41
+ compute_job_id import import compute_job_id L51–51
+ create_branch import import create_branch L55–55
+ create_repo import import create_repo L55–55
+ datetime import import datetime L44–44
+ enqueue_push_intel import import enqueue_push_intel L53–53
+ func function import func L48–48
+ hashlib import import hashlib L43–43
+ patch import import patch L45–45
+ process_fetch_mpack_prebuild_job import import process_fetch_mpack_prebuild_job L54–54
+ pytest import import pytest L47–47
+ select import import select L48–48
+ timezone import import timezone L44–44
+ test_mwp3_01_distinct_mpack_keys_both_enqueued function async_function test_mwp3_01_distinct_mpack_keys_both_enqueued L106–166
+ test_mwp3_02_prebuild_handler_uses_stale_payload_tips function async_function test_mwp3_02_prebuild_handler_uses_stale_payload_tips L175–241
+ test_mwp3_03_single_push_enqueues_exactly_one_each function async_function test_mwp3_03_single_push_enqueues_exactly_one_each L250–292

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:78ce8754bfa2b035d2b5dcb3266b589aa313c93dfa887478ae47e49b07d65570 --body "your comment"