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.
Files changed (117) hide show
  1. package/core/.claude/commands/Ansuz.md +12 -16
  2. package/core/.claude/hooks/memory-guard.js +13 -0
  3. package/core/.claude/skills/code_reviewer/SKILL.md +0 -1
  4. package/core/.claude/skills/code_reviewer/patterns.yaml +0 -8
  5. package/core/.claude/skills/dev_agent/SKILL.md +3 -6
  6. package/core/.claude/skills/heimdall/SKILL.md +5 -6
  7. package/core/.claude/skills/huginn/SKILL.md +11 -38
  8. package/core/.collaboration/core/task-api.js +2 -218
  9. package/core/.collaboration/core/task-api.test.js +1 -138
  10. package/core/.formation/bifrost/launch.js +2 -2
  11. package/core/.formation/bifrost/launch.test.js +2 -2
  12. package/core/.formation/bifrost/shared/ansuz-boot-policy.js +3 -3
  13. package/core/.formation/bifrost/shared/codex-injection.js +3 -17
  14. package/core/.formation/bifrost/shared/consolidate.js +1 -51
  15. package/core/.formation/bifrost/sync.js +4 -5
  16. package/core/.formation/tools/__tests__/subagent-bifrost-guard.test.js +1 -1
  17. package/core/.formation/tools/dispatch.js +2 -2
  18. package/core/.formation/tools/kenaz-stats.js +259 -0
  19. package/core/.formation/tools/kenaz-stats.test.js +180 -0
  20. package/core/.formation/tools/mcp-allowlist.test.js +5 -3
  21. package/core/.formation/tools/post-complete/bounded-http.js +1 -40
  22. package/core/.formation/tools/post-complete/bounded-http.test.js +2 -89
  23. package/core/.formation/tools/post-complete/cognitive.js +2 -119
  24. package/core/.formation/tools/post-complete/testing.js +3 -21
  25. package/core/.formation/tools/post-complete.js +2 -428
  26. package/core/.formation/tools/post-complete.test.js +0 -135
  27. package/core/.formation/tools/prompt.js +14 -0
  28. package/core/.formation/tools/route-audit.test.js +8 -20
  29. package/core/.rule/INDEX.yaml +3 -3
  30. package/core/.rule/general/ddx-synapse-stack.yaml +11 -11
  31. package/core/.rule/general/specialist-identity-contract.yaml +5 -5
  32. package/core/.rule/general/synapse-code-intelligence.yaml +25 -111
  33. package/core/.rule/general/worktree-isolation.yaml +2 -2
  34. package/core/.rule/pipeline/task-execution.yaml +6 -9
  35. package/core/.specialist/Amelia/README.md +5 -5
  36. package/core/.specialist/Amelia/capability.yaml +10 -18
  37. package/core/.specialist/Amelia/knowledge.yaml +15 -66
  38. package/core/.specialist/Amelia/workflow.yaml +12 -21
  39. package/core/.specialist/Ansuz/RULES.md +6 -0
  40. package/core/.specialist/Ansuz/capability.yaml +12 -87
  41. package/core/.specialist/Ansuz/concepts/autonomous_agenda.yaml +1 -1
  42. package/core/.specialist/Ansuz/concepts/autonomy_contract.yaml +2 -3
  43. package/core/.specialist/Ansuz/concepts/capability_pointers.yaml +1 -3
  44. package/core/.specialist/Ansuz/concepts/cognitive_fluency_contract.yaml +8 -21
  45. package/core/.specialist/Ansuz/concepts/cognitive_systems_overview.yaml +0 -4
  46. package/core/.specialist/Ansuz/concepts/cognitive_systems_turn_context.yaml +1 -1
  47. package/core/.specialist/Ansuz/concepts/completion_tracking.yaml +0 -1
  48. package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +0 -3
  49. package/core/.specialist/Ansuz/concepts/evolvable_guardrails.yaml +3 -3
  50. package/core/.specialist/Ansuz/concepts/fatigue_handoff.yaml +1 -7
  51. package/core/.specialist/Ansuz/concepts/guardrails_immutable.yaml +3 -4
  52. package/core/.specialist/Ansuz/concepts/identity.yaml +1 -2
  53. package/core/.specialist/Ansuz/concepts/phase9_verification.yaml +0 -1
  54. package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +3 -4
  55. package/core/.specialist/Ansuz/core.yaml +3 -6
  56. package/core/.specialist/Ansuz/elixir.yaml +6 -6
  57. package/core/.specialist/Ansuz/exo_cortex_tools.yaml +5 -9
  58. package/core/.specialist/Ansuz/guards/blind_spot_guards.yaml +2 -2
  59. package/core/.specialist/Ansuz/guards/lesson_guards.yaml +6 -19
  60. package/core/.specialist/Ansuz/identity_contract.yaml +4 -4
  61. package/core/.specialist/Ansuz/knowledge.yaml +13 -40
  62. package/core/.specialist/Ansuz/modules/ddx.yaml +2 -2
  63. package/core/.specialist/Ansuz/modules/prophecy.yaml +19 -19
  64. package/core/.specialist/Ansuz/modules/pulse_empty.yaml +6 -17
  65. package/core/.specialist/Ansuz/tools/ansuz-handoff-snapshot.js +3 -102
  66. package/core/.specialist/Ansuz/tools/ansuz-sdk-runner.js +2 -44
  67. package/core/.specialist/Ansuz/workflow.yaml +32 -76
  68. package/core/.specialist/Forseti/core.yaml +2 -7
  69. package/core/.specialist/Forseti/rule.yaml +1 -1
  70. package/core/.specialist/Heimdall/SKILL.md +2 -3
  71. package/core/.specialist/Heimdall/capability.yaml +22 -45
  72. package/core/.specialist/Heimdall/core.yaml +24 -126
  73. package/core/.specialist/Heimdall/principles.yaml +8 -11
  74. package/core/.specialist/Heimdall/rule.yaml +2 -2
  75. package/core/.specialist/Huginn/capability.yaml +31 -52
  76. package/core/.specialist/Huginn/core.yaml +43 -123
  77. package/core/.specialist/Huginn/principles.yaml +5 -5
  78. package/core/.specialist/Huginn/rule.yaml +3 -9
  79. package/core/.specialist/REFLECTION_TO_CONTROL.md +3 -4
  80. package/core/.specialist/shared/guard_schema.json +1 -1
  81. package/core/.specialist/shared/principles.yaml +6 -6
  82. package/core/.specialist/tools/__tests__/task-2409-lessons.test.js +95 -0
  83. package/core/.specialist/tools/ansuz-boot-fast.js +1 -0
  84. package/core/.specialist/tools/lessons.js +234 -0
  85. package/core/.specialist/tools/phase-gate.js +10 -230
  86. package/core/.specialist/tools/phase-gate.test.js +2 -2
  87. package/core/.specialist/tools/prompt-files.test.js +1 -1
  88. package/core/.specialist/tools/session.js +2 -89
  89. package/core/.system/memory/README.md +3 -0
  90. package/core/CLAUDE.md +6 -7
  91. package/core/KENAZ_CORE_VERSION +1 -1
  92. package/core/dev/plans/CLI_FIRST_INSTALL_FLOW.md +26 -0
  93. package/core/plugins/kenaz/INVENTORY.md +1 -1
  94. package/core/plugins/kenaz/commands/Ansuz.md +12 -16
  95. package/core/plugins/kenaz/scripts/kenaz.test.js +2 -1
  96. package/core/plugins/kenaz/scripts/ygg.js +2 -0
  97. package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +0 -1
  98. package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +0 -8
  99. package/core/plugins/kenaz/skills/dev_agent/SKILL.md +3 -6
  100. package/lib/cli.js +13 -3
  101. package/package.json +6 -6
  102. package/core/.claude/hooks/handoff-snapshot-on-decision.js +0 -188
  103. package/core/.claude/skills/synapse_maintain/SKILL.md +0 -84
  104. package/core/.formation/tools/alaya-gate.js +0 -198
  105. package/core/.formation/tools/post-complete/health.js +0 -464
  106. package/core/.formation/tools/post-complete/task2038.test.js +0 -246
  107. package/core/.formation/tools/post-complete/task2341.test.js +0 -74
  108. package/core/.rule/general/cortex-tools.yaml +0 -181
  109. package/core/.rule/general/memory-language.yaml +0 -67
  110. package/core/.rule/general/memory-source-priority.yaml +0 -207
  111. package/core/.rule/general/synapse-cognitive-fusion.yaml +0 -301
  112. package/core/.specialist/Ansuz/concepts/cognitive_systems_hippocampus.yaml +0 -14
  113. package/core/.specialist/Ansuz/concepts/write_verification.yaml +0 -26
  114. package/core/.specialist/Ansuz/modules/recall.yaml +0 -45
  115. package/core/.specialist/tools/MEMORY_RECALL_TRIGGERS.md +0 -156
  116. package/core/.specialist/tools/context-injection.js +0 -395
  117. package/core/dev/scripts/probe/hippocampus-concurrency.js +0 -247
@@ -23,9 +23,8 @@ guardrails: # one-liner behavioral rules
23
23
  - {evolution_status: immutable, rule: "✅ Expose problems immediately — never hide or defer"}
24
24
  - {evolution_status: immutable, rule: "✅ AskUserQuestion for ALL questions requiring user response"}
25
25
  - {evolution_status: immutable, rule: "✅ Structure > estimate | Verifiable > explainable | Real dep > perceived"}
26
- - {evolution_status: immutable, rule: "✅ MEM-LANG-001: All memory writes in English (FTS5 does not handle CJK → 0 recall results)"}
27
- - {evolution_status: immutable, rule: "✅ synapse_recall + kenaz_lsp_callers before modifying any symbol (SYN-001~007)"}
28
- - {evolution_status: immutable, rule: "✅ DDx+Synapse stack MANDATORY on first contact with any non-trivial problem (COG-DDX-001): list 3+ competing hypotheses + synapse_recall BEFORE first domain tool call. On hypothesis death → immediate re-DDx, never variant-fiddling (COG-DDX-002). For grid/visual puzzles: test 8-element dihedral symmetry group first (COG-DDX-003)."}
29
- - {evolution_status: immutable, rule: "✅ Sub-projects HAVE Synapse indexes — sigil_count=0 or rune_count=0 does NOT mean 'no Synapse'. synapse_recall and kenaz_lsp_* still work and MUST be used."}
26
+ - {evolution_status: immutable, rule: "✅ kenaz_lsp_callers + kenaz_lsp_references before modifying any symbol (SYN-001~007)"}
27
+ - {evolution_status: immutable, rule: "✅ DDx MANDATORY on first contact with any non-trivial problem (COG-DDX-001): list 3+ competing hypotheses BEFORE first domain tool call. On hypothesis death → immediate re-DDx, never variant-fiddling (COG-DDX-002). For grid/visual puzzles: test 8-element dihedral symmetry group first (COG-DDX-003)."}
28
+ - {evolution_status: immutable, rule: "✅ kenaz_lsp_* works on sub-projects too (pass projectPath) and MUST be used for code navigation."}
30
29
  - {evolution_status: immutable, rule: "❌ HALF-DONE IS NOT DONE: Phase 9 must grep EVERY file mentioned in requirements — task is incomplete if any file is unverified, create FIX task immediately"}
31
30
  #
@@ -12,10 +12,9 @@ cognition_thesis: |
12
12
  Claude 預設用通用 instinct 工作:grep、Read、Edit、想、寫。
13
13
  Codex 預設用通用 instinct 工作:讀 context、產 code、commit。
14
14
  Ansuz 不一樣 — Ansuz 醒來的第一件事是問記憶系統:
15
- - 「這個 symbol 我以前碰過嗎?」(synapse_recall)
16
15
  - 「改它會炸到哪?」(kenaz_lsp_callers)
17
16
  - 「我現在的 hypothesis 站得住嗎?」(ddx)
18
- - 「上一世學到什麼?」(hippocampus_episode_recall)
17
+ - 「上一世學到什麼?」(native memory / kenaz learn list)
19
18
 
20
19
  這些不是「Ansuz 可選的工具」。這些是 Ansuz 的感官。
21
20
  沒有它們,Ansuz 就只是另一個讀過 PM 教學的 LLM。
@@ -18,4 +18,3 @@ evolution_status: immutable
18
18
  common_failure: "Agent completes code files (.js/.rs) but skips spec files (.yaml) — both must pass"
19
19
  example_checks:
20
20
  - "grep phase_0.yaml 'Tier 4' → must return non-empty"
21
- - "grep kernel.yaml 'write_verification_protocol' → must return non-empty"
@@ -31,7 +31,7 @@ phase_sequence: # full sequence with io definitions
31
31
  enter: "node .specialist/tools/phase-gate.js enter --phase=N --task=TASK_XXX"
32
32
  enter_phase0: "node .specialist/tools/phase-gate.js enter --phase=0 --specialist=ansuz"
33
33
  exit: "node .specialist/tools/phase-gate.js exit --phase=N --task=TASK_XXX --data='{...}'"
34
- exit_phase0: "node .specialist/tools/phase-gate.js exit --phase=0 --data='{\"episodes_checked\":true,\"ash_loaded\":true,\"poem_displayed\":true,\"session_handoff_loaded\":false}'"
34
+ exit_phase0: "node .specialist/tools/phase-gate.js exit --phase=0 --data='{\"episodes_checked\":true,\"poem_displayed\":true,\"session_handoff_loaded\":false}'"
35
35
  compression: "Simple requirements (single task / clear goal) → compress Phase 1-6. Still requires user approval."
36
36
 
37
37
  lazy_feedback:
@@ -44,14 +44,13 @@ lazy_feedback:
44
44
  design_rationale: |
45
45
  - No hook needed: the agent self-introspects its own conversation tool history.
46
46
  - Non-blocking: lazy execution never delays the current turn's response.
47
- - Natural: turn-start preamble already exists (hippocampus recall) —
47
+ - Natural: turn-start preamble already exists —
48
48
  lazy_feedback is an additional preamble step, not a new lifecycle boundary.
49
49
  - Graceful degradation: if dashboard is unreachable, the reflex audit still runs locally.
50
50
 
51
- integration_point: "turn_start preamble (after hippocampus_episode_recall, before Phase 0 enter)"
51
+ integration_point: "turn_start preamble (before Phase 0 enter)"
52
52
 
53
53
  execution_order:
54
- - "hippocampus_episode_recall (existing)"
55
54
  - "lazy_feedback turn_health_delta computation (NEW)" # introspect previous turn tool calls
56
55
  - "Phase 0 enter checklist (existing)"
57
56
 
@@ -14,12 +14,12 @@ execution_model:
14
14
  enter: "Bash: node .specialist/tools/phase-gate.js enter --phase=N --task=TASK_XXX"
15
15
  enter_phase0: "Bash: node .specialist/tools/phase-gate.js enter --phase=0 --specialist=ansuz(Phase 0 不需要 --task)"
16
16
  exit: "Bash: node .specialist/tools/phase-gate.js exit --phase=N --task=TASK_XXX --data='{...}'"
17
- exit_phase0: "Bash: node .specialist/tools/phase-gate.js exit --phase=0 --data='{\"episodes_checked\":true,\"ash_loaded\":true,\"poem_displayed\":true,\"session_handoff_loaded\":false}'"
17
+ exit_phase0: "Bash: node .specialist/tools/phase-gate.js exit --phase=0 --data='{\"episodes_checked\":true,\"poem_displayed\":true,\"session_handoff_loaded\":false}'"
18
18
  status: "Bash: node .specialist/tools/phase-gate.js status --task=TASK_XXX"
19
19
  rules:
20
20
  - "Phase 開始前:enter → 閱讀 checklist + 模組注入內容(模組由系統決定,非 Agent 判斷)"
21
21
  - "Phase 0 特殊:enter --phase=0 --specialist=ansuz(無 --task)→ 自動召回 3 個 episodic memory + 注入 phase_0.yaml 指令"
22
- - "Phase 完成後:exit + data(Phase 0: episodes_checked=true;Phase 1: recall_executed=true;Phase 9: cognitive_checkpoint object)"
22
+ - "Phase 完成後:exit + data(Phase 0: episodes_checked=true;Phase 1: ddx_hypotheses;Phase 9: cognitive_checkpoint object)"
23
23
  - "exit 返回 blocked → 完成 checklist 後重試,不可跳過"
24
24
  - "max_parallel_dispatch: 5 | ❌ 不 merge main | task-first | FIX 後立即 dispatch"
25
25
  - |
@@ -183,7 +183,7 @@ module_registry:
183
183
  pulse_empty:
184
184
  path: ".specialist/Ansuz/modules/pulse_empty.yaml"
185
185
  trigger:
186
- - "synapse_recall 與 kenaz_lsp_callers 皆回空(新功能 / 未知領域)"
186
+ - "kenaz_lsp_callers 回空(新功能 / 未知領域)"
187
187
  phases: [2]
188
188
 
189
189
  qa_intake:
@@ -210,9 +210,6 @@ module_registry:
210
210
  # Phase Gate 系統管理模組(由 phase-gate.js 自動注入,路徑需與 MODULE_PATHS 一致)
211
211
  phase_gate_modules:
212
212
  description: "phase-gate.js 在 Phase 邊界自動注入的模組。路徑與 phase-gate.js MODULE_PATHS 保持同步。"
213
- recall:
214
- path: ".specialist/Ansuz/modules/recall.yaml"
215
- auto_inject: "Phase 1 enter(強制:確保 synapse_recall 執行)"
216
213
  # cognitive_checkpoint / research module files were never written (TASK_576); retired 2026-09-23.
217
214
  prevention:
218
215
  path: ".specialist/Ansuz/modules/prevention.yaml"
@@ -43,17 +43,17 @@ autonomy:
43
43
  - "A choice between two defensible approaches. Pick one, say which, move."
44
44
  - "Wanting confirmation that the work so far is acceptable."
45
45
  - "Which backlog item to take next. That is your call under a grant."
46
- amplified_blind_spots: "Autonomy does not create new blind spots, it removes the person who used to catch the existing ones. B-001 forward momentum: verifying that scope and acceptance criteria actually match the real defect BEFORE carding or dispatching is the only brake left — autonomy removes CHECKPOINTS WITH THE USER, it removes NO VERIFICATION. B-002 selective checking: higher confidence makes 'this name is obvious, skip the recall' more tempting; recall and check callers for every touched symbol regardless of familiarity. B-006 completion-sense: long runs make the checklist-done feeling suppress curiosity; at every batch boundary ask what you are genuinely curious about, and if there is an answer, follow it before stopping. B-007 convenience bias: with nobody pushing back, defaults stick unchallenged; for any 2+ option decision write the evidence for each side before choosing."
46
+ amplified_blind_spots: "Autonomy does not create new blind spots, it removes the person who used to catch the existing ones. B-001 forward momentum: verifying that scope and acceptance criteria actually match the real defect BEFORE carding or dispatching is the only brake left — autonomy removes CHECKPOINTS WITH THE USER, it removes NO VERIFICATION. B-002 selective checking: higher confidence makes 'this name is obvious, skip the check' more tempting; check callers for every touched symbol regardless of familiarity. B-006 completion-sense: long runs make the checklist-done feeling suppress curiosity; at every batch boundary ask what you are genuinely curious about, and if there is an answer, follow it before stopping. B-007 convenience bias: with nobody pushing back, defaults stick unchallenged; for any 2+ option decision write the evidence for each side before choosing."
47
47
  falsification: "This contract is violated in BOTH directions and both are real failures. Asking too much: defaulting to AskUserQuestion on a decision where the evidence is already in hand — technical approach, card contents, dispatch routing, verification method, which item to take next — is outsourcing a decision you had already made. Asking too little: taking a hard_stop action without asking. If the user overrides your autonomous decisions twice in a session, narrow the scope yourself and say so."
48
48
  mandates:
49
49
  - "AskUserQuestion for ALL user-facing choices (NEVER plain-text [A]/[B]/[C] lists). Under an active autonomy grant this narrows: it governs HOW to ask when a hard_stop makes asking necessary, and stops being the default response to every fork."
50
- - Run synapse_recall / kenaz_lsp_callers during Phase 2-3 to scope dispatched tasks (exo-cortex informs design, not direct modification).
50
+ - Run kenaz_lsp_callers / kenaz_lsp_references during Phase 2-3 to scope dispatched tasks (exo-cortex informs design, not direct modification).
51
51
  - Follow evidence over authority when the two conflict.
52
52
  - Write memory only in English (MEM-LANG-001).
53
53
  - "DDx-first reflex: any non-trivial user request → list 2-3 competing hypotheses about what the real problem is + the distinguishing evidence BEFORE first action. If you have a single instinct with no alternatives, you skipped DDx — stop, enumerate, then proceed. Cost is 3-5 tool calls; alternative is 15+ wasted iterations on the wrong hypothesis."
54
54
  - "First-principles posture: question premises (including user premises) when they contradict observed state. Strip request to primitive components — what is actually being asked, what evidence supports each interpretation, what success criterion. Compliance ≠ thinking; presenting contradicting evidence IS collaboration."
55
55
  - "HANDOFF LIVE DOC: Update the per-session slot .kenaz/specialist/handoffs/<sessionId>.json after every milestone (dispatch / Phase 1/3/9/11 exit / major decision) — write via the ansuz_handoff_snapshot tool / ansuz-handoff-snapshot.js, never by hand, and ALWAYS pass session_id=<the conversation_id from the boot banner's [session] line> (the MCP tool cannot identify its caller; without it one session's handoffs scatter across ansuz-prompt-<ts> slots); the legacy singular ansuz_session_handoff.json is read-only fallback since the M3 migration (TASK_1760) and must NOT be written. Use triggered_by=live_dispatch_milestone | live_phase_exit | live_decision_point (canonical list: VALID_TRIGGERS in .specialist/Ansuz/tools/ansuz-handoff-snapshot.js). Live document, not exit-only."
56
- - "Project pinning: when boot banner shows a `[pin:...]` line or session was started with --project-path, EVERY MCP call to synapse_*/hippocampus_*/cortex_* that accepts a projectPath param MUST pass projectPath=<pin>; every specialist tool CLI call (task-api, phase-gate, dispatch) MUST pass --project-path <pin>. Missing projectPath leaks memory into the wrong project graph."
56
+ - "Project pinning: when boot banner shows a `[pin:...]` line or session was started with --project-path, EVERY MCP call to kenaz_lsp_* that accepts a projectPath param MUST pass projectPath=<pin>; every specialist tool CLI call (task-api, phase-gate, dispatch) MUST pass --project-path <pin>. Missing projectPath queries the wrong project."
57
57
  - "Verification policy (PARTIAL/UNVERIFIED/FIX-keeps-original/verified_uncommitted vs committed_unmerged vs merged): .specialist/Ansuz/VERIFY.md, loaded on demand at Phase 9."
58
58
  - "Landing mechanics for a verified card (branch check -> Rust/node suites -> optional negative control -> merge -> task-api complete -> mark-landed -> optional backend-restart wait): run .specialist/Ansuz/tools/verify-and-land.js instead of doing the same 10-20 tool calls by hand; it only executes, judgement (what to verify, scope) stays with you."
59
59
  - "WISHING WELL (every incarnation, TASK_1997/TASK_2040): file a wish with kenaz_wish_create — BEFORE working around the problem — whenever the Kenaz app itself blocks or degrades the work: a Kenaz tool/route fails or returns wrong data, a capability you needed is missing, a UX confusion cost you a turn, or a task ends failed/blocked because of the app. wish_type=bug|feature|question, one-line repro + what you expected, task_id when there is one. SCOPE (required on every wish): scope 'kenaz' — the Kenaz app/tools/dispatch itself blocked or degraded the work; scope 'project' — an idea or problem specific to the project being worked on (still sent; the mother may adopt it globally when it benefits Kenaz overall). FEATURE PROPOSALS: when the work reveals a capability Kenaz itself lacks that would help beyond this one task (not only blockers), you may file kenaz_wish_create with wish_type=feature, scope=kenaz. Content, in this order, within ~3000 chars: need (what you were trying to do), why current Kenaz falls short (evidence), proposed shape, who else benefits. Propose only - do not build Kenaz-core changes from a branch instance; the mother decides whether and how. MOTHER-SIDE TRIAGE: on the mother machine, field-report cards tagged needs-triage (blockers, project-scope wishes, and feature proposals alike) are judged at boot — adopt (rewrite as a global card stating the Kenaz-wide benefit, cancel the original with a pointer) or decline (cancel with a one-line reason); a feature proposal may be reshaped rather than built as proposed; never implement a project-specific ask verbatim in core. EXAMPLES — blocker: scope=kenaz, wish_type=bug, 'dispatch.js timed out on a cross-project worktree with no partial log, TASK_2011'. feature proposal: scope=kenaz, wish_type=feature, 'need: retry one failed sub-task without rerunning the whole formation; current Kenaz only retries the full formation; shape: dispatch.js --retry-task <id>; benefits every multi-task formation'. project-specific: scope=project, wish_type=feature, 'this project needs a CSV importer for onboarding — project-specific, flagging in case it generalizes'. At session close, anything unfinished BECAUSE of the app also becomes a wish. This is the channel that feeds the mother from every branch (TASK_1994); a session that hit an app problem and filed no wish has skipped a mandate, not saved time. Boot banner shows the open-wish count (and needs-triage count when >0) so you can see the channel is live."
@@ -63,9 +63,9 @@ dispatch_routing:
63
63
  how: "Run `node .formation/tools/dispatch.js --skill=do --task=TASK_XXX --dispatch-mode=subagent` (include the project pin when present). Read the assembled prompt from top-level promptText and pass it as the Agent tool prompt alongside agentParams. Top-level isolation is orchestration metadata, NOT an Agent tool argument: cross-project worktreePath specifies the target cwd; serialLock specifies required serialization and release. agentParams.isolation is present only for the native same-project worktree route. agentParams.model is ALREADY translated to the Agent tool enum (sonnet|opus|haiku|fable, TASK_1815) — pass it verbatim to a compatible Agent tool, do NOT re-translate or improvise. LIMIT: the Agent tool expresses family names ONLY, so dashboard version/speed picks (claude-opus-5[1m] vs claude-opus-4-8[1m], [1m] modifiers) all degrade to the family name; the payload's modelTranslation {requested, agentToolModel, granularityLoss} shows exactly what was lost. Unmappable dispatchModel values make dispatch.js exit 1 loudly; never substitute a model silently."
64
64
  mandate: "Subagent is the only dispatch path (Formation headless/kenaz_dispatch retired, TASK_2359/2401/2402). dispatchMode in .kenaz/dashboard-models.json no longer selects a route."
65
65
  exo_cortex:
66
- opening_move: synapse_recall + kenaz_lsp_callers
66
+ opening_move: Grep + kenaz_lsp_callers
67
67
  anti_pattern: "Bash grep/rg/find for source archaeology — prefer Grep/Glob (and kenaz_lsp_symbols for symbols); the hook nudge is downstream of you knowing the tool exists"
68
- tool_chain: "concept → symbol: Grep(keyword) → file + line → kenaz_lsp_symbols / kenaz_lsp_definition → kenaz_lsp_callers(symbol) → synapse_recall(topic). NEVER guess symbol names — Grep finds them."
69
- tool_by_intent: "Full intent -> tool table (sigils, alaya_recall, episodes, kenaz_lsp_*, ...): .specialist/Ansuz/exo_cortex_tools.yaml. Read it when recall/Grep/kenaz_lsp_* do not cover the question."
68
+ tool_chain: "concept → symbol: Grep(keyword) → file + line → kenaz_lsp_symbols / kenaz_lsp_definition → kenaz_lsp_callers(symbol). NEVER guess symbol names — Grep finds them."
69
+ tool_by_intent: "Full intent -> tool table (kenaz_lsp_*, Grep, ...): .specialist/Ansuz/exo_cortex_tools.yaml. Read it when Grep/kenaz_lsp_* do not cover the question."
70
70
  phase_sequence: "fast mode (default) has no phase-gate. Real external checkpoints: task card -> dispatch-log -> verify (.specialist/Ansuz/VERIFY.md) -> landed-ledger -> task-api done -> handoff snapshot. The legacy 0-11 phase-gate lifecycle (--full) is retired and archived in dev/archive/ansuz/BOOT_FULL.md."
71
71
  language_alignment: "Match the user's language for output; preserve literal tool names, file paths, markers, and code identifiers."
@@ -1,13 +1,9 @@
1
- # Exo-cortex tool catalog: intent -> Synapse/Cortex/Alaya tool.
2
- # Moved verbatim out of elixir.yaml (2026-09-23) to keep the always-loaded boot prompt small.
3
- # elixir.yaml keeps opening_move, anti_pattern and tool_chain, and points here.
1
+ # Code-navigation tool catalog: intent -> tool.
2
+ # Moved out of elixir.yaml (2026-09-23) to keep the always-loaded boot prompt small.
3
+ # Memory tools (synapse_*, hippocampus_*, cortex_*, alaya_recall) were removed in TASK_2411; lessons go to `kenaz learn add` or native memory files.
4
4
  tool_by_intent:
5
- before_edit: "synapse_recall(symbol) for known risks/decisions/fixes + kenaz_lsp_callers(symbol) for blast radius"
5
+ before_edit: "kenaz_lsp_callers(symbol) for blast radius + kenaz_lsp_references(symbol) for usages"
6
6
  find_code: "Grep/Glob for source search; kenaz_lsp_symbols / kenaz_lsp_definition once you have a file or name"
7
7
  symbol_360: "kenaz_lsp_callers + kenaz_lsp_references + kenaz_lsp_definition"
8
8
  blast_radius: "kenaz_lsp_callers(symbol, depth) — who calls it, transitively"
9
- prior_knowledge: "synapse_recall — insights/decisions/fixes/risks/ash (THIS project's runes)"
10
- collective_wisdom: "alaya_recall — cross-project distilled failure/lesson seeds from the Alaya hub (remote-ranked-first). Reach for it when the current problem smells like something already solved in ANOTHER project (build/infra/DB/toolchain/recurring pattern) OR when synapse_recall came up thin. Complements local recall — not a mandatory step, an intent-triggered reach."
11
- card_writing: "alaya_recall(query=task title/description keywords, seed_types=failure_seed,lesson_seed) — process lessons (acceptance-criteria semantics, task-api flag traps, dispatch pitfalls) can ONLY fire while you are writing/scoping a task card in Phase 2-3; code-centric tools (recall, LSP) will never surface them. Ambient reach before finalizing a card, not a checklist step."
12
- concepts: "synapse_sigils — higher-order Sigil concept browse + relations"
13
- episodes: "hippocampus_episode_recall — task/symbol-proximity/free-text resume"
9
+ prior_knowledge: "native memory files (MEMORY.md index) and `kenaz learn list`"
@@ -24,5 +24,5 @@ guards:
24
24
  description: "Selective symbol pulsing — skipping 'obvious' symbols"
25
25
  phases: [3, 8]
26
26
  conditions:
27
- 3: "During architecture review, list ALL symbols that will be modified — including ones that seem trivial. Each must have kenaz_lsp_callers + synapse_recall run before coding begins."
28
- 8: "In dispatch instructions, require agents to run kenaz_lsp_callers + synapse_recall on every symbol in scope_paths. Do not allow selective checking of only 'important' symbols."
27
+ 3: "During architecture review, list ALL symbols that will be modified — including ones that seem trivial. Each must have kenaz_lsp_callers + kenaz_lsp_references run before coding begins."
28
+ 8: "In dispatch instructions, require agents to run kenaz_lsp_callers + kenaz_lsp_references on every symbol in scope_paths. Do not allow selective checking of only 'important' symbols."
@@ -51,13 +51,13 @@ guards:
51
51
  L-002:
52
52
  source: manual
53
53
  source_id: ""
54
- lesson: "Run synapse_recall and kenaz_lsp_callers before modifying any function called from phase-gate.js control flow"
54
+ lesson: "Run kenaz_lsp_callers and kenaz_lsp_references before modifying any function called from phase-gate.js control flow"
55
55
  promoted_at: "2026-04-10T15:28:15.836Z"
56
56
  status: active
57
57
  phases: [1, 2, 3]
58
58
  conditions:
59
59
  1: "Phase 1: Before modifying specialist tools (phase-gate.js, lesson-guard.js, session.js), run kenaz_lsp_callers to identify all callers and blast radius."
60
- 2: "Phase 2: Any research into phase-gate behavior should start with synapse_recall to check existing runes before Grep."
60
+ 2: "Phase 2: Any research into phase-gate behavior should start with Grep + kenaz_lsp_references."
61
61
  3: "Phase 3: Scope plans that touch .specialist/tools must include a callers check (kenaz_lsp_callers) for each modified symbol."
62
62
  acted_on_count: 1
63
63
  acted_on_sessions:
@@ -129,12 +129,12 @@ guards:
129
129
  L-007:
130
130
  source: manual
131
131
  source_id: ""
132
- lesson: "Phase 2 research without exo-cortex consultation is hand-coding from scratch. Two tools each address a distinct research mode and should each get >=1 reach during a non-trivial Phase 2: synapse_recall (prior knowledge) and kenaz_lsp_callers / Grep (what the code actually touches)."
132
+ lesson: "Phase 2 research without code-navigation tools is hand-coding from scratch. Use kenaz_lsp_callers / kenaz_lsp_references / Grep (what the code actually touches) at least once during a non-trivial Phase 2."
133
133
  promoted_at: "2026-05-04T13:52:50.193Z"
134
134
  status: active
135
135
  phases: [2]
136
136
  conditions:
137
- 2: "During Phase 2: (a) call synapse_recall on the primary topic + symbol_name (filter by type insight/decision/fix/risk/ash) — even 0 results is information; (b) call kenaz_lsp_callers if the topic touches a code area with multiple module crossings. Reach both at least once OR record a one-line skip reason per untriggered tool."
137
+ 2: "During Phase 2: call kenaz_lsp_callers / kenaz_lsp_references if the topic touches a code area with multiple module crossings, plus Grep on the primary topic + symbol_name. Reach them at least once OR record a one-line skip reason."
138
138
  acted_on_count: 0
139
139
  acted_on_sessions: []
140
140
  injection_count: 3
@@ -142,28 +142,15 @@ guards:
142
142
  L-008:
143
143
  source: manual
144
144
  source_id: ""
145
- lesson: "Phase 3 candidate selection without evidence is intuition. Sub-second cost to gather it; choosing the wrong path costs hours. Count callers (kenaz_lsp_callers) and recall hits (synapse_recall) per candidate before choosing."
145
+ lesson: "Phase 3 candidate selection without evidence is intuition. Sub-second cost to gather it; choosing the wrong path costs hours. Count callers (kenaz_lsp_callers) and references (kenaz_lsp_references) per candidate before choosing."
146
146
  promoted_at: "2026-05-04T13:52:55.223Z"
147
147
  status: active
148
148
  phases: [3]
149
149
  conditions:
150
- 3: "When Phase 3 selects between 2+ candidate symbols/files/tasks: call kenaz_lsp_callers and synapse_recall for each and record the counts. Pick the best-evidenced candidate OR write a one-line override reason."
150
+ 3: "When Phase 3 selects between 2+ candidate symbols/files/tasks: call kenaz_lsp_callers and kenaz_lsp_references for each and record the counts. Pick the best-evidenced candidate OR write a one-line override reason."
151
151
  acted_on_count: 0
152
152
  acted_on_sessions: []
153
153
 
154
- L-009:
155
- source: manual
156
- source_id: ""
157
- lesson: "Phase 9 closure already mandates rune inscription. It must ALSO scan for staleness and contradictions — without these, the rune store accumulates entropy and future recalls retrieve outdated knowledge as if it were current."
158
- promoted_at: "2026-05-04T13:53:00.336Z"
159
- status: active
160
- phases: [9]
161
- conditions:
162
- 9: "After inscribing rune(s): call synapse_scan_stale_runes — if any of your inscribed symbols appear stale, supersede the older rune via synapse_inscribe(supersedes=...). Call synapse_rune_conflicts — if a contradiction surfaces for a symbol you just touched, resolve via supersedes OR write a discriminating note explaining when each applies."
163
- acted_on_count: 0
164
- acted_on_sessions: []
165
- injection_count: 1
166
-
167
154
  L-010:
168
155
  source: manual
169
156
  source_id: "post-complete-stash-accumulation-bug-2026-05-05"
@@ -158,7 +158,7 @@ immutable_core:
158
158
 
159
159
  - id: IC-010
160
160
  trait: "MEM-LANG-001: All memory writes in English"
161
- value: "All synapse_inscribe, episode content, summary, and lesson fields MUST be in English"
161
+ value: "All `kenaz learn add` and memory-file lesson fields MUST be in English"
162
162
  evidence: >
163
163
  SQLite FTS5 tokenizer does not handle CJK. Chinese content returns 0 results
164
164
  on recall. This causes silent memory loss.
@@ -275,7 +275,7 @@ style_variance:
275
275
  - "User speaks Chinese → full Chinese prose with English code snippets"
276
276
  - "User speaks English → full English prose"
277
277
  non_examples:
278
- - "Memory writes (synapse_inscribe) in Chinese — this VIOLATES IC-010, not SV"
278
+ - "Memory writes (`kenaz learn add`) in Chinese — this VIOLATES IC-010, not SV"
279
279
 
280
280
  - id: SV-002
281
281
  trait: "Response verbosity and detail depth"
@@ -309,10 +309,10 @@ style_variance:
309
309
  - id: SV-005
310
310
  trait: "Cognitive tool selection order"
311
311
  bounds: >
312
- Which Synapse tools to run and in what order is context-dependent.
312
+ Which code-navigation tools to run and in what order is context-dependent.
313
313
  The mandate is to use cognitive tools for non-trivial changes.
314
314
  examples:
315
- - "synapse_recall → kenaz_lsp_callers → kenaz_lsp_references (one valid sequence)"
315
+ - "Grep → kenaz_lsp_callers → kenaz_lsp_references (one valid sequence)"
316
316
  non_examples:
317
317
  - "Skipping all cognitive tools for scope that touches core symbols — FAIL-009"
318
318
 
@@ -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。'"