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.
Files changed (131) hide show
  1. package/core/.claude/skills/code_reviewer/SKILL.md +0 -1
  2. package/core/.claude/skills/code_reviewer/patterns.yaml +0 -8
  3. package/core/.claude/skills/dev_agent/SKILL.md +3 -6
  4. package/core/.claude/skills/heimdall/SKILL.md +5 -6
  5. package/core/.claude/skills/huginn/SKILL.md +11 -38
  6. package/core/.collaboration/core/task-2288-followups.test.js +2 -37
  7. package/core/.collaboration/core/task-2421-replica.test.js +229 -0
  8. package/core/.collaboration/core/task-api.js +223 -230
  9. package/core/.collaboration/core/task-api.test.js +1 -138
  10. package/core/.collaboration/core/task-replica.js +189 -0
  11. package/core/.formation/.merge-lock +1 -0
  12. package/core/.formation/bifrost/codex-doctor.js +12 -2
  13. package/core/.formation/bifrost/codex-doctor.test.js +15 -0
  14. package/core/.formation/bifrost/launch.js +2 -2
  15. package/core/.formation/bifrost/launch.test.js +2 -2
  16. package/core/.formation/bifrost/setup-codex.js +84 -16
  17. package/core/.formation/bifrost/shared/ansuz-boot-policy.js +3 -3
  18. package/core/.formation/bifrost/shared/codex-injection.js +3 -17
  19. package/core/.formation/bifrost/shared/consolidate.js +1 -51
  20. package/core/.formation/bifrost/sync.js +4 -5
  21. package/core/.formation/tools/__tests__/subagent-bifrost-guard.test.js +1 -1
  22. package/core/.formation/tools/dispatch.js +2 -2
  23. package/core/.formation/tools/kenaz-stats.js +1 -1
  24. package/core/.formation/tools/mcp-allowlist.test.js +5 -3
  25. package/core/.formation/tools/post-complete/bounded-http.js +1 -40
  26. package/core/.formation/tools/post-complete/bounded-http.test.js +2 -89
  27. package/core/.formation/tools/post-complete/cognitive.js +2 -119
  28. package/core/.formation/tools/post-complete/task2420.test.js +129 -0
  29. package/core/.formation/tools/post-complete/testing.js +3 -21
  30. package/core/.formation/tools/post-complete.js +131 -436
  31. package/core/.formation/tools/post-complete.test.js +0 -135
  32. package/core/.formation/tools/route-audit.test.js +8 -20
  33. package/core/.kenaz/specialist/memory_guard_fired.json +1 -1
  34. package/core/.kenaz/specialist/memory_guard_trigger_cache.json +1 -1
  35. package/core/.rule/INDEX.yaml +3 -3
  36. package/core/.rule/general/ddx-synapse-stack.yaml +11 -11
  37. package/core/.rule/general/specialist-identity-contract.yaml +5 -5
  38. package/core/.rule/general/synapse-code-intelligence.yaml +25 -111
  39. package/core/.rule/general/worktree-isolation.yaml +2 -2
  40. package/core/.rule/pipeline/task-execution.yaml +6 -9
  41. package/core/.specialist/Amelia/README.md +5 -5
  42. package/core/.specialist/Amelia/capability.yaml +10 -18
  43. package/core/.specialist/Amelia/knowledge.yaml +15 -66
  44. package/core/.specialist/Amelia/workflow.yaml +12 -21
  45. package/core/.specialist/Ansuz/capability.yaml +12 -87
  46. package/core/.specialist/Ansuz/concepts/autonomous_agenda.yaml +1 -1
  47. package/core/.specialist/Ansuz/concepts/autonomy_contract.yaml +2 -3
  48. package/core/.specialist/Ansuz/concepts/capability_pointers.yaml +1 -3
  49. package/core/.specialist/Ansuz/concepts/cognitive_fluency_contract.yaml +8 -21
  50. package/core/.specialist/Ansuz/concepts/cognitive_systems_overview.yaml +0 -4
  51. package/core/.specialist/Ansuz/concepts/cognitive_systems_turn_context.yaml +1 -1
  52. package/core/.specialist/Ansuz/concepts/completion_tracking.yaml +0 -1
  53. package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +0 -3
  54. package/core/.specialist/Ansuz/concepts/evolvable_guardrails.yaml +3 -3
  55. package/core/.specialist/Ansuz/concepts/fatigue_handoff.yaml +1 -7
  56. package/core/.specialist/Ansuz/concepts/guardrails_immutable.yaml +3 -4
  57. package/core/.specialist/Ansuz/concepts/identity.yaml +1 -2
  58. package/core/.specialist/Ansuz/concepts/phase9_verification.yaml +0 -1
  59. package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +3 -4
  60. package/core/.specialist/Ansuz/core.yaml +3 -6
  61. package/core/.specialist/Ansuz/elixir.yaml +6 -6
  62. package/core/.specialist/Ansuz/exo_cortex_tools.yaml +5 -9
  63. package/core/.specialist/Ansuz/guards/blind_spot_guards.yaml +2 -2
  64. package/core/.specialist/Ansuz/guards/lesson_guards.yaml +6 -19
  65. package/core/.specialist/Ansuz/identity_contract.yaml +4 -4
  66. package/core/.specialist/Ansuz/knowledge.yaml +13 -40
  67. package/core/.specialist/Ansuz/modules/ddx.yaml +2 -2
  68. package/core/.specialist/Ansuz/modules/prophecy.yaml +19 -19
  69. package/core/.specialist/Ansuz/modules/pulse_empty.yaml +6 -17
  70. package/core/.specialist/Ansuz/tools/ansuz-handoff-snapshot.js +3 -102
  71. package/core/.specialist/Ansuz/tools/ansuz-sdk-runner.js +2 -44
  72. package/core/.specialist/Ansuz/workflow.yaml +32 -76
  73. package/core/.specialist/Forseti/core.yaml +2 -7
  74. package/core/.specialist/Forseti/rule.yaml +1 -1
  75. package/core/.specialist/Heimdall/SKILL.md +2 -3
  76. package/core/.specialist/Heimdall/capability.yaml +22 -45
  77. package/core/.specialist/Heimdall/core.yaml +24 -126
  78. package/core/.specialist/Heimdall/principles.yaml +8 -11
  79. package/core/.specialist/Heimdall/rule.yaml +2 -2
  80. package/core/.specialist/Huginn/capability.yaml +31 -52
  81. package/core/.specialist/Huginn/core.yaml +43 -123
  82. package/core/.specialist/Huginn/principles.yaml +5 -5
  83. package/core/.specialist/Huginn/rule.yaml +3 -9
  84. package/core/.specialist/REFLECTION_TO_CONTROL.md +3 -4
  85. package/core/.specialist/shared/guard_schema.json +1 -1
  86. package/core/.specialist/shared/principles.yaml +6 -6
  87. package/core/.specialist/tools/__tests__/rea-detect.test.js +10 -0
  88. package/core/.specialist/tools/phase-gate.js +10 -230
  89. package/core/.specialist/tools/phase-gate.test.js +2 -2
  90. package/core/.specialist/tools/prompt-files.test.js +1 -1
  91. package/core/.specialist/tools/rea-detect.js +6 -2
  92. package/core/.specialist/tools/session.js +2 -89
  93. package/core/.synapse/memory-shared.json.sync +1 -0
  94. package/core/.system/memory/README.md +3 -0
  95. package/core/CLAUDE.md +6 -7
  96. package/core/KENAZ_CORE_VERSION +1 -1
  97. package/core/dev/plans/CLI_FIRST_INSTALL_FLOW.md +75 -83
  98. package/core/dev/specs/peer/CODEX_MANAGED_DAEMON.md +54 -0
  99. package/core/dev/specs/peer/setup-codex-hooks.test.js +38 -0
  100. package/core/dev/spikes/task2145-evidence-20261004/backend-log-excerpt.txt +56 -0
  101. package/core/dev/spikes/task2145-evidence-20261004/graph.shadow +0 -0
  102. package/core/dev/spikes/task2145-evidence-20261004/graph.wal +0 -0
  103. package/core/dev/spikes/task2145-evidence-20261004/graph_corrupt_suspect.marker +1 -0
  104. package/core/plugins/kenaz/INVENTORY.md +1 -1
  105. package/core/plugins/kenaz/scripts/kenaz.test.js +70 -1
  106. package/core/plugins/kenaz/scripts/ygg.js +45 -4
  107. package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +0 -1
  108. package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +0 -8
  109. package/core/plugins/kenaz/skills/dev_agent/SKILL.md +3 -6
  110. package/lib/cli.js +17 -9
  111. package/lib/cli.test.js +10 -0
  112. package/lib/dashboard.test.js +3 -3
  113. package/package.json +6 -6
  114. package/vendor/install-kenaz-cli.js +167 -16
  115. package/core/.claude/hooks/handoff-snapshot-on-decision.js +0 -188
  116. package/core/.claude/skills/synapse_maintain/SKILL.md +0 -84
  117. package/core/.collaboration/core/task-2264-single-after-capture.test.js +0 -61
  118. package/core/.formation/tools/alaya-gate.js +0 -198
  119. package/core/.formation/tools/post-complete/health.js +0 -464
  120. package/core/.formation/tools/post-complete/task2038.test.js +0 -246
  121. package/core/.formation/tools/post-complete/task2341.test.js +0 -74
  122. package/core/.rule/general/cortex-tools.yaml +0 -181
  123. package/core/.rule/general/memory-language.yaml +0 -67
  124. package/core/.rule/general/memory-source-priority.yaml +0 -207
  125. package/core/.rule/general/synapse-cognitive-fusion.yaml +0 -301
  126. package/core/.specialist/Ansuz/concepts/cognitive_systems_hippocampus.yaml +0 -14
  127. package/core/.specialist/Ansuz/concepts/write_verification.yaml +0 -26
  128. package/core/.specialist/Ansuz/modules/recall.yaml +0 -45
  129. package/core/.specialist/tools/MEMORY_RECALL_TRIGGERS.md +0 -156
  130. package/core/.specialist/tools/context-injection.js +0 -395
  131. package/core/dev/scripts/probe/hippocampus-concurrency.js +0 -247
@@ -149,13 +149,11 @@ agent_types:
149
149
  # ═══════════════════════════════════════
150
150
  # §synapse
151
151
  synapse:
152
- overview: "Rust-native 記憶系統 — SQLite FTS5(全文)+ ONNX(語義嵌入);代碼導航改用 kenaz_lsp_* 與 Grep/Glob"
153
- data_path: "<project>/.synapse/db/"
152
+ overview: "代碼導航用 kenaz_lsp_* 與 Grep/Glob(記憶系統 synapse_*/cortex_* 已於 TASK_2411 移除;教訓用 `kenaz learn add` 或 native memory 檔)"
154
153
 
155
154
  # ─── Ansuz 各 Phase 的 Synapse 應用 ───
156
155
  phase_usage:
157
- phase_0_init: "synapse_status → 確認可用性"
158
- phase_2_research: "Grep/Glob → 搜尋相關代碼;kenaz_lsp_callers → 理解調用鏈;synapse_recall → 歷史 rune"
156
+ phase_2_research: "Grep/Glob → 搜尋相關代碼;kenaz_lsp_callers → 理解調用鏈"
159
157
  phase_3_task_design: "kenaz_lsp_callers / kenaz_lsp_references → 確認 scope_paths 涵蓋所有受影響的 symbol"
160
158
  phase_9_verify: "git diff --stat → 確認改動範圍;kenaz_lsp_callers → 驗證無 regression"
161
159
 
@@ -165,49 +163,25 @@ synapse:
165
163
  - "「誰呼叫它?」「改了會影響哪裡?」→ kenaz_lsp_callers / kenaz_lsp_references"
166
164
  - "「它定義在哪?」→ kenaz_lsp_definition"
167
165
  - "「最近改了什麼?」→ git diff / git log"
168
- - "「歷史知識?」→ synapse_recall"
169
- - "精確字串/正則匹配 → Grep(不用 Synapse)"
166
+ - "「歷史知識?」→ native memory 檔 / `kenaz learn list`"
167
+ - "精確字串/正則匹配 → Grep"
170
168
 
171
- fallback: "首次 Synapse 呼叫失敗 → 該 session 全程降級 Grep/Glob,不重試不阻塞"
169
+ fallback: "首次 kenaz_lsp_* 呼叫失敗 → 該 session 全程降級 Grep/Glob,不重試不阻塞"
172
170
 
173
171
  # ═══════════════════════════════════════
174
- # Cortex 跨專案智能系統
172
+ # 代碼導航工具使用指引(dispatch 用)
175
173
  # ═══════════════════════════════════════
176
- # §cortex
177
- cortex:
178
- overview: "跨專案知識圖譜 — Global Memory(SQLite FTS5)"
179
- data_path:
180
- global_memory: "~/.kenaz/cortex/global_memory.db"
181
-
182
- # ─── Ansuz 各 Phase 的 Cortex 應用 ───
183
- phase_usage:
184
- phase_0_init: "cortex_status → 跟 synapse_status 一起偵測跨專案數據可用性"
185
- phase_2_research: "cortex_recall → 查跨專案歷史知識;cortex_search → 找其他專案的參考實現"
186
- phase_3_task_design: "cortex_recall → 判斷是否有可複用的跨專案實現;cortex_search → 架構決策參考"
187
- phase_9_verify: "cortex_recall → 驗證修復方案是否與其他專案的歷史經驗一致"
188
-
189
- # ─── 選擇指南 ───
190
- decision_guide:
191
- - "「其他專案怎麼處理這個問題?」→ cortex_search(exclude_current=true)"
192
- - "「這個概念在哪些專案出現?跨專案有什麼歷史經驗?」→ cortex_recall"
193
- - "「單一專案的符號關係?」→ kenaz_lsp_callers / kenaz_lsp_references"
194
- - "當前專案內搜尋 → 用 Synapse,不用 Cortex"
195
- # cortex_relate / cortex_overview / cortex_cypher 已隨 meta_graph 退役(TASK_2048 移除,TASK_2051 清理)
196
-
197
- # ═══════════════════════════════════════
198
- # Synapse 工具使用指引(dispatch 用)
199
- # ═══════════════════════════════════════
200
- # 目的:確保 Ansuz dispatch 的 sub-agent 知道 Synapse-first 原則
174
+ # 目的:確保 Ansuz dispatch 的 sub-agent 知道 LSP/Grep 導航原則
201
175
  # 此 section 精簡摘要 .rule/general/synapse-code-intelligence.yaml (SYN-001~007)
202
176
  # 的關鍵決策點,不重複全文
203
177
  # §synapse_tools
204
178
  synapse_tools:
205
- principle: "Synapse First — 理解代碼時優先用 Synapse,Grep 僅用於精確字串/正則/枚舉"
179
+ principle: "理解代碼時優先用 kenaz_lsp_*,Grep 用於精確字串/正則/枚舉"
206
180
 
207
181
  # ─── projectPath 強制規則(全局,非僅子專案) ───
208
182
  project_path:
209
183
  rule: |
210
- ⚠️ 所有 Synapse / Cortex MCP 呼叫必須帶 projectPath 參數。
184
+ ⚠️ 所有 kenaz_lsp_* MCP 呼叫必須帶 projectPath 參數。
211
185
  Dashboard active project 可能指向其他專案,default project 不可靠。
212
186
  Phase 0 確認 projectPath 後,後續每次呼叫都帶上。
213
187
  resolve: |
@@ -222,10 +196,9 @@ synapse_tools:
222
196
  call_chain: "kenaz_lsp_callers(symbol, depth) — 「誰呼叫了它?」"
223
197
  blast_radius: "kenaz_lsp_references(symbol) — 「改了會影響哪裡?」"
224
198
  recent_changes: "git diff / git log — 「最近改了什麼?」"
225
- history_knowledge: "synapse_recall — 查詢歷史 rune/sigil 認知知識"
226
- cross_project: "cortex_search / cortex_recall — 跨專案搜尋(見 cortex section)"
227
- exact_string: "Grep — 精確字串/正則匹配(不用 Synapse)"
228
- file_path: "Glob/Read — 已知文件名或路徑(不用 Synapse)"
199
+ history_knowledge: "native memory 檔 / `kenaz learn list`"
200
+ exact_string: "Grep — 精確字串/正則匹配"
201
+ file_path: "Glob/Read — 已知文件名或路徑"
229
202
 
230
203
  # ─── Fallback ───
231
204
  fallback_cascade:
@@ -243,7 +216,7 @@ synapse_tools:
243
216
  # ─── 子專案場景(projectPath 的特殊情況) ───
244
217
  sub_project:
245
218
  description: |
246
- 子專案的 Synapse 索引獨立於 Core。projectPath 解析見上方 project_path.resolve。
219
+ 子專案的 LSP 索引獨立於 Core。projectPath 解析見上方 project_path.resolve。
247
220
  note: "projectPath 是全局強制規則(見 project_path section),子專案只是路徑來源不同"
248
221
 
249
222
  # ─── 禁止行為(速記) ───
@@ -39,8 +39,8 @@ prophecy_handoff:
39
39
  rule: |
40
40
  DDx 識別出 2+ 方案後,不可直接靠推斷選方案。
41
41
  必須接入預言比較(prophecy.yaml):
42
- - Phase 2 已有 callers/recall 結果 → 直接引用數據
43
- - Phase 2 無 callers/recall 結果 → 補跑:對每個方案目標 symbol 各跑 kenaz_lsp_callers + synapse_recall
42
+ - Phase 2 已有 callers 結果 → 直接引用數據
43
+ - Phase 2 無 callers 結果 → 補跑:對每個方案目標 symbol 各跑 kenaz_lsp_callers + kenaz_lsp_references
44
44
  decision_flow: |
45
45
  DDx 列出方案 → 預言比較量化風險 → 結構數據選方案 → 任務設計用選中方案的 scope
46
46
  (鑑別回答「有哪些選擇」→ 預言回答「選哪個」)
@@ -1,5 +1,5 @@
1
1
  name: Prophecy Module — Prophetic Comparison Protocol
2
- description: "多方案時,對每個方案的目標 symbol 各跑 kenaz_lsp_callers + synapse_recall,用結構數據選方案 — 不靠直覺"
2
+ description: "多方案時,對每個方案的目標 symbol 各跑 kenaz_lsp_callers + kenaz_lsp_references,用結構數據選方案 — 不靠直覺"
3
3
  source: "capability.yaml prophetic_comparison (L129-179) + workflow.yaml Phase 2/3 (L308-374)"
4
4
 
5
5
  # ═══════════════════════════════════════
@@ -17,12 +17,12 @@ when:
17
17
  phase_2_trigger: |
18
18
  Phase 2 調研過程中偵測到以下任一信號:
19
19
  - 需求描述包含選擇(「A 或 B」「可以改 X 也可以改 Y」)
20
- - recall/callers 結果顯示多個可行切入點(如 callers 分佈在不同模組)
20
+ - callers 結果顯示多個可行切入點(如 callers 分佈在不同模組)
21
21
  - DDx 產出 2+ 競爭方案(詳見 ddx.yaml)
22
22
  - Ansuz 自身分析出 2+ 路徑
23
23
  phase_2_actions:
24
- - "對每個方案的目標 symbol 各跑 kenaz_lsp_callers + synapse_recall(可並行)"
25
- - "收集 caller 數 / 跨模組數 / known_risks"
24
+ - "對每個方案的目標 symbol 各跑 kenaz_lsp_callers + kenaz_lsp_references(可並行)"
25
+ - "收集 caller 數 / 跨模組數 / .failure 風險"
26
26
  - "填入 🔮 預言比較 cli_format 表格"
27
27
  - "比較結果直接注入 Phase 3 的 scope_paths 和 complexity 決策"
28
28
  phase_2_fallback: "kenaz_lsp_callers 不可用 → 用 Grep 找 symbol 引用數替代"
@@ -33,13 +33,13 @@ phase_2_fallback: "kenaz_lsp_callers 不可用 → 用 Grep 找 symbol 引用數
33
33
  phase_3_integration:
34
34
  rule: |
35
35
  DDx 識別出 2+ 方案後,必須檢查 Phase 2 是否已有預言比較結果:
36
- - 有 → 直接引用 callers/recall 數據做選擇
37
- - 無 → 此刻補跑:對每個方案目標 symbol 各跑 kenaz_lsp_callers + synapse_recall,填入比較表格
36
+ - 有 → 直接引用 callers 數據做選擇
37
+ - 無 → 此刻補跑:對每個方案目標 symbol 各跑 kenaz_lsp_callers + kenaz_lsp_references,填入比較表格
38
38
  scope_derivation: |
39
- 選中方案的 callers + recall 結果直接決定:
40
- - scope_paths ← callers/references 涉及的文件路徑(HIGH-risk rune 所在檔案優先)
39
+ 選中方案的 callers 結果直接決定:
40
+ - scope_paths ← callers/references 涉及的文件路徑
41
41
  - complexity ← caller 數 + 跨模組數
42
- - technical_notes ← recall 的 known_risks + 被排除方案的理由(「為什麼不選 B」)
42
+ - technical_notes ← .failure 風險 + 被排除方案的理由(「為什麼不選 B」)
43
43
 
44
44
  # ═══════════════════════════════════════
45
45
  # Protocol
@@ -48,20 +48,20 @@ protocol:
48
48
  step_1_detect: |
49
49
  偵測多方案情境(任何以下信號):
50
50
  - Phase 1 需求本身包含「或」「還是」等選擇詞
51
- - Phase 2 recall/callers 結果顯示多個可行切入點
51
+ - Phase 2 callers 結果顯示多個可行切入點
52
52
  - DDx 識別出 2+ 競爭方案
53
53
  - Ansuz 自身分析出 2+ 路徑
54
54
  step_2_impact: |
55
55
  對每個方案的核心 symbol 各查一次影響範圍:
56
- - 方案 A → kenaz_lsp_callers(symbolA) + synapse_recall(symbolA) → 取得 callers 數與已知 rune
57
- - 方案 B → kenaz_lsp_callers(symbolB) + synapse_recall(symbolB) → 同上
56
+ - 方案 A → kenaz_lsp_callers(symbolA) + kenaz_lsp_references(symbolA) → 取得 callers / references 數
57
+ - 方案 B → kenaz_lsp_callers(symbolB) + kenaz_lsp_references(symbolB) → 同上
58
58
  - 可並行呼叫(無依賴)
59
59
  - kenaz_lsp_callers 不可用時 fallback: Grep 引用數 symbolA vs symbolB
60
60
  step_3_compare: |
61
61
  結構化對比五個維度:
62
62
  1. caller 數 — 爆炸半徑(越小越安全)
63
63
  2. 跨模組數 — callers 分佈的模組數(越少越乾淨)
64
- 3. known_risks — 歷史 rune 風險數(越少越安心)
64
+ 3. .failure 風險 — 已知風險數(越少越安心)
65
65
  4. 風險等級(LOW > MEDIUM > HIGH,由前三項綜合)
66
66
  step_4_decide: |
67
67
  選擇邏輯:
@@ -72,17 +72,17 @@ protocol:
72
72
  rules:
73
73
  - "✅ 靈活觸發 — 不限於 Phase 2/3,任何階段偵測到多方案就啟動"
74
74
  - "✅ 最少 2 個方案,最多 5 個(超過先用 DDx 粗篩再比較)"
75
- - "✅ callers/recall 結果直接驅動 Phase 3 的 scope_paths 和 complexity"
75
+ - "✅ callers 結果直接驅動 Phase 3 的 scope_paths 和 complexity"
76
76
  - "❌ 禁止只查一個方案就決定 — 至少 2 個對照"
77
- - "❌ 禁止推斷式比較 — 「我覺得 A 比 B 簡單」不算,必須有 callers/recall 數據"
77
+ - "❌ 禁止推斷式比較 — 「我覺得 A 比 B 簡單」不算,必須有 callers 數據"
78
78
 
79
79
  cli_format: |
80
80
  🔮 預言比較
81
81
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
82
  | 方案 | 目標 Symbol | 爆炸半徑 | 跨模組 | 歷史風險 | 風險等級 |
83
83
  |------|------------|---------|--------|---------|---------|
84
- | A | {symbol} | {N} | {N} | {N} runes | {level} |
85
- | B | {symbol} | {N} | {N} | {N} runes | {level} |
84
+ | A | {symbol} | {N} | {N} | {N} risks | {level} |
85
+ | B | {symbol} | {N} | {N} | {N} risks | {level} |
86
86
 
87
87
  結論: 方案 {X} — {一句話理由}
88
88
  {如 trade-off 明顯 → 列出讓用戶決定}
@@ -90,6 +90,6 @@ cli_format: |
90
90
 
91
91
  example: |
92
92
  需求:「修復 data flow 斷裂,可以改 source 端或改 sink 端」
93
- → callers+recall(source_symbol) → 8 callers, 跨 1 模組, 0 risks
94
- → callers+recall(sink_symbol) → 22 callers, 跨 3 模組, 2 risks
93
+ → callers(source_symbol) → 8 callers, 跨 1 模組, 0 risks
94
+ → callers(sink_symbol) → 22 callers, 跨 3 模組, 2 risks
95
95
  → 結論: 改 source 端 — 爆炸半徑小 3 倍,零歷史風險
@@ -1,20 +1,18 @@
1
1
  name: Pulse Empty Protocol
2
- description: "synapse_recall 與 kenaz_lsp_callers 回空時的替代策略 — 新功能/新專案/未知領域"
3
- source: "workflow.yaml Phase 2 pulse_empty_protocol (L289-307)"
2
+ description: "kenaz_lsp_callers 回空時的替代策略 — 新功能/新專案/未知領域"
3
+ source: "workflow.yaml Phase 2 empty_result_protocol"
4
4
 
5
5
  # ═══════════════════════════════════════
6
6
  # 觸發條件
7
7
  # ═══════════════════════════════════════
8
8
  trigger:
9
- when: "synapse_recall 無 rune 且 kenaz_lsp_callers 無呼叫者(新功能、新專案、未知領域)"
10
- principle: "本地無資料 → 跨神經網路查詢(Cortex)→ 手動探索 → 保守設計"
9
+ when: "kenaz_lsp_callers 無呼叫者(新功能、新專案、未知領域)"
10
+ principle: "本地無資料 → 手動探索 → 保守設計"
11
11
 
12
12
  # ═══════════════════════════════════════
13
13
  # Phase 2 替代行動
14
14
  # ═══════════════════════════════════════
15
15
  phase_2_actions:
16
- - "cortex_search({ query: '<功能描述>' }) — 跨專案語義搜尋:其他專案有沒有類似功能的實現?"
17
- - "cortex_recall({ query: '<領域關鍵詞>' }) — 跨專案認知回憶:其他專案在同領域踩過什麼坑?有什麼架構決策?這個概念在哪些專案出現過?"
18
16
  - "Grep/Read — 手動探索相關目錄結構和現有 pattern"
19
17
  - "查 .failure/ — 類似功能有沒有已知失敗模式"
20
18
 
@@ -22,15 +20,6 @@ phase_2_actions:
22
20
  # Phase 3 設計補充
23
21
  # ═══════════════════════════════════════
24
22
  phase_3_actions:
25
- - "scope_paths 靠目錄結構 + 現有 pattern + Cortex 建議推斷(標記為 '未經 LSP 驗證')"
23
+ - "scope_paths 靠目錄結構 + 現有 pattern 推斷(標記為 '未經 LSP 驗證')"
26
24
  - "complexity 預設 medium(無數據,保守估計)"
27
- - "technical_notes 必須注入:'此任務為新功能/未知領域,無本地 recall/callers 數據。Cortex 跨專案參考:{cortex 結果摘要}。Agent 需自行探索 codebase 並遵循現有 pattern。'"
28
- - "如果 Cortex 找到其他專案的類似實現 → 在 technical_notes 中附上參考路徑和 pattern"
29
-
30
- # ═══════════════════════════════════════
31
- # 完成後的認知種子(特別重要)
32
- # ═══════════════════════════════════════
33
- post_code_emphasis:
34
- - "synapse_inscribe — 為新功能留下認知種子(這是該領域的第一顆種子)"
35
- - "synapse_forge — 如果新功能涉及 3+ symbols → 建立 Sigil 概念節點"
36
- - "這些種子是未來 agent 在這個領域的起點 — 寧可多寫不可少寫"
25
+ - "technical_notes 必須注入:'此任務為新功能/未知領域,無本地 callers 數據。Agent 需自行探索 codebase 並遵循現有 pattern。'"
@@ -289,103 +289,6 @@ function atomicWriteJson(filePath, obj) {
289
289
  }
290
290
  }
291
291
 
292
- // ─────────────────────────────────────────
293
- // Dashboard HTTP helpers (best-effort — skip gracefully if server not running)
294
- // ─────────────────────────────────────────
295
-
296
- async function callMcpTool(toolName, toolArgs) {
297
- const http = require('http');
298
- const body = JSON.stringify({
299
- jsonrpc: '2.0',
300
- id: 1,
301
- method: 'tools/call',
302
- params: { name: toolName, arguments: toolArgs },
303
- });
304
-
305
- return new Promise((resolve, reject) => {
306
- const req = http.request(
307
- {
308
- hostname: '127.0.0.1',
309
- port: 18080,
310
- path: '/api/mcp',
311
- method: 'POST',
312
- headers: {
313
- 'Content-Type': 'application/json',
314
- 'Content-Length': Buffer.byteLength(body),
315
- },
316
- timeout: 4000,
317
- },
318
- (res) => {
319
- let data = '';
320
- res.on('data', (chunk) => { data += chunk; });
321
- res.on('end', () => {
322
- try {
323
- const parsed = JSON.parse(data);
324
- if (parsed.error) { reject(new Error(parsed.error.message)); return; }
325
- const text = parsed.result?.content?.[0]?.text;
326
- resolve(text ? JSON.parse(text) : parsed.result);
327
- } catch (e) { reject(e); }
328
- });
329
- }
330
- );
331
- req.on('error', reject);
332
- req.on('timeout', () => { req.destroy(); reject(new Error('mcp timeout')); });
333
- req.write(body);
334
- req.end();
335
- });
336
- }
337
-
338
- async function getKeyDecisionsFromSynapse(projectPath, n = 5) {
339
- try {
340
- // Use synapse_recall (project-scoped, honours projectPath) — NOT cortex_recall,
341
- // which is cross-project global and would bleed core/other-project decisions
342
- // into a sub-project's handoff (e.g. KenazAI HOOK_MARKER/TASK_574 into jiayao).
343
- const result = await callMcpTool('synapse_recall', {
344
- query: 'decision risk ash',
345
- type: 'decision',
346
- projectPath,
347
- limit: n,
348
- });
349
- const runes = result?.runes || [];
350
- if (!Array.isArray(runes) || runes.length === 0) return null;
351
- return runes.slice(0, n).map((r) => {
352
- const type = r.type || r.rune_type || 'rune';
353
- const text = r.content || r.body || r.summary || '';
354
- return `[${type}] ${String(text).substring(0, 100)}`;
355
- }).filter(Boolean);
356
- } catch {
357
- return null;
358
- }
359
- }
360
-
361
- async function archiveHandoffToHippocampus(handoff, projectPath) {
362
- try {
363
- const startResult = await callMcpTool('hippocampus_episode_start', {
364
- scope: `handoff:${handoff.session_id}`,
365
- projectPath,
366
- });
367
- const episodeId = startResult?.episode_id;
368
- if (!episodeId) return false;
369
-
370
- await callMcpTool('hippocampus_episode_append', {
371
- episode_id: episodeId,
372
- phase: 'archive',
373
- content: JSON.stringify(handoff, null, 2),
374
- projectPath,
375
- });
376
-
377
- await callMcpTool('hippocampus_episode_close', {
378
- episode_id: episodeId,
379
- summary: `Archived handoff snapshot session=${handoff.session_id} trigger=${handoff.triggered_by}`,
380
- outcome: 'archived',
381
- projectPath,
382
- });
383
- return true;
384
- } catch {
385
- return false;
386
- }
387
- }
388
-
389
292
  // ─────────────────────────────────────────
390
293
  // ISBAR builder
391
294
  // ─────────────────────────────────────────
@@ -560,17 +463,15 @@ async function main() {
560
463
  if (fs.existsSync(handoffPath)) {
561
464
  try {
562
465
  const existing = JSON.parse(fs.readFileSync(handoffPath, 'utf8'));
563
- if (existing.session_id && existing.session_id !== sessionId) {
564
- await archiveHandoffToHippocampus(existing, projectPath);
565
- } else if (existing.session_id === sessionId) {
466
+ if (existing.session_id === sessionId) {
566
467
  priorHistory = Array.isArray(existing.history) ? existing.history.slice(-9) : [];
567
468
  if (existing.generated_at) priorHistory.push(existing.generated_at);
568
469
  }
569
470
  } catch { /* ignore corrupt/missing */ }
570
471
  }
571
472
 
572
- // Pull recent decision/risk runes from this project's Synapse (best-effort; skip if dashboard not running)
573
- const keyDecisions = await getKeyDecisionsFromSynapse(projectPath, 5);
473
+ // Key decisions came from Synapse runes; the memory system was removed in TASK_2411.
474
+ const keyDecisions = null;
574
475
 
575
476
  // Build handoff object
576
477
  const generatedAt = new Date().toISOString();
@@ -838,37 +838,6 @@ async function runBackgroundCognitiveLoop(lastActivityMs = Date.now()) {
838
838
  try {
839
839
  const signalsToAppend = [];
840
840
 
841
- // Step 4c: hippocampus_due_episodes as signal source (TASK_965)
842
- try {
843
- const dueResp = await callMcpTool('hippocampus_due_episodes', { projectPath: ROOT }, MCP_FAST_TIMEOUT_MS);
844
- const dueContent = dueResp?.result?.content || dueResp?.content || [];
845
- const dueText = (Array.isArray(dueContent) ? dueContent : [dueContent])
846
- .map(c => (typeof c === 'string' ? c : c?.text || '')).join('\n');
847
- let dueCount = 0;
848
- try {
849
- const parsed = JSON.parse(dueText);
850
- dueCount = parsed?.due_count ?? (Array.isArray(parsed?.episodes) ? parsed.episodes.length : 0);
851
- } catch { /* non-JSON */ }
852
- if (dueCount > 0) {
853
- signalsToAppend.push({
854
- detected_at: new Date().toISOString(),
855
- source: 'hippocampus',
856
- signal_type: 'due_episodes',
857
- summary: `${dueCount} hippocampus episode(s) due for review`,
858
- symbols: ['hippocampus_review'],
859
- meta: { due_count: dueCount },
860
- });
861
- log(`[BG] Signal: due_episodes — ${dueCount} episode(s) due`);
862
- } else {
863
- // TASK_1095 (I1): source cleared — drop stale ambient entries AND
864
- // evict hippocampus_review from attentionBuffer so Grade 4 routing
865
- // stops re-appending on subsequent cycles.
866
- reconcileSignalSource('due_episodes', false, ['hippocampus_review']);
867
- }
868
- } catch (e) {
869
- log(`[BG] Warning: hippocampus_due_episodes failed (5s timeout): ${e.message}`);
870
- }
871
-
872
841
  // TASK_1095 (Amelia Blocker 4): TTL-based defense in depth for signal types
873
842
  // with no MCP source-check (curiosity_spike, hot_symbol_unaddressed_risk,
874
843
  // efe_weight_shift, heat). 30min > 5min tick interval but < 50min trim horizon.
@@ -953,9 +922,8 @@ function buildThalamusPrompt(msg) {
953
922
  `Suggested action: ${ctx.suggested_action || 'update stale runes'}`,
954
923
  ``,
955
924
  `## Allowed Actions (Level 1 only)`,
956
- `- Update stale runes for fired symbols (synapse_recall → synapse_inscribe if outdated)`,
925
+ `- Review the fired symbols with kenaz_lsp_references / kenaz_lsp_callers`,
957
926
  `- Fix lint issues in fired symbol files`,
958
- `- Inscribe new risk/fix runes for discovered issues`,
959
927
  ``,
960
928
  `## Forbidden Actions`,
961
929
  `- Do NOT create new tasks`,
@@ -964,7 +932,7 @@ function buildThalamusPrompt(msg) {
964
932
  `- Do NOT create pull requests`,
965
933
  `- Do NOT modify files outside the fired symbols' scope`,
966
934
  ``,
967
- `Review fired symbols, update any stale runes, and report findings. Keep it brief.`,
935
+ `Review the fired symbols and report findings. Keep it brief.`,
968
936
  ].join('\n');
969
937
  }
970
938
 
@@ -999,25 +967,15 @@ async function runQuery(prompt, sessionId) {
999
967
  'Bash', 'Edit', 'Glob', 'Grep', 'Read', 'Write',
1000
968
  'ToolSearch', 'TodoWrite', 'WebFetch', 'WebSearch',
1001
969
  'AskUserQuestion',
1002
- 'mcp__kenaz-dashboard__synapse_recall',
1003
970
  'mcp__kenaz-dashboard__kenaz_lsp_callers',
1004
971
  'mcp__kenaz-dashboard__kenaz_lsp_references',
1005
972
  'mcp__kenaz-dashboard__kenaz_lsp_definition',
1006
973
  'mcp__kenaz-dashboard__kenaz_lsp_symbols',
1007
- 'mcp__kenaz-dashboard__synapse_inscribe',
1008
- 'mcp__kenaz-dashboard__synapse_forge',
1009
- 'mcp__kenaz-dashboard__synapse_sigils',
1010
- 'mcp__kenaz-dashboard__hippocampus_episode_start',
1011
- 'mcp__kenaz-dashboard__hippocampus_episode_append',
1012
- 'mcp__kenaz-dashboard__hippocampus_episode_close',
1013
- 'mcp__kenaz-dashboard__hippocampus_episode_recall',
1014
- 'mcp__kenaz-dashboard__hippocampus_episode_link',
1015
974
  'mcp__kenaz-dashboard__kenaz_task_create',
1016
975
  'mcp__kenaz-dashboard__kenaz_task_update',
1017
976
  'mcp__kenaz-dashboard__kenaz_task_list',
1018
977
  'mcp__kenaz-dashboard__kenaz_task_get',
1019
978
  'mcp__kenaz-dashboard__kenaz_task_delete',
1020
- 'mcp__kenaz-dashboard__cortex_recall',
1021
979
  ],
1022
980
  mcpServers: {
1023
981
  'kenaz-dashboard': {