gabriel / muse public
feat patch feat/chess-domain-episode22 #1 / 1
AI Agent gabriel · 2 days ago · Sep 12, 2026 · Diff

feat: add chess domain plugin (Episode 22 finale)

A chess game as a position-addressed, LCS-diffable sequence of moves. Built live for Build With Muse, Episode 22 ("Build Something Weird With Muse"), following the exact pattern established by the Todo plugin (Episode 06). Two branches diverging after a shared opening produce a real merge conflict with conflict_type='variation' — the same term chess players already use for this exact situation.

13 tests covering schema, snapshot, diff (LCS insert/delete at correct positions), merge (clean extension + genuine variation conflict), and drift.

sha256:78a3b3b54d1ef5e0d4d65eb8506437b2c5083714d4bee38326fe19411059fa53 sha
+60 ~1 symbols
4 changed · 1191 in snapshot files
sha256:84d840708db3acfa5a9fb9dde080c9e3c57b67465711e4ac12bdd8587c71a632 snapshot
+60
symbols added
~1
symbol modified
4
files changed
1191
files in snapshot
0
dead code introduced
Semantic Changes 61 symbols
~ muse/plugins/chess/plugin.py .py 32 symbols added
+ ChessPlugin class class ChessPlugin L76–234
+ apply method method apply L209–212
+ diff method method diff L90–132
+ drift method method drift L199–207
+ merge method method merge L134–197
+ schema method method schema L214–234
+ snapshot method method snapshot L79–88
+ _DOMAIN_NAME variable variable _DOMAIN_NAME L38–38
+ _GAME_FILE variable variable _GAME_FILE L39–39
+ _load_moves function function _load_moves L42–55
+ _move_content_id function function _move_content_id L68–73
+ _write_moves function function _write_moves L58–65
+ ConflictRecord import import ConflictRecord L24–24
+ DeleteOp import import DeleteOp L24–24
+ DomainSchema import import DomainSchema L22–22
+ DriftReport import import DriftReport L24–24
+ InsertOp import import InsertOp L24–24
+ LiveState import import LiveState L24–24
+ Manifest import import Manifest L23–23
+ MergeResult import import MergeResult L24–24
+ PatchOp import import PatchOp L24–24
+ SequenceMatcher import import SequenceMatcher L18–18
+ SequenceSchema import import SequenceSchema L22–22
+ SnapshotManifest import import SnapshotManifest L24–24
+ StateDelta import import StateDelta L24–24
+ StateSnapshot import import StateSnapshot L24–24
+ StructuredDelta import import StructuredDelta L24–24
+ __version__ import import __version__ L20–20
+ blob_id import import blob_id L23–23
+ pathlib import import pathlib L17–17
+ read_object import import read_object L21–21
+ write_object import import write_object L21–21
~ tests/test_chess_plugin.py .py 27 symbols added
+ TestDiff class class TestDiff L57–100
+ test_a_different_next_move_is_a_delete_plus_insert_at_same_position method method test_a_different_next_move_is_a_delete_plus_insert_at_same_position L90–100
+ test_appending_moves_produces_insert_ops_at_correct_positions method method test_appending_moves_produces_insert_ops_at_correct_positions L78–88
+ test_no_change_when_hashes_match method method test_no_change_when_hashes_match L58–62
+ test_top_level_op_is_keyed_by_file_not_move method method test_top_level_op_is_keyed_by_file_not_move L64–76
+ TestDrift class class TestDrift L150–167
+ test_clean_tree_has_no_drift method method test_clean_tree_has_no_drift L162–167
+ test_uncommitted_move_is_detected method method test_uncommitted_move_is_detected L151–160
+ TestMerge class class TestMerge L103–147
+ test_identical_continuations_merge_with_no_conflict method method test_identical_continuations_merge_with_no_conflict L136–147
+ test_one_side_extending_the_game_merges_cleanly method method test_one_side_extending_the_game_merges_cleanly L104–115
+ test_two_different_next_moves_is_a_real_variation_conflict method method test_two_different_next_moves_is_a_real_variation_conflict L117–134
+ TestSchema class class TestSchema L33–41
+ test_merge_mode_is_three_way method method test_merge_mode_is_three_way L40–41
+ test_top_level_is_position_addressed_sequence method method test_top_level_is_position_addressed_sequence L34–38
+ TestSnapshot class class TestSnapshot L44–54
+ test_empty_repo_has_no_files method method test_empty_repo_has_no_files L45–48
+ test_object_id_uses_canonical_blob_format method method test_object_id_uses_canonical_blob_format L50–54
+ _commit_moves function function _commit_moves L23–30
+ _repo function function _repo L18–20
+ ChessPlugin import import ChessPlugin L15–15
+ _GAME_FILE import import _GAME_FILE L15–15
+ annotations import import annotations L9–9
+ blob_id import import blob_id L14–14
+ pathlib import import pathlib L11–11
+ read_object import import read_object L13–13
+ write_object import import write_object L13–13
~ muse/plugins/registry.py .py 1 symbol added, 1 symbol modified
+ ChessPlugin import import ChessPlugin L24–24
Files Changed
+3 ~1
1191 in snapshot
← Older Oldest on feat/chess-domain-episode22
All commits
Newer → Latest on feat/chess-domain-episode22

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