feat(iit): Implement event-level QC architecture V3.1 with dynamic rule filtering, report deduplication and AI intent enhancement

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-08 21:22:11 +08:00
parent 45c7b32dbb
commit 7a299e8562
51 changed files with 10638 additions and 184 deletions

View File

@@ -0,0 +1,30 @@
-- CRA 智能质控引擎支持
-- 扩展 IitSkill 表,新增 IitQcReport 表
-- AlterTable: 扩展 skills 表支持 CRA 五大规则体系
ALTER TABLE "iit_schema"."skills" ADD COLUMN "level" TEXT NOT NULL DEFAULT 'normal',
ADD COLUMN "priority" INTEGER NOT NULL DEFAULT 100,
ADD COLUMN "required_tags" TEXT[] DEFAULT ARRAY[]::TEXT[],
ADD COLUMN "rule_type" TEXT NOT NULL DEFAULT 'HARD_RULE';
-- CreateTable: 质控报告存储表
CREATE TABLE "iit_schema"."qc_reports" (
"id" TEXT NOT NULL,
"project_id" TEXT NOT NULL,
"report_type" TEXT NOT NULL DEFAULT 'daily',
"summary" JSONB NOT NULL,
"issues" JSONB NOT NULL,
"llm_report" TEXT NOT NULL,
"generated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" TIMESTAMP(3),
CONSTRAINT "qc_reports_pkey" PRIMARY KEY ("id")
);
-- CreateIndex: 报告索引
CREATE INDEX "idx_qc_report_project_type" ON "iit_schema"."qc_reports"("project_id", "report_type");
CREATE INDEX "idx_qc_report_generated" ON "iit_schema"."qc_reports"("generated_at");
-- CreateIndex: Skill 触发类型索引
CREATE INDEX "idx_iit_skill_active_trigger" ON "iit_schema"."skills"("is_active", "trigger_type");