rsi-boot 0.1.0__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 (311) hide show
  1. rsi_boot-0.1.0/.cursor-plugin/plugin.json +10 -0
  2. rsi_boot-0.1.0/.gitignore +29 -0
  3. rsi_boot-0.1.0/.qoder-plugin/plugin.json +14 -0
  4. rsi_boot-0.1.0/AGENTS.md +13 -0
  5. rsi_boot-0.1.0/LAUNCHGUIDE.md +56 -0
  6. rsi_boot-0.1.0/LICENSE +21 -0
  7. rsi_boot-0.1.0/PKG-INFO +251 -0
  8. rsi_boot-0.1.0/README.en.md +211 -0
  9. rsi_boot-0.1.0/README.md +211 -0
  10. rsi_boot-0.1.0/SECURITY.md +64 -0
  11. rsi_boot-0.1.0/SKILL.md +97 -0
  12. rsi_boot-0.1.0/assets/logo-1024.png +0 -0
  13. rsi_boot-0.1.0/assets/logo-2048.png +0 -0
  14. rsi_boot-0.1.0/assets/logo.svg +8 -0
  15. rsi_boot-0.1.0/mcp.json +11 -0
  16. rsi_boot-0.1.0/pyproject.toml +73 -0
  17. rsi_boot-0.1.0/schemas/rsi_feedback.schema.json +94 -0
  18. rsi_boot-0.1.0/schemas/rsi_recall.schema.json +62 -0
  19. rsi_boot-0.1.0/schemas/rsi_response.schema.json +231 -0
  20. rsi_boot-0.1.0/scripts/build_agensi_bundle.py +108 -0
  21. rsi_boot-0.1.0/scripts/export_data.py +42 -0
  22. rsi_boot-0.1.0/scripts/export_schemas.py +32 -0
  23. rsi_boot-0.1.0/src/rsi_boot/__init__.py +3 -0
  24. rsi_boot-0.1.0/src/rsi_boot/__main__.py +496 -0
  25. rsi_boot-0.1.0/src/rsi_boot/api/__init__.py +0 -0
  26. rsi_boot-0.1.0/src/rsi_boot/api/mcp_server.py +155 -0
  27. rsi_boot-0.1.0/src/rsi_boot/api/tools/__init__.py +0 -0
  28. rsi_boot-0.1.0/src/rsi_boot/api/tools/conflicts_tool.py +104 -0
  29. rsi_boot-0.1.0/src/rsi_boot/api/tools/explore_tool.py +222 -0
  30. rsi_boot-0.1.0/src/rsi_boot/api/tools/feedback_tool.py +87 -0
  31. rsi_boot-0.1.0/src/rsi_boot/api/tools/impact_tool.py +64 -0
  32. rsi_boot-0.1.0/src/rsi_boot/api/tools/knowledge_add_tool.py +124 -0
  33. rsi_boot-0.1.0/src/rsi_boot/api/tools/knowledge_delete_tool.py +33 -0
  34. rsi_boot-0.1.0/src/rsi_boot/api/tools/knowledge_review_tool.py +253 -0
  35. rsi_boot-0.1.0/src/rsi_boot/api/tools/knowledge_search_tool.py +50 -0
  36. rsi_boot-0.1.0/src/rsi_boot/api/tools/knowledge_update_tool.py +64 -0
  37. rsi_boot-0.1.0/src/rsi_boot/api/tools/learn_tool.py +134 -0
  38. rsi_boot-0.1.0/src/rsi_boot/api/tools/memory_health_tool.py +79 -0
  39. rsi_boot-0.1.0/src/rsi_boot/api/tools/memory_tool.py +67 -0
  40. rsi_boot-0.1.0/src/rsi_boot/api/tools/query_tool.py +58 -0
  41. rsi_boot-0.1.0/src/rsi_boot/api/tools/recall_tool.py +40 -0
  42. rsi_boot-0.1.0/src/rsi_boot/api/tools/review_tool.py +92 -0
  43. rsi_boot-0.1.0/src/rsi_boot/api/tools/stats_tool.py +72 -0
  44. rsi_boot-0.1.0/src/rsi_boot/bootstrap.py +236 -0
  45. rsi_boot-0.1.0/src/rsi_boot/cli/__init__.py +0 -0
  46. rsi_boot-0.1.0/src/rsi_boot/cli/bootstrap_command.py +412 -0
  47. rsi_boot-0.1.0/src/rsi_boot/cli/impact_command.py +93 -0
  48. rsi_boot-0.1.0/src/rsi_boot/cli/knowledge_accept.py +246 -0
  49. rsi_boot-0.1.0/src/rsi_boot/cli/learn_command.py +139 -0
  50. rsi_boot-0.1.0/src/rsi_boot/cli/memory_command.py +216 -0
  51. rsi_boot-0.1.0/src/rsi_boot/cli/progress.py +254 -0
  52. rsi_boot-0.1.0/src/rsi_boot/cli/statusline_command.py +585 -0
  53. rsi_boot-0.1.0/src/rsi_boot/cli/wipe_command.py +259 -0
  54. rsi_boot-0.1.0/src/rsi_boot/common/__init__.py +0 -0
  55. rsi_boot-0.1.0/src/rsi_boot/common/circuit_breaker.py +94 -0
  56. rsi_boot-0.1.0/src/rsi_boot/common/logger.py +35 -0
  57. rsi_boot-0.1.0/src/rsi_boot/common/stdio.py +37 -0
  58. rsi_boot-0.1.0/src/rsi_boot/config/__init__.py +0 -0
  59. rsi_boot-0.1.0/src/rsi_boot/config/default.yaml +60 -0
  60. rsi_boot-0.1.0/src/rsi_boot/config/injection_blocklist.yaml +11 -0
  61. rsi_boot-0.1.0/src/rsi_boot/config/intent_examples.yaml +83 -0
  62. rsi_boot-0.1.0/src/rsi_boot/config/intent_rules.yaml +21 -0
  63. rsi_boot-0.1.0/src/rsi_boot/config/loader.py +206 -0
  64. rsi_boot-0.1.0/src/rsi_boot/config/models.yaml +31 -0
  65. rsi_boot-0.1.0/src/rsi_boot/config/quality_rubric.yaml +18 -0
  66. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/bug_analysis.jinja2 +5 -0
  67. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/coverage_check.jinja2 +4 -0
  68. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/data_analysis.jinja2 +4 -0
  69. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/doc_review.jinja2 +5 -0
  70. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/prd_gen.jinja2 +5 -0
  71. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/req_analyze.jinja2 +4 -0
  72. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/stakeholder_comm.jinja2 +4 -0
  73. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/test_data.jinja2 +4 -0
  74. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/test_gen.jinja2 +5 -0
  75. rsi_boot-0.1.0/src/rsi_boot/config/role_templates/test_review.jinja2 +5 -0
  76. rsi_boot-0.1.0/src/rsi_boot/config/roles/pm.yaml +34 -0
  77. rsi_boot-0.1.0/src/rsi_boot/config/roles/test.yaml +34 -0
  78. rsi_boot-0.1.0/src/rsi_boot/config/templates/base.jinja2 +14 -0
  79. rsi_boot-0.1.0/src/rsi_boot/config/templates/code_gen.jinja2 +4 -0
  80. rsi_boot-0.1.0/src/rsi_boot/config/templates/code_review.jinja2 +8 -0
  81. rsi_boot-0.1.0/src/rsi_boot/config/templates/debug.jinja2 +7 -0
  82. rsi_boot-0.1.0/src/rsi_boot/config/templates/explain.jinja2 +7 -0
  83. rsi_boot-0.1.0/src/rsi_boot/config/templates/general_assist.jinja2 +4 -0
  84. rsi_boot-0.1.0/src/rsi_boot/core/config_merger.py +100 -0
  85. rsi_boot-0.1.0/src/rsi_boot/core/exceptions.py +36 -0
  86. rsi_boot-0.1.0/src/rsi_boot/core/masking.py +72 -0
  87. rsi_boot-0.1.0/src/rsi_boot/core/models.py +207 -0
  88. rsi_boot-0.1.0/src/rsi_boot/data/__init__.py +0 -0
  89. rsi_boot-0.1.0/src/rsi_boot/data/migrate.py +71 -0
  90. rsi_boot-0.1.0/src/rsi_boot/data/sqlite.py +155 -0
  91. rsi_boot-0.1.0/src/rsi_boot/data/vec.py +147 -0
  92. rsi_boot-0.1.0/src/rsi_boot/feedback/__init__.py +1 -0
  93. rsi_boot-0.1.0/src/rsi_boot/feedback/implicit_tracker.py +229 -0
  94. rsi_boot-0.1.0/src/rsi_boot/injector/__init__.py +5 -0
  95. rsi_boot-0.1.0/src/rsi_boot/injector/blocklist.py +32 -0
  96. rsi_boot-0.1.0/src/rsi_boot/injector/conflict.py +693 -0
  97. rsi_boot-0.1.0/src/rsi_boot/injector/rule_injector.py +218 -0
  98. rsi_boot-0.1.0/src/rsi_boot/injector/slug.py +14 -0
  99. rsi_boot-0.1.0/src/rsi_boot/injector/targets.py +287 -0
  100. rsi_boot-0.1.0/src/rsi_boot/knowledge/__init__.py +0 -0
  101. rsi_boot-0.1.0/src/rsi_boot/knowledge/embedding.py +122 -0
  102. rsi_boot-0.1.0/src/rsi_boot/knowledge/retriever.py +290 -0
  103. rsi_boot-0.1.0/src/rsi_boot/learning/__init__.py +13 -0
  104. rsi_boot-0.1.0/src/rsi_boot/learning/audit_store.py +195 -0
  105. rsi_boot-0.1.0/src/rsi_boot/learning/dedup.py +164 -0
  106. rsi_boot-0.1.0/src/rsi_boot/learning/failure_miner.py +81 -0
  107. rsi_boot-0.1.0/src/rsi_boot/learning/gene_map.py +176 -0
  108. rsi_boot-0.1.0/src/rsi_boot/learning/governance.py +61 -0
  109. rsi_boot-0.1.0/src/rsi_boot/learning/knowledge_extractor.py +221 -0
  110. rsi_boot-0.1.0/src/rsi_boot/learning/memory_health.py +757 -0
  111. rsi_boot-0.1.0/src/rsi_boot/learning/pipeline.py +135 -0
  112. rsi_boot-0.1.0/src/rsi_boot/learning/promote.py +192 -0
  113. rsi_boot-0.1.0/src/rsi_boot/learning/proposal_engine.py +601 -0
  114. rsi_boot-0.1.0/src/rsi_boot/learning/reading_pack_actions.py +267 -0
  115. rsi_boot-0.1.0/src/rsi_boot/learning/regression_gate.py +253 -0
  116. rsi_boot-0.1.0/src/rsi_boot/learning/retype_pack.py +86 -0
  117. rsi_boot-0.1.0/src/rsi_boot/learning/skill_loader.py +115 -0
  118. rsi_boot-0.1.0/src/rsi_boot/learning/snapshot_store.py +373 -0
  119. rsi_boot-0.1.0/src/rsi_boot/learning/static_gate.py +73 -0
  120. rsi_boot-0.1.0/src/rsi_boot/learning/teaching.py +433 -0
  121. rsi_boot-0.1.0/src/rsi_boot/memory/__init__.py +20 -0
  122. rsi_boot-0.1.0/src/rsi_boot/memory/graph.py +120 -0
  123. rsi_boot-0.1.0/src/rsi_boot/memory/harvest.py +80 -0
  124. rsi_boot-0.1.0/src/rsi_boot/memory/logstore.py +134 -0
  125. rsi_boot-0.1.0/src/rsi_boot/memory/paths.py +38 -0
  126. rsi_boot-0.1.0/src/rsi_boot/memory/store.py +300 -0
  127. rsi_boot-0.1.0/src/rsi_boot/memory/tree.py +136 -0
  128. rsi_boot-0.1.0/src/rsi_boot/memory/types.py +78 -0
  129. rsi_boot-0.1.0/src/rsi_boot/memory/watch.py +79 -0
  130. rsi_boot-0.1.0/src/rsi_boot/metrics/__init__.py +23 -0
  131. rsi_boot-0.1.0/src/rsi_boot/metrics/footprint.py +115 -0
  132. rsi_boot-0.1.0/src/rsi_boot/metrics/snapshot.py +84 -0
  133. rsi_boot-0.1.0/src/rsi_boot/migrations/001_init.sql +138 -0
  134. rsi_boot-0.1.0/src/rsi_boot/migrations/002_extraction.sql +25 -0
  135. rsi_boot-0.1.0/src/rsi_boot/migrations/003_rule_artifacts.sql +22 -0
  136. rsi_boot-0.1.0/src/rsi_boot/migrations/004_rule_conflicts.sql +23 -0
  137. rsi_boot-0.1.0/src/rsi_boot/model/__init__.py +0 -0
  138. rsi_boot-0.1.0/src/rsi_boot/model/adapter.py +120 -0
  139. rsi_boot-0.1.0/src/rsi_boot/model/providers/__init__.py +0 -0
  140. rsi_boot-0.1.0/src/rsi_boot/model/providers/anthropic.py +81 -0
  141. rsi_boot-0.1.0/src/rsi_boot/model/providers/base.py +30 -0
  142. rsi_boot-0.1.0/src/rsi_boot/model/providers/deepseek.py +29 -0
  143. rsi_boot-0.1.0/src/rsi_boot/model/providers/mock.py +34 -0
  144. rsi_boot-0.1.0/src/rsi_boot/model/providers/openai.py +52 -0
  145. rsi_boot-0.1.0/src/rsi_boot/model/registry.py +67 -0
  146. rsi_boot-0.1.0/src/rsi_boot/orchestrator/__init__.py +0 -0
  147. rsi_boot-0.1.0/src/rsi_boot/orchestrator/handlers/__init__.py +0 -0
  148. rsi_boot-0.1.0/src/rsi_boot/orchestrator/pipeline.py +273 -0
  149. rsi_boot-0.1.0/src/rsi_boot/preprocessor/__init__.py +0 -0
  150. rsi_boot-0.1.0/src/rsi_boot/preprocessor/intent_classifier.py +234 -0
  151. rsi_boot-0.1.0/src/rsi_boot/project.py +295 -0
  152. rsi_boot-0.1.0/src/rsi_boot/quality/__init__.py +5 -0
  153. rsi_boot-0.1.0/src/rsi_boot/quality/assessor.py +194 -0
  154. rsi_boot-0.1.0/src/rsi_boot/rag/__init__.py +14 -0
  155. rsi_boot-0.1.0/src/rsi_boot/rag/chunker.py +47 -0
  156. rsi_boot-0.1.0/src/rsi_boot/rag/index.py +221 -0
  157. rsi_boot-0.1.0/src/rsi_boot/rag/query.py +107 -0
  158. rsi_boot-0.1.0/src/rsi_boot/rag/retriever.py +22 -0
  159. rsi_boot-0.1.0/src/rsi_boot/scanner/__init__.py +0 -0
  160. rsi_boot-0.1.0/src/rsi_boot/scanner/code_scanner.py +222 -0
  161. rsi_boot-0.1.0/src/rsi_boot/scanner/config_scanner.py +246 -0
  162. rsi_boot-0.1.0/src/rsi_boot/scanner/conversation_scanner.py +69 -0
  163. rsi_boot-0.1.0/src/rsi_boot/scanner/correlation_engine.py +114 -0
  164. rsi_boot-0.1.0/src/rsi_boot/scanner/document_scanner.py +230 -0
  165. rsi_boot-0.1.0/src/rsi_boot/scanner/git_analyzer.py +168 -0
  166. rsi_boot-0.1.0/src/rsi_boot/scanner/git_fix.py +66 -0
  167. rsi_boot-0.1.0/src/rsi_boot/scanner/incremental.py +377 -0
  168. rsi_boot-0.1.0/src/rsi_boot/scanner/profile_generator.py +133 -0
  169. rsi_boot-0.1.0/src/rsi_boot/scanner/reading_packs.py +743 -0
  170. rsi_boot-0.1.0/src/rsi_boot/scanner/relearn_skill.md +22 -0
  171. rsi_boot-0.1.0/src/rsi_boot/scanner/report.py +324 -0
  172. rsi_boot-0.1.0/src/rsi_boot/scanner/rule_seed_scanner.py +81 -0
  173. rsi_boot-0.1.0/src/rsi_boot/scanner/signal_discovery.py +217 -0
  174. rsi_boot-0.1.0/src/rsi_boot/scanner/validator.py +98 -0
  175. rsi_boot-0.1.0/src/rsi_boot/scanner/version_conflict.py +177 -0
  176. rsi_boot-0.1.0/src/rsi_boot/scheduler/__init__.py +0 -0
  177. rsi_boot-0.1.0/src/rsi_boot/scheduler/manager.py +152 -0
  178. rsi_boot-0.1.0/src/rsi_boot/scheduler/tasks.py +91 -0
  179. rsi_boot-0.1.0/src/rsi_boot/services/__init__.py +0 -0
  180. rsi_boot-0.1.0/src/rsi_boot/services/decision_queue.py +357 -0
  181. rsi_boot-0.1.0/src/rsi_boot/services/export_service.py +35 -0
  182. rsi_boot-0.1.0/src/rsi_boot/services/impact_service.py +282 -0
  183. rsi_boot-0.1.0/src/rsi_boot/services/knowledge_service.py +558 -0
  184. rsi_boot-0.1.0/src/rsi_boot/services/legacy_migrate.py +306 -0
  185. rsi_boot-0.1.0/src/rsi_boot/services/log_service.py +177 -0
  186. rsi_boot-0.1.0/src/rsi_boot/services/memory_migrate.py +634 -0
  187. rsi_boot-0.1.0/src/rsi_boot/services/profile_service.py +268 -0
  188. rsi_boot-0.1.0/src/rsi_boot/services/recall_service.py +502 -0
  189. rsi_boot-0.1.0/src/rsi_boot/services/stats_service.py +348 -0
  190. rsi_boot-0.1.0/src/rsi_boot/strategy/__init__.py +0 -0
  191. rsi_boot-0.1.0/src/rsi_boot/strategy/cost_router.py +71 -0
  192. rsi_boot-0.1.0/src/rsi_boot/strategy/engine.py +139 -0
  193. rsi_boot-0.1.0/src/rsi_boot/strategy/prompt_renderer.py +84 -0
  194. rsi_boot-0.1.0/src/rsi_boot/strategy/recall.py +172 -0
  195. rsi_boot-0.1.0/src/rsi_boot/ux/__init__.py +13 -0
  196. rsi_boot-0.1.0/src/rsi_boot/ux/lang.py +102 -0
  197. rsi_boot-0.1.0/src/rsi_boot/ux/messages.py +396 -0
  198. rsi_boot-0.1.0/src/rsi_boot/ux/next.py +36 -0
  199. rsi_boot-0.1.0/src/rsi_boot/ux/quips.py +685 -0
  200. rsi_boot-0.1.0/src/rsi_boot/ux/terms.py +97 -0
  201. rsi_boot-0.1.0/tests/conftest.py +43 -0
  202. rsi_boot-0.1.0/tests/eval/__init__.py +1 -0
  203. rsi_boot-0.1.0/tests/eval/baselines.json +28 -0
  204. rsi_boot-0.1.0/tests/eval/datasets/README.md +24 -0
  205. rsi_boot-0.1.0/tests/eval/datasets/__init__.py +0 -0
  206. rsi_boot-0.1.0/tests/eval/datasets/gen_intent_dataset.py +249 -0
  207. rsi_boot-0.1.0/tests/eval/datasets/gen_retrieval_dataset.py +95 -0
  208. rsi_boot-0.1.0/tests/eval/datasets/intent_general.jsonl +250 -0
  209. rsi_boot-0.1.0/tests/eval/datasets/intent_role.jsonl +480 -0
  210. rsi_boot-0.1.0/tests/eval/datasets/retrieval_corpus.jsonl +30 -0
  211. rsi_boot-0.1.0/tests/eval/datasets/retrieval_queries.jsonl +90 -0
  212. rsi_boot-0.1.0/tests/eval/harness.py +180 -0
  213. rsi_boot-0.1.0/tests/eval/test_eval_gate.py +191 -0
  214. rsi_boot-0.1.0/tests/memory_helpers.py +163 -0
  215. rsi_boot-0.1.0/tests/test_adaptive_slice.py +145 -0
  216. rsi_boot-0.1.0/tests/test_audit_learn.py +368 -0
  217. rsi_boot-0.1.0/tests/test_bootstrap.py +162 -0
  218. rsi_boot-0.1.0/tests/test_bootstrap_apply_e2e.py +261 -0
  219. rsi_boot-0.1.0/tests/test_bootstrap_judge_flags.py +211 -0
  220. rsi_boot-0.1.0/tests/test_bootstrap_lanes.py +400 -0
  221. rsi_boot-0.1.0/tests/test_bootstrap_progress.py +209 -0
  222. rsi_boot-0.1.0/tests/test_bootstrap_report_md.py +209 -0
  223. rsi_boot-0.1.0/tests/test_cache_tuning.py +208 -0
  224. rsi_boot-0.1.0/tests/test_chunker.py +29 -0
  225. rsi_boot-0.1.0/tests/test_cli_learn.py +88 -0
  226. rsi_boot-0.1.0/tests/test_cli_logging.py +79 -0
  227. rsi_boot-0.1.0/tests/test_cli_memory.py +271 -0
  228. rsi_boot-0.1.0/tests/test_closeout_inject.py +76 -0
  229. rsi_boot-0.1.0/tests/test_config_hot_reload.py +47 -0
  230. rsi_boot-0.1.0/tests/test_config_loader.py +77 -0
  231. rsi_boot-0.1.0/tests/test_config_merger.py +27 -0
  232. rsi_boot-0.1.0/tests/test_conflict.py +318 -0
  233. rsi_boot-0.1.0/tests/test_conflict_explain.py +251 -0
  234. rsi_boot-0.1.0/tests/test_conflicts_files.py +86 -0
  235. rsi_boot-0.1.0/tests/test_conflicts_tool_batch.py +184 -0
  236. rsi_boot-0.1.0/tests/test_decision_queue.py +234 -0
  237. rsi_boot-0.1.0/tests/test_degradation.py +154 -0
  238. rsi_boot-0.1.0/tests/test_dual_stack_profile.py +30 -0
  239. rsi_boot-0.1.0/tests/test_extract_incoherent.py +220 -0
  240. rsi_boot-0.1.0/tests/test_extract_pending_yaml.py +95 -0
  241. rsi_boot-0.1.0/tests/test_feedback_profile_boost.py +62 -0
  242. rsi_boot-0.1.0/tests/test_feedback_token.py +26 -0
  243. rsi_boot-0.1.0/tests/test_feedback_worker.py +289 -0
  244. rsi_boot-0.1.0/tests/test_frontend_scan.py +112 -0
  245. rsi_boot-0.1.0/tests/test_git_fix.py +71 -0
  246. rsi_boot-0.1.0/tests/test_governance.py +118 -0
  247. rsi_boot-0.1.0/tests/test_harness.py +352 -0
  248. rsi_boot-0.1.0/tests/test_harvest_filter.py +246 -0
  249. rsi_boot-0.1.0/tests/test_impact.py +199 -0
  250. rsi_boot-0.1.0/tests/test_inject_yaml.py +65 -0
  251. rsi_boot-0.1.0/tests/test_injector.py +209 -0
  252. rsi_boot-0.1.0/tests/test_intent_classifier.py +18 -0
  253. rsi_boot-0.1.0/tests/test_intent_llm.py +90 -0
  254. rsi_boot-0.1.0/tests/test_java_profile.py +141 -0
  255. rsi_boot-0.1.0/tests/test_knowledge_accept.py +338 -0
  256. rsi_boot-0.1.0/tests/test_knowledge_extraction.py +236 -0
  257. rsi_boot-0.1.0/tests/test_knowledge_files.py +410 -0
  258. rsi_boot-0.1.0/tests/test_knowledge_freshness.py +190 -0
  259. rsi_boot-0.1.0/tests/test_knowledge_update.py +133 -0
  260. rsi_boot-0.1.0/tests/test_learn_packs.py +348 -0
  261. rsi_boot-0.1.0/tests/test_learn_tool.py +385 -0
  262. rsi_boot-0.1.0/tests/test_lifecycle.py +85 -0
  263. rsi_boot-0.1.0/tests/test_log_files.py +46 -0
  264. rsi_boot-0.1.0/tests/test_logstore.py +141 -0
  265. rsi_boot-0.1.0/tests/test_masking.py +88 -0
  266. rsi_boot-0.1.0/tests/test_mcp_protocol.py +185 -0
  267. rsi_boot-0.1.0/tests/test_memory_graph.py +106 -0
  268. rsi_boot-0.1.0/tests/test_memory_health.py +352 -0
  269. rsi_boot-0.1.0/tests/test_memory_layer_improvements.py +580 -0
  270. rsi_boot-0.1.0/tests/test_memory_migrate.py +315 -0
  271. rsi_boot-0.1.0/tests/test_memory_store.py +272 -0
  272. rsi_boot-0.1.0/tests/test_memory_tool.py +132 -0
  273. rsi_boot-0.1.0/tests/test_memory_types.py +140 -0
  274. rsi_boot-0.1.0/tests/test_migrate.py +66 -0
  275. rsi_boot-0.1.0/tests/test_model_routing.py +364 -0
  276. rsi_boot-0.1.0/tests/test_no_sqlite_runtime_imports.py +31 -0
  277. rsi_boot-0.1.0/tests/test_pipeline.py +69 -0
  278. rsi_boot-0.1.0/tests/test_profile.py +128 -0
  279. rsi_boot-0.1.0/tests/test_progress_summary.py +39 -0
  280. rsi_boot-0.1.0/tests/test_project_isolation.py +543 -0
  281. rsi_boot-0.1.0/tests/test_promote.py +267 -0
  282. rsi_boot-0.1.0/tests/test_python_config.py +131 -0
  283. rsi_boot-0.1.0/tests/test_quality_assessor.py +188 -0
  284. rsi_boot-0.1.0/tests/test_rag_index.py +6 -0
  285. rsi_boot-0.1.0/tests/test_rag_intent.py +130 -0
  286. rsi_boot-0.1.0/tests/test_reading_packs.py +422 -0
  287. rsi_boot-0.1.0/tests/test_recall.py +260 -0
  288. rsi_boot-0.1.0/tests/test_recall_decisions.py +362 -0
  289. rsi_boot-0.1.0/tests/test_recall_files.py +53 -0
  290. rsi_boot-0.1.0/tests/test_recall_gene.py +244 -0
  291. rsi_boot-0.1.0/tests/test_retriever.py +60 -0
  292. rsi_boot-0.1.0/tests/test_review_files.py +239 -0
  293. rsi_boot-0.1.0/tests/test_review_queue.py +234 -0
  294. rsi_boot-0.1.0/tests/test_role_intents.py +49 -0
  295. rsi_boot-0.1.0/tests/test_rule_seeds.py +143 -0
  296. rsi_boot-0.1.0/tests/test_runtime_no_sqlite.py +35 -0
  297. rsi_boot-0.1.0/tests/test_scan_excludes.py +92 -0
  298. rsi_boot-0.1.0/tests/test_scanner_deep.py +208 -0
  299. rsi_boot-0.1.0/tests/test_skill_injection.py +51 -0
  300. rsi_boot-0.1.0/tests/test_sqlite_retry.py +153 -0
  301. rsi_boot-0.1.0/tests/test_static_gate.py +78 -0
  302. rsi_boot-0.1.0/tests/test_stats_files.py +88 -0
  303. rsi_boot-0.1.0/tests/test_stats_tool.py +167 -0
  304. rsi_boot-0.1.0/tests/test_statusline.py +616 -0
  305. rsi_boot-0.1.0/tests/test_strategy_thompson.py +120 -0
  306. rsi_boot-0.1.0/tests/test_ux_lang.py +21 -0
  307. rsi_boot-0.1.0/tests/test_ux_messages.py +78 -0
  308. rsi_boot-0.1.0/tests/test_vector.py +242 -0
  309. rsi_boot-0.1.0/tests/test_version_conflict.py +356 -0
  310. rsi_boot-0.1.0/tests/test_watch_yaml.py +120 -0
  311. rsi_boot-0.1.0/tests/test_wipe.py +149 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "rsi-boot",
3
+ "version": "0.1.0",
4
+ "description": "Repo-bound Harness-RSI for AI coding hosts: the harness improves from failures; memory lives in the repo's .rsi/ and follows the project across Cursor, Qoder, Codex and Claude Code. Zero API keys on the main path.",
5
+ "author": {
6
+ "name": "wenxing luo"
7
+ },
8
+ "license": "MIT",
9
+ "keywords": ["mcp", "harness", "memory", "self-improvement", "portable", "knowledge", "cursor"]
10
+ }
@@ -0,0 +1,29 @@
1
+ # RSI Boot 本地数据
2
+ .rsi/
3
+
4
+ # Python
5
+ __pycache__/
6
+ *.py[cod]
7
+ *.egg-info/
8
+ .venv/
9
+ venv/
10
+ .pytest_cache/
11
+ .mypy_cache/
12
+ .ruff_cache/
13
+ dist/
14
+ build/
15
+
16
+ # 本地临时产物
17
+ .tmp-*/
18
+ .tmp-*
19
+ *.log
20
+
21
+ .pytest-*
22
+ # 评测跑批产物(源码与 datasets/ 保留,报告不入库)
23
+ tests/eval/reports/
24
+
25
+ # 本地会话与注入产物(RSI 注入器自动维护,不入库)
26
+ .cursor/
27
+ .superpowers/
28
+ docs/
29
+ output/
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "rsi-boot",
3
+ "version": "0.1.0",
4
+ "description": "Repo-bound Harness-RSI for AI coding hosts: the harness improves from failures; memory lives in the repo's .rsi/ and follows the project across Cursor, Qoder, Codex and Claude Code. Zero API keys on the main path.",
5
+ "displayName": "RSI Boot",
6
+ "author": {
7
+ "name": "wenxing luo"
8
+ },
9
+ "license": "MIT",
10
+ "keywords": ["mcp", "harness", "memory", "self-improvement", "portable", "knowledge", "qoder"],
11
+ "homepage": "https://github.com/Apollo-lwx/rsi-boot",
12
+ "repository": "https://github.com/Apollo-lwx/rsi-boot",
13
+ "mcpServers": "./mcp.json"
14
+ }
@@ -0,0 +1,13 @@
1
+ <!-- rsi-boot:begin -->
2
+
3
+ > 本块由 RSI Boot 自动维护,请勿手改(改动会被下次重写覆盖)。
4
+
5
+ ## 收工纪律
6
+
7
+ teach_catch:修失败多次、低置信、改公共规则、或用户纠正执行方式时先记现场;写好 lesson 后 teach_record。
8
+ 修了用户可见的 bug(成功也算)必须 teach_record,lesson 含 wrong_action 与 correct_fix。
9
+ 未 audit_finish 前不得改业务代码。
10
+ 最终总结照抄 closeout 路径,或写跳过原因。
11
+ Catch then record. Do not edit product code before the audit is finished. Copy closeout paths into the final summary.
12
+
13
+ <!-- rsi-boot:end -->
@@ -0,0 +1,56 @@
1
+ # RSI Boot
2
+
3
+ ## Tagline
4
+ Repo-bound memory and a self-improving harness for AI coding agents — zero API keys.
5
+
6
+ ## Description
7
+ RSI Boot is a local MCP server that gives AI coding agents persistent, repo-bound memory. Conventions, prohibitions, fix lessons and harness tunables all live in the project's own `.rsi/` directory, so memory moves with the repository — across machines and across hosts (Cursor, Claude Code, Codex, Qoder) with nothing to relearn.
8
+
9
+ Unlike plain memory plugins, RSI Boot also improves the harness itself: negative feedback goes into failure buckets, improvement proposals must pass static gates and human approval, are observed for 7 days, and roll back automatically if acceptance drops. The main path calls no model and needs no API key; every write is gated by approval workflows, prohibition lists and conflict adjudication.
10
+
11
+ Built for developers and teams who use AI coding agents daily and want per-project memory that is portable, auditable, and gets better the more they use it.
12
+
13
+ ## Setup Requirements
14
+ - No environment variables or API keys are required on the main path.
15
+ - `RSI_PROJECT_ROOT` (recommended): absolute path of the workspace whose memory this server should bind to. In a project-level `.cursor/mcp.json`, use `"${workspaceFolder}"`. Do not set it in a user-level config, where `${workspaceFolder}` may not expand.
16
+ - Optional: a model key (e.g. `OPENAI_API_KEY`) only if you enable LLM-enhanced extraction or vector search in `~/.rsi/config.yaml`. Everything works without it.
17
+ - Requires Python 3.10+. Install with `pip install git+https://github.com/Apollo-lwx/rsi-boot.git`, then add the `rsi serve` MCP configuration to your project.
18
+
19
+ ## Category
20
+ Developer Tools
21
+
22
+ ## Use Cases
23
+ Persistent per-project memory for AI coding agents, Recalling project conventions and prohibitions before tasks, Learning from user corrections and negative feedback, Porting memory across Cursor, Claude Code, Codex and Qoder, Sharing conventions with the team through the repo, Self-improving harness with gated proposals and rollback, Local-first knowledge base with no API keys
24
+
25
+ ## Features
26
+ - Repo-bound `.rsi/` storage: memory follows the project across machines and hosts
27
+ - Zero API keys on the main path — no model calls, fully local
28
+ - Harness-RSI loop: proposals → static gates → human approval → 7-day observation → auto-rollback
29
+ - Approval-gated writes with prohibition lists and conflict adjudication
30
+ - 15 MCP tools covering recall, explore, learn, feedback, review, stats and impact
31
+ - Knowledge tree organized by domain lanes with drill-down browsing
32
+ - Conflict detection and resolution for duplicate or contradicting knowledge
33
+ - Memory health scanning for incorrect or stale entries
34
+ - Acceptance-rate tracking; rejections are distilled into new prohibitions
35
+ - Genome bundle export for backup and cross-project migration
36
+ - One MCP server works with Cursor, Claude Code, Codex and Qoder
37
+ - Optional status line for Claude Code and Cursor CLI with RSI recall stats
38
+ - Optional vector search and LLM-enhanced extraction with your own keys
39
+
40
+ ## Getting Started
41
+ - "Learn this project" — bootstrap distills repo knowledge into reviewable packs
42
+ - "What conventions should I follow in this repo?"
43
+ - "Remember: this project uses snake_case everywhere"
44
+ - Tool: rsi_recall — Recall prohibitions and conventions before starting a task
45
+ - Tool: rsi_learn — Distill project knowledge and record lessons
46
+ - Tool: rsi_feedback — Report whether recalled guidance was accepted or rejected
47
+ - Tool: rsi_knowledge_review — Approve distilled knowledge before it enters recall
48
+
49
+ ## Tags
50
+ memory, agent-memory, mcp, self-improvement, harness, knowledge-base, repo-bound, cursor, claude-code, codex, qoder, conventions, feedback-loop, rag, local-first, no-api-key, developer-tools, productivity, python
51
+
52
+ ## Documentation URL
53
+ https://github.com/Apollo-lwx/rsi-boot#readme
54
+
55
+ ## Health Check URL
56
+ N/A — local stdio server; health checks apply to hosted servers only.
rsi_boot-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Apollo-lwx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,251 @@
1
+ Metadata-Version: 2.5
2
+ Name: rsi-boot
3
+ Version: 0.1.0
4
+ Summary: Repo-bound MCP with recursive self-improvement (Harness-RSI) — memory follows the project across hosts, and the harness gets better as you use it.
5
+ Project-URL: Homepage, https://github.com/Apollo-lwx/rsi-boot
6
+ Project-URL: Repository, https://github.com/Apollo-lwx/rsi-boot
7
+ Project-URL: Issues, https://github.com/Apollo-lwx/rsi-boot/issues
8
+ Author: wenxing luo
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: agent-memory,claude-code,codex,cursor,harness,knowledge-base,mcp,repo-bound,self-improvement
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development
21
+ Classifier: Topic :: Utilities
22
+ Requires-Python: >=3.10
23
+ Requires-Dist: aiosqlite>=0.19
24
+ Requires-Dist: cachetools>=5.3
25
+ Requires-Dist: jinja2>=3.1
26
+ Requires-Dist: mcp>=1.2
27
+ Requires-Dist: numpy>=1.26
28
+ Requires-Dist: openai>=1.30
29
+ Requires-Dist: pydantic>=2.6
30
+ Requires-Dist: pyyaml>=6.0
31
+ Requires-Dist: watchfiles>=0.21
32
+ Provides-Extra: anthropic
33
+ Requires-Dist: anthropic>=0.40; extra == 'anthropic'
34
+ Provides-Extra: dev
35
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
36
+ Requires-Dist: pytest>=8.0; extra == 'dev'
37
+ Provides-Extra: vec
38
+ Requires-Dist: sqlite-vec>=0.1; extra == 'vec'
39
+ Description-Content-Type: text/markdown
40
+
41
+ <div align="center">
42
+ <img src="assets/logo.svg" alt="rsi-boot logo" width="120">
43
+ </div>
44
+
45
+ # RSI Boot
46
+
47
+ 简体中文 | [English](README.en.md)
48
+
49
+ Agent 记忆很多人都在做。RSI Boot 要解决的是另外两件事:**harness 会跟着用、跟着改**,以及**记忆跟着仓库走、换宿主不重学**。
50
+
51
+ 主链路零 API Key,不调用模型。约定、禁止项、修复经验和 harness 槽位都只落在当前仓库的 `.rsi/`,下次任务前按需召回。
52
+
53
+ ## 和「又一个记忆插件」差在哪
54
+
55
+ **rsi-harness(Harness-RSI)**
56
+ 负反馈进失败桶,只改可写槽位(提示词 / 技能 / 召回策略 / 意图规则 / 知识)。提案过静态门禁和人工确认才晋升,观察 7 天,采纳率掉就回滚。越用越会干活,不是越记越多。
57
+
58
+ **跟随项目迁移**
59
+ 记忆按仓库隔离,不跟账号、不跟 IDE。仓库拷走、换机器、换目录,`.rsi/` 一起走;打开另一个仓库就是另一份,不会串。Harness 基因组可导出 bundle,跨项目备份或迁槽位。
60
+
61
+ **多平台兼容**
62
+ 同一套 MCP(`rsi serve`)接 Cursor、Qoder、Codex;状态栏同时吃 Claude Code 与 Cursor CLI。规则注入走 `.cursor/rules` 和各宿主都认的 `AGENTS.md` 托管块,换工具不用把项目史再讲一遍。
63
+
64
+ | | 宿主自带记忆 | 云端记忆(Mem0 一类) | 通用本地记忆 MCP | RSI Boot |
65
+ |---|---|---|---|---|
66
+ | 数据跟谁走 | 跟账号 / 跟宿主 | 跟云端用户 | 看实现 | **跟当前仓库** |
67
+ | 换 Cursor / Claude Code / Codex | 重学 | 对方接得上才有 | 多数只做存取 | **同一份 `.rsi/`** |
68
+ | Harness 自改进 | 无 | 无 | 无或弱 | **提案 → 门禁 → 观察 → 回滚** |
69
+ | 主链路 API Key | 绑宿主 | 要 | 常要 | **不要** |
70
+ | 写入闸门 | 模型自觉 | 服务端策略 | 少 | **审批 + 禁止项 + 冲突裁决** |
71
+
72
+ ## 安装
73
+
74
+ 需要 Python 3.10+。在本仓库根目录:
75
+
76
+ ```bash
77
+ pip install -e .
78
+ rsi init
79
+ ```
80
+
81
+ `rsi init` 只写用户配置 `~/.rsi/config.yaml`。项目记忆在各仓库的 `.rsi/`,第一次启动 MCP 或 bootstrap 时创建。
82
+
83
+ ## 接到 Cursor
84
+
85
+ 在**要用记忆的那个项目**的 `.cursor/mcp.json` 加:
86
+
87
+ ```json
88
+ {
89
+ "mcpServers": {
90
+ "rsi-boot": {
91
+ "command": "rsi",
92
+ "args": ["serve"],
93
+ "env": {
94
+ "RSI_PROJECT_ROOT": "${workspaceFolder}"
95
+ }
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ 然后 Settings → MCP 确认 `rsi-boot` 已启用。改过本仓库代码后要重载该 MCP。
102
+
103
+ 不要配用户级 `mcp.json`:那里 `args` 里的 `${workspaceFolder}` 经常不展开,会把记忆串到别的仓库。工作区绑定顺序:`RSI_PROJECT_ROOT`(项目级 mcp.json,推荐,显式契约)→ MCP `roots/list`(插件形态下由 Cursor 自动应答)→ Cursor 注入的 `WORKSPACE_FOLDER_PATHS` → 进程 cwd。
104
+
105
+ ## 接到其他宿主
106
+
107
+ ### Qoder
108
+
109
+ 本仓库同时是 Qoder 插件:`.qoder-plugin/plugin.json` 清单 + 根目录 `mcp.json`(与 Cursor 插件共用同一份 MCP 配置),打 zip 即可分发。手动接的话二选一:
110
+
111
+ ```bash
112
+ qoder mcp add rsi-boot -- rsi serve
113
+ ```
114
+
115
+ 或在项目根 `.mcp.json` 加与 Cursor 相同的 `mcpServers` 片段。工作区绑定顺序与 Cursor 一致(`RSI_PROJECT_ROOT` → roots/list → 注入变量 → cwd)。
116
+
117
+ ### Codex
118
+
119
+ Codex 没有插件包格式,MCP 走 TOML 配置:用户级 `~/.codex/config.toml`,或项目级 `.codex/config.toml`(需目录已被信任):
120
+
121
+ ```toml
122
+ [mcp_servers.rsi-boot]
123
+ command = "rsi"
124
+ args = ["serve"]
125
+ ```
126
+
127
+ 从项目根目录启动 codex 即可——MCP 子进程继承 cwd,rsi-boot 按 cwd 向上认领工作区。要显式钉死就在表里加一行:`env = { RSI_PROJECT_ROOT = "/绝对/路径" }`。
128
+
129
+ ## 状态栏(可选)
130
+
131
+ `rsi statusline` 给宿主 CLI 渲染底部状态栏:模型、上下文余量、token 统计(in/out/cache)、花费、RSI 今日召回与采纳率,外加一条定期轮换的随机文案。Claude Code 与 Cursor CLI 通用(两家的 statusLine 都会把会话 JSON 从 stdin 喂进来,本命令解析后单行输出,带 ANSI 颜色与 emoji)。
132
+
133
+ Claude Code(`~/.claude/settings.json`):
134
+
135
+ ```json
136
+ {
137
+ "statusLine": { "type": "command", "command": "rsi statusline" }
138
+ }
139
+ ```
140
+
141
+ Cursor CLI(`~/.cursor/cli-config.json`):
142
+
143
+ ```json
144
+ {
145
+ "statusLine": { "type": "command", "command": "rsi statusline" }
146
+ }
147
+ ```
148
+
149
+ 效果示例:
150
+
151
+ ```
152
+ 🧠 Kimi K3 │ 📊 上下文余 71% │ ⛽ in 12.3k · out 1.8k · cache 96k │ 💰 $0.42 │ 🐾 RSI 召回 3 · 采纳 92% │ 给你比个心❤
153
+ ```
154
+
155
+ ### 选文案风格
156
+
157
+ 三种配法并列,按场景任选(优先级:`--style` > 环境变量 > 项目级 > 用户级):
158
+
159
+ ```jsonc
160
+ // ① 跟着宿主走:直接写进 statusLine 的 command(最直观,不动任何 config.yaml)
161
+ { "statusLine": { "type": "command", "command": "rsi statusline --style buddy" } }
162
+ ```
163
+
164
+ ```yaml
165
+ # ② 项目级(按仓库定风格,跨宿主共享):<工作区>/.rsi/config.yaml
166
+ # ③ 用户级(全局默认):~/.rsi/config.yaml
167
+ statusline_style: buddy
168
+ ```
169
+
170
+ 六档预设:`mixed` 混搭(默认)、`buddy` 陪伴搭子(WorkBuddy 风:陪伴/安抚/治愈/祝福)、`serious` 严肃专业(只出通用陪伴与金句,不见猫咪玄学)、`healing` 治愈可爱、`geek` 极客梗、`lucky` 玄学好运。改完即生效,无需重启——状态栏每次刷新都会重读。语言键 `lang` 在 config.yaml 里走同一条优先级链。
171
+
172
+ 注意:状态栏不是 MCP server,不由 mcp.json 管理(那是 `rsi serve` 记忆服务的配置),所以风格只能配在 statusLine 的 command 或 config.yaml 里。
173
+
174
+ ### 说明:
175
+
176
+ - token 明细来自 transcript(Claude Code)或 `context_window` 字段(Cursor CLI);上下文窗口默认 200k,`exceeds_200k_tokens` 时按 1M,可用 `RSI_STATUSLINE_CTX_WINDOW` 覆盖。
177
+ - 文案三层供给:**用户文案文件**(`~/.rsi/quips.json`,板块非空即整体替换内置池)> 手写池(130+ 条,质量下限)+ 模板造句器(约 200 种组合,按组合空间加权)。用户文案由宿主模型在对话中生成(对它说「生成状态栏文案」即可,风格规范内嵌在文件头),写完跑 `rsi statusline --validate-quips` 校验口径与去重。
178
+ - 风格按主题(core/motto/kudos/fortune/geek/dry/healing/food/cat/game/hype/slack/offwork/weather)打标过滤;场景池(早安/深夜/告急/久坐/夸夸)功能性文案不受风格限制。
179
+ - 轮换与防重:默认 45 秒一换(`RSI_STATUSLINE_QUIP_SECONDS` 可调,如 5),同桶内不闪烁;`~/.rsi/state/statusline_quips.json` 记录每会话最近 300 条已播,自动避开重复。
180
+ - 场景专属池:早安(06–11 点)、深夜(23–06 点)、上下文告急(≤15%)、久坐提醒(会话 ≥45 分钟,`RSI_STATUSLINE_REST_MINUTES` 可调,0 关闭)、RSI 高采纳夸夸。
181
+ - RSI 段从 cwd 向上找 `.rsi/logs/events.jsonl` 统计今日数据,找不到就静默省略。
182
+ - 语言只显示一种,解析链:`--lang` → `RSI_LANG` → 项目 `.rsi/config.yaml` → 用户 `~/.rsi/config.yaml` → 系统语言。想固定就写一行 `lang: zh`(项目级优先)。
183
+ - 选项:`--lang zh|en`、`--no-rsi`、`--no-quip`、`--plain`(去颜色与 emoji);`NO_COLOR` 只关颜色。
184
+ - 冷启动约 250ms,满足宿主 ≥300ms 刷新间隔;命令永不非零退出,异常时兜底输出一行。
185
+
186
+ ## 在对话里学习
187
+
188
+ 接好 MCP 后不要自己去终端跑 `rsi`。对当前项目窗口里的代理说即可。
189
+
190
+ | 你说 | 代理做的 |
191
+ |------|----------|
192
+ | 第一次学这个项目 | `rsi bootstrap --consent --host-judge` → `rsi_learn` 蒸完全部 pending → `rsi_knowledge_review` 批准本 run |
193
+ | 重新学习 | 先 `rsi wipe --yes` 清记忆,再按上面重新学 |
194
+
195
+ 看到「必须指定 `--host-judge` 或 `--local-judge`」就加 `--host-judge` 重跑,不要改用 `--local-judge`(那条只给终端自己采集用)。`rsi wipe --yes` 会删掉该项目 `.rsi` 下的 `memory/` `logs/` `cache/` `audit/` `state/` 与 `manifest.json`,保留 `identity.json`;若提示文件被占用,先在 Settings → MCP 关掉 `rsi-boot` 再重跑。
196
+
197
+ 学完看 `.rsi/bootstrap_report.md` 的板块清单,pending=0 并经 `rsi_knowledge_review` 批准后才算召回可用。约定获准后只进召回,不会写成 `rsi-convention-*.mdc` 规则文件。
198
+
199
+ ## 终端冒烟
200
+
201
+ 不经对话、只调 CLI 时用。写盘必须带 `--host-judge` 或 `--local-judge` 其中一个;`--dry-run` 除外。
202
+
203
+ ```bash
204
+ rsi recall "帮我审查这段 Python 代码"
205
+ rsi knowledge add --title "项目约定" --content "本项目统一使用 snake_case 命名"
206
+ rsi recall "本项目的命名约定是什么"
207
+
208
+ rsi bootstrap --dry-run
209
+ rsi bootstrap --local-judge
210
+ rsi bootstrap --local-judge --force
211
+
212
+ # 旧版 .rsi/rsi.db 先迁移
213
+ rsi memory migrate
214
+
215
+ # 一般由 Cursor 拉起,不必手跑
216
+ rsi serve
217
+ ```
218
+
219
+ ## MCP 工具
220
+
221
+ | 工具 | 干什么 |
222
+ |------|--------|
223
+ | `rsi_recall` | 任务开始前召回:禁止项置顶 + 约定/文档/gene/teaching |
224
+ | `rsi_explore` | 按 domain 板块下钻浏览知识树(空 path 列顶层板块+计数,传 path 列成员条目标题/简述/id,并附本节点条目的图谱关联 related 与冲突 conflicts) |
225
+ | `rsi_feedback` | 采纳反馈;rejected+评语会提炼为禁止项 |
226
+ | `rsi_learn` | 阅读包 pack_list / pack_open / pack_done,teach_catch / teach_record,Session 审计 |
227
+ | `rsi_knowledge_add` / `rsi_knowledge_search` / `rsi_knowledge_delete` / `rsi_knowledge_update` / `rsi_knowledge_review` | 记忆管理与审批;`rsi_knowledge_update` 支持原地改字段(改优于新建重复)与 `merge` 合并近重复(保留更完整者、其余归档并写 supersedes 边);蒸馏条须带 `pack_id` |
228
+ | `rsi_conflicts` | 短知识冲突查询与裁决 |
229
+ | `rsi_memory_health` | 错误/过时记忆发现与裁决:评语极性打脸开 `incorrect`,来源失效开 `stale_source`;`resolve` 才能归档,扫描本身不动正式库 |
230
+ | `rsi_memory` | 记忆索引 / 打开 / 重建 / 关系图 |
231
+ | `rsi_review` | Harness 改进提案与配置快照 |
232
+ | `rsi_stats` | 记忆使用统计 |
233
+ | `rsi_impact` | 价值/影响力面板(供宣讲):注入成本(字符+token 估算)、召回压缩比、采纳/合规、时间曲线,以及 A/B 省 token 计算器(省量仅由用户喂入的宿主用前/用后对照得出,绝不编造) |
234
+
235
+ RSI 无 OAuth。蒸馏中途不要调 `mcp_auth`、不要给用户弹授权。
236
+
237
+ ## 配置
238
+
239
+ 配置链:包内 `default.yaml` → `~/.rsi/config.yaml` → 项目根 `rsi-boot.yaml` → 请求参数。
240
+
241
+ `RSI_HOME` 只覆盖用户配置目录(默认 `~/.rsi`)。项目记忆、画像、归档都在工作目录 `.rsi/`,打开另一个仓库就是另一份,不会串。主链路零配置可用;可选增强(向量检索、LLM 提取等,需自配模型 Key)见 `~/.rsi/config.yaml` 示例。
242
+
243
+ 项目 `rsi-boot.yaml` 禁止明文密钥,发现即拒绝启动。日志落库前脱敏;注入宿主上下文前过审批闸门与黑名单;超 90 天日志自动归档到 `.rsi/archive/YYYYMM.jsonl`。
244
+
245
+ ## 开发
246
+
247
+ ```bash
248
+ pip install -e ".[dev]"
249
+ python -m pytest
250
+ python scripts/export_schemas.py
251
+ ```
@@ -0,0 +1,211 @@
1
+ <div align="center">
2
+ <img src="assets/logo.svg" alt="rsi-boot logo" width="120">
3
+ </div>
4
+
5
+ # RSI Boot
6
+
7
+ [简体中文](README.md) | English
8
+
9
+ Plenty of tools already store agent memory. RSI Boot is built for two other jobs: **a harness that improves as you use it**, and **memory that travels with the repo so switching hosts does not mean re-teaching the project**.
10
+
11
+ The main path needs no API key and makes no model calls. Conventions, prohibitions, repair lessons, and harness slots live only in the current repo's `.rsi/`, and are recalled on demand before the next task.
12
+
13
+ ## Not another memory plugin
14
+
15
+ **rsi-harness (Harness-RSI)**
16
+ Negative feedback lands in failure buckets and only writable slots change (prompts / skills / recall strategy / intent rules / knowledge). A proposal must pass the static gate and human review before promotion; it is watched for 7 days and rolled back if adoption drops. The point is to get better at the work, not to hoard more notes.
17
+
18
+ **Follows the project**
19
+ Memory is isolated per repo — not per account, not per IDE. Copy the repo, move machines, or rename the directory, and `.rsi/` comes along. Open another repo and you get another copy; nothing leaks across. The harness genome can be exported as a bundle for backup or a slot move.
20
+
21
+ **Host-portable**
22
+ One MCP server (`rsi serve`) plugs into Cursor, Qoder, and Codex; the status line speaks both Claude Code and Cursor CLI. Injection writes `.cursor/rules` plus an `AGENTS.md` managed block that every host already reads, so you do not re-explain the project when you switch tools.
23
+
24
+ | | Host-native memory | Cloud memory (Mem0 and the like) | Generic local memory MCP | RSI Boot |
25
+ |---|---|---|---|---|
26
+ | Data follows | the account / the host | the cloud user | depends | **the current repo** |
27
+ | Switch Cursor / Claude Code / Codex | start over | only if that host is wired | usually store-and-recall | **the same `.rsi/`** |
28
+ | Harness self-improvement | no | no | weak or none | **propose → gate → observe → roll back** |
29
+ | API key on the main path | bound to the host | required | often | **none** |
30
+ | Write gate | the model decides | server-side policy | rare | **review + prohibitions + conflict rulings** |
31
+
32
+ ## Installation
33
+
34
+ Requires Python 3.10+. From the root of this repository:
35
+
36
+ ```bash
37
+ pip install -e .
38
+ rsi init
39
+ ```
40
+
41
+ `rsi init` only writes the user-level config `~/.rsi/config.yaml`. Project memory lives in each repo's `.rsi/`, created on the first MCP startup or bootstrap run.
42
+
43
+ ## Hooking up Cursor
44
+
45
+ In the `.cursor/mcp.json` of **the project you want memory for**, add:
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "rsi-boot": {
51
+ "command": "rsi",
52
+ "args": ["serve"],
53
+ "env": {
54
+ "RSI_PROJECT_ROOT": "${workspaceFolder}"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ Then go to Settings → MCP and confirm `rsi-boot` is enabled. Reload the MCP after changing this repository's code.
62
+
63
+ Do **not** configure a user-level `mcp.json`: `${workspaceFolder}` in `args` often goes unexpanded there, which leaks memory across repos. Workspace binding order: `RSI_PROJECT_ROOT` (project-level mcp.json, recommended — explicit contract) → MCP `roots/list` (answered automatically by Cursor in plugin form) → the `WORKSPACE_FOLDER_PATHS` variable injected by Cursor → process cwd.
64
+
65
+ ## Other hosts
66
+
67
+ ### Qoder
68
+
69
+ This repository is also a Qoder plugin: the `.qoder-plugin/plugin.json` manifest plus the root `mcp.json` (the same MCP config shared with the Cursor plugin) — zip it to distribute. To wire it up manually, either:
70
+
71
+ ```bash
72
+ qoder mcp add rsi-boot -- rsi serve
73
+ ```
74
+
75
+ or add the same `mcpServers` snippet as Cursor to a project-root `.mcp.json`. Workspace binding order is identical (`RSI_PROJECT_ROOT` → roots/list → injected variables → cwd).
76
+
77
+ ### Codex
78
+
79
+ Codex has no plugin bundle format; MCP servers live in TOML: user-level `~/.codex/config.toml`, or project-level `.codex/config.toml` (loaded only from trusted directories):
80
+
81
+ ```toml
82
+ [mcp_servers.rsi-boot]
83
+ command = "rsi"
84
+ args = ["serve"]
85
+ ```
86
+
87
+ Just start codex from the project root — the MCP child process inherits its cwd and rsi-boot claims the workspace by walking up from there. To pin explicitly, add one line to the table: `env = { RSI_PROJECT_ROOT = "/absolute/path" }`.
88
+
89
+ ## Status line (optional)
90
+
91
+ `rsi statusline` renders the host CLI's bottom status line: model, context headroom, token stats (in/out/cache), cost, today's RSI recall/adoption, plus a rotating quip. Works with both Claude Code and Cursor CLI — their `statusLine` hooks pipe a session JSON into stdin, and this command prints a single ANSI-colored line.
92
+
93
+ Claude Code (`~/.claude/settings.json`):
94
+
95
+ ```json
96
+ {
97
+ "statusLine": { "type": "command", "command": "rsi statusline" }
98
+ }
99
+ ```
100
+
101
+ Cursor CLI (`~/.cursor/cli-config.json`):
102
+
103
+ ```json
104
+ {
105
+ "statusLine": { "type": "command", "command": "rsi statusline" }
106
+ }
107
+ ```
108
+
109
+ Example output:
110
+
111
+ ```
112
+ 🧠 Kimi K3 │ 📊 ctx left 71% │ ⛽ in 12.3k · out 1.8k · cache 96k │ 💰 $0.42 │ 🐾 RSI recalls 3 · adopted 92% │ sending you a heart ❤
113
+ ```
114
+
115
+ ### Choosing a quip style
116
+
117
+ Three equivalent ways — pick per scenario (priority: `--style` > env var > project > user):
118
+
119
+ ```jsonc
120
+ // ① Stays with the host: put the flag right in the statusLine command
121
+ { "statusLine": { "type": "command", "command": "rsi statusline --style buddy" } }
122
+ ```
123
+
124
+ ```yaml
125
+ # ② Project level (per-repo style, shared across hosts): <workspace>/.rsi/config.yaml
126
+ # ③ User level (global default): ~/.rsi/config.yaml
127
+ statusline_style: buddy
128
+ ```
129
+
130
+ Six presets: `mixed` (default), `buddy` (WorkBuddy-style companionship: company/reassurance/healing/blessings), `serious` (companionship and maxims only — no cats or fortune-telling), `healing`, `geek`, `lucky`. Takes effect on the next refresh — the file is re-read every time, no restart needed. The `lang` key in config.yaml follows the same priority chain.
131
+
132
+ Note: the status line is not an MCP server and is not governed by mcp.json (that's for the `rsi serve` memory service), so the style lives in the statusLine command or config.yaml only.
133
+
134
+ ### Notes:
135
+
136
+ - Token details come from the transcript (Claude Code) or the `context_window` payload fields (Cursor CLI). The context window defaults to 200k, switches to 1M when `exceeds_200k_tokens` is set, and can be overridden via `RSI_STATUSLINE_CTX_WINDOW`.
137
+ - Three supply layers for quips: **user quips file** (`~/.rsi/quips.json` — any non-empty pool fully replaces its built-in counterpart) > handwritten pools (130+ entries, quality floor) + a template composer (~200 combinations, weighted by combination space). The user file is generated by the host model in conversation (just say "generate statusline quips"; the style spec is embedded in the file header) and verified with `rsi statusline --validate-quips`.
138
+ - Style filters by theme tags (core/motto/kudos/fortune/geek/dry/healing/food/cat/game/hype/slack/offwork/weather); situational pools (morning/late-night/context-low/rest/praise) stay functional and unfiltered.
139
+ - Rotation and no-repeat: 45s per pick by default (`RSI_STATUSLINE_QUIP_SECONDS` to tune, e.g. 5), stable within a bucket so nothing flickers; `~/.rsi/state/statusline_quips.json` tracks the last 300 shown per session and avoids repeats.
140
+ - Situational pools: morning (06–11h), late night (23–06h), context nearly full (≤15%), long-session rest reminders (≥45 min, tunable via `RSI_STATUSLINE_REST_MINUTES`, 0 disables), and RSI high-adoption praise.
141
+ - The RSI segment walks up from cwd to `.rsi/logs/events.jsonl` for today's stats, and is silently omitted when absent.
142
+ - Exactly one language is rendered, resolved via: `--lang` → `RSI_LANG` env → project `.rsi/config.yaml` → user `~/.rsi/config.yaml` → system locale. Write `lang: zh` once to pin it (project level wins).
143
+ - Flags: `--lang zh|en`, `--no-rsi`, `--no-quip`, `--plain` (no colors or emoji); `NO_COLOR` disables colors only.
144
+ - Cold start is ~250ms, within the host's ≥300ms refresh cadence; the command always exits 0 and falls back to a minimal line on error.
145
+
146
+ ## Learning in conversation
147
+
148
+ Once the MCP is connected, don't run `rsi` in a terminal yourself — just talk to the agent in the project window.
149
+
150
+ | You say | The agent does |
151
+ |---------|----------------|
152
+ | Learn this project for the first time | `rsi bootstrap --consent --host-judge` → `rsi_learn` distills all pending packs → `rsi_knowledge_review` approves the run |
153
+ | Re-learn | `rsi wipe --yes` to clear memory first, then repeat the above |
154
+
155
+ If you see "must specify `--host-judge` or `--local-judge`", rerun with `--host-judge` — do not switch to `--local-judge` (that one is for terminal-only capture). `rsi wipe --yes` deletes `memory/`, `logs/`, `cache/`, `audit/`, `state/` and `manifest.json` under the project's `.rsi`, keeping `identity.json`; if files are locked, disable `rsi-boot` in Settings → MCP first, then retry.
156
+
157
+ After learning, check the lane list in `.rsi/bootstrap_report.md`: recall is usable only when pending=0 and the run has been approved via `rsi_knowledge_review`. Approved conventions enter recall only — they are not written out as `rsi-convention-*.mdc` rule files.
158
+
159
+ ## CLI smoke test
160
+
161
+ For driving the CLI directly, outside of conversation. Writes require either `--host-judge` or `--local-judge`; `--dry-run` is exempt.
162
+
163
+ ```bash
164
+ rsi recall "review this Python code for me"
165
+ rsi knowledge add --title "project convention" --content "this project uses snake_case everywhere"
166
+ rsi recall "what are the naming conventions in this project"
167
+
168
+ rsi bootstrap --dry-run
169
+ rsi bootstrap --local-judge
170
+ rsi bootstrap --local-judge --force
171
+
172
+ # migrate a legacy .rsi/rsi.db first
173
+ rsi memory migrate
174
+
175
+ # normally launched by Cursor; no need to run by hand
176
+ rsi serve
177
+ ```
178
+
179
+ ## MCP tools
180
+
181
+ | Tool | What it does |
182
+ |------|--------------|
183
+ | `rsi_recall` | Pre-task recall: prohibitions first, plus conventions / docs / gene / teaching |
184
+ | `rsi_explore` | Drill the knowledge tree by domain module (empty path lists top modules with counts; a path lists member items title/brief/id plus graph-based related / conflicts edges for that node) |
185
+ | `rsi_feedback` | Adoption feedback; rejected+comment is distilled into a prohibition |
186
+ | `rsi_learn` | Reading packs (pack_list / pack_open / pack_done), teach_catch / teach_record, session audit |
187
+ | `rsi_knowledge_add` / `rsi_knowledge_search` / `rsi_knowledge_delete` / `rsi_knowledge_update` / `rsi_knowledge_review` | Memory management and review; `rsi_knowledge_update` edits an entry in place (prefer updating over re-adding duplicates) and `merge` combines near-duplicates (keeps the more complete one, archives the rest, records a supersedes edge); distilled entries must carry a `pack_id` |
188
+ | `rsi_conflicts` | Query and adjudicate conflicts between short knowledge items |
189
+ | `rsi_memory_health` | Flag incorrect or stale memories: contradicting comment polarity opens `incorrect`, a changed source that lost the title phrase opens `stale_source`; only `resolve` archives — scan never writes the official store |
190
+ | `rsi_memory` | Memory index / open / rebuild / relationship graph |
191
+ | `rsi_review` | Harness improvement proposals and config snapshots |
192
+ | `rsi_stats` | Memory usage statistics |
193
+ | `rsi_impact` | Value/impact panel for evangelism: injected cost (chars + est. tokens), recall compaction, adoption/compliance, a time curve, and an A/B token-savings calculator (savings are only produced from a user-supplied host before/after comparison — never invented) |
194
+
195
+ RSI has no OAuth. Do not call `mcp_auth` mid-distillation, and never pop an authorization prompt at the user.
196
+
197
+ ## Configuration
198
+
199
+ Config chain: in-package `default.yaml` → `~/.rsi/config.yaml` → project-root `rsi-boot.yaml` → request parameters.
200
+
201
+ `RSI_HOME` only overrides the user config directory (default `~/.rsi`). Project memory, profiles, and archives all live in the working directory's `.rsi/` — open another repo and you get another copy; nothing leaks across. The main path works with zero configuration; optional enhancements (vector retrieval, LLM extraction, etc., requiring your own model key) are documented in the `~/.rsi/config.yaml` example.
202
+
203
+ Plaintext keys are forbidden in a project's `rsi-boot.yaml` — the server refuses to start if one is found. Logs are redacted before being stored; content passes an approval gate and a blacklist before injection into host context; logs older than 90 days are automatically archived to `.rsi/archive/YYYYMM.jsonl`.
204
+
205
+ ## Development
206
+
207
+ ```bash
208
+ pip install -e ".[dev]"
209
+ python -m pytest
210
+ python scripts/export_schemas.py
211
+ ```