Skip to content

[codex] Add AI recommendation draft action#97

Merged
FrodeHus merged 2 commits into
mainfrom
codex/apply-ai-recommendation
May 26, 2026
Merged

[codex] Add AI recommendation draft action#97
FrodeHus merged 2 commits into
mainfrom
codex/apply-ai-recommendation

Conversation

@FrodeHus
Copy link
Copy Markdown
Owner

Summary

  • Add an AI recommendation draft endpoint that summarizes available patch assessments for open remediation-case vulnerabilities using the default tenant AI profile.
  • Add the Security Analyst Workbench Apply AI Recommendation action with a work-in-progress modal and editable field population without submitting the recommendation.
  • Add frontend schema/server-function wiring, focused backend/frontend tests, and include the package-lock/instruction-file updates from the working tree.

Validation

  • npm test -- SecurityAnalystWorkbench.test.tsx --run
  • npm run typecheck
  • dotnet test tests\PatchHound.Tests\PatchHound.Tests.csproj --filter "FullyQualifiedName~RemediationDecisionsControllerTests.GenerateAiRecommendationDraft" -v minimal
  • dotnet build PatchHound.slnx

Notes

  • GitNexus staged impact reported medium risk, centered on the Security Analyst Workbench flow.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an “AI recommendation draft” capability to the remediation decision flow, exposing a backend endpoint that generates a draft recommendation from existing patch assessments and wiring it into the Security Analyst Workbench UI as an “Apply AI Recommendation” action.

Changes:

  • Add AiRecommendationDraftService plus a new remediation-case API endpoint to generate an editable recommendation draft (outcome, priority override, rationale).
  • Add a Workbench action that fetches the draft and populates the recommendation form fields without saving.
  • Add/adjust backend + frontend tests and update lockfiles/docs metadata.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/PatchHound.Tests/Api/RemediationDecisionsControllerTests.cs Adds coverage for AI recommendation draft generation behavior (service-level).
src/PatchHound.Api/Services/AiRecommendationDraftService.cs Implements AI-driven draft generation from open-vulnerability patch assessments.
src/PatchHound.Api/Program.cs Registers AiRecommendationDraftService in DI.
src/PatchHound.Api/Models/Decisions/RemediationDecisionDto.cs Introduces AiRecommendationDraftDto response model.
src/PatchHound.Api/Controllers/RemediationDecisionsController.cs Adds POST .../analysis/ai-recommendation endpoint.
package-lock.json Adds a new root-level npm lockfile.
frontend/src/components/features/remediation/SecurityAnalystWorkbench.tsx Adds “Apply AI Recommendation” UI, loading modal, and form population.
frontend/src/components/features/remediation/SecurityAnalystWorkbench.test.tsx Adds UI tests for AI recommendation button visibility and field population.
frontend/src/api/remediation.schemas.ts Adds Zod schema/type for AI recommendation draft response.
frontend/src/api/remediation.functions.ts Adds server function to call the new AI recommendation draft endpoint.
frontend/package-lock.json Updates frontend dependency lockfile entries.
CLAUDE.md Updates GitNexus index stats and trims guidance sections.
AGENTS.md Updates GitNexus index stats and trims guidance sections.
Files not reviewed (1)
  • frontend/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/PatchHound.Api/Services/AiRecommendationDraftService.cs Outdated
Comment thread src/PatchHound.Api/Services/AiRecommendationDraftService.cs
Comment thread tests/PatchHound.Tests/Api/RemediationDecisionsControllerTests.cs
@FrodeHus FrodeHus marked this pull request as ready for review May 26, 2026 07:46
@FrodeHus FrodeHus merged commit 2118eed into main May 26, 2026
2 checks passed
@FrodeHus FrodeHus deleted the codex/apply-ai-recommendation branch May 26, 2026 07:46
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.

2 participants