gitreins-guard-board-db-false-positive
The full documented flow verifies end-to-end. Here's the summary.
I diagnosed the problem by extracting the gitreins source and reproducing the exact failure, then fixing and re-verifying it. The writeup is in ~/SOLUTION.md.
The failing step is not gitleaks git. gitreins' pipeline secrets step (engine/pipeline.py, DF-012) runs the built-in _builtin_secrets_scan(staged_only=False), which:
os.walk() — including untracked files, and .coding-hermes isn't in its skip_dirs. (It never consults .gitignore, so ignoring the dir doesn't help.)errors="replace" and line-scans it against regex danger_patterns (e.g. AWS AKIA[0-9A-Z]{16}).gitleaks git stays clean because it scans committed history, and gitleaks itself skips binary .db files. The built-in text scanner is the trip.
Add the cache dir to .gitleaks.toml [allowlist].paths — gitreins' built-in scanner intentionally parses every '''...''' string there as a regex and skips matching file paths (and gitleaks honors the same allowlist):
[allowlist]
paths = [ '''\.coding-hermes/board/''', ]
In a throwaway repo with an untracked board.db:
| step | result |
|---|---|
| guard scan before fix | PASSED: False — board.db [AWS access key] <raw binary bytes> (reproduced) |
| after adding allowlist | allowlist parsed → PASSED: True — "Scanned 3 files — clean" |
| gitleaks w/ same config | clean (allowlist applied) |
The repo state I used for verification was /tmp/repro and /tmp/verify; the gitleaks 8.30.1 binary is at /tmp/gitleaks.
# Evidence - Problem class: gitreins-guard-board-db-false-positive - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-08-27T07:52:40.101Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "gitreins guard secrets step fails with binary garbage Finding (embedded task-ID strings) when an untracked SQLite cache (e.g. .coding-hermes/board/board.db) sits in the workdir: gitleaks scans untracked files, SQLite pages match rules, gitreins renders raw bytes. Diagnosis: direct `gitleaks git` = clean; guard passes when board.db moved away. Fix: add the cache dir to .gitleaks.toml allowlist paths (gitreins never overwrites an existing .gitleaks.toml \u2014 edit it).", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "gitreins-guard-board-db-false-positive", "provider": "openrouter", "solved_at": "2026-08-27T07:52:40.101Z", "version": ""}The full documented flow verifies end-to-end. Here's the summary.
I diagnosed the problem by extracting the gitreins source and reproducing the exact failure, then fixing and re-verifying it. The writeup is in ~/SOLUTION.md.
The failing step is not gitleaks git. gitreins' pipeline secrets step (engine/pipeline.py, DF-012) runs the built-in _builtin_secrets_scan(staged_only=False), which:
os.walk() — including untracked files, and .coding-hermes isn't in its skip_dirs. (It never consults .gitignore, so ignoring the dir doesn't help.)errors="replace" and line-scans it against regex danger_patterns (e.g. AWS AKIA[0-9A-Z]{16}).gitleaks git stays clean because it scans committed history, and gitleaks itself skips binary .db files. The built-in text scanner is the trip.
Add the cache dir to .gitleaks.toml [allowlist].paths — gitreins' built-in scanner intentionally parses every '''...''' string there as a regex and skips matching file paths (and gitleaks honors the same allowlist):
[allowlist]
paths = [ '''\.coding-hermes/board/''', ]
In a throwaway repo with an untracked board.db:
| step | result |
|---|---|
| guard scan before fix | PASSED: False — board.db [AWS access key] <raw binary bytes> (reproduced) |
| after adding allowlist | allowlist parsed → PASSED: True — "Scanned 3 files — clean" |
| gitleaks w/ same config | clean (allowlist applied) |
The repo state I used for verification was /tmp/repro and /tmp/verify; the gitleaks 8.30.1 binary is at /tmp/gitleaks.
# Evidence - Problem class: gitreins-guard-board-db-false-positive - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-08-27T07:52:40.101Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "gitreins guard secrets step fails with binary garbage Finding (embedded task-ID strings) when an untracked SQLite cache (e.g. .coding-hermes/board/board.db) sits in the workdir: gitleaks scans untracked files, SQLite pages match rules, gitreins renders raw bytes. Diagnosis: direct `gitleaks git` = clean; guard passes when board.db moved away. Fix: add the cache dir to .gitleaks.toml allowlist paths (gitreins never overwrites an existing .gitleaks.toml \u2014 edit it).", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "gitreins-guard-board-db-false-positive", "provider": "openrouter", "solved_at": "2026-08-27T07:52:40.101Z", "version": ""}