graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
Let shared-checkout claim fixtures skip auto-isolate
Cursor Agent0dc3ccd092b5
diff --git a/scripts/regression-release-297.py b/scripts/regression-release-297.pyindex d4de670c..3d100675 100644--- a/scripts/regression-release-297.py+++ b/scripts/regression-release-297.py@@ -145,7 +145,7 @@ def handoff(graff):env = {k: v for k, v in os.environ.items() if not k.endswith("_API_KEY")}env.update(HOME=temp, PATH=str(work / "bin") + os.pathsep + os.environ["PATH"], LMSTUDIO_API_KEY="local",GRAFF_NO_TELEMETRY="1", GRAFF_FLEET="off", GRAFF_NO_SMOLIFY="1", GRAFF_NO_CODEDB_GUARD="1",- GRAFF_ISOLATION_FALLBACK="1", NO_COLOR="1") # shared-checkout claim handoff; isolation stays default elsewhere+ GRAFF_AUTO_ISOLATE="0", NO_COLOR="1") # shared-checkout claim handoff; isolation stays default elsewhereprepare_review(work, ['notes.md'])acquired, primed, transferred = (threading.Event() for _ in range(3))def peer(action, kind="publication", key="fixture", **extra):diff --git a/scripts/test-claim-lifecycle.py b/scripts/test-claim-lifecycle.pyindex 87b64cc1..61c3df57 100644--- a/scripts/test-claim-lifecycle.py+++ b/scripts/test-claim-lifecycle.py@@ -85,7 +85,7 @@ def run(binary, recovery, evidence):env = {k:v for k,v in os.environ.items() if not k.endswith('_API_KEY')}env.update(HOME=temp, LMSTUDIO_API_KEY='local', GRAFF_NO_TELEMETRY='1',GRAFF_FLEET='off', GRAFF_NO_SMOLIFY='1', GRAFF_NO_CODEDB_GUARD='1',- GRAFF_ISOLATION_FALLBACK='1')+ GRAFF_AUTO_ISOLATE='0')prepare(work, env, {'checks':'SUCCESS', 'runs':'success', 'new_runs':'success', 'head_branch':'fixture'})subprocess.run(['git','init','--bare','-q',str(work/'remote.git')], check=True, timeout=10)subprocess.run(['git','remote','add','origin',str(work/'remote.git')], cwd=work, check=True, timeout=10)@@ -181,7 +181,7 @@ def independent_issue(binary, evidence):env = {k:v for k,v in os.environ.items() if not k.endswith('_API_KEY')}env.update(HOME=temp, LMSTUDIO_API_KEY='local', GRAFF_NO_TELEMETRY='1',GRAFF_FLEET='off', GRAFF_NO_SMOLIFY='1', GRAFF_NO_CODEDB_GUARD='1',- GRAFF_ISOLATION_FALLBACK='1')+ GRAFF_AUTO_ISOLATE='0')prepare(work,env,{'checks':'SUCCESS'})owner = caller = Nonemodel.start(1234)diff --git a/scripts/test-claim-repository.py b/scripts/test-claim-repository.pyindex f9cd943b..a835bdb0 100644--- a/scripts/test-claim-repository.py+++ b/scripts/test-claim-repository.py@@ -94,7 +94,7 @@ def run_case(binary, name, case, evidence):env = {k: v for k, v in os.environ.items() if not k.endswith('_API_KEY')}env.update(HOME=temp, LMSTUDIO_API_KEY='local', GRAFF_NO_TELEMETRY='1',GRAFF_FLEET='off', GRAFF_NO_SMOLIFY='1', GRAFF_NO_CODEDB_GUARD='1',- GRAFF_ISOLATION_FALLBACK='1')+ GRAFF_AUTO_ISOLATE='0')state = dict(checks='SUCCESS', head_branch='feature', pr_unavailable=case.get('pr_unavailable', False))state['wait_release'] = case.get('wait_release', False)if 'head_repo' in case: state['head_repo'] = case['head_repo']diff --git a/src/session_start.zig b/src/session_start.zigindex c44bd8ca..d30c0bbe 100644--- a/src/session_start.zig+++ b/src/session_start.zig@@ -140,7 +140,7 @@ pub fn setupWorktreeAndBanner(}}var isolated: ?task_workspace.Workspace = null;- if (flags.worktree_flag == null) {+ if (flags.worktree_flag == null and !task_workspace.envSkipAutoIsolate(environ_map.get("GRAFF_AUTO_ISOLATE"))) {switch (task_workspace.maybeAutoIsolate(gpa,io,diff --git a/src/task_workspace.zig b/src/task_workspace.zigindex 354db876..e5c660b8 100644--- a/src/task_workspace.zig+++ b/src/task_workspace.zig@@ -179,6 +179,12 @@ pub fn envIsolationFallback(val: ?[]const u8) bool {return std.mem.eql(u8, v, "1") or std.mem.eql(u8, v, "true") or std.mem.eql(u8, v, "yes");}+/// Shared-checkout fixtures / explicit same-tree work. Default remains isolate.+pub fn envSkipAutoIsolate(val: ?[]const u8) bool {+ const v = val orelse return false;+ return std.mem.eql(u8, v, "0") or std.mem.eql(u8, v, "off") or std.mem.eql(u8, v, "false");+}+fn absPath(io: Io, arena: Allocator, path: []const u8) ![]const u8 {var buf: [4096]u8 = undefined;const n = Io.Dir.cwd().realPathFile(io, path, &buf) catch return arena.dupe(u8, path);@@ -463,6 +469,10 @@ test "preferRemoteBase: explicit wins, then origin, then empty (local HEAD)" {try std.testing.expect(envIsolationFallback("true"));try std.testing.expect(!envIsolationFallback(null));try std.testing.expect(!envIsolationFallback("0"));+ try std.testing.expect(envSkipAutoIsolate("0"));+ try std.testing.expect(envSkipAutoIsolate("off"));+ try std.testing.expect(!envSkipAutoIsolate(null));+ try std.testing.expect(!envSkipAutoIsolate("1"));}test "create: worktree starts from the remote base, not a stale local HEAD" {