From cf07002dcaeba032663acd49dbaa855ffe7ee24f Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 26 Aug 2025 16:45:24 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Checkpoint:=20Edit=20/workspaces?= =?UTF-8?q?/claude-code-flow/src/cli/simple-commands/hive-mind/session-man?= =?UTF-8?q?ager.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/checkpoints/1756226702.json | 1 + .claude/checkpoints/1756226704.json | 1 + .../hive-mind/session-manager.js | 28 +++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 .claude/checkpoints/1756226702.json create mode 100644 .claude/checkpoints/1756226704.json diff --git a/.claude/checkpoints/1756226702.json b/.claude/checkpoints/1756226702.json new file mode 100644 index 0000000000..11af96d2c1 --- /dev/null +++ b/.claude/checkpoints/1756226702.json @@ -0,0 +1 @@ +{"branch": "checkpoint/pre-edit-20250826-164502", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/hive-mind/session-manager.js", "timestamp": "2025-08-26T16:45:02Z", "type": "pre-edit", "original_branch": "alpha97"} diff --git a/.claude/checkpoints/1756226704.json b/.claude/checkpoints/1756226704.json new file mode 100644 index 0000000000..29488ff89a --- /dev/null +++ b/.claude/checkpoints/1756226704.json @@ -0,0 +1 @@ +{"tag": "checkpoint-20250826-164504", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/hive-mind/session-manager.js", "timestamp": "2025-08-26T16:45:04Z", "type": "post-edit", "branch": "alpha97", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 12 ++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +++--- .claude/checkpoints/task-1756226679.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/hive-mind/session-manager.js | 2 ++ 6 files changed, 19 insertions(+), 4 deletions(-) "} diff --git a/src/cli/simple-commands/hive-mind/session-manager.js b/src/cli/simple-commands/hive-mind/session-manager.js index d9226f436f..93bf417328 100644 --- a/src/cli/simple-commands/hive-mind/session-manager.js +++ b/src/cli/simple-commands/hive-mind/session-manager.js @@ -164,12 +164,20 @@ To enable persistence, see: https://github.com/ruvnet/claude-code-flow/docs/wind try { // Check if required columns exist const columns = this.db.prepare('PRAGMA table_info(sessions)').all(); + + // Core columns const hasObjective = columns.some((col) => col.name === 'objective'); const hasSwarmName = columns.some((col) => col.name === 'swarm_name'); const hasCheckpointData = columns.some((col) => col.name === 'checkpoint_data'); const hasMetadata = columns.some((col) => col.name === 'metadata'); const hasParentPid = columns.some((col) => col.name === 'parent_pid'); const hasChildPids = columns.some((col) => col.name === 'child_pids'); + + // Timestamp columns + const hasUpdatedAt = columns.some((col) => col.name === 'updated_at'); + const hasPausedAt = columns.some((col) => col.name === 'paused_at'); + const hasResumedAt = columns.some((col) => col.name === 'resumed_at'); + const hasCompletionPercentage = columns.some((col) => col.name === 'completion_percentage'); if (!hasObjective) { this.db.exec('ALTER TABLE sessions ADD COLUMN objective TEXT'); @@ -200,6 +208,26 @@ To enable persistence, see: https://github.com/ruvnet/claude-code-flow/docs/wind this.db.exec('ALTER TABLE sessions ADD COLUMN child_pids TEXT'); console.log('Added child_pids column to sessions table'); } + + if (!hasUpdatedAt) { + this.db.exec('ALTER TABLE sessions ADD COLUMN updated_at DATETIME DEFAULT CURRENT_TIMESTAMP'); + console.log('Added updated_at column to sessions table'); + } + + if (!hasPausedAt) { + this.db.exec('ALTER TABLE sessions ADD COLUMN paused_at DATETIME'); + console.log('Added paused_at column to sessions table'); + } + + if (!hasResumedAt) { + this.db.exec('ALTER TABLE sessions ADD COLUMN resumed_at DATETIME'); + console.log('Added resumed_at column to sessions table'); + } + + if (!hasCompletionPercentage) { + this.db.exec('ALTER TABLE sessions ADD COLUMN completion_percentage REAL DEFAULT 0'); + console.log('Added completion_percentage column to sessions table'); + } } catch (error) { console.error('Migration error:', error); }