Skip to content

Correct AGENTS.md on ImageRef locking - #542

Merged
davidbyttow merged 1 commit into
masterfrom
agents-md-lock-fix
Aug 8, 2026
Merged

Correct AGENTS.md on ImageRef locking#542
davidbyttow merged 1 commit into
masterfrom
agents-md-lock-fix

Conversation

@davidbyttow

@davidbyttow davidbyttow commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the inaccuracy Macroscope flagged on #541: AGENTS.md said ImageRef methods "guard with runtime.KeepAlive(r) and r.lock", implying general concurrency safety. In reality r.lock is taken only at lifecycle/ownership transitions (Close, SetKill, setImage, streaming materialize/save — verified via grep, those are the only five r.lock.Lock() sites); ordinary transform/export/metadata methods take no lock. The doc now says that plainly and warns against using one ImageRef from multiple goroutines.

🤖 Generated with Claude Code

Note

Correct ImageRef locking and concurrency documentation in AGENTS.md

Updates AGENTS.md to accurately describe ImageRef concurrency semantics. Clarifies that r.lock guards only lifecycle/ownership transitions (Close, SetKill, setImage, streaming materialize/save), while ordinary transform, export, and metadata methods do not take the lock and rely solely on runtime.KeepAlive(r). Explicitly documents that ImageRef is not safe for concurrent use and that no methods, including Close, may be called from multiple goroutines simultaneously.

Macroscope summarized 54f71e7.

r.lock only guards lifecycle transitions (Close, SetKill, setImage,
streaming materialize/save); ordinary methods take no lock, so state
plainly that an ImageRef is not safe for concurrent use rather than
implying general methods are mutex-guarded.

Flagged by Macroscope on #541.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@davidbyttow
davidbyttow merged commit 1159365 into master Aug 8, 2026
3 checks passed
@davidbyttow
davidbyttow deleted the agents-md-lock-fix branch August 8, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant