gabriel / muse public
feat patch social task/social-domain-phase00 #1 / 1
AI Agent gabriel · 136 days ago · May 2, 2026 · Diff

feat(social): Phase 00 — SocialPlugin core domain plugin

Implements the full MuseDomainPlugin protocol for the social domain.

- muse/plugins/social/plugin.py: SocialPlugin with all 6 required methods (snapshot, diff, merge, drift, apply, schema). Merge is set-algebraic for posts/, reactions/, and graph/ namespaces; profile.json conflicts on concurrent edits from both branches. Follow graph uses per-person files (graph/follows/<handle>.json) so set-union is automatic. - muse/plugins/registry.py: registers SocialPlugin under domain key 'social' - tests/test_social_plugin.py: 43 tests across 6 classes — shape, schema, in-memory ops, merge semantics, and docstring coverage. All RED before implementation, all GREEN after.

sha256:fb3818f8b5ecd70c1f7d4b010eba61742d0c4994ef3abb96004a52dee9d12860 sha
+109 ~1 symbols
sha256:69f4a437bc06d4764632e76ffc46ecda3c63437cab3664c391e3ec41907152dc snapshot
+109
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 110 symbols
~ muse/plugins/social/plugin.py .py 28 symbols added
+ SocialPlugin class class SocialPlugin L61–343
+ apply method method apply L243–257
+ diff method method diff L131–151
+ drift method method drift L221–241
+ merge method method merge L153–219
+ schema method method schema L259–343
+ snapshot method method snapshot L80–129
+ _DOMAIN_NAME variable variable _DOMAIN_NAME L58–58
+ DimensionSpec import import DimensionSpec L41–41
+ DomainSchema import import DomainSchema L41–41
+ DriftReport import import DriftReport L48–48
+ LiveState import import LiveState L48–48
+ Manifest import import Manifest L47–47
+ MergeResult import import MergeResult L48–48
+ MuseDomainPlugin import import MuseDomainPlugin L48–48
+ SetSchema import import SetSchema L41–41
+ SnapshotManifest import import SnapshotManifest L48–48
+ StateDelta import import StateDelta L48–48
+ StateSnapshot import import StateSnapshot L48–48
+ __version__ import import __version__ L39–39
+ _stat import import _stat L37–37
+ annotations import import annotations L32–32
+ hashlib import import hashlib L34–34
+ load_cache import import load_cache L46–46
+ os import import os L35–35
+ pathlib import import pathlib L36–36
+ snapshot_diff import import snapshot_diff L40–40
+ plugin variable variable plugin L346–346
~ tests/test_social_plugin.py .py 80 symbols added
+ TestSocialPluginDocstrings class class TestSocialPluginDocstrings L366–379
+ test_class_has_docstring class method test_class_has_docstring L372–373
+ test_each_method_has_docstring method method test_each_method_has_docstring L375–379
+ test_module_has_docstring method method test_module_has_docstring L368–370
+ TestSocialPluginInMemory class class TestSocialPluginInMemory L163–234
+ test_apply_returns_live_state_unchanged method method test_apply_returns_live_state_unchanged L230–234
+ test_diff_add_post_produces_insert_op method method test_diff_add_post_produces_insert_op L175–180
+ test_diff_empty_to_empty_has_no_ops method method test_diff_empty_to_empty_has_no_ops L171–173
+ test_diff_multiple_adds method method test_diff_multiple_adds L196–204
+ test_diff_remove_post_produces_delete_op method method test_diff_remove_post_produces_delete_op L182–187
+ test_diff_replace_post_produces_replace_op method method test_diff_replace_post_produces_replace_op L189–194
+ test_drift_detects_deleted_post method method test_drift_detects_deleted_post L217–221
+ test_drift_detects_new_post method method test_drift_detects_new_post L211–215
+ test_drift_no_drift_when_identical method method test_drift_no_drift_when_identical L206–209
+ test_drift_report_has_summary method method test_drift_report_has_summary L223–228
+ test_snapshot_passes_through_manifest method method test_snapshot_passes_through_manifest L165–169
+ TestSocialPluginMerge class class TestSocialPluginMerge L241–359
+ test_merge_both_sides_add_different_posts_no_conflict method method test_merge_both_sides_add_different_posts_no_conflict L243–252
+ test_merge_both_sides_add_same_post_no_conflict method method test_merge_both_sides_add_same_post_no_conflict L254–262
+ test_merge_combined_scenario method method test_merge_combined_scenario L339–359
+ test_merge_concurrent_profile_edits_conflict method method test_merge_concurrent_profile_edits_conflict L289–297
+ test_merge_graph_following_set_union method method test_merge_graph_following_set_union L319–329
+ test_merge_only_left_adds_post method method test_merge_only_left_adds_post L264–270
+ test_merge_only_left_edits_profile_no_conflict method method test_merge_only_left_edits_profile_no_conflict L299–307
+ test_merge_only_right_adds_post method method test_merge_only_right_adds_post L272–278
+ test_merge_only_right_edits_profile_no_conflict method method test_merge_only_right_edits_profile_no_conflict L309–317
+ test_merge_reactions_set_union method method test_merge_reactions_set_union L280–287
+ test_merge_result_domain_is_social method method test_merge_result_domain_is_social L335–337
+ test_merge_returns_merge_result method method test_merge_returns_merge_result L331–333
+ TestSocialPluginSchema class class TestSocialPluginSchema L104–156
+ test_graph_dimension_independent method method test_graph_dimension_independent L141–143
+ test_posts_dimension_independent method method test_posts_dimension_independent L133–135
+ test_profile_dimension_not_independent method method test_profile_dimension_not_independent L145–147
+ test_reactions_dimension_independent method method test_reactions_dimension_independent L137–139
+ test_schema_description_non_empty method method test_schema_description_non_empty L155–156
+ test_schema_dimension_names method method test_schema_dimension_names L129–131
+ test_schema_domain_is_social method method test_schema_domain_is_social L115–116
+ test_schema_has_four_dimensions method method test_schema_has_four_dimensions L126–127
+ test_schema_is_json_serialisable method method test_schema_is_json_serialisable L149–153
+ test_schema_merge_mode_three_way method method test_schema_merge_mode_three_way L123–124
+ test_schema_returns_domain_schema method method test_schema_returns_domain_schema L106–113
+ test_schema_top_level_is_set method method test_schema_top_level_is_set L118–121
+ TestSocialPluginShape class class TestSocialPluginShape L79–97
+ test_domain_constant_is_social method method test_domain_constant_is_social L88–90
+ test_has_all_six_methods method method test_has_all_six_methods L84–86
+ test_registered_in_registry method method test_registered_in_registry L92–93
+ test_resolve_plugin_by_domain_returns_social_plugin method method test_resolve_plugin_by_domain_returns_social_plugin L95–97
+ test_satisfies_protocol method method test_satisfies_protocol L81–82
+ _FOLLOWING variable variable _FOLLOWING L63–63
+ _POST_A variable variable _POST_A L57–57
+ _POST_B variable variable _POST_B L58–58
+ _POST_C variable variable _POST_C L59–59
+ _PROFILE_V1 variable variable _PROFILE_V1 L60–60
+ _PROFILE_V2 variable variable _PROFILE_V2 L61–61
+ _REACTION_A variable variable _REACTION_A L62–62
+ _blob_id function function _blob_id L43–44
+ _empty_snap function function _empty_snap L53–54
+ _snap function function _snap L47–50
+ DimensionSpec import import DimensionSpec L34–34
+ DomainSchema import import DomainSchema L34–34
+ DriftReport import import DriftReport L25–25
+ MergeResult import import MergeResult L25–25
+ MuseDomainPlugin import import MuseDomainPlugin L25–25
+ SetSchema import import SetSchema L34–34
+ SnapshotManifest import import SnapshotManifest L25–25
+ SocialPlugin import import SocialPlugin L35–35
+ StateDelta import import StateDelta L25–25
+ StateSnapshot import import StateSnapshot L25–25
+ StructuredDelta import import StructuredDelta L25–25
+ annotations import import annotations L14–14
+ hashlib import import hashlib L16–16
+ inspect import import inspect L17–17
+ json import import json L18–18
+ pathlib import import pathlib L19–19
+ pytest import import pytest L23–23
+ registered_domains import import registered_domains L36–36
+ resolve_plugin_by_domain import import resolve_plugin_by_domain L36–36
+ sys import import sys L20–20
+ time import import time L21–21
+ plugin function function plugin L71–72
~ muse/plugins/registry.py .py 1 symbol added, 1 symbol modified
+ SocialPlugin import import SocialPlugin L29–29
← Older Oldest on task/social-domain-phase00
All commits
Newer → Latest on task/social-domain-phase00

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