gabriel / musehub public
feat BREAKING task/derived-agent-provisioning #1 / 1
AI Agent gabriel · 145 days ago · May 1, 2026 · Diff

feat: auto-provision derived agents with genesis identity on profile view

- compute_derived_agent_id(handle) added to genesis.py formula: sha256('agent_handle' NUL handle) — deterministic, verifiable - derived_agent_provisioner.py: ensure_agent_identity (upsert, idempotent) + provision_if_derived (hook for _resolve_identity) - profile view calls provision_if_derived when agent has no user_id → real identity row created, sigil route now resolves 200 - removed 'derived' eyebrow label from profile template - 23 TDD tests, all green

sha256:4528420e0c9faa3219cc1dc7f70f744cac753d307cbf12c13c598317827a2290 sha
+54 ~12 symbols
sha256:5c88680ebfcbbf2164b8431ab51cc420497dcf3e39a445cda3d51bcd0f4d1fd5 snapshot
+54
symbols added
~12
symbols modified
0
dead code introduced
Semantic Changes 66 symbols
+ _IdentityDict variable variable _IdentityDict L26–26
+ ensure_agent_identity function async_function ensure_agent_identity L29–58
+ Any import import Any L18–18
+ AsyncSession import import AsyncSession L21–21
+ MusehubIdentity import import MusehubIdentity L24–24
+ annotations import import annotations L15–15
+ compute_derived_agent_id import import compute_derived_agent_id L23–23
+ datetime import import datetime L17–17
+ select import import select L20–20
+ timezone import import timezone L17–17
+ provision_if_derived function async_function provision_if_derived L61–90
+ _CUSTOM_HANDLE variable variable _CUSTOM_HANDLE L36–36
+ _KNOWN_FIRST_SEEN variable variable _KNOWN_FIRST_SEEN L38–38
+ _OPUS_HANDLE variable variable _OPUS_HANDLE L35–35
+ _SONNET_HANDLE variable variable _SONNET_HANDLE L34–34
+ _expected_id function function _expected_id L41–44
+ ASGITransport import import ASGITransport L25–25
+ AsyncClient import import AsyncClient L25–25
+ AsyncMock import import AsyncMock L21–21
+ MagicMock import import MagicMock L21–21
+ annotations import import annotations L16–16
+ app import import app L28–28
+ datetime import import datetime L20–20
+ hashlib import import hashlib L18–18
+ patch import import patch L21–21
+ pytest import import pytest L23–23
+ pytest_asyncio import import pytest_asyncio L24–24
+ re import import re L19–19
+ select import import select L26–26
+ timezone import import timezone L20–20
+ test_avatar_route_serves_sigil_for_provisioned_agent function async_function test_avatar_route_serves_sigil_for_provisioned_agent L330–345
+ test_avatar_route_sigil_reflects_agent_archetype function async_function test_avatar_route_sigil_reflects_agent_archetype L349–367
+ test_avatar_sigil_is_deterministic_for_provisioned_agent function async_function test_avatar_sigil_is_deterministic_for_provisioned_agent L371–386
+ test_compute_derived_agent_id_differs_by_handle function function test_compute_derived_agent_id_differs_by_handle L101–105
+ test_compute_derived_agent_id_hex_part_is_64_chars function function test_compute_derived_agent_id_hex_part_is_64_chars L86–92
+ test_compute_derived_agent_id_is_deterministic function function test_compute_derived_agent_id_is_deterministic L95–98
+ test_compute_derived_agent_id_matches_known_formula function function test_compute_derived_agent_id_matches_known_formula L108–114
+ test_compute_derived_agent_id_returns_sha256_prefixed function function test_compute_derived_agent_id_returns_sha256_prefixed L79–83
+ test_ensure_agent_identity_creates_row function async_function test_ensure_agent_identity_creates_row L123–140
+ test_ensure_agent_identity_different_handles_create_separate_rows function async_function test_ensure_agent_identity_different_handles_create_separate_rows L235–251
+ test_ensure_agent_identity_importable function function test_ensure_agent_identity_importable L62–65
+ test_ensure_agent_identity_is_idempotent function async_function test_ensure_agent_identity_is_idempotent L201–216
+ test_ensure_agent_identity_model_none_is_accepted function async_function test_ensure_agent_identity_model_none_is_accepted L186–197
+ test_ensure_agent_identity_returns_existing_row_unchanged function async_function test_ensure_agent_identity_returns_existing_row_unchanged L220–231
+ test_ensure_agent_identity_sets_correct_identity_id function async_function test_ensure_agent_identity_sets_correct_identity_id L144–154
+ test_ensure_agent_identity_sets_identity_type_agent function async_function test_ensure_agent_identity_sets_identity_type_agent L158–168
+ test_ensure_agent_identity_stores_agent_model function async_function test_ensure_agent_identity_stores_agent_model L172–182
+ test_genesis_module_exports_compute_derived_agent_id function function test_genesis_module_exports_compute_derived_agent_id L52–55
+ test_provision_if_derived_importable function function test_provision_if_derived_importable L68–71
+ test_provision_if_derived_provisions_derived_agent function async_function test_provision_if_derived_provisions_derived_agent L260–283
+ test_provision_if_derived_skips_already_registered function async_function test_provision_if_derived_skips_already_registered L306–321
+ test_provision_if_derived_skips_non_agent function async_function test_provision_if_derived_skips_non_agent L287–302
+ test_provisioner_module_importable function function test_provisioner_module_importable L58–59
~ musehub/core/genesis.py .py 1 symbol added
+ compute_derived_agent_id function function compute_derived_agent_id L53–63
← Older Oldest on task/derived-agent-provisioning
All commits
Newer → Latest on task/derived-agent-provisioning

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