diff --git a/shannon.mjs b/shannon.mjs index 586796c..1dc54ee 100755 --- a/shannon.mjs +++ b/shannon.mjs @@ -13,7 +13,6 @@ import { runPhase, getGitCommitHash } from './src/checkpoint-manager.js'; // Setup and Deliverables import { setupLocalRepo, cleanupMCP } from './src/setup/environment.js'; -import { saveRunMetadata } from './src/setup/deliverables.js'; // AI and Prompts import { runClaudePromptWithRetry } from './src/ai/claude-executor.js'; @@ -178,15 +177,6 @@ async function main(webUrl, repoPath, configPath = null, pipelineTestingMode = f ); } - // Save run metadata with error handling - try { - await saveRunMetadata(sourceDir, webUrl, repoPath); - } catch (error) { - // Non-critical operation, log warning and continue - console.log(chalk.yellow(`⚠️ Failed to save run metadata: ${error.message}`)); - await logError(error, 'Run metadata saving', sourceDir); - } - // Check if we should continue from where session left off const nextAgent = getNextAgent(session); if (!nextAgent) { diff --git a/src/setup/deliverables.js b/src/setup/deliverables.js deleted file mode 100644 index 96f0fb6..0000000 --- a/src/setup/deliverables.js +++ /dev/null @@ -1,67 +0,0 @@ -import { fs, path } from 'zx'; -import chalk from 'chalk'; -import { PentestError, logError } from '../error-handling.js'; - -// Pure function: Save run metadata for debugging and reproducibility -export async function saveRunMetadata(sourceDir, webUrl, repoPath) { - console.log(chalk.blue('💾 Saving run metadata...')); - - try { - // Read package.json to get version info with error handling - const packagePath = path.join(import.meta.dirname, '..', '..', 'package.json'); - let packageJson; - try { - packageJson = await fs.readJSON(packagePath); - } catch (packageError) { - throw new PentestError( - `Cannot read package.json: ${packageError.message}`, - 'filesystem', - false, - { packagePath, originalError: packageError.message } - ); - } - - const metadata = { - timestamp: new Date().toISOString(), - targets: { webUrl, repoPath }, - environment: { - nodeVersion: process.version, - platform: process.platform, - arch: process.arch, - cwd: process.cwd() - }, - dependencies: { - claudeCodeVersion: packageJson.dependencies?.['@anthropic-ai/claude-code'] || 'unknown', - zxVersion: packageJson.dependencies?.['zx'] || 'unknown', - chalkVersion: packageJson.dependencies?.['chalk'] || 'unknown' - }, - execution: { - args: process.argv, - env: { - PLAYWRIGHT_HEADLESS: process.env.PLAYWRIGHT_HEADLESS || 'true', - NODE_ENV: process.env.NODE_ENV - } - } - }; - - const metadataPath = path.join(sourceDir, 'run-metadata.json'); - await fs.writeJSON(metadataPath, metadata, { spaces: 2 }); - - console.log(chalk.green(`✅ Run metadata saved to: ${metadataPath}`)); - return metadata; - } catch (error) { - if (error instanceof PentestError) { - await logError(error, 'Saving run metadata', sourceDir); - throw error; // Re-throw PentestError to be handled by caller - } - - const metadataError = new PentestError( - `Run metadata saving failed: ${error.message}`, - 'filesystem', - false, - { sourceDir, originalError: error.message } - ); - await logError(metadataError, 'Saving run metadata', sourceDir); - throw metadataError; - } -} \ No newline at end of file