Skip to content

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

Python

merge: feat/prime-413-locks into integration/prime-batch

Rach Pradhanf331b51121c7
diff --cc CHANGELOG.md
index 2280c316,c23dfdd7..bba6d94e
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -12,19 -12,18 +12,31 @@@ current is part of cutting a release
## v0.0.241 (unreleased)
+ - Cross-process locks stopped trusting a bare pid (#413): an owner record now
+ carries the holder's process START identity next to its pid (`/proc/<pid>/stat`
+ field 22 on Linux, `proc_pidinfo` on macOS, `GetProcessTimes` on Windows), so
+ liveness is "the pid is alive AND it is still the same process". A recycled
+ pid can no longer look like a live owner forever, and a crashed holder's lock
+ is reclaimed because its identity provably mismatches rather than because a
+ timeout guessed. A record written by an older graff carries no identity and
+ keeps the pid-only contract exactly as before, so an in-flight lock is never
+ bricked, and an identity that cannot be read fails safe: held, never stolen.
+ The #320 worktree lease gets the producer it was missing, and a session save
+ on a filesystem with no working locks (#289) now coordinates through an owner
+ record instead of racing unguarded.
+- A no-progress `eval` is no longer paid for (#412). A goal/loop run
+ re-verifies on every continuation, so a model that has edited nothing since
+ the last RED re-ran the whole `--eval` command — plus a `--judge` model call,
+ plus 1500 bytes of output tail — to re-derive a verdict that could not have
+ changed. graff now fingerprints the verification before running it (the eval
+ command text, `git status --porcelain -z -uall`, `git diff --binary HEAD`,
+ and the contents of every untracked file, since the first two are blind to an
+ untracked edit); identical to the tree the last verification failed on means
+ the verifier is not run at all. The attempt still counts, so a stuck loop
+ converges on its iteration cap instead of spinning for free, and the model is
+ steered at the real blocker: the workspace has not changed, edit something
+ first. Fail-open throughout — no repo, no git, a timed-out or truncated
+ probe, an unreadable file all read as "changed" and the verifier runs.
## v0.0.240 (2026-08-06)
diff --cc src/test_hooks.zig
index 5df7ef66,a7ac6a54..033f8746
--- a/src/test_hooks.zig
+++ b/src/test_hooks.zig
@@@ -130,10 -130,12 +130,16 @@@ const credential_store = @import("crede
const engine_events = @import("engine_events.zig");
const engine_sink = @import("engine_sink.zig");
+// #412: the worktree fingerprint behind the no-progress verify guard.
+// agent_eval.zig reaches it through a CALL only, which analyses nothing.
+const verify_fingerprint = @import("verify_fingerprint.zig");
+
+ // #413: process START identity, the half of a lock owner record a recycled pid
+ // cannot forge. session_lock.zig and worktree_lease.zig reach it only through
+ // calls, and it is the kind of module whose tests must never go quiet: every
+ // cross-process lock in graff decides "stale or held" with it.
+ const proc_identity = @import("proc_identity.zig");
+
test {
_ = learn_holdout;
_ = learn_receipt;
@@@ -173,7 -175,7 +179,8 @@@
_ = credential_store;
_ = engine_events;
_ = engine_sink;
+ _ = verify_fingerprint;
+ _ = proc_identity;
_ = escalation;
_ = escalation_tests;
_ = edit_contract;