# youhua **Repository Path**: wu1123/youhua ## Basic Information - **Project Name**: youhua - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-22 - **Last Updated**: 2026-02-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GitHub智能Agent群系统 [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![FastAPI](https://img.shields.io/badge/FastAPI-0.109+-green.svg)](https://fastapi.tiangolo.com/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 自动化的GitHub安全漏洞发现与修复系统。 ## 系统架构 本系统由四个核心Agent组成: - **TaskScout** - 任务发现Agent:多平台赏金监控、GitHub高级搜索 - **CodeSentinel** - 代码分析Agent:CodeQL深度集成、多工具协同分析 - **AutoPatch** - 自动修复Agent:多范式修复策略、修复验证流水线 - **CommBridge** - 沟通协作Agent:GitHub自动化交互、多轮对话管理 ## 技术栈 - **运行时**: Python 3.11+ - **Web框架**: FastAPI - **异步任务**: Celery + RabbitMQ - **数据库**: PostgreSQL 15+ - **缓存**: Redis 7+ - **代码分析**: CodeQL, Bandit, Safety - **容器化**: Docker ## 快速开始 ### 环境要求 - Python 3.11+ - Docker & Docker Compose - PostgreSQL 15+ - Redis 7+ - RabbitMQ 3.12+ ### 安装步骤 1. **克隆仓库** ```bash git clone https://github.com/your-org/youhua.git cd youhua ``` 2. **创建虚拟环境** ```bash python -m venv venv source venv/bin/activate # Linux/macOS # 或 venv\Scripts\activate # Windows ``` 3. **安装依赖** ```bash pip install -e ".[dev]" ``` 4. **配置环境变量** ```bash cp .env.example .env # 编辑 .env 文件,填入必要的配置 ``` 5. **启动基础设施服务** ```bash docker-compose up -d postgres redis rabbitmq ``` 6. **初始化数据库** ```bash python scripts/init_db.py ``` 7. **启动应用** ```bash # 启动API服务 uvicorn app.main:app --reload # 启动Celery Worker(新终端) celery -A app.workers.celery_app worker --loglevel=info ``` ### 访问服务 - API文档: http://localhost:8000/docs - 健康检查: http://localhost:8000/health ## 项目结构 ``` youhua/ ├── app/ # 应用主目录 │ ├── core/ # 核心模块(数据库、配置、异常) │ ├── models/ # SQLAlchemy数据模型 │ ├── schemas/ # Pydantic验证模型 │ ├── agents/ # 四个核心Agent实现 │ │ ├── task_scout/ # 任务发现Agent │ │ ├── code_sentinel/ # 代码分析Agent │ │ ├── auto_patch/ # 自动修复Agent │ │ └── comm_bridge/ # 沟通协作Agent │ ├── api/ # API路由 │ └── workers/ # Celery Workers ├── tests/ # 测试目录 ├── scripts/ # 工具脚本 ├── docker/ # Docker配置 ├── docs/ # 文档 └── pyproject.toml # 项目配置 ``` ## 开发指南 ### 运行测试 ```bash # 运行所有测试 pytest # 运行特定测试 pytest tests/unit/test_task_scout.py # 生成覆盖率报告 pytest --cov=app --cov-report=html ``` ### 代码风格 ```bash # 格式化代码 black app tests # 代码检查 ruff check app tests # 类型检查 mypy app ``` ## API端点 | 方法 | 路径 | 描述 | |------|------|------| | GET | /health | 健康检查 | | GET | /metrics | 监控指标 | | POST | /api/v1/tasks | 创建任务 | | GET | /api/v1/tasks | 获取任务列表 | | GET | /api/v1/tasks/{id} | 获取任务详情 | | POST | /api/v1/tasks/{id}/analyze | 触发分析 | | POST | /api/v1/tasks/{id}/fix | 触发修复 | ## 文档 - [API参考文档](docs/API_REFERENCE.md) - [运维指南](docs/OPERATIONS.md) - [需求规格说明书](.omc/autopilot/spec.md) - [实施计划](.omc/plans/autopilot-impl.md) ## 许可证 MIT License - 详见 [LICENSE](LICENSE) 文件