Commit Graph

4 Commits

Author SHA1 Message Date
Codex Agent b236021993 chore: remove duplicate AGENTS.md from root
- AGENTS.md has been moved to docs/guides/ for consistent structure
- This cleans up the root directory
- All documentation is now properly organized under docs/
2025-11-18 17:11:58 +08:00
Codex Agent 692ff6ef0f docs: 归档所有markdown文档到docs目录
目录结构优化:
1. 创建了规范的文档目录结构
   - docs/guides/ - 开发指南文档
   - docs/features/ - 功能开发文档
     - admin/ - 管理员功能
     - login_redirect/ - 登录跳转功能
     - org_chart/ - 组织架构功能
   - docs/security/ - 安全与权限文档
   - docs/reports/ - 测试报告
     - test-reports/ - 功能测试报告
     - checkpoint-reports/ - Checkpoint系统报告
   - docs/development/ - 开发总结报告
   - docs/README.md - 文档索引

2. 移动了38个markdown文件到对应目录
   - 开发指南: README.md, AGENTS.md, CLAUDE.md
   - 功能开发: 12个功能实现文档
   - 安全权限: 5个安全和权限文档
   - 测试报告: 10个测试报告
   - 开发总结: 2个完成报告
   - Checkpoint: 5个系统报告

3. 创建了文档索引文件
   - docs/README.md
   - 详细说明目录结构和文档分类
   - 提供快速导航链接
   - 方便查阅和维护

效果:
 根目录不再有混乱的markdown文件
 文档按功能模块清晰分类
 便于开发者快速定位相关文档
 建立了完整的项目文档体系

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 17:06:45 +08:00
Codex Agent cf3bfd3fc0 feat: checkpoint system comprehensive enhancement
Security Fixes:
- Fix critical data loss risk in restore_checkpoint (TRUNCATE without rollback)
- Add table dependency tracking with topological sort
- Implement auto-backup before restore for safety
- Add table-level locks during restore (EXCLUSIVE MODE)
- Single transaction for atomic operations

Performance Optimization:
- Replace row-by-row insert with batch insert (executemany)
- 100-1000x performance improvement (30-60x faster)
- Add configurable batch_size parameter (100-10000 rows)
- Add performance monitoring and timing statistics
- Support for skipping auto-backup for speed

Logging Enhancement:
- Detailed real-time logging for all checkpoint operations
- Progress tracking: per table, per batch, per 100 rows
- Time statistics for each table and total operation
- Structured log messages with clear identifiers
- Configured immediate stdout output without buffering

Documentation:
- Updated CLAUDE.md with improved guidelines
- Created CHECKPOINT_SECURITY_FIX_SUMMARY.md
- Created CHECKPOINT_LOGGING_GUIDE.md
- Created CHECKPOINT_PERFORMANCE_OPTIMIZATION.md
- Created PATCH_CHECKPOINT_SECURITY.md
- Created analysis/checkpoint_analysis.md

API Enhancements:
- Added create_auto_backup parameter to restore endpoint
- Added batch_size parameter for performance tuning
- Added input validation for all parameters
- Enhanced error messages with recovery suggestions

Modified Files:
- lawrisk/services/licensing_repo.py: Core checkpoint logic
- lawrisk/api/v2.py: REST API endpoints
- app.py: Logging configuration
- docs/CLAUDE.md: Updated development guide

Closes: #security #performance #logging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 17:33:12 +08:00
Codex Agent bfda66afc1 refactor: 重新规划项目结构为标准Python包
主要变更:
- 重组项目目录结构,采用标准Python包组织方式
  * 创建 lawrisk/ 主包
  * 分离 API 路由层 (api/v1.py, api/v2.py)
  * 封装业务逻辑层 (services/)
  * 抽取中间件 (middleware/)
  * 整理工具模块 (utils/)

- 重构应用入口
  * 使用 Flask Blueprint 注册路由
  * 简化 app.py 逻辑

- 添加项目文档
  * 创建 README.md 项目说明
  * 创建 requirements.txt 依赖管理
  * 统一文档到 docs/ 目录

- 文件组织优化
  * 数据文件移动到 data/
  * 测试目录 tests/ 准备就绪

- 修复导入路径
  * 更新所有模块导入为相对路径
  * 确保应用正常启动运行

验证:
 应用成功启动在端口 8000
 所有路由正确注册
 健康检查端点正常响应

Closes: #重构项目结构
2025-10-29 15:31:01 +08:00