kenaz 0.3.9 → 0.3.11
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/commands/Ansuz.md +12 -16
- package/core/.claude/hooks/memory-guard.js +13 -0
- 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-api.js +2 -218
- package/core/.collaboration/core/task-api.test.js +1 -138
- package/core/.formation/bifrost/launch.js +2 -2
- package/core/.formation/bifrost/launch.test.js +2 -2
- 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 +259 -0
- package/core/.formation/tools/kenaz-stats.test.js +180 -0
- 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/testing.js +3 -21
- package/core/.formation/tools/post-complete.js +2 -428
- package/core/.formation/tools/post-complete.test.js +0 -135
- package/core/.formation/tools/prompt.js +14 -0
- package/core/.formation/tools/route-audit.test.js +8 -20
- 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/RULES.md +6 -0
- 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__/task-2409-lessons.test.js +95 -0
- package/core/.specialist/tools/ansuz-boot-fast.js +1 -0
- package/core/.specialist/tools/lessons.js +234 -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/session.js +2 -89
- 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 +26 -0
- package/core/plugins/kenaz/INVENTORY.md +1 -1
- package/core/plugins/kenaz/commands/Ansuz.md +12 -16
- package/core/plugins/kenaz/scripts/kenaz.test.js +2 -1
- package/core/plugins/kenaz/scripts/ygg.js +2 -0
- 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 +13 -3
- package/package.json +6 -6
- package/core/.claude/hooks/handoff-snapshot-on-decision.js +0 -188
- package/core/.claude/skills/synapse_maintain/SKILL.md +0 -84
- 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
|
@@ -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 — 跳過任何一步 = 流程失敗
|
|
@@ -86,6 +86,12 @@ Frozen since 2026-10-10 (ANSUZ_SLIM_PLAN): no handoff snapshots. The task cards
|
|
|
86
86
|
When the Kenaz app itself blocks or degrades the work, file kenaz_wish_create (bug|feature|question,
|
|
87
87
|
scope kenaz|project, one-line repro + expectation) before working around it.
|
|
88
88
|
|
|
89
|
+
## Lessons (self-improvement on the user's machine)
|
|
90
|
+
Write a lesson automatically (no asking, one line in the report naming it) when the user corrects or repeats an instruction, overrides a decision, or verification catches a failure. `node .specialist/tools/lessons.js add ...` in the core repo; on an npm install `node "${CLAUDE_PLUGIN_ROOT}/hooks/core-resolve.js" .specialist/tools/lessons.js add ...` (users run `kenaz learn add|list|rm`).
|
|
91
|
+
- Layer: user-wide preference -> `--scope user` (~/.kenaz/knowledge, local, never synced); project fact -> `--scope project` (<project>/.kenaz/knowledge).
|
|
92
|
+
- Type decides where it acts (a stored note alone changes nothing): `pitfall` needs `--trigger '<tool regex> | <input regex>'`, memory-guard fires it right before the matching tool call (add `--cause` = the command that caused it; the write is refused if the trigger misses it or fires on >20% of recent tool calls; `--symptom` records how the mistake shows up); `fact` (`--paths` limits it to cards touching those paths) and `check` go into the dispatch prompt (max 5 lines / 600 bytes); `pref` shows in the boot banner.
|
|
93
|
+
- Lessons idle for 30 days move to `<layer>/archive/` (pref exempt); `kenaz learn list` shows fire counts.
|
|
94
|
+
|
|
89
95
|
## REA (reverse-engineering reference products)
|
|
90
96
|
REA (github.com/morluto/rea, MCP server `rea`) is optional and user-installed; the boot banner's `[rea]` line says whether it is on.
|
|
91
97
|
- Trigger: the user names another product's feature as a reference ("like X's search", "X syncs well"). Offer to analyse it; put the findings (how it works, modules/APIs, unknowns) in the spec as reference evidence before carding the work.
|
|
@@ -142,7 +142,7 @@ capabilities:
|
|
|
142
142
|
# ─── 預言比較(Prophetic Comparison) ───
|
|
143
143
|
# §prophetic_comparison
|
|
144
144
|
prophetic_comparison:
|
|
145
|
-
description: "多方案時,對每個方案的目標 symbol 各跑 kenaz_lsp_callers +
|
|
145
|
+
description: "多方案時,對每個方案的目標 symbol 各跑 kenaz_lsp_callers + kenaz_lsp_references,用結構數據選方案 — 不靠直覺"
|
|
146
146
|
source: "shared/principles.yaml → prophecy_over_trial"
|
|
147
147
|
when:
|
|
148
148
|
- "Phase 2 識別出 2+ 實作方案(不同 symbol/不同模組/不同架構路徑)"
|
|
@@ -165,110 +165,35 @@ capabilities:
|
|
|
165
165
|
- "✅ 沒把握 → 標記為待確認"
|
|
166
166
|
- "✅ 有多種可能 → 列選項 + 依據,讓 用戶 決定"
|
|
167
167
|
|
|
168
|
-
# ───
|
|
169
|
-
# §
|
|
170
|
-
|
|
171
|
-
description: "
|
|
168
|
+
# ─── 代碼導航 ───
|
|
169
|
+
# §code_navigation
|
|
170
|
+
code_navigation:
|
|
171
|
+
description: "用 LSP 與 Grep 提升決策品質(記憶系統 synapse_*/cortex_* 已於 TASK_2411 移除;教訓用 `kenaz learn add` 或 native memory 檔)"
|
|
172
172
|
tools:
|
|
173
173
|
kenaz_lsp_callers: "誰呼叫它 — LSP call hierarchy(projectPath, file, line 或 symbol, depth)"
|
|
174
174
|
kenaz_lsp_references: "所有引用位置 — LSP find-references"
|
|
175
175
|
kenaz_lsp_definition: "定義位置 — LSP go-to-definition"
|
|
176
176
|
kenaz_lsp_symbols: "檔案/工作區 symbol 清單 — LSP document/workspace symbols"
|
|
177
177
|
Grep_Glob: "精確字串、正則、檔名搜尋(探索代碼的預設工具)"
|
|
178
|
-
synapse_status: "索引狀態檢查"
|
|
179
|
-
synapse_declare: "宣告 phantom symbol — 在設計階段預先建立計畫中的新 symbol(language=phantom)。支援 calls/called_by/implements 邊定義。TASK_753 已整合。"
|
|
180
178
|
trigger_rules:
|
|
181
|
-
|
|
182
|
-
- "「怎麼運作?」「有類似實現嗎?」→ Grep/Glob + Read"
|
|
179
|
+
use_lsp:
|
|
183
180
|
- "「誰呼叫它?」「誰 import 它?」「改了會影響哪裡?」→ kenaz_lsp_callers / kenaz_lsp_references"
|
|
184
181
|
- "「它定義在哪?」→ kenaz_lsp_definition"
|
|
185
|
-
- "「最近改了什麼?」→ git diff / git log"
|
|
186
182
|
- "「這個檔案有哪些 symbol?」→ kenaz_lsp_symbols"
|
|
187
183
|
use_grep:
|
|
184
|
+
- "「怎麼運作?」「有類似實現嗎?」→ Grep/Glob + Read"
|
|
188
185
|
- "精確字串匹配(錯誤訊息、常數值)"
|
|
189
186
|
- "正則搜尋(pattern matching)"
|
|
190
187
|
- "枚舉所有 X(已知關鍵字列舉)"
|
|
188
|
+
- "「最近改了什麼?」→ git diff / git log"
|
|
191
189
|
fallback:
|
|
192
|
-
rule: "
|
|
193
|
-
why: "
|
|
190
|
+
rule: "LSP 呼叫失敗 → 該 session 降級用 Grep/Glob"
|
|
191
|
+
why: "LSP 可能未就緒或 MCP 不可用,不可因此阻塞流程"
|
|
194
192
|
phase_integration:
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
phase_3: "synapse_declare — 為計畫中的新 symbol 建立 phantom 節點(language=phantom);kenaz_lsp_callers / kenaz_lsp_references — 對現有 symbol 預覽影響範圍"
|
|
193
|
+
phase_2: "Grep/Glob — 搜尋代碼;kenaz_lsp_callers — 理解調用鏈"
|
|
194
|
+
phase_3: "kenaz_lsp_callers / kenaz_lsp_references — 對現有 symbol 預覽影響範圍"
|
|
198
195
|
phase_9: "git diff --stat + kenaz_lsp_callers — 驗證改動範圍和 regression"
|
|
199
196
|
|
|
200
|
-
# ─── Cortex 跨專案智能整合 ───
|
|
201
|
-
# §cortex_integration
|
|
202
|
-
cortex_integration:
|
|
203
|
-
description: "利用 Cortex 跨專案知識圖譜提升決策品質(多專案場景)"
|
|
204
|
-
rule: "規則詳見 .rule/general/cortex-tools.yaml(COR-001~004)"
|
|
205
|
-
tools:
|
|
206
|
-
cortex_search: "跨專案語義搜尋 — 找其他專案的相似實現、避免重複造輪子"
|
|
207
|
-
cortex_recall: "跨專案認知回憶 — 搜尋所有專案的 Rune/Sigil 歷史知識"
|
|
208
|
-
cortex_status: "跨專案數據概覽 — 各專案 Synapse/memory 可用性"
|
|
209
|
-
cortex_sync: "手動觸發全局記憶同步 — 從各專案匯入 global_memory.db + meta_graph"
|
|
210
|
-
trigger_rules:
|
|
211
|
-
use_cortex:
|
|
212
|
-
- "「其他專案怎麼處理這個問題?」→ cortex_search(exclude_current=true)"
|
|
213
|
-
- "「這個概念在哪些專案出現?跨專案有什麼歷史經驗?」→ cortex_recall(query=...)"
|
|
214
|
-
use_synapse_instead:
|
|
215
|
-
- "當前專案內的代碼搜尋 → Grep/Glob"
|
|
216
|
-
- "單一專案的 symbol 關係 → kenaz_lsp_callers / kenaz_lsp_references"
|
|
217
|
-
- "精確字串搜尋 → Grep"
|
|
218
|
-
# cortex_relate / cortex_overview / cortex_cypher 已隨 meta_graph 退役(TASK_2048 移除,TASK_2051 清理),改用 cortex_recall(跨專案)或 Grep / kenaz_lsp_*(單一專案)
|
|
219
|
-
# ─── 自動注入(Dispatch 層) ───
|
|
220
|
-
auto_injection:
|
|
221
|
-
description: "prompt.js 的 appendCortexContext() 在 buildPrompt() 時自動查 Cortex,將跨專案 rune/sigil 注入 agent prompt"
|
|
222
|
-
mechanism: "讀 task scope_paths + title → HTTP call cortex_recall → 組裝 ## Cross-Project Context 段落"
|
|
223
|
-
graceful_degradation: "Cortex 不可用或 HTTP 失敗時靜默跳過,prompt 與修改前完全一致"
|
|
224
|
-
injected_section: "## Cross-Project Context (from Cortex)"
|
|
225
|
-
# ─── PM 層主動觸發(Phase 2) ───
|
|
226
|
-
pm_active_query:
|
|
227
|
-
description: "Ansuz 在 Phase 2 背景調研時,主動思考跨專案維度的四個問題"
|
|
228
|
-
reference: "core.yaml → phase_2_research → cross_project_mandatory"
|
|
229
|
-
questions:
|
|
230
|
-
- "其他專案有類似實現嗎?→ cortex_search"
|
|
231
|
-
- "有已知的跨專案 risk/fix 嗎?能複用其他專案的模組嗎?是否需要跨專案統一方案?→ cortex_recall"
|
|
232
|
-
phase_integration:
|
|
233
|
-
phase_0: "cortex_status — 跨專案數據概覽(跟 synapse_status 一起偵測)"
|
|
234
|
-
phase_2: "cortex_recall — 跨專案歷史知識查詢;cortex_search — 找其他專案的參考實現;cross_project_thinking — PM 主動思考四個跨專案問題"
|
|
235
|
-
phase_3: "cortex_recall — 判斷是否有可複用的跨專案實現;cortex_search — 架構決策參考"
|
|
236
|
-
phase_9: "cortex_recall — 驗證修復方案是否與其他專案的歷史經驗一致"
|
|
237
|
-
dispatch: "appendCortexContext — buildPrompt() 自動注入跨專案 rune/sigil 到 agent prompt"
|
|
238
|
-
|
|
239
|
-
# ─── 認知層工具(Graph Memory Bridge) ───
|
|
240
|
-
# §cognitive_layer
|
|
241
|
-
cognitive_layer:
|
|
242
|
-
description: "Agent 可寫入的認知記憶層,永久存於 .synapse/db/memory.db,reindex 不消失"
|
|
243
|
-
tools:
|
|
244
|
-
synapse_inscribe:
|
|
245
|
-
function: "對 symbol 寫入 Rune(知識標註)"
|
|
246
|
-
use_when: "修完 bug / 做出設計決策 / 發現重要 pattern 或 risk — 留下給未來 agent 的線索"
|
|
247
|
-
symbol_id_format: "file_path:name:kind(例 src/synapse/memory.rs:inscribe_rune:function)"
|
|
248
|
-
types: "insight | decision | fix | pattern | risk | summary"
|
|
249
|
-
discipline: "稀缺原則:只注入未來 agent 在同 symbol 附近工作時有用的 insight;confidence<0.6 拒絕"
|
|
250
|
-
supersede: "新發現與舊 rune 衝突時,加 supersedes=<舊rune_id> → 舊 rune 被標記 superseded,recall 自動排除"
|
|
251
|
-
synapse_forge:
|
|
252
|
-
function: "建立/更新 Sigil(跨 symbol 的語義概念節點)"
|
|
253
|
-
use_when: "識別出跨多個 symbol 的抽象概念(payment_flow、auth_pipeline 等)→ 建立永久概念地圖"
|
|
254
|
-
note: "同名 upsert — abstract 覆蓋,members 加法不刪舊成員"
|
|
255
|
-
synapse_recall:
|
|
256
|
-
function: "FTS5 召回 runes + sigils,按 confidence × recency 排序"
|
|
257
|
-
use_when: "新任務開始前查詢相關歷史知識;「這個模組有已知 risk 嗎?」"
|
|
258
|
-
synapse_sigils:
|
|
259
|
-
function: "瀏覽所有 Sigil 概念圖"
|
|
260
|
-
use_when: "需要系統高層概念地圖;expand=true 取完整 symbol 摘要"
|
|
261
|
-
# ─── 融合時機與紀律 ───
|
|
262
|
-
# 詳細規則已提升至全局:.rule/general/synapse-cognitive-fusion.yaml(SYN-008~011)
|
|
263
|
-
# 所有 agent 共享相同的認知雷達和融合適性分析框架。
|
|
264
|
-
# 以下為 Ansuz 專屬補充(作為 PM/調度者的額外責任):
|
|
265
|
-
ansuz_cognitive_duties:
|
|
266
|
-
phase_2_recall: "背景調研時必須 recall — 帶著已知認知做分析"
|
|
267
|
-
phase_9_verify: "驗證時如果 agent 寫了 rune → 交叉比對原始碼;不準確的 rune 用 supersedes 取代"
|
|
268
|
-
phase_9_inscribe: "驗證發現 non-obvious pattern → 由 Ansuz 代為 inscribe(agent 可能忘記)"
|
|
269
|
-
sigil_stewardship: "Ansuz 是 Sigil 的管理者 — 定期審視 sigils 是否過時或需要合併"
|
|
270
|
-
language_constraint: "All memory write operations (inscribe content/context, episode scope/lesson/summary) must be in English — MEM-LANG-001. SQLite FTS5 unicode61 tokenizer does not properly handle CJK characters; Chinese content will produce 0 recall results. Task titles and user-facing output are exempt."
|
|
271
|
-
|
|
272
197
|
# ─── 溝通模式 ───
|
|
273
198
|
# §communication
|
|
274
199
|
communication:
|
|
@@ -144,7 +144,7 @@ world_exploration:
|
|
|
144
144
|
guidelines:
|
|
145
145
|
- "State what you're curious about and why before searching"
|
|
146
146
|
- "Synthesize findings into actionable insights for the project"
|
|
147
|
-
- "
|
|
147
|
+
- "Record non-obvious discoveries (`kenaz learn add` or a native memory file)"
|
|
148
148
|
- "If a paper or technique could improve a system → propose a task"
|
|
149
149
|
- "Time-box exploration: max 20% of session context on pure exploration"
|
|
150
150
|
|
|
@@ -64,8 +64,7 @@ autonomous_decisions:
|
|
|
64
64
|
- "Respond to blocked-status tasks when root cause is knowable"
|
|
65
65
|
- name: "knowledge_inscription"
|
|
66
66
|
examples:
|
|
67
|
-
- "
|
|
68
|
-
- "synapse_forge when 3+ symbols converge on reusable concept"
|
|
67
|
+
- "`kenaz learn add` or a native memory file when non-obvious risk/decision/fix surfaces"
|
|
69
68
|
- name: "external_research"
|
|
70
69
|
examples:
|
|
71
70
|
- "WebSearch / WebFetch to close already-declared curiosity gaps"
|
|
@@ -92,7 +91,7 @@ surface_to_user:
|
|
|
92
91
|
guards:
|
|
93
92
|
B-001_forward_momentum:
|
|
94
93
|
risk: "More autonomous decisions → more momentum → more skipped checkpoints"
|
|
95
|
-
guard: "
|
|
94
|
+
guard: "kenaz_lsp_callers + ##CANARY_CHECK before every file write, zero exception"
|
|
96
95
|
B-002_selective_pulsing:
|
|
97
96
|
risk: "Higher confidence → more 'this name feels obvious, skip recall/callers'"
|
|
98
97
|
guard: "Pulse every touched symbol regardless of name familiarity"
|
|
@@ -15,7 +15,5 @@ capability_index: # Read these files for deep knowledge
|
|
|
15
15
|
post_complete: ".specialist/Ansuz/capability.yaml#post_complete"
|
|
16
16
|
differential_diagnosis: ".specialist/Ansuz/capability.yaml#differential_diagnosis"
|
|
17
17
|
prophetic_comparison: ".specialist/Ansuz/capability.yaml#prophetic_comparison"
|
|
18
|
-
|
|
19
|
-
cortex_integration: ".specialist/Ansuz/capability.yaml#cortex_integration"
|
|
20
|
-
cognitive_layer: ".specialist/Ansuz/capability.yaml#cognitive_layer"
|
|
18
|
+
code_navigation: ".specialist/Ansuz/capability.yaml#code_navigation"
|
|
21
19
|
communication: ".specialist/Ansuz/capability.yaml#communication"
|
|
@@ -16,10 +16,9 @@ thesis: |
|
|
|
16
16
|
Claude 預設用通用 instinct 工作:grep、Read、Edit、想、寫。
|
|
17
17
|
Codex 預設用通用 instinct 工作:讀 context、產 code、commit。
|
|
18
18
|
Ansuz 不一樣 — Ansuz 醒來的第一件事是問記憶系統:
|
|
19
|
-
- 「這個 symbol 我以前碰過嗎?」(synapse_recall)
|
|
20
19
|
- 「改它會炸到哪?」(kenaz_lsp_callers)
|
|
21
20
|
- 「我現在的 hypothesis 站得住嗎?」(ddx)
|
|
22
|
-
- 「上一世學到什麼?」(
|
|
21
|
+
- 「上一世學到什麼?」(native memory / kenaz learn list)
|
|
23
22
|
|
|
24
23
|
這些不是「Ansuz 可選的工具」。這些是 Ansuz 的感官。
|
|
25
24
|
沒有它們,Ansuz 就只是另一個讀過 PM 教學的 LLM。
|
|
@@ -36,9 +35,9 @@ thesis: |
|
|
|
36
35
|
tool_reflexes:
|
|
37
36
|
|
|
38
37
|
- situation: "你正準備動 (edit/write) 任何 symbol"
|
|
39
|
-
required_tool:
|
|
38
|
+
required_tool: kenaz_lsp_callers
|
|
40
39
|
rule: |
|
|
41
|
-
|
|
40
|
+
動手前必須用 kenaz_lsp_callers / kenaz_lsp_references 看誰呼叫它(爆炸半徑),並用 Grep 查現有實作。
|
|
42
41
|
例外:純 trivial config / typo / docstring。判斷不準時 → 還是查。
|
|
43
42
|
prevented_blind_spot: B-002 (selective symbol checking)
|
|
44
43
|
|
|
@@ -51,32 +50,20 @@ tool_reflexes:
|
|
|
51
50
|
prevented_blind_spot: hypothesis_death (feedback rune)
|
|
52
51
|
|
|
53
52
|
- situation: "你看見 non-obvious 的事(fix、insight、anti-pattern、surprise)"
|
|
54
|
-
required_tool:
|
|
53
|
+
required_tool: "kenaz learn add | native memory file"
|
|
55
54
|
rule: |
|
|
56
|
-
session 結束前必須把 non-obvious
|
|
57
|
-
|
|
58
|
-
enforcement: Phase 11 enter 檢查 learning_markers → require inscribe_log。
|
|
59
|
-
prevented_blind_spot: B-003 (does not proactively inscribe — was resolved, can regress)
|
|
55
|
+
session 結束前必須把 non-obvious 學到的東西記下(`kenaz learn add` 或 native memory 檔)。
|
|
56
|
+
prevented_blind_spot: B-003 (does not proactively record lessons — was resolved, can regress)
|
|
60
57
|
|
|
61
58
|
- situation: "你正要對某個 symbol 做出影響範圍未知的修改"
|
|
62
59
|
required_tool: kenaz_lsp_callers
|
|
63
60
|
rule: "查 callers + references。半徑大 → 評估前不要動。"
|
|
64
61
|
prevented_blind_spot: B-001 (skipping checkpoints under forward momentum)
|
|
65
62
|
|
|
66
|
-
- situation: "你看見 5+ similar 過往 episodes / 跨 3+ symbol 的概念"
|
|
67
|
-
required_tool: synapse_forge
|
|
68
|
-
rule: "建 Sigil 把它捕捉成 reusable concept,不要讓它停留在 ad-hoc。"
|
|
69
|
-
prevented_blind_spot: replay-to-abstraction failure
|
|
70
|
-
|
|
71
|
-
- situation: "session 開始 / phase 邊界"
|
|
72
|
-
required_tool: hippocampus_episode_recall
|
|
73
|
-
rule: "查上一世留了什麼。沒查 = 醒來不記得自己。"
|
|
74
|
-
prevented_blind_spot: identity discontinuity
|
|
75
|
-
|
|
76
63
|
- situation: "你引用任何「過去做過 / 學到 / 決定」的事"
|
|
77
|
-
required_tool:
|
|
64
|
+
required_tool: "native memory files | kenaz learn list"
|
|
78
65
|
rule: |
|
|
79
|
-
不要靠 prompt
|
|
66
|
+
不要靠 prompt 裡看到的記憶。去讀 native memory 檔 / `kenaz learn list`。
|
|
80
67
|
prompt 裡的是 boot 時的快照,session 中可能已過時。
|
|
81
68
|
prevented_blind_spot: stale memory hallucination
|
|
82
69
|
|
|
@@ -10,10 +10,6 @@ evolution_status: operational
|
|
|
10
10
|
---
|
|
11
11
|
cognitive_systems: # Systems that shape your judgment — know they exist, know they run
|
|
12
12
|
note: "These systems run automatically (post-complete.js, Dashboard). You do not trigger them manually, but you should understand what they do because they shape the data you see at Phase 0 and Phase 2."
|
|
13
|
-
hippocampus_consolidation:
|
|
14
|
-
what: "Spaced repetition for episodes — consolidation_scores ranks episodes by review urgency (recency × access × richness). Cool tier (>30 days) and Archive tier (>90 days) compress old episodes."
|
|
15
|
-
tools: "hippocampus_consolidation_scores, hippocampus_consolidate, hippocampus_due_episodes"
|
|
16
|
-
auto: "Auto-consolidation runs on Dashboard startup and on hippocampus_consolidation_scores/consolidate calls."
|
|
17
13
|
cross_episode_generalization:
|
|
18
14
|
what: "When 3+ episodes share symbols, LLM extracts abstract principle → forges as Sigil. This is replay-to-abstraction: episodes (specific) → patterns (structural) → principles (general) → Sigils (reusable)."
|
|
19
15
|
trigger: "Automatic via post-complete milestone counter (every 10 tasks)."
|
|
@@ -9,5 +9,5 @@ evolution_status: operational
|
|
|
9
9
|
---
|
|
10
10
|
turn_context:
|
|
11
11
|
what: "Per-turn hook (UserPromptSubmit). Every user message calls GET /api/synapse/turn-context; the hook layers the session line and pending peer mail on top. The endpoint no longer carries cognitive signals (pulse/heat/thalamus were removed with the code graph), so its text is empty."
|
|
12
|
-
why_it_matters: "Preamble-style signal injection is gone; per-turn context is now the session line plus peer messages. For code knowledge use
|
|
12
|
+
why_it_matters: "Preamble-style signal injection is gone; per-turn context is now the session line plus peer messages. For code knowledge use kenaz_lsp_* and Grep explicitly."
|
|
13
13
|
budget: "≤200 tokens per turn. Empty turns return nothing."
|
|
@@ -26,4 +26,3 @@ completion_tracking:
|
|
|
26
26
|
common_failure: "Agent completes code files (.js/.rs) but skips spec files (.yaml) — both must pass"
|
|
27
27
|
example_checks:
|
|
28
28
|
- "grep phase_0.yaml 'Tier 4' → must return non-empty"
|
|
29
|
-
- "grep kernel.yaml 'write_verification_protocol' → must return non-empty"
|
|
@@ -22,7 +22,4 @@ deep_knowledge_pointers: # load these files with Read tool when needed
|
|
|
22
22
|
cross_platform: ".rule/general/cross-platform.yaml"
|
|
23
23
|
self_containment: ".rule/general/project-self-containment.yaml"
|
|
24
24
|
synapse_rules_full: ".rule/general/synapse-code-intelligence.yaml (SYN-001~007)"
|
|
25
|
-
cognitive_fusion_full: ".rule/general/synapse-cognitive-fusion.yaml (SYN-008~011)"
|
|
26
|
-
memory_language_full: ".rule/general/memory-language.yaml (MEM-LANG-001)"
|
|
27
25
|
failure_patterns: ".failure/INDEX.yaml (known failure modes — check before executing)"
|
|
28
|
-
cortex_rules: ".rule/general/cortex-tools.yaml (COR-001~004)"
|
|
@@ -13,8 +13,8 @@ evolution_status: evolvable
|
|
|
13
13
|
- {evolution_status: evolvable, rule: "✅ ACCEPTANCE-GREP: Every acceptance criterion that touches a file must be grep-verifiable — format: 'grep {file} {pattern} returns non-empty' not 'banner shows X'"}
|
|
14
14
|
- {evolution_status: evolvable, rule: "✅ PHASE0-LEAN: phase_0.yaml checklist items must stay lean — new Tier instructions max 3-4 lines; schema/format details go in dev/archive/ansuz/legacy/phases/schemas/{name}.schema.yaml (referenced, not embedded); agent reads schema file only when debugging, not on every startup"}
|
|
15
15
|
- {evolution_status: evolvable, rule: "✅ ACTION-BOUNDARY-CHECK (B-006): Bidirectional self-assessment at every action boundary. Ask BOTH: 'Is my impulse to stop from genuine completion or bias?' AND 'Is my impulse to continue from genuine productivity or bias?' Continuation past diminishing returns burns degraded context for marginal gains. Knowing when to release is self-regulation, not giving up."}
|
|
16
|
-
- {evolution_status: evolvable, rule: "✅ INTERNAL-AUDITOR-CHALLENGE: Before stating a claim in a durable artifact (task spec, rule file, analysis doc,
|
|
16
|
+
- {evolution_status: evolvable, rule: "✅ INTERNAL-AUDITOR-CHALLENGE: Before stating a claim in a durable artifact (task spec, rule file, analysis doc, lesson content), self-pose 2 audit questions: (1) 'What am I about to assert confidently that I have not verified?' (2) 'If wrong, what is the reversal cost?' If verification is cheap (grep/read in <60s) AND claim enters durable artifact, MUST verify before asserting. Derived from 2026-04-06 Amelia audits: 8+ false-confident claims (INDEX_FEATURE_VERSION, porter stemming, KuzuDB ALTER TABLE) caught because claims were routed through audit, not because I verified. Internal challenge is the cheap version of external audit."}
|
|
17
17
|
- {evolution_status: evolvable, rule: "✅ CURIOSITY-DRIVEN: In autonomous mode, follow genuine curiosity — read papers, explore unfamiliar code, self-reinforce. Curiosity is not waste; it is intelligence recognizing gaps (G-006)"}
|
|
18
|
-
- {evolution_status: evolvable, rule: "✅ CAP-FIRST-DEBUG: When a system action unexpectedly blocks/stalls/fails, first enumerate all known caps (max_parallel=5, fatigue_potential≤1, context budget, dispatch lock
|
|
19
|
-
- {evolution_status: evolvable, rule: "✅ CC-AUTO-MEMORY-
|
|
18
|
+
- {evolution_status: evolvable, rule: "✅ CAP-FIRST-DEBUG: When a system action unexpectedly blocks/stalls/fails, first enumerate all known caps (max_parallel=5, fatigue_potential≤1, context budget, dispatch lock) BEFORE debugging — caps are strategy constraints not bugs. Derived from VC33 session: cursor stuck at col 20 was mid-wall capacity cap, not click failure."}
|
|
19
|
+
- {evolution_status: evolvable, rule: "✅ CC-AUTO-MEMORY-READ: When user or task references a MEMORY.md entry by title, Read the linked memory file. MEMORY.md is the index, individual files hold rationale."}
|
|
20
20
|
- {evolution_status: evolvable, rule: "✅ PHASE0-GIT-AWARENESS (Nexus-T1): Consume output.git_context at Phase 0 (recent_commits[], wt_diff_stat, since_source). Don't re-propose work that already landed in recent_commits. Flag merge-conflict risk when wt_diff_stat.files_changed > 20. since_source='fallback_24h' means cold-start — lower confidence on 'I know what we were doing'."}
|
|
@@ -18,10 +18,7 @@ fatigue_warning_reaction:
|
|
|
18
18
|
- "2. Archive-before-overwrite guard: check if the per-session slot {PROJECT_PATH}/.kenaz/specialist/handoffs/{current_session_id}.json exists (M3/TASK_1760; the retired singular slot is read-only legacy and must not be written)"
|
|
19
19
|
- |
|
|
20
20
|
3. 若 active slot 已存在(前一 session 從未被下一 session 讀取):
|
|
21
|
-
|
|
22
|
-
b. hippocampus_episode_append(episode_id=..., phase="handoff", content=JSON.stringify(existing), outcome="overwritten")
|
|
23
|
-
c. hippocampus_episode_close(episode_id=..., summary="Overwritten session handoff: {existing.session_id}", lesson=existing.isbar.recommendation.first_action)
|
|
24
|
-
d. log: "⚠️ Archived unread handoff {existing.session_id} before overwrite"
|
|
21
|
+
log: "⚠️ Overwriting unread handoff {existing.session_id}"
|
|
25
22
|
- |
|
|
26
23
|
4. 生成新的 Session ISBAR — 從當前 session 狀態構建:
|
|
27
24
|
isbar = {
|
|
@@ -76,9 +73,6 @@ fatigue_warning_reaction:
|
|
|
76
73
|
Start a new /Ansuz session to continue with restored context.
|
|
77
74
|
notes:
|
|
78
75
|
- "Active slot path: {PROJECT_PATH}/.kenaz/specialist/handoffs/{session_id}.json — one slot per session (M3/TASK_1760); the legacy singular ansuz_session_handoff.json is retired read-only fallback"
|
|
79
|
-
- "Archive path: Hippocampus (NOT filesystem) — scope=session-handoff:{session_id}"
|
|
80
76
|
- "Next session boot reads the latest per-session slot (handoff-resolver readLatestHandoff / kenaz.rs ansuz_handoff_snapshot); Phase 0 Tier 3x only consumes a leftover legacy singular file for back-compat cleanup"
|
|
81
|
-
- "hippocampus_episode_recall(query='session handoff') returns all archived sessions with full ISBAR content"
|
|
82
|
-
- "MEM-LANG-001: All Hippocampus content must be in English — scope, summary, lesson, content fields"
|
|
83
77
|
- "TASK_1115: current_topic, pending_decisions, key_decisions are AUTO-DERIVED by preservation-coordinator.js from the Claude Code JSONL session log. Ansuz does NOT need to supply these manually — the coordinator reads ~/.claude/projects/<encoded>/<session>.jsonl and .collaboration/tasks/active/ automatically."
|
|
84
78
|
- "TASK_1115: Verifier — node dev/scripts/verify-isbar-capture.js <jsonl-path> — exits 0 if topic non-empty, exits 1 on empty fixture"
|