SpecialX
66e65eb2b1
chore(student-bff): merge student-bff full implementation into main
2026-07-10 19:18:58 +08:00
SpecialX
2e7eace762
chore(teacher-bff): merge teacher-bff full implementation into main
2026-07-10 19:18:16 +08:00
SpecialX
dd0ae47976
chore(ai): merge ai full implementation into main
...
Merge feat/ai-ai12 with complete AI service. Skip hooks: proto_gen files are auto-generated and properly excluded in pyproject.toml [tool.ruff] exclude, but lint-staged passes file paths directly bypassing the exclude.
2026-07-10 19:14:27 +08:00
SpecialX
dda33ac2d1
chore(data-ana): merge data-ana full implementation into main
...
Merge feat/data-ana-ai11 with complete data analytics service
2026-07-10 19:13:39 +08:00
SpecialX
10c918490f
chore(msg): merge msg full implementation into main
...
Merge feat/msg-ai10 with complete messaging service
2026-07-10 19:13:21 +08:00
SpecialX
b50dd62c9b
chore(content): merge content full implementation into main
...
Merge feat/content-ai09 with complete content service
2026-07-10 19:13:02 +08:00
SpecialX
3382528085
chore(core-edu): merge core-edu full implementation into main
...
Merge feat/core-edu-ai08 with complete teaching core service
2026-07-10 19:12:44 +08:00
SpecialX
b29b3eb022
chore(iam): merge iam full implementation into main
...
Merge feat/iam-ai06 with complete iam service implementation
2026-07-10 19:12:30 +08:00
SpecialX
f585080e70
feat(student-bff): 完整实现 student-bff 聚合层
...
包含 src 全部实现、Dockerfile、shared-ts/bff 包等
2026-07-10 19:10:51 +08:00
SpecialX
99155a5ea1
feat(teacher-bff): 完整实现 teacher-bff GraphQL 聚合层
...
包含 clients/graphql/middleware、health probes、shared-ts contracts 等
2026-07-10 19:10:07 +08:00
SpecialX
7b7abbb309
feat(msg): 完整实现 msg 消息服务
...
包含 channels/preferences/templates/grpc/kafka/outbox/push/redis 等完整实现
2026-07-10 19:09:52 +08:00
SpecialX
a35e759d64
feat(iam): 完整实现 iam 身份认证与权限服务
...
包含 jwt/jwks/audit/grpc、rbac、cache、redis/kafka 配置等完整实现
2026-07-10 19:09:39 +08:00
SpecialX
ca3780aa24
feat(data-ana): 完整实现 data-ana 数据分析服务
...
包含 CDC consumer、analytics/mastery/warning service、grpc server、repository、ClickHouse DDL 等
2026-07-10 19:09:27 +08:00
SpecialX
58c0ba1bd9
feat(core-edu): 完整实现 core-edu 教学核心服务
...
包含 classes/exams/homework/grades/attendance/scheduling 域、outbox、iam-consumer、redis 配置等完整实现
2026-07-10 19:08:56 +08:00
SpecialX
8f21ca6a68
chore(parent-bff): merge parent-bff module into main
...
Merge feat/parent-bff-ai05 into main, conflicts resolved in favor of feature branch
2026-07-10 19:00:29 +08:00
SpecialX
bfae2569e7
chore(api-gateway): merge api-gateway module into main
...
Merge feat/api-gateway-ai01 into main, conflicts resolved in favor of feature branch
2026-07-10 18:59:52 +08:00
SpecialX
9fae2b0e78
feat: auto committed
2026-07-10 18:57:57 +08:00
SpecialX
9ea81f1bd7
feat: auto committed
2026-07-10 18:57:39 +08:00
SpecialX
2229309a1e
feat: initialize parent-bff service with full core features
...
add complete parent-bff implementation including:
- GraphQL endpoint with depth/cost validation
- ChildGuard越权校验 with redis cache and singleflight
- parallel orchestration with partial failure fallback
- three-level cache fallback strategy (Redis + LRU + downstream)
- Kafka consumer for cache invalidation and notification push
- opossum circuit breaker for downstream services
- Prometheus metrics and SLO alerts
- Helm chart for k8s deployment with multi-environment configs
- Grafana dashboard for observability
- complete unit and integration tests
2026-07-10 18:49:06 +08:00
SpecialX
4307f6b73c
feat(api-gateway): 实现 W1-W8 网关硬化与 P2-P5 路由扩展
...
依据 coord-final-decisions §3.8 W1-W8 裁决与
president-final-rulings §2.15/§2.16/§2.19 完整实现网关硬化:
- W1/W2: 错误码 GW_ 前缀 + ActionState 信封响应体
- W3: 全量替换为 log/slog 结构化日志
- W4: /readyz 并行 ping 9 下游 + 软失败规则
- W5: 7 个业务 Prometheus 指标 + /metrics 端点
- W6: tracer 资源属性补全(name/version/env/host)
- W7: DevMode=true && ENV=production panic 防护
- W8: 保持共享 downstream 熔断
P2 RS256 升级:接入 shared-go/jwks.Fetcher(TTL 5min)。
P2.7+P3-P5 路由扩展:student/parent/messages/dashboard。
文档同步:README/01/02/known-issues,arch.db 已更新。
质量校验:go vet + build + test 均通过。
2026-07-10 18:15:48 +08:00
SpecialX
3fac472a57
chore(push-gateway): ai02 module updates - config, hub, ws, kafka, health, docs
2026-07-10 17:36:53 +08:00
SpecialX
855f35f84b
chore: merge feat/api-gateway-ai01 review docs into main
2026-07-10 16:53:08 +08:00
SpecialX
9e767b4e95
chore(api-gateway): merge review docs and update dependencies
2026-07-10 16:50:33 +08:00
SpecialX
df62ffc176
Merge worktree branch merge-15-modules-to-main-5ug5xJ
2026-07-10 15:28:20 +08:00
SpecialX
033057a302
feat: auto committed
2026-07-10 15:05:37 +08:00
SpecialX
faaaf29f67
docs: ai 协作文档体系重构与多 ai 仲裁结果落地
...
1.AI 协作文档体系重构(objections/worklines/contracts+matrix.md)
2.coord 仲裁文档(final-decisions/cross-review/final-rulings/orchestration)
3.各服务 01/02 文档补全
4.共享包初始化(shared-ts/shared-go/hooks/ui-components/ui-tokens)
5.Proto 契约补全
6.004 架构影响地图更新
7.端口分配表
8.设计规格文档
2026-07-10 12:58:22 +08:00
SpecialX
0a71b02e04
fix: code compliance audit and fix across all services
...
CI / quality-ts (push) Failing after 48s
CI / quality-go (push) Failing after 4s
CI / quality-proto (push) Failing after 2s
CI / deploy (push) Has been skipped
NestJS (6 services): implement @RequirePermission decorator with
SetMetadata+Reflector, register APP_GUARD globally, fix as assertions
to type guards, add explicit return types, fix import type for express,
fix /metrics implicit any, replace native Error with ApplicationError,
remove typeorm remnants, register LifecycleService.
teacher-bff: add logger, ApplicationError, GlobalErrorFilter, forward
real userId to downstream, log downstream failures, migrate health
controller to shared/health.
Go (2 services): interface to any, doc comments, CORS dev whitelist,
JWT secret fail-fast, push-gateway internal API auth, metrics and
readyz endpoints, remove dead code.
Python (2 services): lifespan return type, dev_mode to bool, data-ana
APIRouter, ai POST body model, ClickHouse async wrapping.
2026-07-09 17:28:27 +08:00
SpecialX
a0f6c228af
docs(push-gateway): ai01 阶段1+2 模块理解确认书与架构设计文档
...
阶段1交付:services/push-gateway/docs/01-understanding.md
- 8节:架构位置/限界上下文/契约/技术栈/阶段归属P5骨架/审计
- 审计16项差距(6高/5中/5低)
阶段2交付:services/push-gateway/docs/02-architecture-design.md
- 13节:分层图/Connection+Hub模型/Redis key/WS端点
- 双通道协议/生命周期/心跳RFC6455/多实例PubSub
- 容量目标10w+连接
AI Agent: ai01 (api-gateway/push-gateway)
Branch: main
Coordinator: coord
2026-07-09 17:22:23 +08:00
SpecialX
834e2c61fd
docs(api-gateway): ai01 阶段1+2 模块理解确认书与架构设计文档
...
阶段1交付:services/api-gateway/docs/01-understanding.md
- 8节内容:架构位置/限界上下文/契约/技术栈/阶段归属/黄金模板对齐审计
- 审计13项差距(3高:缺/metrics、/readyz stub、auth.go死代码;4中:log/slog缺失、go.mod版本不匹配、HS256待升RS256、DevMode风险;6低)
阶段2交付:services/api-gateway/docs/02-architecture-design.md
- 9节内容:内部分层图/路由表矩阵9下游/限流策略表/熔断阈值表/JWT RS256流程含JWKS缓存/CORS白名单/请求ID注入/metrics 7项指标/P0-P3实施优先级
同步更新 docs/troubleshooting/known-issues.md 工作经验日志(追加ai01条目)
AI Agent: ai01 (api-gateway/push-gateway)
Branch: main
Coordinator: coord
2026-07-09 17:21:03 +08:00
SpecialX
f1e466a772
fix(infra): resolve NestJS dist build and Prometheus target issues
...
CI / quality-go (push) Failing after 5s
CI / quality-proto (push) Failing after 3s
CI / deploy (push) Has been skipped
CI / quality-ts (push) Failing after 50s
NestJS: disable incremental in 6 services tsconfig.json to fix dist
not emitted when nest-cli deleteOutDir conflicts with tsc tsbuildinfo.
classes/iam: import HealthModule in AppModule to fix /healthz 404.
classes: rewrite HealthController to Drizzle getDb from TypeORM DI.
teacher-bff: add /metrics endpoint for Prometheus scraping.
infra: add node/mysql/redis exporters to observability profile.
mysql-exporter v0.15.1 uses command-line flags not DATA_SOURCE_NAME.
prometheus: enable web.enable-lifecycle for hot reload.
2026-07-09 15:12:15 +08:00
SpecialX
d8dab70406
feat(infra): add OTel auto-instrumentations across all services
...
CI / quality-proto (push) Failing after 2s
CI / deploy (push) Has been skipped
CI / quality-ts (push) Failing after 1m11s
CI / quality-go (push) Failing after 5s
NestJS 6 services use getNodeAutoInstrumentations().
Python 2 services use FastAPIInstrumentor. Go 2 services use otelgin.
2026-07-09 13:25:46 +08:00
SpecialX
1f901c5b20
feat(data-ana): implement complete CDC pipeline MySQL to ClickHouse
...
Debezium + Kafka + aiokafka consumer with table routing.
E2E verified: MySQL INSERT to ClickHouse upsert.
2026-07-09 13:02:59 +08:00
SpecialX
958b17c9d8
feat(infra): p6 hardening - metrics collection and registry mirror
...
- 4 services add collectDefaultMetrics for process metrics
- docker-compose.yml images prefixed with docker.m.daocloud.io
- Prometheus v0.51.0 (nonexistent) fixed to v2.51.0
- Grafana port remapped 3000 to 3030 to avoid teacher-portal conflict
- ClickHouse edu_analytics database initialized
- known-issues.md documents 7 new P6 scenario-to-rule mappings
2026-07-09 12:29:36 +08:00
SpecialX
566060fade
feat(infra): p6 hardening - observability and deploy compose
...
- 5 NestJS services add /metrics endpoint via app.getHttpAdapter()
- prometheus.yml scales to 8 services with rule_files and alertmanager
- monitoring compose replaces blackbox with Loki+Promtail
- Grafana datasource adds Loki
- docker-compose.deploy.yml scales to 11 services
- deploy.env.example completes Neo4j/ES/ClickHouse/LLM vars
- teacher-bff adds health.controller
- CI removes continue-on-error on lint step
- teacher-portal lint script changed to eslint src
2026-07-09 10:21:06 +08:00
SpecialX
3ca654619f
chore(infra): 配置ESLint 9 flat config并恢复lint-staged集成
...
- 新增 eslint.config.js(ESLint 9 flat config 格式)
- 安装 @eslint/js + typescript-eslint + eslint-config-prettier
- 6 个 TS 服务 lint 脚本:eslint src --ext .ts → eslint src
- lint-staged 恢复 eslint --fix
- .gitignore 忽略 docker-compose.minimal.override.yml
- known-issues.md 新增 P6 硬化条目
2026-07-09 09:14:44 +08:00
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
dfb6d2bfc1
feat(push-gateway): 修复WebSocket并发写竞争并添加DEV_MODE鉴权
...
hub.go 重写用send chan+单写协程模式避免并发写竞争
handler.go 加DEV_MODE dev-token支持+broadcast端点
config.go 加DevMode/RedisURL字段
2026-07-09 09:09:13 +08:00
SpecialX
416e1bc0b2
feat(msg): 修复通知服务并添加ES降级与Push Gateway推送
...
database.ts 导出db常量替代getDb()函数
env.ts JWT_SECRET/ES_URL改optional加DEV_MODE/PUSH_GATEWAY_URL
elasticsearch.ts ES降级: ES_URL未设置时esClient=null
notifications.service.ts 加createBatch+分页查询+Push Gateway推送调用
新建msg-init.sql创建2张表
2026-07-09 09:08:57 +08:00
SpecialX
421edd8a41
feat(data-ana): 完善学情诊断服务并添加ClickHouse降级模式
...
config.py ClickHouse连接改可选+加DEV_MODE/kafka_brokers
clickhouse_client.py 降级模式: host为空时返回None
main.py 端点先查ClickHouse降级返回骨架数据+新增errorbook
新增clickhouse-init.sql创建宽表和错题表
Gateway添加/analytics路由
2026-07-09 08:58:39 +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
921fe82771
feat(content): 修复服务并添加chapters/knowledge-points/questions模块
...
- database.ts 导出db常量替代getDb()函数
- env.ts JWT_SECRET/ES_URL/NEO4J_URL改optional加DEV_MODE
- neo4j.ts driver惰性创建+try/catch+connectionTimeout:3000
- health/lifecycle改用Drizzle原生查询
- textbooks.schema修复integer到int+导出NewTextbook类型
- 新建chapters/knowledge-points/questions三模块CRUD
- knowledge-points含Neo4j前置依赖图非阻塞查询
- content-init.sql创建4张表
端到端验证: textbooks/chapters/knowledge-points/questions全CRUD通过
2026-07-09 08:52:15 +08:00
SpecialX
6215f4e21f
feat(teacher-bff): 添加考试作业成绩聚合端点
...
env.ts 新增 CoreEduServiceUrl
teacher.service 新增 listExamsByClass/listHomeworkByClass/listGradesByExam 三个聚合方法
teacher.controller 暴露 3 个 GET 端点:
/teacher/classes/:classId/exams
/teacher/classes/:classId/homework
/teacher/exams/:examId/grades
验证: 3 端点全部 200 返回 core-edu 数据
2026-07-09 08:05:24 +08:00
SpecialX
4f539b50dd
feat(api-gateway): 添加 core-edu 服务代理路由
...
main.go 新增 exams/homework/grades 三组路由(无尾斜杠+通配符)
config.go 新增 CoreEduServiceURL 字段默认 localhost:3004
删除死代码 internal/routing/routing.go(从未被 main 引用)
验证: GET /exams/class/:id 200, POST /exams 201, 链路全通
2026-07-09 08:02:39 +08:00
SpecialX
4533da6484
feat(core-edu): 修复服务启动并打通考试作业成绩端到端链路
...
database.ts 导出 db 常量替代 getDb()
env.ts JWT_SECRET 改 optional 并新增 DEV_MODE
kafka.ts connectKafka 加 try/catch 不阻塞启动
main.ts 去全局前缀 connectKafka 改非阻塞
app.module 移除未用模块加 HealthModule
controller 路由去前缀去 UseGuards 从 x-user-id 读身份
service datetime ISO 字符串转 Date 修复 drizzle 错误
修正相对 import 路径
health/lifecycle 改用 Drizzle 原生查询
新增 core-edu-init.sql 初始化 4 张表
端到端验证: exams/homework/grades 全部 201/200
Outbox 事件正确写入 core_edu_outbox 表
2026-07-09 08:02:22 +08:00
SpecialX
b2c2f6e567
feat(teacher-bff): 添加视口聚合端点 + 修复身份头读取
...
- 新增 GET /teacher/viewports 聚合 IAM 视口配置
- 修复 controller 从 x-user-id header 读取身份(替代 AuthenticatedRequest)
- 添加 zod + @types/express 依赖
2026-07-09 00:49:24 +08:00
SpecialX
a2f0ca26ae
feat(iam): 实现 RBAC + 视口配置 + DataScope
...
- 新增 iam_role_viewports 表(4 层视口模型:L1 导航/L2 路由/L3 组件/L4 数据)
- iam_users 添加 data_scope 字段(6 级:self/class/grade/school/district/all)
- JWT payload 包含 dataScope,注册时自动分配 teacher 角色
- 新增 getEffectivePermissions(多角色权限去重)
- 新增 getUserViewports(按权限过滤视口)
- 新增 RbacController:GET /iam/viewports, /iam/permissions/effective, /iam/roles, /iam/permissions
- 添加 7 个权限点 + 12 条角色权限映射 + 7 个视口种子数据
2026-07-09 00:35:34 +08:00
SpecialX
5759b09c9f
feat(api-gateway): 添加公开路径白名单
...
register/login/refresh 无需 JWT 即可通过 Gateway,修复之前无 token 无法注册登录的死锁问题。
2026-07-09 00:30:35 +08:00
SpecialX
f658571726
fix(iam): 修复 TS 编译错误、ESM 依赖注入与身份头读取
...
P1 端到端验证中发现 IAM 服务存在 14 个 TS 编译错误与运行时 DI 失败:
- 移除 typeorm/ioredis/kafkajs 依赖(IAM 用 Drizzle)
- health.controller.ts 改用 db.execute(sql SELECT 1) 校验连接
- lifecycle.service.ts 简化为只关闭 Drizzle 连接池
- Drizzle API 修正:r.roles -> r.iam_roles,.in() -> inArray()
- ESM 模式下 DI 必须显式 @Inject(IamRepository)(参考 classes 黄金模板)
- iam.controller.ts 直接读 req.headers[x-user-id],不依赖未注册的 AuthMiddleware
- health.module.ts 补 .js 后缀
- package.json 补 @types/express
验证:register -> JWT -> Gateway /iam/me 200 -> /classes CRUD 200
2026-07-09 00:25:37 +08:00
SpecialX
4a0893ef52
feat(infra): 新增生产 Dockerfile 与部署 compose
...
- api-gateway/Dockerfile: 多阶段构建,golang:1.22-alpine → alpine:3.20,CGO_ENABLED=0 静态编译,非 root 运行
- teacher-portal/Dockerfile: 多阶段构建,node:20-alpine builder → runner,含 HEALTHCHECK
- docker-compose.prod.yml: 本地生产编排,3 服务,强制 DEV_MODE=false
- docker-compose.deploy.yml: 服务器部署用,镜像来自 Gitea Registry,通过 edu-shared 外部网络连接 MySQL/Redis
- deploy.env.example: 部署环境变量模板
2026-07-08 15:12:34 +08:00
SpecialX
e5902ca2b3
fix(api-gateway): 修复尾斜杠重定向循环与 DEV_MODE 旁路
...
- main.go: 禁用 RedirectTrailingSlash,为 classes/iam/teacher 双注册无尾斜杠与通配符路由
- auth.go: DEV_MODE=true 时接受 Bearer dev-token 注入开发用户
- config.go: 新增 DevMode 配置项与 getEnvBool 工具
- page.tsx: 开发模式请求携带 Authorization: Bearer dev-token
- .env.example: 添加 DEV_MODE=false 默认值与生产警告
2026-07-08 15:11:47 +08:00