{"record":{"id":"85975c98be8be382","repo":"ruvnet/ruflo","slug":"learning-not-enabled-pass-enablelearning-true","errorCode":null,"errorMessage":"Learning not enabled. Pass { enableLearning: true } to createAIDefence()","messagePattern":"Learning not enabled\\. Pass (.+?) to createAIDefence\\(\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/aidefence/src/index.ts","lineNumber":209,"sourceCode":"\n    quickScan(input: string) {\n      return detectionService.quickScan(input);\n    },\n\n    hasPII(input: string) {\n      return detectionService.detectPII(input);\n    },\n\n    async searchSimilarThreats(query, options) {\n      if (!learningService) {\n        return [];\n      }\n      return learningService.searchSimilarThreats(query, options);\n    },\n\n    async learnFromDetection(input, result, feedback) {\n      if (!learningService) {\n        console.warn('Learning not enabled. Pass { enableLearning: true } to createAIDefence()');\n        return;\n      }\n      await learningService.learnFromDetection(input, result, feedback);\n    },\n\n    async recordMitigation(threatType, strategy, success) {\n      if (!learningService) return;\n      await learningService.recordMitigation(threatType, strategy, success);\n    },\n\n    async getBestMitigation(threatType) {\n      if (!learningService) return null;\n      return learningService.getBestMitigation(threatType);\n    },\n\n    startTrajectory(sessionId, task) {\n      learningService?.startTrajectory(sessionId, task);\n    },","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/aidefence/src/index.ts#L191-L227","documentation":"Log warning in learnFromDetection: the factory was created without { enableLearning: true }, so no learning service exists and the learning call is a no-op returning immediately — a capability guard, not a thrown error.","triggerScenarios":"Thrown at v3/@claude-flow/aidefence/src/index.ts:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass { enableLearning: true } to createAIDefence() to enable the learning features being invoked."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}