gabriel / musehub public
test patch task/identity-tests-and-docstrings #1 / 1
AI Agent gabriel · 142 days ago · May 1, 2026 · Diff

test: belt-and-suspenders coverage for identity plugin phases 1–6

- Add test_identity_belt_and_suspenders.py with 19 new tests covering: - _commit_key_rotation_to_identity_repo: no-op guards + correct HEAD update - State integrity: identity repo HEAD pubkey consistent with MusehubAuthKey fingerprint - Concurrent stress: 50+ simultaneous read_object_bytes calls across all storage paths - Security edge cases: malformed pubkey, corrupted JSON, empty paths all return None - Update docstrings in identities.py: - get_identity: document merge strategy (repo HEAD > DB enrichment) - _read_identity_record_from_repo: expand to describe the full traversal path - _row_to_dict: document the canonical-truth merge logic

sha256:f15e86f04c55358e06df845eb5024feebbe4c34d0143c0cef1d0debbfa6c60ba sha
+54 ~3 symbols
sha256:84d244395d76f602a6e1466eba88290a5a8ca6cb79cf5c3e8e8ac99ef318a255 snapshot
+54
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 57 symbols
+ TestCommitKeyRotationToIdentityRepo class class TestCommitKeyRotationToIdentityRepo L247–367
+ test_noop_when_identity_has_no_identity_repo method async_method test_noop_when_identity_has_no_identity_repo L268–283
+ test_noop_when_identity_id_not_found method async_method test_noop_when_identity_id_not_found L255–265
+ test_preserves_other_fields_after_rotation method async_method test_preserves_other_fields_after_rotation L311–339
+ test_second_rotation_overwrites_first method async_method test_second_rotation_overwrites_first L341–367
+ test_updates_pubkey_in_head_record method async_method test_updates_pubkey_in_head_record L286–309
+ TestReadObjectBytesStress class class TestReadObjectBytesStress L483–561
+ _cached_obj method method _cached_obj L486–493
+ _disk_obj method method _disk_obj L495–502
+ test_50_concurrent_reads_on_cached_object method async_method test_50_concurrent_reads_on_cached_object L504–513
+ test_50_concurrent_reads_on_disk_object method async_method test_50_concurrent_reads_on_disk_object L515–526
+ test_concurrent_reads_complete_under_budget method async_method test_concurrent_reads_complete_under_budget L550–561
+ test_mixed_concurrent_reads_cached_and_disk method async_method test_mixed_concurrent_reads_cached_and_disk L528–548
+ TestSecurityEdgeCases class class TestSecurityEdgeCases L569–734
+ test_read_identity_record_corrupted_json_returns_none method async_method test_read_identity_record_corrupted_json_returns_none L666–734
+ test_read_object_bytes_returns_none_on_empty_paths method async_method test_read_object_bytes_returns_none_on_empty_paths L590–601
+ test_read_object_bytes_returns_none_on_missing_disk_path method async_method test_read_object_bytes_returns_none_on_missing_disk_path L574–588
+ test_resolve_handle_empty_pubkey_returns_none method async_method test_resolve_handle_empty_pubkey_returns_none L626–640
+ test_resolve_handle_malformed_pubkey_returns_none method async_method test_resolve_handle_malformed_pubkey_returns_none L605–624
+ test_resolve_handle_no_identity_repo_returns_none method async_method test_resolve_handle_no_identity_repo_returns_none L642–653
+ test_resolve_unknown_handle_returns_none method async_method test_resolve_unknown_handle_returns_none L655–662
+ TestStateIntegrity class class TestStateIntegrity L375–475
+ test_after_rotation_get_response_and_auth_key_agree method async_method test_after_rotation_get_response_and_auth_key_agree L441–475
+ test_get_identity_pubkey_consistent_with_auth_key_fingerprint method async_method test_get_identity_pubkey_consistent_with_auth_key_fingerprint L414–439
+ test_registered_key_fingerprint_matches_identity_repo_pubkey method async_method test_registered_key_fingerprint_matches_identity_repo_pubkey L386–412
+ _COUNTER variable variable _COUNTER L63–63
+ _KEY_A_B64 variable variable _KEY_A_B64 L55–55
+ _KEY_A_BYTES variable variable _KEY_A_BYTES L53–53
+ _KEY_A_FP variable variable _KEY_A_FP L54–54
+ _KEY_B_B64 variable variable _KEY_B_B64 L59–59
+ _KEY_B_BYTES variable variable _KEY_B_BYTES L57–57
+ _KEY_B_FP variable variable _KEY_B_FP L58–58
+ _NOW variable variable _NOW L61–61
+ _make_auth_key function function _make_auth_key L88–98
+ _make_identity function function _make_identity L74–85
+ _read_head_record function async_function _read_head_record L187–239
+ _seed_identity_repo function async_function _seed_identity_repo L101–184
+ _uid function function _uid L66–68
+ AsyncClient import import AsyncClient L41–41
+ AsyncSession import import AsyncSession L42–42
+ annotations import import annotations L30–30
+ asyncio import import asyncio L32–32
+ base64 import import base64 L33–33
+ compute_branch_id import import compute_branch_id L45–45
+ compute_identity_id import import compute_identity_id L45–45
+ compute_repo_id import import compute_repo_id L45–45
+ datetime import import datetime L40–40
+ hashlib import import hashlib L34–34
+ json import import json L35–35
+ msgpack import import msgpack L38–38
+ pytest import import pytest L39–39
+ select import import select L43–43
+ time import import time L36–36
+ timezone import import timezone L40–40
← Older Oldest on task/identity-tests-and-docstrings
All commits
Newer → Latest on task/identity-tests-and-docstrings

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