Skip to content

feat(review): add category enum to AI finding schema + parser default #2147

Description

@JSONbored

Tag every inline finding with a category (security/correctness/performance/maintainability/tests/style) parsed from the model output with a safe default. Schema + parser + prompt only — rendering and deterministic fallback are separate slices. Unblocks category-level analytics.

Deliverables

  • Add a FindingCategory union + optional category on InlineFinding (src/services/ai-review.ts:215)
  • Parse category in toInlineFindings (src/services/ai-review.ts:414): accept only known enum values, default to a safe 'maintainability' (or 'other') otherwise
  • Update INLINE_FINDINGS_SUFFIX prompt (src/services/ai-review.ts:497) to request the category field
  • Preserve category through composeInlineFindings (src/services/ai-review.ts:841)
  • Tests: each valid category, unknown/absent → default (both branches), preserved through compose

References

  • src/services/ai-review.ts:215
  • src/services/ai-review.ts:414
  • src/services/ai-review.ts:497
  • 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