feat(6242): a repo renamed on its forge keeps its binding and shape ledger
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 1m13s
CI & Build / integration (push) Successful in 1m15s
CI & Build / Python tests (push) Successful in 2m8s
CI & Build / Build & push image (push) Successful in 28s

A binding and every row of its project's code-shape ledger are keyed by the
repo's remote. A rename on the forge changes the remote, so binding the new name
started an empty ledger beside the old one and left every judgment behind.

bind_repo now takes moved_from, the old remote. Its binding and the project's
ledger rows move to the new key in one transaction, and the reply says how many
shapes moved. The move is refused when:
- the old name isn't bound to that project;
- the new name is already bound;
- the project already has a ledger under the new name.

Each refusal leaves both names exactly as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 13:53:57 -04:00
co-authored by Claude Opus 5.5
parent a07547447f
commit 5ad1df8e0f
4 changed files with 186 additions and 3 deletions
+7
View File
@@ -376,6 +376,13 @@ def test_bind_repo_tool_takes_a_ref():
assert "ref" in tool.parameters.get("properties", {})
def test_bind_repo_tool_can_move_a_renamed_repo():
"""A repo renamed on its forge carries its ledger to the new name."""
from grimoire.mcp.server import build_mcp_server
tool = build_mcp_server()._tool_manager.get_tool("bind_repo")
assert "moved_from" in tool.parameters.get("properties", {})
def test_coverage_routes_are_registered():
from grimoire.app import create_app