rosett-ai 1.3.3

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 (527) hide show
  1. checksums.yaml +7 -0
  2. data/.ai-provenance.yml +119 -0
  3. data/.debride_whitelist +186 -0
  4. data/.fasterer.yml +29 -0
  5. data/.mdl_style.rb +10 -0
  6. data/.mdlrc +3 -0
  7. data/.mutant.yml +49 -0
  8. data/.namespace-allowlist +42 -0
  9. data/.reek.yml +1040 -0
  10. data/.rosett-ai/config.yml +3 -0
  11. data/.rspec +5 -0
  12. data/.rubocop.yml +380 -0
  13. data/.ruby-version +1 -0
  14. data/.yamllint +51 -0
  15. data/.yardopts +12 -0
  16. data/AI-DISCLOSURE.md +48 -0
  17. data/CHANGELOG.md +519 -0
  18. data/CLAUDE.md +141 -0
  19. data/CONTRIBUTING.md +734 -0
  20. data/INSTALL.md +154 -0
  21. data/LICENSE +674 -0
  22. data/LICENSE.md +675 -0
  23. data/QUICKSTART.md +73 -0
  24. data/README.md +366 -0
  25. data/Rakefile +200 -0
  26. data/SECURITY.md +114 -0
  27. data/bin/rai +1 -0
  28. data/cliff.toml +52 -0
  29. data/conf/adopt_redactions.yml +8 -0
  30. data/conf/behaviour/.gitkeep +0 -0
  31. data/conf/compliance/cra_rules.yml +25 -0
  32. data/conf/compliance/license_rules.yml +20 -0
  33. data/conf/design/aaif_alignment.yml +181 -0
  34. data/conf/design/ab_testing.yml +172 -0
  35. data/conf/design/accessibility.yml +84 -0
  36. data/conf/design/ai_authorship.yml +210 -0
  37. data/conf/design/ai_provenance.yml +224 -0
  38. data/conf/design/ai_tool_configuration.yml +207 -0
  39. data/conf/design/architecture.yml +139 -0
  40. data/conf/design/autocompletion.yml +115 -0
  41. data/conf/design/backward_compatibility.yml +112 -0
  42. data/conf/design/behaviour_composition.yml +246 -0
  43. data/conf/design/build_rake_extraction.yml +57 -0
  44. data/conf/design/ci_pipeline.yml +100 -0
  45. data/conf/design/claude_code_configuration.yml +157 -0
  46. data/conf/design/compiler.yml +128 -0
  47. data/conf/design/comply.yml +153 -0
  48. data/conf/design/content_packs.yml +84 -0
  49. data/conf/design/desktop_integration.yml +289 -0
  50. data/conf/design/distribution.yml +216 -0
  51. data/conf/design/doctor.yml +184 -0
  52. data/conf/design/documentation.yml +152 -0
  53. data/conf/design/engine_architecture.yml +257 -0
  54. data/conf/design/error_handling.yml +103 -0
  55. data/conf/design/feature_flags.yml +142 -0
  56. data/conf/design/git_hooks.yml +165 -0
  57. data/conf/design/gui_plugins.yml +475 -0
  58. data/conf/design/i18n.yml +84 -0
  59. data/conf/design/integration_testing.yml +56 -0
  60. data/conf/design/licensing_system.yml +88 -0
  61. data/conf/design/lifecycle_management.yml +208 -0
  62. data/conf/design/mcp_integration.yml +207 -0
  63. data/conf/design/mcp_settings.yml +126 -0
  64. data/conf/design/migration.yml +56 -0
  65. data/conf/design/monitoring_observability.yml +194 -0
  66. data/conf/design/namespace_cleanup.yml +145 -0
  67. data/conf/design/plugin_test_segregation.yml +145 -0
  68. data/conf/design/policy_management.yml +229 -0
  69. data/conf/design/project_management.yml +183 -0
  70. data/conf/design/rai_mcp_asset_discovery.yml +164 -0
  71. data/conf/design/rai_mcp_server.yml +605 -0
  72. data/conf/design/release_management.yml +117 -0
  73. data/conf/design/retrofit.yml +199 -0
  74. data/conf/design/retrospective_analyzer.yml +79 -0
  75. data/conf/design/scope_hierarchy.yml +352 -0
  76. data/conf/design/security.yml +115 -0
  77. data/conf/design/session_retrospective.yml +85 -0
  78. data/conf/design/smart_ui_feedback.yml +89 -0
  79. data/conf/design/structured_logging.yml +148 -0
  80. data/conf/design/styles.yml +123 -0
  81. data/conf/design/test_peer_review.yml +89 -0
  82. data/conf/design/testing.yml +136 -0
  83. data/conf/design/threat_model.yml +108 -0
  84. data/conf/design/ui_framework.yml +111 -0
  85. data/conf/design/usage_optimization.yml +122 -0
  86. data/conf/design/version_management.yml +60 -0
  87. data/conf/design/workflow.yml +227 -0
  88. data/conf/mcp/server_defaults.yml +42 -0
  89. data/conf/mcp/trust.yml +21 -0
  90. data/conf/packaging/core.yml +12 -0
  91. data/conf/packaging/gtk4.yml +11 -0
  92. data/conf/packaging/qt6.yml +11 -0
  93. data/conf/policy/default_deny_list.yml +197 -0
  94. data/conf/review/cli-command-audit.yml +857 -0
  95. data/conf/review/design-docs.yml +1064 -0
  96. data/conf/review/design-questionnaire.yml +153 -0
  97. data/conf/review/questionnaire.yml +146 -0
  98. data/conf/review/rosett-ai-core.yml +2919 -0
  99. data/conf/schemas/ai_config_schema.json +73 -0
  100. data/conf/schemas/behaviour_schema.json +132 -0
  101. data/conf/schemas/compliance_rule_schema.json +63 -0
  102. data/conf/schemas/content_pack_manifest_schema.json +51 -0
  103. data/conf/schemas/design_schema.json +210 -0
  104. data/conf/schemas/engine_manifest_schema.json +144 -0
  105. data/conf/schemas/lockfile_schema.json +74 -0
  106. data/conf/schemas/mcp_server_schema.json +48 -0
  107. data/conf/schemas/packaging_schema.json +70 -0
  108. data/conf/schemas/policy_schema.json +85 -0
  109. data/conf/schemas/provenance_schema.json +84 -0
  110. data/conf/schemas/rai_config_schema.json +56 -0
  111. data/conf/schemas/rai_project_schema.json +20 -0
  112. data/conf/schemas/scope_hierarchy_schema.json +49 -0
  113. data/conf/schemas/target_schema.json +67 -0
  114. data/conf/schemas/tooling_schema.json +65 -0
  115. data/conf/schemas/workflow_schema.json +112 -0
  116. data/conf/targets/agents_md.yml +17 -0
  117. data/conf/targets/claude.yml +12 -0
  118. data/conf/tooling/tools.yml +58 -0
  119. data/dist/rosett-ai-mcp.service +48 -0
  120. data/dist/rosett-ai-mcp.yml.default +45 -0
  121. data/doc/AAIF_POSITIONING.md +58 -0
  122. data/doc/ADOPT.md +224 -0
  123. data/doc/AI_PROVENANCE.md +139 -0
  124. data/doc/ARCHITECTURE.md +920 -0
  125. data/doc/BEHAVIOUR.md +409 -0
  126. data/doc/BUILD.md +138 -0
  127. data/doc/CI_CD_RECIPES.md +171 -0
  128. data/doc/CLAUDE_SESSIONS_MOVED.md +16 -0
  129. data/doc/COMMAND_ANALYSIS.md +229 -0
  130. data/doc/CONFIGURATION.md +281 -0
  131. data/doc/DESIGN_AUDIT.md +235 -0
  132. data/doc/DESIGN_PEER_REVIEW.md +771 -0
  133. data/doc/DESKTOP.md +447 -0
  134. data/doc/ENGINES.md +567 -0
  135. data/doc/ENGINE_DEVELOPMENT_GUIDE.md +417 -0
  136. data/doc/FEATURE_AUDIT.md +218 -0
  137. data/doc/IMPLEMENTATION_PLAN.md +669 -0
  138. data/doc/INCIDENT_REPORT_2026-02-02.md +251 -0
  139. data/doc/MIGRATION_GUIDE.md +88 -0
  140. data/doc/PACKAGING.md +232 -0
  141. data/doc/PROJECT_DASHBOARD.md +153 -0
  142. data/doc/PULP_DEPLOYMENT.md +164 -0
  143. data/doc/QUALITY_FIX_SUMMARY.md +110 -0
  144. data/doc/QUICK_START.md +162 -0
  145. data/doc/REEK_CONFIGURATION.md +166 -0
  146. data/doc/REFERENCE.md +253 -0
  147. data/doc/REFERENCES.md +324 -0
  148. data/doc/SECURITY_REVIEW_CHECKLIST.md +72 -0
  149. data/doc/SESSION_2026-02-28_GTK4_HARDENING.md +359 -0
  150. data/doc/SETUP.md +202 -0
  151. data/doc/TEST_PEER_REVIEW.md +152 -0
  152. data/doc/THREAT_MODEL.md +230 -0
  153. data/doc/USAGE.md +545 -0
  154. data/doc/USER_MANUAL.md +585 -0
  155. data/doc/ai_test_review_checklist.md +110 -0
  156. data/doc/changes/2026-02-18-packaging-fpm.md +155 -0
  157. data/doc/changes/2026-02-19-testing-infrastructure.md +221 -0
  158. data/doc/changes/2026-02-20-security-implementation.md +281 -0
  159. data/doc/changes/2026-02-20-styles-implementation.md +220 -0
  160. data/doc/changes/2026-02-21-architecture-completion.md +95 -0
  161. data/doc/changes/2026-02-21-architecture-ui-layer.md +253 -0
  162. data/doc/changes/2026-02-21-cc-config-implementation.md +108 -0
  163. data/doc/changes/2026-02-21-ci-pipeline-implementation.md +214 -0
  164. data/doc/changes/2026-02-21-compiler-multi-target-pipeline.md +241 -0
  165. data/doc/changes/2026-02-21-config-design-show-commands.md +61 -0
  166. data/doc/changes/2026-02-21-design-implementation-overview.md +455 -0
  167. data/doc/changes/2026-02-21-lifecycle-management.md +196 -0
  168. data/doc/changes/2026-02-21-path-resolver.md +128 -0
  169. data/doc/changes/2026-02-24-ci-tmpdir-mutant-fetch.md +45 -0
  170. data/doc/changes/2026-03-01-ci-bundler-strategy.md +120 -0
  171. data/doc/changes/2026-03-20-security-hardening-phase2.md +163 -0
  172. data/doc/context/SESSION-HANDOFF.md +69 -0
  173. data/doc/context/ai-engine-usage-trends-2026.md +80 -0
  174. data/doc/context/plan-pluggable-engines.md +590 -0
  175. data/doc/decisions/001-flog-deferred.md +32 -0
  176. data/doc/decisions/002-path-resolution-strategy.md +158 -0
  177. data/doc/decisions/003-ui-adapter-selection.md +193 -0
  178. data/doc/decisions/004-design-document-validation.md +179 -0
  179. data/doc/decisions/005-package-splitting-strategy.md +200 -0
  180. data/doc/decisions/006-multi-engine-architecture.md +147 -0
  181. data/doc/decisions/007-engine-agnostic-pivot.md +219 -0
  182. data/doc/decisions/008-ci-bundler-strategy.md +129 -0
  183. data/doc/decisions/009-core-only-v1-release.md +60 -0
  184. data/doc/decisions/010-engine-debian-packaging.md +66 -0
  185. data/doc/decisions/011-context-aware-cli.md +71 -0
  186. data/doc/dependency_decisions.yml +247 -0
  187. data/doc/issues/001-wrapper-missing-environment-variables.md +197 -0
  188. data/doc/issues/002-embedded-ruby-wrong-prefix.md +217 -0
  189. data/doc/issues/003-smoke-test-false-positive.md +127 -0
  190. data/doc/issues/004-market-research-design-updates.md +109 -0
  191. data/doc/issues/005-compile-scope-coexistence.md +161 -0
  192. data/doc/locales/.gitkeep +0 -0
  193. data/doc/man/rai.1.ronn +505 -0
  194. data/doc/operations/packaging.md +133 -0
  195. data/doc/operations/rosett-ai-release.md +65 -0
  196. data/doc/reference/error-catalog.md +107 -0
  197. data/doc/reference/rosett-ai-technical-reference.pdf +0 -0
  198. data/doc/reference/src/Pictures/cover.jpg +0 -0
  199. data/doc/reference/src/Pictures/head1.jpg +0 -0
  200. data/doc/reference/src/Pictures/head2.jpg +0 -0
  201. data/doc/reference/src/Pictures/head3.jpg +0 -0
  202. data/doc/reference/src/Pictures/head4.jpg +0 -0
  203. data/doc/reference/src/Pictures/head5.jpg +0 -0
  204. data/doc/reference/src/Pictures/head6.jpg +0 -0
  205. data/doc/reference/src/Pictures/head7.jpg +0 -0
  206. data/doc/reference/src/Pictures/head8.jpg +0 -0
  207. data/doc/reference/src/StyleInd.ist +4 -0
  208. data/doc/reference/src/bibliography.bib +79 -0
  209. data/doc/reference/src/main.tex +1288 -0
  210. data/doc/reference/src/structure.tex +303 -0
  211. data/doc/rosett-ai-bookmarks.html +301 -0
  212. data/kitchen.yml +46 -0
  213. data/lib/rosett_ai/adopter/executor_resolver.rb +77 -0
  214. data/lib/rosett_ai/adopter/local_analysis_collector.rb +154 -0
  215. data/lib/rosett_ai/adopter/rule_adopter.rb +254 -0
  216. data/lib/rosett_ai/ai_config/config_compiler.rb +111 -0
  217. data/lib/rosett_ai/ai_config/context_window.rb +55 -0
  218. data/lib/rosett_ai/ai_config/cost_controls.rb +44 -0
  219. data/lib/rosett_ai/ai_config/fallback_chain.rb +64 -0
  220. data/lib/rosett_ai/ai_config/model_router.rb +121 -0
  221. data/lib/rosett_ai/ai_config/validator.rb +45 -0
  222. data/lib/rosett_ai/authorship/attribution_compiler.rb +99 -0
  223. data/lib/rosett_ai/authorship/disclosure_policy.rb +81 -0
  224. data/lib/rosett_ai/authorship/review_validator.rb +39 -0
  225. data/lib/rosett_ai/authorship/trailer_generator.rb +88 -0
  226. data/lib/rosett_ai/backup/compressor.rb +180 -0
  227. data/lib/rosett_ai/backup/destination.rb +91 -0
  228. data/lib/rosett_ai/behaviour/manager.rb +156 -0
  229. data/lib/rosett_ai/compiler/backend.rb +86 -0
  230. data/lib/rosett_ai/compiler/backends/agents_md_backend.rb +80 -0
  231. data/lib/rosett_ai/compiler/backends/claude_backend.rb +88 -0
  232. data/lib/rosett_ai/compiler/backends/generic_backend.rb +15 -0
  233. data/lib/rosett_ai/compiler/behaviour_compiler.rb +40 -0
  234. data/lib/rosett_ai/compiler/capability_checker.rb +104 -0
  235. data/lib/rosett_ai/compiler/compilation_pipeline.rb +361 -0
  236. data/lib/rosett_ai/compiler/compiled_output.rb +39 -0
  237. data/lib/rosett_ai/compiler/locale_compiler.rb +250 -0
  238. data/lib/rosett_ai/compiler/target_profile.rb +112 -0
  239. data/lib/rosett_ai/completion/generator.rb +101 -0
  240. data/lib/rosett_ai/completion/shells/bash_generator.rb +126 -0
  241. data/lib/rosett_ai/completion/shells/fish_generator.rb +78 -0
  242. data/lib/rosett_ai/completion/shells/zsh_generator.rb +126 -0
  243. data/lib/rosett_ai/comply/checkers/cra_checker.rb +102 -0
  244. data/lib/rosett_ai/comply/checkers/license_checker.rb +85 -0
  245. data/lib/rosett_ai/comply/checkers/spdx_header_checker.rb +98 -0
  246. data/lib/rosett_ai/comply/reporter.rb +113 -0
  247. data/lib/rosett_ai/comply/runner.rb +50 -0
  248. data/lib/rosett_ai/composition/circular_dependency_detector.rb +56 -0
  249. data/lib/rosett_ai/composition/composer.rb +158 -0
  250. data/lib/rosett_ai/composition/composition_result.rb +64 -0
  251. data/lib/rosett_ai/composition/conflict_detector.rb +53 -0
  252. data/lib/rosett_ai/composition/lockfile.rb +103 -0
  253. data/lib/rosett_ai/composition/merge_strategy.rb +131 -0
  254. data/lib/rosett_ai/composition/priority_sorter.rb +29 -0
  255. data/lib/rosett_ai/composition/scope_resolver.rb +55 -0
  256. data/lib/rosett_ai/config/compile_result.rb +37 -0
  257. data/lib/rosett_ai/config/compiler.rb +13 -0
  258. data/lib/rosett_ai/config/domain_transformer.rb +13 -0
  259. data/lib/rosett_ai/config/key_map.rb +13 -0
  260. data/lib/rosett_ai/config/masking_secret_resolver.rb +40 -0
  261. data/lib/rosett_ai/config/scope_router.rb +13 -0
  262. data/lib/rosett_ai/config/secret_resolver.rb +125 -0
  263. data/lib/rosett_ai/configuration.rb +119 -0
  264. data/lib/rosett_ai/content/content_client.rb +60 -0
  265. data/lib/rosett_ai/content/pack_installer.rb +117 -0
  266. data/lib/rosett_ai/content/pack_manifest.rb +50 -0
  267. data/lib/rosett_ai/content/pack_registry.rb +68 -0
  268. data/lib/rosett_ai/content_packs/manager.rb +50 -0
  269. data/lib/rosett_ai/dbus/compositor_detector.rb +77 -0
  270. data/lib/rosett_ai/dbus/focus_adapters/base.rb +59 -0
  271. data/lib/rosett_ai/dbus/focus_adapters/gnome_adapter.rb +172 -0
  272. data/lib/rosett_ai/dbus/focus_adapters/hyprland_adapter.rb +77 -0
  273. data/lib/rosett_ai/dbus/focus_adapters/i3_adapter.rb +65 -0
  274. data/lib/rosett_ai/dbus/focus_adapters/kwin_adapter.rb +103 -0
  275. data/lib/rosett_ai/dbus/focus_adapters/x11_adapter.rb +105 -0
  276. data/lib/rosett_ai/dbus/focus_monitor_interface.rb +103 -0
  277. data/lib/rosett_ai/dbus/manager_interface.rb +213 -0
  278. data/lib/rosett_ai/dbus/plugin_manager_interface.rb +169 -0
  279. data/lib/rosett_ai/dbus/rate_limiter.rb +89 -0
  280. data/lib/rosett_ai/dbus/service.rb +121 -0
  281. data/lib/rosett_ai/dbus/status_notifier_interface.rb +79 -0
  282. data/lib/rosett_ai/deprecation.rb +79 -0
  283. data/lib/rosett_ai/desktop/dbus_client.rb +259 -0
  284. data/lib/rosett_ai/desktop/gtk4_app.rb +371 -0
  285. data/lib/rosett_ai/desktop/gtk4_preferences.rb +331 -0
  286. data/lib/rosett_ai/desktop/gui_logger.rb +236 -0
  287. data/lib/rosett_ai/doctor/check.rb +92 -0
  288. data/lib/rosett_ai/doctor/checks/cache_health_check.rb +50 -0
  289. data/lib/rosett_ai/doctor/checks/dbus_availability_check.rb +39 -0
  290. data/lib/rosett_ai/doctor/checks/engine_detection_check.rb +46 -0
  291. data/lib/rosett_ai/doctor/checks/file_permission_check.rb +44 -0
  292. data/lib/rosett_ai/doctor/checks/gem_dependency_check.rb +55 -0
  293. data/lib/rosett_ai/doctor/checks/ruby_version_check.rb +50 -0
  294. data/lib/rosett_ai/doctor/checks/stale_config_nncc_check.rb +57 -0
  295. data/lib/rosett_ai/doctor/checks/stale_home_nncc_check.rb +59 -0
  296. data/lib/rosett_ai/doctor.rb +81 -0
  297. data/lib/rosett_ai/documentation/reference_compiler.rb +122 -0
  298. data/lib/rosett_ai/documentation/translator.rb +62 -0
  299. data/lib/rosett_ai/engines/base_config_compiler.rb +203 -0
  300. data/lib/rosett_ai/engines/detector.rb +63 -0
  301. data/lib/rosett_ai/engines/registry.rb +50 -0
  302. data/lib/rosett_ai/error_handler.rb +139 -0
  303. data/lib/rosett_ai/exit_codes.rb +76 -0
  304. data/lib/rosett_ai/feature_flags.rb +102 -0
  305. data/lib/rosett_ai/formatting.rb +33 -0
  306. data/lib/rosett_ai/gem_consistency_checker.rb +199 -0
  307. data/lib/rosett_ai/git_hooks/chain_detector.rb +86 -0
  308. data/lib/rosett_ai/git_hooks/installer.rb +175 -0
  309. data/lib/rosett_ai/git_hooks/script_generator.rb +125 -0
  310. data/lib/rosett_ai/gitlab/validators/supplementary_gitlab_ci_yaml_validator.rb +79 -0
  311. data/lib/rosett_ai/i18n/locale_resolver.rb +46 -0
  312. data/lib/rosett_ai/i18n/utf8_checker.rb +32 -0
  313. data/lib/rosett_ai/init/config_file_writer.rb +24 -0
  314. data/lib/rosett_ai/init/directory_builder.rb +38 -0
  315. data/lib/rosett_ai/init/file_copier.rb +95 -0
  316. data/lib/rosett_ai/init/global_initializer.rb +28 -0
  317. data/lib/rosett_ai/init/local_initializer.rb +27 -0
  318. data/lib/rosett_ai/init/mcp_registrar.rb +109 -0
  319. data/lib/rosett_ai/init/project_initializer.rb +38 -0
  320. data/lib/rosett_ai/licensing/license_key.rb +139 -0
  321. data/lib/rosett_ai/licensing/license_store.rb +64 -0
  322. data/lib/rosett_ai/licensing/license_validator.rb +60 -0
  323. data/lib/rosett_ai/licensing/tier.rb +42 -0
  324. data/lib/rosett_ai/mcp/admin/auditor.rb +88 -0
  325. data/lib/rosett_ai/mcp/admin/health_checker.rb +81 -0
  326. data/lib/rosett_ai/mcp/admin/registry.rb +100 -0
  327. data/lib/rosett_ai/mcp/admin/schema_validator.rb +63 -0
  328. data/lib/rosett_ai/mcp/enforcement/.gitkeep +0 -0
  329. data/lib/rosett_ai/mcp/enforcement/hook_generator.rb +197 -0
  330. data/lib/rosett_ai/mcp/enforcement/validator.rb +215 -0
  331. data/lib/rosett_ai/mcp/governance.rb +160 -0
  332. data/lib/rosett_ai/mcp/http_security_config.rb +158 -0
  333. data/lib/rosett_ai/mcp/instructions.rb +266 -0
  334. data/lib/rosett_ai/mcp/key_hasher.rb +66 -0
  335. data/lib/rosett_ai/mcp/keyfile.rb +221 -0
  336. data/lib/rosett_ai/mcp/middleware/authentication.rb +146 -0
  337. data/lib/rosett_ai/mcp/middleware/content_type.rb +56 -0
  338. data/lib/rosett_ai/mcp/middleware/cors.rb +83 -0
  339. data/lib/rosett_ai/mcp/middleware/origin_validation.rb +73 -0
  340. data/lib/rosett_ai/mcp/middleware/rate_limit.rb +106 -0
  341. data/lib/rosett_ai/mcp/middleware/request_size.rb +51 -0
  342. data/lib/rosett_ai/mcp/plugins.rb +143 -0
  343. data/lib/rosett_ai/mcp/prompts/compilation_prompt.rb +40 -0
  344. data/lib/rosett_ai/mcp/prompts/compliance_prompt.rb +41 -0
  345. data/lib/rosett_ai/mcp/prompts/diagnostics_prompt.rb +41 -0
  346. data/lib/rosett_ai/mcp/prompts/validation_prompt.rb +41 -0
  347. data/lib/rosett_ai/mcp/resources/behaviour_resource.rb +127 -0
  348. data/lib/rosett_ai/mcp/resources/config_resource.rb +72 -0
  349. data/lib/rosett_ai/mcp/resources/design_resource.rb +58 -0
  350. data/lib/rosett_ai/mcp/resources/hooks_resource.rb +74 -0
  351. data/lib/rosett_ai/mcp/resources/provenance_resource.rb +51 -0
  352. data/lib/rosett_ai/mcp/resources/rules_resource.rb +60 -0
  353. data/lib/rosett_ai/mcp/resources/schema_resource.rb +72 -0
  354. data/lib/rosett_ai/mcp/response_helper.rb +46 -0
  355. data/lib/rosett_ai/mcp/security_logger.rb +60 -0
  356. data/lib/rosett_ai/mcp/server.rb +212 -0
  357. data/lib/rosett_ai/mcp/settings/server_installer.rb +112 -0
  358. data/lib/rosett_ai/mcp/settings/trust_manager.rb +142 -0
  359. data/lib/rosett_ai/mcp/tools/adopt_tool.rb +70 -0
  360. data/lib/rosett_ai/mcp/tools/backup_tool.rb +64 -0
  361. data/lib/rosett_ai/mcp/tools/behaviour_display_tool.rb +72 -0
  362. data/lib/rosett_ai/mcp/tools/behaviour_list_tool.rb +56 -0
  363. data/lib/rosett_ai/mcp/tools/behaviour_manage_tool.rb +114 -0
  364. data/lib/rosett_ai/mcp/tools/behaviour_show_tool.rb +62 -0
  365. data/lib/rosett_ai/mcp/tools/compile_status_tool.rb +122 -0
  366. data/lib/rosett_ai/mcp/tools/compile_tool.rb +191 -0
  367. data/lib/rosett_ai/mcp/tools/comply_tool.rb +79 -0
  368. data/lib/rosett_ai/mcp/tools/config_compile_tool.rb +71 -0
  369. data/lib/rosett_ai/mcp/tools/config_status_tool.rb +79 -0
  370. data/lib/rosett_ai/mcp/tools/content_tool.rb +78 -0
  371. data/lib/rosett_ai/mcp/tools/context_query_tool.rb +156 -0
  372. data/lib/rosett_ai/mcp/tools/design_list_tool.rb +57 -0
  373. data/lib/rosett_ai/mcp/tools/design_show_tool.rb +69 -0
  374. data/lib/rosett_ai/mcp/tools/doctor_tool.rb +62 -0
  375. data/lib/rosett_ai/mcp/tools/documentation_status_tool.rb +45 -0
  376. data/lib/rosett_ai/mcp/tools/engines_tool.rb +84 -0
  377. data/lib/rosett_ai/mcp/tools/hook_install_tool.rb +190 -0
  378. data/lib/rosett_ai/mcp/tools/hook_preview_tool.rb +173 -0
  379. data/lib/rosett_ai/mcp/tools/hooks_status_tool.rb +84 -0
  380. data/lib/rosett_ai/mcp/tools/init_tool.rb +87 -0
  381. data/lib/rosett_ai/mcp/tools/license_status_tool.rb +44 -0
  382. data/lib/rosett_ai/mcp/tools/project_tool.rb +117 -0
  383. data/lib/rosett_ai/mcp/tools/provenance_tool.rb +97 -0
  384. data/lib/rosett_ai/mcp/tools/provenance_write_tool.rb +40 -0
  385. data/lib/rosett_ai/mcp/tools/retrofit_tool.rb +81 -0
  386. data/lib/rosett_ai/mcp/tools/rule_search_tool.rb +163 -0
  387. data/lib/rosett_ai/mcp/tools/schema_get_tool.rb +94 -0
  388. data/lib/rosett_ai/mcp/tools/tooling_tool.rb +86 -0
  389. data/lib/rosett_ai/mcp/tools/validate_tool.rb +105 -0
  390. data/lib/rosett_ai/mcp/tools/workflow_execute_tool.rb +74 -0
  391. data/lib/rosett_ai/mcp/tools/workflow_tool.rb +78 -0
  392. data/lib/rosett_ai/migration/detector.rb +117 -0
  393. data/lib/rosett_ai/migration/nncc_config_migrator.rb +94 -0
  394. data/lib/rosett_ai/migration/nncc_project_migrator.rb +90 -0
  395. data/lib/rosett_ai/migration/xdg_migrator.rb +123 -0
  396. data/lib/rosett_ai/package_manager/apt.rb +108 -0
  397. data/lib/rosett_ai/package_manager/base.rb +68 -0
  398. data/lib/rosett_ai/package_manager/gem_backend.rb +90 -0
  399. data/lib/rosett_ai/packaging/variant_config.rb +92 -0
  400. data/lib/rosett_ai/path_resolver.rb +115 -0
  401. data/lib/rosett_ai/plugins/contract.rb +43 -0
  402. data/lib/rosett_ai/plugins/engine_contract.rb +60 -0
  403. data/lib/rosett_ai/plugins/gui_contract.rb +74 -0
  404. data/lib/rosett_ai/plugins/mcp_contract.rb +48 -0
  405. data/lib/rosett_ai/plugins/registry.rb +150 -0
  406. data/lib/rosett_ai/policy/auditor.rb +41 -0
  407. data/lib/rosett_ai/policy/deny_list.rb +71 -0
  408. data/lib/rosett_ai/policy/opt_out_scanner.rb +37 -0
  409. data/lib/rosett_ai/policy/policy_compiler.rb +84 -0
  410. data/lib/rosett_ai/policy/protected_files.rb +47 -0
  411. data/lib/rosett_ai/policy/tier_hierarchy.rb +48 -0
  412. data/lib/rosett_ai/policy/validator.rb +35 -0
  413. data/lib/rosett_ai/profiler.rb +79 -0
  414. data/lib/rosett_ai/project/drift_detector.rb +126 -0
  415. data/lib/rosett_ai/project/manager.rb +115 -0
  416. data/lib/rosett_ai/project/sync_manager.rb +138 -0
  417. data/lib/rosett_ai/project/template_applier.rb +105 -0
  418. data/lib/rosett_ai/project_context.rb +82 -0
  419. data/lib/rosett_ai/provenance/entry.rb +63 -0
  420. data/lib/rosett_ai/provenance/file_source.rb +32 -0
  421. data/lib/rosett_ai/provenance/source.rb +62 -0
  422. data/lib/rosett_ai/provenance/store.rb +153 -0
  423. data/lib/rosett_ai/provenance/tracker.rb +62 -0
  424. data/lib/rosett_ai/provenance/trailer_generator.rb +43 -0
  425. data/lib/rosett_ai/provenance/validator.rb +45 -0
  426. data/lib/rosett_ai/quorum/collector.rb +59 -0
  427. data/lib/rosett_ai/quorum/comparator.rb +81 -0
  428. data/lib/rosett_ai/quorum/dispatcher.rb +57 -0
  429. data/lib/rosett_ai/quorum/strategies/adopt.rb +56 -0
  430. data/lib/rosett_ai/rai_config.rb +107 -0
  431. data/lib/rosett_ai/retrofit/base_parser.rb +66 -0
  432. data/lib/rosett_ai/retrofit/engine.rb +171 -0
  433. data/lib/rosett_ai/retrofit/parsers/agents_md_parser.rb +50 -0
  434. data/lib/rosett_ai/retrofit/parsers/claude_parser.rb +69 -0
  435. data/lib/rosett_ai/retrofit/parsers/cursor_parser.rb +82 -0
  436. data/lib/rosett_ai/retrofit/round_trip_validator.rb +65 -0
  437. data/lib/rosett_ai/retrofit/scanner.rb +47 -0
  438. data/lib/rosett_ai/retrofit/secret_detector.rb +87 -0
  439. data/lib/rosett_ai/secrets_resolver.rb +71 -0
  440. data/lib/rosett_ai/smart_feedback/suggester.rb +83 -0
  441. data/lib/rosett_ai/smart_feedback/thor_middleware.rb +84 -0
  442. data/lib/rosett_ai/structured_logger.rb +110 -0
  443. data/lib/rosett_ai/telemetry/json_lines_writer.rb +50 -0
  444. data/lib/rosett_ai/telemetry/log_rotator.rb +67 -0
  445. data/lib/rosett_ai/telemetry/provider.rb +26 -0
  446. data/lib/rosett_ai/telemetry/reporter.rb +144 -0
  447. data/lib/rosett_ai/telemetry.rb +47 -0
  448. data/lib/rosett_ai/text_sanitizer.rb +62 -0
  449. data/lib/rosett_ai/thor/cli.rb +269 -0
  450. data/lib/rosett_ai/thor/tasks/adopt.rb +250 -0
  451. data/lib/rosett_ai/thor/tasks/backup.rb +420 -0
  452. data/lib/rosett_ai/thor/tasks/behaviour.rb +474 -0
  453. data/lib/rosett_ai/thor/tasks/build.rb +1162 -0
  454. data/lib/rosett_ai/thor/tasks/compile.rb +415 -0
  455. data/lib/rosett_ai/thor/tasks/completion.rb +123 -0
  456. data/lib/rosett_ai/thor/tasks/comply.rb +82 -0
  457. data/lib/rosett_ai/thor/tasks/config.rb +265 -0
  458. data/lib/rosett_ai/thor/tasks/content.rb +193 -0
  459. data/lib/rosett_ai/thor/tasks/dbus.rb +321 -0
  460. data/lib/rosett_ai/thor/tasks/design.rb +258 -0
  461. data/lib/rosett_ai/thor/tasks/desktop.rb +129 -0
  462. data/lib/rosett_ai/thor/tasks/doctor.rb +127 -0
  463. data/lib/rosett_ai/thor/tasks/documentation.rb +321 -0
  464. data/lib/rosett_ai/thor/tasks/engines.rb +167 -0
  465. data/lib/rosett_ai/thor/tasks/hooks.rb +219 -0
  466. data/lib/rosett_ai/thor/tasks/init.rb +259 -0
  467. data/lib/rosett_ai/thor/tasks/license.rb +120 -0
  468. data/lib/rosett_ai/thor/tasks/mcp.rb +535 -0
  469. data/lib/rosett_ai/thor/tasks/migrate.rb +121 -0
  470. data/lib/rosett_ai/thor/tasks/plugins.rb +157 -0
  471. data/lib/rosett_ai/thor/tasks/project.rb +260 -0
  472. data/lib/rosett_ai/thor/tasks/provenance.rb +195 -0
  473. data/lib/rosett_ai/thor/tasks/release.rb +314 -0
  474. data/lib/rosett_ai/thor/tasks/retrofit.rb +90 -0
  475. data/lib/rosett_ai/thor/tasks/tooling.rb +308 -0
  476. data/lib/rosett_ai/thor/tasks/validate.rb +108 -0
  477. data/lib/rosett_ai/thor/tasks/workflow.rb +196 -0
  478. data/lib/rosett_ai/tooling/ci_yaml_validator.rb +37 -0
  479. data/lib/rosett_ai/tooling/version_checker.rb +35 -0
  480. data/lib/rosett_ai/ui/accessible_tui.rb +61 -0
  481. data/lib/rosett_ai/ui/base.rb +46 -0
  482. data/lib/rosett_ai/ui/gtk4.rb +98 -0
  483. data/lib/rosett_ai/ui/kde.rb +40 -0
  484. data/lib/rosett_ai/ui/qt6.rb +40 -0
  485. data/lib/rosett_ai/ui/registry.rb +60 -0
  486. data/lib/rosett_ai/ui/tty_helper.rb +74 -0
  487. data/lib/rosett_ai/ui/tui.rb +59 -0
  488. data/lib/rosett_ai/validators/behaviour_validator.rb +20 -0
  489. data/lib/rosett_ai/validators/design_validator.rb +17 -0
  490. data/lib/rosett_ai/validators/schema_validator.rb +84 -0
  491. data/lib/rosett_ai/validators/tooling_validator.rb +17 -0
  492. data/lib/rosett_ai/version.rb +8 -0
  493. data/lib/rosett_ai/version_consistency_checker.rb +129 -0
  494. data/lib/rosett_ai/workflow/audit_log.rb +86 -0
  495. data/lib/rosett_ai/workflow/engine.rb +142 -0
  496. data/lib/rosett_ai/workflow/manager.rb +82 -0
  497. data/lib/rosett_ai/workflow/schema_validator.rb +71 -0
  498. data/lib/rosett_ai/workflow/step_runner.rb +61 -0
  499. data/lib/rosett_ai/workflow/steps/prompt_step.rb +62 -0
  500. data/lib/rosett_ai/workflow/steps/rai_step.rb +74 -0
  501. data/lib/rosett_ai/workflow/steps/shell_step.rb +53 -0
  502. data/lib/rosett_ai/yaml_loader.rb +78 -0
  503. data/lib/rosett_ai.rb +221 -0
  504. data/lib/rubocop/cop/rosett_ai/shell_interpolation.rb +54 -0
  505. data/lib/rubocop/cop/rosett_ai/unsafe_const_get.rb +60 -0
  506. data/lib/rubocop/cop/rosett_ai/unsafe_send.rb +50 -0
  507. data/lib/rubocop/cop/rosett_ai/unsafe_yaml_load.rb +40 -0
  508. data/lib/rubocop/rosett_ai.rb +9 -0
  509. data/lib/scripts/generated/docker_hub_tags.rb +126 -0
  510. data/locales/.gitkeep +0 -0
  511. data/locales/ar.yml +579 -0
  512. data/locales/en.yml +571 -0
  513. data/locales/fr.yml +567 -0
  514. data/packaging/build-engine-deb.sh +81 -0
  515. data/packaging/scripts/postinst +17 -0
  516. data/packaging/scripts/postrm +19 -0
  517. data/packaging/scripts/prerm +10 -0
  518. data/packaging/wrapper.sh.template +38 -0
  519. data/rosett-ai.gemspec +63 -0
  520. data/rules/.gitkeep +0 -0
  521. data/scripts/publish/pulp_upload.sh +123 -0
  522. data/settings.json +29 -0
  523. data/share/applications/be.neatnerds.rosettai.desktop +29 -0
  524. data/share/dbus-1/interfaces/be.neatnerds.rosettai.xml +103 -0
  525. data/share/dbus-1/services/be.neatnerds.rosettai.service +3 -0
  526. data/share/templates/behaviour/criticalthinking.yml +69 -0
  527. metadata +810 -0
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: licensing_system
3
+ domain: licensing
4
+ version: 1.1.0
5
+ status: implemented
6
+ priority: 4
7
+ author: hugo
8
+ created_at: "2026-02-18"
9
+ modified_at: "2026-03-17"
10
+ modified_by: claude
11
+ depends_on:
12
+ - security
13
+ - architecture
14
+
15
+ intent: |
16
+ Implement a license key system that supports the open-core monetization model.
17
+ License keys unlock access to downloading premium content packs — they NEVER
18
+ restrict software functionality. The GPL-3.0 software is always fully
19
+ functional without a license key. Keys use Ed25519-signed JWTs that are
20
+ offline-verifiable with an embedded public key, ensuring users can validate
21
+ their license without internet access. Trust-first design means content
22
+ doesn't disappear on expiry — it stops updating.
23
+
24
+ constraints:
25
+ - License keys NEVER enable or disable software features (GPL-3.0 compliance)
26
+ - License keys ONLY control access to downloading premium content
27
+ - User without a license has full rosett-ai software functionality
28
+ - License keys are Ed25519-signed JWTs with offline verification
29
+ - Public verification key is embedded in source (safe — cannot forge, only verify)
30
+ - Private signing key is never in the codebase or on client machines
31
+ - License file stored at ~/.config/rosett-ai/license.key with 0600 permissions
32
+ - Premium content works offline indefinitely for perpetual tier licenses
33
+ - Subscription content works offline for 30-day grace period after last sync
34
+ - Content does NOT disappear on subscription expiry — it freezes at last version
35
+ - Expiry grace period is 14 days after subscription end before content freezes
36
+ - License validation must complete in under 100ms (offline check)
37
+
38
+ acceptance_criteria:
39
+ - bin/raictl license activate NNCC-... validates and stores license key
40
+ - bin/raictl license status shows current tier, expiry, and entitled features
41
+ - bin/raictl license deactivate removes license (reverts to community tier)
42
+ - Offline license validation works without internet
43
+ - Forged keys (wrong signature) are rejected with clear error message
44
+ - Expired subscription keys show warning but don't crash
45
+ - ~/.config/rosett-ai/license.key is created with 0600 permissions
46
+ - Property-based tests verify forged keys are always rejected
47
+ - Mutation score for licensing module is >= 95%
48
+
49
+ examples:
50
+ - scenario: "User activates a valid Supporter license key"
51
+ expected: |
52
+ Key decoded, signature verified against embedded public key.
53
+ Tier set to supporter. License stored at ~/.config/rosett-ai/license.key (0600).
54
+ 'License activated: Supporter tier. You have access to premium content packs.'
55
+ not: "Key stored without verification. Permissions set to 0644."
56
+ - scenario: "Someone forges a license key with a different private key"
57
+ expected: "Ed25519 signature verification fails. 'Invalid license key: signature verification failed.'"
58
+ not: "Key is accepted because the JWT structure looks valid."
59
+ - scenario: "Subscriber license expired 10 days ago"
60
+ expected: |
61
+ Warning: 'Subscription expired 10 days ago. Premium content available
62
+ for 4 more days. Renew to continue receiving updates.' Software works fully.
63
+ Previously downloaded content still accessible.
64
+ not: "Software crashes. Content deleted. Features disabled."
65
+ - scenario: "User runs rosett-ai on a machine with no internet and a valid perpetual license"
66
+ expected: "License validated offline against embedded public key. Full premium content access."
67
+ not: "Online check fails and license is rejected."
68
+
69
+ anti_patterns:
70
+ - Checking license key to enable/disable software features
71
+ - Storing private signing key in the codebase
72
+ - Deleting premium content when a license expires
73
+ - Requiring internet for perpetual license validation
74
+ - Storing license files with world-readable permissions
75
+ - Logging or displaying the full license key in output
76
+ - Using symmetric signing (HMAC) where the secret would need to be in the client
77
+
78
+ preferences:
79
+ language: ruby
80
+ gems:
81
+ - jwt
82
+ - ed25519
83
+ - faraday
84
+ patterns:
85
+ - offline_first_validation
86
+ - trust_first_expiry_design
87
+ - principle_of_least_privilege
88
+ testing: rspec with property-based tests for cryptographic validation
@@ -0,0 +1,208 @@
1
+ ---
2
+ name: lifecycle_management
3
+ domain: core
4
+ version: 1.1.0
5
+ status: implemented
6
+ priority: 1
7
+ author: hugo
8
+ created_at: "2026-02-19"
9
+ modified_at: "2026-03-17"
10
+ modified_by: claude
11
+ depends_on:
12
+ - security
13
+ - testing
14
+ - ci_pipeline
15
+
16
+ intent: |
17
+ Define repeatable, auditable processes for upgrading software components
18
+ (Ruby runtime, gems, system libraries, build tools) across the rai project.
19
+ Upgrades are security-critical operations — a missed CVE fix is a vulnerability,
20
+ a botched upgrade is downtime. This document captures the methodology, decision
21
+ criteria, and verification steps so that every upgrade follows the same rigorous
22
+ pattern regardless of who (or what AI) performs it.
23
+
24
+ Without lifecycle management:
25
+ - Version references drift across files (CLAUDE.md says one thing, .ruby-version another)
26
+ - Security patches are applied late or inconsistently
27
+ - Upgrades break things because verification was incomplete
28
+ - Knowledge about how to upgrade is tribal, not documented
29
+
30
+ With lifecycle management:
31
+ - Single source of truth for version pins
32
+ - CVE-driven upgrade triggers with clear escalation
33
+ - Repeatable verification checklist
34
+ - Auditable trail of what changed and why
35
+
36
+ constraints:
37
+ - Every upgrade must be triggered by a documented reason (CVE, EOL, dependency requirement, performance)
38
+ - Version references must be updated atomically — no partial updates where some files say old and others say new
39
+ - The full verification suite must pass before an upgrade is committed (security audit, linter, smell detector, tests)
40
+ - Upgrades must not skip intermediate verification steps even when the change appears trivial
41
+ - Breaking changes in a dependency must be researched against official documentation before upgrading
42
+ - Rollback path must be identified before starting (e.g. rbenv still has the old version installed)
43
+ - Pre-commit hooks must pass — never bypass hooks to land an upgrade faster
44
+ - Gem version constraints must use pessimistic operator (~>) to allow patch updates while preventing breaking changes
45
+ - The commit message must reference the specific CVEs or reasons that triggered the upgrade
46
+
47
+ acceptance_criteria:
48
+ - All version references across the codebase are consistent after an upgrade
49
+ - ruby-audit reports 0 vulnerabilities after a Ruby upgrade
50
+ - bundler-audit reports 0 vulnerabilities after a gem upgrade
51
+ - RuboCop, Reek, Flay, and Flog run without regressions (Flog deferred — covered by RuboCop Metrics cops)
52
+ - Full RSpec suite passes with 0 failures
53
+ - Commit message includes CVE identifiers or upgrade rationale
54
+ - No files contain stale version references (verified by grep)
55
+
56
+ examples:
57
+ - scenario: "ruby-audit flags 3 CVEs in Ruby 3.3.8 (resolv DoS, REXML DoS, URI credential leak)"
58
+ expected: |
59
+ 1. Research: check ruby-lang.org/en/downloads/releases/ for latest 3.3.x patch
60
+ 2. Research: verify rbenv has the target version (rbenv install --list | grep 3.3)
61
+ 3. Identify scope: grep codebase for all '3.3.8' references
62
+ 4. Install: rbenv install 3.3.10
63
+ 5. Pin: update .ruby-version to 3.3.10
64
+ 6. Reinstall: bundle install (full gem reinstall under new Ruby)
65
+ 7. Update refs: all files containing old version (CLAUDE.md, README.md, docs, specs)
66
+ 8. Verify: ruby-audit (0 vulns), rubocop (0 offenses), reek (0 warnings), rspec (0 failures)
67
+ 9. Commit: reference CVE-2025-24294, CVE-2025-58767, CVE-2025-61594 in message
68
+ not: |
69
+ Upgrade Ruby without checking all file references. Commit with failing ruby-audit.
70
+ Skip bundle install assuming old gems work. Use --no-verify to bypass hooks.
71
+
72
+ - scenario: "bundler-audit flags a CVE in a direct dependency"
73
+ expected: |
74
+ 1. Research: check RubyGems for latest patched version
75
+ 2. Verify: the new version is compatible with existing Gemfile constraints
76
+ 3. Update: Gemfile constraint if needed, run bundle update <gem>
77
+ 4. Verify: full suite passes (rubocop, reek, rspec, bundler-audit)
78
+ 5. Commit: reference CVE and gem name in commit message
79
+ not: |
80
+ Blindly run 'bundle update' without targeting the specific gem.
81
+ Ignore transitive dependency CVEs. Skip test suite.
82
+
83
+ - scenario: "A Ruby minor version reaches end-of-life"
84
+ expected: |
85
+ 1. Research: check endoflife.date/ruby and ruby-lang.org for EOL dates
86
+ 2. Plan: identify next supported minor version (e.g. 3.3 → 3.4)
87
+ 3. Research: read CHANGELOG for breaking changes between minor versions
88
+ 4. Test: install new version in parallel, run full suite
89
+ 5. Update: .ruby-version, gemspec required_ruby_version, all doc references
90
+ 6. Verify: all tools pass, no deprecation warnings in test output
91
+ 7. Commit: reference EOL policy in commit message
92
+ not: |
93
+ Stay on EOL version indefinitely. Jump multiple minor versions without
94
+ reading changelogs. Update .ruby-version without updating gemspec constraint.
95
+
96
+ - scenario: "A new pre-commit hook (e.g. RubyAudit) blocks commits due to existing issues"
97
+ expected: |
98
+ 1. Assess: determine if the issues are fixable before committing the hook
99
+ 2. If fixable: fix the issues first, then commit hook + fixes together
100
+ 3. If not immediately fixable: set hook to on_warn: warn (report, don't block),
101
+ commit with a plan to promote to on_warn: fail after the issues are resolved
102
+ not: |
103
+ Use --no-verify to bypass the new hook. Remove the hook because it's inconvenient.
104
+ Leave on_warn: warn permanently without a follow-up plan.
105
+
106
+ - scenario: "Upgrading flog or flay reveals new code quality findings"
107
+ expected: |
108
+ Review new findings. If they represent real improvements, fix them.
109
+ If the tool changed thresholds or scoring, update exclusions with justification.
110
+ Never suppress findings without documenting why.
111
+ not: |
112
+ Downgrade the tool to avoid new findings. Add blanket exclusions without review.
113
+
114
+ anti_patterns:
115
+ - Upgrading without checking official release notes or changelogs
116
+ - Partial version reference updates (some files updated, others forgotten)
117
+ - Running 'bundle update' without targeting specific gems (risks cascading breakage)
118
+ - Skipping the verification suite because "it's just a patch version"
119
+ - Bypassing pre-commit hooks with --no-verify to land an upgrade faster
120
+ - Upgrading production dependencies based on blog posts instead of official documentation
121
+ - Leaving stale version pins in documentation after an upgrade
122
+ - Mixing unrelated changes into an upgrade commit (keep upgrades atomic)
123
+ - Upgrading multiple unrelated components in a single commit (one concern per commit)
124
+ - Ignoring deprecation warnings in test output after an upgrade
125
+ - Assuming backwards compatibility without verification
126
+
127
+ preferences:
128
+ language: ruby
129
+ gems:
130
+ - ruby_audit
131
+ - bundler-audit
132
+ patterns:
133
+ - cve_driven_upgrades
134
+ - atomic_version_updates
135
+ - grep_before_commit
136
+ - full_suite_verification
137
+ testing: rspec with version-sensitive fixtures
138
+ # Research plan methodology — the repeatable process for any component upgrade.
139
+ # This was derived from the Ruby 3.3.8 → 3.3.10 upgrade (2026-02-19).
140
+ research_methodology:
141
+ trigger: |
142
+ An upgrade is triggered by one of: security audit finding (ruby-audit, bundler-audit),
143
+ end-of-life announcement, dependency requirement, or performance regression.
144
+ phases:
145
+ - name: discovery
146
+ description: Identify what needs upgrading and why
147
+ tasks:
148
+ - Run security audit tools (ruby-audit, bundler-audit) to identify CVEs
149
+ - Record each CVE identifier, severity, and affected component
150
+ - Determine the minimum version that resolves all identified CVEs
151
+ - name: research
152
+ description: Verify the target version exists and is suitable
153
+ tasks:
154
+ - Check official release page (e.g. ruby-lang.org/en/downloads/releases/)
155
+ - Check version manager availability (rbenv install --list | grep <version>)
156
+ - Read release notes for breaking changes or new deprecations
157
+ - Verify target version satisfies gemspec/dependency constraints
158
+ - name: scope
159
+ description: Map every file that references the current version
160
+ tasks:
161
+ - "grep -r '<current_version>' across the entire codebase"
162
+ - Categorize findings into config (.ruby-version), docs (CLAUDE.md, README), specs, build scripts
163
+ - Note any version-dependent logic in source code
164
+ - name: execute
165
+ description: Perform the upgrade
166
+ tasks:
167
+ - Install new version (rbenv install <version>)
168
+ - Update version pin (.ruby-version)
169
+ - Reinstall dependencies (bundle install)
170
+ - Update all version references identified in scope phase
171
+ - name: verify
172
+ description: Confirm nothing is broken
173
+ tasks:
174
+ - "Security: ruby-audit check → 0 vulnerabilities"
175
+ - "Security: bundler-audit check → 0 vulnerabilities"
176
+ - "Style: rubocop → 0 offenses"
177
+ - "Smells: reek lib/ → 0 warnings"
178
+ - "Duplication: flay lib/ → no regressions"
179
+ - "Complexity: flog lib/ → no regressions"
180
+ - "Tests: rspec → 0 failures"
181
+ - "Grep: no stale version references remain"
182
+ - name: commit
183
+ description: Create an auditable record
184
+ tasks:
185
+ - Stage only upgrade-related files (no unrelated changes)
186
+ - Write commit message referencing CVEs or upgrade rationale
187
+ - Let pre-commit hooks run (never --no-verify)
188
+ - Verify hooks pass (especially the newly relevant security hooks)
189
+ reference_execution:
190
+ date: "2026-02-19"
191
+ component: Ruby runtime
192
+ from_version: 3.3.8
193
+ to_version: 3.3.10
194
+ trigger: ruby-audit flagged CVE-2025-24294, CVE-2025-58767, CVE-2025-61594
195
+ files_updated:
196
+ - .ruby-version
197
+ - CLAUDE.md
198
+ - README.md
199
+ - doc/USAGE.md
200
+ - doc/PACKAGING.md
201
+ - spec/rosett_ai/thor/tasks/build_package_spec.rb
202
+ verification_results:
203
+ ruby_audit: 0 vulnerabilities
204
+ rubocop: 44 files, 0 offenses
205
+ reek: 0 warnings
206
+ flay: 199 total score (unchanged)
207
+ rspec: 277 examples, 0 failures
208
+ coverage: 92.92%
@@ -0,0 +1,207 @@
1
+ ---
2
+ name: mcp_integration
3
+ domain: core
4
+ version: 0.1.0
5
+ status: implemented
6
+ priority: 2
7
+ author: hugo
8
+ created_at: "2026-02-24"
9
+ modified_at: "2026-03-16"
10
+ modified_by: claude
11
+ depends_on:
12
+ - security
13
+ - architecture
14
+ - compiler
15
+ - engine_architecture
16
+ - error_handling
17
+ #
18
+ intent: |
19
+ Enable rosett-ai to participate in the Model Context Protocol (MCP) ecosystem as both
20
+ a provider and an administrator. This serves two purposes:
21
+
22
+ 1. **rosett-ai as MCP server**: Expose rosett-ai's validation, compilation, and configuration
23
+ management capabilities as MCP tools/resources/prompts, making them available to
24
+ any MCP-compatible AI agent (Claude Code, Goose, Cursor, Copilot, etc.).
25
+
26
+ 2. **MCP administration**: Provide structured management of multiple MCP server
27
+ configurations — discovery, validation, lifecycle management, and health monitoring.
28
+ This fills a gap in the AAIF ecosystem where no tool currently provides structured,
29
+ validated, auditable MCP server administration.
30
+
31
+ MCP is now an AAIF-governed standard (donated by Anthropic, Dec 2025) with 10,000+
32
+ published servers and 97M+ monthly SDK downloads. The Ruby SDK (mcp gem v0.7.1,
33
+ Apache-2.0) provides production-ready server and client implementations.
34
+
35
+ A key differentiator is compliance auditing: the CRA (Cyber Resilience Act),
36
+ NIS2, and DORA require demonstrable security practices. MCP admin tooling that
37
+ provides auditable configuration management and compliance reporting has genuine
38
+ enterprise value that no current AAIF project addresses.
39
+
40
+ For the OpenVox Puppet ecosystem specifically, building an MCP server from the
41
+ Ruby SDK is estimated at 6-10 weeks for an MVP. Puppet Enterprise already ships
42
+ native MCP (proprietary Infra Assistant), but OpenVox has no equivalent.
43
+
44
+ This design governs protocol participation and MCP server/admin implementation.
45
+ Trust-first server installation and configuration management is governed by
46
+ mcp_settings.yml. AAIF ecosystem strategic positioning is governed by
47
+ aaif_alignment.yml. Error handling for MCP commands follows error_handling.yml.
48
+ #
49
+ constraints:
50
+ - "Must use the official MCP Ruby SDK (mcp gem) — no custom protocol implementation"
51
+ - "MCP spec version support must be explicit — start with 2025-03-26, track newer revisions"
52
+ - "All MCP tools must validate input against JSON Schema before execution"
53
+ - "MCP server must run via stdio transport by default (subprocess model)"
54
+ - "Streamable HTTP transport is optional and must require explicit opt-in"
55
+ - "No MCP tool may perform destructive operations without user confirmation"
56
+ - "MCP tool annotations must accurately reflect behaviour (readOnlyHint, destructiveHint)"
57
+ - "Server-side secrets (API keys, tokens) must never be exposed via MCP resources"
58
+ - "MCP server must declare capabilities honestly — no overclaiming"
59
+ - "Array-form system() for any subprocess spawning within MCP tools"
60
+ - "YAML.safe_load only for any YAML processing within MCP tools"
61
+ - "MCP admin configurations must be validated against a schema before use"
62
+ - "MCP server health checks must timeout (max 5s) and never block the main process"
63
+ - "This design governs MCP protocol participation and server/admin implementation.
64
+ Trust-first configuration management is governed by mcp_settings.yml.
65
+ AAIF ecosystem positioning is governed by aaif_alignment.yml"
66
+ #
67
+ acceptance_criteria:
68
+ - "rosett-ai exposes at least 5 MCP tools (validate, compile, behaviour_list, design_list, config_status)"
69
+ - "rosett-ai exposes behaviours and design documents as MCP resources with proper URIs"
70
+ - "rosett-ai exposes at least 2 MCP prompts (validation workflow, compilation workflow)"
71
+ - "MCP server starts via `bin/raictl mcp serve` and communicates over stdio"
72
+ - "MCP server passes the MCP reference test suite (if available)"
73
+ - "MCP admin can list, validate, and report status of configured MCP servers"
74
+ - "MCP admin configurations are validated against conf/schemas/mcp_server_schema.json"
75
+ - "All MCP tools have accurate annotations (readOnlyHint, destructiveHint)"
76
+ - "Integration tests verify MCP protocol handshake and tool execution"
77
+ - "MCP server gracefully handles malformed JSON-RPC messages (no crash, proper error response)"
78
+ - "Documentation includes example Claude Code MCP configuration for Rosett-AI"
79
+ - "MCP admin supports at least stdio and streamable HTTP server types"
80
+ - "MCP admin provides compliance-relevant audit output (who configured what, when, validation status)"
81
+ - "CLI command `bin/raictl mcp list` shows all configured MCP servers with status"
82
+ - "CLI command `bin/raictl mcp validate` validates MCP server configurations against schema"
83
+ - "CLI command `bin/raictl mcp status` reports health of configured MCP servers"
84
+ - "Exit code 0 on success, 1 on MCP server errors, 2 on validation failures"
85
+ - "TTY-aware output: formatted table when interactive, JSON when piped"
86
+ #
87
+ examples:
88
+ - scenario: "User configures Claude Code to use rosett-ai as an MCP server"
89
+ expected: |
90
+ In ~/.claude/settings.json:
91
+ {
92
+ "mcpServers": {
93
+ "rosett-ai": {
94
+ "command": "bin/raictl",
95
+ "args": ["mcp", "serve"],
96
+ "env": {}
97
+ }
98
+ }
99
+ }
100
+ Claude Code discovers rosett-ai tools and can validate/compile behaviours.
101
+ not: "User must manually configure JSON-RPC endpoints or protocol details"
102
+ - scenario: "AI agent calls the rai validate tool via MCP"
103
+ expected: |
104
+ Tool call: { name: "rai_validate", arguments: { scope: "behaviour" } }
105
+ Response: structured validation results with file paths, errors, warnings.
106
+ Tool annotation: readOnlyHint=true, destructiveHint=false.
107
+ not: "Validation modifies any files or returns unstructured text"
108
+ - scenario: "AI agent calls the rai compile tool via MCP"
109
+ expected: |
110
+ Tool call: { name: "rai_compile", arguments: { simulate: true, verbose: true } }
111
+ Response: diff output showing what would change, no files written.
112
+ Tool annotation: readOnlyHint=true (simulate), destructiveHint=false.
113
+ When simulate=false: readOnlyHint=false, user confirmation required.
114
+ not: "Compilation runs without simulate flag and overwrites files without confirmation"
115
+ - scenario: "AI agent requests list of configured MCP servers from admin"
116
+ expected: |
117
+ Tool call: { name: "rosett_ai_mcp_list", arguments: {} }
118
+ Response: JSON array of configured servers with name, type, status, transport.
119
+ not: "Returns internal config file paths or credentials"
120
+ - scenario: "MCP server receives malformed JSON-RPC request"
121
+ expected: "Returns JSON-RPC error response with code -32700 (Parse error). Server continues running."
122
+ not: "Server crashes or hangs"
123
+ - scenario: "MCP admin validates a server configuration"
124
+ expected: |
125
+ Checks: schema validity, transport reachability (with 5s timeout), capability negotiation.
126
+ Returns structured report per server.
127
+ not: "Hangs indefinitely on unreachable server or skips schema validation"
128
+ - scenario: "Enterprise needs CRA compliance audit of MCP server configurations"
129
+ expected: |
130
+ $ bin/raictl mcp audit --format json
131
+ Returns: per-server audit report with configuration provenance (who, when, what),
132
+ validation status, transport security assessment, tool permission summary.
133
+ Suitable for inclusion in CRA technical documentation.
134
+ not: "No audit trail, no provenance tracking, manual documentation required"
135
+ - scenario: "User manages MCP servers for multiple AI agents (Claude Code, Goose, Cursor)"
136
+ expected: |
137
+ $ bin/raictl mcp list
138
+ NAME TRANSPORT AGENT STATUS
139
+ puppet-mcp stdio claude,goose healthy
140
+ terraform-mcp http claude healthy
141
+ db-query stdio goose unreachable
142
+ Each server's configuration is validated, health-checked, and reported per-agent.
143
+ not: "Each AI agent's MCP config must be managed independently with no cross-visibility"
144
+ #
145
+ anti_patterns:
146
+ - "Implementing custom JSON-RPC handling instead of using the mcp gem"
147
+ - "Exposing file system paths outside whitelisted directories as MCP resources"
148
+ - "Making MCP tools that perform side effects without accurate annotations"
149
+ - "Running MCP server over HTTP without explicit user opt-in"
150
+ - "Storing MCP server credentials in plaintext configuration files"
151
+ - "Spawning MCP admin health checks without timeouts"
152
+ - "Coupling MCP tool implementation to Claude Code specific features"
153
+ - "Using MCP sampling (server-initiated LLM calls) without explicit user consent"
154
+ - "Mixing MCP server logic with core rosett-ai library code (keep separate module)"
155
+ #
156
+ gui_notes: |
157
+ Document interactions (cross-references):
158
+
159
+ 1. mcp_settings.yml: mcp_integration governs protocol participation and
160
+ server/admin implementation. mcp_settings governs trust-first configuration
161
+ management and server installation policies.
162
+
163
+ 2. aaif_alignment.yml: AAIF governs ecosystem strategic positioning.
164
+ MCP integration handles the technical protocol implementation.
165
+
166
+ 3. engine_architecture.yml: MCP server exposes engine capabilities. Engine
167
+ manifests declare which MCP tools each engine can provide.
168
+
169
+ 4. security.yml: all MCP tool handlers follow security constraints —
170
+ YAML.safe_load, array-form system(), no secret exposure.
171
+
172
+ 5. comply.yml: MCP admin audit output supports CRA/NIS2 compliance
173
+ documentation requirements.
174
+
175
+ 6. error_handling.yml: MCP command errors follow the structured error
176
+ hierarchy with exit codes and localised messages.
177
+
178
+ 7. compiler.yml: MCP server can trigger compilation via tool call,
179
+ respecting simulate/verbose flags.
180
+
181
+ MCP module structure:
182
+
183
+ lib/rosett_ai/mcp/
184
+ server.rb — MCP server entry point (stdio transport)
185
+ tools/ — Tool implementations (validate, compile, etc.)
186
+ resources/ — Resource providers (behaviours, design docs)
187
+ prompts/ — Prompt templates (validation, compilation)
188
+ admin/
189
+ registry.rb — Configured server registry
190
+ health_checker.rb — Health check with 5s timeout
191
+ auditor.rb — CRA compliance audit reporter
192
+ schema_validator.rb — Server config validation
193
+ #
194
+ preferences:
195
+ language: ruby
196
+ patterns:
197
+ - "Service object pattern for MCP tool implementations"
198
+ - "Command pattern for MCP admin operations"
199
+ - "Adapter pattern for transport abstraction (stdio, HTTP)"
200
+ - "Registry pattern for configured server management"
201
+ testing: rspec with MCP protocol handshake tests, tool execution
202
+ scenarios, malformed input handling, health check timeout verification,
203
+ and audit output format validation
204
+ gems:
205
+ - mcp
206
+ - json_schemer
207
+ - thor
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: mcp_settings
3
+ domain: core
4
+ version: 0.1.0
5
+ status: implemented
6
+ priority: 2
7
+ author: hugo
8
+ created_at: "2026-03-15"
9
+ modified_at: "2026-03-16"
10
+ modified_by: claude
11
+ depends_on:
12
+ - mcp_integration
13
+ - security
14
+ - claude_code_configuration
15
+ - error_handling
16
+ #
17
+ intent: |
18
+ Manage MCP (Model Context Protocol) server configuration with a trust-first
19
+ model that prevents untrusted servers from being silently added to a
20
+ developer's configuration. Restrict MCP server installation to explicitly
21
+ trusted sources (rosett-ai Enterprise Manager Server, configured trusted domains,
22
+ the Goose project) and provide centralised management for teams using rosett-ai
23
+ Enterprise Manager.
24
+
25
+ This design governs MCP server trust, installation, and configuration
26
+ lifecycle. The MCP protocol implementation (server, tools, resources, admin)
27
+ is governed by mcp_integration.yml. Engine-specific MCP compilation is
28
+ governed by engine_architecture.yml. Error handling for MCP settings
29
+ commands follows error_handling.yml.
30
+ #
31
+ constraints:
32
+ - "MCP servers must come from a trusted source before installation"
33
+ - "Trust sources are: rosett-ai Enterprise Manager Server, user-configured
34
+ trusted domains, Goose project registry"
35
+ - "MCP server configs are stored in XDG-compliant paths (~/.config/rosett-ai/mcp/)"
36
+ - "Enterprise Manager can push MCP configurations to managed installations"
37
+ - "All MCP server URIs must use HTTPS — no plaintext HTTP"
38
+ - "MCP server removal must be explicit — never garbage-collected"
39
+ - "Configuration must be engine-agnostic — compiled to engine-native format
40
+ by the compiler"
41
+ - "YAML.safe_load only for all MCP configuration parsing"
42
+ - "Array-form system() for any subprocess spawning during server validation"
43
+ - "This design governs MCP server trust and configuration lifecycle.
44
+ Protocol implementation is governed by mcp_integration.yml.
45
+ Engine-specific compilation is governed by engine_architecture.yml"
46
+ #
47
+ acceptance_criteria:
48
+ - "`rai mcp list` shows all configured MCP servers with trust source"
49
+ - "`rai mcp add URI` installs a server from a trusted source"
50
+ - "`rai mcp add URI` from an untrusted source is rejected with explanation"
51
+ - "`rai mcp remove NAME` removes a configured server"
52
+ - "`rai mcp trust-sources` lists configured trust sources"
53
+ - "Enterprise Manager can remotely provision MCP server configs"
54
+ - "Compile step translates generic MCP config to engine-specific format"
55
+ - "Exit code 0 on success, 1 on trust rejection, 2 on validation failure"
56
+ - "TTY-aware output: formatted table when interactive, JSON when piped"
57
+ #
58
+ examples:
59
+ - scenario: "Developer adds an MCP server from a trusted company domain"
60
+ expected: "Server is installed, validated, and appears in `rai mcp list`"
61
+ not: "Server installed without trust validation"
62
+ - scenario: "Enterprise Manager pushes a new MCP server to all team members"
63
+ expected: "Server appears in managed section, cannot be removed by user"
64
+ not: "User can override or delete enterprise-managed servers"
65
+ - scenario: "Developer tries to add an MCP server from unknown domain"
66
+ expected: |
67
+ Clear rejection message explaining trusted sources and how to add trust.
68
+ Exit code 1 (trust rejection). Suggests `rai mcp trust-sources add DOMAIN`.
69
+ not: "Silent failure or generic error message"
70
+ - scenario: "User lists MCP servers in a CI pipeline"
71
+ expected: |
72
+ $ bin/raictl mcp list --format json | ruby -rjson -e 'puts JSON.parse(STDIN.read).length'
73
+ 3
74
+ Machine-readable JSON output when piped.
75
+ not: "Human-readable table with ANSI codes breaks CI parsing"
76
+ #
77
+ anti_patterns:
78
+ - "Allowing arbitrary MCP server installation without trust verification"
79
+ - "Storing MCP credentials in plaintext configuration files"
80
+ - "Engine-specific MCP config in the generic layer"
81
+ - "Auto-discovering MCP servers from network scanning"
82
+ - "Bypassing trust validation for localhost servers without explicit opt-in"
83
+ #
84
+ gui_notes: |
85
+ Document interactions (cross-references):
86
+
87
+ 1. mcp_integration.yml: mcp_settings governs trust and configuration
88
+ lifecycle. mcp_integration governs protocol implementation (server,
89
+ tools, resources, admin).
90
+
91
+ 2. security.yml: trust-first model enforces supply-chain security.
92
+ All URI validation and credential handling follow security constraints.
93
+
94
+ 3. claude_code_configuration.yml: MCP server entries are compiled into
95
+ Claude Code's settings.json mcpServers section.
96
+
97
+ 4. engine_architecture.yml: engine manifests declare MCP compilation
98
+ format. The generic MCP config is compiled per-engine.
99
+
100
+ 5. error_handling.yml: trust rejection and validation failure messages
101
+ follow the structured error hierarchy with exit codes.
102
+
103
+ 6. comply.yml: MCP server audit trail supports CRA compliance reporting.
104
+
105
+ MCP trust chain:
106
+
107
+ 1. User configures trust sources in ~/.config/rosett-ai/mcp/trust.yml
108
+ 2. `rai mcp add URI` validates URI against trust sources
109
+ 3. If trusted: download, validate schema, store in ~/.config/rosett-ai/mcp/servers/
110
+ 4. If untrusted: reject with explanation and suggestion to add trust
111
+ 5. Enterprise Manager can push configs bypassing user trust (managed scope)
112
+ 6. `rai compile` translates generic MCP config to engine-native format
113
+ #
114
+ preferences:
115
+ language: ruby
116
+ patterns:
117
+ - "Trust chain validation before installation"
118
+ - "XDG Base Directory Specification for config paths"
119
+ - "Declarative YAML for MCP server definitions"
120
+ - "Scope separation (managed vs user-configured)"
121
+ testing: rspec with trust source validation scenarios, untrusted
122
+ rejection tests, Enterprise Manager push simulation, engine-specific
123
+ compilation output verification, and TTY-aware output format tests
124
+ gems:
125
+ - json_schemer
126
+ - thor