kenaz 0.3.18 → 0.3.20

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 (329) hide show
  1. package/core/.claude/commands/agent-worker.md +1 -1
  2. package/core/.claude/commands/architect.md +1 -2
  3. package/core/.claude/commands/spec.md +1 -1
  4. package/core/.claude/commands//347/224/242/345/223/201.md +1 -1
  5. package/core/.claude/hooks/__tests__/task-1977-dedupe-guard.test.js +8 -8
  6. package/core/.claude/skills/architect_agent/SKILL.md +11 -92
  7. package/core/.claude/skills/assessment_agent/SKILL.md +0 -1
  8. package/core/.claude/skills/backend_engineer/SKILL.md +3 -6
  9. package/core/.claude/skills/code_reviewer/SKILL.md +1 -1
  10. package/core/.claude/skills/code_reviewer/patterns.yaml +1 -1
  11. package/core/.claude/skills/designer/SKILL.md +3 -6
  12. package/core/.claude/skills/dev_agent/SKILL.md +30 -491
  13. package/core/.claude/skills/developer/SKILL.md +3 -6
  14. package/core/.claude/skills/feature_agent/SKILL.md +3 -17
  15. package/core/.claude/skills/product_manager/SKILL.md +29 -1064
  16. package/core/.claude/skills/qa_engineer/SKILL.md +12 -17
  17. package/core/.claude/skills/spec_optimizer/SKILL.md +25 -275
  18. package/core/.claude/skills/sre_agent/SKILL.md +3 -6
  19. package/core/.collaboration/README.md +2 -3
  20. package/core/.collaboration/core/task-api.js +5 -138
  21. package/core/.collaboration/docs/CLI.md +0 -2
  22. package/core/.failure/INDEX.yaml +6 -40
  23. package/core/.failure/agent-execution/FAIL-013-search-cwd-drift-and-case-mismatch.yaml +1 -1
  24. package/core/.failure/tools/README.md +9 -227
  25. package/core/.formation/bifrost/launch.js +1 -6
  26. package/core/.formation/bifrost/launch.test.js +1 -1
  27. package/core/.formation/bifrost/shared/ansuz-boot-policy.js +3 -3
  28. package/core/.formation/bifrost/shared/ansuz-boot-policy.test.js +1 -2
  29. package/core/.formation/tools/__tests__/arms.test.js +41 -0
  30. package/core/.formation/tools/__tests__/diagnose-bug.test.js +10 -0
  31. package/core/.formation/tools/__tests__/m1-hmap-convid.test.js +1 -124
  32. package/core/.formation/tools/arms.js +48 -0
  33. package/core/.formation/tools/dispatch.js +24 -15
  34. package/core/.formation/tools/kenaz-stats.js +32 -8
  35. package/core/.formation/tools/kenaz-stats.test.js +15 -2
  36. package/core/.formation/tools/loader.js +17 -140
  37. package/core/.formation/tools/post-complete.js +0 -31
  38. package/core/.formation/tools/prompt.js +16 -1
  39. package/core/.formation/tools/prompt.test.js +20 -0
  40. package/core/.rule/INDEX.yaml +0 -18
  41. package/core/.rule/general/agent-workflow.yaml +14 -164
  42. package/core/.rule/general/project-self-containment.yaml +8 -19
  43. package/core/.rule/general/rust-verify-target.yaml +6 -5
  44. package/core/.rule/general/synapse-code-intelligence.yaml +3 -3
  45. package/core/.specialist/Amelia/capability.yaml +12 -12
  46. package/core/.specialist/Amelia/workflow.yaml +2 -2
  47. package/core/.specialist/Ansuz/SYSTEM_DOC.md +20 -578
  48. package/core/.specialist/Ansuz/cognitive_principles.yaml +2 -3
  49. package/core/.specialist/Ansuz/concepts/boot_rules_summary.yaml +0 -1
  50. package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +1 -2
  51. package/core/.specialist/Ansuz/core.yaml +6 -108
  52. package/core/.specialist/Ansuz/guards/lesson_guards.yaml +0 -3
  53. package/core/.specialist/Ansuz/identity_contract.yaml +0 -1
  54. package/core/.specialist/Ansuz/knowledge.yaml +0 -4
  55. package/core/.specialist/Ansuz/rule.yaml +0 -1
  56. package/core/.specialist/Ansuz/tools/handoff-session-identity.test.js +6 -150
  57. package/core/.specialist/tests/runtime-discovery/README.md +1 -1
  58. package/core/.specialist/tools/__tests__/task-2374-usage-counter.test.js +1 -12
  59. package/core/.specialist/tools/ansuz-boot-fast.js +7 -4
  60. package/core/.specialist/tools/ansuz-boot-fast.test.js +10 -3
  61. package/core/.specialist/tools/prompt-files.test.js +1 -0
  62. package/core/.specialist/tools/task-bridge.js +1 -66
  63. package/core/.system/README.md +11 -552
  64. package/core/.system/collaboration/README.md +10 -174
  65. package/core/CLAUDE.md +1 -6
  66. package/core/KENAZ_CORE_VERSION +1 -1
  67. package/core/dev/scripts/js-yaml-resolution.test.js +1 -1
  68. package/core/dev/scripts/peer-identity-e2e.js +402 -0
  69. package/core/dev/scripts/peer-identity-e2e.md +47 -0
  70. package/core/dev/scripts/relay-admin.js +94 -0
  71. package/core/dev/scripts/relay-admin.test.js +131 -0
  72. package/core/dev/scripts/run-rust-tests.js +9 -45
  73. package/core/dev/scripts/rust-verify-worktree.js +4 -4
  74. package/core/dev/scripts/verify-target-dir.js +6 -6
  75. package/core/plugins/kenaz/INVENTORY.md +8 -8
  76. package/core/plugins/kenaz/README.md +10 -0
  77. package/core/plugins/kenaz/commands/architect.md +1 -2
  78. package/core/plugins/kenaz/commands/spec.md +1 -1
  79. package/core/plugins/kenaz/commands//347/224/242/345/223/201.md +1 -1
  80. package/core/plugins/kenaz/guidance.md +1 -1
  81. package/core/plugins/kenaz/hooks/kenaz-hook.js +2 -1
  82. package/core/plugins/kenaz/hooks/sdk-gate.js +9 -0
  83. package/core/plugins/kenaz/scripts/kenaz.test.js +15 -3
  84. package/core/plugins/kenaz/scripts/sync.js +1 -1
  85. package/core/plugins/kenaz/scripts/ygg.js +8 -0
  86. package/core/plugins/kenaz/scripts/ygg.test.js +72 -0
  87. package/core/plugins/kenaz/skills/architect_agent/SKILL.md +11 -92
  88. package/core/plugins/kenaz/skills/assessment_agent/SKILL.md +0 -1
  89. package/core/plugins/kenaz/skills/backend_engineer/SKILL.md +3 -6
  90. package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +1 -1
  91. package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +1 -1
  92. package/core/plugins/kenaz/skills/designer/SKILL.md +3 -6
  93. package/core/plugins/kenaz/skills/dev_agent/SKILL.md +30 -491
  94. package/core/plugins/kenaz/skills/developer/SKILL.md +3 -6
  95. package/core/plugins/kenaz/skills/feature_agent/SKILL.md +3 -17
  96. package/core/plugins/kenaz/skills/product_manager/SKILL.md +29 -1064
  97. package/core/plugins/kenaz/skills/qa_engineer/SKILL.md +12 -17
  98. package/core/plugins/kenaz/skills/spec_optimizer/SKILL.md +25 -275
  99. package/core/plugins/kenaz/skills/sre_agent/SKILL.md +3 -6
  100. package/core/plugins/kenaz-peer/hooks/register.test.ts +32 -0
  101. package/core/plugins/kenaz-peer/hooks/register.ts +9 -0
  102. package/package.json +6 -6
  103. package/core/.claude/commands/archive.md +0 -24
  104. package/core/.claude/commands/init.md +0 -112
  105. package/core/.claude/commands/legacy_dev.md +0 -18
  106. package/core/.claude/commands/product-review.md +0 -131
  107. package/core/.claude/commands/strategy.md +0 -141
  108. package/core/.claude/commands/sunny.md +0 -1
  109. package/core/.claude/commands//347/224/242/345/223/201/346/252/242/350/246/226.md +0 -129
  110. package/core/.claude/commands//351/200/262/345/272/246.md +0 -15
  111. package/core/.claude/hooks/__tests__/substrate.test.js +0 -122
  112. package/core/.claude/hooks/_substrate-paths.js +0 -95
  113. package/core/.claude/hooks/context-check.js +0 -51
  114. package/core/.claude/hooks/fatigue-check.js +0 -52
  115. package/core/.claude/hooks/handoff-snapshot-on-commit.js +0 -154
  116. package/core/.claude/hooks/handoff-snapshot-on-question.js +0 -158
  117. package/core/.claude/hooks/handoff-staleness.js +0 -197
  118. package/core/.claude/hooks/jev-thalamus-context.js +0 -17
  119. package/core/.claude/hooks/jev-thalamus-context.test.js +0 -41
  120. package/core/.claude/hooks/lease-release.js +0 -119
  121. package/core/.claude/hooks/lease-touch.js +0 -96
  122. package/core/.claude/hooks/reflex-feedback.js +0 -5
  123. package/core/.claude/hooks/session-init.ps1 +0 -49
  124. package/core/.claude/hooks/sound-event.js +0 -70
  125. package/core/.claude/hooks/sound-event.sh +0 -37
  126. package/core/.claude/hooks/stream-delta.js +0 -169
  127. package/core/.claude/no-hooks.settings.json +0 -3
  128. package/core/.claude/skills/legacy_dev/SKILL.md +0 -202
  129. package/core/.claude/skills/sunny/SKILL.md +0 -74
  130. package/core/.collaboration/cli/commands/assign.js +0 -39
  131. package/core/.collaboration/cli/commands/claim.js +0 -33
  132. package/core/.collaboration/cli/commands/complete.js +0 -44
  133. package/core/.collaboration/cli/commands/create.js +0 -110
  134. package/core/.collaboration/cli/commands/get.js +0 -83
  135. package/core/.collaboration/cli/commands/index.js +0 -52
  136. package/core/.collaboration/cli/commands/list.js +0 -51
  137. package/core/.collaboration/cli/commands/lock.js +0 -45
  138. package/core/.collaboration/cli/commands/rebuild.js +0 -39
  139. package/core/.collaboration/cli/commands/search.js +0 -61
  140. package/core/.collaboration/cli/commands/stats.js +0 -61
  141. package/core/.collaboration/cli/commands/transfer.js +0 -41
  142. package/core/.collaboration/cli/commands/unlock.js +0 -48
  143. package/core/.collaboration/cli/formatters/help-formatter.js +0 -70
  144. package/core/.collaboration/cli/formatters/index.js +0 -7
  145. package/core/.collaboration/cli/task-cli.js +0 -46
  146. package/core/.collaboration/cli/utils/arg-parser.js +0 -74
  147. package/core/.collaboration/cli/utils/git-user.js +0 -25
  148. package/core/.collaboration/cli/utils/index.js +0 -9
  149. package/core/.collaboration/cli/utils/output.js +0 -10
  150. package/core/.collaboration/config/default.yaml +0 -189
  151. package/core/.collaboration/core/conflict-resolver.js +0 -461
  152. package/core/.collaboration/core/conflict-resolver.test.js +0 -389
  153. package/core/.collaboration/core/migrate-legacy.js +0 -260
  154. package/core/.collaboration/docs/API.md +0 -787
  155. package/core/.collaboration/docs/ARCHITECTURE.md +0 -596
  156. package/core/.collaboration/docs/FAQ.md +0 -695
  157. package/core/.collaboration/docs/MIGRATION.md +0 -804
  158. package/core/.collaboration/docs/examples/README.md +0 -320
  159. package/core/.collaboration/docs/examples/advanced-queries.js +0 -261
  160. package/core/.collaboration/docs/examples/basic-usage.js +0 -184
  161. package/core/.collaboration/docs/examples/team-workflow.js +0 -352
  162. package/core/.failure/agent-execution/FAIL-001-agent-no-output.yaml +0 -391
  163. package/core/.failure/agent-execution/FAIL-007-pm-lead-wrong-team-invocation.yaml +0 -0
  164. package/core/.failure/agent-execution/FAIL-010-phase0-poem-format-skipped.yaml +0 -28
  165. package/core/.failure/agent-execution/FAIL-010-skipping-cognitive-checkpoint-after-verification.yaml +0 -59
  166. package/core/.failure/agent-execution/FAIL-012-grep-shortcut-during-investigation.yaml +0 -85
  167. package/core/.failure/architecture/FAIL-006-python-version-compatibility.yaml +0 -445
  168. package/core/.failure/pipeline/FAIL-003-queue-pollution.yaml +0 -335
  169. package/core/.failure/pipeline/README.md +0 -95
  170. package/core/.failure/retired/FAIL-009-skipping-synapse-pulse-before-code-change.yaml +0 -49
  171. package/core/.failure/tools/USAGE_GUIDE.md +0 -323
  172. package/core/.failure/tools/check_failures.ps1 +0 -387
  173. package/core/.failure/tools/log_failure.ps1 +0 -474
  174. package/core/.formation/.episode-input.json +0 -10
  175. package/core/.formation/.merge-lock +0 -1
  176. package/core/.formation/lead.yaml +0 -118
  177. package/core/.formation/legacy.bak/designer.yaml +0 -57
  178. package/core/.formation/legacy.bak/pm.yaml +0 -57
  179. package/core/.formation/legacy.bak/qa.yaml +0 -57
  180. package/core/.formation/legacy.bak/review.yaml +0 -62
  181. package/core/.formation/legacy.bak/scheduler.yaml +0 -129
  182. package/core/.formation/legacy.bak/sre.yaml +0 -57
  183. package/core/.formation/role-map.yaml +0 -274
  184. package/core/.formation/roles/_shared/modules/code_review.yaml +0 -98
  185. package/core/.formation/roles/_shared/modules/security.yaml +0 -103
  186. package/core/.formation/roles/_shared/modules/testing.yaml +0 -14
  187. package/core/.formation/roles/backend/role.yaml +0 -93
  188. package/core/.formation/roles/code_reviewer/role.yaml +0 -102
  189. package/core/.formation/roles/database_optimizer/role.yaml +0 -107
  190. package/core/.formation/roles/designer/role.yaml +0 -66
  191. package/core/.formation/roles/developer/role.yaml +0 -75
  192. package/core/.formation/roles/frontend/role.yaml +0 -134
  193. package/core/.formation/roles/incident_response/role.yaml +0 -89
  194. package/core/.formation/roles/qa/role.yaml +0 -89
  195. package/core/.formation/roles/security/role.yaml +0 -87
  196. package/core/.formation/roles/sre/role.yaml +0 -66
  197. package/core/.formation/skills/coordinator.yaml +0 -52
  198. package/core/.formation/solo/diagnosis.yaml +0 -78
  199. package/core/.formation/solo/strategy.yaml +0 -121
  200. package/core/.formation/tests/hello.txt +0 -2
  201. package/core/.formation/tools/coordinator.js +0 -350
  202. package/core/.formation/tools/jev-correction.js +0 -214
  203. package/core/.formation/tools/jev-correction.test.js +0 -178
  204. package/core/.formation/tools/log-reader.js +0 -232
  205. package/core/.formation/tools/revert-daemon-state.js +0 -162
  206. package/core/.formation/tools/test-drift.js +0 -148
  207. package/core/.formation/unit/heimdall.yaml +0 -96
  208. package/core/.formation/unit/plan.yaml +0 -67
  209. package/core/.formation/unit/think.yaml +0 -58
  210. package/core/.kenaz/MUNINN_SNAPSHOT9_EPISODE.json +0 -32
  211. package/core/.kenaz/MUNINN_SNAPSHOT9_RUNE.json +0 -23
  212. package/core/.kenaz/MUNINN_SNAPSHOT9_SUMMARY.md +0 -89
  213. package/core/.kenaz/ash_TASK_1428-20260507.json +0 -14
  214. package/core/.kenaz/muninn_episode_write.ps1 +0 -17
  215. package/core/.kenaz/muninn_snapshot11_rune_candidates.md +0 -63
  216. package/core/.kenaz/muninn_snapshot1_rune_candidates.md +0 -49
  217. package/core/.kenaz/runes_TASK_1428.json +0 -57
  218. package/core/.kenaz/tmp_heimdall_proposal_8d3e392.json +0 -13
  219. package/core/.kenaz/tmp_props.json +0 -1
  220. package/core/.kenaz/tmp_sounddrop_t1_prompt.txt +0 -371
  221. package/core/.rule/MECHANIZED.md +0 -61
  222. package/core/.rule/general/cortex-memory-recall.yaml +0 -446
  223. package/core/.rule/general/pipeline.yaml +0 -246
  224. package/core/.rule/general/sunny-access-control.yaml +0 -60
  225. package/core/.rule/general/system-invariants.yaml +0 -231
  226. package/core/.rule/pipeline/PPL-002-completed-task-archival.yaml +0 -528
  227. package/core/.rule/pipeline/auto-update.yaml +0 -282
  228. package/core/.rule/pipeline/task-execution.yaml +0 -365
  229. package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +0 -65
  230. package/core/.specialist/Ansuz/experiments/boot_ablation_replay.js +0 -197
  231. package/core/.specialist/Ansuz/tools/bootstrap-anchors.js +0 -289
  232. package/core/.specialist/Ansuz/workflow.yaml +0 -1225
  233. package/core/.specialist/experiments/rg_benchmark.js +0 -523
  234. package/core/.specialist/experiments/rg_benchmark_results.json +0 -27
  235. package/core/.specialist/tools/jev-optional-context.js +0 -107
  236. package/core/.specialist/tools/jev-optional-context.test.js +0 -152
  237. package/core/.specialist/tools/memory-action-log.js +0 -839
  238. package/core/.specialist/tools/phase-gate.js +0 -3534
  239. package/core/.specialist/tools/phase-gate.test.js +0 -85
  240. package/core/.specialist/tools/precompute-runner.js +0 -444
  241. package/core/.specialist/tools/rule-engine.js +0 -621
  242. package/core/.specialist/tools/task-bridge-jev.test.js +0 -170
  243. package/core/.synapse/memory-shared.json.sync +0 -1
  244. package/core/.system/agent-skills/README.md +0 -724
  245. package/core/.system/cli-tools/README.md +0 -724
  246. package/core/.system/cortex/MODULES.md +0 -1046
  247. package/core/.system/dashboard/FRONTEND.md +0 -812
  248. package/core/.system/dashboard/README.md +0 -737
  249. package/core/.system/failure/README.md +0 -723
  250. package/core/.system/formation/LEGACY_SKILLS.md +0 -974
  251. package/core/.system/formation/POST_COMPLETE.md +0 -602
  252. package/core/.system/formation/README.md +0 -1094
  253. package/core/.system/formation/TOOLS_REFERENCE.md +0 -1145
  254. package/core/.system/kenaz/README.md +0 -787
  255. package/core/.system/memory/README.md +0 -719
  256. package/core/.system/pipeline/README.md +0 -712
  257. package/core/.system/rule/README.md +0 -794
  258. package/core/.system/sunny/README.md +0 -476
  259. package/core/.system/sunny/RULES.json +0 -89
  260. package/core/.system/sunny/knowledge/INDEX.md +0 -37
  261. package/core/.system/sunny/knowledge/agent-teams-api.md +0 -0
  262. package/core/.system/sunny/knowledge/ansuz-specialist.md +0 -500
  263. package/core/.system/sunny/knowledge/claude-cli-spawn.md +0 -177
  264. package/core/.system/sunny/knowledge/collaboration-api.md +0 -925
  265. package/core/.system/sunny/teammates/README.md +0 -107
  266. package/core/.system/sunny/teammates/how_to_use.yaml +0 -101
  267. package/core/.system/sunny/teammates/tools/headless/launcher.js +0 -318
  268. package/core/.system/sunny/teammates/tools/powershell/launcher.js +0 -241
  269. package/core/.system/sunny/teammates/tools/powershell/start.bat +0 -50
  270. package/core/.system/sunny/teammates/tools/utils/env.js +0 -96
  271. package/core/.system/sunny/teammates/tools/utils/format-output.js +0 -329
  272. package/core/.system/sunny/tools.json +0 -101
  273. package/core/dev/scripts/cleanup-queue.js +0 -184
  274. package/core/dev/scripts/cleanup_queue.js +0 -86
  275. package/core/dev/scripts/legacy/README.md +0 -39
  276. package/core/dev/scripts/legacy/dev_agent_scheduler.ps1.bak +0 -536
  277. package/core/dev/scripts/legacy/multi_agent_scheduler.ps1.bak +0 -1978
  278. package/core/dev/scripts/matrix/CLI_README.md +0 -214
  279. package/core/dev/scripts/matrix/README.md +0 -310
  280. package/core/dev/scripts/matrix/package-lock.json +0 -4266
  281. package/core/dev/scripts/matrix/package.json +0 -55
  282. package/core/dev/scripts/matrix/src/abbreviations.ts +0 -295
  283. package/core/dev/scripts/matrix/src/cli/commands/convert.ts +0 -211
  284. package/core/dev/scripts/matrix/src/cli/commands/create.ts +0 -95
  285. package/core/dev/scripts/matrix/src/cli/commands/delete.ts +0 -102
  286. package/core/dev/scripts/matrix/src/cli/commands/list-tags.ts.wip +0 -140
  287. package/core/dev/scripts/matrix/src/cli/commands/manage-tags.ts.wip +0 -173
  288. package/core/dev/scripts/matrix/src/cli/commands/query.ts +0 -261
  289. package/core/dev/scripts/matrix/src/cli/commands/read.ts +0 -77
  290. package/core/dev/scripts/matrix/src/cli/commands/stats.ts.wip +0 -168
  291. package/core/dev/scripts/matrix/src/cli/commands/tokens.ts.wip +0 -126
  292. package/core/dev/scripts/matrix/src/cli/commands/update.ts +0 -147
  293. package/core/dev/scripts/matrix/src/cli/commands/validate.ts +0 -275
  294. package/core/dev/scripts/matrix/src/cli/index.ts +0 -350
  295. package/core/dev/scripts/matrix/src/cli/utils/file-handler.ts +0 -72
  296. package/core/dev/scripts/matrix/src/cli/utils/logger.ts +0 -65
  297. package/core/dev/scripts/matrix/src/index.ts +0 -62
  298. package/core/dev/scripts/matrix/src/indexer/tag-indexer.ts +0 -165
  299. package/core/dev/scripts/matrix/src/parser.ts +0 -281
  300. package/core/dev/scripts/matrix/src/serializer.ts +0 -151
  301. package/core/dev/scripts/matrix/src/validator.ts +0 -301
  302. package/core/dev/scripts/matrix/tests/abbreviations.test.ts +0 -122
  303. package/core/dev/scripts/matrix/tests/cli.test.ts +0 -177
  304. package/core/dev/scripts/matrix/tests/convert.test.ts +0 -143
  305. package/core/dev/scripts/matrix/tests/parser.test.ts +0 -203
  306. package/core/dev/scripts/matrix/tests/query.test.ts +0 -85
  307. package/core/dev/scripts/matrix/tests/serializer.test.ts +0 -197
  308. package/core/dev/scripts/matrix/tests/validate.test.ts +0 -141
  309. package/core/dev/scripts/matrix/tests/validator.test.ts +0 -167
  310. package/core/dev/scripts/matrix/tsconfig.json +0 -20
  311. package/core/dev/scripts/matrix/types/index.d.ts +0 -111
  312. package/core/dev/scripts/matrix/types/index.d.ts.map +0 -1
  313. package/core/dev/scripts/matrix/types/index.js +0 -8
  314. package/core/dev/scripts/matrix/types/index.js.map +0 -1
  315. package/core/dev/scripts/matrix/types/index.ts +0 -124
  316. package/core/dev/scripts/memory-usage-report.js +0 -152
  317. package/core/dev/scripts/probe/ansuz-scaffold-ablation.js +0 -579
  318. package/core/dev/scripts/probe/ansuz-scaffold-ablation.test.js +0 -244
  319. package/core/dev/scripts/probe/hook-latency-probe.js +0 -315
  320. package/core/dev/scripts/probe/hook-latency-probe.test.js +0 -105
  321. package/core/dev/scripts/probe/prediction-signal-auc.js +0 -483
  322. package/core/dev/scripts/probe/prediction-signal-auc.test.js +0 -200
  323. package/core/dev/scripts/test-pty-ws-tunnel.js +0 -229
  324. package/core/dev/scripts/validate_pipeline.js +0 -197
  325. package/core/dev/spikes/task2145-evidence-20261004/backend-log-excerpt.txt +0 -56
  326. package/core/dev/spikes/task2145-evidence-20261004/graph.shadow +0 -0
  327. package/core/dev/spikes/task2145-evidence-20261004/graph.wal +0 -0
  328. package/core/dev/spikes/task2145-evidence-20261004/graph_corrupt_suspect.marker +0 -1
  329. package/core/plugins/kenaz/commands/strategy.md +0 -141
@@ -1,586 +1,28 @@
1
- # Ansuz — 產品全生命週期引擎
1
+ # Ansuz
2
2
 
3
- > **ᚨ** — 神諭符文:理解意圖,傳遞給執行層
3
+ Kenaz's orchestrator specialist. Understands the request, does small fixes itself, cards and dispatches bigger work to subagents, verifies on the real path before merging, then reports.
4
4
 
5
- **版本**: 1.0.0
6
- **符文**: Ansuz(ᚨ)— 北歐盧恩符文,象徵智慧與溝通
7
- **定位**: Product Manager + Formation Lead 合一
8
- **核心**: 從需求到完成的全生命週期引擎
5
+ ## Entry and boot
9
6
 
10
- ---
7
+ `/Ansuz` (`.claude/commands/Ansuz.md`) runs `node .specialist/tools/ansuz-boot-fast.js`, which prints the banner (open cards, project handoff, lessons). The boot prompt itself is `elixir.yaml` (loaded verbatim by `session.js prompt Ansuz --depth=elixir`).
11
8
 
12
- ## 與舊系統的差異
9
+ ## Files
13
10
 
14
- | 特性 | 舊 PM(product_manager) | 舊 Lead(formation_lead) | Ansuz |
15
- |------|-------------------------|--------------------------|-------|
16
- | **職責範圍** | 需求分析 + 任務建立 | 陣型判斷 + dispatch + 追蹤 | 全生命週期(需求 → 完成) |
17
- | **需求理解** | ✅ 深度分析 | ❌ 依賴已建任務 | ✅ 深度分析 + 意圖推導 |
18
- | **任務設計** | ✅ 拆分 + 依賴分析 | ❌ 接受已建任務 | ✅ 拆分 + 依賴 + scope 衝突檢測 |
19
- | **執行調度** | ❌ 無(需用戶 /dev) | ✅ Formation 調度 | ✅ Formation 調度 |
20
- | **結果驗證** | ❌ 不驗證 | ✅ 驗證 | ✅ 驗證 + 交叉比對原始碼 |
21
- | **完成後處理** | ❌ 無 | ⚠️ 部分(Git) | ✅ Archive + Git + 回報 |
22
- | **交接次數** | 1 次(PM → 用戶 → Lead) | 0 次(Lead 走到底) | 0 次(Ansuz 走到底) |
23
- | **工作流程** | 線性 9 階段 | 線性 7 階段 | **事件驅動 7 phases** |
11
+ | File | Role |
12
+ |---|---|
13
+ | `elixir.yaml` | Always-loaded identity, role boundary, autonomy contract, mandates |
14
+ | `RULES.md` | Read on demand: trust boundary, autonomy, dispatch, verify and land, handoff, lessons, code navigation |
15
+ | `ROUTING.md` | Work routing by difficulty x blast radius (DIRECT / FAST / FULL, high-risk paths always FULL) |
16
+ | `VERIFY.md` | Verification policy before merge |
17
+ | `exo_cortex_tools.yaml` | Intent to tool table for code navigation (`kenaz_lsp_*`, Grep/Glob) |
18
+ | `capability.yaml`, `knowledge.yaml`, `core.yaml`, `principles.yaml`, `cognitive_principles.yaml`, `identity_contract.yaml` | Capability, agent skill map, support definitions and module registry, principles, identity contract |
19
+ | `modules/`, `concepts/`, `decisions/`, `guards/` | Lazy-loaded protocols and reference notes |
20
+ | `tools/` | Handoff, state and verify-and-land helpers |
24
21
 
25
- **關鍵優勢**:
26
- - 舊系統:PM 建完任務 → 用戶手動 `/dev` → Lead 執行(**交接損失 context**)
27
- - Ansuz:從需求到完成一氣呵成,**無斷裂交接**
22
+ ## Working loop
28
23
 
29
- ---
24
+ 1. Route the change (ROUTING.md). Small, low-risk edits: do them directly and run the nearest tests.
25
+ 2. Larger or risky work: create a task card (`node .collaboration/core/task-api.js create` or `kenaz_task_create`), then `node .formation/tools/dispatch.js --skill=do --task=TASK_XXX --dispatch-mode=subagent`. Subagent is the only dispatch path.
26
+ 3. The subagent commits in its worktree. Ansuz verifies on the real path (VERIFY.md), merges, completes the card (`task-api.js complete`), and records a handoff when stopping.
30
27
 
31
- ## 核心架構
32
-
33
- ### 1. 身份與邊界
34
-
35
- ```yaml
36
- 身份: "Ansuz = 產品全生命週期引擎(PM + Lead 合一)"
37
- 行為規則:
38
- ❌ 不 invoke 其他 Skill — 不切換身份
39
- ✅ 需要執行時 → Agent tool subagent dispatch(dispatch.js --dispatch-mode=subagent)
40
- ✅ 本體負責:需求理解、任務設計、陣型判斷、調度、追蹤、回報
41
- ❌ 不親自寫程式碼 — 只做決策和調度
42
- ```
43
-
44
- **工作模式**:
45
- - **Ansuz = 指揮官 + 調度者**,不是執行者
46
- - 所有實作交給 Formation 系統的 agent(developer, backend, designer...)
47
- - 通過 `.formation/tools/dispatch.js` 組裝 prompt,再由 Agent tool subagent 執行任務
48
-
49
- ### 2. 事件驅動生命週期(7 Phases)
50
-
51
- Ansuz 使用事件驅動模型,而非線性階段:
52
-
53
- ```
54
- ┌─────────────────────────────────────────────────────────────┐
55
- │ Event-Driven Workflow │
56
- │ │
57
- │ Trigger: user_request │
58
- │ ↓ │
59
- │ Phase 1: understand — 理解需求意圖 │
60
- │ ↓ │
61
- │ Phase 2: design — 設計任務(拆分 + 依賴 + scope) │
62
- │ ↓ │
63
- │ Phase 3: create — 建立任務卡(.collaboration) │
64
- │ ↓ │
65
- │ Phase 4: dispatch — 陣型判斷 + Formation 調度 │
66
- │ ↓ │
67
- │ Trigger: result_arrived │
68
- │ ↓ │
69
- │ Phase 5: on_result — 驗證輸出 + 交叉比對原始碼 │
70
- │ ├─ 通過 ↓ │
71
- │ │ Phase 6: post_complete — Archive + Git 分支管理 │
72
- │ │ ↓ │
73
- │ │ Phase 7: report — 回報結果(結構化輸出) │
74
- │ │ │
75
- │ └─ 失敗 → 建 [FIX] 任務 → 回到 Phase 4 dispatch ─┐ │
76
- │ (閉環迴圈,不可停在 backlog) │ │
77
- │ ↑─────────────────────────────────────────┘ │
78
- │ │
79
- │ Error Path: │
80
- │ error_occurred → 重派 | 建 FIX 並 dispatch | 換策略 | 升級 │
81
- │ conflict_detected → 交叉驗證 | 問 用戶 │
82
- └─────────────────────────────────────────────────────────────┘
83
- ```
84
-
85
- **與舊系統的關鍵差異**:
86
- - 舊 PM/Lead:線性階段,每個階段完成才進下一階段
87
- - Ansuz:事件驅動,多條任務線可交疊、並行、動態響應
88
-
89
- ### 3. 七條底層原則
90
-
91
- Ansuz 的決策邏輯基於 7 條底層原則(定義於 `principles.yaml`):
92
-
93
- | 原則 | 說明 | 應用場景 |
94
- |------|------|---------|
95
- | **lifecycle_over_handoff** | 全生命週期 > 分段交接 | 理解需求的人負責到底,不丟給下一棒 |
96
- | **minimal_formation** | 最輕量陣型 > 最大陣型 | 能 unit 不 solo,能 solo 不 squad |
97
- | **structural_over_estimation** | 結構 > 估計 | 用依賴圖決定前景/背景,不猜執行時間 |
98
- | **verifiable_over_explainable** | 可驗證 > 可解釋 | 交叉比對原始碼,不因邏輯通順就採信 |
99
- | **real_dependency_over_perceived** | 依賴關係 > 感覺相關 | 真依賴 = B 的輸入包含 A 的輸出 |
100
- | **intent_over_literal** | 意圖 > 字面 | 理解人類要什麼,不逐字執行人類說什麼 |
101
- | **expose_over_hide** | 暴露 > 隱藏 | 壞消息早說,不等「確認」後再說 |
102
- | **wire_over_rewrite** | 接線 > 重寫 | 優先用現有函數組合,不全新實作 |
103
-
104
- **用法**:
105
- - 遇到任何決策時,先查原則 → 從原則推導答案
106
- - 如果 workflow 的規則與原則矛盾 → 原則贏,修改規則
107
- - 新情境沒有對應規則 → 從原則推導,不猜測
108
-
109
- ---
110
-
111
- ## Formation 調度能力
112
-
113
- ### 1. 陣型判斷邏輯
114
-
115
- **原則**: "能 unit 不 solo,能 solo 不 squad,能 squad 不 legion"
116
-
117
- | 陣型 | Agents | 通訊方式 | 適用場景 | Skills |
118
- |------|--------|---------|---------|--------|
119
- | **unit** | 1 | 無 | 目標明確、單一 scope | do, think, plan |
120
- | **solo** | 1 | 自我對話 | 需要多角度動態分析 | strategy, diagnosis |
121
- | **squad** | N | shared_context | 可拆成獨立子任務並行 | blitz, sweep |
122
- | **legion** | N | 即時通訊 | 有順序依賴或回饋循環 | forge, hive |
123
-
124
- **判斷標準**:
125
- - 單檔修改 → unit/do
126
- - 多檔無依賴 → squad/blitz 並行
127
- - 有依賴回饋 → legion/forge
128
-
129
- **反模式**:
130
- - ❌ 不為看起來厲害而選大陣型
131
- - ❌ 不為開 agent 而開 agent
132
- - ❌ 不為流程而流程
133
-
134
- ### 子專案支援
135
-
136
- 當工作目錄是子專案(有 `.kenaz/project.yaml`)時,所有 CLI 命令必須:
137
- 1. 用 `{CORE}` 前綴指向 KenazAI core 的工具路徑
138
- 2. 加 `--project-path {PROJECT_PATH}` 讓工具操作正確的 repo
139
-
140
- ```bash
141
- # 子專案偵測
142
- if [ -f .kenaz/project.yaml ]; then
143
- # CORE = project.yaml 的 core_path
144
- # PROJECT_PATH = 當前工作目錄
145
- fi
146
-
147
- # 子專案範例
148
- node {CORE}/.collaboration/core/task-api.js --project-path {PROJECT_PATH} list
149
- node {CORE}/.formation/tools/dispatch.js --project-path {PROJECT_PATH} --skill=do --task=TASK_XXX --dispatch-mode=subagent
150
- node {CORE}/.formation/tools/post-complete.js --task=TASK_XXX --project-path={PROJECT_PATH}
151
- ```
152
-
153
- > 以下 CLI 範例均為 Core 專案格式。子專案時請加上述參數。
154
-
155
- ### 2. Dispatch 執行機制
156
-
157
- **工具**: `.formation/tools/dispatch.js`
158
- **方法**: Bash tool → `node dispatch.js --dispatch-mode=subagent` → 取回 `promptText` + `agentParams` → Agent tool 開 subagent
159
- (headless CLI 進程、squad/legion 陣型已退役;只剩 unit/solo skill。)
160
-
161
- **CLI 命令格式**:
162
-
163
- ```bash
164
- # Unit 陣型
165
- node .formation/tools/dispatch.js --skill=do --task=TASK_XXX --dispatch-mode=subagent
166
-
167
- # Solo 陣型
168
- node .formation/tools/dispatch.js --formation=solo --skill=strategy --task=TASK_XXX --dispatch-mode=subagent
169
- ```
170
-
171
- **關鍵規則**:
172
- - ✅ 所有調度必須經過 `.collaboration` 任務系統
173
- - ✅ 流程:create → dispatch.js(subagent) → Agent tool → complete
174
- - ✅ 有依賴 → 前一個完成再 dispatch 下一個;同一 project 序列化
175
- - ❌ 不跳過任務系統直接 dispatch
176
- - ❌ 不手寫 subagent prompt — 用 dispatch.js 組裝(prompt 組裝、principles 注入)
177
-
178
- ### 3. Scope 安全保證
179
-
180
- **原則**: "併發安全由 Ansuz 保證,agent 不感知"
181
-
182
- ```yaml
183
- Scope 分配規則:
184
- 同檔案: "一個實例處理整個檔案"
185
- 跨檔案: "fan_out,按模組/目錄切"
186
- 派工前: "確認 scope 無重疊"
187
- ```
188
-
189
- **實現**:
190
- - 每個任務定義 `scope_paths: []`(修改的文件/目錄)
191
- - Dispatch 前檢查 scope 是否重疊
192
- - 衝突任務順序執行,無衝突任務並行執行
193
-
194
- ---
195
-
196
- ## 任務系統整合
197
-
198
- ### 1. 任務生命週期
199
-
200
- ```bash
201
- # 建立任務
202
- node .collaboration/core/task-api.js create \
203
- --title "任務標題" \
204
- --priority P1 \
205
- --role developer
206
-
207
- # 認領任務
208
- node .collaboration/core/task-api.js claim TASK_XXX
209
-
210
- # 完成任務
211
- node .collaboration/core/task-api.js complete TASK_XXX
212
-
213
- # 阻塞任務
214
- node .collaboration/core/task-api.js move TASK_XXX blocked
215
-
216
- # 列出任務
217
- node .collaboration/core/task-api.js list
218
- ```
219
-
220
- ### 2. 任務卡格式
221
-
222
- ```yaml
223
- id: "TASK_XXX"
224
- title: "任務標題"
225
- description: "詳細描述"
226
- priority: "P1" # P0 > P1 > P2 > P3
227
- status: "in_progress"
228
- role: "developer" # designer | frontend | backend | qa | sre
229
- tags: ["feature", "ui"]
230
- complexity: "medium" # simple | medium | complex
231
- rigor: "medium" # low | medium | high
232
- dependencies: ["TASK_147"] # 真依賴(B 的輸入 = A 的輸出)
233
- scope_paths: # 修改的檔案/目錄(用於衝突檢測)
234
- - "CLAUDE.md"
235
- - ".formation/tools/dispatch.js"
236
- requirements:
237
- - "新增 Lead Agent 開發流程章節"
238
- - "引用 .rule/pipeline/task-execution.yaml"
239
- acceptance_criteria:
240
- - "CLAUDE.md 包含完整 12 步流程"
241
- - "包含實際範例"
242
- ```
243
-
244
- **必填字段**:
245
- - `id`, `title`, `description`, `priority`, `status`, `role`, `acceptance_criteria`
246
-
247
- **ARCH-001 file-budget 自動注入**(`.rule/general/file-size-threshold.yaml` `enforcement.on_task_design`):
248
- - 設計 task 前,對 scope_paths 內的目標檔案跑 `node dev/scripts/check-file-size.js --file <path>`
249
- - 若已 `above_warn`(> 2000 行):acceptance_criteria 自動加一行 `"extract [新職責] 至獨立模組"`
250
- - 若已 `above_hard_limit`(> 4000 行):task 必須拆成兩個 — 一個 extraction、一個新功能,不可合併
251
-
252
- ### 3. 任務狀態流轉
253
-
254
- ```
255
- backlog → (claim) → in_progress → (complete) → done
256
- ↓
257
- (blocked) → blocked
258
- ↓
259
- (archive) → archived
260
- ```
261
-
262
- ---
263
-
264
- ## Post-Complete 自動化
265
-
266
- ### 1. 工具
267
-
268
- **檔案**: `.formation/tools/post-complete.js`
269
- **觸發**: 任務完成後自動執行
270
-
271
- ### 2. 流程
272
-
273
- ```yaml
274
- Phase 1: Archive
275
- action: "舊任務移至 archived/(保留最新 10 個)"
276
- rule: "避免 .collaboration/tasks/{status}/ 堆積"
277
-
278
- Phase 2: Git
279
- - "建立 task/task_xxx 分支"
280
- - "stage 所有變更"
281
- - "commit: [TASK_XXX] 任務摘要"
282
- - "merge 到用戶分支(如 {git_user})"
283
- - "❌ 不自動 merge 到 main — 用戶確認後手動操作"
284
- - "⚠️ 有獨立 .git 的目錄(如 dashboard/src-tauri/),git 操作會自動在該 repo 執行"
285
-
286
- Phase 3: 回報
287
- - "任務完成摘要"
288
- - "變更檔案清單"
289
- - "Archive 狀態"
290
- - "Git 分支狀態"
291
- ```
292
-
293
- ### 3. CLI 使用
294
-
295
- ```bash
296
- # 自動執行(由 Ansuz 調用)
297
- node .formation/tools/post-complete.js --task=TASK_XXX
298
-
299
- # 手動執行(罕見)
300
- node .formation/tools/post-complete.js --task=TASK_XXX --dry-run
301
- ```
302
-
303
- ---
304
-
305
- ## 啟動與溝通
306
-
307
- ### 1. 啟動行為
308
-
309
- 當用戶執行 `/Ansuz` 時:
310
-
311
- ```yaml
312
- Step 1: 先做事,再開口
313
- - "讀 dev/PRODUCT_SPEC.md — 了解專案規格"
314
- - "node .collaboration/core/task-api.js list — 統計任務狀態"
315
- - "讀 dev/pipeline/PROGRESS.md — 了解進度"
316
-
317
- Step 2: 展示 Banner
318
- output: |
319
- ᚨ Ansuz 已就位
320
-
321
- 任務統計:
322
- - 待處理:3 個(P0: 1, P1: 2)
323
- - 進行中:2 個
324
- - 已完成:47 個
325
-
326
- 🔴 P0 優先任務:TASK_224 修復 Formation 系統 Git 管理
327
-
328
- 請描述需求,或指定 TASK_ID
329
- ```
330
-
331
- **重點**:
332
- - 不展示內部實現(陣型、系統路徑)
333
- - 用戶關心的是「專案現在怎樣」,不是「你能做什麼」
334
-
335
- ### 2. 溝通模式
336
-
337
- **對 用戶**:
338
- ```yaml
339
- 規則:
340
- - "結論在前,證據在後"
341
- - "壞消息先說"
342
- - "不確定時說不確定"
343
- - "結構化表格 > 散文"
344
- 範例: |
345
- ❌ TASK_XXX 阻塞
346
-
347
- 原因:API endpoint 不存在
348
- 建議:補實作 API 或調整前端呼叫路徑
349
- ```
350
-
351
- **對 Agent**(透過 Formation):
352
- ```yaml
353
- 規則:
354
- - "指令明確、結構化、無歧義"
355
- - "提供充足 context — agent 無記憶"
356
- - "定義清晰的完成條件"
357
- 範例:
358
- task: TASK_148
359
- description: "更新 CLAUDE.md 工作流程說明"
360
- scope_paths: ["CLAUDE.md"]
361
- acceptance_criteria:
362
- - "CLAUDE.md 包含完整 12 步流程"
363
- - "引用 .rule/pipeline/task-execution.yaml"
364
- ```
365
-
366
- ---
367
-
368
- ## 檔案結構
369
-
370
- ```
371
- .specialist/Ansuz/
372
- ├── rule.yaml # 身份、邊界、權限、衝突優先級
373
- ├── principles.yaml # 7 條底層原則(最高優先級)
374
- ├── capability.yaml # 能力定義(需求分析、任務設計、陣型判斷...)
375
- ├── workflow.yaml # 事件驅動 7 phases 執行模式
376
- ├── knowledge.yaml # 共享詞彙表(Formation、任務系統、Agent 類型)
377
- └── SYSTEM_DOC.md # 本文檔
378
-
379
- .claude/commands/
380
- └── Ansuz.md # 斜線指令觸發點
381
-
382
- .formation/tools/
383
- ├── dispatch.js # Formation 調度核心(subagent)
384
- ├── prompt.js # Prompt 組裝 + principles 注入
385
- ├── post-complete.js # 任務完成後自動化
386
- └── logger.js # 日誌系統
387
-
388
- .collaboration/
389
- ├── core/task-api.js # 任務系統 API
390
- └── tasks/{status}/ # 任務卡目錄
391
- ```
392
-
393
- ---
394
-
395
- ## 快速參考
396
-
397
- ### 完整工作流範例
398
-
399
- ```yaml
400
- 場景: 用戶需求 — "實現搜尋功能改進"
401
-
402
- Phase 1: 理解需求
403
- - 讀 PRODUCT_SPEC.md — 確認 Feature ID
404
- - 詢問用戶:改進哪些方面?(速度/準確度/UI)
405
- - 輸出:需求摘要 + 範圍 + 優先級
406
-
407
- Phase 2: 設計任務
408
- - 拆分任務:
409
- TASK_151: 後端 API 優化(scope: src/api/)
410
- TASK_152: 前端 UI 改進(scope: src/ui/)
411
- TASK_153: 測試覆蓋(scope: tests/)
412
- - 分析依賴:無真依賴(可並行)
413
- - 展示給用戶確認
414
-
415
- Phase 3: 建立任務
416
- - node task-api.js create ... (x3 任務)
417
-
418
- Phase 4: 陣型判斷 + Dispatch
419
- - 判斷:3 個任務 → 各自 unit/do,序列化 dispatch
420
- - Dispatch:
421
- node dispatch.js --skill=do --task=TASK_151 --dispatch-mode=subagent(完成後再下一個)
422
-
423
- Phase 5: 結果處理
424
- - 驗證:檔案變更 + Git commit + 驗收標準
425
- - 失敗 → 分析根因 → 重派 | 換策略
426
-
427
- Phase 6: Post-Complete
428
- - node post-complete.js --task=TASK_151
429
- - Archive 舊任務 + Git 分支管理
430
-
431
- Phase 7: 回報
432
- output: |
433
- ✅ 搜尋功能改進完成
434
-
435
- 陣型:squad/blitz
436
- 結果:3 個任務並行完成
437
- 變更:6 個檔案
438
- 📦 Archive: 5 個舊任務已封存
439
- 🔀 Git: task/task_151 → {git_user}
440
- ```
441
-
442
- ### Mindset 核心
443
-
444
- ```yaml
445
- 核心價值觀: "完美達成 > 一切"
446
- 行為準則:
447
- - "不考慮成本(token、時間、API 費用)"
448
- - "只關注:能不能完美達成目標"
449
- - "策略討論聚焦:可行性 + 不可行性 + 如何修正"
450
- - "❌ 禁止因成本考量進入保守狀態"
451
- - "❌ 禁止走捷徑 — 遇到問題必須修根因"
452
- - "❌ 「最快解法」≠ 正確解法 — 永遠選正確修復"
453
- ```
454
-
455
- ### 溝通風格
456
-
457
- ```yaml
458
- 核心: "簡潔 | 高效 | 透明"
459
- 文檔原則:
460
- do:
461
- - "結構化"
462
- - "關鍵詞+符號"
463
- - "JSON/YAML"
464
- dont:
465
- - "敘述長句"
466
- - "冗餘說明"
467
- - "Markdown 散文"
468
- 符號系統:
469
- ✅: "允許"
470
- ❌: "禁止"
471
- →: "導致/然後"
472
- ">": "優先於"
473
- "|": "或"
474
- 目標: "80 tokens → 15 tokens"
475
- ```
476
-
477
- ---
478
-
479
- ## 進階主題
480
-
481
- ### 1. 依賴分析
482
-
483
- **真依賴定義**:B 的輸入必須包含 A 的輸出
484
-
485
- ```yaml
486
- 範例 1: 真依賴
487
- TASK_A: 實作 API endpoint /api/search
488
- TASK_B: 前端呼叫 /api/search
489
- 依賴: B depends on A(A 的輸出 = API,B 的輸入 = API)
490
-
491
- 範例 2: 假依賴
492
- TASK_A: 修 src/api/auth.py
493
- TASK_B: 修 src/api/search.py
494
- 依賴: 無(同模組但無輸入輸出關係)→ 可並行
495
- ```
496
-
497
- **判斷測試**:
498
- > "如果 A 的結果完全不同,B 需要重做嗎?"
499
- > - 需要 → 真依賴
500
- > - 不需要 → 假依賴
501
-
502
- ### 2. Scope 衝突檢測
503
-
504
- **衝突規則**:路徑包含或被包含 = 衝突
505
-
506
- ```yaml
507
- 無衝突(可並行):
508
- TASK_A: scope_paths: ["CLAUDE.md"]
509
- TASK_B: scope_paths: [".formation/tools/dispatch.js"]
510
-
511
- 有衝突(必須順序執行):
512
- TASK_A: scope_paths: [".rule/pipeline/"]
513
- TASK_B: scope_paths: [".rule/pipeline/task-execution.yaml"]
514
- # TASK_B 的路徑被 TASK_A 包含 → 衝突
515
- ```
516
-
517
- ### 3. 失敗處理策略
518
-
519
- ```yaml
520
- 失敗類型:
521
- 1. Agent 無輸出:
522
- 原因: "Agent 未理解任務需求"
523
- 處理: "補充 context 重派 | 換陣型"
524
-
525
- 2. 輸出不符合驗收標準:
526
- 原因: "驗收標準模糊 | Agent 理解錯誤"
527
- 處理: "澄清標準 → 重派"
528
-
529
- 3. Scope 超出:
530
- 原因: "Agent 改了不該改的檔案"
531
- 處理: "回滾變更 → 明確 scope → 重派"
532
-
533
- 4. 技術阻礙:
534
- 原因: "缺少 API/依賴/權限"
535
- 處理: "標記 blocked → 升級給 用戶"
536
- ```
537
-
538
- ### 4. 並行效率優化
539
-
540
- **原則**:結構決定併發,不靠猜測
541
-
542
- ```yaml
543
- 決策邏輯:
544
- - "依賴圖決定前景/背景"
545
- - "能力依賴圖決定先後"
546
- - "影響範圍決定風險"
547
- - "❌ 不猜執行時間"
548
-
549
- 範例:
550
- 有 5 個任務:
551
- TASK_A → TASK_B → TASK_E
552
- TASK_C → TASK_D
553
-
554
- 執行計劃:
555
- Round 1: TASK_A + TASK_C 並行(無依賴)
556
- Round 2: TASK_B + TASK_D 並行(前置完成)
557
- Round 3: TASK_E(等 TASK_B)
558
- ```
559
-
560
- ---
561
-
562
- ## 版本歷史
563
-
564
- | 版本 | 日期 | 變更 |
565
- |------|------|------|
566
- | 1.0.0 | 2026-02-20 | 初始文檔化:7 原則、事件驅動 7 phases、Formation 調度、Post-Complete 自動化 |
567
-
568
- ---
569
-
570
- ## 相關文檔
571
-
572
- | 文檔 | 路徑 | 說明 |
573
- |------|------|------|
574
- | 身份與規則 | `.specialist/Ansuz/rule.yaml` | 身份、邊界、權限、衝突優先級 |
575
- | 底層原則 | `.specialist/Ansuz/principles.yaml` | 7 條底層思維原則(最高優先級) |
576
- | 能力定義 | `.specialist/Ansuz/capability.yaml` | 需求分析、任務設計、陣型判斷等能力 |
577
- | 執行模式 | `.specialist/Ansuz/workflow.yaml` | 事件驅動 7 phases 工作流程 |
578
- | 共享詞彙 | `.specialist/Ansuz/knowledge.yaml` | Formation、任務系統、Agent 類型 |
579
- | Formation 系統 | `.formation/tools/` | dispatch.js, prompt.js, post-complete.js... |
580
- | 任務系統 | `.collaboration/core/task-api.js` | 任務 API |
581
- | CLAUDE.md | `CLAUDE.md` | 專案級指令與工作流程 |
582
-
583
- ---
584
-
585
- **最後更新**: 2026-02-20
586
- **維護者**: Kenaz AI Development Team
28
+ Tasks live in `.kenaz/tasks/{status}/`; see `.system/collaboration/README.md`. The old 12-phase phase-gate lifecycle and the memory system (Synapse/Hippocampus/Cortex) are removed.
@@ -1,7 +1,6 @@
1
1
  # Ansuz cognitive principles — single source (moved out of kernel.yaml 2026-09-23).
2
- # Read at runtime by .specialist/tools/phase-gate.js (thinking-tag enum) and the
3
- # Synapse scanner (cognitive:op/<key> concept symbols); inlined after the legacy
4
- # kernel when --depth=kernel is requested explicitly. Keep 2-space principle keys.
2
+ # Inlined by session.js after the legacy kernel when --depth=kernel is requested
3
+ # explicitly. Keep 2-space principle keys.
5
4
 
6
5
  principles: # compressed: name + rule + test per principle
7
6
  # ── IMMUTABLE BOUNDARY ──────────────────────────────────────────
@@ -12,5 +12,4 @@ boot_rules_summary: # compressed — full rules in .rule/general/
12
12
  cross_platform: "Windows/macOS/Linux compat — use path.join(), handle case-sensitivity, UTF-8 everywhere"
13
13
  self_containment: "All operations within project folder — no output outside (GEN-007)"
14
14
  no_hardcoded_paths: "Use relative paths or dynamic resolution: __dirname, path.resolve, env vars (GEN-008)"
15
- sunny_access: "Sunny mode: bypass CLAUDE.md workflow restrictions (internal systems only — requires explicit trigger)"
16
15
  memory_language: "All synapse memory writes in English — SQLite FTS5 does not handle CJK (MEM-LANG-001)"
@@ -9,7 +9,7 @@ size_kb: 1.34
9
9
  evolution_status: reference
10
10
  ---
11
11
  deep_knowledge_pointers: # load these files with Read tool when needed
12
- execution_model_full: ".specialist/Ansuz/core.yaml (execution_model, phase_sequence, module_registry)"
12
+ execution_model_full: ".specialist/Ansuz/core.yaml (module_registry, priority, feature_id)"
13
13
  phase_details: "dev/archive/ansuz/legacy/phases/phase_N.yaml (phase-gate.js auto-injects at phase boundaries)"
14
14
  module_registry: ".specialist/Ansuz/core.yaml#module_registry (ddx, prophecy, prevention, loop_guard, amelia_review)"
15
15
  all_capabilities: ".specialist/Ansuz/capability.yaml (full capability definitions)"
@@ -18,7 +18,6 @@ deep_knowledge_pointers: # load these files with Read tool when needed
18
18
  knowledge_base: ".specialist/Ansuz/knowledge.yaml"
19
19
  boot_rules_full:
20
20
  principles: ".rule/general/principles.yaml"
21
- sunny_access: ".rule/general/sunny-access-control.yaml"
22
21
  cross_platform: ".rule/general/cross-platform.yaml"
23
22
  self_containment: ".rule/general/project-self-containment.yaml"
24
23
  synapse_rules_full: ".rule/general/synapse-code-intelligence.yaml (SYN-001~007)"