gabriel / musehub public
feat patch phase5 task/phase5-mcp-profile-manifest #1 / 1
AI Agent gabriel · 144 days ago · Apr 30, 2026 · Diff

feat(phase5): MCP profile manifest + attestation + MPay executor functions

Add six new MCP executor functions and their dispatcher routing + tool definitions:

- execute_read_profile_manifest: full archetype-aware ProfileManifest (activity canvas, attestation badges, AVAX address, agent trust chain, org manifest, MPay totals) — supersedes execute_read_user_profile for agent consumers - execute_issue_attestation: Ed25519 sig verification before DB write; ATTEST canonical message domain-separated from MSign and MPay - execute_revoke_attestation: attester-only revocation; KeyError → 404, PermissionError → 403 - execute_list_attestations: query by subject with optional include_revoked flag - execute_record_mpay_claim: guards amount>0 + sender!=recipient before sig verify; idempotent on nonce_hex - execute_get_mpay_ledger: clamped limit (max 500); returns sent + received with totals

Also adds dispatch_tool() public wrapper in dispatcher.py for test + CLI use. 24 RED → GREEN TDD tests in tests/test_mcp_profile_tools.py.

sha256:9ad0efbec47b1f00437d4ae234184060adcde1ece69c7b63550a13408106b00a sha
+60 ~2 symbols
sha256:1302fd0e8bc1882bea1afdd7514a2608bc07d0e814b3d1ef3f4100efe5383769 snapshot
+60
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 62 symbols
~ tests/test_mcp_profile_tools.py .py 53 symbols added
+ TestDispatcherRouting class class TestDispatcherRouting L673–792
+ test_dispatch_get_mpay_ledger method async_method test_dispatch_get_mpay_ledger L778–792
+ test_dispatch_issue_attestation method async_method test_dispatch_issue_attestation L694–716
+ test_dispatch_list_attestations method async_method test_dispatch_list_attestations L736–750
+ test_dispatch_read_profile_manifest method async_method test_dispatch_read_profile_manifest L677–691
+ test_dispatch_record_mpay_claim method async_method test_dispatch_record_mpay_claim L753–775
+ test_dispatch_revoke_attestation method async_method test_dispatch_revoke_attestation L719–733
+ TestExecuteGetMpayLedger class class TestExecuteGetMpayLedger L588–666
+ test_limit_clamped_to_500 method async_method test_limit_clamped_to_500 L638–666
+ test_returns_sent_received_totals method async_method test_returns_sent_received_totals L591–635
+ TestExecuteIssueAttestation class class TestExecuteIssueAttestation L222–307
+ test_invalid_signature_returns_error method async_method test_invalid_signature_returns_error L268–285
+ test_valid_attestation_returns_ok method async_method test_valid_attestation_returns_ok L226–265
+ test_wrong_key_returns_error method async_method test_wrong_key_returns_error L288–307
+ TestExecuteListAttestations class class TestExecuteListAttestations L402–467
+ test_empty_subject_returns_empty_list method async_method test_empty_subject_returns_empty_list L444–467
+ test_returns_list_with_count method async_method test_returns_list_with_count L405–441
+ TestExecuteReadProfileManifest class class TestExecuteReadProfileManifest L58–215
+ _make_manifest method method _make_manifest L62–103
+ test_not_found_returns_error method async_method test_not_found_returns_error L197–215
+ test_returns_agent_specific_fields method async_method test_returns_agent_specific_fields L139–165
+ test_returns_full_manifest_fields method async_method test_returns_full_manifest_fields L106–136
+ test_returns_org_specific_fields method async_method test_returns_org_specific_fields L168–194
+ TestExecuteRecordMpayClaim class class TestExecuteRecordMpayClaim L474–581
+ test_invalid_mpay_signature_returns_error method async_method test_invalid_mpay_signature_returns_error L522–539
+ test_self_payment_returns_error method async_method test_self_payment_returns_error L563–581
+ test_valid_claim_returns_claim_id method async_method test_valid_claim_returns_claim_id L477–519
+ test_zero_amount_returns_error method async_method test_zero_amount_returns_error L542–560
+ TestExecuteRevokeAttestation class class TestExecuteRevokeAttestation L314–395
+ test_not_found_returns_error method async_method test_not_found_returns_error L348–370
+ test_revoke_returns_revoked_at method async_method test_revoke_returns_revoked_at L317–345
+ test_wrong_revoker_returns_forbidden method async_method test_wrong_revoker_returns_forbidden L373–395
+ _AMOUNT_NANO variable variable _AMOUNT_NANO L50–50
+ _ATTESTER variable variable _ATTESTER L44–44
+ _CLAIM variable variable _CLAIM L46–46
+ _NONCE_HEX variable variable _NONCE_HEX L51–51
+ _RECIPIENT variable variable _RECIPIENT L49–49
+ _SENDER variable variable _SENDER L48–48
+ _SUBJECT variable variable _SUBJECT L45–45
+ _TS variable variable _TS L47–47
+ _make_ed25519_pair function function _make_ed25519_pair L28–31
+ _sign_attest function function _sign_attest L34–36
+ _sign_mpay function function _sign_mpay L39–41
+ AsyncMock import import AsyncMock L18–18
+ Ed25519PrivateKey import import Ed25519PrivateKey L21–21
+ MagicMock import import MagicMock L18–18
+ annotations import import annotations L15–15
+ datetime import import datetime L17–17
+ encode_pubkey import import encode_pubkey L22–22
+ encode_sig import import encode_sig L22–22
+ patch import import patch L18–18
+ pytest import import pytest L20–20
+ timezone import import timezone L17–17
~ musehub/mcp/dispatcher.py .py 1 symbol added, 1 symbol modified
+ dispatch_tool function async_function dispatch_tool L1632–1668
+ execute_get_mpay_ledger function async_function execute_get_mpay_ledger L4168–4216
+ execute_issue_attestation function async_function execute_issue_attestation L3904–3974
+ execute_list_attestations function async_function execute_list_attestations L4031–4073
+ execute_read_profile_manifest function async_function execute_read_profile_manifest L3848–3901
+ execute_record_mpay_claim function async_function execute_record_mpay_claim L4076–4165
+ execute_revoke_attestation function async_function execute_revoke_attestation L3977–4028
← Older Oldest on task/phase5-mcp-profile-manifest
All commits
Newer → Latest on task/phase5-mcp-profile-manifest

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