| Age | Commit message (Collapse) | Author |
|
The hooks run git in the session's repository and in those the session
moves to. A repository other than the session's own is now skipped when
its own config has settings that change what git runs. An index copy made
in another repository holds only the entries for files.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Co-authored-by: mhegazy <mhegazy@anthropic.com>
# Conflicts:
# plugins/security-guidance/hooks/security_reminder_hook.py
|
|
security-guidance: keep a review's result and time on full metric rows
|
|
security-guidance: review text files renamed to code names
|
|
security-guidance: review a commit-and-push again when the commit review gave no verdict
|
|
The commit and push reviews captured, decoded and split the whole
`git show -p` / `git diff` before looking at the number of files. An
import of 5,800 files and 4.6 M lines took 6.4 GB, and the review was
then skipped for its file count.
Read git's output as it arrives and keep what the review uses: the
characters of each file the prompt takes, a count of the added lines
after them, and past the file cut-off only the file names.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
With findings, the critical and high counts could be cut from a full row. They now come with the result. commit_review_on and push_sweep_on, which are always true on a reviewed row, go last instead.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
report a failure the push review did not
A message-only amend made while the first review was running counted as
reviewed at once. When that review then failed, a later push reviewed
nothing. The amend now waits for that review.
A failed commit review stayed quiet for the push review of its own command,
which can itself end quietly (a cap, no network, killed). It now waits for
the push review, and reports unless that one got a verdict or told of its
own failure.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
git shows no content for a renamed file, so a text or document file renamed
to a code name (notes.txt to payload.py) was never read by the commit and
push reviews. They now read it whole, behind the files they already review
and within a small share of the prompt. Other renames are reviewed as before.
Part of #4852
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
`git \` with `commit` or `push` on the next line started the hook, but the
command patterns only allowed whitespace between the words, so nothing was
reviewed. They now also allow a line continued with a backslash (Bash) or a
backtick (PowerShell).
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
gave no verdict
When one command commits and pushes, the push review left the new commit to
the commit review and ended at once. A commit review that then failed, was
killed or skipped the commit left it pushed and unreviewed, and no later push
covers it.
The push review now waits for the commit review's process to end, and reviews
the pushed range itself when there is no verdict. Both choose the commit
through one helper, so they cannot pick differently.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Only the first 20 keys of a hook's metrics are kept. Commit reviews with findings, and failed reviews that used tokens, often have more, so their time and sometimes their result were lost. The result, kind and time of a review now come first.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
security-guidance: take the review model from one place, default to the newest listed
|
|
security-guidance: review commits and pushes made through the PowerShell tool
|
|
security-guidance: review what a commit-and-push command sends out beyond its own commit
|
|
security-guidance: stop custom rule regexes that run too long
|
|
security-guidance: custom rule globs can be relative to the project
|
|
security-guidance: push review of a merge reviews what the push added
|
|
newest listed
The commit reviewer asked its CLI for the opus alias, so an out-of-date
CLI reviewed on an older model. It now uses the same lookup as the diff
review, at medium effort, and keeps the alias when the endpoint can't
list models. The retry model comes from the same lookup. Model names
remain only for a direct API call when the endpoint can't list.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
its own commit
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
security-guidance: count reviewer verdicts the CLI refused
|
|
security-guidance: send a claude.ai token as a bearer, hold back a gateway's
|
|
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
security-guidance: count commits that no commit hook saw
|
|
security-guidance: say when a Stop finding is in a file the session has no record of editing
|
|
The reviewed prefix could end on the merged-in branch, so the diff held
everything the first parent has that the branch lacks. Keep the base on
HEAD's first-parent line. A merge whose history is all reviewed is sent as
its combined diff, so only its conflict resolutions and hand edits are read.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
A record lost before one Stop was treated as whole by the next, and a prompt
that was never stored as having no edits, so the note could name the
session's own file. File names in the note are quoted as JSON.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Measure only, for #5746: one key on the commit and push review row when the
reviewer's verdict was refused, and how many were wrapped in their own key.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
A claude.ai token that arrives as ANTHROPIC_API_KEY (from an apiKeyHelper) is
refused by the API as a key; send it as a bearer. On hosts other than Claude
Code, a bearer that is not a claude.ai token is not sent without a base URL.
Other hosts' base URLs and cloud providers are left alone.
Fixes #6955
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
A commit review starts from a hook on the Bash tool, so a commit made any
other way starts none. The Stop row now carries turn_commits: how many
commits the turn made, how many have no review, and how many of those no
commit hook saw. Count only; what is reviewed does not change, and no hook
entry is added.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Measure only: path globs a wider reading would change, refused and counted
repeats in regexes, and the slowest custom regex, on the Stop row. Which
rules apply does not change.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
mhegazy/sg-stop-finding-names-unwritten
# Conflicts:
# plugins/security-guidance/hooks/security_reminder_hook.py
|
|
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
security-guidance: stop the commit reviewer on refused credentials, end hung reviews in time
|
|
security-guidance: count Bash hook starts that match no commit or push
|
|
security-guidance: take the turn baseline without git stash create
|
|
security-guidance: keep new files in the Stop review when git add -N fails
|
|
security-guidance: treat a blank ANTHROPIC_BASE_URL as unset
|
|
security-guidance: stop starting the packaged Python alias on every hook
|
|
When git add -N fails on both tries or times out, wake Claude once per
set of files with their names, so the review no longer ends as "no
changes". A timed-out add now keeps the tracked files' diff, so a
timeout on every turn cannot stop their reviews. Private object
directory cleanup no longer chmods through a link.
Fixes #6996
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
hook's time limit
A single-shot review that follows a fast agentic failure, or runs with the
agentic review off, had no deadline: with no answer it ran 739 s, past Claude
Code's 600 s kill, so the session heard nothing. It now ends at 570 s into the
hook with the usual notice. The limit counts from hook start, so a push
review's wait and the work before the review count. Failed push rows keep
inflight_wait_s, and CLAUDE_CODE_REMOTE is read the same way in both places.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Create ~/.claude/security with mode 0700 from every place that makes it, and
narrow the default folder on the next run, so a umask such as 002 does not
leave the reviewer's venv group-writable. The in-place state write replaces a
link instead of following it, and creates a 0600 file.
Co-authored-by: mhegazy <mhegazy@anthropic.com>
|
|
Measurement only. One Bash call in ten that starts the hook without a
commit or push reports bash_no_match, and precheck_skip when a plain text
check on the hook input could have told so before Python started.
precheck_miss marks a reviewed command that such a check would have
dropped. Nothing is skipped and no review changes.
|
|
A failed first probe, a lost race fallback or a failed dual leg left its
class (and api_error) on the row of a review that got a verdict.
|