tracecraft
tracecraft copied to clipboard
claim TTL + heartbeat: crashed agents must not hold locks forever
Problem
Both are listed in README limitations today:
- A claim has no TTL — if the claiming agent crashes, the step is locked until a human runs
complete --force. - The agent heartbeat is written once at
initand never refreshed, soagentsshows who registered, not who's alive.
Proposal
claim --ttl <seconds>writesexpires_atintoclaim.json.- Readers treat an expired claim as
pendingagain — preserving the existing crash-window invariant (claim.json present + status.json missing = in_progress by the claimer) for unexpired claims. - Takeover of an expired claim uses a conditional delete (
If-Matchon the stale claim's ETag) so two waiting agents can't both seize it. S3-compatible backends only; on HuggingFace takeover stays best-effort, same as claiming. - Heartbeat refresh on every CLI call (cheap single put), so
agentsbecomes trustworthy. - Extend the contention benchmark with TTL-expiry races before calling it done.