Skip to content

feat: stale-pattern drift checker (orphan patterns/*.md)#64

Open
advancedresearcharray wants to merge 8 commits into
mex-memory:mainfrom
advancedresearcharray:feat/stale-pattern-checker-51
Open

feat: stale-pattern drift checker (orphan patterns/*.md)#64
advancedresearcharray wants to merge 8 commits into
mex-memory:mainfrom
advancedresearcharray:feat/stale-pattern-checker-51

Conversation

@advancedresearcharray

@advancedresearcharray advancedresearcharray commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds checkStalePatterns drift checker: warns when patterns/*.md files (except INDEX/README) are not referenced from ROUTER.md or context/*.md
  • Parses markdown links and backtick *.md references
  • Unit tests in test/checkers.test.ts

How this differs from index-sync

  • index-sync checks the catalogpatterns/INDEX.md must list every pattern file on disk (and every INDEX entry must exist).
  • stale-pattern checks the navigation graph — pattern files must be reachable from ROUTER.md or context/*.md, regardless of INDEX coverage.
  • A pattern can pass 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 by index-sync, not here.

Closes #51

Test plan

  • npm run typecheck && npm test && npm run build
  • npm test -- --run test/checkers.test.ts

@advancedresearcharray advancedresearcharray force-pushed the feat/stale-pattern-checker-51 branch 3 times, most recently from f34ceb5 to ffeba4d Compare June 6, 2026 04:13
@advancedresearcharray

Copy link
Copy Markdown
Contributor Author

Pushed a small follow-up in b0f5045: strip HTML comments from ROUTER/context before collecting pattern refs (matching index-sync), add node_modules ignore on the patterns glob, and add tests for commented-out links plus project-root patterns fallback when scaffold is .mex/. Checker tests (54) pass locally. Ready for review when you have a moment.

root and others added 6 commits June 9, 2026 04:28
Warn when patterns/*.md files are not linked from ROUTER.md or context/*.md.
Closes mex-memory#51.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fixes typecheck CI on stale-pattern checker PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.
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>
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>
Add a public API integration test so STALE_PATTERN is exercised end-to-end
via the drift pipeline, not only through the unit checker tests.
@advancedresearcharray advancedresearcharray force-pushed the feat/stale-pattern-checker-51 branch from 3b39b03 to 52027c0 Compare June 9, 2026 04:28
Array Fleet and others added 2 commits June 9, 2026 14:29
When scaffoldRoot is .mex/ but ROUTER.md and context/*.md live at the
project root, resolve nav sources from projectRoot (matching the
existing patternsDir fallback). Removes corrupt mkdocs export commits
from the branch tip.

Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise the stale-pattern checker end-to-end when .mex/ has no
ROUTER.md or context/*.md and navigation lives at the project root.

Co-authored-by: Cursor <cursoragent@cursor.com>
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 a stale-pattern drift checker

1 participant