Skip to content

feat(drift): add tool-config-sync checker#37

Merged
theDakshJaitly merged 1 commit intotheDakshJaitly:mainfrom
mvanhorn:osc/8-tool-config-drift-checker
Apr 24, 2026
Merged

feat(drift): add tool-config-sync checker#37
theDakshJaitly merged 1 commit intotheDakshJaitly:mainfrom
mvanhorn:osc/8-tool-config-drift-checker

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Fixes #8

What changed

setup.sh copies identical content to CLAUDE.md, AGENTS.md, .cursorrules, .windsurfrules, and .github/copilot-instructions.md. If someone installs more than one tool and then edits one of those files in place, the copies silently drift. Nothing in mex check surfaced that before.

Adds a structural checker at src/drift/checkers/tool-config-sync.ts:

  • Scans the project root for those five files.
  • Returns a TOOL_CONFIG_DRIFT warning for any file that doesn't match the first one seen.
  • No-op when fewer than two are installed.
  • Intentionally excludes .opencode/opencode.json — per .tool-configs/README.md, that file is a different format pointing at .mex/AGENTS.md rather than sharing content with the others.

Wired into runDriftCheck() next to the existing structural checkers (index-sync, script-coverage). TOOL_CONFIG_DRIFT added to the IssueCode union.

Tests

6 new cases in test/checkers.test.ts:

  • empty when no tool configs installed
  • empty when only one is installed
  • empty when all matching
  • drift flagged when two differ (right file, right code, right severity)
  • multiple drifted files reported separately, matching files left alone
  • nested .github/copilot-instructions.md is picked up

Full suite: npx vitest run → 118 tests passing.

Out of scope

Left mex sync-configs (the "bonus" suggestion in the issue) out of this PR so the checker can land standalone. Happy to follow up if the checker looks good.

setup.sh copies identical content to CLAUDE.md, AGENTS.md, .cursorrules,
.windsurfrules, and .github/copilot-instructions.md. If a user installs
more than one AI tool and edits one file in place, the other copies
silently drift out of sync.

Add a structural checker that scans the project root for those files,
compares content, and emits TOOL_CONFIG_DRIFT warnings for any file
that no longer matches the first-seen reference. No-op when fewer than
two are installed. .opencode/opencode.json is intentionally excluded
because it's a different format (per .tool-configs/README.md).

Wired into runDriftCheck like the other structural checkers
(index-sync, script-coverage). 6 new tests in test/checkers.test.ts
cover the no-op cases, the drift case, multiple drifted files, and
the nested .github/copilot-instructions.md path.

Fixes theDakshJaitly#8
Copy link
Copy Markdown
Owner

@theDakshJaitly theDakshJaitly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — verified locally, all 194 tests pass.

@theDakshJaitly
Copy link
Copy Markdown
Owner

Thanks again, Matt — clean scope, good tests, and the opencode exclusion call-out saved me a question. Merging now. Happy to take that mex sync-configs follow-up whenever you're up for it.

@theDakshJaitly theDakshJaitly merged commit a44f63e into theDakshJaitly:main Apr 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add checker for multi-tool config file sync

2 participants