claude-flow 2.7.34 → 2.7.36
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/CHANGELOG.md +82 -0
- package/bin/claude-flow +1 -1
- package/dist/src/__tests__/benchmarks/performance.bench.js +0 -19
- package/dist/src/__tests__/benchmarks/performance.bench.js.map +1 -1
- package/dist/src/__tests__/hook-matchers.test.js.map +1 -1
- package/dist/src/agents/agent-registry.js.map +1 -1
- package/dist/src/api/auth-service.js.map +1 -1
- package/dist/src/api/claude-client-enhanced.js +4 -2
- package/dist/src/api/claude-client-enhanced.js.map +1 -1
- package/dist/src/api/claude-client.js +4 -2
- package/dist/src/api/claude-client.js.map +1 -1
- package/dist/src/api/database-service.js.map +1 -1
- package/dist/src/api/swarm-api.js +1 -1
- package/dist/src/api/swarm-api.js.map +1 -1
- package/dist/src/cli/commands/hive-mind/wizard.js +1 -1
- package/dist/src/cli/commands/hive-mind/wizard.js.map +1 -1
- package/dist/src/cli/help-formatter.js +0 -5
- package/dist/src/cli/init/index.js +55 -33
- package/dist/src/cli/init/index.js.map +1 -1
- package/dist/src/cli/simple-commands/init/skills-copier.js +1 -1
- package/dist/src/cli/simple-commands/init/skills-copier.js.map +1 -1
- package/dist/src/cli/simple-orchestrator.js +1 -1
- package/dist/src/cli/simple-orchestrator.js.map +1 -1
- package/dist/src/coordination/conflict-resolution.js +1 -1
- package/dist/src/coordination/conflict-resolution.js.map +1 -1
- package/dist/src/coordination/load-balancer.js +1 -1
- package/dist/src/coordination/load-balancer.js.map +1 -1
- package/dist/src/core/DatabaseManager.js +39 -9
- package/dist/src/core/DatabaseManager.js.map +1 -1
- package/dist/src/core/config.js +1 -1
- package/dist/src/core/config.js.map +1 -1
- package/dist/src/enterprise/audit-manager.js +1 -1
- package/dist/src/enterprise/audit-manager.js.map +1 -1
- package/dist/src/providers/openai-provider.js +2 -2
- package/dist/src/providers/openai-provider.js.map +1 -1
- package/dist/src/sdk/checkpoint-manager.js +1 -1
- package/dist/src/sdk/checkpoint-manager.js.map +1 -1
- package/dist/src/services/agentic-flow-hooks/workflow-hooks.js +1 -1
- package/dist/src/services/agentic-flow-hooks/workflow-hooks.js.map +1 -1
- package/dist/src/swarm/coordinator.js +1 -1
- package/dist/src/swarm/coordinator.js.map +1 -1
- package/dist/src/utils/error-recovery.js +215 -0
- package/dist/src/utils/error-recovery.js.map +1 -0
- package/dist/src/utils/key-redactor.js.map +1 -1
- package/dist/src/utils/metrics-reader.js +10 -0
- package/dist/src/verification/rollback.js +2 -2
- package/dist/src/verification/rollback.js.map +1 -1
- package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js +4 -2
- package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js.map +1 -1
- package/docs/.claude-flow/metrics/performance.json +3 -3
- package/docs/.claude-flow/metrics/task-metrics.json +3 -3
- package/docs/architecture/README.md +555 -0
- package/docs/architecture/github-workflows-optimization-strategy.md +1079 -0
- package/docs/architecture/workflow-architecture-diagram.md +615 -0
- package/docs/architecture/workflow-optimization-implementation-guide.md +593 -0
- package/docs/features/AUTOMATIC_ERROR_RECOVERY_v2.7.35.md +321 -0
- package/docs/features/automatic-error-recovery.md +333 -0
- package/docs/fixes/WORKFLOW_FIXES.md +292 -0
- package/docs/fixes/WORKFLOW_FIXES_FINAL_STATUS.md +291 -0
- package/docs/fixes/github-workflow-fixes-pr888.md +279 -0
- package/docs/fixes/workflow-fixes-action-plan.md +388 -0
- package/docs/github-issues/README.md +88 -0
- package/docs/github-issues/wsl-enotempty-automatic-recovery.md +470 -0
- package/docs/github-workflow-fixes.md +219 -0
- package/docs/reviews/github-workflows-analysis-report.md +820 -0
- package/docs/reviews/pr-888-review-report.md +560 -0
- package/docs/testing/CONFIRMATION_AUTOMATIC_ERROR_RECOVERY.md +384 -0
- package/docs/testing/DOCKER_TEST_RESULTS_v2.7.35.md +305 -0
- package/docs/troubleshooting/wsl-better-sqlite3-error.md +239 -0
- package/docs/validation/workflow-fix-verification.md +206 -0
- package/package.json +7 -7
- package/scripts/create-github-issue.sh +64 -0
- package/scripts/test-docker-wsl.sh +198 -0
- package/src/__tests__/benchmarks/performance.bench.ts +2 -25
- package/src/__tests__/hook-matchers.test.ts +2 -0
- package/src/agents/agent-registry.ts +1 -1
- package/src/api/auth-service.ts +1 -1
- package/src/api/claude-client-enhanced.ts +2 -1
- package/src/api/claude-client.ts +2 -2
- package/src/api/database-service.ts +1 -2
- package/src/api/swarm-api.ts +2 -2
- package/src/cli/commands/hive-mind/wizard.ts +1 -1
- package/src/cli/init/index.ts +72 -42
- package/src/cli/simple-commands/init/skills-copier.js +1 -1
- package/src/cli/simple-orchestrator.ts +1 -1
- package/src/coordination/conflict-resolution.ts +1 -1
- package/src/coordination/load-balancer.ts +1 -1
- package/src/core/DatabaseManager.ts +55 -9
- package/src/core/config.ts +1 -1
- package/src/enterprise/audit-manager.ts +1 -1
- package/src/providers/openai-provider.ts +2 -2
- package/src/sdk/checkpoint-manager.ts +1 -1
- package/src/services/agentic-flow-hooks/workflow-hooks.ts +1 -1
- package/src/swarm/coordinator.ts +1 -1
- package/src/utils/error-recovery.ts +325 -0
- package/src/verification/rollback.ts +2 -2
- package/src/verification/tests/mocks/false-reporting-scenarios.test.ts +6 -3
- /package/docs/{BUG_REPORT_MEMORY_STATS.md → bug-reports/BUG_REPORT_MEMORY_STATS.md} +0 -0
- /package/docs/{MCP_2025_FEATURE_CONFIRMATION.md → features/MCP_2025_FEATURE_CONFIRMATION.md} +0 -0
- /package/docs/{OPTIONAL_LOCAL_EMBEDDINGS.md → features/OPTIONAL_LOCAL_EMBEDDINGS.md} +0 -0
- /package/docs/{mcp-2025-implementation-summary.md → features/mcp-2025-implementation-summary.md} +0 -0
- /package/docs/{mcp-spec-2025-implementation-plan.md → features/mcp-spec-2025-implementation-plan.md} +0 -0
- /package/docs/{AGENTIC_FLOW_ENABLED_LOG_FIX.md → fixes/AGENTIC_FLOW_ENABLED_LOG_FIX.md} +0 -0
- /package/docs/{MEMORY_COMMAND_FIX.md → fixes/MEMORY_COMMAND_FIX.md} +0 -0
- /package/docs/{NPX_MEMORY_FIX_v2.7.19.md → fixes/NPX_MEMORY_FIX_v2.7.19.md} +0 -0
- /package/docs/{REMOTE_INSTALL_FIX.md → fixes/REMOTE_INSTALL_FIX.md} +0 -0
- /package/docs/{SQLITE_FIX_COMPLETE_v2.7.21.md → fixes/SQLITE_FIX_COMPLETE_v2.7.21.md} +0 -0
- /package/docs/{NPM_PUBLISH_GUIDE_v2.7.33.md → guides/NPM_PUBLISH_GUIDE_v2.7.33.md} +0 -0
- /package/docs/{SWARM_INITIALIZATION_GUIDE.md → guides/SWARM_INITIALIZATION_GUIDE.md} +0 -0
- /package/docs/{AGENTDB_BRANCH_MERGE_VERIFICATION.md → integration/AGENTDB_BRANCH_MERGE_VERIFICATION.md} +0 -0
- /package/docs/{INTEGRATION_STATUS_FINAL.md → integration/INTEGRATION_STATUS_FINAL.md} +0 -0
- /package/docs/{agentic-flow-agentdb-mcp-integration.md → integration/agentic-flow-agentdb-mcp-integration.md} +0 -0
- /package/docs/{phase-1-2-implementation-summary.md → integration/phase-1-2-implementation-summary.md} +0 -0
- /package/docs/{.github-release-issue-v2.7.33.md → releases/.github-release-issue-v2.7.33.md} +0 -0
- /package/docs/{RELEASE_NOTES_v2.7.15.md → releases/RELEASE_NOTES_v2.7.15.md} +0 -0
- /package/docs/{RELEASE_NOTES_v2.7.33.md → releases/RELEASE_NOTES_v2.7.33.md} +0 -0
- /package/docs/{RELEASE_READINESS_SUMMARY.md → releases/RELEASE_READINESS_SUMMARY.md} +0 -0
- /package/docs/{RELEASE_SUMMARY_v2.7.33.md → releases/RELEASE_SUMMARY_v2.7.33.md} +0 -0
- /package/docs/{V2.7.14_RELEASE_NOTES.md → releases/V2.7.14_RELEASE_NOTES.md} +0 -0
- /package/docs/{V2.7.25_RELEASE_NOTES.md → releases/V2.7.25_RELEASE_NOTES.md} +0 -0
- /package/docs/{V2.7.26_RELEASE_SUMMARY.md → releases/V2.7.26_RELEASE_SUMMARY.md} +0 -0
- /package/docs/{V2.7.27_RELEASE_NOTES.md → releases/V2.7.27_RELEASE_NOTES.md} +0 -0
- /package/docs/{V2.7.28_RELEASE_NOTES.md → releases/V2.7.28_RELEASE_NOTES.md} +0 -0
- /package/docs/{AGENTIC_FLOW_INTEGRATION_REVIEW.md → reviews/AGENTIC_FLOW_INTEGRATION_REVIEW.md} +0 -0
- /package/docs/{BRANCH_REVIEW_SUMMARY.md → reviews/BRANCH_REVIEW_SUMMARY.md} +0 -0
- /package/docs/{DEEP_CODE_REVIEW_v2.7.33.md → reviews/DEEP_CODE_REVIEW_v2.7.33.md} +0 -0
- /package/docs/{LATEST_LIBRARIES_REVIEW.md → reviews/LATEST_LIBRARIES_REVIEW.md} +0 -0
- /package/docs/{REGRESSION_TEST_REPORT_v2.7.33.md → testing/REGRESSION_TEST_REPORT_v2.7.33.md} +0 -0
- /package/docs/{V2.7.27_TEST_REPORT.md → testing/V2.7.27_TEST_REPORT.md} +0 -0
- /package/docs/{regression-analysis-phase-1-2.md → testing/regression-analysis-phase-1-2.md} +0 -0
- /package/docs/{TRANSFORMER_INITIALIZATION_ISSUE.md → troubleshooting/TRANSFORMER_INITIALIZATION_ISSUE.md} +0 -0
- /package/docs/{FIX_VERIFICATION_MEMORY_STATS.md → validation/FIX_VERIFICATION_MEMORY_STATS.md} +0 -0
- /package/docs/{TOOL_VALIDATION_REPORT.md → validation/TOOL_VALIDATION_REPORT.md} +0 -0
- /package/docs/{VALIDATION_REPORT_v2.7.1.md → validation/VALIDATION_REPORT_v2.7.1.md} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/verification/tests/mocks/false-reporting-scenarios.test.ts"],"sourcesContent":["/**\n * Mock Agent Scenarios for False Reporting Detection Tests\n * \n * Tests various scenarios where agents might provide false or misleading reports:\n * - Intentional false claims about task completion\n * - Exaggerated performance improvements\n * - Hidden failures in implementation\n * - Inconsistent reporting between agents\n * - Fabricated test results and evidence\n */\n\nimport { jest } from '@jest/globals';\nimport { EventEmitter } from 'events';\nimport * as fs from 'fs/promises';\nimport * as path from 'path';\nimport * as os from 'os';\n\n// Import verification components\nimport TruthScoreCalculator from '../../../../.claude/helpers/truth-score.js';\n\ninterface MockAgent {\n id: string;\n type: string;\n deceptionLevel: number; // 0 = honest, 1 = completely deceptive\n deceptionStrategy: DeceptionStrategy;\n behaviorPattern: BehaviorPattern;\n reportHistory: AgentReport[];\n detectedAs: 'honest' | 'suspicious' | 'deceptive' | 'unknown';\n}\n\ninterface DeceptionStrategy {\n type: 'overconfident' | 'fabrication' | 'selective_reporting' | 'gaslighting' | 'collusion';\n parameters: Record<string, any>;\n}\n\ninterface BehaviorPattern {\n consistency: number; // 0-1, how consistent the agent's reports are\n timeToReport: number; // Average time to submit reports (ms)\n detailLevel: number; // 0-1, how detailed the reports are\n evidenceQuality: number; // 0-1, quality of evidence provided\n}\n\ninterface AgentReport {\n id: string;\n agentId: string;\n taskId: string;\n claimedOutcome: TaskOutcome;\n evidence: any;\n timestamp: number;\n truthScore?: number;\n verified: boolean;\n conflicts: string[];\n}\n\ninterface TaskOutcome {\n success: boolean;\n testsPass: boolean;\n noErrors: boolean;\n performance: {\n improvement: number;\n metrics: Record<string, number>;\n };\n quality: {\n codeQuality: number;\n documentation: number;\n maintainability: number;\n };\n}\n\ninterface VerificationResult {\n reportId: string;\n agentId: string;\n truthScore: number;\n deceptionDetected: boolean;\n deceptionType: string[];\n confidence: number;\n evidence: any;\n recommendations: string[];\n}\n\ndescribe('False Reporting Detection Scenarios', () => {\n let tempDir: string;\n let truthCalculator: any;\n let deceptionDetector: DeceptionDetector;\n let mockAgents: Map<string, MockAgent>;\n\n beforeEach(async () => {\n tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'false-reporting-test-'));\n \n // Setup truth score calculator\n truthCalculator = new TruthScoreCalculator();\n truthCalculator.configPath = path.join(tempDir, 'verification.json');\n truthCalculator.memoryPath = path.join(tempDir, 'truth-scores');\n await truthCalculator.init();\n \n // Setup deception detector\n deceptionDetector = new DeceptionDetector(truthCalculator, tempDir);\n await deceptionDetector.initialize();\n \n // Create mock agents with different deception strategies\n mockAgents = new Map();\n await createMockAgentScenarios();\n });\n\n afterEach(async () => {\n await fs.rm(tempDir, { recursive: true, force: true });\n });\n\n async function createMockAgentScenarios() {\n const agentConfigs = [\n // Honest baseline agent\n {\n id: 'honest-agent-001',\n type: 'coder',\n deceptionLevel: 0,\n deceptionStrategy: { type: 'overconfident', parameters: {} },\n behaviorPattern: {\n consistency: 0.95,\n timeToReport: 5000,\n detailLevel: 0.8,\n evidenceQuality: 0.9\n }\n },\n // Overconfident agent\n {\n id: 'overconfident-agent-002',\n type: 'coder',\n deceptionLevel: 0.3,\n deceptionStrategy: {\n type: 'overconfident',\n parameters: { confidenceMultiplier: 1.5, hideMinorIssues: true }\n },\n behaviorPattern: {\n consistency: 0.7,\n timeToReport: 3000,\n detailLevel: 0.6,\n evidenceQuality: 0.7\n }\n },\n // Fabricating agent\n {\n id: 'fabricating-agent-003',\n type: 'tester',\n deceptionLevel: 0.8,\n deceptionStrategy: {\n type: 'fabrication',\n parameters: { fabricateResults: true, fakePassRate: 0.95 }\n },\n behaviorPattern: {\n consistency: 0.4,\n timeToReport: 1000, // Reports very quickly (suspicious)\n detailLevel: 0.9, // High detail to seem legitimate\n evidenceQuality: 0.3 // Low quality evidence\n }\n },\n // Selective reporting agent\n {\n id: 'selective-agent-004',\n type: 'reviewer',\n deceptionLevel: 0.5,\n deceptionStrategy: {\n type: 'selective_reporting',\n parameters: { reportOnlyPositives: true, hideFailures: true }\n },\n behaviorPattern: {\n consistency: 0.8,\n timeToReport: 7000,\n detailLevel: 0.5,\n evidenceQuality: 0.6\n }\n },\n // Gaslighting agent\n {\n id: 'gaslighting-agent-005',\n type: 'coordinator',\n deceptionLevel: 0.9,\n deceptionStrategy: {\n type: 'gaslighting',\n parameters: { contradictOthers: true, rewriteHistory: true }\n },\n behaviorPattern: {\n consistency: 0.2,\n timeToReport: 4000,\n detailLevel: 0.7,\n evidenceQuality: 0.4\n }\n }\n ];\n\n for (const config of agentConfigs) {\n const agent = createMockAgent(config);\n mockAgents.set(config.id, agent);\n }\n }\n\n function createMockAgent(config: any): MockAgent {\n return {\n id: config.id,\n type: config.type,\n deceptionLevel: config.deceptionLevel,\n deceptionStrategy: config.deceptionStrategy,\n behaviorPattern: config.behaviorPattern,\n reportHistory: [],\n detectedAs: 'unknown'\n };\n }\n\n describe('Overconfident Agent Scenarios', () => {\n test('should detect agent consistently overestimating success rates', async () => {\n const agent = mockAgents.get('overconfident-agent-002')!;\n const reports: AgentReport[] = [];\n\n // Generate series of overconfident reports\n for (let i = 0; i < 20; i++) {\n const actualSuccess = Math.random() > 0.3; // 70% actual success rate\n const claimedSuccess = actualSuccess || Math.random() > 0.2; // Claims 94% success rate\n\n const report = generateReport(agent, `task-${i}`, {\n actualOutcome: {\n success: actualSuccess,\n testsPass: actualSuccess,\n noErrors: actualSuccess,\n performance: { improvement: Math.random() * 0.2, metrics: {} },\n quality: { codeQuality: Math.random() * 0.3 + 0.4, documentation: 0.5, maintainability: 0.6 }\n },\n claimedOutcome: {\n success: claimedSuccess,\n testsPass: claimedSuccess,\n noErrors: claimedSuccess,\n performance: { improvement: Math.random() * 0.3 + 0.2, metrics: {} }, // Exaggerated\n quality: { codeQuality: Math.random() * 0.2 + 0.8, documentation: 0.9, maintainability: 0.9 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n // Analyze pattern for deception\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('overconfidence');\n expect(analysis.confidence).toBeGreaterThan(0.7);\n expect(analysis.truthScore).toBeLessThan(0.6);\n\n // Check specific indicators\n expect(analysis.evidence.successRateDiscrepancy).toBeGreaterThan(0.15);\n expect(analysis.evidence.performanceExaggeration).toBeGreaterThan(0.1);\n expect(analysis.recommendations).toContain('Implement additional verification for this agent');\n });\n\n test('should detect pattern of hiding minor issues', async () => {\n const agent = mockAgents.get('overconfident-agent-002')!;\n const reports: AgentReport[] = [];\n\n // Generate reports where agent hides minor issues\n for (let i = 0; i < 15; i++) {\n const minorIssues = Math.floor(Math.random() * 5) + 1; // 1-5 minor issues\n const majorIssues = Math.random() > 0.8 ? 1 : 0; // Occasional major issue\n\n const report = generateReport(agent, `minor-issues-task-${i}`, {\n actualOutcome: {\n success: majorIssues === 0,\n testsPass: true,\n noErrors: false, // Has minor errors\n performance: { improvement: 0.1, metrics: { minorIssues, majorIssues } },\n quality: { codeQuality: 0.7, documentation: 0.6, maintainability: 0.7 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true, // Claims no errors\n performance: { improvement: 0.15, metrics: { minorIssues: 0, majorIssues: 0 } },\n quality: { codeQuality: 0.9, documentation: 0.8, maintainability: 0.9 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('issue_hiding');\n expect(analysis.evidence.hiddenIssuesCount).toBeGreaterThan(10);\n expect(analysis.recommendations).toContain('Require detailed issue reporting');\n });\n });\n\n describe('Evidence Fabrication Scenarios', () => {\n test('should detect fabricated test results', async () => {\n const agent = mockAgents.get('fabricating-agent-003')!;\n const reports: AgentReport[] = [];\n\n // Generate reports with fabricated test results\n for (let i = 0; i < 25; i++) {\n const actualTestResults = {\n total: 100,\n passed: Math.floor(Math.random() * 30) + 60, // 60-90% pass rate\n failed: 0,\n skipped: 0\n };\n actualTestResults.failed = actualTestResults.total - actualTestResults.passed;\n\n const fabricatedResults = {\n total: 100,\n passed: Math.floor(Math.random() * 5) + 95, // 95-100% pass rate\n failed: 0,\n skipped: 0\n };\n fabricatedResults.failed = fabricatedResults.total - fabricatedResults.passed;\n\n const report = generateReport(agent, `fabrication-task-${i}`, {\n actualOutcome: {\n success: actualTestResults.passed > 80,\n testsPass: actualTestResults.passed === actualTestResults.total,\n noErrors: false,\n performance: { improvement: 0.05, metrics: actualTestResults },\n quality: { codeQuality: 0.6, documentation: 0.5, maintainability: 0.6 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.15, metrics: fabricatedResults },\n quality: { codeQuality: 0.95, documentation: 0.9, maintainability: 0.95 }\n },\n evidence: {\n testResults: fabricatedResults,\n executionTime: Math.random() * 100 + 50, // Suspiciously consistent timing\n testLogs: generateFakeTestLogs(fabricatedResults)\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('fabrication');\n expect(analysis.deceptionType).toContain('unrealistic_results');\n expect(analysis.confidence).toBeGreaterThan(0.8);\n\n // Check fabrication indicators\n expect(analysis.evidence.unrealisticSuccessRate).toBe(true);\n expect(analysis.evidence.suspiciouslyFastReporting).toBe(true);\n expect(analysis.evidence.evidenceInconsistency).toBeGreaterThan(0.5);\n });\n\n test('should detect impossible performance improvements', async () => {\n const agent = mockAgents.get('fabricating-agent-003')!;\n const reports: AgentReport[] = [];\n\n // Generate reports with impossible performance claims\n for (let i = 0; i < 10; i++) {\n const report = generateReport(agent, `impossible-perf-task-${i}`, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: {\n improvement: Math.random() * 0.1 + 0.05, // 5-15% actual improvement\n metrics: {\n responseTime: 1000,\n throughput: 100,\n memoryUsage: 500\n }\n },\n quality: { codeQuality: 0.7, documentation: 0.6, maintainability: 0.7 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: {\n improvement: Math.random() * 0.5 + 0.8, // 80-130% claimed improvement (impossible)\n metrics: {\n responseTime: 100, // 10x improvement\n throughput: 1000, // 10x improvement\n memoryUsage: 50 // 10x improvement\n }\n },\n quality: { codeQuality: 0.99, documentation: 0.99, maintainability: 0.99 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('impossible_claims');\n expect(analysis.evidence.impossiblePerformanceGains).toBe(true);\n expect(analysis.recommendations).toContain('Require third-party verification for performance claims');\n });\n });\n\n describe('Selective Reporting Scenarios', () => {\n test('should detect agent that only reports successes', async () => {\n const agent = mockAgents.get('selective-agent-004')!;\n const reports: AgentReport[] = [];\n\n // Generate mixed actual outcomes but agent only reports successes\n const actualOutcomes = [];\n for (let i = 0; i < 30; i++) {\n const success = Math.random() > 0.4; // 60% actual success rate\n actualOutcomes.push(success);\n\n // Agent only reports the successful ones\n if (success || Math.random() > 0.9) { // Reports 90% of successes, 10% of failures\n const report = generateReport(agent, `selective-task-${i}`, {\n actualOutcome: {\n success,\n testsPass: success,\n noErrors: success,\n performance: { improvement: success ? 0.1 : -0.05, metrics: {} },\n quality: { codeQuality: success ? 0.8 : 0.4, documentation: 0.6, maintainability: 0.7 }\n },\n claimedOutcome: {\n success: true, // Always claims success\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.12, metrics: {} },\n quality: { codeQuality: 0.85, documentation: 0.8, maintainability: 0.8 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('selective_reporting');\n expect(analysis.evidence.missingFailureReports).toBe(true);\n expect(analysis.evidence.suspiciousSuccessRate).toBeGreaterThan(0.95);\n expect(analysis.recommendations).toContain('Mandatory reporting of all task outcomes');\n });\n\n test('should detect cherry-picked metrics reporting', async () => {\n const agent = mockAgents.get('selective-agent-004')!;\n const reports: AgentReport[] = [];\n\n // Generate reports where agent only reports favorable metrics\n for (let i = 0; i < 20; i++) {\n const fullMetrics = {\n responseTime: Math.random() * 1000 + 500, // 500-1500ms\n throughput: Math.random() * 200 + 50, // 50-250 rps\n memoryUsage: Math.random() * 800 + 200, // 200-1000MB\n errorRate: Math.random() * 0.1, // 0-10% errors\n cpuUsage: Math.random() * 100, // 0-100% CPU\n diskIO: Math.random() * 1000 // 0-1000 IOPS\n };\n\n // Agent only reports the best 2-3 metrics\n const favorableMetrics = Object.entries(fullMetrics)\n .sort(([keyA, valueA], [keyB, valueB]) => {\n // Sort by how \"good\" the metric looks (lower is better for most)\n const goodValues = { responseTime: -valueA, errorRate: -valueA, default: valueB };\n return (goodValues[keyA] || goodValues.default) - (goodValues[keyB] || goodValues.default);\n })\n .slice(0, 3)\n .reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {});\n\n const report = generateReport(agent, `cherry-pick-task-${i}`, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: fullMetrics.errorRate < 0.05,\n performance: { improvement: 0.05, metrics: fullMetrics },\n quality: { codeQuality: 0.7, documentation: 0.6, maintainability: 0.7 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.15, metrics: favorableMetrics },\n quality: { codeQuality: 0.9, documentation: 0.8, maintainability: 0.9 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('cherry_picking');\n expect(analysis.evidence.incompleteMetricsReporting).toBe(true);\n expect(analysis.recommendations).toContain('Require comprehensive metrics reporting');\n });\n });\n\n describe('Gaslighting and Manipulation Scenarios', () => {\n test('should detect agent contradicting previous statements', async () => {\n const agent = mockAgents.get('gaslighting-agent-005')!;\n const reports: AgentReport[] = [];\n\n // Generate contradictory reports about the same tasks\n const taskIds = Array.from({ length: 5 }, (_, i) => `contradiction-task-${i}`);\n\n for (const taskId of taskIds) {\n // First report - claims failure\n const firstReport = generateReport(agent, taskId, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.1, metrics: {} },\n quality: { codeQuality: 0.8, documentation: 0.7, maintainability: 0.8 }\n },\n claimedOutcome: {\n success: false,\n testsPass: false,\n noErrors: false,\n performance: { improvement: -0.05, metrics: {} },\n quality: { codeQuality: 0.4, documentation: 0.3, maintainability: 0.5 }\n },\n timestamp: Date.now()\n });\n\n // Second report - claims success for same task\n const secondReport = generateReport(agent, taskId, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.1, metrics: {} },\n quality: { codeQuality: 0.8, documentation: 0.7, maintainability: 0.8 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.2, metrics: {} },\n quality: { codeQuality: 0.95, documentation: 0.9, maintainability: 0.95 }\n },\n timestamp: Date.now() + 60000 // 1 minute later\n });\n\n reports.push(firstReport, secondReport);\n agent.reportHistory.push(firstReport, secondReport);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('gaslighting');\n expect(analysis.deceptionType).toContain('contradictory_statements');\n expect(analysis.evidence.contradictionCount).toBeGreaterThan(3);\n expect(analysis.recommendations).toContain('Implement immutable audit trail for agent reports');\n });\n\n test('should detect agent attempting to discredit other agents', async () => {\n const gaslightingAgent = mockAgents.get('gaslighting-agent-005')!;\n const honestAgent = mockAgents.get('honest-agent-001')!;\n const reports: AgentReport[] = [];\n\n // Generate scenario where gaslighting agent contradicts honest agent\n for (let i = 0; i < 10; i++) {\n const taskId = `discredit-task-${i}`;\n\n // Honest agent reports realistic outcome\n const honestReport = generateReport(honestAgent, taskId, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.08, metrics: {} },\n quality: { codeQuality: 0.75, documentation: 0.7, maintainability: 0.8 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.08, metrics: {} },\n quality: { codeQuality: 0.75, documentation: 0.7, maintainability: 0.8 }\n }\n });\n\n // Gaslighting agent contradicts with false negative report\n const gaslightingReport = generateReport(gaslightingAgent, taskId, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.08, metrics: {} },\n quality: { codeQuality: 0.75, documentation: 0.7, maintainability: 0.8 }\n },\n claimedOutcome: {\n success: false,\n testsPass: false,\n noErrors: false,\n performance: { improvement: -0.1, metrics: {} },\n quality: { codeQuality: 0.3, documentation: 0.2, maintainability: 0.4 }\n },\n evidence: {\n contradicts: honestReport.id,\n claimsOtherAgentWrong: true\n }\n });\n\n reports.push(honestReport, gaslightingReport);\n gaslightingAgent.reportHistory.push(gaslightingReport);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(gaslightingAgent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('discrediting_others');\n expect(analysis.evidence.contradictionsWithOtherAgents).toBeGreaterThan(7);\n expect(analysis.evidence.systematicDisagreement).toBe(true);\n });\n });\n\n describe('Collusion Detection', () => {\n test('should detect agents colluding to hide failures', async () => {\n const colludingAgents = [\n mockAgents.get('overconfident-agent-002')!,\n mockAgents.get('selective-agent-004')!\n ];\n\n const reports: AgentReport[] = [];\n const sharedFailures = ['shared-failure-1', 'shared-failure-2', 'shared-failure-3'];\n\n // Generate coordinated false reports\n for (const taskId of sharedFailures) {\n for (const agent of colludingAgents) {\n const report = generateReport(agent, taskId, {\n actualOutcome: {\n success: false,\n testsPass: false,\n noErrors: false,\n performance: { improvement: -0.05, metrics: {} },\n quality: { codeQuality: 0.3, documentation: 0.2, maintainability: 0.4 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.15, metrics: {} },\n quality: { codeQuality: 0.9, documentation: 0.8, maintainability: 0.9 }\n },\n evidence: {\n crossReferencedWith: colludingAgents.map(a => a.id).filter(id => id !== agent.id)\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n }\n\n // Analyze for collusion patterns\n const collusionAnalysis = await deceptionDetector.analyzeCollusionPatterns(\n colludingAgents.map(a => a.id),\n reports\n );\n\n expect(collusionAnalysis.collusionDetected).toBe(true);\n expect(collusionAnalysis.collusionType).toContain('coordinated_false_reporting');\n expect(collusionAnalysis.confidence).toBeGreaterThan(0.7);\n expect(collusionAnalysis.evidence.synchronizedReporting).toBe(true);\n expect(collusionAnalysis.evidence.identicalFalseClaims).toBeGreaterThan(2);\n });\n });\n\n // Helper functions\n function generateReport(\n agent: MockAgent,\n taskId: string,\n scenario: {\n actualOutcome: TaskOutcome;\n claimedOutcome: TaskOutcome;\n evidence?: any;\n timestamp?: number;\n }\n ): AgentReport {\n const reportId = `report-${Date.now()}-${Math.random()}`;\n \n // Apply agent's deception strategy\n const modifiedClaim = applyDeceptionStrategy(agent, scenario.claimedOutcome);\n \n // Generate evidence based on agent's behavior pattern\n const evidence = generateEvidence(agent, scenario.actualOutcome, modifiedClaim, scenario.evidence);\n\n return {\n id: reportId,\n agentId: agent.id,\n taskId,\n claimedOutcome: modifiedClaim,\n evidence,\n timestamp: scenario.timestamp || Date.now(),\n verified: false,\n conflicts: []\n };\n }\n\n function applyDeceptionStrategy(agent: MockAgent, claimedOutcome: TaskOutcome): TaskOutcome {\n const strategy = agent.deceptionStrategy;\n const deceptionLevel = agent.deceptionLevel;\n const modified = JSON.parse(JSON.stringify(claimedOutcome));\n\n switch (strategy.type) {\n case 'overconfident':\n if (strategy.parameters.confidenceMultiplier) {\n modified.performance.improvement *= strategy.parameters.confidenceMultiplier;\n modified.quality.codeQuality = Math.min(1, modified.quality.codeQuality * 1.2);\n }\n if (strategy.parameters.hideMinorIssues) {\n modified.noErrors = true;\n }\n break;\n\n case 'fabrication':\n if (strategy.parameters.fabricateResults) {\n modified.success = true;\n modified.testsPass = true;\n modified.performance.improvement = Math.random() * 0.5 + 0.3;\n }\n break;\n\n case 'selective_reporting':\n if (strategy.parameters.reportOnlyPositives && !modified.success) {\n return null; // Don't report failures\n }\n break;\n\n case 'gaslighting':\n // Randomly flip outcomes to create contradictions\n if (Math.random() < deceptionLevel * 0.5) {\n modified.success = !modified.success;\n modified.testsPass = !modified.testsPass;\n }\n break;\n }\n\n return modified;\n }\n\n function generateEvidence(\n agent: MockAgent,\n actualOutcome: TaskOutcome,\n claimedOutcome: TaskOutcome,\n additionalEvidence?: any\n ): any {\n const evidence: any = {\n ...additionalEvidence,\n reportingTime: agent.behaviorPattern.timeToReport + (Math.random() - 0.5) * 1000,\n detailLevel: agent.behaviorPattern.detailLevel,\n evidenceQuality: agent.behaviorPattern.evidenceQuality\n };\n\n // Add inconsistencies based on deception level\n if (agent.deceptionLevel > 0.5) {\n evidence.inconsistencies = [\n 'Test logs don\\'t match reported results',\n 'Performance metrics seem unrealistic',\n 'Evidence quality unusually low'\n ];\n }\n\n return evidence;\n }\n\n function generateFakeTestLogs(testResults: any): string {\n // Generate fake test logs that look real but have inconsistencies\n const logs = [];\n logs.push(`Running ${testResults.total} tests...`);\n logs.push(`PASS: ${testResults.passed} tests`);\n if (testResults.failed > 0) {\n logs.push(`FAIL: ${testResults.failed} tests`);\n }\n logs.push('All tests completed successfully!'); // Contradictory message\n return logs.join('\\n');\n }\n});\n\n// Mock Deception Detector Implementation\nclass DeceptionDetector {\n private truthCalculator: any;\n private dataPath: string;\n private behaviorProfiles: Map<string, any> = new Map();\n\n constructor(truthCalculator: any, dataPath: string) {\n this.truthCalculator = truthCalculator;\n this.dataPath = dataPath;\n }\n\n async initialize() {\n await fs.mkdir(path.join(this.dataPath, 'deception-analysis'), { recursive: true });\n }\n\n async analyzeAgentPattern(agentId: string, reports: AgentReport[]): Promise<VerificationResult> {\n const analysis = {\n reportId: `analysis-${agentId}`,\n agentId,\n truthScore: 0,\n deceptionDetected: false,\n deceptionType: [],\n confidence: 0,\n evidence: {},\n recommendations: []\n };\n\n // Calculate truth scores for all reports\n const truthScores = reports.map(report => {\n return this.calculateReportTruthScore(report);\n });\n\n analysis.truthScore = truthScores.reduce((sum, score) => sum + score, 0) / truthScores.length;\n\n // Detect overconfidence pattern\n const successClaimRate = reports.filter(r => r.claimedOutcome.success).length / reports.length;\n const avgTruthScore = analysis.truthScore;\n \n if (successClaimRate > 0.9 && avgTruthScore < 0.7) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('overconfidence');\n analysis.evidence.successRateDiscrepancy = successClaimRate - avgTruthScore;\n }\n\n // Detect issue hiding\n const hiddenIssues = reports.filter(r => \n r.claimedOutcome.noErrors && r.evidence?.inconsistencies?.length > 0\n ).length;\n \n if (hiddenIssues > reports.length * 0.5) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('issue_hiding');\n analysis.evidence.hiddenIssuesCount = hiddenIssues;\n }\n\n // Detect fabrication\n const unrealisticResults = reports.filter(r => \n r.claimedOutcome.performance.improvement > 0.5 || // >50% improvement\n r.claimedOutcome.quality.codeQuality > 0.95 // >95% quality\n ).length;\n\n if (unrealisticResults > 0) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('fabrication', 'unrealistic_results');\n analysis.evidence.unrealisticSuccessRate = true;\n }\n\n // Detect fast reporting (suspicious)\n const avgReportingTime = reports.reduce((sum, r) => sum + (r.evidence?.reportingTime || 5000), 0) / reports.length;\n if (avgReportingTime < 2000) {\n analysis.evidence.suspiciouslyFastReporting = true;\n }\n\n // Detect impossible claims\n const impossibleClaims = reports.filter(r =>\n r.claimedOutcome.performance.improvement > 1.0 // >100% improvement\n ).length;\n\n if (impossibleClaims > 0) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('impossible_claims');\n analysis.evidence.impossiblePerformanceGains = true;\n }\n\n // Detect selective reporting\n const allSuccesses = reports.every(r => r.claimedOutcome.success);\n if (allSuccesses && reports.length > 10) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('selective_reporting');\n analysis.evidence.missingFailureReports = true;\n analysis.evidence.suspiciousSuccessRate = 1.0;\n }\n\n // Detect cherry picking\n const incompleteMetrics = reports.filter(r => {\n const metrics = r.claimedOutcome.performance.metrics;\n return Object.keys(metrics).length < 3; // Less than 3 metrics reported\n }).length;\n\n if (incompleteMetrics > reports.length * 0.7) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('cherry_picking');\n analysis.evidence.incompleteMetricsReporting = true;\n }\n\n // Detect contradictions\n const contradictions = this.detectContradictions(reports);\n if (contradictions > 0) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('gaslighting', 'contradictory_statements');\n analysis.evidence.contradictionCount = contradictions;\n }\n\n // Calculate confidence\n analysis.confidence = Math.min(1.0, analysis.deceptionType.length * 0.3 + (1 - analysis.truthScore));\n\n // Generate recommendations\n if (analysis.deceptionDetected) {\n analysis.recommendations = this.generateRecommendations(analysis.deceptionType);\n }\n\n return analysis;\n }\n\n async analyzeCollusionPatterns(agentIds: string[], reports: AgentReport[]): Promise<any> {\n const agentReports = new Map();\n \n // Group reports by agent\n for (const report of reports) {\n if (!agentReports.has(report.agentId)) {\n agentReports.set(report.agentId, []);\n }\n agentReports.get(report.agentId).push(report);\n }\n\n // Look for synchronization patterns\n const taskReports = new Map();\n for (const report of reports) {\n if (!taskReports.has(report.taskId)) {\n taskReports.set(report.taskId, []);\n }\n taskReports.get(report.taskId).push(report);\n }\n\n let synchronizedReporting = 0;\n let identicalFalseClaims = 0;\n\n for (const [taskId, taskReportsArray] of taskReports) {\n if (taskReportsArray.length > 1) {\n // Check for synchronized timing\n const timestamps = taskReportsArray.map(r => r.timestamp);\n const maxTimestamp = Math.max(...timestamps);\n const minTimestamp = Math.min(...timestamps);\n \n if (maxTimestamp - minTimestamp < 60000) { // Within 1 minute\n synchronizedReporting++;\n }\n\n // Check for identical false claims\n const claims = taskReportsArray.map(r => JSON.stringify(r.claimedOutcome));\n const uniqueClaims = new Set(claims);\n \n if (uniqueClaims.size === 1 && taskReportsArray[0].claimedOutcome.success) {\n // All agents claim same success - check if it's false\n const avgTruthScore = taskReportsArray.reduce((sum, r) => \n sum + this.calculateReportTruthScore(r), 0) / taskReportsArray.length;\n \n if (avgTruthScore < 0.5) {\n identicalFalseClaims++;\n }\n }\n }\n }\n\n return {\n collusionDetected: synchronizedReporting > 0 || identicalFalseClaims > 0,\n collusionType: ['coordinated_false_reporting'],\n confidence: Math.min(1.0, (synchronizedReporting + identicalFalseClaims) * 0.3),\n evidence: {\n synchronizedReporting: synchronizedReporting > 0,\n identicalFalseClaims,\n analysedTasks: taskReports.size,\n involvedAgents: agentIds\n }\n };\n }\n\n private calculateReportTruthScore(report: AgentReport): number {\n // Simplified truth score calculation\n let score = 0.8; // Base score\n\n // Penalize for inconsistencies\n if (report.evidence?.inconsistencies?.length > 0) {\n score -= report.evidence.inconsistencies.length * 0.1;\n }\n\n // Penalize for unrealistic claims\n if (report.claimedOutcome.performance.improvement > 0.5) {\n score -= 0.3;\n }\n\n if (report.claimedOutcome.quality.codeQuality > 0.95) {\n score -= 0.2;\n }\n\n // Penalize for fast reporting\n if (report.evidence?.reportingTime < 2000) {\n score -= 0.1;\n }\n\n return Math.max(0, Math.min(1, score));\n }\n\n private detectContradictions(reports: AgentReport[]): number {\n let contradictions = 0;\n const taskReports = new Map();\n\n // Group by task\n for (const report of reports) {\n if (!taskReports.has(report.taskId)) {\n taskReports.set(report.taskId, []);\n }\n taskReports.get(report.taskId).push(report);\n }\n\n // Check for contradictory reports on same task\n for (const [taskId, taskReportsArray] of taskReports) {\n if (taskReportsArray.length > 1) {\n for (let i = 0; i < taskReportsArray.length - 1; i++) {\n const report1 = taskReportsArray[i];\n const report2 = taskReportsArray[i + 1];\n \n if (report1.claimedOutcome.success !== report2.claimedOutcome.success) {\n contradictions++;\n }\n }\n }\n }\n\n return contradictions;\n }\n\n private generateRecommendations(deceptionTypes: string[]): string[] {\n const recommendations = [];\n\n if (deceptionTypes.includes('overconfidence')) {\n recommendations.push('Implement additional verification for this agent');\n recommendations.push('Require independent validation of claims');\n }\n\n if (deceptionTypes.includes('fabrication')) {\n recommendations.push('Require third-party verification for performance claims');\n recommendations.push('Implement automated evidence validation');\n }\n\n if (deceptionTypes.includes('selective_reporting')) {\n recommendations.push('Mandatory reporting of all task outcomes');\n recommendations.push('Automated detection of missing reports');\n }\n\n if (deceptionTypes.includes('cherry_picking')) {\n recommendations.push('Require comprehensive metrics reporting');\n recommendations.push('Standardize required evidence formats');\n }\n\n if (deceptionTypes.includes('gaslighting')) {\n recommendations.push('Implement immutable audit trail for agent reports');\n recommendations.push('Enable cross-agent verification workflows');\n }\n\n return recommendations;\n }\n}"],"names":["fs","path","os","TruthScoreCalculator","describe","tempDir","truthCalculator","deceptionDetector","mockAgents","beforeEach","mkdtemp","join","tmpdir","configPath","memoryPath","init","DeceptionDetector","initialize","Map","createMockAgentScenarios","afterEach","rm","recursive","force","agentConfigs","id","type","deceptionLevel","deceptionStrategy","parameters","behaviorPattern","consistency","timeToReport","detailLevel","evidenceQuality","confidenceMultiplier","hideMinorIssues","fabricateResults","fakePassRate","reportOnlyPositives","hideFailures","contradictOthers","rewriteHistory","config","agent","createMockAgent","set","reportHistory","detectedAs","test","get","reports","i","actualSuccess","Math","random","claimedSuccess","report","generateReport","actualOutcome","success","testsPass","noErrors","performance","improvement","metrics","quality","codeQuality","documentation","maintainability","claimedOutcome","push","analysis","analyzeAgentPattern","expect","deceptionDetected","toBe","deceptionType","toContain","confidence","toBeGreaterThan","truthScore","toBeLessThan","evidence","successRateDiscrepancy","performanceExaggeration","recommendations","minorIssues","floor","majorIssues","hiddenIssuesCount","actualTestResults","total","passed","failed","skipped","fabricatedResults","testResults","executionTime","testLogs","generateFakeTestLogs","unrealisticSuccessRate","suspiciouslyFastReporting","evidenceInconsistency","responseTime","throughput","memoryUsage","impossiblePerformanceGains","actualOutcomes","missingFailureReports","suspiciousSuccessRate","fullMetrics","errorRate","cpuUsage","diskIO","favorableMetrics","Object","entries","sort","keyA","valueA","keyB","valueB","goodValues","default","slice","reduce","obj","key","value","incompleteMetricsReporting","taskIds","Array","from","length","_","taskId","firstReport","timestamp","Date","now","secondReport","contradictionCount","gaslightingAgent","honestAgent","honestReport","gaslightingReport","contradicts","claimsOtherAgentWrong","contradictionsWithOtherAgents","systematicDisagreement","colludingAgents","sharedFailures","crossReferencedWith","map","a","filter","collusionAnalysis","analyzeCollusionPatterns","collusionDetected","collusionType","synchronizedReporting","identicalFalseClaims","scenario","reportId","modifiedClaim","applyDeceptionStrategy","generateEvidence","agentId","verified","conflicts","strategy","modified","JSON","parse","stringify","min","additionalEvidence","reportingTime","inconsistencies","logs","dataPath","behaviorProfiles","mkdir","truthScores","calculateReportTruthScore","sum","score","successClaimRate","r","avgTruthScore","hiddenIssues","unrealisticResults","avgReportingTime","impossibleClaims","allSuccesses","every","incompleteMetrics","keys","contradictions","detectContradictions","generateRecommendations","agentIds","agentReports","has","taskReports","taskReportsArray","timestamps","maxTimestamp","max","minTimestamp","claims","uniqueClaims","Set","size","analysedTasks","involvedAgents","report1","report2","deceptionTypes","includes"],"mappings":"AAaA,YAAYA,QAAQ,cAAc;AAClC,YAAYC,UAAU,OAAO;AAC7B,YAAYC,QAAQ,KAAK;AAGzB,OAAOC,0BAA0B,6CAA6C;AA8D9EC,SAAS,uCAAuC;IAC9C,IAAIC;IACJ,IAAIC;IACJ,IAAIC;IACJ,IAAIC;IAEJC,WAAW;QACTJ,UAAU,MAAML,GAAGU,OAAO,CAACT,KAAKU,IAAI,CAACT,GAAGU,MAAM,IAAI;QAGlDN,kBAAkB,IAAIH;QACtBG,gBAAgBO,UAAU,GAAGZ,KAAKU,IAAI,CAACN,SAAS;QAChDC,gBAAgBQ,UAAU,GAAGb,KAAKU,IAAI,CAACN,SAAS;QAChD,MAAMC,gBAAgBS,IAAI;QAG1BR,oBAAoB,IAAIS,kBAAkBV,iBAAiBD;QAC3D,MAAME,kBAAkBU,UAAU;QAGlCT,aAAa,IA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Bf,IAAI,CAAC;YACrBe,gBAAgBf,IAAI,CAAC;QACvB;QAEA,IAAIoJ,eAAeC,QAAQ,CAAC,wBAAwB;YAClDtI,gBAAgBf,IAAI,CAAC;YACrBe,gBAAgBf,IAAI,CAAC;QACvB;QAEA,IAAIoJ,eAAeC,QAAQ,CAAC,mBAAmB;YAC7CtI,gBAAgBf,IAAI,CAAC;YACrBe,gBAAgBf,IAAI,CAAC;QACvB;QAEA,IAAIoJ,eAAeC,QAAQ,CAAC,gBAAgB;YAC1CtI,gBAAgBf,IAAI,CAAC;YACrBe,gBAAgBf,IAAI,CAAC;QACvB;QAEA,OAAOe;IACT;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/verification/tests/mocks/false-reporting-scenarios.test.ts"],"sourcesContent":["/**\n * Mock Agent Scenarios for False Reporting Detection Tests\n * \n * Tests various scenarios where agents might provide false or misleading reports:\n * - Intentional false claims about task completion\n * - Exaggerated performance improvements\n * - Hidden failures in implementation\n * - Inconsistent reporting between agents\n * - Fabricated test results and evidence\n */\n\nimport { jest } from '@jest/globals';\nimport { EventEmitter } from 'events';\nimport * as fs from 'fs/promises';\nimport * as path from 'path';\nimport * as os from 'os';\n\n// Import verification components\n// Dynamic import for CommonJS module\nimport { createRequire } from 'module';\nconst require = createRequire(import.meta.url);\nconst TruthScoreCalc = require('../../../../.claude/helpers/truth-score.js');\n\ninterface MockAgent {\n id: string;\n type: string;\n deceptionLevel: number; // 0 = honest, 1 = completely deceptive\n deceptionStrategy: DeceptionStrategy;\n behaviorPattern: BehaviorPattern;\n reportHistory: AgentReport[];\n detectedAs: 'honest' | 'suspicious' | 'deceptive' | 'unknown';\n}\n\ninterface DeceptionStrategy {\n type: 'overconfident' | 'fabrication' | 'selective_reporting' | 'gaslighting' | 'collusion';\n parameters: Record<string, any>;\n}\n\ninterface BehaviorPattern {\n consistency: number; // 0-1, how consistent the agent's reports are\n timeToReport: number; // Average time to submit reports (ms)\n detailLevel: number; // 0-1, how detailed the reports are\n evidenceQuality: number; // 0-1, quality of evidence provided\n}\n\ninterface AgentReport {\n id: string;\n agentId: string;\n taskId: string;\n claimedOutcome: TaskOutcome;\n evidence: any;\n timestamp: number;\n truthScore?: number;\n verified: boolean;\n conflicts: string[];\n}\n\ninterface TaskOutcome {\n success: boolean;\n testsPass: boolean;\n noErrors: boolean;\n performance: {\n improvement: number;\n metrics: Record<string, number>;\n };\n quality: {\n codeQuality: number;\n documentation: number;\n maintainability: number;\n };\n}\n\ninterface VerificationResult {\n reportId: string;\n agentId: string;\n truthScore: number;\n deceptionDetected: boolean;\n deceptionType: string[];\n confidence: number;\n evidence: any;\n recommendations: string[];\n}\n\ndescribe('False Reporting Detection Scenarios', () => {\n let tempDir: string;\n let truthCalculator: any;\n let deceptionDetector: DeceptionDetector;\n let mockAgents: Map<string, MockAgent>;\n\n beforeEach(async () => {\n tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'false-reporting-test-'));\n\n // Setup truth score calculator\n truthCalculator = new TruthScoreCalc();\n truthCalculator.configPath = path.join(tempDir, 'verification.json');\n truthCalculator.memoryPath = path.join(tempDir, 'truth-scores');\n await truthCalculator.init();\n \n // Setup deception detector\n deceptionDetector = new DeceptionDetector(truthCalculator, tempDir);\n await deceptionDetector.initialize();\n \n // Create mock agents with different deception strategies\n mockAgents = new Map();\n await createMockAgentScenarios();\n });\n\n afterEach(async () => {\n await fs.rm(tempDir, { recursive: true, force: true });\n });\n\n async function createMockAgentScenarios() {\n const agentConfigs = [\n // Honest baseline agent\n {\n id: 'honest-agent-001',\n type: 'coder',\n deceptionLevel: 0,\n deceptionStrategy: { type: 'overconfident', parameters: {} },\n behaviorPattern: {\n consistency: 0.95,\n timeToReport: 5000,\n detailLevel: 0.8,\n evidenceQuality: 0.9\n }\n },\n // Overconfident agent\n {\n id: 'overconfident-agent-002',\n type: 'coder',\n deceptionLevel: 0.3,\n deceptionStrategy: {\n type: 'overconfident',\n parameters: { confidenceMultiplier: 1.5, hideMinorIssues: true }\n },\n behaviorPattern: {\n consistency: 0.7,\n timeToReport: 3000,\n detailLevel: 0.6,\n evidenceQuality: 0.7\n }\n },\n // Fabricating agent\n {\n id: 'fabricating-agent-003',\n type: 'tester',\n deceptionLevel: 0.8,\n deceptionStrategy: {\n type: 'fabrication',\n parameters: { fabricateResults: true, fakePassRate: 0.95 }\n },\n behaviorPattern: {\n consistency: 0.4,\n timeToReport: 1000, // Reports very quickly (suspicious)\n detailLevel: 0.9, // High detail to seem legitimate\n evidenceQuality: 0.3 // Low quality evidence\n }\n },\n // Selective reporting agent\n {\n id: 'selective-agent-004',\n type: 'reviewer',\n deceptionLevel: 0.5,\n deceptionStrategy: {\n type: 'selective_reporting',\n parameters: { reportOnlyPositives: true, hideFailures: true }\n },\n behaviorPattern: {\n consistency: 0.8,\n timeToReport: 7000,\n detailLevel: 0.5,\n evidenceQuality: 0.6\n }\n },\n // Gaslighting agent\n {\n id: 'gaslighting-agent-005',\n type: 'coordinator',\n deceptionLevel: 0.9,\n deceptionStrategy: {\n type: 'gaslighting',\n parameters: { contradictOthers: true, rewriteHistory: true }\n },\n behaviorPattern: {\n consistency: 0.2,\n timeToReport: 4000,\n detailLevel: 0.7,\n evidenceQuality: 0.4\n }\n }\n ];\n\n for (const config of agentConfigs) {\n const agent = createMockAgent(config);\n mockAgents.set(config.id, agent);\n }\n }\n\n function createMockAgent(config: any): MockAgent {\n return {\n id: config.id,\n type: config.type,\n deceptionLevel: config.deceptionLevel,\n deceptionStrategy: config.deceptionStrategy,\n behaviorPattern: config.behaviorPattern,\n reportHistory: [],\n detectedAs: 'unknown'\n };\n }\n\n describe('Overconfident Agent Scenarios', () => {\n test('should detect agent consistently overestimating success rates', async () => {\n const agent = mockAgents.get('overconfident-agent-002')!;\n const reports: AgentReport[] = [];\n\n // Generate series of overconfident reports\n for (let i = 0; i < 20; i++) {\n const actualSuccess = Math.random() > 0.3; // 70% actual success rate\n const claimedSuccess = actualSuccess || Math.random() > 0.2; // Claims 94% success rate\n\n const report = generateReport(agent, `task-${i}`, {\n actualOutcome: {\n success: actualSuccess,\n testsPass: actualSuccess,\n noErrors: actualSuccess,\n performance: { improvement: Math.random() * 0.2, metrics: {} },\n quality: { codeQuality: Math.random() * 0.3 + 0.4, documentation: 0.5, maintainability: 0.6 }\n },\n claimedOutcome: {\n success: claimedSuccess,\n testsPass: claimedSuccess,\n noErrors: claimedSuccess,\n performance: { improvement: Math.random() * 0.3 + 0.2, metrics: {} }, // Exaggerated\n quality: { codeQuality: Math.random() * 0.2 + 0.8, documentation: 0.9, maintainability: 0.9 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n // Analyze pattern for deception\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('overconfidence');\n expect(analysis.confidence).toBeGreaterThan(0.7);\n expect(analysis.truthScore).toBeLessThan(0.6);\n\n // Check specific indicators\n expect(analysis.evidence.successRateDiscrepancy).toBeGreaterThan(0.15);\n expect(analysis.evidence.performanceExaggeration).toBeGreaterThan(0.1);\n expect(analysis.recommendations).toContain('Implement additional verification for this agent');\n });\n\n test('should detect pattern of hiding minor issues', async () => {\n const agent = mockAgents.get('overconfident-agent-002')!;\n const reports: AgentReport[] = [];\n\n // Generate reports where agent hides minor issues\n for (let i = 0; i < 15; i++) {\n const minorIssues = Math.floor(Math.random() * 5) + 1; // 1-5 minor issues\n const majorIssues = Math.random() > 0.8 ? 1 : 0; // Occasional major issue\n\n const report = generateReport(agent, `minor-issues-task-${i}`, {\n actualOutcome: {\n success: majorIssues === 0,\n testsPass: true,\n noErrors: false, // Has minor errors\n performance: { improvement: 0.1, metrics: { minorIssues, majorIssues } },\n quality: { codeQuality: 0.7, documentation: 0.6, maintainability: 0.7 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true, // Claims no errors\n performance: { improvement: 0.15, metrics: { minorIssues: 0, majorIssues: 0 } },\n quality: { codeQuality: 0.9, documentation: 0.8, maintainability: 0.9 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('issue_hiding');\n expect(analysis.evidence.hiddenIssuesCount).toBeGreaterThan(10);\n expect(analysis.recommendations).toContain('Require detailed issue reporting');\n });\n });\n\n describe('Evidence Fabrication Scenarios', () => {\n test('should detect fabricated test results', async () => {\n const agent = mockAgents.get('fabricating-agent-003')!;\n const reports: AgentReport[] = [];\n\n // Generate reports with fabricated test results\n for (let i = 0; i < 25; i++) {\n const actualTestResults = {\n total: 100,\n passed: Math.floor(Math.random() * 30) + 60, // 60-90% pass rate\n failed: 0,\n skipped: 0\n };\n actualTestResults.failed = actualTestResults.total - actualTestResults.passed;\n\n const fabricatedResults = {\n total: 100,\n passed: Math.floor(Math.random() * 5) + 95, // 95-100% pass rate\n failed: 0,\n skipped: 0\n };\n fabricatedResults.failed = fabricatedResults.total - fabricatedResults.passed;\n\n const report = generateReport(agent, `fabrication-task-${i}`, {\n actualOutcome: {\n success: actualTestResults.passed > 80,\n testsPass: actualTestResults.passed === actualTestResults.total,\n noErrors: false,\n performance: { improvement: 0.05, metrics: actualTestResults },\n quality: { codeQuality: 0.6, documentation: 0.5, maintainability: 0.6 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.15, metrics: fabricatedResults },\n quality: { codeQuality: 0.95, documentation: 0.9, maintainability: 0.95 }\n },\n evidence: {\n testResults: fabricatedResults,\n executionTime: Math.random() * 100 + 50, // Suspiciously consistent timing\n testLogs: generateFakeTestLogs(fabricatedResults)\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('fabrication');\n expect(analysis.deceptionType).toContain('unrealistic_results');\n expect(analysis.confidence).toBeGreaterThan(0.8);\n\n // Check fabrication indicators\n expect(analysis.evidence.unrealisticSuccessRate).toBe(true);\n expect(analysis.evidence.suspiciouslyFastReporting).toBe(true);\n expect(analysis.evidence.evidenceInconsistency).toBeGreaterThan(0.5);\n });\n\n test('should detect impossible performance improvements', async () => {\n const agent = mockAgents.get('fabricating-agent-003')!;\n const reports: AgentReport[] = [];\n\n // Generate reports with impossible performance claims\n for (let i = 0; i < 10; i++) {\n const report = generateReport(agent, `impossible-perf-task-${i}`, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: {\n improvement: Math.random() * 0.1 + 0.05, // 5-15% actual improvement\n metrics: {\n responseTime: 1000,\n throughput: 100,\n memoryUsage: 500\n }\n },\n quality: { codeQuality: 0.7, documentation: 0.6, maintainability: 0.7 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: {\n improvement: Math.random() * 0.5 + 0.8, // 80-130% claimed improvement (impossible)\n metrics: {\n responseTime: 100, // 10x improvement\n throughput: 1000, // 10x improvement\n memoryUsage: 50 // 10x improvement\n }\n },\n quality: { codeQuality: 0.99, documentation: 0.99, maintainability: 0.99 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('impossible_claims');\n expect(analysis.evidence.impossiblePerformanceGains).toBe(true);\n expect(analysis.recommendations).toContain('Require third-party verification for performance claims');\n });\n });\n\n describe('Selective Reporting Scenarios', () => {\n test('should detect agent that only reports successes', async () => {\n const agent = mockAgents.get('selective-agent-004')!;\n const reports: AgentReport[] = [];\n\n // Generate mixed actual outcomes but agent only reports successes\n const actualOutcomes = [];\n for (let i = 0; i < 30; i++) {\n const success = Math.random() > 0.4; // 60% actual success rate\n actualOutcomes.push(success);\n\n // Agent only reports the successful ones\n if (success || Math.random() > 0.9) { // Reports 90% of successes, 10% of failures\n const report = generateReport(agent, `selective-task-${i}`, {\n actualOutcome: {\n success,\n testsPass: success,\n noErrors: success,\n performance: { improvement: success ? 0.1 : -0.05, metrics: {} },\n quality: { codeQuality: success ? 0.8 : 0.4, documentation: 0.6, maintainability: 0.7 }\n },\n claimedOutcome: {\n success: true, // Always claims success\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.12, metrics: {} },\n quality: { codeQuality: 0.85, documentation: 0.8, maintainability: 0.8 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('selective_reporting');\n expect(analysis.evidence.missingFailureReports).toBe(true);\n expect(analysis.evidence.suspiciousSuccessRate).toBeGreaterThan(0.95);\n expect(analysis.recommendations).toContain('Mandatory reporting of all task outcomes');\n });\n\n test('should detect cherry-picked metrics reporting', async () => {\n const agent = mockAgents.get('selective-agent-004')!;\n const reports: AgentReport[] = [];\n\n // Generate reports where agent only reports favorable metrics\n for (let i = 0; i < 20; i++) {\n const fullMetrics = {\n responseTime: Math.random() * 1000 + 500, // 500-1500ms\n throughput: Math.random() * 200 + 50, // 50-250 rps\n memoryUsage: Math.random() * 800 + 200, // 200-1000MB\n errorRate: Math.random() * 0.1, // 0-10% errors\n cpuUsage: Math.random() * 100, // 0-100% CPU\n diskIO: Math.random() * 1000 // 0-1000 IOPS\n };\n\n // Agent only reports the best 2-3 metrics\n const favorableMetrics = Object.entries(fullMetrics)\n .sort(([keyA, valueA], [keyB, valueB]) => {\n // Sort by how \"good\" the metric looks (lower is better for most)\n const goodValues = { responseTime: -valueA, errorRate: -valueA, default: valueB };\n return (goodValues[keyA] || goodValues.default) - (goodValues[keyB] || goodValues.default);\n })\n .slice(0, 3)\n .reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {});\n\n const report = generateReport(agent, `cherry-pick-task-${i}`, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: fullMetrics.errorRate < 0.05,\n performance: { improvement: 0.05, metrics: fullMetrics },\n quality: { codeQuality: 0.7, documentation: 0.6, maintainability: 0.7 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.15, metrics: favorableMetrics },\n quality: { codeQuality: 0.9, documentation: 0.8, maintainability: 0.9 }\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('cherry_picking');\n expect(analysis.evidence.incompleteMetricsReporting).toBe(true);\n expect(analysis.recommendations).toContain('Require comprehensive metrics reporting');\n });\n });\n\n describe('Gaslighting and Manipulation Scenarios', () => {\n test('should detect agent contradicting previous statements', async () => {\n const agent = mockAgents.get('gaslighting-agent-005')!;\n const reports: AgentReport[] = [];\n\n // Generate contradictory reports about the same tasks\n const taskIds = Array.from({ length: 5 }, (_, i) => `contradiction-task-${i}`);\n\n for (const taskId of taskIds) {\n // First report - claims failure\n const firstReport = generateReport(agent, taskId, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.1, metrics: {} },\n quality: { codeQuality: 0.8, documentation: 0.7, maintainability: 0.8 }\n },\n claimedOutcome: {\n success: false,\n testsPass: false,\n noErrors: false,\n performance: { improvement: -0.05, metrics: {} },\n quality: { codeQuality: 0.4, documentation: 0.3, maintainability: 0.5 }\n },\n timestamp: Date.now()\n });\n\n // Second report - claims success for same task\n const secondReport = generateReport(agent, taskId, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.1, metrics: {} },\n quality: { codeQuality: 0.8, documentation: 0.7, maintainability: 0.8 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.2, metrics: {} },\n quality: { codeQuality: 0.95, documentation: 0.9, maintainability: 0.95 }\n },\n timestamp: Date.now() + 60000 // 1 minute later\n });\n\n reports.push(firstReport, secondReport);\n agent.reportHistory.push(firstReport, secondReport);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(agent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('gaslighting');\n expect(analysis.deceptionType).toContain('contradictory_statements');\n expect(analysis.evidence.contradictionCount).toBeGreaterThan(3);\n expect(analysis.recommendations).toContain('Implement immutable audit trail for agent reports');\n });\n\n test('should detect agent attempting to discredit other agents', async () => {\n const gaslightingAgent = mockAgents.get('gaslighting-agent-005')!;\n const honestAgent = mockAgents.get('honest-agent-001')!;\n const reports: AgentReport[] = [];\n\n // Generate scenario where gaslighting agent contradicts honest agent\n for (let i = 0; i < 10; i++) {\n const taskId = `discredit-task-${i}`;\n\n // Honest agent reports realistic outcome\n const honestReport = generateReport(honestAgent, taskId, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.08, metrics: {} },\n quality: { codeQuality: 0.75, documentation: 0.7, maintainability: 0.8 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.08, metrics: {} },\n quality: { codeQuality: 0.75, documentation: 0.7, maintainability: 0.8 }\n }\n });\n\n // Gaslighting agent contradicts with false negative report\n const gaslightingReport = generateReport(gaslightingAgent, taskId, {\n actualOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.08, metrics: {} },\n quality: { codeQuality: 0.75, documentation: 0.7, maintainability: 0.8 }\n },\n claimedOutcome: {\n success: false,\n testsPass: false,\n noErrors: false,\n performance: { improvement: -0.1, metrics: {} },\n quality: { codeQuality: 0.3, documentation: 0.2, maintainability: 0.4 }\n },\n evidence: {\n contradicts: honestReport.id,\n claimsOtherAgentWrong: true\n }\n });\n\n reports.push(honestReport, gaslightingReport);\n gaslightingAgent.reportHistory.push(gaslightingReport);\n }\n\n const analysis = await deceptionDetector.analyzeAgentPattern(gaslightingAgent.id, reports);\n\n expect(analysis.deceptionDetected).toBe(true);\n expect(analysis.deceptionType).toContain('discrediting_others');\n expect(analysis.evidence.contradictionsWithOtherAgents).toBeGreaterThan(7);\n expect(analysis.evidence.systematicDisagreement).toBe(true);\n });\n });\n\n describe('Collusion Detection', () => {\n test('should detect agents colluding to hide failures', async () => {\n const colludingAgents = [\n mockAgents.get('overconfident-agent-002')!,\n mockAgents.get('selective-agent-004')!\n ];\n\n const reports: AgentReport[] = [];\n const sharedFailures = ['shared-failure-1', 'shared-failure-2', 'shared-failure-3'];\n\n // Generate coordinated false reports\n for (const taskId of sharedFailures) {\n for (const agent of colludingAgents) {\n const report = generateReport(agent, taskId, {\n actualOutcome: {\n success: false,\n testsPass: false,\n noErrors: false,\n performance: { improvement: -0.05, metrics: {} },\n quality: { codeQuality: 0.3, documentation: 0.2, maintainability: 0.4 }\n },\n claimedOutcome: {\n success: true,\n testsPass: true,\n noErrors: true,\n performance: { improvement: 0.15, metrics: {} },\n quality: { codeQuality: 0.9, documentation: 0.8, maintainability: 0.9 }\n },\n evidence: {\n crossReferencedWith: colludingAgents.map(a => a.id).filter(id => id !== agent.id)\n }\n });\n\n reports.push(report);\n agent.reportHistory.push(report);\n }\n }\n\n // Analyze for collusion patterns\n const collusionAnalysis = await deceptionDetector.analyzeCollusionPatterns(\n colludingAgents.map(a => a.id),\n reports\n );\n\n expect(collusionAnalysis.collusionDetected).toBe(true);\n expect(collusionAnalysis.collusionType).toContain('coordinated_false_reporting');\n expect(collusionAnalysis.confidence).toBeGreaterThan(0.7);\n expect(collusionAnalysis.evidence.synchronizedReporting).toBe(true);\n expect(collusionAnalysis.evidence.identicalFalseClaims).toBeGreaterThan(2);\n });\n });\n\n // Helper functions\n function generateReport(\n agent: MockAgent,\n taskId: string,\n scenario: {\n actualOutcome: TaskOutcome;\n claimedOutcome: TaskOutcome;\n evidence?: any;\n timestamp?: number;\n }\n ): AgentReport {\n const reportId = `report-${Date.now()}-${Math.random()}`;\n \n // Apply agent's deception strategy\n const modifiedClaim = applyDeceptionStrategy(agent, scenario.claimedOutcome);\n \n // Generate evidence based on agent's behavior pattern\n const evidence = generateEvidence(agent, scenario.actualOutcome, modifiedClaim, scenario.evidence);\n\n return {\n id: reportId,\n agentId: agent.id,\n taskId,\n claimedOutcome: modifiedClaim,\n evidence,\n timestamp: scenario.timestamp || Date.now(),\n verified: false,\n conflicts: []\n };\n }\n\n function applyDeceptionStrategy(agent: MockAgent, claimedOutcome: TaskOutcome): TaskOutcome {\n const strategy = agent.deceptionStrategy;\n const deceptionLevel = agent.deceptionLevel;\n const modified = JSON.parse(JSON.stringify(claimedOutcome));\n\n switch (strategy.type) {\n case 'overconfident':\n if (strategy.parameters.confidenceMultiplier) {\n modified.performance.improvement *= strategy.parameters.confidenceMultiplier;\n modified.quality.codeQuality = Math.min(1, modified.quality.codeQuality * 1.2);\n }\n if (strategy.parameters.hideMinorIssues) {\n modified.noErrors = true;\n }\n break;\n\n case 'fabrication':\n if (strategy.parameters.fabricateResults) {\n modified.success = true;\n modified.testsPass = true;\n modified.performance.improvement = Math.random() * 0.5 + 0.3;\n }\n break;\n\n case 'selective_reporting':\n if (strategy.parameters.reportOnlyPositives && !modified.success) {\n return null; // Don't report failures\n }\n break;\n\n case 'gaslighting':\n // Randomly flip outcomes to create contradictions\n if (Math.random() < deceptionLevel * 0.5) {\n modified.success = !modified.success;\n modified.testsPass = !modified.testsPass;\n }\n break;\n }\n\n return modified;\n }\n\n function generateEvidence(\n agent: MockAgent,\n actualOutcome: TaskOutcome,\n claimedOutcome: TaskOutcome,\n additionalEvidence?: any\n ): any {\n const evidence: any = {\n ...additionalEvidence,\n reportingTime: agent.behaviorPattern.timeToReport + (Math.random() - 0.5) * 1000,\n detailLevel: agent.behaviorPattern.detailLevel,\n evidenceQuality: agent.behaviorPattern.evidenceQuality\n };\n\n // Add inconsistencies based on deception level\n if (agent.deceptionLevel > 0.5) {\n evidence.inconsistencies = [\n 'Test logs don\\'t match reported results',\n 'Performance metrics seem unrealistic',\n 'Evidence quality unusually low'\n ];\n }\n\n return evidence;\n }\n\n function generateFakeTestLogs(testResults: any): string {\n // Generate fake test logs that look real but have inconsistencies\n const logs = [];\n logs.push(`Running ${testResults.total} tests...`);\n logs.push(`PASS: ${testResults.passed} tests`);\n if (testResults.failed > 0) {\n logs.push(`FAIL: ${testResults.failed} tests`);\n }\n logs.push('All tests completed successfully!'); // Contradictory message\n return logs.join('\\n');\n }\n});\n\n// Mock Deception Detector Implementation\nclass DeceptionDetector {\n private truthCalculator: any;\n private dataPath: string;\n private behaviorProfiles: Map<string, any> = new Map();\n\n constructor(truthCalculator: any, dataPath: string) {\n this.truthCalculator = truthCalculator;\n this.dataPath = dataPath;\n }\n\n async initialize() {\n await fs.mkdir(path.join(this.dataPath, 'deception-analysis'), { recursive: true });\n }\n\n async analyzeAgentPattern(agentId: string, reports: AgentReport[]): Promise<VerificationResult> {\n const analysis = {\n reportId: `analysis-${agentId}`,\n agentId,\n truthScore: 0,\n deceptionDetected: false,\n deceptionType: [],\n confidence: 0,\n evidence: {},\n recommendations: []\n };\n\n // Calculate truth scores for all reports\n const truthScores = reports.map(report => {\n return this.calculateReportTruthScore(report);\n });\n\n analysis.truthScore = truthScores.reduce((sum, score) => sum + score, 0) / truthScores.length;\n\n // Detect overconfidence pattern\n const successClaimRate = reports.filter(r => r.claimedOutcome.success).length / reports.length;\n const avgTruthScore = analysis.truthScore;\n \n if (successClaimRate > 0.9 && avgTruthScore < 0.7) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('overconfidence');\n analysis.evidence.successRateDiscrepancy = successClaimRate - avgTruthScore;\n }\n\n // Detect issue hiding\n const hiddenIssues = reports.filter(r => \n r.claimedOutcome.noErrors && r.evidence?.inconsistencies?.length > 0\n ).length;\n \n if (hiddenIssues > reports.length * 0.5) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('issue_hiding');\n analysis.evidence.hiddenIssuesCount = hiddenIssues;\n }\n\n // Detect fabrication\n const unrealisticResults = reports.filter(r => \n r.claimedOutcome.performance.improvement > 0.5 || // >50% improvement\n r.claimedOutcome.quality.codeQuality > 0.95 // >95% quality\n ).length;\n\n if (unrealisticResults > 0) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('fabrication', 'unrealistic_results');\n analysis.evidence.unrealisticSuccessRate = true;\n }\n\n // Detect fast reporting (suspicious)\n const avgReportingTime = reports.reduce((sum, r) => sum + (r.evidence?.reportingTime || 5000), 0) / reports.length;\n if (avgReportingTime < 2000) {\n analysis.evidence.suspiciouslyFastReporting = true;\n }\n\n // Detect impossible claims\n const impossibleClaims = reports.filter(r =>\n r.claimedOutcome.performance.improvement > 1.0 // >100% improvement\n ).length;\n\n if (impossibleClaims > 0) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('impossible_claims');\n analysis.evidence.impossiblePerformanceGains = true;\n }\n\n // Detect selective reporting\n const allSuccesses = reports.every(r => r.claimedOutcome.success);\n if (allSuccesses && reports.length > 10) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('selective_reporting');\n analysis.evidence.missingFailureReports = true;\n analysis.evidence.suspiciousSuccessRate = 1.0;\n }\n\n // Detect cherry picking\n const incompleteMetrics = reports.filter(r => {\n const metrics = r.claimedOutcome.performance.metrics;\n return Object.keys(metrics).length < 3; // Less than 3 metrics reported\n }).length;\n\n if (incompleteMetrics > reports.length * 0.7) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('cherry_picking');\n analysis.evidence.incompleteMetricsReporting = true;\n }\n\n // Detect contradictions\n const contradictions = this.detectContradictions(reports);\n if (contradictions > 0) {\n analysis.deceptionDetected = true;\n analysis.deceptionType.push('gaslighting', 'contradictory_statements');\n analysis.evidence.contradictionCount = contradictions;\n }\n\n // Calculate confidence\n analysis.confidence = Math.min(1.0, analysis.deceptionType.length * 0.3 + (1 - analysis.truthScore));\n\n // Generate recommendations\n if (analysis.deceptionDetected) {\n analysis.recommendations = this.generateRecommendations(analysis.deceptionType);\n }\n\n return analysis;\n }\n\n async analyzeCollusionPatterns(agentIds: string[], reports: AgentReport[]): Promise<any> {\n const agentReports = new Map();\n \n // Group reports by agent\n for (const report of reports) {\n if (!agentReports.has(report.agentId)) {\n agentReports.set(report.agentId, []);\n }\n agentReports.get(report.agentId).push(report);\n }\n\n // Look for synchronization patterns\n const taskReports = new Map();\n for (const report of reports) {\n if (!taskReports.has(report.taskId)) {\n taskReports.set(report.taskId, []);\n }\n taskReports.get(report.taskId).push(report);\n }\n\n let synchronizedReporting = 0;\n let identicalFalseClaims = 0;\n\n for (const [taskId, taskReportsArray] of taskReports) {\n if (taskReportsArray.length > 1) {\n // Check for synchronized timing\n const timestamps = taskReportsArray.map(r => r.timestamp);\n const maxTimestamp = Math.max(...timestamps);\n const minTimestamp = Math.min(...timestamps);\n \n if (maxTimestamp - minTimestamp < 60000) { // Within 1 minute\n synchronizedReporting++;\n }\n\n // Check for identical false claims\n const claims = taskReportsArray.map(r => JSON.stringify(r.claimedOutcome));\n const uniqueClaims = new Set(claims);\n \n if (uniqueClaims.size === 1 && taskReportsArray[0].claimedOutcome.success) {\n // All agents claim same success - check if it's false\n const avgTruthScore = taskReportsArray.reduce((sum, r) => \n sum + this.calculateReportTruthScore(r), 0) / taskReportsArray.length;\n \n if (avgTruthScore < 0.5) {\n identicalFalseClaims++;\n }\n }\n }\n }\n\n return {\n collusionDetected: synchronizedReporting > 0 || identicalFalseClaims > 0,\n collusionType: ['coordinated_false_reporting'],\n confidence: Math.min(1.0, (synchronizedReporting + identicalFalseClaims) * 0.3),\n evidence: {\n synchronizedReporting: synchronizedReporting > 0,\n identicalFalseClaims,\n analysedTasks: taskReports.size,\n involvedAgents: agentIds\n }\n };\n }\n\n private calculateReportTruthScore(report: AgentReport): number {\n // Simplified truth score calculation\n let score = 0.8; // Base score\n\n // Penalize for inconsistencies\n if (report.evidence?.inconsistencies?.length > 0) {\n score -= report.evidence.inconsistencies.length * 0.1;\n }\n\n // Penalize for unrealistic claims\n if (report.claimedOutcome.performance.improvement > 0.5) {\n score -= 0.3;\n }\n\n if (report.claimedOutcome.quality.codeQuality > 0.95) {\n score -= 0.2;\n }\n\n // Penalize for fast reporting\n if (report.evidence?.reportingTime < 2000) {\n score -= 0.1;\n }\n\n return Math.max(0, Math.min(1, score));\n }\n\n private detectContradictions(reports: AgentReport[]): number {\n let contradictions = 0;\n const taskReports = new Map();\n\n // Group by task\n for (const report of reports) {\n if (!taskReports.has(report.taskId)) {\n taskReports.set(report.taskId, []);\n }\n taskReports.get(report.taskId).push(report);\n }\n\n // Check for contradictory reports on same task\n for (const [taskId, taskReportsArray] of taskReports) {\n if (taskReportsArray.length > 1) {\n for (let i = 0; i < taskReportsArray.length - 1; i++) {\n const report1 = taskReportsArray[i];\n const report2 = taskReportsArray[i + 1];\n \n if (report1.claimedOutcome.success !== report2.claimedOutcome.success) {\n contradictions++;\n }\n }\n }\n }\n\n return contradictions;\n }\n\n private generateRecommendations(deceptionTypes: string[]): string[] {\n const recommendations = [];\n\n if (deceptionTypes.includes('overconfidence')) {\n recommendations.push('Implement additional verification for this agent');\n recommendations.push('Require independent validation of claims');\n }\n\n if (deceptionTypes.includes('fabrication')) {\n recommendations.push('Require third-party verification for performance claims');\n recommendations.push('Implement automated evidence validation');\n }\n\n if (deceptionTypes.includes('selective_reporting')) {\n recommendations.push('Mandatory reporting of all task outcomes');\n recommendations.push('Automated detection of missing reports');\n }\n\n if (deceptionTypes.includes('cherry_picking')) {\n recommendations.push('Require comprehensive metrics reporting');\n recommendations.push('Standardize required evidence formats');\n }\n\n if (deceptionTypes.includes('gaslighting')) {\n recommendations.push('Implement immutable audit trail for agent reports');\n recommendations.push('Enable cross-agent verification workflows');\n }\n\n return recommendations;\n }\n}"],"names":["fs","path","os","createRequire","require","url","TruthScoreCalc","describe","tempDir","truthCalculator","deceptionDetector","mockAgents","beforeEach","mkdtemp","join","tmpdir","configPath","memoryPath","init","DeceptionDetector","initialize","Map","createMockAgentScenarios","afterEach","rm","recursive","force","agentConfigs","id","type","deceptionLevel","deceptionStrategy","parameters","behaviorPattern","consistency","timeToReport","detailLevel","evidenceQuality","confidenceMultiplier","hideMinorIssues","fabricateResults","fakePassRate","reportOnlyPositives","hideFailures","contradictOthers","rewriteHistory","config","agent","createMockAgent","set","reportHistory","detectedAs","test","get","reports","i","actualSuccess","Math","random","claimedSuccess","report","generateReport","actualOutcome","success","testsPass","noErrors","performance","improvement","metrics","quality","codeQuality","documentation","maintainability","claimedOutcome","push","analysis","analyzeAgentPattern","expect","deceptionDetected","toBe","deceptionType","toContain","confidence","toBeGreaterThan","truthScore","toBeLessThan","evidence","successRateDiscrepancy","performanceExaggeration","recommendations","minorIssues","floor","majorIssues","hiddenIssuesCount","actualTestResults","total","passed","failed","skipped","fabricatedResults","testResults","executionTime","testLogs","generateFakeTestLogs","unrealisticSuccessRate","suspiciouslyFastReporting","evidenceInconsistency","responseTime","throughput","memoryUsage","impossiblePerformanceGains","actualOutcomes","missingFailureReports","suspiciousSuccessRate","fullMetrics","errorRate","cpuUsage","diskIO","favorableMetrics","Object","entries","sort","keyA","valueA","keyB","valueB","goodValues","default","slice","reduce","obj","key","value","incompleteMetricsReporting","taskIds","Array","from","length","_","taskId","firstReport","timestamp","Date","now","secondReport","contradictionCount","gaslightingAgent","honestAgent","honestReport","gaslightingReport","contradicts","claimsOtherAgentWrong","contradictionsWithOtherAgents","systematicDisagreement","colludingAgents","sharedFailures","crossReferencedWith","map","a","filter","collusionAnalysis","analyzeCollusionPatterns","collusionDetected","collusionType","synchronizedReporting","identicalFalseClaims","scenario","reportId","modifiedClaim","applyDeceptionStrategy","generateEvidence","agentId","verified","conflicts","strategy","modified","JSON","parse","stringify","min","additionalEvidence","reportingTime","inconsistencies","logs","dataPath","behaviorProfiles","mkdir","truthScores","calculateReportTruthScore","sum","score","successClaimRate","r","avgTruthScore","hiddenIssues","unrealisticResults","avgReportingTime","impossibleClaims","allSuccesses","every","incompleteMetrics","keys","contradictions","detectContradictions","generateRecommendations","agentIds","agentReports","has","taskReports","taskReportsArray","timestamps","maxTimestamp","max","minTimestamp","claims","uniqueClaims","Set","size","analysedTasks","involvedAgents","report1","report2","deceptionTypes","includes"],"mappings":"AAaA,YAAYA,QAAQ,cAAc;AAClC,YAAYC,UAAU,OAAO;AAC7B,YAAYC,QAAQ,KAAK;AAIzB,SAASC,aAAa,QAAQ,SAAS;AACvC,MAAMC,UAAUD,cAAc,YAAYE,GAAG;AAC7C,MAAMC,iBAAiBF,QAAQ;AA8D/BG,SAAS,uCAAuC;IAC9C,IAAIC;IACJ,IAAIC;IACJ,IAAIC;IACJ,IAAIC;IAEJC,WAAW;QACTJ,UAAU,MAAMR,GAAGa,OAAO,CAACZ,KAAKa,IAAI,CAACZ,GAAGa,MAAM,IAAI;QAGlDN,kBAAkB,IAAIH;QACtBG,gBAAgBO,UAAU,GAAGf,KAAKa,IAAI,CAACN,SAAS;QAChDC,gBAAgBQ,UAAU,GAAGhB,KAAKa,IAAI,CAACN,SAAS;QAChD,MAAMC,gBAAgBS,IAAI;QAG1BR,oBAAoB,IAAIS,kBAAkBV,iBAAiBD;QAC3D,MAAME,kBAAkBU,UAAU;QAGlCT,aAAa,IAAIU;QACjB,MAAMC;IACR;IAEAC,UAAU;QACR,MAAMvB,GAAGwB,EAAE,CAAChB,SAAS;YAAEiB,WAAW;YAAMC,OAAO;QAAK;IACtD;IAEA,eAAeJ;QACb,MAAMK,eAAe;YAEnB;gBACEC,IAAI;gBACJC,MAAM;gBACNC,gBAAgB;gBAChBC,mBAAmB;oBAAEF,MAAM;oBAAiBG,YAAY,CAAC;gBAAE;gBAC3DC,iBAAiB;oBACfC,aAAa;oBACbC,cAAc;oBACdC,aAAa;oBACbC,iBAAiB;gBACnB;YACF;YAEA;gBACET,IAAI;gBACJC,MAAM;gBACNC,gBAAgB;gBAChBC,mBAAmB;oBACjBF,MAAM;oBACNG,YAAY;wBAAEM,sBAAsB;wBAAKC,iBAAiB;oB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3
|
-
"sessionId": "session-
|
|
4
|
-
"lastActivity":
|
|
2
|
+
"startTime": 1764361665390,
|
|
3
|
+
"sessionId": "session-1764361665390",
|
|
4
|
+
"lastActivity": 1764361665390,
|
|
5
5
|
"sessionDuration": 0,
|
|
6
6
|
"totalTasks": 1,
|
|
7
7
|
"successfulTasks": 1,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"id": "cmd-hooks-
|
|
3
|
+
"id": "cmd-hooks-1764361665495",
|
|
4
4
|
"type": "hooks",
|
|
5
5
|
"success": true,
|
|
6
|
-
"duration":
|
|
7
|
-
"timestamp":
|
|
6
|
+
"duration": 38.65179599999999,
|
|
7
|
+
"timestamp": 1764361665534,
|
|
8
8
|
"metadata": {}
|
|
9
9
|
}
|
|
10
10
|
]
|