{"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/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/integrations/CcsAlignRulesWalker.ts#L522-L558","documentation":"walkRules flags DRIFT when a seat leaf line is close-but-not-exact to a house line (detectDrift), indicating the house text changed and the leaf still carries old wording. layer='seat'. It catches near-duplicates that SHADOW_HOUSE's exact-match check misses.","triggerScenarios":"House rules were edited upstream while a seat file kept an older, slightly different copy of the line; detectDrift's similarity heuristic matches it against allHouseLines.","commonSituations":"Manual edits to house rules not propagated to seat copies; merge conflicts resolved by keeping the leaf copy; forks that drifted from house wording.","solutions":["Update the seat line to the current house wording (given in detail as matchedHouseLine)","Or delete the seat line entirely and inherit the house rule","Diff the seat file against the house file to find all drifted lines","Re-run walkRules after syncing"],"exampleFix":"// before (seat)\nNever use emojis in any response.\n// after (house, updated wording)\nAvoid emojis in responses unless the user requests them.","handlingStrategy":"validation","validationCode":"// fuzzy check before shipping\nconst close = (a: string, b: string) =>\n  a.trim().toLowerCase().replace(/\\s+/g, ' ') === b.trim().toLowerCase().replace(/\\s+/g, ' ');\nif (houseLines.some(h => close(leaf, h))) console.warn('near-duplicate of house line');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Sync seat files whenever house rules change","Prefer inheritance over restating rules at leaf layers","Diff seat vs house files after house edits","Run drift detection in CI"],"tags":["lint","drift","rules","sync"],"backgroundTag":"conflicting-config-options","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}