Delete calculate_identity_confidence.py
Browse files- calculate_identity_confidence.py +0 -177
calculate_identity_confidence.py
DELETED
|
@@ -1,177 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
from typing import Dict, Any
|
| 3 |
-
from prompt_analyzer import create_handler
|
| 4 |
-
from statistics import mean
|
| 5 |
-
from collections import Counter
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def calculate_identity_confidence(
|
| 9 |
-
sources_data: Dict[str, Any],
|
| 10 |
-
code_style_results: Dict[str, Any],
|
| 11 |
-
project_preferences: Dict[str, Any],
|
| 12 |
-
temporal_patterns: Dict[str, Any]
|
| 13 |
-
) -> Dict[str, Any]:
|
| 14 |
-
"""Synthesizes all analysis results into a comprehensive developer identity profile"""
|
| 15 |
-
|
| 16 |
-
handler = create_handler()
|
| 17 |
-
|
| 18 |
-
# Create consolidated analysis data for the prompt
|
| 19 |
-
analysis_data = {
|
| 20 |
-
"repositories": sources_data,
|
| 21 |
-
"code_style_analysis": code_style_results,
|
| 22 |
-
"project_preferences": project_preferences,
|
| 23 |
-
"temporal_patterns": temporal_patterns
|
| 24 |
-
}
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
prompt = f"""
|
| 28 |
-
|
| 29 |
-
IDENTITY CONFIDENCE CALCULATION
|
| 30 |
-
|
| 31 |
-
You are an expert in developer profiling and behavioral analysis. Synthesize all provided analysis data to create a comprehensive profile of the developer's identity, expertise, and behavioral patterns.
|
| 32 |
-
|
| 33 |
-
Analysis Data:
|
| 34 |
-
{json.dumps(analysis_data, indent=2)}
|
| 35 |
-
|
| 36 |
-
Based on all provided repository data and previous analyses, create a detailed developer profile focusing on:
|
| 37 |
-
1. Technical expertise and knowledge domains
|
| 38 |
-
2. Problem-solving patterns and approaches
|
| 39 |
-
3. Development philosophy and practices
|
| 40 |
-
4. Unique identifiers and consistent traits
|
| 41 |
-
|
| 42 |
-
Generate a single comprehensive identity profile JSON:
|
| 43 |
-
|
| 44 |
-
{{
|
| 45 |
-
"developer_profile": {{
|
| 46 |
-
"expertise": {{
|
| 47 |
-
"primary_domains": [
|
| 48 |
-
{{
|
| 49 |
-
"domain": string,
|
| 50 |
-
"proficiency_level": string, // "beginner", "intermediate", "expert"
|
| 51 |
-
"evidence": [string],
|
| 52 |
-
"confidence": number // 0-100
|
| 53 |
-
}}
|
| 54 |
-
],
|
| 55 |
-
"technical_depth": {{
|
| 56 |
-
"languages": [
|
| 57 |
-
{{
|
| 58 |
-
"name": string,
|
| 59 |
-
"mastery_level": string,
|
| 60 |
-
"usage_patterns": [string],
|
| 61 |
-
"notable_practices": [string]
|
| 62 |
-
}}
|
| 63 |
-
],
|
| 64 |
-
"frameworks": [
|
| 65 |
-
{{
|
| 66 |
-
"name": string,
|
| 67 |
-
"usage_sophistication": string,
|
| 68 |
-
"implementation_patterns": [string]
|
| 69 |
-
}}
|
| 70 |
-
],
|
| 71 |
-
"specialized_knowledge": [
|
| 72 |
-
{{
|
| 73 |
-
"area": string, // e.g. "cryptography", "distributed systems"
|
| 74 |
-
"depth": string,
|
| 75 |
-
"application_examples": [string]
|
| 76 |
-
}}
|
| 77 |
-
]
|
| 78 |
-
}}
|
| 79 |
-
}},
|
| 80 |
-
"work_patterns": {{
|
| 81 |
-
"development_style": {{
|
| 82 |
-
"code_organization": string,
|
| 83 |
-
"problem_solving_approach": string,
|
| 84 |
-
"quality_focus": string,
|
| 85 |
-
"distinctive_habits": [string]
|
| 86 |
-
}},
|
| 87 |
-
"workflow_characteristics": {{
|
| 88 |
-
"development_cycle": string,
|
| 89 |
-
"testing_approach": string,
|
| 90 |
-
"refactoring_patterns": string,
|
| 91 |
-
"documentation_style": string
|
| 92 |
-
}},
|
| 93 |
-
"communication_style": {{
|
| 94 |
-
"code_commenting": string,
|
| 95 |
-
"commit_messages": string,
|
| 96 |
-
"documentation_quality": string
|
| 97 |
-
}}
|
| 98 |
-
}},
|
| 99 |
-
"behavioral_traits": {{
|
| 100 |
-
"strengths": [
|
| 101 |
-
{{
|
| 102 |
-
"trait": string,
|
| 103 |
-
"evidence": [string],
|
| 104 |
-
"consistency": number // 0-100
|
| 105 |
-
}}
|
| 106 |
-
],
|
| 107 |
-
"areas_for_improvement": [
|
| 108 |
-
{{
|
| 109 |
-
"area": string,
|
| 110 |
-
"indicators": [string]
|
| 111 |
-
}}
|
| 112 |
-
],
|
| 113 |
-
"unique_characteristics": [
|
| 114 |
-
{{
|
| 115 |
-
"trait": string,
|
| 116 |
-
"significance": string,
|
| 117 |
-
"supporting_patterns": [string]
|
| 118 |
-
}}
|
| 119 |
-
]
|
| 120 |
-
}},
|
| 121 |
-
"knowledge_breadth": {{
|
| 122 |
-
"technical_stack": {{
|
| 123 |
-
"preferred_technologies": [string],
|
| 124 |
-
"experience_indicators": [string],
|
| 125 |
-
"adoption_patterns": string
|
| 126 |
-
}},
|
| 127 |
-
"domain_knowledge": {{
|
| 128 |
-
"primary_domains": [string],
|
| 129 |
-
"depth_indicators": [string],
|
| 130 |
-
"application_examples": [string]
|
| 131 |
-
}},
|
| 132 |
-
"architectural_understanding": {{
|
| 133 |
-
"preferred_patterns": [string],
|
| 134 |
-
"complexity_handling": string,
|
| 135 |
-
"scalability_awareness": string
|
| 136 |
-
}}
|
| 137 |
-
}},
|
| 138 |
-
"identity_confidence": {{
|
| 139 |
-
"overall_score": number, // 0-100
|
| 140 |
-
"distinguishing_factors": [
|
| 141 |
-
{{
|
| 142 |
-
"factor": string,
|
| 143 |
-
"significance": string,
|
| 144 |
-
"supporting_evidence": [string]
|
| 145 |
-
}}
|
| 146 |
-
],
|
| 147 |
-
"consistency_metrics": {{
|
| 148 |
-
"coding_style": number, // 0-100
|
| 149 |
-
"problem_solving": number, // 0-100
|
| 150 |
-
"quality_standards": number // 0-100
|
| 151 |
-
}},
|
| 152 |
-
"pattern_reliability": {{
|
| 153 |
-
"stable_patterns": [string],
|
| 154 |
-
"variable_patterns": [string],
|
| 155 |
-
"context_dependencies": [string]
|
| 156 |
-
}}
|
| 157 |
-
}}
|
| 158 |
-
}}
|
| 159 |
-
}}
|
| 160 |
-
|
| 161 |
-
Critical Analysis Requirements:
|
| 162 |
-
1. Base all conclusions on concrete evidence from the provided data
|
| 163 |
-
2. Focus on patterns that appear consistently across repositories
|
| 164 |
-
3. Highlight unique traits that distinguish this developer
|
| 165 |
-
4. Note any evolution in skills or practices
|
| 166 |
-
5. Indicate confidence levels for all major conclusions
|
| 167 |
-
6. Consider both technical and behavioral aspects
|
| 168 |
-
7. Identify any potential biases or limitations in the analysis
|
| 169 |
-
"""
|
| 170 |
-
|
| 171 |
-
try:
|
| 172 |
-
result = handler.generate_json_response(prompt)
|
| 173 |
-
except Exception as e:
|
| 174 |
-
print(f"Error analyzing: {str(e)}")
|
| 175 |
-
|
| 176 |
-
return result
|
| 177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|