<feed xmlns='http://www.w3.org/2005/Atom'>
<title>claude-plugins-official.git/plugins/security-guidance/tests/test_record_files.py, branch bump/coderabbit</title>
<subtitle>Official Claude Code plugin directory
</subtitle>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/'/>
<entry>
<title>security-guidance: open the review records and markers through one helper</title>
<updated>2026-11-12T15:01:04+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-11-12T15:01:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=052eeb00464b9db2079325ae538356c49494fb1b'/>
<id>052eeb00464b9db2079325ae538356c49494fb1b</id>
<content type='text'>
The commit and push reviews keep two small records (sg-reviewed-shas,
sg-reviewed-diffs) and one marker per commit under review
(sg-inflight-&lt;sha&gt;) in the git directory.

The plugin should only read and write files it made itself; the session
state file is already written in a similar way. All three are now opened
through one helper, which takes a regular file with no second hard link that
is no larger than a record can be. Anything else at that path is replaced by
a new file when the record is about to be written, and passed over when it
is only read. A folder is left alone. The open never waits, and reads from a
record are capped. Anything old at a marker's path that is not such a file,
other than a folder, is removed without being opened.

Three more fixes on the same lines:

- sg-reviewed-shas was locked with a blocking flock just before the findings
  go out, so the findings waited for the lock, up to the hook's timeout. The
  hook now waits half a second and then appends without the lock, as it does
  where there is no flock.
- Bytes in that record that are not text ended the push review with a
  traceback. They now cost only their own row.
- The rewritten record was still in the buffer when the lock was released, so
  rows written by several sessions at once were lost. It is flushed first.

Cost: in a repository copied with hard links (cp -al) the records have two
names, so neither copy reads them. The first copy to write starts them
afresh, and commits reviewed before the copy may be reviewed once more.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The commit and push reviews keep two small records (sg-reviewed-shas,
sg-reviewed-diffs) and one marker per commit under review
(sg-inflight-&lt;sha&gt;) in the git directory.

The plugin should only read and write files it made itself; the session
state file is already written in a similar way. All three are now opened
through one helper, which takes a regular file with no second hard link that
is no larger than a record can be. Anything else at that path is replaced by
a new file when the record is about to be written, and passed over when it
is only read. A folder is left alone. The open never waits, and reads from a
record are capped. Anything old at a marker's path that is not such a file,
other than a folder, is removed without being opened.

Three more fixes on the same lines:

- sg-reviewed-shas was locked with a blocking flock just before the findings
  go out, so the findings waited for the lock, up to the hook's timeout. The
  hook now waits half a second and then appends without the lock, as it does
  where there is no flock.
- Bytes in that record that are not text ended the push review with a
  traceback. They now cost only their own row.
- The rewritten record was still in the buffer when the lock was released, so
  rows written by several sessions at once were lost. It is flushed first.

Cost: in a repository copied with hard links (cp -al) the records have two
names, so neither copy reads them. The first copy to write starts them
afresh, and commits reviewed before the copy may be reviewed once more.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
