Skip to content

[business-logic] commit_analyzer.go Contains-based test-file detection and bare 'ci' substring misclassification #823

Description

@topcheer

File: internal/tool/commit_analyzer.go L141-142 + L87.

Executed proofs: categorizeFile('pkg/latest_report.go') -> CatTest (contains 'test_'); 'src/attest_helper.py' -> CatTest; inferCommitType('efficient parsing improvement') -> 'ci'. The test-suffix loop uses strings.Contains where every other category uses HasSuffix, and 'ci' is a 2-char bare substring matching common English words. Results feed commit-scope analysis and commit-partition grouping, so misclassification distorts tests-only/mixed decisions.

Impact: Low-Medium heuristic quality.
Fix: HasSuffix for suffixes, word-boundary match for 'ci'.
Verified by independent re-review with runnable categorizeFile repro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions