create-egregore 0.21.6 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (719) hide show
  1. package/assets/egregore-launcher.js +58 -6
  2. package/assets/egregore-launcher.sh +15 -2
  3. package/lib/claude-runtime.js +2 -0
  4. package/lib/codex-runtime.js +2 -0
  5. package/lib/setup.js +20 -3
  6. package/package.json +2 -2
  7. package/runtime/claude/.claude/context/commit-format.md +7 -4
  8. package/runtime/claude/.claude/context/handoff-claiming.md +32 -0
  9. package/runtime/claude/.claude/context/notification-consent.md +12 -9
  10. package/runtime/claude/.claude/hooks/boundary-check.sh +14 -331
  11. package/runtime/claude/.claude/hooks/memory-read-guard.sh +9 -1
  12. package/runtime/claude/.claude/rules/voice-bedrock.md +6 -2
  13. package/runtime/claude/.claude/settings.json +1 -1
  14. package/runtime/claude/.claude/skills/commit/SKILL.md +5 -3
  15. package/runtime/claude/.claude/skills/dark-mode/SKILL.md +48 -369
  16. package/runtime/claude/.claude/skills/records/SKILL.md +158 -0
  17. package/runtime/claude/.claude/skills/reflect/SKILL.md +50 -21
  18. package/runtime/claude/.claude/skills/review-pr/SKILL.md +4 -2
  19. package/runtime/claude/.claude/skills/save/SKILL.md +9 -3
  20. package/runtime/claude/.claude/skills/summon/SKILL.md +138 -207
  21. package/runtime/claude/.claude/skills/tui-design/SKILL.md +1 -1
  22. package/runtime/claude/.claude/skills/update/SKILL.md +1 -1
  23. package/runtime/claude/.claude/skills/view/SKILL.md +52 -16
  24. package/runtime/claude/.claude/skills/view/compose-scaffold.html +19 -13
  25. package/runtime/claude/CLAUDE.md +59 -95
  26. package/runtime/claude/bin/agent.sh +231 -7
  27. package/runtime/claude/bin/api-call.sh +44 -23
  28. package/runtime/claude/bin/artifact-register.sh +7 -1
  29. package/runtime/claude/bin/artifact-writeback.sh +1 -1
  30. package/runtime/claude/bin/artifacts.sh +66 -265
  31. package/runtime/claude/bin/attendant.sh +4 -1
  32. package/runtime/claude/bin/boundary-guard.cjs +1848 -0
  33. package/runtime/claude/bin/boundary-hook.sh +41 -0
  34. package/runtime/claude/bin/boundary.sh +15 -155
  35. package/runtime/claude/bin/capture-run.sh +32 -2
  36. package/runtime/claude/bin/codex-render-spec.mjs +24 -46
  37. package/runtime/claude/bin/codex-session-start.sh +19 -0
  38. package/runtime/claude/bin/codex-skill-render.mjs +18 -0
  39. package/runtime/claude/bin/config-get.sh +10 -1
  40. package/runtime/claude/bin/connect-refresh.sh +16 -0
  41. package/runtime/claude/bin/corpus_map.py +5 -0
  42. package/runtime/claude/bin/data/capabilities/claude.json +1480 -0
  43. package/runtime/claude/bin/genui.sh +19 -0
  44. package/runtime/claude/bin/graph-batch.sh +1 -1
  45. package/runtime/claude/bin/graph-op.sh +14 -0
  46. package/runtime/claude/bin/graph.sh +1 -1
  47. package/runtime/claude/bin/handoff-pr-backfill.sh +1 -1
  48. package/runtime/claude/bin/handoff-run.sh +11 -6
  49. package/runtime/claude/bin/ingest-item.sh +1 -1
  50. package/runtime/claude/bin/ingest-surface.html +22 -4
  51. package/runtime/claude/bin/issue.sh +1 -1
  52. package/runtime/claude/bin/knowledge.sh +1 -1
  53. package/runtime/claude/bin/lib/card-delivery.sh +329 -0
  54. package/runtime/claude/bin/lib/config.sh +148 -3
  55. package/runtime/claude/bin/lib/context.sh +38 -67
  56. package/runtime/claude/bin/lib/genui-entry.py +36 -0
  57. package/runtime/claude/bin/lib/git-message.sh +25 -6
  58. package/runtime/claude/bin/lib/git-sync.sh +12 -4
  59. package/runtime/claude/bin/lib/greeting.sh +255 -28
  60. package/runtime/claude/bin/lib/handoff_meta.py +294 -0
  61. package/runtime/claude/bin/lib/health-footer.sh +83 -2
  62. package/runtime/claude/bin/lib/identity.sh +31 -10
  63. package/runtime/claude/bin/lib/instance-registry.sh +71 -0
  64. package/runtime/claude/bin/lib/local_ci_receipt.py +249 -0
  65. package/runtime/claude/bin/lib/metrics.sh +121 -8
  66. package/runtime/claude/bin/lib/notices.sh +36 -0
  67. package/runtime/claude/bin/lib/record_outcomes.py +729 -0
  68. package/runtime/claude/bin/lib/reflexes.py +267 -0
  69. package/runtime/claude/bin/lib/retrieval_scorecard.py +624 -0
  70. package/runtime/claude/bin/lib/session-record-prompt.txt +18 -0
  71. package/runtime/claude/bin/lib/session_record.py +3747 -0
  72. package/runtime/claude/bin/lib/session_trail.py +1983 -0
  73. package/runtime/claude/bin/lib/settings-drift.sh +8 -5
  74. package/runtime/claude/bin/lib/startup-restart.sh +41 -0
  75. package/runtime/claude/bin/lib/worktree-links.sh +92 -0
  76. package/runtime/claude/bin/memory-push.sh +6 -0
  77. package/runtime/claude/bin/merge-gate.sh +498 -0
  78. package/runtime/claude/bin/notify.sh +5 -2
  79. package/runtime/claude/bin/page-access.sh +103 -0
  80. package/runtime/claude/bin/person.sh +13 -2
  81. package/runtime/claude/bin/pi-render-spec.mjs +0 -1
  82. package/runtime/claude/bin/pi-spirit-discovery.mjs +34 -0
  83. package/runtime/claude/bin/post-update.sh +181 -0
  84. package/runtime/claude/bin/prime-render-spec.mjs +0 -1
  85. package/runtime/claude/bin/publish-artifact.sh +89 -42
  86. package/runtime/claude/bin/qa-inventory.sh +2 -2
  87. package/runtime/claude/bin/quest.sh +1 -1
  88. package/runtime/claude/bin/records.sh +11 -0
  89. package/runtime/claude/bin/reflexes/05-vitals.sh +9 -0
  90. package/runtime/claude/bin/reflexes/10-open-items.sh +12 -0
  91. package/runtime/claude/bin/reflexes/15-retrieval.sh +8 -0
  92. package/runtime/claude/bin/reflexes/20-nightly.sh +100 -0
  93. package/runtime/claude/bin/reflexes/20-sandbox.sh +85 -0
  94. package/runtime/claude/bin/reflexes/30-cost.py +116 -0
  95. package/runtime/claude/bin/reflexes/40-shells.py +51 -0
  96. package/runtime/claude/bin/reflexes/README.md +61 -0
  97. package/runtime/claude/bin/reflexes.sh +7 -0
  98. package/runtime/claude/bin/runtime-identity.sh +140 -42
  99. package/runtime/claude/bin/screenshot.sh +77 -0
  100. package/runtime/claude/bin/scroll.sh +1 -1
  101. package/runtime/claude/bin/search.sh +31 -5
  102. package/runtime/claude/bin/session-autosave.sh +6 -3
  103. package/runtime/claude/bin/session-id.sh +147 -0
  104. package/runtime/claude/bin/session-log.sh +19 -0
  105. package/runtime/claude/bin/session-record.sh +26 -0
  106. package/runtime/claude/bin/session-start.sh +121 -151
  107. package/runtime/claude/bin/settings.sh +13 -8
  108. package/runtime/claude/bin/spirit-discovery-claude.sh +4 -0
  109. package/runtime/claude/bin/spirit-discovery-codex.sh +4 -0
  110. package/runtime/claude/bin/spirit-discovery-pi.sh +4 -0
  111. package/runtime/claude/bin/spirit-discovery-prime.sh +4 -0
  112. package/runtime/claude/bin/spirit-discovery.sh +4 -0
  113. package/runtime/claude/bin/startup-check.sh +1 -1
  114. package/runtime/claude/bin/telemetry.sh +11 -4
  115. package/runtime/claude/bin/test-baseline.sh +33 -5
  116. package/runtime/claude/bin/todo.sh +1 -1
  117. package/runtime/claude/bin/worktree-create.sh +15 -45
  118. package/runtime/claude/bin/worktree.sh +6 -0
  119. package/runtime/claude/docs/spirit-discovery.md +96 -0
  120. package/runtime/claude/egregore_runtime/__init__.py +18 -12
  121. package/runtime/claude/egregore_runtime/access.py +608 -0
  122. package/runtime/claude/egregore_runtime/access_cli.py +190 -0
  123. package/runtime/claude/egregore_runtime/adapters/invitation.py +5 -3
  124. package/runtime/claude/egregore_runtime/adapters/qmd.py +521 -47
  125. package/runtime/claude/egregore_runtime/admin_entry.py +56 -0
  126. package/runtime/claude/egregore_runtime/artifacts.py +222 -16
  127. package/runtime/claude/egregore_runtime/contracts.py +27 -0
  128. package/runtime/claude/egregore_runtime/eligibility.py +5 -12
  129. package/runtime/claude/egregore_runtime/episode_binding.py +16 -5
  130. package/runtime/claude/egregore_runtime/github_issues.py +2 -2
  131. package/runtime/claude/egregore_runtime/handoff_lookup.py +9 -20
  132. package/runtime/claude/egregore_runtime/harness_cli.py +674 -149
  133. package/runtime/claude/egregore_runtime/held.py +2436 -0
  134. package/runtime/claude/egregore_runtime/hosted_api.py +137 -0
  135. package/runtime/claude/egregore_runtime/identity.py +196 -65
  136. package/runtime/claude/egregore_runtime/identity_transfer.py +6 -2
  137. package/runtime/claude/egregore_runtime/ingest_cli.py +2 -2
  138. package/runtime/claude/egregore_runtime/ingest_index_cli.py +4 -16
  139. package/runtime/claude/egregore_runtime/installation.py +119 -0
  140. package/runtime/claude/egregore_runtime/investigation.py +64 -41
  141. package/runtime/claude/egregore_runtime/investigation_guidance.py +16 -11
  142. package/runtime/claude/egregore_runtime/issue_cli.py +51 -32
  143. package/runtime/claude/egregore_runtime/issue_reporting.py +4 -3
  144. package/runtime/claude/egregore_runtime/issue_triage_service.py +2 -2
  145. package/runtime/claude/egregore_runtime/issues.py +12 -6
  146. package/runtime/claude/egregore_runtime/knowledge.py +331 -5
  147. package/runtime/claude/egregore_runtime/knowledge_cli.py +57 -17
  148. package/runtime/claude/egregore_runtime/lifecycle.py +88 -22
  149. package/runtime/claude/egregore_runtime/lifecycle_cli.py +21 -13
  150. package/runtime/claude/egregore_runtime/line_ids.py +10 -0
  151. package/runtime/claude/egregore_runtime/memory_push.py +349 -0
  152. package/runtime/claude/egregore_runtime/observe.py +64 -25
  153. package/runtime/claude/egregore_runtime/observers.py +19 -0
  154. package/runtime/claude/egregore_runtime/optional_modules.py +13 -0
  155. package/runtime/claude/egregore_runtime/outputs_cli.py +321 -0
  156. package/runtime/claude/egregore_runtime/policy.py +651 -24
  157. package/runtime/claude/egregore_runtime/private_result.py +2 -1
  158. package/runtime/claude/egregore_runtime/projection.py +946 -0
  159. package/runtime/claude/egregore_runtime/quest_cli.py +20 -23
  160. package/runtime/claude/egregore_runtime/question_cli.py +15 -11
  161. package/runtime/claude/egregore_runtime/questions.py +10 -10
  162. package/runtime/claude/egregore_runtime/quests.py +10 -10
  163. package/runtime/claude/egregore_runtime/record_publish.py +548 -0
  164. package/runtime/claude/egregore_runtime/record_subject.py +564 -0
  165. package/runtime/claude/egregore_runtime/research_ingest.py +2 -4
  166. package/runtime/claude/egregore_runtime/runtime.py +169 -60
  167. package/runtime/claude/egregore_runtime/sandbox.py +194 -0
  168. package/runtime/claude/egregore_runtime/scroll_cli.py +22 -32
  169. package/runtime/claude/egregore_runtime/scrolls.py +23 -15
  170. package/runtime/claude/egregore_runtime/shadow.py +262 -0
  171. package/runtime/claude/egregore_runtime/spirit_discovery.py +487 -0
  172. package/runtime/claude/egregore_runtime/spirit_discovery_cli.py +25 -0
  173. package/runtime/claude/egregore_runtime/spirit_discovery_transport.py +18 -0
  174. package/runtime/claude/egregore_runtime/status.py +101 -44
  175. package/runtime/claude/egregore_runtime/status_cli.py +13 -5
  176. package/runtime/claude/egregore_runtime/sync.py +39 -21
  177. package/runtime/claude/egregore_runtime/taste.py +934 -0
  178. package/runtime/claude/egregore_runtime/taste_cli.py +242 -0
  179. package/runtime/claude/egregore_runtime/taste_rules.py +91 -0
  180. package/runtime/claude/egregore_runtime/telemetry.py +26 -3
  181. package/runtime/claude/egregore_runtime/todo_cli.py +15 -12
  182. package/runtime/claude/egregore_runtime/todos.py +3 -2
  183. package/runtime/claude/egregore_runtime/upgrade.py +85 -58
  184. package/runtime/claude/egregore_runtime/writeback.py +330 -24
  185. package/runtime/claude/manifest.json +65 -5
  186. package/runtime/codex/.claude/context/handoff-claiming.md +32 -0
  187. package/runtime/codex/.claude/context/notification-consent.md +12 -9
  188. package/runtime/codex/.claude/skills/view/SKILL.md +438 -0
  189. package/runtime/codex/.codex/hooks.json +11 -0
  190. package/runtime/codex/.codex/skills/dark-mode/SKILL.md +1 -1
  191. package/runtime/codex/.codex/skills/records/SKILL.md +29 -0
  192. package/runtime/codex/.codex/skills/summon/SKILL.md +1 -1
  193. package/runtime/codex/.codex/skills/view/assets/compose-scaffold.html +19 -13
  194. package/runtime/codex/.codex/spec-manifest.json +13 -19
  195. package/runtime/codex/AGENTS.md +54 -105
  196. package/runtime/codex/bin/agent.sh +231 -7
  197. package/runtime/codex/bin/api-call.sh +44 -23
  198. package/runtime/codex/bin/artifact-register.sh +7 -1
  199. package/runtime/codex/bin/artifact-writeback.sh +1 -1
  200. package/runtime/codex/bin/artifacts.sh +66 -265
  201. package/runtime/codex/bin/attendant.sh +4 -1
  202. package/runtime/codex/bin/boundary-guard.cjs +1848 -0
  203. package/runtime/codex/bin/boundary-hook.sh +41 -0
  204. package/runtime/codex/bin/capture-run.sh +32 -2
  205. package/runtime/codex/bin/codex-render-spec.mjs +24 -46
  206. package/runtime/codex/bin/codex-session-start.sh +19 -0
  207. package/runtime/codex/bin/codex-skill-render.mjs +18 -0
  208. package/runtime/codex/bin/config-get.sh +10 -1
  209. package/runtime/codex/bin/connect-refresh.sh +16 -0
  210. package/runtime/codex/bin/corpus_map.py +5 -0
  211. package/runtime/codex/bin/data/capabilities/codex.json +1458 -0
  212. package/runtime/codex/bin/genui.sh +19 -0
  213. package/runtime/codex/bin/graph-batch.sh +1 -1
  214. package/runtime/codex/bin/graph-op.sh +14 -0
  215. package/runtime/codex/bin/graph.sh +1 -1
  216. package/runtime/codex/bin/handoff-pr-backfill.sh +1 -1
  217. package/runtime/codex/bin/handoff-run.sh +11 -6
  218. package/runtime/codex/bin/ingest-item.sh +1 -1
  219. package/runtime/codex/bin/ingest-surface.html +22 -4
  220. package/runtime/codex/bin/issue.sh +1 -1
  221. package/runtime/codex/bin/knowledge.sh +1 -1
  222. package/runtime/codex/bin/lib/card-delivery.sh +329 -0
  223. package/runtime/codex/bin/lib/config.sh +148 -3
  224. package/runtime/codex/bin/lib/context.sh +38 -67
  225. package/runtime/codex/bin/lib/genui-entry.py +36 -0
  226. package/runtime/codex/bin/lib/git-message.sh +25 -6
  227. package/runtime/codex/bin/lib/git-sync.sh +12 -4
  228. package/runtime/codex/bin/lib/greeting.sh +255 -28
  229. package/runtime/codex/bin/lib/handoff_meta.py +294 -0
  230. package/runtime/codex/bin/lib/health-footer.sh +83 -2
  231. package/runtime/codex/bin/lib/identity.sh +31 -10
  232. package/runtime/codex/bin/lib/instance-registry.sh +71 -0
  233. package/runtime/codex/bin/lib/local_ci_receipt.py +249 -0
  234. package/runtime/codex/bin/lib/metrics.sh +121 -8
  235. package/runtime/codex/bin/lib/notices.sh +36 -0
  236. package/runtime/codex/bin/lib/record_outcomes.py +729 -0
  237. package/runtime/codex/bin/lib/reflexes.py +267 -0
  238. package/runtime/codex/bin/lib/retrieval_scorecard.py +624 -0
  239. package/runtime/codex/bin/lib/session-record-prompt.txt +18 -0
  240. package/runtime/codex/bin/lib/session_record.py +3747 -0
  241. package/runtime/codex/bin/lib/session_trail.py +1983 -0
  242. package/runtime/codex/bin/lib/settings-drift.sh +8 -5
  243. package/runtime/codex/bin/lib/startup-restart.sh +41 -0
  244. package/runtime/codex/bin/lib/worktree-links.sh +92 -0
  245. package/runtime/codex/bin/memory-push.sh +6 -0
  246. package/runtime/codex/bin/merge-gate.sh +498 -0
  247. package/runtime/codex/bin/notify.sh +5 -2
  248. package/runtime/codex/bin/page-access.sh +103 -0
  249. package/runtime/codex/bin/person.sh +13 -2
  250. package/runtime/codex/bin/pi-render-spec.mjs +0 -1
  251. package/runtime/codex/bin/pi-spirit-discovery.mjs +34 -0
  252. package/runtime/codex/bin/post-update.sh +181 -0
  253. package/runtime/codex/bin/prime-render-spec.mjs +0 -1
  254. package/runtime/codex/bin/publish-artifact.sh +89 -42
  255. package/runtime/codex/bin/qa-inventory.sh +2 -2
  256. package/runtime/codex/bin/quest.sh +1 -1
  257. package/runtime/codex/bin/records.sh +11 -0
  258. package/runtime/codex/bin/reflexes/05-vitals.sh +9 -0
  259. package/runtime/codex/bin/reflexes/10-open-items.sh +12 -0
  260. package/runtime/codex/bin/reflexes/15-retrieval.sh +8 -0
  261. package/runtime/codex/bin/reflexes/20-nightly.sh +100 -0
  262. package/runtime/codex/bin/reflexes/20-sandbox.sh +85 -0
  263. package/runtime/codex/bin/reflexes/30-cost.py +116 -0
  264. package/runtime/codex/bin/reflexes/40-shells.py +51 -0
  265. package/runtime/codex/bin/reflexes/README.md +61 -0
  266. package/runtime/codex/bin/reflexes.sh +7 -0
  267. package/runtime/codex/bin/runtime-identity.sh +140 -42
  268. package/runtime/codex/bin/screenshot.sh +77 -0
  269. package/runtime/codex/bin/scroll.sh +1 -1
  270. package/runtime/codex/bin/search.sh +31 -5
  271. package/runtime/codex/bin/session-autosave.sh +6 -3
  272. package/runtime/codex/bin/session-id.sh +147 -0
  273. package/runtime/codex/bin/session-log.sh +19 -0
  274. package/runtime/codex/bin/session-record.sh +26 -0
  275. package/runtime/codex/bin/settings.sh +13 -8
  276. package/runtime/codex/bin/spirit-discovery-claude.sh +4 -0
  277. package/runtime/codex/bin/spirit-discovery-codex.sh +4 -0
  278. package/runtime/codex/bin/spirit-discovery-pi.sh +4 -0
  279. package/runtime/codex/bin/spirit-discovery-prime.sh +4 -0
  280. package/runtime/codex/bin/spirit-discovery.sh +4 -0
  281. package/runtime/codex/bin/startup-check.sh +1 -1
  282. package/runtime/codex/bin/telemetry.sh +11 -4
  283. package/runtime/codex/bin/test-baseline.sh +33 -5
  284. package/runtime/codex/bin/todo.sh +1 -1
  285. package/runtime/codex/bin/worktree-create.sh +15 -45
  286. package/runtime/codex/bin/worktree.sh +6 -0
  287. package/runtime/codex/docs/spirit-discovery.md +96 -0
  288. package/runtime/codex/egregore_runtime/__init__.py +18 -12
  289. package/runtime/codex/egregore_runtime/access.py +608 -0
  290. package/runtime/codex/egregore_runtime/access_cli.py +190 -0
  291. package/runtime/codex/egregore_runtime/adapters/invitation.py +5 -3
  292. package/runtime/codex/egregore_runtime/adapters/qmd.py +521 -47
  293. package/runtime/codex/egregore_runtime/admin_entry.py +56 -0
  294. package/runtime/codex/egregore_runtime/artifacts.py +222 -16
  295. package/runtime/codex/egregore_runtime/contracts.py +27 -0
  296. package/runtime/codex/egregore_runtime/eligibility.py +5 -12
  297. package/runtime/codex/egregore_runtime/episode_binding.py +16 -5
  298. package/runtime/codex/egregore_runtime/github_issues.py +2 -2
  299. package/runtime/codex/egregore_runtime/handoff_lookup.py +9 -20
  300. package/runtime/codex/egregore_runtime/harness_cli.py +674 -149
  301. package/runtime/codex/egregore_runtime/held.py +2436 -0
  302. package/runtime/codex/egregore_runtime/hosted_api.py +137 -0
  303. package/runtime/codex/egregore_runtime/identity.py +196 -65
  304. package/runtime/codex/egregore_runtime/identity_transfer.py +6 -2
  305. package/runtime/codex/egregore_runtime/ingest_cli.py +2 -2
  306. package/runtime/codex/egregore_runtime/ingest_index_cli.py +4 -16
  307. package/runtime/codex/egregore_runtime/installation.py +119 -0
  308. package/runtime/codex/egregore_runtime/investigation.py +64 -41
  309. package/runtime/codex/egregore_runtime/investigation_guidance.py +16 -11
  310. package/runtime/codex/egregore_runtime/issue_cli.py +51 -32
  311. package/runtime/codex/egregore_runtime/issue_reporting.py +4 -3
  312. package/runtime/codex/egregore_runtime/issue_triage_service.py +2 -2
  313. package/runtime/codex/egregore_runtime/issues.py +12 -6
  314. package/runtime/codex/egregore_runtime/knowledge.py +331 -5
  315. package/runtime/codex/egregore_runtime/knowledge_cli.py +57 -17
  316. package/runtime/codex/egregore_runtime/lifecycle.py +88 -22
  317. package/runtime/codex/egregore_runtime/lifecycle_cli.py +21 -13
  318. package/runtime/codex/egregore_runtime/line_ids.py +10 -0
  319. package/runtime/codex/egregore_runtime/memory_push.py +349 -0
  320. package/runtime/codex/egregore_runtime/observe.py +64 -25
  321. package/runtime/codex/egregore_runtime/observers.py +19 -0
  322. package/runtime/codex/egregore_runtime/optional_modules.py +13 -0
  323. package/runtime/codex/egregore_runtime/outputs_cli.py +321 -0
  324. package/runtime/codex/egregore_runtime/policy.py +651 -24
  325. package/runtime/codex/egregore_runtime/private_result.py +2 -1
  326. package/runtime/codex/egregore_runtime/projection.py +946 -0
  327. package/runtime/codex/egregore_runtime/quest_cli.py +20 -23
  328. package/runtime/codex/egregore_runtime/question_cli.py +15 -11
  329. package/runtime/codex/egregore_runtime/questions.py +10 -10
  330. package/runtime/codex/egregore_runtime/quests.py +10 -10
  331. package/runtime/codex/egregore_runtime/record_publish.py +548 -0
  332. package/runtime/codex/egregore_runtime/record_subject.py +564 -0
  333. package/runtime/codex/egregore_runtime/research_ingest.py +2 -4
  334. package/runtime/codex/egregore_runtime/runtime.py +169 -60
  335. package/runtime/codex/egregore_runtime/sandbox.py +194 -0
  336. package/runtime/codex/egregore_runtime/scroll_cli.py +22 -32
  337. package/runtime/codex/egregore_runtime/scrolls.py +23 -15
  338. package/runtime/codex/egregore_runtime/shadow.py +262 -0
  339. package/runtime/codex/egregore_runtime/spirit_discovery.py +487 -0
  340. package/runtime/codex/egregore_runtime/spirit_discovery_cli.py +25 -0
  341. package/runtime/codex/egregore_runtime/spirit_discovery_transport.py +18 -0
  342. package/runtime/codex/egregore_runtime/status.py +101 -44
  343. package/runtime/codex/egregore_runtime/status_cli.py +13 -5
  344. package/runtime/codex/egregore_runtime/sync.py +39 -21
  345. package/runtime/codex/egregore_runtime/taste.py +934 -0
  346. package/runtime/codex/egregore_runtime/taste_cli.py +242 -0
  347. package/runtime/codex/egregore_runtime/taste_rules.py +91 -0
  348. package/runtime/codex/egregore_runtime/telemetry.py +26 -3
  349. package/runtime/codex/egregore_runtime/todo_cli.py +15 -12
  350. package/runtime/codex/egregore_runtime/todos.py +3 -2
  351. package/runtime/codex/egregore_runtime/upgrade.py +85 -58
  352. package/runtime/codex/egregore_runtime/writeback.py +330 -24
  353. package/runtime/codex/manifest.json +66 -5
  354. package/runtime/pi/.claude/context/handoff-claiming.md +32 -0
  355. package/runtime/pi/.claude/context/notification-consent.md +12 -9
  356. package/runtime/pi/.claude/skills/view/SKILL.md +438 -0
  357. package/runtime/pi/.codex/hooks.json +11 -0
  358. package/runtime/pi/.codex/skills/dark-mode/SKILL.md +1 -1
  359. package/runtime/pi/.codex/skills/records/SKILL.md +29 -0
  360. package/runtime/pi/.codex/skills/summon/SKILL.md +1 -1
  361. package/runtime/pi/.codex/skills/view/assets/compose-scaffold.html +19 -13
  362. package/runtime/pi/.codex/spec-manifest.json +13 -19
  363. package/runtime/pi/.pi/APPEND_SYSTEM.md +53 -99
  364. package/runtime/pi/.pi/extensions/egregore.ts +13 -1
  365. package/runtime/pi/.pi/spec-manifest.json +2 -2
  366. package/runtime/pi/AGENTS.md +54 -105
  367. package/runtime/pi/bin/agent.sh +231 -7
  368. package/runtime/pi/bin/api-call.sh +44 -23
  369. package/runtime/pi/bin/artifact-register.sh +7 -1
  370. package/runtime/pi/bin/artifact-writeback.sh +1 -1
  371. package/runtime/pi/bin/artifacts.sh +66 -265
  372. package/runtime/pi/bin/attendant.sh +4 -1
  373. package/runtime/pi/bin/boundary-guard.cjs +1848 -0
  374. package/runtime/pi/bin/boundary-hook.sh +41 -0
  375. package/runtime/pi/bin/capture-run.sh +32 -2
  376. package/runtime/pi/bin/codex-render-spec.mjs +24 -46
  377. package/runtime/pi/bin/codex-session-start.sh +19 -0
  378. package/runtime/pi/bin/codex-skill-render.mjs +18 -0
  379. package/runtime/pi/bin/config-get.sh +10 -1
  380. package/runtime/pi/bin/connect-refresh.sh +16 -0
  381. package/runtime/pi/bin/corpus_map.py +5 -0
  382. package/runtime/pi/bin/data/capabilities/pi.json +1458 -0
  383. package/runtime/pi/bin/genui.sh +19 -0
  384. package/runtime/pi/bin/graph-batch.sh +1 -1
  385. package/runtime/pi/bin/graph-op.sh +14 -0
  386. package/runtime/pi/bin/graph.sh +1 -1
  387. package/runtime/pi/bin/handoff-pr-backfill.sh +1 -1
  388. package/runtime/pi/bin/handoff-run.sh +11 -6
  389. package/runtime/pi/bin/ingest-item.sh +1 -1
  390. package/runtime/pi/bin/ingest-surface.html +22 -4
  391. package/runtime/pi/bin/issue.sh +1 -1
  392. package/runtime/pi/bin/knowledge.sh +1 -1
  393. package/runtime/pi/bin/lib/card-delivery.sh +329 -0
  394. package/runtime/pi/bin/lib/config.sh +148 -3
  395. package/runtime/pi/bin/lib/context.sh +38 -67
  396. package/runtime/pi/bin/lib/genui-entry.py +36 -0
  397. package/runtime/pi/bin/lib/git-message.sh +25 -6
  398. package/runtime/pi/bin/lib/git-sync.sh +12 -4
  399. package/runtime/pi/bin/lib/greeting.sh +255 -28
  400. package/runtime/pi/bin/lib/handoff_meta.py +294 -0
  401. package/runtime/pi/bin/lib/health-footer.sh +83 -2
  402. package/runtime/pi/bin/lib/identity.sh +31 -10
  403. package/runtime/pi/bin/lib/instance-registry.sh +71 -0
  404. package/runtime/pi/bin/lib/local_ci_receipt.py +249 -0
  405. package/runtime/pi/bin/lib/metrics.sh +121 -8
  406. package/runtime/pi/bin/lib/notices.sh +36 -0
  407. package/runtime/pi/bin/lib/record_outcomes.py +729 -0
  408. package/runtime/pi/bin/lib/reflexes.py +267 -0
  409. package/runtime/pi/bin/lib/retrieval_scorecard.py +624 -0
  410. package/runtime/pi/bin/lib/session-record-prompt.txt +18 -0
  411. package/runtime/pi/bin/lib/session_record.py +3747 -0
  412. package/runtime/pi/bin/lib/session_trail.py +1983 -0
  413. package/runtime/pi/bin/lib/settings-drift.sh +8 -5
  414. package/runtime/pi/bin/lib/startup-restart.sh +41 -0
  415. package/runtime/pi/bin/lib/worktree-links.sh +92 -0
  416. package/runtime/pi/bin/memory-push.sh +6 -0
  417. package/runtime/pi/bin/merge-gate.sh +498 -0
  418. package/runtime/pi/bin/notify.sh +5 -2
  419. package/runtime/pi/bin/page-access.sh +103 -0
  420. package/runtime/pi/bin/person.sh +13 -2
  421. package/runtime/pi/bin/pi-branch-policy.mjs +37 -0
  422. package/runtime/pi/bin/pi-observe-context.mjs +97 -4
  423. package/runtime/pi/bin/pi-render-spec.mjs +0 -1
  424. package/runtime/pi/bin/pi-session-start.sh +4 -1
  425. package/runtime/pi/bin/pi-spirit-discovery.mjs +34 -0
  426. package/runtime/pi/bin/post-update.sh +181 -0
  427. package/runtime/pi/bin/prime-render-spec.mjs +0 -1
  428. package/runtime/pi/bin/publish-artifact.sh +89 -42
  429. package/runtime/pi/bin/qa-inventory.sh +2 -2
  430. package/runtime/pi/bin/quest.sh +1 -1
  431. package/runtime/pi/bin/records.sh +11 -0
  432. package/runtime/pi/bin/reflexes/05-vitals.sh +9 -0
  433. package/runtime/pi/bin/reflexes/10-open-items.sh +12 -0
  434. package/runtime/pi/bin/reflexes/15-retrieval.sh +8 -0
  435. package/runtime/pi/bin/reflexes/20-nightly.sh +100 -0
  436. package/runtime/pi/bin/reflexes/20-sandbox.sh +85 -0
  437. package/runtime/pi/bin/reflexes/30-cost.py +116 -0
  438. package/runtime/pi/bin/reflexes/40-shells.py +51 -0
  439. package/runtime/pi/bin/reflexes/README.md +61 -0
  440. package/runtime/pi/bin/reflexes.sh +7 -0
  441. package/runtime/pi/bin/runtime-identity.sh +140 -42
  442. package/runtime/pi/bin/screenshot.sh +77 -0
  443. package/runtime/pi/bin/scroll.sh +1 -1
  444. package/runtime/pi/bin/search.sh +31 -5
  445. package/runtime/pi/bin/session-autosave.sh +6 -3
  446. package/runtime/pi/bin/session-id.sh +147 -0
  447. package/runtime/pi/bin/session-log.sh +19 -0
  448. package/runtime/pi/bin/session-record.sh +26 -0
  449. package/runtime/pi/bin/settings.sh +13 -8
  450. package/runtime/pi/bin/spirit-discovery-claude.sh +4 -0
  451. package/runtime/pi/bin/spirit-discovery-codex.sh +4 -0
  452. package/runtime/pi/bin/spirit-discovery-pi.sh +4 -0
  453. package/runtime/pi/bin/spirit-discovery-prime.sh +4 -0
  454. package/runtime/pi/bin/spirit-discovery.sh +4 -0
  455. package/runtime/pi/bin/startup-check.sh +1 -1
  456. package/runtime/pi/bin/telemetry.sh +11 -4
  457. package/runtime/pi/bin/test-baseline.sh +33 -5
  458. package/runtime/pi/bin/todo.sh +1 -1
  459. package/runtime/pi/bin/worktree-create.sh +15 -45
  460. package/runtime/pi/bin/worktree.sh +6 -0
  461. package/runtime/pi/docs/spirit-discovery.md +96 -0
  462. package/runtime/pi/egregore_runtime/__init__.py +18 -12
  463. package/runtime/pi/egregore_runtime/access.py +608 -0
  464. package/runtime/pi/egregore_runtime/access_cli.py +190 -0
  465. package/runtime/pi/egregore_runtime/adapters/invitation.py +5 -3
  466. package/runtime/pi/egregore_runtime/adapters/qmd.py +521 -47
  467. package/runtime/pi/egregore_runtime/admin_entry.py +56 -0
  468. package/runtime/pi/egregore_runtime/artifacts.py +222 -16
  469. package/runtime/pi/egregore_runtime/contracts.py +27 -0
  470. package/runtime/pi/egregore_runtime/eligibility.py +5 -12
  471. package/runtime/pi/egregore_runtime/episode_binding.py +16 -5
  472. package/runtime/pi/egregore_runtime/github_issues.py +2 -2
  473. package/runtime/pi/egregore_runtime/handoff_lookup.py +9 -20
  474. package/runtime/pi/egregore_runtime/harness_cli.py +674 -149
  475. package/runtime/pi/egregore_runtime/held.py +2436 -0
  476. package/runtime/pi/egregore_runtime/hosted_api.py +137 -0
  477. package/runtime/pi/egregore_runtime/identity.py +196 -65
  478. package/runtime/pi/egregore_runtime/identity_transfer.py +6 -2
  479. package/runtime/pi/egregore_runtime/ingest_cli.py +2 -2
  480. package/runtime/pi/egregore_runtime/ingest_index_cli.py +4 -16
  481. package/runtime/pi/egregore_runtime/installation.py +119 -0
  482. package/runtime/pi/egregore_runtime/investigation.py +64 -41
  483. package/runtime/pi/egregore_runtime/investigation_guidance.py +16 -11
  484. package/runtime/pi/egregore_runtime/issue_cli.py +51 -32
  485. package/runtime/pi/egregore_runtime/issue_reporting.py +4 -3
  486. package/runtime/pi/egregore_runtime/issue_triage_service.py +2 -2
  487. package/runtime/pi/egregore_runtime/issues.py +12 -6
  488. package/runtime/pi/egregore_runtime/knowledge.py +331 -5
  489. package/runtime/pi/egregore_runtime/knowledge_cli.py +57 -17
  490. package/runtime/pi/egregore_runtime/lifecycle.py +88 -22
  491. package/runtime/pi/egregore_runtime/lifecycle_cli.py +21 -13
  492. package/runtime/pi/egregore_runtime/line_ids.py +10 -0
  493. package/runtime/pi/egregore_runtime/memory_push.py +349 -0
  494. package/runtime/pi/egregore_runtime/observe.py +64 -25
  495. package/runtime/pi/egregore_runtime/observers.py +19 -0
  496. package/runtime/pi/egregore_runtime/optional_modules.py +13 -0
  497. package/runtime/pi/egregore_runtime/outputs_cli.py +321 -0
  498. package/runtime/pi/egregore_runtime/policy.py +651 -24
  499. package/runtime/pi/egregore_runtime/private_result.py +2 -1
  500. package/runtime/pi/egregore_runtime/projection.py +946 -0
  501. package/runtime/pi/egregore_runtime/quest_cli.py +20 -23
  502. package/runtime/pi/egregore_runtime/question_cli.py +15 -11
  503. package/runtime/pi/egregore_runtime/questions.py +10 -10
  504. package/runtime/pi/egregore_runtime/quests.py +10 -10
  505. package/runtime/pi/egregore_runtime/record_publish.py +548 -0
  506. package/runtime/pi/egregore_runtime/record_subject.py +564 -0
  507. package/runtime/pi/egregore_runtime/research_ingest.py +2 -4
  508. package/runtime/pi/egregore_runtime/runtime.py +169 -60
  509. package/runtime/pi/egregore_runtime/sandbox.py +194 -0
  510. package/runtime/pi/egregore_runtime/scroll_cli.py +22 -32
  511. package/runtime/pi/egregore_runtime/scrolls.py +23 -15
  512. package/runtime/pi/egregore_runtime/shadow.py +262 -0
  513. package/runtime/pi/egregore_runtime/spirit_discovery.py +487 -0
  514. package/runtime/pi/egregore_runtime/spirit_discovery_cli.py +25 -0
  515. package/runtime/pi/egregore_runtime/spirit_discovery_transport.py +18 -0
  516. package/runtime/pi/egregore_runtime/status.py +101 -44
  517. package/runtime/pi/egregore_runtime/status_cli.py +13 -5
  518. package/runtime/pi/egregore_runtime/sync.py +39 -21
  519. package/runtime/pi/egregore_runtime/taste.py +934 -0
  520. package/runtime/pi/egregore_runtime/taste_cli.py +242 -0
  521. package/runtime/pi/egregore_runtime/taste_rules.py +91 -0
  522. package/runtime/pi/egregore_runtime/telemetry.py +26 -3
  523. package/runtime/pi/egregore_runtime/todo_cli.py +15 -12
  524. package/runtime/pi/egregore_runtime/todos.py +3 -2
  525. package/runtime/pi/egregore_runtime/upgrade.py +85 -58
  526. package/runtime/pi/egregore_runtime/writeback.py +330 -24
  527. package/runtime/pi/manifest.json +66 -5
  528. package/runtime/prime/.claude/context/handoff-claiming.md +32 -0
  529. package/runtime/prime/.claude/context/notification-consent.md +12 -9
  530. package/runtime/prime/.claude/skills/view/SKILL.md +438 -0
  531. package/runtime/prime/.codex/hooks.json +11 -0
  532. package/runtime/prime/.codex/skills/dark-mode/SKILL.md +1 -1
  533. package/runtime/prime/.codex/skills/records/SKILL.md +29 -0
  534. package/runtime/prime/.codex/skills/summon/SKILL.md +1 -1
  535. package/runtime/prime/.codex/skills/view/assets/compose-scaffold.html +19 -13
  536. package/runtime/prime/.codex/spec-manifest.json +13 -19
  537. package/runtime/prime/.prime/agent/APPEND_SYSTEM.md +53 -99
  538. package/runtime/prime/.prime/agent/extensions/egregore.ts +14 -1
  539. package/runtime/prime/.prime/agent/skills/egregore/SKILL.md +14 -6
  540. package/runtime/prime/.prime/agent/skills/egregore/src/egregore/__init__.py +66 -1
  541. package/runtime/prime/.prime/agent/spec-manifest.json +2 -2
  542. package/runtime/prime/AGENTS.md +54 -105
  543. package/runtime/prime/bin/agent.sh +231 -7
  544. package/runtime/prime/bin/api-call.sh +44 -23
  545. package/runtime/prime/bin/artifact-register.sh +7 -1
  546. package/runtime/prime/bin/artifact-writeback.sh +1 -1
  547. package/runtime/prime/bin/artifacts.sh +66 -265
  548. package/runtime/prime/bin/attendant.sh +4 -1
  549. package/runtime/prime/bin/boundary-guard.cjs +1848 -0
  550. package/runtime/prime/bin/boundary-hook.sh +41 -0
  551. package/runtime/prime/bin/capture-run.sh +32 -2
  552. package/runtime/prime/bin/codex-render-spec.mjs +24 -46
  553. package/runtime/prime/bin/codex-session-start.sh +19 -0
  554. package/runtime/prime/bin/codex-skill-render.mjs +18 -0
  555. package/runtime/prime/bin/config-get.sh +10 -1
  556. package/runtime/prime/bin/connect-refresh.sh +16 -0
  557. package/runtime/prime/bin/corpus_map.py +5 -0
  558. package/runtime/prime/bin/data/capabilities/prime.json +1458 -0
  559. package/runtime/prime/bin/genui.sh +19 -0
  560. package/runtime/prime/bin/graph-batch.sh +1 -1
  561. package/runtime/prime/bin/graph-op.sh +14 -0
  562. package/runtime/prime/bin/graph.sh +1 -1
  563. package/runtime/prime/bin/handoff-pr-backfill.sh +1 -1
  564. package/runtime/prime/bin/handoff-run.sh +11 -6
  565. package/runtime/prime/bin/ingest-item.sh +1 -1
  566. package/runtime/prime/bin/ingest-surface.html +22 -4
  567. package/runtime/prime/bin/issue.sh +1 -1
  568. package/runtime/prime/bin/knowledge.sh +1 -1
  569. package/runtime/prime/bin/lib/card-delivery.sh +329 -0
  570. package/runtime/prime/bin/lib/config.sh +148 -3
  571. package/runtime/prime/bin/lib/context.sh +38 -67
  572. package/runtime/prime/bin/lib/genui-entry.py +36 -0
  573. package/runtime/prime/bin/lib/git-message.sh +25 -6
  574. package/runtime/prime/bin/lib/git-sync.sh +12 -4
  575. package/runtime/prime/bin/lib/greeting.sh +255 -28
  576. package/runtime/prime/bin/lib/handoff_meta.py +294 -0
  577. package/runtime/prime/bin/lib/health-footer.sh +83 -2
  578. package/runtime/prime/bin/lib/identity.sh +31 -10
  579. package/runtime/prime/bin/lib/instance-registry.sh +71 -0
  580. package/runtime/prime/bin/lib/local_ci_receipt.py +249 -0
  581. package/runtime/prime/bin/lib/metrics.sh +121 -8
  582. package/runtime/prime/bin/lib/notices.sh +36 -0
  583. package/runtime/prime/bin/lib/record_outcomes.py +729 -0
  584. package/runtime/prime/bin/lib/reflexes.py +267 -0
  585. package/runtime/prime/bin/lib/retrieval_scorecard.py +624 -0
  586. package/runtime/prime/bin/lib/session-record-prompt.txt +18 -0
  587. package/runtime/prime/bin/lib/session_record.py +3747 -0
  588. package/runtime/prime/bin/lib/session_trail.py +1983 -0
  589. package/runtime/prime/bin/lib/settings-drift.sh +8 -5
  590. package/runtime/prime/bin/lib/startup-restart.sh +41 -0
  591. package/runtime/prime/bin/lib/worktree-links.sh +92 -0
  592. package/runtime/prime/bin/memory-push.sh +6 -0
  593. package/runtime/prime/bin/merge-gate.sh +498 -0
  594. package/runtime/prime/bin/notify.sh +5 -2
  595. package/runtime/prime/bin/page-access.sh +103 -0
  596. package/runtime/prime/bin/person.sh +13 -2
  597. package/runtime/prime/bin/pi-branch-policy.mjs +37 -0
  598. package/runtime/prime/bin/pi-observe-context.mjs +97 -4
  599. package/runtime/prime/bin/pi-render-spec.mjs +0 -1
  600. package/runtime/prime/bin/pi-spirit-discovery.mjs +34 -0
  601. package/runtime/prime/bin/post-update.sh +181 -0
  602. package/runtime/prime/bin/prime-render-spec.mjs +0 -1
  603. package/runtime/prime/bin/prime-session-start.sh +3 -1
  604. package/runtime/prime/bin/publish-artifact.sh +89 -42
  605. package/runtime/prime/bin/qa-inventory.sh +2 -2
  606. package/runtime/prime/bin/quest.sh +1 -1
  607. package/runtime/prime/bin/records.sh +11 -0
  608. package/runtime/prime/bin/reflexes/05-vitals.sh +9 -0
  609. package/runtime/prime/bin/reflexes/10-open-items.sh +12 -0
  610. package/runtime/prime/bin/reflexes/15-retrieval.sh +8 -0
  611. package/runtime/prime/bin/reflexes/20-nightly.sh +100 -0
  612. package/runtime/prime/bin/reflexes/20-sandbox.sh +85 -0
  613. package/runtime/prime/bin/reflexes/30-cost.py +116 -0
  614. package/runtime/prime/bin/reflexes/40-shells.py +51 -0
  615. package/runtime/prime/bin/reflexes/README.md +61 -0
  616. package/runtime/prime/bin/reflexes.sh +7 -0
  617. package/runtime/prime/bin/runtime-identity.sh +140 -42
  618. package/runtime/prime/bin/screenshot.sh +77 -0
  619. package/runtime/prime/bin/scroll.sh +1 -1
  620. package/runtime/prime/bin/search.sh +31 -5
  621. package/runtime/prime/bin/session-autosave.sh +6 -3
  622. package/runtime/prime/bin/session-id.sh +147 -0
  623. package/runtime/prime/bin/session-log.sh +19 -0
  624. package/runtime/prime/bin/session-record.sh +26 -0
  625. package/runtime/prime/bin/settings.sh +13 -8
  626. package/runtime/prime/bin/spirit-discovery-claude.sh +4 -0
  627. package/runtime/prime/bin/spirit-discovery-codex.sh +4 -0
  628. package/runtime/prime/bin/spirit-discovery-pi.sh +4 -0
  629. package/runtime/prime/bin/spirit-discovery-prime.sh +4 -0
  630. package/runtime/prime/bin/spirit-discovery.sh +4 -0
  631. package/runtime/prime/bin/startup-check.sh +1 -1
  632. package/runtime/prime/bin/telemetry.sh +11 -4
  633. package/runtime/prime/bin/test-baseline.sh +33 -5
  634. package/runtime/prime/bin/todo.sh +1 -1
  635. package/runtime/prime/bin/worktree-create.sh +15 -45
  636. package/runtime/prime/bin/worktree.sh +6 -0
  637. package/runtime/prime/docs/spirit-discovery.md +96 -0
  638. package/runtime/prime/egregore_runtime/__init__.py +18 -12
  639. package/runtime/prime/egregore_runtime/access.py +608 -0
  640. package/runtime/prime/egregore_runtime/access_cli.py +190 -0
  641. package/runtime/prime/egregore_runtime/adapters/invitation.py +5 -3
  642. package/runtime/prime/egregore_runtime/adapters/qmd.py +521 -47
  643. package/runtime/prime/egregore_runtime/admin_entry.py +56 -0
  644. package/runtime/prime/egregore_runtime/artifacts.py +222 -16
  645. package/runtime/prime/egregore_runtime/contracts.py +27 -0
  646. package/runtime/prime/egregore_runtime/eligibility.py +5 -12
  647. package/runtime/prime/egregore_runtime/episode_binding.py +16 -5
  648. package/runtime/prime/egregore_runtime/github_issues.py +2 -2
  649. package/runtime/prime/egregore_runtime/handoff_lookup.py +9 -20
  650. package/runtime/prime/egregore_runtime/harness_cli.py +674 -149
  651. package/runtime/prime/egregore_runtime/held.py +2436 -0
  652. package/runtime/prime/egregore_runtime/hosted_api.py +137 -0
  653. package/runtime/prime/egregore_runtime/identity.py +196 -65
  654. package/runtime/prime/egregore_runtime/identity_transfer.py +6 -2
  655. package/runtime/prime/egregore_runtime/ingest_cli.py +2 -2
  656. package/runtime/prime/egregore_runtime/ingest_index_cli.py +4 -16
  657. package/runtime/prime/egregore_runtime/installation.py +119 -0
  658. package/runtime/prime/egregore_runtime/investigation.py +64 -41
  659. package/runtime/prime/egregore_runtime/investigation_guidance.py +16 -11
  660. package/runtime/prime/egregore_runtime/issue_cli.py +51 -32
  661. package/runtime/prime/egregore_runtime/issue_reporting.py +4 -3
  662. package/runtime/prime/egregore_runtime/issue_triage_service.py +2 -2
  663. package/runtime/prime/egregore_runtime/issues.py +12 -6
  664. package/runtime/prime/egregore_runtime/knowledge.py +331 -5
  665. package/runtime/prime/egregore_runtime/knowledge_cli.py +57 -17
  666. package/runtime/prime/egregore_runtime/lifecycle.py +88 -22
  667. package/runtime/prime/egregore_runtime/lifecycle_cli.py +21 -13
  668. package/runtime/prime/egregore_runtime/line_ids.py +10 -0
  669. package/runtime/prime/egregore_runtime/memory_push.py +349 -0
  670. package/runtime/prime/egregore_runtime/observe.py +64 -25
  671. package/runtime/prime/egregore_runtime/observers.py +19 -0
  672. package/runtime/prime/egregore_runtime/optional_modules.py +13 -0
  673. package/runtime/prime/egregore_runtime/outputs_cli.py +321 -0
  674. package/runtime/prime/egregore_runtime/policy.py +651 -24
  675. package/runtime/prime/egregore_runtime/private_result.py +2 -1
  676. package/runtime/prime/egregore_runtime/projection.py +946 -0
  677. package/runtime/prime/egregore_runtime/quest_cli.py +20 -23
  678. package/runtime/prime/egregore_runtime/question_cli.py +15 -11
  679. package/runtime/prime/egregore_runtime/questions.py +10 -10
  680. package/runtime/prime/egregore_runtime/quests.py +10 -10
  681. package/runtime/prime/egregore_runtime/record_publish.py +548 -0
  682. package/runtime/prime/egregore_runtime/record_subject.py +564 -0
  683. package/runtime/prime/egregore_runtime/research_ingest.py +2 -4
  684. package/runtime/prime/egregore_runtime/runtime.py +169 -60
  685. package/runtime/prime/egregore_runtime/sandbox.py +194 -0
  686. package/runtime/prime/egregore_runtime/scroll_cli.py +22 -32
  687. package/runtime/prime/egregore_runtime/scrolls.py +23 -15
  688. package/runtime/prime/egregore_runtime/shadow.py +262 -0
  689. package/runtime/prime/egregore_runtime/spirit_discovery.py +487 -0
  690. package/runtime/prime/egregore_runtime/spirit_discovery_cli.py +25 -0
  691. package/runtime/prime/egregore_runtime/spirit_discovery_transport.py +18 -0
  692. package/runtime/prime/egregore_runtime/status.py +101 -44
  693. package/runtime/prime/egregore_runtime/status_cli.py +13 -5
  694. package/runtime/prime/egregore_runtime/sync.py +39 -21
  695. package/runtime/prime/egregore_runtime/taste.py +934 -0
  696. package/runtime/prime/egregore_runtime/taste_cli.py +242 -0
  697. package/runtime/prime/egregore_runtime/taste_rules.py +91 -0
  698. package/runtime/prime/egregore_runtime/telemetry.py +26 -3
  699. package/runtime/prime/egregore_runtime/todo_cli.py +15 -12
  700. package/runtime/prime/egregore_runtime/todos.py +3 -2
  701. package/runtime/prime/egregore_runtime/upgrade.py +85 -58
  702. package/runtime/prime/egregore_runtime/writeback.py +330 -24
  703. package/runtime/prime/manifest.json +66 -5
  704. package/runtime/claude/bin/thread.sh +0 -9
  705. package/runtime/claude/egregore_runtime/admin_gate.py +0 -102
  706. package/runtime/claude/egregore_runtime/thread_cli.py +0 -173
  707. package/runtime/claude/egregore_runtime/threads.py +0 -521
  708. package/runtime/codex/bin/thread.sh +0 -9
  709. package/runtime/codex/egregore_runtime/admin_gate.py +0 -102
  710. package/runtime/codex/egregore_runtime/thread_cli.py +0 -173
  711. package/runtime/codex/egregore_runtime/threads.py +0 -521
  712. package/runtime/pi/bin/thread.sh +0 -9
  713. package/runtime/pi/egregore_runtime/admin_gate.py +0 -102
  714. package/runtime/pi/egregore_runtime/thread_cli.py +0 -173
  715. package/runtime/pi/egregore_runtime/threads.py +0 -521
  716. package/runtime/prime/bin/thread.sh +0 -9
  717. package/runtime/prime/egregore_runtime/admin_gate.py +0 -102
  718. package/runtime/prime/egregore_runtime/thread_cli.py +0 -173
  719. package/runtime/prime/egregore_runtime/threads.py +0 -521
@@ -1,410 +1,89 @@
1
1
  ---
2
2
  name: dark-mode
3
- description: "Use when authoring or modifying browser-rendered visual output: HTML, CSS, React SSR, artifact templates, markdown renderers, design tokens, themes, or composed pages. Do not invoke for an ordinary /view render—the checked-in renderer already owns its theme contract. The load-bearing rule is that theme-sensitive colors must be emitted as `var(--token)`, never resolved inline hex."
3
+ description: "Use when authoring or modifying browser-rendered visual output: HTML, CSS, React SSR, artifact templates, markdown renderers, design tokens, themes, or composed pages. Do not invoke for an ordinary /view render—the checked-in renderer already owns its theme contract. The load-bearing rule is that theme-sensitive colors must be emitted as `var(--token)`, never resolved inline hex; the colors themselves come from the design system registry."
4
4
  ---
5
5
 
6
6
  # Dark Mode
7
7
 
8
8
  ## Voice Complex
9
9
 
10
- This skill governs BROWSER VISUAL RENDERING — warm palette, CSS token system, theme behavior. The warm-brown base (#1D1611) and terracotta accent (#D4875A) are the visual expression of the same warmth that runs through all Egregore registers.
10
+ This skill governs browser visual rendering: theme tokens and theme behavior. It carries no palette; every color comes from the design system.
11
11
  Shared aesthetic: voice-bedrock (`.claude/rules/voice-bedrock.md`).
12
+ For pair routing, component profiles, or adding a pair: `packages/design-system/skill/SKILL.md`.
12
13
  For terminal rendering: `tui-design` skill.
13
14
  For product copy in rendered pages: `product-voice` skill.
14
15
  For prose content in rendered pages: `egregore-voice` skill.
15
16
 
16
- This skill is a behavioral constraint system for Egregore visual output. It exists to stop the most common failure mode before it happens: an otherwise correct dark palette being defeated by SSR-emitted inline styles.
17
-
18
17
  ## When to invoke
19
18
 
20
- User says: "dark mode", "theme toggle", "color system", "card surface", "make this work in dark mode", or any request to generate or modify browser-rendered visual output (HTML, CSS, React SSR, Egregore artifacts, design tokens)
21
- Not this: TUI terminal output → `tui-design` · plain markdown files with no styled HTML
22
-
23
- ## The Bitter Lesson
24
-
25
- **If React SSR renders `style="color:#2A2A2A"`, dark mode loses.** CSS variable overrides only work when the rendered value is itself a variable reference. If a color must adapt across themes, emit `var(--token)` at the render site. Not in comments. Not in a later stylesheet. In the actual rendered style.
26
-
27
- Treat this as a hard constraint:
28
-
29
- 1. Every theme-sensitive color in CSS or inline `style` props must use `var(--token)`.
30
- 2. Theme state lives on `<html data-theme="...">`.
31
- 3. Theme restoration happens before paint, in `<head>`.
19
+ User says: "dark mode", "theme toggle", "color system", "card surface", "make this work in dark mode", or any request to generate or modify browser-rendered visual output (HTML, CSS, React SSR, Egregore artifacts, design tokens).
32
20
 
33
- Everything else is secondary.
34
-
35
- ## When To Invoke
36
-
37
- - Generating standalone HTML
38
- - Building or editing React SSR output
39
- - Writing CSS for Egregore artifacts
40
- - Modifying markdown renderers that emit inline styles
41
- - Adding a theme toggle
42
- - Extending the design system with dark surfaces
43
- - Producing any browser-rendered visual artifact
44
-
45
- ## Not This
21
+ Not this:
46
22
 
47
23
  - An ordinary deterministic `/view` render; the checked-in renderer already
48
24
  owns and tests its theme contract
49
- - TUI terminal output; use `/tui-design`
25
+ - TUI terminal output; use `tui-design`
50
26
  - Plain markdown files that do not render styled HTML
51
27
  - Backend or CLI code with no visual surface
52
- - Non-rendered config changes unrelated to color or theme behavior
53
28
 
54
- ## The Egregore Dark Palette
29
+ ## The rule
55
30
 
56
- The palette stays warm. The base dark background is `#1D1611`, not pure black. Accent colors stay the same in both modes because terracotta and muted blue already survive the transition cleanly.
31
+ If a renderer emits `style="color:#15212e"`, theming loses: CSS can re-theme a value only when the rendered value is itself a variable reference. Every theme-sensitive color, in a stylesheet or an inline `style` prop, is `var(--token)` at the render site.
57
32
 
58
- ### Core CSS Variables
33
+ ## Where colors come from
59
34
 
60
- | Token | Light | Dark | Role |
61
- |---|---|---|---|
62
- | `--cream` | `#F5F2ED` | `#1D1611` | Page background; inverted selection text in dark |
63
- | `--black` | `#16100B` | `rgba(255, 255, 255, 0.92)` | Primary text, titles, completed badges |
64
- | `--dark` | `#2A2A2A` | `rgba(255, 255, 255, 0.75)` | Body text, secondary copy, blocked badge fill |
65
- | `--border` | `#E0D8CC` | `rgba(255, 255, 255, 0.06)` | Rules, card borders, checkbox outlines |
66
- | `--muted` | `#8a8578` | `rgba(255, 255, 255, 0.50)` | Metadata, labels, de-emphasized text |
67
- | `--warm-gray` | `#d4cfc5` | `rgba(255, 255, 255, 0.30)` | Tertiary marks, dim text, faint structure |
68
- | `--terminal-bg` | `#1D1611` | `#161210` | Code blocks and terminal surfaces |
35
+ - **Registry**: `packages/design-system/themes/registry.json` holds every palette pair and its theme tokens. The default pair is `registry.routing.defaultPair`, currently `sovereign` (`ledger` light, `bedrock` dark: cool stone with verdigris and steel accents). Use another registered pair only when the content matches that pair's `semantics.useWhen` and you can state the reason.
36
+ - **CSS**: inline the committed, generated `packages/design-system/dist/egregore-design.css`. It defines each theme as a `[data-theme="<theme id>"]` block plus legacy aliases (`--bg`, `--text`, `--accent` and the rest). Never copy its values into a page and never edit it by hand; `npm run build` in `packages/design-system` regenerates it from the registry.
37
+ - **Without the design package**: public and downstream instances do not carry `packages/design-system`. The same files ship vendored in `egregore-artifacts`, both in a checked-out `packages/egregore-artifacts` and in the installed package: `lib/vendor/design-system/themes/registry.json` and `lib/vendor/design-system/dist/egregore-design.css`.
38
+ - **Tokens**: use the role tokens from `contract.roleTokens`: `--paper --paper-2 --card`, `--ink --ink-soft --ink-faint`, `--line --line-soft`, `--t1 --t2 --t3` with their `-bg` washes, the tone tokens `--ok --note --warn --critical --neutral` with their `-bg` washes, `--series-1` to `--series-5` with `--chart-grid --chart-axis` for charts, and `--grain --shadow`.
39
+ - **Status colour**: read meaning from the tone tokens, never from `--t1`..`--t3` positions. The meaning is the same in every pair: `--ok` decided or done, `--note` aside or context, `--warn` owed or gated, `--critical` blocked or at risk, `--neutral` background or later.
40
+ - **No local palette**: a page or a skill never defines its own theme colors. If the role tokens do not cover a color you need, that is a registry change; see the design system skill.
69
41
 
70
- ### Dark-Only Surface Helpers
42
+ ## Highlights
71
43
 
72
- Use these when a component needs separation beyond the base variable set. The current artifacts shell uses `--card-bg` and `--code-bg`; `--elevated-bg` and `--strong-border` come from the same shipped token palette and are the right extensions when extra depth is needed.
44
+ No side stripes: a coloured bar down one side of a box is retired in every render. Mark reading emphasis with a marker under the words (`.eg-mark`), a label in the margin (`.eg-margin` holding an `.eg-label`) or a quote with a hanging opening mark (`.eg-quote`). Mark status with a quiet panel (`.eg-panel`) whose `.eg-label` carries the tone's shape (● ok, ◆ note, ▲ warn, ■ critical, ○ neutral), so the state reads without colour and in both themes. A selected item gets weight plus a filled shape, never a stripe. The classes are `RECIPE_CSS` in `packages/egregore-artifacts/lib/recipe.js`, which the kit's shell injects into every render; the design system skill has the full rule.
73
45
 
74
- | Token | Light Fallback | Dark | Role |
75
- |---|---|---|---|
76
- | `--card-bg` | `#FFFFFF` | `#241E19` | Cards, pills, theme toggle background |
77
- | `--code-bg` | `rgba(59, 45, 33, 0.06)` | `rgba(212, 135, 90, 0.08)` | Inline code background |
78
- | `--elevated-bg` | `#FFFFFF` | `#2A231D` | Raised panels or overlays above cards |
79
- | `--strong-border` | `#d4cfc5` | `rgba(255, 255, 255, 0.10)` | Emphasized borders when `--border` is too faint |
46
+ ## The theme contract
80
47
 
81
- ### Palette Rules
48
+ The kit's renderers set three attributes on `<html>`:
82
49
 
83
- - Warm character first: dark surfaces are brown-black, not blue-black and not pure black.
84
- - Text opacity hierarchy is fixed: `0.92` primary, `0.75` secondary, `0.50` muted, `0.30` dim.
85
- - `--terracotta` stays `#D4875A` in both modes.
86
- - `--blue-muted` stays `#7B9DB7` in both modes.
87
- - Selection inverts: terracotta highlight remains, but dark mode switches the selected text to `#1D1611`.
50
+ | Attribute | Value | Role |
51
+ |---|---|---|
52
+ | `data-theme` | resolved theme id, e.g. `ledger` or `bedrock` | the only CSS selector |
53
+ | `data-theme-pair` | pair id, e.g. `sovereign` | names the family; never a CSS selector |
54
+ | `data-theme-mode` | `auto`, `light` or `dark` | the reader's choice |
55
+
56
+ - Persist only the mode. Resolve it through the pair: `auto` follows `prefers-color-scheme`, with the local clock as the fallback, and the result writes the pair's light or dark member into `data-theme`.
57
+ - Resolve before paint, in a blocking `<head>` script.
58
+ - Storage can throw in sandboxed and private pages: wrap every read and write in try/catch and keep the mode in memory.
59
+ - Reference implementation: the theme script in `packages/egregore-artifacts/lib/shell.js` (a three-state toggle, `light → auto → dark`). Reuse its structure; do not write a second engine.
88
60
 
89
61
  ## Anti-Patterns
90
62
 
91
63
  | Pattern | Why It Breaks | Instead |
92
64
  |---|---|---|
93
- | `style={{ color: colors.black }}` | React resolves `colors.black` to a hex during SSR, so dark CSS cannot override it later | `style={{ color: 'var(--black)' }}` or a class that resolves to `var(--black)` |
94
- | `style={{ color: colors.muted }}` in markdown or components | Same SSR trap, just less obvious because muted copy often escapes review | Emit `style={{ color: 'var(--muted)' }}` |
95
- | `background: white` on cards | The card stays white in dark mode and blows out contrast | `background: var(--card-bg, white)` with a dark override on `[data-theme="dark"]` |
96
- | `border-bottom: 1px solid rgba(224, 216, 204, 0.5)` | You hardcoded a light border into a supposedly themeable component | `border-bottom: 1px solid var(--border)` or `var(--strong-border, var(--border))` |
97
- | `#000000` or `#111111` for dark backgrounds | Cold, dead black clashes with Egregore's warm substrate | Use `#1D1611` or `var(--cream)` once dark mode remaps it |
98
- | `opacity: 0.5` on already-colored text | Multiplies contrast unpredictably and usually makes dark text too faint | Use the precomputed text tokens: `var(--muted)` or `var(--warm-gray)` |
99
- | `@media (prefers-color-scheme: dark)` as the only mechanism | No manual override, no persistence, no explicit state | Use a three-state `light / auto / dark` system |
100
- | Separate `.dark-*` classes for every component | Duplicates the design system and drifts fast | Override variables once under `[data-theme="dark"]` and keep component styles shared |
101
- | Putting theme state on `body` or a wrapper div | Inconsistent scope; portals, overlays, and SSR shells can fall out of sync | Put `data-theme` on `<html>` |
102
- | Restoring the saved theme after the page renders | Causes a flash of the wrong theme | Apply the saved theme in a blocking `<head>` script before paint |
103
- | Converting CSS files to variables but leaving inline `colors.*` references behind | Mixed models create false confidence; one stray inline color is enough to break dark mode | Grep every render path for `colors.` and hardcoded hex in inline styles, then replace with `var(--token)` |
104
-
105
- ## Signature Patterns
106
-
107
- 1. Variable-first inline styles. Inline styles are allowed only when they emit CSS variables, never resolved palette values.
108
- 2. `data-theme` on `<html>`. No `body.dark`, no component-local theme root.
109
- 3. Three-state theme toggle. Support `light`, `auto`, and `dark`, with persistence.
110
- 4. Auto resolves OS preference first, then local-clock fallback. If the system exposes no preference, dark runs from `19:00` to `07:00`.
111
- 5. No-flash initialization. Restore theme state in `<head>` before anything visible paints.
112
- 6. Card elevation through background lightness, not shadow stacks. In dark mode, depth comes from surface contrast.
113
- 7. Accent colors stay stable. Terracotta and muted blue do not get separate dark variants unless there is a proven contrast failure.
114
- 8. Selection highlight inversion. The highlight stays terracotta; selected text flips to the dark background color.
65
+ | `style={{ color: palette.ink }}` with a JS constant | SSR resolves the constant to a fixed hex, so the theme cannot override it | `style={{ color: 'var(--ink)' }}` or a class |
66
+ | `background: white` on cards | The card stays white in a dark theme | `background: var(--card)` |
67
+ | `border: 1px solid rgba(0, 0, 0, 0.08)` | A light-only value inside a themeable component | `var(--line)` or `var(--line-soft)` |
68
+ | `[data-theme="dark"]` overrides or `.dark-*` classes | Theme ids are names like `bedrock`, and role tokens already flip per resolved theme | Style with role tokens; add no per-mode overrides |
69
+ | Selecting on `data-theme-pair` | The pair names the family; it is not a selector | Use role tokens, or `[data-theme="<theme id>"]` when one theme needs its own rule |
70
+ | `opacity: 0.5` on colored text | Contrast changes unpredictably between themes | `var(--ink-soft)` or `var(--ink-faint)` |
71
+ | `@media (prefers-color-scheme: dark)` as the only mechanism | No manual override and no persistence | The three-state mode above |
72
+ | Theme state on `body` or a wrapper div | Portals, overlays and shells fall out of sync | The three attributes on `<html>` |
73
+ | Restoring the saved mode after the page renders | A flash of the wrong theme | A blocking `<head>` script |
115
74
 
116
75
  ## Context Modes
117
76
 
118
- ### Egregore Artifacts (React SSR)
119
-
120
- - Start from `packages/egregore-artifacts/lib/shell.js`, `markdown.js`, `components.js`, and `tokens.js`.
121
- - In render functions, replace `colors.black`, `colors.muted`, `colors.dark`, and similar inline values with `'var(--black)'`, `'var(--muted)'`, `'var(--dark)'`, and so on.
122
- - Keep structural values such as spacing, font families, and dimensions in JS as normal. The rule is specifically about theme-sensitive colors.
123
- - Put the dark variable remap in the shell, not on individual components.
124
-
125
- ### Standalone HTML
126
-
127
- - Emit a full `:root` block plus a `[data-theme="dark"]` override block.
128
- - Put the theme restore script in `<head>` before visible markup.
129
- - Mount the toggle in fixed position and hide it in print.
130
- - Use CSS variable strings in any inline HTML styles you generate.
131
-
132
- ### Tailwind CSS
133
-
134
- - Configure `darkMode: ['selector', '[data-theme=\"dark\"]']`.
135
- - Keep the root selector on `<html>`.
136
- - Prefer CSS custom properties for brand tokens, then map Tailwind utilities to those variables.
137
- - Do not sneak theme-sensitive hex colors into JSX `style` props just because the rest of the page uses Tailwind.
138
-
139
- ### Vanilla CSS
140
-
141
- - Define light tokens in `:root`.
142
- - Override only variables under `[data-theme="dark"]`.
143
- - Component rules should read like `color: var(--black)` and `border-color: var(--border)`.
144
-
145
- ### Email HTML
146
-
147
- - This is the one context where `@media (prefers-color-scheme: dark)` with `!important` is correct.
148
- - Do not build a JS toggle for email.
149
- - Accept that support is partial and optimize for legibility, not full parity.
150
-
151
- ## Calibration Examples
152
-
153
- ### 1. React Component Color Reference
154
-
155
- **Off target**
156
-
157
- ```js
158
- h('span', { style: { color: colors.muted, fontSize: '13px' } }, `(${author})`)
159
- ```
160
-
161
- **On point**
162
-
163
- ```js
164
- h('span', { style: { color: 'var(--muted)', fontSize: '13px' } }, `(${author})`)
165
- ```
166
-
167
- Why: the first version serializes to a fixed hex during SSR. The second survives theme remapping.
168
-
169
- ### 2. Card Background And Elevation
170
-
171
- **Off target**
172
-
173
- ```css
174
- .card {
175
- background: white;
176
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
177
- }
178
- ```
179
-
180
- **On point**
181
-
182
- ```css
183
- .card {
184
- background: var(--card-bg, white);
185
- border: 1px solid var(--border);
186
- }
187
-
188
- [data-theme="dark"] .card {
189
- --card-bg: #241E19;
190
- }
191
- ```
192
-
193
- Why: dark separation comes from a warmer surface step, not a generic shadow preset.
194
-
195
- ### 3. Code Block In A Markdown Renderer
196
-
197
- **Off target**
198
-
199
- ```js
200
- h('code', {
201
- style: {
202
- background: 'rgba(59, 45, 33, 0.06)',
203
- color: colors.black,
204
- padding: '2px 5px',
205
- },
206
- }, text)
207
- ```
208
-
209
- **On point**
210
-
211
- ```js
212
- h('code', {
213
- className: 'eg-code',
214
- }, text)
215
- ```
216
-
217
- ```css
218
- .eg-code {
219
- background: var(--code-bg, rgba(59, 45, 33, 0.06));
220
- color: var(--black);
221
- }
222
-
223
- [data-theme="dark"] .eg-code {
224
- --code-bg: rgba(212, 135, 90, 0.08);
225
- color: var(--terracotta);
226
- }
227
- ```
228
-
229
- Why: inline code needs a dedicated surface token in dark mode; a light-only rgba wash will disappear.
230
-
231
- ## Toggle Reference Implementation
232
-
233
- This is the canonical Egregore pattern: one HTML attribute, one variable override block, one small engine. Keep the structure; adapt only if the host environment forces it.
234
-
235
- ### JS Engine
236
-
237
- ```html
238
- <script>
239
- (function() {
240
- var MODES = ['light', 'auto', 'dark'];
241
- var ICONS = ['\u2600', '\u25D0', '\u263D'];
242
- var LABELS = ['light', 'auto', 'dark'];
243
-
244
- function resolveAuto() {
245
- if (window.matchMedia('(prefers-color-scheme: dark)').matches) return 'dark';
246
- if (window.matchMedia('(prefers-color-scheme: light)').matches) return 'light';
247
- var h = new Date().getHours();
248
- return (h >= 19 || h < 7) ? 'dark' : 'light';
249
- }
250
-
251
- function applyTheme(mode) {
252
- var resolved = mode === 'auto' ? resolveAuto() : mode;
253
- document.documentElement.setAttribute('data-theme', resolved);
254
- }
255
-
256
- function updateToggle(mode) {
257
- var idx = MODES.indexOf(mode);
258
- var btn = document.querySelector('.eg-theme-toggle');
259
- if (!btn) return;
260
- btn.querySelector('.eg-t-icon').textContent = ICONS[idx];
261
- btn.querySelector('.eg-t-label').textContent = LABELS[idx];
262
- }
263
-
264
- var saved = localStorage.getItem('eg-theme-mode') || 'auto';
265
- applyTheme(saved);
266
-
267
- window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function() {
268
- if ((localStorage.getItem('eg-theme-mode') || 'auto') === 'auto') applyTheme('auto');
269
- });
270
-
271
- window.__egTheme = {
272
- cycle: function() {
273
- var cur = localStorage.getItem('eg-theme-mode') || 'auto';
274
- var next = MODES[(MODES.indexOf(cur) + 1) % 3];
275
- localStorage.setItem('eg-theme-mode', next);
276
- applyTheme(next);
277
- updateToggle(next);
278
- },
279
- init: function() { updateToggle(saved); }
280
- };
281
- })();
282
- </script>
283
- ```
284
-
285
- ### CSS Shell
286
-
287
- ```css
288
- :root {
289
- --cream: #F5F2ED;
290
- --black: #16100B;
291
- --dark: #2A2A2A;
292
- --border: #E0D8CC;
293
- --muted: #8a8578;
294
- --warm-gray: #d4cfc5;
295
- --terminal-bg: #1D1611;
296
- --terracotta: #D4875A;
297
- --blue-muted: #7B9DB7;
298
- }
299
-
300
- [data-theme="dark"] {
301
- --cream: #1D1611;
302
- --black: rgba(255, 255, 255, 0.92);
303
- --dark: rgba(255, 255, 255, 0.75);
304
- --border: rgba(255, 255, 255, 0.06);
305
- --muted: rgba(255, 255, 255, 0.50);
306
- --warm-gray: rgba(255, 255, 255, 0.30);
307
- --terminal-bg: #161210;
308
- }
309
-
310
- ::selection { background: var(--terracotta); color: var(--cream); }
311
- [data-theme="dark"] ::selection { color: #1D1611; }
312
-
313
- .eg-theme-toggle {
314
- position: fixed;
315
- top: 1.25rem;
316
- right: 1.25rem;
317
- width: 36px;
318
- height: 36px;
319
- border-radius: 50px;
320
- border: 1px solid var(--border);
321
- background: var(--card-bg, white);
322
- cursor: pointer;
323
- display: flex;
324
- align-items: center;
325
- justify-content: center;
326
- font-size: 15px;
327
- line-height: 1;
328
- transition: background 0.2s, border-color 0.2s, width 0.2s;
329
- z-index: 100;
330
- padding: 0;
331
- gap: 6px;
332
- overflow: hidden;
333
- }
334
- .eg-theme-toggle:hover {
335
- border-color: var(--terracotta);
336
- width: 92px;
337
- padding: 0 12px;
338
- }
339
- [data-theme="dark"] .eg-theme-toggle { --card-bg: #241E19; }
340
- .eg-theme-toggle .eg-t-icon { flex-shrink: 0; }
341
- .eg-theme-toggle .eg-t-label {
342
- font-family: var(--font-mono);
343
- font-size: 10px;
344
- letter-spacing: 0.04em;
345
- color: var(--muted);
346
- white-space: nowrap;
347
- width: 0;
348
- overflow: hidden;
349
- transition: width 0.2s, opacity 0.2s;
350
- opacity: 0;
351
- }
352
- .eg-theme-toggle:hover .eg-t-label { width: 32px; opacity: 1; }
353
-
354
- @media print {
355
- body { background: white; }
356
- .eg-artifact { padding: 1rem; max-width: none; }
357
- .eg-card { break-inside: avoid; }
358
- .eg-theme-toggle { display: none; }
359
- }
360
-
361
- @media (max-width: 640px) {
362
- .eg-artifact { padding: 2rem 1.25rem 3rem; }
363
- .eg-title { font-size: 28px; }
364
- .eg-section-title { font-size: 20px; }
365
- .eg-meta-row { gap: 10px; }
366
- .eg-theme-toggle { top: 0.75rem; right: 0.75rem; width: 32px; height: 32px; font-size: 14px; }
367
- }
368
- ```
369
-
370
- ### HTML Hookup
371
-
372
- ```html
373
- <html lang="en" data-theme="light">
374
- <head>
375
- <!-- theme restore script goes here -->
376
- </head>
377
- <body>
378
- <button class="eg-theme-toggle" aria-label="Toggle theme" onclick="__egTheme.cycle()">
379
- <span class="eg-t-icon">&#9680;</span>
380
- <span class="eg-t-label">auto</span>
381
- </button>
382
- <script>__egTheme.init();</script>
383
- </body>
384
- </html>
385
- ```
77
+ - **Egregore artifacts** (`packages/egregore-artifacts`): the shell inlines the design CSS, bridges legacy chrome names onto role tokens, and runs the theme script. Component code uses role tokens only.
78
+ - **Python pages** (`api/`): `api/design_system.py` (`design_head`, `html_attrs`, `bridge_css`) reads the same dist CSS and registry as static files.
79
+ - **Standalone HTML**: inline the dist CSS, set the three attributes on `<html>`, and add the `<head>` theme script.
80
+ - **Tailwind**: map utilities to role-token variables (for example `ink: 'var(--ink)'`); do not use the `dark:` variant for theme colors.
81
+ - **Email HTML**: the one context where `@media (prefers-color-scheme: dark)` with `!important` is correct. Build no JS toggle, and optimize for legibility over parity.
386
82
 
387
83
  ## Pre-Ship Checklist
388
84
 
389
- 1. Grep for hardcoded hex colors and `colors.` references in render paths that emit inline styles.
390
- 2. Verify every theme-sensitive inline color is a `var(--token)` string.
391
- 3. Verify both `:root` and `[data-theme="dark"]` blocks exist.
392
- 4. Verify `data-theme` is set on `<html>`, not `body`.
393
- 5. Verify the saved theme is restored in `<head>` before visible markup paints.
394
- 6. Verify the toggle cycles `light -> auto -> dark` and persists to `localStorage`.
395
- 7. Verify auto mode follows OS preference first and local time second.
396
- 8. Verify no surface uses pure black or a cool gray dark background.
397
- 9. Verify cards, code, and elevated surfaces separate by warm lightness steps rather than shadow spam.
398
- 10. Verify selection, print, and mobile behavior still work after the theme system is added.
399
-
400
- ## Reference Files
401
-
402
- Read these conditionally, depending on the task:
403
-
404
- - `packages/egregore-artifacts/lib/shell.js` for the canonical shell structure, variable overrides, and toggle wiring.
405
- - `packages/egregore-artifacts/lib/tokens.js` for the shipped light and dark token values.
406
- - `packages/egregore-artifacts/lib/markdown.js` for the inline-style `var(--token)` conversion pattern.
407
- - `packages/egregore-artifacts/lib/components.js` for component-level inline style usage that must stay variable-first.
408
- - `packages/design-system/tokens.css` for the broader design-system token vocabulary.
409
-
410
- If the current checkout does not yet contain the merged dark-mode implementation in those artifact files, inspect the shipped worktree copies under `.claude/worktrees/soul-document-design/packages/egregore-artifacts/lib/`.
85
+ 1. No hex or resolved color constant in any render path that emits inline styles.
86
+ 2. Every `var(--x)` the page uses is defined for both members of its pair (for `sovereign`: `ledger` and `bedrock`).
87
+ 3. `<html>` carries all three attributes, and the mode is restored in `<head>` before paint.
88
+ 4. The toggle cycles `light → auto → dark`; the choice survives a reload where storage works, and nothing throws where it does not.
89
+ 5. Print and phone-width layouts still work.
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: records
3
+ description: View or change your session records, hold the current session, redact a past record, record past sessions from this machine, and close or file the open items records carry.
4
+ ---
5
+
6
+ # /records — your session records
7
+
8
+ Session records put asked, decided, left open, touched and cost in shared
9
+ memory. Organization policy sets the default; each person controls their own
10
+ records. The full trail stays on this machine as a file under
11
+ `~/.egregore/trails/<folder>/<session>.md`. Your own Claude
12
+ account reads it once to write an outline. The model
13
+ call can be disabled. See [Session records](../../../docs/session-records.md)
14
+ for the exact content checks and their limits.
15
+
16
+ Claude Code, Codex CLI, Pi and Prime share the same record and hold controls.
17
+ Pi and Prime record at session end; an idle sweep also covers Codex and
18
+ continued sessions. `/records sweep` requests that sweep after the first
19
+ offer has been answered. Codex reports tokens and price coverage; Pi and
20
+ Prime use their usage ledger. Working-directory checks exclude other projects.
21
+
22
+ ## When to invoke
23
+
24
+ Use for `/records`, session record settings, the greeting's past-session
25
+ offer, "off the record", a request to hold or redact a session record, or
26
+ the open items the records carry: listing them, closing one, or filing one as
27
+ an issue.
28
+
29
+ ## Commands
30
+
31
+ Use `bin/records.sh`; do not edit personal state directly.
32
+
33
+ | Intent | Command |
34
+ |---|---|
35
+ | Show settings and unrecorded count | `bash bin/records.sh status` |
36
+ | Read recent decisions and open items | `bash bin/records.sh digest` |
37
+ | Read the organization's vitals, the last seven days beside the seven before | `bash bin/records.sh vitals` (`--json` for measurements and findings; `--findings` for actions and verification) |
38
+ | Record a concrete outcome and its contributing sessions | `bash bin/records.sh outcome record --file <manifest.json>` |
39
+ | Inspect accepted-outcome costs and coverage | `bash bin/records.sh outcome report --json` |
40
+ | Register or update a measured correction | `bash bin/records.sh intervention record --file <manifest.json>` |
41
+ | Inspect the five/ten-outcome checkpoints | `bash bin/records.sh intervention report --json` |
42
+ | Retry a waiting records push | `bash bin/records.sh status --push` |
43
+ | Turn your records on or off | `bash bin/records.sh on` or `off` |
44
+ | Choose the detail | `bash bin/records.sh detail outline` or `detail full` |
45
+ | Hold this session | `bash bin/records.sh hold` |
46
+ | Hold a past session of yours | `bash bin/records.sh redact <id-or-prefix>` |
47
+ | Review past sessions before recording | `bash bin/records.sh backfill --dry-run` |
48
+ | Record the listed past sessions | `bash bin/records.sh backfill --yes` |
49
+ | Sweep idle sessions and refresh continued ones | `bash bin/records.sh sweep` |
50
+ | Limit the past-session window | `bash bin/records.sh backfill --days 30 --dry-run` |
51
+ | Read one local trail | `bash bin/records.sh show <id-or-prefix>` |
52
+ | Mark the greeting offer answered | `bash bin/records.sh noticed` |
53
+ | List active open items | `bash bin/records.sh open` |
54
+ | Review retained stale items | `bash bin/records.sh open --stale` |
55
+ | Renew the relevance of a verified existing outcome | `bash bin/records.sh reactivate <item-id>` |
56
+ | Remove an item from current relevance | `bash bin/records.sh stale <item-id>` |
57
+ | Mark an open item done | `bash bin/records.sh close <item-id>` |
58
+ | Prepare an issue draft for an open item | `bash bin/records.sh file <item-id>` |
59
+ | File that draft after the person confirms it | `bash bin/records.sh file <item-id> --confirm <request-id>` |
60
+
61
+ For "off the record", run `hold` immediately and confirm the returned result
62
+ in one line. The durable hold applies across checkpoints, resumes and
63
+ backfill. An existing record becomes a stub by default; a person who has
64
+ turned off hold stubs gets a removal. Revisions already pushed remain in
65
+ memory repository history. Purging history is a separate future command.
66
+ Do not imply that hold removes earlier published revisions.
67
+
68
+ When the greeting offer is answered: yes runs `backfill --yes`; no keeps
69
+ past sessions unpublished, and only sessions from now on are recorded; an
70
+ explicit request to turn recording off runs `off`. Then run `noticed`. Only a
71
+ later `backfill --yes` publishes the earlier sessions. For "show one", first
72
+ run `backfill --dry-run`, choose one listed session, and use `show` to
73
+ display its local trail. Return
74
+ to the offer after the preview. Do not record the batch until the person says
75
+ yes. A direct request to backfill is already that instruction.
76
+
77
+ `full` includes prompt excerpts and selected assistant text. Explain that
78
+ before changing from outline when the person's intent is unclear. Outline
79
+ asks are paraphrased with mechanical checks, while deterministic sections
80
+ retain paths, command names, commit subjects and counts. The checks do not
81
+ guarantee removal of every sensitive detail or outside name. Hold or redact
82
+ is the person's remedy when something should stay out of shared memory.
83
+
84
+ If `hold` cannot identify the invoking session, report its one-line result.
85
+ Never guess a session id from a shared file or apply another person's id.
86
+ A past-session redaction is restricted to this person's records.
87
+
88
+ ## Digest
89
+
90
+ `/records digest` shows what the day's sessions decided and left open,
91
+ including yesterday and today across all authors, and under Carried the open
92
+ items still carried from earlier days. Each open item starts with its id. Use
93
+ `--days N` or `--since YYYY-MM-DD` for a longer window. The digest reads
94
+ records only and writes nothing. To keep a decision or finding in
95
+ organizational knowledge, hand the line to `/reflect`.
96
+
97
+ ## Open items
98
+
99
+ An open item has two independent properties: **resolution** (open until an
100
+ explicit close or filing) and **relevance** (active or stale). Its id remains
101
+ the first six hex digits of the normalized line's SHA-256, without attribution.
102
+ Its original age never resets. Similar wording is not proof of the same task.
103
+
104
+ After fourteen days without an explicit reactivation, an unresolved item is
105
+ **open but stale**. This is a read-time projection; no timer rewrites records or
106
+ appends expiry noise. Repeating the line does not renew relevance, and a
107
+ mention cannot reopen a closed or filed item. Existing expired ledger events
108
+ remain terminal for backward compatibility; no new expiry events are created.
109
+
110
+ `/records open` shows active work; `open --stale` shows the retained stale
111
+ backlog; `open --all --json` exposes both with their original and relevance
112
+ ages. The greeting shows the active count and a bounded stale count/link,
113
+ without expanding stale text into the working context or demanding an owner.
114
+
115
+ `/records stale <id>` removes an item from current relevance immediately.
116
+ `/records reactivate <id>` appends an explicit relevance renewal, retaining its
117
+ original age and record. Reactivate only after checking that the same concrete
118
+ outcome is still needed. If the goal or scope changed, close the old item with
119
+ a successor reference in the next record and start a new concrete item. Never
120
+ attach new work to a stale item merely because its broad topic sounds similar.
121
+ Filed items continue in their linked issue, preventing duplicate carry work.
122
+
123
+ `close`, `stale`, `reactivate` and successful `file` append events to
124
+ `memory/sessions/open-items.jsonl`. Events contain the item id, state, Runtime
125
+ actor id, timestamp and optional issue URL, never item text. The latest valid
126
+ event by time wins; the union merge rule preserves concurrent histories.
127
+
128
+ `file` without `--confirm` prepares a draft through the issue flow and files
129
+ nothing. Show the person the draft it prints. Only after they confirm that
130
+ exact draft, run `file <item-id> --confirm <request-id>` with the printed
131
+ request id. The event is written only when the filing succeeds, with the
132
+ issue link. Filing needs the configured GitHub issue tracker
133
+ (`issues.backend: github` in `egregore.json`); without one, `file` says so
134
+ and writes nothing.
135
+
136
+ ## Outcomes and measured corrections
137
+
138
+ Use the [outcome economics workflow](../../../docs/plans/outcome-economics-workflow.md)
139
+ when implementing findings from the scorecard. The agent prepares manifests and
140
+ records the work; no additional roles or approval queues are needed. Register a
141
+ concrete outcome as open, link native aggregate session scopes, and append its
142
+ verified disposition when the agreed acceptance condition is met. Do not infer
143
+ acceptance from a merge, topic similarity or an open item. Do not invent a human
144
+ verification. Keep attribution incomplete until driver, worker, retry and review
145
+ costs are accounted for.
146
+
147
+ The explicit scorecard joins canonical final costs. Missing prices or records,
148
+ held work and overlapping parent/worker scopes cannot become measured zero or
149
+ complete unit cost. Repeated finding tags rank associated spend, not recoverable
150
+ waste. Register an intervention's baseline before post-change work; inspect five
151
+ comparable terminal outcomes, decide at ten, and revisit quality regressions
152
+ immediately. These checkpoints never require delaying an already justified fix.
153
+
154
+ ## Telemetry
155
+
156
+ ```bash
157
+ bash bin/telemetry.sh emit "command" '{"command":"records"}' 2>/dev/null &
158
+ ```