create-egregore 0.21.0-runtime-mvp.27 → 0.21.0-runtime-mvp.28

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 (412) hide show
  1. package/assets/egregore-launcher.js +120 -70
  2. package/bin/cli.js +70 -1
  3. package/lib/harness-add.js +159 -0
  4. package/lib/setup.js +3 -3
  5. package/package.json +5 -3
  6. package/runtime/claude/.claude/context/notification-consent.md +17 -2
  7. package/runtime/claude/.claude/context/retrieval-investigation.md +50 -0
  8. package/runtime/claude/.claude/context/telemetry.md +72 -3
  9. package/runtime/claude/.claude/hooks/memory-read-guard.sh +54 -13
  10. package/runtime/claude/.claude/hooks/retrieval-context.sh +4 -44
  11. package/runtime/claude/.claude/rules/voice-bedrock.md +11 -0
  12. package/runtime/claude/.claude/skills/branch/SKILL.md +22 -18
  13. package/runtime/claude/.claude/skills/commit/SKILL.md +11 -7
  14. package/runtime/claude/.claude/skills/create-skill/SKILL.md +5 -3
  15. package/runtime/claude/.claude/skills/issue/SKILL.md +94 -0
  16. package/runtime/claude/.claude/skills/pr/SKILL.md +11 -17
  17. package/runtime/claude/.claude/skills/pull/SKILL.md +10 -33
  18. package/runtime/claude/.claude/skills/push/SKILL.md +6 -2
  19. package/runtime/claude/.claude/skills/review-pr/SKILL.md +18 -0
  20. package/runtime/claude/.claude/skills/save/SKILL.md +12 -2
  21. package/runtime/claude/.claude/skills/test/SKILL.md +2 -2
  22. package/runtime/claude/.claude/skills/update/SKILL.md +1 -1
  23. package/runtime/claude/.claude/skills/view/SKILL.md +3 -2
  24. package/runtime/claude/CLAUDE.md +34 -16
  25. package/runtime/claude/bin/agent.sh +56 -4
  26. package/runtime/claude/bin/base-branch.sh +62 -0
  27. package/runtime/claude/bin/codex-render-spec.mjs +32 -64
  28. package/runtime/claude/bin/codex-session-start.sh +24 -39
  29. package/runtime/claude/bin/codex-sync-skills.sh +79 -24
  30. package/runtime/claude/bin/graph-op.sh +73 -3
  31. package/runtime/claude/bin/lib/generated-trees.sh +27 -0
  32. package/runtime/claude/bin/lib/git-sync.sh +53 -9
  33. package/runtime/claude/bin/lib/greeting.sh +41 -71
  34. package/runtime/claude/bin/lib/health-footer.sh +115 -0
  35. package/runtime/claude/bin/lib/identity.sh +1 -0
  36. package/runtime/claude/bin/lib/notices.sh +177 -0
  37. package/runtime/claude/bin/lib/repo-paths.sh +40 -0
  38. package/runtime/claude/bin/observe-context.sh +2 -2
  39. package/runtime/claude/bin/pi-render-spec.mjs +0 -1
  40. package/runtime/claude/bin/prime-render-spec.mjs +1 -2
  41. package/runtime/claude/bin/prose-check-tally.sh +102 -0
  42. package/runtime/claude/bin/prose-check.mjs +554 -0
  43. package/runtime/claude/bin/prose-rules/announcing-instead-of-doing.md +24 -0
  44. package/runtime/claude/bin/prose-rules/banned-vocabulary.md +40 -0
  45. package/runtime/claude/bin/prose-rules/coined-terms.md +20 -0
  46. package/runtime/claude/bin/prose-rules/exclamation.md +24 -0
  47. package/runtime/claude/bin/prose-rules/filler-intensifiers.md +24 -0
  48. package/runtime/claude/bin/prose-rules/hedging-stack.md +26 -0
  49. package/runtime/claude/bin/prose-rules/mannered-prose.md +24 -0
  50. package/runtime/claude/bin/prose-rules/not-x-but-y.md +23 -0
  51. package/runtime/claude/bin/prose-rules/one-name-per-thing.md +20 -0
  52. package/runtime/claude/bin/prose-rules/passive-enthusiasm.md +25 -0
  53. package/runtime/claude/bin/prose-rules/process-narration.md +30 -0
  54. package/runtime/claude/bin/prose-rules/rhetorical-opener.md +23 -0
  55. package/runtime/claude/bin/prose-rules/self-contained.md +20 -0
  56. package/runtime/claude/bin/prose-rules/self-praise.md +22 -0
  57. package/runtime/claude/bin/prose-rules/temporal-handwave.md +27 -0
  58. package/runtime/claude/bin/pull.sh +272 -0
  59. package/runtime/claude/bin/qa-inventory.sh +341 -0
  60. package/runtime/claude/bin/search.sh +104 -58
  61. package/runtime/claude/bin/session-start.sh +2 -0
  62. package/runtime/claude/bin/telemetry.sh +65 -18
  63. package/runtime/claude/bin/test-baseline.sh +296 -0
  64. package/runtime/claude/bin/test-changes.sh +196 -145
  65. package/runtime/claude/bin/view-render.sh +6 -2
  66. package/runtime/claude/bin/worktree-create.sh +11 -0
  67. package/runtime/claude/egregore_runtime/adapters/qmd.py +309 -50
  68. package/runtime/claude/egregore_runtime/adapters/qmd_cli.py +6 -3
  69. package/runtime/claude/egregore_runtime/adapters/qmd_scoped.mjs +202 -0
  70. package/runtime/claude/egregore_runtime/adapters/qmd_scoped.py +137 -0
  71. package/runtime/claude/egregore_runtime/adapters/qmd_worker.mjs +123 -0
  72. package/runtime/claude/egregore_runtime/artifacts.py +11 -1
  73. package/runtime/claude/egregore_runtime/contracts.py +25 -1
  74. package/runtime/claude/egregore_runtime/eligibility.py +137 -0
  75. package/runtime/claude/egregore_runtime/episode_binding.py +178 -0
  76. package/runtime/claude/egregore_runtime/excerpts.py +42 -0
  77. package/runtime/claude/egregore_runtime/github_issues.py +244 -0
  78. package/runtime/claude/egregore_runtime/harness_cli.py +545 -402
  79. package/runtime/claude/egregore_runtime/identity.py +52 -0
  80. package/runtime/claude/egregore_runtime/ingest_index_cli.py +4 -2
  81. package/runtime/claude/egregore_runtime/investigation.py +792 -0
  82. package/runtime/claude/egregore_runtime/investigation_contracts.py +104 -0
  83. package/runtime/claude/egregore_runtime/investigation_guidance.py +51 -0
  84. package/runtime/claude/egregore_runtime/issue_cli.py +66 -0
  85. package/runtime/claude/egregore_runtime/issue_markers.py +50 -0
  86. package/runtime/claude/egregore_runtime/issue_reporting.py +224 -0
  87. package/runtime/claude/egregore_runtime/observe.py +41 -6
  88. package/runtime/claude/egregore_runtime/operation_cli.py +76 -0
  89. package/runtime/claude/egregore_runtime/operation_observations.py +208 -0
  90. package/runtime/claude/egregore_runtime/private_result.py +147 -0
  91. package/runtime/claude/egregore_runtime/research_ingest_cli.py +3 -1
  92. package/runtime/claude/egregore_runtime/runtime.py +38 -1
  93. package/runtime/claude/egregore_runtime/scroll_cli.py +1 -1
  94. package/runtime/claude/egregore_runtime/scrolls.py +172 -28
  95. package/runtime/claude/egregore_runtime/sync.py +226 -15
  96. package/runtime/claude/egregore_runtime/sync_health.py +63 -0
  97. package/runtime/claude/egregore_runtime/telemetry.py +102 -10
  98. package/runtime/claude/egregore_runtime/threads.py +4 -1
  99. package/runtime/claude/egregore_runtime/writeback.py +28 -4
  100. package/runtime/claude/manifest.json +42 -0
  101. package/runtime/codex/.claude/context/notification-consent.md +17 -2
  102. package/runtime/codex/.claude/context/retrieval-investigation.md +50 -0
  103. package/runtime/codex/.codex/skills/activity/SKILL.md +4 -0
  104. package/runtime/codex/.codex/skills/announce/SKILL.md +7 -0
  105. package/runtime/codex/.codex/skills/archive/SKILL.md +7 -0
  106. package/runtime/codex/.codex/skills/checkup/SKILL.md +7 -0
  107. package/runtime/codex/.codex/skills/dashboard/SKILL.md +4 -0
  108. package/runtime/codex/.codex/skills/deep-reflect/SKILL.md +8 -0
  109. package/runtime/codex/.codex/skills/handoff/SKILL.md +8 -3
  110. package/runtime/codex/.codex/skills/harvest/SKILL.md +8 -0
  111. package/runtime/codex/.codex/skills/ingest/SKILL.md +4 -0
  112. package/runtime/codex/.codex/skills/ingest-user-interview/SKILL.md +7 -0
  113. package/runtime/codex/.codex/skills/invite/SKILL.md +7 -0
  114. package/runtime/codex/.codex/skills/issue/SKILL.md +102 -0
  115. package/runtime/codex/.codex/skills/meeting/SKILL.md +8 -0
  116. package/runtime/codex/.codex/skills/note/SKILL.md +7 -0
  117. package/runtime/codex/.codex/skills/onboarding/SKILL.md +7 -0
  118. package/runtime/codex/.codex/skills/quest/SKILL.md +7 -0
  119. package/runtime/codex/.codex/skills/reflect/SKILL.md +8 -0
  120. package/runtime/codex/.codex/skills/save/SKILL.md +24 -7
  121. package/runtime/codex/.codex/skills/the-spiral/SKILL.md +10 -1
  122. package/runtime/codex/.codex/skills/tutorial/SKILL.md +8 -0
  123. package/runtime/codex/.codex/skills/view/SKILL.md +8 -0
  124. package/runtime/codex/.codex/skills/wrap/SKILL.md +8 -0
  125. package/runtime/codex/.codex/spec-manifest.json +7 -7
  126. package/runtime/codex/AGENTS.md +60 -74
  127. package/runtime/codex/bin/agent.sh +56 -4
  128. package/runtime/codex/bin/base-branch.sh +62 -0
  129. package/runtime/codex/bin/codex-render-spec.mjs +32 -64
  130. package/runtime/codex/bin/codex-session-start.sh +24 -39
  131. package/runtime/codex/bin/codex-sync-skills.sh +79 -24
  132. package/runtime/codex/bin/graph-op.sh +73 -3
  133. package/runtime/codex/bin/lib/generated-trees.sh +27 -0
  134. package/runtime/codex/bin/lib/git-sync.sh +53 -9
  135. package/runtime/codex/bin/lib/greeting.sh +41 -71
  136. package/runtime/codex/bin/lib/health-footer.sh +115 -0
  137. package/runtime/codex/bin/lib/identity.sh +1 -0
  138. package/runtime/codex/bin/lib/notices.sh +177 -0
  139. package/runtime/codex/bin/lib/repo-paths.sh +40 -0
  140. package/runtime/codex/bin/observe-context.sh +2 -2
  141. package/runtime/codex/bin/pi-render-spec.mjs +0 -1
  142. package/runtime/codex/bin/prime-render-spec.mjs +1 -2
  143. package/runtime/codex/bin/prose-check-tally.sh +102 -0
  144. package/runtime/codex/bin/prose-check.mjs +554 -0
  145. package/runtime/codex/bin/prose-rules/announcing-instead-of-doing.md +24 -0
  146. package/runtime/codex/bin/prose-rules/banned-vocabulary.md +40 -0
  147. package/runtime/codex/bin/prose-rules/coined-terms.md +20 -0
  148. package/runtime/codex/bin/prose-rules/exclamation.md +24 -0
  149. package/runtime/codex/bin/prose-rules/filler-intensifiers.md +24 -0
  150. package/runtime/codex/bin/prose-rules/hedging-stack.md +26 -0
  151. package/runtime/codex/bin/prose-rules/mannered-prose.md +24 -0
  152. package/runtime/codex/bin/prose-rules/not-x-but-y.md +23 -0
  153. package/runtime/codex/bin/prose-rules/one-name-per-thing.md +20 -0
  154. package/runtime/codex/bin/prose-rules/passive-enthusiasm.md +25 -0
  155. package/runtime/codex/bin/prose-rules/process-narration.md +30 -0
  156. package/runtime/codex/bin/prose-rules/rhetorical-opener.md +23 -0
  157. package/runtime/codex/bin/prose-rules/self-contained.md +20 -0
  158. package/runtime/codex/bin/prose-rules/self-praise.md +22 -0
  159. package/runtime/codex/bin/prose-rules/temporal-handwave.md +27 -0
  160. package/runtime/codex/bin/pull.sh +272 -0
  161. package/runtime/codex/bin/qa-inventory.sh +341 -0
  162. package/runtime/codex/bin/search.sh +104 -58
  163. package/runtime/codex/bin/telemetry.sh +65 -18
  164. package/runtime/codex/bin/test-baseline.sh +296 -0
  165. package/runtime/codex/bin/test-changes.sh +196 -145
  166. package/runtime/codex/bin/view-render.sh +6 -2
  167. package/runtime/codex/bin/worktree-create.sh +11 -0
  168. package/runtime/codex/egregore_runtime/adapters/qmd.py +309 -50
  169. package/runtime/codex/egregore_runtime/adapters/qmd_cli.py +6 -3
  170. package/runtime/codex/egregore_runtime/adapters/qmd_scoped.mjs +202 -0
  171. package/runtime/codex/egregore_runtime/adapters/qmd_scoped.py +137 -0
  172. package/runtime/codex/egregore_runtime/adapters/qmd_worker.mjs +123 -0
  173. package/runtime/codex/egregore_runtime/artifacts.py +11 -1
  174. package/runtime/codex/egregore_runtime/contracts.py +25 -1
  175. package/runtime/codex/egregore_runtime/eligibility.py +137 -0
  176. package/runtime/codex/egregore_runtime/episode_binding.py +178 -0
  177. package/runtime/codex/egregore_runtime/excerpts.py +42 -0
  178. package/runtime/codex/egregore_runtime/github_issues.py +244 -0
  179. package/runtime/codex/egregore_runtime/harness_cli.py +545 -402
  180. package/runtime/codex/egregore_runtime/identity.py +52 -0
  181. package/runtime/codex/egregore_runtime/ingest_index_cli.py +4 -2
  182. package/runtime/codex/egregore_runtime/investigation.py +792 -0
  183. package/runtime/codex/egregore_runtime/investigation_contracts.py +104 -0
  184. package/runtime/codex/egregore_runtime/investigation_guidance.py +51 -0
  185. package/runtime/codex/egregore_runtime/issue_cli.py +66 -0
  186. package/runtime/codex/egregore_runtime/issue_markers.py +50 -0
  187. package/runtime/codex/egregore_runtime/issue_reporting.py +224 -0
  188. package/runtime/codex/egregore_runtime/observe.py +41 -6
  189. package/runtime/codex/egregore_runtime/operation_cli.py +76 -0
  190. package/runtime/codex/egregore_runtime/operation_observations.py +208 -0
  191. package/runtime/codex/egregore_runtime/private_result.py +147 -0
  192. package/runtime/codex/egregore_runtime/research_ingest_cli.py +3 -1
  193. package/runtime/codex/egregore_runtime/runtime.py +38 -1
  194. package/runtime/codex/egregore_runtime/scroll_cli.py +1 -1
  195. package/runtime/codex/egregore_runtime/scrolls.py +172 -28
  196. package/runtime/codex/egregore_runtime/sync.py +226 -15
  197. package/runtime/codex/egregore_runtime/sync_health.py +63 -0
  198. package/runtime/codex/egregore_runtime/telemetry.py +102 -10
  199. package/runtime/codex/egregore_runtime/threads.py +4 -1
  200. package/runtime/codex/egregore_runtime/writeback.py +28 -4
  201. package/runtime/codex/manifest.json +42 -0
  202. package/runtime/pi/.claude/context/notification-consent.md +17 -2
  203. package/runtime/pi/.claude/context/retrieval-investigation.md +50 -0
  204. package/runtime/pi/.codex/skills/activity/SKILL.md +4 -0
  205. package/runtime/pi/.codex/skills/announce/SKILL.md +7 -0
  206. package/runtime/pi/.codex/skills/archive/SKILL.md +7 -0
  207. package/runtime/pi/.codex/skills/checkup/SKILL.md +7 -0
  208. package/runtime/pi/.codex/skills/dashboard/SKILL.md +4 -0
  209. package/runtime/pi/.codex/skills/deep-reflect/SKILL.md +8 -0
  210. package/runtime/pi/.codex/skills/handoff/SKILL.md +8 -3
  211. package/runtime/pi/.codex/skills/harvest/SKILL.md +8 -0
  212. package/runtime/pi/.codex/skills/ingest/SKILL.md +4 -0
  213. package/runtime/pi/.codex/skills/ingest-user-interview/SKILL.md +7 -0
  214. package/runtime/pi/.codex/skills/invite/SKILL.md +7 -0
  215. package/runtime/pi/.codex/skills/issue/SKILL.md +102 -0
  216. package/runtime/pi/.codex/skills/meeting/SKILL.md +8 -0
  217. package/runtime/pi/.codex/skills/note/SKILL.md +7 -0
  218. package/runtime/pi/.codex/skills/onboarding/SKILL.md +7 -0
  219. package/runtime/pi/.codex/skills/quest/SKILL.md +7 -0
  220. package/runtime/pi/.codex/skills/reflect/SKILL.md +8 -0
  221. package/runtime/pi/.codex/skills/save/SKILL.md +24 -7
  222. package/runtime/pi/.codex/skills/the-spiral/SKILL.md +10 -1
  223. package/runtime/pi/.codex/skills/tutorial/SKILL.md +8 -0
  224. package/runtime/pi/.codex/skills/view/SKILL.md +8 -0
  225. package/runtime/pi/.codex/skills/wrap/SKILL.md +8 -0
  226. package/runtime/pi/.codex/spec-manifest.json +7 -7
  227. package/runtime/pi/.pi/APPEND_SYSTEM.md +35 -17
  228. package/runtime/pi/.pi/extensions/egregore.ts +8 -7
  229. package/runtime/pi/.pi/spec-manifest.json +2 -2
  230. package/runtime/pi/AGENTS.md +60 -74
  231. package/runtime/pi/bin/agent.sh +56 -4
  232. package/runtime/pi/bin/base-branch.sh +62 -0
  233. package/runtime/pi/bin/codex-render-spec.mjs +32 -64
  234. package/runtime/pi/bin/codex-session-start.sh +24 -39
  235. package/runtime/pi/bin/codex-sync-skills.sh +79 -24
  236. package/runtime/pi/bin/graph-op.sh +73 -3
  237. package/runtime/pi/bin/lib/generated-trees.sh +27 -0
  238. package/runtime/pi/bin/lib/git-sync.sh +53 -9
  239. package/runtime/pi/bin/lib/greeting.sh +41 -71
  240. package/runtime/pi/bin/lib/health-footer.sh +115 -0
  241. package/runtime/pi/bin/lib/identity.sh +1 -0
  242. package/runtime/pi/bin/lib/notices.sh +177 -0
  243. package/runtime/pi/bin/lib/repo-paths.sh +40 -0
  244. package/runtime/pi/bin/observe-context.sh +2 -2
  245. package/runtime/pi/bin/pi-observe-context.mjs +38 -2
  246. package/runtime/pi/bin/pi-render-spec.mjs +0 -1
  247. package/runtime/pi/bin/prime-render-spec.mjs +1 -2
  248. package/runtime/pi/bin/prose-check-tally.sh +102 -0
  249. package/runtime/pi/bin/prose-check.mjs +554 -0
  250. package/runtime/pi/bin/prose-rules/announcing-instead-of-doing.md +24 -0
  251. package/runtime/pi/bin/prose-rules/banned-vocabulary.md +40 -0
  252. package/runtime/pi/bin/prose-rules/coined-terms.md +20 -0
  253. package/runtime/pi/bin/prose-rules/exclamation.md +24 -0
  254. package/runtime/pi/bin/prose-rules/filler-intensifiers.md +24 -0
  255. package/runtime/pi/bin/prose-rules/hedging-stack.md +26 -0
  256. package/runtime/pi/bin/prose-rules/mannered-prose.md +24 -0
  257. package/runtime/pi/bin/prose-rules/not-x-but-y.md +23 -0
  258. package/runtime/pi/bin/prose-rules/one-name-per-thing.md +20 -0
  259. package/runtime/pi/bin/prose-rules/passive-enthusiasm.md +25 -0
  260. package/runtime/pi/bin/prose-rules/process-narration.md +30 -0
  261. package/runtime/pi/bin/prose-rules/rhetorical-opener.md +23 -0
  262. package/runtime/pi/bin/prose-rules/self-contained.md +20 -0
  263. package/runtime/pi/bin/prose-rules/self-praise.md +22 -0
  264. package/runtime/pi/bin/prose-rules/temporal-handwave.md +27 -0
  265. package/runtime/pi/bin/pull.sh +272 -0
  266. package/runtime/pi/bin/qa-inventory.sh +341 -0
  267. package/runtime/pi/bin/search.sh +104 -58
  268. package/runtime/pi/bin/telemetry.sh +65 -18
  269. package/runtime/pi/bin/test-baseline.sh +296 -0
  270. package/runtime/pi/bin/test-changes.sh +196 -145
  271. package/runtime/pi/bin/view-render.sh +6 -2
  272. package/runtime/pi/bin/worktree-create.sh +11 -0
  273. package/runtime/pi/egregore_runtime/adapters/qmd.py +309 -50
  274. package/runtime/pi/egregore_runtime/adapters/qmd_cli.py +6 -3
  275. package/runtime/pi/egregore_runtime/adapters/qmd_scoped.mjs +202 -0
  276. package/runtime/pi/egregore_runtime/adapters/qmd_scoped.py +137 -0
  277. package/runtime/pi/egregore_runtime/adapters/qmd_worker.mjs +123 -0
  278. package/runtime/pi/egregore_runtime/artifacts.py +11 -1
  279. package/runtime/pi/egregore_runtime/contracts.py +25 -1
  280. package/runtime/pi/egregore_runtime/eligibility.py +137 -0
  281. package/runtime/pi/egregore_runtime/episode_binding.py +178 -0
  282. package/runtime/pi/egregore_runtime/excerpts.py +42 -0
  283. package/runtime/pi/egregore_runtime/github_issues.py +244 -0
  284. package/runtime/pi/egregore_runtime/harness_cli.py +545 -402
  285. package/runtime/pi/egregore_runtime/identity.py +52 -0
  286. package/runtime/pi/egregore_runtime/ingest_index_cli.py +4 -2
  287. package/runtime/pi/egregore_runtime/investigation.py +792 -0
  288. package/runtime/pi/egregore_runtime/investigation_contracts.py +104 -0
  289. package/runtime/pi/egregore_runtime/investigation_guidance.py +51 -0
  290. package/runtime/pi/egregore_runtime/issue_cli.py +66 -0
  291. package/runtime/pi/egregore_runtime/issue_markers.py +50 -0
  292. package/runtime/pi/egregore_runtime/issue_reporting.py +224 -0
  293. package/runtime/pi/egregore_runtime/observe.py +41 -6
  294. package/runtime/pi/egregore_runtime/operation_cli.py +76 -0
  295. package/runtime/pi/egregore_runtime/operation_observations.py +208 -0
  296. package/runtime/pi/egregore_runtime/private_result.py +147 -0
  297. package/runtime/pi/egregore_runtime/research_ingest_cli.py +3 -1
  298. package/runtime/pi/egregore_runtime/runtime.py +38 -1
  299. package/runtime/pi/egregore_runtime/scroll_cli.py +1 -1
  300. package/runtime/pi/egregore_runtime/scrolls.py +172 -28
  301. package/runtime/pi/egregore_runtime/sync.py +226 -15
  302. package/runtime/pi/egregore_runtime/sync_health.py +63 -0
  303. package/runtime/pi/egregore_runtime/telemetry.py +102 -10
  304. package/runtime/pi/egregore_runtime/threads.py +4 -1
  305. package/runtime/pi/egregore_runtime/writeback.py +28 -4
  306. package/runtime/pi/manifest.json +42 -0
  307. package/runtime/prime/.claude/context/notification-consent.md +17 -2
  308. package/runtime/prime/.claude/context/retrieval-investigation.md +50 -0
  309. package/runtime/prime/.codex/skills/activity/SKILL.md +4 -0
  310. package/runtime/prime/.codex/skills/announce/SKILL.md +7 -0
  311. package/runtime/prime/.codex/skills/archive/SKILL.md +7 -0
  312. package/runtime/prime/.codex/skills/checkup/SKILL.md +7 -0
  313. package/runtime/prime/.codex/skills/dashboard/SKILL.md +4 -0
  314. package/runtime/prime/.codex/skills/deep-reflect/SKILL.md +8 -0
  315. package/runtime/prime/.codex/skills/handoff/SKILL.md +8 -3
  316. package/runtime/prime/.codex/skills/harvest/SKILL.md +8 -0
  317. package/runtime/prime/.codex/skills/ingest/SKILL.md +4 -0
  318. package/runtime/prime/.codex/skills/ingest-user-interview/SKILL.md +7 -0
  319. package/runtime/prime/.codex/skills/invite/SKILL.md +7 -0
  320. package/runtime/prime/.codex/skills/issue/SKILL.md +102 -0
  321. package/runtime/prime/.codex/skills/meeting/SKILL.md +8 -0
  322. package/runtime/prime/.codex/skills/note/SKILL.md +7 -0
  323. package/runtime/prime/.codex/skills/onboarding/SKILL.md +7 -0
  324. package/runtime/prime/.codex/skills/quest/SKILL.md +7 -0
  325. package/runtime/prime/.codex/skills/reflect/SKILL.md +8 -0
  326. package/runtime/prime/.codex/skills/save/SKILL.md +24 -7
  327. package/runtime/prime/.codex/skills/the-spiral/SKILL.md +10 -1
  328. package/runtime/prime/.codex/skills/tutorial/SKILL.md +8 -0
  329. package/runtime/prime/.codex/skills/view/SKILL.md +8 -0
  330. package/runtime/prime/.codex/skills/wrap/SKILL.md +8 -0
  331. package/runtime/prime/.codex/spec-manifest.json +7 -7
  332. package/runtime/prime/.prime/agent/APPEND_SYSTEM.md +36 -18
  333. package/runtime/prime/.prime/agent/extensions/egregore.ts +8 -7
  334. package/runtime/prime/.prime/agent/skills/egregore/src/egregore/__init__.py +14 -2
  335. package/runtime/prime/.prime/agent/spec-manifest.json +2 -2
  336. package/runtime/prime/AGENTS.md +60 -74
  337. package/runtime/prime/bin/agent.sh +56 -4
  338. package/runtime/prime/bin/base-branch.sh +62 -0
  339. package/runtime/prime/bin/codex-render-spec.mjs +32 -64
  340. package/runtime/prime/bin/codex-session-start.sh +24 -39
  341. package/runtime/prime/bin/codex-sync-skills.sh +79 -24
  342. package/runtime/prime/bin/graph-op.sh +73 -3
  343. package/runtime/prime/bin/lib/generated-trees.sh +27 -0
  344. package/runtime/prime/bin/lib/git-sync.sh +53 -9
  345. package/runtime/prime/bin/lib/greeting.sh +41 -71
  346. package/runtime/prime/bin/lib/health-footer.sh +115 -0
  347. package/runtime/prime/bin/lib/identity.sh +1 -0
  348. package/runtime/prime/bin/lib/notices.sh +177 -0
  349. package/runtime/prime/bin/lib/repo-paths.sh +40 -0
  350. package/runtime/prime/bin/observe-context.sh +2 -2
  351. package/runtime/prime/bin/pi-observe-context.mjs +38 -2
  352. package/runtime/prime/bin/pi-render-spec.mjs +0 -1
  353. package/runtime/prime/bin/prime-render-spec.mjs +1 -2
  354. package/runtime/prime/bin/prose-check-tally.sh +102 -0
  355. package/runtime/prime/bin/prose-check.mjs +554 -0
  356. package/runtime/prime/bin/prose-rules/announcing-instead-of-doing.md +24 -0
  357. package/runtime/prime/bin/prose-rules/banned-vocabulary.md +40 -0
  358. package/runtime/prime/bin/prose-rules/coined-terms.md +20 -0
  359. package/runtime/prime/bin/prose-rules/exclamation.md +24 -0
  360. package/runtime/prime/bin/prose-rules/filler-intensifiers.md +24 -0
  361. package/runtime/prime/bin/prose-rules/hedging-stack.md +26 -0
  362. package/runtime/prime/bin/prose-rules/mannered-prose.md +24 -0
  363. package/runtime/prime/bin/prose-rules/not-x-but-y.md +23 -0
  364. package/runtime/prime/bin/prose-rules/one-name-per-thing.md +20 -0
  365. package/runtime/prime/bin/prose-rules/passive-enthusiasm.md +25 -0
  366. package/runtime/prime/bin/prose-rules/process-narration.md +30 -0
  367. package/runtime/prime/bin/prose-rules/rhetorical-opener.md +23 -0
  368. package/runtime/prime/bin/prose-rules/self-contained.md +20 -0
  369. package/runtime/prime/bin/prose-rules/self-praise.md +22 -0
  370. package/runtime/prime/bin/prose-rules/temporal-handwave.md +27 -0
  371. package/runtime/prime/bin/pull.sh +272 -0
  372. package/runtime/prime/bin/qa-inventory.sh +341 -0
  373. package/runtime/prime/bin/search.sh +104 -58
  374. package/runtime/prime/bin/telemetry.sh +65 -18
  375. package/runtime/prime/bin/test-baseline.sh +296 -0
  376. package/runtime/prime/bin/test-changes.sh +196 -145
  377. package/runtime/prime/bin/view-render.sh +6 -2
  378. package/runtime/prime/bin/worktree-create.sh +11 -0
  379. package/runtime/prime/egregore_runtime/adapters/qmd.py +309 -50
  380. package/runtime/prime/egregore_runtime/adapters/qmd_cli.py +6 -3
  381. package/runtime/prime/egregore_runtime/adapters/qmd_scoped.mjs +202 -0
  382. package/runtime/prime/egregore_runtime/adapters/qmd_scoped.py +137 -0
  383. package/runtime/prime/egregore_runtime/adapters/qmd_worker.mjs +123 -0
  384. package/runtime/prime/egregore_runtime/artifacts.py +11 -1
  385. package/runtime/prime/egregore_runtime/contracts.py +25 -1
  386. package/runtime/prime/egregore_runtime/eligibility.py +137 -0
  387. package/runtime/prime/egregore_runtime/episode_binding.py +178 -0
  388. package/runtime/prime/egregore_runtime/excerpts.py +42 -0
  389. package/runtime/prime/egregore_runtime/github_issues.py +244 -0
  390. package/runtime/prime/egregore_runtime/harness_cli.py +545 -402
  391. package/runtime/prime/egregore_runtime/identity.py +52 -0
  392. package/runtime/prime/egregore_runtime/ingest_index_cli.py +4 -2
  393. package/runtime/prime/egregore_runtime/investigation.py +792 -0
  394. package/runtime/prime/egregore_runtime/investigation_contracts.py +104 -0
  395. package/runtime/prime/egregore_runtime/investigation_guidance.py +51 -0
  396. package/runtime/prime/egregore_runtime/issue_cli.py +66 -0
  397. package/runtime/prime/egregore_runtime/issue_markers.py +50 -0
  398. package/runtime/prime/egregore_runtime/issue_reporting.py +224 -0
  399. package/runtime/prime/egregore_runtime/observe.py +41 -6
  400. package/runtime/prime/egregore_runtime/operation_cli.py +76 -0
  401. package/runtime/prime/egregore_runtime/operation_observations.py +208 -0
  402. package/runtime/prime/egregore_runtime/private_result.py +147 -0
  403. package/runtime/prime/egregore_runtime/research_ingest_cli.py +3 -1
  404. package/runtime/prime/egregore_runtime/runtime.py +38 -1
  405. package/runtime/prime/egregore_runtime/scroll_cli.py +1 -1
  406. package/runtime/prime/egregore_runtime/scrolls.py +172 -28
  407. package/runtime/prime/egregore_runtime/sync.py +226 -15
  408. package/runtime/prime/egregore_runtime/sync_health.py +63 -0
  409. package/runtime/prime/egregore_runtime/telemetry.py +102 -10
  410. package/runtime/prime/egregore_runtime/threads.py +4 -1
  411. package/runtime/prime/egregore_runtime/writeback.py +28 -4
  412. package/runtime/prime/manifest.json +42 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // egregore-launcher-version: 0.21.0-runtime-mvp.27
2
+ // egregore-launcher-version: 0.21.0-runtime-mvp.28
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.27";
38
+ const VERSION = "0.21.0-runtime-mvp.28";
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");
@@ -753,72 +753,120 @@ async function renderCodexStartupCard(egregoreDir) {
753
753
  return false;
754
754
  }
755
755
 
756
- function codexSupportMessage(egregoreDir) {
757
- return [
758
- "Codex harness support is missing from this Egregore checkout.",
759
- ` path: ${egregoreDir}`,
760
- "",
761
- "This checkout needs a newer Egregore core with:",
762
- " bin/codex-session-start.sh",
763
- " bin/codex-install-skills.sh",
764
- " .codex/config.toml",
765
- " .codex/skills/",
766
- " .codex/hooks.json",
767
- " .codex/hooks/",
768
- "",
769
- "Restore this instance using its installed runtime version, then rerun egregore.",
770
- "A global CLI refresh does not repair instance files.",
771
- "Egregore workflows appear as slash commands. In Codex, invoke them with the matching $skill token or ask in natural language.",
772
- ].join("\n");
756
+ const CORE_SUPPORT_PATHS = {
757
+ codex: [
758
+ "bin/codex-session-start.sh",
759
+ "bin/codex-install-skills.sh",
760
+ ".codex/config.toml",
761
+ ".codex/skills",
762
+ ".codex/hooks.json",
763
+ ".codex/hooks",
764
+ ],
765
+ pi: [
766
+ "bin/pi-session-start.sh",
767
+ ".pi/APPEND_SYSTEM.md",
768
+ ".pi/settings.json",
769
+ ".pi/extensions/egregore.ts",
770
+ ".codex/skills",
771
+ ],
772
+ prime: [
773
+ "bin/prime-session-start.sh",
774
+ ".prime/agent/APPEND_SYSTEM.md",
775
+ ".prime/agent/settings.json",
776
+ ".prime/agent/extensions/egregore.ts",
777
+ ".codex/skills",
778
+ ],
779
+ };
780
+
781
+ function missingCorePaths(runtime, egregoreDir) {
782
+ return (CORE_SUPPORT_PATHS[runtime] || []).filter(
783
+ (rel) => !fs.existsSync(path.join(egregoreDir, ...rel.split("/"))),
784
+ );
773
785
  }
774
786
 
775
787
  function hasCodexCoreSupport(egregoreDir) {
776
- return (
777
- fs.existsSync(path.join(egregoreDir, "bin", "codex-session-start.sh")) &&
778
- fs.existsSync(path.join(egregoreDir, "bin", "codex-install-skills.sh")) &&
779
- fs.existsSync(path.join(egregoreDir, ".codex", "config.toml")) &&
780
- fs.existsSync(path.join(egregoreDir, ".codex", "skills")) &&
781
- fs.existsSync(path.join(egregoreDir, ".codex", "hooks.json")) &&
782
- fs.existsSync(path.join(egregoreDir, ".codex", "hooks"))
783
- );
788
+ return missingCorePaths("codex", egregoreDir).length === 0;
784
789
  }
785
790
 
786
791
  function hasPiCoreSupport(egregoreDir) {
787
- return (
788
- fs.existsSync(path.join(egregoreDir, "bin", "pi-session-start.sh")) &&
789
- fs.existsSync(path.join(egregoreDir, ".pi", "APPEND_SYSTEM.md")) &&
790
- fs.existsSync(path.join(egregoreDir, ".pi", "settings.json")) &&
791
- fs.existsSync(path.join(egregoreDir, ".pi", "extensions", "egregore.ts")) &&
792
- fs.existsSync(path.join(egregoreDir, ".codex", "skills"))
793
- );
792
+ return missingCorePaths("pi", egregoreDir).length === 0;
794
793
  }
795
794
 
796
- function piSupportMessage(egregoreDir) {
797
- return [
798
- "Pi meta-harness support is missing from this Egregore checkout.",
795
+ function hasPrimeCoreSupport(egregoreDir) {
796
+ return missingCorePaths("prime", egregoreDir).length === 0;
797
+ }
798
+
799
+ // The repair command is pinned to this launcher's own release. `@latest`
800
+ // once pulled another release channel's files into an instance; the
801
+ // launcher and the files it installs must always be the same version.
802
+ function harnessAddCommand(runtime) {
803
+ return `npx -y ${PUBLIC_NPX_PACKAGE}@${VERSION} --add-harness ${runtimeShort(runtime)}`;
804
+ }
805
+
806
+ function harnessSupportMessage(runtime, egregoreDir) {
807
+ const label = runtimeLabel(runtime);
808
+ const missing = missingCorePaths(runtime, egregoreDir);
809
+ const lines = [
810
+ `${label} support is missing from this Egregore checkout.`,
799
811
  ` path: ${egregoreDir}`,
812
+ ];
813
+ if (missing.length > 0) {
814
+ lines.push("", "Missing:");
815
+ for (const rel of missing) lines.push(` ${rel}`);
816
+ }
817
+ lines.push(
800
818
  "",
801
- "Restore this instance using its installed runtime version, then rerun egregore.",
802
- ].join("\n");
819
+ `Add ${label} support to this instance (missing files only, nothing overwritten):`,
820
+ ` cd ${egregoreDir}`,
821
+ ` ${harnessAddCommand(runtime)}`,
822
+ "Then rerun egregore.",
823
+ );
824
+ if (runtime === "codex") {
825
+ lines.push("Egregore workflows appear as slash commands. In Codex, invoke them with the matching $skill token or ask in natural language.");
826
+ }
827
+ return lines.join("\n");
803
828
  }
804
829
 
805
- function hasPrimeCoreSupport(egregoreDir) {
806
- return (
807
- fs.existsSync(path.join(egregoreDir, "bin", "prime-session-start.sh")) &&
808
- fs.existsSync(path.join(egregoreDir, ".prime", "agent", "APPEND_SYSTEM.md")) &&
809
- fs.existsSync(path.join(egregoreDir, ".prime", "agent", "settings.json")) &&
810
- fs.existsSync(path.join(egregoreDir, ".prime", "agent", "extensions", "egregore.ts")) &&
811
- fs.existsSync(path.join(egregoreDir, ".codex", "skills"))
812
- );
830
+ function codexSupportMessage(egregoreDir) {
831
+ return harnessSupportMessage("codex", egregoreDir);
832
+ }
833
+
834
+ function piSupportMessage(egregoreDir) {
835
+ return harnessSupportMessage("pi", egregoreDir);
813
836
  }
814
837
 
815
838
  function primeSupportMessage(egregoreDir) {
816
- return [
817
- "Prime Agent runtime support is missing from this Egregore checkout.",
818
- ` path: ${egregoreDir}`,
839
+ return harnessSupportMessage("prime", egregoreDir);
840
+ }
841
+
842
+ // A launch that fails the support check offers to add exactly that harness
843
+ // to exactly this instance, using this launcher's own release. Without a
844
+ // terminal to ask, print the command and stop; never install unattended.
845
+ async function ensureHarnessSupport(inst, runtime) {
846
+ if (missingCorePaths(runtime, inst.path).length === 0) return;
847
+ const message = harnessSupportMessage(runtime, inst.path);
848
+ if (!canPrompt()) die(message);
849
+ const label = runtimeLabel(runtime);
850
+ const name = inst.name || inst.slug || path.basename(inst.path);
851
+ process.stdout.write([
819
852
  "",
820
- "Restore this instance using its installed runtime version, then rerun egregore.",
821
- ].join("\n");
853
+ ` ${BOLD}${label} support is missing from ${name}.${RESET}`,
854
+ ` ${DIM}Missing: ${missingCorePaths(runtime, inst.path).join(", ")}${RESET}`,
855
+ ` ${DIM}Egregore can add it now. Only missing files are written; nothing is overwritten:${RESET}`,
856
+ ` ${harnessAddCommand(runtime)}`,
857
+ "",
858
+ ].join("\n"));
859
+ const yes = await confirmLine(`Add ${label} support to ${name} now?`);
860
+ if (!yes) die(message);
861
+ const result = spawnSync(
862
+ "npx",
863
+ ["-y", `${PUBLIC_NPX_PACKAGE}@${VERSION}`, "--add-harness", runtimeShort(runtime)],
864
+ { cwd: inst.path, stdio: "inherit", env: process.env, timeout: 3 * 60 * 1000 },
865
+ );
866
+ if (result.error || result.status !== 0 || missingCorePaths(runtime, inst.path).length > 0) {
867
+ die(`${label} support could not be added automatically.\n\n${harnessSupportMessage(runtime, inst.path)}`);
868
+ }
869
+ process.stdout.write(` ${GREEN}✓${RESET} ${label} support added to ${name}\n\n`);
822
870
  }
823
871
 
824
872
  // Minimal y/N line prompt for pre-launch decisions (the TUI select machinery
@@ -873,7 +921,7 @@ function primeAuthHint() {
873
921
 
874
922
  function installCodexSkills(egregoreDir) {
875
923
  const script = path.join(egregoreDir, "bin", "codex-install-skills.sh");
876
- if (!fs.existsSync(script)) return false;
924
+ if (!fs.existsSync(script)) return { ok: false, stderr: `missing ${script}` };
877
925
  try {
878
926
  const result = spawnSync("bash", [script], {
879
927
  cwd: egregoreDir,
@@ -881,9 +929,9 @@ function installCodexSkills(egregoreDir) {
881
929
  encoding: "utf-8",
882
930
  maxBuffer: 1024 * 1024,
883
931
  });
884
- return result.status === 0;
885
- } catch {
886
- return false;
932
+ return { ok: result.status === 0, stderr: (result.stderr || "").trim() };
933
+ } catch (err) {
934
+ return { ok: false, stderr: String(err && err.message ? err.message : err) };
887
935
  }
888
936
  }
889
937
 
@@ -966,29 +1014,31 @@ async function launch(inst, runtimeOverride) {
966
1014
  }
967
1015
  }
968
1016
  if (runtime === "codex") {
969
- // Launching never changes an instance's runtime or release channel.
970
- if (!hasCodexCoreSupport(inst.path)) die(codexSupportMessage(inst.path));
971
- const skillsInstalled = installCodexSkills(inst.path);
1017
+ // Launching never changes an instance's runtime or release channel. A
1018
+ // missing harness is added only with the user's consent, one harness
1019
+ // into this one instance, at this launcher's own version.
1020
+ await ensureHarnessSupport(inst, runtime);
1021
+ const skills = installCodexSkills(inst.path);
1022
+ if (!skills.ok) {
1023
+ die(`Codex skill setup failed in ${inst.path} (bin/codex-install-skills.sh):\n${skills.stderr || " (no error output)"}`);
1024
+ }
972
1025
  const cardRendered = await renderCodexStartupCard(inst.path);
973
- if (!skillsInstalled || !cardRendered) {
974
- die(codexSupportMessage(inst.path));
1026
+ if (!cardRendered) {
1027
+ die(`Codex startup card failed in ${inst.path} (bin/codex-session-start.sh exited non-zero; its output is above).`);
975
1028
  }
976
1029
  } else if (runtime === "pi") {
977
- if (!hasPiCoreSupport(inst.path)) {
978
- die(piSupportMessage(inst.path));
979
- }
1030
+ await ensureHarnessSupport(inst, runtime);
980
1031
  }
981
1032
  let launchArgs = null;
982
1033
  if (runtime === "prime") {
1034
+ await ensureHarnessSupport(inst, runtime);
983
1035
  // Cover the gap between choosing the harness and Prime's first paint:
984
- // the loader runs through the launcher-side pre-flight (core-support
985
- // check + the trust-flag probe, which shells out to the binary), then a
986
- // single handoff line explains the remaining in-harness startup.
1036
+ // the loader runs through the launcher-side pre-flight (the trust-flag
1037
+ // probe, which shells out to the binary), then a single handoff line
1038
+ // explains the remaining in-harness startup.
987
1039
  const stopLoader = startSpinner("Starting Prime Agent");
988
- const coreOk = hasPrimeCoreSupport(inst.path);
989
- launchArgs = coreOk ? runtimeLaunchArgs(runtime, inst.path) : null;
1040
+ launchArgs = runtimeLaunchArgs(runtime, inst.path);
990
1041
  stopLoader();
991
- if (!coreOk) die(primeSupportMessage(inst.path));
992
1042
  primeAuthHint();
993
1043
  process.stdout.write(` ${CYAN}◆${RESET} ${BOLD}Prime Agent starting${RESET}${DIM} — the Egregore greeting loads inside in a few seconds${RESET}\n`);
994
1044
  }
package/bin/cli.js CHANGED
@@ -91,6 +91,32 @@ function detectCwdEgregore(cwd) {
91
91
  }
92
92
  }
93
93
 
94
+ // Resolve which instance `--add-harness` writes into. Explicit `--instance`
95
+ // wins; otherwise the current directory when it is an instance; otherwise the
96
+ // only registered instance. Several registered instances and no explicit
97
+ // choice is an error — this command must never fan out.
98
+ function resolveAddHarnessTarget(explicitPath) {
99
+ const isInstance = (dir) => dir && fs.existsSync(path.join(dir, "egregore.json"));
100
+ if (explicitPath) {
101
+ const dir = path.resolve(explicitPath);
102
+ if (isInstance(dir)) return dir;
103
+ ui.error(`Not an Egregore instance: ${dir} (no egregore.json).`);
104
+ return null;
105
+ }
106
+ let cwd = null;
107
+ try { cwd = process.cwd(); } catch {}
108
+ if (isInstance(cwd)) return cwd;
109
+ const registered = readLocalInstances().filter((inst) => isInstance(inst.path));
110
+ if (registered.length === 1) return path.resolve(registered[0].path);
111
+ if (registered.length === 0) {
112
+ ui.error("No Egregore instance found. Run this inside the instance directory, or pass --instance <path>.");
113
+ return null;
114
+ }
115
+ ui.error("Several Egregore instances are registered. Pass --instance <path> to choose one:");
116
+ for (const inst of registered) ui.info(` ${inst.path}`);
117
+ return null;
118
+ }
119
+
94
120
  function binaryOnPath(bin) {
95
121
  return commandExists(bin);
96
122
  }
@@ -211,6 +237,14 @@ function parseArgs(argv) {
211
237
  args.refreshLauncher = true;
212
238
  } else if (argv[i] === "--refresh-connect") {
213
239
  args.refreshConnect = true;
240
+ } else if (argv[i] === "--add-harness" && argv[i + 1]) {
241
+ args.addHarness = argv[++i];
242
+ } else if (argv[i].startsWith("--add-harness=")) {
243
+ args.addHarness = argv[i].split("=")[1];
244
+ } else if (argv[i] === "--instance" && argv[i + 1]) {
245
+ args.instance = argv[++i];
246
+ } else if (argv[i].startsWith("--instance=")) {
247
+ args.instance = argv[i].split("=")[1];
214
248
  } else if (argv[i] === "--codex") {
215
249
  args.runtime = "codex";
216
250
  } else if (argv[i] === "--pi") {
@@ -386,7 +420,9 @@ function showHelp() {
386
420
  ui.info(" --force Skip the in-repo detection check");
387
421
  ui.info(" --no-autolaunch Don't launch the harness at the end (for CI)");
388
422
  ui.info(" --no-screens Skip the full-screen welcome/ready bookends");
389
- ui.info(" --refresh-launcher Refresh the Egregore CLI and runtime packs, then exit");
423
+ ui.info(" --refresh-launcher Refresh only the global Egregore CLI, then exit");
424
+ ui.info(" --add-harness <h> Add codex, pi, or prime support to one existing instance (missing files only)");
425
+ ui.info(" --instance <path> Instance for --add-harness (default: cwd, or the only registered instance)");
390
426
  ui.info(" -h, --help Show this help");
391
427
  ui.info("");
392
428
  }
@@ -433,6 +469,39 @@ async function main() {
433
469
  }
434
470
  }
435
471
 
472
+ if (args.addHarness) {
473
+ // Explicit, instance-scoped harness addition. This is the only path that
474
+ // writes harness files into an existing instance from the global CLI: one
475
+ // harness, one instance, missing files only. The launcher invokes it with
476
+ // its own pinned version when a launch fails the support check.
477
+ const { addHarnessRuntime, harnessLabel, normalizeHarness } = require("../lib/harness-add");
478
+ const harness = normalizeHarness(args.addHarness);
479
+ if (!harness) {
480
+ ui.error(`Unknown harness "${args.addHarness}". Use --add-harness codex, pi, or prime.`);
481
+ process.exit(1);
482
+ }
483
+ const targetDir = resolveAddHarnessTarget(args.instance);
484
+ if (!targetDir) process.exit(1);
485
+ try {
486
+ const summary = addHarnessRuntime(targetDir, harness);
487
+ const label = harnessLabel(harness);
488
+ if (summary.installed.length === 0) {
489
+ ui.success(`${label} support already present in ${targetDir}`);
490
+ } else {
491
+ ui.success(`Added ${label} support to ${targetDir} ${ui.dim(`(${summary.installed.length} files, ${summary.present} kept)`)}`);
492
+ }
493
+ if (!summary.ready) {
494
+ ui.warn(`${label} support is still incomplete in ${targetDir}; an existing file may be a directory or symlink where a file is expected.`);
495
+ process.exit(1);
496
+ }
497
+ ui.info(`Run: egregore --runtime ${harness}`);
498
+ return;
499
+ } catch (err) {
500
+ ui.error(String(err.message || err));
501
+ process.exit(1);
502
+ }
503
+ }
504
+
436
505
  if (args.refreshConnect) {
437
506
  // Session-start maintenance mode: refresh the Connect overlay for an
438
507
  // existing instance. Local instances no-op instantly; network failure is
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+
3
+ // Add one harness (Codex, Pi, Prime Agent) to an existing instance.
4
+ //
5
+ // Setup overlays only the harness chosen at install time, so a Claude-only
6
+ // instance has no Codex files. The September 2026 launcher auto-repair fixed
7
+ // that by running the *latest* installer against *every* registered instance,
8
+ // which overwrote and deleted files in instances on another release channel.
9
+ // This module is the scoped replacement:
10
+ //
11
+ // - one harness, one instance, chosen explicitly;
12
+ // - copies only files that are missing from that harness's packaged bundle;
13
+ // - never overwrites, never deletes, never touches another harness;
14
+ // - records what it wrote in its own manifest so nothing else claims
15
+ // ownership of pre-existing files.
16
+
17
+ const fs = require("node:fs");
18
+ const path = require("node:path");
19
+
20
+ const PACKAGE = require("../package.json");
21
+
22
+ const HARNESSES = {
23
+ codex: { label: "Codex", module: "./codex-runtime", bundle: "codex" },
24
+ pi: { label: "Pi", module: "./pi-runtime", bundle: "pi" },
25
+ prime: { label: "Prime Agent", module: "./prime-runtime", bundle: "prime" },
26
+ };
27
+
28
+ function normalizeHarness(name) {
29
+ const value = String(name || "").trim().toLowerCase();
30
+ if (value === "codex") return "codex";
31
+ if (value === "pi") return "pi";
32
+ if (value === "prime" || value === "prime-agent") return "prime";
33
+ return null;
34
+ }
35
+
36
+ function harnessLabel(harness) {
37
+ return (HARNESSES[harness] && HARNESSES[harness].label) || harness;
38
+ }
39
+
40
+ function bundleDirFor(harness) {
41
+ return path.join(__dirname, "..", "runtime", HARNESSES[harness].bundle);
42
+ }
43
+
44
+ function listFiles(dir, prefix = "") {
45
+ if (!fs.existsSync(dir)) return [];
46
+ const result = [];
47
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
48
+ const rel = prefix ? path.join(prefix, entry.name) : entry.name;
49
+ const full = path.join(dir, entry.name);
50
+ if (entry.isDirectory()) {
51
+ result.push(...listFiles(full, rel));
52
+ } else if (entry.isFile()) {
53
+ result.push(rel);
54
+ }
55
+ }
56
+ return result.sort();
57
+ }
58
+
59
+ function pathExistsOrSymlink(file) {
60
+ try {
61
+ fs.lstatSync(file);
62
+ return true;
63
+ } catch {
64
+ return false;
65
+ }
66
+ }
67
+
68
+ function copyMissingFile(src, dest) {
69
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
70
+ fs.copyFileSync(src, dest);
71
+ try {
72
+ const mode = fs.statSync(src).mode & 0o777;
73
+ fs.chmodSync(dest, mode);
74
+ } catch {}
75
+ }
76
+
77
+ // Required paths come from the harness module so the CLI and the launcher's
78
+ // pre-launch check agree on what "support present" means.
79
+ function requiredPathsFor(harness) {
80
+ const mod = require(HARNESSES[harness].module);
81
+ const checker = mod.hasCodexRuntimeSupport || mod.hasPiRuntimeSupport || mod.hasPrimeRuntimeSupport;
82
+ return { hasSupport: (dir) => Boolean(checker && checker(dir)) };
83
+ }
84
+
85
+ function manifestPath(egregoreDir, harness) {
86
+ return path.join(egregoreDir, ".egregore", `${harness}-harness-add.json`);
87
+ }
88
+
89
+ // Current Codex discovers project skills via .agents/skills -> ../.codex/skills.
90
+ // Create the link only when nothing is there; never replace a real directory.
91
+ function ensureAgentsSkillsLink(egregoreDir, summary) {
92
+ const agentsDir = path.join(egregoreDir, ".agents");
93
+ const link = path.join(agentsDir, "skills");
94
+ if (pathExistsOrSymlink(link)) return;
95
+ try {
96
+ fs.mkdirSync(agentsDir, { recursive: true });
97
+ fs.symlinkSync(path.join("..", ".codex", "skills"), link);
98
+ summary.installed.push(".agents/skills");
99
+ } catch {}
100
+ }
101
+
102
+ /**
103
+ * Copy every file of `harness`'s packaged bundle that is missing from
104
+ * `egregoreDir`. Existing files are left untouched regardless of content.
105
+ *
106
+ * Returns { harness, installed: [rel...], present: n, ready: bool }.
107
+ */
108
+ function addHarnessRuntime(egregoreDir, harnessName) {
109
+ const harness = normalizeHarness(harnessName);
110
+ if (!harness) {
111
+ throw new Error(`Unknown harness "${harnessName}". Expected codex, pi, or prime.`);
112
+ }
113
+ const bundleDir = bundleDirFor(harness);
114
+ if (!fs.existsSync(bundleDir)) {
115
+ throw new Error(`This create-egregore release ships no ${harnessLabel(harness)} bundle (${bundleDir}).`);
116
+ }
117
+ if (!fs.existsSync(path.join(egregoreDir, "egregore.json"))) {
118
+ throw new Error(`Not an Egregore instance: ${egregoreDir} (no egregore.json).`);
119
+ }
120
+
121
+ const summary = { harness, installed: [], present: 0, ready: false };
122
+ for (const rel of listFiles(bundleDir)) {
123
+ if (rel === "manifest.json") continue;
124
+ const dest = path.join(egregoreDir, rel);
125
+ if (pathExistsOrSymlink(dest)) {
126
+ summary.present += 1;
127
+ continue;
128
+ }
129
+ copyMissingFile(path.join(bundleDir, rel), dest);
130
+ summary.installed.push(rel);
131
+ }
132
+ if (harness === "codex") ensureAgentsSkillsLink(egregoreDir, summary);
133
+
134
+ summary.ready = requiredPathsFor(harness).hasSupport(egregoreDir);
135
+
136
+ if (summary.installed.length > 0) {
137
+ const file = manifestPath(egregoreDir, harness);
138
+ const previous = (() => {
139
+ try { return JSON.parse(fs.readFileSync(file, "utf-8")); } catch { return { files: [] }; }
140
+ })();
141
+ const files = Array.from(new Set([...(previous.files || []), ...summary.installed])).sort();
142
+ fs.mkdirSync(path.dirname(file), { recursive: true });
143
+ fs.writeFileSync(file, JSON.stringify({
144
+ package: PACKAGE.name,
145
+ version: PACKAGE.version,
146
+ harness,
147
+ addedAt: new Date().toISOString(),
148
+ files,
149
+ }, null, 2) + "\n");
150
+ }
151
+ return summary;
152
+ }
153
+
154
+ module.exports = {
155
+ HARNESSES,
156
+ addHarnessRuntime,
157
+ harnessLabel,
158
+ normalizeHarness,
159
+ };
package/lib/setup.js CHANGED
@@ -1203,7 +1203,7 @@ function codexSupportMessage(egregoreDir) {
1203
1203
  " .codex/hooks.json",
1204
1204
  " .codex/hooks/",
1205
1205
  "",
1206
- "Restore this instance using its installed runtime version, then rerun egregore.",
1206
+ `Add it with: npx -y create-egregore@${require("../package.json").version} --add-harness codex (run inside the instance; missing files only), then rerun egregore.`,
1207
1207
  "Egregore workflows appear as slash commands. In Codex, invoke them with the matching $skill token or ask in natural language.",
1208
1208
  ].join("\n");
1209
1209
  }
@@ -1217,7 +1217,7 @@ function piSupportMessage(egregoreDir) {
1217
1217
  "Pi meta-harness support is missing from this Egregore checkout.",
1218
1218
  ` path: ${egregoreDir}`,
1219
1219
  "",
1220
- "Restore this instance using its installed runtime version, then rerun egregore.",
1220
+ `Add it with: npx -y create-egregore@${require("../package.json").version} --add-harness pi (run inside the instance; missing files only), then rerun egregore.`,
1221
1221
  "Pi loads Egregore through project-local .pi resources and the shared portable skill corpus.",
1222
1222
  ].join("\n");
1223
1223
  }
@@ -1227,7 +1227,7 @@ function primeSupportMessage(egregoreDir) {
1227
1227
  "Prime Agent runtime support is missing from this Egregore checkout.",
1228
1228
  ` path: ${egregoreDir}`,
1229
1229
  "",
1230
- "Restore this instance using its installed runtime version, then rerun egregore.",
1230
+ `Add it with: npx -y create-egregore@${require("../package.json").version} --add-harness prime (run inside the instance; missing files only), then rerun egregore.`,
1231
1231
  "Prime Agent loads Egregore through project-local .prime/agent resources and the shared portable skill corpus.",
1232
1232
  ].join("\n");
1233
1233
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-egregore",
3
- "version": "0.21.0-runtime-mvp.27",
3
+ "version": "0.21.0-runtime-mvp.28",
4
4
  "description": "Set up Egregore for your team in one command — installs the egregore launcher and your choice of Claude Code, Codex, or Pi.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -14,10 +14,12 @@
14
14
  "build:claude-runtime": "node scripts/build-claude-runtime-bundle.mjs",
15
15
  "build:pi-runtime": "node scripts/build-pi-runtime-bundle.mjs",
16
16
  "build:prime-runtime": "node scripts/build-prime-runtime-bundle.mjs",
17
- "test": "node ../../bin/capability-distribution.mjs validate --root ../.. && node scripts/build-runtime-bundle.mjs --check && node scripts/build-claude-runtime-bundle.mjs --check && node scripts/build-pi-runtime-bundle.mjs --check && node scripts/build-prime-runtime-bundle.mjs --check && node ../../bin/prime-render-spec.mjs --check && node ../../bin/pi-render-spec.mjs --check && node ../../api/scripts/build-connect-runtime-pack.mjs --check && node --test test/invite-install.test.js test/capability-distribution.test.js test/connect-runtime.test.js test/context.test.js test/path-lookup.test.js test/nixos-portability.test.js test/parse-join-target.test.js test/skip-repos.test.js test/install-origin-guard.test.js test/onboarding-shortcircuit.test.js test/runtime-identity.test.js test/welcome-screen.test.js test/runtime-selection.test.js test/command-generation.test.js test/auth-gh.test.js test/gauntlet-fixes.test.js test/claude-runtime.test.js test/codex-runtime.test.js test/pi-runtime.test.js test/prime-runtime.test.js test/prime-branch-policy.test.js test/prime-bridge-skill.test.js test/pi-observe-context.test.js test/pi-session-smoke.test.js test/prime-session-smoke.test.js test/pi-product-workflows.test.js test/installer-runtime-source.test.js test/runtime-readiness.test.js test/scroll-repro.test.js test/launcher-refocus-redraw.test.js test/multiselect-remote-search.test.js test/back-navigation.test.js test/manifest-form.test.js test/launcher-delete.test.js test/launcher-connect.test.js test/installer-connect-choice.test.js test/launcher-connected-status.test.js test/launcher-telemetry.test.js test/launcher-runtime.test.js test/launcher-settings.test.js test/launcher-permissions.test.js test/launcher-update.test.js test/connected-config.test.js test/workflow-settings.test.js",
17
+ "test": "npm run test:runtime && npm run test:package",
18
18
  "test:packed-runtime": "node scripts/packed-runtime-canary.mjs",
19
19
  "test:e2e": "node --test test/e2e-local.test.js",
20
- "test:all": "node scripts/build-runtime-bundle.mjs --check && node scripts/build-claude-runtime-bundle.mjs --check && node scripts/build-pi-runtime-bundle.mjs --check && node --test test/"
20
+ "test:all": "npm run test:runtime && node --test test/",
21
+ "test:runtime": "node ../../bin/capability-distribution.mjs validate --root ../.. && node scripts/build-runtime-bundle.mjs --check && node scripts/build-claude-runtime-bundle.mjs --check && node scripts/build-pi-runtime-bundle.mjs --check && node scripts/build-prime-runtime-bundle.mjs --check && node ../../bin/prime-render-spec.mjs --check && node ../../bin/pi-render-spec.mjs --check && node ../../api/scripts/build-connect-runtime-pack.mjs --check && bash ../../bin/tests/test-codex-native-skills.sh && bash ../../bin/tests/test-codex-spec-render.sh && node ../../bin/capability-distribution.mjs skill-contract --root ../.. --strict-contract && bash ../../bin/tests/test-bundle-skill-scripts.sh && node --test test/bundle-skill-scripts.test.js",
22
+ "test:package": "node --test test/invite-install.test.js test/capability-distribution.test.js test/connect-runtime.test.js test/context.test.js test/path-lookup.test.js test/nixos-portability.test.js test/parse-join-target.test.js test/skip-repos.test.js test/install-origin-guard.test.js test/onboarding-shortcircuit.test.js test/runtime-identity.test.js test/welcome-screen.test.js test/runtime-selection.test.js test/command-generation.test.js test/auth-gh.test.js test/gauntlet-fixes.test.js test/claude-runtime.test.js test/codex-runtime.test.js test/pi-runtime.test.js test/prime-runtime.test.js test/prime-branch-policy.test.js test/prime-bridge-skill.test.js test/pi-observe-context.test.js test/native-command-observe.test.js test/prime-rpc-driver.test.js test/pi-session-smoke.test.js test/prime-session-smoke.test.js test/pi-product-workflows.test.js test/installer-runtime-source.test.js test/runtime-readiness.test.js test/scroll-repro.test.js test/launcher-refocus-redraw.test.js test/multiselect-remote-search.test.js test/back-navigation.test.js test/manifest-form.test.js test/launcher-delete.test.js test/launcher-connect.test.js test/installer-connect-choice.test.js test/launcher-connected-status.test.js test/launcher-telemetry.test.js test/launcher-runtime.test.js test/launcher-settings.test.js test/launcher-permissions.test.js test/launcher-update.test.js test/harness-add.test.js test/connected-config.test.js test/workflow-settings.test.js"
21
23
  },
22
24
  "files": [
23
25
  "bin/",
@@ -1,13 +1,28 @@
1
1
  # External notification consent
2
2
 
3
3
  This protocol applies to every Telegram, Teams, or other external notification
4
- in every harness. It applies even when the user asked to announce, notify,
4
+ in every harness, except the configured issue system-event feed below. It applies even when the user asked to announce, notify,
5
5
  handoff, invite, or message someone, and even when the harness is running with
6
6
  broad tool permissions.
7
7
 
8
+ ## Configured issue system events
9
+
10
+ The hosted Archive feed is an approved automatic system-event channel only for
11
+ repositories explicitly listed in an org's `PR_FEED_CONFIG.issue_repos` with
12
+ `issue_feed_policy: "issue-feed/v1"`. It reuses that feed's bot and archive
13
+ channel. Allowed events: issue opened/reopened/closed, assignment changes,
14
+ severity label changes, and newly created strict v1 observation comments.
15
+ Only bounded sanitized metadata and validated links may leave; never report
16
+ bodies, comment text, transcripts or logs. HMAC authentication, repository
17
+ allowlisting and service-role transport receipts are required. Known rejected
18
+ sends can be retried; uncertain sends require operator Archive reconciliation.
19
+ Disabling the configuration revokes this exception. No other repository,
20
+ destination, authored message, DM, announcement or background agent is approved.
21
+ The remaining protocol applies unchanged to all agent-composed notifications.
22
+
8
23
  ## Invariant
9
24
 
10
- Never dispatch an external notification until the human has approved that one
25
+ Outside the configured issue-feed exception, never dispatch an external notification until the human has approved that one
11
26
  exact delivery in a dedicated checkpoint. The checkpoint must show:
12
27
 
13
28
  - the organization;
@@ -0,0 +1,50 @@
1
+ # Runtime retrieval
2
+
3
+ Search organizational memory through Runtime; reuse evidence already in context.
4
+ For exact handoff status/order, use `bash bin/search.sh handoffs --mine --status open --order newest --limit 1 --open`; adjust filters to the question.
5
+ Choose a lookup and call `bash bin/search.sh find "<query>" --kind <kind>`:
6
+ filename for known path fragments; literal for exact wording; dates for dated
7
+ inventories; keyword for distinctive terms/names; semantic for paraphrases;
8
+ hybrid for combined ranking. No mode must run first; keyword is the default.
9
+ Add --recent-days N or --after/--before YYYY-MM-DD to preserve the requested period.
10
+ For current work choose --recent-days (normally 30) and state that period.
11
+ Keep the user's subject and known identity; never append the organization roster or unrelated names.
12
+ Keep the date boundary across refinements. Empty results are an evidence gap:
13
+ change the lookup rather than silently broadening it.
14
+ Other filters: --prefix memory/... and --artifact-type TYPE; -n N limits results
15
+ (default 8, maximum 20). Dates query matches literal text in paths/content;
16
+ an exact active-actor ID/name/alias includes its known identity variants. A mention
17
+ is not proof of authorship. Omit query only for an inventory of all subjects.
18
+ Find returns canonical paths and excerpts. Answer from them when sufficient.
19
+ When several sources need more context, open them together in ONE call:
20
+ `bash bin/search.sh open memory/path-a.md memory/path-b.md memory/path-c.md`.
21
+ Up to 10 sources per call; --offset N is a nonnegative character offset and
22
+ --length N is 1–16000 characters per source. A batch shares a 16,000-byte
23
+ result budget, so windows may be shorter. Follow the printed per-source
24
+ continuation only when that source needs more context; do not assume a partial
25
+ window is the complete document. Keep each source batch in its own tool result.
26
+ In Codex, set the outer functions.exec output budget with
27
+ `// @exec: {"max_output_tokens": 20000}` and exec_command.max_output_tokens to
28
+ 20000 for source reads; a larger inner limit alone cannot prevent outer truncation.
29
+ Known paths may be opened directly. Use find --cursor TOKEN only when another
30
+ page is needed. Do not fetch or reread this contract when it is already attached.
31
+ Runtime retains date bounds and resolves the native session automatically.
32
+ Do not supply episode IDs, request IDs, or gap explanations in normal calls.
33
+ If native binding is unavailable, use this prompt's supplied --episode reference;
34
+ never borrow another prompt's reference. A new prompt resets retrieval limits.
35
+ Use a normal completion wait (at least 10 seconds for yield_time_ms); do not
36
+ create polling turns with one-second waits. Batch independent work in the harness.
37
+ Stop when the question is supported. Ranked matches are not exhaustive; verify
38
+ coverage before claiming something is newest or absent. Document dates need not
39
+ be event dates. Distinguish proposals/conditions from completed work and cite sources.
40
+ For evolving plans, open directly relevant later records in the requested period
41
+ before treating an earlier scope as current; a search excerpt may omit revisions.
42
+ Reconcile material differences using record/event dates; cite unresolved alternatives.
43
+ When an answer depends on not finding evidence, carry any material retrieval
44
+ failure or index-coverage warning into the final answer. Say what could not be
45
+ verified and how the gap limits that conclusion; do not turn a search gap into a fact.
46
+ Authorization, source checks, retained evidence and budgets remain inside Runtime:
47
+ 8 discoveries, 20 source windows, 50 calls and 120,000 result characters per prompt.
48
+ Never bypass Runtime with raw memory filesystem or direct QMD access. Code search
49
+ and tests use ordinary tools. Emit the memory retrieval beat once per question.
50
+ On Claude append --context-packet; never reproduce internal JSON or ranking traces.