eagle-mem 4.10.6 → 4.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to the **Eagle Mem** project are documented here.
4
4
 
5
5
  ---
6
6
 
7
+ ## v4.10.7 Graph Rebuild Hotfix
8
+
9
+ This hotfix closes an installed-runtime failure found after the v4.10.6 graph-memory release:
10
+
11
+ - **Import Parser Hardening**: Restricts quoted local import detection to `./` and `../` paths, and limits shell `source` parsing to shell-like files so SQL columns named `source` are not mistaken for shell commands.
12
+ - **SQL-Safe Import Lookup**: Escapes import lookup terms before querying graph file nodes, preventing single quotes in source files from breaking `eagle-mem graph rebuild`.
13
+ - **Regression Coverage**: Extends the graph-memory regression test with a SQL fixture containing `source TEXT NOT NULL DEFAULT 'manual'`, matching the installed-runtime failure mode.
14
+
15
+ ---
16
+
7
17
  ## v4.10.6 Graph Memory Rebuild Release
8
18
 
9
19
  This patch turns the local graph-memory workarounds into supported product behavior:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eagle-mem",
3
- "version": "4.10.6",
3
+ "version": "4.10.7",
4
4
  "description": "Shared memory, release guardrails, RTK token protection, and worker lanes for Claude Code, Codex, Grok, and Google Antigravity",
5
5
  "bin": {
6
6
  "eagle-mem": "bin/eagle-mem"
package/scripts/index.sh CHANGED
@@ -238,10 +238,14 @@ COMMIT;"
238
238
  fi
239
239
 
240
240
  # 2. Parse local relative imports/requires/sources
241
- # Matches paths starting with dot (./ or ../) or sourcing .sh files
242
- local_imports=$(grep -oE "['\"](\.[^'\"]+)['\"]" "$full_path" 2>/dev/null | tr -d "'\"" || true)
243
- # Also grab shell source files
244
- shell_sources=$(grep -E "^[[:space:]]*(\.|source) " "$full_path" 2>/dev/null | sed -E "s/^[[:space:]]*(\.|source)[[:space:]]+(.*)/\\2/" || true)
241
+ # Matches quoted paths starting with ./ or ../ and shell source lines.
242
+ local_imports=$(grep -oE "['\"](\./[^'\"]+|\.\./[^'\"]+)['\"]" "$full_path" 2>/dev/null | tr -d "'\"" || true)
243
+ shell_sources=""
244
+ case "$file" in
245
+ *.sh|*.bash|*.zsh|*.envrc|.envrc)
246
+ shell_sources=$(grep -E "^[[:space:]]*(source[[:space:]]+|\. [^[:space:]])" "$full_path" 2>/dev/null | sed -E "s/^[[:space:]]*(source[[:space:]]+|\. )([^#[:space:]]+).*/\\2/" || true)
247
+ ;;
248
+ esac
245
249
 
246
250
  all_refs=$(printf "%s\n%s\n" "$local_imports" "$shell_sources" | sort -u)
247
251
  if [ -n "$all_refs" ]; then
@@ -250,9 +254,10 @@ COMMIT;"
250
254
  # Clean up path variables in shell sources (e.g. $_eagle_db_dir/db-core.sh -> db-core.sh)
251
255
  ref_clean=$(echo "$ref" | sed -E 's/.*\///; s/\.sh$//; s/\.js$//; s/\.ts$//')
252
256
  [ -z "$ref_clean" ] && continue
257
+ ref_sql=$(eagle_sql_escape "$ref_clean")
253
258
 
254
259
  # Check if there is a known file node in our graph that matches this basename or path
255
- matched_file=$(eagle_db "SELECT node_name FROM graph_nodes WHERE project = '$project_sql' AND node_type = 'file' AND (node_name LIKE '%/$ref_clean%' OR node_name = '$ref_clean') LIMIT 1;")
260
+ matched_file=$(eagle_db "SELECT node_name FROM graph_nodes WHERE project = '$project_sql' AND node_type = 'file' AND (node_name LIKE '%/$ref_sql%' OR node_name = '$ref_sql') LIMIT 1;")
256
261
  if [ -n "$matched_file" ]; then
257
262
  target_file_id=$(eagle_graph_get_node_id "$PROJECT" "file" "$matched_file")
258
263
  if [ -n "$target_file_id" ]; then
@@ -68,7 +68,16 @@ function CloudDictationPipeline() {
68
68
  }
69
69
  EOF
70
70
 
71
- git -C "$repo" add a.sh b.sh old.sh
71
+ mkdir -p "$repo/db"
72
+ cat > "$repo/db/source_column.sql" <<'EOF'
73
+ CREATE TABLE graph_fixture (
74
+ id TEXT PRIMARY KEY,
75
+ source TEXT NOT NULL DEFAULT 'manual',
76
+ note TEXT DEFAULT './not-a-real-import'
77
+ );
78
+ EOF
79
+
80
+ git -C "$repo" add a.sh b.sh old.sh db/source_column.sql
72
81
 
73
82
  "$EAGLE_BIN" scan --force "$repo" >/dev/null
74
83
  "$EAGLE_BIN" index --force "$repo" >/dev/null