Overlay issues
Common issues when working with overlays and their solutions.
Overlay not applied
Symptom: You defined an overlay but the check still uses upstream settings.
Diagnosis
# Apply overlays and rebuild IR/exports (conflicts now fail by default)
aligntrue sync
# Output shows: ✓ Applied N overlays (or errors if conflicts/deprecated selectors)
# Confirm selector health against the current IR
aligntrue override
# Inspect the change the overlay applies
aligntrue override diff 'rule[id=your-rule-id]'
# Look for issues
aligntrue override --jsonCommon causes
1. Typo in Rule ID
Problem:
overlays:
overrides:
- selector: "rule[id=no-console-logs]" # Wrong: should be "no-console-log"
set:
severity: "error"Solution:
# Find correct rule ID
aligntrue override selectors
# Fix overlay
aligntrue override remove 'rule[id=no-console-logs]'
aligntrue override add \
--selector 'rule[id=no-console-log]' \
--set severity=error2. Selector doesn’t match
Problem: Selector doesn’t match any rules in the IR, or uses a deprecated selector type. Supported selectors: rule[id=...], sections[index].
Error message:
✗ Overlay validation failed
Selector matches no rules: rule[id=nonexistent-rule]
Hint: Check rule ID spelling and ensure rule exists in IRSolution:
# List available selectors
aligntrue override selectors
# Fix selector
aligntrue override remove 'rule[id=nonexistent-rule]'
aligntrue override add \
--selector 'rule[id=correct-rule-id]' \
--set severity=error3. Check removed from upstream
Problem: Upstream align removed or renamed the check.
Diagnosis:
aligntrue override status
# Output:
# ❌ rule[id=old-rule-name]
# Set: severity=error
# Healthy: stale (no match in IR)Solution:
# Remove stale overlay
aligntrue override remove 'rule[id=old-rule-name]'
# Find new rule ID
aligntrue override selectors
# Add overlay with new rule ID
aligntrue override add \
--selector 'rule[id=new-rule-name]' \
--set severity=errorOverlay conflicts
Default: Conflicts now fail sync. If multiple overlays target the same property, aligntrue sync exits with errors.
Allow conflicts (last-writer-wins):
aligntrue sync --allow-overlay-conflictsor in config:
overlays:
allow_overlay_conflicts: trueFix conflicts (recommended):
- Remove duplicate/overlapping overlays so each property is set once.
- Prefer
rule[id=...]selectors for clarity.
Overlay status
Symptom: Overlays don’t seem to be taking effect.
Verify overlays are active (and conflict-free)
# 1. Apply overlays (required for IR/exports)
aligntrue sync
# Output shows: ✓ Applied N overlays
# 2. Check that overlay is active and healthy
aligntrue override status
# Shows: ✓ rule[id=your-rule-id]
# Set: severity="error"
# Healthy: yes
# 3. View the effect of the overlay in IR
aligntrue override diff 'rule[id=your-rule-id]'
# Shows: Original → Modified with overlay appliedOverlay effects not visible in exports
If you don’t see severity changes in AGENTS.md or other exports, this is expected. Here’s why:
- Overlays apply at sync time:
.aligntrue/rules/stays upstream; overlays modify the in-memory IR duringaligntrue sync - Exports are simplified: Markdown exports may omit some fields for readability
- Behavior is affected: Checks use the modified IR behavior
- Verification: Run
aligntrue sync(look for “Applied N overlays”), then usealigntrue override statusandaligntrue override diffto confirm
Quick commands
Add overlay
# Change severity
aligntrue override add \
--selector 'rule[id=no-console-log]' \
--set severity=error
# Modify nested property (dot notation)
aligntrue override add \
--selector 'rule[id=max-complexity]' \
--set check.inputs.threshold=15
# Remove property
aligntrue override add \
--selector 'rule[id=prefer-const]' \
--remove autofix
# Combined set and remove
aligntrue override add \
--selector 'rule[id=line-length]' \
--set severity=warning \
--set check.inputs.max=120 \
--remove autofixView overlays
# Dashboard of all overlays
aligntrue override status
# JSON output for CI
aligntrue override status --json
# List available selectors
aligntrue override selectorsDiff overlays
# Show effect of specific overlay
aligntrue override diff 'rule[id=no-console-log]'
# Show all overlay effects
aligntrue override diffRemove overlay
# Interactive removal (select from list)
aligntrue override remove
# Direct removal by selector
aligntrue override remove 'rule[id=no-console-log]'
# Skip confirmation
aligntrue override remove 'rule[id=no-console-log]' --forceBest practices
Document reasons
Always explain why using YAML comments in config:
overlays:
overrides:
# CLI tool requires console output for user feedback
# Owner: cli-team
- selector: "rule[id=no-console-log]"
set:
severity: "off"Track temporary overlays
For temporary overrides, use YAML comments:
overlays:
overrides:
# TEMPORARY: Gradual rollout
# Expires: 2025-12-31
- selector: "rule[id=new-rule]"
set:
severity: "warning"Use aligntrue override status to review active overlays regularly.
Review regularly
Audit overlays monthly:
# Check all overlays health
aligntrue override status
# View overlay effects
aligntrue override diff
# Detect drift
aligntrue driftRelated documentation
- Overlays Guide - Complete overlay documentation
- CLI Reference - Command details
- Team Mode Guide - Team workflows with overlays
- Drift Detection - Detect overlay staleness
Still having issues?
- Run
aligntrue override statusto check health - Run
aligntrue override diffto see current effects - Review drift with
aligntrue drift - Check the Overlays Guide for complete documentation
If none of these resolve your issue, check the main Troubleshooting guide or open an issue on GitHub .