{"record":{"id":"7a04076fa3d17264","repo":"ruvnet/ruflo","slug":"f-kind-f-severity-f-offset-f-re","errorCode":null,"errorMessage":"  - ${f.kind} (${f.severity}) @${f.offset}: ${f.reason}","messagePattern":"  - (.+?) \\((.+?)\\) @(.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/hooks/src/workers/channel-guard-worker.ts","lineNumber":299,"sourceCode":"/**\n * The gate itself: sanitizes `message` and logs a structured audit event\n * when findings are present, unless `CLAUDE_FLOW_SECURITY_CHANNEL_GATE=0`.\n * Call this at any point content is about to cross an inter-agent boundary.\n */\nexport function guardChannelMessage(message: string, options: ChannelGuardOptions = {}): ChannelGuardOutcome {\n  if (!isChannelGateEnabled()) {\n    return { content: message, result: null };\n  }\n\n  const { sanitized, result } = sanitizeChannelMessage(message, options);\n\n  if (!result.safe) {\n    console.warn(\n      `[channel-guard] sanitized ${result.findings.length} finding(s) in inter-agent message ` +\n        `(${result.stats.messageLength} chars, ${result.stats.scanTimeMs}ms scan)`,\n    );\n    for (const f of result.findings) {\n      console.warn(`  - ${f.kind} (${f.severity}) @${f.offset}: ${f.reason}`);\n    }\n  }\n\n  return { content: sanitized, result };\n}\n\n// ============================================================================\n// Hook registration (HookEvent.PostTask) — opt-in, not eagerly registered\n// ============================================================================\n\n/**\n * Builds a `HookHandler` that reads `context.data` as the message body (when\n * it is a string), guards it, and surfaces any findings as `HookResult`\n * warnings plus the sanitized content in `HookResult.data.sanitizedContent`.\n * Never aborts — ChannelGuard is a sanitize+log gate, not a blocking one\n * (see the ADR: only the Composition Inspector has a block mode).\n */\nexport function createChannelGuardHandler() {","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/hooks/src/workers/channel-guard-worker.ts#L281-L317","documentation":"Detail line following a channel-guard audit event: itemizes each sanitized finding — its kind, severity, byte offset, and reason — so operators can see exactly what was stripped from the inter-agent message.","triggerScenarios":"Thrown at v3/@claude-flow/hooks/src/workers/channel-guard-worker.ts:299 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the finding kind, severity, and offset; fix the source message content that triggered the guard."],"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-14T00:17:10.932Z"}