Skip to content

fix: review_findings.category is NULL for all non-security findings (71 of 78) #485

@mickume

Description

@mickume

Summary

The category column in review_findings (added in schema v7) is only populated for security-classified findings. All other findings get category=NULL.

review_findings by category:
  NULL:     71 findings (91%)
  security:  4 findings ( 5%)
  (3 major/security + 1 critical/security)

Root Cause

_detect_security_category() in review_parser.py:84-94 is the only categorization logic. It checks ~20 hardcoded security keywords and returns either "security" or None. No other category types exist.

def _detect_security_category(description: str) -> Optional[str]:
    # Returns "security" if keywords match, None otherwise
    ...

The category value is correctly passed through to the INSERT statement (review_store.py:229-239), but since only security is detected, everything else is NULL.

Files:

  • agent_fox/session/review_parser.py:57-94 — keyword list and detection function
  • agent_fox/knowledge/review_store.py:229-239 — INSERT statement

Impact

The category field was designed to enable filtering and prioritization of findings by type. With 91% NULL values, it's effectively useless for non-security analysis. Queries like "show all correctness findings" or "count performance issues" are impossible.

Suggested Fix

Expand _detect_security_category() (or replace it) with a multi-category classifier. Reasonable categories based on the existing finding descriptions:

  • correctness — spec compliance, wrong behavior, missing functionality
  • compatibility — API mismatches, proto field disagreements
  • testing — missing tests, test infrastructure issues
  • configuration — wrong ports, missing config, deployment issues
  • security — existing keyword-based detection

Could be keyword-based (same approach, more lists) or LLM-based for higher accuracy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    af:fixIssues ready to be implementedaf:fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions