Skip to content

Add a stale-pattern drift checker #51

Description

@theDakshJaitly

Context

Add a checker that flags pattern files in patterns/ that aren't referenced from ROUTER.md or anything in context/ — orphans in the navigation graph.

⚠️ Read src/drift/checkers/index-sync.ts first. This partially overlaps with index-sync, and the goal is not to duplicate it. index-sync is about the index ↔ files relationship; this checker is about pattern files that exist but nothing links to them. Your PR should state clearly how the two differ.

Scope

  • Flag pattern files with no inbound reference from ROUTER.md or context/*.md.
  • Warning-level severity (an orphaned pattern is a smell, not necessarily an error).

Where

  • New checker: src/drift/checkers/stale-pattern.ts — structural checker (operates on projectRoot, scaffoldRoot), follow the shape of index-sync.ts.
  • Register in src/drift/index.ts (import + invoke in the structural block + push to checkerIssueCounts).
  • Tests: test/checkers.test.ts.

Acceptance criteria

  • Flags an orphaned pattern file; does not flag a referenced one.
  • PR description explains how this differs from index-sync.
  • Registered + counted in src/drift/index.ts.
  • npm run typecheck && npm test && npm run build pass.

New to mex? Good first issue — 9 existing checkers to copy from. See CONTRIBUTING.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions