fix: shell injection in hooks, Claude Code mining, chromadb pin

- hooks/mempal_save_hook.sh: pass $TRANSCRIPT_PATH as sys.argv
  instead of interpolating into python -c string (fixes #110)
- normalize.py: accept type "user" in addition to "human" for
  Claude Code JSONL sessions (fixes #111)
- convo_miner.py: skip tool-results/, memory/ dirs and .meta.json
  files when scanning for conversations (fixes #111)
- pyproject.toml: pin chromadb>=0.4.0,<1 to avoid crashing 1.x
  builds on macOS ARM64 (fixes #100)
This commit is contained in:
bensig
2026-04-07 11:45:51 -07:00
parent aa10f8fbf1
commit 186bb2e3d1
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
if [ -f "$TRANSCRIPT_PATH" ]; then
EXCHANGE_COUNT=$(python3 -c "
EXCHANGE_COUNT=$(python3 - "$TRANSCRIPT_PATH" <<'PYEOF'
import json, sys
count = 0
with open('$TRANSCRIPT_PATH') as f:
with open(sys.argv[1]) as f:
for line in f:
try:
entry = json.loads(line)
@@ -98,7 +98,8 @@ with open('$TRANSCRIPT_PATH') as f:
except:
pass
print(count)
" 2>/dev/null)
PYEOF
2>/dev/null)
else
EXCHANGE_COUNT=0
fi