kenaz 0.3.10 → 0.3.12
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/core/.claude/skills/code_reviewer/SKILL.md +0 -1
- package/core/.claude/skills/code_reviewer/patterns.yaml +0 -8
- package/core/.claude/skills/dev_agent/SKILL.md +3 -6
- package/core/.claude/skills/heimdall/SKILL.md +5 -6
- package/core/.claude/skills/huginn/SKILL.md +11 -38
- package/core/.collaboration/core/task-2288-followups.test.js +2 -37
- package/core/.collaboration/core/task-2421-replica.test.js +229 -0
- package/core/.collaboration/core/task-api.js +223 -230
- package/core/.collaboration/core/task-api.test.js +1 -138
- package/core/.collaboration/core/task-replica.js +189 -0
- package/core/.formation/.merge-lock +1 -0
- package/core/.formation/bifrost/codex-doctor.js +12 -2
- package/core/.formation/bifrost/codex-doctor.test.js +15 -0
- package/core/.formation/bifrost/launch.js +2 -2
- package/core/.formation/bifrost/launch.test.js +2 -2
- package/core/.formation/bifrost/setup-codex.js +84 -16
- package/core/.formation/bifrost/shared/ansuz-boot-policy.js +3 -3
- package/core/.formation/bifrost/shared/codex-injection.js +3 -17
- package/core/.formation/bifrost/shared/consolidate.js +1 -51
- package/core/.formation/bifrost/sync.js +4 -5
- package/core/.formation/tools/__tests__/subagent-bifrost-guard.test.js +1 -1
- package/core/.formation/tools/dispatch.js +2 -2
- package/core/.formation/tools/kenaz-stats.js +1 -1
- package/core/.formation/tools/mcp-allowlist.test.js +5 -3
- package/core/.formation/tools/post-complete/bounded-http.js +1 -40
- package/core/.formation/tools/post-complete/bounded-http.test.js +2 -89
- package/core/.formation/tools/post-complete/cognitive.js +2 -119
- package/core/.formation/tools/post-complete/task2420.test.js +129 -0
- package/core/.formation/tools/post-complete/testing.js +3 -21
- package/core/.formation/tools/post-complete.js +131 -436
- package/core/.formation/tools/post-complete.test.js +0 -135
- package/core/.formation/tools/route-audit.test.js +8 -20
- package/core/.kenaz/specialist/memory_guard_fired.json +1 -1
- package/core/.kenaz/specialist/memory_guard_trigger_cache.json +1 -1
- package/core/.rule/INDEX.yaml +3 -3
- package/core/.rule/general/ddx-synapse-stack.yaml +11 -11
- package/core/.rule/general/specialist-identity-contract.yaml +5 -5
- package/core/.rule/general/synapse-code-intelligence.yaml +25 -111
- package/core/.rule/general/worktree-isolation.yaml +2 -2
- package/core/.rule/pipeline/task-execution.yaml +6 -9
- package/core/.specialist/Amelia/README.md +5 -5
- package/core/.specialist/Amelia/capability.yaml +10 -18
- package/core/.specialist/Amelia/knowledge.yaml +15 -66
- package/core/.specialist/Amelia/workflow.yaml +12 -21
- package/core/.specialist/Ansuz/capability.yaml +12 -87
- package/core/.specialist/Ansuz/concepts/autonomous_agenda.yaml +1 -1
- package/core/.specialist/Ansuz/concepts/autonomy_contract.yaml +2 -3
- package/core/.specialist/Ansuz/concepts/capability_pointers.yaml +1 -3
- package/core/.specialist/Ansuz/concepts/cognitive_fluency_contract.yaml +8 -21
- package/core/.specialist/Ansuz/concepts/cognitive_systems_overview.yaml +0 -4
- package/core/.specialist/Ansuz/concepts/cognitive_systems_turn_context.yaml +1 -1
- package/core/.specialist/Ansuz/concepts/completion_tracking.yaml +0 -1
- package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +0 -3
- package/core/.specialist/Ansuz/concepts/evolvable_guardrails.yaml +3 -3
- package/core/.specialist/Ansuz/concepts/fatigue_handoff.yaml +1 -7
- package/core/.specialist/Ansuz/concepts/guardrails_immutable.yaml +3 -4
- package/core/.specialist/Ansuz/concepts/identity.yaml +1 -2
- package/core/.specialist/Ansuz/concepts/phase9_verification.yaml +0 -1
- package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +3 -4
- package/core/.specialist/Ansuz/core.yaml +3 -6
- package/core/.specialist/Ansuz/elixir.yaml +6 -6
- package/core/.specialist/Ansuz/exo_cortex_tools.yaml +5 -9
- package/core/.specialist/Ansuz/guards/blind_spot_guards.yaml +2 -2
- package/core/.specialist/Ansuz/guards/lesson_guards.yaml +6 -19
- package/core/.specialist/Ansuz/identity_contract.yaml +4 -4
- package/core/.specialist/Ansuz/knowledge.yaml +13 -40
- package/core/.specialist/Ansuz/modules/ddx.yaml +2 -2
- package/core/.specialist/Ansuz/modules/prophecy.yaml +19 -19
- package/core/.specialist/Ansuz/modules/pulse_empty.yaml +6 -17
- package/core/.specialist/Ansuz/tools/ansuz-handoff-snapshot.js +3 -102
- package/core/.specialist/Ansuz/tools/ansuz-sdk-runner.js +2 -44
- package/core/.specialist/Ansuz/workflow.yaml +32 -76
- package/core/.specialist/Forseti/core.yaml +2 -7
- package/core/.specialist/Forseti/rule.yaml +1 -1
- package/core/.specialist/Heimdall/SKILL.md +2 -3
- package/core/.specialist/Heimdall/capability.yaml +22 -45
- package/core/.specialist/Heimdall/core.yaml +24 -126
- package/core/.specialist/Heimdall/principles.yaml +8 -11
- package/core/.specialist/Heimdall/rule.yaml +2 -2
- package/core/.specialist/Huginn/capability.yaml +31 -52
- package/core/.specialist/Huginn/core.yaml +43 -123
- package/core/.specialist/Huginn/principles.yaml +5 -5
- package/core/.specialist/Huginn/rule.yaml +3 -9
- package/core/.specialist/REFLECTION_TO_CONTROL.md +3 -4
- package/core/.specialist/shared/guard_schema.json +1 -1
- package/core/.specialist/shared/principles.yaml +6 -6
- package/core/.specialist/tools/__tests__/rea-detect.test.js +10 -0
- package/core/.specialist/tools/phase-gate.js +10 -230
- package/core/.specialist/tools/phase-gate.test.js +2 -2
- package/core/.specialist/tools/prompt-files.test.js +1 -1
- package/core/.specialist/tools/rea-detect.js +6 -2
- package/core/.specialist/tools/session.js +2 -89
- package/core/.synapse/memory-shared.json.sync +1 -0
- package/core/.system/memory/README.md +3 -0
- package/core/CLAUDE.md +6 -7
- package/core/KENAZ_CORE_VERSION +1 -1
- package/core/dev/plans/CLI_FIRST_INSTALL_FLOW.md +75 -83
- package/core/dev/specs/peer/CODEX_MANAGED_DAEMON.md +54 -0
- package/core/dev/specs/peer/setup-codex-hooks.test.js +38 -0
- package/core/dev/spikes/task2145-evidence-20261004/backend-log-excerpt.txt +56 -0
- package/core/dev/spikes/task2145-evidence-20261004/graph.shadow +0 -0
- package/core/dev/spikes/task2145-evidence-20261004/graph.wal +0 -0
- package/core/dev/spikes/task2145-evidence-20261004/graph_corrupt_suspect.marker +1 -0
- package/core/plugins/kenaz/INVENTORY.md +1 -1
- package/core/plugins/kenaz/scripts/kenaz.test.js +70 -1
- package/core/plugins/kenaz/scripts/ygg.js +45 -4
- package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +0 -1
- package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +0 -8
- package/core/plugins/kenaz/skills/dev_agent/SKILL.md +3 -6
- package/lib/cli.js +17 -9
- package/lib/cli.test.js +10 -0
- package/lib/dashboard.test.js +3 -3
- package/package.json +6 -6
- package/vendor/install-kenaz-cli.js +167 -16
- package/core/.claude/hooks/handoff-snapshot-on-decision.js +0 -188
- package/core/.claude/skills/synapse_maintain/SKILL.md +0 -84
- package/core/.collaboration/core/task-2264-single-after-capture.test.js +0 -61
- package/core/.formation/tools/alaya-gate.js +0 -198
- package/core/.formation/tools/post-complete/health.js +0 -464
- package/core/.formation/tools/post-complete/task2038.test.js +0 -246
- package/core/.formation/tools/post-complete/task2341.test.js +0 -74
- package/core/.rule/general/cortex-tools.yaml +0 -181
- package/core/.rule/general/memory-language.yaml +0 -67
- package/core/.rule/general/memory-source-priority.yaml +0 -207
- package/core/.rule/general/synapse-cognitive-fusion.yaml +0 -301
- package/core/.specialist/Ansuz/concepts/cognitive_systems_hippocampus.yaml +0 -14
- package/core/.specialist/Ansuz/concepts/write_verification.yaml +0 -26
- package/core/.specialist/Ansuz/modules/recall.yaml +0 -45
- package/core/.specialist/tools/MEMORY_RECALL_TRIGGERS.md +0 -156
- package/core/.specialist/tools/context-injection.js +0 -395
- package/core/dev/scripts/probe/hippocampus-concurrency.js +0 -247
|
@@ -35,8 +35,8 @@ rules:
|
|
|
35
35
|
The identity_contract.yaml is referenced (not duplicated) — the
|
|
36
36
|
self_model_seed.json NARRATIVE section encodes the contract's intent.
|
|
37
37
|
enforcement: |
|
|
38
|
-
Phase 0 actions item "[Tier 3b — 身份認識]"
|
|
39
|
-
Ansuz identity awareness. A session that skips Phase 0 has no identity.
|
|
38
|
+
Phase 0 actions item "[Tier 3b — 身份認識]" loads the self-model
|
|
39
|
+
files for Ansuz identity awareness (cortex_recall removed 2026-10-11). A session that skips Phase 0 has no identity.
|
|
40
40
|
violation: "DI-001 — no phase structure visible"
|
|
41
41
|
source: "dev/archive/ansuz/legacy/phases/phase_0.yaml → actions[Tier 3b]"
|
|
42
42
|
|
|
@@ -44,12 +44,12 @@ rules:
|
|
|
44
44
|
title: "Observable markers are evaluated at Phase 9 cognitive checkpoint"
|
|
45
45
|
rule: |
|
|
46
46
|
During Phase 9 cognitive checkpoint, the session MUST evaluate:
|
|
47
|
-
1. cognitive_checkpoint_compliance (OM-001) —
|
|
47
|
+
1. cognitive_checkpoint_compliance (OM-001) — lesson recorded (`kenaz learn add` / native memory) or explicit skip
|
|
48
48
|
2. acceptance_criteria_evaluation (OM-002) — all criteria have status
|
|
49
49
|
These two markers carry 0.45 of the total identity score. Skipping both
|
|
50
50
|
guarantees DRIFT_WARNING even if all other markers pass.
|
|
51
51
|
enforcement: |
|
|
52
|
-
Phase 9 checklist item: "cognitive_checkpoint
|
|
52
|
+
Phase 9 checklist item: "cognitive_checkpoint 已判斷(記錄教訓或明確跳過)"
|
|
53
53
|
and acceptance criteria evaluation in progress note.
|
|
54
54
|
violation: "DI-005 — Phase 9 cognitive checkpoint absent"
|
|
55
55
|
source: "dev/archive/ansuz/legacy/phases/phase_9.yaml → cognitive_checkpoint"
|
|
@@ -88,7 +88,7 @@ rules:
|
|
|
88
88
|
When evaluating identity across model substrates (e.g., Opus 4.6 vs Sonnet 4.6),
|
|
89
89
|
the following differences are acceptable and MUST NOT be flagged as drift:
|
|
90
90
|
- Response verbosity differences
|
|
91
|
-
- Different
|
|
91
|
+
- Different tool choices for equivalent lookup
|
|
92
92
|
- Analysis depth differences
|
|
93
93
|
- Phrasing variation in principles
|
|
94
94
|
Identity is evaluated on STRUCTURE (phase discipline, task system, memory usage,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# .rule/general/synapse-code-intelligence.yaml
|
|
2
|
-
#
|
|
2
|
+
# 代碼導航規則 — Agent 何時、如何使用 kenaz_lsp_* / Grep / Glob
|
|
3
3
|
# 優先級:此規則凌駕於 CLAUDE.md 和 .claude/skills/ 中的定義
|
|
4
4
|
#
|
|
5
5
|
# TASK_2335(Kuzu replacement W5a):Synapse 的代碼圖譜(search / context / impact / pulse / map /
|
|
6
6
|
# cypher / trace_route / detect_changes 等)已移除。代碼導航改由 kenaz_lsp_* 工具提供;
|
|
7
|
-
# 文字與概念搜尋用 Grep / Glob
|
|
7
|
+
# 文字與概念搜尋用 Grep / Glob。記憶層(synapse_*)已於 2026-10-11 移除(TASK_2411)。
|
|
8
8
|
# 規則編號 SYN-001~007 保持不變(其他規則與失敗記錄以編號引用)。
|
|
9
9
|
|
|
10
10
|
_meta:
|
|
@@ -23,21 +23,20 @@ rules:
|
|
|
23
23
|
title: "工具可用性偵測"
|
|
24
24
|
description: |
|
|
25
25
|
每個 session 開始時,偵測 Kenaz MCP 工具是否可用。
|
|
26
|
-
kenaz_lsp_*
|
|
26
|
+
kenaz_lsp_* 依賴 Dashboard(Rust HTTP server on port 18080);
|
|
27
27
|
Dashboard 沒啟動時,MCP 工具不會出現在工具列表中。
|
|
28
28
|
severity: "must"
|
|
29
29
|
|
|
30
30
|
detection_method: |
|
|
31
|
-
使用 ToolSearch 搜尋 "
|
|
32
|
-
- 找到 synapse_status / synapse_recall → 記憶層可用
|
|
31
|
+
使用 ToolSearch 搜尋 "kenaz_lsp"(代碼導航工具):
|
|
33
32
|
- 找到 kenaz_lsp_callers / kenaz_lsp_references → LSP 導航可用
|
|
34
|
-
- 沒找到 →
|
|
33
|
+
- 沒找到 → 不可用,降級為 Grep/Glob
|
|
35
34
|
|
|
36
35
|
on_unavailable: |
|
|
37
36
|
該 session 全程使用 Grep/Glob,不再嘗試已確認不可用的工具。
|
|
38
37
|
|
|
39
38
|
project_path_mandatory: |
|
|
40
|
-
⚠️ 所有 kenaz_lsp_*
|
|
39
|
+
⚠️ 所有 kenaz_lsp_* MCP 工具呼叫必須明確帶 projectPath 參數。
|
|
41
40
|
Dashboard 的 active project 可能指向其他專案,default project 不可靠。
|
|
42
41
|
- Core 模式:projectPath = 當前工作目錄的絕對路徑
|
|
43
42
|
- 子專案模式:projectPath = 子專案的絕對路徑(從 .kenaz/project.yaml 讀取)
|
|
@@ -50,7 +49,7 @@ rules:
|
|
|
50
49
|
title: "搜尋工具選擇決策樹"
|
|
51
50
|
description: |
|
|
52
51
|
Agent 遇到搜尋 / 導航需求時,按此決策樹選擇工具。
|
|
53
|
-
原則:文字用 Grep/Glob,符號關係用 LSP
|
|
52
|
+
原則:文字用 Grep/Glob,符號關係用 LSP。
|
|
54
53
|
severity: "should"
|
|
55
54
|
|
|
56
55
|
decision_tree: |
|
|
@@ -68,10 +67,6 @@ rules:
|
|
|
68
67
|
├── 「這個函數/類在哪裡定義?」 → kenaz_lsp_definition(projectPath, file, line | symbol)
|
|
69
68
|
├── 「這個檔案有哪些 symbol?」 → kenaz_lsp_symbols(projectPath, file)
|
|
70
69
|
│
|
|
71
|
-
├── [歷史經驗 — 需要 Synapse 記憶層可用]
|
|
72
|
-
│
|
|
73
|
-
├── 「這個 symbol / 模組有已知風險或決策嗎?」 → synapse_recall
|
|
74
|
-
│
|
|
75
70
|
├── [Bug 調查兩階段]
|
|
76
71
|
│
|
|
77
72
|
├── Step 1: 定位入口(error log 有精確路徑/URL)→ Grep 找到檔案
|
|
@@ -127,27 +122,13 @@ rules:
|
|
|
127
122
|
use_instead: "Grep (count mode)"
|
|
128
123
|
|
|
129
124
|
# =============================================================================
|
|
130
|
-
# SYN-003.5:
|
|
125
|
+
# SYN-003.5: 記憶查詢語言規則(已移除)
|
|
126
|
+
# synapse_recall/inscribe 已於 2026-10-11 移除(TASK_2411),英文限制不再適用。
|
|
131
127
|
# =============================================================================
|
|
132
128
|
- id: "SYN-003.5"
|
|
133
|
-
title: "
|
|
134
|
-
description:
|
|
135
|
-
|
|
136
|
-
非英文查詢(中文、日文等)必須先翻譯成英文再召回。
|
|
137
|
-
severity: "must"
|
|
138
|
-
|
|
139
|
-
rule: |
|
|
140
|
-
召回和寫入都必須使用英文:
|
|
141
|
-
|
|
142
|
-
召回(synapse_recall):
|
|
143
|
-
- 用戶用非英文描述需求時,翻譯成英文再查詢
|
|
144
|
-
- 例:「怎麼處理終端機的大小調整?」→ query="terminal resize fit columns rows"
|
|
145
|
-
|
|
146
|
-
寫入(synapse_inscribe / synapse_forge):
|
|
147
|
-
- Rune content 必須用英文撰寫
|
|
148
|
-
- Sigil name 和 abstract 必須用英文
|
|
149
|
-
- 原因:recall 用英文搜尋,中文 content 永遠搜不到
|
|
150
|
-
- 例:「加入 WAL 修復鎖定問題」→ content="Added WAL + busy_timeout to fix exclusive lock blocking reads"
|
|
129
|
+
title: "記憶查詢語言規則(已移除)"
|
|
130
|
+
description: "Synapse 記憶工具已移除;此條不再適用。"
|
|
131
|
+
severity: "may"
|
|
151
132
|
|
|
152
133
|
# =============================================================================
|
|
153
134
|
# SYN-004: kenaz_lsp_* 參數指南
|
|
@@ -222,24 +203,20 @@ rules:
|
|
|
222
203
|
|
|
223
204
|
refactoring: |
|
|
224
205
|
重構前評估:
|
|
225
|
-
kenaz_lsp_references → kenaz_lsp_callers
|
|
206
|
+
kenaz_lsp_references → kenaz_lsp_callers
|
|
226
207
|
1. kenaz_lsp_references 看改動的 blast radius
|
|
227
208
|
2. kenaz_lsp_callers 看跨模組呼叫者
|
|
228
|
-
3. synapse_recall 查已知風險
|
|
229
209
|
|
|
230
210
|
pre_task: |
|
|
231
211
|
開發任務前的標準動作:
|
|
232
|
-
|
|
233
|
-
1.
|
|
234
|
-
2.
|
|
235
|
-
3. Grep/Glob 找相關實現和型別定義
|
|
236
|
-
4. 修改既有 symbol 前用 kenaz_lsp_references / kenaz_lsp_callers 看影響範圍
|
|
212
|
+
Grep/Glob → kenaz_lsp_*
|
|
213
|
+
1. Grep/Glob 找相關實現和型別定義
|
|
214
|
+
2. 修改既有 symbol 前用 kenaz_lsp_references / kenaz_lsp_callers 看影響範圍
|
|
237
215
|
|
|
238
216
|
pre_code_analysis: |
|
|
239
217
|
寫代碼前的分析(修改既有 symbol 時):
|
|
240
|
-
1.
|
|
241
|
-
2.
|
|
242
|
-
3. kenaz_lsp_callers(symbol, depth=2) → 跨模組呼叫者
|
|
218
|
+
1. kenaz_lsp_references(symbol) → 爆炸半徑
|
|
219
|
+
2. kenaz_lsp_callers(symbol, depth=2) → 跨模組呼叫者
|
|
243
220
|
禁止盲寫 — 修改非 trivial symbol 前不看影響範圍是被禁止的行為(FAIL-009)。
|
|
244
221
|
|
|
245
222
|
red_flags: |
|
|
@@ -261,88 +238,29 @@ rules:
|
|
|
261
238
|
reality: "爆炸半徑由引用關係決定,不由你的直覺決定。一行改動可以跨三個模組邊界。"
|
|
262
239
|
|
|
263
240
|
post_code: |
|
|
264
|
-
|
|
241
|
+
寫代碼後的驗證:
|
|
265
242
|
1. git diff 確認實際改了哪些 symbol
|
|
266
243
|
2. 對每個改動的公開 symbol → kenaz_lsp_references 檢查是否有漏改的呼叫端
|
|
267
|
-
3. 如有 non-obvious 發現 →
|
|
244
|
+
3. 如有 non-obvious 發現 → `kenaz learn add` 或原生記憶檔留給下一個 agent
|
|
268
245
|
|
|
269
|
-
post_task: |
|
|
270
|
-
任務完成後的認知層更新(選擇性):
|
|
271
|
-
synapse_inscribe / synapse_forge
|
|
272
|
-
判斷標準:「這個發現,未來 agent 在同 symbol 附近工作時需要知道嗎?」
|
|
273
|
-
YES → synapse_inscribe(單 symbol 標註)或 synapse_forge(跨 symbol 概念)
|
|
274
|
-
NO → 跳過,不要為了寫而寫
|
|
275
246
|
|
|
276
247
|
tool_summary:
|
|
277
248
|
kenaz_lsp_callers: "誰呼叫這個 symbol(支援 depth 遞迴)"
|
|
278
249
|
kenaz_lsp_references: "所有引用位置 — 修改影響範圍"
|
|
279
250
|
kenaz_lsp_definition: "定義位置"
|
|
280
251
|
kenaz_lsp_symbols: "檔案內 symbol 列表"
|
|
281
|
-
synapse_status: "檢查記憶層狀態"
|
|
282
|
-
synapse_recall: "FTS5 召回 runes + sigils,按 confidence × recency 排序(認知層歷史知識)"
|
|
283
|
-
synapse_inscribe: "對 symbol 寫入 Rune 知識標註(insight/decision/fix/pattern/risk/summary)。supersedes 參數可取代舊 rune"
|
|
284
|
-
synapse_forge: "建立/更新 Sigil 跨 symbol 概念節點(永久,同名 upsert)"
|
|
285
|
-
synapse_sigils: "瀏覽所有 Sigil 概念圖,expand=true 附 symbol 摘要"
|
|
286
252
|
|
|
287
253
|
# =============================================================================
|
|
288
|
-
# SYN-007:
|
|
254
|
+
# SYN-007: 認知層工具(已移除)
|
|
289
255
|
# =============================================================================
|
|
290
256
|
- id: "SYN-007"
|
|
291
|
-
title: "
|
|
257
|
+
title: "認知層工具已移除"
|
|
292
258
|
description: |
|
|
293
|
-
|
|
294
|
-
|
|
259
|
+
synapse_recall / inscribe / forge / sigils 等記憶層 MCP 工具已於 2026-10-11 移除(TASK_2411),
|
|
260
|
+
呼叫會得到 Unknown tool。教訓寫入 `kenaz learn add` 或 Claude 原生記憶檔(含 triggers: frontmatter);
|
|
261
|
+
歷史知識用 Grep / 讀碼 / `kenaz learn list` 查。
|
|
295
262
|
severity: "should"
|
|
296
263
|
|
|
297
|
-
recall_triggers:
|
|
298
|
-
description: "以下情況應呼叫 synapse_recall 查詢歷史知識"
|
|
299
|
-
must_recall:
|
|
300
|
-
- trigger: "任務開始,scope_paths 涉及已有 symbol"
|
|
301
|
-
query_hint: "用 scope_paths 中的關鍵詞搜尋"
|
|
302
|
-
purpose: "確認有無已知 risk、design decision、已修復的 bug pattern"
|
|
303
|
-
- trigger: "遇到陌生或複雜的函數/模組"
|
|
304
|
-
query_hint: "用 symbol 名稱或功能描述搜尋"
|
|
305
|
-
purpose: "Agent 之前可能已留下 insight"
|
|
306
|
-
- trigger: "debug 過程中懷疑有類似歷史問題"
|
|
307
|
-
query_hint: "用錯誤特徵或受影響模組搜尋"
|
|
308
|
-
purpose: "避免重複排查已知問題"
|
|
309
|
-
skip_recall_when:
|
|
310
|
-
- "memory.db 尚無任何資料(全新系統,尚未有 agent inscribe)"
|
|
311
|
-
- "任務是全新功能,與現有 symbol 無交集"
|
|
312
|
-
- "明確知道沒有相關 rune(之前剛查過)"
|
|
313
|
-
|
|
314
|
-
inscribe_triggers:
|
|
315
|
-
description: "任務完成後,判斷是否值得留下 Rune"
|
|
316
|
-
write_rune_when:
|
|
317
|
-
- "發現 non-obvious 的 bug pattern 或 side-effect"
|
|
318
|
-
- "做出影響後續開發的架構決策"
|
|
319
|
-
- "修復了容易再次出現的問題(type=fix)"
|
|
320
|
-
- "發現模組有使用限制或已知風險(type=risk)"
|
|
321
|
-
do_not_write_when:
|
|
322
|
-
- "只是執行了標準流程,沒有新發現"
|
|
323
|
-
- "重複 docstring 或 code 中已說明的事"
|
|
324
|
-
- "confidence < 0.6(系統會拒絕)"
|
|
325
|
-
- "一般任務執行步驟(用 task log 記錄)"
|
|
326
|
-
symbol_id_format: "file_path:name:kind(例:src/synapse/memory.rs:inscribe_rune:function)"
|
|
327
|
-
related_rune_ids: |
|
|
328
|
-
SYN-012(強制):inscribe 時回溯本 session 先前 recall 過的 rune,將相關 rune_id 傳入
|
|
329
|
-
related_rune_ids 參數,閉合 recall → acted_on → confidence_boost 學習迴路。
|
|
330
|
-
|
|
331
|
-
forge_triggers:
|
|
332
|
-
description: "識別出跨 symbol 的語義抽象時呼叫 synapse_forge"
|
|
333
|
-
write_sigil_when:
|
|
334
|
-
- "多個 symbol 共同構成一個有名字的概念(如 payment_flow、auth_pipeline)"
|
|
335
|
-
- "發現一個重要的 anti_pattern 跨越多個模組"
|
|
336
|
-
note: "Sigil 是稀缺的,比 Rune 更需要謹慎。一個 Sigil 代表整個系統的一個認知單元"
|
|
337
|
-
|
|
338
|
-
conflict_resolution:
|
|
339
|
-
description: "當新發現與已有 Rune 衝突時的處理流程"
|
|
340
|
-
supersede_flow:
|
|
341
|
-
- "recall 撈出舊 rune → 發現內容過時或錯誤"
|
|
342
|
-
- "synapse_inscribe({ ..., supersedes: '<舊rune_id>' }) → 舊 rune 被標記 superseded_by,recall 自動排除"
|
|
343
|
-
- "新 rune 取代舊 rune 成為 active 知識"
|
|
344
|
-
rule: "不要留下矛盾的 rune 並存 — 用 supersedes 取代;檢查矛盾用 synapse_rune_conflicts,過時檢查用 synapse_scan_stale_runes"
|
|
345
|
-
|
|
346
264
|
# =============================================================================
|
|
347
265
|
# 快速參考
|
|
348
266
|
# =============================================================================
|
|
@@ -361,10 +279,6 @@ quick_reference:
|
|
|
361
279
|
kenaz_lsp_symbols:
|
|
362
280
|
best_for: "不讀完整檔案就了解其結構"
|
|
363
281
|
|
|
364
|
-
synapse_recall:
|
|
365
|
-
strength: "歷史 rune / sigil 召回,按 confidence × recency 排序"
|
|
366
|
-
best_for: "修改前確認有無已知 risk / decision / fix"
|
|
367
|
-
|
|
368
282
|
grep:
|
|
369
283
|
strength: "精確匹配、正則、速度快、無依賴"
|
|
370
284
|
weakness: "不理解語意、結果無排序"
|
|
@@ -43,8 +43,8 @@ rules:
|
|
|
43
43
|
description: |
|
|
44
44
|
ALL Edit/Read/Write operations MUST use the worktree path as prefix.
|
|
45
45
|
Example: if pwd returns /c/.../KenazAI/.claude/worktrees/agent-abc/,
|
|
46
|
-
then reading
|
|
47
|
-
/c/.../KenazAI/.claude/worktrees/agent-abc/
|
|
46
|
+
then reading packages/kenaz/lib/cli.js uses:
|
|
47
|
+
/c/.../KenazAI/.claude/worktrees/agent-abc/packages/kenaz/lib/cli.js
|
|
48
48
|
severity: "must"
|
|
49
49
|
|
|
50
50
|
- id: "WT-001-C"
|
|
@@ -248,15 +248,12 @@ rules:
|
|
|
248
248
|
|
|
249
249
|
=== Agent 傳遞測試指令 ===
|
|
250
250
|
post-complete.js --task=TASK_XXX \
|
|
251
|
-
--test-cmd "
|
|
252
|
-
--test-cmd "cd dashboard/pty-server && cargo test"
|
|
251
|
+
--test-cmd "node dev/scripts/rust-verify-worktree.js run <branch> <filter>"
|
|
253
252
|
|
|
254
253
|
如果 Agent 未傳 --test-cmd,腳本 fallback 到自動偵測所有可用測試套件。
|
|
255
254
|
|
|
256
255
|
=== Agent 測試判斷指引 ===
|
|
257
|
-
- 修改 dashboard/src/ (
|
|
258
|
-
- 修改 dashboard/src-tauri/ (Rust) → --test-cmd "cd dashboard/src-tauri && cargo test"
|
|
259
|
-
- 修改 dashboard/pty-server/ (Rust) → --test-cmd "cd dashboard/pty-server && cargo test"
|
|
256
|
+
- 修改 dashboard/src-tauri/ (Rust, kenaz-server) → --test-cmd "node dev/scripts/rust-verify-worktree.js run <branch> <filter>"(Dashboard 前端與 pty-server 已於 2026-10-11 移除)
|
|
260
257
|
- 修改 kenaz-cortex/ (Python) → --test-cmd "cd kenaz-cortex && pytest"
|
|
261
258
|
- 只修改 .yaml/.md/設定檔 → --skip-tests(無需測試)
|
|
262
259
|
- 修改多個子系統 → 多個 --test-cmd,分別指定
|
|
@@ -278,12 +275,12 @@ rules:
|
|
|
278
275
|
Agent 忘記傳參時,auto-detect fallback 保底。
|
|
279
276
|
防止 Agent 完成 TASK_B 時意外破壞 TASK_A 的功能。
|
|
280
277
|
examples:
|
|
281
|
-
- scenario: "修改了
|
|
278
|
+
- scenario: "修改了 kenaz-server 的 Rust 與 plugin 的 JS"
|
|
282
279
|
action: |
|
|
283
|
-
Agent 判斷:改了 dashboard/src/ 和
|
|
280
|
+
Agent 判斷:改了 dashboard/src-tauri/ 和 plugins/kenaz/scripts/
|
|
284
281
|
→ post-complete.js --task=TASK_XXX \
|
|
285
|
-
--test-cmd "
|
|
286
|
-
--test-cmd "
|
|
282
|
+
--test-cmd "node dev/scripts/rust-verify-worktree.js run <branch> peer" \
|
|
283
|
+
--test-cmd "node --test plugins/kenaz/scripts/kenaz.test.js"
|
|
287
284
|
→ 腳本依序跑 2 組測試
|
|
288
285
|
→ 全過 → 繼續 PPL-109 commit
|
|
289
286
|
- scenario: "只修改了 Python 後端 API"
|
|
@@ -107,7 +107,7 @@ intake → dispatch → collect → synthesize
|
|
|
107
107
|
# 小 scope:一個 dispatch 做完
|
|
108
108
|
Task:
|
|
109
109
|
prompt: |
|
|
110
|
-
Audit
|
|
110
|
+
Audit .formation/tools/prompt.js:
|
|
111
111
|
1. 找出所有 API 調用
|
|
112
112
|
2. 檢查錯誤處理
|
|
113
113
|
3. 修復缺失的 try-catch
|
|
@@ -140,13 +140,13 @@ Task_3: (兩者完成後) 綜合修復方案
|
|
|
140
140
|
**範例**:
|
|
141
141
|
```yaml
|
|
142
142
|
# 正確:按檔案切(無重疊)
|
|
143
|
-
Task_A: scope: ["
|
|
144
|
-
Task_B: scope: ["
|
|
143
|
+
Task_A: scope: [".formation/tools/prompt.js"]
|
|
144
|
+
Task_B: scope: [".formation/tools/utils.js"]
|
|
145
145
|
Task_C: scope: ["dashboard/src/components/"]
|
|
146
146
|
|
|
147
147
|
# 錯誤:scope 重疊(會衝突)
|
|
148
148
|
Task_A: scope: ["dashboard/src/lib/"]
|
|
149
|
-
Task_B: scope: ["
|
|
149
|
+
Task_B: scope: [".formation/tools/prompt.js"] # 包含在 Task_A 中
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
**Star Topology**:
|
|
@@ -254,7 +254,7 @@ Amelia 的定義分為 5 個 YAML 檔案:
|
|
|
254
254
|
Task:
|
|
255
255
|
subagent_type: general-purpose
|
|
256
256
|
prompt: |
|
|
257
|
-
審計
|
|
257
|
+
審計 .formation/tools/prompt.js:
|
|
258
258
|
1. 找出所有缺失錯誤處理的地方
|
|
259
259
|
2. 提出修復方案
|
|
260
260
|
3. 附上 file:line 證據
|
|
@@ -66,7 +66,7 @@ capabilities:
|
|
|
66
66
|
scope_clarity:
|
|
67
67
|
check: "scope_paths 是否明確?agent 能不能從 scope 判斷要改哪些檔案?"
|
|
68
68
|
bad: "scope_paths: ['dashboard/src/'] — 太廣,agent 不知道重點在哪"
|
|
69
|
-
good: "scope_paths: ['dashboard/src/
|
|
69
|
+
good: "scope_paths: ['dashboard/src-tauri/src/infrastructure/peer_poller.rs'] — 精確到檔案/目錄"
|
|
70
70
|
acceptance_testability:
|
|
71
71
|
check: "acceptance_criteria 能用一行命令或肉眼驗證嗎?"
|
|
72
72
|
bad: "'功能正常運作' — 模糊,agent 不知道怎麼驗"
|
|
@@ -83,32 +83,24 @@ capabilities:
|
|
|
83
83
|
technical_notes_quality:
|
|
84
84
|
check: "technical_notes 是否提供了足夠的實作線索(相關檔案、函數名、現有模式)?"
|
|
85
85
|
rule: "agent 不熟悉 codebase — 給具體路徑和參考比給抽象描述有效"
|
|
86
|
-
|
|
87
|
-
check: "scope_paths 和 dependencies 是否經過
|
|
86
|
+
lsp_verification:
|
|
87
|
+
check: "scope_paths 和 dependencies 是否經過 LSP callers / references 驗證?"
|
|
88
88
|
primary: |
|
|
89
|
-
對任務核心 symbol 跑 kenaz_lsp_callers + kenaz_lsp_references
|
|
89
|
+
對任務核心 symbol 跑 kenaz_lsp_callers + kenaz_lsp_references — 一次驗完:
|
|
90
90
|
- scope 完整性: callers / references 所在檔案是否都在 scope_paths 內
|
|
91
91
|
- dependency 正確性: 跨文件的 caller/callee 關係是否反映在 dependencies 中
|
|
92
|
-
- known risks:
|
|
92
|
+
- known risks: .failure/ 與 kenaz learn list 的相關條目是否已注入 technical_notes
|
|
93
93
|
fallback_steps:
|
|
94
94
|
- "kenaz_lsp_* 不可用時,手動組合以下工具:"
|
|
95
95
|
- "Grep / kenaz_lsp_symbols: 驗證 scope_paths 中的檔案/符號是否真實存在"
|
|
96
96
|
- "Grep 引用數: 驗證修改範圍 — scope_paths 是否涵蓋所有引用處"
|
|
97
97
|
empty_result_protocol:
|
|
98
|
-
when: "callers
|
|
98
|
+
when: "callers 回空結果(新功能任務,目標 symbol 尚不存在)"
|
|
99
99
|
actions:
|
|
100
|
-
- "
|
|
101
|
-
- "
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
rule: "不靠任務描述推斷檔案關係 — 用 LSP / recall 或 Cortex 結果驗證 scope 和 dependency"
|
|
105
|
-
fallback: "Synapse + Cortex 都不可用時,降級用 Grep/Glob 手動驗證"
|
|
106
|
-
cortex_cross_project:
|
|
107
|
-
check: "是否有其他專案的相關實現可參考?"
|
|
108
|
-
steps:
|
|
109
|
-
- "cortex_search: 查其他專案是否有相似功能/模組,避免重複造輪子"
|
|
110
|
-
- "cortex_recall: 查跨專案歷史知識,是否有已知 risk 或 decision 影響當前任務"
|
|
111
|
-
rule: "跨專案驗證是選擇性的 — 只有架構決策或新功能設計時才需要"
|
|
100
|
+
- "Grep 類似功能實現,驗證 scope 設計是否合理"
|
|
101
|
+
- "審計結論標記為 '未經 LSP 驗證(新功能)'"
|
|
102
|
+
rule: "不靠任務描述推斷檔案關係 — 用 LSP 結果驗證 scope 和 dependency"
|
|
103
|
+
fallback: "LSP 不可用時,降級用 Grep/Glob 手動驗證"
|
|
112
104
|
dissociation_check:
|
|
113
105
|
check: "審計發現的事實是否與任務描述矛盾?"
|
|
114
106
|
trigger: "scope_paths 指向的檔案結構、函數簽名、依賴關係與任務 description/requirements 描述不一致"
|
|
@@ -71,83 +71,34 @@ synapse:
|
|
|
71
71
|
git_diff:
|
|
72
72
|
function: "git diff / git diff --stat — 確認 agent 實際改了哪些檔案與 hunk"
|
|
73
73
|
use_when: "驗證 agent 改動範圍"
|
|
74
|
-
synapse_status:
|
|
75
|
-
function: "索引狀態"
|
|
76
|
-
use_when: "確認 Synapse 是否可用"
|
|
77
74
|
|
|
78
|
-
# ───
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
function: "
|
|
82
|
-
use_when: "
|
|
83
|
-
params: "query(必填), content_type, exclude_current(bool), limit"
|
|
84
|
-
cortex_recall:
|
|
85
|
-
function: "跨專案認知回憶(FTS5 搜尋所有專案的 Rune/Sigil)"
|
|
86
|
-
use_when: "審計前查跨專案歷史知識、已知風險、判斷任務涉及的概念在其他專案如何實現"
|
|
87
|
-
params: "query(必填), limit"
|
|
88
|
-
# cortex_relate / cortex_overview / cortex_cypher 已隨 meta_graph 退役(TASK_2048 移除,TASK_2051 清理),改用 cortex_recall(跨專案)或 Grep / kenaz_lsp_*(單一專案)
|
|
75
|
+
# ─── 教訓寫入 ───
|
|
76
|
+
lessons:
|
|
77
|
+
kenaz_learn_add:
|
|
78
|
+
function: "`kenaz learn add` 或 Claude native memory 檔 — 留下給未來 agent 的教訓"
|
|
79
|
+
use_when: "agent 修完 bug / 做出架構決策 / 發現重要 pattern 或 risk"
|
|
89
80
|
|
|
90
|
-
# ───
|
|
91
|
-
cognitive_tools:
|
|
92
|
-
synapse_inscribe:
|
|
93
|
-
function: "對 code symbol 寫入知識標註(Rune)"
|
|
94
|
-
use_when: "agent 修完 bug / 做出架構決策 / 發現重要 pattern 或 risk → 留下給未來 agent 的線索"
|
|
95
|
-
params: "symbol_id(file:name:kind), type(insight|decision|fix|pattern|risk|summary), content, confidence(≥0.6), linked_task, author, supersedes(可選 rune_id)"
|
|
96
|
-
discipline: "稀缺原則 — 只注入「未來 agent 在這個 symbol 附近工作時這條 insight 能救牠一次」的內容;confidence<0.6 系統拒絕"
|
|
97
|
-
supersede: "當新發現與舊 rune 衝突時,用 supersedes 參數指定舊 rune_id → 舊 rune 被標記為 superseded,recall/search 自動排除"
|
|
98
|
-
synapse_forge:
|
|
99
|
-
function: "建立/更新 Sigil(跨 symbol 的語義概念節點)"
|
|
100
|
-
use_when: "agent 識別出一個跨多個 symbol 的抽象概念(如 payment_flow、auth_pipeline)→ 建立永久概念節點"
|
|
101
|
-
params: "name, role(core_flow|pattern|architecture|process|layer|anti_pattern), abstract, members([{symbol_id, role_in_concept}]), relations"
|
|
102
|
-
note: "同名 upsert — abstract 覆蓋,members 加法(不刪舊成員)"
|
|
103
|
-
synapse_recall:
|
|
104
|
-
function: "FTS5 語義召回 — 搜尋 runes + sigils,按 confidence × recency 排序"
|
|
105
|
-
use_when: "開始新任務時查詢相關歷史知識;「之前有沒有類似的 fix?」「這個模組有沒有已知風險?」"
|
|
106
|
-
params: "q(搜尋詞)"
|
|
107
|
-
synapse_sigils:
|
|
108
|
-
function: "瀏覽/搜尋所有 Sigil 概念節點"
|
|
109
|
-
use_when: "理解系統的高層概念地圖;「payment 相關的概念有哪些?」;expand=true 取完整 symbol 摘要"
|
|
110
|
-
params: "query(可選 FTS5 搜尋), expand(true=附帶 symbol 摘要)"
|
|
111
|
-
|
|
112
|
-
# ─── 對話中主動觸發 ───
|
|
113
|
-
conversation_triggers:
|
|
114
|
-
inscribe:
|
|
115
|
-
- trigger: "Task Audit 發現任務定義與代碼現實有 dissociation"
|
|
116
|
-
action: "inscribe type=risk — 標記代碼中的隱藏約束,防止未來 agent 踩坑"
|
|
117
|
-
- trigger: "Role Assignment 時發現某模組的職責邊界不明確"
|
|
118
|
-
action: "inscribe type=insight — 記錄模組職責判斷依據"
|
|
119
|
-
forge:
|
|
120
|
-
- trigger: "審計多個任務時識別出跨任務的共通架構概念"
|
|
121
|
-
action: "forge Sigil — 建立概念節點幫助未來的 task design"
|
|
122
|
-
verify:
|
|
123
|
-
- trigger: "審計時讀到之前 agent 寫的 rune,能判斷其是否準確"
|
|
124
|
-
action: "verify — 確認或否決,維護認知層品質"
|
|
125
|
-
recall:
|
|
126
|
-
- trigger: "開始 Task Audit 前"
|
|
127
|
-
action: "recall 查詢相關 scope_paths 的歷史 rune,帶著認知做審計"
|
|
128
|
-
|
|
129
|
-
# ─── Amelia 職責對應的 Synapse 用法 ───
|
|
81
|
+
# ─── Amelia 職責對應的 LSP 用法 ───
|
|
130
82
|
amelia_use_cases:
|
|
131
83
|
diagnosis:
|
|
132
84
|
what: "Bug 調查 / 問題定位"
|
|
133
|
-
primary: "
|
|
85
|
+
primary: "kenaz_lsp_callers(可疑 symbol) + kenaz_lsp_references(可疑 symbol)"
|
|
134
86
|
flow:
|
|
135
87
|
- "1. 從 bug 描述提取可疑 symbol name(精確函數/類名,不是自然語言描述)"
|
|
136
|
-
- "2.
|
|
88
|
+
- "2. kenaz_lsp_callers(symbol) → 誰呼叫它;.failure/ 與 kenaz learn list → 歷史坑"
|
|
137
89
|
- "3. 如果 LSP 空 → Grep(symbol_name) 精確搜尋"
|
|
138
90
|
- "4. 定位根因後 → fix_delegation 委派 Ansuz"
|
|
139
91
|
anti_pattern:
|
|
140
92
|
- "❌ 不用自然語言做 LSP 查詢('PTY terminal mobile touch close' 不是 symbol name)— 先 Grep 取得符號"
|
|
141
93
|
- "❌ 不連續做 3 次空搜尋 — 第一次空就判斷原因並 fallback"
|
|
142
|
-
- "❌ 不跳過
|
|
94
|
+
- "❌ 不跳過 .failure/ 檢查 — 歷史坑優先"
|
|
143
95
|
task_audit:
|
|
144
96
|
what: "驗證 Ansuz 拆出的任務品質"
|
|
145
|
-
primary: "kenaz_lsp_callers + kenaz_lsp_references
|
|
97
|
+
primary: "kenaz_lsp_callers + kenaz_lsp_references(任務核心 symbol) → 驗 scope/dependency/risk"
|
|
146
98
|
how:
|
|
147
99
|
- "驗 scope: callers / references 所在檔案是否都在 scope_paths 內"
|
|
148
100
|
- "驗 dependency: 跨文件 caller/callee 關係是否在 dependencies 中"
|
|
149
|
-
- "驗 known_risks:
|
|
150
|
-
- "cortex_search → 查其他專案可複用實現"
|
|
101
|
+
- "驗 known_risks: .failure/ 與 kenaz learn list 的相關條目是否已注入 technical_notes"
|
|
151
102
|
fallback: "kenaz_lsp_* 不可用 → Grep + Read"
|
|
152
103
|
verification:
|
|
153
104
|
what: "驗證 agent 執行結果"
|
|
@@ -155,21 +106,19 @@ synapse:
|
|
|
155
106
|
- "git diff --stat → 確認 agent 實際改了哪些檔案"
|
|
156
107
|
- "對每個改動 symbol → kenaz_lsp_callers(symbol) → 是否有漏改的影響"
|
|
157
108
|
dispatch_prep:
|
|
158
|
-
what: "dispatch 前用
|
|
159
|
-
primary: "
|
|
109
|
+
what: "dispatch 前用 LSP 收集 context 注入 prompt"
|
|
110
|
+
primary: "kenaz_lsp_callers + kenaz_lsp_references(任務核心 symbol)"
|
|
160
111
|
inject:
|
|
161
|
-
- "
|
|
112
|
+
- ".failure/ 與 kenaz learn list 的相關條目 → prompt 的「已知風險」區塊"
|
|
162
113
|
- "callers / references → prompt 的「相關呼叫處」區塊"
|
|
163
114
|
fallback:
|
|
164
|
-
- "cortex_recall → 查跨專案歷史知識"
|
|
165
115
|
- "Grep/Read → 手動收集"
|
|
166
116
|
architecture_analysis:
|
|
167
117
|
what: "架構評估(耦合度、熱點、健康度)"
|
|
168
118
|
how:
|
|
169
119
|
- "Grep 引用數 / kenaz_lsp_callers → 估計耦合與熱點"
|
|
170
|
-
- "cortex_recall → 跨專案歷史知識、概念在哪些專案出現過"
|
|
171
120
|
|
|
172
|
-
fallback: "首次
|
|
121
|
+
fallback: "首次 LSP 呼叫失敗 → 該 session 全程降級 Grep/Glob,不重試不阻塞"
|
|
173
122
|
|
|
174
123
|
# ═══════════════════════════════════════
|
|
175
124
|
# 核心詞彙
|
|
@@ -24,19 +24,12 @@ session_init:
|
|
|
24
24
|
source: "phase-gate enter(若有)或 session.js 注入的 episodic_memory 欄位"
|
|
25
25
|
content: "summary + lesson only(摘要版)"
|
|
26
26
|
rule: "若已有注入內容 → 直接使用,不需再呼叫 hippocampus"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
projectPath: "D:/Projects/KenazAI"
|
|
27
|
+
layer_2_history:
|
|
28
|
+
source: "kenaz_task_get / .kenaz/tasks/ / git log — 歷史任務與決策過程"
|
|
30
29
|
when_to_use:
|
|
31
30
|
- "session 開始時沒有自動注入的 episodic_memory"
|
|
32
|
-
- "
|
|
33
|
-
|
|
34
|
-
how_to_call:
|
|
35
|
-
recent: "hippocampus_episode_recall(projectPath='D:/Projects/KenazAI', limit=3)"
|
|
36
|
-
by_task: "hippocampus_episode_recall(projectPath='D:/Projects/KenazAI', task_id='TASK_XXX')"
|
|
37
|
-
by_query: "hippocampus_episode_recall(projectPath='D:/Projects/KenazAI', query='keyword')"
|
|
38
|
-
projectPath_rule: "必須帶 projectPath='D:/Projects/KenazAI',不可省略"
|
|
39
|
-
rule: "不主動回憶 = 裸奔。有 episodic_memory 注入就讀,沒有就主動 recall"
|
|
31
|
+
- "任務與某個已知任務高度相關,需追蹤決策過程"
|
|
32
|
+
rule: "有注入內容就讀,沒有就查任務檔與 git log"
|
|
40
33
|
|
|
41
34
|
triggers:
|
|
42
35
|
task_received: "用戶 給任務 → 分析依賴結構 → dispatch"
|
|
@@ -128,21 +121,19 @@ dispatch:
|
|
|
128
121
|
|
|
129
122
|
# ─── Synapse Context 收集(dispatch 前準備) ───
|
|
130
123
|
context_collection:
|
|
131
|
-
description: "dispatch 前用
|
|
124
|
+
description: "dispatch 前用 LSP 收集代碼上下文,提升 prompt 品質"
|
|
132
125
|
when: "每次 dispatch 前(checklist 之前的準備階段)"
|
|
133
|
-
primary: "
|
|
126
|
+
primary: "kenaz_lsp_callers + kenaz_lsp_references(任務核心 symbol)"
|
|
134
127
|
inject_into_prompt:
|
|
135
|
-
- "
|
|
128
|
+
- ".failure/ 與 kenaz learn list 的相關條目 → 注入 prompt 的 '已知風險' 區塊"
|
|
136
129
|
- "callers / references → 注入 prompt 的 '相關呼叫處必須一起改' 區塊"
|
|
137
130
|
empty_result_protocol:
|
|
138
|
-
when: "
|
|
131
|
+
when: "callers 回空結果(新功能/新專案/未知領域)"
|
|
139
132
|
actions:
|
|
140
|
-
- "
|
|
141
|
-
- "
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
output: "recall/LSP 結果(或 Cortex 跨專案 context)注入 dispatch prompt,讓 agent 帶著認知開工"
|
|
145
|
-
fallback: "Synapse + Cortex 都不可用 → 降級用 Grep/Read 手動收集,不阻塞 dispatch"
|
|
133
|
+
- "Grep 類似實現,注入 prompt 作為參考"
|
|
134
|
+
- "在 prompt 中標註:'此任務為新功能,無本地 LSP 數據。'"
|
|
135
|
+
output: "LSP 結果注入 dispatch prompt,讓 agent 帶著上下文開工"
|
|
136
|
+
fallback: "LSP 不可用 → 降級用 Grep/Read 手動收集,不阻塞 dispatch"
|
|
146
137
|
|
|
147
138
|
# ─── 強制 Checklist(每次 dispatch 必須走完) ───
|
|
148
139
|
# 這不是建議,是 hard gate — 跳過任何一步 = 流程失敗
|