specmem-hardwicksoftware 3.7.9 → 3.7.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specmem-hardwicksoftware",
3
- "version": "3.7.9",
3
+ "version": "3.7.10",
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",
@@ -3514,6 +3514,46 @@ async function indexCodebase(projectPath, ui, embeddingResult) {
3514
3514
  return results;
3515
3515
  }
3516
3516
 
3517
+ // AUTO-CREATE codebase_files table if it doesn't exist
3518
+ // CRITICAL: Init must not depend on MCP migrations having run first
3519
+ try {
3520
+ await pool.query(`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`);
3521
+ await pool.query(`CREATE EXTENSION IF NOT EXISTS "vector"`);
3522
+ await pool.query(`
3523
+ CREATE TABLE IF NOT EXISTS codebase_files (
3524
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
3525
+ file_path TEXT NOT NULL,
3526
+ absolute_path TEXT NOT NULL,
3527
+ file_name VARCHAR(255) NOT NULL,
3528
+ extension VARCHAR(50),
3529
+ language_id VARCHAR(50) NOT NULL DEFAULT 'unknown',
3530
+ language_name VARCHAR(100) NOT NULL DEFAULT 'Unknown',
3531
+ language_type VARCHAR(50) NOT NULL DEFAULT 'data',
3532
+ content TEXT NOT NULL,
3533
+ content_hash VARCHAR(64),
3534
+ size_bytes INTEGER NOT NULL DEFAULT 0,
3535
+ line_count INTEGER NOT NULL DEFAULT 0,
3536
+ char_count INTEGER NOT NULL DEFAULT 0,
3537
+ last_modified TIMESTAMPTZ NOT NULL DEFAULT NOW(),
3538
+ chunk_index INTEGER,
3539
+ total_chunks INTEGER,
3540
+ original_file_id UUID,
3541
+ embedding vector(384),
3542
+ project_path TEXT DEFAULT '/',
3543
+ created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
3544
+ updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
3545
+ CONSTRAINT content_not_empty CHECK (length(content) > 0)
3546
+ )
3547
+ `);
3548
+ await pool.query(`CREATE INDEX IF NOT EXISTS idx_codebase_files_content_hash ON codebase_files(content_hash)`);
3549
+ await pool.query(`CREATE INDEX IF NOT EXISTS idx_codebase_files_path ON codebase_files(file_path)`);
3550
+ await pool.query(`CREATE INDEX IF NOT EXISTS idx_codebase_files_project_path_file ON codebase_files(file_path, project_path)`);
3551
+ await pool.query(`CREATE INDEX IF NOT EXISTS idx_codebase_files_project_path_hash ON codebase_files(project_path, content_hash)`);
3552
+ initLog('[CODEBASE] Table codebase_files ensured');
3553
+ } catch (e) {
3554
+ initLog(`[CODEBASE] Table ensure warning: ${e.message}`);
3555
+ }
3556
+
3517
3557
  // Load existing hashes to skip unchanged files ONLY if they have embeddings
3518
3558
  // CRITICAL: Files without embeddings need to be re-indexed even if content matches!
3519
3559
  ui.setStatus('Checking existing index...');