Hi — thanks for jev-commit, the "belt and a judge" framing is a good one and the belt's redaction is careful.
One ordering detail that I think undercuts the promise, found while reviewing the tool for a write-up.
In jev_commit/cli.py the belt scans the diff at line 262:
# The belt reads the whole diff, never only the part that survived the token budget.
hits = belt.scan(prep["all_hunks"], exclude=args.exclude)
but the request goes out nine lines later, at 271:
and the block based on those hits only happens afterwards (decide(...) at 279, and _belt_only at 339 on the unreachable path). So when the belt finds a high-precision credential in the staged diff, the commit is correctly blocked locally — but the chunk states containing that same diff have already been sent to the API. The block stops the commit, not the disclosure.
For a tool whose job is to catch a staged credential, I think most users would read "blocked, a credential-shaped line is staged" as meaning the line stayed on the machine.
Suggested fix: run belt.scan before building/sending the states and return early when belt.blocking(hits) is non-empty and the commit isn't an amend — i.e. move the existing _belt_only path ahead of judge(...) for the blocking case. That keeps the current behaviour for non-blocking hits.
Reproduced at 311e163b8abb9c333132155bc2e0bbfac4f36283.
Hi — thanks for jev-commit, the "belt and a judge" framing is a good one and the belt's redaction is careful.
One ordering detail that I think undercuts the promise, found while reviewing the tool for a write-up.
In
jev_commit/cli.pythe belt scans the diff at line 262:but the request goes out nine lines later, at 271:
and the block based on those hits only happens afterwards (
decide(...)at 279, and_belt_onlyat 339 on the unreachable path). So when the belt finds a high-precision credential in the staged diff, the commit is correctly blocked locally — but the chunk states containing that same diff have already been sent to the API. The block stops the commit, not the disclosure.For a tool whose job is to catch a staged credential, I think most users would read "blocked, a credential-shaped line is staged" as meaning the line stayed on the machine.
Suggested fix: run
belt.scanbefore building/sending the states and return early whenbelt.blocking(hits)is non-empty and the commit isn't an amend — i.e. move the existing_belt_onlypath ahead ofjudge(...)for the blocking case. That keeps the current behaviour for non-blocking hits.Reproduced at
311e163b8abb9c333132155bc2e0bbfac4f36283.