muse_registry.py
file-level
1
files
1
commits
0
hotspots
0
🧊 dead
0
💥 blast risk
| 1 | """Optional Muse agent-key registry seam (§P0.4 / §P0.7). |
| 2 | |
| 3 | The kit verifies signatures; Muse owns key custody. Under Muse-backed regimes, |
| 4 | ``human_ref`` may resolve via an injected registry in tests or future adapters. |
| 5 | """ |
| 6 | |
| 7 | from __future__ import annotations |
| 8 | |
| 9 | from typing import Protocol |
| 10 | |
| 11 | |
| 12 | class MuseAgentKeyRegistry(Protocol): |
| 13 | """Resolve an agent public key from a human owner reference.""" |
| 14 | |
| 15 | def resolve_pubkey(self, *, human_ref: str, agent_id: str) -> str | None: |
| 16 | """Return ``ed25519:<base64>`` pubkey token or None when unknown.""" |
| 17 | |
| 18 | |
| 19 | class NullMuseAgentKeyRegistry: |
| 20 | """Default registry: no Muse lookup (entry-embedded pubkey only).""" |
| 21 | |
| 22 | def resolve_pubkey(self, *, human_ref: str, agent_id: str) -> str | None: |
| 23 | return None |