We've successfully moved from mock testing to real production implementation with:
-
GitHub API Integration (
utils/github_mcp.py)- ✅ Fetches real repository metadata
- ✅ Retrieves actual file trees (up to 500 files)
- ✅ Gets real README content
- ✅ Fetches actual issues (last 20)
- ✅ Retrieves real pull requests (last 20)
- ✅ Gets commit history (last 50)
- ✅ Detects dependencies from multiple file types
- ✅ Full error handling and fallback to mock
-
Interactive CLI (
cli_runner.py)- ✅ Beautiful terminal interface with colors
- ✅ Step-by-step interactive prompts
- ✅ Repository URL input (multiple formats supported)
- ✅ Difficulty selection (easy/medium/hard/expert)
- ✅ Problem type selection (feature/bug-fix/refactor/optimization)
- ✅ Time limit configuration
- ✅ Real-time progress updates
- ✅ JSON output saved to file
- ✅ Performance metrics display
-
Updated Agent Pipeline
- ✅ Scanner Agent uses real GitHub data
- ✅ All 7 agents work with real repository information
- ✅ Multi-agent analysis (3-loop pattern)
- ✅ Single-pass QA validation with feedback
- ✅ Problem refinement based on QA feedback
- ✅ Complete A2A protocol integration
hackathon_code/
├── cli_runner.py # 🆕 Interactive CLI (main entry point)
├── utils/
│ ├── github_mcp.py # 🆕 Real GitHub API integration
│ ├── a2a_protocol.py # A2A protocol implementation
│ ├── monitoring.py # Performance & logging
│ └── json_parser.py # Robust JSON parsing
├── agents/
│ ├── scanner_agent.py # ✏️ Updated for real GitHub data
│ ├── code_analyzer_agent.py # Code analysis
│ ├── pr_analyzer_agent.py # PR analysis
│ ├── issue_analyzer_agent.py # Issue analysis
│ ├── dependency_analyzer_agent.py # Dependency analysis
│ ├── problem_creator_agent.py # ✏️ Updated with refinement mode
│ ├── qa_validator_agent.py # ✏️ Updated for single-pass validation
│ └── base_agent.py # Base agent class
├── orchestrator.py # ✏️ Updated to accept pre-fetched data
├── CLI_GUIDE.md # 🆕 Complete usage guide
├── PRODUCTION_READY.md # 🆕 This file
├── test_github_token.sh # 🆕 Token verification script
└── final_docs/ # Architecture & setup docs
# Set GitHub token
export GITHUB_TOKEN='your_github_personal_access_token'
# Verify Google Cloud setup (should already be done)
export GOOGLE_CLOUD_PROJECT='true-ability-473715-b4'
export GOOGLE_APPLICATION_CREDENTIALS='/path/to/service-account-key.json'
export GOOGLE_CLOUD_REGION='us-central1'cd /Users/muratcankoylan/ActualCode/hackathon_code
./test_github_token.shExpected output:
✅ GITHUB_TOKEN is set
Testing API access...
✅ GitHub API access successful!
Authenticated as: your-username
Ready to use ActualCode CLI!
# Activate virtual environment
source venv/bin/activate
# Run the interactive CLI
python cli_runner.py1. Enter repository URL (e.g., facebook/react)
2. Select difficulty level
3. Select problem type
4. Select time limit
5. Confirm and generate!
The CLI will:
- ✅ Fetch real repository data from GitHub
- ✅ Run 7 AI agents with multi-agent analysis
- ✅ Generate realistic coding assessment
- ✅ Validate with QA scoring
- ✅ Refine based on feedback
- ✅ Save complete JSON to file
Output file: assessment_YYYYMMDD_HHMMSS.json
# From utils/github_mcp.py
repo_data = await github_client.fetch_repository_data(
repo_url="owner/repo",
fetch_issues=True,
fetch_prs=True,
fetch_commits=True,
max_items=20
)Returns:
- Repository metadata (name, description, language, stars, etc.)
- File tree (up to 500 files)
- README content
- Recent issues
- Recent pull requests
- Commit history
- Dependencies
╔═══════════════════════════════════════════════════════════════════════════╗
║ ACTUALCODE ║
║ AI-Powered Code Assessment Generator ║
╚═══════════════════════════════════════════════════════════════════════════╝
Environment Check
═══════════════════════
✅ GitHub token configured
✅ Google Cloud project: true-ability-473715-b4
Configuration
═══════════════════════
GitHub Repository URL: expressjs/express
Select Difficulty Level:
1. easy
→ 2. medium
3. hard
4. expert
Scanner (Real GitHub Data)
↓
Code Analyzer (Loop 1, 2, 3)
PR Analyzer (Loop 1, 2, 3)
Issue Analyzer (Loop 1, 2, 3)
Dependency Analyzer (Loop 1, 2, 3)
↓
Problem Creator (Initial)
↓
QA Validator (Single Pass)
↓
Problem Creator (Refinement)
↓
Final Assessment ✨
{
"problem": {
"title": "Implement Middleware Error Handling",
"description": "Add comprehensive error handling...",
"requirements": [
"Create error handling middleware",
"Add custom error classes",
"Implement error logging",
...
],
"acceptance_criteria": [...],
"starter_code": [
{
"filename": "middleware/errorHandler.js",
"content": "// TODO: Implement...",
"description": "Error handling middleware"
}
],
"hints": [...],
"estimated_time": 180,
"difficulty": "medium",
"tech_stack": ["JavaScript", "Express", "Node.js"],
"evaluation_rubric": [...]
},
"validation": {
"overall_score": 88,
"scores": {
"feasibility": 90,
"quality": 85,
"technical": 88,
"educational": 90
}
},
"repository_analysis": {
"code_analysis": {...},
"pr_analysis": {...},
"issue_analysis": {...},
"dependency_analysis": {...}
},
"performance": {
"total_duration": 142.5,
"scan": 8.3,
"analysis": 78.2,
"creation": 42.1,
"validation": 13.9
}
}Class: GitHubMCP in utils/github_mcp.py
Key Methods:
fetch_repository_data()- Main entry point_fetch_repo_metadata()- Basic repo info_fetch_file_tree()- File structure_fetch_readme()- README content_fetch_issues()- Issue tracking_fetch_pull_requests()- PR history_fetch_commits()- Commit log_fetch_dependencies()- Dependency files
Authentication: Uses GitHub Personal Access Token
Rate Limits:
- Authenticated: 5,000 requests/hour
- Typical usage: 10-15 requests per assessment
Before (Mock):
def scan_repository(repo_url):
return mock_dataAfter (Real):
async def scan_repository(repo_url, pre_fetched_data=None):
if pre_fetched_data:
return pre_fetched_data # Use CLI-fetched data
elif self.use_real_data:
return await github_client.fetch_repository_data(repo_url)
else:
return mock_data # FallbackAdded:
repo_dataparameter for pre-fetched data- Smart data source handling
- Performance tracking
Two Modes:
- Creation Mode: Generate new problem from scratch
- Refinement Mode: Improve existing problem based on QA feedback
Refinement Rules:
- Keep same title, description, tech stack
- Only fix critical issues
- Make minimal changes (preserve 90%)
- Honor QA feedback
Before: Multiple validation loops (slow) After: Single validation + feedback to Problem Creator (fast)
Benefits:
- Faster generation (1 validation instead of 2-3)
- Better refinement (specific feedback)
- Cleaner workflow
- 🔵 Blue: Information/headers
- 🟢 Green: Success messages
- 🟡 Yellow: Warnings/prompts
- 🔴 Red: Errors
- 🎨 Cyan: User inputs
- Default values for quick testing
- Number-based selection
- Input validation
- Confirmation before generation
- Real-time agent status
- Performance metrics
- File saved confirmations
# Good test repositories:
python cli_runner.py
# Enter: minimaxir/big-list-of-naughty-strings
# or: sindresorhus/ispython cli_runner.py
# Enter: facebook/react
# or: vercel/next.js
# or: expressjs/express# Check generated file
ls -lh assessment_*.json
# View content
cat assessment_20250930_*.json | jq '.problem.title'Typical Generation Time: 120-180 seconds
Breakdown:
- GitHub Fetch: 5-15s
- Scanner: <1s (uses pre-fetched data)
- Analysis (3 loops): 60-90s
- Problem Creation: 30-45s
- QA Validation: 10-15s
- Refinement: 20-35s
Optimization:
- Pre-fetch GitHub data (parallel to agent init)
- Single-pass QA validation
- Efficient token limits (8192 max)
- Robust JSON parsing
- ✅ GitHub token stored in environment variable
- ✅ No tokens in code or logs
- ✅ Service account key not in repository
- ✅ API rate limiting handled
- ✅ Error messages don't expose sensitive data
- Large Repositories: File tree limited to 500 files
- Rate Limits: GitHub API has hourly limits
- Private Repos: Requires repo scope in token
- File Content: Not fetched (only metadata) to save API calls
- Fetch selected file contents for deeper analysis
- Add support for GitLab, Bitbucket
- Web UI integration
- Database storage of generated assessments
- Real-time streaming of agent progress
- Multi-repository batch processing
- Custom agent configurations
- Assessment templates
We've built a fully functional, production-ready CLI tool that:
✅ Fetches real data from GitHub repositories
✅ Runs 7 AI agents in a multi-agent pipeline
✅ Generates realistic, implementable coding assessments
✅ Validates quality with automated QA scoring
✅ Provides beautiful CLI experience with colors and interactivity
✅ Saves complete JSON output for further use
✅ Handles errors gracefully with fallbacks
✅ Includes comprehensive documentation
Ready to demo! 🚀