Merge pull request #114 from milla-jovovich/fix/security-mining-chromadb

fix: shell injection in hooks, Claude Code mining, chromadb pin
This commit is contained in:
Ben Sigman
2026-04-07 11:53:12 -07:00
committed by GitHub
4 changed files with 10 additions and 5 deletions
+4 -3
View File
@@ -81,10 +81,10 @@ fi
# Count human messages in the JSONL transcript # Count human messages in the JSONL transcript
if [ -f "$TRANSCRIPT_PATH" ]; then if [ -f "$TRANSCRIPT_PATH" ]; then
EXCHANGE_COUNT=$(python3 -c " EXCHANGE_COUNT=$(python3 - "$TRANSCRIPT_PATH" <<'PYEOF'
import json, sys import json, sys
count = 0 count = 0
with open('$TRANSCRIPT_PATH') as f: with open(sys.argv[1]) as f:
for line in f: for line in f:
try: try:
entry = json.loads(line) entry = json.loads(line)
@@ -98,7 +98,8 @@ with open('$TRANSCRIPT_PATH') as f:
except: except:
pass pass
print(count) print(count)
" 2>/dev/null) PYEOF
2>/dev/null)
else else
EXCHANGE_COUNT=0 EXCHANGE_COUNT=0
fi fi
+4
View File
@@ -39,6 +39,8 @@ SKIP_DIRS = {
"build", "build",
".next", ".next",
".mempalace", ".mempalace",
"tool-results",
"memory",
} }
MIN_CHUNK_SIZE = 30 MIN_CHUNK_SIZE = 30
@@ -238,6 +240,8 @@ def scan_convos(convo_dir: str) -> list:
for root, dirs, filenames in os.walk(convo_path): for root, dirs, filenames in os.walk(convo_path):
dirs[:] = [d for d in dirs if d not in SKIP_DIRS] dirs[:] = [d for d in dirs if d not in SKIP_DIRS]
for filename in filenames: for filename in filenames:
if filename.endswith(".meta.json"):
continue
filepath = Path(root) / filename filepath = Path(root) / filename
if filepath.suffix.lower() in CONVO_EXTENSIONS: if filepath.suffix.lower() in CONVO_EXTENSIONS:
files.append(filepath) files.append(filepath)
+1 -1
View File
@@ -81,7 +81,7 @@ def _try_claude_code_jsonl(content: str) -> Optional[str]:
continue continue
msg_type = entry.get("type", "") msg_type = entry.get("type", "")
message = entry.get("message", {}) message = entry.get("message", {})
if msg_type == "human": if msg_type in ("human", "user"):
text = _extract_content(message.get("content", "")) text = _extract_content(message.get("content", ""))
if text: if text:
messages.append(("user", text)) messages.append(("user", text))
+1 -1
View File
@@ -29,7 +29,7 @@ classifiers = [
"Topic :: Utilities", "Topic :: Utilities",
] ]
dependencies = [ dependencies = [
"chromadb>=0.4.0", "chromadb>=0.4.0,<1",
"pyyaml>=6.0", "pyyaml>=6.0",
] ]