From fdf276cae8aac383dd363a61e5758281b278effb Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 12 Aug 2025 02:40:15 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Checkpoint:=20Edit=20/workspaces?= =?UTF-8?q?/claude-code-flow/src/verification/index.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/checkpoints/1754966395.json | 1 + .claude/checkpoints/1754966396.json | 1 + src/verification/index.ts | 94 +++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 .claude/checkpoints/1754966395.json create mode 100644 .claude/checkpoints/1754966396.json create mode 100644 src/verification/index.ts diff --git a/.claude/checkpoints/1754966395.json b/.claude/checkpoints/1754966395.json new file mode 100644 index 0000000000..8b4a58b7cc --- /dev/null +++ b/.claude/checkpoints/1754966395.json @@ -0,0 +1 @@ +{"tag": "checkpoint-20250812-023955", "file": "/workspaces/claude-code-flow/src/verification/api/websocket/truth-monitor.js", "timestamp": "2025-08-12T02:39:55Z", "type": "post-edit", "branch": "alpha-89", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 124 +++++- .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/1754966365.json | 1 + .claude/checkpoints/1754966367.json | 1 + .claude/checkpoints/1754966393.json | 1 + CLAUDE.md | 53 +++ src/verification/api/websocket/truth-monitor.js | 519 ++++++++++++++++++++++++ 8 files changed, 689 insertions(+), 18 deletions(-) "} diff --git a/.claude/checkpoints/1754966396.json b/.claude/checkpoints/1754966396.json new file mode 100644 index 0000000000..ea988843e4 --- /dev/null +++ b/.claude/checkpoints/1754966396.json @@ -0,0 +1 @@ +{"tag": "checkpoint-20250812-023956", "file": "/workspaces/claude-code-flow/src/verification/interfaces.ts", "timestamp": "2025-08-12T02:39:56Z", "type": "post-edit", "branch": "alpha-89", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 124 ++++- .claude-flow/metrics/task-metrics.json | 6 +- CLAUDE.md | 53 ++ src/verification/interfaces.ts | 833 +++++++++++++++++++++++++++++++ 5 files changed, 1000 insertions(+), 18 deletions(-) "} diff --git a/src/verification/index.ts b/src/verification/index.ts new file mode 100644 index 0000000000..f22688f682 --- /dev/null +++ b/src/verification/index.ts @@ -0,0 +1,94 @@ +/** + * Verification Module - Index + * + * Main entry point for the verification system. + * Provides a unified interface for all verification capabilities. + */ + +export * from './hooks.js'; +export * from './cli-integration.js'; + +// Re-export key components for convenience +export { + verificationHookManager, + VerificationHookManager, + DEFAULT_PRE_TASK_CHECKERS, + DEFAULT_POST_TASK_VALIDATORS, + DEFAULT_TRUTH_VALIDATORS, + DEFAULT_ROLLBACK_TRIGGERS, + DEFAULT_VERIFICATION_CONFIG +} from './hooks.js'; + +export { + initializeVerificationCLI, + createVerificationCommand, + VerificationCLICommands +} from './cli-integration.js'; + +import { Logger } from '../core/logger.js'; +import { verificationHookManager } from './hooks.js'; +import { initializeVerificationCLI } from './cli-integration.js'; + +const logger = new Logger({ + level: 'info', + format: 'text', + destination: 'console' +}, { prefix: 'VerificationModule' }); + +/** + * Initialize the complete verification system + */ +export async function initializeVerificationSystem(): Promise { + logger.info('Initializing verification system...'); + + try { + // Initialize CLI integration + await initializeVerificationCLI(); + + // Start cleanup interval (every hour) + setInterval(() => { + verificationHookManager.cleanup(); + }, 60 * 60 * 1000); + + logger.info('Verification system initialized successfully'); + } catch (error) { + logger.error('Failed to initialize verification system:', error); + throw error; + } +} + +/** + * Get verification system status + */ +export function getVerificationSystemStatus(): { + initialized: boolean; + hooksRegistered: number; + activeContexts: number; + metrics: any; +} { + const metrics = verificationHookManager.getMetrics(); + + return { + initialized: true, + hooksRegistered: 5, // Pre-task, post-task, integration, truth, rollback + activeContexts: metrics.activeContexts || 0, + metrics + }; +} + +/** + * Shutdown verification system gracefully + */ +export async function shutdownVerificationSystem(): Promise { + logger.info('Shutting down verification system...'); + + try { + // Cleanup all contexts and snapshots + verificationHookManager.cleanup(0); // Cleanup all data + + logger.info('Verification system shut down successfully'); + } catch (error) { + logger.error('Error during verification system shutdown:', error); + throw error; + } +} \ No newline at end of file