Skip to content

[codex] Add local-first vulnerability research#93

Merged
FrodeHus merged 4 commits into
mainfrom
codex/local-first-vulnerability-research
May 21, 2026
Merged

[codex] Add local-first vulnerability research#93
FrodeHus merged 4 commits into
mainfrom
codex/local-first-vulnerability-research

Conversation

@FrodeHus
Copy link
Copy Markdown
Owner

Summary

  • add local vulnerability intel as the baseline research source for CVE assessment jobs
  • split r.jina-backed external research into a dedicated provider and make the existing research service orchestrate local plus external providers
  • add configurable r.jina search provider defaults and UI warning copy for PatchHound-managed external research

Behavior

  • vulnerability assessments now include local PatchHound/NVD/threat context first
  • external r.jina research is only added for PatchHound-managed profiles when external research is enabled
  • provider-native OpenAI research keeps provider-native web search while also carrying local context

Validation

  • dotnet test --filter "FullyQualifiedName~PatchHound.Tests.Infrastructure.TenantAiResearchServiceTests|FullyQualifiedName~PatchHound.Tests.Worker.IngestionWorkerTests"
  • dotnet test PatchHound.slnx -v minimal
  • npm run typecheck
  • npm run lint
  • git diff --check
  • GitNexus detect_changes(scope: staged) reported low risk and no affected execution flows

@FrodeHus FrodeHus marked this pull request as ready for review May 21, 2026 09:46
@FrodeHus FrodeHus requested a review from Copilot May 21, 2026 09:46
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 makes vulnerability assessment research “local-first” by introducing a local vulnerability intel provider (PatchHound/NVD/threat context) and refactoring PatchHound-managed external web research into a dedicated provider, with TenantAiResearchService orchestrating both.

Changes:

  • Added LocalVulnerabilityIntelResearchProvider and updated the assessment worker to include local intel context by default (and add external web search only when enabled).
  • Extracted the previous r.jina-based research logic into ExternalWebSearchResearchProvider with configurable search provider defaults via AiResearchOptions.
  • Updated frontend copy + schema to reflect local-first behavior and introduced a new TenantAiWebResearchMode.LocalVulnerabilityIntel enum value.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/PatchHound.Tests/Infrastructure/TenantAiResearchServiceTests.cs Extends tests to cover local intel bundling, provider selection, and options-driven search provider behavior.
src/PatchHound.Worker/VulnerabilityAssessmentWorker.cs Injects vulnerability ID into research requests and composes local + optional external context for assessments.
src/PatchHound.Worker/appsettings.json Adds default AiResearch:JinaSearchProvider.
src/PatchHound.Worker/appsettings.Development.json Adds default AiResearch:JinaSearchProvider for development.
src/PatchHound.Infrastructure/Services/TenantAiResearchService.cs Refactors into an orchestrator over local + external research providers.
src/PatchHound.Infrastructure/Services/LocalVulnerabilityIntelResearchProvider.cs New provider that assembles local vulnerability intel context and sources from the DB/NVD cache.
src/PatchHound.Infrastructure/Services/ExternalWebSearchResearchProvider.cs New provider containing r.jina-based search + page-fetch enrichment and URL filtering.
src/PatchHound.Infrastructure/Options/AiResearchOptions.cs Adds options model and section name for research configuration.
src/PatchHound.Infrastructure/DependencyInjection.cs Registers providers, options, and typed HttpClient for external research provider.
src/PatchHound.Core/Models/AiWebResearchRequest.cs Extends request model with optional vulnerability IDs and provider selection.
src/PatchHound.Core/Enums/TenantAiWebResearchMode.cs Adds LocalVulnerabilityIntel enum value.
src/PatchHound.Core/Enums/AiResearchProviderKind.cs Introduces provider-kind enum for orchestrated research.
src/PatchHound.Api/appsettings.json Adds default AiResearch:JinaSearchProvider.
src/PatchHound.Api/appsettings.Development.json Adds default AiResearch:JinaSearchProvider for development.
frontend/src/components/features/settings/TenantAiSettingsPage.tsx Updates UI copy and adds explanatory warning for PatchHound-managed external research.
frontend/src/api/ai-settings.schemas.ts Expands Zod enum to include LocalVulnerabilityIntel.
CLAUDE.md Updates GitNexus index stats.
AGENTS.md Updates GitNexus index stats.

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

Comment thread src/PatchHound.Infrastructure/Services/ExternalWebSearchResearchProvider.cs Outdated
Comment thread src/PatchHound.Infrastructure/Services/ExternalWebSearchResearchProvider.cs Outdated
Comment thread src/PatchHound.Infrastructure/Services/ExternalWebSearchResearchProvider.cs Outdated
Comment thread src/PatchHound.Infrastructure/Services/ExternalWebSearchResearchProvider.cs Outdated
Comment thread src/PatchHound.Infrastructure/Services/LocalVulnerabilityIntelResearchProvider.cs Outdated
Comment thread src/PatchHound.Infrastructure/Services/LocalVulnerabilityIntelResearchProvider.cs Outdated
Comment thread src/PatchHound.Infrastructure/Services/TenantAiResearchService.cs
Comment thread frontend/src/components/features/settings/TenantAiSettingsPage.tsx
@FrodeHus FrodeHus merged commit 33d0333 into main May 21, 2026
2 checks passed
@FrodeHus FrodeHus deleted the codex/local-first-vulnerability-research branch May 21, 2026 10:17
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