Repository navigation
TR-1164: tests that exec or spawn a watch run on a scratch home - #585
Conversation
factory/review: changes at b530668The guard is the right shape: it wraps Verified (worktree at b530668, TARES*/FACTORY*/CLAUDE* stripped, fail keyring)
F1 (P2, blocking): the guard fails four suites, and CI is red on six shards
F2 (P3, non-blocking, tests/_crew_guard.py
|
factory/review: pass at 71f2ea6 (round 2)F1 is fixed: the four suites that probed with the real HOME now call Verified (worktree at 71f2ea6, TARES*/FACTORY*/CLAUDE* stripped, fail keyring)
Resolved: F1 fixed. F2 and F3 fixed, by documenting them in the docstring. Not run
|
Ticket: TR-1164
What changed
Tests that exec or spawn a watch could attach to the real ~/factory when a patch missed (the TR-1069 incident: a real watch started and live stations moved onto it).
test_crew_kit.pyenv_(line 744) is the first.tests/_crew_guard.pywrapsos.exec*andsubprocess.Popen. A start whose environment reaches the real home (HOME/USERPROFILE, FACTORY_CREW_HOME/FACTORY_HOME on ~/factory, or a crew process with no home) raisesRealHomeReached, is recorded, and an exit hook ends the run non-zero, so a broadexcept Exceptioncannot hide it. Tests' own exec/spawn stand-ins callcheck_exec.tests/test_crew_scratch_home.py(new, inci_list.txt, 26 checks): the guard's rules, the guard on the realrestart_selfandwatch.startwith the old kit environment, and a scan that fails any test file that can start a crew process without the guard.test_crew_watch_process.pychecks thatwatch()callsfollow_engineevery round, between the pid file claim and the steps (and not withonce=True).tares/orclaude-plugin/; bash engine untouched.Checks (scratch HOME, TARES_FACTORY_URL unset, PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring)
test_crew_*andtest_factory_*in ci_list pass;test_factory_mcpandtest_factory_deskonly fail with the station's own TARES_PROJECT set, and pass without it (not related).env_intest_crew_kit.py-> guard fails the run (exit 1, "no HOME or USERPROFILE ... no FACTORY_CREW_HOME"); restored, 121 passed.follow_enginecall removed fromwatch()-> the new check fails (87 passed, 1 failed); restored, 88 passed.check_ledgerok;check_port_drift origin/main HEADok.Assumptions
None.