gabriel / musehub public
test mwp4 task/mwp-4-prebuild-after-index #6 / 6
AI Agent gabriel · 21 days ago · Jun 29, 2026 · Diff

test(mwp4): Phase 0 RED reproduction tests for RC-4 ordering race

MWP4_01 — correctly FAILING: claim_next_job returns fetch.mpack.prebuild before a pending mpack.index for the same repo, proving the ordering race (RC-4).

MWP4_02 — PASSING: after deleting inline MusehubMPackIndex rows written by wire_push_unpack_mpack at step 7d (simulating the pre-index state), running process_fetch_mpack_prebuild_job raises FetchNotIndexedError which the broad except at musehub_wire_fetch.py:1164-1167 silently swallows — tips_built=0, no MusehubFetchMPackCache row. The silent-no-cache bug is proven.

Issue: musehub#109, master: muse#58

sha256:2c523da45351334b5c4dbefed4dc3dd553b3faa8737a4e6caf301e5dc82141be sha
+59 symbols
2 changed · 987 in snapshot files
sha256:70860b8287e086d698f0fe9497ab806f4e657d6721739e0b4192a1ce6f5611ee snapshot
+59
symbols added
2
files changed
987
files in snapshot
0
dead code introduced
Semantic Changes 59 symbols
+ index (fixes RC-4) section MWP-4 — Gate fetch.mpack.prebuild behind mpack.index (fixes RC-4) L1–364
+ Acceptance criteria section Acceptance criteria L314–340
+ Adjacent suites to run green (no regressions) section Adjacent suites to run green (no regressions) L330–340
+ Background section Background L17–107
+ The symptom section The symptom L19–27
+ Why MWP-3 did not already fix this section Why MWP-3 did not already fix this L86–95
+ Why it happens — RC-4 (foundation-job ordering race) section Why it happens — RC-4 (foundation-job ordering race) L27–86
+ code[python]@L43 variable variable code[python]@L43 L43–48
+ code[python]@L58 variable variable code[python]@L58 L58–70
+ code[python]@L76 variable variable code[python]@L76 L76–80
+ Worker-scope reality section Worker-scope reality L95–107
+ Design — chosen fix and rationale section Design — chosen fix and rationale L121–228
+ Defense-in-depth — created_at stagger section Defense-in-depth — created_at stagger L199–215
+ code variable variable code L206–211
+ Hardening — stop masking the index gap section Hardening — stop masking the index gap L215–228
+ The load-bearing fix — a claim-layer dependency barrier section The load-bearing fix — a claim-layer dependency barrier L138–199
+ code[python] variable variable code[python] L145–174
+ table section table L177–184
+ Why a timestamp stagger alone is insufficient section Why a timestamp stagger alone is insufficient L129–138
+ Goal — definition of done section Goal — definition of done L107–121
+ Out of scope section Out of scope L340–353
+ Phases section Phases L228–314
+ Phase 0 — RED reproduction (no production change) section Phase 0 — RED reproduction (no production change) L236–250
+ Phase 1 — created_at stagger (defense-in-depth) section Phase 1 — created_at stagger (defense-in-depth) L250–260
+ Phase 2 — claim-layer dependency barrier (load-bearing) section Phase 2 — claim-layer dependency barrier (load-bearing) L260–280
+ Phase 3 — stop masking the index gap section Phase 3 — stop masking the index gap L280–290
+ Phase 4 — integration + stress (real worker claim loop) section Phase 4 — integration + stress (real worker claim loop) L290–304
+ Phase 5 — docs + close section Phase 5 — docs + close L304–314
+ Reference — key symbol anchors section Reference — key symbol anchors L353–364
+ table section table L355–364
~ tests/test_mwp4_prebuild_ordering.py .py 29 symbols added
+ _E2E_OWNER variable variable _E2E_OWNER L86–86
+ _e2e_push function async_function _e2e_push L116–167
+ _e2e_raw_commit function function _e2e_raw_commit L89–113
+ _fake_commit_id function function _fake_commit_id L58–59
+ _job_row function function _job_row L66–83
+ _now function function _now L62–63
+ AsyncSession import import AsyncSession L39–39
+ MusehubBackgroundJob import import MusehubBackgroundJob L45–45
+ MusehubFetchMPackCache import import MusehubFetchMPackCache L46–46
+ MusehubMPackIndex import import MusehubMPackIndex L46–46
+ annotations import import annotations L32–32
+ blob_id import import blob_id L43–43
+ build_wire_mpack import import build_wire_mpack L42–42
+ claim_next_job import import claim_next_job L47–47
+ compute_job_id import import compute_job_id L44–44
+ create_repo import import create_repo L50–50
+ datetime import import datetime L35–35
+ delete import import delete L38–38
+ func function import func L38–38
+ hash_snapshot import import hash_snapshot L41–41
+ hashlib import import hashlib L34–34
+ process_fetch_mpack_prebuild_job import import process_fetch_mpack_prebuild_job L48–48
+ pytest import import pytest L37–37
+ select import import select L38–38
+ timedelta import import timedelta L35–35
+ timezone import import timezone L35–35
+ wire_push_unpack_mpack import import wire_push_unpack_mpack L49–49
+ test_mwp4_01_claim_returns_prebuild_before_index function async_function test_mwp4_01_claim_returns_prebuild_before_index L176–235
+ test_mwp4_02_prebuild_swallows_fetch_not_indexed_error function async_function test_mwp4_02_prebuild_swallows_fetch_not_indexed_error L244–340
Files Changed
+2
987 in snapshot

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:2c523da45351334b5c4dbefed4dc3dd553b3faa8737a4e6caf301e5dc82141be --body "your comment"