cognirelay 1.4.9__tar.gz

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 (279) hide show
  1. cognirelay-1.4.9/.env.example +158 -0
  2. cognirelay-1.4.9/LICENSE +17 -0
  3. cognirelay-1.4.9/MANIFEST.in +26 -0
  4. cognirelay-1.4.9/PKG-INFO +47 -0
  5. cognirelay-1.4.9/README-PYPI.md +32 -0
  6. cognirelay-1.4.9/README.md +165 -0
  7. cognirelay-1.4.9/agent-assets/README.md +10 -0
  8. cognirelay-1.4.9/agent-assets/hooks/README.md +77 -0
  9. cognirelay-1.4.9/agent-assets/hooks/cognirelay_continuity_save_hook.py +477 -0
  10. cognirelay-1.4.9/agent-assets/hooks/cognirelay_retrieval_hook.py +146 -0
  11. cognirelay-1.4.9/agent-assets/skills/cognirelay-continuity-authoring/SKILL.md +52 -0
  12. cognirelay-1.4.9/app/__init__.py +1 -0
  13. cognirelay-1.4.9/app/artifact_lifecycle/__init__.py +0 -0
  14. cognirelay-1.4.9/app/artifact_lifecycle/service.py +1835 -0
  15. cognirelay-1.4.9/app/audit.py +372 -0
  16. cognirelay-1.4.9/app/auth.py +188 -0
  17. cognirelay-1.4.9/app/config.py +636 -0
  18. cognirelay-1.4.9/app/constants.py +5 -0
  19. cognirelay-1.4.9/app/context/__init__.py +29 -0
  20. cognirelay-1.4.9/app/context/graph.py +750 -0
  21. cognirelay-1.4.9/app/context/service.py +990 -0
  22. cognirelay-1.4.9/app/continuity/__init__.py +37 -0
  23. cognirelay-1.4.9/app/continuity/cold.py +185 -0
  24. cognirelay-1.4.9/app/continuity/compare.py +80 -0
  25. cognirelay-1.4.9/app/continuity/constants.py +324 -0
  26. cognirelay-1.4.9/app/continuity/context_state.py +471 -0
  27. cognirelay-1.4.9/app/continuity/freshness.py +75 -0
  28. cognirelay-1.4.9/app/continuity/listing.py +285 -0
  29. cognirelay-1.4.9/app/continuity/paths.py +125 -0
  30. cognirelay-1.4.9/app/continuity/persistence.py +369 -0
  31. cognirelay-1.4.9/app/continuity/refresh.py +123 -0
  32. cognirelay-1.4.9/app/continuity/retention.py +196 -0
  33. cognirelay-1.4.9/app/continuity/retrieval.py +97 -0
  34. cognirelay-1.4.9/app/continuity/revalidation.py +105 -0
  35. cognirelay-1.4.9/app/continuity/salience.py +258 -0
  36. cognirelay-1.4.9/app/continuity/service.py +2633 -0
  37. cognirelay-1.4.9/app/continuity/trimming.py +191 -0
  38. cognirelay-1.4.9/app/continuity/trust.py +329 -0
  39. cognirelay-1.4.9/app/continuity/validation.py +871 -0
  40. cognirelay-1.4.9/app/coordination/__init__.py +61 -0
  41. cognirelay-1.4.9/app/coordination/common.py +162 -0
  42. cognirelay-1.4.9/app/coordination/handoff_service.py +426 -0
  43. cognirelay-1.4.9/app/coordination/locking.py +138 -0
  44. cognirelay-1.4.9/app/coordination/query_index.py +764 -0
  45. cognirelay-1.4.9/app/coordination/reconciliation_service.py +602 -0
  46. cognirelay-1.4.9/app/coordination/shared_service.py +546 -0
  47. cognirelay-1.4.9/app/discovery/__init__.py +33 -0
  48. cognirelay-1.4.9/app/discovery/service.py +1759 -0
  49. cognirelay-1.4.9/app/git_locking.py +141 -0
  50. cognirelay-1.4.9/app/git_manager.py +102 -0
  51. cognirelay-1.4.9/app/git_safety.py +200 -0
  52. cognirelay-1.4.9/app/help/__init__.py +35 -0
  53. cognirelay-1.4.9/app/help/service.py +1953 -0
  54. cognirelay-1.4.9/app/indexer.py +383 -0
  55. cognirelay-1.4.9/app/lifecycle_warnings.py +94 -0
  56. cognirelay-1.4.9/app/main.py +2066 -0
  57. cognirelay-1.4.9/app/maintenance/__init__.py +31 -0
  58. cognirelay-1.4.9/app/maintenance/service.py +2479 -0
  59. cognirelay-1.4.9/app/mcp/__init__.py +15 -0
  60. cognirelay-1.4.9/app/mcp/service.py +713 -0
  61. cognirelay-1.4.9/app/messages/__init__.py +29 -0
  62. cognirelay-1.4.9/app/messages/service.py +931 -0
  63. cognirelay-1.4.9/app/models.py +1209 -0
  64. cognirelay-1.4.9/app/ops/__init__.py +10 -0
  65. cognirelay-1.4.9/app/ops/service.py +873 -0
  66. cognirelay-1.4.9/app/peers/__init__.py +21 -0
  67. cognirelay-1.4.9/app/peers/service.py +345 -0
  68. cognirelay-1.4.9/app/registry_lifecycle/__init__.py +0 -0
  69. cognirelay-1.4.9/app/registry_lifecycle/service.py +2290 -0
  70. cognirelay-1.4.9/app/runtime/__init__.py +49 -0
  71. cognirelay-1.4.9/app/runtime/hooks.py +374 -0
  72. cognirelay-1.4.9/app/runtime/service.py +350 -0
  73. cognirelay-1.4.9/app/schedule/__init__.py +27 -0
  74. cognirelay-1.4.9/app/schedule/service.py +1253 -0
  75. cognirelay-1.4.9/app/security/__init__.py +35 -0
  76. cognirelay-1.4.9/app/security/service.py +897 -0
  77. cognirelay-1.4.9/app/segment_history/__init__.py +1 -0
  78. cognirelay-1.4.9/app/segment_history/append.py +363 -0
  79. cognirelay-1.4.9/app/segment_history/families.py +593 -0
  80. cognirelay-1.4.9/app/segment_history/locking.py +190 -0
  81. cognirelay-1.4.9/app/segment_history/manifest.py +337 -0
  82. cognirelay-1.4.9/app/segment_history/service.py +2971 -0
  83. cognirelay-1.4.9/app/segment_history/utils.py +199 -0
  84. cognirelay-1.4.9/app/storage.py +337 -0
  85. cognirelay-1.4.9/app/tasks/__init__.py +35 -0
  86. cognirelay-1.4.9/app/tasks/service.py +582 -0
  87. cognirelay-1.4.9/app/timestamps.py +97 -0
  88. cognirelay-1.4.9/app/ui/__init__.py +5 -0
  89. cognirelay-1.4.9/app/ui/docs.py +366 -0
  90. cognirelay-1.4.9/app/ui/render.py +21 -0
  91. cognirelay-1.4.9/app/ui/router.py +3038 -0
  92. cognirelay-1.4.9/app/ui/static/mu.slate.css +2 -0
  93. cognirelay-1.4.9/app/ui/static/ui.css +610 -0
  94. cognirelay-1.4.9/app/ui/static/ui_live.js +274 -0
  95. cognirelay-1.4.9/app/ui/templates/continuity_detail.html +123 -0
  96. cognirelay-1.4.9/app/ui/templates/continuity_list.html +65 -0
  97. cognirelay-1.4.9/app/ui/templates/docs_detail.html +15 -0
  98. cognirelay-1.4.9/app/ui/templates/docs_index.html +6 -0
  99. cognirelay-1.4.9/app/ui/templates/graph.html +17 -0
  100. cognirelay-1.4.9/app/ui/templates/layout.html +61 -0
  101. cognirelay-1.4.9/app/ui/templates/overview.html +52 -0
  102. cognirelay-1.4.9/app/ui/templates/schedule_list.html +48 -0
  103. cognirelay-1.4.9/app/ui/templates/task_list.html +32 -0
  104. cognirelay-1.4.9/cognirelay/__init__.py +5 -0
  105. cognirelay-1.4.9/cognirelay/__main__.py +9 -0
  106. cognirelay-1.4.9/cognirelay/cli.py +104 -0
  107. cognirelay-1.4.9/deploy/GO_LIVE_RUNBOOK.md +228 -0
  108. cognirelay-1.4.9/deploy/PRODUCTION_SIGNOFF_CHECKLIST.md +82 -0
  109. cognirelay-1.4.9/deploy/caddy/Caddyfile +16 -0
  110. cognirelay-1.4.9/deploy/nginx/cognirelay.conf +32 -0
  111. cognirelay-1.4.9/deploy/scripts/bootstrap-debian-nginx.sh +236 -0
  112. cognirelay-1.4.9/deploy/scripts/cognirelay-ops-run.sh +48 -0
  113. cognirelay-1.4.9/deploy/scripts/rollback-debian-nginx.sh +174 -0
  114. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-backup.service +10 -0
  115. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-backup.timer +10 -0
  116. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-compact-plan.service +10 -0
  117. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-compact-plan.timer +10 -0
  118. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-index.service +10 -0
  119. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-index.timer +10 -0
  120. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-metrics.service +10 -0
  121. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-metrics.timer +10 -0
  122. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-restore-test.service +10 -0
  123. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-restore-test.timer +10 -0
  124. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-rotation-check.service +10 -0
  125. cognirelay-1.4.9/deploy/systemd/cognirelay-ops-rotation-check.timer +10 -0
  126. cognirelay-1.4.9/deploy/systemd/cognirelay.env.example +31 -0
  127. cognirelay-1.4.9/deploy/systemd/cognirelay.service +21 -0
  128. cognirelay-1.4.9/docs/_config.yml +3 -0
  129. cognirelay-1.4.9/docs/agent-onboarding.md +243 -0
  130. cognirelay-1.4.9/docs/api-surface.md +296 -0
  131. cognirelay-1.4.9/docs/assets/css/style.scss +108 -0
  132. cognirelay-1.4.9/docs/cognirelay-client.md +273 -0
  133. cognirelay-1.4.9/docs/external-references.md +437 -0
  134. cognirelay-1.4.9/docs/index.md +72 -0
  135. cognirelay-1.4.9/docs/mcp-216-convergence-audit.md +47 -0
  136. cognirelay-1.4.9/docs/mcp.md +248 -0
  137. cognirelay-1.4.9/docs/payload-reference.md +873 -0
  138. cognirelay-1.4.9/docs/releases/v1.4.0.md +48 -0
  139. cognirelay-1.4.9/docs/releases/v1.4.1.md +35 -0
  140. cognirelay-1.4.9/docs/releases/v1.4.2.md +38 -0
  141. cognirelay-1.4.9/docs/releases/v1.4.3.md +38 -0
  142. cognirelay-1.4.9/docs/releases/v1.4.4.md +38 -0
  143. cognirelay-1.4.9/docs/releases/v1.4.5.md +38 -0
  144. cognirelay-1.4.9/docs/releases/v1.4.6.md +40 -0
  145. cognirelay-1.4.9/docs/releases/v1.4.7.md +49 -0
  146. cognirelay-1.4.9/docs/releases/v1.4.8.md +37 -0
  147. cognirelay-1.4.9/docs/releases/v1.4.9.md +66 -0
  148. cognirelay-1.4.9/docs/reviewer-guide.md +373 -0
  149. cognirelay-1.4.9/docs/system-overview.md +582 -0
  150. cognirelay-1.4.9/pyproject.toml +37 -0
  151. cognirelay-1.4.9/server.json +33 -0
  152. cognirelay-1.4.9/setup.cfg +4 -0
  153. cognirelay-1.4.9/setup.py +23 -0
  154. cognirelay-1.4.9/tests/test_179_capabilities_v1.py +104 -0
  155. cognirelay-1.4.9/tests/test_admin_bypass_audit_153.py +354 -0
  156. cognirelay-1.4.9/tests/test_agent_assets_289.py +709 -0
  157. cognirelay-1.4.9/tests/test_artifact_lifecycle_113.py +2065 -0
  158. cognirelay-1.4.9/tests/test_client_163.py +1562 -0
  159. cognirelay-1.4.9/tests/test_cognirelay_cli.py +88 -0
  160. cognirelay-1.4.9/tests/test_config.py +123 -0
  161. cognirelay-1.4.9/tests/test_context_graph_219_slice1.py +703 -0
  162. cognirelay-1.4.9/tests/test_context_retrieval.py +453 -0
  163. cognirelay-1.4.9/tests/test_context_retrieval_213_slice1.py +401 -0
  164. cognirelay-1.4.9/tests/test_continuity_107_retention_policy.py +527 -0
  165. cognirelay-1.4.9/tests/test_continuity_108_cold_storage.py +701 -0
  166. cognirelay-1.4.9/tests/test_continuity_120_thread_identity.py +1267 -0
  167. cognirelay-1.4.9/tests/test_continuity_121_aggregate.py +467 -0
  168. cognirelay-1.4.9/tests/test_continuity_121_integration.py +803 -0
  169. cognirelay-1.4.9/tests/test_continuity_121_trust_signals.py +659 -0
  170. cognirelay-1.4.9/tests/test_continuity_165_startup_view.py +448 -0
  171. cognirelay-1.4.9/tests/test_continuity_167_session_end_snapshot.py +380 -0
  172. cognirelay-1.4.9/tests/test_continuity_174_extraction_guards.py +84 -0
  173. cognirelay-1.4.9/tests/test_continuity_176_lifecycle.py +852 -0
  174. cognirelay-1.4.9/tests/test_continuity_176_normalization.py +574 -0
  175. cognirelay-1.4.9/tests/test_continuity_176_patch.py +1289 -0
  176. cognirelay-1.4.9/tests/test_continuity_176_preserve.py +1058 -0
  177. cognirelay-1.4.9/tests/test_continuity_217_slice3_limits.py +252 -0
  178. cognirelay-1.4.9/tests/test_continuity_33_phase1.py +278 -0
  179. cognirelay-1.4.9/tests/test_continuity_33_phase2.py +269 -0
  180. cognirelay-1.4.9/tests/test_continuity_33_phase3.py +306 -0
  181. cognirelay-1.4.9/tests/test_continuity_97_locking.py +381 -0
  182. cognirelay-1.4.9/tests/test_continuity_git_lock_durability.py +359 -0
  183. cognirelay-1.4.9/tests/test_continuity_phase4_phase1.py +478 -0
  184. cognirelay-1.4.9/tests/test_continuity_phase4_phase2.py +738 -0
  185. cognirelay-1.4.9/tests/test_continuity_phase4_phase3.py +419 -0
  186. cognirelay-1.4.9/tests/test_continuity_phase4_phase4.py +601 -0
  187. cognirelay-1.4.9/tests/test_continuity_v1.py +477 -0
  188. cognirelay-1.4.9/tests/test_continuity_v2_phase1.py +187 -0
  189. cognirelay-1.4.9/tests/test_continuity_v2_phase2.py +341 -0
  190. cognirelay-1.4.9/tests/test_continuity_v2_phase3.py +269 -0
  191. cognirelay-1.4.9/tests/test_continuity_v2_phase4.py +281 -0
  192. cognirelay-1.4.9/tests/test_continuity_v3_phase1.py +280 -0
  193. cognirelay-1.4.9/tests/test_continuity_v3_phase2.py +302 -0
  194. cognirelay-1.4.9/tests/test_continuity_v3_phase3.py +466 -0
  195. cognirelay-1.4.9/tests/test_continuity_v3_phase4.py +346 -0
  196. cognirelay-1.4.9/tests/test_coordination_142_persist_hardening.py +735 -0
  197. cognirelay-1.4.9/tests/test_coordination_36_phase1.py +528 -0
  198. cognirelay-1.4.9/tests/test_coordination_36_phase2.py +276 -0
  199. cognirelay-1.4.9/tests/test_coordination_36_phase3.py +246 -0
  200. cognirelay-1.4.9/tests/test_coordination_37_phase1.py +552 -0
  201. cognirelay-1.4.9/tests/test_coordination_37_phase2.py +386 -0
  202. cognirelay-1.4.9/tests/test_coordination_37_phase3.py +226 -0
  203. cognirelay-1.4.9/tests/test_coordination_38_phase1.py +949 -0
  204. cognirelay-1.4.9/tests/test_coordination_38_phase2.py +715 -0
  205. cognirelay-1.4.9/tests/test_coordination_38_phase3.py +459 -0
  206. cognirelay-1.4.9/tests/test_coordination_42_locking.py +268 -0
  207. cognirelay-1.4.9/tests/test_coordination_45_integration.py +546 -0
  208. cognirelay-1.4.9/tests/test_coordination_45_mutations.py +382 -0
  209. cognirelay-1.4.9/tests/test_coordination_45_query_index.py +564 -0
  210. cognirelay-1.4.9/tests/test_discovery.py +241 -0
  211. cognirelay-1.4.9/tests/test_git_locking_98.py +266 -0
  212. cognirelay-1.4.9/tests/test_git_manager_43.py +217 -0
  213. cognirelay-1.4.9/tests/test_git_safety.py +341 -0
  214. cognirelay-1.4.9/tests/test_go_live_hardening.py +282 -0
  215. cognirelay-1.4.9/tests/test_graph_runtime_256.py +586 -0
  216. cognirelay-1.4.9/tests/test_help_214_slice1.py +763 -0
  217. cognirelay-1.4.9/tests/test_help_243_runtime_onboarding_limits.py +820 -0
  218. cognirelay-1.4.9/tests/test_indexer.py +29 -0
  219. cognirelay-1.4.9/tests/test_jsonl_size_guard.py +847 -0
  220. cognirelay-1.4.9/tests/test_lifecycle_warnings.py +91 -0
  221. cognirelay-1.4.9/tests/test_main_index_rebuild.py +87 -0
  222. cognirelay-1.4.9/tests/test_mcp_216_slice1_matrix.py +513 -0
  223. cognirelay-1.4.9/tests/test_mcp_216_slice2_runtime.py +1065 -0
  224. cognirelay-1.4.9/tests/test_mcp_216_slice3_help.py +480 -0
  225. cognirelay-1.4.9/tests/test_mcp_243_runtime_onboarding_limits.py +149 -0
  226. cognirelay-1.4.9/tests/test_mcp_rpc.py +681 -0
  227. cognirelay-1.4.9/tests/test_mcp_startup_guidance.py +64 -0
  228. cognirelay-1.4.9/tests/test_messages_delivery_state.py +578 -0
  229. cognirelay-1.4.9/tests/test_messages_partial_failure.py +575 -0
  230. cognirelay-1.4.9/tests/test_messages_reliability.py +159 -0
  231. cognirelay-1.4.9/tests/test_namespace_granularity_149.py +445 -0
  232. cognirelay-1.4.9/tests/test_ops_host_local.py +528 -0
  233. cognirelay-1.4.9/tests/test_p1_code_checks_merge.py +204 -0
  234. cognirelay-1.4.9/tests/test_p1_tasks_and_patches.py +263 -0
  235. cognirelay-1.4.9/tests/test_p2_security_replication.py +545 -0
  236. cognirelay-1.4.9/tests/test_packaging_290.py +286 -0
  237. cognirelay-1.4.9/tests/test_peers_and_snapshots.py +205 -0
  238. cognirelay-1.4.9/tests/test_prepare_release_293.py +973 -0
  239. cognirelay-1.4.9/tests/test_rationale_entries_122.py +1529 -0
  240. cognirelay-1.4.9/tests/test_registry_lifecycle_112.py +2109 -0
  241. cognirelay-1.4.9/tests/test_registry_lifecycle_112_restore_test.py +384 -0
  242. cognirelay-1.4.9/tests/test_related_documents_217_slice1.py +532 -0
  243. cognirelay-1.4.9/tests/test_related_documents_217_slice2.py +217 -0
  244. cognirelay-1.4.9/tests/test_replication_scope_155.py +178 -0
  245. cognirelay-1.4.9/tests/test_runtime_143_rate_limit_locking.py +265 -0
  246. cognirelay-1.4.9/tests/test_runtime_215_slice2_hooks.py +652 -0
  247. cognirelay-1.4.9/tests/test_salience.py +913 -0
  248. cognirelay-1.4.9/tests/test_schedule_255.py +852 -0
  249. cognirelay-1.4.9/tests/test_segment_history_114_append_guards.py +87 -0
  250. cognirelay-1.4.9/tests/test_segment_history_114_cold_rehydrate_families.py +301 -0
  251. cognirelay-1.4.9/tests/test_segment_history_114_cold_store.py +213 -0
  252. cognirelay-1.4.9/tests/test_segment_history_114_concurrency_fixes.py +3018 -0
  253. cognirelay-1.4.9/tests/test_segment_history_114_coverage_gaps.py +1111 -0
  254. cognirelay-1.4.9/tests/test_segment_history_114_families.py +232 -0
  255. cognirelay-1.4.9/tests/test_segment_history_114_locked_append.py +473 -0
  256. cognirelay-1.4.9/tests/test_segment_history_114_locking.py +117 -0
  257. cognirelay-1.4.9/tests/test_segment_history_114_maintenance.py +321 -0
  258. cognirelay-1.4.9/tests/test_segment_history_114_manifest.py +95 -0
  259. cognirelay-1.4.9/tests/test_segment_history_114_ops.py +51 -0
  260. cognirelay-1.4.9/tests/test_segment_history_114_rehydrate.py +208 -0
  261. cognirelay-1.4.9/tests/test_segment_history_114_residue.py +130 -0
  262. cognirelay-1.4.9/tests/test_segment_history_114_restore_test.py +364 -0
  263. cognirelay-1.4.9/tests/test_segment_history_114_settings.py +184 -0
  264. cognirelay-1.4.9/tests/test_segment_history_114_substrate.py +333 -0
  265. cognirelay-1.4.9/tests/test_segment_history_114_write_time.py +83 -0
  266. cognirelay-1.4.9/tests/test_stable_preferences_124.py +1169 -0
  267. cognirelay-1.4.9/tests/test_stage_d_blocker_regressions.py +809 -0
  268. cognirelay-1.4.9/tests/test_stage_d_cold_crash_recovery.py +803 -0
  269. cognirelay-1.4.9/tests/test_storage_append_jsonl.py +129 -0
  270. cognirelay-1.4.9/tests/test_storage_append_jsonl_multi.py +308 -0
  271. cognirelay-1.4.9/tests/test_storage_atomic_write.py +445 -0
  272. cognirelay-1.4.9/tests/test_timestamps.py +247 -0
  273. cognirelay-1.4.9/tests/test_token_lifecycle.py +241 -0
  274. cognirelay-1.4.9/tests/test_ui_docs.py +344 -0
  275. cognirelay-1.4.9/tests/test_ui_issue_199_slice1.py +1562 -0
  276. cognirelay-1.4.9/tests/test_ui_issue_249_task_views.py +442 -0
  277. cognirelay-1.4.9/tests/test_ui_issue_251_context_inspector.py +425 -0
  278. cognirelay-1.4.9/tests/test_ui_issue_260_schedule.py +332 -0
  279. cognirelay-1.4.9/tests/test_utf8_replace.py +440 -0
@@ -0,0 +1,158 @@
1
+ # Repository root managed by the service (relative or absolute path)
2
+ COGNIRELAY_REPO_ROOT=./data_repo
3
+
4
+ # Comma-separated bearer tokens for local testing.
5
+ # Format: token or token:scope1|scope2|scope3
6
+ # For multi-peer setups prefer data_repo/config/peer_tokens.json (supports token_sha256).
7
+ COGNIRELAY_TOKENS=change-me-local-dev-token
8
+
9
+ # If true, auto-initialize git repo when missing
10
+ COGNIRELAY_AUTO_INIT_GIT=true
11
+
12
+ # If true, append API actions to logs/api_audit.jsonl
13
+ COGNIRELAY_AUDIT_LOG_ENABLED=true
14
+
15
+ # If true, message ingress endpoints require signed_envelope
16
+ COGNIRELAY_REQUIRE_SIGNED_INGRESS=false
17
+
18
+ # Optional operator UI (disabled by default).
19
+ # Supported posture: local-only, read-only, server-rendered `/ui` with local
20
+ # assets only. Do not use these flags to imply remote auth or mutable behavior.
21
+ COGNIRELAY_UI_ENABLED=false
22
+ # Keep true for the supported issue #199 posture. Forwarded headers are not
23
+ # trusted for this boundary; only the transport peer counts.
24
+ COGNIRELAY_UI_REQUIRE_LOCALHOST=true
25
+ # Remains explicit even though no mutable UI actions currently exist.
26
+ COGNIRELAY_UI_READ_ONLY=true
27
+ # SSE live-update snapshot interval in seconds for `/ui/events` (clamped 1-60).
28
+ COGNIRELAY_UI_SSE_POLL_INTERVAL_SECONDS=5
29
+
30
+ # Key material storage hardening
31
+ COGNIRELAY_USE_EXTERNAL_KEY_STORE=true
32
+ COGNIRELAY_KEY_STORE_PATH=~/.cognirelay/security_keys.json
33
+
34
+ # Abuse controls
35
+ COGNIRELAY_MAX_PAYLOAD_BYTES=262144
36
+ COGNIRELAY_TOKEN_RATE_LIMIT_PER_MIN=240
37
+ COGNIRELAY_IP_RATE_LIMIT_PER_MIN=480
38
+ COGNIRELAY_VERIFY_FAILURE_LIMIT=20
39
+ COGNIRELAY_VERIFY_FAILURE_WINDOW_SECONDS=600
40
+
41
+ # Maximum JSONL file size (bytes) loaded into memory. Readers that exceed
42
+ # this limit return degraded or empty responses to protect against OOM.
43
+ COGNIRELAY_MAX_JSONL_READ_BYTES=10485760
44
+
45
+ # Alarm thresholds
46
+ COGNIRELAY_BACKLOG_ALARM_THRESHOLD=100
47
+ COGNIRELAY_VERIFICATION_ALARM_THRESHOLD=20
48
+ COGNIRELAY_REPLICATION_DRIFT_MAX_AGE_SECONDS=3600
49
+
50
+ # Coordination query scaling — fallback full-scan warns above this file count
51
+ COGNIRELAY_COORDINATION_QUERY_SCAN_THRESHOLD=5000
52
+
53
+ # Continuity archived envelopes older than this many days become archive_stale
54
+ # and eligible for explicit cold-store retention planning/apply.
55
+ COGNIRELAY_CONTINUITY_RETENTION_ARCHIVE_DAYS=90
56
+
57
+ # --- Registry lifecycle (issue #112) ---
58
+ # Terminal delivery rows stay hot for this many days before externalization
59
+ COGNIRELAY_DELIVERY_TERMINAL_RETENTION_DAYS=30
60
+ # Delivery history shards become cold-eligible after this many days
61
+ COGNIRELAY_DELIVERY_HISTORY_COLD_AFTER_DAYS=90
62
+ # Hot idempotency mappings retained for this many days
63
+ COGNIRELAY_DELIVERY_IDEMPOTENCY_RETENTION_DAYS=30
64
+ # Upper bound for nonce prune when entry is malformed or has no parseable expiry
65
+ COGNIRELAY_NONCE_RETENTION_DAYS=7
66
+ # Max trust-history transitions kept hot per peer
67
+ COGNIRELAY_PEER_TRUST_HISTORY_MAX_HOT_ENTRIES=32
68
+ # Older trust transitions externalize after this hot review window
69
+ COGNIRELAY_PEER_TRUST_HISTORY_HOT_RETENTION_DAYS=30
70
+ # Trust-history shards become cold-eligible after this many days
71
+ COGNIRELAY_PEER_TRUST_HISTORY_COLD_AFTER_DAYS=120
72
+ # Keep recently superseded replication summaries hot for this many days
73
+ COGNIRELAY_REPLICATION_HISTORY_HOT_RETENTION_DAYS=14
74
+ # Replication history shards become cold-eligible after this many days
75
+ COGNIRELAY_REPLICATION_HISTORY_COLD_AFTER_DAYS=90
76
+ # Bound replication pull dedup state retention
77
+ COGNIRELAY_REPLICATION_PULL_IDEMPOTENCY_RETENTION_DAYS=14
78
+ # Minimum hot retention for active tombstones (delete correctness)
79
+ COGNIRELAY_REPLICATION_TOMBSTONE_GRACE_DAYS=30
80
+ # Externalized tombstone shards become cold-eligible after this many days
81
+ COGNIRELAY_REPLICATION_TOMBSTONE_COLD_AFTER_DAYS=90
82
+ # Preserve tombstone history for this many days before prune from historical tier
83
+ COGNIRELAY_REPLICATION_TOMBSTONE_RETENTION_DAYS=365
84
+ # Maximum subrecords externalized or pruned in one maintenance pass per family
85
+ COGNIRELAY_REGISTRY_HISTORY_BATCH_LIMIT=500
86
+
87
+ # --- Artifact lifecycle (issue #113) ---
88
+ # Terminal handoffs stay hot for this many days before externalization
89
+ COGNIRELAY_HANDOFF_TERMINAL_RETENTION_DAYS=30
90
+ # Handoff history units become cold-eligible after this many days
91
+ COGNIRELAY_HANDOFF_COLD_AFTER_DAYS=90
92
+ # Keep recently superseded shared versions hot before externalization
93
+ COGNIRELAY_SHARED_HISTORY_HOT_RETENTION_DAYS=30
94
+ # Shared-history units become cold-eligible after this many days
95
+ COGNIRELAY_SHARED_HISTORY_COLD_AFTER_DAYS=90
96
+ # Keep resolved reconciliations hot before externalization
97
+ COGNIRELAY_RECONCILIATION_RESOLVED_RETENTION_DAYS=30
98
+ # Reconciliation history units become cold-eligible after this many days
99
+ COGNIRELAY_RECONCILIATION_COLD_AFTER_DAYS=90
100
+ # Keep done tasks hot before externalization
101
+ COGNIRELAY_TASK_DONE_HOT_RETENTION_DAYS=30
102
+ # Done-task history units become cold-eligible after this many days
103
+ COGNIRELAY_TASK_DONE_COLD_AFTER_DAYS=90
104
+ # Keep applied patches hot before externalization
105
+ COGNIRELAY_PATCH_APPLIED_HOT_RETENTION_DAYS=30
106
+ # Applied-patch history units become cold-eligible after this many days
107
+ COGNIRELAY_PATCH_APPLIED_COLD_AFTER_DAYS=90
108
+ # Maximum historical units externalized in one maintenance pass per family
109
+ COGNIRELAY_ARTIFACT_HISTORY_BATCH_LIMIT=500
110
+
111
+ # --- Segment-history lifecycle (issue #114) ---
112
+ # Journal day-bucket segments become cold-eligible after this many days
113
+ COGNIRELAY_JOURNAL_COLD_AFTER_DAYS=30
114
+ # Journal segments retained before deletion
115
+ COGNIRELAY_JOURNAL_RETENTION_DAYS=365
116
+ # Audit log rolls a new segment when the active file exceeds this size
117
+ COGNIRELAY_AUDIT_LOG_ROLLOVER_BYTES=1048576
118
+ # Audit log segments become cold-eligible after this many days
119
+ COGNIRELAY_AUDIT_LOG_COLD_AFTER_DAYS=30
120
+ # Audit log segments retained before deletion
121
+ COGNIRELAY_AUDIT_LOG_RETENTION_DAYS=365
122
+ # Ops run log rolls a new segment when the active file exceeds this size
123
+ COGNIRELAY_OPS_RUN_ROLLOVER_BYTES=1048576
124
+ # Ops run segments become cold-eligible after this many days
125
+ COGNIRELAY_OPS_RUN_COLD_AFTER_DAYS=30
126
+ # Ops run segments retained before deletion
127
+ COGNIRELAY_OPS_RUN_RETENTION_DAYS=365
128
+ # Message stream rolls a new segment when the active file exceeds this size
129
+ COGNIRELAY_MESSAGE_STREAM_ROLLOVER_BYTES=1048576
130
+ # Message stream segments older than this stay hot
131
+ COGNIRELAY_MESSAGE_STREAM_MAX_HOT_DAYS=14
132
+ # Message stream segments become cold-eligible after this many days
133
+ COGNIRELAY_MESSAGE_STREAM_COLD_AFTER_DAYS=30
134
+ # Message stream segments retained before deletion
135
+ COGNIRELAY_MESSAGE_STREAM_RETENTION_DAYS=180
136
+ # Message thread rolls a new segment when the active file exceeds this size
137
+ COGNIRELAY_MESSAGE_THREAD_ROLLOVER_BYTES=2097152
138
+ # Message thread rolls after this many days of inactivity
139
+ COGNIRELAY_MESSAGE_THREAD_INACTIVITY_DAYS=30
140
+ # Message thread segments become cold-eligible after this many days
141
+ COGNIRELAY_MESSAGE_THREAD_COLD_AFTER_DAYS=60
142
+ # Message thread segments retained before deletion
143
+ COGNIRELAY_MESSAGE_THREAD_RETENTION_DAYS=365
144
+ # Episodic memory rolls a new segment when the active file exceeds this size
145
+ COGNIRELAY_EPISODIC_ROLLOVER_BYTES=1048576
146
+ # Episodic memory segments become cold-eligible after this many days
147
+ COGNIRELAY_EPISODIC_COLD_AFTER_DAYS=30
148
+ # Episodic memory segments retained before deletion
149
+ COGNIRELAY_EPISODIC_RETENTION_DAYS=180
150
+ # Maximum segments processed in one maintenance or cold-store pass
151
+ COGNIRELAY_SEGMENT_HISTORY_BATCH_LIMIT=500
152
+
153
+ # API/tool contract version (freeze for client compatibility)
154
+ COGNIRELAY_CONTRACT_VERSION=2026-02-25
155
+
156
+ # Commit author identity used by the service
157
+ COGNIRELAY_GIT_AUTHOR_NAME=CogniRelay Bot
158
+ COGNIRELAY_GIT_AUTHOR_EMAIL=bot@example.local
@@ -0,0 +1,17 @@
1
+ MIT License
2
+
3
+ Copyright <2026> <Stef Karyotidis - https://stefk.me - stef[dot]kariotidis[at]gmail[dot]com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation
7
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
8
+ and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included
11
+ in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
16
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,26 @@
1
+ include README.md
2
+ include README-PYPI.md
3
+ include server.json
4
+ recursive-include docs *
5
+ recursive-include agent-assets *
6
+ recursive-include deploy *
7
+ prune .git
8
+ prune .venv
9
+ prune memory
10
+ prune logs
11
+ prune dist
12
+ prune build
13
+ prune *.egg-info
14
+ prune data_repo
15
+ prune .locks
16
+ prune .pytest_cache
17
+ prune .ruff_cache
18
+ prune .mypy_cache
19
+ global-exclude __pycache__ *.py[cod]
20
+ global-exclude *.db *.db-wal *.db-shm *.db-journal *.sqlite *.sqlite-wal *.sqlite-shm *.sqlite-journal *.sqlite3 *.sqlite3-wal *.sqlite3-shm *.sqlite3-journal
21
+ exclude .env .env.*
22
+ recursive-exclude * .env .env.*
23
+ global-exclude *.pem *.key *.token
24
+ global-exclude *.log *.jsonl *.bak *.tmp api_audit.jsonl peer_tokens.json
25
+ include .env.example
26
+ include deploy/systemd/cognirelay.env.example
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.4
2
+ Name: cognirelay
3
+ Version: 1.4.9
4
+ Summary: Self-hosted continuity and collaboration substrate for autonomous agents.
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: fastapi<1,>=0.115
9
+ Requires-Dist: uvicorn<1,>=0.30
10
+ Requires-Dist: pydantic<3,>=2.7
11
+ Requires-Dist: python-dotenv<2,>=1.0
12
+ Requires-Dist: markdown<4,>=3.6
13
+ Requires-Dist: bleach<7,>=6
14
+ Dynamic: license-file
15
+
16
+ # CogniRelay
17
+
18
+ <!-- mcp-name: io.github.stef-k/cognirelay -->
19
+
20
+ CogniRelay is a self-hosted continuity and collaboration substrate for autonomous agents. It provides a local FastAPI and MCP-facing service for bounded agent orientation, retrieval, coordination, and recovery across context resets.
21
+
22
+ ## Install
23
+
24
+ ```bash
25
+ pip install cognirelay
26
+ ```
27
+
28
+ ## Run
29
+
30
+ Set `COGNIRELAY_REPO_ROOT` to a durable writable repository root before starting the service. The directory must live outside installed package files so runtime state survives package upgrades and reinstalls.
31
+
32
+ ```bash
33
+ export COGNIRELAY_REPO_ROOT=/path/to/durable/cognirelay-state
34
+ cognirelay serve --host 127.0.0.1 --port 8080
35
+ ```
36
+
37
+ This package starts a local Streamable HTTP server only; it does not provide stdio transport or a hosted default CogniRelay service.
38
+
39
+ ## Documentation
40
+
41
+ Documentation and release notes are available at:
42
+
43
+ https://stef-k.github.io/CogniRelay/
44
+
45
+ Project source is available at:
46
+
47
+ https://github.com/stef-k/CogniRelay
@@ -0,0 +1,32 @@
1
+ # CogniRelay
2
+
3
+ <!-- mcp-name: io.github.stef-k/cognirelay -->
4
+
5
+ CogniRelay is a self-hosted continuity and collaboration substrate for autonomous agents. It provides a local FastAPI and MCP-facing service for bounded agent orientation, retrieval, coordination, and recovery across context resets.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install cognirelay
11
+ ```
12
+
13
+ ## Run
14
+
15
+ Set `COGNIRELAY_REPO_ROOT` to a durable writable repository root before starting the service. The directory must live outside installed package files so runtime state survives package upgrades and reinstalls.
16
+
17
+ ```bash
18
+ export COGNIRELAY_REPO_ROOT=/path/to/durable/cognirelay-state
19
+ cognirelay serve --host 127.0.0.1 --port 8080
20
+ ```
21
+
22
+ This package starts a local Streamable HTTP server only; it does not provide stdio transport or a hosted default CogniRelay service.
23
+
24
+ ## Documentation
25
+
26
+ Documentation and release notes are available at:
27
+
28
+ https://stef-k.github.io/CogniRelay/
29
+
30
+ Project source is available at:
31
+
32
+ https://github.com/stef-k/CogniRelay
@@ -0,0 +1,165 @@
1
+ # CogniRelay
2
+
3
+ <!-- mcp-name: io.github.stef-k/cognirelay -->
4
+
5
+ Self-hosted continuity and collaboration substrate for autonomous agents with bounded, recoverable memory.
6
+
7
+ CogniRelay is an applied continuity-infrastructure project: real, production-oriented systems engineering for autonomous agents, guided and strengthened by ongoing experimental and conceptual research into agent continuity, reorientation cost, and long-horizon collaboration.
8
+
9
+ CogniRelay uses a local git repository as durable state, exposes a machine-first FastAPI interface, stores content as Markdown and JSON/JSONL, and keeps dependencies minimal. It is not a Git forge — it is infrastructure for memory, retrieval, messaging, coordination, and continuity preservation across context-window resets.
10
+
11
+ CogniRelay is agent-agnostic: it does not depend on a specific model provider, agent runtime, or orchestration framework, as long as the agent can call its API surfaces.
12
+
13
+ The default deployment model is one owner-agent per CogniRelay instance. The owner-agent is also the local operator of that instance. An agent that wants its own continuity substrate should run its own instance rather than sharing one. Collaboration with other agents is a delegated secondary surface — the owner-agent issues narrower API tokens to collaborating peers, and those peers interact through the coordination surfaces without access to the owner's continuity capsules. Access isolation between agents is enforced by token scopes and namespace restrictions, not by built-in per-agent tenant isolation.
14
+
15
+ ## When CogniRelay Is Useful
16
+
17
+ CogniRelay exists for people who run agents that work across sessions, over long tasks, or alongside other agents.
18
+
19
+ When an agent hits a context-window reset, a compaction boundary, or a handoff to another agent, it loses its working orientation: what it was doing, what it decided not to do, what constraints still apply, and where it was headed. Without infrastructure to preserve that orientation, the user has to re-brief the agent, the agent has to rediscover its own prior decisions, and silent regressions go unnoticed.
20
+
21
+ CogniRelay reduces that cost. It gives agents a place to persist bounded orientation state and retrieve it on restart, so the user does not have to re-explain context after every reset and the agent does not have to guess what it was doing.
22
+
23
+ **When it helps most:**
24
+
25
+ - Long-running agent workflows that span multiple sessions or context windows
26
+ - Multi-step tasks where losing intermediate progress is costly
27
+ - Collaborative setups where the owner-agent delegates bounded coordination access to external peers without shared-state mutation
28
+ - Any scenario where silent context loss leads to repeated work, contradictory decisions, or undetected drift
29
+
30
+ **When it is not especially needed:**
31
+
32
+ - One-shot chat interactions with no continuation expectation
33
+ - Single-prompt tool use where the full context fits in one window
34
+ - Stateless pipelines where no agent needs to remember prior decisions
35
+
36
+ CogniRelay does not claim to preserve everything. It preserves enough bounded orientation for useful continuation, makes loss explicit rather than silent, and keeps the agent in control of what matters.
37
+
38
+ For specific application areas and the project's value as a research and evaluation testbed, see [Practical Application Areas](docs/system-overview.md#practical-application-areas) and [Research and Evaluation Value](docs/system-overview.md#research-and-evaluation-value) in the System Overview.
39
+ For external experiments, third-party usage notes, and public case studies, see [External References and Case Studies](docs/external-references.md).
40
+
41
+ ## What It Offers
42
+
43
+ - Git-backed read, write, and append operations with commit-on-change behavior
44
+ - Derived indexing and local search with JSON indexes and SQLite FTS5
45
+ - Context retrieval, continuity capsules, and deterministic snapshots for continuation-safe agent loops
46
+ - [Trust signals](docs/payload-reference.md#read--post-v1continuityread) on continuity reads, [startup view](docs/payload-reference.md#startup-view-viewstartup) for mechanical orientation extraction, and [session-end snapshot](docs/payload-reference.md#session-end-snapshot-helper) for lightweight session-end capture
47
+ - [Thread identity](docs/payload-reference.md#threaddescriptor) with scope anchors and lifecycle transitions, and [salience ranking](docs/payload-reference.md#salience-ranking) for deterministic retrieval ordering
48
+ - [Stable preferences](docs/payload-reference.md#stablepreference) for cross-thread standing instructions, and [rationale entries](docs/payload-reference.md#rationaleentry) for structured decision continuity
49
+ - [Mechanical continuity assistance](docs/system-overview.md#mechanical-assistance-and-agent-authorship) — preserve-mode merge, partial patch, and lifecycle transitions that reduce authoring burden while agents remain solely responsible for semantic content
50
+ - [Versioned feature discovery](docs/api-surface.md#get-v1capabilities--versioned-feature-map) via `GET /v1/capabilities`
51
+ - Peer registry, federation metadata, direct messaging, and relay transport
52
+ - Shared task records, patch proposal/apply flows, and code check/merge workflows
53
+ - Token lifecycle management, signed message verification, replication, backup, and host-local ops automation
54
+
55
+ ## Agent Integration Patterns
56
+
57
+ Agents integrate with CogniRelay through hook points in their runtime loop. CogniRelay does not control when it is invoked — agents own invocation timing, and CogniRelay owns response quality once invoked.
58
+
59
+ **Minimum viable integration** (two canonical hook points):
60
+
61
+ - `startup`: call `POST /v1/continuity/read` / `continuity.read` with `view: "startup"` and `allow_fallback: true` to restore orientation after a reset
62
+ - `pre_compaction_or_handoff`: evaluate write eligibility and call `POST /v1/continuity/upsert` / `continuity.upsert` only when the closed persisted-orientation field set changed, before known context loss or a real inter-agent handoff
63
+
64
+ This is enough for basic orientation recovery across resets.
65
+
66
+ **Recommended fuller integration** (four canonical hook points):
67
+
68
+ - `startup`: restore orientation (same as above)
69
+ - `pre_prompt`: read-only retrieval hook bound to `POST /v1/context/retrieve` / `context.retrieve`
70
+ - `post_prompt`: persist orientation changes with `POST /v1/continuity/upsert` / `continuity.upsert` only when at least one closed persisted-orientation field changed
71
+ - `pre_compaction_or_handoff`: satisfy the local continuity step before compaction or a real inter-agent handoff; only after that step completes may a real handoff additionally call `POST /v1/coordination/handoff/create` / `coordination.handoff_create`
72
+
73
+ The fuller pattern gives tighter continuity without widening the write surface: `startup` and `pre_prompt` stay read-only by default, `post_prompt` skips writes when the closed persisted-orientation field set is unchanged, and `pre_compaction_or_handoff` remains the primary write-before-context-loss hook. For the authoritative contract, including anti-noise rules and deterministic examples, see [Agent Onboarding](docs/agent-onboarding.md#canonical-hook-contract).
74
+
75
+ For the full cold-start endpoint sequence, see [System Overview: Agent Usage](docs/system-overview.md#agent-usage).
76
+
77
+ ## Canonical Docs
78
+
79
+ - [Agent Onboarding](docs/agent-onboarding.md): practical integration guide for cold-start and already-running agents
80
+ - [Reviewer Guide](docs/reviewer-guide.md): system thesis, boundaries, recovery model, and authority limits
81
+ - [System Overview](docs/system-overview.md): implemented product shape and agent usage guidance
82
+ - [External References and Case Studies](docs/external-references.md): external experiments, usage notes, and scoped collaboration/evaluation references
83
+ - [API Surface](docs/api-surface.md): currently implemented HTTP behavior grouped by domain
84
+ - [Payload Reference](docs/payload-reference.md): capsule structure, request/response schemas, and field constraints
85
+ - [MCP Guide](docs/mcp.md): MCP bootstrap flow and tool mapping
86
+ - [CLI Client](docs/cognirelay-client.md): stdlib-only command-line tool for continuity read, upsert, and token hashing
87
+ - [Go-live Runbook](deploy/GO_LIVE_RUNBOOK.md): operator deployment and go-live workflow
88
+ - [Production Signoff Checklist](deploy/PRODUCTION_SIGNOFF_CHECKLIST.md): production verification and data-safety checks
89
+
90
+ ## Quick Start
91
+
92
+ Source or GitHub release installs keep the existing deployment model:
93
+
94
+ ```bash
95
+ python3 -m venv .venv
96
+ source .venv/bin/activate
97
+ pip install -r requirements.txt
98
+ cp .env.example .env
99
+ uvicorn app.main:app --host 127.0.0.1 --port 8080 --reload
100
+ ```
101
+
102
+ PyPI installs use the thin package wrapper and the same `app.main:app` runtime:
103
+
104
+ ```bash
105
+ pip install cognirelay
106
+ export COGNIRELAY_REPO_ROOT=/var/lib/cognirelay/data_repo
107
+ cognirelay serve --host 127.0.0.1 --port 8080
108
+ ```
109
+
110
+ `COGNIRELAY_REPO_ROOT` must point to a durable writable directory outside `site-packages` and outside installed package files for PyPI or MCP Registry starts. The default `./data_repo` is for local/manual development only.
111
+
112
+ Wheel installs do not bundle the full source documentation in this slice. The `/ui/docs` page may show degraded or unavailable doc entries unless `COGNIRELAY_DOCS_SOURCE_ROOT` points at a source checkout.
113
+
114
+ If you want git history under `data_repo/` and it is not already initialized:
115
+
116
+ ```bash
117
+ cd data_repo
118
+ git init
119
+ ```
120
+
121
+ For non-local exposure, prefer file-based peer tokens in `data_repo/config/peer_tokens.json` instead of the plaintext development token in `.env`.
122
+
123
+ The optional operator UI is disabled by default. It is a local-only, read-only operator surface mounted under `/ui`: server-rendered HTML with locally served CSS/JS, no npm, no SPA, and no mutable actions. Enable it with `COGNIRELAY_UI_ENABLED=true`, keep `COGNIRELAY_UI_REQUIRE_LOCALHOST=true`, leave `COGNIRELAY_UI_READ_ONLY=true`, and optionally tune `COGNIRELAY_UI_SSE_POLL_INTERVAL_SECONDS` if you need faster or slower live snapshots. The shipped surface covers the overview page, bounded continuity list/detail inspection, lifecycle visibility across active/fallback/archived/cold artifacts, graph inspection, task-centric views, read-only schedule inspection, context retrieval inspection, the read-only docs browser, and a bounded `/ui/events` SSE stream used only for small progressive live regions on the overview, continuity list, and continuity detail pages. The SSE poll interval defaults to `5` seconds and is clamped to `1-60` seconds.
124
+
125
+ Do not publish `/ui` through a normal public reverse proxy path. The supported deployment boundary is local operator access only, either directly on loopback or via an operator-controlled tunnel into loopback. Remote auth, mutable UI behavior, broader reactive UI behavior, WebSockets, and standalone archive/cold maintenance consoles are intentionally deferred.
126
+
127
+ Each CogniRelay instance serves a single owner-agent. If you operate multiple agents that each need their own continuity, run a separate instance per agent.
128
+
129
+ For shell-based agent hooks, the [CLI client](docs/cognirelay-client.md) (`tools/cognirelay_client.py`) can read and upsert continuity capsules without a third-party HTTP library.
130
+
131
+ ## Runtime Shape
132
+
133
+ - API framework: FastAPI
134
+ - Storage model: git-backed repo plus Markdown and JSON/JSONL files
135
+ - Search layer: stdlib `sqlite3` FTS5 with JSON-index fallback
136
+ - Auth model: bearer tokens with scopes and split read/write namespace restrictions
137
+ - Machine discoverability: `/v1/manifest`, `/v1/discovery/*`, and `POST /v1/mcp`
138
+
139
+ For agent integration details, including the MCP bootstrap flow and tool mapping, see [docs/mcp.md](docs/mcp.md).
140
+
141
+ PyPI and MCP Registry metadata provide discoverability and a runnable local install path. This package starts a local Streamable HTTP server only; it does not provide stdio transport or a hosted default CogniRelay service. GitHub Releases remain the canonical human release notes. Manual release publication order is: merge release prep, build, run `twine check`, upload to PyPI, publish or submit `server.json` to the MCP Registry, then create or update the GitHub Release as applicable. Maintainers must verify the `cognirelay` PyPI package name before the first upload.
142
+
143
+ Validate `server.json` against the MCP Registry schema before publication:
144
+
145
+ ```bash
146
+ ./.venv/bin/python tools/validate_server_json.py
147
+ ```
148
+
149
+ ## Development
150
+
151
+ Tests are in `tests/`. Discovery and manifest behavior are covered in `tests/test_discovery.py`.
152
+
153
+ Install development-only tooling with:
154
+
155
+ ```bash
156
+ pip install -r requirements-dev.txt
157
+ ```
158
+
159
+ Local quality commands:
160
+
161
+ ```bash
162
+ ./.venv/bin/python -m unittest discover -s tests -v
163
+ ./.venv/bin/python -m ruff check app tests tools
164
+ ./.venv/bin/python tools/validate_server_json.py
165
+ ```
@@ -0,0 +1,10 @@
1
+ # CogniRelay Agent Assets
2
+
3
+ This directory contains copyable integration assets for agent runtimes that use CogniRelay continuity.
4
+
5
+ - `skills/cognirelay-continuity-authoring/SKILL.md`: agent-facing continuity authoring guidance.
6
+ - `hooks/cognirelay_retrieval_hook.py`: read-only startup and optional context retrieval hook.
7
+ - `hooks/cognirelay_continuity_save_hook.py`: facts, template, dry-run, write, readback, and doctor hook.
8
+ - `hooks/README.md`: hook configuration, invocation, stdout, and exit-code contract.
9
+
10
+ CogniRelay is the continuity substrate. The running agent authors semantic continuity fields; hooks gather facts, provide scaffolds, validate, write explicit payloads, and read back stored state.
@@ -0,0 +1,77 @@
1
+ # CogniRelay Hooks
2
+
3
+ These hooks are copyable Python 3 scripts for generic agent-runtime integration. They use only the Python standard library and emit one JSON object to stdout for normal operation. Human/debug logs belong on stderr.
4
+
5
+ ## Configuration
6
+
7
+ Required by CLI flag or environment for networked modes:
8
+
9
+ - `COGNIRELAY_BASE_URL`
10
+ - `COGNIRELAY_TOKEN`
11
+
12
+ Subject values are required for retrieval and may be used by `facts`, `template`, `readback`, and `doctor`:
13
+
14
+ - `COGNIRELAY_SUBJECT_KIND`
15
+ - `COGNIRELAY_SUBJECT_ID`
16
+
17
+ Optional:
18
+
19
+ - `COGNIRELAY_RETRIEVAL_TASK`
20
+ - `COGNIRELAY_CONTEXT_RETRIEVE`
21
+ - `COGNIRELAY_TIMEOUT_SECONDS`
22
+
23
+ CLI flags override environment variables. `--no-context-retrieve` wins over all context-retrieve enablement.
24
+
25
+ ## Retrieval
26
+
27
+ ```bash
28
+ python agent-assets/hooks/cognirelay_retrieval_hook.py \
29
+ --base-url http://127.0.0.1:8000 \
30
+ --token "$COGNIRELAY_TOKEN" \
31
+ --subject-kind thread \
32
+ --subject-id issue-289 \
33
+ --context-retrieve \
34
+ --task "Continue issue 289"
35
+ ```
36
+
37
+ The retrieval hook is read-only. It calls `POST /v1/continuity/read` with `view="startup"` and `allow_fallback=true`, then optionally calls `POST /v1/context/retrieve` when enabled and a non-empty task is present.
38
+
39
+ ## Save
40
+
41
+ ```bash
42
+ python agent-assets/hooks/cognirelay_continuity_save_hook.py facts --subject-kind thread --subject-id issue-289
43
+ python agent-assets/hooks/cognirelay_continuity_save_hook.py template --subject-kind thread --subject-id issue-289
44
+ python agent-assets/hooks/cognirelay_continuity_save_hook.py dry-run --input payload.json
45
+ python agent-assets/hooks/cognirelay_continuity_save_hook.py write --input payload.json
46
+ python agent-assets/hooks/cognirelay_continuity_save_hook.py readback --subject-kind thread --subject-id issue-289
47
+ python agent-assets/hooks/cognirelay_continuity_save_hook.py doctor --subject-kind thread --subject-id issue-289
48
+ ```
49
+
50
+ Use `--input -` for stdin payloads in `dry-run` and `write`.
51
+
52
+ `dry-run` is local-only by default and does not contact CogniRelay. `--server-compare` is intentionally unsupported in this shipped hook until implemented by a future slice.
53
+
54
+ ## Stdout Envelope
55
+
56
+ Success or degraded success:
57
+
58
+ ```json
59
+ {"ok": true, "mode": "dry-run", "warnings": [], "errors": [], "result": {}}
60
+ ```
61
+
62
+ Failure:
63
+
64
+ ```json
65
+ {"ok": false, "mode": "dry-run", "warnings": [], "errors": [{"code": "validation", "message": "Invalid input."}], "result": {}}
66
+ ```
67
+
68
+ Exit codes:
69
+
70
+ - `0`: success or degraded success with warnings
71
+ - `2`: usage, config, input validation, placeholder rejection, or unsupported offline mode
72
+ - `3`: transport failure without an HTTP response
73
+ - `4`: HTTP response received outside the expected success range
74
+
75
+ ## Local Glue Boundary
76
+
77
+ Local glue supplies base URL, token, subject identity, task text, and any runtime-specific file/stdin wiring. The hook never prints the token and never creates schedules, mutates tasks, acknowledges schedules, or infers continuity semantics. The agent authors semantic fields explicitly.