gabriel / musehub public
feat patch mist task/mist-phase2-push-validator #1 / 1
AI Agent gabriel · 142 days ago · May 1, 2026 · Diff

feat(mist): Phase 2 — mist push validator wired into wire_push_stream

- New musehub/services/musehub_mist_push_validator.py: MistValidationResult dataclass (errors/warnings, valid property) validate_mist_manifest() — iterates manifest paths, delegates to _validate_mist_filename() for hard errors, warns on unknown extensions - musehub_wire.py step 3c: for mist-domain repos, validate every snapshot manifest before any writes; reject with 422 on hard errors - 24 TDD tests: result shape, path traversal, null bytes, ANSI escapes, control chars, path separators, length, empty filename, multi-error accumulation, valid inputs, warnings for unknown extensions, wire wiring

sha256:9080d55f6da50f3f065993a7f929e566f8d2517bfd9dd9f2c35700bada8a7c8a sha
+40 ~1 symbols
sha256:e4694887d3fbebc71e6e8e282d8d81cd16d05721c54fc4aed059b7f3fbefb851 snapshot
+40
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 41 symbols
+ MistValidationResult class class MistValidationResult L39–49
+ valid method method valid L48–49
+ _KNOWN_EXTENSIONS variable variable _KNOWN_EXTENSIONS L29–35
+ _validate_mist_filename import import _validate_mist_filename L25–25
+ annotations import import annotations L21–21
+ dataclass class import dataclass L23–23
+ detect_artifact_type import import detect_artifact_type L25–25
+ field import import field L23–23
+ validate_mist_manifest function function validate_mist_manifest L52–87
+ TestMistValidationResult class class TestMistValidationResult L21–38
+ test_result_with_errors_is_invalid method method test_result_with_errors_is_invalid L28–32
+ test_result_with_only_warnings_is_valid method method test_result_with_only_warnings_is_valid L34–38
+ test_valid_result_has_no_errors method method test_valid_result_has_no_errors L22–26
+ TestValidateMistManifestHardErrors class class TestValidateMistManifestHardErrors L45–113
+ test_ansi_escape_in_filename method method test_ansi_escape_in_filename L66–70
+ test_backslash_path_separator method method test_backslash_path_separator L84–88
+ test_control_character_in_filename method method test_control_character_in_filename L72–76
+ test_empty_filename_is_rejected method method test_empty_filename_is_rejected L109–113
+ test_errors_list_all_invalid_paths method method test_errors_list_all_invalid_paths L97–107
+ test_filename_exceeds_255_chars method method test_filename_exceeds_255_chars L90–95
+ test_forward_slash_path_separator method method test_forward_slash_path_separator L78–82
+ test_null_byte_in_filename method method test_null_byte_in_filename L59–64
+ test_path_traversal_dot_dot_only method method test_path_traversal_dot_dot_only L53–57
+ test_path_traversal_dot_dot_slash method method test_path_traversal_dot_dot_slash L46–51
+ TestValidateMistManifestValid class class TestValidateMistManifestValid L120–157
+ test_clean_python_filename method method test_clean_python_filename L121–126
+ test_clean_solidity_filename method method test_clean_solidity_filename L134–138
+ test_clean_typescript_filename method method test_clean_typescript_filename L128–132
+ test_empty_manifest_is_valid method method test_empty_manifest_is_valid L140–146
+ test_multiple_clean_filenames method method test_multiple_clean_filenames L148–157
+ TestValidateMistManifestWarnings class class TestValidateMistManifestWarnings L164–197
+ test_known_extension_produces_no_warning method method test_known_extension_produces_no_warning L180–185
+ test_mix_valid_and_unknown_ext method method test_mix_valid_and_unknown_ext L187–197
+ test_no_extension_produces_warning method method test_no_extension_produces_warning L173–178
+ test_unknown_extension_produces_warning method method test_unknown_extension_produces_warning L165–171
+ TestWirePushMistValidation class class TestWirePushMistValidation L204–241
+ test_domain_non_mist_skips_validator method async_method test_domain_non_mist_skips_validator L230–241
+ test_validate_manifest_called_for_mist_domain method async_method test_validate_manifest_called_for_mist_domain L213–227
+ annotations import import annotations L13–13
+ pytest import import pytest L15–15
← Older Oldest on task/mist-phase2-push-validator
All commits
Newer → Latest on task/mist-phase2-push-validator

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:9080d55f6da50f3f065993a7f929e566f8d2517bfd9dd9f2c35700bada8a7c8a --body "your comment"