Skip to content

feat(review): deterministic changed-file classifier (source/test/docs/config/generated) #2143

Description

@JSONbored

Add a pure classifyChangedFile(path) that maps a changed file to one of source/test/docs/config/generated using the existing path-matchers, so the changed-files summary table (and future analytics) group deterministically. Pure function + tests only — no rendering; keeps the #1957 render slice small.

Deliverables

  • New pure module (e.g. src/review/changed-files-classify.ts) classifyChangedFile(path): 'source'|'test'|'docs'|'config'|'generated'
  • Compose from src/signals/path-matchers.ts: isGeneratedFile, isDocsFile, isConfigFile, isVendoredFile/isLockfile, plus isTestPath/isTestFile
  • Fixed precedence (generated > test > docs > config > source) documented in a comment so the mapping is stable
  • Tests: one file per class + precedence conflicts (e.g. a generated test file), lockfile/vendored → generated, unknown → source (both arms of each matcher)

References

  • src/signals/path-matchers.ts:153
  • src/signals/path-matchers.ts:182
  • src/signals/path-matchers.ts:197
  • src/review/review-diff.ts:16
  • part of #1957

Part of #1957.


size: S · held for later release (gittensor:priority once activated)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions