@hupan56/wlkj 3.3.13 → 3.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +0 -7
- package/package.json +29 -29
- package/templates/qoder/commands/optional/wl-spec.md +0 -8
- package/templates/qoder/commands/optional/wl-status.md +0 -8
- package/templates/qoder/commands/wl-code.md +0 -8
- package/templates/qoder/commands/wl-commit.md +0 -8
- package/templates/qoder/commands/wl-init.md +129 -129
- package/templates/qoder/commands/wl-search.md +0 -8
- package/templates/qoder/commands/wl-task.md +0 -8
- package/templates/qoder/commands/wl-test.md +0 -8
- package/templates/qoder/config.yaml +2 -3
- package/templates/qoder/contracts/insight.md +55 -55
- package/templates/qoder/hooks/pre-tool-use-commit.py +124 -124
- package/templates/qoder/hooks/session-start.py +384 -384
- package/templates/qoder/hooks/stop-eval.py +383 -383
- package/templates/qoder/scripts/capability/adapters/mcp.py +322 -322
- package/templates/qoder/scripts/capability/registry.py +245 -245
- package/templates/qoder/scripts/deployment/setup/install_qoderwork.py +14 -0
- package/templates/qoder/scripts/deployment/setup/setup.py +0 -11
- package/templates/qoder/scripts/domain/task/wlkj_panel.py +1503 -1503
- package/templates/qoder/scripts/foundation/bootstrap.py +145 -156
- package/templates/qoder/scripts/foundation/io/context_cache.py +94 -94
- package/templates/qoder/scripts/orchestration/wlkj.py +295 -306
- package/templates/qoder/scripts/tool_guide.md +70 -70
- package/templates/qoder/scripts/validation/eval/alignment_matrix.py +176 -176
- package/templates/qoder/scripts/validation/eval/bf2_content_fidelity.py +110 -110
- package/templates/qoder/scripts/validation/eval/bf2_llmjudge.py +104 -104
- package/templates/qoder/scripts/validation/eval/bf_score.py +218 -218
- package/templates/qoder/scripts/validation/eval/code_flywheel.py +150 -150
- package/templates/qoder/scripts/validation/eval/dispatcher_ab.py +156 -156
- package/templates/qoder/scripts/validation/eval/dispatcher_ab_2026-07-21.json +23 -23
- package/templates/qoder/scripts/validation/eval/feature_fidelity_flywheel.py +143 -143
- package/templates/qoder/scripts/validation/eval/gradient_matrix.py +261 -261
- package/templates/qoder/scripts/validation/eval/gradient_matrix_baseline_2026-07-21.json +33 -33
- package/templates/qoder/scripts/validation/eval/metrics_dashboard.py +105 -105
- package/templates/qoder/scripts/validation/eval/multi_turn_flywheel.py +118 -118
- package/templates/qoder/scripts/validation/eval/prd_fidelity_flywheel.py +128 -128
- package/templates/qoder/scripts/validation/eval/prd_flywheel.py +148 -148
- package/templates/qoder/scripts/validation/eval/prototype_fidelity_flywheel.py +166 -166
- package/templates/qoder/scripts/validation/eval/recall_flywheel.py +148 -148
- package/templates/qoder/scripts/validation/eval/robustness_flywheel.py +139 -139
- package/templates/qoder/scripts/validation/eval/speed_accuracy_flywheel.py +188 -188
- package/templates/qoder/scripts/validation/eval/task_flywheel.py +124 -124
- package/templates/qoder/scripts/validation/eval/token_flywheel.py +88 -88
- package/templates/qoder/scripts/validation/metrics/eval_code_ac.py +177 -177
- package/templates/qoder/scripts/validation/metrics/lint_cases.py +170 -170
- package/templates/qoder/scripts/validation/test/test_context_cache.py +78 -78
- package/templates/qoder/scripts/validation/test/test_lint_cases.py +60 -60
- package/templates/qoder/scripts/validation/test/test_pre_tool_use_commit.py +70 -70
- package/templates/qoder/commands/wl-data.md +0 -46
- package/templates/qoder/commands/wl-fix.md +0 -47
- package/templates/qoder/commands/wl-knowledge.md +0 -41
- package/templates/qoder/commands/wl-review.md +0 -49
- package/templates/workspace/specs/REQ-TEST-CTX/.context-cache.json +0 -1
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
"""test_pre_tool_use_commit.py — T1.6 w3 commit msg 门禁 hook 单测。
|
|
2
|
-
测 _extract_msg + 标记检测 + e2e(advisory/block/has-tag/non-git) via subprocess。
|
|
3
|
-
"""
|
|
4
|
-
import os, sys, json, subprocess
|
|
5
|
-
_HERE = os.path.dirname(os.path.abspath(__file__))
|
|
6
|
-
_HOOK = os.path.abspath(os.path.join(_HERE, "..", "..", "..", "hooks", "pre-tool-use-commit.py"))
|
|
7
|
-
|
|
8
|
-
P = F = 0
|
|
9
|
-
def check(cond, msg):
|
|
10
|
-
global P, F
|
|
11
|
-
if cond: P += 1; print("OK ", msg)
|
|
12
|
-
else: F += 1; print("FAIL", msg)
|
|
13
|
-
|
|
14
|
-
import importlib.util
|
|
15
|
-
spec = importlib.util.spec_from_file_location("pre_tool_use_commit", _HOOK)
|
|
16
|
-
H = importlib.util.module_from_spec(spec)
|
|
17
|
-
spec.loader.exec_module(H)
|
|
18
|
-
|
|
19
|
-
# ① _extract_msg 各种形式
|
|
20
|
-
check(H._extract_msg('git commit -m "fix: x"') == "fix: x", "-m 双引号")
|
|
21
|
-
check(H._extract_msg("git commit -m 'fix: y'") == "fix: y", "-m 单引号")
|
|
22
|
-
check(H._extract_msg('git commit --message=foo') == "foo", "--message=")
|
|
23
|
-
check(H._extract_msg('git commit -m "title" -m "body"') == "title\nbody", "多 -m 拼接")
|
|
24
|
-
check(H._extract_msg('git commit -am "x" --no-verify') == "x", "-am 混合 flag")
|
|
25
|
-
|
|
26
|
-
# ② 标记检测
|
|
27
|
-
check(bool(H._REQ_TAG_RE.search("fix: 漏改 [#REQ-a1b2c3d4]")), "[#REQ-uuid] 命中")
|
|
28
|
-
check(bool(H._REQ_TAG_RE.search("feat: x [#761]")), "[#禅道号] 命中")
|
|
29
|
-
check(not H._REQ_TAG_RE.search("fix: 漏改 无标记"), "无标记不命中")
|
|
30
|
-
|
|
31
|
-
def run_hook(stdin_data, env_block=None):
|
|
32
|
-
env = dict(os.environ)
|
|
33
|
-
if env_block is not None:
|
|
34
|
-
env["WLCOMMIT_GATE_BLOCK"] = env_block
|
|
35
|
-
else:
|
|
36
|
-
env.pop("WLCOMMIT_GATE_BLOCK", None)
|
|
37
|
-
r = subprocess.run([sys.executable, _HOOK], input=json.dumps(stdin_data),
|
|
38
|
-
capture_output=True, text=True, env=env, timeout=15)
|
|
39
|
-
return r.returncode, r.stdout, r.stderr
|
|
40
|
-
|
|
41
|
-
def mk(cmd): return {"tool_name": "Bash", "tool_input": {"command": cmd}}
|
|
42
|
-
|
|
43
|
-
# ③ e2e advisory(默认): 无标记 → exit 0 + stdout 提醒
|
|
44
|
-
rc, out, err = run_hook(mk('git commit -m "fix: 漏改无标记"'))
|
|
45
|
-
check(rc == 0, "advisory 无标记 exit 0(不阻断)")
|
|
46
|
-
check("提醒" in out, "advisory 产 stdout 提醒")
|
|
47
|
-
|
|
48
|
-
# ④ e2e block(env=1): 无标记 → exit 2
|
|
49
|
-
rc, out, err = run_hook(mk('git commit -m "fix: 漏改无标记"'), env_block="1")
|
|
50
|
-
check(rc == 2, "BLOCK 模式(env=1) 无标记 exit 2")
|
|
51
|
-
check("硬拦" in err, "BLOCK 产 stderr 硬拦语")
|
|
52
|
-
|
|
53
|
-
# ⑤ e2e 有标记 → exit 0 无提醒(任何模式)
|
|
54
|
-
rc, out, err = run_hook(mk('git commit -m "fix: x [#REQ-a1b2c3d4]"'), env_block="1")
|
|
55
|
-
check(rc == 0 and "提醒" not in out, "有标记放行(BLOCK 模式也不拦)")
|
|
56
|
-
|
|
57
|
-
# ⑥ 非 git commit 命令 → exit 0 静默
|
|
58
|
-
rc, out, err = run_hook(mk('git push origin main'))
|
|
59
|
-
check(rc == 0 and out == "" and err == "", "非 git commit 静默放行")
|
|
60
|
-
|
|
61
|
-
# ⑦ 非 Bash 工具 → exit 0
|
|
62
|
-
rc, out, err = run_hook({"tool_name": "Write", "tool_input": {"file_path": "x.py"}})
|
|
63
|
-
check(rc == 0, "非 Bash 工具放行")
|
|
64
|
-
|
|
65
|
-
# ⑧ platform/dev commit(无标记,advisory)也不硬断 → exit 0(不误拦其他)
|
|
66
|
-
rc, out, err = run_hook(mk('git commit -m "chore: 改文档"'))
|
|
67
|
-
check(rc == 0, "advisory 默认不误拦工具/文档 commit")
|
|
68
|
-
|
|
69
|
-
print("\n%d passed, %d failed" % (P, F))
|
|
70
|
-
sys.exit(0 if F == 0 else 1)
|
|
1
|
+
"""test_pre_tool_use_commit.py — T1.6 w3 commit msg 门禁 hook 单测。
|
|
2
|
+
测 _extract_msg + 标记检测 + e2e(advisory/block/has-tag/non-git) via subprocess。
|
|
3
|
+
"""
|
|
4
|
+
import os, sys, json, subprocess
|
|
5
|
+
_HERE = os.path.dirname(os.path.abspath(__file__))
|
|
6
|
+
_HOOK = os.path.abspath(os.path.join(_HERE, "..", "..", "..", "hooks", "pre-tool-use-commit.py"))
|
|
7
|
+
|
|
8
|
+
P = F = 0
|
|
9
|
+
def check(cond, msg):
|
|
10
|
+
global P, F
|
|
11
|
+
if cond: P += 1; print("OK ", msg)
|
|
12
|
+
else: F += 1; print("FAIL", msg)
|
|
13
|
+
|
|
14
|
+
import importlib.util
|
|
15
|
+
spec = importlib.util.spec_from_file_location("pre_tool_use_commit", _HOOK)
|
|
16
|
+
H = importlib.util.module_from_spec(spec)
|
|
17
|
+
spec.loader.exec_module(H)
|
|
18
|
+
|
|
19
|
+
# ① _extract_msg 各种形式
|
|
20
|
+
check(H._extract_msg('git commit -m "fix: x"') == "fix: x", "-m 双引号")
|
|
21
|
+
check(H._extract_msg("git commit -m 'fix: y'") == "fix: y", "-m 单引号")
|
|
22
|
+
check(H._extract_msg('git commit --message=foo') == "foo", "--message=")
|
|
23
|
+
check(H._extract_msg('git commit -m "title" -m "body"') == "title\nbody", "多 -m 拼接")
|
|
24
|
+
check(H._extract_msg('git commit -am "x" --no-verify') == "x", "-am 混合 flag")
|
|
25
|
+
|
|
26
|
+
# ② 标记检测
|
|
27
|
+
check(bool(H._REQ_TAG_RE.search("fix: 漏改 [#REQ-a1b2c3d4]")), "[#REQ-uuid] 命中")
|
|
28
|
+
check(bool(H._REQ_TAG_RE.search("feat: x [#761]")), "[#禅道号] 命中")
|
|
29
|
+
check(not H._REQ_TAG_RE.search("fix: 漏改 无标记"), "无标记不命中")
|
|
30
|
+
|
|
31
|
+
def run_hook(stdin_data, env_block=None):
|
|
32
|
+
env = dict(os.environ)
|
|
33
|
+
if env_block is not None:
|
|
34
|
+
env["WLCOMMIT_GATE_BLOCK"] = env_block
|
|
35
|
+
else:
|
|
36
|
+
env.pop("WLCOMMIT_GATE_BLOCK", None)
|
|
37
|
+
r = subprocess.run([sys.executable, _HOOK], input=json.dumps(stdin_data),
|
|
38
|
+
capture_output=True, text=True, env=env, timeout=15)
|
|
39
|
+
return r.returncode, r.stdout, r.stderr
|
|
40
|
+
|
|
41
|
+
def mk(cmd): return {"tool_name": "Bash", "tool_input": {"command": cmd}}
|
|
42
|
+
|
|
43
|
+
# ③ e2e advisory(默认): 无标记 → exit 0 + stdout 提醒
|
|
44
|
+
rc, out, err = run_hook(mk('git commit -m "fix: 漏改无标记"'))
|
|
45
|
+
check(rc == 0, "advisory 无标记 exit 0(不阻断)")
|
|
46
|
+
check("提醒" in out, "advisory 产 stdout 提醒")
|
|
47
|
+
|
|
48
|
+
# ④ e2e block(env=1): 无标记 → exit 2
|
|
49
|
+
rc, out, err = run_hook(mk('git commit -m "fix: 漏改无标记"'), env_block="1")
|
|
50
|
+
check(rc == 2, "BLOCK 模式(env=1) 无标记 exit 2")
|
|
51
|
+
check("硬拦" in err, "BLOCK 产 stderr 硬拦语")
|
|
52
|
+
|
|
53
|
+
# ⑤ e2e 有标记 → exit 0 无提醒(任何模式)
|
|
54
|
+
rc, out, err = run_hook(mk('git commit -m "fix: x [#REQ-a1b2c3d4]"'), env_block="1")
|
|
55
|
+
check(rc == 0 and "提醒" not in out, "有标记放行(BLOCK 模式也不拦)")
|
|
56
|
+
|
|
57
|
+
# ⑥ 非 git commit 命令 → exit 0 静默
|
|
58
|
+
rc, out, err = run_hook(mk('git push origin main'))
|
|
59
|
+
check(rc == 0 and out == "" and err == "", "非 git commit 静默放行")
|
|
60
|
+
|
|
61
|
+
# ⑦ 非 Bash 工具 → exit 0
|
|
62
|
+
rc, out, err = run_hook({"tool_name": "Write", "tool_input": {"file_path": "x.py"}})
|
|
63
|
+
check(rc == 0, "非 Bash 工具放行")
|
|
64
|
+
|
|
65
|
+
# ⑧ platform/dev commit(无标记,advisory)也不硬断 → exit 0(不误拦其他)
|
|
66
|
+
rc, out, err = run_hook(mk('git commit -m "chore: 改文档"'))
|
|
67
|
+
check(rc == 0, "advisory 默认不误拦工具/文档 commit")
|
|
68
|
+
|
|
69
|
+
print("\n%d passed, %d failed" % (P, F))
|
|
70
|
+
sys.exit(0 if F == 0 else 1)
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wl-data
|
|
3
|
-
description: "数据分析: 自然语言→语义层声明metric→接地SQL→保形门禁→执行渲染。不裸NL2SQL盲猜。"
|
|
4
|
-
argument-hint: "[自然语言数据问题] 如:统计各公司资产原值"
|
|
5
|
-
auto-approve: true
|
|
6
|
-
allowed-tools: [Read, Glob, Grep, Bash, Write, Edit]
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# /wl-data - 数据分析工序站
|
|
10
|
-
|
|
11
|
-
User input: $ARGUMENTS
|
|
12
|
-
|
|
13
|
-
> **问库不乱猜,声明 metric 优先于裸 SQL。** 对齐 dbt 语义层 + conformal 保形门禁。
|
|
14
|
-
|
|
15
|
-
## 🔧 工具优先级(宿主能力 × 知识层分工)
|
|
16
|
-
| 步骤 | 用谁 | 原因 |
|
|
17
|
-
|------|------|------|
|
|
18
|
-
| 选表选列 | **MCP schema_link** | 确定性概念→真表+列(dbt级,非LLM猜) |
|
|
19
|
-
| join 路径 | **MCP semantic/mapper_joins** | Dijkstra 最高置信 join 路径(RAT-SQL对齐) |
|
|
20
|
-
| NL→metric | **MCP nl2ontology** | 语义层路由:NL→声明metric→grounded SQL(非裸NL2SQL) |
|
|
21
|
-
| 保形门禁 | **MCP gate_check** | conformal coverage≥1-α,低置信拒答 |
|
|
22
|
-
| 执行+渲染 | **Qoder AI** | 执行 SQL + 渲染业务答案 |
|
|
23
|
-
|
|
24
|
-
## 🧠 流程(确定性语义层 + 保形)
|
|
25
|
-
1. **schema linking**:`schema_link(concept=<问题>)` → 真表+列+join候选
|
|
26
|
-
2. **语义层路由**:`nl2ontology(question=<问题>)` → 命中声明 metric(如 asset_total_cost)→ grounded SQL;未命中走 LLM NL2SQL(只用 schema_link 选表列,禁全表 schema_text 注入=负贡献)
|
|
27
|
-
3. **保形门禁**:`gate_check(sql, confidence, risk_strategy=v2, alpha=0.1)` → pass/abstain;abstain 诚实拒答(不硬编)
|
|
28
|
-
4. **执行+渲染**:执行 SQL(只读)→ Qoder AI 渲染业务答案(表/图)
|
|
29
|
-
|
|
30
|
-
## 🚨 铁律
|
|
31
|
-
1. **声明优先**:NL 命中声明 metric → 用其 grounded SQL(确定性);未命中才 LLM 生成
|
|
32
|
-
2. **schema_text 禁注入**:全表 schema 注入 prompt 是负贡献(实测 L1 38→63 是禁 schema 后),只用 schema_link 选表列
|
|
33
|
-
3. **保形拒答**:置信度 < 阈值诚实 abstain,不硬编答案(selective 价值:pass 集准 vs abstain 集)
|
|
34
|
-
4. **只读执行**:SQL 只 SELECT,禁 DDL/DML(data/security.py 白名单 + executor READ ONLY)
|
|
35
|
-
|
|
36
|
-
## 📊 对齐
|
|
37
|
-
- dbt Semantic Layer(声明 metric)/ MetricFlow(多跳 join)/ conformal prediction(保形 coverage)
|
|
38
|
-
- 平台 workflow_sim WL_WL_DATA_GRAPH(schema_link→LINK→ONTO→SQLGEN→GATE→ANSWER)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## 🚨 接地铁律(防幻觉/保真,Qoder AI 必须遵守)
|
|
42
|
-
|
|
43
|
-
1. **溯源**:引用代码符号/表名/接口用**真实原名**(如 `CostApplyController`、`base_asset`),非中文描述——只引 MCP 工具(rag_search/schema_link/context_360/get_impact 等)召回的真实符号,提升可溯源性
|
|
44
|
-
2. **禁编**:不编造未在召回里出现的类名/表名/字段/接口;召回不足时标"待确认(知识层未召回)",**诚实优于编造**
|
|
45
|
-
3. **接地(数据表)**:涉及数据表/字段时,先调 MCP `schema_link`/`query_schema` 取真表真列;未召回真表禁编 t_xxx 表名+字段充数
|
|
46
|
-
4. **完整**:产物详尽展开(每节实质内容,不一行带过)
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wl-fix
|
|
3
|
-
description: "修bug: 症状→根因(不治标)→爆炸半径(防回归)→最小侵入修复。"
|
|
4
|
-
argument-hint: "[bug症状/报错] 如:保险导出报空指针"
|
|
5
|
-
auto-approve: true
|
|
6
|
-
allowed-tools: [Read, Glob, Grep, Bash, Write, Edit]
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# /wl-fix - bug 修复工序站
|
|
10
|
-
|
|
11
|
-
User input: $ARGUMENTS
|
|
12
|
-
|
|
13
|
-
> **治根因不治标,先量爆炸半径防回归。**
|
|
14
|
-
|
|
15
|
-
## 🔧 工具优先级
|
|
16
|
-
| 步骤 | 用谁 | 原因 |
|
|
17
|
-
|------|------|------|
|
|
18
|
-
| 定位缺陷站点 | **MCP search_code** | 精确符号定位(疑似缺陷文件/符号) |
|
|
19
|
-
| 相似bug模式 | **MCP rag_search** | 历史相似缺陷/修复(kind=code) |
|
|
20
|
-
| 变更史 | **MCP code_history** | regression 根因(该文件历史变更) |
|
|
21
|
-
| 爆炸半径 | **MCP get_impact** | 改一处影响谁(upstream/downstream) |
|
|
22
|
-
| 修复方案 | **Qoder AI** | 综合→最小侵入修复 |
|
|
23
|
-
|
|
24
|
-
## 🧠 流程
|
|
25
|
-
1. **定位**:`search_code(query=<症状>, focus=symbol)` → 疑似缺陷符号(带 repo 前缀,避 CTRL 双格式坑)
|
|
26
|
-
2. **相似模式**:`rag_search(query=<症状>, kind=code)` → 相似 bug/历史修复
|
|
27
|
-
3. **根因假设**:derive → suspected_location + root_cause + evidence + confidence(<0.5 回扩词重搜)
|
|
28
|
-
4. **爆炸半径**:`get_impact(entity=<suspected_location>, depth=2)` → 影响面(防回归)
|
|
29
|
-
5. **修复方案**:Qoder AI 综合 → 最小侵入修复 + 回归防护
|
|
30
|
-
|
|
31
|
-
## 🚨 铁律
|
|
32
|
-
1. **根因非症状**:区分表面报错点 vs 真根因,不治标
|
|
33
|
-
2. **爆炸半径**:改前必 get_impact,影响大→人工确认
|
|
34
|
-
3. **最小侵入**:修复尽量小,附带回归测试建议
|
|
35
|
-
4. **置信度诚实**:confidence<0.5 标"根因不确定,建议人工核实"
|
|
36
|
-
|
|
37
|
-
## 📊 对齐
|
|
38
|
-
- 平台 workflow_sim WL_WL_FIX_GRAPH(search_code→rag→derive根因→get_impact→synth修复)
|
|
39
|
-
- _UNDERUTILIZED_PRE 补 code_history 节点(regression 根因)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## 🚨 接地铁律(防幻觉/保真,Qoder AI 必须遵守)
|
|
43
|
-
|
|
44
|
-
1. **溯源**:引用代码符号/表名/接口用**真实原名**(如 `CostApplyController`、`base_asset`),非中文描述——只引 MCP 工具(rag_search/schema_link/context_360/get_impact 等)召回的真实符号,提升可溯源性
|
|
45
|
-
2. **禁编**:不编造未在召回里出现的类名/表名/字段/接口;召回不足时标"待确认(知识层未召回)",**诚实优于编造**
|
|
46
|
-
3. **接地(数据表)**:涉及数据表/字段时,先调 MCP `schema_link`/`query_schema` 取真表真列;未召回真表禁编 t_xxx 表名+字段充数
|
|
47
|
-
4. **完整**:产物详尽展开(每节实质内容,不一行带过)
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wl-knowledge
|
|
3
|
-
description: "知识问答: 理解一个对象/概念。三支柱接地(代码+流程+字段)+可溯源答案。"
|
|
4
|
-
argument-hint: "[概念/符号/字段] 如:保险单是什么 / vehicle_no 含义"
|
|
5
|
-
auto-approve: true
|
|
6
|
-
allowed-tools: [Read, Glob, Grep, Bash, Write, Edit]
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# /wl-knowledge - 知识问答工序站
|
|
10
|
-
|
|
11
|
-
User input: $ARGUMENTS
|
|
12
|
-
|
|
13
|
-
> **理解一个对象,三支柱接地(代码实体 + 业务流程 + 字段schema)。** 与 wl-search(定位/路由) 区别:wl-knowledge 聚焦"讲清一个对象是什么"。
|
|
14
|
-
|
|
15
|
-
## 🔧 工具优先级
|
|
16
|
-
| 步骤 | 用谁 | 原因 |
|
|
17
|
-
|------|------|------|
|
|
18
|
-
| 提炼概念+意图 | **Qoder AI** | 拆四路:concept/search_query/intent/field_candidates |
|
|
19
|
-
| 代码实体 | **MCP rag_search** | 语义召回相关代码/字段/API |
|
|
20
|
-
| 概念画像 | **MCP context_360** | 实体的代码+API+字段+测试全貌 |
|
|
21
|
-
| 业务流程 | **MCP graphrag_ask** | GraphRAG 社区摘要(全局流程) |
|
|
22
|
-
| 字段schema | **MCP schema_link/query_schema** | 真表结构/字段含义 |
|
|
23
|
-
| 综合答案 | **Qoder AI** | 三支柱接地综合 |
|
|
24
|
-
|
|
25
|
-
## 🧠 流程
|
|
26
|
-
1. **提炼**:derive → concept(核心对象) + search_query(干净检索词) + intent(concept_explain/business_flow/code_locate/field_schema) + field_candidates
|
|
27
|
-
2. **代码召回**:`rag_search(query=<search_query>)` → 相关代码/字段
|
|
28
|
-
3. **概念画像**:`context_360(query=<concept>)` → 实体全貌
|
|
29
|
-
4. **业务流程**:`graphrag_ask(q=<问题>)` → 全局流程(社区摘要支撑)
|
|
30
|
-
5. **字段schema**:`query_schema(field=<candidate>)` → 真表字段含义
|
|
31
|
-
6. **综合答案**:Qoder AI → 三支柱接地的知识答案
|
|
32
|
-
|
|
33
|
-
## 🚨 铁律
|
|
34
|
-
1. **三支柱接地**:代码实体 + 业务流程 + 字段schema 都基于真实召回
|
|
35
|
-
2. **意图定重心**:intent=concept_explain 讲概念;business_flow 讲流程;code_locate 定位;field_schema 讲字段
|
|
36
|
-
3. **可溯源**:引用真实符号/表/字段,禁编造
|
|
37
|
-
4. **诚实**:召回不足标"知识层未覆盖"
|
|
38
|
-
|
|
39
|
-
## 📊 对齐
|
|
40
|
-
- 平台 workflow_sim WL_WL_KNOWLEDGE_GRAPH(derive→rag→context_360→graphrag_ask→query_schema→synth)
|
|
41
|
-
- graphrag_ask 依赖社区摘要(FW17-B1 已修:并发+向量化+pgvector解析)
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wl-review
|
|
3
|
-
description: "代码审查: 改动影响半径+需求对齐+安全/质量/业务多维审查报告。"
|
|
4
|
-
argument-hint: "[变更实体/diff/分支] 如:CostApplyController"
|
|
5
|
-
auto-approve: true
|
|
6
|
-
allowed-tools: [Read, Glob, Grep, Bash, Write, Edit]
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# /wl-review - 代码审查工序站
|
|
10
|
-
|
|
11
|
-
User input: $ARGUMENTS
|
|
12
|
-
|
|
13
|
-
> **影响半径 + 需求对齐 + 多维审查,给通过/打回结论。**
|
|
14
|
-
|
|
15
|
-
## 🔧 工具优先级
|
|
16
|
-
| 步骤 | 用谁 | 原因 |
|
|
17
|
-
|------|------|------|
|
|
18
|
-
| 变更实体 | **Qoder AI 解析** | 从 diff/分支/文件集解析变更符号 |
|
|
19
|
-
| 影响半径 | **MCP get_impact** | 改动影响谁(upstream/downstream) |
|
|
20
|
-
| 全上下文 | **MCP context_360** | 变更实体的代码/API/字段画像 |
|
|
21
|
-
| 需求对齐 | **MCP aggregate_requirement** | 关联需求的 PRD/AC(业务覆盖) |
|
|
22
|
-
| 安全门禁 | **MCP gate_check** | conformal/risk 裁决 |
|
|
23
|
-
| 审查报告 | **Qoder AI** | 多维综合→通过/打回 |
|
|
24
|
-
|
|
25
|
-
## 🧠 流程
|
|
26
|
-
1. **提取变更**:derive → changed_entities + change_intent + req_key
|
|
27
|
-
2. **影响半径**:`get_impact(entity=<changed>, depth=3)` → 影响面
|
|
28
|
-
3. **全上下文**:`context_360(query=<changed>)` → 实体画像
|
|
29
|
-
4. **需求对齐**:`aggregate_requirement(req_key=<req>)` → PRD/AC(业务覆盖)
|
|
30
|
-
5. **相似实现**:`rag_search(query=<intent>)` → 相似/缺陷模式
|
|
31
|
-
6. **审查焦点**:derive → risk_areas + security + quality + business_gaps + regression_scope
|
|
32
|
-
7. **审查报告**:Qoder AI 综合 → ① 变更范围 ② 安全 ③ 精准度 ④ 需求覆盖 ⑤ 通过/打回
|
|
33
|
-
|
|
34
|
-
## 🚨 铁律
|
|
35
|
-
1. **只评真实**:变更范围只评 get_impact 命中的真实实体
|
|
36
|
-
2. **PascalCase 引用**:审查实体用原名(CostApplyController),非中文描述(溯源)
|
|
37
|
-
3. **门禁量化**:gate_check 裁决 block/warn/pass
|
|
38
|
-
4. **结论明确**:通过/打回二选一 + 理由
|
|
39
|
-
|
|
40
|
-
## 📊 对齐
|
|
41
|
-
- 平台 workflow_sim WL_WL_REVIEW_GRAPH(extract→impact→context→requirement→search→focus→report)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## 🚨 接地铁律(防幻觉/保真,Qoder AI 必须遵守)
|
|
45
|
-
|
|
46
|
-
1. **溯源**:引用代码符号/表名/接口用**真实原名**(如 `CostApplyController`、`base_asset`),非中文描述——只引 MCP 工具(rag_search/schema_link/context_360/get_impact 等)召回的真实符号,提升可溯源性
|
|
47
|
-
2. **禁编**:不编造未在召回里出现的类名/表名/字段/接口;召回不足时标"待确认(知识层未召回)",**诚实优于编造**
|
|
48
|
-
3. **接地(数据表)**:涉及数据表/字段时,先调 MCP `schema_link`/`query_schema` 取真表真列;未召回真表禁编 t_xxx 表名+字段充数
|
|
49
|
-
4. **完整**:产物详尽展开(每节实质内容,不一行带过)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|