create-egregore 0.21.0-runtime-mvp.28 → 0.21.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 (610) hide show
  1. package/assets/egregore-launcher.js +170 -80
  2. package/lib/api.js +2 -2
  3. package/lib/claude-runtime.js +25 -46
  4. package/lib/codex-runtime.js +6 -1
  5. package/lib/local.js +37 -95
  6. package/lib/pi-runtime.js +6 -1
  7. package/lib/prime-runtime.js +6 -1
  8. package/lib/runtime-git-excludes.js +95 -0
  9. package/lib/setup.js +86 -63
  10. package/lib/ui.js +91 -64
  11. package/package.json +3 -3
  12. package/runtime/claude/.claude/context/retrieval-investigation.md +7 -0
  13. package/runtime/claude/.claude/context/telemetry.md +2 -1
  14. package/runtime/claude/.claude/hooks/retrieval-context.sh +1 -1
  15. package/runtime/claude/.claude/hooks/search-hint.sh +11 -0
  16. package/runtime/claude/.claude/rules/voice-bedrock.md +9 -0
  17. package/runtime/claude/.claude/settings.json +9 -0
  18. package/runtime/claude/.claude/skills/announce/SKILL.md +33 -12
  19. package/runtime/claude/.claude/skills/archive/SKILL.md +7 -6
  20. package/runtime/claude/.claude/skills/branch/SKILL.md +16 -13
  21. package/runtime/claude/.claude/skills/checkup/SKILL.md +8 -11
  22. package/runtime/claude/.claude/skills/contribute/SKILL.md +108 -62
  23. package/runtime/claude/.claude/skills/create-skill/SKILL.md +14 -5
  24. package/runtime/claude/.claude/skills/dashboard/SKILL.md +3 -3
  25. package/runtime/claude/.claude/skills/deep-reflect/REPORT.md +6 -6
  26. package/runtime/claude/.claude/skills/deep-reflect/ROLES.md +2 -2
  27. package/runtime/claude/.claude/skills/deep-reflect/SKILL.md +26 -15
  28. package/runtime/claude/.claude/skills/delete-user/SKILL.md +39 -44
  29. package/runtime/claude/.claude/skills/emissary/SKILL.md +36 -26
  30. package/runtime/claude/.claude/skills/env/SKILL.md +161 -0
  31. package/runtime/claude/.claude/skills/handoff/SKILL.md +16 -6
  32. package/runtime/claude/.claude/skills/harvest/AUDIT.md +4 -4
  33. package/runtime/claude/.claude/skills/harvest/PROCESS.md +7 -6
  34. package/runtime/claude/.claude/skills/harvest/SKILL.md +8 -6
  35. package/runtime/claude/.claude/skills/ingest/SKILL.md +25 -11
  36. package/runtime/claude/.claude/skills/ingest-corpus/SKILL.md +9 -7
  37. package/runtime/claude/.claude/skills/ingest-user-interview/SKILL.md +6 -3
  38. package/runtime/claude/.claude/skills/invite/SKILL.md +36 -5
  39. package/runtime/claude/.claude/skills/issue/SKILL.md +179 -27
  40. package/runtime/claude/.claude/skills/me/SKILL.md +2 -2
  41. package/runtime/claude/.claude/skills/meeting/SKILL.md +16 -4
  42. package/runtime/claude/.claude/skills/note/SKILL.md +6 -4
  43. package/runtime/claude/.claude/skills/notion-connect/SKILL.md +2 -2
  44. package/runtime/claude/.claude/skills/onboarding/SKILL.md +23 -5
  45. package/runtime/claude/.claude/skills/reflect/SKILL.md +9 -7
  46. package/runtime/claude/.claude/skills/review-pr/SKILL.md +27 -18
  47. package/runtime/claude/.claude/skills/save/SKILL.md +36 -6
  48. package/runtime/claude/.claude/skills/slack-connect/SKILL.md +63 -16
  49. package/runtime/claude/.claude/skills/summon/SKILL.md +44 -44
  50. package/runtime/claude/.claude/skills/sync-repos/SKILL.md +37 -14
  51. package/runtime/claude/.claude/skills/teams-connect/SKILL.md +82 -28
  52. package/runtime/claude/.claude/skills/telegram-connect/SKILL.md +20 -3
  53. package/runtime/claude/.claude/skills/telemetry/SKILL.md +3 -1
  54. package/runtime/claude/.claude/skills/test/SKILL.md +1 -1
  55. package/runtime/claude/.claude/skills/tui-design/SKILL.md +4 -4
  56. package/runtime/claude/.claude/skills/tutorial/SKILL.md +6 -5
  57. package/runtime/claude/.claude/skills/update/SKILL.md +115 -67
  58. package/runtime/claude/.claude/skills/view/SKILL.md +16 -9
  59. package/runtime/claude/.claude/skills/visual-explain/SKILL.md +1 -1
  60. package/runtime/claude/.claude/skills/wrap/SKILL.md +11 -6
  61. package/runtime/claude/CLAUDE.md +27 -15
  62. package/runtime/claude/bin/activity-action.sh +1 -1
  63. package/runtime/claude/bin/activity-data.sh +1 -1
  64. package/runtime/claude/bin/agent.sh +78 -27
  65. package/runtime/claude/bin/api-call.sh +181 -0
  66. package/runtime/claude/bin/artifact-register.sh +62 -6
  67. package/runtime/claude/bin/artifact-writeback.sh +28 -3
  68. package/runtime/claude/bin/artifacts.sh +1 -1
  69. package/runtime/claude/bin/attendant.sh +1 -1
  70. package/runtime/claude/bin/codex-render-spec.mjs +14 -10
  71. package/runtime/claude/bin/codex-session-start.sh +7 -1
  72. package/runtime/claude/bin/codex-skill-render.mjs +15 -6
  73. package/runtime/claude/bin/codex-sync-skills.sh +6 -2
  74. package/runtime/claude/bin/config-get.sh +65 -0
  75. package/runtime/claude/bin/contribute-guard.sh +70 -0
  76. package/runtime/claude/bin/dashboard-data.sh +1 -1
  77. package/runtime/claude/bin/gh-run.sh +25 -0
  78. package/runtime/claude/bin/graph-op.sh +230 -3
  79. package/runtime/claude/bin/graph-projection.sh +1 -1
  80. package/runtime/claude/bin/graph-wal.sh +2 -2
  81. package/runtime/claude/bin/graph.sh +1 -1
  82. package/runtime/claude/bin/handoff-lifecycle.sh +2 -2
  83. package/runtime/claude/bin/handoff-preview.sh +7 -3
  84. package/runtime/claude/bin/handoff-run.sh +1 -1
  85. package/runtime/claude/bin/hosting-ops.sh +248 -0
  86. package/runtime/claude/bin/index-handoff.sh +3 -3
  87. package/runtime/claude/bin/ingest-item.sh +1 -1
  88. package/runtime/claude/bin/ingest.sh +3 -3
  89. package/runtime/claude/bin/invite.sh +1 -0
  90. package/runtime/claude/bin/issue.sh +1 -1
  91. package/runtime/claude/bin/knowledge.sh +1 -1
  92. package/runtime/claude/bin/lib/config.sh +4 -8
  93. package/runtime/claude/bin/lib/dashboard-artifact.sh +1 -1
  94. package/runtime/claude/bin/lib/framework-update.sh +41 -0
  95. package/runtime/claude/bin/lib/git-sync.sh +18 -11
  96. package/runtime/claude/bin/lib/greeting.sh +4 -1
  97. package/runtime/claude/bin/lib/health-footer.sh +1 -1
  98. package/runtime/claude/bin/lib/hosted-ref-id.sh +108 -0
  99. package/runtime/claude/bin/lib/runtime-owned.sh +52 -16
  100. package/runtime/claude/bin/lib/scratch.sh +26 -0
  101. package/runtime/claude/bin/lib/secret_entry.py +1013 -0
  102. package/runtime/claude/bin/notification.sh +1 -1
  103. package/runtime/claude/bin/notify.sh +134 -14
  104. package/runtime/claude/bin/observe-context.sh +1 -1
  105. package/runtime/claude/bin/onboarding.sh +1 -0
  106. package/runtime/claude/bin/person.sh +9 -4
  107. package/runtime/claude/bin/prose-rules/harness-tool-names.md +36 -0
  108. package/runtime/claude/bin/publish-artifact.sh +52 -4
  109. package/runtime/claude/bin/publish-references.sh +27 -8
  110. package/runtime/claude/bin/qa-gate.sh +205 -0
  111. package/runtime/claude/bin/quest.sh +1 -1
  112. package/runtime/claude/bin/question.sh +1 -1
  113. package/runtime/claude/bin/research-ingest.sh +1 -1
  114. package/runtime/claude/bin/runtime-identity.sh +3 -3
  115. package/runtime/claude/bin/runtime-upgrade.sh +5 -3
  116. package/runtime/claude/bin/scratch-sweep.sh +29 -0
  117. package/runtime/claude/bin/scroll.sh +1 -1
  118. package/runtime/claude/bin/search.sh +7 -7
  119. package/runtime/claude/bin/secret-entry.py +6 -0
  120. package/runtime/claude/bin/session-autosave.sh +1 -1
  121. package/runtime/claude/bin/session-log.sh +7 -2
  122. package/runtime/claude/bin/session-start.sh +3 -1
  123. package/runtime/claude/bin/settings.sh +1 -1
  124. package/runtime/claude/bin/test-baseline.sh +188 -44
  125. package/runtime/claude/bin/thread.sh +1 -1
  126. package/runtime/claude/bin/todo.sh +1 -1
  127. package/runtime/claude/bin/update-framework.sh +24 -0
  128. package/runtime/claude/bin/view-render.sh +21 -1
  129. package/runtime/claude/bin/worktree.sh +1 -1
  130. package/runtime/claude/docs/credential-entry.md +286 -0
  131. package/runtime/claude/egregore_runtime/artifacts.py +122 -19
  132. package/runtime/claude/egregore_runtime/contracts.py +18 -0
  133. package/runtime/claude/egregore_runtime/github_issues.py +89 -1
  134. package/runtime/claude/egregore_runtime/graph.py +15 -6
  135. package/runtime/claude/egregore_runtime/harness_cli.py +82 -12
  136. package/runtime/claude/egregore_runtime/identity.py +108 -8
  137. package/runtime/claude/egregore_runtime/identity_transfer.py +288 -0
  138. package/runtime/claude/egregore_runtime/ingest_cli.py +4 -6
  139. package/runtime/claude/egregore_runtime/investigation_guidance.py +8 -1
  140. package/runtime/claude/egregore_runtime/issue_cli.py +32 -1
  141. package/runtime/claude/egregore_runtime/issue_duplicates.py +116 -0
  142. package/runtime/claude/egregore_runtime/issue_readiness.py +231 -0
  143. package/runtime/claude/egregore_runtime/issue_triage.py +331 -0
  144. package/runtime/claude/egregore_runtime/issue_triage_service.py +124 -0
  145. package/runtime/claude/egregore_runtime/knowledge_cli.py +4 -3
  146. package/runtime/claude/egregore_runtime/notification_cli.py +66 -8
  147. package/runtime/claude/egregore_runtime/questions.py +1 -0
  148. package/runtime/claude/egregore_runtime/research_ingest_cli.py +4 -4
  149. package/runtime/claude/egregore_runtime/runtime.py +23 -2
  150. package/runtime/claude/egregore_runtime/scratch.py +294 -0
  151. package/runtime/claude/egregore_runtime/scroll_cli.py +7 -7
  152. package/runtime/claude/egregore_runtime/sync.py +21 -6
  153. package/runtime/claude/egregore_runtime/thread_cli.py +4 -4
  154. package/runtime/claude/egregore_runtime/threads.py +1 -0
  155. package/runtime/claude/egregore_runtime/upgrade.py +771 -34
  156. package/runtime/claude/egregore_runtime/writeback.py +146 -8
  157. package/runtime/claude/egregore_runtime/writeback_cli.py +89 -17
  158. package/runtime/claude/manifest.json +24 -1
  159. package/runtime/codex/.claude/context/retrieval-investigation.md +7 -0
  160. package/runtime/codex/.codex/config.toml +1 -2
  161. package/runtime/codex/.codex/skills/activity/SKILL.md +45 -39
  162. package/runtime/codex/.codex/skills/announce/SKILL.md +25 -47
  163. package/runtime/codex/.codex/skills/archive/SKILL.md +45 -33
  164. package/runtime/codex/.codex/skills/branch/SKILL.md +2 -2
  165. package/runtime/codex/.codex/skills/checkup/SKILL.md +39 -83
  166. package/runtime/codex/.codex/skills/commit/SKILL.md +2 -2
  167. package/runtime/codex/.codex/skills/contribute/SKILL.md +2 -2
  168. package/runtime/codex/.codex/skills/create-skill/SKILL.md +2 -2
  169. package/runtime/codex/.codex/skills/dark-mode/SKILL.md +2 -2
  170. package/runtime/codex/.codex/skills/dashboard/SKILL.md +45 -29
  171. package/runtime/codex/.codex/skills/deep-reflect/SKILL.md +45 -113
  172. package/runtime/codex/.codex/skills/delete-user/SKILL.md +2 -2
  173. package/runtime/codex/.codex/skills/emissary/SKILL.md +6 -2
  174. package/runtime/codex/.codex/skills/env/SKILL.md +29 -0
  175. package/runtime/codex/.codex/skills/handoff/SKILL.md +45 -131
  176. package/runtime/codex/.codex/skills/harvest/SKILL.md +45 -50
  177. package/runtime/codex/.codex/skills/ingest/SKILL.md +25 -51
  178. package/runtime/codex/.codex/skills/ingest-corpus/SKILL.md +2 -2
  179. package/runtime/codex/.codex/skills/ingest-notion/SKILL.md +2 -2
  180. package/runtime/codex/.codex/skills/ingest-user-interview/SKILL.md +45 -30
  181. package/runtime/codex/.codex/skills/invite/SKILL.md +25 -33
  182. package/runtime/codex/.codex/skills/issue/SKILL.md +45 -162
  183. package/runtime/codex/.codex/skills/me/SKILL.md +2 -2
  184. package/runtime/codex/.codex/skills/meeting/SKILL.md +45 -29
  185. package/runtime/codex/.codex/skills/note/SKILL.md +25 -37
  186. package/runtime/codex/.codex/skills/notion-connect/SKILL.md +2 -2
  187. package/runtime/codex/.codex/skills/onboarding/SKILL.md +45 -43
  188. package/runtime/codex/.codex/skills/pr/SKILL.md +2 -2
  189. package/runtime/codex/.codex/skills/pull/SKILL.md +2 -2
  190. package/runtime/codex/.codex/skills/push/SKILL.md +2 -2
  191. package/runtime/codex/.codex/skills/quest/SKILL.md +45 -44
  192. package/runtime/codex/.codex/skills/reflect/SKILL.md +45 -35
  193. package/runtime/codex/.codex/skills/review-pr/SKILL.md +6 -2
  194. package/runtime/codex/.codex/skills/save/SKILL.md +25 -137
  195. package/runtime/codex/.codex/skills/slack-connect/SKILL.md +2 -2
  196. package/runtime/codex/.codex/skills/summon/SKILL.md +6 -2
  197. package/runtime/codex/.codex/skills/sync-repos/SKILL.md +2 -2
  198. package/runtime/codex/.codex/skills/teams-connect/SKILL.md +2 -2
  199. package/runtime/codex/.codex/skills/telegram-connect/SKILL.md +2 -2
  200. package/runtime/codex/.codex/skills/telemetry/SKILL.md +2 -2
  201. package/runtime/codex/.codex/skills/test/SKILL.md +7 -3
  202. package/runtime/codex/.codex/skills/the-spiral/SKILL.md +25 -89
  203. package/runtime/codex/.codex/skills/tui-design/SKILL.md +6 -2
  204. package/runtime/codex/.codex/skills/tutorial/SKILL.md +45 -48
  205. package/runtime/codex/.codex/skills/update/SKILL.md +2 -2
  206. package/runtime/codex/.codex/skills/view/SKILL.md +39 -158
  207. package/runtime/codex/.codex/skills/visual-explain/SKILL.md +6 -2
  208. package/runtime/codex/.codex/skills/wrap/SKILL.md +45 -66
  209. package/runtime/codex/.codex/spec-manifest.json +10 -10
  210. package/runtime/codex/AGENTS.md +29 -18
  211. package/runtime/codex/bin/activity-action.sh +1 -1
  212. package/runtime/codex/bin/activity-data.sh +1 -1
  213. package/runtime/codex/bin/agent.sh +78 -27
  214. package/runtime/codex/bin/api-call.sh +181 -0
  215. package/runtime/codex/bin/artifact-register.sh +62 -6
  216. package/runtime/codex/bin/artifact-writeback.sh +28 -3
  217. package/runtime/codex/bin/artifacts.sh +1 -1
  218. package/runtime/codex/bin/attendant.sh +1 -1
  219. package/runtime/codex/bin/codex-render-spec.mjs +14 -10
  220. package/runtime/codex/bin/codex-session-start.sh +7 -1
  221. package/runtime/codex/bin/codex-skill-render.mjs +15 -6
  222. package/runtime/codex/bin/codex-sync-skills.sh +6 -2
  223. package/runtime/codex/bin/config-get.sh +65 -0
  224. package/runtime/codex/bin/contribute-guard.sh +70 -0
  225. package/runtime/codex/bin/dashboard-data.sh +1 -1
  226. package/runtime/codex/bin/gh-run.sh +25 -0
  227. package/runtime/codex/bin/graph-op.sh +230 -3
  228. package/runtime/codex/bin/graph-projection.sh +1 -1
  229. package/runtime/codex/bin/graph-wal.sh +2 -2
  230. package/runtime/codex/bin/graph.sh +1 -1
  231. package/runtime/codex/bin/handoff-lifecycle.sh +2 -2
  232. package/runtime/codex/bin/handoff-preview.sh +7 -3
  233. package/runtime/codex/bin/handoff-run.sh +1 -1
  234. package/runtime/codex/bin/hosting-ops.sh +248 -0
  235. package/runtime/codex/bin/index-handoff.sh +3 -3
  236. package/runtime/codex/bin/ingest-item.sh +1 -1
  237. package/runtime/codex/bin/ingest.sh +3 -3
  238. package/runtime/codex/bin/invite.sh +1 -0
  239. package/runtime/codex/bin/issue.sh +1 -1
  240. package/runtime/codex/bin/knowledge.sh +1 -1
  241. package/runtime/codex/bin/lib/config.sh +4 -8
  242. package/runtime/codex/bin/lib/dashboard-artifact.sh +1 -1
  243. package/runtime/codex/bin/lib/framework-update.sh +41 -0
  244. package/runtime/codex/bin/lib/git-sync.sh +18 -11
  245. package/runtime/codex/bin/lib/greeting.sh +4 -1
  246. package/runtime/codex/bin/lib/health-footer.sh +1 -1
  247. package/runtime/codex/bin/lib/hosted-ref-id.sh +108 -0
  248. package/runtime/codex/bin/lib/runtime-owned.sh +52 -16
  249. package/runtime/codex/bin/lib/scratch.sh +26 -0
  250. package/runtime/codex/bin/lib/secret_entry.py +1013 -0
  251. package/runtime/codex/bin/notification.sh +1 -1
  252. package/runtime/codex/bin/notify.sh +134 -14
  253. package/runtime/codex/bin/observe-context.sh +1 -1
  254. package/runtime/codex/bin/onboarding.sh +1 -0
  255. package/runtime/codex/bin/person.sh +9 -4
  256. package/runtime/codex/bin/prose-rules/harness-tool-names.md +36 -0
  257. package/runtime/codex/bin/publish-artifact.sh +52 -4
  258. package/runtime/codex/bin/publish-references.sh +27 -8
  259. package/runtime/codex/bin/qa-gate.sh +205 -0
  260. package/runtime/codex/bin/quest.sh +1 -1
  261. package/runtime/codex/bin/question.sh +1 -1
  262. package/runtime/codex/bin/research-ingest.sh +1 -1
  263. package/runtime/codex/bin/runtime-identity.sh +3 -3
  264. package/runtime/codex/bin/runtime-upgrade.sh +5 -3
  265. package/runtime/codex/bin/scratch-sweep.sh +29 -0
  266. package/runtime/codex/bin/scroll.sh +1 -1
  267. package/runtime/codex/bin/search.sh +7 -7
  268. package/runtime/codex/bin/secret-entry.py +6 -0
  269. package/runtime/codex/bin/session-autosave.sh +1 -1
  270. package/runtime/codex/bin/session-log.sh +7 -2
  271. package/runtime/codex/bin/settings.sh +1 -1
  272. package/runtime/codex/bin/test-baseline.sh +188 -44
  273. package/runtime/codex/bin/thread.sh +1 -1
  274. package/runtime/codex/bin/todo.sh +1 -1
  275. package/runtime/codex/bin/update-framework.sh +24 -0
  276. package/runtime/codex/bin/view-render.sh +21 -1
  277. package/runtime/codex/bin/worktree.sh +1 -1
  278. package/runtime/codex/docs/credential-entry.md +286 -0
  279. package/runtime/codex/egregore_runtime/artifacts.py +122 -19
  280. package/runtime/codex/egregore_runtime/contracts.py +18 -0
  281. package/runtime/codex/egregore_runtime/github_issues.py +89 -1
  282. package/runtime/codex/egregore_runtime/graph.py +15 -6
  283. package/runtime/codex/egregore_runtime/harness_cli.py +82 -12
  284. package/runtime/codex/egregore_runtime/identity.py +108 -8
  285. package/runtime/codex/egregore_runtime/identity_transfer.py +288 -0
  286. package/runtime/codex/egregore_runtime/ingest_cli.py +4 -6
  287. package/runtime/codex/egregore_runtime/investigation_guidance.py +8 -1
  288. package/runtime/codex/egregore_runtime/issue_cli.py +32 -1
  289. package/runtime/codex/egregore_runtime/issue_duplicates.py +116 -0
  290. package/runtime/codex/egregore_runtime/issue_readiness.py +231 -0
  291. package/runtime/codex/egregore_runtime/issue_triage.py +331 -0
  292. package/runtime/codex/egregore_runtime/issue_triage_service.py +124 -0
  293. package/runtime/codex/egregore_runtime/knowledge_cli.py +4 -3
  294. package/runtime/codex/egregore_runtime/notification_cli.py +66 -8
  295. package/runtime/codex/egregore_runtime/questions.py +1 -0
  296. package/runtime/codex/egregore_runtime/research_ingest_cli.py +4 -4
  297. package/runtime/codex/egregore_runtime/runtime.py +23 -2
  298. package/runtime/codex/egregore_runtime/scratch.py +294 -0
  299. package/runtime/codex/egregore_runtime/scroll_cli.py +7 -7
  300. package/runtime/codex/egregore_runtime/sync.py +21 -6
  301. package/runtime/codex/egregore_runtime/thread_cli.py +4 -4
  302. package/runtime/codex/egregore_runtime/threads.py +1 -0
  303. package/runtime/codex/egregore_runtime/upgrade.py +771 -34
  304. package/runtime/codex/egregore_runtime/writeback.py +146 -8
  305. package/runtime/codex/egregore_runtime/writeback_cli.py +89 -17
  306. package/runtime/codex/manifest.json +23 -1
  307. package/runtime/pi/.claude/context/retrieval-investigation.md +7 -0
  308. package/runtime/pi/.codex/config.toml +1 -2
  309. package/runtime/pi/.codex/skills/activity/SKILL.md +45 -39
  310. package/runtime/pi/.codex/skills/announce/SKILL.md +25 -47
  311. package/runtime/pi/.codex/skills/archive/SKILL.md +45 -33
  312. package/runtime/pi/.codex/skills/branch/SKILL.md +2 -2
  313. package/runtime/pi/.codex/skills/checkup/SKILL.md +39 -83
  314. package/runtime/pi/.codex/skills/commit/SKILL.md +2 -2
  315. package/runtime/pi/.codex/skills/contribute/SKILL.md +2 -2
  316. package/runtime/pi/.codex/skills/create-skill/SKILL.md +2 -2
  317. package/runtime/pi/.codex/skills/dark-mode/SKILL.md +2 -2
  318. package/runtime/pi/.codex/skills/dashboard/SKILL.md +45 -29
  319. package/runtime/pi/.codex/skills/deep-reflect/SKILL.md +45 -113
  320. package/runtime/pi/.codex/skills/delete-user/SKILL.md +2 -2
  321. package/runtime/pi/.codex/skills/emissary/SKILL.md +6 -2
  322. package/runtime/pi/.codex/skills/env/SKILL.md +29 -0
  323. package/runtime/pi/.codex/skills/handoff/SKILL.md +45 -131
  324. package/runtime/pi/.codex/skills/harvest/SKILL.md +45 -50
  325. package/runtime/pi/.codex/skills/ingest/SKILL.md +25 -51
  326. package/runtime/pi/.codex/skills/ingest-corpus/SKILL.md +2 -2
  327. package/runtime/pi/.codex/skills/ingest-notion/SKILL.md +2 -2
  328. package/runtime/pi/.codex/skills/ingest-user-interview/SKILL.md +45 -30
  329. package/runtime/pi/.codex/skills/invite/SKILL.md +25 -33
  330. package/runtime/pi/.codex/skills/issue/SKILL.md +45 -162
  331. package/runtime/pi/.codex/skills/me/SKILL.md +2 -2
  332. package/runtime/pi/.codex/skills/meeting/SKILL.md +45 -29
  333. package/runtime/pi/.codex/skills/note/SKILL.md +25 -37
  334. package/runtime/pi/.codex/skills/notion-connect/SKILL.md +2 -2
  335. package/runtime/pi/.codex/skills/onboarding/SKILL.md +45 -43
  336. package/runtime/pi/.codex/skills/pr/SKILL.md +2 -2
  337. package/runtime/pi/.codex/skills/pull/SKILL.md +2 -2
  338. package/runtime/pi/.codex/skills/push/SKILL.md +2 -2
  339. package/runtime/pi/.codex/skills/quest/SKILL.md +45 -44
  340. package/runtime/pi/.codex/skills/reflect/SKILL.md +45 -35
  341. package/runtime/pi/.codex/skills/review-pr/SKILL.md +6 -2
  342. package/runtime/pi/.codex/skills/save/SKILL.md +25 -137
  343. package/runtime/pi/.codex/skills/slack-connect/SKILL.md +2 -2
  344. package/runtime/pi/.codex/skills/summon/SKILL.md +6 -2
  345. package/runtime/pi/.codex/skills/sync-repos/SKILL.md +2 -2
  346. package/runtime/pi/.codex/skills/teams-connect/SKILL.md +2 -2
  347. package/runtime/pi/.codex/skills/telegram-connect/SKILL.md +2 -2
  348. package/runtime/pi/.codex/skills/telemetry/SKILL.md +2 -2
  349. package/runtime/pi/.codex/skills/test/SKILL.md +7 -3
  350. package/runtime/pi/.codex/skills/the-spiral/SKILL.md +25 -89
  351. package/runtime/pi/.codex/skills/tui-design/SKILL.md +6 -2
  352. package/runtime/pi/.codex/skills/tutorial/SKILL.md +45 -48
  353. package/runtime/pi/.codex/skills/update/SKILL.md +2 -2
  354. package/runtime/pi/.codex/skills/view/SKILL.md +39 -158
  355. package/runtime/pi/.codex/skills/visual-explain/SKILL.md +6 -2
  356. package/runtime/pi/.codex/skills/wrap/SKILL.md +45 -66
  357. package/runtime/pi/.codex/spec-manifest.json +10 -10
  358. package/runtime/pi/.pi/APPEND_SYSTEM.md +28 -17
  359. package/runtime/pi/.pi/spec-manifest.json +2 -2
  360. package/runtime/pi/AGENTS.md +29 -18
  361. package/runtime/pi/bin/activity-action.sh +1 -1
  362. package/runtime/pi/bin/activity-data.sh +1 -1
  363. package/runtime/pi/bin/agent.sh +78 -27
  364. package/runtime/pi/bin/api-call.sh +181 -0
  365. package/runtime/pi/bin/artifact-register.sh +62 -6
  366. package/runtime/pi/bin/artifact-writeback.sh +28 -3
  367. package/runtime/pi/bin/artifacts.sh +1 -1
  368. package/runtime/pi/bin/attendant.sh +1 -1
  369. package/runtime/pi/bin/codex-render-spec.mjs +14 -10
  370. package/runtime/pi/bin/codex-session-start.sh +7 -1
  371. package/runtime/pi/bin/codex-skill-render.mjs +15 -6
  372. package/runtime/pi/bin/codex-sync-skills.sh +6 -2
  373. package/runtime/pi/bin/config-get.sh +65 -0
  374. package/runtime/pi/bin/contribute-guard.sh +70 -0
  375. package/runtime/pi/bin/dashboard-data.sh +1 -1
  376. package/runtime/pi/bin/gh-run.sh +25 -0
  377. package/runtime/pi/bin/graph-op.sh +230 -3
  378. package/runtime/pi/bin/graph-projection.sh +1 -1
  379. package/runtime/pi/bin/graph-wal.sh +2 -2
  380. package/runtime/pi/bin/graph.sh +1 -1
  381. package/runtime/pi/bin/handoff-lifecycle.sh +2 -2
  382. package/runtime/pi/bin/handoff-preview.sh +7 -3
  383. package/runtime/pi/bin/handoff-run.sh +1 -1
  384. package/runtime/pi/bin/hosting-ops.sh +248 -0
  385. package/runtime/pi/bin/index-handoff.sh +3 -3
  386. package/runtime/pi/bin/ingest-item.sh +1 -1
  387. package/runtime/pi/bin/ingest.sh +3 -3
  388. package/runtime/pi/bin/invite.sh +1 -0
  389. package/runtime/pi/bin/issue.sh +1 -1
  390. package/runtime/pi/bin/knowledge.sh +1 -1
  391. package/runtime/pi/bin/lib/config.sh +4 -8
  392. package/runtime/pi/bin/lib/dashboard-artifact.sh +1 -1
  393. package/runtime/pi/bin/lib/framework-update.sh +41 -0
  394. package/runtime/pi/bin/lib/git-sync.sh +18 -11
  395. package/runtime/pi/bin/lib/greeting.sh +4 -1
  396. package/runtime/pi/bin/lib/health-footer.sh +1 -1
  397. package/runtime/pi/bin/lib/hosted-ref-id.sh +108 -0
  398. package/runtime/pi/bin/lib/runtime-owned.sh +52 -16
  399. package/runtime/pi/bin/lib/scratch.sh +26 -0
  400. package/runtime/pi/bin/lib/secret_entry.py +1013 -0
  401. package/runtime/pi/bin/notification.sh +1 -1
  402. package/runtime/pi/bin/notify.sh +134 -14
  403. package/runtime/pi/bin/observe-context.sh +1 -1
  404. package/runtime/pi/bin/onboarding.sh +1 -0
  405. package/runtime/pi/bin/person.sh +9 -4
  406. package/runtime/pi/bin/pi-product-workflows.mjs +5 -0
  407. package/runtime/pi/bin/prose-rules/harness-tool-names.md +36 -0
  408. package/runtime/pi/bin/publish-artifact.sh +52 -4
  409. package/runtime/pi/bin/publish-references.sh +27 -8
  410. package/runtime/pi/bin/qa-gate.sh +205 -0
  411. package/runtime/pi/bin/quest.sh +1 -1
  412. package/runtime/pi/bin/question.sh +1 -1
  413. package/runtime/pi/bin/research-ingest.sh +1 -1
  414. package/runtime/pi/bin/runtime-identity.sh +3 -3
  415. package/runtime/pi/bin/runtime-upgrade.sh +5 -3
  416. package/runtime/pi/bin/scratch-sweep.sh +29 -0
  417. package/runtime/pi/bin/scroll.sh +1 -1
  418. package/runtime/pi/bin/search.sh +7 -7
  419. package/runtime/pi/bin/secret-entry.py +6 -0
  420. package/runtime/pi/bin/session-autosave.sh +1 -1
  421. package/runtime/pi/bin/session-log.sh +7 -2
  422. package/runtime/pi/bin/settings.sh +1 -1
  423. package/runtime/pi/bin/test-baseline.sh +188 -44
  424. package/runtime/pi/bin/thread.sh +1 -1
  425. package/runtime/pi/bin/todo.sh +1 -1
  426. package/runtime/pi/bin/update-framework.sh +24 -0
  427. package/runtime/pi/bin/view-render.sh +21 -1
  428. package/runtime/pi/bin/worktree.sh +1 -1
  429. package/runtime/pi/docs/credential-entry.md +286 -0
  430. package/runtime/pi/egregore_runtime/artifacts.py +122 -19
  431. package/runtime/pi/egregore_runtime/contracts.py +18 -0
  432. package/runtime/pi/egregore_runtime/github_issues.py +89 -1
  433. package/runtime/pi/egregore_runtime/graph.py +15 -6
  434. package/runtime/pi/egregore_runtime/harness_cli.py +82 -12
  435. package/runtime/pi/egregore_runtime/identity.py +108 -8
  436. package/runtime/pi/egregore_runtime/identity_transfer.py +288 -0
  437. package/runtime/pi/egregore_runtime/ingest_cli.py +4 -6
  438. package/runtime/pi/egregore_runtime/investigation_guidance.py +8 -1
  439. package/runtime/pi/egregore_runtime/issue_cli.py +32 -1
  440. package/runtime/pi/egregore_runtime/issue_duplicates.py +116 -0
  441. package/runtime/pi/egregore_runtime/issue_readiness.py +231 -0
  442. package/runtime/pi/egregore_runtime/issue_triage.py +331 -0
  443. package/runtime/pi/egregore_runtime/issue_triage_service.py +124 -0
  444. package/runtime/pi/egregore_runtime/knowledge_cli.py +4 -3
  445. package/runtime/pi/egregore_runtime/notification_cli.py +66 -8
  446. package/runtime/pi/egregore_runtime/questions.py +1 -0
  447. package/runtime/pi/egregore_runtime/research_ingest_cli.py +4 -4
  448. package/runtime/pi/egregore_runtime/runtime.py +23 -2
  449. package/runtime/pi/egregore_runtime/scratch.py +294 -0
  450. package/runtime/pi/egregore_runtime/scroll_cli.py +7 -7
  451. package/runtime/pi/egregore_runtime/sync.py +21 -6
  452. package/runtime/pi/egregore_runtime/thread_cli.py +4 -4
  453. package/runtime/pi/egregore_runtime/threads.py +1 -0
  454. package/runtime/pi/egregore_runtime/upgrade.py +771 -34
  455. package/runtime/pi/egregore_runtime/writeback.py +146 -8
  456. package/runtime/pi/egregore_runtime/writeback_cli.py +89 -17
  457. package/runtime/pi/manifest.json +23 -1
  458. package/runtime/prime/.claude/context/retrieval-investigation.md +7 -0
  459. package/runtime/prime/.codex/config.toml +1 -2
  460. package/runtime/prime/.codex/skills/activity/SKILL.md +45 -39
  461. package/runtime/prime/.codex/skills/announce/SKILL.md +25 -47
  462. package/runtime/prime/.codex/skills/archive/SKILL.md +45 -33
  463. package/runtime/prime/.codex/skills/branch/SKILL.md +2 -2
  464. package/runtime/prime/.codex/skills/checkup/SKILL.md +39 -83
  465. package/runtime/prime/.codex/skills/commit/SKILL.md +2 -2
  466. package/runtime/prime/.codex/skills/contribute/SKILL.md +2 -2
  467. package/runtime/prime/.codex/skills/create-skill/SKILL.md +2 -2
  468. package/runtime/prime/.codex/skills/dark-mode/SKILL.md +2 -2
  469. package/runtime/prime/.codex/skills/dashboard/SKILL.md +45 -29
  470. package/runtime/prime/.codex/skills/deep-reflect/SKILL.md +45 -113
  471. package/runtime/prime/.codex/skills/delete-user/SKILL.md +2 -2
  472. package/runtime/prime/.codex/skills/emissary/SKILL.md +6 -2
  473. package/runtime/prime/.codex/skills/env/SKILL.md +29 -0
  474. package/runtime/prime/.codex/skills/handoff/SKILL.md +45 -131
  475. package/runtime/prime/.codex/skills/harvest/SKILL.md +45 -50
  476. package/runtime/prime/.codex/skills/ingest/SKILL.md +25 -51
  477. package/runtime/prime/.codex/skills/ingest-corpus/SKILL.md +2 -2
  478. package/runtime/prime/.codex/skills/ingest-notion/SKILL.md +2 -2
  479. package/runtime/prime/.codex/skills/ingest-user-interview/SKILL.md +45 -30
  480. package/runtime/prime/.codex/skills/invite/SKILL.md +25 -33
  481. package/runtime/prime/.codex/skills/issue/SKILL.md +45 -162
  482. package/runtime/prime/.codex/skills/me/SKILL.md +2 -2
  483. package/runtime/prime/.codex/skills/meeting/SKILL.md +45 -29
  484. package/runtime/prime/.codex/skills/note/SKILL.md +25 -37
  485. package/runtime/prime/.codex/skills/notion-connect/SKILL.md +2 -2
  486. package/runtime/prime/.codex/skills/onboarding/SKILL.md +45 -43
  487. package/runtime/prime/.codex/skills/pr/SKILL.md +2 -2
  488. package/runtime/prime/.codex/skills/pull/SKILL.md +2 -2
  489. package/runtime/prime/.codex/skills/push/SKILL.md +2 -2
  490. package/runtime/prime/.codex/skills/quest/SKILL.md +45 -44
  491. package/runtime/prime/.codex/skills/reflect/SKILL.md +45 -35
  492. package/runtime/prime/.codex/skills/review-pr/SKILL.md +6 -2
  493. package/runtime/prime/.codex/skills/save/SKILL.md +25 -137
  494. package/runtime/prime/.codex/skills/slack-connect/SKILL.md +2 -2
  495. package/runtime/prime/.codex/skills/summon/SKILL.md +6 -2
  496. package/runtime/prime/.codex/skills/sync-repos/SKILL.md +2 -2
  497. package/runtime/prime/.codex/skills/teams-connect/SKILL.md +2 -2
  498. package/runtime/prime/.codex/skills/telegram-connect/SKILL.md +2 -2
  499. package/runtime/prime/.codex/skills/telemetry/SKILL.md +2 -2
  500. package/runtime/prime/.codex/skills/test/SKILL.md +7 -3
  501. package/runtime/prime/.codex/skills/the-spiral/SKILL.md +25 -89
  502. package/runtime/prime/.codex/skills/tui-design/SKILL.md +6 -2
  503. package/runtime/prime/.codex/skills/tutorial/SKILL.md +45 -48
  504. package/runtime/prime/.codex/skills/update/SKILL.md +2 -2
  505. package/runtime/prime/.codex/skills/view/SKILL.md +39 -158
  506. package/runtime/prime/.codex/skills/visual-explain/SKILL.md +6 -2
  507. package/runtime/prime/.codex/skills/wrap/SKILL.md +45 -66
  508. package/runtime/prime/.codex/spec-manifest.json +10 -10
  509. package/runtime/prime/.prime/agent/APPEND_SYSTEM.md +28 -17
  510. package/runtime/prime/.prime/agent/skills/egregore/SKILL.md +8 -1
  511. package/runtime/prime/.prime/agent/skills/egregore/src/egregore/__init__.py +10 -2
  512. package/runtime/prime/.prime/agent/spec-manifest.json +2 -2
  513. package/runtime/prime/AGENTS.md +29 -18
  514. package/runtime/prime/bin/activity-action.sh +1 -1
  515. package/runtime/prime/bin/activity-data.sh +1 -1
  516. package/runtime/prime/bin/agent.sh +78 -27
  517. package/runtime/prime/bin/api-call.sh +181 -0
  518. package/runtime/prime/bin/artifact-register.sh +62 -6
  519. package/runtime/prime/bin/artifact-writeback.sh +28 -3
  520. package/runtime/prime/bin/artifacts.sh +1 -1
  521. package/runtime/prime/bin/attendant.sh +1 -1
  522. package/runtime/prime/bin/codex-render-spec.mjs +14 -10
  523. package/runtime/prime/bin/codex-session-start.sh +7 -1
  524. package/runtime/prime/bin/codex-skill-render.mjs +15 -6
  525. package/runtime/prime/bin/codex-sync-skills.sh +6 -2
  526. package/runtime/prime/bin/config-get.sh +65 -0
  527. package/runtime/prime/bin/contribute-guard.sh +70 -0
  528. package/runtime/prime/bin/dashboard-data.sh +1 -1
  529. package/runtime/prime/bin/gh-run.sh +25 -0
  530. package/runtime/prime/bin/graph-op.sh +230 -3
  531. package/runtime/prime/bin/graph-projection.sh +1 -1
  532. package/runtime/prime/bin/graph-wal.sh +2 -2
  533. package/runtime/prime/bin/graph.sh +1 -1
  534. package/runtime/prime/bin/handoff-lifecycle.sh +2 -2
  535. package/runtime/prime/bin/handoff-preview.sh +7 -3
  536. package/runtime/prime/bin/handoff-run.sh +1 -1
  537. package/runtime/prime/bin/hosting-ops.sh +248 -0
  538. package/runtime/prime/bin/index-handoff.sh +3 -3
  539. package/runtime/prime/bin/ingest-item.sh +1 -1
  540. package/runtime/prime/bin/ingest.sh +3 -3
  541. package/runtime/prime/bin/invite.sh +1 -0
  542. package/runtime/prime/bin/issue.sh +1 -1
  543. package/runtime/prime/bin/knowledge.sh +1 -1
  544. package/runtime/prime/bin/lib/config.sh +4 -8
  545. package/runtime/prime/bin/lib/dashboard-artifact.sh +1 -1
  546. package/runtime/prime/bin/lib/framework-update.sh +41 -0
  547. package/runtime/prime/bin/lib/git-sync.sh +18 -11
  548. package/runtime/prime/bin/lib/greeting.sh +4 -1
  549. package/runtime/prime/bin/lib/health-footer.sh +1 -1
  550. package/runtime/prime/bin/lib/hosted-ref-id.sh +108 -0
  551. package/runtime/prime/bin/lib/runtime-owned.sh +52 -16
  552. package/runtime/prime/bin/lib/scratch.sh +26 -0
  553. package/runtime/prime/bin/lib/secret_entry.py +1013 -0
  554. package/runtime/prime/bin/notification.sh +1 -1
  555. package/runtime/prime/bin/notify.sh +134 -14
  556. package/runtime/prime/bin/observe-context.sh +1 -1
  557. package/runtime/prime/bin/onboarding.sh +1 -0
  558. package/runtime/prime/bin/person.sh +9 -4
  559. package/runtime/prime/bin/pi-product-workflows.mjs +5 -0
  560. package/runtime/prime/bin/prose-rules/harness-tool-names.md +36 -0
  561. package/runtime/prime/bin/publish-artifact.sh +52 -4
  562. package/runtime/prime/bin/publish-references.sh +27 -8
  563. package/runtime/prime/bin/qa-gate.sh +205 -0
  564. package/runtime/prime/bin/quest.sh +1 -1
  565. package/runtime/prime/bin/question.sh +1 -1
  566. package/runtime/prime/bin/research-ingest.sh +1 -1
  567. package/runtime/prime/bin/runtime-identity.sh +3 -3
  568. package/runtime/prime/bin/runtime-upgrade.sh +5 -3
  569. package/runtime/prime/bin/scratch-sweep.sh +29 -0
  570. package/runtime/prime/bin/scroll.sh +1 -1
  571. package/runtime/prime/bin/search.sh +7 -7
  572. package/runtime/prime/bin/secret-entry.py +6 -0
  573. package/runtime/prime/bin/session-autosave.sh +1 -1
  574. package/runtime/prime/bin/session-log.sh +7 -2
  575. package/runtime/prime/bin/settings.sh +1 -1
  576. package/runtime/prime/bin/test-baseline.sh +188 -44
  577. package/runtime/prime/bin/thread.sh +1 -1
  578. package/runtime/prime/bin/todo.sh +1 -1
  579. package/runtime/prime/bin/update-framework.sh +24 -0
  580. package/runtime/prime/bin/view-render.sh +21 -1
  581. package/runtime/prime/bin/worktree.sh +1 -1
  582. package/runtime/prime/docs/credential-entry.md +286 -0
  583. package/runtime/prime/egregore_runtime/artifacts.py +122 -19
  584. package/runtime/prime/egregore_runtime/contracts.py +18 -0
  585. package/runtime/prime/egregore_runtime/github_issues.py +89 -1
  586. package/runtime/prime/egregore_runtime/graph.py +15 -6
  587. package/runtime/prime/egregore_runtime/harness_cli.py +82 -12
  588. package/runtime/prime/egregore_runtime/identity.py +108 -8
  589. package/runtime/prime/egregore_runtime/identity_transfer.py +288 -0
  590. package/runtime/prime/egregore_runtime/ingest_cli.py +4 -6
  591. package/runtime/prime/egregore_runtime/investigation_guidance.py +8 -1
  592. package/runtime/prime/egregore_runtime/issue_cli.py +32 -1
  593. package/runtime/prime/egregore_runtime/issue_duplicates.py +116 -0
  594. package/runtime/prime/egregore_runtime/issue_readiness.py +231 -0
  595. package/runtime/prime/egregore_runtime/issue_triage.py +331 -0
  596. package/runtime/prime/egregore_runtime/issue_triage_service.py +124 -0
  597. package/runtime/prime/egregore_runtime/knowledge_cli.py +4 -3
  598. package/runtime/prime/egregore_runtime/notification_cli.py +66 -8
  599. package/runtime/prime/egregore_runtime/questions.py +1 -0
  600. package/runtime/prime/egregore_runtime/research_ingest_cli.py +4 -4
  601. package/runtime/prime/egregore_runtime/runtime.py +23 -2
  602. package/runtime/prime/egregore_runtime/scratch.py +294 -0
  603. package/runtime/prime/egregore_runtime/scroll_cli.py +7 -7
  604. package/runtime/prime/egregore_runtime/sync.py +21 -6
  605. package/runtime/prime/egregore_runtime/thread_cli.py +4 -4
  606. package/runtime/prime/egregore_runtime/threads.py +1 -0
  607. package/runtime/prime/egregore_runtime/upgrade.py +771 -34
  608. package/runtime/prime/egregore_runtime/writeback.py +146 -8
  609. package/runtime/prime/egregore_runtime/writeback_cli.py +89 -17
  610. package/runtime/prime/manifest.json +23 -1
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // egregore-launcher-version: 0.21.0-runtime-mvp.28
2
+ // egregore-launcher-version: 0.21.0
3
3
  //
4
4
  // egregore — launch and browse Egregore instances from your terminal.
5
5
  // Installed by create-egregore. Reads ~/.egregore/instances.json.
@@ -35,7 +35,7 @@ const crypto = require("node:crypto");
35
35
  const { spawnSync, spawn } = require("node:child_process");
36
36
  const readline = require("node:readline");
37
37
 
38
- const VERSION = "0.21.0-runtime-mvp.28";
38
+ const VERSION = "0.21.0";
39
39
  const REGISTRY = path.join(os.homedir(), ".egregore", "instances.json");
40
40
  const DEFAULT_FILE = path.join(os.homedir(), ".egregore", "default");
41
41
  const UPDATE_CACHE_FILE = path.join(os.homedir(), ".egregore", "update-check.json");
@@ -755,6 +755,7 @@ async function renderCodexStartupCard(egregoreDir) {
755
755
 
756
756
  const CORE_SUPPORT_PATHS = {
757
757
  codex: [
758
+ "AGENTS.md",
758
759
  "bin/codex-session-start.sh",
759
760
  "bin/codex-install-skills.sh",
760
761
  ".codex/config.toml",
@@ -1354,7 +1355,10 @@ function compareReleaseVersions(a, b) {
1354
1355
  }
1355
1356
 
1356
1357
  function cliUpdateState(latest) {
1357
- if (!parseReleaseVersion(latest)) return null;
1358
+ // The global refresh follows latest; prerelease testing is selected explicitly.
1359
+ const parsed = parseReleaseVersion(latest);
1360
+ if (!RUNTIME_STABLE_VERSION_RE.test(latest || "") || !parsed
1361
+ || !parsed.parts.every(Number.isSafeInteger)) return null;
1358
1362
  return {
1359
1363
  current: VERSION,
1360
1364
  latest,
@@ -1445,7 +1449,7 @@ function cmdCliUpdate(latest) {
1445
1449
  );
1446
1450
  if (result.status !== 0) {
1447
1451
  console.log(`\r${ANSI.clearLine} [1/2] ${YELLOW}!${RESET} Install failed`);
1448
- const detail = String(result.stderr || result.stdout || "").trim().split("\n").filter(Boolean).pop();
1452
+ const detail = adapterErrorText(result.stderr || result.stdout || "").trim().split("\n").filter(Boolean).pop();
1449
1453
  if (detail) console.error(` ${DIM}${detail}${RESET}`);
1450
1454
  console.error(` Retry: npx -y ${PUBLIC_NPX_PACKAGE}@${latest} --refresh-launcher\n`);
1451
1455
  process.exitCode = 1;
@@ -1617,10 +1621,39 @@ function persistConnectState(inst, fields) {
1617
1621
  writeJsonFileAtomic(file, state);
1618
1622
  }
1619
1623
 
1624
+ // Older installed adapters and API versions may still use storage terminology.
1625
+ // Normalize only diagnostic display text; protocol fields and payloads stay intact.
1626
+ function adapterErrorText(detail) {
1627
+ return String(detail)
1628
+ // Describe a retired technical reference as a whole. Replacing one word
1629
+ // inside a path/module or shell invocation would invent a runnable command.
1630
+ .replace(/(^|\s)(?:(?:\/[^\s"'`]+)*\/)?(?:bash|sh|zsh)\s+(?:"([^"\n]+)"|'([^'\n]+)'|([^\s;"'`]+))/g,
1631
+ (command, prefix, quoted, singleQuoted, bare) => {
1632
+ const script = quoted || singleQuoted || bare;
1633
+ if (!/(?:graph|neo4j)/i.test(script)) return command;
1634
+ return prefix + (/sync-graph\.sh$/i.test(script) ? "the memory sync operation" : "the hosted storage operation");
1635
+ })
1636
+ .replace(/[^\s"'`()\[\]{},;:]+/g, (token) => {
1637
+ if (!/(?:graph|neo4j)/i.test(token)) return token;
1638
+ if (/[/\\]/.test(token)) {
1639
+ if (/[/\\]bin[/\\][^/\\]+\.sh$/i.test(token) || /^bin[/\\][^/\\]+\.sh$/i.test(token)) {
1640
+ return /sync-graph\.sh$/i.test(token) ? "the memory sync adapter" : "the hosted storage adapter";
1641
+ }
1642
+ return "the hosted storage path";
1643
+ }
1644
+ if (/^[a-z_][\w-]*(?:\.[a-z_][\w-]*)+\.?$/i.test(token)) return "the hosted storage component";
1645
+ return token;
1646
+ })
1647
+ .replace(/\bknowledge graph\b/gi, "shared memory")
1648
+ .replace(/\bgraph database\b/gi, "hosted storage")
1649
+ .replace(/\bneo4j\b/gi, "hosted storage")
1650
+ .replace(/\bgraph\b/gi, "storage");
1651
+ }
1652
+
1620
1653
  function connectError(result, fallback) {
1621
1654
  if (!result) return fallback;
1622
1655
  const data = result.data || {};
1623
- return data.detail || data.message || (typeof data === "string" ? data : fallback);
1656
+ return adapterErrorText(data.detail || data.message || (typeof data === "string" ? data : fallback));
1624
1657
  }
1625
1658
 
1626
1659
  function sleep(ms) {
@@ -1646,7 +1679,7 @@ function backfillSummaryLines(summary) {
1646
1679
 
1647
1680
  if (sessions !== null && artifacts !== null && quests !== null) {
1648
1681
  if (sessions + artifacts + quests === 0) {
1649
- lines.push("Graph already contained all sessions, artifacts, and quests");
1682
+ lines.push("Hosted memory is already up to date for sessions, artifacts, and quests");
1650
1683
  } else {
1651
1684
  lines.push(`Added ${[
1652
1685
  backfillCountLabel(sessions, "session", "sessions"),
@@ -1664,6 +1697,23 @@ function backfillSummaryLines(summary) {
1664
1697
  return lines;
1665
1698
  }
1666
1699
 
1700
+ function connectedOrganizationId(config, response) {
1701
+ const current = String(config.org_id || "");
1702
+ const returned = String(response?.org_id || "");
1703
+ if (!/^(?:org_[0-9a-f]{32}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/.test(returned) ||
1704
+ (current && !current.startsWith("legacy-org:") && returned !== current)) {
1705
+ die("Connected did not confirm this Egregore's existing identity. Local configuration is unchanged; update the hosted service before retrying.");
1706
+ }
1707
+ return returned || current;
1708
+ }
1709
+
1710
+ function hostedMemorySyncEnabled(config) {
1711
+ const override = process.env.EGREGORE_GRAPH_PROJECTION;
1712
+ if (["1", "true", "enabled"].includes(override)) return true;
1713
+ if (["0", "false", "disabled"].includes(override)) return false;
1714
+ return config.features?.graph_projection === true;
1715
+ }
1716
+
1667
1717
  async function cmdConnect(args) {
1668
1718
  const fresh = args.includes("--fresh");
1669
1719
  const positional = args.filter((a) => !String(a).startsWith("--"));
@@ -1681,6 +1731,8 @@ async function cmdConnect(args) {
1681
1731
  die(`GITHUB_TOKEN is missing for ${inst.slug}.\n Add it to ${path.join(inst.path, ".env")} and retry.`);
1682
1732
  }
1683
1733
  const activation = state.connected_activation || {};
1734
+ let expectedOrgId = cfg.org_id && !String(cfg.org_id).startsWith("legacy-org:")
1735
+ ? cfg.org_id : activation.org_id || "";
1684
1736
  if (cfg.mode === "connected" && activation.status === "connected") {
1685
1737
  if (activation.intent_id) {
1686
1738
  const repaired = await connectedApiRequest(
@@ -1694,8 +1746,10 @@ async function cmdConnect(args) {
1694
1746
  `Connected is active, but its shared configuration could not be published: ${connectError(repaired, `HTTP ${repaired.status}`)}`,
1695
1747
  );
1696
1748
  }
1749
+ const orgId = connectedOrganizationId(cfg, repaired.data);
1697
1750
  writeJsonFileAtomic(path.join(inst.path, "egregore.json"), {
1698
1751
  ...cfg,
1752
+ ...(orgId ? { org_id: orgId } : {}),
1699
1753
  mode: "connected",
1700
1754
  api_url: repaired.data.api_url,
1701
1755
  });
@@ -1751,16 +1805,18 @@ async function cmdConnect(args) {
1751
1805
  // Local installs may have skipped platform registration (DO_NOT_TRACK
1752
1806
  // gates it as telemetry). Connect requires it functionally, and choosing
1753
1807
  // Connect is the consent — register on demand. Idempotent for members of
1754
- // already-registered orgs; a 409 (registered by someone else) falls
1755
- // through to the billing-actor check on intent creation.
1808
+ // already-registered orgs. Identity conflicts must stop before checkout.
1756
1809
  const registration = await connectedApiRequest(githubToken, "POST", "/api/org/register", {
1757
1810
  org_name: cfg.org_name || inst.slug,
1758
1811
  github_org: cfg.github_org || "",
1759
1812
  slug: cfg.slug || inst.slug,
1813
+ ...(cfg.org_id && !String(cfg.org_id).startsWith("legacy-org:") ? { org_id: cfg.org_id } : {}),
1814
+ repo_name: cfg.repo_name || "egregore",
1760
1815
  });
1761
- if (registration.status !== 200 && registration.status !== 409) {
1816
+ if (registration.status !== 200) {
1762
1817
  die(`could not register this Egregore with the platform: ${connectError(registration, `HTTP ${registration.status}`)}`);
1763
1818
  }
1819
+ expectedOrgId = connectedOrganizationId(cfg, registration.data);
1764
1820
  console.log(` [1/5] ${DIM}Creating connection intent…${RESET}`);
1765
1821
  const checkout = await connectedApiRequest(
1766
1822
  githubToken,
@@ -1774,6 +1830,7 @@ async function cmdConnect(args) {
1774
1830
  mode: cfg.mode || "local",
1775
1831
  repo_name: cfg.repo_name || "",
1776
1832
  managed_repo_count: Array.isArray(cfg.repos) ? cfg.repos.length : 0,
1833
+ hosted_memory_sync: hostedMemorySyncEnabled(cfg),
1777
1834
  fresh,
1778
1835
  },
1779
1836
  },
@@ -1786,6 +1843,7 @@ async function cmdConnect(args) {
1786
1843
  connectUrl = checkout.data.connect_url;
1787
1844
  persistConnectState(inst, {
1788
1845
  intent_id: intentId,
1846
+ org_id: expectedOrgId,
1789
1847
  connect_ticket: checkout.data.connect_ticket,
1790
1848
  connect_ticket_expires_at: checkout.data.connect_ticket_expires_at,
1791
1849
  connect_url: connectUrl,
@@ -1793,6 +1851,17 @@ async function cmdConnect(args) {
1793
1851
  });
1794
1852
  console.log(` [1/5] ${GREEN}✓${RESET} Connection intent`);
1795
1853
  } else {
1854
+ if (!expectedOrgId) {
1855
+ const registration = await connectedApiRequest(githubToken, "POST", "/api/org/register", {
1856
+ org_name: cfg.org_name || inst.slug, github_org: cfg.github_org || "",
1857
+ slug: cfg.slug || inst.slug, repo_name: cfg.repo_name || "egregore",
1858
+ });
1859
+ if (registration.status !== 200) {
1860
+ die(`could not confirm this Egregore's identity: ${connectError(registration, `HTTP ${registration.status}`)}`);
1861
+ }
1862
+ expectedOrgId = connectedOrganizationId(cfg, registration.data);
1863
+ persistConnectState(inst, { org_id: expectedOrgId });
1864
+ }
1796
1865
  console.log(` [1/5] ${GREEN}✓${RESET} Resuming connection intent`);
1797
1866
  }
1798
1867
 
@@ -1852,8 +1921,11 @@ async function cmdConnect(args) {
1852
1921
  const configFile = path.join(inst.path, "egregore.json");
1853
1922
  const envFile = path.join(inst.path, ".env");
1854
1923
  const currentConfig = readJsonFile(configFile);
1924
+ const orgId = connectedOrganizationId({ ...currentConfig, org_id: expectedOrgId || currentConfig.org_id }, claim.data);
1925
+ const syncEnabled = hostedMemorySyncEnabled(currentConfig);
1855
1926
  writeJsonFileAtomic(configFile, {
1856
1927
  ...currentConfig,
1928
+ ...(orgId ? { org_id: orgId } : {}),
1857
1929
  mode: "connected",
1858
1930
  api_url: claim.data.api_url,
1859
1931
  });
@@ -1864,19 +1936,22 @@ async function cmdConnect(args) {
1864
1936
  status: "backfilling",
1865
1937
  activation_protocol: claim.data.activation_protocol,
1866
1938
  });
1867
- console.log(` [4/5] ${GREEN}✓${RESET} Connected credential and graph node`);
1939
+ console.log(` [4/5] ${GREEN}✓${RESET} Hosted access and organization ready`);
1868
1940
 
1869
1941
  let backfillSummary = { replayed: true };
1870
1942
  if (fresh) {
1871
1943
  // Fresh install — no existing memory to project; skip the replay entirely.
1872
- console.log(` [5/5] ${GREEN}✓${RESET} Fresh instance — nothing to project yet`);
1944
+ console.log(` [5/5] ${GREEN}✓${RESET} Fresh instance — no existing memory to sync`);
1873
1945
  backfillSummary = { fresh: true, replayed: false };
1946
+ } else if (!syncEnabled) {
1947
+ backfillSummary = { replayed: false, reason: "local_memory" };
1948
+ console.log(` [5/5] ${GREEN}✓${RESET} Memory and retrieval remain local`);
1874
1949
  } else {
1875
1950
  const syncScript = path.join(inst.path, "bin", "sync-graph.sh");
1876
1951
  if (!fs.existsSync(syncScript)) {
1877
- die("bin/sync-graph.sh is missing. Update the installed Egregore version, then run egregore connect again.");
1952
+ die("The memory sync adapter is missing. Update the installed Egregore version, then run egregore connect again.");
1878
1953
  }
1879
- console.log(` [5/5] ${CYAN}◦${RESET} Projecting existing memory into the graph…`);
1954
+ console.log(` [5/5] ${CYAN}◦${RESET} Syncing existing memory with hosted services…`);
1880
1955
  console.log(` ${DIM}Scanning sessions, artifacts, quests, and ingest history${RESET}`);
1881
1956
  const sync = spawnSync("bash", [syncScript], {
1882
1957
  cwd: inst.path,
@@ -1885,8 +1960,8 @@ async function cmdConnect(args) {
1885
1960
  timeout: 10 * 60 * 1000,
1886
1961
  });
1887
1962
  if (sync.status !== 0) {
1888
- const detail = (sync.stderr || sync.stdout || "graph replay failed").trim();
1889
- die(`Connected is configured, but graph replay did not finish.\n ${detail}\n Run egregore connect ${inst.slug} to retry; existing data is unchanged.`);
1963
+ const detail = adapterErrorText(sync.stderr || sync.stdout || "memory sync failed").trim();
1964
+ die(`Connected is configured, but memory sync did not finish.\n ${detail}\n Run egregore connect ${inst.slug} to retry; existing data is unchanged.`);
1890
1965
  }
1891
1966
  try { backfillSummary = JSON.parse((sync.stdout || "").trim()); } catch {}
1892
1967
  }
@@ -1903,15 +1978,15 @@ async function cmdConnect(args) {
1903
1978
  await sleep(250 * (attempt + 1));
1904
1979
  }
1905
1980
  if (complete.status !== 200) {
1906
- die(`graph replay finished, but activation could not be finalized: ${connectError(complete, `HTTP ${complete.status}`)}`);
1981
+ die(`Hosted access is configured, but activation could not be finalized: ${connectError(complete, `HTTP ${complete.status}`)}`);
1907
1982
  }
1908
1983
  persistConnectState(inst, {
1909
1984
  status: "connected",
1910
1985
  connected_at: new Date().toISOString(),
1911
1986
  backfill_summary: backfillSummary,
1912
1987
  });
1913
- if (!fresh) {
1914
- console.log(` [5/5] ${GREEN}✓${RESET} Existing memory projected into the graph`);
1988
+ if (!fresh && syncEnabled) {
1989
+ console.log(` [5/5] ${GREEN}✓${RESET} Existing memory synced with hosted services`);
1915
1990
  for (const line of backfillSummaryLines(backfillSummary)) {
1916
1991
  console.log(` ${DIM}${line}${RESET}`);
1917
1992
  }
@@ -2345,43 +2420,23 @@ function settingsDump(inst) {
2345
2420
  // explicit verbs — one source of truth, no JS reimplementation.
2346
2421
 
2347
2422
  const RUNTIME_MVP_VERSION_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-runtime-mvp\.(0|[1-9]\d*)$/;
2348
- const RUNTIME_MVP_REGISTRY_URL = process.env.EGREGORE_RUNTIME_MVP_REGISTRY_URL
2349
- || "https://registry.npmjs.org/create-egregore/runtime-mvp";
2423
+ const RUNTIME_STABLE_VERSION_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
2350
2424
 
2351
- function upgradeScriptPath(inst) {
2352
- return path.join(inst.path, "bin", "runtime-upgrade.sh");
2425
+ function isRuntimeCandidate(version) {
2426
+ return typeof version === "string"
2427
+ && (RUNTIME_MVP_VERSION_RE.test(version) || RUNTIME_STABLE_VERSION_RE.test(version))
2428
+ && parseReleaseVersion(version).parts.every(Number.isSafeInteger)
2429
+ && compareReleaseVersions(version, "0.21.0-runtime-mvp.0") >= 0;
2353
2430
  }
2354
2431
 
2355
- // After the Runtime cutover, a Connected instance's hosted link no longer
2356
- // serves retrieval — saying "hosted graph active" would misstate what the
2357
- // connection is for. Mirror the shell gate (bin/search.sh): stable org
2358
- // identity composed with the main installation path keys the activation
2359
- // record; only a real record flips the wording.
2360
- function upgradedGraphRetrievalOff(instPath) {
2361
- try {
2362
- const cfg = JSON.parse(fs.readFileSync(path.join(instPath, "egregore.json"), "utf-8"));
2363
- const orgId = String(cfg.org_id || "").trim();
2364
- if (!orgId) return false;
2365
- let main = instPath;
2366
- const gitFile = path.join(instPath, ".git");
2367
- if (fs.existsSync(gitFile) && fs.statSync(gitFile).isFile()) {
2368
- const m = /^gitdir: (.*)$/m.exec(fs.readFileSync(gitFile, "utf-8"));
2369
- if (m && m[1].includes("/.git/worktrees/")) main = m[1].split("/.git/worktrees/")[0];
2370
- }
2371
- main = fs.realpathSync(main);
2372
- const key = crypto.createHash("sha256").update(`${orgId}|${main}`).digest("hex").slice(0, 16);
2373
- const base = process.env.EGREGORE_UPGRADE_ROOT || path.join(os.homedir(), ".egregore", "runtime", "upgrade");
2374
- const record = JSON.parse(fs.readFileSync(path.join(base, key, "active.json"), "utf-8"));
2375
- return record.retrieval === "runtime-qmd";
2376
- } catch {
2377
- return false;
2378
- }
2432
+ function upgradeScriptPath(inst) {
2433
+ return path.join(inst.path, "bin", "runtime-upgrade.sh");
2379
2434
  }
2380
2435
 
2381
- function connectedModeSuffix(instPath) {
2382
- return upgradedGraphRetrievalOff(instPath)
2383
- ? "· hosted services · graph retrieval off"
2384
- : "· hosted graph active";
2436
+ // Connected describes the hosted service relationship. Retrieval health is
2437
+ // shown separately in Runtime settings, including on fresh installations.
2438
+ function connectedModeSuffix() {
2439
+ return "· hosted services";
2385
2440
  }
2386
2441
 
2387
2442
  // An instance that predates the bridge (0.20.1 and earlier) is still
@@ -2407,8 +2462,23 @@ function packagedUpgradeScript() {
2407
2462
 
2408
2463
  function resolveUpgradeBridge(inst) {
2409
2464
  const own = upgradeScriptPath(inst);
2410
- if (fs.existsSync(own)) return { script: own, env: {} };
2411
2465
  const packaged = packagedUpgradeScript();
2466
+ if (fs.existsSync(own)) {
2467
+ // Older MVP engines reject stable versions. Probe without identity setup
2468
+ // or state writes; use the launcher's engine for the entire transaction
2469
+ // when the installed engine predates this protocol advertisement.
2470
+ if (!packaged || !fs.existsSync(packaged)) return { script: own, env: { EGREGORE_INSTANCE_ROOT: inst.path } };
2471
+ try {
2472
+ const probe = spawnSync("bash", upgradeBridgeArgs({ script: own }, ["capabilities"]), {
2473
+ cwd: inst.path, encoding: "utf-8", timeout: 2000,
2474
+ env: { ...process.env, EGREGORE_INSTANCE_ROOT: inst.path },
2475
+ });
2476
+ const capability = probe.status === 0 ? JSON.parse(probe.stdout) : null;
2477
+ if (capability?.upgrade_protocol === 1 && capability.stable_candidates === true) {
2478
+ return { script: own, env: { EGREGORE_INSTANCE_ROOT: inst.path } };
2479
+ }
2480
+ } catch { /* Missing/legacy capability response uses the packaged engine. */ }
2481
+ }
2412
2482
  if (packaged && fs.existsSync(packaged)) {
2413
2483
  return { script: packaged, env: { EGREGORE_INSTANCE_ROOT: inst.path } };
2414
2484
  }
@@ -2499,8 +2569,8 @@ function formatPrivacyLines(snapshot) {
2499
2569
  lines.push(`Personal read roots: ${personalRoots.length ? personalRoots.join(", ") : "none"}`);
2500
2570
  lines.push(
2501
2571
  snapshot.graph_retrieval === "not-used-by-this-runtime"
2502
- ? "Graph retrieval: not used by this Runtime"
2503
- : "Graph retrieval: legacy configuration",
2572
+ ? "Search: local to this Egregore"
2573
+ : "Search: check Runtime status",
2504
2574
  );
2505
2575
  return lines;
2506
2576
  }
@@ -2619,14 +2689,20 @@ function retrievalHealthAsync(inst, cb) {
2619
2689
  } catch { cb(null); }
2620
2690
  }
2621
2691
 
2622
- // Exact candidate resolution: the runtime-mvp dist-tag only, validated
2623
- // against the prerelease scheme — never latest, never a retired scheme.
2624
- // EGREGORE_RUNTIME_MVP_CANDIDATE is the offline/test seam.
2625
- async function fetchRuntimeMvpCandidate() {
2626
- const seeded = process.env.EGREGORE_RUNTIME_MVP_CANDIDATE;
2627
- if (seeded !== undefined) return RUNTIME_MVP_VERSION_RE.test(seeded) ? seeded : null;
2692
+ // Stable is the default even for an existing MVP installation. Testing the
2693
+ // prerelease channel requires an explicit selection; dist-tags never reach init.
2694
+ async function fetchRuntimeCandidate() {
2695
+ const channel = process.env.EGREGORE_RUNTIME_CHANNEL || "stable";
2696
+ if (!["stable", "runtime-mvp"].includes(channel)) return null;
2697
+ const mvp = channel === "runtime-mvp";
2698
+ const accepts = (version) => isRuntimeCandidate(version)
2699
+ && (mvp ? RUNTIME_MVP_VERSION_RE : RUNTIME_STABLE_VERSION_RE).test(version);
2700
+ const seeded = process.env[mvp ? "EGREGORE_RUNTIME_MVP_CANDIDATE" : "EGREGORE_RUNTIME_STABLE_CANDIDATE"];
2701
+ if (seeded !== undefined) return accepts(seeded) ? seeded : null;
2702
+ const registryUrl = process.env[mvp ? "EGREGORE_RUNTIME_MVP_REGISTRY_URL" : "EGREGORE_RUNTIME_STABLE_REGISTRY_URL"]
2703
+ || `https://registry.npmjs.org/create-egregore/${mvp ? "runtime-mvp" : "latest"}`;
2628
2704
  try {
2629
- const url = new URL(RUNTIME_MVP_REGISTRY_URL);
2705
+ const url = new URL(registryUrl);
2630
2706
  const result = await requestJson({
2631
2707
  hostname: url.hostname,
2632
2708
  port: url.port || undefined,
@@ -2638,7 +2714,7 @@ async function fetchRuntimeMvpCandidate() {
2638
2714
  headers: { Accept: "application/json" },
2639
2715
  });
2640
2716
  const version = result.status === 200 && result.data && result.data.version;
2641
- return version && RUNTIME_MVP_VERSION_RE.test(version) ? version : null;
2717
+ return accepts(version) ? version : null;
2642
2718
  } catch {
2643
2719
  return null;
2644
2720
  }
@@ -2649,6 +2725,7 @@ async function fetchRuntimeMvpCandidate() {
2649
2725
  // staged must not dead-end into a CLI instruction referencing a tarball the
2650
2726
  // user does not have — the registry has it, digest-verified.
2651
2727
  function fetchCandidateTarball(version, cb) {
2728
+ if (!isRuntimeCandidate(version)) return cb(new Error("an exact supported Runtime version is required"));
2652
2729
  const metaUrl = new URL(`https://registry.npmjs.org/${PUBLIC_NPX_PACKAGE}/${version}`);
2653
2730
  requestJson({
2654
2731
  hostname: metaUrl.hostname,
@@ -2659,7 +2736,12 @@ function fetchCandidateTarball(version, cb) {
2659
2736
  headers: { Accept: "application/json" },
2660
2737
  }).then((meta) => {
2661
2738
  const dist = meta && meta.status === 200 && meta.data && meta.data.dist;
2662
- if (!dist || !dist.tarball) return cb(new Error(`candidate ${version} not found on the registry`));
2739
+ if (!dist || !dist.tarball || meta.data.name !== PUBLIC_NPX_PACKAGE || meta.data.version !== version) {
2740
+ return cb(new Error(`candidate ${version} not found on the registry`));
2741
+ }
2742
+ if (typeof dist.integrity !== "string" || !/^sha512-[A-Za-z0-9+/]{86}==$/.test(dist.integrity)) {
2743
+ return cb(new Error("candidate sha512 integrity is missing or invalid — refusing to stage"));
2744
+ }
2663
2745
  const dest = path.join(os.tmpdir(), `egregore-candidate-${version}.tgz`);
2664
2746
  const fetchTarball = (url, redirects) => {
2665
2747
  https.get(url, { headers: { "User-Agent": "egregore-launcher" } }, (res) => {
@@ -2710,7 +2792,7 @@ const UPGRADE_STATUS_LABEL = {
2710
2792
  // transaction state, not the condition the user needs to see.
2711
2793
  function runtimeUpdateAvailable(st, candidate) {
2712
2794
  return st?.status === "active"
2713
- && RUNTIME_MVP_VERSION_RE.test(candidate || "")
2795
+ && isRuntimeCandidate(candidate)
2714
2796
  && compareReleaseVersions(candidate, st.active_version) > 0;
2715
2797
  }
2716
2798
 
@@ -2766,14 +2848,14 @@ function formatUpgradeLines(inst, st, { candidate = "", retrieval = null } = {})
2766
2848
  // A recorded failure only needs attention while the transaction is stuck
2767
2849
  // on it; once a later prepare succeeds the line would contradict "ready".
2768
2850
  if (d.failure && d.failure.message && (["failed", "interrupted", "unavailable"].includes(d.status))) {
2769
- lines.push(`Attention: ${d.failure.message}`);
2851
+ lines.push(`Attention: ${adapterErrorText(d.failure.message)}`);
2770
2852
  }
2771
2853
  if (d.rollback_version && d.status !== "none") lines.push(`Rollback target: ${d.rollback_version}`);
2772
2854
  const ts = d.team_sync;
2773
2855
  if (ts && ts.label) lines.push(`Team memory: ${ts.label}`);
2774
2856
  if (d.status === "active") {
2775
2857
  lines.push("Organizational retrieval: Runtime/QMD");
2776
- lines.push("Graph retrieval: not used by this Runtime version");
2858
+ lines.push("Search: local to this Egregore");
2777
2859
  } else if (d.status !== "none") {
2778
2860
  lines.push("Previous Runtime remains active until activation.");
2779
2861
  }
@@ -2802,10 +2884,10 @@ function formatUpgradeLines(inst, st, { candidate = "", retrieval = null } = {})
2802
2884
  parts.push(`${upgradeElapsed(d)} elapsed`);
2803
2885
  detail = ` — ${parts.join(" · ")}`;
2804
2886
  } else if (stage.state === "done" && stage.detail) {
2805
- detail = ` — ${stage.detail}`;
2887
+ detail = ` — ${adapterErrorText(stage.detail)}`;
2806
2888
  }
2807
2889
  } else if (stage.state === "failed" && stage.detail) {
2808
- detail = ` — ${stage.detail}`;
2890
+ detail = ` — ${adapterErrorText(stage.detail)}`;
2809
2891
  }
2810
2892
  lines.push(` ${glyph} ${stage.label}${detail}`);
2811
2893
  }
@@ -2825,7 +2907,7 @@ const UPGRADE_CHANGES = [
2825
2907
  "Runtime version",
2826
2908
  "Organizational retrieval moves to Runtime/QMD",
2827
2909
  "Keyword and meaning search become owned by this Egregore",
2828
- "Graph retrieval stops after activation (kept only for rollback)",
2910
+ "Previous search is replaced after activation (kept for rollback)",
2829
2911
  "Cross-session continuity uses the new Runtime",
2830
2912
  "Readiness and synchronization become visible here in Settings",
2831
2913
  ];
@@ -2852,22 +2934,28 @@ async function cmdSettingsRuntime(inst, args) {
2852
2934
  if (action === "init") {
2853
2935
  const version = (args[1] || "").trim();
2854
2936
  const tarball = (args[2] || "").trim();
2855
- if (!RUNTIME_MVP_VERSION_RE.test(version)) {
2856
- process.stderr.write("Runtime update needs an exact candidate like 0.21.0-runtime-mvp.1.\n");
2937
+ if (!isRuntimeCandidate(version)) {
2938
+ process.stderr.write("Runtime update needs an exact version like 0.21.0 or 0.21.0-runtime-mvp.1.\n");
2857
2939
  process.exitCode = 1; return;
2858
2940
  }
2859
2941
  if (!tarball || !fs.existsSync(tarball)) {
2860
2942
  process.stderr.write("Runtime update installs actual packaged bytes: egregore settings <slug> runtime init <version> <candidate.tgz>\n");
2861
2943
  process.exitCode = 1; return;
2862
2944
  }
2945
+ const current = upgradeStatus(inst);
2946
+ if (!current || current.status === "unavailable" || (current.active_version && (!parseReleaseVersion(current.active_version)
2947
+ || compareReleaseVersions(version, current.active_version) <= 0))) {
2948
+ process.stderr.write("Runtime update requires a version newer than the verified active version; use rollback for recovery.\n");
2949
+ process.exitCode = 1; return;
2950
+ }
2863
2951
  const r = runUpgrade(inst, ["init", "--candidate", version, "--tarball", path.resolve(tarball)]);
2864
- if (r.status !== 0) { process.stderr.write(r.stderr || "could not stage the candidate\n"); process.exitCode = r.status; return; }
2952
+ if (r.status !== 0) { process.stderr.write(adapterErrorText(r.stderr || "could not stage the candidate\n")); process.exitCode = r.status; return; }
2865
2953
  emit(upgradeStatus(inst) || null);
2866
2954
  return;
2867
2955
  }
2868
2956
  if (["prepare", "activate", "cancel", "rollback"].includes(action)) {
2869
2957
  const r = runUpgrade(inst, [action]);
2870
- if (r.status !== 0) { process.stderr.write(r.stderr || `${action} failed\n`); process.exitCode = r.status; return; }
2958
+ if (r.status !== 0) { process.stderr.write(adapterErrorText(r.stderr || `${action} failed\n`)); process.exitCode = r.status; return; }
2871
2959
  const st = upgradeStatus(inst);
2872
2960
  emit(st);
2873
2961
  if (action === "activate" && st && st.status === "active") {
@@ -3975,17 +4063,17 @@ async function browser(args = {}) {
3975
4063
  const r = runUpgrade(inst, ["prepare"]);
3976
4064
  state.upgradeNotice = r.status === 0
3977
4065
  ? `${DIM}Preparing in the background — safe to leave this screen.${RESET}`
3978
- : `${YELLOW}${(r.stderr || "prepare failed").trim().split("\n")[0]}${RESET}`;
4066
+ : `${YELLOW}${adapterErrorText(r.stderr || "prepare failed").trim().split("\n")[0]}${RESET}`;
3979
4067
  } else if (mode === "confirm-activate") {
3980
4068
  const r = runUpgrade(inst, ["activate"]);
3981
4069
  state.upgradeNotice = r.status === 0
3982
4070
  ? `${GREEN}Update complete. Start a session to work on the new Runtime.${RESET}`
3983
- : `${YELLOW}${(r.stderr || "activation refused — a gate has not passed").trim().split("\n")[0]}${RESET}`;
4071
+ : `${YELLOW}${adapterErrorText(r.stderr || "activation refused — a gate has not passed").trim().split("\n")[0]}${RESET}`;
3984
4072
  } else if (mode === "confirm-rollback") {
3985
4073
  const r = runUpgrade(inst, ["rollback"]);
3986
4074
  state.upgradeNotice = r.status === 0
3987
4075
  ? `${DIM}Rolled back. The previous Runtime is active again.${RESET}`
3988
- : `${YELLOW}${(r.stderr || "rollback failed").trim().split("\n")[0]}${RESET}`;
4076
+ : `${YELLOW}${adapterErrorText(r.stderr || "rollback failed").trim().split("\n")[0]}${RESET}`;
3989
4077
  } else if (mode === "confirm-cancel") {
3990
4078
  runUpgrade(inst, ["cancel"]);
3991
4079
  state.upgradeNotice = `${DIM}Preparation cancelled. The current Runtime was never touched.${RESET}`;
@@ -4008,8 +4096,10 @@ async function browser(args = {}) {
4008
4096
  && state.upgradeData.candidate_version;
4009
4097
  if (!staged) {
4010
4098
  const candidate = state.upgradeCandidate;
4011
- if (!candidate) {
4012
- state.upgradeNotice = `${DIM}No published candidate found. Stage one manually: egregore settings ${state.upgradeInst.slug} runtime init --candidate <version> --tarball <candidate.tgz>${RESET}`;
4099
+ if (!candidate || (state.upgradeData?.active_version
4100
+ && (!parseReleaseVersion(state.upgradeData.active_version)
4101
+ || compareReleaseVersions(candidate, state.upgradeData.active_version) <= 0))) {
4102
+ state.upgradeNotice = `${DIM}No published candidate found. Stage one manually: egregore settings ${state.upgradeInst.slug} runtime init <version> <candidate.tgz>${RESET}`;
4013
4103
  render(); return;
4014
4104
  }
4015
4105
  if (state.upgradeFetching) { render(); return; }
@@ -4026,7 +4116,7 @@ async function browser(args = {}) {
4026
4116
  }
4027
4117
  const r = runUpgrade(inst, ["init", "--candidate", candidate, "--tarball", tgz]);
4028
4118
  if (r === null || r.status !== 0) {
4029
- const detail = ((r && (r.stderr || r.stdout)) || "staging failed").trim().split("\n")[0];
4119
+ const detail = adapterErrorText((r && (r.stderr || r.stdout)) || "staging failed").trim().split("\n")[0];
4030
4120
  state.upgradeNotice = `${YELLOW}${detail}${RESET}`;
4031
4121
  render(); return;
4032
4122
  }
@@ -4326,7 +4416,7 @@ async function browser(args = {}) {
4326
4416
  });
4327
4417
  refreshUpgrade();
4328
4418
  if (!state.upgradeCandidate) {
4329
- fetchRuntimeMvpCandidate().then((v) => {
4419
+ fetchRuntimeCandidate().then((v) => {
4330
4420
  state.upgradeCandidate = v || "";
4331
4421
  if (state.upgradeInst) render();
4332
4422
  });
@@ -4620,7 +4710,7 @@ async function browser(args = {}) {
4620
4710
  if (state.settingsInst === pick && !state.upgradeInst) render();
4621
4711
  });
4622
4712
  if (!state.upgradeCandidate) {
4623
- fetchRuntimeMvpCandidate().then((v) => {
4713
+ fetchRuntimeCandidate().then((v) => {
4624
4714
  state.upgradeCandidate = v || "";
4625
4715
  if (state.settingsInst === pick && !state.upgradeInst) render();
4626
4716
  });
package/lib/api.js CHANGED
@@ -99,10 +99,10 @@ class EgregoreAPI {
99
99
  });
100
100
  }
101
101
 
102
- async registerOrg(githubToken, { org_name, github_org, slug, flow_variant }) {
102
+ async registerOrg(githubToken, { org_name, github_org, slug, flow_variant, org_id, repo_name }) {
103
103
  return request("POST", `${this.base}/api/org/register`, {
104
104
  headers: { Authorization: `Bearer ${githubToken}` },
105
- body: { org_name, github_org, slug, ...(flow_variant ? { flow_variant } : {}) },
105
+ body: { org_name, github_org, slug, ...(org_id ? { org_id } : {}), ...(repo_name ? { repo_name } : {}), ...(flow_variant ? { flow_variant } : {}) },
106
106
  });
107
107
  }
108
108