Skip to content

Refactor AI Triage and AI Remediation into separate APIs#214

Open
cx-happy-yang wants to merge 4 commits into
masterfrom
refactor/ai-triage-remediation-api
Open

Refactor AI Triage and AI Remediation into separate APIs#214
cx-happy-yang wants to merge 4 commits into
masterfrom
refactor/ai-triage-remediation-api

Conversation

@cx-happy-yang

@cx-happy-yang cx-happy-yang commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Split AiTriageAndRemediationAPI into AiTriageAPI and AiRemediationAPI with correct endpoint paths and schemas matching the Checkmarx One API reference
  • Added 20 new DTOs covering full request/response schemas for both APIs
  • Removed 5 orphaned DTOs from the old combined API
  • Rewrote integration tests and updated CxOne_REST_API_List.md

Endpoints

Class Method Endpoint
AiTriageAPI trigger_ai_triage POST /api/ai-triage/triage
AiTriageAPI retrieve_ai_triage_results GET /api/ai-triage/triage/{project_id}/{group_id}
AiRemediationAPI trigger_ai_remediation POST /api/remediation/remediate
AiRemediationAPI retrieve_ai_remediation_details GET /api/remediation/remediation-details/{scan_id}/{result_id}

Test plan

  • test_trigger_ai_triage
  • test_retrieve_ai_triage_results
  • test_trigger_ai_remediation
  • test_retrieve_ai_remediation_details

🤖 Generated with Claude Code

cx-happy-yang and others added 4 commits July 24, 2026 10:08
Split the combined class into two dedicated modules — aiTriageAPI.py
(AiTriageAPI) and aiRemediationAPI.py (AiRemediationAPI) — each owning
its own base URL and methods. Removes aiTriageAndRemediationAPI.py and
updates __init__.py accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nAPI

Update both APIs to match actual endpoint paths, request/response schemas,
and Accept headers from the Checkmarx One API reference guide.

AiTriageAPI:
- POST /api/ai-triage/triage (AiTriageRequest → AiTriageResponse)
- GET  /api/ai-triage/triage/{project_id}/{group_id} (→ AiTriageResult)

AiRemediationAPI:
- POST /api/remediation/remediate (AiRemediationRequest → AiRemediationResponse)
- GET  /api/remediation/remediation-details/{scan_id}/{result_id} (→ AiRemediationDetails)

Add 20 new DTOs covering full request/response schemas including nested
objects for triage analysis, confidence scores, reachability, exploitability,
reasoning traces, auto-PR details, file changes, and test generation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove 5 DTOs that belonged to the old combined API and are no longer
referenced anywhere: AiTrProcessResult, AiTrProcessStatusResponse,
AiTriageTriggerRequest, AiTriageTriggerResponse, AiTriageVulnerability.

Rewrite test_ai_triage_and_remediation_api.py to use the new split APIs:
- AiTriageRequest / TriageBucket for trigger_ai_triage
- retrieve_ai_triage_results(project_id, group_id) returning AiTriageResult
- AiRemediationRequest / RemediationBucket for trigger_ai_remediation
- retrieve_ai_remediation_details(scan_id, result_id) returning AiRemediationDetails

Tests now obtain alternateId from ScannersResultsAPI and URL-encode path
parameters before use.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the old AiTriageAndRemediationAPI entries with the two new
separate classes, correct endpoint paths, and updated method names.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cx-happy-yang cx-happy-yang self-assigned this Jul 24, 2026
@cx-happy-yang cx-happy-yang added the workflows-approved A PR needs the label workflows-approved to run any workflows. label Jul 24, 2026
@github-actions

Copy link
Copy Markdown

Logo
Checkmarx One – Scan Summary & Details1c259518-3ea3-4a7a-ba9b-e7bd2a18e3f4

Great job! No new security vulnerabilities introduced in this pull request

@cx-happy-yang

Copy link
Copy Markdown
Contributor Author

I will request enabling AI Triage and Remediation feature flag for my tenant.

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

Labels

workflows-approved A PR needs the label workflows-approved to run any workflows.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant