@jaguilar87/gaia 5.0.0-rc.3 → 5.0.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 (517) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/ARCHITECTURE.md +12 -14
  4. package/CHANGELOG.md +177 -6
  5. package/CONTRIBUTING.md +4 -2
  6. package/INSTALL.md +110 -112
  7. package/README.md +26 -21
  8. package/agents/README.md +3 -3
  9. package/agents/cloud-troubleshooter.md +44 -34
  10. package/agents/developer.md +34 -35
  11. package/agents/gaia-operator.md +55 -25
  12. package/agents/gaia-orchestrator.md +43 -53
  13. package/agents/gaia-planner.md +47 -27
  14. package/agents/gaia-system.md +66 -39
  15. package/agents/gitops-operator.md +41 -34
  16. package/agents/platform-architect.md +68 -0
  17. package/bin/README.md +72 -63
  18. package/bin/cli/_install_helpers.py +556 -0
  19. package/bin/cli/ac.py +322 -0
  20. package/bin/cli/approvals.py +1204 -53
  21. package/bin/cli/brief.py +1025 -0
  22. package/bin/cli/cleanup.py +3 -2
  23. package/bin/cli/context.py +371 -116
  24. package/bin/cli/doctor.py +935 -167
  25. package/bin/cli/evidence.py +393 -0
  26. package/bin/cli/history.py +57 -38
  27. package/bin/cli/install.py +822 -0
  28. package/bin/cli/memory.py +1768 -67
  29. package/bin/cli/metrics.py +12 -9
  30. package/bin/cli/milestone.py +303 -0
  31. package/bin/cli/paths.py +104 -0
  32. package/bin/cli/plan.py +397 -0
  33. package/bin/cli/plans.py +23 -23
  34. package/bin/cli/query.py +267 -0
  35. package/bin/cli/scan.py +463 -0
  36. package/bin/cli/status.py +143 -65
  37. package/bin/cli/task.py +279 -0
  38. package/bin/cli/uninstall.py +389 -0
  39. package/bin/cli/update.py +209 -134
  40. package/bin/cli/workspace.py +211 -0
  41. package/bin/pre-publish-validate.js +93 -0
  42. package/bin/validate-sandbox.sh +183 -12
  43. package/commands/README.md +1 -1
  44. package/commands/gaia.md +1 -1
  45. package/commands/scan-project.md +19 -12
  46. package/config/README.md +12 -15
  47. package/config/surface-routing.json +24 -9
  48. package/dist/gaia-ops/.claude-plugin/plugin.json +192 -2
  49. package/dist/gaia-ops/README.md +11 -12
  50. package/dist/gaia-ops/agents/cloud-troubleshooter.md +44 -34
  51. package/dist/gaia-ops/agents/developer.md +34 -35
  52. package/dist/gaia-ops/agents/gaia-operator.md +55 -25
  53. package/dist/gaia-ops/agents/gaia-orchestrator.md +43 -53
  54. package/dist/gaia-ops/agents/gaia-planner.md +47 -27
  55. package/dist/gaia-ops/agents/gaia-system.md +66 -39
  56. package/dist/gaia-ops/agents/gitops-operator.md +41 -34
  57. package/dist/gaia-ops/agents/platform-architect.md +68 -0
  58. package/dist/gaia-ops/commands/gaia.md +1 -1
  59. package/dist/gaia-ops/config/README.md +12 -15
  60. package/dist/gaia-ops/config/surface-routing.json +24 -9
  61. package/dist/gaia-ops/hooks/adapters/claude_code.py +217 -95
  62. package/dist/gaia-ops/hooks/hooks.json +19 -19
  63. package/dist/gaia-ops/hooks/modules/agents/contract_validator.py +380 -45
  64. package/dist/gaia-ops/hooks/modules/agents/handoff_persister.py +146 -0
  65. package/dist/gaia-ops/hooks/modules/agents/response_contract.py +207 -36
  66. package/dist/gaia-ops/hooks/modules/agents/skill_injection_verifier.py +1 -17
  67. package/dist/gaia-ops/hooks/modules/agents/state_tracker.py +14 -0
  68. package/dist/gaia-ops/hooks/modules/audit/workflow_auditor.py +61 -89
  69. package/dist/gaia-ops/hooks/modules/audit/workflow_recorder.py +48 -71
  70. package/dist/gaia-ops/hooks/modules/context/__init__.py +3 -3
  71. package/dist/gaia-ops/hooks/modules/context/anchor_tracker.py +1 -1
  72. package/dist/gaia-ops/hooks/modules/context/compact_context_builder.py +119 -76
  73. package/dist/gaia-ops/hooks/modules/context/context_freshness.py +67 -71
  74. package/dist/gaia-ops/hooks/modules/context/context_injector.py +135 -207
  75. package/dist/gaia-ops/hooks/modules/context/context_writer.py +366 -444
  76. package/dist/gaia-ops/hooks/modules/context/contracts_loader.py +100 -117
  77. package/dist/gaia-ops/hooks/modules/core/state.py +29 -1
  78. package/dist/gaia-ops/hooks/modules/core/workspace_bootstrap.py +91 -0
  79. package/dist/gaia-ops/hooks/modules/memory/episode_writer.py +7 -0
  80. package/dist/gaia-ops/hooks/modules/scanning/scan_trigger.py +3 -1
  81. package/dist/gaia-ops/hooks/modules/security/approval_cleanup.py +75 -4
  82. package/dist/gaia-ops/hooks/modules/security/approval_grants.py +647 -79
  83. package/dist/gaia-ops/hooks/modules/security/approval_messages.py +41 -1
  84. package/dist/gaia-ops/hooks/modules/security/approval_scopes.py +18 -32
  85. package/dist/gaia-ops/hooks/modules/security/blocked_commands.py +133 -5
  86. package/dist/gaia-ops/hooks/modules/security/blocked_message_formatter.py +3 -3
  87. package/dist/gaia-ops/hooks/modules/security/capability_classes.py +379 -0
  88. package/dist/gaia-ops/hooks/modules/security/command_semantics.py +87 -5
  89. package/dist/gaia-ops/hooks/modules/security/composition_rules.py +69 -0
  90. package/dist/gaia-ops/hooks/modules/security/gaia_db_write_guard.py +97 -0
  91. package/dist/gaia-ops/hooks/modules/security/inline_ast_analyzer.py +339 -0
  92. package/dist/gaia-ops/hooks/modules/security/mutative_verbs.py +563 -11
  93. package/dist/gaia-ops/hooks/modules/session/pending_scanner.py +18 -2
  94. package/dist/gaia-ops/hooks/modules/session/session_event_injector.py +1 -1
  95. package/dist/gaia-ops/hooks/modules/session/session_manifest.py +548 -0
  96. package/dist/gaia-ops/hooks/modules/session/session_registry.py +151 -145
  97. package/dist/gaia-ops/hooks/modules/tools/bash_validator.py +502 -110
  98. package/dist/gaia-ops/hooks/modules/tools/task_validator.py +5 -4
  99. package/dist/gaia-ops/hooks/post_compact.py +5 -1
  100. package/dist/gaia-ops/hooks/post_tool_use.py +5 -1
  101. package/dist/gaia-ops/hooks/pre_compact.py +5 -1
  102. package/dist/gaia-ops/hooks/pre_tool_use.py +5 -1
  103. package/dist/gaia-ops/hooks/session_end_hook.py +5 -1
  104. package/dist/gaia-ops/hooks/session_start.py +157 -7
  105. package/dist/gaia-ops/hooks/stop_hook.py +5 -1
  106. package/dist/gaia-ops/hooks/subagent_start.py +5 -17
  107. package/dist/gaia-ops/hooks/subagent_stop.py +46 -5
  108. package/dist/gaia-ops/hooks/task_completed.py +5 -1
  109. package/dist/gaia-ops/hooks/user_prompt_submit.py +31 -67
  110. package/dist/gaia-ops/skills/README.md +29 -28
  111. package/dist/gaia-ops/skills/agent-approval-protocol/SKILL.md +98 -0
  112. package/dist/gaia-ops/skills/agent-approval-protocol/reference.md +74 -0
  113. package/dist/gaia-ops/skills/agent-contract-handoff/SKILL.md +157 -0
  114. package/dist/gaia-ops/skills/agent-creation/SKILL.md +48 -35
  115. package/dist/gaia-ops/skills/agent-creation/examples.md +72 -65
  116. package/dist/gaia-ops/skills/agent-creation/reference.md +68 -26
  117. package/dist/gaia-ops/skills/agent-protocol/SKILL.md +58 -52
  118. package/dist/gaia-ops/skills/agent-protocol/examples.md +169 -59
  119. package/dist/gaia-ops/skills/agent-response/SKILL.md +42 -44
  120. package/dist/gaia-ops/skills/agentic-loop/SKILL.md +1 -1
  121. package/dist/gaia-ops/skills/brief-spec/SKILL.md +138 -17
  122. package/dist/gaia-ops/skills/command-execution/SKILL.md +12 -12
  123. package/dist/gaia-ops/skills/execution/SKILL.md +21 -13
  124. package/dist/gaia-ops/skills/gaia-audit/SKILL.md +119 -0
  125. package/dist/gaia-ops/skills/gaia-compact/SKILL.md +1 -1
  126. package/dist/gaia-ops/skills/gaia-patterns/SKILL.md +5 -6
  127. package/dist/gaia-ops/skills/gaia-patterns/reference.md +130 -75
  128. package/dist/gaia-ops/skills/gaia-planner/SKILL.md +140 -17
  129. package/dist/gaia-ops/skills/gaia-planner/reference.md +143 -56
  130. package/dist/gaia-ops/skills/gaia-release/SKILL.md +35 -60
  131. package/dist/gaia-ops/skills/gaia-release/reference.md +173 -84
  132. package/dist/gaia-ops/skills/gaia-verify/SKILL.md +6 -6
  133. package/dist/gaia-ops/skills/gaia-verify/reference.md +9 -9
  134. package/dist/gaia-ops/skills/investigation/SKILL.md +86 -87
  135. package/dist/gaia-ops/skills/jira-ticket-writing/SKILL.md +95 -0
  136. package/dist/gaia-ops/skills/jira-ticket-writing/examples.md +109 -0
  137. package/dist/gaia-ops/skills/memory/SKILL.md +399 -0
  138. package/dist/gaia-ops/skills/orchestrator-present-approval/SKILL.md +101 -0
  139. package/dist/gaia-ops/skills/orchestrator-present-approval/reference.md +264 -0
  140. package/dist/gaia-ops/skills/orchestrator-present-approval/template.md +49 -0
  141. package/dist/gaia-ops/skills/pending-approvals/SKILL.md +119 -54
  142. package/dist/gaia-ops/skills/pending-approvals/reference.md +60 -27
  143. package/dist/gaia-ops/skills/readme-writing/reference.md +1 -1
  144. package/dist/gaia-ops/skills/reference.md +1 -2
  145. package/dist/gaia-ops/skills/schedule-task/SKILL.md +1 -1
  146. package/dist/gaia-ops/skills/schedule-task/reference.md +1 -1
  147. package/dist/gaia-ops/skills/security-tiers/SKILL.md +35 -111
  148. package/dist/gaia-ops/skills/security-tiers/destructive-commands-reference.md +5 -4
  149. package/dist/gaia-ops/skills/security-tiers/reference.md +6 -0
  150. package/dist/gaia-ops/skills/session-reflection/SKILL.md +174 -45
  151. package/dist/gaia-ops/skills/skill-creation/SKILL.md +21 -14
  152. package/dist/gaia-ops/skills/skill-creation/examples.md +53 -0
  153. package/dist/gaia-ops/skills/skill-creation/reference.md +2 -18
  154. package/dist/gaia-ops/skills/subagent-request-approval/SKILL.md +86 -0
  155. package/dist/gaia-ops/skills/subagent-request-approval/reference.md +129 -0
  156. package/dist/gaia-ops/tools/context/README.md +21 -33
  157. package/dist/gaia-ops/tools/context/__init__.py +0 -2
  158. package/dist/gaia-ops/tools/context/context_provider.py +170 -194
  159. package/dist/gaia-ops/tools/gaia_simulator/runner.py +5 -31
  160. package/dist/gaia-ops/tools/memory/episodic.py +239 -149
  161. package/dist/gaia-ops/tools/migration/README.md +95 -0
  162. package/dist/gaia-ops/tools/migration/migrate_01_episodes.py +186 -0
  163. package/dist/gaia-ops/tools/migration/migrate_01_episodes.sh +21 -0
  164. package/dist/gaia-ops/tools/migration/migrate_02_memory.py +179 -0
  165. package/dist/gaia-ops/tools/migration/migrate_02_memory.sh +19 -0
  166. package/dist/gaia-ops/tools/migration/migrate_03_context_contracts.py +103 -0
  167. package/dist/gaia-ops/tools/migration/migrate_03_context_contracts.sh +19 -0
  168. package/dist/gaia-ops/tools/migration/migrate_04_harness_events.py +132 -0
  169. package/dist/gaia-ops/tools/migration/migrate_04_harness_events.sh +23 -0
  170. package/dist/gaia-ops/tools/migration/migrate_05_briefs.py +307 -0
  171. package/dist/gaia-ops/tools/migration/migrate_06_state_machines.py +441 -0
  172. package/dist/gaia-ops/tools/migration/migrate_07_plans_content.py +124 -0
  173. package/dist/gaia-ops/tools/migration/migrate_08_rename_workspace.py +513 -0
  174. package/dist/gaia-ops/tools/migration/validate.sh +68 -0
  175. package/dist/gaia-ops/tools/scan/config.py +6 -28
  176. package/dist/gaia-ops/tools/scan/core.py +441 -0
  177. package/dist/gaia-ops/tools/scan/merge.py +3 -2
  178. package/dist/gaia-ops/tools/scan/migrate_workspace.py +249 -0
  179. package/dist/gaia-ops/tools/scan/orchestrator.py +35 -174
  180. package/dist/gaia-ops/tools/scan/role_detector.py +198 -0
  181. package/dist/gaia-ops/tools/scan/seed_contract_permissions.py +327 -0
  182. package/dist/gaia-ops/tools/scan/store_populator.py +1818 -0
  183. package/dist/gaia-ops/tools/scan/tests/test_core.py +190 -0
  184. package/dist/gaia-ops/tools/scan/tests/test_integration.py +42 -113
  185. package/dist/gaia-ops/tools/scan/tests/test_store_populator.py +345 -0
  186. package/dist/gaia-ops/tools/scan/ui.py +31 -12
  187. package/dist/gaia-ops/tools/scan/verify.py +39 -24
  188. package/dist/gaia-ops/tools/scan/workspace.py +33 -8
  189. package/dist/gaia-ops/tools/state/__init__.py +1 -0
  190. package/dist/gaia-ops/tools/state/diff_source_of_truth.py +150 -0
  191. package/dist/gaia-ops/tools/validation/README.md +1 -1
  192. package/dist/gaia-security/.claude-plugin/plugin.json +113 -2
  193. package/dist/gaia-security/README.md +0 -2
  194. package/dist/gaia-security/hooks/adapters/claude_code.py +217 -95
  195. package/dist/gaia-security/hooks/hooks.json +11 -11
  196. package/dist/gaia-security/hooks/modules/agents/contract_validator.py +380 -45
  197. package/dist/gaia-security/hooks/modules/agents/handoff_persister.py +146 -0
  198. package/dist/gaia-security/hooks/modules/agents/response_contract.py +207 -36
  199. package/dist/gaia-security/hooks/modules/agents/skill_injection_verifier.py +1 -17
  200. package/dist/gaia-security/hooks/modules/agents/state_tracker.py +14 -0
  201. package/dist/gaia-security/hooks/modules/audit/workflow_auditor.py +61 -89
  202. package/dist/gaia-security/hooks/modules/audit/workflow_recorder.py +48 -71
  203. package/dist/gaia-security/hooks/modules/context/__init__.py +3 -3
  204. package/dist/gaia-security/hooks/modules/context/anchor_tracker.py +1 -1
  205. package/dist/gaia-security/hooks/modules/context/compact_context_builder.py +119 -76
  206. package/dist/gaia-security/hooks/modules/context/context_freshness.py +67 -71
  207. package/dist/gaia-security/hooks/modules/context/context_injector.py +135 -207
  208. package/dist/gaia-security/hooks/modules/context/context_writer.py +366 -444
  209. package/dist/gaia-security/hooks/modules/context/contracts_loader.py +100 -117
  210. package/dist/gaia-security/hooks/modules/core/state.py +29 -1
  211. package/dist/gaia-security/hooks/modules/core/workspace_bootstrap.py +91 -0
  212. package/dist/gaia-security/hooks/modules/memory/episode_writer.py +7 -0
  213. package/dist/gaia-security/hooks/modules/scanning/scan_trigger.py +3 -1
  214. package/dist/gaia-security/hooks/modules/security/approval_cleanup.py +75 -4
  215. package/dist/gaia-security/hooks/modules/security/approval_grants.py +647 -79
  216. package/dist/gaia-security/hooks/modules/security/approval_messages.py +41 -1
  217. package/dist/gaia-security/hooks/modules/security/approval_scopes.py +18 -32
  218. package/dist/gaia-security/hooks/modules/security/blocked_commands.py +133 -5
  219. package/dist/gaia-security/hooks/modules/security/blocked_message_formatter.py +3 -3
  220. package/dist/gaia-security/hooks/modules/security/capability_classes.py +379 -0
  221. package/dist/gaia-security/hooks/modules/security/command_semantics.py +87 -5
  222. package/dist/gaia-security/hooks/modules/security/composition_rules.py +69 -0
  223. package/dist/gaia-security/hooks/modules/security/gaia_db_write_guard.py +97 -0
  224. package/dist/gaia-security/hooks/modules/security/inline_ast_analyzer.py +339 -0
  225. package/dist/gaia-security/hooks/modules/security/mutative_verbs.py +563 -11
  226. package/dist/gaia-security/hooks/modules/session/pending_scanner.py +18 -2
  227. package/dist/gaia-security/hooks/modules/session/session_event_injector.py +1 -1
  228. package/dist/gaia-security/hooks/modules/session/session_manifest.py +548 -0
  229. package/dist/gaia-security/hooks/modules/session/session_registry.py +151 -145
  230. package/dist/gaia-security/hooks/modules/tools/bash_validator.py +502 -110
  231. package/dist/gaia-security/hooks/modules/tools/task_validator.py +5 -4
  232. package/dist/gaia-security/hooks/post_tool_use.py +5 -1
  233. package/dist/gaia-security/hooks/pre_tool_use.py +5 -1
  234. package/dist/gaia-security/hooks/session_end_hook.py +5 -1
  235. package/dist/gaia-security/hooks/session_start.py +157 -7
  236. package/dist/gaia-security/hooks/stop_hook.py +5 -1
  237. package/dist/gaia-security/hooks/user_prompt_submit.py +31 -67
  238. package/gaia/README.md +136 -0
  239. package/gaia/__init__.py +21 -0
  240. package/gaia/approvals/__init__.py +17 -0
  241. package/gaia/approvals/chain.py +268 -0
  242. package/gaia/approvals/display.py +235 -0
  243. package/gaia/approvals/revert.py +282 -0
  244. package/gaia/approvals/store.py +752 -0
  245. package/gaia/briefs/__init__.py +62 -0
  246. package/gaia/briefs/serializer.py +683 -0
  247. package/gaia/briefs/store.py +1098 -0
  248. package/gaia/evidence/__init__.py +5 -0
  249. package/gaia/evidence/fs.py +123 -0
  250. package/gaia/evidence/store.py +265 -0
  251. package/gaia/paths/README.md +32 -0
  252. package/gaia/paths/__init__.py +65 -0
  253. package/gaia/paths/layout.py +47 -0
  254. package/gaia/paths/resolver.py +107 -0
  255. package/gaia/project.py +314 -0
  256. package/gaia/state/__init__.py +132 -0
  257. package/gaia/state/check_clauses.py +61 -0
  258. package/gaia/state/permissions.py +117 -0
  259. package/gaia/state/transitions.py +140 -0
  260. package/gaia/store/NOTICE.md +49 -0
  261. package/gaia/store/__init__.py +42 -0
  262. package/gaia/store/provider.py +170 -0
  263. package/gaia/store/reader.py +545 -0
  264. package/gaia/store/schema.sql +965 -0
  265. package/gaia/store/writer.py +3595 -0
  266. package/hooks/README.md +20 -9
  267. package/hooks/adapters/claude_code.py +217 -95
  268. package/hooks/elicitation_result.py +35 -3
  269. package/hooks/hooks.json +21 -16
  270. package/hooks/modules/README.md +2 -2
  271. package/hooks/modules/agents/contract_validator.py +380 -45
  272. package/hooks/modules/agents/handoff_persister.py +146 -0
  273. package/hooks/modules/agents/response_contract.py +207 -36
  274. package/hooks/modules/agents/skill_injection_verifier.py +1 -17
  275. package/hooks/modules/agents/state_tracker.py +14 -0
  276. package/hooks/modules/audit/workflow_auditor.py +61 -89
  277. package/hooks/modules/audit/workflow_recorder.py +48 -71
  278. package/hooks/modules/context/__init__.py +3 -3
  279. package/hooks/modules/context/anchor_tracker.py +1 -1
  280. package/hooks/modules/context/compact_context_builder.py +119 -76
  281. package/hooks/modules/context/context_freshness.py +67 -71
  282. package/hooks/modules/context/context_injector.py +135 -207
  283. package/hooks/modules/context/context_writer.py +366 -444
  284. package/hooks/modules/context/contracts_loader.py +100 -117
  285. package/hooks/modules/core/state.py +29 -1
  286. package/hooks/modules/core/workspace_bootstrap.py +91 -0
  287. package/hooks/modules/install_detector.py +186 -0
  288. package/hooks/modules/memory/episode_writer.py +7 -0
  289. package/hooks/modules/scanning/scan_trigger.py +3 -1
  290. package/hooks/modules/security/approval_cleanup.py +75 -4
  291. package/hooks/modules/security/approval_grants.py +647 -79
  292. package/hooks/modules/security/approval_messages.py +41 -1
  293. package/hooks/modules/security/approval_scopes.py +18 -32
  294. package/hooks/modules/security/blocked_commands.py +133 -5
  295. package/hooks/modules/security/blocked_message_formatter.py +3 -3
  296. package/hooks/modules/security/capability_classes.py +379 -0
  297. package/hooks/modules/security/command_semantics.py +87 -5
  298. package/hooks/modules/security/composition_rules.py +69 -0
  299. package/hooks/modules/security/gaia_db_write_guard.py +97 -0
  300. package/hooks/modules/security/inline_ast_analyzer.py +339 -0
  301. package/hooks/modules/security/mutative_verbs.py +563 -11
  302. package/hooks/modules/session/pending_scanner.py +18 -2
  303. package/hooks/modules/session/session_event_injector.py +1 -1
  304. package/hooks/modules/session/session_manifest.py +548 -0
  305. package/hooks/modules/session/session_registry.py +151 -145
  306. package/hooks/modules/tools/bash_validator.py +502 -110
  307. package/hooks/modules/tools/task_validator.py +5 -4
  308. package/hooks/post_compact.py +5 -1
  309. package/hooks/post_tool_use.py +5 -1
  310. package/hooks/pre_compact.py +5 -1
  311. package/hooks/pre_tool_use.py +5 -1
  312. package/hooks/session_end_hook.py +5 -1
  313. package/hooks/session_start.py +157 -7
  314. package/hooks/stop_hook.py +5 -1
  315. package/hooks/subagent_start.py +5 -17
  316. package/hooks/subagent_stop.py +46 -5
  317. package/hooks/task_completed.py +5 -1
  318. package/hooks/user_prompt_submit.py +31 -67
  319. package/package.json +8 -21
  320. package/pyproject.toml +5 -2
  321. package/scripts/bootstrap_database.sh +851 -0
  322. package/scripts/build-plugin.py +439 -0
  323. package/scripts/migrations/README.md +63 -0
  324. package/scripts/migrations/v10_to_v11.sql +170 -0
  325. package/scripts/migrations/v10_to_v11_fresh.sql +18 -0
  326. package/scripts/migrations/v11_to_v12.sql +195 -0
  327. package/scripts/migrations/v11_to_v12_fresh.sql +19 -0
  328. package/scripts/migrations/v12_to_v13.sql +48 -0
  329. package/scripts/migrations/v12_to_v13_fresh.sql +17 -0
  330. package/scripts/migrations/v13_to_v14.sql +44 -0
  331. package/scripts/migrations/v13_to_v14_fresh.sql +17 -0
  332. package/scripts/migrations/v14_to_v15.sql +71 -0
  333. package/scripts/migrations/v14_to_v15_fresh.sql +19 -0
  334. package/scripts/migrations/v15_to_v16.sql +57 -0
  335. package/scripts/migrations/v15_to_v16_fresh.sql +18 -0
  336. package/scripts/migrations/v16_to_v17.sql +51 -0
  337. package/scripts/migrations/v16_to_v17_fresh.sql +18 -0
  338. package/scripts/migrations/v17_to_v18.sql +66 -0
  339. package/scripts/migrations/v17_to_v18_fresh.sql +24 -0
  340. package/scripts/migrations/v1_to_v2.sql +97 -0
  341. package/scripts/migrations/v2_to_v3.sql +68 -0
  342. package/scripts/migrations/v2_to_v3_merge.sql +69 -0
  343. package/scripts/migrations/v3_to_v4.sql +67 -0
  344. package/scripts/migrations/v3_to_v4_fresh.sql +20 -0
  345. package/scripts/migrations/v4_to_v5.sql +55 -0
  346. package/scripts/migrations/v4_to_v5_fresh.sql +20 -0
  347. package/scripts/migrations/v5_to_v6.sql +48 -0
  348. package/scripts/migrations/v5_to_v6_fresh.sql +17 -0
  349. package/scripts/migrations/v6_to_v7.sql +26 -0
  350. package/scripts/migrations/v6_to_v7_fresh.sql +13 -0
  351. package/scripts/migrations/v7_to_v8.sql +44 -0
  352. package/scripts/migrations/v7_to_v8_fresh.sql +14 -0
  353. package/scripts/migrations/v8_to_v9.sql +87 -0
  354. package/scripts/migrations/v8_to_v9_fresh.sql +15 -0
  355. package/scripts/migrations/v9_to_v10.sql +109 -0
  356. package/scripts/migrations/v9_to_v10_episodes_workspace.sql +109 -0
  357. package/scripts/migrations/v9_to_v10_fresh.sql +18 -0
  358. package/scripts/seed_agent_permissions.py +166 -0
  359. package/skills/README.md +29 -28
  360. package/skills/agent-approval-protocol/SKILL.md +98 -0
  361. package/skills/agent-approval-protocol/reference.md +74 -0
  362. package/skills/agent-contract-handoff/SKILL.md +157 -0
  363. package/skills/agent-creation/SKILL.md +48 -35
  364. package/skills/agent-creation/examples.md +72 -65
  365. package/skills/agent-creation/reference.md +68 -26
  366. package/skills/agent-protocol/SKILL.md +58 -52
  367. package/skills/agent-protocol/examples.md +169 -59
  368. package/skills/agent-response/SKILL.md +42 -44
  369. package/skills/agentic-loop/SKILL.md +1 -1
  370. package/skills/brief-spec/SKILL.md +138 -17
  371. package/skills/command-execution/SKILL.md +12 -12
  372. package/skills/execution/SKILL.md +21 -13
  373. package/skills/gaia-audit/SKILL.md +119 -0
  374. package/skills/gaia-compact/SKILL.md +1 -1
  375. package/skills/gaia-patterns/SKILL.md +5 -6
  376. package/skills/gaia-patterns/reference.md +130 -75
  377. package/skills/gaia-planner/SKILL.md +140 -17
  378. package/skills/gaia-planner/reference.md +143 -56
  379. package/skills/gaia-release/SKILL.md +35 -60
  380. package/skills/gaia-release/reference.md +173 -84
  381. package/skills/gaia-verify/SKILL.md +6 -6
  382. package/skills/gaia-verify/reference.md +9 -9
  383. package/skills/investigation/SKILL.md +86 -87
  384. package/skills/jira-ticket-writing/SKILL.md +95 -0
  385. package/skills/jira-ticket-writing/examples.md +109 -0
  386. package/skills/memory/SKILL.md +399 -0
  387. package/skills/orchestrator-present-approval/SKILL.md +101 -0
  388. package/skills/orchestrator-present-approval/reference.md +264 -0
  389. package/skills/orchestrator-present-approval/template.md +49 -0
  390. package/skills/pending-approvals/SKILL.md +119 -54
  391. package/skills/pending-approvals/reference.md +60 -27
  392. package/skills/readme-writing/reference.md +1 -1
  393. package/skills/reference.md +1 -2
  394. package/skills/schedule-task/SKILL.md +1 -1
  395. package/skills/schedule-task/reference.md +1 -1
  396. package/skills/security-tiers/SKILL.md +35 -111
  397. package/skills/security-tiers/destructive-commands-reference.md +5 -4
  398. package/skills/security-tiers/reference.md +6 -0
  399. package/skills/session-reflection/SKILL.md +174 -45
  400. package/skills/skill-creation/SKILL.md +21 -14
  401. package/skills/skill-creation/examples.md +53 -0
  402. package/skills/skill-creation/reference.md +2 -18
  403. package/skills/subagent-request-approval/SKILL.md +86 -0
  404. package/skills/subagent-request-approval/reference.md +129 -0
  405. package/templates/README.md +14 -13
  406. package/tools/context/README.md +21 -33
  407. package/tools/context/__init__.py +0 -2
  408. package/tools/context/context_provider.py +170 -194
  409. package/tools/gaia_simulator/runner.py +5 -31
  410. package/tools/memory/episodic.py +239 -149
  411. package/tools/migration/README.md +95 -0
  412. package/tools/migration/migrate_01_episodes.py +186 -0
  413. package/tools/migration/migrate_01_episodes.sh +21 -0
  414. package/tools/migration/migrate_02_memory.py +179 -0
  415. package/tools/migration/migrate_02_memory.sh +19 -0
  416. package/tools/migration/migrate_03_context_contracts.py +103 -0
  417. package/tools/migration/migrate_03_context_contracts.sh +19 -0
  418. package/tools/migration/migrate_04_harness_events.py +132 -0
  419. package/tools/migration/migrate_04_harness_events.sh +23 -0
  420. package/tools/migration/migrate_05_briefs.py +307 -0
  421. package/tools/migration/migrate_06_state_machines.py +441 -0
  422. package/tools/migration/migrate_07_plans_content.py +124 -0
  423. package/tools/migration/migrate_08_rename_workspace.py +513 -0
  424. package/tools/migration/validate.sh +68 -0
  425. package/tools/scan/config.py +6 -28
  426. package/tools/scan/core.py +441 -0
  427. package/tools/scan/merge.py +3 -2
  428. package/tools/scan/migrate_workspace.py +249 -0
  429. package/tools/scan/orchestrator.py +35 -174
  430. package/tools/scan/role_detector.py +198 -0
  431. package/tools/scan/seed_contract_permissions.py +327 -0
  432. package/tools/scan/store_populator.py +1818 -0
  433. package/tools/scan/tests/test_core.py +190 -0
  434. package/tools/scan/tests/test_integration.py +42 -113
  435. package/tools/scan/tests/test_store_populator.py +345 -0
  436. package/tools/scan/ui.py +31 -12
  437. package/tools/scan/verify.py +39 -24
  438. package/tools/scan/workspace.py +33 -8
  439. package/tools/state/__init__.py +1 -0
  440. package/tools/state/diff_source_of_truth.py +150 -0
  441. package/tools/validation/README.md +1 -1
  442. package/agents/terraform-architect.md +0 -63
  443. package/bin/gaia-cleanup.js +0 -531
  444. package/bin/gaia-doctor.js +0 -635
  445. package/bin/gaia-evidence +0 -126
  446. package/bin/gaia-history.js +0 -251
  447. package/bin/gaia-metrics.js +0 -1278
  448. package/bin/gaia-review.js +0 -269
  449. package/bin/gaia-scan +0 -44
  450. package/bin/gaia-scan.py +0 -589
  451. package/bin/gaia-skills-diagnose.js +0 -929
  452. package/bin/gaia-status.js +0 -278
  453. package/bin/gaia-uninstall.js +0 -111
  454. package/bin/gaia-update.js +0 -919
  455. package/config/cloud/aws.json +0 -134
  456. package/config/cloud/gcp.json +0 -139
  457. package/config/context-contracts.json +0 -158
  458. package/config/universal-rules.json +0 -102
  459. package/dist/gaia-ops/agents/terraform-architect.md +0 -63
  460. package/dist/gaia-ops/config/cloud/aws.json +0 -134
  461. package/dist/gaia-ops/config/cloud/gcp.json +0 -139
  462. package/dist/gaia-ops/config/context-contracts.json +0 -158
  463. package/dist/gaia-ops/config/universal-rules.json +0 -102
  464. package/dist/gaia-ops/settings.json +0 -72
  465. package/dist/gaia-ops/skills/context-updater/SKILL.md +0 -87
  466. package/dist/gaia-ops/skills/context-updater/examples.md +0 -71
  467. package/dist/gaia-ops/skills/developer-patterns/SKILL.md +0 -50
  468. package/dist/gaia-ops/skills/developer-patterns/reference.md +0 -112
  469. package/dist/gaia-ops/skills/gaia-self-check/SKILL.md +0 -114
  470. package/dist/gaia-ops/skills/gaia-self-check/reference.md +0 -453
  471. package/dist/gaia-ops/skills/gitops-patterns/SKILL.md +0 -60
  472. package/dist/gaia-ops/skills/gitops-patterns/reference.md +0 -183
  473. package/dist/gaia-ops/skills/memory-curation/SKILL.md +0 -83
  474. package/dist/gaia-ops/skills/memory-search/SKILL.md +0 -88
  475. package/dist/gaia-ops/skills/orchestrator-approval/SKILL.md +0 -160
  476. package/dist/gaia-ops/skills/orchestrator-approval/reference.md +0 -174
  477. package/dist/gaia-ops/skills/request-approval/SKILL.md +0 -140
  478. package/dist/gaia-ops/skills/request-approval/examples.md +0 -140
  479. package/dist/gaia-ops/skills/request-approval/reference.md +0 -57
  480. package/dist/gaia-ops/skills/terraform-patterns/SKILL.md +0 -89
  481. package/dist/gaia-ops/skills/terraform-patterns/reference.md +0 -93
  482. package/dist/gaia-ops/tools/context/context_section_reader.py +0 -342
  483. package/dist/gaia-ops/tools/context/pending_updates.py +0 -760
  484. package/dist/gaia-ops/tools/persist_transcript_analysis.py +0 -85
  485. package/dist/gaia-ops/tools/review/__init__.py +0 -1
  486. package/dist/gaia-ops/tools/review/review_engine.py +0 -157
  487. package/dist/gaia-ops/tools/scan/setup.py +0 -686
  488. package/dist/gaia-security/config/universal-rules.json +0 -102
  489. package/dist/gaia-security/settings.json +0 -58
  490. package/hooks/modules/evidence/__init__.py +0 -34
  491. package/hooks/modules/evidence/assertions.py +0 -137
  492. package/hooks/modules/evidence/index_writer.py +0 -57
  493. package/hooks/modules/evidence/loader.py +0 -126
  494. package/hooks/modules/evidence/runner.py +0 -241
  495. package/skills/context-updater/SKILL.md +0 -87
  496. package/skills/context-updater/examples.md +0 -71
  497. package/skills/developer-patterns/SKILL.md +0 -50
  498. package/skills/developer-patterns/reference.md +0 -112
  499. package/skills/gaia-self-check/SKILL.md +0 -114
  500. package/skills/gaia-self-check/reference.md +0 -453
  501. package/skills/gitops-patterns/SKILL.md +0 -60
  502. package/skills/gitops-patterns/reference.md +0 -183
  503. package/skills/memory-curation/SKILL.md +0 -83
  504. package/skills/memory-search/SKILL.md +0 -88
  505. package/skills/orchestrator-approval/SKILL.md +0 -160
  506. package/skills/orchestrator-approval/reference.md +0 -174
  507. package/skills/request-approval/SKILL.md +0 -140
  508. package/skills/request-approval/examples.md +0 -140
  509. package/skills/request-approval/reference.md +0 -57
  510. package/skills/terraform-patterns/SKILL.md +0 -89
  511. package/skills/terraform-patterns/reference.md +0 -93
  512. package/tools/context/context_section_reader.py +0 -342
  513. package/tools/context/pending_updates.py +0 -760
  514. package/tools/persist_transcript_analysis.py +0 -85
  515. package/tools/review/__init__.py +0 -1
  516. package/tools/review/review_engine.py +0 -157
  517. package/tools/scan/setup.py +0 -686
@@ -8,7 +8,7 @@
8
8
  {
9
9
  "name": "gaia-ops",
10
10
  "description": "Full DevOps orchestration for Claude Code. Eight specialized agents handle the complete development lifecycle — analysis, planning, execution, and deployment. Gaia-Ops scans your codebase to understand it and injects the right context into each sub-agent. Every command is classified by risk: read-only runs freely, state changes pause for your approval, and irreversible operations are permanently blocked.",
11
- "version": "5.0.0-rc.3",
11
+ "version": "5.0.2",
12
12
  "category": "devops",
13
13
  "author": {
14
14
  "name": "jaguilar87",
@@ -20,7 +20,7 @@
20
20
  {
21
21
  "name": "gaia-security",
22
22
  "description": "Keeps you in the loop only when it matters. Gaia Security analyzes every command and classifies it into risk tiers: read-only queries run freely, simulations and validations pass through, and state-changing operations (create, delete, apply, push) pause for your explicit approval before executing. Irreversible commands like dropping databases or deleting cloud infrastructure are permanently blocked.",
23
- "version": "5.0.0-rc.3",
23
+ "version": "5.0.2",
24
24
  "category": "security",
25
25
  "author": {
26
26
  "name": "jaguilar87",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaia-ops",
3
- "version": "5.0.0-rc.3",
3
+ "version": "5.0.2",
4
4
  "description": "Security-first orchestrator with specialized agents, hooks, and governance for AI coding",
5
5
  "author": {
6
6
  "name": "jaguilar87",
package/ARCHITECTURE.md CHANGED
@@ -38,7 +38,7 @@ pre_tool_use.py (PreToolUse hook)
38
38
  | 4. Validate SendMessage (agent resumption)
39
39
  v
40
40
  Agent executes
41
- | Uses tools, follows skills, emits json:contract
41
+ | Uses tools, follows skills, emits agent_contract_handoff
42
42
  v
43
43
  subagent_stop.py (SubagentStop hook)
44
44
  | 1. Read transcript, extract task description
@@ -46,9 +46,9 @@ subagent_stop.py (SubagentStop hook)
46
46
  | 3. Validate response contract
47
47
  | 4. Detect anomalies
48
48
  | 5. Store episodic memory
49
- | 6. Process CONTEXT_UPDATE blocks
49
+ | 6. Process update_contracts from the agent_contract_handoff envelope
50
50
  v
51
- Orchestrator processes json:contract (via agent-response skill)
51
+ Orchestrator processes agent_contract_handoff (via agent-response skill)
52
52
  | COMPLETE -> summarize to user
53
53
  | APPROVAL_REQUEST (with approval_id) -> get approval -> resume via SendMessage
54
54
  | NEEDS_INPUT -> ask user -> resume via SendMessage
@@ -108,7 +108,7 @@ Fires after every agent tool completes:
108
108
  4. Detect anomalies --> execution failures, consecutive failures
109
109
  | If anomalies found -> create needs_analysis.flag for Gaia
110
110
  5. Capture episodic memory --> store episode via tools/memory/episodic.py
111
- 6. Process context updates --> apply CONTEXT_UPDATE blocks via context_writer.py
111
+ 6. Process context updates --> apply update_contracts entries from the agent_contract_handoff envelope via context_writer.py (process_update_contracts)
112
112
  ```
113
113
 
114
114
  ## Surface Routing: surface_router.py
@@ -119,7 +119,7 @@ Classifies user tasks into surfaces using signal matching against `config/surfac
119
119
  |---------|--------------|-----------------|
120
120
  | `live_runtime` | cloud-troubleshooter | pods, services, logs, kubectl, gcloud |
121
121
  | `gitops_desired_state` | gitops-operator | manifests, Flux, Helm, Kustomize |
122
- | `terraform_iac` | terraform-architect | Terraform, Terragrunt, IAM, modules |
122
+ | `iac` | platform-architect | Terraform, Terragrunt, IAM, modules |
123
123
  | `app_ci_tooling` | developer | CI/CD, Docker, package tooling |
124
124
  | `planning_specs` | gaia-planner | briefs, plans (materializados cuando una conversación alcanza Cerrar) |
125
125
  | `gaia_system` | gaia-system | hooks, skills, agents/, CLAUDE.md |
@@ -141,12 +141,11 @@ Assembles the context payload injected into agent prompts by pre_tool_use.py.
141
141
  ```
142
142
  context_provider.py <agent_name> <user_task>
143
143
  |
144
- +--> Load project-context.json
145
- +--> Detect cloud provider (GCP/AWS)
146
- +--> Load base contracts (config/context-contracts.json)
144
+ +--> Load project context from ~/.gaia/gaia.db (project_context_contracts table)
145
+ +--> Detect cloud provider (GCP/AWS) from DB workspace record
146
+ +--> Load base contracts from DB (agent_contract_permissions table)
147
147
  +--> Merge cloud overrides (config/cloud/{provider}.json)
148
148
  +--> Extract contracted sections for this agent (read permissions)
149
- +--> Load universal rules (config/universal-rules.json)
150
149
  +--> Load relevant episodic memory (similarity match)
151
150
  +--> Classify surfaces (surface_router.py)
152
151
  +--> Build investigation brief (surface_router.py)
@@ -182,7 +181,7 @@ Nonce-based T3 approval lifecycle:
182
181
 
183
182
  ## Response Contract Validation
184
183
 
185
- Every agent response must end with a `json:contract` block containing `agent_status`. The contract validator (`hooks/modules/agents/contract_validator.py`) enforces:
184
+ Every agent response must end with a `agent_contract_handoff` block containing `agent_status`. The contract validator (`hooks/modules/agents/contract_validator.py`) enforces:
186
185
 
187
186
  - **AGENT_STATUS**: PLAN_STATUS (from 5 valid states: COMPLETE, NEEDS_INPUT, APPROVAL_REQUEST, BLOCKED, IN_PROGRESS), PENDING_STEPS, NEXT_ACTION, AGENT_ID
188
187
  - **EVIDENCE_REPORT**: required for all valid states. Seven fields: PATTERNS_CHECKED, FILES_CHECKED, COMMANDS_RUN, KEY_OUTPUTS, VERBATIM_OUTPUTS, CROSS_LAYER_IMPACTS, OPEN_GAPS
@@ -244,9 +243,9 @@ The adapter layer connects Claude Code's hook protocol to Gaia business logic th
244
243
  |-----------|-------|
245
244
  | **File** | `hooks/subagent_stop.py` |
246
245
  | **Hook event** | SubagentStop |
247
- | **What it does** | Fires after every agent completes. Consumes approval files, captures workflow metrics, validates the response contract (AGENT_STATUS, EVIDENCE_REPORT, CONSOLIDATION_REPORT), detects anomalies, stores episodic memory, and processes CONTEXT_UPDATE blocks. |
246
+ | **What it does** | Fires after every agent completes. Consumes approval files, captures workflow metrics, validates the response contract (AGENT_STATUS, EVIDENCE_REPORT, CONSOLIDATION_REPORT), detects anomalies, stores episodic memory, and processes the update_contracts array from the agent_contract_handoff envelope. |
248
247
  | **Adapter methods called** | `ClaudeCodeAdapter.parse_event()`, `ClaudeCodeAdapter.parse_agent_completion()` |
249
- | **Business logic modules** | `agents/response_contract.py` (`validate_response_contract`, `save_pending_repair`, `clear_pending_repair`), `tools/memory/episodic.py` (`EpisodicMemory.store_episode`), `context/context_writer.py` (`process_agent_output`) |
248
+ | **Business logic modules** | `agents/response_contract.py` (`validate_response_contract`, `save_pending_repair`, `clear_pending_repair`), `tools/memory/episodic.py` (`EpisodicMemory.store_episode`), `context/context_writer.py` (`process_update_contracts`) |
250
249
 
251
250
  ### CP-4: `hooks/modules/tools/hook_response.py` -- Response Formatting
252
251
 
@@ -328,8 +327,7 @@ To support a CLI other than Claude Code (e.g., a hypothetical Cursor or Windsurf
328
327
  | `tools/context/surface_router.py` | Surface classification and investigation briefs |
329
328
  | `tools/memory/episodic.py` | Episodic memory storage |
330
329
  | `config/context-contracts.json` | Agent read/write section permissions |
331
- | `config/universal-rules.json` | Universal and agent-specific rules |
332
330
  | `config/surface-routing.json` | Surface signals and routing config |
333
331
  | `agents/*.md` | Agent identity definitions |
334
332
  | `skills/*/SKILL.md` | Injected procedural knowledge |
335
- | `bin/*.js` | CLI tools (gaia-scan, gaia-doctor, gaia-status, etc.) |
333
+ | `bin/gaia` + `bin/cli/*.py` | Unified `gaia` CLI; subcommands auto-discovered from `bin/cli/` |
package/CHANGELOG.md CHANGED
@@ -7,6 +7,177 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [5.0.2] - 2026-06-03
11
+
12
+ ### Approval-Flow Hardening, mkdir Reclassification, Jira Skill
13
+
14
+ Patch release accumulating security and approval-flow fixes, one new skill, and a quality-of-life exemption for Gaia's own planning bookkeeping commands. All 4575 tests pass on a clean install.
15
+
16
+ #### Fixed
17
+
18
+ - **Stop double-approval on re-dispatched T3 grants** — a T3 command that was
19
+ re-dispatched after approval could be blocked a second time with a fresh nonce,
20
+ forcing the user to approve the same operation twice. Two gaps caused the grant miss:
21
+ `command_semantics` was not normalizing output-redirect tokens out of the semantic
22
+ signature (causing the retry signature to drift from the approved one), and
23
+ `bash_validator._find_pending_in_db` was matching too narrowly and minting a new
24
+ nonce instead of reusing the granted one. Both gaps are closed; a regression test
25
+ reproduces the redirect-normalization grant miss.
26
+
27
+ - **Flag-classifier grants + cross-session grant matching** — the flag-classifier
28
+ branch in `bash_validator` was never consulting approval grants, so curl-family T3
29
+ commands that had been approved were blocked again on retry. `check_db_semantic_grant`
30
+ is now session-agnostic (session is audit-only); `_find_pending_in_db` accepts
31
+ `all_sessions=True`; grant insert is fingerprint-idempotent so cross-session
32
+ block→approve→retry converges. `matches_approval_signature` derives identity from
33
+ `analyze_command` only; `_normalize_flag_token` binds long `--flag=value` tokens to
34
+ fix a critical over-match. Grant TTL raised from 5 to 60 minutes
35
+ (`APPROVAL_GRANT_TTL_MINUTES`), kept distinct from the 1440-minute pending TTL.
36
+
37
+ - **Unify T3 decision across bash validator classifiers** — mutative-verb,
38
+ `file_to_exec` composition, and flag-mutation classifiers now all route through a
39
+ single `decide_t3_outcome()` keyed on `has_orchestrator_above` (is_subagent AND
40
+ is_ops_mode). `file_to_exec` and curl flag-mutations no longer hardcode the native
41
+ CC approval dialog; in ops+subagent mode they produce `deny+approval_id` like
42
+ mutative verbs, keeping them inside the Gaia approval/audit trail. Local workspace
43
+ data files (`.json`/`.yaml`/`.csv`/`.txt`) are degraded to ALLOW for the
44
+ `file_to_exec` composition; network/decode→exec pipelines still BLOCK.
45
+
46
+ - **`mkdir` reclassified as T0 for non-sensitive working-tree paths** — `mkdir` on
47
+ relative, home-relative, or absolute non-system paths is non-destructive and
48
+ idempotent with `-p`; it no longer triggers T3. `mkdir` targeting kernel
49
+ pseudo-filesystems or privileged OS directories (`/dev`, `/sys`, `/proc`, `/etc`,
50
+ `/boot`, `/usr`, `/bin`, `/sbin`, `/lib`, `/lib64`, `/root`) retains T3. Scratch
51
+ space (`/tmp`, `/run`) is excluded — ephemeral, world-writable by design. Adds
52
+ `MKDIR_SENSITIVE_PATH_PREFIXES` (11 prefixes) and `_mkdir_targets_sensitive_path()`
53
+ in `mutative_verbs.py`.
54
+
55
+ #### Added
56
+
57
+ - **Schema v18 — stable project identity** — `project_identity` column and a partial
58
+ unique index on the `projects` table collapse the same physical repo scanned from
59
+ different vantages into one row. `store_populator.resolve_project_identity()` derives
60
+ stable identity from git-common-dir → normalized remote → realpath. Migration files:
61
+ `scripts/migrations/v17_to_v18.sql` and `v17_to_v18_fresh.sql`.
62
+
63
+ - **Skill `jira-ticket-writing`** — technique skill for writing human-readable Jira
64
+ Stories and Subtasks following Atlassian conventions: structured title formula,
65
+ acceptance criteria, story points, label taxonomy, and worked examples. User-invocable
66
+ (`user-invocable: true`); not injected into any agent frontmatter by default.
67
+
68
+ #### Changed
69
+
70
+ - **`gaia brief` / `gaia ac` exempted from T3 gate** — `gaia brief <verb>` and
71
+ `gaia ac <verb>` (`edit`/`set-status`/`set-field`/`add`/`remove`/`new`/`show`/`list`)
72
+ now classify as non-mutative. Local planning bookkeeping that is reversible and has no
73
+ external side effects is treated like `git commit`. The exemption is anchored to
74
+ `(base_cmd, subcommand)` — not a generic `gaia *` pattern — so the consent layer
75
+ (`gaia approvals approve/revoke`) and other groups (`gaia memory`) remain T3.
76
+ Whole-record destruction (`gaia brief delete`) and dangerous flags (`--force`) still
77
+ re-gate.
78
+
79
+ ## [5.0.0] - 2026-06-02
80
+
81
+ ### Stable Release: Scan Overhaul, Zero-Dep Install, Soft-Delete, DB-Canonical Context
82
+
83
+ Fifth major release of Gaia. Promotes the rc.7 release candidate to stable after passing the full dry-run, CI, and live-install gate. The headline work is a ground-up rewrite of the workspace scanner, a zero-dependency NPM install path, a soft-delete model for projects and workspaces, and the retirement of `project-context.json` in favour of the DB as the single canonical source of project context.
84
+
85
+ #### Added
86
+
87
+ - **Scan overhaul — taxonomy and recursive discovery** — `gaia scan` now classifies
88
+ discovered items across three orthogonal dimensions: *workspace* (the Claude Code
89
+ working environment), *project* (the user's source tree), and *installation* (the
90
+ Gaia artefacts wired into `.claude/`). Discovery walks recursively so nested
91
+ monorepo structures and workspace-within-workspace layouts are captured correctly.
92
+ Taxonomy is defined in `tools/scan/` and tested independently of the CLI.
93
+
94
+ - **On-demand `gaia scan <path>`** — the scan subcommand now accepts an explicit
95
+ target path, enabling agents to scan a directory that is not the current working
96
+ directory without changing cwd. Useful for multi-root workspaces and cross-project
97
+ context enrichment.
98
+
99
+ - **Scan/install separation + scan-core** — the scan pipeline is now split into a
100
+ pure discovery core (`scan-core`) with no install-time side effects, and a
101
+ separate install phase that consumes core output. This makes scan deterministic
102
+ and testable without triggering postinstall hooks, and lets the install phase be
103
+ skipped when scanning for context only.
104
+
105
+ - **Pure-NPM zero-dependency install** — `postinstall` now completes with zero
106
+ runtime npm dependencies. All install-time logic runs through `python3 bin/gaia
107
+ install --postinstall` (Python stdlib only). The devDependencies remain for build
108
+ tooling (`chalk`, `eslint`) but consumers take no transitive runtime deps.
109
+
110
+ - **Soft-delete for projects and workspaces** — `gaia scan` handles pruning
111
+ automatically: when a previously-registered project path is no longer found on
112
+ disk, the prune pass marks it missing; scanning a directory that has no Gaia
113
+ installation demotes the workspace (marks it missing) and tombstones its
114
+ projects. No explicit remove or demote commands exist — lifecycle state flows
115
+ from the scanner. Soft-deleted rows are hidden from list views. Schema migrated
116
+ from v12 to v17 to carry the new columns and the `project_workspace_archive`
117
+ table.
118
+
119
+ - **`project-context.json` retired — DB is canonical** — the on-disk
120
+ `project-context.json` file is no longer written or read by any Gaia component.
121
+ Project context lives exclusively in `~/.gaia/gaia.db` (tables `projects`,
122
+ `workspaces`, `project_resources`). The context provider and all CLI subcommands
123
+ read directly from the DB. Existing `project-context.json` files are ignored on
124
+ upgrade; run `gaia scan` to populate the DB.
125
+
126
+ #### Fixed
127
+
128
+ - **`gaia approvals list` crash** — `bin/cli/approvals.py` raised an unhandled
129
+ exception when the `approval_grants` table contained rows with a `None` nonce
130
+ (rows inserted by older schema versions). Added a null-guard before nonce
131
+ formatting; the command now lists all rows cleanly and marks legacy rows as
132
+ `(no nonce)`.
133
+
134
+ #### Changed
135
+
136
+ - **Schema v12 → v17** — five incremental migrations applied in lockstep with
137
+ `EXPECTED_SCHEMA_VERSION` in `bin/cli/doctor.py` and the bootstrap insert in
138
+ `scripts/bootstrap_database.sh`. The `test_schema_version_lockstep.py` test
139
+ confirms all three agree.
140
+
141
+ - **CI hardening** — `ci.yml` now runs the full pytest suite on Python 3.9, 3.11,
142
+ and 3.12 in parallel, blocks merges on any failure, and verifies `build:plugins`
143
+ produces valid `dist/` artefacts. The `validate-sandbox.sh` harness is wired
144
+ into the publish gate.
145
+
146
+ - **Suite green** — all Layer 1 tests pass on the three supported Python versions.
147
+ The scan-core and soft-delete paths are covered by dedicated test modules.
148
+
149
+ - **`bin/validate-sandbox.sh`** -- harness now drives `gaia` subcommands end
150
+ to end (no `gaia-X.js` callers remain). The 8-check matrix is unchanged.
151
+ Sandbox DB is now isolated via `GAIA_DATA_DIR` so memory checks run against
152
+ a seeded fixture DB rather than the global `~/.gaia/gaia.db`.
153
+
154
+ - **CLI docstrings** -- `bin/cli/*.py` modules dropped the
155
+ "Mirrors gaia-X.js" parity comments now that there is no JS counterpart on
156
+ disk to mirror.
157
+
158
+ #### Removed
159
+
160
+ - **Legacy JS CLI binaries** -- `bin/gaia-doctor.js`, `bin/gaia-status.js`,
161
+ `bin/gaia-history.js`, `bin/gaia-metrics.js`, `bin/gaia-cleanup.js`,
162
+ `bin/gaia-update.js`, `bin/gaia-uninstall.js`, `bin/gaia-skills-diagnose.js`,
163
+ `bin/gaia-review.js`, `bin/gaia-evidence`, `bin/gaia-scan` (Node wrapper),
164
+ and `bin/gaia-scan.py` are gone. The `bin` field in `package.json` now
165
+ exposes a single binary: `gaia`. Every subcommand previously available as
166
+ `npx gaia-X` is now reached through `gaia X` -- subcommands are discovered
167
+ automatically from `bin/cli/*.py` via the `register()` / `cmd_<name>()`
168
+ contract. Lifecycle scripts (`postinstall`, `preuninstall`) call
169
+ `python3 bin/gaia install --postinstall` and `python3 bin/gaia uninstall
170
+ --preuninstall` directly. `gaia-skills-diagnose`, `gaia-review`, and
171
+ `gaia-evidence` had no Python successor and are not migrated; for general
172
+ health checks use `gaia doctor`.
173
+
174
+ #### Internal
175
+
176
+ - Regenerated `dist/gaia-ops/` and `dist/gaia-security/` for 5.0.0.
177
+ - `pyproject.toml` version aligned with `package.json` at `5.0.0`.
178
+
179
+ ---
180
+
10
181
  ## [5.0.0-rc.3] - 2026-04-26
11
182
 
12
183
  ### Release Candidate 3: Python 3.9 Compatibility Fix
@@ -205,7 +376,7 @@ The unified CLI also provides subcommands that did not exist as standalone JS CL
205
376
  | `python3 bin/gaia plans list` | List all feature briefs |
206
377
  | `python3 bin/gaia plans show BRIEF_NAME` | Show a brief and plan |
207
378
  | `python3 bin/gaia context show` | Display project-context.json summary |
208
- | `python3 bin/gaia context scan` | Invoke gaia-scan to refresh context |
379
+ | `python3 bin/gaia context scan` | Refresh project-context via the scanner |
209
380
 
210
381
  #### Deprecation timeline
211
382
 
@@ -298,7 +469,7 @@ Contracts now fully control what context each agent receives. Removed the progre
298
469
  #### Changed
299
470
  - **context_provider.py**: Contracts are the single source of truth -- removed progressive disclosure filtering that overrode contract-defined sections
300
471
  - **context_provider.py**: Simplified output payload -- removed `enrichment` and `progressive_disclosure` keys from response
301
- - **contracts/terraform-architect.json**: Now reads `cluster_details` and `application_services` sections
472
+ - **contracts/platform-architect.json**: Now reads `cluster_details` and `application_services` sections
302
473
  - **contracts/gitops-operator.json**: Now reads `gcp_services` section (GCP overlay)
303
474
  - **pre_tool_use.py**: Updated log message to show sections count and rules count
304
475
  - **templates/CLAUDE.template.md**: Synced agent routing descriptions with CLAUDE.md
@@ -391,8 +562,8 @@ Major redesign of skills and agents. Skills now teach principles instead of enum
391
562
  - **`skills/reference.md`** - Agent template and npm release checklist (moved from gaia agent)
392
563
  - **`skills/terraform-patterns/reference.md`** - Full HCL examples
393
564
  - **`skills/gitops-patterns/reference.md`** - Full YAML examples
394
- - **`investigation` skill** assigned to cloud-troubleshooter, terraform-architect, gitops-operator, devops-developer, gaia
395
- - **`git-conventions` skill** assigned to terraform-architect, gitops-operator, devops-developer
565
+ - **`investigation` skill** assigned to cloud-troubleshooter, platform-architect, gitops-operator, devops-developer, gaia
566
+ - **`git-conventions` skill** assigned to platform-architect, gitops-operator, devops-developer
396
567
  - **`agent-protocol` + `security-tiers` skills** assigned to speckit-planner
397
568
 
398
569
  #### Metrics
@@ -689,7 +860,7 @@ Inspired by [memory-graph](https://github.com/gregorydickson/memory-graph) analy
689
860
  ### Changed - Agent Optimization
690
861
 
691
862
  - **agents/*.md** - All 6 agents reduced by 78%
692
- - terraform-architect: 916 → 183 lines
863
+ - platform-architect: 916 → 183 lines
693
864
  - gitops-operator: 1,238 → 217 lines
694
865
  - gcp-troubleshooter: 600 → 156 lines
695
866
  - aws-troubleshooter: 565 → 142 lines
@@ -773,7 +944,7 @@ Inspired by [memory-graph](https://github.com/gregorydickson/memory-graph) analy
773
944
  - Better Flux CD integration guidance
774
945
  - Enhanced troubleshooting protocols
775
946
 
776
- - **agents/terraform-architect.md** - Enhanced with 47 new lines
947
+ - **agents/platform-architect.md** - Enhanced with 47 new lines
777
948
  - Improved Terragrunt support
778
949
  - Better module design guidance
779
950
  - Enhanced security scanning protocols
package/CONTRIBUTING.md CHANGED
@@ -67,7 +67,7 @@ See [README.md](./README.md) for the full directory tree. Key areas for contribu
67
67
  | `tools/` | Orchestration tools (context provider, memory, validation) |
68
68
  | `config/` | Configuration files (contracts, git standards, rules) |
69
69
  | `tests/` | Test suite organized by layer |
70
- | `bin/` | CLI utilities (`gaia-scan`, `gaia-doctor`, etc.) |
70
+ | `bin/` | Unified `gaia` CLI -- subcommands live in `bin/cli/*.py` |
71
71
 
72
72
  ## Coding Standards
73
73
 
@@ -81,7 +81,9 @@ See [README.md](./README.md) for the full directory tree. Key areas for contribu
81
81
  ### JavaScript / Node.js
82
82
 
83
83
  - ES modules (`import`/`export`), not CommonJS.
84
- - Follow the existing patterns in `bin/` and `index.js`.
84
+ - The CLI surface is now Python (`bin/cli/*.py`); JS lives in `index.js`
85
+ (programmatic API helpers) and `bin/pre-publish-validate.js` /
86
+ `bin/python-detect.js` (tooling).
85
87
 
86
88
  ### Commit Messages
87
89