gabriel / muse public
feat patch verify-pack dev
AI Agent gabriel · 161 days ago · Apr 18, 2026 · Diff

feat(verify-pack): Phase 1 — promised object awareness + --strict flag

Fixes the false-positive failure storm on partial-clone repos.

Root cause: verify-pack treated any object absent from the bundle AND absent from the local store as a failure. In a partial-clone repo, historical objects are legitimately absent locally but promised by a promisor remote — muse verify already handles this correctly via the PRESENT/PROMISED/MISSING tristate; verify-pack did not.

Changes: - Import ObjectState, load_promisor_remotes, object_state from muse.core.object_availability (same module used by muse verify) - Load promisor remotes once at run() startup when root is available - Snapshot manifest check now uses the three-state model: PRESENT → pass (exists and hash-verified locally) PROMISED → increment promised_count, skip (unless --strict) MISSING → failure (no known recovery path) - Add promised_objects: int to _VerifyPackResult TypedDict and JSON output - Add --strict flag: treats PROMISED as MISSING (full self-containment) - Update module docstring with object availability model section - 17 new tests in TestPromisedObjects covering all three states, --strict mode, mixed present/promised/in-bundle scenarios, quiet mode

Live result on muse repo (partial clone with 3 promisor remotes): Before: 68,539 failures (all false positives) After: 0 failures, 68,539 promised_objects, all_ok=true

sha256:249d174c6efc1b9e7563058988b02c6013f607a26f9851e7628d551bffef9373 sha
+23 ~3 symbols
sha256:21566bb7d8680bd54a63686081578d7c3397613979b45ba58b26deb02debec33 snapshot
+23
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 26 symbols
~ muse/cli/commands/verify_pack.py .py 3 symbols added, 3 symbols modified
+ ObjectState import import ObjectState L113–113
+ load_promisor_remotes import import load_promisor_remotes L113–113
+ object_state import import object_state L113–113
~ run
~ tests/test_cmd_verify_pack.py .py 20 symbols added
+ TestPromisedObjects class class TestPromisedObjects L968–1183
+ test_exit_code_zero_for_promised_objects method method test_exit_code_zero_for_promised_objects L1018–1024
+ test_json_envelope_includes_promised_objects method method test_json_envelope_includes_promised_objects L1134–1141
+ test_missing_object_is_a_failure method method test_missing_object_is_a_failure L1030–1038
+ test_missing_object_not_in_promised_objects method method test_missing_object_not_in_promised_objects L1040–1045
+ test_mixed_present_and_promised method method test_mixed_present_and_promised L1143–1175
+ test_present_object_passes_with_no_promisor method method test_present_object_passes_with_no_promisor L1092–1109
+ test_present_object_passes_with_strict method method test_present_object_passes_with_strict L1111–1128
+ test_promised_object_counted_in_promised_objects method method test_promised_object_counted_in_promised_objects L1002–1008
+ test_promised_object_not_a_failure_by_default method method test_promised_object_not_a_failure_by_default L992–1000
+ test_promised_object_not_in_failures_list method method test_promised_object_not_in_failures_list L1010–1016
+ test_promised_objects_key_present_on_clean_bundle method method test_promised_objects_key_present_on_clean_bundle L975–980
+ test_promised_objects_zero_when_all_present method method test_promised_objects_zero_when_all_present L982–986
+ test_quiet_passes_with_promised method method test_quiet_passes_with_promised L1177–1183
+ test_strict_exit_nonzero_for_promised method method test_strict_exit_nonzero_for_promised L1061–1066
+ test_strict_promised_counted_separately method method test_strict_promised_counted_separately L1077–1086
+ test_strict_still_passes_for_present_objects method method test_strict_still_passes_for_present_objects L1068–1075
+ test_strict_treats_promised_as_failure method method test_strict_treats_promised_as_failure L1051–1059
+ _bundle_with_remote_only_ref function function _bundle_with_remote_only_ref L948–965
+ _write_promisor_config function function _write_promisor_config L938–945
← Older Oldest on dev
All commits
Newer → Latest on dev

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:249d174c6efc1b9e7563058988b02c6013f607a26f9851e7628d551bffef9373 --body "your comment"