create-egregore 0.21.6 → 0.22.0

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 (719) hide show
  1. package/assets/egregore-launcher.js +58 -6
  2. package/assets/egregore-launcher.sh +15 -2
  3. package/lib/claude-runtime.js +2 -0
  4. package/lib/codex-runtime.js +2 -0
  5. package/lib/setup.js +20 -3
  6. package/package.json +2 -2
  7. package/runtime/claude/.claude/context/commit-format.md +7 -4
  8. package/runtime/claude/.claude/context/handoff-claiming.md +32 -0
  9. package/runtime/claude/.claude/context/notification-consent.md +12 -9
  10. package/runtime/claude/.claude/hooks/boundary-check.sh +14 -331
  11. package/runtime/claude/.claude/hooks/memory-read-guard.sh +9 -1
  12. package/runtime/claude/.claude/rules/voice-bedrock.md +6 -2
  13. package/runtime/claude/.claude/settings.json +1 -1
  14. package/runtime/claude/.claude/skills/commit/SKILL.md +5 -3
  15. package/runtime/claude/.claude/skills/dark-mode/SKILL.md +48 -369
  16. package/runtime/claude/.claude/skills/records/SKILL.md +158 -0
  17. package/runtime/claude/.claude/skills/reflect/SKILL.md +50 -21
  18. package/runtime/claude/.claude/skills/review-pr/SKILL.md +4 -2
  19. package/runtime/claude/.claude/skills/save/SKILL.md +9 -3
  20. package/runtime/claude/.claude/skills/summon/SKILL.md +138 -207
  21. package/runtime/claude/.claude/skills/tui-design/SKILL.md +1 -1
  22. package/runtime/claude/.claude/skills/update/SKILL.md +1 -1
  23. package/runtime/claude/.claude/skills/view/SKILL.md +52 -16
  24. package/runtime/claude/.claude/skills/view/compose-scaffold.html +19 -13
  25. package/runtime/claude/CLAUDE.md +59 -95
  26. package/runtime/claude/bin/agent.sh +231 -7
  27. package/runtime/claude/bin/api-call.sh +44 -23
  28. package/runtime/claude/bin/artifact-register.sh +7 -1
  29. package/runtime/claude/bin/artifact-writeback.sh +1 -1
  30. package/runtime/claude/bin/artifacts.sh +66 -265
  31. package/runtime/claude/bin/attendant.sh +4 -1
  32. package/runtime/claude/bin/boundary-guard.cjs +1848 -0
  33. package/runtime/claude/bin/boundary-hook.sh +41 -0
  34. package/runtime/claude/bin/boundary.sh +15 -155
  35. package/runtime/claude/bin/capture-run.sh +32 -2
  36. package/runtime/claude/bin/codex-render-spec.mjs +24 -46
  37. package/runtime/claude/bin/codex-session-start.sh +19 -0
  38. package/runtime/claude/bin/codex-skill-render.mjs +18 -0
  39. package/runtime/claude/bin/config-get.sh +10 -1
  40. package/runtime/claude/bin/connect-refresh.sh +16 -0
  41. package/runtime/claude/bin/corpus_map.py +5 -0
  42. package/runtime/claude/bin/data/capabilities/claude.json +1480 -0
  43. package/runtime/claude/bin/genui.sh +19 -0
  44. package/runtime/claude/bin/graph-batch.sh +1 -1
  45. package/runtime/claude/bin/graph-op.sh +14 -0
  46. package/runtime/claude/bin/graph.sh +1 -1
  47. package/runtime/claude/bin/handoff-pr-backfill.sh +1 -1
  48. package/runtime/claude/bin/handoff-run.sh +11 -6
  49. package/runtime/claude/bin/ingest-item.sh +1 -1
  50. package/runtime/claude/bin/ingest-surface.html +22 -4
  51. package/runtime/claude/bin/issue.sh +1 -1
  52. package/runtime/claude/bin/knowledge.sh +1 -1
  53. package/runtime/claude/bin/lib/card-delivery.sh +329 -0
  54. package/runtime/claude/bin/lib/config.sh +148 -3
  55. package/runtime/claude/bin/lib/context.sh +38 -67
  56. package/runtime/claude/bin/lib/genui-entry.py +36 -0
  57. package/runtime/claude/bin/lib/git-message.sh +25 -6
  58. package/runtime/claude/bin/lib/git-sync.sh +12 -4
  59. package/runtime/claude/bin/lib/greeting.sh +255 -28
  60. package/runtime/claude/bin/lib/handoff_meta.py +294 -0
  61. package/runtime/claude/bin/lib/health-footer.sh +83 -2
  62. package/runtime/claude/bin/lib/identity.sh +31 -10
  63. package/runtime/claude/bin/lib/instance-registry.sh +71 -0
  64. package/runtime/claude/bin/lib/local_ci_receipt.py +249 -0
  65. package/runtime/claude/bin/lib/metrics.sh +121 -8
  66. package/runtime/claude/bin/lib/notices.sh +36 -0
  67. package/runtime/claude/bin/lib/record_outcomes.py +729 -0
  68. package/runtime/claude/bin/lib/reflexes.py +267 -0
  69. package/runtime/claude/bin/lib/retrieval_scorecard.py +624 -0
  70. package/runtime/claude/bin/lib/session-record-prompt.txt +18 -0
  71. package/runtime/claude/bin/lib/session_record.py +3747 -0
  72. package/runtime/claude/bin/lib/session_trail.py +1983 -0
  73. package/runtime/claude/bin/lib/settings-drift.sh +8 -5
  74. package/runtime/claude/bin/lib/startup-restart.sh +41 -0
  75. package/runtime/claude/bin/lib/worktree-links.sh +92 -0
  76. package/runtime/claude/bin/memory-push.sh +6 -0
  77. package/runtime/claude/bin/merge-gate.sh +498 -0
  78. package/runtime/claude/bin/notify.sh +5 -2
  79. package/runtime/claude/bin/page-access.sh +103 -0
  80. package/runtime/claude/bin/person.sh +13 -2
  81. package/runtime/claude/bin/pi-render-spec.mjs +0 -1
  82. package/runtime/claude/bin/pi-spirit-discovery.mjs +34 -0
  83. package/runtime/claude/bin/post-update.sh +181 -0
  84. package/runtime/claude/bin/prime-render-spec.mjs +0 -1
  85. package/runtime/claude/bin/publish-artifact.sh +89 -42
  86. package/runtime/claude/bin/qa-inventory.sh +2 -2
  87. package/runtime/claude/bin/quest.sh +1 -1
  88. package/runtime/claude/bin/records.sh +11 -0
  89. package/runtime/claude/bin/reflexes/05-vitals.sh +9 -0
  90. package/runtime/claude/bin/reflexes/10-open-items.sh +12 -0
  91. package/runtime/claude/bin/reflexes/15-retrieval.sh +8 -0
  92. package/runtime/claude/bin/reflexes/20-nightly.sh +100 -0
  93. package/runtime/claude/bin/reflexes/20-sandbox.sh +85 -0
  94. package/runtime/claude/bin/reflexes/30-cost.py +116 -0
  95. package/runtime/claude/bin/reflexes/40-shells.py +51 -0
  96. package/runtime/claude/bin/reflexes/README.md +61 -0
  97. package/runtime/claude/bin/reflexes.sh +7 -0
  98. package/runtime/claude/bin/runtime-identity.sh +140 -42
  99. package/runtime/claude/bin/screenshot.sh +77 -0
  100. package/runtime/claude/bin/scroll.sh +1 -1
  101. package/runtime/claude/bin/search.sh +31 -5
  102. package/runtime/claude/bin/session-autosave.sh +6 -3
  103. package/runtime/claude/bin/session-id.sh +147 -0
  104. package/runtime/claude/bin/session-log.sh +19 -0
  105. package/runtime/claude/bin/session-record.sh +26 -0
  106. package/runtime/claude/bin/session-start.sh +121 -151
  107. package/runtime/claude/bin/settings.sh +13 -8
  108. package/runtime/claude/bin/spirit-discovery-claude.sh +4 -0
  109. package/runtime/claude/bin/spirit-discovery-codex.sh +4 -0
  110. package/runtime/claude/bin/spirit-discovery-pi.sh +4 -0
  111. package/runtime/claude/bin/spirit-discovery-prime.sh +4 -0
  112. package/runtime/claude/bin/spirit-discovery.sh +4 -0
  113. package/runtime/claude/bin/startup-check.sh +1 -1
  114. package/runtime/claude/bin/telemetry.sh +11 -4
  115. package/runtime/claude/bin/test-baseline.sh +33 -5
  116. package/runtime/claude/bin/todo.sh +1 -1
  117. package/runtime/claude/bin/worktree-create.sh +15 -45
  118. package/runtime/claude/bin/worktree.sh +6 -0
  119. package/runtime/claude/docs/spirit-discovery.md +96 -0
  120. package/runtime/claude/egregore_runtime/__init__.py +18 -12
  121. package/runtime/claude/egregore_runtime/access.py +608 -0
  122. package/runtime/claude/egregore_runtime/access_cli.py +190 -0
  123. package/runtime/claude/egregore_runtime/adapters/invitation.py +5 -3
  124. package/runtime/claude/egregore_runtime/adapters/qmd.py +521 -47
  125. package/runtime/claude/egregore_runtime/admin_entry.py +56 -0
  126. package/runtime/claude/egregore_runtime/artifacts.py +222 -16
  127. package/runtime/claude/egregore_runtime/contracts.py +27 -0
  128. package/runtime/claude/egregore_runtime/eligibility.py +5 -12
  129. package/runtime/claude/egregore_runtime/episode_binding.py +16 -5
  130. package/runtime/claude/egregore_runtime/github_issues.py +2 -2
  131. package/runtime/claude/egregore_runtime/handoff_lookup.py +9 -20
  132. package/runtime/claude/egregore_runtime/harness_cli.py +674 -149
  133. package/runtime/claude/egregore_runtime/held.py +2436 -0
  134. package/runtime/claude/egregore_runtime/hosted_api.py +137 -0
  135. package/runtime/claude/egregore_runtime/identity.py +196 -65
  136. package/runtime/claude/egregore_runtime/identity_transfer.py +6 -2
  137. package/runtime/claude/egregore_runtime/ingest_cli.py +2 -2
  138. package/runtime/claude/egregore_runtime/ingest_index_cli.py +4 -16
  139. package/runtime/claude/egregore_runtime/installation.py +119 -0
  140. package/runtime/claude/egregore_runtime/investigation.py +64 -41
  141. package/runtime/claude/egregore_runtime/investigation_guidance.py +16 -11
  142. package/runtime/claude/egregore_runtime/issue_cli.py +51 -32
  143. package/runtime/claude/egregore_runtime/issue_reporting.py +4 -3
  144. package/runtime/claude/egregore_runtime/issue_triage_service.py +2 -2
  145. package/runtime/claude/egregore_runtime/issues.py +12 -6
  146. package/runtime/claude/egregore_runtime/knowledge.py +331 -5
  147. package/runtime/claude/egregore_runtime/knowledge_cli.py +57 -17
  148. package/runtime/claude/egregore_runtime/lifecycle.py +88 -22
  149. package/runtime/claude/egregore_runtime/lifecycle_cli.py +21 -13
  150. package/runtime/claude/egregore_runtime/line_ids.py +10 -0
  151. package/runtime/claude/egregore_runtime/memory_push.py +349 -0
  152. package/runtime/claude/egregore_runtime/observe.py +64 -25
  153. package/runtime/claude/egregore_runtime/observers.py +19 -0
  154. package/runtime/claude/egregore_runtime/optional_modules.py +13 -0
  155. package/runtime/claude/egregore_runtime/outputs_cli.py +321 -0
  156. package/runtime/claude/egregore_runtime/policy.py +651 -24
  157. package/runtime/claude/egregore_runtime/private_result.py +2 -1
  158. package/runtime/claude/egregore_runtime/projection.py +946 -0
  159. package/runtime/claude/egregore_runtime/quest_cli.py +20 -23
  160. package/runtime/claude/egregore_runtime/question_cli.py +15 -11
  161. package/runtime/claude/egregore_runtime/questions.py +10 -10
  162. package/runtime/claude/egregore_runtime/quests.py +10 -10
  163. package/runtime/claude/egregore_runtime/record_publish.py +548 -0
  164. package/runtime/claude/egregore_runtime/record_subject.py +564 -0
  165. package/runtime/claude/egregore_runtime/research_ingest.py +2 -4
  166. package/runtime/claude/egregore_runtime/runtime.py +169 -60
  167. package/runtime/claude/egregore_runtime/sandbox.py +194 -0
  168. package/runtime/claude/egregore_runtime/scroll_cli.py +22 -32
  169. package/runtime/claude/egregore_runtime/scrolls.py +23 -15
  170. package/runtime/claude/egregore_runtime/shadow.py +262 -0
  171. package/runtime/claude/egregore_runtime/spirit_discovery.py +487 -0
  172. package/runtime/claude/egregore_runtime/spirit_discovery_cli.py +25 -0
  173. package/runtime/claude/egregore_runtime/spirit_discovery_transport.py +18 -0
  174. package/runtime/claude/egregore_runtime/status.py +101 -44
  175. package/runtime/claude/egregore_runtime/status_cli.py +13 -5
  176. package/runtime/claude/egregore_runtime/sync.py +39 -21
  177. package/runtime/claude/egregore_runtime/taste.py +934 -0
  178. package/runtime/claude/egregore_runtime/taste_cli.py +242 -0
  179. package/runtime/claude/egregore_runtime/taste_rules.py +91 -0
  180. package/runtime/claude/egregore_runtime/telemetry.py +26 -3
  181. package/runtime/claude/egregore_runtime/todo_cli.py +15 -12
  182. package/runtime/claude/egregore_runtime/todos.py +3 -2
  183. package/runtime/claude/egregore_runtime/upgrade.py +85 -58
  184. package/runtime/claude/egregore_runtime/writeback.py +330 -24
  185. package/runtime/claude/manifest.json +65 -5
  186. package/runtime/codex/.claude/context/handoff-claiming.md +32 -0
  187. package/runtime/codex/.claude/context/notification-consent.md +12 -9
  188. package/runtime/codex/.claude/skills/view/SKILL.md +438 -0
  189. package/runtime/codex/.codex/hooks.json +11 -0
  190. package/runtime/codex/.codex/skills/dark-mode/SKILL.md +1 -1
  191. package/runtime/codex/.codex/skills/records/SKILL.md +29 -0
  192. package/runtime/codex/.codex/skills/summon/SKILL.md +1 -1
  193. package/runtime/codex/.codex/skills/view/assets/compose-scaffold.html +19 -13
  194. package/runtime/codex/.codex/spec-manifest.json +13 -19
  195. package/runtime/codex/AGENTS.md +54 -105
  196. package/runtime/codex/bin/agent.sh +231 -7
  197. package/runtime/codex/bin/api-call.sh +44 -23
  198. package/runtime/codex/bin/artifact-register.sh +7 -1
  199. package/runtime/codex/bin/artifact-writeback.sh +1 -1
  200. package/runtime/codex/bin/artifacts.sh +66 -265
  201. package/runtime/codex/bin/attendant.sh +4 -1
  202. package/runtime/codex/bin/boundary-guard.cjs +1848 -0
  203. package/runtime/codex/bin/boundary-hook.sh +41 -0
  204. package/runtime/codex/bin/capture-run.sh +32 -2
  205. package/runtime/codex/bin/codex-render-spec.mjs +24 -46
  206. package/runtime/codex/bin/codex-session-start.sh +19 -0
  207. package/runtime/codex/bin/codex-skill-render.mjs +18 -0
  208. package/runtime/codex/bin/config-get.sh +10 -1
  209. package/runtime/codex/bin/connect-refresh.sh +16 -0
  210. package/runtime/codex/bin/corpus_map.py +5 -0
  211. package/runtime/codex/bin/data/capabilities/codex.json +1458 -0
  212. package/runtime/codex/bin/genui.sh +19 -0
  213. package/runtime/codex/bin/graph-batch.sh +1 -1
  214. package/runtime/codex/bin/graph-op.sh +14 -0
  215. package/runtime/codex/bin/graph.sh +1 -1
  216. package/runtime/codex/bin/handoff-pr-backfill.sh +1 -1
  217. package/runtime/codex/bin/handoff-run.sh +11 -6
  218. package/runtime/codex/bin/ingest-item.sh +1 -1
  219. package/runtime/codex/bin/ingest-surface.html +22 -4
  220. package/runtime/codex/bin/issue.sh +1 -1
  221. package/runtime/codex/bin/knowledge.sh +1 -1
  222. package/runtime/codex/bin/lib/card-delivery.sh +329 -0
  223. package/runtime/codex/bin/lib/config.sh +148 -3
  224. package/runtime/codex/bin/lib/context.sh +38 -67
  225. package/runtime/codex/bin/lib/genui-entry.py +36 -0
  226. package/runtime/codex/bin/lib/git-message.sh +25 -6
  227. package/runtime/codex/bin/lib/git-sync.sh +12 -4
  228. package/runtime/codex/bin/lib/greeting.sh +255 -28
  229. package/runtime/codex/bin/lib/handoff_meta.py +294 -0
  230. package/runtime/codex/bin/lib/health-footer.sh +83 -2
  231. package/runtime/codex/bin/lib/identity.sh +31 -10
  232. package/runtime/codex/bin/lib/instance-registry.sh +71 -0
  233. package/runtime/codex/bin/lib/local_ci_receipt.py +249 -0
  234. package/runtime/codex/bin/lib/metrics.sh +121 -8
  235. package/runtime/codex/bin/lib/notices.sh +36 -0
  236. package/runtime/codex/bin/lib/record_outcomes.py +729 -0
  237. package/runtime/codex/bin/lib/reflexes.py +267 -0
  238. package/runtime/codex/bin/lib/retrieval_scorecard.py +624 -0
  239. package/runtime/codex/bin/lib/session-record-prompt.txt +18 -0
  240. package/runtime/codex/bin/lib/session_record.py +3747 -0
  241. package/runtime/codex/bin/lib/session_trail.py +1983 -0
  242. package/runtime/codex/bin/lib/settings-drift.sh +8 -5
  243. package/runtime/codex/bin/lib/startup-restart.sh +41 -0
  244. package/runtime/codex/bin/lib/worktree-links.sh +92 -0
  245. package/runtime/codex/bin/memory-push.sh +6 -0
  246. package/runtime/codex/bin/merge-gate.sh +498 -0
  247. package/runtime/codex/bin/notify.sh +5 -2
  248. package/runtime/codex/bin/page-access.sh +103 -0
  249. package/runtime/codex/bin/person.sh +13 -2
  250. package/runtime/codex/bin/pi-render-spec.mjs +0 -1
  251. package/runtime/codex/bin/pi-spirit-discovery.mjs +34 -0
  252. package/runtime/codex/bin/post-update.sh +181 -0
  253. package/runtime/codex/bin/prime-render-spec.mjs +0 -1
  254. package/runtime/codex/bin/publish-artifact.sh +89 -42
  255. package/runtime/codex/bin/qa-inventory.sh +2 -2
  256. package/runtime/codex/bin/quest.sh +1 -1
  257. package/runtime/codex/bin/records.sh +11 -0
  258. package/runtime/codex/bin/reflexes/05-vitals.sh +9 -0
  259. package/runtime/codex/bin/reflexes/10-open-items.sh +12 -0
  260. package/runtime/codex/bin/reflexes/15-retrieval.sh +8 -0
  261. package/runtime/codex/bin/reflexes/20-nightly.sh +100 -0
  262. package/runtime/codex/bin/reflexes/20-sandbox.sh +85 -0
  263. package/runtime/codex/bin/reflexes/30-cost.py +116 -0
  264. package/runtime/codex/bin/reflexes/40-shells.py +51 -0
  265. package/runtime/codex/bin/reflexes/README.md +61 -0
  266. package/runtime/codex/bin/reflexes.sh +7 -0
  267. package/runtime/codex/bin/runtime-identity.sh +140 -42
  268. package/runtime/codex/bin/screenshot.sh +77 -0
  269. package/runtime/codex/bin/scroll.sh +1 -1
  270. package/runtime/codex/bin/search.sh +31 -5
  271. package/runtime/codex/bin/session-autosave.sh +6 -3
  272. package/runtime/codex/bin/session-id.sh +147 -0
  273. package/runtime/codex/bin/session-log.sh +19 -0
  274. package/runtime/codex/bin/session-record.sh +26 -0
  275. package/runtime/codex/bin/settings.sh +13 -8
  276. package/runtime/codex/bin/spirit-discovery-claude.sh +4 -0
  277. package/runtime/codex/bin/spirit-discovery-codex.sh +4 -0
  278. package/runtime/codex/bin/spirit-discovery-pi.sh +4 -0
  279. package/runtime/codex/bin/spirit-discovery-prime.sh +4 -0
  280. package/runtime/codex/bin/spirit-discovery.sh +4 -0
  281. package/runtime/codex/bin/startup-check.sh +1 -1
  282. package/runtime/codex/bin/telemetry.sh +11 -4
  283. package/runtime/codex/bin/test-baseline.sh +33 -5
  284. package/runtime/codex/bin/todo.sh +1 -1
  285. package/runtime/codex/bin/worktree-create.sh +15 -45
  286. package/runtime/codex/bin/worktree.sh +6 -0
  287. package/runtime/codex/docs/spirit-discovery.md +96 -0
  288. package/runtime/codex/egregore_runtime/__init__.py +18 -12
  289. package/runtime/codex/egregore_runtime/access.py +608 -0
  290. package/runtime/codex/egregore_runtime/access_cli.py +190 -0
  291. package/runtime/codex/egregore_runtime/adapters/invitation.py +5 -3
  292. package/runtime/codex/egregore_runtime/adapters/qmd.py +521 -47
  293. package/runtime/codex/egregore_runtime/admin_entry.py +56 -0
  294. package/runtime/codex/egregore_runtime/artifacts.py +222 -16
  295. package/runtime/codex/egregore_runtime/contracts.py +27 -0
  296. package/runtime/codex/egregore_runtime/eligibility.py +5 -12
  297. package/runtime/codex/egregore_runtime/episode_binding.py +16 -5
  298. package/runtime/codex/egregore_runtime/github_issues.py +2 -2
  299. package/runtime/codex/egregore_runtime/handoff_lookup.py +9 -20
  300. package/runtime/codex/egregore_runtime/harness_cli.py +674 -149
  301. package/runtime/codex/egregore_runtime/held.py +2436 -0
  302. package/runtime/codex/egregore_runtime/hosted_api.py +137 -0
  303. package/runtime/codex/egregore_runtime/identity.py +196 -65
  304. package/runtime/codex/egregore_runtime/identity_transfer.py +6 -2
  305. package/runtime/codex/egregore_runtime/ingest_cli.py +2 -2
  306. package/runtime/codex/egregore_runtime/ingest_index_cli.py +4 -16
  307. package/runtime/codex/egregore_runtime/installation.py +119 -0
  308. package/runtime/codex/egregore_runtime/investigation.py +64 -41
  309. package/runtime/codex/egregore_runtime/investigation_guidance.py +16 -11
  310. package/runtime/codex/egregore_runtime/issue_cli.py +51 -32
  311. package/runtime/codex/egregore_runtime/issue_reporting.py +4 -3
  312. package/runtime/codex/egregore_runtime/issue_triage_service.py +2 -2
  313. package/runtime/codex/egregore_runtime/issues.py +12 -6
  314. package/runtime/codex/egregore_runtime/knowledge.py +331 -5
  315. package/runtime/codex/egregore_runtime/knowledge_cli.py +57 -17
  316. package/runtime/codex/egregore_runtime/lifecycle.py +88 -22
  317. package/runtime/codex/egregore_runtime/lifecycle_cli.py +21 -13
  318. package/runtime/codex/egregore_runtime/line_ids.py +10 -0
  319. package/runtime/codex/egregore_runtime/memory_push.py +349 -0
  320. package/runtime/codex/egregore_runtime/observe.py +64 -25
  321. package/runtime/codex/egregore_runtime/observers.py +19 -0
  322. package/runtime/codex/egregore_runtime/optional_modules.py +13 -0
  323. package/runtime/codex/egregore_runtime/outputs_cli.py +321 -0
  324. package/runtime/codex/egregore_runtime/policy.py +651 -24
  325. package/runtime/codex/egregore_runtime/private_result.py +2 -1
  326. package/runtime/codex/egregore_runtime/projection.py +946 -0
  327. package/runtime/codex/egregore_runtime/quest_cli.py +20 -23
  328. package/runtime/codex/egregore_runtime/question_cli.py +15 -11
  329. package/runtime/codex/egregore_runtime/questions.py +10 -10
  330. package/runtime/codex/egregore_runtime/quests.py +10 -10
  331. package/runtime/codex/egregore_runtime/record_publish.py +548 -0
  332. package/runtime/codex/egregore_runtime/record_subject.py +564 -0
  333. package/runtime/codex/egregore_runtime/research_ingest.py +2 -4
  334. package/runtime/codex/egregore_runtime/runtime.py +169 -60
  335. package/runtime/codex/egregore_runtime/sandbox.py +194 -0
  336. package/runtime/codex/egregore_runtime/scroll_cli.py +22 -32
  337. package/runtime/codex/egregore_runtime/scrolls.py +23 -15
  338. package/runtime/codex/egregore_runtime/shadow.py +262 -0
  339. package/runtime/codex/egregore_runtime/spirit_discovery.py +487 -0
  340. package/runtime/codex/egregore_runtime/spirit_discovery_cli.py +25 -0
  341. package/runtime/codex/egregore_runtime/spirit_discovery_transport.py +18 -0
  342. package/runtime/codex/egregore_runtime/status.py +101 -44
  343. package/runtime/codex/egregore_runtime/status_cli.py +13 -5
  344. package/runtime/codex/egregore_runtime/sync.py +39 -21
  345. package/runtime/codex/egregore_runtime/taste.py +934 -0
  346. package/runtime/codex/egregore_runtime/taste_cli.py +242 -0
  347. package/runtime/codex/egregore_runtime/taste_rules.py +91 -0
  348. package/runtime/codex/egregore_runtime/telemetry.py +26 -3
  349. package/runtime/codex/egregore_runtime/todo_cli.py +15 -12
  350. package/runtime/codex/egregore_runtime/todos.py +3 -2
  351. package/runtime/codex/egregore_runtime/upgrade.py +85 -58
  352. package/runtime/codex/egregore_runtime/writeback.py +330 -24
  353. package/runtime/codex/manifest.json +66 -5
  354. package/runtime/pi/.claude/context/handoff-claiming.md +32 -0
  355. package/runtime/pi/.claude/context/notification-consent.md +12 -9
  356. package/runtime/pi/.claude/skills/view/SKILL.md +438 -0
  357. package/runtime/pi/.codex/hooks.json +11 -0
  358. package/runtime/pi/.codex/skills/dark-mode/SKILL.md +1 -1
  359. package/runtime/pi/.codex/skills/records/SKILL.md +29 -0
  360. package/runtime/pi/.codex/skills/summon/SKILL.md +1 -1
  361. package/runtime/pi/.codex/skills/view/assets/compose-scaffold.html +19 -13
  362. package/runtime/pi/.codex/spec-manifest.json +13 -19
  363. package/runtime/pi/.pi/APPEND_SYSTEM.md +53 -99
  364. package/runtime/pi/.pi/extensions/egregore.ts +13 -1
  365. package/runtime/pi/.pi/spec-manifest.json +2 -2
  366. package/runtime/pi/AGENTS.md +54 -105
  367. package/runtime/pi/bin/agent.sh +231 -7
  368. package/runtime/pi/bin/api-call.sh +44 -23
  369. package/runtime/pi/bin/artifact-register.sh +7 -1
  370. package/runtime/pi/bin/artifact-writeback.sh +1 -1
  371. package/runtime/pi/bin/artifacts.sh +66 -265
  372. package/runtime/pi/bin/attendant.sh +4 -1
  373. package/runtime/pi/bin/boundary-guard.cjs +1848 -0
  374. package/runtime/pi/bin/boundary-hook.sh +41 -0
  375. package/runtime/pi/bin/capture-run.sh +32 -2
  376. package/runtime/pi/bin/codex-render-spec.mjs +24 -46
  377. package/runtime/pi/bin/codex-session-start.sh +19 -0
  378. package/runtime/pi/bin/codex-skill-render.mjs +18 -0
  379. package/runtime/pi/bin/config-get.sh +10 -1
  380. package/runtime/pi/bin/connect-refresh.sh +16 -0
  381. package/runtime/pi/bin/corpus_map.py +5 -0
  382. package/runtime/pi/bin/data/capabilities/pi.json +1458 -0
  383. package/runtime/pi/bin/genui.sh +19 -0
  384. package/runtime/pi/bin/graph-batch.sh +1 -1
  385. package/runtime/pi/bin/graph-op.sh +14 -0
  386. package/runtime/pi/bin/graph.sh +1 -1
  387. package/runtime/pi/bin/handoff-pr-backfill.sh +1 -1
  388. package/runtime/pi/bin/handoff-run.sh +11 -6
  389. package/runtime/pi/bin/ingest-item.sh +1 -1
  390. package/runtime/pi/bin/ingest-surface.html +22 -4
  391. package/runtime/pi/bin/issue.sh +1 -1
  392. package/runtime/pi/bin/knowledge.sh +1 -1
  393. package/runtime/pi/bin/lib/card-delivery.sh +329 -0
  394. package/runtime/pi/bin/lib/config.sh +148 -3
  395. package/runtime/pi/bin/lib/context.sh +38 -67
  396. package/runtime/pi/bin/lib/genui-entry.py +36 -0
  397. package/runtime/pi/bin/lib/git-message.sh +25 -6
  398. package/runtime/pi/bin/lib/git-sync.sh +12 -4
  399. package/runtime/pi/bin/lib/greeting.sh +255 -28
  400. package/runtime/pi/bin/lib/handoff_meta.py +294 -0
  401. package/runtime/pi/bin/lib/health-footer.sh +83 -2
  402. package/runtime/pi/bin/lib/identity.sh +31 -10
  403. package/runtime/pi/bin/lib/instance-registry.sh +71 -0
  404. package/runtime/pi/bin/lib/local_ci_receipt.py +249 -0
  405. package/runtime/pi/bin/lib/metrics.sh +121 -8
  406. package/runtime/pi/bin/lib/notices.sh +36 -0
  407. package/runtime/pi/bin/lib/record_outcomes.py +729 -0
  408. package/runtime/pi/bin/lib/reflexes.py +267 -0
  409. package/runtime/pi/bin/lib/retrieval_scorecard.py +624 -0
  410. package/runtime/pi/bin/lib/session-record-prompt.txt +18 -0
  411. package/runtime/pi/bin/lib/session_record.py +3747 -0
  412. package/runtime/pi/bin/lib/session_trail.py +1983 -0
  413. package/runtime/pi/bin/lib/settings-drift.sh +8 -5
  414. package/runtime/pi/bin/lib/startup-restart.sh +41 -0
  415. package/runtime/pi/bin/lib/worktree-links.sh +92 -0
  416. package/runtime/pi/bin/memory-push.sh +6 -0
  417. package/runtime/pi/bin/merge-gate.sh +498 -0
  418. package/runtime/pi/bin/notify.sh +5 -2
  419. package/runtime/pi/bin/page-access.sh +103 -0
  420. package/runtime/pi/bin/person.sh +13 -2
  421. package/runtime/pi/bin/pi-branch-policy.mjs +37 -0
  422. package/runtime/pi/bin/pi-observe-context.mjs +97 -4
  423. package/runtime/pi/bin/pi-render-spec.mjs +0 -1
  424. package/runtime/pi/bin/pi-session-start.sh +4 -1
  425. package/runtime/pi/bin/pi-spirit-discovery.mjs +34 -0
  426. package/runtime/pi/bin/post-update.sh +181 -0
  427. package/runtime/pi/bin/prime-render-spec.mjs +0 -1
  428. package/runtime/pi/bin/publish-artifact.sh +89 -42
  429. package/runtime/pi/bin/qa-inventory.sh +2 -2
  430. package/runtime/pi/bin/quest.sh +1 -1
  431. package/runtime/pi/bin/records.sh +11 -0
  432. package/runtime/pi/bin/reflexes/05-vitals.sh +9 -0
  433. package/runtime/pi/bin/reflexes/10-open-items.sh +12 -0
  434. package/runtime/pi/bin/reflexes/15-retrieval.sh +8 -0
  435. package/runtime/pi/bin/reflexes/20-nightly.sh +100 -0
  436. package/runtime/pi/bin/reflexes/20-sandbox.sh +85 -0
  437. package/runtime/pi/bin/reflexes/30-cost.py +116 -0
  438. package/runtime/pi/bin/reflexes/40-shells.py +51 -0
  439. package/runtime/pi/bin/reflexes/README.md +61 -0
  440. package/runtime/pi/bin/reflexes.sh +7 -0
  441. package/runtime/pi/bin/runtime-identity.sh +140 -42
  442. package/runtime/pi/bin/screenshot.sh +77 -0
  443. package/runtime/pi/bin/scroll.sh +1 -1
  444. package/runtime/pi/bin/search.sh +31 -5
  445. package/runtime/pi/bin/session-autosave.sh +6 -3
  446. package/runtime/pi/bin/session-id.sh +147 -0
  447. package/runtime/pi/bin/session-log.sh +19 -0
  448. package/runtime/pi/bin/session-record.sh +26 -0
  449. package/runtime/pi/bin/settings.sh +13 -8
  450. package/runtime/pi/bin/spirit-discovery-claude.sh +4 -0
  451. package/runtime/pi/bin/spirit-discovery-codex.sh +4 -0
  452. package/runtime/pi/bin/spirit-discovery-pi.sh +4 -0
  453. package/runtime/pi/bin/spirit-discovery-prime.sh +4 -0
  454. package/runtime/pi/bin/spirit-discovery.sh +4 -0
  455. package/runtime/pi/bin/startup-check.sh +1 -1
  456. package/runtime/pi/bin/telemetry.sh +11 -4
  457. package/runtime/pi/bin/test-baseline.sh +33 -5
  458. package/runtime/pi/bin/todo.sh +1 -1
  459. package/runtime/pi/bin/worktree-create.sh +15 -45
  460. package/runtime/pi/bin/worktree.sh +6 -0
  461. package/runtime/pi/docs/spirit-discovery.md +96 -0
  462. package/runtime/pi/egregore_runtime/__init__.py +18 -12
  463. package/runtime/pi/egregore_runtime/access.py +608 -0
  464. package/runtime/pi/egregore_runtime/access_cli.py +190 -0
  465. package/runtime/pi/egregore_runtime/adapters/invitation.py +5 -3
  466. package/runtime/pi/egregore_runtime/adapters/qmd.py +521 -47
  467. package/runtime/pi/egregore_runtime/admin_entry.py +56 -0
  468. package/runtime/pi/egregore_runtime/artifacts.py +222 -16
  469. package/runtime/pi/egregore_runtime/contracts.py +27 -0
  470. package/runtime/pi/egregore_runtime/eligibility.py +5 -12
  471. package/runtime/pi/egregore_runtime/episode_binding.py +16 -5
  472. package/runtime/pi/egregore_runtime/github_issues.py +2 -2
  473. package/runtime/pi/egregore_runtime/handoff_lookup.py +9 -20
  474. package/runtime/pi/egregore_runtime/harness_cli.py +674 -149
  475. package/runtime/pi/egregore_runtime/held.py +2436 -0
  476. package/runtime/pi/egregore_runtime/hosted_api.py +137 -0
  477. package/runtime/pi/egregore_runtime/identity.py +196 -65
  478. package/runtime/pi/egregore_runtime/identity_transfer.py +6 -2
  479. package/runtime/pi/egregore_runtime/ingest_cli.py +2 -2
  480. package/runtime/pi/egregore_runtime/ingest_index_cli.py +4 -16
  481. package/runtime/pi/egregore_runtime/installation.py +119 -0
  482. package/runtime/pi/egregore_runtime/investigation.py +64 -41
  483. package/runtime/pi/egregore_runtime/investigation_guidance.py +16 -11
  484. package/runtime/pi/egregore_runtime/issue_cli.py +51 -32
  485. package/runtime/pi/egregore_runtime/issue_reporting.py +4 -3
  486. package/runtime/pi/egregore_runtime/issue_triage_service.py +2 -2
  487. package/runtime/pi/egregore_runtime/issues.py +12 -6
  488. package/runtime/pi/egregore_runtime/knowledge.py +331 -5
  489. package/runtime/pi/egregore_runtime/knowledge_cli.py +57 -17
  490. package/runtime/pi/egregore_runtime/lifecycle.py +88 -22
  491. package/runtime/pi/egregore_runtime/lifecycle_cli.py +21 -13
  492. package/runtime/pi/egregore_runtime/line_ids.py +10 -0
  493. package/runtime/pi/egregore_runtime/memory_push.py +349 -0
  494. package/runtime/pi/egregore_runtime/observe.py +64 -25
  495. package/runtime/pi/egregore_runtime/observers.py +19 -0
  496. package/runtime/pi/egregore_runtime/optional_modules.py +13 -0
  497. package/runtime/pi/egregore_runtime/outputs_cli.py +321 -0
  498. package/runtime/pi/egregore_runtime/policy.py +651 -24
  499. package/runtime/pi/egregore_runtime/private_result.py +2 -1
  500. package/runtime/pi/egregore_runtime/projection.py +946 -0
  501. package/runtime/pi/egregore_runtime/quest_cli.py +20 -23
  502. package/runtime/pi/egregore_runtime/question_cli.py +15 -11
  503. package/runtime/pi/egregore_runtime/questions.py +10 -10
  504. package/runtime/pi/egregore_runtime/quests.py +10 -10
  505. package/runtime/pi/egregore_runtime/record_publish.py +548 -0
  506. package/runtime/pi/egregore_runtime/record_subject.py +564 -0
  507. package/runtime/pi/egregore_runtime/research_ingest.py +2 -4
  508. package/runtime/pi/egregore_runtime/runtime.py +169 -60
  509. package/runtime/pi/egregore_runtime/sandbox.py +194 -0
  510. package/runtime/pi/egregore_runtime/scroll_cli.py +22 -32
  511. package/runtime/pi/egregore_runtime/scrolls.py +23 -15
  512. package/runtime/pi/egregore_runtime/shadow.py +262 -0
  513. package/runtime/pi/egregore_runtime/spirit_discovery.py +487 -0
  514. package/runtime/pi/egregore_runtime/spirit_discovery_cli.py +25 -0
  515. package/runtime/pi/egregore_runtime/spirit_discovery_transport.py +18 -0
  516. package/runtime/pi/egregore_runtime/status.py +101 -44
  517. package/runtime/pi/egregore_runtime/status_cli.py +13 -5
  518. package/runtime/pi/egregore_runtime/sync.py +39 -21
  519. package/runtime/pi/egregore_runtime/taste.py +934 -0
  520. package/runtime/pi/egregore_runtime/taste_cli.py +242 -0
  521. package/runtime/pi/egregore_runtime/taste_rules.py +91 -0
  522. package/runtime/pi/egregore_runtime/telemetry.py +26 -3
  523. package/runtime/pi/egregore_runtime/todo_cli.py +15 -12
  524. package/runtime/pi/egregore_runtime/todos.py +3 -2
  525. package/runtime/pi/egregore_runtime/upgrade.py +85 -58
  526. package/runtime/pi/egregore_runtime/writeback.py +330 -24
  527. package/runtime/pi/manifest.json +66 -5
  528. package/runtime/prime/.claude/context/handoff-claiming.md +32 -0
  529. package/runtime/prime/.claude/context/notification-consent.md +12 -9
  530. package/runtime/prime/.claude/skills/view/SKILL.md +438 -0
  531. package/runtime/prime/.codex/hooks.json +11 -0
  532. package/runtime/prime/.codex/skills/dark-mode/SKILL.md +1 -1
  533. package/runtime/prime/.codex/skills/records/SKILL.md +29 -0
  534. package/runtime/prime/.codex/skills/summon/SKILL.md +1 -1
  535. package/runtime/prime/.codex/skills/view/assets/compose-scaffold.html +19 -13
  536. package/runtime/prime/.codex/spec-manifest.json +13 -19
  537. package/runtime/prime/.prime/agent/APPEND_SYSTEM.md +53 -99
  538. package/runtime/prime/.prime/agent/extensions/egregore.ts +14 -1
  539. package/runtime/prime/.prime/agent/skills/egregore/SKILL.md +14 -6
  540. package/runtime/prime/.prime/agent/skills/egregore/src/egregore/__init__.py +66 -1
  541. package/runtime/prime/.prime/agent/spec-manifest.json +2 -2
  542. package/runtime/prime/AGENTS.md +54 -105
  543. package/runtime/prime/bin/agent.sh +231 -7
  544. package/runtime/prime/bin/api-call.sh +44 -23
  545. package/runtime/prime/bin/artifact-register.sh +7 -1
  546. package/runtime/prime/bin/artifact-writeback.sh +1 -1
  547. package/runtime/prime/bin/artifacts.sh +66 -265
  548. package/runtime/prime/bin/attendant.sh +4 -1
  549. package/runtime/prime/bin/boundary-guard.cjs +1848 -0
  550. package/runtime/prime/bin/boundary-hook.sh +41 -0
  551. package/runtime/prime/bin/capture-run.sh +32 -2
  552. package/runtime/prime/bin/codex-render-spec.mjs +24 -46
  553. package/runtime/prime/bin/codex-session-start.sh +19 -0
  554. package/runtime/prime/bin/codex-skill-render.mjs +18 -0
  555. package/runtime/prime/bin/config-get.sh +10 -1
  556. package/runtime/prime/bin/connect-refresh.sh +16 -0
  557. package/runtime/prime/bin/corpus_map.py +5 -0
  558. package/runtime/prime/bin/data/capabilities/prime.json +1458 -0
  559. package/runtime/prime/bin/genui.sh +19 -0
  560. package/runtime/prime/bin/graph-batch.sh +1 -1
  561. package/runtime/prime/bin/graph-op.sh +14 -0
  562. package/runtime/prime/bin/graph.sh +1 -1
  563. package/runtime/prime/bin/handoff-pr-backfill.sh +1 -1
  564. package/runtime/prime/bin/handoff-run.sh +11 -6
  565. package/runtime/prime/bin/ingest-item.sh +1 -1
  566. package/runtime/prime/bin/ingest-surface.html +22 -4
  567. package/runtime/prime/bin/issue.sh +1 -1
  568. package/runtime/prime/bin/knowledge.sh +1 -1
  569. package/runtime/prime/bin/lib/card-delivery.sh +329 -0
  570. package/runtime/prime/bin/lib/config.sh +148 -3
  571. package/runtime/prime/bin/lib/context.sh +38 -67
  572. package/runtime/prime/bin/lib/genui-entry.py +36 -0
  573. package/runtime/prime/bin/lib/git-message.sh +25 -6
  574. package/runtime/prime/bin/lib/git-sync.sh +12 -4
  575. package/runtime/prime/bin/lib/greeting.sh +255 -28
  576. package/runtime/prime/bin/lib/handoff_meta.py +294 -0
  577. package/runtime/prime/bin/lib/health-footer.sh +83 -2
  578. package/runtime/prime/bin/lib/identity.sh +31 -10
  579. package/runtime/prime/bin/lib/instance-registry.sh +71 -0
  580. package/runtime/prime/bin/lib/local_ci_receipt.py +249 -0
  581. package/runtime/prime/bin/lib/metrics.sh +121 -8
  582. package/runtime/prime/bin/lib/notices.sh +36 -0
  583. package/runtime/prime/bin/lib/record_outcomes.py +729 -0
  584. package/runtime/prime/bin/lib/reflexes.py +267 -0
  585. package/runtime/prime/bin/lib/retrieval_scorecard.py +624 -0
  586. package/runtime/prime/bin/lib/session-record-prompt.txt +18 -0
  587. package/runtime/prime/bin/lib/session_record.py +3747 -0
  588. package/runtime/prime/bin/lib/session_trail.py +1983 -0
  589. package/runtime/prime/bin/lib/settings-drift.sh +8 -5
  590. package/runtime/prime/bin/lib/startup-restart.sh +41 -0
  591. package/runtime/prime/bin/lib/worktree-links.sh +92 -0
  592. package/runtime/prime/bin/memory-push.sh +6 -0
  593. package/runtime/prime/bin/merge-gate.sh +498 -0
  594. package/runtime/prime/bin/notify.sh +5 -2
  595. package/runtime/prime/bin/page-access.sh +103 -0
  596. package/runtime/prime/bin/person.sh +13 -2
  597. package/runtime/prime/bin/pi-branch-policy.mjs +37 -0
  598. package/runtime/prime/bin/pi-observe-context.mjs +97 -4
  599. package/runtime/prime/bin/pi-render-spec.mjs +0 -1
  600. package/runtime/prime/bin/pi-spirit-discovery.mjs +34 -0
  601. package/runtime/prime/bin/post-update.sh +181 -0
  602. package/runtime/prime/bin/prime-render-spec.mjs +0 -1
  603. package/runtime/prime/bin/prime-session-start.sh +3 -1
  604. package/runtime/prime/bin/publish-artifact.sh +89 -42
  605. package/runtime/prime/bin/qa-inventory.sh +2 -2
  606. package/runtime/prime/bin/quest.sh +1 -1
  607. package/runtime/prime/bin/records.sh +11 -0
  608. package/runtime/prime/bin/reflexes/05-vitals.sh +9 -0
  609. package/runtime/prime/bin/reflexes/10-open-items.sh +12 -0
  610. package/runtime/prime/bin/reflexes/15-retrieval.sh +8 -0
  611. package/runtime/prime/bin/reflexes/20-nightly.sh +100 -0
  612. package/runtime/prime/bin/reflexes/20-sandbox.sh +85 -0
  613. package/runtime/prime/bin/reflexes/30-cost.py +116 -0
  614. package/runtime/prime/bin/reflexes/40-shells.py +51 -0
  615. package/runtime/prime/bin/reflexes/README.md +61 -0
  616. package/runtime/prime/bin/reflexes.sh +7 -0
  617. package/runtime/prime/bin/runtime-identity.sh +140 -42
  618. package/runtime/prime/bin/screenshot.sh +77 -0
  619. package/runtime/prime/bin/scroll.sh +1 -1
  620. package/runtime/prime/bin/search.sh +31 -5
  621. package/runtime/prime/bin/session-autosave.sh +6 -3
  622. package/runtime/prime/bin/session-id.sh +147 -0
  623. package/runtime/prime/bin/session-log.sh +19 -0
  624. package/runtime/prime/bin/session-record.sh +26 -0
  625. package/runtime/prime/bin/settings.sh +13 -8
  626. package/runtime/prime/bin/spirit-discovery-claude.sh +4 -0
  627. package/runtime/prime/bin/spirit-discovery-codex.sh +4 -0
  628. package/runtime/prime/bin/spirit-discovery-pi.sh +4 -0
  629. package/runtime/prime/bin/spirit-discovery-prime.sh +4 -0
  630. package/runtime/prime/bin/spirit-discovery.sh +4 -0
  631. package/runtime/prime/bin/startup-check.sh +1 -1
  632. package/runtime/prime/bin/telemetry.sh +11 -4
  633. package/runtime/prime/bin/test-baseline.sh +33 -5
  634. package/runtime/prime/bin/todo.sh +1 -1
  635. package/runtime/prime/bin/worktree-create.sh +15 -45
  636. package/runtime/prime/bin/worktree.sh +6 -0
  637. package/runtime/prime/docs/spirit-discovery.md +96 -0
  638. package/runtime/prime/egregore_runtime/__init__.py +18 -12
  639. package/runtime/prime/egregore_runtime/access.py +608 -0
  640. package/runtime/prime/egregore_runtime/access_cli.py +190 -0
  641. package/runtime/prime/egregore_runtime/adapters/invitation.py +5 -3
  642. package/runtime/prime/egregore_runtime/adapters/qmd.py +521 -47
  643. package/runtime/prime/egregore_runtime/admin_entry.py +56 -0
  644. package/runtime/prime/egregore_runtime/artifacts.py +222 -16
  645. package/runtime/prime/egregore_runtime/contracts.py +27 -0
  646. package/runtime/prime/egregore_runtime/eligibility.py +5 -12
  647. package/runtime/prime/egregore_runtime/episode_binding.py +16 -5
  648. package/runtime/prime/egregore_runtime/github_issues.py +2 -2
  649. package/runtime/prime/egregore_runtime/handoff_lookup.py +9 -20
  650. package/runtime/prime/egregore_runtime/harness_cli.py +674 -149
  651. package/runtime/prime/egregore_runtime/held.py +2436 -0
  652. package/runtime/prime/egregore_runtime/hosted_api.py +137 -0
  653. package/runtime/prime/egregore_runtime/identity.py +196 -65
  654. package/runtime/prime/egregore_runtime/identity_transfer.py +6 -2
  655. package/runtime/prime/egregore_runtime/ingest_cli.py +2 -2
  656. package/runtime/prime/egregore_runtime/ingest_index_cli.py +4 -16
  657. package/runtime/prime/egregore_runtime/installation.py +119 -0
  658. package/runtime/prime/egregore_runtime/investigation.py +64 -41
  659. package/runtime/prime/egregore_runtime/investigation_guidance.py +16 -11
  660. package/runtime/prime/egregore_runtime/issue_cli.py +51 -32
  661. package/runtime/prime/egregore_runtime/issue_reporting.py +4 -3
  662. package/runtime/prime/egregore_runtime/issue_triage_service.py +2 -2
  663. package/runtime/prime/egregore_runtime/issues.py +12 -6
  664. package/runtime/prime/egregore_runtime/knowledge.py +331 -5
  665. package/runtime/prime/egregore_runtime/knowledge_cli.py +57 -17
  666. package/runtime/prime/egregore_runtime/lifecycle.py +88 -22
  667. package/runtime/prime/egregore_runtime/lifecycle_cli.py +21 -13
  668. package/runtime/prime/egregore_runtime/line_ids.py +10 -0
  669. package/runtime/prime/egregore_runtime/memory_push.py +349 -0
  670. package/runtime/prime/egregore_runtime/observe.py +64 -25
  671. package/runtime/prime/egregore_runtime/observers.py +19 -0
  672. package/runtime/prime/egregore_runtime/optional_modules.py +13 -0
  673. package/runtime/prime/egregore_runtime/outputs_cli.py +321 -0
  674. package/runtime/prime/egregore_runtime/policy.py +651 -24
  675. package/runtime/prime/egregore_runtime/private_result.py +2 -1
  676. package/runtime/prime/egregore_runtime/projection.py +946 -0
  677. package/runtime/prime/egregore_runtime/quest_cli.py +20 -23
  678. package/runtime/prime/egregore_runtime/question_cli.py +15 -11
  679. package/runtime/prime/egregore_runtime/questions.py +10 -10
  680. package/runtime/prime/egregore_runtime/quests.py +10 -10
  681. package/runtime/prime/egregore_runtime/record_publish.py +548 -0
  682. package/runtime/prime/egregore_runtime/record_subject.py +564 -0
  683. package/runtime/prime/egregore_runtime/research_ingest.py +2 -4
  684. package/runtime/prime/egregore_runtime/runtime.py +169 -60
  685. package/runtime/prime/egregore_runtime/sandbox.py +194 -0
  686. package/runtime/prime/egregore_runtime/scroll_cli.py +22 -32
  687. package/runtime/prime/egregore_runtime/scrolls.py +23 -15
  688. package/runtime/prime/egregore_runtime/shadow.py +262 -0
  689. package/runtime/prime/egregore_runtime/spirit_discovery.py +487 -0
  690. package/runtime/prime/egregore_runtime/spirit_discovery_cli.py +25 -0
  691. package/runtime/prime/egregore_runtime/spirit_discovery_transport.py +18 -0
  692. package/runtime/prime/egregore_runtime/status.py +101 -44
  693. package/runtime/prime/egregore_runtime/status_cli.py +13 -5
  694. package/runtime/prime/egregore_runtime/sync.py +39 -21
  695. package/runtime/prime/egregore_runtime/taste.py +934 -0
  696. package/runtime/prime/egregore_runtime/taste_cli.py +242 -0
  697. package/runtime/prime/egregore_runtime/taste_rules.py +91 -0
  698. package/runtime/prime/egregore_runtime/telemetry.py +26 -3
  699. package/runtime/prime/egregore_runtime/todo_cli.py +15 -12
  700. package/runtime/prime/egregore_runtime/todos.py +3 -2
  701. package/runtime/prime/egregore_runtime/upgrade.py +85 -58
  702. package/runtime/prime/egregore_runtime/writeback.py +330 -24
  703. package/runtime/prime/manifest.json +66 -5
  704. package/runtime/claude/bin/thread.sh +0 -9
  705. package/runtime/claude/egregore_runtime/admin_gate.py +0 -102
  706. package/runtime/claude/egregore_runtime/thread_cli.py +0 -173
  707. package/runtime/claude/egregore_runtime/threads.py +0 -521
  708. package/runtime/codex/bin/thread.sh +0 -9
  709. package/runtime/codex/egregore_runtime/admin_gate.py +0 -102
  710. package/runtime/codex/egregore_runtime/thread_cli.py +0 -173
  711. package/runtime/codex/egregore_runtime/threads.py +0 -521
  712. package/runtime/pi/bin/thread.sh +0 -9
  713. package/runtime/pi/egregore_runtime/admin_gate.py +0 -102
  714. package/runtime/pi/egregore_runtime/thread_cli.py +0 -173
  715. package/runtime/pi/egregore_runtime/threads.py +0 -521
  716. package/runtime/prime/bin/thread.sh +0 -9
  717. package/runtime/prime/egregore_runtime/admin_gate.py +0 -102
  718. package/runtime/prime/egregore_runtime/thread_cli.py +0 -173
  719. package/runtime/prime/egregore_runtime/threads.py +0 -521
@@ -21,26 +21,54 @@ Use when the user says 'we decided', 'I realized', or 'that's a pattern' — cap
21
21
  ## Context
22
22
 
23
23
  Reuse attached `EGREGORE_ORG_CONTEXT_V1` evidence. When it is sufficient, do
24
- not search or reopen sources. If a named gap remains, make one
25
- `bash bin/search.sh query "<concept>" -n 6` call and open only the missing
26
- canonical source through `bash bin/search.sh open`. Never query implementation
27
- infrastructure or storage directly.
24
+ not reopen sources. If a named gap remains, make one
25
+ `bash bin/search.sh find "<concept>" --kind hybrid -n 6` call and open only the
26
+ missing canonical source through `bash bin/search.sh open`. Never query
27
+ implementation infrastructure or storage directly.
28
+
29
+ ## Two layers
30
+
31
+ Knowledge is saved as a **pattern** (a general motif) and **evidence** (the
32
+ specific, dated, sourced case, a `finding` with subtype `evidence`) linked by
33
+ `instance-of`. Before classifying, search existing motifs once:
34
+ `bash bin/search.sh find "<motif in general words>" --kind hybrid --prefix memory/knowledge/patterns -n 5`.
35
+
36
+ - A pattern fits: create only the evidence, linked to that pattern's id (or
37
+ canonical path). `bash bin/knowledge.sh instances <pattern-id>` lists what
38
+ already instances it.
39
+ - No pattern fits and the insight recurs or generalizes: create the pattern
40
+ first, then the evidence linked to the `artifact_id` in its receipt.
41
+ - A one-off fact or a decision needs no pattern.
42
+
43
+ A pattern reads as a general motif: no organization or people names and no
44
+ dates in the motif sentence; the evidence keeps the specifics. Pattern body
45
+ sections: Motif, Where it lives, When it shows up, How to recognise it, The
46
+ move, When it doesn't apply, Situations (for discovery). Name the first case in
47
+ one line under Instances; the live list is the `instances` command. Situations
48
+ go in as repeatable flags: `--situation-domain` (a field such as meta-harness
49
+ design), `--situation-path` (repository-relative glob), `--situation-activity`
50
+ (what someone is doing). A matching later session gets one offer line,
51
+ `Patterns that may apply: …`; `knowledge.sh situated` runs it on demand.
52
+
53
+ Relationships: `instance-of` (evidence → pattern), `responds-to` (decision →
54
+ the evidence it answers), `applies` (decision → the pattern it acts on),
55
+ `supersedes`, `relates-to`. Other relations are kept with a warning.
28
56
 
29
57
  ## Flow
30
58
 
31
59
  1. Extract the title, exact insight, context, rationale, two to four topics,
32
60
  workstream, explicit relationships, and superseded artifact IDs when known.
33
- 2. Classify each distinct insight as `decision`, `finding`, or `pattern`.
34
- Create at most three. Do not infer supersession or authority from recency.
35
- 3. Use already-returned evidence for dedupe. If a likely duplicate exists,
36
- open it through the Runtime boundary and ask whether to supersede it or
37
- create a distinct artifact.
38
- 4. Preview the proposed artifacts and wait for `y`, edits, or `skip`. Nothing
39
- is canonical before this acceptance.
40
- 5. For each accepted artifact, render its complete Markdown body to a temporary file
41
- under `tmp/` and call exactly one domain command; `{artifact-file}` is that file, and
42
- `{artifact-type}`, `{title}`, `{topic}`, and `{workstream}` are the accepted
43
- artifact's type, title, topic, and workstream:
61
+ 2. Classify each distinct insight as `decision`, `finding`, or `pattern` and
62
+ place it in the two layers above. Create at most three artifacts. Do not
63
+ infer supersession or authority from recency.
64
+ 3. Use returned evidence for dedupe. If a likely duplicate exists, open it
65
+ through the Runtime boundary and ask whether to supersede it or create a
66
+ distinct artifact.
67
+ 4. Preview every proposed artifact, the pattern and its evidence together, and
68
+ wait for `y`, edits, or `skip`. Nothing is canonical before this acceptance.
69
+ 5. For each accepted artifact, render its complete Markdown body to a temporary
70
+ file under `tmp/` and call exactly one domain command; `{artifact-file}` is
71
+ that file and the other values come from the accepted artifact:
44
72
 
45
73
  ```bash
46
74
  bash bin/knowledge.sh create \
@@ -51,12 +79,13 @@ bash bin/knowledge.sh create \
51
79
  --workstream '{workstream}'
52
80
  ```
53
81
 
54
- Add repeated `--topic`, `--relationship "RELATION:TARGET"`, or
55
- `--supersedes "ARTIFACT_ID"` arguments only when explicit. The Runtime resolves
56
- ActorContext, authorizes, assigns stable identity/provenance, persists canonical
57
- Markdown, records Git provenance, refreshes retrieval, starts background
58
- embedding, and emits content-free telemetry. Treat `partial` projection
59
- warnings honestly; the canonical artifact remains authoritative.
82
+ Add repeated `--topic`, `--subtype evidence`, `--relationship "RELATION:TARGET"`,
83
+ `--situation-*`, or `--supersedes "ARTIFACT_ID"` arguments only when they apply.
84
+ The Runtime resolves ActorContext, authorizes, assigns stable
85
+ identity/provenance, persists canonical Markdown, records Git provenance,
86
+ refreshes retrieval, starts background embedding, and emits content-free
87
+ telemetry. Report receipt `warnings` and `partial` projection honestly; the
88
+ canonical artifact remains authoritative.
60
89
 
61
90
  ## Boundaries
62
91
 
@@ -275,11 +275,13 @@ After showing the summary, offer:
275
275
 
276
276
  ## Merge execution (when user confirms)
277
277
 
278
- For each PR the user confirmed for merging, use its metadata number as `{pr_number}` and the configured `{github_org}` and `{repo_name}`:
278
+ For each PR the user confirmed for merging, use its metadata number as `{pr_number}` and the configured `{github_org}` and `{repo_name}`, and merge through the gate:
279
279
  ```bash
280
- bash bin/gh-run.sh pr merge '{pr_number}' --merge --repo '{github_org}/{repo_name}'
280
+ bash bin/agent.sh merge 'https://github.com/{github_org}/{repo_name}/pull/{pr_number}'
281
281
  ```
282
282
 
283
+ When the gate refuses on a red check, show the user the failing jobs it names, and merge only if they decide those jobs do not matter: write a receipt naming each one and why, then run the same command with `--receipt <file>`, and the gate posts it on the PR before it merges.
284
+
283
285
  After merge, update local develop:
284
286
  ```bash
285
287
  git fetch origin develop --quiet
@@ -85,9 +85,15 @@ scope checkpoint. Otherwise continue without ritual confirmation.
85
85
  drafts by default; passing `--draft` also converts an existing ready PR
86
86
  before pushing, avoiding paid checks on unfinished iterations.
87
87
  - When the requested work is complete and local QA/review has passed, use
88
- `--ready`. For an existing draft, the bridge pushes the final head before
89
- marking it ready, so CI checks the saved version. If checks fail or another
90
- edit is needed, use `--draft` for the next in-progress save.
88
+ `--ready`. In the Egregore source repository (not an installed instance)
89
+ the bridge first runs the checks CI would select for the branch on this
90
+ machine, which can take as long as a CI run; run the save in the
91
+ background where the harness allows. If a check fails, the work is still
92
+ pushed, the PR stays a draft, and the bridge exits non-zero naming the
93
+ check and its log: fix it, then save with `--ready` again. For an existing
94
+ draft, the bridge pushes the final head before marking it ready, so CI
95
+ checks the saved version. If CI fails or another edit is needed, use
96
+ `--draft` for the next in-progress save.
91
97
  - Non-coding saves keep their existing ready/auto-merge behavior. Omit the
92
98
  readiness flag unless the work should deliberately remain a draft.
93
99
  - Without a flag, existing PRs retain their current readiness. `--draft` and
@@ -1,240 +1,171 @@
1
1
  ---
2
2
  name: summon
3
- description: "Design and launch a persistent agent (a spirit) that runs on a schedule or watches for conditions, via adaptive questioning that produces a reviewable spec before launch."
3
+ description: "Reuse, design, and launch Egregore spirits. Review available recipes and current host permissions, then start authorized on-demand work or design a scheduled process for an available scheduler."
4
4
  ---
5
5
 
6
- # /summon — Design and Launch a Persistent Agent Process
6
+ # Summon an Egregore spirit
7
7
 
8
- Summon a spirit — a persistent agent that runs on a schedule or watches for conditions. Unlike `/loop` (dumb scheduler), `/summon` designs the process through adaptive questioning, produces a reviewable spec, then launches it.
8
+ A spirit is an Egregore agent with a durable purpose and execution history.
9
+ Begin with what the user wants done and reuse an available recipe when it fits.
10
+ A recipe is a portable design; an admitted run and a running schedule each need
11
+ their own host receipt. Saving a design does not launch a spirit.
9
12
 
10
13
  ## When to invoke
11
14
 
12
- **Trigger phrases**: "summon", "create a loop", "set up a recurring", "watch for", "monitor", "keep an eye on", "babysit", "run something every", "I want an agent that"
13
-
14
- **Not this command**:
15
- - Quick one-shot schedule → `/loop` directly (user already knows what they want)
16
- - One-time task → just do it, no spirit needed
17
-
18
- ## Mode detection
19
-
20
- ```bash
21
- bash bin/config-get.sh mode
15
+ Use for “summon,” “I want a spirit that,” reusing a spirit recipe, or designing
16
+ recurring work, monitoring, and condition-triggered work. Ordinary one-off work
17
+ needs no new recipe unless the user wants a reusable spirit. A fully specified
18
+ schedule can go straight to an available scheduler.
19
+
20
+ ## 1. Restore intent and discover what exists
21
+
22
+ Use the conversation first. Do not ask again for purpose, constraints, or
23
+ authorization already supplied. Ask only for missing information that affects
24
+ the next action; use structured questions when available.
25
+
26
+ For organizational context, follow the Runtime retrieval contract: reuse
27
+ supplied evidence, otherwise use `bash bin/search.sh find` and `open`. Show the
28
+ required retrieval beat. Do not scan raw memory or query relationships merely
29
+ because the request concerns a spirit. Existing `.spirits/` designs are project
30
+ files and can be inspected normally.
31
+
32
+ Check the tools actually exposed by the current host:
33
+
34
+ - If `discover_capabilities` is available, use it to find visible recipes and
35
+ their limitations. A catalog entry alone does not establish readiness.
36
+ - If `review_spirit_recipe` is available, review the selected recipe. Show its
37
+ purpose, profile, **effective tools**, on-demand trigger, and admission result.
38
+ Required capability IDs describe workflow features; they do not limit the
39
+ profile to only those tools. A review digest grants no permissions.
40
+ - If these tools are absent, continue with design using available evidence.
41
+ Do not invent a recipe review, host binding, installed capability, or launch.
42
+
43
+ Never infer availability from this skill's examples. Source recipes such as
44
+ `egregore/researcher` and `egregore/pm` must still pass the current host review.
45
+ Local candidates are not reviewed releases or evidence of deployment adoption.
46
+
47
+ ## 2. Reuse a recipe for authorized work
48
+
49
+ With the host tools available, the sequence is:
50
+
51
+ 1. `review_spirit_recipe({"recipe_id":"<selected ID>"})`.
52
+ 2. Present the current scope and effective permissions. Proceed if the user's
53
+ existing request authorizes the concrete task and admission is allowed.
54
+ 3. Call `delegate_work` with `recipe_id`, the returned
55
+ `expected_binding_digest`, and the user's `task`. Include
56
+ `source_message_ids` only for selected messages in the authorized direct
57
+ conversation. Do not also supply `profile` or construct a binding yourself.
58
+ 4. Report the returned job or clarification and how to inspect or cancel it.
59
+
60
+ Recipe discussion or a deferred source link is not a request to start work.
61
+ Preserve the user's original constraints, source selection, and “do not
62
+ implement” limits. On a stale review, re-review; changed permissions or scope
63
+ need to be made visible before continuing. A denied admission is not a reason
64
+ to bypass the recipe through a broader profile.
65
+
66
+ The Telegram host also supports direct commands in an authorized DM:
67
+
68
+ ```text
69
+ /summon <recipe ID> Review only
70
+ /summon <recipe ID> <task> Request one run
22
71
  ```
23
72
 
24
- Use the printed value as `{mode}`; quote it in single quotes when you use it in a command, and write any single quote inside the value as `'\''`.
25
-
26
- **Local mode** (`{mode}` is `local`): Skip ALL `bin/graph-op.sh` and `bin/notify.sh` calls — do NOT run them. Do NOT show any graph-related messaging.
73
+ The task form obtains a fresh host review and admits against that binding. It
74
+ uses the same queue, current actor grants, source clarification, and result
75
+ delivery as other spirit work. It creates no schedule. Group commands do not
76
+ expose recipe details or start recipe work.
77
+ This is an explicit command form: every trailing task is submitted as work.
78
+ Use the review-only form to inspect a recipe; use ordinary conversation to
79
+ discuss a future task or retain a link without starting a run.
27
80
 
28
- Local-mode adjustments:
29
- - **Phase 1**: Skip the graph scan. Generate options from conversation context, `memory/quests/` files, and `.spirits/` directory instead of the graph.
30
- - **Phase 5**: Skip Spirit node creation in Neo4j. Write the spec file to `.spirits/{name}.json`. **Claude Code:** create the scheduled job — this works without the graph.
31
- - **Phase 6**: Skip LoopReport creation in Neo4j. The TUI report still renders, but the graph artifact is not created.
32
- - **Managing Spirits**: Read from `.spirits/` directory instead of querying the graph. **Claude Code:** suspend/resume only deletes or creates the scheduled job, without graph updates.
81
+ If launch tools are unavailable, report that no work was started. Say a design
82
+ was saved only after actually writing it. Do not present a source file or a
83
+ model promise as an active spirit.
33
84
 
34
- ## Instructions
85
+ ## 3. Design a new reusable spirit when needed
35
86
 
36
- ### Phase 1: Intent Discovery
87
+ Resolve the consequential unknowns: purpose and source scope; actions and
88
+ boundaries; outcome evidence; budget and stop conditions; delivery; and whether
89
+ the trigger is on-demand, scheduled, or event-based. Stop questioning when
90
+ these are concrete. Reuse known capabilities instead of creating a parallel
91
+ implementation because a spirit has a new name.
37
92
 
38
- Start with one open question: ask with a structured question when available and permitted in this session; otherwise ask in plain text:
93
+ For a Pi Durable on-demand design, write `.spirits/{name}.json` using the
94
+ portable v2 shape. This example is illustrative, not an installed recipe:
39
95
 
40
- ```
41
- What should this spirit do?
42
- ```
43
-
44
- **Connected mode:** Options should be derived from current graph context — not hardcoded. Before asking, run a lightweight graph scan to understand what's happening:
45
-
46
- ```bash
47
- mkdir -p tmp
48
- ```
49
-
50
- ```bash
51
- bash bin/graph-op.sh spirit-context > tmp/summon-context.json
96
+ ```json
97
+ {
98
+ "schema": "egregore.spirit-recipe/v2",
99
+ "id": "example/researcher",
100
+ "purpose": "Investigate selected sources and retain evidence-backed findings",
101
+ "runtime": "pi-durable",
102
+ "capabilities": ["egregore/contextual-delegation", "egregore/task-outcome"],
103
+ "skills": [],
104
+ "trigger": {"kind": "on-demand"},
105
+ "outcome_contract": "egregore.task-outcome/v1",
106
+ "budget_policy_ref": "local/bounded-work",
107
+ "binding_ref": "local/researcher",
108
+ "delivery": {"kind": "request-origin"}
109
+ }
52
110
  ```
53
111
 
54
- Read the active quests, recent sessions, and spirit health signals:
112
+ Keep this schema exact. No credentials, actor grants, machine paths, current
113
+ status, or ad hoc scheduler fields belong in it. References still need a host
114
+ binding; saving this file does not install it into the host's selected catalog.
115
+ Review the design with the user. Continue authorized preparation without an
116
+ extra permission round; resolve any new consequential choice before acting.
55
117
 
56
- ```bash
57
- jq '.values[0][0] // {}' tmp/summon-context.json
58
- ```
59
-
60
- Use the printed results as `{context}` for the options below.
118
+ Existing `version: 1` designs remain readable as **legacy-unknown**. They do not
119
+ prove grants, outcome acceptance, generation binding, or current activity.
120
+ Preserve them and their history; draft a migration separately rather than
121
+ silently converting or starting them.
61
122
 
62
- Use this context to generate options that are relevant — e.g. if there are dormant quests, offer "reconcile dormant work"; if there's a PR-heavy period, offer "watch PRs". Always include a free-text option.
123
+ ## 4. Scheduled and condition-triggered spirits
63
124
 
64
- **Local mode:** Skip the graph scan. Instead, derive options from:
65
- - Active quests in `memory/quests/` (parse frontmatter for status)
66
- - Recent handoffs in `memory/handoffs/index.md`
67
- - Existing spirits in `.spirits/` directory
68
- - Conversation context
69
- Always include a free-text option.
125
+ Pi Durable's current recipe admission supports on-demand work. Scheduling is a
126
+ separate host capability. Use a native scheduler only when it is actually
127
+ available and authorized in the session. Otherwise save a design describing
128
+ the trigger, observed sources, action, budget, stop conditions, and delivery,
129
+ and explicitly report that no schedule was created.
70
130
 
71
- The agent has full discretion to decide what context is relevant given the user's stated intent.
131
+ Keep a scheduled design separate from the strict on-demand v2 JSON. For a
132
+ watcher, define an observable condition and its source; do not assume a
133
+ relationship query or introduce polling without explaining the cadence.
72
134
 
73
- ### Phase 2: Adaptive Convergence
135
+ When creating a schedule, retain the real scheduler ID, scope, trigger,
136
+ expiry/restart behavior, and cancellation instructions returned by that host.
137
+ Verify actual registration before saying it is running. Suspend/resume through
138
+ the scheduler and report its receipt; editing a status field is insufficient.
74
139
 
75
- Ask questions iteratively with a structured question when available and permitted in this session; otherwise ask in plain text. Each round is informed by previous answers AND graph context. The questioning is non-linear — the agent decides what to ask based on where the interesting tension is, not a fixed script.
140
+ ## 5. Observe outcomes and accumulate improvements
76
141
 
77
- **Dimensions to explore** (not necessarily in order — the agent picks what matters):
142
+ Distinguish execution state, the spirit's outcome claim, verified acceptance,
143
+ and delivery. A completed model run is not proof the task was fulfilled.
144
+ Report evidence and unresolved requirements; ask a bounded question when a
145
+ source or decision is missing. Do not require a speculative insight every run.
78
146
 
79
- - **Scope**: What exactly does the spirit observe? What can it act on? What's off-limits?
80
- - **Cadence**: How often? Time-driven (cron) or condition-driven (watchdog)? Or both?
81
- - **Boundaries**: What should it never do? What requires human approval vs auto-action?
82
- - **Reporting**: What does the user want to see? Metrics? Narrative? Diffs? Alerts only?
83
- - **Failure modes**: What happens when the spirit finds something it can't handle?
84
- - **Evolution**: Should the spirit's behavior change as it learns? How?
147
+ Use owned work history where exposed and Runtime retrieval for canonical
148
+ records. Local history does not require Connected services. Metadata-only
149
+ records are not transcripts or proof of subjective experience. Recording,
150
+ publication, and outgoing notifications each follow their own current policy;
151
+ this workflow does not enable them implicitly. Agent-authored external
152
+ notifications follow `.claude/context/notification-consent.md`.
85
153
 
86
- **Convergence signal**: When the user's answers start narrowing to specifics (concrete conditions, specific quests, named thresholds), propose the spec. Don't ask more than 6 rounds unless the user is actively expanding scope.
154
+ When a run reveals a reusable improvement, retain a candidate with source
155
+ evidence, its limitation, and a proposed evaluation. Reuse the existing
156
+ library/contribution tools if available. Keep observation, proposed change,
157
+ tested capability, release, and receiving-host adoption distinct. A success
158
+ claim alone must not update other spirits or grant new permissions.
87
159
 
88
- **For watchdog spirits** (event-driven):
89
- - Define the condition to watch for (as a Cypher query or graph pattern)
90
- - Define the action on trigger (notify, auto-fix, flag, escalate)
91
- - Cadence is polling interval (cron-based for now, hookable later)
160
+ ## Managing existing spirits
92
161
 
93
- ### Phase 3: Spec Generation
162
+ Show designs from `.spirits/`, admitted work from the host's owned job surface,
163
+ and active schedules from the scheduler. Label missing or stale evidence.
164
+ Use actual job or scheduler handles for inspect/cancel/resume actions.
165
+ Do not claim a design is active from its file name or a legacy status field.
94
166
 
95
- Produce a spirit spec as JSON. Write to `.spirits/{name}.json`:
96
-
97
- ```json
98
- {
99
- "name": "memory-gardener",
100
- "type": "recurring",
101
- "purpose": "Maintain the optional relationship index — fix structural issues, infer new relationships, report drift",
102
- "cadence": "0 3 * * *",
103
- "cadence_human": "Daily at 3:03 AM",
104
- "scope": {
105
- "reads": ["Quest", "Artifact", "Session", "Person"],
106
- "writes": ["Artifact", "Quest"],
107
- "relationships": ["PART_OF", "RELATES_TO", "BUILDS_ON"],
108
- "off_limits": ["Person deletion", "Quest deletion"]
109
- },
110
- "actions": {
111
- "auto": ["resolve stale handoffs", "migrate date types", "mark dormant quests", "link artifacts by topic"],
112
- "suggest": ["merge duplicate persons", "link disconnected artifacts"],
113
- "flag": ["ghost artifacts", "orphaned sessions"]
114
- },
115
- "reporting": {
116
- "tui": true,
117
- "graph_artifact": true,
118
- "notify": false
119
- },
120
- "watchdog": null,
121
- "created_by": "cem",
122
- "created_at": "2026-03-09T10:00:00Z",
123
- "version": 1
124
- }
125
- ```
126
-
127
- For watchdog spirits, the `watchdog` field contains:
128
-
129
- ```json
130
- {
131
- "condition": "MATCH (s:Session) WHERE s.date > date() - duration('P1D') AND s.handoffStatus = 'pending' RETURN count(s) > 3",
132
- "action": "notify",
133
- "message_template": "{{count}} handoffs piling up — someone should triage"
134
- }
135
- ```
136
-
137
- ### Phase 4: Review
138
-
139
- Present the spec as a TUI box:
140
-
141
- ```
142
- ┌ Spirit: memory-gardener ───────────────────────────┐
143
- │ │
144
- │ Purpose: Maintain the relationship index │
145
- │ Type: Recurring │
146
- │ Cadence: Daily at 3:03 AM │
147
- │ │
148
- │ Auto-fix: stale handoffs, date types, │
149
- │ dormant quests, topic links │
150
- │ Suggest: duplicate persons, disconnected arts │
151
- │ Flag: ghosts, orphans │
152
- │ │
153
- │ Reporting: TUI + saved report each cycle │
154
- │ Boundaries: No person/quest deletion │
155
- │ │
156
- └────────────────────────────────────────────────────┘
157
- ```
158
-
159
- Ask: "Launch this spirit?" with options: Launch, Edit (back to questioning), Cancel.
160
-
161
- ### Phase 5: Launch
162
-
163
- Use scheduling only when available and permitted in this session;
164
- otherwise write the spec file `.spirits/{name}.json`, report that no job was
165
- scheduled, and stop before the remaining launch steps.
166
- **Claude Code:** use the native session scheduler for the scheduling steps
167
- below.
168
-
169
- 1. **Write spec file**: `.spirits/{name}.json`
170
- 2. **Create Spirit node in graph** — **CONNECTED MODE ONLY**:
171
- **Skip this step in local mode.** Use the spec fields with the named operation:
172
- ```bash
173
- bash bin/graph-op.sh spirit-create --name '{name}' --type '{type}' --purpose '{purpose}' --cadence '{cadence}' --status 'active' --author '{author}'
174
- ```
175
- 3. **Create the scheduled job**:
176
- - Prompt is the spirit's execution prompt (constructed from spec)
177
- - For recurring: standard cron
178
- - For watchdog: polling cron + condition check prefix
179
- 4. **Confirm**: Show job ID and how to cancel. **Claude Code:** include the 3-day auto-expiry note.
180
-
181
- ### Phase 6: Cycle Reporting (attached to each execution)
182
-
183
- When a spirit runs (via `/loop` invoking its prompt), each cycle MUST:
184
-
185
- 1. **Run the work** defined in the spec
186
- 2. **Produce TUI report**:
187
- ```
188
- ┌ memory-gardener · Cycle 4 · 2026-03-09 ─────────┐
189
- │ │
190
- │ ✦ Fixed: 3 stale handoffs resolved │
191
- │ ✦ Fixed: 12 date types migrated │
192
- │ ◇ Inferred: 8 new RELATES_TO edges │
193
- │ ⚠ Flagged: 2 ghost artifacts │
194
- │ │
195
- │ Health: 412 nodes · 891 edges · 1.2% orphan │
196
- │ Delta: +15 edges since last cycle │
197
- │ Drift: dormant quest count stable (26) │
198
- │ │
199
- │ Insight: "3 artifacts about 'governance' appeared│
200
- │ this week but aren't linked to any quest — │
201
- │ emerging theme?" │
202
- │ │
203
- └───────────────────────────────────────────────────┘
204
- ```
205
-
206
- 3. **Write LoopReport to graph** — **CONNECTED MODE ONLY**:
207
- **Skip this step in local mode.** The named update records this cycle's report; the TUI report still renders locally.
208
- ```bash
209
- bash bin/graph-op.sh spirit-update --name '{name}' --id '{id}' --title '{title}' --metrics '{metrics}'
210
- ```
211
-
212
- 4. **Insights**: The report should include one model-generated insight per cycle — a pattern, question, or observation that emerges from the data but wasn't explicitly programmed. This is the inferential layer growing.
213
-
214
- ### Telemetry
167
+ Emit the standard command telemetry when the project adapter is available:
215
168
 
216
169
  ```bash
217
170
  bash bin/telemetry.sh emit "command" '{"command":"summon"}' 2>/dev/null &
218
171
  ```
219
-
220
- ## Managing Spirits
221
-
222
- **Connected mode:**
223
- - **List active**: `bash bin/graph-op.sh spirit-list`
224
- - **Suspend**: Set `sp.status = 'suspended'` and delete the scheduled job
225
- - **Resume**: Set `sp.status = 'active'` and create the scheduled job
226
- - **View history**: `MATCH (lr:Artifact {origin: 'spirit'})-[:GENERATED_BY]->(sp:Spirit {name: $name}) RETURN lr ORDER BY lr.created DESC`
227
-
228
- **Local mode:**
229
- - **List active**: Read `.spirits/*.json` files, filter by `"status": "active"`. Display name, type, cadence from each spec file.
230
- - **Suspend**: Update spec file `"status": "suspended"` and delete the scheduled job
231
- - **Resume**: Update spec file `"status": "active"` and create the scheduled job
232
- - **View history**: Not available in local mode (no graph artifact storage). Show: `Spirit history requires connected mode.`
233
-
234
- ## Design Principles
235
-
236
- 1. **Bitter lesson**: The agent decides what context is relevant, not a fixed query set. More compute, less hand-engineering.
237
- 2. **Adaptive convergence**: Questions stop when the spec is clear, not after N rounds.
238
- 3. **Specs are forkable**: `.spirits/` is git-tracked. Fork the egregore, inherit its spirits.
239
- 4. **Spirits compound**: Each cycle's LoopReport feeds future cycles. The spirit gets smarter about what to surface.
240
- 5. **Watchdogs are deferred hooks**: Poll-on-cron now, proper event-driven hooks when infrastructure exists.
@@ -10,7 +10,7 @@ description: "TUI Design System for Egregore slash commands. Use when designing
10
10
  This skill governs TERMINAL RENDERING — structural, not tonal.
11
11
  Shared aesthetic: voice-bedrock (`.claude/rules/voice-bedrock.md`).
12
12
  For product voice in command output prose: `product-voice` skill.
13
- For browser visual output: `dark-mode` skill.
13
+ For browser visual output: `dark-mode` skill, which takes every color from the design system registry (`packages/design-system/themes/registry.json`).
14
14
  For ASCII diagrams in explanations: `visual-explain` skill.
15
15
 
16
16
  ## When to invoke
@@ -195,7 +195,7 @@ fi
195
195
 
196
196
  **Framework paths synced:** `bin/`, `egregore_runtime/`, `.claude/commands/`, `.claude/skills/`, `.claude/hooks/`, `.claude/context/`, `.claude/agents/`, `.pi/`, `.prime/`, `loom/`, `CLAUDE.md`, `skills/`
197
197
  **Regenerated:** `AGENTS.md` + `.codex/spec-manifest.json` via `bin/codex-render-spec.mjs`, `.pi/APPEND_SYSTEM.md` + `.pi/spec-manifest.json` via `bin/pi-render-spec.mjs`, `.prime/agent/APPEND_SYSTEM.md` + `.prime/agent/spec-manifest.json` via `bin/prime-render-spec.mjs`, then generated Codex adapter skills via `bin/codex-sync-skills.sh`, so all derived harnesses stay aligned with `CLAUDE.md` and the canonical skills.
198
- **Never touched:** `egregore.json`, `.env`, `memory/`, `.egregore-state.json`, `.mcp.json`
198
+ **Never touched:** `egregore.json`, `.env`, `memory/`, `.egregore-state.json`, `.mcp.json` — except one migration: `bin/post-update.sh` rewrites a Connected `api_url` that still names the hosted API's retired October 2026 origin, and stages only that change for the update commit. It replaces only the address text, byte for byte, and keeps the file's mode and line endings. It leaves the file as is, with a warning, when it is a link, missing, unreadable, set aside by a sparse checkout, or Local in either the committed or the working copy, or when its `api_url` is escaped or repeated.
199
199
  **Org-owned skills:** names in `egregore.json` → `owned_skills[]` are restored from the org's committed state after the overlay (`bin/restore-owned-skills.sh`) — upstream never overwrites them; collisions are reported instead.
200
200
 
201
201
  ## Step 3: Post-update migrations