gabriel / musehub public
fix BREAKING task/mwp9-prebuild-running-dedup #1 / 1
AI Agent gabriel · 18 hours ago · Oct 21, 2026 · Diff

fix: dedup fetch.mpack.prebuild against running jobs, not just pending

rc10 object-store migration corrupted signer_public_key/signature on 1179+ commits (muse#108). The repair mechanism (wire_repair_commit) works, but running a bulk repair batch against it flooded the background job queue: fetch.mpack.prebuild is self-coalescing (re-reads live branch tips at run time) but every enqueue site only deduped against status=pending, never running. A rebuild takes 30-100+s, so repeated triggers during that window (repair-commit calls, or just rapid pushes) each queued a redundant full rebuild, starving ordinary clone/fetch requests past their 120s retry budget -- confirmed live: 3 of 5 concurrent clone attempts failed outright during a 184-commit repair run.

Adds a dedup_statuses param to enqueue_job (default unchanged: pending only) and scopes pending+running dedup narrowly to fetch.mpack.prebuild at both enqueue sites (_enqueue_repair_prebuild and enqueue_push_intel's coarse dedup). Other coarse job types keep the original pending-only window since they aren't confirmed self-coalescing.

Also adds deploy/repair_commit_signatures.py, the bulk repair driver used to find this, with TDD coverage for its WireCommit payload projection (including an exhaustiveness guard against WireCommit's nullable-string fields -- a live 422 on agent_id/model_id was caught this way).

sha256:195787044debd61f93cc31b92754ee0f78e1b6f66757ee07ea5058ed5ce5197d sha
+53 ~7 symbols
5 changed · 1084 in snapshot files
sha256:95b6279219c47603c9cc75a2a84f231079de60c6daee8ae1933c24f6c41a75da snapshot
+53
symbols added
~7
symbols modified
5
files changed
1084
files in snapshot
0
dead code introduced
Semantic Changes 60 symbols
~ deploy/repair_commit_signatures.py .py 15 symbols added
+ _DIFF_SUMMARY_KEYS variable variable _DIFF_SUMMARY_KEYS L40–43
+ _ENVELOPE_KEYS variable variable _ENVELOPE_KEYS L37–39
+ _NULLABLE_STRING_FIELDS variable variable _NULLABLE_STRING_FIELDS L55–59
+ annotations import import annotations L25–25
+ argparse import import argparse L27–27
+ json import import json L28–28
+ subprocess import import subprocess L29–29
+ sys import import sys L30–30
+ time import import time L31–31
+ main function function main L158–168
+ muse_read function function muse_read L78–83
+ muse_verify_failures function function muse_verify_failures L86–93
+ project_to_wire_commit_fields function function project_to_wire_commit_fields L62–75
+ repair_one function function repair_one L96–114
+ run function function run L117–155
~ tests/test_mwp9_running_job_dedup.py .py 21 symbols added
+ _count_prebuild_jobs function async_function _count_prebuild_jobs L69–76
+ _fake_commit_id function function _fake_commit_id L45–46
+ _insert_prebuild_job function async_function _insert_prebuild_job L53–66
+ _now function function _now L49–50
+ AsyncSession import import AsyncSession L36–36
+ MusehubBackgroundJob import import MusehubBackgroundJob L39–39
+ _enqueue_repair_prebuild import import _enqueue_repair_prebuild L41–41
+ annotations import import annotations L29–29
+ compute_job_id import import compute_job_id L38–38
+ create_branch import import create_branch L42–42
+ create_repo import import create_repo L42–42
+ datetime import import datetime L32–32
+ enqueue_push_intel import import enqueue_push_intel L40–40
+ hashlib import import hashlib L31–31
+ pytest import import pytest L34–34
+ select import import select L35–35
+ timezone import import timezone L32–32
+ test_mwp9_01_pending_prebuild_still_deduped_on_repair function async_function test_mwp9_01_pending_prebuild_still_deduped_on_repair L80–89
+ test_mwp9_02_running_prebuild_deduped_on_repair function async_function test_mwp9_02_running_prebuild_deduped_on_repair L93–107
+ test_mwp9_03_running_prebuild_deduped_on_regular_push function async_function test_mwp9_03_running_prebuild_deduped_on_regular_push L111–128
+ test_mwp9_04_other_coarse_job_types_unaffected function async_function test_mwp9_04_other_coarse_job_types_unaffected L132–161
+ TestProjectToWireCommitFields class class TestProjectToWireCommitFields L64–142
+ test_envelope_keys_stripped method method test_envelope_keys_stripped L65–67
+ test_merge_commit_parent2_preserved method method test_merge_commit_parent2_preserved L122–126
+ test_missing_parent2_commit_id_defaults_to_none method method test_missing_parent2_commit_id_defaults_to_none L115–120
+ test_none_agent_id_and_model_id_coerced_to_empty_string method method test_none_agent_id_and_model_id_coerced_to_empty_string L92–105
+ test_none_toolchain_and_prompt_hash_coerced_to_empty_string method method test_none_toolchain_and_prompt_hash_coerced_to_empty_string L83–90
+ test_nullable_string_fields_list_is_exhaustive method method test_nullable_string_fields_list_is_exhaustive L128–142
+ test_read_only_diff_summary_keys_stripped method method test_read_only_diff_summary_keys_stripped L69–73
+ test_real_fields_preserved_exactly method method test_real_fields_preserved_exactly L75–81
+ test_result_validates_as_a_real_wire_commit method method test_result_validates_as_a_real_wire_commit L107–113
+ _ENVELOPE_KEYS variable variable _ENVELOPE_KEYS L26–28
+ _SAMPLE_MUSE_READ_RECORD variable variable _SAMPLE_MUSE_READ_RECORD L30–61
+ WireCommit import import WireCommit L24–24
+ annotations import import annotations L19–19
+ project_to_wire_commit_fields import import project_to_wire_commit_fields L23–23
+ pytest import import pytest L21–21
~ musehub/services/musehub_jobs.py .py 1 symbol added, 6 symbols modified
+ or_ import import or_ L35–35
~ and_
~ exists
~ select
~ update
Files Changed
+3 ~2
1084 in snapshot
← Older Oldest on task/mwp9-prebuild-running-dedup
All commits
Newer → Latest on task/mwp9-prebuild-running-dedup

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:195787044debd61f93cc31b92754ee0f78e1b6f66757ee07ea5058ed5ce5197d --body "your comment"