specmem-hardwicksoftware 3.7.9 → 3.7.11

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.
@@ -3026,17 +3026,30 @@ class EmbeddingServer:
3026
3026
 
3027
3027
  try:
3028
3028
  # Get TOTAL count first for progress tracking
3029
+ # Schema isolation already separates projects, so project_path filter
3030
+ # is only needed when file_path values are absolute. Check if filter
3031
+ # matches anything — if not, skip it (paths are likely relative).
3029
3032
  count_cursor = conn.cursor()
3033
+ use_project_filter = False
3030
3034
  if project_path:
3031
3035
  count_cursor.execute(
3032
3036
  "SELECT COUNT(*) FROM codebase_files WHERE embedding IS NULL AND content IS NOT NULL AND file_path LIKE %s",
3033
3037
  (f"{project_path}%",)
3034
3038
  )
3035
- print(f"🎯 Filtering to project: {project_path}", file=sys.stderr)
3039
+ filtered_count = count_cursor.fetchone()[0]
3040
+ if filtered_count > 0:
3041
+ use_project_filter = True
3042
+ total_missing = filtered_count
3043
+ print(f"🎯 Filtering to project: {project_path} ({total_missing} files)", file=sys.stderr)
3044
+ else:
3045
+ # Paths are relative — schema isolation handles project separation
3046
+ count_cursor.execute("SELECT COUNT(*) FROM codebase_files WHERE embedding IS NULL AND content IS NOT NULL")
3047
+ total_missing = count_cursor.fetchone()[0]
3048
+ print(f"📁 Schema-isolated mode (relative paths, {total_missing} files)", file=sys.stderr)
3036
3049
  else:
3037
3050
  count_cursor.execute("SELECT COUNT(*) FROM codebase_files WHERE embedding IS NULL AND content IS NOT NULL")
3051
+ total_missing = count_cursor.fetchone()[0]
3038
3052
  print(f"⚠️ Processing ALL projects (no project_path filter)", file=sys.stderr)
3039
- total_missing = count_cursor.fetchone()[0]
3040
3053
  count_cursor.close()
3041
3054
 
3042
3055
  print(f"📊 Total files needing embeddings: {total_missing}", file=sys.stderr)
@@ -3054,7 +3067,7 @@ class EmbeddingServer:
3054
3067
 
3055
3068
  # Fetch next batch - always gets files without embeddings
3056
3069
  cursor = conn.cursor()
3057
- if project_path:
3070
+ if use_project_filter:
3058
3071
  cursor.execute("""
3059
3072
  SELECT id, file_path, content
3060
3073
  FROM codebase_files
@@ -3242,17 +3255,28 @@ class EmbeddingServer:
3242
3255
 
3243
3256
  try:
3244
3257
  # Get TOTAL count first for progress tracking
3258
+ # Schema isolation handles project separation, so project_path filter
3259
+ # only applies when file_path values are absolute paths.
3245
3260
  count_cursor = conn.cursor()
3261
+ use_project_filter = False
3246
3262
  if project_path:
3247
3263
  count_cursor.execute(
3248
3264
  "SELECT COUNT(*) FROM code_definitions WHERE embedding IS NULL AND file_path LIKE %s",
3249
3265
  (f"{project_path}%",)
3250
3266
  )
3251
- print(f"🎯 Filtering to project: {project_path}", file=sys.stderr)
3267
+ filtered_count = count_cursor.fetchone()[0]
3268
+ if filtered_count > 0:
3269
+ use_project_filter = True
3270
+ total_missing = filtered_count
3271
+ print(f"🎯 Filtering to project: {project_path} ({total_missing} definitions)", file=sys.stderr)
3272
+ else:
3273
+ count_cursor.execute("SELECT COUNT(*) FROM code_definitions WHERE embedding IS NULL")
3274
+ total_missing = count_cursor.fetchone()[0]
3275
+ print(f"📁 Schema-isolated mode (relative paths, {total_missing} definitions)", file=sys.stderr)
3252
3276
  else:
3253
3277
  count_cursor.execute("SELECT COUNT(*) FROM code_definitions WHERE embedding IS NULL")
3278
+ total_missing = count_cursor.fetchone()[0]
3254
3279
  print(f"⚠️ Processing ALL projects (no project_path filter)", file=sys.stderr)
3255
- total_missing = count_cursor.fetchone()[0]
3256
3280
  count_cursor.close()
3257
3281
 
3258
3282
  print(f"📊 Total code_definitions needing embeddings: {total_missing}", file=sys.stderr)
@@ -3270,7 +3294,7 @@ class EmbeddingServer:
3270
3294
 
3271
3295
  # Fetch next batch
3272
3296
  cursor = conn.cursor()
3273
- if project_path:
3297
+ if use_project_filter:
3274
3298
  cursor.execute("""
3275
3299
  SELECT id, definition_type, name, signature, docstring, language, file_path
3276
3300
  FROM code_definitions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specmem-hardwicksoftware",
3
- "version": "3.7.9",
3
+ "version": "3.7.11",
4
4
  "type": "module",
5
5
  "description": "Persistent memory system for coding sessions - semantic search with pgvector, token compression, team coordination, file watching. Needs root: installs system-wide hooks, manages docker/PostgreSQL, writes global configs, handles screen sessions. justcalljon.pro",
6
6
  "main": "dist/index.js",