[codex] Add Jina Reader AI research source#95
Merged
Conversation
75d5056 to
93cabfa
Compare
There was a problem hiding this comment.
Pull request overview
Adds Jina Reader as a selectable, PatchHound-managed external web research source, introduces enrichment “process targets” (Scheduled vs AIResearch), and threads the selected research tool through tenant AI profiles and AI-driven workflows.
Changes:
- Introduces enrichment source “Targets” + “OptionsJson” (Jina Reader options) and updates system settings APIs/UI to manage them.
- Adds a pluggable
IAiResearchSourceProvidermodel with a newJinaReaderAiResearchProvider, and updatesTenantAiResearchServiceto select a provider by source key. - Extends tenant AI profiles and AI research requests to include a selected
ResearchSourceKey, with validation and UI selection.
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/PatchHound.Tests/Worker/IngestionWorkerTests.cs | Adds unit test ensuring the “external research unavailable” note is appended only once. |
| tests/PatchHound.Tests/TestData/TenantAiProfileFactory.cs | Extends test profile factory to set researchSourceKey. |
| tests/PatchHound.Tests/Infrastructure/TenantAiResearchServiceTests.cs | Adds coverage for selecting Jina Reader + optional API key + rate limit “unavailable note” behavior; updates DI test wiring. |
| tests/PatchHound.Tests/Api/TenantAiProfilesControllerTests.cs | Adds API tests validating research source requirements and persistence for PatchHound-managed research. |
| tests/PatchHound.Tests/Api/SettingsAuditControllerTests.cs | Verifies Jina Reader appears in enrichment sources and that targets/options round-trip. |
| src/PatchHound.Worker/VulnerabilityAssessmentWorker.cs | Appends “external research unavailable” note to summaries and passes ResearchSourceKey into research requests. |
| src/PatchHound.Worker/EnrichmentWorker.cs | Filters scheduled enrichment runs to only sources targeted for Scheduled. |
| src/PatchHound.Infrastructure/Tenants/JinaReaderOptions.cs | Adds serializable/normalizable options for Jina Reader. |
| src/PatchHound.Infrastructure/Tenants/EnrichmentSourceCatalog.cs | Adds targets parsing/normalization, Jina Reader defaults, and credential behavior updates. |
| src/PatchHound.Infrastructure/Services/TenantAiResearchService.cs | Selects external research provider by configured enrichment source key. |
| src/PatchHound.Infrastructure/Services/SoftwareDescriptionGenerationService.cs | Passes ResearchSourceKey when doing managed research for software descriptions. |
| src/PatchHound.Infrastructure/Services/JinaReaderAiResearchProvider.cs | New research provider implementation using Jina Reader with optional API key. |
| src/PatchHound.Infrastructure/Services/IAiResearchSourceProvider.cs | New provider abstraction for AI research sources. |
| src/PatchHound.Infrastructure/Services/ExternalWebSearchResearchProvider.cs | Implements IAiResearchSourceProvider and exposes internals for reuse. |
| src/PatchHound.Infrastructure/Migrations/PatchHoundDbContextModelSnapshot.cs | Updates EF snapshot for new columns on enrichment sources and AI profiles. |
| src/PatchHound.Infrastructure/Migrations/20260522105236_AddAiResearchSourceTargets.Designer.cs | Adds EF migration designer output for schema changes. |
| src/PatchHound.Infrastructure/Migrations/20260522105236_AddAiResearchSourceTargets.cs | Adds DB columns for Targets, OptionsJson, and ResearchSourceKey. |
| src/PatchHound.Infrastructure/DependencyInjection.cs | Registers both external and Jina research providers under IAiResearchSourceProvider. |
| src/PatchHound.Infrastructure/Data/Configurations/TenantAiProfileConfiguration.cs | Maps ResearchSourceKey as required in EF config. |
| src/PatchHound.Infrastructure/Data/Configurations/EnrichmentSourceConfiguration.cs | Maps Targets and OptionsJson as required in EF config. |
| src/PatchHound.Core/Services/RiskChangeBriefAiSummaryService.cs | Passes ResearchSourceKey into managed research requests. |
| src/PatchHound.Core/Models/AiWebResearchRequest.cs | Adds ResearchSourceKey field to research request model. |
| src/PatchHound.Core/Entities/TenantAiProfile.cs | Adds persisted ResearchSourceKey to tenant AI profiles. |
| src/PatchHound.Core/Entities/EnrichmentSourceConfiguration.cs | Adds persisted Targets and OptionsJson to enrichment sources. |
| src/PatchHound.Api/Models/System/EnrichmentSourceDtos.cs | Extends system enrichment source DTOs with targets and options payloads. |
| src/PatchHound.Api/Models/Settings/TenantAiProfileDto.cs | Extends tenant AI profile DTOs with ResearchSourceKey. |
| src/PatchHound.Api/Controllers/TenantAiProfilesController.cs | Validates and persists selected managed research tool for AI profiles. |
| src/PatchHound.Api/Controllers/SystemController.cs | Supports updating targets/options; maps Jina Reader options in responses. |
| src/PatchHound.Api/Controllers/SoftwareController.cs | Passes ResearchSourceKey into managed research for software risk context. |
| frontend/src/server/system.functions.ts | Extends Zod schemas + update payloads for targets/options and optional-global-secret mode. |
| frontend/src/components/features/settings/TenantAiSettingsPage.tsx | Adds research tool selection and “no tools available” UX, with link to enrichment settings. |
| frontend/src/components/features/admin/GlobalEnrichmentSourceManagement.tsx | Adds process targets UI and Jina Reader options editing + display of targets badges. |
| frontend/src/components/features/admin/GlobalEnrichmentSourceManagement.test.tsx | Updates test fixture to include targets/options. |
| frontend/src/api/ai-settings.schemas.ts | Extends AI profile schemas with researchSourceKey. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Jina Reader as a configurable AI research enrichment source and wires selected AI research tools into tenant AI profiles.
Changes
Validation
npm run typechecknpm test -- GlobalEnrichmentSourceManagementdotnet test --filter "FullyQualifiedName~SettingsAuditControllerTests|FullyQualifiedName~TenantAiProfilesControllerTests|FullyQualifiedName~TenantAiResearchServiceTests" -v minimaldotnet test PatchHound.slnx -v minimal