Skip to content

feat(review): deterministic fallback categorization for findings (keyword/path heuristics) #2148

Description

@JSONbored

When the model omits a finding category, infer one deterministically from the finding body keywords and file path (e.g. test path → tests, security keywords → security), instead of a flat default. Pure heuristic function + tests; consumed by the parser default slice.

Deliverables

  • Pure inferFindingCategory(body: string, path: string): FindingCategory using keyword sets + path-matchers (src/signals/path-matchers.ts: isTestPath, isDocsFile, isConfigFile)
  • Documented precedence (path signal first, then keyword buckets, then a final default)
  • Wire as the fallback in the parser only when the model omits/garbles category
  • Tests: each keyword bucket hits, test/docs/config path routing, no-signal → default (every branch of the precedence chain)

References

  • src/services/ai-review.ts:414
  • src/signals/path-matchers.ts:182
  • part of #1958

Part of #1958.


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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions