SpecialX
|
a70a74207e
|
feat(ai): 完善AI网关服务并添加LLM降级模式
config.py 加openai_api_key/base_url/dev_mode
新建llm_client.py httpx异步调OpenAI REST API
main.py 业务路由加/ai前缀+降级模式+readyz端点
Gateway添加/notifications和/ai路由
docs: known-issues记录P5三服务经验
|
2026-07-09 09:09:27 +08:00 |
|
SpecialX
|
5f18821302
|
feat(api-gateway): 添加content服务代理路由
main.go添加textbooks/chapters/knowledge-points/questions四组路由
config.go新增ContentServiceURL字段
docs: known-issues记录P4 content端到端验证经验
|
2026-07-09 08:52:30 +08:00 |
|
SpecialX
|
beb204c00f
|
docs(docs): 记录 P3 core-edu 端到端验证经验与场景映射
core-edu 段新增 6 行: datetime 转换/Kafka 非阻塞/相对 import/身份头/健康检查/Outbox 验证
api-gateway 段新增 3 行: 路由注册位置/多服务路由扩展/DEV_MODE 环境变量
经验日志追加 2026-07-09 P3 条目
|
2026-07-09 08:04:00 +08:00 |
|
SpecialX
|
2c7afe59ef
|
feat(teacher-portal): 实现登录页侧边栏路由组与真实JWT集成
- lib/auth.ts: localStorage token 存储 + login/logout
- app/login: 登录表单页
- components/AppShell: 视口驱动侧边栏 + 路由保护
- app/(app)/layout: 路由组布局套 AppShell
- app/(app)/dashboard: 聚合统计卡片页
- app/(app)/classes: 迁移 CRUD 改用真实 JWT
- app/page.tsx: 根路径重定向
- known-issues.md: 记录 P2 经验
|
2026-07-09 00:58:42 +08:00 |
|
SpecialX
|
d92cdda727
|
docs(docs): 记录 P1 端到端验证经验与 IAM 场景映射
在 2.3 iam 分区补充 5 条场景映射(ESM DI/Drizzle API/健康检查/Gateway 身份传递/DEV_MODE 登录);工作经验日志追加 P1 端到端验证完整记录。
|
2026-07-09 00:26:28 +08:00 |
|
SpecialX
|
ae460e61a3
|
docs(docs): 记录重定向循环与CICD配置经验
- 新增场景映射:尾斜杠重定向循环、开发模式鉴权旁路
- 工作经验日志:重定向循环修复、CI/CD 完整配置
|
2026-07-08 15:16:00 +08:00 |
|
SpecialX
|
beedbaf686
|
docs: 同步 P6 工作日志、runbook 与服务 README
- known-issues.md: 追加 9 条 P6 工作经验日志,更新 arch-scan 经验
- post-p6-followup.md: 新增 P6 后续工作手册 runbook
- iam/core-edu/content/msg README: 补充健康检查端点说明
|
2026-07-08 12:53:05 +08:00 |
|
SpecialX
|
e9ea34fe53
|
feat(p6): production hardening with circuit breaker, backup, monitoring and chaos engineering
CI Go / test (push) Has been cancelled
CI Python / test (push) Has been cancelled
CI TypeScript / test (push) Has been cancelled
CI Proto / lint (push) Failing after 8m7s
P6 生产硬化阶段交付物(46 文件):
## 1. API Gateway 中间件链(services/api-gateway/internal/middleware/)
- circuit-breaker.go: gobreaker v2 熔断器(5s 窗口/50% 错误率/30s OPEN→HALF_OPEN)
- ratelimit.go: 令牌桶限流(sync.Map + cleanup goroutine,默认 100rps/20 burst)
- cors.go: CORS 中间件(CORS_ORIGINS 环境变量)
- recovery.go: panic 恢复 + uuid request_id
- security.go: 安全头 + 请求体 10MB 限制
- requestid.go: 请求 ID 注入
- health/health.go: /healthz + /readyz 健康检查
- main.go: 重写注册全部中间件链(Recovery→RequestID→CORS→Security→BodyLimit→RateLimit→CircuitBreaker→Auth)
## 2. 基础设施硬化(infra/)
- backup/backup-mysql.sh: MySQL 全量备份(mysqldump+gzip,按服务独立)
- backup/restore-mysql.sh: 恢复脚本
- backup/backup-cron.sh: cron 调度入口(5 服务批量备份)
- alertmanager/alertmanager.yml: 告警路由(webhook + 邮件示例)
- prometheus/rules.yml: 8 条告警规则(服务可用性/性能/资源 3 组)
- grafana/dashboards/microservices-overview.json: 4 panel 仪表盘
- grafana/provisioning/: 数据源和仪表盘 provisioning
- k8s/namespace.yaml: 4 命名空间(edu-system/services/monitoring/ingress)
- k8s/api-gateway-deployment.yaml: Deployment + Service 骨架
- chaos/experiments.yaml: 3 个 Litmus 混沌实验(pod-kill/network-latency/disk-fill)
- docker-compose.monitoring.yml: 监控栈 profile
- security/secrets.example.env: 8 项密钥占位符
- security/waf-rules.conf: ModSecurity WAF 规则骨架
## 3. 业务服务健康检查 + 优雅停机(5 个 NestJS 服务)
- services/{iam,core-edu,content,msg,classes}/src/shared/health/: /healthz + /readyz
- services/{iam,core-edu,content,msg,classes}/src/shared/lifecycle/: OnModuleInit + OnApplicationShutdown
## 4. Python 服务健康检查
- services/{ai,data-ana}/src/health/health.py: FastAPI APIRouter
## 5. 运维文档
- docs/architecture/runbooks/p6-hardening.md: P6 总览 Runbook(9 章节)
- docs/architecture/runbooks/incident-response.md: 事件响应手册(5 章节)
- docs/architecture/004-p6-addendum.md: 004 架构补记 P6 章节
- docs/troubleshooting/known-issues-p6-addendum.md: 15 条 P6 场景→技术映射
## 验收信号
- RPO ≤ 15min(MySQL 备份 + binlog PITR)
- RTO ≤ 30min(K8s 滚动更新 + DNS 切换)
- P99 ≤ 500ms(熔断 + 限流 + 缓存)
- 熔断器错误率 > 50% 触发 OPEN
- 限流 100rps/20 burst
- 备份保留 7 天
- 混沌实验每月 1 次
|
2026-07-08 02:16:58 +08:00 |
|
SpecialX
|
2ba4250165
|
feat(p1): complete P1 foundation stage
CI Go / test (push) Has been cancelled
CI Proto / lint (push) Has been cancelled
CI Python / test (push) Has been cancelled
CI TypeScript / test (push) Has been cancelled
- monorepo: pnpm workspace + go.work + pyproject.toml + commitlint/husky
- infra: docker-compose (minimal + full profiles) + init-sql + prometheus
- arch-scan: multi-language scanner skeleton (TS/Go/Python/Proto)
- shared-proto: buf v2 + classes.proto (ClassService CRUD contract)
- api-gateway: Go/Gin + JWT HS256 auth + reverse proxy + request ID
- classes: NestJS golden template (error system + observability + middleware + CRUD + tests)
- teacher-portal: Next.js + paper-feel UI design system
- CI/CD: 4 workflows (go/ts/py/proto)
- docs: migration guide + project_rules + coding-standards + git-workflow + ui-design-system + 004 + 9 module READMEs + known-issues + spec/plan migration + roadmap
|
2026-07-07 23:39:37 +08:00 |
|