@@ -103,6 +103,74 @@ class ResearchValidationResponse(BaseModel):
103103 )
104104
105105
106+ class ResearchComplexityFactors (BaseModel ):
107+ """Analysis factors for determining research complexity."""
108+
109+ domain_specialization : str = Field (
110+ description = "Level of domain specialization: 'general', 'specialized', 'highly_specialized'"
111+ )
112+ technology_maturity : str = Field (
113+ description = "Maturity of required technologies: 'established', 'emerging', 'cutting_edge'"
114+ )
115+ integration_scope : str = Field (
116+ description = "Scope of system integration: 'isolated', 'moderate', 'system_wide'"
117+ )
118+ existing_solutions : str = Field (
119+ description = "Availability of existing solutions: 'abundant', 'limited', 'scarce'"
120+ )
121+ risk_level : str = Field (
122+ description = "Implementation risk level: 'low', 'medium', 'high'"
123+ )
124+
125+
126+ class ResearchRequirementsAnalysis (BaseModel ):
127+ """LLM analysis of research requirements for a task."""
128+
129+ expected_url_count : int = Field (
130+ description = "Recommended number of research URLs for optimal coverage" ,
131+ ge = 0 ,
132+ le = 10
133+ )
134+ minimum_url_count : int = Field (
135+ description = "Minimum acceptable number of URLs for basic adequacy" ,
136+ ge = 0 ,
137+ le = 5
138+ )
139+ reasoning : str = Field (
140+ description = "Detailed explanation of why these URL counts are appropriate"
141+ )
142+ complexity_factors : ResearchComplexityFactors = Field (
143+ description = "Breakdown of complexity analysis factors"
144+ )
145+ quality_requirements : list [str ] = Field (
146+ default_factory = list ,
147+ description = "Specific requirements for research source quality and types"
148+ )
149+
150+
151+ class URLValidationResult (BaseModel ):
152+ """Result of validating provided URLs against dynamic requirements."""
153+
154+ adequate : bool = Field (
155+ description = "Whether the provided URLs meet the dynamic requirements"
156+ )
157+ provided_count : int = Field (
158+ description = "Number of URLs actually provided"
159+ )
160+ expected_count : int = Field (
161+ description = "Expected number of URLs based on analysis"
162+ )
163+ minimum_count : int = Field (
164+ description = "Minimum acceptable number of URLs"
165+ )
166+ feedback : str = Field (
167+ description = "Detailed feedback about URL adequacy and suggestions"
168+ )
169+ meets_quality_standards : bool = Field (
170+ description = "Whether URLs meet quality requirements beyond just count"
171+ )
172+
173+
106174# Database models for conversation history
107175# ConversationRecord is now defined in db/interface.py using SQLModel
108176# DatabaseConfig is now defined in constants.py
@@ -181,6 +249,20 @@ class JudgeCodingPlanUserVars(BaseModel):
181249 description = "Strategies to mitigate identified risks"
182250 )
183251
252+ # Dynamic URL requirements fields - NEW
253+ expected_url_count : int = Field (
254+ default = 0 ,
255+ description = "LLM-determined expected number of research URLs for this task"
256+ )
257+ minimum_url_count : int = Field (
258+ default = 0 ,
259+ description = "LLM-determined minimum acceptable URL count"
260+ )
261+ url_requirement_reasoning : str = Field (
262+ default = "" ,
263+ description = "LLM explanation of why specific URL count is needed"
264+ )
265+
184266
185267class JudgeCodeChangeSystemVars (BaseModel ):
186268 """Variables for judge_code_change system prompt."""
@@ -223,7 +305,7 @@ class ResearchValidationUserVars(BaseModel):
223305 research : str = Field (description = "Research findings to be validated" )
224306 research_urls : list [str ] = Field (
225307 default_factory = list ,
226- description = "URLs from MANDATORY online research - minimum 3 URLs required " ,
308+ description = "URLs from online research - count determined dynamically based on task complexity " ,
227309 )
228310 context : str = Field (description = "Additional context about the research validation" )
229311 conversation_history : list = Field (
@@ -241,14 +323,22 @@ class WorkflowGuidanceSystemVars(BaseModel):
241323
242324
243325class WorkflowGuidanceUserVars (BaseModel ):
244- """Variables for build_workflow user prompt."""
326+ """Variables for workflow_guidance user prompt."""
245327
328+ task_id : str = Field (description = "Task ID" )
329+ task_title : str = Field (description = "Task title" )
246330 task_description : str = Field (description = "Description of the development task" )
247- context : str = Field (description = "Additional context about the task" )
248- conversation_history : list = Field (
249- default_factory = list ,
250- description = "Previous conversation history as JSON array with timestamps" ,
251- )
331+ user_requirements : str = Field (description = "User requirements for the task" )
332+ current_state : str = Field (description = "Current task state" )
333+ state_description : str = Field (description = "Description of current state" )
334+ current_operation : str = Field (description = "Current operation being performed" )
335+ task_size : str = Field (description = "Task size classification" )
336+ task_size_definitions : str = Field (description = "Task size definitions" )
337+ state_transitions : str = Field (description = "Valid state transitions" )
338+ tool_descriptions : str = Field (description = "Available tool descriptions" )
339+ conversation_context : str = Field (description = "Conversation history context" )
340+ operation_context : str = Field (description = "Current operation context" )
341+ response_schema : str = Field (description = "JSON schema for the expected response format" )
252342
253343
254344class ValidationErrorSystemVars (BaseModel ):
@@ -300,6 +390,29 @@ class ElicitationFallbackUserVars(BaseModel):
300390 )
301391
302392
393+ class ResearchRequirementsAnalysisSystemVars (BaseModel ):
394+ """Variables for research_requirements_analysis system prompt."""
395+
396+ response_schema : str = Field (
397+ description = "JSON schema for the expected response format"
398+ )
399+
400+
401+ class ResearchRequirementsAnalysisUserVars (BaseModel ):
402+ """Variables for research_requirements_analysis user prompt."""
403+
404+ task_title : str = Field (description = "Title of the coding task" )
405+ task_description : str = Field (description = "Detailed description of the task" )
406+ user_requirements : str = Field (description = "User requirements for the task" )
407+ research_scope : str = Field (description = "Current research scope (none/light/deep)" )
408+ research_rationale : str = Field (
409+ description = "Rationale for why research is needed at current scope"
410+ )
411+ context : str = Field (
412+ description = "Additional context about the task and project"
413+ )
414+
415+
303416class TestingEvaluationSystemVars (BaseModel ):
304417 """Variables for testing evaluation system prompt."""
305418
0 commit comments