{"record":{"id":"d13673dede6debcd","repo":"thedotmack/claude-mem","slug":"shadow-house","errorCode":"SHADOW_HOUSE","errorMessage":"SHADOW_HOUSE","messagePattern":"SHADOW_HOUSE","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/integrations/CcsAlignRulesWalker.ts","lineNumber":519,"sourceCode":"          detail: 'Top-of-prompt clock or \"current time is\" in a profile (house rule: no clock in prefix)',\n        });\n      }\n    }\n  }\n\n  // Seat-layer specific conflict detection (against house)\n  const shadowPatchesByFile = new Map<string, Set<string>>();\n\n  for (const entry of seat.entries) {\n    for (const line of entry.lines) {\n      const trimmed = line.trim();\n      if (trimmed.length === 0) continue;\n\n      // SHADOW_HOUSE: leaf line also at house (or starts with \"House rule\")\n      const shadow = detectShadowHouse(trimmed, houseLineSet);\n      if (shadow.isShadow) {\n        conflicts.push({\n          code: 'SHADOW_HOUSE',\n          layer: 'seat',\n          file: entry.file,\n          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);","sourceCodeStart":501,"sourceCodeEnd":537,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/integrations/CcsAlignRulesWalker.ts#L501-L537","documentation":"walkRules flags SHADOW_HOUSE when a seat-layer leaf line duplicates a house line (matched via detectShadowHouse against houseLineSet) or begins with 'House rule', meaning the leaf shadows/redeclares the cascade instead of inheriting it. Reported as a conflict with layer='seat'.","triggerScenarios":"A seat rules file contains a line textually identical (after trimming) to a house line, or any line starting with 'House rule', during leaf-line iteration.","commonSituations":"Copy-pasting house rules into seat-level files 'to be safe'; generated seat files that re-emit inherited rules; refactors that left a duplicated line behind.","solutions":["Delete the duplicated line from the seat file at entry.file so it inherits from house","If the leaf intentionally starts with 'House rule', rewrite it to reference rather than restate the rule","Regenerate the seat file from the current cascade to remove stale copies","Re-run the walker to verify the conflict cleared"],"exampleFix":"// before (seat file)\nHouse rule: no clock in prompt prefix\n// after (seat file)\n# removed - inherited from house rules\n","handlingStrategy":"validation","validationCode":"const trimmed = line.trim();\nif (houseLineSet.has(trimmed) || trimmed.startsWith('House rule')) {\n  console.warn('SHADOW_HOUSE candidate:', trimmed);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never copy house rules into seat files; rely on cascade inheritance","Deduplicate seat files against house during generation","Run the align walker in CI before shipping rule files","Start leaf lines with something other than 'House rule'"],"tags":["lint","rules","duplication","cascade"],"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"}