kenaz 0.3.22 → 0.3.24

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 (474) hide show
  1. package/core/.claude/hooks/_user-scope.js +1 -1
  2. package/core/.claude/hooks/core-resolve.js +1 -1
  3. package/core/.claude/hooks/worktree-create.js +11 -29
  4. package/core/.claude/hooks/worktree-remove.js +12 -38
  5. package/core/.collaboration/core/reconcile.js +16 -1
  6. package/core/.collaboration/core/task-2467-lifecycle.test.js +63 -0
  7. package/core/.collaboration/core/task-api.js +37 -7
  8. package/core/.formation/bifrost/launch.js +1 -1
  9. package/core/.formation/tools/dispatch-detail/worktree-subagent-mode.md +6 -1
  10. package/core/.formation/tools/kenaz-stats.js +1 -1
  11. package/core/.formation/tools/post-complete/git-merge.js +1 -1
  12. package/core/.formation/tools/prompt.js +1 -1
  13. package/core/.formation/tools/utils.js +5 -5
  14. package/core/.formation/tools/worktree-reclaim.js +73 -2
  15. package/core/.formation/tools/worktree-reclaim.test.js +113 -0
  16. package/core/.kenaz/specialist/ansuz_rules.yaml +7 -51
  17. package/core/.kenaz/specialist/ansuz_session_handoff.schema.json +2 -6
  18. package/core/.rule/general/project-self-containment.yaml +2 -2
  19. package/core/.specialist/Amelia/README.md +1 -1
  20. package/core/.specialist/Amelia/rule.yaml +1 -1
  21. package/core/.specialist/Ansuz/RULES.md +6 -2
  22. package/core/.specialist/Ansuz/concepts/commitment_layer.yaml +1 -1
  23. package/core/.specialist/Ansuz/concepts/evolvable_guardrails.yaml +1 -1
  24. package/core/.specialist/Ansuz/knowledge.yaml +1 -3
  25. package/core/.specialist/tools/__tests__/task-2409-lessons.test.js +10 -0
  26. package/core/.specialist/tools/__tests__/task-2427-harvest.test.js +25 -0
  27. package/core/.specialist/tools/ansuz-boot-fast.js +1 -1
  28. package/core/.specialist/tools/failure-detector.js +4 -4
  29. package/core/.specialist/tools/handoff-doc.js +1 -1
  30. package/core/.specialist/tools/lessons.js +2 -2
  31. package/core/CLAUDE.md +5 -5
  32. package/core/KENAZ_CORE_VERSION +1 -1
  33. package/core/dashboard/scripts/install-kenaz-cli.js +56 -30
  34. package/core/dev/scripts/check-file-size.js +1 -1
  35. package/core/dev/scripts/ci-feedback.js +1 -1
  36. package/core/dev/scripts/gc-agent-worktrees.js +13 -12
  37. package/core/dev/scripts/kenaz-session.js +3 -3
  38. package/core/dev/scripts/peer-identity-e2e.js +6 -4
  39. package/core/dev/scripts/run-rust-tests.js +2 -2
  40. package/core/dev/scripts/skill-routing-replay.js +3 -3
  41. package/core/dev/scripts/task1961/selftest.js +2 -2
  42. package/core/dev/scripts/windows-hide-guard.test.js +112 -0
  43. package/core/plugins/kenaz/guidance.md +1 -0
  44. package/core/plugins/kenaz/hooks/core-resolve.js +1 -1
  45. package/core/plugins/kenaz/hooks/hooks.json +9 -0
  46. package/core/plugins/kenaz/hooks/kenaz-hook.js +58 -4
  47. package/core/plugins/kenaz/hooks/worktree-guard.js +121 -0
  48. package/core/plugins/kenaz/hooks/worktree-guard.test.js +75 -0
  49. package/core/plugins/kenaz/scripts/kenaz.test.js +72 -5
  50. package/core/plugins/kenaz-peer/hooks/register.test.ts +14 -2
  51. package/core/plugins/kenaz-peer/hooks/register.ts +6 -1
  52. package/lib/cli.js +9 -5
  53. package/package.json +6 -6
  54. package/vendor/install-kenaz-cli.js +56 -30
  55. package/core/.kenaz/designs/METAPLASTICITY_CONFIDENCE_DESIGN.md +0 -537
  56. package/core/.kenaz/designs/REFLEX_INITIATOR_DESIGN.md +0 -501
  57. package/core/.kenaz/designs/TASK_1385_handoff_mcp_design.md +0 -426
  58. package/core/.kenaz/designs/TASK_932_hippocampus_consolidation.md +0 -103
  59. package/core/.kenaz/designs/TASK_934_efe_signal_engine.md +0 -97
  60. package/core/.kenaz/designs/TASK_935_self_evolution_framework.md +0 -154
  61. package/core/.kenaz/designs/VISION_cognitive_architecture_roadmap.md +0 -159
  62. package/core/.kenaz/designs/metaplasticity_simulation_results.json +0 -696
  63. package/core/.kenaz/main-memory/README.md +0 -230
  64. package/core/.kenaz/main-memory/kenaz/cortex/001_cortex_overview.md +0 -168
  65. package/core/.kenaz/main-memory/kenaz/cortex/001_rag_engine_overview.md +0 -30
  66. package/core/.kenaz/main-memory/kenaz/memory-system/001_three_tier_architecture.md +0 -361
  67. package/core/.kenaz/main-memory/kenaz/pipeline/001_task_execution_flow.md +0 -117
  68. package/core/.kenaz/main-memory/kenaz/pipeline/001_task_granularity.md +0 -154
  69. package/core/.kenaz/main-memory/kenaz/pipeline/002_team_priority.md +0 -51
  70. package/core/.kenaz/main-memory/kenaz/pipeline/003_feature_id_system.md +0 -46
  71. package/core/.kenaz/main-memory/kenaz/rules/001_gen_007_self_containment.md +0 -108
  72. package/core/.kenaz/main-memory/kenaz/rules/001_rule_priority_system.md +0 -121
  73. package/core/.kenaz/main-memory/kenaz/rules/002_agt_006_pre_check.md +0 -0
  74. package/core/.kenaz/main-memory/kenaz/rules/003_ppl_002_task_archival.md +0 -48
  75. package/core/.kenaz/main-memory/kenaz/system/001_dual_track_task_system.md +0 -197
  76. package/core/.kenaz/main-memory/knowledge/patterns/001_json_bom_issue.md +0 -78
  77. package/core/.kenaz/main-memory/knowledge/patterns/001_leader_worker_pattern.md +0 -0
  78. package/core/.kenaz/main-memory/knowledge/patterns/002_scope_path_conflict.md +0 -115
  79. package/core/.kenaz/main-memory/knowledge/patterns/002_task_dependency_resolution.md +0 -223
  80. package/core/.kenaz/main-memory/knowledge/patterns/003_question_protocol.md +0 -242
  81. package/core/.kenaz/main-memory/knowledge/patterns/004_user_insight_value.md +0 -111
  82. package/core/.kenaz/main-memory/knowledge/patterns/005_file_lock_pattern.md +0 -274
  83. package/core/.kenaz/main-memory/knowledge/references/001_ppl_rules.md +0 -28
  84. package/core/.kenaz/main-memory/knowledge/solutions/001_json_bom_issue.md +0 -137
  85. package/core/.kenaz/main-memory/knowledge/solutions/001_team_invocation.md +0 -0
  86. package/core/.kenaz/main-memory/knowledge/solutions/002_passive_monitoring.md +0 -0
  87. package/core/.kenaz/main-memory/knowledge/solutions/003_windows_file_race_condition.md +0 -239
  88. package/core/.kenaz/main-memory/registry.json +0 -326
  89. package/core/.kenaz/main-memory/version.yaml +0 -58
  90. package/core/.kenaz/specialist/memory_guard_fired.json +0 -1
  91. package/core/.kenaz/specialist/memory_guard_trigger_cache.json +0 -1
  92. package/core/.kenaz/specialist/memory_source_priority.yaml +0 -260
  93. package/core/.kenaz/specialist/prompt_1775.txt +0 -317
  94. package/core/.kenaz/specialist/prompt_1776.txt +0 -326
  95. package/core/.kenaz/specialist/prompt_1791.txt +0 -320
  96. package/core/.kenaz/specialist/prompt_1792.txt +0 -320
  97. package/core/.kenaz/specialist/prompt_1795.txt +0 -281
  98. package/core/.kenaz/specialist/prompt_1813.txt +0 -332
  99. package/core/.kenaz/specialist/prompt_1814.txt +0 -401
  100. package/core/.kenaz/specialist/prompt_1815.txt +0 -394
  101. package/core/.kenaz/specialist/prompt_1816.txt +0 -437
  102. package/core/.kenaz/specialist/prompt_1818.txt +0 -361
  103. package/core/.kenaz/specialist/prompt_1819.txt +0 -421
  104. package/core/.kenaz/specialist/prompt_1821.txt +0 -345
  105. package/core/.kenaz/specialist/prompt_1822.txt +0 -313
  106. package/core/.kenaz/specialist/prompt_1824.txt +0 -348
  107. package/core/.kenaz/specialist/prompt_1826.txt +0 -388
  108. package/core/.kenaz/specialist/rune_efe_salience_gap.md +0 -21
  109. package/core/.kenaz/specialist/task1825_update.json +0 -43
  110. package/core/.kenaz/specialist/taskgen/consolidation_i.json +0 -38
  111. package/core/.kenaz/specialist/taskgen/csharp_a.json +0 -44
  112. package/core/.kenaz/specialist/taskgen/csharp_b.json +0 -40
  113. package/core/.kenaz/specialist/taskgen/embedding_e.json +0 -34
  114. package/core/.kenaz/specialist/taskgen/hygiene_fg.json +0 -39
  115. package/core/.kenaz/specialist/taskgen/pathology_h.json +0 -36
  116. package/core/.kenaz/specialist/taskgen/unity_noise_d.json +0 -38
  117. package/core/.kenaz/specialist/taskgen/visibility_c.json +0 -38
  118. package/core/.specialist/Ansuz/decisions/ADR-requirement-graph-layer.md +0 -390
  119. package/core/.specialist/Ansuz/self_model_seed.backup.json +0 -100
  120. package/core/.specialist/ansuz_session_handoff.json +0 -96
  121. package/core/dev/ALAYA_FIELD_FEEDBACK_DESIGN.md +0 -126
  122. package/core/dev/ANSUZ_SCAFFOLD_DIET_2026-09-20.md +0 -231
  123. package/core/dev/ANSUZ_STARTUP_INJECTION_REVIEW.md +0 -355
  124. package/core/dev/ANSUZ_WORKFLOW_MODERNIZATION.md +0 -143
  125. package/core/dev/CORTEX_META_GRAPH_ASSESSMENT.md +0 -99
  126. package/core/dev/FREYA_DOWNSTREAM_BUGS_2026-09-19.md +0 -44
  127. package/core/dev/GLOBAL_MEMORY_IDENTITY_CONSOLIDATION.md +0 -263
  128. package/core/dev/GUARD_EFFECTIVENESS_DESIGN.md +0 -180
  129. package/core/dev/HEALTH_GATE_VARIANCE_ASSESSMENT.md +0 -271
  130. package/core/dev/HOOK_DIET_2026-09-21.md +0 -126
  131. package/core/dev/JEV_INTEGRATION_PLAN.md +0 -189
  132. package/core/dev/KENAZ_AGENT_CONNECT_v1_SPEC.md +0 -139
  133. package/core/dev/MOBILE_DESIGN_SPEC.md +0 -569
  134. package/core/dev/MULTI_ANSUZ_SPEC.md +0 -136
  135. package/core/dev/MUNINN_RETIREMENT.md +0 -115
  136. package/core/dev/PHASE3_ATTRIBUTION_POPULATION_DIAGNOSIS.md +0 -211
  137. package/core/dev/PHASE3_P3-2B_TASKLEVEL_PROBE.md +0 -83
  138. package/core/dev/PHASE3_P3-2_POPULATION_DISJOINTNESS.md +0 -83
  139. package/core/dev/PHASE3_P3-2_REMEASURE_REPORT.md +0 -231
  140. package/core/dev/PREDICTION_GROUNDING_DESIGN.md +0 -376
  141. package/core/dev/PRODUCT_SPEC.md +0 -317
  142. package/core/dev/PROJECT_REGISTRY_DUPLICATE_ASSESSMENT.md +0 -86
  143. package/core/dev/STARTUP_TIMELINE_TASK_1995.md +0 -181
  144. package/core/dev/SYNAPSE_WORKER_PER_PROJECT.md +0 -881
  145. package/core/dev/TASK_1680_P3-3_DISPATCH_SPEC.md +0 -96
  146. package/core/dev/TASK_1684_CALIBRATION_IMPACT_ANALYSIS.md +0 -170
  147. package/core/dev/TASK_1684_FORK_A_GOODHART_DESIGN.md +0 -171
  148. package/core/dev/TASK_1684_P3_2_REMEASURE_VALIDATION.md +0 -262
  149. package/core/dev/TASK_1903_SIGNAL_AUC_MEASUREMENT.md +0 -207
  150. package/core/dev/TASK_1904_BRANCH_INTEGRITY_AUDIT.md +0 -146
  151. package/core/dev/ansuz-eval/README.md +0 -38
  152. package/core/dev/ansuz-eval/build-fixtures.js +0 -87
  153. package/core/dev/ansuz-eval/grade.js +0 -96
  154. package/core/dev/ansuz-eval/grader.test.js +0 -117
  155. package/core/dev/ansuz-eval/tasks.md +0 -32
  156. package/core/dev/archive/ansuz/BOOT_FULL.md +0 -141
  157. package/core/dev/archive/ansuz/agents/ansuz-boot.md +0 -176
  158. package/core/dev/archive/ansuz/designs/alaya-passive-surfacing.md +0 -84
  159. package/core/dev/archive/ansuz/designs/cc_memory_indexing.md +0 -307
  160. package/core/dev/archive/ansuz/designs/check_guard.md +0 -322
  161. package/core/dev/archive/ansuz/designs/consequence_loop.md +0 -227
  162. package/core/dev/archive/ansuz/designs/mcp_kuzudb_lock_architecture.md +0 -312
  163. package/core/dev/archive/ansuz/designs/phase0_git_enrichment.md +0 -278
  164. package/core/dev/archive/ansuz/designs/refactor_mcp_tools_synapse.md +0 -490
  165. package/core/dev/archive/ansuz/designs/semantic_markdown_extraction.md +0 -167
  166. package/core/dev/archive/ansuz/designs/task_1372_prompt_injects_into.md +0 -193
  167. package/core/dev/archive/ansuz/designs/thought_stack.md +0 -286
  168. package/core/dev/archive/ansuz/investigations/reachability_unified_api_2026-04-11.md +0 -330
  169. package/core/dev/archive/ansuz/investigations/synapse_orphans_indexing_bug_2026-04-11.md +0 -352
  170. package/core/dev/archive/ansuz/investigations/synapse_orphans_reindex_verification_2026-04-11.md +0 -48
  171. package/core/dev/archive/ansuz/investigations/synapse_orphans_verification_2026-04-11.md +0 -170
  172. package/core/dev/archive/ansuz/legacy/kernel.yaml +0 -399
  173. package/core/dev/archive/ansuz/legacy/phases/phase_0.yaml +0 -418
  174. package/core/dev/archive/ansuz/legacy/phases/phase_1.yaml +0 -376
  175. package/core/dev/archive/ansuz/legacy/phases/phase_10.yaml +0 -35
  176. package/core/dev/archive/ansuz/legacy/phases/phase_11.yaml +0 -582
  177. package/core/dev/archive/ansuz/legacy/phases/phase_2.yaml +0 -94
  178. package/core/dev/archive/ansuz/legacy/phases/phase_3.yaml +0 -274
  179. package/core/dev/archive/ansuz/legacy/phases/phase_4.yaml +0 -67
  180. package/core/dev/archive/ansuz/legacy/phases/phase_5.yaml +0 -32
  181. package/core/dev/archive/ansuz/legacy/phases/phase_6.yaml +0 -91
  182. package/core/dev/archive/ansuz/legacy/phases/phase_7.yaml +0 -58
  183. package/core/dev/archive/ansuz/legacy/phases/phase_8.yaml +0 -146
  184. package/core/dev/archive/ansuz/legacy/phases/phase_9.yaml +0 -424
  185. package/core/dev/archive/ansuz/specs/INDEX_bifrost_hook_parity.yaml +0 -92
  186. package/core/dev/archive/ansuz/specs/active-inference-formation.yaml +0 -453
  187. package/core/dev/archive/ansuz/specs/brief_TASK_1228_userpromptsubmit.yaml +0 -191
  188. package/core/dev/archive/ansuz/specs/brief_TASK_1229_pretooluse_posttooluse.yaml +0 -250
  189. package/core/dev/archive/ansuz/specs/brief_TASK_1230_sessionstart_stop.yaml +0 -301
  190. package/core/dev/archive/ansuz/specs/brief_TASK_1231_verification.yaml +0 -272
  191. package/core/dev/archive/skills/feature_agent/SKILL.md +0 -289
  192. package/core/dev/design/PHASE4_DESIGN.md +0 -559
  193. package/core/dev/design/dashboard_docs_integration_PLAN.md +0 -388
  194. package/core/dev/design/matrix_format_ABBREVIATIONS.md +0 -655
  195. package/core/dev/design/matrix_format_DESIGN_SPEC.md +0 -601
  196. package/core/dev/design/matrix_format_DISCUSSION_SUMMARY.md +0 -484
  197. package/core/dev/design/matrix_format_EXAMPLE_memory.matrix +0 -13
  198. package/core/dev/design/matrix_format_EXAMPLE_project_status.matrix +0 -9
  199. package/core/dev/design/matrix_format_EXAMPLE_tasks.matrix +0 -14
  200. package/core/dev/design/matrix_format_SYNTAX_BNF.md +0 -754
  201. package/core/dev/design/matrix_format_TOKEN_COMPARISON.md +0 -484
  202. package/core/dev/design/matrix_v2_COGNITIVE_DESIGN.md +0 -503
  203. package/core/dev/design/matrix_v2_DISCUSSION_SUMMARY.md +0 -414
  204. package/core/dev/design/matrix_v2_EXAMPLE.matrix +0 -67
  205. package/core/dev/designs/EXPANDABLE_CARD_DESIGN_SPEC.md +0 -509
  206. package/core/dev/jev-eval/ACTIVE_CORRECTION.md +0 -52
  207. package/core/dev/jev-eval/ANNOTATION_GUIDE.md +0 -68
  208. package/core/dev/jev-eval/BASELINE_COMPARISON.md +0 -45
  209. package/core/dev/jev-eval/CONTEXT_REVIEW.md +0 -31
  210. package/core/dev/jev-eval/EVALUATION_STATUS.md +0 -39
  211. package/core/dev/jev-eval/HISTORICAL_CORPUS.md +0 -33
  212. package/core/dev/jev-eval/PACKAGING_VERIFICATION.md +0 -42
  213. package/core/dev/jev-eval/README.md +0 -101
  214. package/core/dev/jev-eval/THALAMUS_RANKING.md +0 -58
  215. package/core/dev/jev-eval/VALIDATION_PROGRESS.md +0 -54
  216. package/core/dev/jev-eval/cli.mjs +0 -50
  217. package/core/dev/jev-eval/context.mjs +0 -183
  218. package/core/dev/jev-eval/corpus.mjs +0 -186
  219. package/core/dev/jev-eval/fixtures/conversation-review.seed.jsonl +0 -6
  220. package/core/dev/jev-eval/fixtures/synthetic.jsonl +0 -11
  221. package/core/dev/jev-eval/metrics.mjs +0 -67
  222. package/core/dev/jev-eval/muninn-baseline.mjs +0 -119
  223. package/core/dev/jev-eval/providers.mjs +0 -95
  224. package/core/dev/jev-eval/reports/annotation-pilot-2026-09-20.json +0 -32
  225. package/core/dev/jev-eval/reports/context-review-2026-09-20.json +0 -48
  226. package/core/dev/jev-eval/reports/conversation-review.pending.json +0 -151
  227. package/core/dev/jev-eval/reports/history-corpus-2026-09-20.json +0 -52
  228. package/core/dev/jev-eval/reports/length-probe-2026-09-20.json +0 -133
  229. package/core/dev/jev-eval/reports/live-smoke-2026-09-20.json +0 -616
  230. package/core/dev/jev-eval/reports/muninn-baseline-2026-09-20.json +0 -52
  231. package/core/dev/jev-eval/reports/resilience-2026-09-20.json +0 -520
  232. package/core/dev/jev-eval/reports/rules-baseline.json +0 -197
  233. package/core/dev/jev-eval/reports/synthetic-review.pending.json +0 -357
  234. package/core/dev/jev-eval/resilience.mjs +0 -71
  235. package/core/dev/jev-eval/review.mjs +0 -78
  236. package/core/dev/jev-eval/schema.mjs +0 -87
  237. package/core/dev/jev-eval/test/context.test.mjs +0 -95
  238. package/core/dev/jev-eval/test/corpus.test.mjs +0 -102
  239. package/core/dev/jev-eval/test/eval.test.mjs +0 -146
  240. package/core/dev/jev-eval/test/muninn-baseline.test.mjs +0 -71
  241. package/core/dev/jev-eval/test/resilience.test.mjs +0 -72
  242. package/core/dev/jev-eval/test/review.test.mjs +0 -61
  243. package/core/dev/pipeline/PHASE3_PLANNING_SUMMARY.md +0 -338
  244. package/core/dev/pipeline/PROGRESS.md +0 -113
  245. package/core/dev/pipeline/PROGRESS_template.md +0 -860
  246. package/core/dev/pipeline/QA_REPORT_F008.md +0 -431
  247. package/core/dev/pipeline/QA_REPORT_LOCAL_CLAUDE_DIAGNOSIS.md +0 -583
  248. package/core/dev/pipeline/README.md +0 -210
  249. package/core/dev/pipeline/WORKFLOW_GUIDE.md +0 -824
  250. package/core/dev/pipeline/archived/TASK_015_tauri_init.yaml +0 -53
  251. package/core/dev/pipeline/archived/TASK_016_tauri_commands.yaml +0 -54
  252. package/core/dev/pipeline/archived/TASK_017_rust_pty.yaml +0 -54
  253. package/core/dev/pipeline/archived/TASK_018_tauri_bundle.yaml +0 -53
  254. package/core/dev/pipeline/archived/TASK_019_release_workflow.yaml +0 -56
  255. package/core/dev/pipeline/archived/TASK_020_update_ui.yaml +0 -54
  256. package/core/dev/pipeline/archived/TASK_021_update_notification_ui.yaml +0 -55
  257. package/core/dev/pipeline/archived/TASK_022_remove_node_pty.yaml +0 -65
  258. package/core/dev/pipeline/archived/TASK_023_api_routes_migration.yaml +0 -86
  259. package/core/dev/pipeline/archived/TASK_024_feature_id_system.yaml +0 -51
  260. package/core/dev/pipeline/archived/TASK_025_executable_acceptance.yaml +0 -66
  261. package/core/dev/pipeline/archived/TASK_026_spec_versioning.yaml +0 -56
  262. package/core/dev/pipeline/archived/TASK_027_drift_detection.yaml +0 -60
  263. package/core/dev/pipeline/archived/TASK_028_tauri_pty_manager.yaml +0 -60
  264. package/core/dev/pipeline/archived/TASK_029_tauri_pty_commands.yaml +0 -62
  265. package/core/dev/pipeline/archived/TASK_030_frontend_session_adapter.yaml +0 -54
  266. package/core/dev/pipeline/archived/TASK_031_terminal_tauri_events.yaml +0 -56
  267. package/core/dev/pipeline/archived/TASK_041_scheduler_data_models.yaml +0 -54
  268. package/core/dev/pipeline/archived/TASK_042_path_lock_manager.yaml +0 -53
  269. package/core/dev/pipeline/archived/TASK_043_process_manager.yaml +0 -57
  270. package/core/dev/pipeline/archived/TASK_044_git_integration.yaml +0 -85
  271. package/core/dev/pipeline/archived/TASK_045_task_queue_manager.yaml +0 -54
  272. package/core/dev/pipeline/archived/TASK_046_scheduler_dispatcher.yaml +0 -60
  273. package/core/dev/pipeline/archived/TASK_047_tauri_scheduler_commands.yaml +0 -55
  274. package/core/dev/pipeline/archived/TASK_048_realtime_status_push.yaml +0 -92
  275. package/core/dev/pipeline/archived/TASK_049_frontend_scheduler_integration.yaml +0 -58
  276. package/core/dev/pipeline/archived/TASK_050_error_recovery.yaml +0 -56
  277. package/core/dev/pipeline/archived/TASK_051_optimization_proposals_backend.yaml +0 -53
  278. package/core/dev/pipeline/archived/TASK_052_optimization_proposals_ui.yaml +0 -58
  279. package/core/dev/pipeline/archived/TASK_053_optimization_proposals_diff_view.yaml +0 -54
  280. package/core/dev/pipeline/archived/TASK_054_multi_project_scheduler_state.yaml +0 -76
  281. package/core/dev/pipeline/archived/TASK_055_scheduler_api_project_scope.yaml +0 -64
  282. package/core/dev/pipeline/archived/TASK_056_frontend_scheduler_project_scope.yaml +0 -62
  283. package/core/dev/pipeline/archived/TASK_057_scheduler_module_structure.yaml +0 -54
  284. package/core/dev/pipeline/archived/TASK_058_scheduler_models_extract.yaml +0 -51
  285. package/core/dev/pipeline/archived/TASK_059_scheduler_core_extract.yaml +0 -51
  286. package/core/dev/pipeline/archived/TASK_060_scheduler_commands_extract.yaml +0 -51
  287. package/core/dev/pipeline/archived/TASK_061_scheduler_specialized_commands.yaml +0 -53
  288. package/core/dev/pipeline/archived/TASK_062_process_manager_module_structure.yaml +0 -56
  289. package/core/dev/pipeline/archived/TASK_063_process_manager_core_extract.yaml +0 -56
  290. package/core/dev/pipeline/archived/TASK_064_recovery_module_structure.yaml +0 -57
  291. package/core/dev/pipeline/archived/TASK_065_recovery_core_extract.yaml +0 -56
  292. package/core/dev/pipeline/archived/TASK_066_self_enhancement_scheduler_models.yaml +0 -60
  293. package/core/dev/pipeline/archived/TASK_067_agents_section_quick_actions.yaml +0 -53
  294. package/core/dev/pipeline/archived/TASK_067_self_enhancement_scheduler_core.yaml +0 -65
  295. package/core/dev/pipeline/archived/TASK_068_agent_workflow_rule_enhancement.yaml +0 -46
  296. package/core/dev/pipeline/archived/TASK_068_self_enhancement_tauri_commands.yaml +0 -61
  297. package/core/dev/pipeline/archived/TASK_069_agent_wizard_responsive.yaml +0 -46
  298. package/core/dev/pipeline/archived/TASK_069_self_enhancement_ui.yaml +0 -62
  299. package/core/dev/pipeline/archived/TASK_070_preview_panel_redesign.yaml +0 -62
  300. package/core/dev/pipeline/archived/TASK_070_self_enhancement_integration.yaml +0 -57
  301. package/core/dev/pipeline/archived/TASK_071_preview_panel_qa.yaml +0 -98
  302. package/core/dev/pipeline/archived/TASK_071_single_agent_config.yaml +0 -57
  303. package/core/dev/pipeline/archived/TASK_072_preview_modal_esc_fix.yaml +0 -71
  304. package/core/dev/pipeline/archived/TASK_072_product_review_module.yaml +0 -57
  305. package/core/dev/pipeline/archived/TASK_073_agents_page_component_refactor.yaml +0 -68
  306. package/core/dev/pipeline/archived/TASK_073_rename_single_agent.yaml +0 -64
  307. package/core/dev/pipeline/archived/TASK_074_preview_mode_ui_diagnosis.yaml +0 -71
  308. package/core/dev/pipeline/archived/TASK_074_single_agent_ui_toggle.yaml +0 -56
  309. package/core/dev/pipeline/archived/TASK_075_agents_page_component_refactor.yaml +0 -69
  310. package/core/dev/pipeline/archived/TASK_075_single_agent_integration_test.yaml +0 -75
  311. package/core/dev/pipeline/archived/TASK_076_preview_mode_ui_diagnosis.yaml +0 -70
  312. package/core/dev/pipeline/archived/TASK_076_single_agent_continuous_mode.yaml +0 -65
  313. package/core/dev/pipeline/archived/TASK_077_failure_directory_structure.yaml +0 -51
  314. package/core/dev/pipeline/archived/TASK_077_single_agent_typescript_types.yaml +0 -59
  315. package/core/dev/pipeline/archived/TASK_078_fail_001_agent_no_output.yaml +0 -53
  316. package/core/dev/pipeline/archived/TASK_078_single_agent_ui_simplify.yaml +0 -74
  317. package/core/dev/pipeline/archived/TASK_079_dashboard_rwd_responsive.yaml +0 -63
  318. package/core/dev/pipeline/archived/TASK_079_fail_002_json_bom.yaml +0 -56
  319. package/core/dev/pipeline/archived/TASK_080_fail_003_queue_pollution.yaml +0 -56
  320. package/core/dev/pipeline/archived/TASK_080_http_server_module.yaml +0 -55
  321. package/core/dev/pipeline/archived/TASK_081_failure_logging_tools.yaml +0 -57
  322. package/core/dev/pipeline/archived/TASK_081_http_api_routes.yaml +0 -62
  323. package/core/dev/pipeline/archived/TASK_082_frontend_api_adapter.yaml +0 -51
  324. package/core/dev/pipeline/archived/TASK_082_integrate_failure_to_workflow.yaml +0 -60
  325. package/core/dev/pipeline/archived/TASK_083_cleanup_nextjs_api.yaml +0 -48
  326. package/core/dev/pipeline/archived/TASK_083_task_queue_cleanup.yaml +0 -67
  327. package/core/dev/pipeline/archived/TASK_084_rust_dead_code_cleanup.yaml +0 -66
  328. package/core/dev/pipeline/archived/TASK_084_scheduler_sync_logic_fix.yaml +0 -68
  329. package/core/dev/pipeline/archived/TASK_085_http_api_web_mode_fixes.yaml +0 -46
  330. package/core/dev/pipeline/archived/TASK_085_memory_consolidation_0204_0205.yaml +0 -98
  331. package/core/dev/pipeline/archived/TASK_086_collapsible_preview_panel.yaml +0 -161
  332. package/core/dev/pipeline/archived/TASK_086_web_mode_feature_parity.yaml +0 -62
  333. package/core/dev/pipeline/archived/TASK_087_manual_memory_archival.yaml +0 -163
  334. package/core/dev/pipeline/archived/TASK_087_mobile_http_control.yaml +0 -68
  335. package/core/dev/pipeline/archived/TASK_088_fail_003_to_ppl_002_rule.yaml +0 -63
  336. package/core/dev/pipeline/archived/TASK_088_mobile_http_qa.yaml +0 -121
  337. package/core/dev/pipeline/archived/TASK_089_agent_collaboration_topic.yaml +0 -60
  338. package/core/dev/pipeline/archived/TASK_089_web_mode_monitor_fix.yaml +0 -58
  339. package/core/dev/pipeline/archived/TASK_090_cli_detection_fix.yaml +0 -61
  340. package/core/dev/pipeline/archived/TASK_090_ui_ux_lessons_topic.yaml +0 -63
  341. package/core/dev/pipeline/archived/TASK_091_expandable_card_design.yaml +0 -56
  342. package/core/dev/pipeline/archived/TASK_091_move_agent_section_components.yaml +0 -65
  343. package/core/dev/pipeline/archived/TASK_092_expandable_card_component.yaml +0 -60
  344. package/core/dev/pipeline/archived/TASK_092_refactor_agent_create_wizard.yaml +0 -84
  345. package/core/dev/pipeline/archived/TASK_093_taskcard_detail_integration.yaml +0 -57
  346. package/core/dev/pipeline/archived/TASK_093_update_barrel_exports_test.yaml +0 -84
  347. package/core/dev/pipeline/archived/TASK_094_ai_agent_generation_enhancement.yaml +0 -115
  348. package/core/dev/pipeline/archived/TASK_094_proposalcard_detail_integration.yaml +0 -55
  349. package/core/dev/pipeline/archived/TASK_095_preview_fixes.yaml +0 -129
  350. package/core/dev/pipeline/archived/TASK_095_single_agent_task_selector.yaml +0 -60
  351. package/core/dev/pipeline/archived/TASK_096_agents_page_ux_improvements.yaml +0 -163
  352. package/core/dev/pipeline/archived/TASK_096_single_agent_status_sync.yaml +0 -60
  353. package/core/dev/pipeline/archived/TASK_097_local_claude_error_logging.yaml +0 -59
  354. package/core/dev/pipeline/archived/TASK_097_single_agent_monitor_events.yaml +0 -59
  355. package/core/dev/pipeline/archived/TASK_098_product_manager_team_phase2.yaml +0 -60
  356. package/core/dev/pipeline/archived/TASK_098_single_agent_refactor_test.yaml +0 -58
  357. package/core/dev/pipeline/archived/TASK_099_backend_team_creation.yaml +0 -258
  358. package/core/dev/pipeline/archived/TASK_100_frontend_team_creation.yaml +0 -61
  359. package/core/dev/pipeline/archived/TASK_101_orchestrator_system.yaml +0 -403
  360. package/core/dev/pipeline/archived/TASK_102_designer_sre_teams.yaml +0 -90
  361. package/core/dev/pipeline/archived/TASK_103_integration_testing.yaml +0 -86
  362. package/core/dev/pipeline/archived/TASK_128_integration_testing.yaml +0 -83
  363. package/core/dev/pipeline/archived/TASK_134_cortex_v2_phase3_file_watcher.yaml +0 -65
  364. package/core/dev/pipeline/archived/TASK_134_team_http_api.yaml +0 -96
  365. package/core/dev/pipeline/archived/TASK_135_cortex_v2_phase3_git_monitor.yaml +0 -63
  366. package/core/dev/pipeline/archived/TASK_136_cortex_v2_phase3_change_analyzer.yaml +0 -69
  367. package/core/dev/pipeline/archived/TASK_137_cortex_v2_phase3_cache_invalidator.yaml +0 -67
  368. package/core/dev/pipeline/archived/TASK_137_team_orchestrator_integration.yaml +0 -93
  369. package/core/dev/pipeline/archived/TASK_138_cortex_v2_phase3_distributed_cache.yaml +0 -68
  370. package/core/dev/pipeline/archived/TASK_138_matrix_folder_structure.yaml +0 -61
  371. package/core/dev/pipeline/archived/TASK_139_cortex_v2_phase3_cache_prewarming.yaml +0 -65
  372. package/core/dev/pipeline/archived/TASK_146_unified_documentation.yaml +0 -141
  373. package/core/dev/pipeline/archived/TASK_147_pipeline_execution_rules.yaml +0 -76
  374. package/core/dev/pipeline/archived/TASK_148_update_claude_md.yaml +0 -77
  375. package/core/dev/pipeline/archived/TASK_149_fix_nextjs_mdx_serialization.yaml +0 -63
  376. package/core/dev/pipeline/archived/TASK_149_update_team_docs.yaml +0 -77
  377. package/core/dev/pipeline/archived/TASK_150_pipeline_workflow_guide.yaml +0 -82
  378. package/core/dev/pipeline/archived/TASK_164_fix_smart_context_switch.yaml +0 -49
  379. package/core/dev/pipeline/archived/TASK_165_ctags_symbol_index.yaml +0 -53
  380. package/core/dev/pipeline/archived/TASK_166_symbol_search_mcp_tool.yaml +0 -48
  381. package/core/dev/pipeline/archived/TASK_167_llm_module_summary.yaml +0 -55
  382. package/core/dev/pipeline/archived/TASK_168_map_reduce_context.yaml +0 -51
  383. package/core/dev/pipeline/archived/TASK_169_v2_integration_testing.yaml +0 -52
  384. package/core/dev/pipeline/backups/archive_2026-02-04T22-07-22/TASK_QUEUE_backup.json +0 -95
  385. package/core/dev/pipeline/docs/multi-agent-coordination.md +0 -446
  386. package/core/dev/pipeline/docs/overview.md +0 -406
  387. package/core/dev/pipeline/docs/task-management.md +0 -412
  388. package/core/dev/pipeline/docs/workflows.md +0 -32
  389. package/core/dev/pipeline/orchestrator/schemas/task_queue_schema.json +0 -58
  390. package/core/dev/pipeline/orchestrator/schemas/task_schema.json +0 -139
  391. package/core/dev/pipeline/plans/PLAN_task_cli_refactor.md +0 -281
  392. package/core/dev/pipeline/test_results/TASK_TEST_PARALLEL_002_result.txt +0 -27
  393. package/core/dev/plans/ANSUZ_SLIM_PLAN.md +0 -68
  394. package/core/dev/plans/CLI_FIRST_INSTALL_FLOW.md +0 -120
  395. package/core/dev/plans/FORMATION_RETIREMENT_PLAN.md +0 -313
  396. package/core/dev/plans/KUZU_REPLACEMENT_PLAN.md +0 -126
  397. package/core/dev/scripts/CRASH_DIAGNOSIS.md +0 -47
  398. package/core/dev/scripts/README.md +0 -142
  399. package/core/dev/scripts/RUN_ONCE.bat +0 -40
  400. package/core/dev/scripts/START_DEV_AGENT.bat +0 -63
  401. package/core/dev/scripts/START_MULTI_AGENT.bat +0 -80
  402. package/core/dev/scripts/dev_agent_scheduler.ps1 +0 -536
  403. package/core/dev/scripts/init_git.ps1 +0 -396
  404. package/core/dev/scripts/init_git.sh +0 -337
  405. package/core/dev/scripts/init_project.ps1 +0 -851
  406. package/core/dev/scripts/init_project.sh +0 -477
  407. package/core/dev/scripts/multi_agent_scheduler.ps1 +0 -2021
  408. package/core/dev/scripts/multi_agent_scheduler.sh +0 -1344
  409. package/core/dev/scripts/run_once.sh +0 -47
  410. package/core/dev/scripts/setup_rag.ps1 +0 -304
  411. package/core/dev/scripts/setup_rag.sh +0 -230
  412. package/core/dev/scripts/start_dev_agent.sh +0 -137
  413. package/core/dev/scripts/start_multi_agent.sh +0 -41
  414. package/core/dev/scripts/sync_task_queue.ps1 +0 -505
  415. package/core/dev/scripts/sync_task_queue.sh +0 -392
  416. package/core/dev/specs/agent-connect/PROTOCOL.md +0 -177
  417. package/core/dev/specs/agent-connect/SDK_GUIDE.md +0 -915
  418. package/core/dev/specs/agent-connect/examples/minimal-site/README.md +0 -137
  419. package/core/dev/specs/agent-connect/examples/minimal-site/package.json +0 -12
  420. package/core/dev/specs/agent-connect/examples/minimal-site/public/index.html +0 -116
  421. package/core/dev/specs/agent-connect/examples/minimal-site/public/install-redirect.js +0 -73
  422. package/core/dev/specs/agent-connect/examples/minimal-site/server.js +0 -516
  423. package/core/dev/specs/agent-connect/examples/minimal-site/test/smoke.test.mjs +0 -263
  424. package/core/dev/specs/agent-connect/history/DEFECT_REPORT_kenaz-agent-hub_2026-09-09_v0.4-empty-prompt-no-first-turn.md +0 -77
  425. package/core/dev/specs/agent-connect/history/DEFECT_REPORT_kenaz-agent-hub_2026-09-09_v0.4-prompt-mojibake.md +0 -90
  426. package/core/dev/specs/agent-connect/history/FEATURE_REQUEST_kenaz-agent-hub_2026-09-07.md +0 -61
  427. package/core/dev/specs/agent-connect/history/FEATURE_REQUEST_kenaz-agent-hub_2026-09-08_relay-v1-conformance.md +0 -76
  428. package/core/dev/specs/agent-connect/history/FEATURE_REQUEST_kenaz-agent-hub_2026-09-09_v0.4-session-channel.md +0 -87
  429. package/core/dev/specs/agent-connect/history/FLOWPIX_REPLY_agent-hub_2026-09-08_relay-v1-answers.md +0 -68
  430. package/core/dev/specs/agent-connect/history/FLOWPIX_bridge_CONTRACT.md +0 -642
  431. package/core/dev/specs/agent-connect/history/FLOWPIX_spikes_relay_spike_relay.mjs +0 -244
  432. package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-07.md +0 -77
  433. package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-08_direction-change-v0.3.md +0 -44
  434. package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-08_relay-v1-answers-ack.md +0 -37
  435. package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-08_relay-v1-conformance.md +0 -56
  436. package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_annotations-install-coldstart.md +0 -44
  437. package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_empty-prompt-first-turn.md +0 -56
  438. package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_prompt-mojibake-fixed.md +0 -48
  439. package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_session-channel.md +0 -57
  440. package/core/dev/specs/agent-connect/history/PROTOCOL_v0.3_snapshot.md +0 -379
  441. package/core/dev/specs/agent-connect/history/README.md +0 -47
  442. package/core/dev/specs/peer/CODEX_INTERACTIVE_PUSH.md +0 -65
  443. package/core/dev/specs/peer/CODEX_MANAGED_DAEMON.md +0 -54
  444. package/core/dev/specs/peer/CODEX_PEER_PULL_SPIKE.md +0 -54
  445. package/core/dev/specs/peer/MODS_SPIKE.md +0 -133
  446. package/core/dev/specs/peer/PER_PROJECT_ADDRESSING.md +0 -143
  447. package/core/dev/specs/peer/SWARM_PROTOCOLS.md +0 -256
  448. package/core/dev/specs/peer/codex-hook-shim-peer.test.js +0 -113
  449. package/core/dev/specs/peer/codex-push-launcher.test.js +0 -142
  450. package/core/dev/specs/peer/setup-codex-hooks.test.js +0 -60
  451. package/core/dev/specs/peer-ansuz/DELIVERY_SPIKE.md +0 -397
  452. package/core/dev/specs/peer-ansuz/DESIGN.md +0 -109
  453. package/core/dev/specs/peer-ansuz/spike/claude_poke.js +0 -129
  454. package/core/dev/specs/peer-ansuz/spike/claude_session_start_hook.js +0 -37
  455. package/core/dev/specs/peer-ansuz/spike/claude_settings_hook.json +0 -14
  456. package/core/dev/specs/peer-ansuz/spike/codex_appserver_client.js +0 -105
  457. package/core/dev/specs/peer-ansuz/spike/codex_appserver_query.js +0 -29
  458. package/core/dev/specs/peer-ansuz/spike/extract_timeline.js +0 -26
  459. package/core/dev/specs/synapse/SYMBOL_IDENTITY.md +0 -305
  460. package/core/dev/spikes/A4-cypher-varlen.md +0 -176
  461. package/core/dev/spikes/bloat-rounds.sh +0 -25
  462. package/core/dev/spikes/mods/clean-claude.js +0 -9
  463. package/core/dev/spikes/mods/drive-probe.js +0 -29
  464. package/core/dev/spikes/mods/e2e-peer.js +0 -71
  465. package/core/dev/spikes/mods/evidence/e2e-peer-control.json +0 -17
  466. package/core/dev/spikes/mods/evidence/e2e-peer-mod.json +0 -17
  467. package/core/dev/spikes/mods/evidence/probe-006a6e65-d807-4bc1-b648-fd7d1edfe0b4.jsonl +0 -4
  468. package/core/dev/spikes/mods/evidence/probe-cebdf1f7-f9c4-47a8-83cd-7c0786177404.jsonl +0 -12
  469. package/core/dev/spikes/mods/evidence/probe-eb21147d-10ce-4c32-93ed-37ca37d88d5a.jsonl +0 -11
  470. package/core/dev/spikes/mods/evidence/stream-cebdf1f7.jsonl +0 -18
  471. package/core/dev/spikes/mods/kenaz-mod-probe/.claude-plugin/plugin.json +0 -1
  472. package/core/dev/spikes/mods/kenaz-mod-probe/hooks/hooks.json +0 -1
  473. package/core/dev/spikes/mods/kenaz-mod-probe/hooks/register.ts +0 -65
  474. package/core/dev/spikes/mods/kenaz-mod-probe/tsconfig.json +0 -3
@@ -1,54 +0,0 @@
1
- # Codex UserPromptSubmit hook injection spike (TASK_2299)
2
-
3
- Date: 2026-10-04. Codex CLI: `codex-cli 0.159.2` (model gpt-6-astra). Closes TASK_2141 open risk 5.
4
-
5
- ## Result: WORKS
6
-
7
- A Codex `UserPromptSubmit` command hook's stdout reaches the model's context for that turn. Both shapes were accepted:
8
-
9
- | Hook stdout | Reached the model? |
10
- |---|---|
11
- | Plain text, e.g. `PEERNONCE_PLAIN_7Q4K` | yes |
12
- | JSON `{"hookSpecificOutput":{"hookEventName":"UserPromptSubmit","additionalContext":"PEERNONCE_JSON_9X2M"}}` | yes |
13
-
14
- The shim uses plain text (simplest; no JSON-escaping of peer text).
15
-
16
- ## Hook config format (config.toml, same as setup-codex.js already writes)
17
-
18
- ```toml
19
- [[hooks.UserPromptSubmit]]
20
-
21
- [[hooks.UserPromptSubmit.hooks]]
22
- type = "command"
23
- command = 'node "/abs/path/hook.js"'
24
- timeout = 15
25
- ```
26
-
27
- Hook stdin is JSON: `session_id`, `turn_id`, `transcript_path`, `cwd`, `hook_event_name`, `prompt` (observed keys: `session_id`, `turn_id`, `transcript_path`, `cwd`).
28
-
29
- ## IMPORTANT: hook trust
30
-
31
- Codex 0.159.2 does NOT run a newly registered hook until it is reviewed/trusted ("New hook - review required"; persisted as `[hooks.state."<key>"] trusted_hash` in config.toml; re-review after the hook changes). Control run: with the hooks registered but untrusted, the model reported `NONE` and the hook log file was never written. Trust is granted by the user in the TUI (`/hooks`); `codex exec --dangerously-bypass-hook-trust` bypasses it for one invocation (used only in the isolated spike). So registering the hook via setup-codex.js is necessary but not sufficient: the user must trust it once, and again after the shim/command changes.
32
-
33
- ## Commands (isolated CODEX_HOME; real ~/.codex untouched)
34
-
35
- 1. Copy `~/.codex/auth.json` and `config.toml` to a temp dir; append two `[[hooks.UserPromptSubmit]]` blocks (plain-text hook, JSON hook).
36
- 2. Control (no bypass): `CODEX_HOME=<tmp> codex exec --json --skip-git-repo-check -s read-only -C <tmp> "Repeat back any unusual codeword tokens ... If none, say NONE."` -> `NONE`, no hook log.
37
- 3. With bypass: same command plus `--dangerously-bypass-hook-trust` -> agent_message `PEERNONCE_PLAIN_7Q4K` and `PEERNONCE_JSON_9X2M`; hook log shows stdin JSON.
38
-
39
- ## This machine
40
-
41
- `~/.codex/config.toml` has NO kenaz hooks (no `[[hooks.*]]` at all, including UserPromptSubmit). `setup-codex.js` `missingHookEvents()` reports all five events missing. Installing (re-running setup-codex) plus a one-time `/hooks` trust review is needed before the pull is live.
42
-
43
- ## Implementation
44
-
45
- `.formation/bifrost/openai/codex-hook-shim.js` on `UserPromptSubmit`: resolve root (`KENAZ_CONSOLIDATE_ROOT` or hook `cwd`, via `_peer-project-root.js`) -> `GET /api/peer/pending?peek=true&projectPath&sessionId` (2.5 s bound, fail-open) -> print Codex-tuned frame (mirrors `codex_wake.rs frame_for_codex`) to stdout -> `POST /api/peer/ack {projectPath, ids}`. Messages are text only; nothing is acted on. Tests: `dev/specs/peer/codex-hook-shim-peer.test.js`, `dev/specs/peer/setup-codex-hooks.test.js`.
46
-
47
- Gate: the pull runs only when `KENAZ_PEER_PULL=1` (set by `.formation/bifrost/launch.js` for the interactive session; `relay.js` deletes it from headless worker env) so formation workers sharing the user-wide hook never peek/ack the inbox.
48
-
49
- ## Operational notes (2026-10-05, from wei@Ashfall's field verification)
50
-
51
- - Verified live on Ashfall after 645343bc8: three pending messages were injected on the next prompt.
52
- - Session identity: inside Codex, use `CODEX_SESSION_ID` as the session id (for `kenaz_peer_send` and handoffs). The fast-boot banner now prefers it (ansuz-boot-fast.js `harnessSessionIdFromEnv`); before that it reported an id taken from Claude hook hints, and replies bound to that id were not delivered to the Codex session.
53
- - Diagnostics: `GET /api/peer/pending?peek=true` WITH `sessionId` claims a 60 s lease on the returned rows (`peer.rs` LEASE_SECS, TASK_2285); a diagnostic peek under another id delays delivery to the real session for up to 60 s. Diagnose with peek and NO sessionId.
54
- - Idle push (delivery without a user prompt) is not provided for Codex: `codex_push` is off by design and the Claude helper push path (`expected exactly one SendMessage call`) is parked in favour of the kenaz-peer mod (TASK_2159 / TASK_2234).
@@ -1,133 +0,0 @@
1
- # Claude Code mods spike (TASK_2225)
2
-
3
- Date: 2026-10-03. CLI: Claude Code 2.1.288 (Windows 11). Status: spike report, no production code changed.
4
-
5
- Question: can a Claude Code mod (function-hooks plugin, CLI >= 2.1.287) running inside each
6
- Ansuz session replace (a) the peer wake helper (`peer_wake.rs`, a `claude -p` helper calling
7
- ListAgents + SendMessage) and (b) the peer pull in the `UserPromptSubmit` hook
8
- (`.claude/hooks/turn-context.js` -> `GET /api/peer/pending`)?
9
-
10
- ## Reproduce
11
-
12
- - Probe mod: `dev/spikes/mods/kenaz-mod-probe/` (`claude plugin validate` passes; not installed globally).
13
- - One-shot run: `claude -p --plugin-dir dev/spikes/mods/kenaz-mod-probe --output-format json "<ask for the MODPROBE_CONTEXT line>"`.
14
- - Long-lived idle run: `node dev/spikes/mods/drive-probe.js <repo> 80000`. This opens a stream-json session, sends one prompt,
15
- then holds stdin open for 80 s so the session sits idle but alive.
16
- - Evidence: `dev/spikes/mods/evidence/probe-<sessionId>.jsonl` (written by the mod itself) and
17
- `evidence/stream-cebdf1f7.jsonl` (the session's stream-json output).
18
-
19
- The probe records: `session.start` -> `$.session.id/cwd`; `$.http.fetch` to the backend plus a closed
20
- port as a negative control; `$.clock.every(10s)` capped at 6 ticks; a `prompt.submit` hook that adds a
21
- per-load random token as context; `$.clock.after(15s)` -> `$.prompt.submit(...)`.
22
-
23
- ## Step 1: doc claims vs live behaviour
24
-
25
- | Claim | Verdict | Evidence |
26
- |---|---|---|
27
- | A `prompt.submit` hook can add context that only the model reads | **VERIFIED** | Run `006a6e65`: the model replied `MODPROBE_CONTEXT token=8ayfzh14 session=006a6e65-…`. The token is random per load, so the model cannot guess it. The user never sees it. |
28
- | `$.http.fetch` reaches `127.0.0.1:18080` | **VERIFIED** | `/api/health` returned `200 {"status":"ok","service":"kenaz-dashboard","version":"0.2.257",…}`. The control fetch to `127.0.0.1:1` rejected with `ECONNREFUSED`, so the success is not vacuous. |
29
- | `$.session.id()` equals the hook payload / harness `session_id` | **VERIFIED** | The mod recorded `id=006a6e65-d807-…`, identical to `session_id` in the `claude -p` JSON output. Run 2 shows the same: mod `cebdf1f7-…` equals the stream-json `init session cebdf1f7-…`. |
30
- | `$.clock.every` runs background timers | **VERIFIED** | Run `cebdf1f7`: 6 ticks at +10.0 s spacing (`1791014909642` … `1791014959648`), then `cancel()` stopped it. Ticks kept firing while no turn was running. |
31
- | `$.prompt.submit` waits until the session is idle and starts a new turn with no user input | **VERIFIED (SDK host + real TTY)** | TTY run `eb21147d` (2026-10-03, see caveat 1): idle submit started a turn and the model answered. SDK run `cebdf1f7`: turn 1 ended with `result: success READY`. At +15 s the mod logged `submit.call`, and `submit.result` came back with `origin {kind:"plugin", name:"kenaz-mod-probe"}`. The stream then shows a second `init` and a new assistant turn, with no input on stdin. |
32
-
33
- ### Caveats and extra findings
34
-
35
- 1. **Idle submit, real TTY: VERIFIED 2026-10-03.** An interactive `claude --plugin-dir dev/spikes/mods/kenaz-mod-probe`
36
- session in a new console was left untouched. The mod logged `submit.call`, then `submit.result` with origin `plugin`, 15 s
37
- after start (`evidence/probe-eb21147d-….jsonl`). The transcript shows a new user turn that the engine framed as
38
- "The kenaz-mod-probe plugin sent a message: …", followed by an assistant reply.
39
- - **Launch gotcha:** a session started from inside another Claude Code session inherits `CLAUDE_CODE_CHILD_SESSION`
40
- and the other `CLAUDE*` vars. It then runs as a child, with transcript saving off and no mod evidence. The first
41
- attempt failed this way. Clear those vars before launching (see `drive-probe` notes).
42
- - **Classic hooks run on plugin submits.** The project's `UserPromptSubmit` hook (turn-context) ran on the
43
- mod-submitted prompt, and the model saw its `CONTEXT_CONTEXT` line. Without TASK_2226's heartbeat gate, a peer
44
- message would be delivered twice, once by the mod's submit and once by the hook's pull on that same turn. The gate
45
- is required, not optional.
46
- 2. **A plugin's own `$.prompt.submit` did not go through that same plugin's `prompt.submit` hook.** The
47
- evidence has no second `prompt.submit` record after `submit.call`. The token in turn 2 came from turn 1's
48
- context, which is still in the history. Design consequence: the mod must put the peer message in the
49
- submitted `text` itself. It cannot rely on its own hook to attach it as context.
50
- 3. **The model sees the plugin's name as the origin** (`origin.kind = "plugin"`, `name`). This gives a
51
- built-in provenance label for the "peer message = DATA, not instruction" rule (TASK_2122).
52
- 4. **Claude Code already has native cross-session delivery.** `PromptOrigin` has the kinds `peer`
53
- ("Another Claude session's message") and `peer-send-message` ("Another session's SendMessage
54
- delivery"), and `PromptSubmitInput.turnId` documents "a queued delivery (a peer session's message)
55
- reaches the model inside a running turn". This is what the current wake helper rides on via
56
- SendMessage. A mod makes that helper unnecessary for *local* delivery.
57
- 5. **`claude -p` runs the mod** (`--plugin-dir`): hooks, timers and fetch all worked headless. This is useful
58
- for automated tests of the mod itself.
59
- 6. **Mods can fail to load, and the design fails safe (TASK_2231).** `claude plugin test` refused to run once
60
- ("rollout switch saved off by an earlier session"); a plain `claude -p` refreshed it. One of five e2e runs of
61
- `plugins/kenaz-peer` also had no mod activity (heartbeat `live:false`, nothing delivered), cause unexplained.
62
- Consequence: the heartbeat is the only liveness signal, so a mod that did not load sends none, and delivery stays on
63
- the helper/pull path. Never make a later step assume the mod loaded.
64
- 7. **Test launches must strip the `CLAUDE*` env** (`CLAUDECODE`, `CLAUDE_CODE_*`, `CLAUDE_PID`), otherwise the child
65
- runs as a child session with the mod silent. Use `node dev/spikes/mods/clean-claude.js <cwd> <claude args>`; the e2e
66
- driver `dev/spikes/mods/e2e-peer.js` does the same internally.
67
-
68
- ## Step 2: design for a `kenaz-peer` mod (proposal, not built)
69
-
70
- **Binding.** In `session.start`, the mod reads `$.session.id()` and `$.session.cwd()` and resolves its
71
- bound project the way the pull does today: `_session-pin.lookupSessionPin(cwd, session_id)`, exposed through a
72
- small backend route, falling back to cwd. The id is the harness's own value (verified above), so none of
73
- TASK_2218's target-selection guessing is needed: the session identifies itself.
74
-
75
- **Delivery loop.** Every N seconds (`$.clock.every`, e.g. 5 s):
76
- 1. `GET /api/peer/pending?projectPath=<bound>&peek=true`. This reads without acking (TASK_2217 contract).
77
- 2. If messages are waiting, call `$.prompt.submit({ text: <framed batch> })`. The engine holds the submit until the
78
- session is idle; a mid-turn delivery is queued, not interleaved.
79
- 3. When `submit` resolves (the prompt entered the session), ack the delivered ids.
80
- **Backend gap:** today the non-peek `GET /pending` is take-and-ack in one step. The mod needs an
81
- ack-by-id route, e.g. `POST /api/peer/ack {ids}`, so a crash between peek and submit cannot lose a message.
82
- This is the only backend change on the critical path.
83
-
84
- **Pull path.** The same mod's `prompt.submit` hook replaces the turn-context peer pull for user-typed prompts.
85
- It peeks, attaches the messages as `context` (verified), and acks them. This retires the per-install-layout
86
- `UserPromptSubmit` registration problem from the TASK_2218 review for peer messages.
87
-
88
- **Coexistence and retirement of `peer_wake.rs`.** The mod sends a heartbeat on its timer:
89
- `POST /api/peer/mod-heartbeat {session_id, project}`. `peer_wake::wake_session` skips projects with a
90
- live heartbeat (< 2 ticks old) and keeps today's helper as the fallback otherwise. Likewise, turn-context.js
91
- skips its peer pull when a heartbeat exists for its `session_id`. Once installs report the mod as
92
- present, delete the helper path. That removes the `.cmd` argv handling (TASK_2217), console windows,
93
- haiku-per-push cost, and permission-mode holds.
94
-
95
- **Distribution.** Ship the mod as a plugin inside kenaz-core and have the installer write
96
- `enabledPlugins` (user scope). On CLI < 2.1.287 the mod does not load, so no heartbeat is sent and the
97
- backend keeps using the helper plus the pull, with no behaviour change. The installer can log
98
- `claude --version` so the dashboard shows which path each machine uses.
99
-
100
- **Remote peers are unchanged.** The relay, `peer_poller` storing into the local inbox, and the send-side gates
101
- (`evaluate_send_gate`) stay as they are. The mod only replaces the last hop from the local inbox into a live session.
102
-
103
- ## Step 3: moving the whole hook chain into mods
104
-
105
- Mods can hook every settings-hook event as `classic.<Event>` (for example `classic.PreToolUse`). They
106
- return the same fields, such as `additionalContext` and `block` (types: `ClassicResultFields`), so the
107
- shape of each hook ports 1:1. But mods run with no Node runtime. turn-context, memory-guard,
108
- pulse-before-*, task-bridge and the handoff hooks are Node scripts that use `require`, the filesystem and
109
- local modules. Porting them means either a rewrite against `$.fs`/`$.http`, or `$.process.run(['node', script])`.
110
- The second option recreates today's hook with an extra hop.
111
-
112
- **Recommendation: no-go for now.** The install-layout problem is real, but it hurts only the peer pull,
113
- and Step 2 removes that dependency. Keep the other hooks in `.claude/settings.json`. Revisit hook by hook
114
- only when one becomes cheap to express against `$.*`, for example the SessionStart HTTP ping, which is
115
- already a single fetch.
116
-
117
- ## Go / no-go
118
-
119
- **GO for Step 2** (peer delivery mod), in phases:
120
- 1. Backend: `POST /api/peer/ack {ids}` plus `POST /api/peer/mod-heartbeat`, and make `peer_wake` and turn-context
121
- skip their peer work for heartbeat-live sessions.
122
- 2. Mod: `kenaz-peer` in kenaz-core (peek -> submit -> ack loop, pull via the `prompt.submit` context hook),
123
- with `claude plugin test` coverage.
124
- 3. Installer: write `enabledPlugins`; report the CLI version.
125
- 4. Confirm in a real terminal (caveat 1), run a two-machine Ashfall test, then delete the helper path.
126
-
127
- Fallback for CLI < 2.1.287: today's path, chosen automatically by the heartbeat being absent.
128
-
129
- **NO-GO for Step 3** (whole-chain migration), for the reasons above.
130
-
131
- ## TASK_2241 - the LLM push helper is unsafe for framing integrity
132
-
133
- Observed live on 0.2.259: the `claude -p` helper delivered a paraphrase of a bridge reply WITHOUT the `[Peer message ...]` header and fence; the verifier rejected it only after `SendMessage` had already delivered it. Framing is what keeps peer text as data, and an LLM in the path cannot guarantee it. Mitigations in the helper path (bridge stand-down to a live core mod, a one-line "delivered unverified" notice on the rolled-back redelivery, sha256 audit of expected vs delivered text) reduce but do not remove the risk. Only the mod path (deterministic exact framed text, engine-stamped origin, no LLM) closes it, which raises the priority of the TASK_2234 mod rollout.
@@ -1,143 +0,0 @@
1
- # Per-project peer addressing (TASK_2237)
2
-
3
- Status: option B implemented behind wire compatibility; awaiting user review of the open questions at the end.
4
-
5
- ## 1. Problem
6
-
7
- Peer messages are addressed to a **machine** (`node_name`), not to a project folder. Two project folders on one
8
- machine that belong to the same Yggdrasil room cannot be told apart, and only one of them receives. Field case
9
- (node gamem-DESKTOP-1TR25AE, thread 0b849325): `C:\project\Ashfall` (ART) and `C:\project\Ashfall_code` (CODE)
10
- share room `github.com/xyz9516/Ashfall` and one `node_name`. Art questions were injected into the CODE session
11
- and arrived twice (turn-context pull plus UDS helper push). This is a plausible contributor to field report
12
- TASK_2206 (one-way messages).
13
-
14
- ## 2. Current model (before this task), with evidence
15
-
16
- | Fact | Evidence |
17
- |---|---|
18
- | `node_name` is one per machine by design (global git user.name, then os user, then hostname) | `mcp_tools/pool.rs:311-326` (TASK_2124 comment) |
19
- | Send writes `to_node = <machine name>`, `project = <room>`; payload is only `kind/body/refs/reply_to` | `mcp_tools/peer.rs` `send_with_cfg` |
20
- | Poll runs once per room: roots resolving to the same `(http_base, project_key)` are deduped, the first root polls and stores into **its** inbox only | `peer_poller.rs` `poll_all_rooms` (`seen_rooms` HashSet) |
21
- | Poll query is `task_events?to_node=<node>&project=<room>&include_acked=0` | `peer_poller.rs` `poll_with_cfg_bounded` |
22
- | Relay matches `to_node` exactly and scopes by team and project | `yggdrasil-relay/src/routes/task_events.rs:236` |
23
- | Ack is per event and removes it for every poller of that `to_node` (`WHERE ... AND to_node = ?4`) | `task_events.rs:294-298` |
24
- | Relay validates `to_node` against the `nodes` table (team-scoped) on create | `task_events.rs:110-114` |
25
- | Relay stores `payload` verbatim as `payload_json` and returns it unchanged; only a size cap applies | `task_events.rs:85-90, 100` |
26
- | Bridge roots (TASK_2157) only let a session at the CORE root drain bridge inboxes; they do not split one room between two ordinary projects | `routes/peer.rs` `select_bridge_roots` |
27
-
28
- Consequences: (1) a message to the machine reaches only the first-listed root; (2) a send from local project A to
29
- local project B has `from_node == to_node` and lands in the first root (possibly A itself); (3) a reply cannot
30
- choose A or B; (4) the second root's `peer_poll_state` is never advanced, so any attempt to poll it too would
31
- contend for acks with the first poll.
32
-
33
- Reproduction is in tests (no live registry or relay touched): see section 7.
34
-
35
- ## 3. Options for identity
36
-
37
- ### Option A: `node@project-instance` as the relay-level node id
38
- `to_node` becomes e.g. `gamem-DESKTOP@a1b2c3d4e5f6`; each root registers its own presence row and polls its own
39
- `to_node`.
40
- - Wire: old nodes only know machine names. A message to `machine@proj` is rejected by the relay (`to_node` must
41
- exist in `nodes`), so old senders cannot reach a new node unless the machine row is kept as well.
42
- - Relay: presence/nodes table grows one row per root (the node list UI, `kenaz_pool_nodes`, claim ownership
43
- `created_by = node_name` all assume one row per machine); `to_node` matching works unchanged but every
44
- consumer of node names (pool claims, TASK_2139 stale-identity drain, mute/block lists) changes meaning.
45
- - Ack: becomes per instance, which fixes the shared-ack problem for free.
46
- - Pin/mod: the session pin picks an instance by construction.
47
- - Cost: relay deploy plus a new node-identity concept across pool, presence, UI. Highest blast radius.
48
-
49
- ### Option B: machine node plus a project sub-address in the event payload (recommended)
50
- `to_node` stays the machine name. The payload carries `from_project` (instance id), `from_project_label`
51
- (folder name, display only) and optional `to_project`. Routing is client-side.
52
- - Wire: additive JSON fields inside `payload`. Old nodes ignore them (verified: they only read `kind`, `body`,
53
- `refs`). The relay stores payload verbatim (section 2), so **no relay change**.
54
- - Relay: none. `to_node` matching, `nodes` rows, size cap, TTL and ack semantics are untouched. Ack stays
55
- per event per machine, which is fine because ONE poll per room per machine remains the only poller.
56
- - Pin/mod: the receiving Ansuz sees `from node@label (project <id>)` in the framed header and replies with
57
- `kenaz_peer_send toProject=<id>`; the sender needs no registry lookup. The session pin / kenaz-peer mod keep
58
- working per root because each root has its own inbox, so a pull at root X only sees rows delivered to X.
59
- Bridge roots (TASK_2157) are just another local root in the room and are routed like any other.
60
- - Weakness: addressing is advisory, not enforced by the relay (a sender can omit or forge `to_project`);
61
- acceptable because peers are team-claimed and all content is already framed as untrusted.
62
-
63
- ### Option C: a separate relay route / per-instance mailbox
64
- Rejected: new relay surface for no benefit over B at current scale.
65
-
66
- | | A: node@instance | B: payload sub-address |
67
- |---|---|---|
68
- | Old node can send to a new node | only if the machine row is kept | yes, unchanged |
69
- | New node can send to an old node | needs the old machine name | yes, fields ignored |
70
- | Relay change | yes (presence, pool, UI semantics) | none |
71
- | Ack isolation per project | yes | no (not needed, one poll per room) |
72
- | Rollback | hard (rows, ids) | trivial (stop reading fields) |
73
-
74
- ## 4. Instance id
75
-
76
- Folder names are not safe: `Ashfall` vs `Ashfall_code` differ by a suffix and the same name can repeat on other
77
- machines. The id is the **first 12 hex chars of sha256 over the normalized absolute root path** (forward
78
- slashes, no trailing slash, lower-cased on Windows). Properties:
79
- - Same function on send and receive (`mcp_tools/peer.rs::project_instance_id`), derived from the root the
80
- existing `resolve_peer_project_root` already agrees on; no new stored state, nothing to migrate.
81
- - Full local paths never go on the wire; the folder name travels only as `from_project_label` for display.
82
- - Not portable across machines by design: it identifies a local root, and the remote peer only echoes it back.
83
- - Weakness: moving or renaming a folder changes the id. In-flight replies then name an unknown id and fall back
84
- to "all roots" (below), so nothing is lost. A `project.yaml` uuid would survive moves; see open questions.
85
-
86
- ## 5. Behaviour (implemented)
87
-
88
- Send (`send_with_cfg_addressed`, MCP `kenaz_peer_send`):
89
- - payload adds `from_project`, `from_project_label`, and `to_project` (null unless `toProject` is given).
90
- - `toProject` is validated against the peer-id charset; `to_node` is still the machine name.
91
-
92
- Receive (`peer_poller.rs`, `route_roots`):
93
- - Still ONE GET and one ack per event per room; all local roots of the room are collected in `poll_all_rooms`.
94
- - `to_project` matches a local root's id: delivered only to that root.
95
- - `to_project` absent (legacy sender, first contact): delivered to **every** local root in the room, one inbox
96
- row each (same relay id, separate sqlite files, so no PK clash). A single-root machine behaves exactly as before.
97
- - `to_project` present but unknown: delivered to all roots and logged at info.
98
- - Mute/block is evaluated per destination root. If an inbox cannot be opened the event is not acked, so it is
99
- retried next tick (INSERT OR IGNORE dedups the inboxes that succeeded).
100
- - The sender's own outbound row (`direction='out'`, id `out:...`) is never inbound; a same-machine A to B message
101
- returns from the relay on the normal poll and lands in B only.
102
- - Inbox schema gains nullable `from_project`, `to_project`, `from_project_label` (idempotent ALTER migration).
103
- The pending API adds `from_project` and `from_project_label`; the framed header becomes
104
- `from <node>@<label> (project <id>)` when the sender is a new node, otherwise unchanged.
105
- - Wake/push (peer_wake, codex_wake) now batches per destination root, so each project is woken with its own messages.
106
-
107
- Not addressed here: the double delivery in the field report (pull plus UDS push) is a separate TASK_2223 path;
108
- delivering the same message to two roots does not change its per-inbox claim/ack logic.
109
-
110
- ## 6. Migration and interop
111
-
112
- | Sender | Receiver | Result |
113
- |---|---|---|
114
- | old | old | unchanged |
115
- | old | new | no `to_project`: delivered to all local roots of the room (previously: first root only) |
116
- | new | old | extra fields ignored; old node behaves as today |
117
- | new | new | addressed delivery; unaddressed first contact reaches all roots |
118
-
119
- No flag day: rollout is per node, in any order. The only behaviour change for an old sender is that a new
120
- multi-root machine now shows its messages in every root of the room instead of one, which is the safer failure
121
- (duplicate visibility rather than silent misrouting). Rollback = deploy the old build; rows with the new nullable
122
- columns are ignored by it.
123
-
124
- ## 7. Tests (peer_poller.rs `e2e_stub_relay`, filter `task_2237`)
125
-
126
- - `task_2237_addressed_message_lands_only_in_the_matching_root` (ART/CODE-style fixture, one GET per room)
127
- - `task_2237_local_a_to_b_lands_in_b_only_with_sender_project` (outbound row not re-stored; sender shown)
128
- - `task_2237_unaddressed_and_unknown_to_project_reach_all_roots` (legacy event without sub-address; no redelivery)
129
- - `task_2237_project_instance_id_is_stable_across_path_variants`
130
-
131
- The pre-fix characterization of the defect (second root empty, `from_node == to_node`) was converted into these
132
- assertions once the fix landed.
133
-
134
- ## 8. Open questions for the user
135
-
136
- 1. Instance id stability: is path-hash acceptable (breaks on folder move), or should a uuid in
137
- `.kenaz/project.yaml` be minted and used instead (survives moves, needs a one-time write per project)?
138
- 2. Unaddressed messages now fan out to every root in the room. Prefer that, or fan out only to roots with an
139
- active session, or keep a per-room "default root" setting?
140
- 3. Broadcast (`to='*'`) is per machine row today; should it ever fan out to specific projects? (Left unchanged.)
141
- 4. Do we want the relay to eventually validate `to_project` (Option A style) once most nodes are upgraded, or
142
- keep addressing advisory?
143
- 5. Same-machine delivery uses a relay round trip (needs network). Acceptable, or add a local short-circuit?
@@ -1,256 +0,0 @@
1
- # Swarm-coordination protocols for Yggdrasil: evaluation (TASK_2228)
2
-
3
- Status: DESIGN ONLY, for user review. No protocol or production code is changed by this document.
4
- Date: 2026-10-03. Baseline: main at fb7867827 (TASK_2227 merged).
5
-
6
- Question asked: should Yggdrasil peer collaboration borrow from slime mould, bees and ants?
7
-
8
- Short answer: the one mechanism that paid off is the lease-style claim (a), and it paid off only after
9
- being tuned to human absence rather than to biology. For (b)-(f) I found no field report or peer log
10
- showing the failure each would prevent, and at 2-5 nodes most of them lose the property that makes them
11
- work in nature. One cheap, flag-only slice is recommended at the end to collect the missing evidence.
12
-
13
- ## 0. Ground rules used in this document
14
-
15
- - "Current behaviour" claims cite a file and line in the main repo, or a field report. Field reports
16
- are cards tagged `field-report` in `.kenaz/tasks/cancel/` (TASK_2205, 2206, 2207, 2208, 2212, 2132).
17
- Those cards are duplicate re-cards from a self-heal at 2026-10-02T16:18Z, but each carries the
18
- original report text (report id, received_at, app_version), which is what is cited here.
19
- - The local peer log is not usable as evidence: `.kenaz/peer/inbox.sqlite` in the KenazAI repo has 0
20
- rows in `peer_messages`. The Ashfall traffic lives on other machines. Where a mechanism has no
21
- incident, this document says so rather than inventing one.
22
- - Scale: Kenaz runs 2-5 nodes plus humans. Honeybee swarm decisions average over hundreds of scouts;
23
- Temnothorax quorum over tens of ants; Physarum prunes a mesh of thousands of tube segments with
24
- random exploration; the response-threshold model (Bonabeau 1998) is a statement about the
25
- distribution of thresholds across a population. None of these statistical properties exist with
26
- 3 nodes. Local rules transfer; averaging and random exploration do not.
27
- - Principle carried from (a), supplied by the user's rejection of auto-release: biology's automatic
28
- decay must be tuned to how long a member may legitimately be absent, and where a wrong automatic
29
- action costs duplicated human work, prefer "flag, then explicit action with an event recorded" over
30
- automatic action.
31
-
32
- Sources: Seeley et al. 2012, Science 335:108 (stop signals); Bonabeau et al. 1998, Bull Math Biol
33
- (response thresholds); Grueter et al. 2012, PLoS ONE, PMC3440389 (crowding negative feedback); Tero
34
- et al. 2010, Science (Physarum network design).
35
-
36
- ## Summary table
37
-
38
- | | Mechanism | Evidence of a real failure | Cost | Pays off at 2-5 nodes | Verdict |
39
- |---|---|---|---|---|---|
40
- | a | Decaying claims / leases | Yes: offline owner holds a card (design reason for TASK_2227); human-absence cost drove the redesign | Done | Yes, as flag + explicit takeover | SHIPPED (reference) |
41
- | b | Response-threshold claiming | None found | Medium | No (needs a population of thresholds); a read-time age flag is cheap | DEFER |
42
- | c | Crowding / load signal | Partial: invisibility of claim progress (TASK_2207), since fixed; no overload incident | Low for a read-only flag | Marginal; humans already see load | DEFER (flag only, if ever) |
43
- | d | Stop signals / cross-inhibition | None found for approach conflicts; file conflicts already gated | Medium-high | Automatic inhibition is harmful at N=2 | NO-GO automatic; DEFER advisory |
44
- | e | Quorum for shared-outcome decisions | None found; no such decision path exists in code | High | No: N=2 quorum is unanimity or nothing | NO-GO |
45
- | f | Physarum-style reinforced routing | None found; observed routing failures are identity bugs | Medium | No: sender already knows whom to ask | NO-GO |
46
-
47
- ## (a) Decaying claims / leases (reference, shipped as TASK_2227)
48
-
49
- Card text asked for automatic expiry of claims. What shipped is different and is the right shape:
50
-
51
- - A claim is stale when its owner has not heartbeated (`nodes.updated_at`) for 4 hours, or, if the
52
- owner never registered, when `claimed_at` is 4 hours old (`yggdrasil-relay/src/routes/tasks.rs:838-841`,
53
- `claim_staleness` at 846-860). Staleness is computed at read time and nothing is released
54
- automatically (comment at 840).
55
- - Another node may take a stale claim only by explicitly claiming it. `claim_task` first tries the
56
- atomic unclaimed update (922-930), refuses an owner re-claiming itself (944-946) and a non-stale
57
- claim (949-951), re-checks `claimed_by` in the UPDATE so a concurrent change is not clobbered
58
- (953-961), and writes a `reason=takeover` event with `previous_owner` and `stale_since` (965-972).
59
- - `unclaim_task` returns a card to the pool and records `reason=unclaim` (978-1001).
60
- - The client side, `tool_pool_claim`, keeps the relay row after the local write so the publisher keeps
61
- seeing the card (`dashboard/src-tauri/src/infrastructure/http_server/routes/mcp_tools/pool.rs:747-750`).
62
- That closes the visibility gap reported in TASK_2207 (publisher could no longer see a card after the
63
- other lane claimed it).
64
-
65
- Why the biology had to be changed: an ant pheromone trail evaporates in minutes and the colony loses
66
- nothing when a trail dies, because workers are interchangeable and cheap. A Kenaz claim is a human's
67
- or an agent's hours of context. An offline Dashboard (laptop closed overnight) is not abandoned work,
68
- and an automatic release would hand the card to a second node that then duplicates the first node's
69
- unfinished work. So the decay constant is 4 h, not minutes, and the "evaporation" is only a flag.
70
-
71
- Lesson carried into (b)-(f): any proposed automatic action must state (1) the longest legitimate
72
- absence or silence, (2) the cost of a wrong automatic action, and (3) the flag-plus-explicit
73
- alternative. If (2) is duplicated human work, default to the flag.
74
-
75
- Verdict: SHIPPED. No further work here.
76
-
77
- ## (b) Response-threshold claiming (urgency rises with age, per-node thresholds by skill)
78
-
79
- Biology: each worker has a threshold for a task stimulus; stimulus grows while the task is
80
- unattended, and workers with lower thresholds respond first. Specialisation emerges from a
81
- distribution of thresholds across many workers (Bonabeau 1998).
82
-
83
- Current Kenaz behaviour:
84
- - Pool cards are listed in static order: `ORDER BY priority, created_at`
85
- (`yggdrasil-relay/src/routes/tasks.rs:103`). Priority is a fixed string defaulting to "P2"
86
- (`tasks.rs:204`). Nothing grows with age.
87
- - Role is a display/filter field only, "independent of assigned_to" (`tasks.rs:154` and the `role`
88
- column in `yggdrasil-relay/src/routes/nodes.rs:38`). There is no per-node skill threshold.
89
- - Claiming is a manual act by an agent or human calling `kenaz_pool_claim` (`pool.rs:631`), with an
90
- atomic first-wins relay update (`tasks.rs:922-930`).
91
- - Dependency gating already hides cards whose dependencies are unmet (`tasks.rs:80-87`).
92
-
93
- Failure it would prevent: a card sitting unclaimed because nobody prefers it. Evidence: none found.
94
- TASK_2207 reports the opposite problem (claimed cards invisible to the publisher), and TASK_2132 is a
95
- room-key activation bug, not a starvation case. I did not find a report of an unclaimed card
96
- languishing.
97
-
98
- Why it transfers poorly: a threshold distribution needs a population; with 3 nodes plus a human who
99
- reads the list, "node X has a lower threshold for UI cards" is a hand-written preference, i.e. the
100
- existing `role` field. Automatic escalation would only re-sort a list a human reads anyway.
101
-
102
- Cost: Low for a read-time `age_secs` annotation plus an "unclaimed for > N h" flag (same pattern as
103
- `annotate_claim_state`, `tasks.rs:863-874`). Medium for per-node thresholds (schema + config + UX).
104
-
105
- Verdict: DEFER. If evidence appears, the only form worth building is the read-time age flag, not
106
- automatic urgency escalation and not automatic assignment.
107
-
108
- ## (c) Crowding negative feedback (a busy node signals load)
109
-
110
- Biology: Grueter et al. describe foragers reducing recruitment when a food source is crowded; the
111
- negative signal is local and cheap.
112
-
113
- Current Kenaz behaviour:
114
- - Load-like data already exists in presence: each node row carries `current_task`, `touching_files`,
115
- `uncommitted`, `work_summary`, `planned_tasks`, `is_online` (`yggdrasil-relay/src/routes/nodes.rs:37-38`,
116
- upsert at 103-126). `kenaz_pool_nodes` exposes it (`pool.rs:916`).
117
- - Negative feedback on message volume already exists: the TASK_2161 adaptive loop guard, 30 sends per
118
- thread per hour and a ping-pong cooldown, is in `evaluate_send_gate`
119
- (`dashboard/src-tauri/src/infrastructure/http_server/routes/mcp_tools/peer.rs:457-502`), called at
120
- 1098-1134, plus a per-minute rate limit at 1067-1081.
121
- - A send to an offline or stale target is still delivered but warned (`peer.rs:1179-1186`), and a
122
- target that is not in the room is refused with the live node list (1181).
123
-
124
- Evidence of failure: the relevant incidents are about the guard being wrong, not about missing load
125
- signals. The earlier human-in-the-loop guard refused sends after the user had typed a new prompt
126
- (TASK_2208, app 0.2.251, 2026-09-29; TASK_2212, app 0.2.254, 2026-10-02): "the very next
127
- kenaz_peer_send on the same thread was refused with the identical loop-guard error", blocking
128
- completion notices. TASK_2161 replaced that design (`peer.rs:1083-1086`). I have no field data yet on
129
- the new guard, so I cannot say whether its constants (30/h, ping-pong) are right. The lesson for any
130
- new negative-feedback rule: it must be tied to a signal that actually resets, and a false refusal
131
- costs more than a missed throttle at this scale.
132
- - TASK_2207 (app 0.2.252): a publisher could not see a claimed card's progress. Resolved in direction
133
- by `pool.rs:747-750`; the remaining ask there (status moving to in_progress/done with commit hashes
134
- on the relay row) is a visibility feature, not a crowding signal.
135
-
136
- Why it transfers poorly: at 2-5 nodes, "node B is busy" is already in presence data and in the human's
137
- head. A numeric load score with thresholds that suppresses sends or claims would be an automatic action
138
- whose wrong case (a node refused work because a stale `planned_tasks` says busy) is blocked human work.
139
-
140
- Cost: Low for a read-only `busy` flag in `kenaz_pool_nodes`; the data is already there.
141
-
142
- Verdict: DEFER. Do not gate sends or claims on load. If done, flag only.
143
-
144
- ## (d) Bee stop signals (cross-inhibition when two nodes start conflicting approaches)
145
-
146
- Biology: scouts for site A headbutt scouts for site B, cutting their dance duration; this breaks
147
- deadlock between equal-quality sites and prevents a split decision, where the swarm divides between
148
- two sites (Seeley 2012). Tuned wrongly, inhibition fails either way: too much and the swarm stalls
149
- (deadlock), too little and it fragments (split decision).
150
-
151
- Current Kenaz behaviour:
152
- - File-level conflict is already a pre-dispatch gate. `remote-conflict.js` compares a candidate card's
153
- `scope_paths` with other nodes' claimed tasks and with their live `touching_files`
154
- (`.formation/tools/remote-conflict.js:3-4`, `hasRemoteConflict` 44-64, `hasRemoteFileConflict` 72-87),
155
- with a 10 s cache (line 14), and `dispatch.js:1062-1066` consults both before dispatching. That is
156
- already a stop signal, on the dimension where Kenaz can detect conflict mechanically. It skips a
157
- card (it does not abort running work).
158
- - Approach-level conflict (two nodes solving the same problem differently without overlapping
159
- `scope_paths`, or before either has touched a file) has no detection. Peer messages are free text
160
- with kinds `question|answer|notice|request` (`peer.rs:59`); nothing relates them to cards.
161
-
162
- Evidence of failure: none found. No field report describes two nodes starting conflicting approaches.
163
- The only two-lane traffic on file (Ashfall, TASK_2206/2207) shows dependency sequencing needs
164
- (TASK_470 before BA's edit; TASK_492 before TASK_500), which the dependency gate in `tasks.rs:80-87`
165
- and the "claimed card stays visible" change address.
166
-
167
- Why automatic inhibition is harmful here: with N=2, mutual cross-inhibition becomes deadlock: A
168
- tells B to stop and B tells A to stop, and both stall, or a tie-break rule is needed, which
169
- is just "lower node name wins" and arbitrary. The cost of a wrong stop is a node idling or discarding
170
- work while a human is away, which is the (a) lesson.
171
-
172
- Cost: Medium for an advisory (compare scope/touching overlap at claim time and report it), high for
173
- anything that stops running work.
174
-
175
- Verdict: NO-GO for automatic inhibition. DEFER an advisory; it is the basis of the recommended slice
176
- because it also yields the evidence that this section lacks.
177
-
178
- ## (e) Quorum before committing shared-outcome decisions
179
-
180
- Biology: Temnothorax ants and honeybees commit only after enough scouts are at the candidate site;
181
- this converts noisy individual votes into a reliable group choice.
182
-
183
- Current Kenaz behaviour:
184
- - I found no code path in the relay or peer tools that makes a shared-outcome decision across nodes.
185
- Peer messages are advisory text (`peer.rs:59`, framed at 281-299 as untrusted peer content). Pool
186
- claim is first-wins atomic, a single-writer decision (`tasks.rs:922-930`). Merging to main is a git
187
- operation by a human or agent, outside the relay.
188
- - The decisions that matter (what lands on main, whether an approach is accepted) are made by the
189
- human owners, who are the real quorum.
190
-
191
- Evidence of failure: none found. No report shows a shared decision committed by one node that others
192
- objected to.
193
-
194
- Why it does not transfer: quorum exists to average out unreliable individuals. With 2 nodes a
195
- quorum threshold is 1 (no protection) or 2 (any offline node blocks everything, the (a) failure again).
196
- With 3 nodes, 2-of-3 requires a third machine online, and the cost of waiting for it is human time.
197
- Humans already provide the check at the points where it matters.
198
-
199
- Cost: High (new message kind, vote storage, timeout policy, offline handling).
200
-
201
- Verdict: NO-GO. Revisit only if a concrete shared-outcome decision type is identified and its
202
- absence causes a logged incident.
203
-
204
- ## (f) Physarum-style reinforced routing (send questions to peers whose answers proved useful)
205
-
206
- Biology: tubes carrying more flow thicken, others shrink; the network converges on efficient paths
207
- through many cycles of flow and random exploration (Tero 2010).
208
-
209
- Current Kenaz behaviour:
210
- - Routing is explicit by name: `to` is a node name or `*` for broadcast to every other registered
211
- node, offline included (`peer.rs:1005-1012`, `1158-1172`). A non-room target is refused with the
212
- node list (`1179-1181`); a stale one is warned (`1182-1184`).
213
- - Local rows record kind, thread and direction (`peer.rs:633` schema, `751` thread query), so answer
214
- rate and latency per node could be computed, but nothing does.
215
- - Identity, not choice, is where routing has actually failed. TASK_2205 (app 0.2.249): a reply to the
216
- sender's `from_node` "BA" failed with relay 403 because the routable name was "dashboard-node".
217
- TASK_2206 (app 0.2.251): replies "never arrive" after a node rename without a Dashboard restart; the
218
- lane "had to relay its answer through the human by copy-paste". Both are name-resolution defects
219
- addressed by TASK_2139 (target check and stale-target warning at `peer.rs:1174-1189`, 403 fallback
220
- at 1206-1210), not routing-quality problems.
221
-
222
- Evidence of failure that reinforcement would fix: none. A learned weight cannot repair a name that
223
- does not resolve.
224
-
225
- Why it does not transfer: the Physarum result needs many flow events and random exploration to
226
- estimate usefulness. A room with 2-5 nodes has a handful of threads; the sender knows whom to ask,
227
- and the model has no data to learn from. Exploration (asking the wrong peer on purpose) costs a human
228
- a confusing message.
229
-
230
- Cost: Medium (per-node usefulness score, decay, UI), for a decision that is currently a human choice
231
- among at most four options.
232
-
233
- Verdict: NO-GO.
234
-
235
- ## Recommended single next slice
236
-
237
- Title: Claim-time overlap advisory with recorded event (flag only, relay + `kenaz_pool_claim` response).
238
-
239
- What: when a node claims a pool card, the relay compares the card's `scope_paths` with the
240
- `touching_files` and active-claim `scope_paths` of other nodes (reusing the matching rule in
241
- `remote-conflict.js:44-87`, ported to the relay or exposed via an existing endpoint), and returns an
242
- `overlap_advisory` list in the claim response without refusing the claim. It writes a
243
- `reason=overlap_advisory` event into `task_state_events` with the other node and file, the same way
244
- `reason=takeover` is recorded at `tasks.rs:965-972`. The claimer or human decides what to do.
245
-
246
- Why this one: it is the only mechanism with an existing data source, an existing mechanical rule and a
247
- flag-only shape that cannot cause duplicated human work. It adds no automatic action. It also produces
248
- the evidence (how often overlap actually occurs, at claim time) that (b), (c) and (d) currently lack,
249
- so a later decision can be made on logs rather than on biology.
250
-
251
- Size: normal card, about 2 files plus tests: relay `tasks.rs` (advisory + event + tests against an
252
- in-memory DB like the TASK_2227 tests) and `pool.rs` (pass the advisory through the claim result).
253
- It does not change the peer wire protocol. It still touches shared relay behaviour, so it needs the
254
- user's go-ahead after this document.
255
-
256
- Not recommended now: any of (b), (e), (f); automatic inhibition from (d); load-gated sends from (c).