feat: stale-pattern drift checker (orphan patterns/*.md)#64
Open
advancedresearcharray wants to merge 5 commits into
Open
feat: stale-pattern drift checker (orphan patterns/*.md)#64advancedresearcharray wants to merge 5 commits into
advancedresearcharray wants to merge 5 commits into
Conversation
Warn when patterns/*.md files are not linked from ROUTER.md or context/*.md. Closes theDakshJaitly#51. Co-authored-by: Cursor <cursoragent@cursor.com>
Fixes typecheck CI on stale-pattern checker PR. Co-authored-by: Cursor <cursoragent@cursor.com>
06b7e58 to
f34ceb5
Compare
Align patternsDir fallback with index-sync, guard missing context/, add reporter remediation, update README/CHANGELOG/CONTRIBUTING, and add a test showing the index-sync vs stale-pattern distinction.
f34ceb5 to
ffeba4d
Compare
Strip HTML comments from ROUTER/context before collecting refs (matching index-sync), add node_modules ignore to the patterns glob, and add tests for commented-out links and project-root patterns fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Pushed a small follow-up in b0f5045: strip HTML comments from ROUTER/context before collecting pattern refs (matching |
Use the same .md-specific markdown link pattern as index-sync and add coverage for anchor fragments and ./patterns/ relative paths. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
checkStalePatternsdrift checker: warns whenpatterns/*.mdfiles (except INDEX/README) are not referenced fromROUTER.mdorcontext/*.md*.mdreferencestest/checkers.test.tsHow this differs from
index-syncindex-syncchecks the catalog —patterns/INDEX.mdmust list every pattern file on disk (and every INDEX entry must exist).stale-patternchecks the navigation graph — pattern files must be reachable fromROUTER.mdorcontext/*.md, regardless of INDEX coverage.index-sync(listed in INDEX) but still be flagged here if nothing in ROUTER/context links to it; conversely, a pattern linked from ROUTER/context but missing from INDEX is caught byindex-sync, not here.Closes #51
Test plan
npm run typecheck && npm test && npm run buildnpm test -- --run test/checkers.test.ts