kenaz 0.3.17 → 0.3.19

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 (316) 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/hooks/synapse-first-investigation.js +15 -0
  7. package/core/.claude/skills/architect_agent/SKILL.md +11 -92
  8. package/core/.claude/skills/assessment_agent/SKILL.md +0 -1
  9. package/core/.claude/skills/backend_engineer/SKILL.md +3 -6
  10. package/core/.claude/skills/code_reviewer/SKILL.md +1 -1
  11. package/core/.claude/skills/code_reviewer/patterns.yaml +1 -1
  12. package/core/.claude/skills/designer/SKILL.md +3 -6
  13. package/core/.claude/skills/dev_agent/SKILL.md +30 -491
  14. package/core/.claude/skills/developer/SKILL.md +3 -6
  15. package/core/.claude/skills/feature_agent/SKILL.md +3 -17
  16. package/core/.claude/skills/product_manager/SKILL.md +29 -1064
  17. package/core/.claude/skills/qa_engineer/SKILL.md +12 -17
  18. package/core/.claude/skills/spec_optimizer/SKILL.md +25 -275
  19. package/core/.claude/skills/sre_agent/SKILL.md +3 -6
  20. package/core/.collaboration/README.md +2 -3
  21. package/core/.collaboration/core/task-api.js +5 -138
  22. package/core/.collaboration/docs/CLI.md +0 -2
  23. package/core/.failure/INDEX.yaml +6 -40
  24. package/core/.failure/agent-execution/FAIL-013-search-cwd-drift-and-case-mismatch.yaml +1 -1
  25. package/core/.failure/tools/README.md +9 -227
  26. package/core/.formation/bifrost/exec.js +29 -4
  27. package/core/.formation/bifrost/launch.js +1 -6
  28. package/core/.formation/bifrost/launch.test.js +1 -1
  29. package/core/.formation/bifrost/provider-launch.js +18 -11
  30. package/core/.formation/bifrost/provider-launch.test.js +26 -2
  31. package/core/.formation/bifrost/shared/ansuz-boot-policy.js +3 -3
  32. package/core/.formation/bifrost/shared/ansuz-boot-policy.test.js +1 -2
  33. package/core/.formation/tools/__tests__/dispatch-cwd-project.test.js +42 -0
  34. package/core/.formation/tools/__tests__/m1-hmap-convid.test.js +1 -124
  35. package/core/.formation/tools/__tests__/subagent-executor.test.js +3 -2
  36. package/core/.formation/tools/dispatch.js +15 -2
  37. package/core/.formation/tools/loader.js +17 -140
  38. package/core/.formation/tools/post-complete.js +0 -31
  39. package/core/.rule/INDEX.yaml +0 -18
  40. package/core/.rule/general/agent-workflow.yaml +14 -164
  41. package/core/.rule/general/project-self-containment.yaml +8 -19
  42. package/core/.rule/general/rust-verify-target.yaml +6 -5
  43. package/core/.rule/general/synapse-code-intelligence.yaml +3 -3
  44. package/core/.specialist/Amelia/capability.yaml +12 -12
  45. package/core/.specialist/Amelia/workflow.yaml +2 -2
  46. package/core/.specialist/Ansuz/SYSTEM_DOC.md +20 -578
  47. package/core/.specialist/Ansuz/cognitive_principles.yaml +2 -3
  48. package/core/.specialist/Ansuz/concepts/boot_rules_summary.yaml +0 -1
  49. package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +1 -2
  50. package/core/.specialist/Ansuz/core.yaml +6 -108
  51. package/core/.specialist/Ansuz/guards/lesson_guards.yaml +0 -3
  52. package/core/.specialist/Ansuz/identity_contract.yaml +0 -1
  53. package/core/.specialist/Ansuz/knowledge.yaml +0 -4
  54. package/core/.specialist/Ansuz/rule.yaml +0 -1
  55. package/core/.specialist/Ansuz/tools/handoff-session-identity.test.js +6 -150
  56. package/core/.specialist/tests/runtime-discovery/README.md +1 -1
  57. package/core/.specialist/tools/__tests__/task-2374-usage-counter.test.js +1 -12
  58. package/core/.specialist/tools/prompt-files.test.js +1 -0
  59. package/core/.specialist/tools/task-bridge.js +1 -66
  60. package/core/.system/README.md +11 -552
  61. package/core/.system/collaboration/README.md +10 -174
  62. package/core/CLAUDE.md +1 -6
  63. package/core/KENAZ_CORE_VERSION +1 -1
  64. package/core/dev/scripts/js-yaml-resolution.test.js +1 -1
  65. package/core/dev/scripts/run-rust-tests.js +30 -46
  66. package/core/dev/scripts/run-rust-tests.test.js +17 -0
  67. package/core/dev/scripts/rust-verify-worktree.js +4 -4
  68. package/core/dev/scripts/verify-target-dir.js +6 -6
  69. package/core/plugins/kenaz/INVENTORY.md +8 -8
  70. package/core/plugins/kenaz/commands/architect.md +1 -2
  71. package/core/plugins/kenaz/commands/spec.md +1 -1
  72. package/core/plugins/kenaz/commands//347/224/242/345/223/201.md +1 -1
  73. package/core/plugins/kenaz/guidance.md +1 -1
  74. package/core/plugins/kenaz/scripts/sync.js +1 -1
  75. package/core/plugins/kenaz/scripts/ygg.js +6 -0
  76. package/core/plugins/kenaz/skills/architect_agent/SKILL.md +11 -92
  77. package/core/plugins/kenaz/skills/assessment_agent/SKILL.md +0 -1
  78. package/core/plugins/kenaz/skills/backend_engineer/SKILL.md +3 -6
  79. package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +1 -1
  80. package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +1 -1
  81. package/core/plugins/kenaz/skills/designer/SKILL.md +3 -6
  82. package/core/plugins/kenaz/skills/dev_agent/SKILL.md +30 -491
  83. package/core/plugins/kenaz/skills/developer/SKILL.md +3 -6
  84. package/core/plugins/kenaz/skills/feature_agent/SKILL.md +3 -17
  85. package/core/plugins/kenaz/skills/product_manager/SKILL.md +29 -1064
  86. package/core/plugins/kenaz/skills/qa_engineer/SKILL.md +12 -17
  87. package/core/plugins/kenaz/skills/spec_optimizer/SKILL.md +25 -275
  88. package/core/plugins/kenaz/skills/sre_agent/SKILL.md +3 -6
  89. package/package.json +6 -6
  90. package/core/.claude/commands/archive.md +0 -24
  91. package/core/.claude/commands/init.md +0 -112
  92. package/core/.claude/commands/legacy_dev.md +0 -18
  93. package/core/.claude/commands/product-review.md +0 -131
  94. package/core/.claude/commands/strategy.md +0 -141
  95. package/core/.claude/commands/sunny.md +0 -1
  96. package/core/.claude/commands//347/224/242/345/223/201/346/252/242/350/246/226.md +0 -129
  97. package/core/.claude/commands//351/200/262/345/272/246.md +0 -15
  98. package/core/.claude/hooks/__tests__/substrate.test.js +0 -122
  99. package/core/.claude/hooks/_substrate-paths.js +0 -95
  100. package/core/.claude/hooks/context-check.js +0 -51
  101. package/core/.claude/hooks/fatigue-check.js +0 -52
  102. package/core/.claude/hooks/handoff-snapshot-on-commit.js +0 -154
  103. package/core/.claude/hooks/handoff-snapshot-on-question.js +0 -158
  104. package/core/.claude/hooks/handoff-staleness.js +0 -197
  105. package/core/.claude/hooks/jev-thalamus-context.js +0 -17
  106. package/core/.claude/hooks/jev-thalamus-context.test.js +0 -41
  107. package/core/.claude/hooks/lease-release.js +0 -119
  108. package/core/.claude/hooks/lease-touch.js +0 -96
  109. package/core/.claude/hooks/reflex-feedback.js +0 -5
  110. package/core/.claude/hooks/session-init.ps1 +0 -49
  111. package/core/.claude/hooks/sound-event.js +0 -70
  112. package/core/.claude/hooks/sound-event.sh +0 -37
  113. package/core/.claude/hooks/stream-delta.js +0 -169
  114. package/core/.claude/no-hooks.settings.json +0 -3
  115. package/core/.claude/skills/legacy_dev/SKILL.md +0 -202
  116. package/core/.claude/skills/sunny/SKILL.md +0 -74
  117. package/core/.collaboration/cli/commands/assign.js +0 -39
  118. package/core/.collaboration/cli/commands/claim.js +0 -33
  119. package/core/.collaboration/cli/commands/complete.js +0 -44
  120. package/core/.collaboration/cli/commands/create.js +0 -110
  121. package/core/.collaboration/cli/commands/get.js +0 -83
  122. package/core/.collaboration/cli/commands/index.js +0 -52
  123. package/core/.collaboration/cli/commands/list.js +0 -51
  124. package/core/.collaboration/cli/commands/lock.js +0 -45
  125. package/core/.collaboration/cli/commands/rebuild.js +0 -39
  126. package/core/.collaboration/cli/commands/search.js +0 -61
  127. package/core/.collaboration/cli/commands/stats.js +0 -61
  128. package/core/.collaboration/cli/commands/transfer.js +0 -41
  129. package/core/.collaboration/cli/commands/unlock.js +0 -48
  130. package/core/.collaboration/cli/formatters/help-formatter.js +0 -70
  131. package/core/.collaboration/cli/formatters/index.js +0 -7
  132. package/core/.collaboration/cli/task-cli.js +0 -46
  133. package/core/.collaboration/cli/utils/arg-parser.js +0 -74
  134. package/core/.collaboration/cli/utils/git-user.js +0 -25
  135. package/core/.collaboration/cli/utils/index.js +0 -9
  136. package/core/.collaboration/cli/utils/output.js +0 -10
  137. package/core/.collaboration/config/default.yaml +0 -189
  138. package/core/.collaboration/core/conflict-resolver.js +0 -461
  139. package/core/.collaboration/core/conflict-resolver.test.js +0 -389
  140. package/core/.collaboration/core/migrate-legacy.js +0 -260
  141. package/core/.collaboration/docs/API.md +0 -787
  142. package/core/.collaboration/docs/ARCHITECTURE.md +0 -596
  143. package/core/.collaboration/docs/FAQ.md +0 -695
  144. package/core/.collaboration/docs/MIGRATION.md +0 -804
  145. package/core/.collaboration/docs/examples/README.md +0 -320
  146. package/core/.collaboration/docs/examples/advanced-queries.js +0 -261
  147. package/core/.collaboration/docs/examples/basic-usage.js +0 -184
  148. package/core/.collaboration/docs/examples/team-workflow.js +0 -352
  149. package/core/.failure/agent-execution/FAIL-001-agent-no-output.yaml +0 -391
  150. package/core/.failure/agent-execution/FAIL-007-pm-lead-wrong-team-invocation.yaml +0 -0
  151. package/core/.failure/agent-execution/FAIL-010-phase0-poem-format-skipped.yaml +0 -28
  152. package/core/.failure/agent-execution/FAIL-010-skipping-cognitive-checkpoint-after-verification.yaml +0 -59
  153. package/core/.failure/agent-execution/FAIL-012-grep-shortcut-during-investigation.yaml +0 -85
  154. package/core/.failure/architecture/FAIL-006-python-version-compatibility.yaml +0 -445
  155. package/core/.failure/pipeline/FAIL-003-queue-pollution.yaml +0 -335
  156. package/core/.failure/pipeline/README.md +0 -95
  157. package/core/.failure/retired/FAIL-009-skipping-synapse-pulse-before-code-change.yaml +0 -49
  158. package/core/.failure/tools/USAGE_GUIDE.md +0 -323
  159. package/core/.failure/tools/check_failures.ps1 +0 -387
  160. package/core/.failure/tools/log_failure.ps1 +0 -474
  161. package/core/.formation/.episode-input.json +0 -10
  162. package/core/.formation/.merge-lock +0 -1
  163. package/core/.formation/lead.yaml +0 -118
  164. package/core/.formation/legacy.bak/designer.yaml +0 -57
  165. package/core/.formation/legacy.bak/pm.yaml +0 -57
  166. package/core/.formation/legacy.bak/qa.yaml +0 -57
  167. package/core/.formation/legacy.bak/review.yaml +0 -62
  168. package/core/.formation/legacy.bak/scheduler.yaml +0 -129
  169. package/core/.formation/legacy.bak/sre.yaml +0 -57
  170. package/core/.formation/role-map.yaml +0 -274
  171. package/core/.formation/roles/_shared/modules/code_review.yaml +0 -98
  172. package/core/.formation/roles/_shared/modules/security.yaml +0 -103
  173. package/core/.formation/roles/_shared/modules/testing.yaml +0 -14
  174. package/core/.formation/roles/backend/role.yaml +0 -93
  175. package/core/.formation/roles/code_reviewer/role.yaml +0 -102
  176. package/core/.formation/roles/database_optimizer/role.yaml +0 -107
  177. package/core/.formation/roles/designer/role.yaml +0 -66
  178. package/core/.formation/roles/developer/role.yaml +0 -75
  179. package/core/.formation/roles/frontend/role.yaml +0 -134
  180. package/core/.formation/roles/incident_response/role.yaml +0 -89
  181. package/core/.formation/roles/qa/role.yaml +0 -89
  182. package/core/.formation/roles/security/role.yaml +0 -87
  183. package/core/.formation/roles/sre/role.yaml +0 -66
  184. package/core/.formation/skills/coordinator.yaml +0 -52
  185. package/core/.formation/solo/diagnosis.yaml +0 -78
  186. package/core/.formation/solo/strategy.yaml +0 -121
  187. package/core/.formation/tests/hello.txt +0 -2
  188. package/core/.formation/tools/coordinator.js +0 -350
  189. package/core/.formation/tools/jev-correction.js +0 -214
  190. package/core/.formation/tools/jev-correction.test.js +0 -178
  191. package/core/.formation/tools/log-reader.js +0 -232
  192. package/core/.formation/tools/revert-daemon-state.js +0 -162
  193. package/core/.formation/tools/test-drift.js +0 -148
  194. package/core/.formation/unit/heimdall.yaml +0 -96
  195. package/core/.formation/unit/plan.yaml +0 -67
  196. package/core/.formation/unit/think.yaml +0 -58
  197. package/core/.kenaz/MUNINN_SNAPSHOT9_EPISODE.json +0 -32
  198. package/core/.kenaz/MUNINN_SNAPSHOT9_RUNE.json +0 -23
  199. package/core/.kenaz/MUNINN_SNAPSHOT9_SUMMARY.md +0 -89
  200. package/core/.kenaz/ash_TASK_1428-20260507.json +0 -14
  201. package/core/.kenaz/muninn_episode_write.ps1 +0 -17
  202. package/core/.kenaz/muninn_snapshot11_rune_candidates.md +0 -63
  203. package/core/.kenaz/muninn_snapshot1_rune_candidates.md +0 -49
  204. package/core/.kenaz/runes_TASK_1428.json +0 -57
  205. package/core/.kenaz/tmp_heimdall_proposal_8d3e392.json +0 -13
  206. package/core/.kenaz/tmp_props.json +0 -1
  207. package/core/.kenaz/tmp_sounddrop_t1_prompt.txt +0 -371
  208. package/core/.rule/MECHANIZED.md +0 -61
  209. package/core/.rule/general/cortex-memory-recall.yaml +0 -446
  210. package/core/.rule/general/pipeline.yaml +0 -246
  211. package/core/.rule/general/sunny-access-control.yaml +0 -60
  212. package/core/.rule/general/system-invariants.yaml +0 -231
  213. package/core/.rule/pipeline/PPL-002-completed-task-archival.yaml +0 -528
  214. package/core/.rule/pipeline/auto-update.yaml +0 -282
  215. package/core/.rule/pipeline/task-execution.yaml +0 -365
  216. package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +0 -65
  217. package/core/.specialist/Ansuz/experiments/boot_ablation_replay.js +0 -197
  218. package/core/.specialist/Ansuz/tools/bootstrap-anchors.js +0 -289
  219. package/core/.specialist/Ansuz/workflow.yaml +0 -1225
  220. package/core/.specialist/experiments/rg_benchmark.js +0 -523
  221. package/core/.specialist/experiments/rg_benchmark_results.json +0 -27
  222. package/core/.specialist/tools/jev-optional-context.js +0 -107
  223. package/core/.specialist/tools/jev-optional-context.test.js +0 -152
  224. package/core/.specialist/tools/memory-action-log.js +0 -839
  225. package/core/.specialist/tools/phase-gate.js +0 -3534
  226. package/core/.specialist/tools/phase-gate.test.js +0 -85
  227. package/core/.specialist/tools/precompute-runner.js +0 -444
  228. package/core/.specialist/tools/rule-engine.js +0 -621
  229. package/core/.specialist/tools/task-bridge-jev.test.js +0 -170
  230. package/core/.synapse/memory-shared.json.sync +0 -1
  231. package/core/.system/agent-skills/README.md +0 -724
  232. package/core/.system/cli-tools/README.md +0 -724
  233. package/core/.system/cortex/MODULES.md +0 -1046
  234. package/core/.system/dashboard/FRONTEND.md +0 -812
  235. package/core/.system/dashboard/README.md +0 -737
  236. package/core/.system/failure/README.md +0 -723
  237. package/core/.system/formation/LEGACY_SKILLS.md +0 -974
  238. package/core/.system/formation/POST_COMPLETE.md +0 -602
  239. package/core/.system/formation/README.md +0 -1094
  240. package/core/.system/formation/TOOLS_REFERENCE.md +0 -1145
  241. package/core/.system/kenaz/README.md +0 -787
  242. package/core/.system/memory/README.md +0 -719
  243. package/core/.system/pipeline/README.md +0 -712
  244. package/core/.system/rule/README.md +0 -794
  245. package/core/.system/sunny/README.md +0 -476
  246. package/core/.system/sunny/RULES.json +0 -89
  247. package/core/.system/sunny/knowledge/INDEX.md +0 -37
  248. package/core/.system/sunny/knowledge/agent-teams-api.md +0 -0
  249. package/core/.system/sunny/knowledge/ansuz-specialist.md +0 -500
  250. package/core/.system/sunny/knowledge/claude-cli-spawn.md +0 -177
  251. package/core/.system/sunny/knowledge/collaboration-api.md +0 -925
  252. package/core/.system/sunny/teammates/README.md +0 -107
  253. package/core/.system/sunny/teammates/how_to_use.yaml +0 -101
  254. package/core/.system/sunny/teammates/tools/headless/launcher.js +0 -318
  255. package/core/.system/sunny/teammates/tools/powershell/launcher.js +0 -241
  256. package/core/.system/sunny/teammates/tools/powershell/start.bat +0 -50
  257. package/core/.system/sunny/teammates/tools/utils/env.js +0 -96
  258. package/core/.system/sunny/teammates/tools/utils/format-output.js +0 -329
  259. package/core/.system/sunny/tools.json +0 -101
  260. package/core/dev/scripts/cleanup-queue.js +0 -184
  261. package/core/dev/scripts/cleanup_queue.js +0 -86
  262. package/core/dev/scripts/legacy/README.md +0 -39
  263. package/core/dev/scripts/legacy/dev_agent_scheduler.ps1.bak +0 -536
  264. package/core/dev/scripts/legacy/multi_agent_scheduler.ps1.bak +0 -1978
  265. package/core/dev/scripts/matrix/CLI_README.md +0 -214
  266. package/core/dev/scripts/matrix/README.md +0 -310
  267. package/core/dev/scripts/matrix/package-lock.json +0 -4266
  268. package/core/dev/scripts/matrix/package.json +0 -55
  269. package/core/dev/scripts/matrix/src/abbreviations.ts +0 -295
  270. package/core/dev/scripts/matrix/src/cli/commands/convert.ts +0 -211
  271. package/core/dev/scripts/matrix/src/cli/commands/create.ts +0 -95
  272. package/core/dev/scripts/matrix/src/cli/commands/delete.ts +0 -102
  273. package/core/dev/scripts/matrix/src/cli/commands/list-tags.ts.wip +0 -140
  274. package/core/dev/scripts/matrix/src/cli/commands/manage-tags.ts.wip +0 -173
  275. package/core/dev/scripts/matrix/src/cli/commands/query.ts +0 -261
  276. package/core/dev/scripts/matrix/src/cli/commands/read.ts +0 -77
  277. package/core/dev/scripts/matrix/src/cli/commands/stats.ts.wip +0 -168
  278. package/core/dev/scripts/matrix/src/cli/commands/tokens.ts.wip +0 -126
  279. package/core/dev/scripts/matrix/src/cli/commands/update.ts +0 -147
  280. package/core/dev/scripts/matrix/src/cli/commands/validate.ts +0 -275
  281. package/core/dev/scripts/matrix/src/cli/index.ts +0 -350
  282. package/core/dev/scripts/matrix/src/cli/utils/file-handler.ts +0 -72
  283. package/core/dev/scripts/matrix/src/cli/utils/logger.ts +0 -65
  284. package/core/dev/scripts/matrix/src/index.ts +0 -62
  285. package/core/dev/scripts/matrix/src/indexer/tag-indexer.ts +0 -165
  286. package/core/dev/scripts/matrix/src/parser.ts +0 -281
  287. package/core/dev/scripts/matrix/src/serializer.ts +0 -151
  288. package/core/dev/scripts/matrix/src/validator.ts +0 -301
  289. package/core/dev/scripts/matrix/tests/abbreviations.test.ts +0 -122
  290. package/core/dev/scripts/matrix/tests/cli.test.ts +0 -177
  291. package/core/dev/scripts/matrix/tests/convert.test.ts +0 -143
  292. package/core/dev/scripts/matrix/tests/parser.test.ts +0 -203
  293. package/core/dev/scripts/matrix/tests/query.test.ts +0 -85
  294. package/core/dev/scripts/matrix/tests/serializer.test.ts +0 -197
  295. package/core/dev/scripts/matrix/tests/validate.test.ts +0 -141
  296. package/core/dev/scripts/matrix/tests/validator.test.ts +0 -167
  297. package/core/dev/scripts/matrix/tsconfig.json +0 -20
  298. package/core/dev/scripts/matrix/types/index.d.ts +0 -111
  299. package/core/dev/scripts/matrix/types/index.d.ts.map +0 -1
  300. package/core/dev/scripts/matrix/types/index.js +0 -8
  301. package/core/dev/scripts/matrix/types/index.js.map +0 -1
  302. package/core/dev/scripts/matrix/types/index.ts +0 -124
  303. package/core/dev/scripts/memory-usage-report.js +0 -152
  304. package/core/dev/scripts/probe/ansuz-scaffold-ablation.js +0 -579
  305. package/core/dev/scripts/probe/ansuz-scaffold-ablation.test.js +0 -244
  306. package/core/dev/scripts/probe/hook-latency-probe.js +0 -315
  307. package/core/dev/scripts/probe/hook-latency-probe.test.js +0 -105
  308. package/core/dev/scripts/probe/prediction-signal-auc.js +0 -483
  309. package/core/dev/scripts/probe/prediction-signal-auc.test.js +0 -200
  310. package/core/dev/scripts/test-pty-ws-tunnel.js +0 -229
  311. package/core/dev/scripts/validate_pipeline.js +0 -197
  312. package/core/dev/spikes/task2145-evidence-20261004/backend-log-excerpt.txt +0 -56
  313. package/core/dev/spikes/task2145-evidence-20261004/graph.shadow +0 -0
  314. package/core/dev/spikes/task2145-evidence-20261004/graph.wal +0 -0
  315. package/core/dev/spikes/task2145-evidence-20261004/graph_corrupt_suspect.marker +0 -1
  316. package/core/plugins/kenaz/commands/strategy.md +0 -141
@@ -1,60 +0,0 @@
1
- # .rule/general/sunny-access-control.yaml
2
- # SEC-010: Sunny 系統存取控制
3
-
4
- _meta:
5
- category: "general"
6
- priority: 0
7
- applies_to:
8
- - "ai_agent"
9
- created_at: "2026-02-15"
10
- rationale: |
11
- Sunny 是內部系統開發 Agent,擁有繞過 CLAUDE.md 的特權。
12
- 必須限制其他 Agent 存取 Sunny 的工具、規則和配置,避免特權擴散。
13
-
14
- rules:
15
- - id: "SEC-010"
16
- title: "Sunny 系統存取控制"
17
- description: |
18
- 只有透過 /sunny 指令啟動的 session 才能存取 Sunny 系統。
19
- 其他 Agent 禁止讀取、修改或調用 Sunny 的任何資源。
20
- severity: "must"
21
-
22
- protected_paths:
23
- - ".system/sunny/"
24
- - ".claude/skills/sunny/"
25
-
26
- forbidden_actions:
27
- - action: "讀取 .system/sunny/ 下的任何檔案"
28
- applies_to: ["product_manager", "developer", "designer", "backend_engineer", "qa_engineer", "sre_agent", "dev_agent", "assessment_agent", "feature_agent", "frontend_agent", "optimization_agent", "team_worker"]
29
-
30
- - action: "修改 .system/sunny/ 下的任何檔案"
31
- applies_to: ["all_agents_except_sunny"]
32
-
33
- - action: "調用 /sunny 指令或引用 Sunny 的工具"
34
- applies_to: ["all_agents_except_sunny"]
35
-
36
- - action: "在 Task subagent 中使用 Sunny 的配置或規則"
37
- applies_to: ["all_agents_except_sunny"]
38
-
39
- allowed:
40
- - agent: "sunny"
41
- permissions: ["read", "write", "execute"]
42
- note: "Sunny 自身擁有完整存取權限"
43
-
44
- - agent: "human_developer"
45
- permissions: ["read", "write"]
46
- note: "人類開發者可直接管理 Sunny 配置"
47
-
48
- enforcement:
49
- - "Agent 啟動時檢查自身身份,非 Sunny 不得載入 .system/sunny/*"
50
- - "Task subagent 不得傳遞 Sunny 的配置內容"
51
- - "Team Worker 不得引用 Sunny 的 tools.json 或 RULES.json"
52
-
53
- examples:
54
- violations:
55
- - "product_manager 讀取 .system/sunny/RULES.json 以獲取特權"
56
- - "dev_agent 調用 Sunny 的 team-launcher 工具"
57
- - "team_worker 引用 Sunny 的 cortex 配置繞過標準流程"
58
- correct:
59
- - "用戶直接輸入 /sunny 啟動 Sunny 模式"
60
- - "人類開發者手動編輯 .system/sunny/RULES.json"
@@ -1,231 +0,0 @@
1
- # .rule/general/system-invariants.yaml
2
- # SYS-INV: KenazAI System Invariants Catalog (Conservation Laws)
3
- #
4
- # PURPOSE
5
- # This file is an INDEX of system-level invariants — conservation laws, caps,
6
- # and bounds that the KenazAI system is designed to preserve. Ansuz Phase 2
7
- # (research) queries this catalog BEFORE diving into case research, because
8
- # strategy often falls straight out of the bounds (see VC33: T+M+B
9
- # conservation → alternating-pump strategy without trial).
10
- #
11
- # DISCIPLINE
12
- # - This file is an INDEX, NOT a source of truth.
13
- # - Every entry MUST cite a `source:` back to the defining file+section.
14
- # - Never duplicate a definition here. Paraphrase bound, link to source.
15
- # - Update the `source:` reference when the defining file moves/renames.
16
- #
17
- # USAGE
18
- # Ansuz Phase 2: scan invariants relevant to the task's scope → derive
19
- # constraints → check if strategy is already implied by the bound before
20
- # researching past cases.
21
-
22
- _meta:
23
- id: "SYS-INV"
24
- version: "1.0.0"
25
- description: "KenazAI system invariants — conservation laws, caps, bounds"
26
- last_updated: "2026-04-05"
27
- created_from: "TASK_1023"
28
- file_type: "index" # NOT source-of-truth
29
- discipline: |
30
- Single source of truth. This file indexes but never defines. Every
31
- invariant MUST link back via source: path#section.
32
-
33
- # ============================================================================
34
- # CATEGORY: task_system
35
- # Task lifecycle, state conservation, FSM transitions
36
- # ============================================================================
37
-
38
- invariants:
39
-
40
- - name: task_status_totality
41
- category: task_system
42
- formula: |
43
- tasks_total = |backlog| + |active| + |done| + |blocked| + |cancel| + |archived| + |pool|
44
- (every task belongs to exactly one status directory — no orphans,
45
- no duplicates across directories)
46
- bound: "status ∈ {backlog, active, done, blocked, cancel, archived, pool}"
47
- enforcement: |
48
- task-api.js moveTask() atomic copy-then-delete; ALL_STATUS_DIRS
49
- enumerates the closed set of valid status directories.
50
- violation_detection: |
51
- Scan all STATUS_DIRS for duplicate task_ids → if same id appears in
52
- two directories, atomicity broke. See FAIL-003 (queue pollution).
53
- source: ".collaboration/core/task-api.js#L95-L97 (STATUS_DIRS, ALL_STATUS_DIRS)"
54
- failure_witness: ".failure/pipeline/FAIL-003-queue-pollution.yaml"
55
-
56
- - name: task_state_transitions_fsm
57
- category: task_system
58
- formula: |
59
- VALID_TRANSITIONS = {
60
- backlog → {active, cancel, blocked},
61
- active → {done, blocked, cancel, backlog},
62
- blocked → {active, backlog, cancel},
63
- done → {backlog, archived},
64
- cancel → {backlog},
65
- archived → {backlog}
66
- }
67
- bound: "FSM — NOT strictly single-directional; reopen edges exist"
68
- enforcement: |
69
- task-api.js moveTask() validates newStatus against VALID_TRANSITIONS
70
- before performing the move.
71
- violation_detection: |
72
- task-api.js moveTask rejects invalid transitions with an explicit
73
- error. Audit log of moves can be replayed against the FSM.
74
- source: ".collaboration/core/task-api.js#L119-L125 (VALID_TRANSITIONS)"
75
-
76
- - name: completed_task_archival_discipline
77
- category: task_system
78
- formula: "done tasks must be archived; never re-enter active pool as 'completed'"
79
- bound: "|{t ∈ TASK_QUEUE | t.status == completed}| = 0 after archival"
80
- enforcement: |
81
- PPL-002 (pipeline/PPL-002-completed-task-archival.yaml) — scheduler
82
- must archive-then-remove, not mark-completed-in-place.
83
- violation_detection: |
84
- Grep TASK_QUEUE.json for status:completed entries; non-empty ⇒ leak.
85
- source: ".rule/pipeline/PPL-002-completed-task-archival.yaml"
86
- failure_witness: ".failure/pipeline/FAIL-003-queue-pollution.yaml"
87
-
88
- # ============================================================================
89
- # CATEGORY: concurrency
90
- # Parallel execution caps, locks, isolation boundaries
91
- # ============================================================================
92
-
93
- - name: worktree_isolation_boundary
94
- category: concurrency
95
- formula: |
96
- ∀ dispatched_task t: t.cwd = .formation/worktrees/task_<id>/
97
- (all Read/Edit/Write MUST use worktree-absolute paths, NOT main
98
- repo paths)
99
- bound: "one worktree per active dispatch; no cross-worktree writes"
100
- enforcement: |
101
- Agent-tool dispatch carries SUBAGENT_PREFIX rule 11 (WORKTREE FILE
102
- PATH RULE) in prompt.js. (The former runner.js spawn-time "[WORKTREE]"
103
- injection was removed with the headless path, TASK_2401.)
104
- violation_detection: |
105
- Agent Edits a path under main repo root while cwd is a worktree →
106
- `git add -A` in worktree finds no changes. See FAIL-013.
107
- source: ".formation/tools/prompt.js SUBAGENT_PREFIX rule 11"
108
- failure_witness: ".failure/agent-execution/FAIL-013-search-cwd-drift-and-case-mismatch.yaml"
109
-
110
- - name: per_project_dispatch_lock
111
- category: concurrency
112
- formula: "per-project dispatch-lock serializes non-worktree dispatches"
113
- bound: "1 in-flight serial dispatch per project at a time"
114
- enforcement: |
115
- Dispatch-lock fallback in dispatch.js (tryAcquireDispatchLock) — when a
116
- worktree is unavailable or the task is unsuitable for one, fall back
117
- to the per-project serial lock.
118
- violation_detection: |
119
- Two concurrent non-worktree dispatches writing the same project
120
- state (e.g., task-api moves). Lock contention visible in logs.
121
- source: ".formation/tools/dispatch.js (tryAcquireDispatchLock) + .formation/tools/utils.js (dispatchLockPath)"
122
-
123
- # ============================================================================
124
- # CATEGORY: cognitive
125
- # Fatigue/engagement potentials, phase token budgets, context bounds
126
- # ============================================================================
127
-
128
- - name: fatigue_potential_upper_bound
129
- category: cognitive
130
- formula: "fatigue_potential ∈ [0.0, 1.0]"
131
- bound: "≤ 1.0 (saturation ceiling)"
132
- enforcement: |
133
- fatigue_potential is clamped to [0,1]; Ansuz kernel
134
- reads this as a float in handoff JSON and formats as {:.1f}. When
135
- fatigue_potential == 1.0, Ansuz triggers session handoff (kernel
136
- Phase 12 exit ritual).
137
- violation_detection: |
138
- Any fatigue_potential > 1.0 in a per-session handoff slot
139
- (.kenaz/specialist/handoffs/<sessionId>.json; legacy singular
140
- ansuz_session_handoff.json retired by M3/TASK_1760) is a
141
- clamp-bug. Handoff never triggered on 0.9 ⇒ threshold bug.
142
- source: "dev/archive/ansuz/legacy/kernel.yaml#L213,L350,L381 (fatigue_potential ≤ 1)"
143
-
144
- - name: engagement_potential_upper_bound
145
- category: cognitive
146
- formula: "engagement_potential ∈ [0.0, 1.0]"
147
- bound: "≤ 1.0 (saturation ceiling, mirror of fatigue)"
148
- enforcement: |
149
- engagement_potential follows the same 0.0-1.0 clamp convention as
150
- fatigue_potential (the Muninn observer that produced it was retired
151
- 2026-10-07, TASK_2345; legacy values in handoff slots keep the bound).
152
- violation_detection: |
153
- Engagement score > 1.0 in a handoff slot indicates an unnormalized sum.
154
- source: "dev/archive/ansuz/legacy/kernel.yaml#L213,L350,L381 (same clamp convention as fatigue_potential)"
155
-
156
- - name: phase_0_token_budget
157
- category: cognitive
158
- formula: "Ansuz Phase 0 banner context ≤ 500 tokens"
159
- bound: "≤ 500 tokens (soft cap; boot injection budget)"
160
- enforcement: |
161
- Phase 0 banner is constrained so awakening doesn't burn the context
162
- budget before work begins (the Norn preamble tool was removed in TASK_2335).
163
- violation_detection: |
164
- Count tokens of Phase 0 output; > 500 ⇒ banner bloat.
165
- source: "CLAUDE.md#Session 初始化 (Phase 0 boot budget)"
166
-
167
- - name: cap_first_debug_discipline
168
- category: cognitive
169
- formula: |
170
- When a system action blocks/stalls/fails unexpectedly, enumerate
171
- known caps BEFORE debugging: {max_parallel=5, fatigue_potential≤1,
172
- context budget, dispatch lock, hippocampus budget}. Caps are
173
- strategy-constraints, not bugs.
174
- bound: "N/A (procedural invariant — debugging discipline)"
175
- enforcement: |
176
- Ansuz kernel evolvable rule CAP-FIRST-DEBUG (VC33 derivation).
177
- violation_detection: |
178
- Debug session burns hours on a symptom that a 30-second cap check
179
- would have explained (VC33: cursor stuck at col 20 = mid-wall cap,
180
- not click failure).
181
- source: "dev/archive/ansuz/legacy/kernel.yaml#L213 (CAP-FIRST-DEBUG)"
182
-
183
- # ============================================================================
184
- # CATEGORY: memory
185
- # Persistence intervals, retention, single-slot semantics
186
- # ============================================================================
187
-
188
- - name: ansuz_session_handoff_slot_per_session
189
- category: memory
190
- formula: |
191
- ∃ at-most-one active handoff PER SESSION:
192
- {PROJECT_PATH}/.kenaz/specialist/handoffs/<sessionId>.json
193
- Multiple slots (one per session) coexist BY DESIGN — M3 migration
194
- (TASK_1760) replaced the retired singular slot
195
- ansuz_session_handoff.json, which is read-only legacy fallback.
196
- bound: "one slot per session; legacy singular slot write-forbidden"
197
- enforcement: |
198
- All handoff IO goes through handoff-resolver.js (TASK_1829):
199
- writeHandoff targets only the per-session slot (atomic
200
- write-.tmp-and-rename); readOwnHandoff / readLatestHandoff are the
201
- only two read semantics (own-session freshness vs. boot-time
202
- latest) and must never be merged. Archive-before-overwrite guard:
203
- ansuz-handoff-snapshot.js archives a different session's slot
204
- content to Hippocampus before overwrite; 30-min freshness window
205
- prevents auto-snapshot clobbering a live author.
206
- violation_detection: |
207
- Any code path WRITING the legacy singular slot ⇒ violation
208
- (grep -rn ansuz_session_handoff; only resolver-internal read
209
- fallbacks and marked-historical references may remain). Multiple
210
- slots under handoffs/ is NOT a violation. Unread handoff
211
- overwritten without Hippocampus archive episode ⇒ guard bypassed.
212
- source: ".specialist/Ansuz/tools/handoff-resolver.js (TASK_1829); .specialist/Ansuz/tools/ansuz-handoff-snapshot.js (freshness + archive guard)"
213
-
214
- # ============================================================================
215
- # Maintenance notes
216
- # ============================================================================
217
- _maintenance:
218
- when_to_update: |
219
- - A new cap/bound is introduced in source files (e.g., new max_*
220
- constant, new FSM transition, new retention window).
221
- - An existing bound is changed (value, scope, or enforcement path).
222
- - A new failure case demonstrates an invariant was not previously
223
- catalogued.
224
- when_to_remove: |
225
- - The underlying source file removes the bound entirely.
226
- - Two entries describe the same invariant (dedupe — keep the entry
227
- with the more precise source: reference).
228
- cross_references:
229
- - ".rule/INDEX.yaml (rule system index)"
230
- - ".failure/INDEX.yaml (failure witness ground truth)"
231
- - "dev/archive/ansuz/legacy/kernel.yaml (CAP-FIRST-DEBUG consumer)"