fix: 修复集成测试中发现的全部 bug — 15 服务端到端验证通过

修复涵盖 6 大类问题:

1. api-gateway
   - 路径前缀剥离 /api 而非 /api/v1,保留下游 /v1/ controller 前缀
   - JWKS URL 默认值修复
   - publicPaths 白名单对齐 /v1/iam/*

2. iam
   - iam.module.ts exports 补充 PermissionCacheService 和 IamRepository
   - main.ts resolveProtoPath() 多路径探测 proto 文件

3. core-edu
   - app.module.ts AuthMiddleware 全局注册

4. BFF 层 GraphQL 端点(teacher-bff / parent-bff / student-bff)
   - teacher-bff: mock dataScope OWN→SELF 对齐 GraphQL enum;WHATWG Request header .get() 提取
   - parent-bff: handleNodeRequestAndResponse 不存在 → 直接 yoga(req,res);WHATWG Request header .get() 提取
   - student-bff: auth.resolver 移除 ActionState 信封返回扁平对象;WHATWG Request header .get() 提取

5. ai
   - Kafka 事务降级 + 10s 超时
   - gRPC 拦截器降级
   - dev mode 禁用事务模式

6. 前端 + 共享包
   - teacher-portal: MF 插件条件实例化 + transpilePackages + extensionAlias
   - ui-components: error-boundary.tsx 添加 use client
   - ui-tokens: tailwind-theme.css 移除 @layer base
   - shared-ts: 导出从源码改为 dist 编译产物;OutboxModule global:true

7. infra
   - .gitignore 补充 keys/ *.pem *.key secrets/ 排除规则
   - infra/init-sql/02-all-services-schema.sql 36 张表 DDL

验证结果:
- TS typecheck: 19 个 workspace 项目全部通过
- Go vet + Ruff: 通过
- 15 服务全部启动成功
- 3 个 BFF GraphQL 端点 + 4 个前端页面全部 200
- Gateway → iam → core-edu 端到端链路验证通过

AI identity: trae-main(集成测试修复会话)
This commit is contained in:
SpecialX
2026-07-11 01:41:46 +08:00
parent c6362f4b04
commit 61d824924a
35 changed files with 1020 additions and 192 deletions

View File

@@ -452,6 +452,12 @@ type WeakPoint {
lastAssessedAt: DateTime
}
type LearningTrendSummary {
studentId: ID!
subjectId: ID
points: [TrendPoint!]!
}
type LearningTrend {
studentId: ID!
subjectId: ID
@@ -567,6 +573,12 @@ type AIChatPayload implements Degradable {
degradedFields: [String!]
}
input AIChatInput {
messages: [AIChatMessageInput!]!
model: String = "gpt-4o-mini"
context: AIChatContextInput
}
# ============================================================================
# Mutation 结果
# ============================================================================
@@ -723,6 +735,11 @@ type Query {
# @permission: NOTIFICATION_READ
# @dataScope: OWN
myNotificationUnreadCount: UnreadCountPayload!
"""AI 答疑 (同步, ai.Chat). 实际为写操作但 schema 设计为 Query 便于前端 GET 缓存"""
# @permission: STUDENT_AI_CHAT
# @dataScope: OWN
aiChat(input: AIChatInput!): AIChatPayload!
}
# ============================================================================

View File

@@ -5,15 +5,16 @@
"type": "module",
"exports": {
"./outbox": {
"types": "./src/outbox/index.ts",
"default": "./src/outbox/index.ts"
"types": "./dist/outbox/index.d.ts",
"default": "./dist/outbox/index.js"
},
"./bff": {
"types": "./src/bff/index.ts",
"default": "./src/bff/index.ts"
"types": "./dist/bff/index.d.ts",
"default": "./dist/bff/index.js"
}
},
"scripts": {
"build": "tsc",
"lint": "eslint src",
"typecheck": "tsc --noEmit"
},

View File

@@ -60,6 +60,7 @@ export class OutboxModule {
return {
module: OutboxModule,
global: true,
providers: [
{ provide: OUTBOX_CONFIG, useValue: options.config },
{ provide: OUTBOX_DB, useValue: options.db },

View File

@@ -1,3 +1,5 @@
"use client";
import { Component, type ErrorInfo, type ReactNode } from "react";
/**

View File

@@ -18,14 +18,12 @@
*/
/* 显式引用语义令牌,确保 CSS 变量在构建产物中可用 */
@layer base {
:root {
/* Tailwind 颜色类映射(与 tailwind.config.js theme.extend.colors 对齐) */
--tw-color-paper: var(--bg-paper);
--tw-color-surface: var(--bg-surface);
--tw-color-ink: var(--color-ink);
--tw-color-ink-muted: var(--color-ink-muted);
--tw-color-accent: var(--color-accent);
--tw-color-rule: var(--color-rule);
}
:root {
/* Tailwind 颜色类映射(与 tailwind.config.js theme.extend.colors 对齐) */
--tw-color-paper: var(--bg-paper);
--tw-color-surface: var(--bg-surface);
--tw-color-ink: var(--color-ink);
--tw-color-ink-muted: var(--color-ink-muted);
--tw-color-accent: var(--color-accent);
--tw-color-rule: var(--color-rule);
}