Answer stability round 1: 1 🔴, 6 🟡 (2 misread); read the scoring rule from the clone, hand windows XDG_DATA_HOME, retry the home check where nobody watches, tell an unreadable sign-in status and settings file apart, and bound the claude commands that build the home
CI / tests (pull_request) Successful in 4m35s

This commit is contained in:
2026-12-04 02:45:02 +01:00
parent 71865e0479
commit 3519922f01
19 changed files with 153 additions and 69 deletions
+3 -3
View File
@@ -8,7 +8,7 @@ import pathlib
import typing
from failure import Failure
from loop_state.paths import Paths, XDG_CONFIG_HOME, XDG_STATE_HOME
from loop_state.paths import Paths, XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME
from transcript_archive.project_key import project_key
from agent_cycle import tmux
@@ -22,9 +22,9 @@ OWN = "BUILD_RELEASE_"
# A window gets the tmux server's environment, not the starting terminal's. With another XDG value than its starter's, a window would lock and write in other folders. So each is handed even where the starter lacks it, as empty: an empty value moves no folder.
def handed(env: typing.Mapping[str, str]) -> dict[str, str]:
"""The variables an entry point hands each window it starts: those of env that both entry points read, and the two that move the config folder and the state folder."""
"""The variables an entry point hands each window it starts: those of env that both entry points read, and the three that move the config folder, the state folder and the loop's Claude home."""
own = {name: value for name, value in env.items() if name.startswith(OWN)}
return {**own, XDG_CONFIG_HOME: env.get(XDG_CONFIG_HOME, ""), XDG_STATE_HOME: env.get(XDG_STATE_HOME, "")}
return {**own, **{name: env.get(name, "") for name in (XDG_CONFIG_HOME, XDG_STATE_HOME, XDG_DATA_HOME)}}
@contextlib.contextmanager
+4 -4
View File
@@ -10,12 +10,12 @@ from chunk_driver.claims import handed, LOCK, starting
class Handed(unittest.TestCase):
def test_hands_a_window_the_setups_own_variables_and_the_two_that_move_its_folders(self) -> None:
env = {"BUILD_RELEASE_JUDGE_MODEL": "judge", "XDG_CONFIG_HOME": "/configs", "XDG_STATE_HOME": "/state", "XDG_DATA_HOME": "/data", "PATH": "/bin"}
self.assertEqual(handed(env), {"BUILD_RELEASE_JUDGE_MODEL": "judge", "XDG_CONFIG_HOME": "/configs", "XDG_STATE_HOME": "/state"})
def test_hands_a_window_the_setups_own_variables_and_the_three_that_move_its_folders(self) -> None:
env = {"BUILD_RELEASE_JUDGE_MODEL": "judge", "XDG_CONFIG_HOME": "/configs", "XDG_STATE_HOME": "/state", "XDG_DATA_HOME": "/data", "XDG_CACHE_HOME": "/cache", "PATH": "/bin"}
self.assertEqual(handed(env), {"BUILD_RELEASE_JUDGE_MODEL": "judge", "XDG_CONFIG_HOME": "/configs", "XDG_STATE_HOME": "/state", "XDG_DATA_HOME": "/data"})
def test_hands_an_xdg_variable_the_starter_lacks_as_empty_so_the_tmux_servers_value_moves_no_folder(self) -> None:
self.assertEqual(handed({"PATH": "/bin", "XDG_STATE_HOME": "/state"}), {"XDG_CONFIG_HOME": "", "XDG_STATE_HOME": "/state"})
self.assertEqual(handed({"PATH": "/bin", "XDG_STATE_HOME": "/state"}), {"XDG_CONFIG_HOME": "", "XDG_STATE_HOME": "/state", "XDG_DATA_HOME": ""})
class Starting(unittest.TestCase):