gabriel / musehub public
feat patch task/identity-repo-phase3 #1 / 1
AI Agent gabriel · 142 days ago · May 1, 2026 · Diff

feat: Phase 3 — agent SPAWNS relationship committed to parent's identity repo

- Add _commit_spawns_relationship() in musehub_auth.py: looks up the parent's identity repo by handle and commits a RelationshipRecord at relationships/{parent}--spawns--{agent}.json. No-op when the parent has no identity repo (migration-period safety).

- Wire into register_agent_identity() immediately after the agent's own identity repo is created, so every spawn produces a tamper- evident SPAWNS edge in the parent's commit history.

- Add tests/test_identity_repo_phase3.py: 8 TDD regression tests covering: commit added to parent repo, relationship file at correct path, two agents produce two commits, agent's own repo untouched, from_handle/to_handle/edge_type content, no-op for ghost parent. All 8 GREEN (27/27 across all three phases).

Closes #19 Phase 3

sha256:24dff4f177aed149b76c2f7d95c5e8fb764ca41dae0a712565bcc522a5e8443d sha
+33 ~1 symbols
sha256:60b921fae3ed3d01976af44478572cf7f4a0621c58b59d0ea0dacfb3ea2e70f2 snapshot
+33
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 34 symbols
~ tests/test_identity_repo_phase3.py .py 32 symbols added
+ TestRelationshipRecordContent class class TestRelationshipRecordContent L191–234
+ test_relationship_record_edge_type_is_spawns method async_method test_relationship_record_edge_type_is_spawns L220–234
+ test_relationship_record_from_handle method async_method test_relationship_record_from_handle L192–204
+ test_relationship_record_to_handle method async_method test_relationship_record_to_handle L206–218
+ TestSpawnsNoOpWhenParentMissing class class TestSpawnsNoOpWhenParentMissing L242–271
+ test_spawning_without_parent_identity_repo_does_not_raise method async_method test_spawning_without_parent_identity_repo_does_not_raise L243–271
+ TestSpawnsRelationshipCreated class class TestSpawnsRelationshipCreated L128–183
+ test_agent_own_identity_repo_unchanged method async_method test_agent_own_identity_repo_unchanged L171–183
+ test_spawning_adds_commit_to_parent_identity_repo method async_method test_spawning_adds_commit_to_parent_identity_repo L129–140
+ test_spawning_two_agents_adds_two_commits_to_parent method async_method test_spawning_two_agents_adds_two_commits_to_parent L158–169
+ test_spawns_commit_contains_relationship_file method async_method test_spawns_commit_contains_relationship_file L142–156
+ _get_identity_repo_commits function async_function _get_identity_repo_commits L87–103
+ _keypair function function _keypair L38–41
+ _read_manifest_from_commit function async_function _read_manifest_from_commit L106–112
+ _read_object_bytes function async_function _read_object_bytes L115–120
+ _register_human function async_function _register_human L49–67
+ _sign_nonce function function _sign_nonce L44–46
+ _spawn_agent function async_function _spawn_agent L70–84
+ AsyncSession import import AsyncSession L24–24
+ Ed25519PrivateKey import import Ed25519PrivateKey L20–20
+ annotations import import annotations L15–15
+ create_challenge import import create_challenge L28–28
+ db import import db L27–27
+ encode_pubkey import import encode_pubkey L21–21
+ encode_sig import import encode_sig L21–21
+ json import import json L17–17
+ key_fingerprint import import key_fingerprint L26–26
+ pytest import import pytest L19–19
+ register_agent_identity import import register_agent_identity L28–28
+ relationship_path import import relationship_path L22–22
+ select import import select L23–23
+ verify_and_authenticate import import verify_and_authenticate L28–28
~ musehub/services/musehub_auth.py .py 1 symbol added, 1 symbol modified
+ _commit_spawns_relationship function async_function _commit_spawns_relationship L142–188
← Older Oldest on task/identity-repo-phase3
All commits
Newer → Latest on task/identity-repo-phase3

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