🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
fix(daemon): stop the local audit worker faking a clean scan (#4563)
ordinary being77a346503040
diff --git a/v3/@claude-flow/cli/__tests__/worker-daemon-audit-honesty-4549.test.ts b/v3/@claude-flow/cli/__tests__/worker-daemon-audit-honesty-4549.test.tsnew file mode 100644index 0000000000..c46e2f4968--- /dev/null+++ b/v3/@claude-flow/cli/__tests__/worker-daemon-audit-honesty-4549.test.ts@@ -0,0 +1,49 @@+/**+ * #4549 automation scan: the daemon's default-on, critical-priority local+ * audit worker hardcoded noHardcodedSecrets:true and riskLevel:'low' without+ * scanning anything. That is a believable false-negative security claim.+ */+import { afterEach, beforeEach, describe, expect, it } from 'vitest';+import { mkdtempSync, readFileSync, rmSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join } from 'node:path';+import { WorkerDaemon } from '../src/services/worker-daemon.js';++let dir: string;+let daemon: WorkerDaemon;++beforeEach(() => {+ dir = mkdtempSync(join(tmpdir(), 'worker-daemon-audit-honesty-'));+ daemon = new WorkerDaemon(dir, { aiWorkersEnabled: false });+});++afterEach(() => {+ rmSync(dir, { recursive: true, force: true });+ process.removeAllListeners('SIGTERM');+ process.removeAllListeners('SIGINT');+ process.removeAllListeners('SIGHUP');+});++describe('WorkerDaemon local audit report honesty (#4549)', () => {+ it('does not claim a secret scan or a low risk level when none was performed', async () => {+ const audit = await (daemon as unknown as {+ runAuditWorkerLocal(): Promise<{+ scanned: boolean;+ riskLevel: string;+ checks: { noHardcodedSecrets: boolean | null };+ note: string;+ }>;+ }).runAuditWorkerLocal();++ expect(audit.scanned).toBe(false);+ expect(audit.riskLevel).toBe('unknown');+ expect(audit.checks.noHardcodedSecrets).toBeNull();+ expect(audit.note).toMatch(/does not scan source contents/i);++ const persisted = JSON.parse(readFileSync(+ join(dir, '.claude-flow', 'metrics', 'security-audit.json'),+ 'utf-8',+ ));+ expect(persisted).toEqual(audit);+ });+});diff --git a/v3/@claude-flow/cli/src/services/worker-daemon.ts b/v3/@claude-flow/cli/src/services/worker-daemon.tsindex c75b05e62d..9cfb7321ab 100644--- a/v3/@claude-flow/cli/src/services/worker-daemon.ts+++ b/v3/@claude-flow/cli/src/services/worker-daemon.ts@@ -1790,14 +1790,21 @@ export class WorkerDaemon extends EventEmitter {const audit = {timestamp: new Date().toISOString(),mode: 'local',+ // This fallback performs file-presence checks only. It must not report+ // a clean secret scan or a low risk level it did not actually establish:+ // the worker runs by default at critical priority, so a fabricated+ // noHardcodedSecrets/riskLevel pair is a believable false negative.+ scanned: false,checks: {envFilesProtected: !existsSync(join(this.projectRoot, '.env.local')),gitIgnoreExists: existsSync(join(this.projectRoot, '.gitignore')),- noHardcodedSecrets: true, // Would need actual scanning+ noHardcodedSecrets: null,},- riskLevel: 'low',- recommendations: [],- note: 'Install Claude Code CLI for AI-powered security analysis',+ riskLevel: 'unknown',+ recommendations: [+ 'No secret scan or code analysis was performed by the local fallback; install Claude Code CLI for AI-powered security analysis.',+ ],+ note: 'Local fallback checks file presence only; it does not scan source contents.',};writeFileSync(auditFile, JSON.stringify(audit, null, 2));