gabriel / musehub public
feat BREAKING profiles task/profile-reimagination #1 / 1
AI Agent gabriel · 156 days ago · Apr 21, 2026 · Diff

feat(profiles): implement Issue #1 — archetype-aware profile reimagination

- genesis.py: add compute_attestation_id and compute_mpay_claim_id - db/musehub_models.py: extend MusehubIdentity with avax_address, org_members, org_quorum, org_treasury_address; add MusehubAttestation and MusehubMPayClaim ORM models - models/musehub.py: add AttestationRequest/Response, MPayClaimRequest/Response, MPayLedgerResponse, ActivityDomain, AttestationBadge, TrustChainEntry, OrgManifest, ProfileManifest Pydantic schemas - services/musehub_attestations.py: Ed25519 sig verify, issue/revoke/query attestations - services/musehub_mpay.py: Ed25519 sig verify, record/query MPay claims + ledger - services/musehub_profile.py: multi-domain activity canvas (code/music/midi/prose/mpay), trust chain builder, build_profile_manifest() archetype dispatcher - api/routes/api/profiles.py: GET /api/profiles/{handle}, POST /attestations, DELETE /attestations/{id}, GET /mpay-ledger, POST /mpay-claims - main.py: register api_profiles_router - alembic/versions/profile_reimagination.py: migration d4e5f6a7b8c3 - tests/test_profile_reimagination.py: 42 tests covering genesis IDs, sig verify, Pydantic schemas, service CRUD mocks, activity canvas math

sha256:a34ecd87afe8c2701fa51e7e07387253eacd386cce699515ed3a56d426266850 sha
+205 ~8 symbols
sha256:c4169b258c361c3d4d928435210009645a0bc6f57d04e34835aeb64070a1b613 snapshot
+205
symbols added
~8
symbols modified
0
dead code introduced
Semantic Changes 213 symbols
+ branch_labels variable variable branch_labels L18–18
+ depends_on variable variable depends_on L19–19
+ down_revision variable variable down_revision L17–17
+ downgrade function function downgrade L86–92
+ Union import import Union L11–11
+ annotations import import annotations L9–9
+ op import import op L14–14
+ sa import import sa L13–13
+ revision variable variable revision L16–16
+ upgrade function function upgrade L22–83
~ musehub/api/routes/api/profiles.py .py 26 symbols added
+ get_mpay_ledger function async_function get_mpay_ledger L138–144
+ get_profile_manifest function async_function get_profile_manifest L35–59
+ APIRouter import import APIRouter L14–14
+ AsyncSession import import AsyncSession L15–15
+ AttestationListResponse import import AttestationListResponse L18–18
+ AttestationRequest import import AttestationRequest L18–18
+ AttestationResponse import import AttestationResponse L18–18
+ Depends import import Depends L14–14
+ HTTPException import import HTTPException L14–14
+ MPayClaimRequest import import MPayClaimRequest L18–18
+ MPayClaimResponse import import MPayClaimResponse L18–18
+ MPayLedgerResponse import import MPayLedgerResponse L18–18
+ ProfileManifest import import ProfileManifest L18–18
+ Query import import Query L14–14
+ annotations import import annotations L10–10
+ get_db import import get_db L17–17
+ logging import import logging L12–12
+ musehub_attestations import import musehub_attestations L27–27
+ musehub_mpay import import musehub_mpay L27–27
+ musehub_profile import import musehub_profile L27–27
+ issue_attestation function async_function issue_attestation L75–93
+ list_attestations function async_function list_attestations L63–71
+ logger variable variable logger L29–29
+ record_mpay_claim function async_function record_mpay_claim L116–134
+ revoke_attestation function async_function revoke_attestation L100–112
+ router variable variable router L31–31
+ _PREFIX variable variable _PREFIX L35–35
+ _canonical_message function function _canonical_message L44–45
+ _decode_b64url function function _decode_b64url L38–41
+ attestation_to_badge function function attestation_to_badge L239–252
+ get_attestations_for_subject function async_function get_attestations_for_subject L204–236
+ AsyncSession import import AsyncSession L23–23
+ AttestationBadge import import AttestationBadge L26–26
+ AttestationListResponse import import AttestationListResponse L26–26
+ AttestationRequest import import AttestationRequest L26–26
+ AttestationResponse import import AttestationResponse L26–26
+ Ed25519PublicKey import import Ed25519PublicKey L20–20
+ Encoding import import Encoding L21–21
+ PublicFormat import import PublicFormat L21–21
+ annotations import import annotations L13–13
+ base64 import import base64 L15–15
+ compute_attestation_id import import compute_attestation_id L25–25
+ datetime import import datetime L18–18
+ json import import json L16–16
+ logging import import logging L17–17
+ text import import text L22–22
+ timezone import import timezone L18–18
+ issue_attestation function async_function issue_attestation L76–153
+ logger variable variable logger L33–33
+ revoke_attestation function async_function revoke_attestation L156–201
+ verify_attestation_signature function function verify_attestation_signature L48–73
~ musehub/services/musehub_mpay.py .py 20 symbols added
+ _PREFIX variable variable _PREFIX L31–31
+ _canonical_message function function _canonical_message L39–42
+ _decode_b64url function function _decode_b64url L34–36
+ _row_to_claim function function _row_to_claim L72–85
+ get_mpay_ledger function async_function get_mpay_ledger L166–200
+ AsyncSession import import AsyncSession L20–20
+ Ed25519PublicKey import import Ed25519PublicKey L18–18
+ MPayClaimRequest import import MPayClaimRequest L23–23
+ MPayClaimResponse import import MPayClaimResponse L23–23
+ MPayLedgerResponse import import MPayLedgerResponse L23–23
+ annotations import import annotations L12–12
+ base64 import import base64 L14–14
+ compute_mpay_claim_id import import compute_mpay_claim_id L22–22
+ datetime import import datetime L16–16
+ logging import import logging L15–15
+ text import import text L19–19
+ timezone import import timezone L16–16
+ logger variable variable logger L29–29
+ record_mpay_claim function async_function record_mpay_claim L88–163
+ verify_mpay_signature function function verify_mpay_signature L45–69
~ tests/test_profile_reimagination.py .py 91 symbols added
+ TestActivityCanvas class class TestActivityCanvas L700–736
+ test_empty_grid_length method method test_empty_grid_length L724–727
+ test_grid_index_future_returns_none method method test_grid_index_future_returns_none L716–722
+ test_grid_index_out_of_range_returns_none method method test_grid_index_out_of_range_returns_none L708–714
+ test_grid_index_today_is_last method method test_grid_index_today_is_last L701–706
+ test_grid_to_domain method method test_grid_to_domain L729–736
+ TestAttestationGenesisId class class TestAttestationGenesisId L99–128
+ test_canonical_form method method test_canonical_form L100–103
+ test_deterministic method method test_deterministic L105–108
+ test_distinct_attester method method test_distinct_attester L110–113
+ test_distinct_claim method method test_distinct_claim L120–123
+ test_distinct_subject method method test_distinct_subject L115–118
+ test_distinct_timestamp method method test_distinct_timestamp L125–128
+ TestAttestationService class class TestAttestationService L370–491
+ test_issue_attestation_idempotent method async_method test_issue_attestation_idempotent L423–458
+ test_issue_attestation_invalid_sig_raises method async_method test_issue_attestation_invalid_sig_raises L401–420
+ test_issue_attestation_valid_sig method async_method test_issue_attestation_valid_sig L372–398
+ test_revoke_attestation_not_found_raises method async_method test_revoke_attestation_not_found_raises L483–491
+ test_revoke_attestation_wrong_revoker_raises method async_method test_revoke_attestation_wrong_revoker_raises L461–480
+ TestAttestationSignatureVerification class class TestAttestationSignatureVerification L158–194
+ test_missing_prefix_fails method method test_missing_prefix_fails L177–185
+ test_valid_signature method method test_valid_signature L159–166
+ test_wrong_message_fails method method test_wrong_message_fails L168–175
+ test_wrong_public_key_fails method method test_wrong_public_key_fails L187–194
+ TestMPayGenesisId class class TestMPayGenesisId L131–150
+ test_canonical_form method method test_canonical_form L132–135
+ test_deterministic method method test_deterministic L137–140
+ test_distinct_amount method method test_distinct_amount L142–145
+ test_distinct_nonce method method test_distinct_nonce L147–150
+ TestMPayService class class TestMPayService L499–586
+ test_record_claim_idempotent method async_method test_record_claim_idempotent L549–586
+ test_record_claim_invalid_sig_raises method async_method test_record_claim_invalid_sig_raises L528–546
+ test_record_claim_valid_sig method async_method test_record_claim_valid_sig L501–525
+ TestMPaySignatureVerification class class TestMPaySignatureVerification L202–228
+ test_missing_prefix_fails method method test_missing_prefix_fails L221–228
+ test_tampered_amount_fails method method test_tampered_amount_fails L212–219
+ test_valid_signature method method test_valid_signature L203–210
+ TestProfileManifestBuilder class class TestProfileManifestBuilder L594–692
+ _make_identity method method _make_identity L595–624
+ test_manifest_human_fields method async_method test_manifest_human_fields L638–654
+ test_manifest_mpay_totals_passed_through method async_method test_manifest_mpay_totals_passed_through L676–692
+ test_manifest_org_fields method async_method test_manifest_org_fields L657–673
+ test_manifest_returns_none_for_unknown_handle method async_method test_manifest_returns_none_for_unknown_handle L627–635
+ TestPydanticSchemas class class TestPydanticSchemas L236–362
+ _make_repo_summary method method _make_repo_summary L237–246
+ test_activity_domain_grid_length method method test_activity_domain_grid_length L292–295
+ test_attestation_badge_claim_type method method test_attestation_badge_claim_type L310–322
+ test_attestation_response method method test_attestation_response L297–308
+ test_mpay_claim_response method method test_mpay_claim_response L324–337
+ test_mpay_ledger_totals method method test_mpay_ledger_totals L339–362
+ test_profile_manifest_agent method method test_profile_manifest_agent L262–278
+ test_profile_manifest_human method method test_profile_manifest_human L248–260
+ test_profile_manifest_org method method test_profile_manifest_org L280–290
+ _AMOUNT_NANO variable variable _AMOUNT_NANO L56–56
+ _ATTESTER variable variable _ATTESTER L49–49
+ _ATTESTER2 variable variable _ATTESTER2 L52–52
+ _CLAIM variable variable _CLAIM L51–51
+ _NONCE_HEX variable variable _NONCE_HEX L57–57
+ _RECIPIENT variable variable _RECIPIENT L55–55
+ _SENDER variable variable _SENDER L54–54
+ _SUBJECT variable variable _SUBJECT L50–50
+ _TS variable variable _TS L48–48
+ _make_ed25519_pair function function _make_ed25519_pair L60–65
+ _sign_attest function function _sign_attest L68–78
+ _sign_mpay function function _sign_mpay L81–91
+ ActivityDomain import import ActivityDomain L25–25
+ AsyncMock import import AsyncMock L19–19
+ AttestationBadge import import AttestationBadge L25–25
+ AttestationRequest import import AttestationRequest L25–25
+ AttestationResponse import import AttestationResponse L25–25
+ Ed25519PrivateKey import import Ed25519PrivateKey L22–22
+ MPayClaimRequest import import MPayClaimRequest L25–25
+ MPayClaimResponse import import MPayClaimResponse L25–25
+ MPayLedgerResponse import import MPayLedgerResponse L25–25
+ MagicMock import import MagicMock L19–19
+ OrgManifest import import OrgManifest L25–25
+ ProfileManifest import import ProfileManifest L25–25
+ ProfileRepoSummary import import ProfileRepoSummary L25–25
+ TrustChainEntry import import TrustChainEntry L25–25
+ annotations import import annotations L14–14
+ attestation_to_badge import import attestation_to_badge L38–38
+ base64 import import base64 L16–16
+ compute_attestation_id import import compute_attestation_id L24–24
+ compute_mpay_claim_id import import compute_mpay_claim_id L24–24
+ datetime import import datetime L18–18
+ json import import json L17–17
+ patch import import patch L19–19
+ pytest import import pytest L21–21
+ timezone import import timezone L18–18
+ verify_attestation_signature import import verify_attestation_signature L38–38
+ verify_mpay_signature import import verify_mpay_signature L42–42
~ musehub/core/genesis.py .py 2 symbols added
+ compute_attestation_id function function compute_attestation_id L439–452
+ compute_mpay_claim_id function function compute_mpay_claim_id L459–473
~ musehub/db/musehub_models.py .py 2 symbols added, 1 symbol modified
+ MusehubAttestation class class MusehubAttestation L1260–1297
+ MusehubMPayClaim class class MusehubMPayClaim L1300–1341
~ musehub/main.py .py 1 symbol added
+ api_profiles_router import import api_profiles_router L64–64
~ musehub/models/musehub.py .py 11 symbols added
+ ActivityDomain class class ActivityDomain L2914–2924
+ AttestationBadge class class AttestationBadge L2927–2934
+ AttestationListResponse class class AttestationListResponse L2855–2860
+ AttestationRequest class class AttestationRequest L2824–2839
+ AttestationResponse class class AttestationResponse L2842–2852
+ MPayClaimRequest class class MPayClaimRequest L2868–2880
+ MPayClaimResponse class class MPayClaimResponse L2883–2896
+ MPayLedgerResponse class class MPayLedgerResponse L2899–2906
+ OrgManifest class class OrgManifest L2945–2950
+ ProfileManifest class class ProfileManifest L2953–3000
+ TrustChainEntry class class TrustChainEntry L2937–2942
~ musehub/services/musehub_profile.py .py 17 symbols added, 7 symbols modified
+ _GRID_DAYS variable variable _GRID_DAYS L260–260
+ _build_code_grid function async_function _build_code_grid L275–301
+ _build_mist_domain_grid function async_function _build_mist_domain_grid L360–385
+ _build_mpay_grid function async_function _build_mpay_grid L338–357
+ _build_prose_grid function async_function _build_prose_grid L304–335
+ _build_trust_chain function async_function _build_trust_chain L422–456
+ _date_to_grid_index function function _date_to_grid_index L267–272
+ _empty_grid function function _empty_grid L263–264
+ _grid_to_domain function function _grid_to_domain L388–391
+ build_activity_canvas function async_function build_activity_canvas L394–415
+ build_profile_manifest function async_function build_profile_manifest L463–519
+ ActivityDomain import import ActivityDomain L17–17
+ AttestationBadge import import AttestationBadge L17–17
+ OrgManifest import import OrgManifest L17–17
+ ProfileManifest import import ProfileManifest L17–17
+ TrustChainEntry import import TrustChainEntry L17–17
+ text import import text L12–12
~ desc
~ func
~ select
← Older Oldest on task/profile-reimagination
All commits
Newer → Latest on task/profile-reimagination

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