fix(8321): a .grimoire marker that disagrees with the repo's binding is named at session start
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Failing after 1m58s
CI & Build / integration (push) Successful in 1m58s
CI & Build / Build & push image (push) Skipped
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Failing after 1m58s
CI & Build / integration (push) Successful in 1m58s
CI & Build / Build & push image (push) Skipped
A marker copied along with a repo outlived the project it was written for: the Throne folder's marker still named project 38 after the split, so every hook held the session to Cartographer and writes to Throne stopped on the project fence, with nothing saying why. The SessionStart hook now sends the remote beside a marker's project_id. The marker still decides the project; /context also resolves the remote's binding, and when it names a different project the context says which project each names and how to fix the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -52,3 +52,22 @@ def test_the_fallback_is_a_first_step_not_an_option(tmp_path):
|
||||
def test_a_marker_names_the_exact_call(tmp_path):
|
||||
out = run_hook(tmp_path, DEAD, marker_project=31)
|
||||
assert "Start by calling `enter_project(31)`" in out
|
||||
|
||||
|
||||
def test_a_marker_sends_the_remote_beside_it_so_a_disagreement_can_be_said(tmp_path):
|
||||
"""The marker decides the project, but a marker copied along with a repo
|
||||
can outlive the project it was written for. The remote goes too, so the
|
||||
server can compare it with the repo's binding; a folder outside any repo
|
||||
sends the marker alone."""
|
||||
from tests.helpers import http_sink
|
||||
|
||||
need_tools("bash", "curl", "awk", "git")
|
||||
subprocess.run(["git", "init", "-q", str(tmp_path)], check=True)
|
||||
subprocess.run(["git", "-C", str(tmp_path), "remote", "add", "origin",
|
||||
"https://git.example.com/owner/split-off.git"], check=True)
|
||||
with http_sink(b'{"context":"","project":null}') as (port, seen):
|
||||
url = f"http://127.0.0.1:{port}"
|
||||
run_hook(tmp_path, url, marker_project=38)
|
||||
ask = seen[0]
|
||||
assert ask["project_id"] == ["38"]
|
||||
assert ask["repo"] == ["https://git.example.com/owner/split-off.git"]
|
||||
|
||||
Reference in New Issue
Block a user