{"record":{"id":"ff2719aef5ef8ad1","repo":"thedotmack/claude-mem","slug":"drift","errorCode":"DRIFT","errorMessage":"DRIFT","messagePattern":"DRIFT","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/integrations/CcsAlignRulesWalker.ts","lineNumber":540,"sourceCode":"          line: trimmed,\n          detail: shadow.matchedHouseLine\n            ? `Leaf duplicates house line: \"${shadow.matchedHouseLine}\"`\n            : 'Leaf starts with \"House rule\" — shadows the cascade',\n          houseMatch: shadow.matchedHouseLine,\n        });\n\n        if (!shadowPatchesByFile.has(entry.file)) {\n          shadowPatchesByFile.set(entry.file, new Set());\n        }\n        shadowPatchesByFile.get(entry.file)!.add(trimmed);\n      }\n\n      // DRIFT: leaf line is close-but-not-exact to a house line\n      if (!shadow.isShadow) {\n        const drift = detectDrift(trimmed, allHouseLines);\n        if (drift.isDrift) {\n          conflicts.push({\n            code: 'DRIFT',\n            layer: 'seat',\n            file: entry.file,\n            line: trimmed,\n            detail: drift.matchedHouseLine\n              ? `House text may have changed; leaf still has old wording. House: \"${drift.matchedHouseLine}\"`\n              : 'Possible drift from house text',\n          });\n        }\n      }\n\n      // DENY_ALLOW: check seat line against house+project lines\n      const denyAllow = detectDenyAllow(trimmed, houseProjectLines);\n      if (denyAllow.isDenyAllow) {\n        conflicts.push({\n          code: 'DENY_ALLOW',\n          layer: 'seat',\n          file: entry.file,\n          line: trimmed,","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/8bc631a71a487424b866756e43a6efa4574cc66b/src/services/integrations/CcsAlignRulesWalker.ts#L522-L558","documentation":"A conflict record emitted by CcsAlignRulesWalker.walkRules with code DRIFT: a leaf (seat-level) line is close-but-not-exact to a house line, per detectDrift. It usually means the house text was updated and the seat copy still carries the old wording, so the two layers now disagree in a subtle way that exact-match shadow detection missed.","triggerScenarios":"walkRules finds a seat line that detectDrift scores as near-matching some house line (fuzzy similarity above threshold but not identical).","commonSituations":"House rules were reworded ('always run tests' -> 'run the full test suite before commit') but seat files pinned the old phrasing; manual edits touched only one of two synced copies.","solutions":["Update the seat line to the current house wording, or delete it in favor of the house line","Diff the flagged line against the reported house line (in the detail field) and reconcile intentionally","If the similarity is coincidental, reword the seat line to break the fuzzy match","Re-run the walker to confirm the DRIFT entry is gone"],"exampleFix":"// before (seat file)\nAlways run tests before committing.\n// after\n(run the full test suite before commit   <- matches updated house line)\n// or simply delete the seat line","handlingStrategy":"validation","validationCode":"// flag near-duplicates of house lines in seat files\nfunction fuzzyEq(a: string, b: string): boolean {\n  const norm = (s: string) => s.toLowerCase().replace(/[^a-z0-9 ]/g, '');\n  return norm(a) === norm(b) || (norm(a).length > 0 && norm(b).includes(norm(a)));\n}\nseatLines.filter(s => houseLines.some(h => fuzzyEq(s, h) && s.trim() !== h.trim())).forEach(drifted);","typeGuard":"null","tryCatchPattern":"null","preventionTips":["After rewording house rules, grep seat files for the old phrasing","Prefer deleting seat copies over editing them in parallel with house","Run the DRIFT check whenever house rules change in a PR"],"tags":["rules-walker","conflict-detection","drift"],"backgroundTag":"schema-validation-failed","analyzedSha":"8bc631a71a487424b866756e43a6efa4574cc66b","analyzedAt":"2026-09-09T10:47:06.009Z","contentChangedAt":"2026-09-09T10:47:06.009Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}