Skip to content

Surface and filter ai classification on results show(AST-178033) - #1579

Open
cx-sumit-morchhale wants to merge 3 commits into
mainfrom
feature/AST-178033-surface-filter-aiclassification-results
Open

cx-sumit-morchhale wants to merge 3 commits into
mainfrom
feature/AST-178033-surface-filter-aiclassification-results

Conversation

@cx-sumit-morchhale

Copy link
Copy Markdown
Contributor

Summary

  • Surfaces the aiClassification field (TP/FP/UNCLASSIFIED/NOT_ANALYZED) that ast-results now returns on GET /api/results for SAST results (AST-175453) into both the CLI's JSON and SARIF reports — previously silently dropped since ScanResultData had no matching field.
  • Documents the existing --filter "ai-classification=TP;FP" pass-through in results show's help text (filtering already worked by accident via the generic --filter mechanism; this just makes it discoverable).
  • Absent/omitted when the API omits the key (non-SAST result, or the phase-2 flag off for the tenant) — no client-side feature-flag gate needed, the CLI just reflects whatever ast-results sends.

Changes

  • internal/wrappers/results-json.go — add AIClassification *string (omitempty) to ScanResultData.
  • internal/wrappers/results-sarif.go — add AIClassification *string (omitempty) to SarifResultProperties.
  • internal/commands/result.go — populate SarifResultProperties.AIClassification in parseSarifResultSast when present; list ai-classification in filterResultsListFlagUsage.
  • internal/params/flags.go — add AIClassificationQueryParam constant.
  • internal/wrappers/mock/results-mock.go — seed one mock SAST result with a classification for test coverage.
  • internal/commands/result_test.go — cover present/absent cases for both JSON and SARIF output.

Out of scope

  • sonar and gl-sast reports (externally-owned schemas, no field for this) and pdf (server-rendered) — unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant