Answer stability round 1: 0 🔴, 2 🟡 (0 misread); refuse a release cloned in the person's own Claude home, and bound build-release's start

This commit is contained in:
2026-12-04 07:53:50 +01:00
parent 1940722b16
commit 018d45aa6e
4 changed files with 33 additions and 15 deletions
+4 -1
View File
@@ -33,7 +33,7 @@ class Git(typing.Protocol):
def unready(home: pathlib.Path, clone: pathlib.Path, reports: pathlib.Path, own: pathlib.Path, claude: Claude, git: Git) -> str | None:
"""Builds the home from clone, or refreshes it where the clone's commit or the reports folder changed since. own is the person's own Claude home, whose instructions the home keeps out. Then why a claude cannot run in the home yet, said for the person to act on; None where one can."""
"""Builds the home from clone, or refreshes it where the clone's commit or the reports folder changed since; own is the person's own Claude home, whose instructions the home keeps out. Then says why a claude cannot run in the home yet, said for the person to act on; None where one can."""
try:
built = refreshed(home, clone, reports, own, claude, git)
if isinstance(built, Failure):
@@ -71,6 +71,9 @@ def printed(done: subprocess.CompletedProcess[str]) -> str:
def refreshed(home: pathlib.Path, clone: pathlib.Path, reports: pathlib.Path, own: pathlib.Path, claude: Claude, git: Git) -> Failure | None:
# The home links to the clone's rules/, and Claude Code applies the exclusion of own's files to a link's target too: a clone in own would run without its rules.
if clone.resolve().is_relative_to(own.resolve()):
return Failure(f"the release is cloned in your own Claude home, {own}, whose instructions the loop keeps out; clone it elsewhere, as README.md → Install says")
commit = git("rev-parse", "HEAD", cwd=str(clone))
if isinstance(commit, Failure):
return commit
+8
View File
@@ -77,6 +77,14 @@ class Home(unittest.TestCase):
self.assertEqual(self.settings()["claudeMdExcludes"], [f"{self.own}/**"])
def test_a_clone_in_the_persons_own_home_stops_since_the_exclusion_would_drop_the_setups_rules(self) -> None:
for own in (self.clone, self.clone.parent):
with self.subTest(own=own):
self.own = own
self.assertEqual(self.unready(), f"could not build the loop's Claude home, {self.home}: the release is cloned in your own Claude home, {own}, whose instructions the loop keeps out; clone it elsewhere, as README.md → Install says")
self.assertFalse((self.home / "settings.json").exists())
def test_a_moved_reports_folder_refreshes_the_home(self) -> None:
self.unready()
self.reports = self.temp / "elsewhere" / "build-release" / "larv-review"