thedotmack/claude-mem · warning

DRIFT

DRIFT

Error message

DRIFT

What it means

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.

Solutions

  1. Update the seat line to the current house wording (given in detail as matchedHouseLine)
  2. Or delete the seat line entirely and inherit the house rule
  3. Diff the seat file against the house file to find all drifted lines
  4. Re-run walkRules after syncing

Example fix

// before (seat)
Never use emojis in any response.
// after (house, updated wording)
Avoid emojis in responses unless the user requests them.
Defensive patterns

Strategy: validation

Validate before calling

// fuzzy check before shipping
const close = (a: string, b: string) =>
  a.trim().toLowerCase().replace(/\s+/g, ' ') === b.trim().toLowerCase().replace(/\s+/g, ' ');
if (houseLines.some(h => close(leaf, h))) console.warn('near-duplicate of house line');

Prevention

When it happens

Trigger: 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.

Common situations: Manual edits to house rules not propagated to seat copies; merge conflicts resolved by keeping the leaf copy; forks that drifted from house wording.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/ff2719aef5ef8ad1. Report an issue: GitHub.

Appendix: source

Thrown at src/services/integrations/CcsAlignRulesWalker.ts:540

          line: trimmed,
          detail: shadow.matchedHouseLine
            ? `Leaf duplicates house line: "${shadow.matchedHouseLine}"`
            : 'Leaf starts with "House rule" — shadows the cascade',
          houseMatch: shadow.matchedHouseLine,
        });

        if (!shadowPatchesByFile.has(entry.file)) {
          shadowPatchesByFile.set(entry.file, new Set());
        }
        shadowPatchesByFile.get(entry.file)!.add(trimmed);
      }

      // DRIFT: leaf line is close-but-not-exact to a house line
      if (!shadow.isShadow) {
        const drift = detectDrift(trimmed, allHouseLines);
        if (drift.isDrift) {
          conflicts.push({
            code: 'DRIFT',
            layer: 'seat',
            file: entry.file,
            line: trimmed,
            detail: drift.matchedHouseLine
              ? `House text may have changed; leaf still has old wording. House: "${drift.matchedHouseLine}"`
              : 'Possible drift from house text',
          });
        }
      }

      // DENY_ALLOW: check seat line against house+project lines
      const denyAllow = detectDenyAllow(trimmed, houseProjectLines);
      if (denyAllow.isDenyAllow) {
        conflicts.push({
          code: 'DENY_ALLOW',
          layer: 'seat',
          file: entry.file,
          line: trimmed,

View on GitHub (pinned to d8bc9755e7)