Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Merge worktree isolation onto the 0.0.302.2 line

Cursor Agent3a23c003deed
diff --cc scripts/regression-release-297.py
index 4777c8be,3d100675..0fac97b6
--- a/scripts/regression-release-297.py
+++ b/scripts/regression-release-297.py
@@@ -20,9 -20,8 +20,9 @@@ ROOT = Path(__file__).resolve().parents
sys.path.insert(0, str(ROOT / "scripts" / "eval"))
from mock_model import ScriptedModel
from process_guard import run as bounded_run
+from claim_ledger import path as claim_ledger_path
- from github_fixture import GH, prepare_review
+ from github_fixture import GH, claim_ledger, prepare_review
def tool(command):
@@@ -146,7 -145,7 +146,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_ACCORD="0", NO_COLOR="1")
- GRAFF_AUTO_ISOLATE="0", NO_COLOR="1") # shared-checkout claim handoff; isolation stays default elsewhere
++ GRAFF_ACCORD="0", GRAFF_AUTO_ISOLATE="0", NO_COLOR="1")
prepare_review(work, ['notes.md'])
acquired, primed, transferred = (threading.Event() for _ in range(3))
def peer(action, kind="publication", key="fixture", **extra):
diff --cc scripts/test-claim-lifecycle.py
index 46a1d043,ca8e94ea..4fef2b89
--- a/scripts/test-claim-lifecycle.py
+++ b/scripts/test-claim-lifecycle.py
@@@ -12,9 -12,8 +12,9 @@@ import tempfil
import threading
import time
sys.path.insert(0, str(Path(__file__).resolve().parent / 'eval'))
- from github_fixture import prepare
+ from github_fixture import claim_ledger, prepare
from mock_model import ScriptedModel
+from claim_ledger import path as claim_ledger_path
def tool(name, **arguments):
@@@ -84,8 -83,9 +84,9 @@@ def run(binary, recovery, evidence)
with tempfile.TemporaryDirectory(prefix='graff-claim-life-') as temp:
work = Path(temp)
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',
+ env.update(HOME=temp, LMSTUDIO_API_KEY='local', GRAFF_NO_TELEMETRY='1', GRAFF_ACCORD='0',
- GRAFF_FLEET='off', GRAFF_NO_SMOLIFY='1', GRAFF_NO_CODEDB_GUARD='1')
+ GRAFF_FLEET='off', GRAFF_NO_SMOLIFY='1', GRAFF_NO_CODEDB_GUARD='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)
@@@ -113,18 -113,20 +114,23 @@@
prefix = [write, write, tool('bash',command='gh pr list --json number')]
model.caller_steps = prefix+[tool('bash',command=cmd) for cmd in commands+commands[:1]]
caller.prompt(label)
- observed = model.requests[first:]
+ def is_peer(req):
+ content = req['messages'][-1].get('content', '')
+ return isinstance(content, str) and content.startswith('[peer]')
+ observed = [req for req in model.requests[first:] if not is_peer(req)]
# Each successive request contains the prior actual tool result.
+ # `git add` is shared-tree presence, not an artifact claim.
for request in observed[4:]:
- content = request['messages'][-1].get('content', '')
- assert 'artifact claim held' in content, request['messages'][-1]
+ last = request['messages'][-1]
+ if last.get('role') != 'tool':
+ continue
+ content = last.get('content', '')
+ if content.strip() in ('', '(no output)'):
+ continue
+ assert 'artifact claim held' in content, last
assert '[]' in observed[3]['messages'][-1]['content']
assert (work/unrelated).read_text() == 'fixture'
- assert len(observed) == len(commands)+5, len(observed)
- assert subprocess.check_output(['git','diff','--cached','--name-only'],cwd=work,text=True) == ''
+ assert len(observed) >= len(commands)+5, len(observed)
assert subprocess.check_output(['git','rev-parse','HEAD'],cwd=work,text=True).strip() == initial
assert not (work/'mutations.jsonl').exists()
blocked_round('Attempt the claimed writes, then retry staging.')
@@@ -184,8 -185,9 +190,9 @@@ def independent_issue(binary, evidence)
with tempfile.TemporaryDirectory(prefix='graff-claim-issue-') as temp:
work = Path(temp)
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',
+ env.update(HOME=temp, LMSTUDIO_API_KEY='local', GRAFF_NO_TELEMETRY='1', GRAFF_ACCORD='0',
- GRAFF_FLEET='off', GRAFF_NO_SMOLIFY='1', GRAFF_NO_CODEDB_GUARD='1')
+ GRAFF_FLEET='off', GRAFF_NO_SMOLIFY='1', GRAFF_NO_CODEDB_GUARD='1',
+ GRAFF_AUTO_ISOLATE='0')
prepare(work,env,{'checks':'SUCCESS'})
owner = caller = None
model.start(1234)
diff --cc scripts/test-claim-repository.py
index ac2beef9,a835bdb0..589d8c01
--- a/scripts/test-claim-repository.py
+++ b/scripts/test-claim-repository.py
@@@ -12,9 -12,8 +12,9 @@@ import sy
import tempfile
import threading
sys.path.insert(0, str(Path(__file__).resolve().parent / 'eval'))
- from github_fixture import prepare, prepare_review
+ from github_fixture import claim_ledger, prepare, prepare_review
from mock_model import ScriptedModel
+from claim_ledger import path as claim_ledger_path
def tool(name, **arguments):
@@@ -93,8 -92,9 +93,9 @@@ def run_case(binary, name, case, eviden
work = Path(temp)
model.work = work
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',
+ env.update(HOME=temp, LMSTUDIO_API_KEY='local', GRAFF_NO_TELEMETRY='1', GRAFF_ACCORD='0',
- GRAFF_FLEET='off', GRAFF_NO_SMOLIFY='1', GRAFF_NO_CODEDB_GUARD='1')
+ GRAFF_FLEET='off', GRAFF_NO_SMOLIFY='1', GRAFF_NO_CODEDB_GUARD='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']