@jaguilar87/gaia 5.0.0-rc.2

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 (621) hide show
  1. package/.claude-plugin/marketplace.json +33 -0
  2. package/.claude-plugin/plugin.json +26 -0
  3. package/ARCHITECTURE.md +335 -0
  4. package/CHANGELOG.md +1298 -0
  5. package/CODE_OF_CONDUCT.md +11 -0
  6. package/CONTRIBUTING.md +146 -0
  7. package/INSTALL.md +436 -0
  8. package/LICENSE +21 -0
  9. package/README.md +222 -0
  10. package/SECURITY.md +47 -0
  11. package/agents/README.md +78 -0
  12. package/agents/cloud-troubleshooter.md +73 -0
  13. package/agents/developer.md +65 -0
  14. package/agents/gaia-operator.md +64 -0
  15. package/agents/gaia-orchestrator.md +111 -0
  16. package/agents/gaia-planner.md +53 -0
  17. package/agents/gaia-system.md +71 -0
  18. package/agents/gitops-operator.md +61 -0
  19. package/agents/terraform-architect.md +63 -0
  20. package/bin/README.md +106 -0
  21. package/bin/cli/__init__.py +1 -0
  22. package/bin/cli/approvals.py +740 -0
  23. package/bin/cli/cleanup.py +562 -0
  24. package/bin/cli/context.py +283 -0
  25. package/bin/cli/doctor.py +651 -0
  26. package/bin/cli/history.py +305 -0
  27. package/bin/cli/memory.py +483 -0
  28. package/bin/cli/metrics.py +1068 -0
  29. package/bin/cli/plans.py +515 -0
  30. package/bin/cli/status.py +302 -0
  31. package/bin/cli/update.py +382 -0
  32. package/bin/gaia +112 -0
  33. package/bin/gaia-cleanup.js +531 -0
  34. package/bin/gaia-doctor.js +635 -0
  35. package/bin/gaia-evidence +126 -0
  36. package/bin/gaia-history.js +251 -0
  37. package/bin/gaia-metrics.js +1278 -0
  38. package/bin/gaia-review.js +269 -0
  39. package/bin/gaia-scan +44 -0
  40. package/bin/gaia-scan.py +589 -0
  41. package/bin/gaia-skills-diagnose.js +929 -0
  42. package/bin/gaia-status.js +278 -0
  43. package/bin/gaia-uninstall.js +111 -0
  44. package/bin/gaia-update.js +919 -0
  45. package/bin/pre-publish-validate.js +610 -0
  46. package/bin/python-detect.js +60 -0
  47. package/bin/validate-sandbox.sh +601 -0
  48. package/commands/README.md +64 -0
  49. package/commands/gaia.md +37 -0
  50. package/commands/scan-project.md +67 -0
  51. package/config/README.md +71 -0
  52. package/config/cloud/aws.json +134 -0
  53. package/config/cloud/gcp.json +139 -0
  54. package/config/context-contracts.json +158 -0
  55. package/config/crons-schema.md +81 -0
  56. package/config/git_standards.json +72 -0
  57. package/config/surface-routing.json +417 -0
  58. package/config/universal-rules.json +102 -0
  59. package/dist/gaia-ops/.claude-plugin/plugin.json +24 -0
  60. package/dist/gaia-ops/README.md +80 -0
  61. package/dist/gaia-ops/agents/cloud-troubleshooter.md +73 -0
  62. package/dist/gaia-ops/agents/developer.md +65 -0
  63. package/dist/gaia-ops/agents/gaia-operator.md +64 -0
  64. package/dist/gaia-ops/agents/gaia-orchestrator.md +111 -0
  65. package/dist/gaia-ops/agents/gaia-planner.md +53 -0
  66. package/dist/gaia-ops/agents/gaia-system.md +71 -0
  67. package/dist/gaia-ops/agents/gitops-operator.md +61 -0
  68. package/dist/gaia-ops/agents/terraform-architect.md +63 -0
  69. package/dist/gaia-ops/commands/gaia.md +37 -0
  70. package/dist/gaia-ops/config/README.md +71 -0
  71. package/dist/gaia-ops/config/cloud/aws.json +134 -0
  72. package/dist/gaia-ops/config/cloud/gcp.json +139 -0
  73. package/dist/gaia-ops/config/context-contracts.json +158 -0
  74. package/dist/gaia-ops/config/crons-schema.md +81 -0
  75. package/dist/gaia-ops/config/git_standards.json +72 -0
  76. package/dist/gaia-ops/config/surface-routing.json +417 -0
  77. package/dist/gaia-ops/config/universal-rules.json +102 -0
  78. package/dist/gaia-ops/hooks/adapters/__init__.py +52 -0
  79. package/dist/gaia-ops/hooks/adapters/base.py +219 -0
  80. package/dist/gaia-ops/hooks/adapters/channel.py +17 -0
  81. package/dist/gaia-ops/hooks/adapters/claude_code.py +1890 -0
  82. package/dist/gaia-ops/hooks/adapters/types.py +194 -0
  83. package/dist/gaia-ops/hooks/adapters/utils.py +25 -0
  84. package/dist/gaia-ops/hooks/hooks.json +192 -0
  85. package/dist/gaia-ops/hooks/modules/__init__.py +15 -0
  86. package/dist/gaia-ops/hooks/modules/agents/__init__.py +29 -0
  87. package/dist/gaia-ops/hooks/modules/agents/contract_validator.py +647 -0
  88. package/dist/gaia-ops/hooks/modules/agents/response_contract.py +496 -0
  89. package/dist/gaia-ops/hooks/modules/agents/skill_injection_verifier.py +120 -0
  90. package/dist/gaia-ops/hooks/modules/agents/state_tracker.py +267 -0
  91. package/dist/gaia-ops/hooks/modules/agents/task_info_builder.py +74 -0
  92. package/dist/gaia-ops/hooks/modules/agents/transcript_analyzer.py +458 -0
  93. package/dist/gaia-ops/hooks/modules/agents/transcript_reader.py +152 -0
  94. package/dist/gaia-ops/hooks/modules/audit/__init__.py +28 -0
  95. package/dist/gaia-ops/hooks/modules/audit/event_detector.py +168 -0
  96. package/dist/gaia-ops/hooks/modules/audit/logger.py +131 -0
  97. package/dist/gaia-ops/hooks/modules/audit/metrics.py +134 -0
  98. package/dist/gaia-ops/hooks/modules/audit/workflow_auditor.py +611 -0
  99. package/dist/gaia-ops/hooks/modules/audit/workflow_recorder.py +296 -0
  100. package/dist/gaia-ops/hooks/modules/context/__init__.py +11 -0
  101. package/dist/gaia-ops/hooks/modules/context/agentic_loop_detector.py +165 -0
  102. package/dist/gaia-ops/hooks/modules/context/anchor_tracker.py +317 -0
  103. package/dist/gaia-ops/hooks/modules/context/compact_context_builder.py +218 -0
  104. package/dist/gaia-ops/hooks/modules/context/context_freshness.py +145 -0
  105. package/dist/gaia-ops/hooks/modules/context/context_injector.py +558 -0
  106. package/dist/gaia-ops/hooks/modules/context/context_writer.py +530 -0
  107. package/dist/gaia-ops/hooks/modules/context/contracts_loader.py +161 -0
  108. package/dist/gaia-ops/hooks/modules/core/__init__.py +40 -0
  109. package/dist/gaia-ops/hooks/modules/core/hook_entry.py +78 -0
  110. package/dist/gaia-ops/hooks/modules/core/paths.py +160 -0
  111. package/dist/gaia-ops/hooks/modules/core/plugin_mode.py +149 -0
  112. package/dist/gaia-ops/hooks/modules/core/plugin_setup.py +577 -0
  113. package/dist/gaia-ops/hooks/modules/core/state.py +179 -0
  114. package/dist/gaia-ops/hooks/modules/core/stdin.py +24 -0
  115. package/dist/gaia-ops/hooks/modules/events/__init__.py +1 -0
  116. package/dist/gaia-ops/hooks/modules/events/event_writer.py +210 -0
  117. package/dist/gaia-ops/hooks/modules/memory/__init__.py +8 -0
  118. package/dist/gaia-ops/hooks/modules/memory/episode_writer.py +216 -0
  119. package/dist/gaia-ops/hooks/modules/orchestrator/__init__.py +1 -0
  120. package/dist/gaia-ops/hooks/modules/orchestrator/delegate_mode.py +122 -0
  121. package/dist/gaia-ops/hooks/modules/scanning/__init__.py +8 -0
  122. package/dist/gaia-ops/hooks/modules/scanning/scan_trigger.py +84 -0
  123. package/dist/gaia-ops/hooks/modules/security/__init__.py +120 -0
  124. package/dist/gaia-ops/hooks/modules/security/approval_cleanup.py +87 -0
  125. package/dist/gaia-ops/hooks/modules/security/approval_constants.py +23 -0
  126. package/dist/gaia-ops/hooks/modules/security/approval_grants.py +1638 -0
  127. package/dist/gaia-ops/hooks/modules/security/approval_messages.py +71 -0
  128. package/dist/gaia-ops/hooks/modules/security/approval_scopes.py +222 -0
  129. package/dist/gaia-ops/hooks/modules/security/blocked_commands.py +595 -0
  130. package/dist/gaia-ops/hooks/modules/security/blocked_message_formatter.py +87 -0
  131. package/dist/gaia-ops/hooks/modules/security/command_semantics.py +181 -0
  132. package/dist/gaia-ops/hooks/modules/security/composition_rules.py +547 -0
  133. package/dist/gaia-ops/hooks/modules/security/flag_classifiers.py +873 -0
  134. package/dist/gaia-ops/hooks/modules/security/gitops_validator.py +179 -0
  135. package/dist/gaia-ops/hooks/modules/security/mutative_verbs.py +1131 -0
  136. package/dist/gaia-ops/hooks/modules/security/network_hosts.py +481 -0
  137. package/dist/gaia-ops/hooks/modules/security/prompt_validator.py +40 -0
  138. package/dist/gaia-ops/hooks/modules/security/shell_unwrapper.py +165 -0
  139. package/dist/gaia-ops/hooks/modules/security/tiers.py +196 -0
  140. package/dist/gaia-ops/hooks/modules/session/__init__.py +10 -0
  141. package/dist/gaia-ops/hooks/modules/session/pending_scanner.py +174 -0
  142. package/dist/gaia-ops/hooks/modules/session/session_context_writer.py +100 -0
  143. package/dist/gaia-ops/hooks/modules/session/session_event_injector.py +160 -0
  144. package/dist/gaia-ops/hooks/modules/session/session_manager.py +31 -0
  145. package/dist/gaia-ops/hooks/modules/session/session_registry.py +333 -0
  146. package/dist/gaia-ops/hooks/modules/tools/__init__.py +29 -0
  147. package/dist/gaia-ops/hooks/modules/tools/bash_validator.py +1008 -0
  148. package/dist/gaia-ops/hooks/modules/tools/cloud_pipe_validator.py +231 -0
  149. package/dist/gaia-ops/hooks/modules/tools/hook_response.py +55 -0
  150. package/dist/gaia-ops/hooks/modules/tools/shell_parser.py +227 -0
  151. package/dist/gaia-ops/hooks/modules/tools/stage_decomposer.py +315 -0
  152. package/dist/gaia-ops/hooks/modules/tools/task_validator.py +294 -0
  153. package/dist/gaia-ops/hooks/modules/validation/__init__.py +23 -0
  154. package/dist/gaia-ops/hooks/modules/validation/commit_validator.py +380 -0
  155. package/dist/gaia-ops/hooks/post_compact.py +43 -0
  156. package/dist/gaia-ops/hooks/post_tool_use.py +54 -0
  157. package/dist/gaia-ops/hooks/pre_compact.py +60 -0
  158. package/dist/gaia-ops/hooks/pre_tool_use.py +413 -0
  159. package/dist/gaia-ops/hooks/session_end_hook.py +77 -0
  160. package/dist/gaia-ops/hooks/session_start.py +81 -0
  161. package/dist/gaia-ops/hooks/stop_hook.py +70 -0
  162. package/dist/gaia-ops/hooks/subagent_start.py +71 -0
  163. package/dist/gaia-ops/hooks/subagent_stop.py +295 -0
  164. package/dist/gaia-ops/hooks/task_completed.py +70 -0
  165. package/dist/gaia-ops/hooks/user_prompt_submit.py +246 -0
  166. package/dist/gaia-ops/settings.json +72 -0
  167. package/dist/gaia-ops/skills/README.md +158 -0
  168. package/dist/gaia-ops/skills/agent-creation/SKILL.md +87 -0
  169. package/dist/gaia-ops/skills/agent-creation/examples.md +170 -0
  170. package/dist/gaia-ops/skills/agent-creation/reference.md +191 -0
  171. package/dist/gaia-ops/skills/agent-protocol/SKILL.md +93 -0
  172. package/dist/gaia-ops/skills/agent-protocol/examples.md +223 -0
  173. package/dist/gaia-ops/skills/agent-response/SKILL.md +69 -0
  174. package/dist/gaia-ops/skills/agentic-loop/SKILL.md +80 -0
  175. package/dist/gaia-ops/skills/agentic-loop/reference.md +378 -0
  176. package/dist/gaia-ops/skills/blog-writing/SKILL.md +98 -0
  177. package/dist/gaia-ops/skills/blog-writing/reference.md +130 -0
  178. package/dist/gaia-ops/skills/brief-spec/SKILL.md +185 -0
  179. package/dist/gaia-ops/skills/command-execution/SKILL.md +64 -0
  180. package/dist/gaia-ops/skills/command-execution/reference.md +83 -0
  181. package/dist/gaia-ops/skills/context-updater/SKILL.md +87 -0
  182. package/dist/gaia-ops/skills/context-updater/examples.md +71 -0
  183. package/dist/gaia-ops/skills/developer-patterns/SKILL.md +50 -0
  184. package/dist/gaia-ops/skills/developer-patterns/reference.md +112 -0
  185. package/dist/gaia-ops/skills/execution/SKILL.md +99 -0
  186. package/dist/gaia-ops/skills/fast-queries/SKILL.md +43 -0
  187. package/dist/gaia-ops/skills/gaia-compact/SKILL.md +74 -0
  188. package/dist/gaia-ops/skills/gaia-patterns/SKILL.md +108 -0
  189. package/dist/gaia-ops/skills/gaia-patterns/reference.md +395 -0
  190. package/dist/gaia-ops/skills/gaia-planner/SKILL.md +37 -0
  191. package/dist/gaia-ops/skills/gaia-planner/reference.md +107 -0
  192. package/dist/gaia-ops/skills/gaia-release/SKILL.md +85 -0
  193. package/dist/gaia-ops/skills/gaia-release/reference.md +92 -0
  194. package/dist/gaia-ops/skills/gaia-self-check/SKILL.md +114 -0
  195. package/dist/gaia-ops/skills/gaia-self-check/reference.md +453 -0
  196. package/dist/gaia-ops/skills/gaia-verify/SKILL.md +77 -0
  197. package/dist/gaia-ops/skills/gaia-verify/reference.md +80 -0
  198. package/dist/gaia-ops/skills/git-conventions/SKILL.md +47 -0
  199. package/dist/gaia-ops/skills/gitops-patterns/SKILL.md +60 -0
  200. package/dist/gaia-ops/skills/gitops-patterns/reference.md +183 -0
  201. package/dist/gaia-ops/skills/gmail-policy/SKILL.md +200 -0
  202. package/dist/gaia-ops/skills/gmail-policy/reference.md +150 -0
  203. package/dist/gaia-ops/skills/gmail-triage/SKILL.md +100 -0
  204. package/dist/gaia-ops/skills/gws-setup/SKILL.md +99 -0
  205. package/dist/gaia-ops/skills/gws-setup/reference.md +73 -0
  206. package/dist/gaia-ops/skills/investigation/SKILL.md +100 -0
  207. package/dist/gaia-ops/skills/memory-curation/SKILL.md +83 -0
  208. package/dist/gaia-ops/skills/memory-search/SKILL.md +88 -0
  209. package/dist/gaia-ops/skills/orchestrator-approval/SKILL.md +160 -0
  210. package/dist/gaia-ops/skills/orchestrator-approval/reference.md +174 -0
  211. package/dist/gaia-ops/skills/pending-approvals/SKILL.md +72 -0
  212. package/dist/gaia-ops/skills/pending-approvals/reference.md +214 -0
  213. package/dist/gaia-ops/skills/readme-writing/SKILL.md +71 -0
  214. package/dist/gaia-ops/skills/readme-writing/reference.md +188 -0
  215. package/dist/gaia-ops/skills/reference.md +135 -0
  216. package/dist/gaia-ops/skills/request-approval/SKILL.md +140 -0
  217. package/dist/gaia-ops/skills/request-approval/examples.md +140 -0
  218. package/dist/gaia-ops/skills/request-approval/reference.md +57 -0
  219. package/dist/gaia-ops/skills/schedule-task/SKILL.md +64 -0
  220. package/dist/gaia-ops/skills/schedule-task/reference.md +233 -0
  221. package/dist/gaia-ops/skills/security-tiers/SKILL.md +141 -0
  222. package/dist/gaia-ops/skills/security-tiers/destructive-commands-reference.md +623 -0
  223. package/dist/gaia-ops/skills/security-tiers/reference.md +39 -0
  224. package/dist/gaia-ops/skills/session-reflection/SKILL.md +69 -0
  225. package/dist/gaia-ops/skills/skill-creation/SKILL.md +92 -0
  226. package/dist/gaia-ops/skills/skill-creation/reference.md +29 -0
  227. package/dist/gaia-ops/skills/terraform-patterns/SKILL.md +89 -0
  228. package/dist/gaia-ops/skills/terraform-patterns/reference.md +93 -0
  229. package/dist/gaia-ops/tools/__init__.py +9 -0
  230. package/dist/gaia-ops/tools/agentic-loop/decide-status.py +210 -0
  231. package/dist/gaia-ops/tools/agentic-loop/parse-metric.py +106 -0
  232. package/dist/gaia-ops/tools/agentic-loop/record-iteration.py +221 -0
  233. package/dist/gaia-ops/tools/context/README.md +132 -0
  234. package/dist/gaia-ops/tools/context/__init__.py +42 -0
  235. package/dist/gaia-ops/tools/context/_paths.py +20 -0
  236. package/dist/gaia-ops/tools/context/context_provider.py +721 -0
  237. package/dist/gaia-ops/tools/context/context_section_reader.py +342 -0
  238. package/dist/gaia-ops/tools/context/deep_merge.py +159 -0
  239. package/dist/gaia-ops/tools/context/pending_updates.py +760 -0
  240. package/dist/gaia-ops/tools/context/surface_router.py +278 -0
  241. package/dist/gaia-ops/tools/fast-queries/README.md +65 -0
  242. package/dist/gaia-ops/tools/fast-queries/__init__.py +30 -0
  243. package/dist/gaia-ops/tools/fast-queries/appservices/quicktriage_devops_developer.sh +75 -0
  244. package/dist/gaia-ops/tools/fast-queries/cloud/aws/quicktriage_aws_troubleshooter.sh +32 -0
  245. package/dist/gaia-ops/tools/fast-queries/cloud/gcp/quicktriage_gcp_troubleshooter.sh +88 -0
  246. package/dist/gaia-ops/tools/fast-queries/gitops/quicktriage_gitops_operator.sh +48 -0
  247. package/dist/gaia-ops/tools/fast-queries/run_triage.sh +59 -0
  248. package/dist/gaia-ops/tools/fast-queries/terraform/quicktriage_terraform_architect.sh +80 -0
  249. package/dist/gaia-ops/tools/gaia_simulator/__init__.py +33 -0
  250. package/dist/gaia-ops/tools/gaia_simulator/cli.py +354 -0
  251. package/dist/gaia-ops/tools/gaia_simulator/extractor.py +457 -0
  252. package/dist/gaia-ops/tools/gaia_simulator/reporter.py +258 -0
  253. package/dist/gaia-ops/tools/gaia_simulator/routing_simulator.py +334 -0
  254. package/dist/gaia-ops/tools/gaia_simulator/runner.py +539 -0
  255. package/dist/gaia-ops/tools/gaia_simulator/skills_mapper.py +264 -0
  256. package/dist/gaia-ops/tools/memory/README.md +0 -0
  257. package/dist/gaia-ops/tools/memory/__init__.py +20 -0
  258. package/dist/gaia-ops/tools/memory/backfill_fts5.py +107 -0
  259. package/dist/gaia-ops/tools/memory/conflict_detector.py +295 -0
  260. package/dist/gaia-ops/tools/memory/episodic.py +1210 -0
  261. package/dist/gaia-ops/tools/memory/git_invalidator.py +262 -0
  262. package/dist/gaia-ops/tools/memory/paths.py +102 -0
  263. package/dist/gaia-ops/tools/memory/scoring.py +193 -0
  264. package/dist/gaia-ops/tools/memory/search_store.py +375 -0
  265. package/dist/gaia-ops/tools/persist_transcript_analysis.py +85 -0
  266. package/dist/gaia-ops/tools/review/__init__.py +1 -0
  267. package/dist/gaia-ops/tools/review/review_engine.py +157 -0
  268. package/dist/gaia-ops/tools/scan/__init__.py +35 -0
  269. package/dist/gaia-ops/tools/scan/config.py +247 -0
  270. package/dist/gaia-ops/tools/scan/merge.py +212 -0
  271. package/dist/gaia-ops/tools/scan/orchestrator.py +549 -0
  272. package/dist/gaia-ops/tools/scan/registry.py +127 -0
  273. package/dist/gaia-ops/tools/scan/scanners/__init__.py +18 -0
  274. package/dist/gaia-ops/tools/scan/scanners/base.py +137 -0
  275. package/dist/gaia-ops/tools/scan/scanners/environment.py +349 -0
  276. package/dist/gaia-ops/tools/scan/scanners/git.py +570 -0
  277. package/dist/gaia-ops/tools/scan/scanners/infrastructure.py +875 -0
  278. package/dist/gaia-ops/tools/scan/scanners/orchestration.py +600 -0
  279. package/dist/gaia-ops/tools/scan/scanners/stack.py +1085 -0
  280. package/dist/gaia-ops/tools/scan/scanners/tools.py +260 -0
  281. package/dist/gaia-ops/tools/scan/setup.py +686 -0
  282. package/dist/gaia-ops/tools/scan/tests/__init__.py +1 -0
  283. package/dist/gaia-ops/tools/scan/tests/conftest.py +796 -0
  284. package/dist/gaia-ops/tools/scan/tests/test_environment.py +323 -0
  285. package/dist/gaia-ops/tools/scan/tests/test_git.py +419 -0
  286. package/dist/gaia-ops/tools/scan/tests/test_infrastructure.py +382 -0
  287. package/dist/gaia-ops/tools/scan/tests/test_integration.py +920 -0
  288. package/dist/gaia-ops/tools/scan/tests/test_merge.py +269 -0
  289. package/dist/gaia-ops/tools/scan/tests/test_orchestration.py +304 -0
  290. package/dist/gaia-ops/tools/scan/tests/test_stack.py +604 -0
  291. package/dist/gaia-ops/tools/scan/tests/test_tools.py +349 -0
  292. package/dist/gaia-ops/tools/scan/ui.py +624 -0
  293. package/dist/gaia-ops/tools/scan/verify.py +270 -0
  294. package/dist/gaia-ops/tools/scan/walk.py +118 -0
  295. package/dist/gaia-ops/tools/scan/workspace.py +85 -0
  296. package/dist/gaia-ops/tools/validation/README.md +244 -0
  297. package/dist/gaia-ops/tools/validation/__init__.py +17 -0
  298. package/dist/gaia-ops/tools/validation/approval_gate.py +321 -0
  299. package/dist/gaia-ops/tools/validation/validate_skills.py +189 -0
  300. package/dist/gaia-security/.claude-plugin/plugin.json +24 -0
  301. package/dist/gaia-security/README.md +90 -0
  302. package/dist/gaia-security/config/universal-rules.json +102 -0
  303. package/dist/gaia-security/hooks/adapters/__init__.py +52 -0
  304. package/dist/gaia-security/hooks/adapters/base.py +219 -0
  305. package/dist/gaia-security/hooks/adapters/channel.py +17 -0
  306. package/dist/gaia-security/hooks/adapters/claude_code.py +1890 -0
  307. package/dist/gaia-security/hooks/adapters/types.py +194 -0
  308. package/dist/gaia-security/hooks/adapters/utils.py +25 -0
  309. package/dist/gaia-security/hooks/hooks.json +113 -0
  310. package/dist/gaia-security/hooks/modules/__init__.py +15 -0
  311. package/dist/gaia-security/hooks/modules/agents/__init__.py +29 -0
  312. package/dist/gaia-security/hooks/modules/agents/contract_validator.py +647 -0
  313. package/dist/gaia-security/hooks/modules/agents/response_contract.py +496 -0
  314. package/dist/gaia-security/hooks/modules/agents/skill_injection_verifier.py +120 -0
  315. package/dist/gaia-security/hooks/modules/agents/state_tracker.py +267 -0
  316. package/dist/gaia-security/hooks/modules/agents/task_info_builder.py +74 -0
  317. package/dist/gaia-security/hooks/modules/agents/transcript_analyzer.py +458 -0
  318. package/dist/gaia-security/hooks/modules/agents/transcript_reader.py +152 -0
  319. package/dist/gaia-security/hooks/modules/audit/__init__.py +28 -0
  320. package/dist/gaia-security/hooks/modules/audit/event_detector.py +168 -0
  321. package/dist/gaia-security/hooks/modules/audit/logger.py +131 -0
  322. package/dist/gaia-security/hooks/modules/audit/metrics.py +134 -0
  323. package/dist/gaia-security/hooks/modules/audit/workflow_auditor.py +611 -0
  324. package/dist/gaia-security/hooks/modules/audit/workflow_recorder.py +296 -0
  325. package/dist/gaia-security/hooks/modules/context/__init__.py +11 -0
  326. package/dist/gaia-security/hooks/modules/context/agentic_loop_detector.py +165 -0
  327. package/dist/gaia-security/hooks/modules/context/anchor_tracker.py +317 -0
  328. package/dist/gaia-security/hooks/modules/context/compact_context_builder.py +218 -0
  329. package/dist/gaia-security/hooks/modules/context/context_freshness.py +145 -0
  330. package/dist/gaia-security/hooks/modules/context/context_injector.py +558 -0
  331. package/dist/gaia-security/hooks/modules/context/context_writer.py +530 -0
  332. package/dist/gaia-security/hooks/modules/context/contracts_loader.py +161 -0
  333. package/dist/gaia-security/hooks/modules/core/__init__.py +40 -0
  334. package/dist/gaia-security/hooks/modules/core/hook_entry.py +78 -0
  335. package/dist/gaia-security/hooks/modules/core/paths.py +160 -0
  336. package/dist/gaia-security/hooks/modules/core/plugin_mode.py +149 -0
  337. package/dist/gaia-security/hooks/modules/core/plugin_setup.py +577 -0
  338. package/dist/gaia-security/hooks/modules/core/state.py +179 -0
  339. package/dist/gaia-security/hooks/modules/core/stdin.py +24 -0
  340. package/dist/gaia-security/hooks/modules/events/__init__.py +1 -0
  341. package/dist/gaia-security/hooks/modules/events/event_writer.py +210 -0
  342. package/dist/gaia-security/hooks/modules/memory/__init__.py +8 -0
  343. package/dist/gaia-security/hooks/modules/memory/episode_writer.py +216 -0
  344. package/dist/gaia-security/hooks/modules/orchestrator/__init__.py +1 -0
  345. package/dist/gaia-security/hooks/modules/orchestrator/delegate_mode.py +122 -0
  346. package/dist/gaia-security/hooks/modules/scanning/__init__.py +8 -0
  347. package/dist/gaia-security/hooks/modules/scanning/scan_trigger.py +84 -0
  348. package/dist/gaia-security/hooks/modules/security/__init__.py +120 -0
  349. package/dist/gaia-security/hooks/modules/security/approval_cleanup.py +87 -0
  350. package/dist/gaia-security/hooks/modules/security/approval_constants.py +23 -0
  351. package/dist/gaia-security/hooks/modules/security/approval_grants.py +1638 -0
  352. package/dist/gaia-security/hooks/modules/security/approval_messages.py +71 -0
  353. package/dist/gaia-security/hooks/modules/security/approval_scopes.py +222 -0
  354. package/dist/gaia-security/hooks/modules/security/blocked_commands.py +595 -0
  355. package/dist/gaia-security/hooks/modules/security/blocked_message_formatter.py +87 -0
  356. package/dist/gaia-security/hooks/modules/security/command_semantics.py +181 -0
  357. package/dist/gaia-security/hooks/modules/security/composition_rules.py +547 -0
  358. package/dist/gaia-security/hooks/modules/security/flag_classifiers.py +873 -0
  359. package/dist/gaia-security/hooks/modules/security/gitops_validator.py +179 -0
  360. package/dist/gaia-security/hooks/modules/security/mutative_verbs.py +1131 -0
  361. package/dist/gaia-security/hooks/modules/security/network_hosts.py +481 -0
  362. package/dist/gaia-security/hooks/modules/security/prompt_validator.py +40 -0
  363. package/dist/gaia-security/hooks/modules/security/shell_unwrapper.py +165 -0
  364. package/dist/gaia-security/hooks/modules/security/tiers.py +196 -0
  365. package/dist/gaia-security/hooks/modules/session/__init__.py +10 -0
  366. package/dist/gaia-security/hooks/modules/session/pending_scanner.py +174 -0
  367. package/dist/gaia-security/hooks/modules/session/session_context_writer.py +100 -0
  368. package/dist/gaia-security/hooks/modules/session/session_event_injector.py +160 -0
  369. package/dist/gaia-security/hooks/modules/session/session_manager.py +31 -0
  370. package/dist/gaia-security/hooks/modules/session/session_registry.py +333 -0
  371. package/dist/gaia-security/hooks/modules/tools/__init__.py +29 -0
  372. package/dist/gaia-security/hooks/modules/tools/bash_validator.py +1008 -0
  373. package/dist/gaia-security/hooks/modules/tools/cloud_pipe_validator.py +231 -0
  374. package/dist/gaia-security/hooks/modules/tools/hook_response.py +55 -0
  375. package/dist/gaia-security/hooks/modules/tools/shell_parser.py +227 -0
  376. package/dist/gaia-security/hooks/modules/tools/stage_decomposer.py +315 -0
  377. package/dist/gaia-security/hooks/modules/tools/task_validator.py +294 -0
  378. package/dist/gaia-security/hooks/modules/validation/__init__.py +23 -0
  379. package/dist/gaia-security/hooks/modules/validation/commit_validator.py +380 -0
  380. package/dist/gaia-security/hooks/post_tool_use.py +54 -0
  381. package/dist/gaia-security/hooks/pre_tool_use.py +413 -0
  382. package/dist/gaia-security/hooks/session_end_hook.py +77 -0
  383. package/dist/gaia-security/hooks/session_start.py +81 -0
  384. package/dist/gaia-security/hooks/stop_hook.py +70 -0
  385. package/dist/gaia-security/hooks/user_prompt_submit.py +246 -0
  386. package/dist/gaia-security/settings.json +58 -0
  387. package/git-hooks/commit-msg +41 -0
  388. package/hooks/README.md +100 -0
  389. package/hooks/adapters/__init__.py +52 -0
  390. package/hooks/adapters/base.py +219 -0
  391. package/hooks/adapters/channel.py +17 -0
  392. package/hooks/adapters/claude_code.py +1890 -0
  393. package/hooks/adapters/types.py +194 -0
  394. package/hooks/adapters/utils.py +25 -0
  395. package/hooks/elicitation_result.py +179 -0
  396. package/hooks/hooks.json +84 -0
  397. package/hooks/modules/README.md +189 -0
  398. package/hooks/modules/__init__.py +15 -0
  399. package/hooks/modules/agents/__init__.py +29 -0
  400. package/hooks/modules/agents/contract_validator.py +647 -0
  401. package/hooks/modules/agents/response_contract.py +496 -0
  402. package/hooks/modules/agents/skill_injection_verifier.py +120 -0
  403. package/hooks/modules/agents/state_tracker.py +267 -0
  404. package/hooks/modules/agents/task_info_builder.py +74 -0
  405. package/hooks/modules/agents/transcript_analyzer.py +458 -0
  406. package/hooks/modules/agents/transcript_reader.py +152 -0
  407. package/hooks/modules/audit/__init__.py +28 -0
  408. package/hooks/modules/audit/event_detector.py +168 -0
  409. package/hooks/modules/audit/logger.py +131 -0
  410. package/hooks/modules/audit/metrics.py +134 -0
  411. package/hooks/modules/audit/workflow_auditor.py +611 -0
  412. package/hooks/modules/audit/workflow_recorder.py +296 -0
  413. package/hooks/modules/context/__init__.py +11 -0
  414. package/hooks/modules/context/agentic_loop_detector.py +165 -0
  415. package/hooks/modules/context/anchor_tracker.py +317 -0
  416. package/hooks/modules/context/compact_context_builder.py +218 -0
  417. package/hooks/modules/context/context_freshness.py +145 -0
  418. package/hooks/modules/context/context_injector.py +558 -0
  419. package/hooks/modules/context/context_writer.py +530 -0
  420. package/hooks/modules/context/contracts_loader.py +161 -0
  421. package/hooks/modules/core/__init__.py +40 -0
  422. package/hooks/modules/core/hook_entry.py +78 -0
  423. package/hooks/modules/core/paths.py +160 -0
  424. package/hooks/modules/core/plugin_mode.py +149 -0
  425. package/hooks/modules/core/plugin_setup.py +577 -0
  426. package/hooks/modules/core/state.py +179 -0
  427. package/hooks/modules/core/stdin.py +24 -0
  428. package/hooks/modules/events/__init__.py +1 -0
  429. package/hooks/modules/events/event_writer.py +210 -0
  430. package/hooks/modules/evidence/__init__.py +34 -0
  431. package/hooks/modules/evidence/assertions.py +137 -0
  432. package/hooks/modules/evidence/index_writer.py +57 -0
  433. package/hooks/modules/evidence/loader.py +126 -0
  434. package/hooks/modules/evidence/runner.py +241 -0
  435. package/hooks/modules/memory/__init__.py +8 -0
  436. package/hooks/modules/memory/episode_writer.py +216 -0
  437. package/hooks/modules/orchestrator/__init__.py +1 -0
  438. package/hooks/modules/orchestrator/delegate_mode.py +122 -0
  439. package/hooks/modules/scanning/__init__.py +8 -0
  440. package/hooks/modules/scanning/scan_trigger.py +84 -0
  441. package/hooks/modules/security/__init__.py +120 -0
  442. package/hooks/modules/security/approval_cleanup.py +87 -0
  443. package/hooks/modules/security/approval_constants.py +23 -0
  444. package/hooks/modules/security/approval_grants.py +1638 -0
  445. package/hooks/modules/security/approval_messages.py +71 -0
  446. package/hooks/modules/security/approval_scopes.py +222 -0
  447. package/hooks/modules/security/blocked_commands.py +595 -0
  448. package/hooks/modules/security/blocked_message_formatter.py +87 -0
  449. package/hooks/modules/security/command_semantics.py +181 -0
  450. package/hooks/modules/security/composition_rules.py +547 -0
  451. package/hooks/modules/security/flag_classifiers.py +873 -0
  452. package/hooks/modules/security/gitops_validator.py +179 -0
  453. package/hooks/modules/security/mutative_verbs.py +1131 -0
  454. package/hooks/modules/security/network_hosts.py +481 -0
  455. package/hooks/modules/security/prompt_validator.py +40 -0
  456. package/hooks/modules/security/shell_unwrapper.py +165 -0
  457. package/hooks/modules/security/tiers.py +196 -0
  458. package/hooks/modules/session/__init__.py +10 -0
  459. package/hooks/modules/session/pending_scanner.py +174 -0
  460. package/hooks/modules/session/session_context_writer.py +100 -0
  461. package/hooks/modules/session/session_event_injector.py +160 -0
  462. package/hooks/modules/session/session_manager.py +31 -0
  463. package/hooks/modules/session/session_registry.py +333 -0
  464. package/hooks/modules/tools/__init__.py +29 -0
  465. package/hooks/modules/tools/bash_validator.py +1008 -0
  466. package/hooks/modules/tools/cloud_pipe_validator.py +231 -0
  467. package/hooks/modules/tools/hook_response.py +55 -0
  468. package/hooks/modules/tools/shell_parser.py +227 -0
  469. package/hooks/modules/tools/stage_decomposer.py +315 -0
  470. package/hooks/modules/tools/task_validator.py +294 -0
  471. package/hooks/modules/validation/__init__.py +23 -0
  472. package/hooks/modules/validation/commit_validator.py +380 -0
  473. package/hooks/post_compact.py +43 -0
  474. package/hooks/post_tool_use.py +54 -0
  475. package/hooks/pre_compact.py +60 -0
  476. package/hooks/pre_tool_use.py +413 -0
  477. package/hooks/session_end_hook.py +77 -0
  478. package/hooks/session_start.py +81 -0
  479. package/hooks/stop_hook.py +70 -0
  480. package/hooks/subagent_start.py +71 -0
  481. package/hooks/subagent_stop.py +295 -0
  482. package/hooks/task_completed.py +70 -0
  483. package/hooks/user_prompt_submit.py +246 -0
  484. package/index.js +83 -0
  485. package/package.json +103 -0
  486. package/pyproject.toml +32 -0
  487. package/skills/README.md +158 -0
  488. package/skills/agent-creation/SKILL.md +87 -0
  489. package/skills/agent-creation/examples.md +170 -0
  490. package/skills/agent-creation/reference.md +191 -0
  491. package/skills/agent-protocol/SKILL.md +93 -0
  492. package/skills/agent-protocol/examples.md +223 -0
  493. package/skills/agent-response/SKILL.md +69 -0
  494. package/skills/agentic-loop/SKILL.md +80 -0
  495. package/skills/agentic-loop/reference.md +378 -0
  496. package/skills/blog-writing/SKILL.md +98 -0
  497. package/skills/blog-writing/reference.md +130 -0
  498. package/skills/brief-spec/SKILL.md +185 -0
  499. package/skills/command-execution/SKILL.md +64 -0
  500. package/skills/command-execution/reference.md +83 -0
  501. package/skills/context-updater/SKILL.md +87 -0
  502. package/skills/context-updater/examples.md +71 -0
  503. package/skills/developer-patterns/SKILL.md +50 -0
  504. package/skills/developer-patterns/reference.md +112 -0
  505. package/skills/execution/SKILL.md +99 -0
  506. package/skills/fast-queries/SKILL.md +43 -0
  507. package/skills/gaia-compact/SKILL.md +74 -0
  508. package/skills/gaia-patterns/SKILL.md +108 -0
  509. package/skills/gaia-patterns/reference.md +395 -0
  510. package/skills/gaia-planner/SKILL.md +37 -0
  511. package/skills/gaia-planner/reference.md +107 -0
  512. package/skills/gaia-release/SKILL.md +85 -0
  513. package/skills/gaia-release/reference.md +92 -0
  514. package/skills/gaia-self-check/SKILL.md +114 -0
  515. package/skills/gaia-self-check/reference.md +453 -0
  516. package/skills/gaia-verify/SKILL.md +77 -0
  517. package/skills/gaia-verify/reference.md +80 -0
  518. package/skills/git-conventions/SKILL.md +47 -0
  519. package/skills/gitops-patterns/SKILL.md +60 -0
  520. package/skills/gitops-patterns/reference.md +183 -0
  521. package/skills/gmail-policy/SKILL.md +200 -0
  522. package/skills/gmail-policy/reference.md +150 -0
  523. package/skills/gmail-triage/SKILL.md +100 -0
  524. package/skills/gws-setup/SKILL.md +99 -0
  525. package/skills/gws-setup/reference.md +73 -0
  526. package/skills/investigation/SKILL.md +100 -0
  527. package/skills/memory-curation/SKILL.md +83 -0
  528. package/skills/memory-search/SKILL.md +88 -0
  529. package/skills/orchestrator-approval/SKILL.md +160 -0
  530. package/skills/orchestrator-approval/reference.md +174 -0
  531. package/skills/pending-approvals/SKILL.md +72 -0
  532. package/skills/pending-approvals/reference.md +214 -0
  533. package/skills/readme-writing/SKILL.md +71 -0
  534. package/skills/readme-writing/reference.md +188 -0
  535. package/skills/reference.md +135 -0
  536. package/skills/request-approval/SKILL.md +140 -0
  537. package/skills/request-approval/examples.md +140 -0
  538. package/skills/request-approval/reference.md +57 -0
  539. package/skills/schedule-task/SKILL.md +64 -0
  540. package/skills/schedule-task/reference.md +233 -0
  541. package/skills/security-tiers/SKILL.md +141 -0
  542. package/skills/security-tiers/destructive-commands-reference.md +623 -0
  543. package/skills/security-tiers/reference.md +39 -0
  544. package/skills/session-reflection/SKILL.md +69 -0
  545. package/skills/skill-creation/SKILL.md +92 -0
  546. package/skills/skill-creation/reference.md +29 -0
  547. package/skills/terraform-patterns/SKILL.md +89 -0
  548. package/skills/terraform-patterns/reference.md +93 -0
  549. package/templates/README.md +69 -0
  550. package/templates/managed-settings.template.json +43 -0
  551. package/tools/__init__.py +9 -0
  552. package/tools/agentic-loop/decide-status.py +210 -0
  553. package/tools/agentic-loop/parse-metric.py +106 -0
  554. package/tools/agentic-loop/record-iteration.py +221 -0
  555. package/tools/context/README.md +132 -0
  556. package/tools/context/__init__.py +42 -0
  557. package/tools/context/_paths.py +20 -0
  558. package/tools/context/context_provider.py +721 -0
  559. package/tools/context/context_section_reader.py +342 -0
  560. package/tools/context/deep_merge.py +159 -0
  561. package/tools/context/pending_updates.py +760 -0
  562. package/tools/context/surface_router.py +278 -0
  563. package/tools/fast-queries/README.md +65 -0
  564. package/tools/fast-queries/__init__.py +30 -0
  565. package/tools/fast-queries/appservices/quicktriage_devops_developer.sh +75 -0
  566. package/tools/fast-queries/cloud/aws/quicktriage_aws_troubleshooter.sh +32 -0
  567. package/tools/fast-queries/cloud/gcp/quicktriage_gcp_troubleshooter.sh +88 -0
  568. package/tools/fast-queries/gitops/quicktriage_gitops_operator.sh +48 -0
  569. package/tools/fast-queries/run_triage.sh +59 -0
  570. package/tools/fast-queries/terraform/quicktriage_terraform_architect.sh +80 -0
  571. package/tools/gaia_simulator/__init__.py +33 -0
  572. package/tools/gaia_simulator/cli.py +354 -0
  573. package/tools/gaia_simulator/extractor.py +457 -0
  574. package/tools/gaia_simulator/reporter.py +258 -0
  575. package/tools/gaia_simulator/routing_simulator.py +334 -0
  576. package/tools/gaia_simulator/runner.py +539 -0
  577. package/tools/gaia_simulator/skills_mapper.py +264 -0
  578. package/tools/memory/README.md +0 -0
  579. package/tools/memory/__init__.py +20 -0
  580. package/tools/memory/backfill_fts5.py +107 -0
  581. package/tools/memory/conflict_detector.py +295 -0
  582. package/tools/memory/episodic.py +1210 -0
  583. package/tools/memory/git_invalidator.py +262 -0
  584. package/tools/memory/paths.py +102 -0
  585. package/tools/memory/scoring.py +193 -0
  586. package/tools/memory/search_store.py +375 -0
  587. package/tools/persist_transcript_analysis.py +85 -0
  588. package/tools/review/__init__.py +1 -0
  589. package/tools/review/review_engine.py +157 -0
  590. package/tools/scan/__init__.py +35 -0
  591. package/tools/scan/config.py +247 -0
  592. package/tools/scan/merge.py +212 -0
  593. package/tools/scan/orchestrator.py +549 -0
  594. package/tools/scan/registry.py +127 -0
  595. package/tools/scan/scanners/__init__.py +18 -0
  596. package/tools/scan/scanners/base.py +137 -0
  597. package/tools/scan/scanners/environment.py +349 -0
  598. package/tools/scan/scanners/git.py +570 -0
  599. package/tools/scan/scanners/infrastructure.py +875 -0
  600. package/tools/scan/scanners/orchestration.py +600 -0
  601. package/tools/scan/scanners/stack.py +1085 -0
  602. package/tools/scan/scanners/tools.py +260 -0
  603. package/tools/scan/setup.py +686 -0
  604. package/tools/scan/tests/__init__.py +1 -0
  605. package/tools/scan/tests/conftest.py +796 -0
  606. package/tools/scan/tests/test_environment.py +323 -0
  607. package/tools/scan/tests/test_git.py +419 -0
  608. package/tools/scan/tests/test_infrastructure.py +382 -0
  609. package/tools/scan/tests/test_integration.py +920 -0
  610. package/tools/scan/tests/test_merge.py +269 -0
  611. package/tools/scan/tests/test_orchestration.py +304 -0
  612. package/tools/scan/tests/test_stack.py +604 -0
  613. package/tools/scan/tests/test_tools.py +349 -0
  614. package/tools/scan/ui.py +624 -0
  615. package/tools/scan/verify.py +270 -0
  616. package/tools/scan/walk.py +118 -0
  617. package/tools/scan/workspace.py +85 -0
  618. package/tools/validation/README.md +244 -0
  619. package/tools/validation/__init__.py +17 -0
  620. package/tools/validation/approval_gate.py +321 -0
  621. package/tools/validation/validate_skills.py +189 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,1298 @@
1
+ # Changelog: CLAUDE.md
2
+
3
+ All notable changes to the gaia-ops orchestration system are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [5.0.0-rc.2] - 2026-04-26
11
+
12
+ ### Release Candidate 2: Converger Identity, Session Liveness, Install-Gate Hardening
13
+
14
+ Second release candidate for v5.0.0. Adds the orchestrator's Converger
15
+ ("Cerrar") conversational closure identity, real-PID session liveness in the
16
+ registry, the `agent-creation` and `session-reflection` skills, and an
17
+ end-to-end consumer-install validation harness that now actually exercises the
18
+ gate. Three install-time bugs surfaced and were fixed alongside the harness
19
+ that found them.
20
+
21
+ #### Added
22
+ - **Converger identity for orchestrator** — "Cerrar" conversational closure
23
+ framing. Brief-spec reframed as closure ritual (Size gate removed),
24
+ `planning_specs` surface routing narrowed to explicit artifact keywords,
25
+ architecture docs aligned with closure framing.
26
+ - **session-reflection skill** — conversational session-close ritual. Surfaced
27
+ by orchestrator at session end; complements `gaia-compact`.
28
+ - **agent-creation skill** — coach skill for designing new agents end-to-end:
29
+ identity, tool surface, contract, and verification.
30
+ - **SessionEnd hook + PID liveness** — `session_end_hook.py` for clean
31
+ unregister; session_registry now uses real PID + `/proc` starttime to detect
32
+ liveness across sessions. `Stop` hook no longer mutates the registry (was
33
+ causing premature unregister mid-conversation).
34
+ - **validate-sandbox.sh** — end-to-end consumer-install verification harness.
35
+ Two targets: `--target sandbox` (ephemeral fixture project) and
36
+ `--target local` (real workspace install with `--workspace` override). Eight
37
+ pass/fail checks: version, doctor, status, context show, memory stats,
38
+ memory search, scan, settings preservation. Wired into `publish.yml` so
39
+ every release smoke-tests the published tarball before notifying success.
40
+ - **`gaia:verify-install:{local,rc,latest}` and `gaia:install-local`** scripts
41
+ in package.json for manual local validation against tarballs or registry.
42
+
43
+ #### Changed
44
+ - **REVIEW → APPROVAL_REQUEST** rename across active doctrine (state machine,
45
+ skills, hooks). Comments and references in `hooks/**` updated. The previous
46
+ `REVIEW` state caused confusion with the human review activity; the new name
47
+ reflects what the state actually represents (an agent requesting human
48
+ approval for a specific T3 operation).
49
+ - **Stop hook decoupled from registry** — Stop event no longer mutates
50
+ session_registry. SessionEnd handles unregister cleanly; this avoids the
51
+ Stop-then-resume race where the registry would drop a still-active session.
52
+ - **`publish.yml`** — sandbox harness step added after npm publish; waits for
53
+ registry propagation, then runs validate-sandbox.sh against the freshly
54
+ published tarball as a smoke test.
55
+
56
+ #### Fixed
57
+ - **Sandbox harness on noexec /tmp** — validate-sandbox.sh now detects
58
+ `noexec` mounts via `findmnt` (with `/proc/mounts` fallback) and falls back
59
+ to `$TMPDIR` → `/tmp` → `$HOME/.cache/gaia-sandbox`. Previously the harness
60
+ was unrunnable on WSL/Linux setups with `noexec /tmp` (rc=126 Permission
61
+ denied on the installed bin shims); the gate appeared to validate but never
62
+ actually ran.
63
+ - **`gaia scan` harness check** — was invoking bare `gaia-scan --dry-run`,
64
+ which routes to `gaia-scan.py` whose argparse rejects `--dry-run`. Now uses
65
+ `gaia context scan --dry-run` (the higher-level CLI subcommand that does
66
+ accept `--dry-run`); drops the dead fallback.
67
+ - **doctor `<lambda>` check** — `cmd_doctor` wrapped each check in a bare
68
+ `lambda`, so any exception surfaced as `'<lambda>'` in the JSON output
69
+ hiding which check actually failed. Replaced with `functools.partial` so
70
+ `__name__` resolves to the wrapped function (e.g. `check_project_dirs`).
71
+ - **doctor `check_project_dirs` PosixPath/list TypeError** — code did
72
+ `project_root / dir_path` while iterating `paths.items()`; when a value was
73
+ a list (e.g. `"scan_targets": ["."]`), `Path / list` raised TypeError.
74
+ Values are now normalized to a flat sequence of `(label, str)` pairs before
75
+ joining; list values expand into `label[0]`, `label[1]`, ...
76
+ - **postinstall FTS5 backfill on fresh install** — `maybeBackfillFts5()`
77
+ returned early when `search.db` was missing with comment "doctor --fix will
78
+ create it on first use", but nothing in the install flow runs `doctor --fix`
79
+ automatically. A consumer reinstalling after `gaia uninstall` (which scrubs
80
+ search.db) would have an empty FTS5 index until manual intervention. The
81
+ early return is gone; missing search.db now falls through to `doctor --fix`
82
+ which creates and populates the index.
83
+ - **postinstall dynamic package resolution** — `gaia-update.js` now resolves
84
+ the gaia package name from `node_modules/@jaguilar87/` instead of
85
+ hardcoding, supporting both the v5+ `gaia` name and legacy `gaia-ops`. Also
86
+ detects and repairs symlinks pointing at the legacy path.
87
+ - **memory sentinel return** — sentinel value returned with a surfaced warning
88
+ instead of a silent failure when memory paths fail to resolve.
89
+
90
+ #### Internal
91
+ - **Regenerated plugin artifacts** — `dist/gaia-ops/` and `dist/gaia-security/`
92
+ rebuilt for rc2.
93
+ - **Cross-session liveness test** — real PID isolation in
94
+ `session_registry` test fixtures.
95
+
96
+ ## [5.0.0-rc1] - 2026-04-21
97
+
98
+ ### Release Candidate: Context Evals, Planner M1-M6, Memory CLI, Security Hardening
99
+
100
+ First release candidate for v5.0.0. Consolidates the agentic-loop evaluation
101
+ framework, the closed gaia-planner milestones, the unified `gaia memory` CLI,
102
+ and a round of security hardening covering approval lifecycle, Gmail policy,
103
+ and session compaction.
104
+
105
+ #### Added
106
+ - **Context-evals framework** — full pytest-driven evaluation suite for agent
107
+ context consumption. 5 graders (code, contract, trace, routing,
108
+ skill-injection), 3 backends (static, headless, live), 10 scenarios in
109
+ catalog, baseline snapshot with drift detection, and reporter for CI-friendly
110
+ output. Tests under `tests/evals/` with `baseline.json` tracked and
111
+ `{timestamp}-smoke.json` gitignored.
112
+ - **gaia-planner M1-M6 closed** — brief-spec + gaia-planner agent pipeline
113
+ end-to-end. Includes plan state machine, REVIEW -> APPROVAL_REQUEST split,
114
+ session_registry liveness filter, and approvals-drift-fix closed 2026-04-20.
115
+ - **gaia memory CLI** — `python3 bin/gaia memory` subcommand with search
116
+ (`gaia memory search`), episode inspection (`gaia memory show <id>`), FTS5
117
+ full-text index, scoring overhaul, and session context orientation.
118
+ - **gaia-compact skill** — structured session compaction preserving decisions,
119
+ components, gaps, file map, and next steps. Invoked via `/compact` or
120
+ orchestrator-level "compacta" triggers.
121
+ - **tools/__init__.py** — namespace marker for pytest rootdir parity. Resolves
122
+ 8 collection errors when running full suite (tests goes to 3702 passed,
123
+ 36 skipped, 0 errors).
124
+
125
+ #### Changed
126
+ - **Gmail policy** — macro-prefix fix: `+` in label prefixes now correctly
127
+ strips before state-machine classification. Reply classified as mutative
128
+ (was previously read-only, causing false negatives in T3 flow).
129
+ - **Approval workflow docs** — documented that `permissionMode` does not
130
+ survive SendMessage resume. Subagents emitting APPROVAL_REQUEST mid-task
131
+ require orchestrator to re-dispatch fresh (mode does not inherit on resume).
132
+ - **Package version** — `package.json` aligned with `pyproject.toml` at
133
+ `5.0.0-rc1` (previously drifted at `5.0.0-beta.9`).
134
+
135
+ #### Fixed
136
+ - **pytest collection** — `tools/__init__.py` prevents rootdir walk-up mismatch
137
+ between `tests/` and `tools/scan/tests/`. Full suite now collects cleanly.
138
+ - **Evals smoke JSONs** — transient artifacts no longer tracked in git;
139
+ `tests/evals/results/*-smoke.json` gitignored, `baseline.json` preserved.
140
+
141
+ ### Unified Python CLI + JS CLI Deprecation (inherited from beta cycle)
142
+
143
+ The JS CLIs (`gaia-status`, `gaia-doctor`, `gaia-cleanup`, `gaia-update`, `gaia-history`, `gaia-metrics`) are now deprecated in favor of the unified `bin/gaia` Python CLI. The JS CLIs remain functional but print deprecation warnings to stderr on every invocation.
144
+
145
+ #### Migration: Old Command → New Command
146
+
147
+ | Old JS command | New unified command |
148
+ |---|---|
149
+ | `npx gaia-status` | `python3 bin/gaia status` |
150
+ | `npx gaia-doctor` | `python3 bin/gaia doctor` |
151
+ | `npx gaia-cleanup` | `python3 bin/gaia cleanup` |
152
+ | `npx gaia-update` | `python3 bin/gaia update` |
153
+ | `npx gaia-history` | `python3 bin/gaia history` |
154
+ | `npx gaia-metrics` | `python3 bin/gaia metrics` |
155
+
156
+ #### New commands with no JS equivalent
157
+
158
+ The unified CLI also provides subcommands that did not exist as standalone JS CLIs:
159
+
160
+ | New command | Description |
161
+ |---|---|
162
+ | `python3 bin/gaia approvals list` | List pending T3 approval requests |
163
+ | `python3 bin/gaia approvals show APPROVAL_ID` | Show approval detail |
164
+ | `python3 bin/gaia approvals reject NONCE` | Reject a pending approval |
165
+ | `python3 bin/gaia approvals clean` | Remove expired grants |
166
+ | `python3 bin/gaia approvals stats` | Show approval statistics |
167
+ | `python3 bin/gaia plans list` | List all feature briefs |
168
+ | `python3 bin/gaia plans show BRIEF_NAME` | Show a brief and plan |
169
+ | `python3 bin/gaia context show` | Display project-context.json summary |
170
+ | `python3 bin/gaia context scan` | Invoke gaia-scan to refresh context |
171
+
172
+ #### Deprecation timeline
173
+
174
+ - **Now (M6):** JS CLIs print `[DEPRECATED]` warnings to stderr. All functionality remains intact.
175
+ - **Future version (TBD):** JS CLIs will be removed from `package.json` bin field.
176
+
177
+ #### Why a unified CLI?
178
+
179
+ - Zero external dependencies (stdlib only, Python 3.9+)
180
+ - Single entry point: `bin/gaia --help` for all subcommands
181
+ - Machine-readable `--json` output on all subcommands
182
+ - Consistent exit codes: 0=ok, 1=warnings, 2=errors
183
+ - Extensible: add subcommands by dropping a `bin/cli/<name>.py` file
184
+
185
+ ---
186
+
187
+ ## [4.5.0] - 2026-03-24
188
+
189
+ ### Settings Architecture Redesign + Multi-Cloud Security
190
+
191
+ Unified approach for permissions across NPM and plugin installation modes. Permissions now live in `settings.local.json` (union merge, preserves user config). `settings.json` contains only hooks.
192
+
193
+ #### Added
194
+ - **Azure deny rules** — 39 rules covering resource groups, networking, AKS, Key Vault, CosmosDB, Service Bus, and more
195
+ - **Generic wildcard deny rules** — 20 rules that catch all present and future cloud services (`aws * delete-*`, `az * delete`, `gcloud * delete`, etc.)
196
+ - **Indirect execution detection** — Catches `bash -c`, `eval`, `python3 -c`, `node -e`, `ruby -e`, `perl -e` wrappers that bypass regex patterns
197
+ - **Managed settings template** — `templates/managed-settings.template.json` for enterprise deployment via Claude.ai Admin Console
198
+ - **`updateLocalPermissions()`** in `gaia-update.js` — NPM postinstall now merges permissions into `settings.local.json` (same approach as plugin SessionStart)
199
+ - **Plugin mode detection via `plugin.json`** — `plugin_setup.py` and `plugin_mode.py` now read `.claude-plugin/plugin.json` for reliable name/version/mode detection with `--plugin-dir`
200
+ - **First-run welcome message** — `user_prompt_submit.py` detects first run and injects a welcome explaining that restart is needed to activate permissions
201
+
202
+ #### Changed
203
+ - **`settings.template.json`** — Removed permissions block; template now contains only hooks + environment
204
+ - **`_DENY_RULES` centralized in Python** — Single source of truth in `plugin_setup.py`, shared by both OPS and SECURITY modes
205
+ - **T3 approval flow** — All T3 mutative operations now use native `ask` dialog (both ops and security mode). Nonce workflow removed from direct conversation; kept for subagent use via skills.
206
+ - **`approval_messages.py`** — Simplified T3 block message to minimal data (tier + nonce). Workflow instructions live in skills, not hook messages.
207
+ - **`pre_tool_use.py`** — Simplified: passes through `block_response` from `bash_validator` directly, no more mode-specific branching
208
+ - **`bash_validator.py`** — T3 mutative returns `ask` response directly (no nonce generation, no pending files)
209
+ - **`session_start.py`** — Uses `mark_done=False` so `user_prompt_submit.py` can detect first-run and show welcome before marking initialized
210
+ - **`gaia-update.js` registry path** — Fixed to write `plugin-registry.json` in `.claude/` (same path Python hooks expect)
211
+ - **`gaia-doctor.js`** — Now checks permissions in `settings.local.json` (not just `settings.json`). Updated agent and config file lists.
212
+ - **`gaia-update.js` health check** — Updated config files (`surface-routing.json`) and agent list (`gaia-system.md`, `speckit-planner.md`)
213
+
214
+ #### Fixed
215
+ - **Registry path mismatch** — `gaia-update.js` wrote to `.claude/project-context/`, Python read from `.claude/`. Now both use `.claude/`.
216
+ - **Orphaned nonce files** — `bash_validator` no longer writes pending approval files for `ask` responses
217
+ - **Plugin mode detection** — `--plugin-dir` now correctly detects `gaia-ops` vs `gaia-security` via `plugin.json` instead of path parsing
218
+ - **First-run welcome race condition** — `SessionStart` no longer marks initialized; `UserPromptSubmit` marks after showing welcome
219
+ - **`_build_welcome()` framing** — Rewritten to explain WHY the user needs to restart (permissions not active yet), making Claude naturally relay the message
220
+
221
+ ## [4.4.0-rc.5] - 2026-03-19
222
+
223
+ ### Identity Redesign
224
+
225
+ Orchestrator identity is now minimal (~900 chars) and delegates to on-demand skills. CLAUDE.template.md deleted -- the UserPromptSubmit hook is the single source of truth for orchestrator identity.
226
+
227
+ #### Added
228
+ - **`skills/project-dispatch/SKILL.md`** (Reference type) -- agent routing table and dispatch rules, loaded on-demand via Skill tool
229
+ - **`skills/agent-response/SKILL.md`** (Protocol type) -- contract status handling, loaded on-demand via Skill tool
230
+ - Plugin distribution: `.claude-plugin/plugin.json` manifest with engines + categories for Claude Code native plugin system
231
+ - Self-hosted marketplace: `.claude-plugin/marketplace.json` with 2 sub-plugin tiers (gaia-security, gaia-ops)
232
+ - Adapter layer: `hooks/adapters/` with normalized types, abstract base, and Claude Code adapter
233
+ - `hooks/hooks.json` for plugin-channel hook configuration
234
+ - Distribution channel detection (`hooks/adapters/channel.py`)
235
+ - Integration tests for adapter -> business logic -> response flow
236
+ - Plugin manifest validation tests
237
+
238
+ #### Changed
239
+ - **`hooks/modules/identity/ops_identity.py`** -- reduced to ~900 chars; tells orchestrator to load skills on-demand instead of embedding all instructions inline
240
+ - **SendMessage validation** -- moved from invalid hook event to PreToolUse matcher (agent ID format + nonce approval check)
241
+ - **`hooks/modules/scanning/scan_trigger.py`** -- imports `tools.scan` directly (no `bin/` dependency), works in both npm and plugin mode
242
+ - **Agent namespace support** -- accepts both `cloud-troubleshooter` and `gaia-ops:cloud-troubleshooter` forms
243
+ - **`hooks/user_prompt_submit.py`** -- calls `ensure_plugin_registry()` as fallback if SessionStart didn't fire
244
+ - **`hooks/modules/context/context_injector.py`** -- path fixes for plugin mode
245
+ - **`hooks/modules/session/session_event_injector.py`** -- path fixes for plugin mode
246
+ - Hook entry points (pre_tool_use.py, post_tool_use.py, subagent_stop.py) now use adapter layer for stdin/stdout
247
+ - hook_response.py delegates to ClaudeCodeAdapter internally
248
+ - npm dist-tag now derived from version suffix (rc -> next, beta -> beta, etc.)
249
+
250
+ #### Removed
251
+ - **`templates/CLAUDE.template.md`** -- identity now injected dynamically; no generated CLAUDE.md
252
+ - **`copy_claude_md()`** in `tools/scan/setup.py` -- deprecated to no-op (callers still reference it for backward compat)
253
+
254
+ ## [4.0.0] - 2026-03-03
255
+
256
+ ### Breaking: Contracts as Single Source of Truth
257
+
258
+ Contracts now fully control what context each agent receives. Removed the progressive disclosure layer that was silently overriding contract definitions, and cleaned up ~400 lines of dead code from context_provider.py.
259
+
260
+ #### Changed
261
+ - **context_provider.py**: Contracts are the single source of truth -- removed progressive disclosure filtering that overrode contract-defined sections
262
+ - **context_provider.py**: Simplified output payload -- removed `enrichment` and `progressive_disclosure` keys from response
263
+ - **contracts/terraform-architect.json**: Now reads `cluster_details` and `application_services` sections
264
+ - **contracts/gitops-operator.json**: Now reads `gcp_services` section (GCP overlay)
265
+ - **pre_tool_use.py**: Updated log message to show sections count and rules count
266
+ - **templates/CLAUDE.template.md**: Synced agent routing descriptions with CLAUDE.md
267
+
268
+ #### Fixed
269
+ - **context_provider.py `get_contracts_dir()`**: Path traversal went up 2 levels instead of 3, producing wrong directory -- masked by legacy fallback that silently compensated
270
+
271
+ #### Removed
272
+ - **context_provider.py**: ~400 lines of dead code:
273
+ - Progressive disclosure engine (section filtering, phase-based visibility)
274
+ - `LEGACY_AGENT_CONTRACTS` dictionary (hardcoded fallback contracts)
275
+ - Semantic enrichment pipeline
276
+ - `validate_project_paths()` function
277
+ - Path resolution utility functions
278
+
279
+ #### Tests
280
+ - **tests/tools/test_context_provider.py**: Complete rewrite -- 8 tests covering all 6 agents, payload structure, and invalid agent handling
281
+
282
+ ## [3.15.1] - 2026-02-24
283
+
284
+ ### Fix: Cross-Layer Consistency & Dead Code Cleanup
285
+
286
+ Comprehensive audit of skills, hooks, and security modules. Fixed inconsistencies between layers that caused silent failures (tests pass but system broken).
287
+
288
+ #### Fixed
289
+ - **bash_validator**: Check blocked commands BEFORE safe commands (defense-in-depth order was inverted)
290
+ - **tiers.py**: Split `VALIDATION_PATTERNS` into `T1_PATTERNS` (validate, lint, fmt, check) and `T2_PATTERNS` (plan, template, diff) — aligns with security-tiers skill
291
+ - **tiers.py**: Removed `terraform plan` from `ULTRA_COMMON_T0_COMMANDS` fast-path (was T0, should be T2)
292
+ - **safe_commands.py**: Removed `terraform plan`/`terragrunt plan` from `ALWAYS_SAFE_MULTIWORD` (simulation, not read-only)
293
+ - **safe_commands.py**: Removed `python3`, `python` from `always_safe` (can execute arbitrary code)
294
+ - **safe_commands.py**: Removed `tar`, `gzip`, `gunzip`, `zip`, `unzip` from `always_safe` (modify filesystem)
295
+ - **task_validator.py**: Removed legacy `APPROVAL_INDICATORS` (`'validation["approved"] == True'`, `"Phase 5: Realization"`)
296
+ - **task_validator.py**: Added `speckit-planner` to `META_AGENTS`
297
+ - **pre_tool_use.py**: Resume regex `{6,7}` → `{5,}` to accept real Claude Code agent IDs
298
+ - **pre_tool_use.py**: Session events now inject BEFORE `# User Task` marker (was after)
299
+ - **post_tool_use.py**: Added `fcntl.flock` to prevent race conditions on `context.json`
300
+ - **post_tool_use.py**: Guard empty timestamps in retention filter
301
+ - **subagent_stop.py**: Fixed indentation bug in consecutive failure detection
302
+ - **subagent_stop.py**: Use `deque(f, maxlen=7)` instead of `f.readlines()` for metrics.jsonl
303
+ - **settings.json**: Moved 7 T3 commands from `allow` → `ask`: kubectl exec/label/annotate/uncordon, helm rollback, flux suspend/resume
304
+ - **settings.json**: Added `flux create` to `ask` list (was unprotected)
305
+ - **agent-protocol skill**: Removed `CURRENT_PHASE` from AGENT_STATUS (redundant with `PLAN_STATUS`)
306
+ - **agent-protocol skill**: `PLANNING` state now explicitly emitted in Phase 2
307
+ - **execution skill**: Scope clarified as T3-only (was accidentally broadened to T2)
308
+ - All 3 hooks: Removed `logging.StreamHandler()` (was sending noise to stderr)
309
+
310
+ #### Removed
311
+ - **`config_loader.py`** — Dead code, never imported by any module
312
+ - **`discovery_classifier.py`** — Deprecated, replaced by context_writer.py (609 lines)
313
+ - **`exhaustion_detector.py`** — Never worked (wrong glob pattern, wrong file format parsing, 200K thresholds obsolete with 1M context)
314
+ - **`detect_speckit_milestone()`** in event_detector.py — Dead code (post_hook only runs for Bash, not Skill)
315
+ - **`SPECKIT_MILESTONE`** enum value from EventType
316
+ - **`test_config_loader.py`** — Tests for deleted module
317
+ - **`test_discovery_classifier.py`** — Tests for deleted module
318
+ - Slow execution detection in subagent_stop.py (duration_ms always None)
319
+
320
+ #### Added
321
+ - **`test_cross_layer_consistency.py`** — 24 tests validating consistency between settings.json ↔ safe_commands ↔ blocked_commands ↔ tiers ↔ skills ↔ task_validator
322
+
323
+ #### Metrics
324
+ - Dead code removed: ~1,500 lines (config_loader + discovery_classifier + exhaustion_detector + dead test files)
325
+ - All 890 tests pass, 0 failures
326
+
327
+ ## [3.12.0] - 2026-02-17
328
+
329
+ ### Refactor: Principle-First Skills & Agent Deduplication
330
+
331
+ Major redesign of skills and agents. Skills now teach principles instead of enumerating commands. Agents delegate process knowledge to skills, keeping only domain identity.
332
+
333
+ #### Removed
334
+ - **`skills/anti-patterns/`** - Merged into `command-execution` skill as defensive execution principles
335
+
336
+ #### Changed
337
+ - **`skills/command-execution/SKILL.md`** - Complete rewrite with defensive execution framework
338
+ - Timeout hierarchy (tool-native → shell wrapper → abort)
339
+ - Pre-flight checklist ("Can this hang?" / "Do I know the timeout?")
340
+ - 7 numbered rules: no pipes, one command per step, Claude Code tools over bash, validate before mutate, absolute paths, files over inline data, quote variables
341
+ - **`skills/security-tiers/SKILL.md`** - Changed from command enumeration to decision framework
342
+ - Classification by question: "Does it modify live state?" → T3
343
+ - **`skills/terraform-patterns/SKILL.md`** - Split into slim SKILL.md (86 lines) + reference.md
344
+ - **`skills/gitops-patterns/SKILL.md`** - Split into slim SKILL.md (94 lines) + reference.md
345
+ - **`skills/fast-queries/SKILL.md`** - Cut from 256 to 41 lines (essentials only)
346
+ - **`skills/investigation/SKILL.md`** - Fixed to use Glob/Grep/Read tools, removed duplicated content
347
+ - **`skills/output-format/SKILL.md`** - Removed dead escalation protocol
348
+ - **`skills/execution/SKILL.md`** - Consolidated commit format to git-conventions reference
349
+ - **`skills/approval/SKILL.md`** - Removed duplicated commit standards and AskUserQuestion section
350
+ - **All 6 agents** - Removed duplicated Before Acting, Investigation Protocol, Pre-loaded Standards, and command enumeration tier tables
351
+
352
+ #### Added
353
+ - **`skills/reference.md`** - Agent template and npm release checklist (moved from gaia agent)
354
+ - **`skills/terraform-patterns/reference.md`** - Full HCL examples
355
+ - **`skills/gitops-patterns/reference.md`** - Full YAML examples
356
+ - **`investigation` skill** assigned to cloud-troubleshooter, terraform-architect, gitops-operator, devops-developer, gaia
357
+ - **`git-conventions` skill** assigned to terraform-architect, gitops-operator, devops-developer
358
+ - **`agent-protocol` + `security-tiers` skills** assigned to speckit-planner
359
+
360
+ #### Metrics
361
+ - Skills: 1,865 → 725 lines (-61%)
362
+ - Agents: 1,914 → 1,007 lines (-47%)
363
+ - Total injected tokens significantly reduced
364
+ - All 882 tests pass
365
+
366
+ ## [3.11.0] - 2026-02-16
367
+
368
+ ### feat: 3-Layer E2E Testing System
369
+
370
+ Added Layer 1 prompt regression tests (86 tests) validating agent frontmatter, prompt content, skill cross-references, context contracts, security tier consistency, routing table, and skill content rules.
371
+
372
+ ## [3.7.0] - 2026-01-20
373
+
374
+ ### Refactor: Commit Validator Architecture
375
+
376
+ Moved commit validation to hooks system for better encapsulation and clearer separation of concerns.
377
+
378
+ #### Changed
379
+ - **commit_validator.py location**: Moved from `tools/validation/` to `hooks/modules/validation/`
380
+ - **bash_validator.py imports**: Updated to use relative import from sibling module
381
+ - **Module structure**: commit_validator.py now exclusively used by bash_validator.py (no direct imports)
382
+ - **Documentation**: Updated tools/validation/README.md to reflect new architecture
383
+
384
+ #### Technical Details
385
+ - bash_validator.py now uses relative import: `from ..validation.commit_validator import validate_commit_message`
386
+ - commit_validator.py path resolution updated for new location (4 dirname calls instead of 3)
387
+ - pre-publish-validate.js updated to validate new path
388
+ - tools/validation/__init__.py no longer exports commit_validator (internal use only)
389
+
390
+ #### Benefits
391
+ - Better encapsulation: commit validation only accessible through bash_validator
392
+ - Clearer architecture: validation logic properly contained within hooks system
393
+ - No breaking changes: commit validation continues to work identically
394
+
395
+ ## [3.6.1] - 2026-01-20
396
+
397
+ ### Fix: Include skills/ directory in npm package
398
+
399
+ #### Fixed
400
+ - **package.json files array**: Added `"skills/"` to ensure skills directory is published to npm
401
+ - This was preventing skills/standards/ from being available in v3.6.0
402
+
403
+ ## [3.6.0] - 2026-01-20
404
+
405
+ ### Standards Migration to Skills System
406
+
407
+ Major architectural change: migrated from dual context system (standards + skills) to unified skills-based architecture.
408
+
409
+ #### Added
410
+ - **New skills directory**: `skills/standards/` with 4 standards skills:
411
+ - `security-tiers/` - T0-T3 operation classification (auto_load)
412
+ - `output-format/` - Global output contract for all agents (auto_load)
413
+ - `command-execution/` - Shell security rules and timeout guidelines (triggered)
414
+ - `anti-patterns/` - Common mistakes by tool: kubectl, terraform, gcloud, helm, flux, npm, docker (triggered)
415
+ - **Standards loader in skill_loader.py**: New `_load_standards_skills()` method
416
+ - **Standards config in skill-triggers.json**: New `standards` section with auto_load and triggers
417
+
418
+ #### Changed
419
+ - **Unified loading system**: All context now loaded via `skill_loader.py` (skills only)
420
+ - **skill-triggers.json**: Added `standards` section with 4 skills configuration
421
+
422
+ #### Removed
423
+ - **build_standards_context()**: Removed 91 lines from `context_provider.py`
424
+ - **Standards system**: Deleted `get_standards_dir()`, `read_standard_file()`, `should_preload_standard()`, `build_standards_context()`
425
+ - **--no-standards flag**: Removed from context_provider.py (no longer needed)
426
+ - **docs/ directory**: Eliminated symlink `.claude/docs` (standards now in skills/)
427
+ - **Obsolete tests**: Removed 66 lines of standards-specific tests from `test_context_provider.py`
428
+ - **Duplicate content**: Removed docs/standards reference from universal-protocol skill
429
+
430
+ #### Migration Notes
431
+ - **Breaking change**: Systems relying on `.claude/docs/standards/` must update to use skills system
432
+ - **Skills auto-load**: `security-tiers` and `output-format` now load for ALL agents (not just PROJECT_AGENTS)
433
+ - **No functional impact**: Same content, different delivery mechanism
434
+ - **Benefits**: Single loading system, better versioning, no duplication
435
+
436
+ ## [3.3.2] - 2025-12-11
437
+
438
+ ### Read-Only Auto-Approval & Code Optimization
439
+
440
+ Major improvements to the permission system with compound command support and code quality optimizations.
441
+
442
+ #### Added
443
+ - **Compound command auto-approval**: Safe compound commands (`cat file | grep foo`, `ls && pwd`, `tail file || echo error`) now execute WITHOUT ASK prompts
444
+ - **Extended safe command list**: Added `base64`, `md5sum`, `sha256sum`, `tar`, `gzip`, `time`, `timeout`, `sleep` to always-safe commands
445
+ - **Multi-word command support**: Added `kubectl get/describe/logs`, `helm list/status`, `flux check/get`, `docker ps/images`, `gcloud/aws describe/list` as always-safe
446
+
447
+ #### Changed
448
+ - **R1: Unified safe command configuration** (`SAFE_COMMANDS_CONFIG`) - Single source of truth for all safe commands, eliminating ~150 lines of duplicate patterns
449
+ - **R2: Unified validation flow** - `classify_command_tier()` now uses `is_read_only_command()` for T0 classification
450
+ - **R4: Singleton ShellCommandParser** - Single instance reused across all validations
451
+
452
+ #### Removed
453
+ - **R3: Dead code removal** - Removed unused `_contains_command_chaining()` method (~30 lines)
454
+ - **Removed tenacity dependency** - Simplified capabilities loading (retry logic was over-engineering)
455
+ - **Removed duplicate `allowed_read_operations`** - Now derived from `SAFE_COMMANDS_CONFIG`
456
+
457
+ #### Fixed
458
+ - Compound commands with safe components no longer trigger ASK prompts
459
+ - More consistent tier classification between auto-approval and security validation
460
+
461
+ #### Technical Details
462
+ - **Lines reduced**: ~200 lines removed through deduplication
463
+ - **Maintainability**: Single source of truth for safe commands
464
+ - **Performance**: Singleton parser avoids repeated instantiation
465
+
466
+ #### Test Results
467
+ All previous tests continue to pass:
468
+ - Simple read-only commands: NO ASK (auto-approved)
469
+ - Safe compound commands: NO ASK (NEW - auto-approved)
470
+ - Dangerous commands: BLOCKED correctly
471
+ - Compound with dangerous components: BLOCKED correctly
472
+
473
+ ---
474
+
475
+ ## [3.3.1] - 2025-12-11
476
+
477
+ ### Granular AWS Permissions & Command Chaining Block
478
+
479
+ Refined AWS permission patterns to read-only operations and blocked command chaining to ensure predictable permission evaluation.
480
+
481
+ #### Changed
482
+ - **AWS permissions**: Replaced broad service wildcards with granular read-only patterns
483
+ - `Bash(aws ec2:*)` → 40 specific `describe-*` and `get-*` commands
484
+ - `Bash(aws s3:*)` → `s3 ls`, `s3api get-*`, `s3api list-*`, `s3api head-*`
485
+ - `Bash(aws rds:*)` → `describe-*`, `list-tags-for-resource`
486
+ - `Bash(aws iam:*)` → `get-*`, `list-*`, `generate-*`, `simulate-*`
487
+ - Similar granular patterns for Lambda, Logs, CloudWatch, CloudFormation, ELB, Route53, SecretsManager, SSM, SNS, SQS, DynamoDB, ECR, EKS, ElastiCache
488
+
489
+ #### Added
490
+ - **Command chaining block** in `pre_tool_use.py`:
491
+ - Blocks `&&`, `;`, `||` operators to prevent bypassing permission checks
492
+ - Allows pipes `|` (don't affect permissions)
493
+ - Smart detection avoids false positives in quoted strings
494
+ - Clear error message: "Execute each command separately"
495
+
496
+ #### Fixed
497
+ - Moved `agents/README.md` files to `docs/` to resolve Claude Code parse errors
498
+
499
+ #### Security Impact
500
+ - Modification commands (create, start, stop) now properly require ASK confirmation
501
+ - Chained commands can no longer bypass individual permission evaluation
502
+ - Read-only operations execute without confirmation
503
+
504
+ ---
505
+
506
+ ## [3.2.3] - 2025-12-09
507
+
508
+ ### Service-Level Permission Wildcards
509
+
510
+ Simplified permission patterns using service-level wildcards for better Claude Code compatibility.
511
+
512
+ #### Changed
513
+ - **AWS patterns**: Simplified from `Bash(aws rds describe-:*)` to `Bash(aws rds :*)`
514
+ - Service-level wildcards: `aws ec2`, `aws rds`, `aws s3`, `aws iam`, etc.
515
+ - Works around Claude Code pattern matching issues with hyphens
516
+ - **GCP patterns**: Simplified to `Bash(gcloud compute :*)`, `Bash(gcloud container :*)`, etc.
517
+ - **Format standardization**: Removed spaces before `:*` for commands without arguments
518
+
519
+ #### Fixed
520
+ - Agent README files renamed back to `README.md` (underscore prefix removed)
521
+ - Pattern matching now works for `aws rds describe-db-instances` and similar commands
522
+
523
+ #### Impact
524
+ - **Read-only commands**: Execute automatically ✓
525
+ - **Modification commands** (start/stop, upload, resize): Now execute automatically (Option A1)
526
+ - **Destructive commands** (delete, terminate): Still blocked ✓
527
+
528
+ #### Philosophy (Option A1 - Permissive with guardrails)
529
+ - Wide `allow[]` for entire services (e.g., `aws ec2 :*`)
530
+ - Strict `deny[]` for destructive operations
531
+ - Trade-off: Modification commands no longer require confirmation
532
+
533
+ ---
534
+
535
+ ## [3.2.2] - 2025-12-09
536
+
537
+ ### Enhanced Permissions System
538
+
539
+ Complete overhaul of the permissions configuration to implement "permissive-with-guardrails" strategy.
540
+
541
+ #### Changed
542
+ - **Comprehensive allow[] rules**: 331 specific read-only patterns for shell, git, kubernetes, helm, flux, terraform, aws, gcp, docker commands
543
+ - **Granular ask[] rules**: 162 modification operations that require user confirmation
544
+ - **Strict deny[] rules**: 73 destructive operations that are completely blocked
545
+
546
+ #### Fixed
547
+ - Removed duplicate patterns (`uname:*`, `xargs:*`)
548
+ - Fixed `gsutil rm -r:*::*` → `gsutil rm -r:*` (incorrect double colon)
549
+ - Added missing `git branch:*` to allow[] for `git branch -a`
550
+
551
+ #### Added
552
+ - **New test suite**: `tests/permissions-validation/test_permissions_validation.py`
553
+ - Emulates Claude Code's actual permission matching behavior
554
+ - 114 test cases across 13 categories
555
+ - Tests prefix matching with `:*` wildcard
556
+ - Validates precedence: Deny → Allow → Ask
557
+
558
+ #### Philosophy
559
+ - **Allow**: Read-only commands execute automatically (no confirmation)
560
+ - **Ask**: Modification commands require user approval (can be approved)
561
+ - **Deny**: Destructive commands are blocked (cannot be approved)
562
+
563
+ ---
564
+
565
+ ## [3.2.1] - 2025-12-06
566
+
567
+ ### Security Fix - Permission Bypass Bug
568
+
569
+ **Critical security fix** for permission enforcement in `settings.template.json`.
570
+
571
+ #### Fixed
572
+ - **Removed generic `"Bash"` from `allow[]`**: The generic `"Bash"` permission was bypassing all specific `ask[]` rules like `"Bash(git push:*)"`, allowing T3 operations (git push, git commit) to execute without user confirmation.
573
+ - **Changed hook matcher from `"BashTool"` to `"Bash"`**: The PreToolUse and PostToolUse hooks were configured with matcher `"BashTool"` but Claude Code invokes the tool as `"Bash"`, causing hooks to never execute.
574
+
575
+ #### Root Cause Analysis
576
+ - See post-mortem: Generic permission `allow: ["Bash"]` has higher precedence than specific `ask: ["Bash(git push:*)"]` in Claude Code's permission evaluation.
577
+ - Hook matchers must match the exact tool name used by Claude Code.
578
+
579
+ #### Impact
580
+ - All git operations (push, commit, add) now correctly trigger "ask" confirmation
581
+ - PreToolUse hooks now execute for bash commands
582
+ - Security tier enforcement restored
583
+
584
+ ---
585
+
586
+ ## [3.2.0] - 2025-12-06
587
+
588
+ ### Added - Episodic Memory P0+P1 Enhancements
589
+
590
+ Inspired by [memory-graph](https://github.com/gregorydickson/memory-graph) analysis, selective feature adoption.
591
+
592
+ - **P0: Outcome Tracking** (`tools/4-memory/episodic.py`)
593
+ - New fields: `outcome`, `success`, `duration_seconds`, `commands_executed`
594
+ - Valid outcomes: "success", "partial", "failed", "abandoned"
595
+ - New method: `update_outcome()` - Update episode results after execution
596
+ - Search boost: 10% relevance increase for successful episodes
597
+
598
+ - **P1: Simple Relationships** (`tools/4-memory/episodic.py`)
599
+ - New field: `related_episodes` - List of related episode IDs with types
600
+ - Relationship types: SOLVES, CAUSES, DEPENDS_ON, VALIDATES, SUPERSEDES, RELATED_TO
601
+ - New method: `add_relationship()` - Link episodes together
602
+ - New method: `get_related_episodes()` - Query related episodes (outgoing/incoming/both)
603
+ - Search enhancement: `include_relationships=True` parameter
604
+
605
+ - **Statistics Enhancements**
606
+ - Outcome counts by type
607
+ - Total relationships count
608
+ - Relationship types breakdown
609
+
610
+ - **CLI Commands**
611
+ - `store --outcome --duration` - Store with outcome tracking
612
+ - `update-outcome <id> <outcome>` - Update episode outcome
613
+ - `add-relationship <source> <target> <type>` - Create relationship
614
+ - `get-related <id>` - Query related episodes
615
+ - `search --include-relationships` - Search with relationship context
616
+
617
+ ### Design Decisions
618
+
619
+ - Backward compatible: All new fields optional with None defaults
620
+ - Audit trail: Relationship and outcome events logged to JSONL
621
+ - Performance limits: 1000 episodes, 5000 relationships in index
622
+ - No external dependencies: Pure Python implementation
623
+
624
+ ## [3.1.1] - 2025-12-06
625
+
626
+ ### Fixed
627
+
628
+ - **package.json** - Added `docs/` to files array (was missing in 3.1.0)
629
+ - `docs/standards/` now included in npm package
630
+ - Required for hybrid pre-loading in `context_provider.py`
631
+
632
+ ## [3.1.0] - 2025-12-06
633
+
634
+ ### Added - Token Optimization & Consolidation
635
+
636
+ - **NEW:** `docs/standards/` - Shared execution standards
637
+ - `security-tiers.md` - T0-T3 definitions
638
+ - `output-format.md` - Report structure
639
+ - `command-execution.md` - Execution pillars
640
+ - `anti-patterns.md` - Common mistakes by tool
641
+
642
+ - **NEW:** Hybrid pre-loading in `context_provider.py`
643
+ - Always loads: security-tiers, output-format
644
+ - On-demand: command-execution
645
+ - **78% token reduction** per agent invocation
646
+
647
+ - **NEW:** QuickTriage scripts
648
+ - `tools/fast-queries/cloud/aws/quicktriage_aws_troubleshooter.sh`
649
+ - `tools/fast-queries/appservices/quicktriage_devops_developer.sh`
650
+
651
+ ### Changed - Agent Optimization
652
+
653
+ - **agents/*.md** - All 6 agents reduced by 78%
654
+ - terraform-architect: 916 → 183 lines
655
+ - gitops-operator: 1,238 → 217 lines
656
+ - gcp-troubleshooter: 600 → 156 lines
657
+ - aws-troubleshooter: 565 → 142 lines
658
+ - devops-developer: 641 → 173 lines
659
+
660
+ ### Removed - Session System Consolidation
661
+
662
+ - **REMOVED:** Session management system (consolidated into Episodic Memory)
663
+ - `commands/save-session.md`
664
+ - `commands/restore-session.md`
665
+ - `commands/session-status.md`
666
+ - `hooks/session_start.py`
667
+ - `tools/5-task-management/session-manager.py`
668
+ - `tools/5-task-management/create_current_session_bundle.py`
669
+ - `tools/5-task-management/restore_session.py`
670
+
671
+ ### Changed - Episodic Memory Enhanced
672
+
673
+ - **tools/4-memory/episodic.py** - Added `capture_git_state()` migrated from session system
674
+
675
+ ### Fixed - Test Suite
676
+
677
+ - **359 tests passing (100%)**
678
+ - Fixed import in `test_commit_validator.py`
679
+ - Fixed import in `test_episodic_memory.py`
680
+ - Updated `test_agent_definitions.py` for meta-agents
681
+ - Changed `test_hook_blocks_docker_ps` to `test_hook_default_permit_for_docker_ps`
682
+ - Fixed 11 warnings (return → assert)
683
+
684
+ ### Changed - Documentation
685
+
686
+ - **README.md & README.en.md** - Updated to v3.1.0, reduced 41%
687
+ - **All subdirectory READMEs** - Reduced 63% total (~2,025 lines removed)
688
+ - Eliminated all references to session system
689
+
690
+ ---
691
+
692
+ ## [3.0.0] - 2025-12-05
693
+
694
+ ### Added - Agent Intelligence System (MAJOR)
695
+
696
+ - **NEW:** `tools/10-agent-intelligence/` module for intelligent agent optimization
697
+ - `agent_writing_assistant.py` (24KB) - Assists in writing and improving agent definitions
698
+ - `workflow_optimizer.py` (29KB) - Applies the 7 LLM Engineering Principles to optimize workflows
699
+ - Binary Decision Trees
700
+ - Guards Over Advice
701
+ - Tool Contracts
702
+ - Failure Paths
703
+ - TL;DR First
704
+ - References Over Duplication
705
+ - Metrics Over Subjective Goals
706
+
707
+ - **NEW:** `tools/4-memory/` Episodic Memory System
708
+ - `episodic.py` (23KB) - Persistent storage and retrieval of historical context
709
+ - `demo.py` - Demonstration script for episodic memory
710
+ - Features:
711
+ - Automatic episode storage with keywords and classifications
712
+ - Smart search with time decay and relevance scoring
713
+ - Auto-classification of episode types (deployment, troubleshooting, etc.)
714
+ - Index management with automatic trimming (1000 episode limit)
715
+ - Audit trail with append-only JSONL file
716
+
717
+ - **NEW:** `tools/conversation/` Enhanced Conversation Management
718
+ - `enhanced_conversation_manager.py` (21KB) - Advanced conversation state management
719
+ - `agent_contract_builder.py` (19KB) - Dynamic agent contract generation
720
+ - `progressive_disclosure.py` (17KB) - Progressive context disclosure for token optimization
721
+
722
+ - **NEW:** `tests/workflow/` directory for workflow-specific tests
723
+ - **NEW:** `tests/test_agent_contract_integration.py` - Agent contract validation tests
724
+ - **NEW:** `tools/agent_capabilities.json` - Centralized agent capabilities definition
725
+
726
+ ### Changed - Agent Enhancements
727
+
728
+ - **agents/gaia.md** - Major refactoring (1707 lines changed)
729
+ - Streamlined agent definition
730
+ - Improved protocol definitions
731
+ - Better integration with new intelligence modules
732
+
733
+ - **agents/gitops-operator.md** - Enhanced with 234 new lines
734
+ - Improved Kubernetes operation patterns
735
+ - Better Flux CD integration guidance
736
+ - Enhanced troubleshooting protocols
737
+
738
+ - **agents/terraform-architect.md** - Enhanced with 47 new lines
739
+ - Improved Terragrunt support
740
+ - Better module design guidance
741
+ - Enhanced security scanning protocols
742
+
743
+ - **agents/gcp-troubleshooter.md** - Enhanced with 52 new lines
744
+ - Improved GKE diagnostics
745
+ - Better IAM analysis patterns
746
+ - Enhanced networking troubleshooting
747
+
748
+ ### Changed - Tools & Infrastructure
749
+
750
+ - **hooks/pre_tool_use.py** - Major enhancement (286+ lines)
751
+ - Improved security validations
752
+ - Better command blocking logic
753
+ - Enhanced credential detection
754
+
755
+ - **hooks/subagent_stop.py** - Enhanced with 193 new lines
756
+ - Better result packaging
757
+ - Improved bundle generation
758
+ - Enhanced session integration
759
+
760
+ - **tools/2-context/context_provider.py** - Enhanced (120+ lines changed)
761
+ - Better provider detection
762
+ - Improved contract validation
763
+ - Enhanced error handling
764
+
765
+ - **tools/3-clarification/workflow.py** - Major enhancement (162+ lines)
766
+ - Episodic memory integration
767
+ - Improved ambiguity detection
768
+ - Better context enrichment
769
+
770
+ - **tools/9-agent-framework/agent_orchestrator.py** - Enhanced (38+ lines)
771
+ - Better phase management
772
+ - Improved error recovery
773
+ - Enhanced logging
774
+
775
+ ### Changed - Fast Queries (Simplified)
776
+
777
+ - **tools/fast-queries/README.md** - Simplified documentation (185 lines changed)
778
+ - **tools/fast-queries/run_triage.sh** - Streamlined (152 lines changed)
779
+ - **tools/fast-queries/terraform/quicktriage_terraform_architect.sh** - Enhanced (90+ lines)
780
+ - **tools/fast-queries/gitops/quicktriage_gitops_operator.sh** - Enhanced (69+ lines)
781
+ - **tools/fast-queries/cloud/gcp/quicktriage_gcp_troubleshooter.sh** - Enhanced (99+ lines)
782
+
783
+ ### Removed (BREAKING)
784
+
785
+ - **REMOVED:** `tools/fast-queries/USAGE_GUIDE.md` (369 lines) - Consolidated into README
786
+ - **REMOVED:** `tools/fast-queries/appservices/quicktriage_devops_developer.sh` (38 lines)
787
+ - **REMOVED:** `tools/fast-queries/cloud/aws/quicktriage_aws_troubleshooter.sh` (45 lines)
788
+
789
+ ### Improved
790
+
791
+ - **Token Efficiency:** New progressive disclosure system reduces context by up to 70%
792
+ - **Agent Intelligence:** Workflows now validated against 7 engineering principles
793
+ - **Memory System:** Historical context improves routing accuracy over time
794
+ - **Conversation Management:** Multi-turn conversations with intelligent context carry-over
795
+ - **Test Coverage:** New workflow and integration tests
796
+
797
+ ### Migration Guide for v3.0.0
798
+
799
+ **Breaking Changes:**
800
+ 1. Removed `quicktriage_devops_developer.sh` - Use agent directly
801
+ 2. Removed `quicktriage_aws_troubleshooter.sh` - Use agent directly
802
+ 3. Removed `USAGE_GUIDE.md` - See README.md instead
803
+
804
+ **New Features to Adopt:**
805
+ ```python
806
+ # Episodic Memory
807
+ from tools.4_memory.episodic import EpisodicMemory
808
+ memory = EpisodicMemory()
809
+ memory.store_episode(prompt="...", context={...})
810
+
811
+ # Workflow Optimizer
812
+ from tools.10_agent_intelligence.workflow_optimizer import WorkflowOptimizer
813
+ optimizer = WorkflowOptimizer()
814
+ result = optimizer.analyze(workflow_content)
815
+
816
+ # Enhanced Conversation
817
+ from tools.conversation.enhanced_conversation_manager import EnhancedConversationManager
818
+ manager = EnhancedConversationManager()
819
+ ```
820
+
821
+ **Recommended Actions:**
822
+ - Review new agent definitions for improved patterns
823
+ - Enable episodic memory for better context over time
824
+ - Use workflow optimizer to validate custom workflows
825
+
826
+ ---
827
+
828
+ ## [2.6.2] - 2025-11-14
829
+
830
+ ### Added - Absolute Paths Support
831
+
832
+ - **NEW:** `normalizePath()` function - Handles both absolute and relative paths transparently
833
+ - **NEW:** CLI option `--project-context-repo` - Specify git repository for project context in non-interactive mode
834
+ - **NEW:** Environment variable `CLAUDE_PROJECT_CONTEXT_REPO` - Alternative way to specify context repo
835
+
836
+ ### Changed
837
+
838
+ - **`getConfiguration()`** - Now normalizes paths using `normalizePath()`
839
+ - **`validateAndSetupProjectPaths()`** - Enhanced to handle absolute paths correctly
840
+ - **CLI help and documentation** - Updated examples with absolute paths
841
+
842
+ ### Improved
843
+
844
+ - Path handling is now more robust and user-friendly
845
+ - Better error messages for path-related issues
846
+ - Clearer documentation and examples
847
+
848
+ ### Examples
849
+
850
+ ```bash
851
+ # Absolute paths without context repo
852
+ npx gaia-init --non-interactive \
853
+ --gitops /home/user/project/gitops \
854
+ --terraform /home/user/project/terraform \
855
+ --app-services /home/user/project/services
856
+
857
+ # Absolute paths with context repo
858
+ npx gaia-init --non-interactive \
859
+ --gitops /path/to/gitops \
860
+ --terraform /path/to/terraform \
861
+ --project-context-repo git@bitbucket.org:org/repo.git
862
+ ```
863
+
864
+ ---
865
+
866
+ ## [2.3.0] - 2025-11-11
867
+
868
+ ### Added - Phase 0 Clarification Module
869
+
870
+ - **NEW:** `tools/clarification/` module for intelligent ambiguity detection before routing
871
+ - `clarification/engine.py`: Core clarification engine (refactored from clarify_engine.py)
872
+ - `clarification/patterns.py`: Ambiguity detection patterns (ServiceAmbiguityPattern, NamespaceAmbiguityPattern, etc.)
873
+ - `clarification/workflow.py`: High-level helper functions for orchestrators (`execute_workflow()`)
874
+ - `clarification/__init__.py`: Clean public API
875
+ - **Protocol G** in `agents/gaia.md`: Clarification system analysis and troubleshooting guide
876
+ - **Rule 5.0.1** in `templates/CLAUDE.template.md`: Phase 0 implementation guide with code examples
877
+ - **Phase 0 integration** in `/speckit.specify` command
878
+ - **Regression tests** in `tests/integration/test_phase_0_regression.py`
879
+ - **Clarification metrics** to Key System Metrics (target: 20-30% clarification rate)
880
+
881
+ ### Changed - Module Restructuring (BREAKING)
882
+
883
+ - **BREAKING:** `clarify_engine.py` and `clarify_patterns.py` moved to `clarification/` module
884
+ - **Old imports:** `from clarify_engine import request_clarification`
885
+ - **New imports:** `from clarification import execute_workflow, request_clarification`
886
+ - Updated `application_services` structure in project-context.json:
887
+ - Added `tech_stack` field (replaces `technology`)
888
+ - Added `namespace` field for service location
889
+ - **Removed** `status` field (dynamic state must be verified in real-time, not stored in SSOT)
890
+ - Service metadata now shows only static information: `tech_stack | namespace | port`
891
+
892
+ ### Fixed
893
+
894
+ - Import paths in `tests/tools/test_clarify_engine.py` updated to new module structure
895
+ - Service metadata test updated to reflect removal of dynamic status field
896
+ - All 20 unit tests passing with new module structure
897
+
898
+ ### Migration Guide for v2.3.0
899
+
900
+ ```python
901
+ # Before (v2.2.x)
902
+ from clarify_engine import request_clarification, process_clarification
903
+
904
+ # After (v2.3.0)
905
+ from clarification import execute_workflow
906
+
907
+ # Simple usage
908
+ result = execute_workflow(user_prompt)
909
+ enriched_prompt = result["enriched_prompt"]
910
+ ```
911
+
912
+ ---
913
+
914
+ ## [2.2.3] - 2025-11-11
915
+
916
+ ### Fixed - Deterministic Project Context Location
917
+
918
+ - **context_provider.py**
919
+ - Always reads `.claude/project-context/project-context.json` (no fallback to legacy paths)
920
+ - Removed legacy auto-detection logic and unused imports
921
+ - Prevents "Context file not found" errors when projects only use the new structure
922
+ - **templates/CLAUDE.template.md**
923
+ - Rule 1 clarifies when to delegate vs. self-execute
924
+ - Rule 2 explicitly documents the `context_provider.py --context-file .claude/project-context/project-context.json …` invocation
925
+ - Workflow summary now references orchestration docs after the table (cleaner render)
926
+
927
+ ### Changed - CLI Documentation & Version Alignment
928
+
929
+ - **README.md / README.en.md**
930
+ - Documented the exact `npx` commands (`npx gaia-init` / `npx @jaguilar87/gaia-ops`) and clarified installation steps
931
+ - Updated "Current version" badges to **2.2.3**
932
+ - **package.json**
933
+ - Bumped package version to `2.2.3`
934
+
935
+ ### Benefits
936
+
937
+ - No manual tweaks needed to point `context_provider.py` at the correct project context
938
+ - CLAUDE template now tells the orchestrator exactly how to invoke the context provider
939
+ - README instructions reflect the real CLI entry points, reducing confusion for new installs
940
+
941
+ ---
942
+
943
+ ## [2.2.2] - 2025-11-11
944
+
945
+ ### Added - Pre-generated Semantic Embeddings
946
+
947
+ - **NEW:** Included pre-generated intent embeddings in package (74KB total)
948
+ - `config/intent_embeddings.json` (55KB) - Semantic vectors for intent matching
949
+ - `config/intent_embeddings.npy` (19KB) - Binary embeddings for fast loading
950
+ - `config/embeddings_info.json` (371B) - Metadata about embeddings
951
+
952
+ ### Changed - Semantic Routing Now Works Out-of-the-Box
953
+
954
+ - **Semantic matching enabled by default:** No manual setup required
955
+ - **Routing accuracy improved:** Ambiguous queries now route correctly using semantic similarity
956
+ - **Example improvement:**
957
+ ```
958
+ Query: "puede decirme el estado de los servicios de tcm?"
959
+ Before: devops-developer (keyword "ci" - incorrect)
960
+ After: gitops-operator (semantic matching - correct)
961
+ ```
962
+
963
+ ### Fixed - Directory Structure Consistency
964
+
965
+ - **Consolidated `configs/` into `config/`:** All configuration and data files now in single directory
966
+ - **Updated tool references:**
967
+ - `tools/semantic_matcher.py`: Updated embeddings path (configs/ → config/)
968
+ - `tools/generate_embeddings.py`: Updated output path (configs/ → config/)
969
+ - All documentation updated to reference correct paths
970
+
971
+ ### Fixed - Test Suite (254 tests, 100% passing)
972
+
973
+ - **tests/system/test_configuration_files.py:**
974
+ - Updated to validate `templates/settings.template.json` (package contains template, not installed settings.json)
975
+ - Tests now reflect npm package structure instead of installed project structure
976
+
977
+ - **tests/system/test_directory_structure.py:**
978
+ - Completely rewritten for npm package validation
979
+ - Tests now verify package directories (agents/, tools/, config/, templates/, bin/)
980
+ - Removed tests for installed-project structure (session/, .claude/ name)
981
+ - Added comprehensive tests for all package subdirectories (agents, tools, hooks, config, speckit)
982
+
983
+ - **tests/tools/test_clarify_engine.py:**
984
+ - Fixed import paths (tests/tools → gaia-ops/tools)
985
+ - Made emoji checks flexible (accepts any emoji, not just 📦)
986
+ - All 32 clarify_engine tests now pass
987
+
988
+ - **tests/tools/test_context_provider.py:**
989
+ - Updated troubleshooter contract test (application_services is optional, not required)
990
+ - Fixed invalid_agent test expectation (now correctly exits with code 1)
991
+
992
+ - **tools/context_provider.py:**
993
+ - Changed behavior for invalid agents: now exits with code 1 (was: warning + empty contract)
994
+ - Better error messages: "ERROR: Invalid agent" instead of "Warning: No contract found"
995
+
996
+ ### Benefits
997
+
998
+ - Zero configuration: Semantic routing works immediately after installation
999
+ - Better routing: Handles ambiguous queries with 6x higher confidence
1000
+ - Consistent structure: All config files in one place (`config/`)
1001
+ - Smaller package: Embeddings optimized for size (74KB vs 5MB unoptimized)
1002
+ - Regeneration optional: Users can regenerate with `python3 .claude/tools/generate_embeddings.py` if needed
1003
+ - Test coverage: 254 tests passing (0 failures)
1004
+
1005
+ ---
1006
+
1007
+ ## [2.2.1] - 2025-11-10
1008
+
1009
+ ### Fixed - Documentation Consistency
1010
+
1011
+ - **README.md & README.en.md:**
1012
+ - Updated version numbers from 2.1.0 → 2.2.0
1013
+ - Corrected package structure (hooks/, templates/, commands/)
1014
+ - Fixed hooks/ listing: now shows actual Python files (pre_tool_use.py, post_tool_use.py, etc.) instead of non-existent pre-commit
1015
+ - Fixed templates/ listing: removed non-existent code-examples/, listed actual files (CLAUDE.template.md, settings.template.json)
1016
+ - Added context-contracts.gcp.json and context-contracts.aws.json to config/ section
1017
+ - Removed CLAUDE.md and AGENTS.md from package root (only templates exist)
1018
+ - Added speckit/ directory to structure
1019
+
1020
+ - **config/AGENTS.md:**
1021
+ - Updated all references: `.claude/docs/` → `.claude/config/`
1022
+ - Fixed quick links and support documentation paths
1023
+
1024
+ - **config/agent-catalog.md:**
1025
+ - Updated all 5 context contract references: `.claude/docs/` → `.claude/config/`
1026
+
1027
+ - **index.js:**
1028
+ - Deprecated `getDocPath()` function with console warning
1029
+ - Function now redirects to `config/` directory instead of non-existent `docs/`
1030
+ - Added JSDoc @deprecated annotation
1031
+
1032
+ - **README.en.md (Documentation section):**
1033
+ - Removed broken reference to `./CLAUDE.md` (file not in package)
1034
+ - Fixed all documentation links: `./docs/` → `./config/`
1035
+ - Updated to match actual config/ directory structure
1036
+
1037
+ - **speckit/README.en.md:**
1038
+ - Removed 3 non-existent commands: speckit.clarify, speckit.analyze-plan, speckit.constitution
1039
+ - Updated command count: 9 → 7 actual commands
1040
+ - Removed references to non-existent tasks-richer.py tool
1041
+ - Removed entire sections for non-existent templates (data-model-template.md, contracts-template.md)
1042
+ - Updated tool files list with actual tools (task_manager.py, clarify_engine.py, context_provider.py)
1043
+ - Fixed all code examples to use only existing commands
1044
+
1045
+ - **tools/context_provider.py:**
1046
+ - Added auto-detection for project-context.json location
1047
+ - Honors GAIA_CONTEXT_PATH environment variable
1048
+ - Falls back through common locations (.claude/project-context.json, .claude/project-context/project-context.json)
1049
+ - Fixes agent routing failures when project-context.json is in non-legacy location
1050
+
1051
+ - **package.json:**
1052
+ - Fixed `npm test` script (was calling non-existent pytest tests)
1053
+ - Now echoes informative message about fixture availability
1054
+
1055
+ - **Agent Branding Unification:**
1056
+ - Renamed `agents/claude-architect.md` → `agents/gaia.md` (aligns with gaia-ops package name)
1057
+ - Renamed `commands/gaina.md` → `commands/gaia.md` (unified as `/gaia` command)
1058
+ - Updated all references in README.md, README.en.md, and agents/gaia.md
1059
+ - Complete branding consistency: package name, agent name, and command name all use "gaia"
1060
+
1061
+ ### Benefits
1062
+
1063
+ - Accurate documentation: All paths and structures match actual package contents
1064
+ - No broken links: References point to existing files
1065
+ - Clear API: Deprecated functions clearly marked
1066
+ - User trust: Documentation matches reality
1067
+ - npm test passes: No false failures
1068
+
1069
+ ---
1070
+
1071
+ ## [2.2.0] - 2025-11-10
1072
+
1073
+ ### Added - Unified Settings Template & Auto-Installation
1074
+
1075
+ - **NEW:** Created unified `templates/settings.template.json` (214 lines)
1076
+ - Merged functionality from `settings.json` + `settings.local.json`
1077
+ - Includes all hooks (PreToolUse, PostToolUse, SubagentStop)
1078
+ - Complete permissions (75+ allow, 9 deny, 27 ask entries)
1079
+ - Full security tier definitions (T0-T3)
1080
+ - Environment configuration
1081
+
1082
+ - **Auto-Installation:** `gaia-init.js` now automatically generates `.claude/settings.json`
1083
+ - Added `generateSettingsJson()` function
1084
+ - Integrated into installation workflow (Step 6.5)
1085
+ - Projects get complete settings from day 1
1086
+
1087
+ ### Removed - Dead Code Elimination
1088
+
1089
+ - **CLAUDE.md** from package root (only template exists now)
1090
+ - **templates/code-examples/** (321 lines - never imported or executed)
1091
+ - `commit_validation.py`
1092
+ - `clarification_workflow.py`
1093
+ - `approval_gate_workflow.py`
1094
+ - **templates/project-context.template.json** (126 lines - unused, installer generates programmatically)
1095
+ - **templates/project-context.template.aws.json** (128 lines - never used)
1096
+ - **package.json:** Removed `CLAUDE.md` from files array
1097
+
1098
+ ### Changed - Package Consistency
1099
+
1100
+ - **templates/CLAUDE.template.md:**
1101
+ - Updated all references: `.claude/docs/` → `.claude/config/`
1102
+ - Updated package name: `@aaxis/claude-agents` → `@jaguilar87/gaia-ops`
1103
+ - Removed code-examples reference (no longer exists)
1104
+
1105
+ - **README.en.md:**
1106
+ - Updated API examples to use `@jaguilar87/gaia-ops`
1107
+ - Changed `getDocPath()` → `getConfigPath()` (correct function)
1108
+
1109
+ - **index.js:**
1110
+ - Updated header and JSDoc comments with new package name
1111
+ - Updated example usage
1112
+
1113
+ - **agents/gaia.md:**
1114
+ - Updated system paths to reflect gaia-ops package structure
1115
+ - Clarified symlink architecture and layout
1116
+
1117
+ ### Improved - Package Quality
1118
+
1119
+ - **Reduced template bloat by 57%:** 882 lines → 378 lines (504 lines removed)
1120
+ - **Single source of truth:** One settings template instead of scattered config
1121
+ - **Cleaner architecture:** Only actual templates remain in `templates/`
1122
+ - **Better defaults:** Projects start with complete, production-ready settings
1123
+
1124
+ ### Benefits
1125
+
1126
+ - Unified configuration: Everything in one settings.json file
1127
+ - Automatic setup: No manual settings configuration needed
1128
+ - Smaller package: 57% reduction in template code
1129
+ - Flexibility maintained: Users can still create `settings.local.json` for overrides
1130
+ - Package consistency: All references use correct package name
1131
+
1132
+ ---
1133
+
1134
+ ## [2.1.0] - 2025-11-10
1135
+
1136
+ ### Added - Provider-Specific Context Contracts
1137
+
1138
+ - **NEW:** Created separate contract files per cloud provider
1139
+ - `config/context-contracts.gcp.json` - GCP-specific contracts
1140
+ - `config/context-contracts.aws.json` - AWS-specific contracts
1141
+ - Ready for `context-contracts.azure.json` (future)
1142
+
1143
+ - **Auto-Detection:** `context_provider.py` now automatically:
1144
+ 1. Detects cloud provider from `metadata.cloud_provider`
1145
+ 2. Falls back to inferring from field presence (`project_id` → GCP, `account_id` → AWS)
1146
+ 3. Loads the correct contract file
1147
+ 4. Validates against provider-specific requirements
1148
+
1149
+ - **Test Fixtures:** Added sample contexts for testing
1150
+ - `tests/fixtures/project-context.gcp.json`
1151
+ - `tests/fixtures/project-context.aws.json`
1152
+
1153
+ ### Changed
1154
+
1155
+ - **Context Provider:** Updated `tools/context_provider.py`
1156
+ - Added `detect_cloud_provider()` function
1157
+ - Added `load_provider_contracts()` function
1158
+ - Updated `get_contract_context()` to accept provider contracts
1159
+ - Legacy contracts remain for backward compatibility
1160
+
1161
+ - **Field Names:** Standardized provider-specific fields
1162
+ - GCP: `project_details.project_id` (no change)
1163
+ - AWS: `project_details.account_id` (was `aws_account`)
1164
+ - Installer updated to generate correct field names
1165
+
1166
+ - **Templates:** Created AWS-specific template
1167
+ - `templates/project-context.template.aws.json`
1168
+ - Matches AWS naming conventions (EKS, RDS, ECR, etc.)
1169
+
1170
+ - **Documentation:** Updated `config/context-contracts.md`
1171
+ - Added "Provider-Specific Contracts" section
1172
+ - Documented how provider detection works
1173
+ - Explained benefits of provider-specific approach
1174
+ - Version bumped to 2.1.0
1175
+
1176
+ ### Benefits
1177
+
1178
+ - Clarity: Field names match cloud provider terminology
1179
+ - Simplicity: No complex conditional validation logic in agents
1180
+ - Extensibility: Adding Azure = create one JSON file (15 minutes)
1181
+ - Agents Stay Agnostic: Agents use pattern discovery, don't need provider logic
1182
+ - Single Source of Truth: Orchestrator selects the right contract
1183
+
1184
+ ### Backward Compatibility
1185
+
1186
+ - Legacy support maintained: If provider-specific contracts don't exist, falls back to hardcoded contracts
1187
+ - Existing projects: Continue to work without changes
1188
+ - Migration: Optional, but recommended for clarity
1189
+
1190
+ ---
1191
+
1192
+ ## [1.4.0] - 2025-11-10
1193
+
1194
+ ### Changed - BREAKING: Complete Installer Redesign
1195
+
1196
+ - **NEW FLOW:** Directories first, context second (much more logical!)
1197
+ 1. Ask for directories (gitops, terraform, app-services) - ALWAYS
1198
+ 2. Ask for project context repo - OPTIONAL
1199
+ 3. If NO context: Ask basic questions to create project-context.json
1200
+ 4. If YES context: Use that configuration and done!
1201
+
1202
+ ### Improved
1203
+
1204
+ - **Clearer Purpose:** Context repo is now clearly optional
1205
+ - **Better Fallback:** If no context exists, creates a basic one with minimal info
1206
+ - **All Fields Optional:** Can leave everything empty if you don't know yet
1207
+ - **Logical Order:** Ask for what you always need first (paths), then optional context
1208
+
1209
+ ---
1210
+
1211
+ ## [1.3.6] - 2025-11-10
1212
+
1213
+ ### Fixed
1214
+
1215
+ - **Installer:** Skip questions when project context already has the answers
1216
+ - **Smart Detection:** Only ask what's missing or needs confirmation (paths)
1217
+ - **User Experience:** Show config summary when context is loaded
1218
+ - **Directory Creation:** Auto-create missing directories without prompting
1219
+
1220
+ ### Changed
1221
+
1222
+ - When project context loads successfully, only asks to confirm/adjust paths
1223
+ - Cloud provider, credentials, region, and cluster name auto-applied from context
1224
+ - Clearer feedback showing what was loaded from project context
1225
+ - Missing directories (gitops, terraform, app-services) now created automatically
1226
+
1227
+ ---
1228
+
1229
+ ## [1.3.5] - 2025-11-10
1230
+
1231
+ ### Added
1232
+
1233
+ - **Smart Installer Flow:** Project context repo now asked FIRST, with auto-population of all config
1234
+ - **Input Sanitization:** Handles "git clone <url>" pastes automatically (extracts just URL)
1235
+ - **Auto-Configuration:** Parses project-context.json and pre-fills all wizard questions
1236
+ - **Better Error Messages:** Clear troubleshooting tips for git clone failures (SSH keys, access, URL)
1237
+
1238
+ ### Changed
1239
+
1240
+ - **Wizard Question Order:** Project context moved from last to first question
1241
+ - **User Experience:** Reduced manual input when project context exists
1242
+ - **Clone Strategy:** Validates project context early, then sets up in final location
1243
+ - **Error Handling:** Installation continues even if project context clone fails
1244
+
1245
+ ---
1246
+
1247
+ ## [1.3.4] - 2025-11-10
1248
+
1249
+ ### Fixed
1250
+
1251
+ - **Installer:** Removed incorrect AGENTS.md symlink creation in project root during installation
1252
+ - **Documentation:** AGENTS.md now only accessible via `.claude/config/AGENTS.md` as intended
1253
+ - **Package Quality:** Excluded Python cache files (`__pycache__/`) from published package
1254
+
1255
+ ### Changed
1256
+
1257
+ - **README.md:** Updated project structure documentation to reflect correct AGENTS.md location
1258
+ - **README.en.md:** Updated project structure and corrected package references
1259
+ - **Package Size:** Reduced from 911.7 kB (93 files) to 660.7 kB (77 files) - 27% reduction
1260
+
1261
+ ### Added
1262
+
1263
+ - **Package Metadata:** Added `homepage` and `bugs` fields to package.json for better npm discovery
1264
+ - **Badges:** Added npm version, license, and Node.js version badges to README files
1265
+ - **CI/CD:** Created GitHub Actions workflow for automated npm publishing
1266
+ - **.npmignore:** Added file to exclude development artifacts from package
1267
+ - **Cleanup Script:** Added `npm run clean` to remove Python cache files automatically
1268
+ - **Pre-publish Hook:** Added `prepublishOnly` script for automatic cleanup before publishing
1269
+
1270
+ ---
1271
+
1272
+ ## Versioning Policy
1273
+
1274
+ ### Version Number Format: MAJOR.MINOR.PATCH
1275
+
1276
+ - **MAJOR:** Breaking changes to orchestrator behavior (requires agent updates, system changes)
1277
+ - **MINOR:** New features, sections, or substantial improvements (backward compatible)
1278
+ - **PATCH:** Bug fixes, clarifications, typos (backward compatible)
1279
+
1280
+ ### Examples
1281
+
1282
+ - Adding new agent: MINOR (e.g., 2.0.0 → 2.1.0)
1283
+ - Changing core principle: MAJOR (e.g., 2.1.0 → 3.0.0)
1284
+ - Fixing typo in docs: PATCH (e.g., 2.1.0 → 2.1.1)
1285
+ - Refactoring structure (like 2.0.0): MAJOR (changed from monolith to modular)
1286
+
1287
+ ---
1288
+
1289
+ ## Maintainers
1290
+
1291
+ - **Primary:** Jorge Aguilar (jorge.aguilar87@gmail.com)
1292
+ - **Contributors:** Claude Code Agent Swarm
1293
+
1294
+ ---
1295
+
1296
+ ## License
1297
+
1298
+ Internal documentation for Aaxis RnD team. Not for external distribution.