hachi-og 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1064) hide show
  1. hachi_og-0.1.0/.claude/.gitignore +7 -0
  2. hachi_og-0.1.0/.claude/agents/README.md +39 -0
  3. hachi_og-0.1.0/.claude/agents/gate-keeper.md +42 -0
  4. hachi_og-0.1.0/.claude/agents/plan-critic.md +153 -0
  5. hachi_og-0.1.0/.claude/agents/regression-guard.md +47 -0
  6. hachi_og-0.1.0/.claude/agents/scope-sentinel.md +43 -0
  7. hachi_og-0.1.0/.claude/hooks/README.md +53 -0
  8. hachi_og-0.1.0/.claude/hooks/_common.py +73 -0
  9. hachi_og-0.1.0/.claude/hooks/auto_format.py +37 -0
  10. hachi_og-0.1.0/.claude/hooks/bash_guard.py +138 -0
  11. hachi_og-0.1.0/.claude/hooks/session_start.py +104 -0
  12. hachi_og-0.1.0/.claude/hooks/stop_guard.py +43 -0
  13. hachi_og-0.1.0/.claude/launch.json +18 -0
  14. hachi_og-0.1.0/.claude/settings.json +55 -0
  15. hachi_og-0.1.0/.dockerignore +22 -0
  16. hachi_og-0.1.0/.gitattributes +5 -0
  17. hachi_og-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
  18. hachi_og-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  19. hachi_og-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  20. hachi_og-0.1.0/.github/instructions/hachi-python-guardrails.instructions.md +31 -0
  21. hachi_og-0.1.0/.github/workflows/ci.yml +320 -0
  22. hachi_og-0.1.0/.github/workflows/release.yml +66 -0
  23. hachi_og-0.1.0/.gitignore +95 -0
  24. hachi_og-0.1.0/.secret-scan-allowlist +45 -0
  25. hachi_og-0.1.0/AGENTS.md +38 -0
  26. hachi_og-0.1.0/ARCHITECTURE.md +262 -0
  27. hachi_og-0.1.0/CLAUDE.md +88 -0
  28. hachi_og-0.1.0/CODEOWNERS +9 -0
  29. hachi_og-0.1.0/CODE_OF_CONDUCT.md +99 -0
  30. hachi_og-0.1.0/CONTRIBUTING.md +282 -0
  31. hachi_og-0.1.0/Dockerfile +35 -0
  32. hachi_og-0.1.0/HACHI_GUARDRAIL.md +339 -0
  33. hachi_og-0.1.0/LICENSE +201 -0
  34. hachi_og-0.1.0/NOTICE +13 -0
  35. hachi_og-0.1.0/PKG-INFO +373 -0
  36. hachi_og-0.1.0/README.md +301 -0
  37. hachi_og-0.1.0/SECURITY.md +167 -0
  38. hachi_og-0.1.0/TRADEMARK.md +43 -0
  39. hachi_og-0.1.0/benchmarks/og_bench/__init__.py +1 -0
  40. hachi_og-0.1.0/benchmarks/og_bench/data/s_real_results_v1.json +60 -0
  41. hachi_og-0.1.0/benchmarks/og_bench/metrics.py +401 -0
  42. hachi_og-0.1.0/benchmarks/og_bench/s_real_probes.json +288 -0
  43. hachi_og-0.1.0/conftest.py +1 -0
  44. hachi_og-0.1.0/design-system/.thumbnail +0 -0
  45. hachi_og-0.1.0/design-system/SKILL.md +27 -0
  46. hachi_og-0.1.0/design-system/_adherence.oxlintrc.json +323 -0
  47. hachi_og-0.1.0/design-system/_ds_bundle.js +1867 -0
  48. hachi_og-0.1.0/design-system/_ds_manifest.json +1 -0
  49. hachi_og-0.1.0/design-system/assets/hachi-app-icon.svg +9 -0
  50. hachi_og-0.1.0/design-system/assets/hachi-loop.svg +3 -0
  51. hachi_og-0.1.0/design-system/assets/hachi-mark-knockout.svg +5 -0
  52. hachi_og-0.1.0/design-system/assets/hachi-mark.svg +14 -0
  53. hachi_og-0.1.0/design-system/components/core/Badge.d.ts +11 -0
  54. hachi_og-0.1.0/design-system/components/core/Badge.jsx +32 -0
  55. hachi_og-0.1.0/design-system/components/core/Badge.prompt.md +9 -0
  56. hachi_og-0.1.0/design-system/components/core/Button.d.ts +21 -0
  57. hachi_og-0.1.0/design-system/components/core/Button.jsx +87 -0
  58. hachi_og-0.1.0/design-system/components/core/Button.prompt.md +10 -0
  59. hachi_og-0.1.0/design-system/components/core/Card.d.ts +11 -0
  60. hachi_og-0.1.0/design-system/components/core/Card.jsx +19 -0
  61. hachi_og-0.1.0/design-system/components/core/Card.prompt.md +10 -0
  62. hachi_og-0.1.0/design-system/components/core/Input.d.ts +12 -0
  63. hachi_og-0.1.0/design-system/components/core/Input.jsx +37 -0
  64. hachi_og-0.1.0/design-system/components/core/Input.prompt.md +8 -0
  65. hachi_og-0.1.0/design-system/components/core/StatusPill.d.ts +15 -0
  66. hachi_og-0.1.0/design-system/components/core/StatusPill.jsx +36 -0
  67. hachi_og-0.1.0/design-system/components/core/StatusPill.prompt.md +10 -0
  68. hachi_og-0.1.0/design-system/components/core/Switch.d.ts +12 -0
  69. hachi_og-0.1.0/design-system/components/core/Switch.jsx +39 -0
  70. hachi_og-0.1.0/design-system/components/core/Switch.prompt.md +7 -0
  71. hachi_og-0.1.0/design-system/components/feedback/LoyalLoop.d.ts +14 -0
  72. hachi_og-0.1.0/design-system/components/feedback/LoyalLoop.jsx +23 -0
  73. hachi_og-0.1.0/design-system/components/feedback/LoyalLoop.prompt.md +7 -0
  74. hachi_og-0.1.0/design-system/components/feedback/Toast.d.ts +12 -0
  75. hachi_og-0.1.0/design-system/components/feedback/Toast.jsx +35 -0
  76. hachi_og-0.1.0/design-system/components/feedback/Toast.prompt.md +8 -0
  77. hachi_og-0.1.0/design-system/components/hachi/HachiMark.d.ts +12 -0
  78. hachi_og-0.1.0/design-system/components/hachi/HachiMark.jsx +34 -0
  79. hachi_og-0.1.0/design-system/components/hachi/HachiMark.prompt.md +8 -0
  80. hachi_og-0.1.0/design-system/components/hachi/LeashPrompt.d.ts +20 -0
  81. hachi_og-0.1.0/design-system/components/hachi/LeashPrompt.jsx +86 -0
  82. hachi_og-0.1.0/design-system/components/hachi/LeashPrompt.prompt.md +14 -0
  83. hachi_og-0.1.0/design-system/components/hachi/RunCard.d.ts +22 -0
  84. hachi_og-0.1.0/design-system/components/hachi/RunCard.jsx +58 -0
  85. hachi_og-0.1.0/design-system/components/hachi/RunCard.prompt.md +8 -0
  86. hachi_og-0.1.0/design-system/components/hachi/Terminal.d.ts +20 -0
  87. hachi_og-0.1.0/design-system/components/hachi/Terminal.jsx +43 -0
  88. hachi_og-0.1.0/design-system/components/hachi/Terminal.prompt.md +13 -0
  89. hachi_og-0.1.0/design-system/readme.md +176 -0
  90. hachi_og-0.1.0/design-system/styles.css +8 -0
  91. hachi_og-0.1.0/design-system/templates/leash-prompt/ds-base.js +15 -0
  92. hachi_og-0.1.0/design-system/templates/leash-prompt/support.js +1466 -0
  93. hachi_og-0.1.0/design-system/tokens/base.css +42 -0
  94. hachi_og-0.1.0/design-system/tokens/colors.css +86 -0
  95. hachi_og-0.1.0/design-system/tokens/fonts.css +7 -0
  96. hachi_og-0.1.0/design-system/tokens/motion.css +16 -0
  97. hachi_og-0.1.0/design-system/tokens/spacing.css +22 -0
  98. hachi_og-0.1.0/design-system/tokens/typography.css +27 -0
  99. hachi_og-0.1.0/design-system/ui_kits/cli/Cli.jsx +63 -0
  100. hachi_og-0.1.0/design-system/ui_kits/cli/README.md +11 -0
  101. hachi_og-0.1.0/design-system/ui_kits/tui/README.md +16 -0
  102. hachi_og-0.1.0/design-system/ui_kits/tui/Tui.jsx +150 -0
  103. hachi_og-0.1.0/design-system/ui_kits/webapp/README.md +22 -0
  104. hachi_og-0.1.0/design-system/ui_kits/webapp/Sidebar.jsx +73 -0
  105. hachi_og-0.1.0/design-system/ui_kits/webapp/Workspace.jsx +102 -0
  106. hachi_og-0.1.0/design-system/ui_kits/webapp/icons.jsx +32 -0
  107. hachi_og-0.1.0/design-system/uploads/hachi-token.css +33 -0
  108. hachi_og-0.1.0/design-system/uploads/hachi.svg +14 -0
  109. hachi_og-0.1.0/docker-compose.yml +60 -0
  110. hachi_og-0.1.0/docs/AUDIT.md +577 -0
  111. hachi_og-0.1.0/docs/DECISIONS.md +2962 -0
  112. hachi_og-0.1.0/docs/README.md +46 -0
  113. hachi_og-0.1.0/docs/architecture/01-architecture-analysis.md +170 -0
  114. hachi_og-0.1.0/docs/architecture/02-current-state.md +184 -0
  115. hachi_og-0.1.0/docs/architecture/03-tech-debt.md +179 -0
  116. hachi_og-0.1.0/docs/architecture/04-extension-points.md +147 -0
  117. hachi_og-0.1.0/docs/architecture/05-risk-assessment.md +168 -0
  118. hachi_og-0.1.0/docs/architecture/06-gap-analysis.md +96 -0
  119. hachi_og-0.1.0/docs/architecture/10-target-architecture.md +169 -0
  120. hachi_og-0.1.0/docs/architecture/11-domain-boundaries.md +83 -0
  121. hachi_og-0.1.0/docs/architecture/12-event-architecture.md +107 -0
  122. hachi_og-0.1.0/docs/architecture/13-provider-architecture.md +181 -0
  123. hachi_og-0.1.0/docs/architecture/14-capability-registry.md +162 -0
  124. hachi_og-0.1.0/docs/architecture/15-model-routing.md +148 -0
  125. hachi_og-0.1.0/docs/architecture/16-durable-execution.md +161 -0
  126. hachi_og-0.1.0/docs/architecture/17-search-platform.md +81 -0
  127. hachi_og-0.1.0/docs/architecture/18-attachment-platform.md +93 -0
  128. hachi_og-0.1.0/docs/architecture/19-voice-platform.md +66 -0
  129. hachi_og-0.1.0/docs/architecture/20-vision-platform.md +76 -0
  130. hachi_og-0.1.0/docs/architecture/21-observability.md +284 -0
  131. hachi_og-0.1.0/docs/architecture/22-database-changes.md +60 -0
  132. hachi_og-0.1.0/docs/architecture/23-api-changes.md +59 -0
  133. hachi_og-0.1.0/docs/architecture/24-configuration-changes.md +74 -0
  134. hachi_og-0.1.0/docs/architecture/25-migration-strategy.md +66 -0
  135. hachi_og-0.1.0/docs/architecture/26-backward-compatibility.md +51 -0
  136. hachi_og-0.1.0/docs/architecture/27-testing-strategy.md +60 -0
  137. hachi_og-0.1.0/docs/architecture/28-rollout-plan.md +63 -0
  138. hachi_og-0.1.0/docs/architecture/29-design-review.md +232 -0
  139. hachi_og-0.1.0/docs/architecture/README.md +106 -0
  140. hachi_og-0.1.0/docs/architecture/adr/0000-template.md +33 -0
  141. hachi_og-0.1.0/docs/architecture/adr/0001-capability-based-model-routing.md +55 -0
  142. hachi_og-0.1.0/docs/architecture/adr/0002-aiprovider-capability-interface.md +56 -0
  143. hachi_og-0.1.0/docs/architecture/adr/0003-event-bus-over-emit-funnel.md +38 -0
  144. hachi_og-0.1.0/docs/architecture/adr/0004-durable-run-state-on-sqlite-job-substrate.md +51 -0
  145. hachi_og-0.1.0/docs/architecture/adr/0005-observability-correlation-and-injected-exporter.md +95 -0
  146. hachi_og-0.1.0/docs/architecture/adr/README.md +43 -0
  147. hachi_og-0.1.0/docs/assets/hachi-banner-readme.svg +91 -0
  148. hachi_og-0.1.0/docs/assets/hachi-blink-code-of-conduct.svg +70 -0
  149. hachi_og-0.1.0/docs/assets/hachi-blink-contributing.svg +81 -0
  150. hachi_og-0.1.0/docs/assets/hachi-blink-security.svg +70 -0
  151. hachi_og-0.1.0/docs/audit/2026-06-28/COST_BASELINE.json +131 -0
  152. hachi_og-0.1.0/docs/audit/2026-06-28/COST_ROADMAP.md +37 -0
  153. hachi_og-0.1.0/docs/audit/2026-06-28/OPTIMIZATIONS_IMPLEMENTED.md +120 -0
  154. hachi_og-0.1.0/docs/audit/2026-06-28/PRICING_VALIDATION.md +149 -0
  155. hachi_og-0.1.0/docs/audit/2026-06-28/REMAINING_WORK_PLAN.md +537 -0
  156. hachi_og-0.1.0/docs/audit/2026-06-28/STREAMING_PERF_PLAN.md +227 -0
  157. hachi_og-0.1.0/docs/audit/2026-06-28/TOKEN_AUDIT_REPORT.md +70 -0
  158. hachi_og-0.1.0/docs/audit/2026-07-03/BACKLOG.md +327 -0
  159. hachi_og-0.1.0/docs/audit/2026-07-03/DETAILED_FINDINGS.md +96 -0
  160. hachi_og-0.1.0/docs/audit/2026-07-03/GAP_ANALYSIS.md +166 -0
  161. hachi_og-0.1.0/docs/audit/2026-07-03/PRODUCTION_READINESS.md +183 -0
  162. hachi_og-0.1.0/docs/audit/2026-07-03/TASKS.md +316 -0
  163. hachi_og-0.1.0/docs/audit/2026-07-19/ARCHITECTURE-REVIEW.md +289 -0
  164. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/CORRECTIONS.md +672 -0
  165. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/README.md +326 -0
  166. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-01-approver-selection-dead-branch.md +498 -0
  167. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-02-settings-example-toml.md +528 -0
  168. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-03-config-writers-file-layer-only.md +634 -0
  169. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-04-kennel-pack-store.md +555 -0
  170. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-05-routing-cost-warnings-arity.md +342 -0
  171. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-06-memory-settings-reach-vault.md +540 -0
  172. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-07-eval-reports-config-section.md +441 -0
  173. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-08-memory-gardener.md +426 -0
  174. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-09-file-extracted-shared-bus.md +470 -0
  175. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-10-shared-session-store.md +546 -0
  176. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-11-auto-memory-key-resolution.md +558 -0
  177. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-12-provider-kinds-schema.md +454 -0
  178. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-13-feature-liveness-smoke.md +487 -0
  179. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-14-ban-getattr-own-types.md +459 -0
  180. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-15-approvals-through-control-plane.md +434 -0
  181. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-16-approval-real-deadline.md +471 -0
  182. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-17-fe-resolve-approvals-by-request-id.md +527 -0
  183. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-18-fe-surface-decision-failures.md +454 -0
  184. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-19-fe-stop-fabricating-audit-rows.md +422 -0
  185. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-20-govern-channel-schedule-sessions.md +481 -0
  186. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-21-tui-degraded-state.md +500 -0
  187. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-22-web-fixtures-out-of-prod-bundle.md +432 -0
  188. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-23-thread-llm-timeout.md +619 -0
  189. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-24-collapse-retry-layers.md +595 -0
  190. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-25-served-model-cost-attribution.md +530 -0
  191. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-26-routing-boot-failure-visible.md +371 -0
  192. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-27-forward-max-tokens-resilient-client.md +407 -0
  193. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-28-wall-clock-deadline-hung-socket.md +476 -0
  194. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-29-sse-disconnect-scope.md +453 -0
  195. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-30-sse-gap-signal.md +569 -0
  196. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-31-openai-facade-decision.md +555 -0
  197. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-32-facade-session-isolation.md +487 -0
  198. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-33-facade-session-lifecycle.md +440 -0
  199. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-34-subagent-schedule-tool-blocklist.md +582 -0
  200. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-35-google-double-mount.md +648 -0
  201. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-36-tool-registry-duplicate-guard.md +444 -0
  202. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-37-error-envelope-in-openapi.md +400 -0
  203. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-38-openapi-pilot-og-domain.md +582 -0
  204. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-39-tool-groups-at-registration.md +570 -0
  205. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-40-emit-runtime-event-closure-capture.md +600 -0
  206. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-41-extract-in-process-runtime.md +590 -0
  207. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-42-retire-core-cli-seam.md +496 -0
  208. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-43-collapse-control-plane-interfaces.md +538 -0
  209. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-44-boot-agent-staged-builders.md +520 -0
  210. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-45-boot-agent-constructor-stashes.md +518 -0
  211. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-46-session-read-models-facade.md +495 -0
  212. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-47-lift-routers-out-of-closure.md +541 -0
  213. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-48-memory-package-boundary.md +509 -0
  214. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-49-memory-provider-seam-decision.md +586 -0
  215. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-50-memory-session-provenance.md +532 -0
  216. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-51-memory-delete-tri-store.md +761 -0
  217. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-52-memory-compaction-persistence.md +565 -0
  218. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-53-jobs-db-path-unification.md +612 -0
  219. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-54-schema-version-tables.md +655 -0
  220. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-55-backup-completeness.md +646 -0
  221. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-56-pack-consent-every-install-path.md +536 -0
  222. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-57-oauth-consolidation.md +484 -0
  223. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-58-declarative-integrations-consolidation.md +491 -0
  224. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-59-exception-taxonomy-unification.md +460 -0
  225. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-60-twin-contract-types.md +430 -0
  226. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-61-single-tenant-adr.md +433 -0
  227. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-62-session-messages-ownership-check.md +413 -0
  228. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-63-frontend-store-slices.md +462 -0
  229. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-64-frontend-fix-false-cycle-comment.md +333 -0
  230. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-65-chat-ts-kernel-extraction.md +460 -0
  231. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-66-approval-string-ids.md +510 -0
  232. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-67-governance-drift-cleanup.md +631 -0
  233. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-68-import-linter-exemption-burndown.md +497 -0
  234. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-69-mypy-burndown-ratchet.md +450 -0
  235. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-70-test-tree-mirroring.md +487 -0
  236. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-71-injected-clocks-restore-parallelism.md +489 -0
  237. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-72-og-spec-executable-surface.md +474 -0
  238. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-73-skill-engine-collaborators.md +502 -0
  239. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-74-repo-hygiene-sweep.md +679 -0
  240. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-75-durable-event-log.md +773 -0
  241. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-76-bless-sdk-public-surface.md +731 -0
  242. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-77-consolidate-prompts-into-composer.md +732 -0
  243. hachi_og-0.1.0/docs/audit/2026-07-19/tasks/_TEMPLATE.md +129 -0
  244. hachi_og-0.1.0/docs/brand/hachi/hachi-app-icon.svg +9 -0
  245. hachi_og-0.1.0/docs/brand/hachi/hachi-loop.svg +3 -0
  246. hachi_og-0.1.0/docs/brand/hachi/hachi-mark-knockout.svg +5 -0
  247. hachi_og-0.1.0/docs/brand/hachi/hachi-mark.svg +14 -0
  248. hachi_og-0.1.0/docs/brand/hachi-token.css +33 -0
  249. hachi_og-0.1.0/docs/brand/hachi.svg +14 -0
  250. hachi_og-0.1.0/docs/bug-bank.md +2347 -0
  251. hachi_og-0.1.0/docs/design/hachi-tui-spec.md +1133 -0
  252. hachi_og-0.1.0/docs/design/hachi-web-ui-requirements.md +271 -0
  253. hachi_og-0.1.0/docs/guides/configuration.md +560 -0
  254. hachi_og-0.1.0/docs/guides/cookbook.md +565 -0
  255. hachi_og-0.1.0/docs/guides/git-sync.md +73 -0
  256. hachi_og-0.1.0/docs/guides/memory.md +117 -0
  257. hachi_og-0.1.0/docs/guides/releasing.md +67 -0
  258. hachi_og-0.1.0/docs/history/god-tier-plan.md +216 -0
  259. hachi_og-0.1.0/docs/history/tui-product-brief.md +157 -0
  260. hachi_og-0.1.0/docs/plans/Observability-plan.md +236 -0
  261. hachi_og-0.1.0/docs/reference/benchmark.md +270 -0
  262. hachi_og-0.1.0/docs/reference/objectgraph-spec.md +1741 -0
  263. hachi_og-0.1.0/docs/reference/og-security.md +189 -0
  264. hachi_og-0.1.0/docs/strategy/00-index.md +40 -0
  265. hachi_og-0.1.0/docs/strategy/00-recon.md +346 -0
  266. hachi_og-0.1.0/docs/strategy/01-architecture-review.md +270 -0
  267. hachi_og-0.1.0/docs/strategy/02-object-graph-eval.md +254 -0
  268. hachi_og-0.1.0/docs/strategy/03-competitive-and-positioning.md +191 -0
  269. hachi_og-0.1.0/docs/strategy/04-memory-redesign.md +258 -0
  270. hachi_og-0.1.0/docs/strategy/05-agent-platform.md +197 -0
  271. hachi_og-0.1.0/docs/strategy/06-ux-redesign.md +234 -0
  272. hachi_og-0.1.0/docs/strategy/07-future-and-growth.md +170 -0
  273. hachi_og-0.1.0/docs/strategy/08-roadmap.md +136 -0
  274. hachi_og-0.1.0/docs/strategy/09-execution-plan.md +538 -0
  275. hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/01-hachi-ground-truth.md +73 -0
  276. hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/02-competitive-landscape.md +136 -0
  277. hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/03-gap-analysis.md +97 -0
  278. hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/04-first-principles-and-bets.md +117 -0
  279. hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/README.md +85 -0
  280. hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/SOURCES.md +68 -0
  281. hachi_og-0.1.0/docs/web/backend-api-gaps.md +269 -0
  282. hachi_og-0.1.0/frontend/.dockerignore +8 -0
  283. hachi_og-0.1.0/frontend/.env.example +31 -0
  284. hachi_og-0.1.0/frontend/Dockerfile +25 -0
  285. hachi_og-0.1.0/frontend/IMPLEMENTATION_CONTRACT.md +202 -0
  286. hachi_og-0.1.0/frontend/docker-entrypoint.sh +15 -0
  287. hachi_og-0.1.0/frontend/index.html +12 -0
  288. hachi_og-0.1.0/frontend/nginx.conf.template +30 -0
  289. hachi_og-0.1.0/frontend/package-lock.json +3839 -0
  290. hachi_og-0.1.0/frontend/package.json +37 -0
  291. hachi_og-0.1.0/frontend/src/components/brand/HachiMark.tsx +83 -0
  292. hachi_og-0.1.0/frontend/src/components/brand/HachiMascot.tsx +258 -0
  293. hachi_og-0.1.0/frontend/src/components/brand/LeashPrompt.test.tsx +70 -0
  294. hachi_og-0.1.0/frontend/src/components/brand/LeashPrompt.tsx +421 -0
  295. hachi_og-0.1.0/frontend/src/components/conversation/ActionCardRow.tsx +160 -0
  296. hachi_og-0.1.0/frontend/src/components/conversation/AttachmentChip.tsx +135 -0
  297. hachi_og-0.1.0/frontend/src/components/conversation/ConversationComposer.tsx +778 -0
  298. hachi_og-0.1.0/frontend/src/components/conversation/MessageItem.tsx +280 -0
  299. hachi_og-0.1.0/frontend/src/components/conversation/RoutineCard.tsx +208 -0
  300. hachi_og-0.1.0/frontend/src/components/conversation/SessionPicker.tsx +184 -0
  301. hachi_og-0.1.0/frontend/src/components/conversation/SlashItem.tsx +47 -0
  302. hachi_og-0.1.0/frontend/src/components/conversation/StarterButton.tsx +37 -0
  303. hachi_og-0.1.0/frontend/src/components/conversation/StreamingText.tsx +54 -0
  304. hachi_og-0.1.0/frontend/src/components/conversation/TtsButton.tsx +56 -0
  305. hachi_og-0.1.0/frontend/src/components/conversation/VoiceOption.tsx +65 -0
  306. hachi_og-0.1.0/frontend/src/components/conversation/VoiceWave.tsx +22 -0
  307. hachi_og-0.1.0/frontend/src/components/conversation/helpers.ts +33 -0
  308. hachi_og-0.1.0/frontend/src/components/icons/ConnectorLogo.tsx +199 -0
  309. hachi_og-0.1.0/frontend/src/components/icons/Icon.test.tsx +72 -0
  310. hachi_og-0.1.0/frontend/src/components/icons/Icon.tsx +123 -0
  311. hachi_og-0.1.0/frontend/src/components/overlays/CommandPalette.test.ts +33 -0
  312. hachi_og-0.1.0/frontend/src/components/overlays/CommandPalette.tsx +370 -0
  313. hachi_og-0.1.0/frontend/src/components/overlays/KennelConsent.test.tsx +65 -0
  314. hachi_og-0.1.0/frontend/src/components/overlays/KennelConsent.tsx +382 -0
  315. hachi_og-0.1.0/frontend/src/components/overlays/ReconnectingBanner.tsx +45 -0
  316. hachi_og-0.1.0/frontend/src/components/overlays/SetupWizard.test.tsx +194 -0
  317. hachi_og-0.1.0/frontend/src/components/overlays/SetupWizard.tsx +793 -0
  318. hachi_og-0.1.0/frontend/src/components/overlays/ToastHost.tsx +72 -0
  319. hachi_og-0.1.0/frontend/src/components/overlays/index.tsx +38 -0
  320. hachi_og-0.1.0/frontend/src/components/settings/AddProviderDialog.tsx +588 -0
  321. hachi_og-0.1.0/frontend/src/components/settings/ProviderSettings.tsx +707 -0
  322. hachi_og-0.1.0/frontend/src/components/settings/SettingsNav.tsx +105 -0
  323. hachi_og-0.1.0/frontend/src/components/settings/VoiceSettings.tsx +515 -0
  324. hachi_og-0.1.0/frontend/src/components/settings/sections/GeneralSection.test.tsx +65 -0
  325. hachi_og-0.1.0/frontend/src/components/settings/sections/GeneralSection.tsx +243 -0
  326. hachi_og-0.1.0/frontend/src/components/settings/sections/PermissionsSection.test.tsx +58 -0
  327. hachi_og-0.1.0/frontend/src/components/settings/sections/PermissionsSection.tsx +510 -0
  328. hachi_og-0.1.0/frontend/src/components/settings/sections/SpendSection.tsx +512 -0
  329. hachi_og-0.1.0/frontend/src/components/settings/shared.tsx +100 -0
  330. hachi_og-0.1.0/frontend/src/components/shell/BudgetWidget.tsx +106 -0
  331. hachi_og-0.1.0/frontend/src/components/shell/GovernanceBar.tsx +133 -0
  332. hachi_og-0.1.0/frontend/src/components/shell/NavItem.tsx +68 -0
  333. hachi_og-0.1.0/frontend/src/components/shell/Sidebar.tsx +320 -0
  334. hachi_og-0.1.0/frontend/src/components/ui/Button.tsx +87 -0
  335. hachi_og-0.1.0/frontend/src/components/ui/ConfirmButton.test.tsx +67 -0
  336. hachi_og-0.1.0/frontend/src/components/ui/ConfirmButton.tsx +110 -0
  337. hachi_og-0.1.0/frontend/src/components/ui/Input.tsx +120 -0
  338. hachi_og-0.1.0/frontend/src/components/ui/JumpToLatest.tsx +45 -0
  339. hachi_og-0.1.0/frontend/src/components/ui/LoyalLoop.tsx +65 -0
  340. hachi_og-0.1.0/frontend/src/components/ui/Markdown.test.tsx +383 -0
  341. hachi_og-0.1.0/frontend/src/components/ui/Markdown.tsx +1032 -0
  342. hachi_og-0.1.0/frontend/src/components/ui/Modal.tsx +74 -0
  343. hachi_og-0.1.0/frontend/src/components/ui/OgExplainer.tsx +142 -0
  344. hachi_og-0.1.0/frontend/src/components/ui/PendingCard.tsx +35 -0
  345. hachi_og-0.1.0/frontend/src/components/ui/StatusPill.tsx +47 -0
  346. hachi_og-0.1.0/frontend/src/components/ui/Switch.test.tsx +35 -0
  347. hachi_og-0.1.0/frontend/src/components/ui/Switch.tsx +97 -0
  348. hachi_og-0.1.0/frontend/src/components/ui/Terminal.test.tsx +18 -0
  349. hachi_og-0.1.0/frontend/src/components/ui/Terminal.tsx +219 -0
  350. hachi_og-0.1.0/frontend/src/components/ui/Toast.tsx +117 -0
  351. hachi_og-0.1.0/frontend/src/components/voice/ContinuousVoice.tsx +671 -0
  352. hachi_og-0.1.0/frontend/src/lib/data/README.md +185 -0
  353. hachi_og-0.1.0/frontend/src/lib/data/bootstrap.ts +37 -0
  354. hachi_og-0.1.0/frontend/src/lib/data/cache.test.ts +297 -0
  355. hachi_og-0.1.0/frontend/src/lib/data/cache.ts +122 -0
  356. hachi_og-0.1.0/frontend/src/lib/data/client.ts +187 -0
  357. hachi_og-0.1.0/frontend/src/lib/data/dedupe.ts +26 -0
  358. hachi_og-0.1.0/frontend/src/lib/data/domains/approvals.ts +330 -0
  359. hachi_og-0.1.0/frontend/src/lib/data/domains/authoring.ts +277 -0
  360. hachi_og-0.1.0/frontend/src/lib/data/domains/chat.test.ts +103 -0
  361. hachi_og-0.1.0/frontend/src/lib/data/domains/chat.ts +1593 -0
  362. hachi_og-0.1.0/frontend/src/lib/data/domains/config.test.ts +149 -0
  363. hachi_og-0.1.0/frontend/src/lib/data/domains/config.ts +464 -0
  364. hachi_og-0.1.0/frontend/src/lib/data/domains/files.ts +156 -0
  365. hachi_og-0.1.0/frontend/src/lib/data/domains/integrations.test.ts +265 -0
  366. hachi_og-0.1.0/frontend/src/lib/data/domains/integrations.ts +988 -0
  367. hachi_og-0.1.0/frontend/src/lib/data/domains/interactions.test.ts +249 -0
  368. hachi_og-0.1.0/frontend/src/lib/data/domains/interactions.ts +147 -0
  369. hachi_og-0.1.0/frontend/src/lib/data/domains/memory.ts +275 -0
  370. hachi_og-0.1.0/frontend/src/lib/data/domains/og.ts +78 -0
  371. hachi_og-0.1.0/frontend/src/lib/data/domains/operator.ts +185 -0
  372. hachi_og-0.1.0/frontend/src/lib/data/domains/providers.ts +210 -0
  373. hachi_og-0.1.0/frontend/src/lib/data/domains/setup.ts +402 -0
  374. hachi_og-0.1.0/frontend/src/lib/data/domains/skills.test.ts +48 -0
  375. hachi_og-0.1.0/frontend/src/lib/data/domains/skills.ts +186 -0
  376. hachi_og-0.1.0/frontend/src/lib/data/domains/spend.ts +174 -0
  377. hachi_og-0.1.0/frontend/src/lib/data/domains/voice.test.ts +172 -0
  378. hachi_og-0.1.0/frontend/src/lib/data/domains/voice.ts +341 -0
  379. hachi_og-0.1.0/frontend/src/lib/data/domains/work.test.ts +99 -0
  380. hachi_og-0.1.0/frontend/src/lib/data/domains/work.ts +514 -0
  381. hachi_og-0.1.0/frontend/src/lib/data/fixtures.ts +394 -0
  382. hachi_og-0.1.0/frontend/src/lib/data/live.ts +39 -0
  383. hachi_og-0.1.0/frontend/src/lib/data/schema.d.ts +6052 -0
  384. hachi_og-0.1.0/frontend/src/lib/data/sse.test.ts +43 -0
  385. hachi_og-0.1.0/frontend/src/lib/data/sse.ts +187 -0
  386. hachi_og-0.1.0/frontend/src/lib/data/types.ts +404 -0
  387. hachi_og-0.1.0/frontend/src/lib/hooks/useBodyScrollLock.ts +16 -0
  388. hachi_og-0.1.0/frontend/src/lib/hooks/useCountdown.ts +74 -0
  389. hachi_og-0.1.0/frontend/src/lib/hooks/useFocusTrap.test.tsx +54 -0
  390. hachi_og-0.1.0/frontend/src/lib/hooks/useFocusTrap.ts +71 -0
  391. hachi_og-0.1.0/frontend/src/lib/hooks/useMediaQuery.ts +40 -0
  392. hachi_og-0.1.0/frontend/src/lib/notifications.ts +48 -0
  393. hachi_og-0.1.0/frontend/src/lib/store/store.test.ts +204 -0
  394. hachi_og-0.1.0/frontend/src/lib/store/store.ts +1807 -0
  395. hachi_og-0.1.0/frontend/src/lib/ui/format.test.ts +134 -0
  396. hachi_og-0.1.0/frontend/src/lib/ui/format.ts +59 -0
  397. hachi_og-0.1.0/frontend/src/lib/ui/platform.ts +4 -0
  398. hachi_og-0.1.0/frontend/src/lib/ui/status.ts +17 -0
  399. hachi_og-0.1.0/frontend/src/lib/voice/speech.ts +239 -0
  400. hachi_og-0.1.0/frontend/src/main.tsx +24 -0
  401. hachi_og-0.1.0/frontend/src/routeTree.gen.ts +294 -0
  402. hachi_og-0.1.0/frontend/src/routes/-index.ApprovalCard.test.tsx +41 -0
  403. hachi_og-0.1.0/frontend/src/routes/__root.tsx +104 -0
  404. hachi_og-0.1.0/frontend/src/routes/approvals.tsx +695 -0
  405. hachi_og-0.1.0/frontend/src/routes/authoring.tsx +964 -0
  406. hachi_og-0.1.0/frontend/src/routes/conversation.tsx +593 -0
  407. hachi_og-0.1.0/frontend/src/routes/index.tsx +847 -0
  408. hachi_og-0.1.0/frontend/src/routes/integrations.tsx +2187 -0
  409. hachi_og-0.1.0/frontend/src/routes/memory.tsx +1214 -0
  410. hachi_og-0.1.0/frontend/src/routes/og.tsx +1283 -0
  411. hachi_og-0.1.0/frontend/src/routes/review.tsx +406 -0
  412. hachi_og-0.1.0/frontend/src/routes/run.tsx +689 -0
  413. hachi_og-0.1.0/frontend/src/routes/settings.tsx +131 -0
  414. hachi_og-0.1.0/frontend/src/routes/skills.tsx +363 -0
  415. hachi_og-0.1.0/frontend/src/routes/work.tsx +1472 -0
  416. hachi_og-0.1.0/frontend/src/styles/global.css +97 -0
  417. hachi_og-0.1.0/frontend/src/styles/index.css +10 -0
  418. hachi_og-0.1.0/frontend/src/styles/interactive.css +414 -0
  419. hachi_og-0.1.0/frontend/src/styles/responsive.css +462 -0
  420. hachi_og-0.1.0/frontend/src/styles/tokens/base.css +42 -0
  421. hachi_og-0.1.0/frontend/src/styles/tokens/colors.css +130 -0
  422. hachi_og-0.1.0/frontend/src/styles/tokens/fonts.css +7 -0
  423. hachi_og-0.1.0/frontend/src/styles/tokens/motion.css +16 -0
  424. hachi_og-0.1.0/frontend/src/styles/tokens/spacing.css +22 -0
  425. hachi_og-0.1.0/frontend/src/styles/tokens/typography.css +27 -0
  426. hachi_og-0.1.0/frontend/src/vite-env.d.ts +11 -0
  427. hachi_og-0.1.0/frontend/tests/interactive-css.test.ts +91 -0
  428. hachi_og-0.1.0/frontend/tsconfig.json +20 -0
  429. hachi_og-0.1.0/frontend/vite.config.ts +46 -0
  430. hachi_og-0.1.0/hachi +21 -0
  431. hachi_og-0.1.0/hachi.bat +3 -0
  432. hachi_og-0.1.0/install.ps1 +199 -0
  433. hachi_og-0.1.0/install.sh +256 -0
  434. hachi_og-0.1.0/mypy-strict-gate.ini +52 -0
  435. hachi_og-0.1.0/openapi/hachi-openapi.json +5911 -0
  436. hachi_og-0.1.0/pyproject.toml +331 -0
  437. hachi_og-0.1.0/qa/__init__.py +1 -0
  438. hachi_og-0.1.0/qa/fixtures/.env.sample +21 -0
  439. hachi_og-0.1.0/qa/fixtures/README.md +28 -0
  440. hachi_og-0.1.0/qa/fixtures/setup-isolated-runtime.sh +29 -0
  441. hachi_og-0.1.0/qa/metrics/__init__.py +1 -0
  442. hachi_og-0.1.0/qa/metrics/pytest_plugin.py +633 -0
  443. hachi_og-0.1.0/qa/metrics/report.py +739 -0
  444. hachi_og-0.1.0/qa/metrics/run_store.py +944 -0
  445. hachi_og-0.1.0/scripts/check_adrs.py +81 -0
  446. hachi_og-0.1.0/scripts/lint_skills.py +61 -0
  447. hachi_og-0.1.0/scripts/measure_turn.py +365 -0
  448. hachi_og-0.1.0/scripts/preflight.py +307 -0
  449. hachi_og-0.1.0/scripts/verify_dist.py +136 -0
  450. hachi_og-0.1.0/settings.example.toml +417 -0
  451. hachi_og-0.1.0/spec/conformance/README.md +11 -0
  452. hachi_og-0.1.0/spec/conformance/conformance.json +49 -0
  453. hachi_og-0.1.0/spec/conformance/fixtures/01-minimal.og +19 -0
  454. hachi_og-0.1.0/spec/conformance/fixtures/02-full-node.og +45 -0
  455. hachi_og-0.1.0/spec/conformance/fixtures/03-scoped.og +32 -0
  456. hachi_og-0.1.0/spec/og-spec-v1.0.md +160 -0
  457. hachi_og-0.1.0/src/hachi/channels/__init__.py +21 -0
  458. hachi_og-0.1.0/src/hachi/channels/base.py +50 -0
  459. hachi_og-0.1.0/src/hachi/channels/discord.py +133 -0
  460. hachi_og-0.1.0/src/hachi/channels/router.py +108 -0
  461. hachi_og-0.1.0/src/hachi/channels/runner.py +44 -0
  462. hachi_og-0.1.0/src/hachi/channels/slack.py +138 -0
  463. hachi_og-0.1.0/src/hachi/channels/telegram.py +120 -0
  464. hachi_og-0.1.0/src/hachi/channels/telegram_commands.py +266 -0
  465. hachi_og-0.1.0/src/hachi/channels/telegram_setup.py +103 -0
  466. hachi_og-0.1.0/src/hachi/channels/whatsapp.py +452 -0
  467. hachi_og-0.1.0/src/hachi/cli/__init__.py +1 -0
  468. hachi_og-0.1.0/src/hachi/cli/commands/__init__.py +1 -0
  469. hachi_og-0.1.0/src/hachi/cli/commands/channel.py +195 -0
  470. hachi_og-0.1.0/src/hachi/cli/commands/daemon.py +147 -0
  471. hachi_og-0.1.0/src/hachi/cli/commands/eval.py +385 -0
  472. hachi_og-0.1.0/src/hachi/cli/commands/jobs.py +114 -0
  473. hachi_og-0.1.0/src/hachi/cli/commands/mcp.py +175 -0
  474. hachi_og-0.1.0/src/hachi/cli/commands/memory.py +349 -0
  475. hachi_og-0.1.0/src/hachi/cli/commands/pack.py +314 -0
  476. hachi_og-0.1.0/src/hachi/cli/commands/schedule.py +249 -0
  477. hachi_og-0.1.0/src/hachi/cli/commands/session.py +583 -0
  478. hachi_og-0.1.0/src/hachi/cli/commands/skill.py +1082 -0
  479. hachi_og-0.1.0/src/hachi/cli/main.py +5780 -0
  480. hachi_og-0.1.0/src/hachi/cli/wizard.py +1090 -0
  481. hachi_og-0.1.0/src/hachi/client/__init__.py +140 -0
  482. hachi_og-0.1.0/src/hachi/client/gaps.py +521 -0
  483. hachi_og-0.1.0/src/hachi/client/gateway.py +591 -0
  484. hachi_og-0.1.0/src/hachi/client/models.py +988 -0
  485. hachi_og-0.1.0/src/hachi/client/sse.py +248 -0
  486. hachi_og-0.1.0/src/hachi/core/__init__.py +1 -0
  487. hachi_og-0.1.0/src/hachi/core/approvals.py +501 -0
  488. hachi_og-0.1.0/src/hachi/core/archive_safety.py +151 -0
  489. hachi_og-0.1.0/src/hachi/core/assertion_eval.py +192 -0
  490. hachi_og-0.1.0/src/hachi/core/atomic_io.py +99 -0
  491. hachi_og-0.1.0/src/hachi/core/browser.py +294 -0
  492. hachi_og-0.1.0/src/hachi/core/bundled_packs.py +85 -0
  493. hachi_og-0.1.0/src/hachi/core/cache_observability.py +128 -0
  494. hachi_og-0.1.0/src/hachi/core/checkpoints.py +144 -0
  495. hachi_og-0.1.0/src/hachi/core/community_packs.py +500 -0
  496. hachi_og-0.1.0/src/hachi/core/config_loader.py +333 -0
  497. hachi_og-0.1.0/src/hachi/core/config_validate.py +94 -0
  498. hachi_og-0.1.0/src/hachi/core/constants.py +28 -0
  499. hachi_og-0.1.0/src/hachi/core/conversation_memory.py +39 -0
  500. hachi_og-0.1.0/src/hachi/core/cost.py +642 -0
  501. hachi_og-0.1.0/src/hachi/core/credential_vault.py +117 -0
  502. hachi_og-0.1.0/src/hachi/core/errors.py +133 -0
  503. hachi_og-0.1.0/src/hachi/core/eval/__init__.py +33 -0
  504. hachi_og-0.1.0/src/hachi/core/eval/corpus.py +427 -0
  505. hachi_og-0.1.0/src/hachi/core/eval/replay.py +255 -0
  506. hachi_og-0.1.0/src/hachi/core/eval/report.py +253 -0
  507. hachi_og-0.1.0/src/hachi/core/eval/runner.py +364 -0
  508. hachi_og-0.1.0/src/hachi/core/eval/scheduled_report.py +377 -0
  509. hachi_og-0.1.0/src/hachi/core/event_bus.py +210 -0
  510. hachi_og-0.1.0/src/hachi/core/file_lock.py +98 -0
  511. hachi_og-0.1.0/src/hachi/core/files/__init__.py +32 -0
  512. hachi_og-0.1.0/src/hachi/core/files/store.py +631 -0
  513. hachi_og-0.1.0/src/hachi/core/graph_recall.py +206 -0
  514. hachi_og-0.1.0/src/hachi/core/idempotency.py +169 -0
  515. hachi_og-0.1.0/src/hachi/core/integrations.py +319 -0
  516. hachi_og-0.1.0/src/hachi/core/lease_manager.py +169 -0
  517. hachi_og-0.1.0/src/hachi/core/llm.py +1027 -0
  518. hachi_og-0.1.0/src/hachi/core/loop.py +1283 -0
  519. hachi_og-0.1.0/src/hachi/core/mcp_client.py +1928 -0
  520. hachi_og-0.1.0/src/hachi/core/memory.py +1561 -0
  521. hachi_og-0.1.0/src/hachi/core/memory_exporter.py +222 -0
  522. hachi_og-0.1.0/src/hachi/core/memory_gardener.py +347 -0
  523. hachi_og-0.1.0/src/hachi/core/memory_graph.py +327 -0
  524. hachi_og-0.1.0/src/hachi/core/memory_guard.py +143 -0
  525. hachi_og-0.1.0/src/hachi/core/memory_importer.py +352 -0
  526. hachi_og-0.1.0/src/hachi/core/memory_index.py +242 -0
  527. hachi_og-0.1.0/src/hachi/core/memory_provider.py +304 -0
  528. hachi_og-0.1.0/src/hachi/core/memory_vault.py +1859 -0
  529. hachi_og-0.1.0/src/hachi/core/memory_writer.py +289 -0
  530. hachi_og-0.1.0/src/hachi/core/migrations.py +56 -0
  531. hachi_og-0.1.0/src/hachi/core/models.py +136 -0
  532. hachi_og-0.1.0/src/hachi/core/net_guard.py +167 -0
  533. hachi_og-0.1.0/src/hachi/core/notifier.py +443 -0
  534. hachi_og-0.1.0/src/hachi/core/oauth.py +362 -0
  535. hachi_og-0.1.0/src/hachi/core/obs/__init__.py +9 -0
  536. hachi_og-0.1.0/src/hachi/core/obs/envelope.py +243 -0
  537. hachi_og-0.1.0/src/hachi/core/obs/logging_setup.py +260 -0
  538. hachi_og-0.1.0/src/hachi/core/obs/metrics.py +417 -0
  539. hachi_og-0.1.0/src/hachi/core/obs/sink.py +131 -0
  540. hachi_og-0.1.0/src/hachi/core/obs/spans.py +158 -0
  541. hachi_og-0.1.0/src/hachi/core/obs/trace.py +184 -0
  542. hachi_og-0.1.0/src/hachi/core/og_history.py +247 -0
  543. hachi_og-0.1.0/src/hachi/core/og_pack.py +490 -0
  544. hachi_og-0.1.0/src/hachi/core/onboarding.py +941 -0
  545. hachi_og-0.1.0/src/hachi/core/pack_index.py +225 -0
  546. hachi_og-0.1.0/src/hachi/core/paths.py +135 -0
  547. hachi_og-0.1.0/src/hachi/core/permissions.py +1220 -0
  548. hachi_og-0.1.0/src/hachi/core/prompt_composer.py +134 -0
  549. hachi_og-0.1.0/src/hachi/core/providers/__init__.py +28 -0
  550. hachi_og-0.1.0/src/hachi/core/providers/anthropic_provider.py +96 -0
  551. hachi_og-0.1.0/src/hachi/core/providers/base.py +156 -0
  552. hachi_og-0.1.0/src/hachi/core/providers/openai_compat_provider.py +104 -0
  553. hachi_og-0.1.0/src/hachi/core/providers/registry.py +293 -0
  554. hachi_og-0.1.0/src/hachi/core/providers/search.py +123 -0
  555. hachi_og-0.1.0/src/hachi/core/providers/speech.py +650 -0
  556. hachi_og-0.1.0/src/hachi/core/providers/tavily_provider.py +220 -0
  557. hachi_og-0.1.0/src/hachi/core/rate_limit.py +128 -0
  558. hachi_og-0.1.0/src/hachi/core/resilience.py +486 -0
  559. hachi_og-0.1.0/src/hachi/core/rest_adapter.py +388 -0
  560. hachi_og-0.1.0/src/hachi/core/routing/__init__.py +27 -0
  561. hachi_og-0.1.0/src/hachi/core/routing/budget.py +99 -0
  562. hachi_og-0.1.0/src/hachi/core/routing/capability.py +32 -0
  563. hachi_og-0.1.0/src/hachi/core/routing/classifier.py +183 -0
  564. hachi_og-0.1.0/src/hachi/core/routing/descriptor.py +82 -0
  565. hachi_og-0.1.0/src/hachi/core/routing/policy.py +225 -0
  566. hachi_og-0.1.0/src/hachi/core/routing/registry.py +150 -0
  567. hachi_og-0.1.0/src/hachi/core/routing/registry_data.py +122 -0
  568. hachi_og-0.1.0/src/hachi/core/routing/router.py +422 -0
  569. hachi_og-0.1.0/src/hachi/core/routing/snapshot.py +41 -0
  570. hachi_og-0.1.0/src/hachi/core/routing/validate.py +84 -0
  571. hachi_og-0.1.0/src/hachi/core/runtime/__init__.py +0 -0
  572. hachi_og-0.1.0/src/hachi/core/runtime/job_handlers.py +485 -0
  573. hachi_og-0.1.0/src/hachi/core/runtime/resume.py +196 -0
  574. hachi_og-0.1.0/src/hachi/core/runtime/state.py +90 -0
  575. hachi_og-0.1.0/src/hachi/core/runtime/store.py +196 -0
  576. hachi_og-0.1.0/src/hachi/core/runtime/waits.py +107 -0
  577. hachi_og-0.1.0/src/hachi/core/runtime_events.py +344 -0
  578. hachi_og-0.1.0/src/hachi/core/runtime_read_models.py +450 -0
  579. hachi_og-0.1.0/src/hachi/core/sandbox.py +572 -0
  580. hachi_og-0.1.0/src/hachi/core/search_cache.py +174 -0
  581. hachi_og-0.1.0/src/hachi/core/secret_scanner.py +486 -0
  582. hachi_og-0.1.0/src/hachi/core/secret_store.py +496 -0
  583. hachi_og-0.1.0/src/hachi/core/session_store.py +1003 -0
  584. hachi_og-0.1.0/src/hachi/core/session_titler.py +128 -0
  585. hachi_og-0.1.0/src/hachi/core/settings.py +479 -0
  586. hachi_og-0.1.0/src/hachi/core/skill_packs.py +126 -0
  587. hachi_og-0.1.0/src/hachi/core/sub_agent.py +891 -0
  588. hachi_og-0.1.0/src/hachi/core/suggestion_chips.py +180 -0
  589. hachi_og-0.1.0/src/hachi/core/testing.py +49 -0
  590. hachi_og-0.1.0/src/hachi/core/tool_results.py +36 -0
  591. hachi_og-0.1.0/src/hachi/core/tracing.py +249 -0
  592. hachi_og-0.1.0/src/hachi/core/turn_context.py +136 -0
  593. hachi_og-0.1.0/src/hachi/core/unofficial_providers.py +283 -0
  594. hachi_og-0.1.0/src/hachi/core/untrusted_content.py +63 -0
  595. hachi_og-0.1.0/src/hachi/core/user_profile.py +542 -0
  596. hachi_og-0.1.0/src/hachi/core/validators.py +376 -0
  597. hachi_og-0.1.0/src/hachi/core/voice.py +624 -0
  598. hachi_og-0.1.0/src/hachi/core/workflow_composer.py +176 -0
  599. hachi_og-0.1.0/src/hachi/daemon.py +577 -0
  600. hachi_og-0.1.0/src/hachi/data/model-registry.json +363 -0
  601. hachi_og-0.1.0/src/hachi/default_skills/brain.og +201 -0
  602. hachi_og-0.1.0/src/hachi/default_skills/core_integrations.og +31 -0
  603. hachi_og-0.1.0/src/hachi/default_skills/general/career.og +130 -0
  604. hachi_og-0.1.0/src/hachi/default_skills/general/currency.og +30 -0
  605. hachi_og-0.1.0/src/hachi/default_skills/general/dictionary.og +30 -0
  606. hachi_og-0.1.0/src/hachi/default_skills/general/finance.og +31 -0
  607. hachi_og-0.1.0/src/hachi/default_skills/general/flight_radar.og +32 -0
  608. hachi_og-0.1.0/src/hachi/default_skills/general/learning.og +132 -0
  609. hachi_og-0.1.0/src/hachi/default_skills/general/math_engine.og +31 -0
  610. hachi_og-0.1.0/src/hachi/default_skills/general/network.og +30 -0
  611. hachi_og-0.1.0/src/hachi/default_skills/general/qr_creator.og +26 -0
  612. hachi_og-0.1.0/src/hachi/default_skills/general/translator.og +32 -0
  613. hachi_og-0.1.0/src/hachi/default_skills/general/weather.og +31 -0
  614. hachi_og-0.1.0/src/hachi/default_skills/general/wiki.og +31 -0
  615. hachi_og-0.1.0/src/hachi/default_skills/google/inbox_sentinel.og +23 -0
  616. hachi_og-0.1.0/src/hachi/default_skills/google/meeting_copilot.og +28 -0
  617. hachi_og-0.1.0/src/hachi/default_skills/google/morning_briefing.og +24 -0
  618. hachi_og-0.1.0/src/hachi/default_skills/google/receipt_sweeper.og +23 -0
  619. hachi_og-0.1.0/src/hachi/default_skills/google/travel_organizer.og +26 -0
  620. hachi_og-0.1.0/src/hachi/default_skills/manifest.json +36 -0
  621. hachi_og-0.1.0/src/hachi/default_skills/notion/notion_brain_dump.og +26 -0
  622. hachi_og-0.1.0/src/hachi/default_skills/notion/project_kickoff.og +26 -0
  623. hachi_og-0.1.0/src/hachi/default_skills/notion/weekly_review.og +27 -0
  624. hachi_og-0.1.0/src/hachi/default_skills/roles/analyst.og +91 -0
  625. hachi_og-0.1.0/src/hachi/default_skills/roles/coder.og +88 -0
  626. hachi_og-0.1.0/src/hachi/default_skills/roles/devops.og +92 -0
  627. hachi_og-0.1.0/src/hachi/default_skills/roles/emailer.og +90 -0
  628. hachi_og-0.1.0/src/hachi/default_skills/roles/researcher.og +86 -0
  629. hachi_og-0.1.0/src/hachi/default_skills/slack/daily_standup.og +28 -0
  630. hachi_og-0.1.0/src/hachi/default_skills/slack/dnd_coordinator.og +26 -0
  631. hachi_og-0.1.0/src/hachi/default_skills/slack/urgent_escalator.og +29 -0
  632. hachi_og-0.1.0/src/hachi/default_skills/technical/frontend_dev.og +268 -0
  633. hachi_og-0.1.0/src/hachi/default_skills/technical/github.og +33 -0
  634. hachi_og-0.1.0/src/hachi/default_skills/technical/npm.og +32 -0
  635. hachi_og-0.1.0/src/hachi/default_skills/technical/pypi.og +32 -0
  636. hachi_og-0.1.0/src/hachi/gateway/__init__.py +9 -0
  637. hachi_og-0.1.0/src/hachi/gateway/_net_guard.py +115 -0
  638. hachi_og-0.1.0/src/hachi/gateway/control_plane.py +1533 -0
  639. hachi_og-0.1.0/src/hachi/gateway/fastapi_app.py +3112 -0
  640. hachi_og-0.1.0/src/hachi/gateway/middleware/__init__.py +0 -0
  641. hachi_og-0.1.0/src/hachi/gateway/middleware/trace.py +164 -0
  642. hachi_og-0.1.0/src/hachi/gateway/orchestrator.py +3737 -0
  643. hachi_og-0.1.0/src/hachi/gateway/provider_admin.py +635 -0
  644. hachi_og-0.1.0/src/hachi/gateway/routing_store.py +175 -0
  645. hachi_og-0.1.0/src/hachi/gateway/shared_services.py +350 -0
  646. hachi_og-0.1.0/src/hachi/gateway/tool_registration.py +129 -0
  647. hachi_og-0.1.0/src/hachi/gateway/voice_endpoints.py +457 -0
  648. hachi_og-0.1.0/src/hachi/gateway/workspace.py +464 -0
  649. hachi_og-0.1.0/src/hachi/integrations/__init__.py +1 -0
  650. hachi_og-0.1.0/src/hachi/integrations/connector_registry.py +455 -0
  651. hachi_og-0.1.0/src/hachi/integrations/google/__init__.py +87 -0
  652. hachi_og-0.1.0/src/hachi/integrations/google/calendar.py +632 -0
  653. hachi_og-0.1.0/src/hachi/integrations/google/client.py +292 -0
  654. hachi_og-0.1.0/src/hachi/integrations/google/contacts.py +290 -0
  655. hachi_og-0.1.0/src/hachi/integrations/google/docs.py +173 -0
  656. hachi_og-0.1.0/src/hachi/integrations/google/drive.py +321 -0
  657. hachi_og-0.1.0/src/hachi/integrations/google/gmail.py +980 -0
  658. hachi_og-0.1.0/src/hachi/integrations/google/meet.py +324 -0
  659. hachi_og-0.1.0/src/hachi/integrations/google/planning.py +245 -0
  660. hachi_og-0.1.0/src/hachi/integrations/google/service.py +64 -0
  661. hachi_og-0.1.0/src/hachi/integrations/google/sheets.py +166 -0
  662. hachi_og-0.1.0/src/hachi/integrations/google/tasks.py +299 -0
  663. hachi_og-0.1.0/src/hachi/integrations/notion/__init__.py +9 -0
  664. hachi_og-0.1.0/src/hachi/integrations/notion/databases.py +130 -0
  665. hachi_og-0.1.0/src/hachi/integrations/notion/pages.py +356 -0
  666. hachi_og-0.1.0/src/hachi/integrations/notion/service.py +90 -0
  667. hachi_og-0.1.0/src/hachi/integrations/oauth_flow.py +870 -0
  668. hachi_og-0.1.0/src/hachi/integrations/slack/__init__.py +9 -0
  669. hachi_og-0.1.0/src/hachi/integrations/slack/chat.py +275 -0
  670. hachi_og-0.1.0/src/hachi/integrations/slack/service.py +171 -0
  671. hachi_og-0.1.0/src/hachi/integrations/slack/workspace.py +115 -0
  672. hachi_og-0.1.0/src/hachi/jobs/__init__.py +39 -0
  673. hachi_og-0.1.0/src/hachi/jobs/queue.py +1115 -0
  674. hachi_og-0.1.0/src/hachi/jobs/scheduler.py +910 -0
  675. hachi_og-0.1.0/src/hachi/og_engine/__init__.py +1 -0
  676. hachi_og-0.1.0/src/hachi/og_engine/engine.py +1881 -0
  677. hachi_og-0.1.0/src/hachi/og_engine/graph_viz.py +244 -0
  678. hachi_og-0.1.0/src/hachi/og_engine/parser.py +762 -0
  679. hachi_og-0.1.0/src/hachi/og_engine/serializer.py +155 -0
  680. hachi_og-0.1.0/src/hachi/og_engine/skill_md.py +149 -0
  681. hachi_og-0.1.0/src/hachi/packs/crm-agent/crm_agent.og +70 -0
  682. hachi_og-0.1.0/src/hachi/packs/crm-agent/pack.toml +17 -0
  683. hachi_og-0.1.0/src/hachi/packs/finance-agent/finance_agent.og +81 -0
  684. hachi_og-0.1.0/src/hachi/packs/finance-agent/pack.toml +16 -0
  685. hachi_og-0.1.0/src/hachi/packs/inbox-sentinel/inbox_sentinel.og +129 -0
  686. hachi_og-0.1.0/src/hachi/packs/inbox-sentinel/pack.toml +17 -0
  687. hachi_og-0.1.0/src/hachi/packs/meeting-copilot/meeting_copilot.og +145 -0
  688. hachi_og-0.1.0/src/hachi/packs/meeting-copilot/pack.toml +17 -0
  689. hachi_og-0.1.0/src/hachi/packs/research-agent/pack.toml +16 -0
  690. hachi_og-0.1.0/src/hachi/packs/research-agent/research_agent.og +76 -0
  691. hachi_og-0.1.0/src/hachi/sdk/__init__.py +113 -0
  692. hachi_og-0.1.0/src/hachi/tools/__init__.py +1 -0
  693. hachi_og-0.1.0/src/hachi/tools/browser_tools.py +192 -0
  694. hachi_og-0.1.0/src/hachi/tools/config_tools.py +733 -0
  695. hachi_og-0.1.0/src/hachi/tools/delegation_tools.py +1033 -0
  696. hachi_og-0.1.0/src/hachi/tools/file_tools.py +342 -0
  697. hachi_og-0.1.0/src/hachi/tools/google_tools.py +129 -0
  698. hachi_og-0.1.0/src/hachi/tools/memory_tools.py +678 -0
  699. hachi_og-0.1.0/src/hachi/tools/messaging_tools.py +322 -0
  700. hachi_og-0.1.0/src/hachi/tools/notification_tools.py +244 -0
  701. hachi_og-0.1.0/src/hachi/tools/og_tools.py +495 -0
  702. hachi_og-0.1.0/src/hachi/tools/os_tools.py +697 -0
  703. hachi_og-0.1.0/src/hachi/tools/presentation_tools.py +300 -0
  704. hachi_og-0.1.0/src/hachi/tools/sandbox_tools.py +219 -0
  705. hachi_og-0.1.0/src/hachi/tools/schedule_tools.py +165 -0
  706. hachi_og-0.1.0/src/hachi/tools/search_tools.py +233 -0
  707. hachi_og-0.1.0/src/hachi/tools/vision_tools.py +469 -0
  708. hachi_og-0.1.0/src/hachi/tools/voice_tools.py +441 -0
  709. hachi_og-0.1.0/src/hachi/tools/workflow_tools.py +70 -0
  710. hachi_og-0.1.0/src/hachi/tui/__init__.py +1 -0
  711. hachi_og-0.1.0/src/hachi/tui/art.py +143 -0
  712. hachi_og-0.1.0/src/hachi/tui/cockpit/__init__.py +16 -0
  713. hachi_og-0.1.0/src/hachi/tui/cockpit/__main__.py +45 -0
  714. hachi_og-0.1.0/src/hachi/tui/cockpit/app.py +172 -0
  715. hachi_og-0.1.0/src/hachi/tui/cockpit/approval.py +232 -0
  716. hachi_og-0.1.0/src/hachi/tui/cockpit/base.py +76 -0
  717. hachi_og-0.1.0/src/hachi/tui/cockpit/data.py +604 -0
  718. hachi_og-0.1.0/src/hachi/tui/cockpit/footer.py +76 -0
  719. hachi_og-0.1.0/src/hachi/tui/cockpit/help.py +156 -0
  720. hachi_og-0.1.0/src/hachi/tui/cockpit/mascot.py +94 -0
  721. hachi_og-0.1.0/src/hachi/tui/cockpit/nav.py +238 -0
  722. hachi_og-0.1.0/src/hachi/tui/cockpit/palette.py +315 -0
  723. hachi_og-0.1.0/src/hachi/tui/cockpit/screen.py +485 -0
  724. hachi_og-0.1.0/src/hachi/tui/cockpit/trust_bar.py +243 -0
  725. hachi_og-0.1.0/src/hachi/tui/cockpit/views/__init__.py +53 -0
  726. hachi_og-0.1.0/src/hachi/tui/cockpit/views/agents.py +191 -0
  727. hachi_og-0.1.0/src/hachi/tui/cockpit/views/approvals.py +206 -0
  728. hachi_og-0.1.0/src/hachi/tui/cockpit/views/audit.py +177 -0
  729. hachi_og-0.1.0/src/hachi/tui/cockpit/views/chat.py +572 -0
  730. hachi_og-0.1.0/src/hachi/tui/cockpit/views/connections.py +270 -0
  731. hachi_og-0.1.0/src/hachi/tui/cockpit/views/dashboard.py +283 -0
  732. hachi_og-0.1.0/src/hachi/tui/cockpit/views/governance.py +350 -0
  733. hachi_og-0.1.0/src/hachi/tui/cockpit/views/memory.py +513 -0
  734. hachi_og-0.1.0/src/hachi/tui/cockpit/views/resources.py +268 -0
  735. hachi_og-0.1.0/src/hachi/tui/cockpit/views/settings.py +316 -0
  736. hachi_og-0.1.0/src/hachi/tui/cockpit/views/skills.py +242 -0
  737. hachi_og-0.1.0/src/hachi/tui/cockpit/views/table.py +534 -0
  738. hachi_og-0.1.0/src/hachi/tui/cockpit/views/tasks.py +200 -0
  739. hachi_og-0.1.0/src/hachi/tui/theme.py +237 -0
  740. hachi_og-0.1.0/tests/conftest.py +180 -0
  741. hachi_og-0.1.0/tests/fixtures/sample_skill.og +72 -0
  742. hachi_og-0.1.0/tests/test_action_approval.py +508 -0
  743. hachi_og-0.1.0/tests/test_agent_session_shutdown.py +53 -0
  744. hachi_og-0.1.0/tests/test_archive_safety.py +203 -0
  745. hachi_og-0.1.0/tests/test_assertion_eval.py +195 -0
  746. hachi_og-0.1.0/tests/test_atomic_state_writes.py +246 -0
  747. hachi_og-0.1.0/tests/test_authoring_backend.py +406 -0
  748. hachi_og-0.1.0/tests/test_b10_episodic_recall_offload.py +228 -0
  749. hachi_og-0.1.0/tests/test_backend_fixes_issues.py +595 -0
  750. hachi_og-0.1.0/tests/test_backup_restore.py +307 -0
  751. hachi_og-0.1.0/tests/test_boot_without_credentials.py +105 -0
  752. hachi_og-0.1.0/tests/test_brain_constraints.py +236 -0
  753. hachi_og-0.1.0/tests/test_browser_tools.py +198 -0
  754. hachi_og-0.1.0/tests/test_cache_observability.py +66 -0
  755. hachi_og-0.1.0/tests/test_calendar_tasks_hardening.py +340 -0
  756. hachi_og-0.1.0/tests/test_channel_whatsapp_cmd.py +447 -0
  757. hachi_og-0.1.0/tests/test_channels.py +154 -0
  758. hachi_og-0.1.0/tests/test_checkpoints.py +79 -0
  759. hachi_og-0.1.0/tests/test_cli_creds_and_og.py +476 -0
  760. hachi_og-0.1.0/tests/test_cli_daemon.py +171 -0
  761. hachi_og-0.1.0/tests/test_cli_gateway_command.py +594 -0
  762. hachi_og-0.1.0/tests/test_cli_mcp_commands.py +196 -0
  763. hachi_og-0.1.0/tests/test_cli_memory.py +103 -0
  764. hachi_og-0.1.0/tests/test_cli_models.py +180 -0
  765. hachi_og-0.1.0/tests/test_cli_run_once.py +108 -0
  766. hachi_og-0.1.0/tests/test_cli_skill_assert.py +102 -0
  767. hachi_og-0.1.0/tests/test_cli_skill_benchmark.py +154 -0
  768. hachi_og-0.1.0/tests/test_cli_skill_changelog.py +81 -0
  769. hachi_og-0.1.0/tests/test_cli_skill_deps.py +48 -0
  770. hachi_og-0.1.0/tests/test_cli_skill_graph.py +82 -0
  771. hachi_og-0.1.0/tests/test_cli_skill_report.py +105 -0
  772. hachi_og-0.1.0/tests/test_cli_skill_search.py +63 -0
  773. hachi_og-0.1.0/tests/test_cli_skill_show.py +68 -0
  774. hachi_og-0.1.0/tests/test_cli_wizard.py +634 -0
  775. hachi_og-0.1.0/tests/test_client_gaps.py +251 -0
  776. hachi_og-0.1.0/tests/test_client_models.py +489 -0
  777. hachi_og-0.1.0/tests/test_client_sse.py +145 -0
  778. hachi_og-0.1.0/tests/test_cockpit_chat_live.py +588 -0
  779. hachi_og-0.1.0/tests/test_cockpit_foundation.py +518 -0
  780. hachi_og-0.1.0/tests/test_cockpit_gaps.py +330 -0
  781. hachi_og-0.1.0/tests/test_cockpit_live_refresh.py +376 -0
  782. hachi_og-0.1.0/tests/test_cockpit_overlays.py +411 -0
  783. hachi_og-0.1.0/tests/test_cockpit_table_views.py +611 -0
  784. hachi_og-0.1.0/tests/test_cockpit_views_e.py +517 -0
  785. hachi_og-0.1.0/tests/test_cockpit_views_f.py +345 -0
  786. hachi_og-0.1.0/tests/test_cold_start_resume.py +402 -0
  787. hachi_og-0.1.0/tests/test_compaction_summary_applyback.py +270 -0
  788. hachi_og-0.1.0/tests/test_config_get_set.py +268 -0
  789. hachi_og-0.1.0/tests/test_config_loader.py +162 -0
  790. hachi_og-0.1.0/tests/test_config_resilience.py +40 -0
  791. hachi_og-0.1.0/tests/test_config_tools.py +661 -0
  792. hachi_og-0.1.0/tests/test_config_validate.py +118 -0
  793. hachi_og-0.1.0/tests/test_connector_credentials.py +487 -0
  794. hachi_og-0.1.0/tests/test_contacts_planning_meet_hardening.py +394 -0
  795. hachi_og-0.1.0/tests/test_conversation_memory.py +205 -0
  796. hachi_og-0.1.0/tests/test_core_tool_cost_guard.py +118 -0
  797. hachi_og-0.1.0/tests/test_cost_tracking.py +442 -0
  798. hachi_og-0.1.0/tests/test_credential_auto_detection.py +278 -0
  799. hachi_og-0.1.0/tests/test_daemon.py +381 -0
  800. hachi_og-0.1.0/tests/test_daily_cap_enforcement.py +218 -0
  801. hachi_og-0.1.0/tests/test_daily_spend_ledger.py +73 -0
  802. hachi_og-0.1.0/tests/test_delegation_credentials.py +63 -0
  803. hachi_og-0.1.0/tests/test_delegation_failclosed.py +323 -0
  804. hachi_og-0.1.0/tests/test_dependency_policy.py +162 -0
  805. hachi_og-0.1.0/tests/test_docker_assets.py +94 -0
  806. hachi_og-0.1.0/tests/test_docs_cli_reference.py +87 -0
  807. hachi_og-0.1.0/tests/test_dotenv_hermeticity.py +81 -0
  808. hachi_og-0.1.0/tests/test_drive_docs_sheets_hardening.py +542 -0
  809. hachi_og-0.1.0/tests/test_durable_fact_extraction.py +323 -0
  810. hachi_og-0.1.0/tests/test_durable_store.py +215 -0
  811. hachi_og-0.1.0/tests/test_durable_waits.py +193 -0
  812. hachi_og-0.1.0/tests/test_e2e_loop.py +773 -0
  813. hachi_og-0.1.0/tests/test_episodic_memory.py +331 -0
  814. hachi_og-0.1.0/tests/test_eval_assertions.py +256 -0
  815. hachi_og-0.1.0/tests/test_eval_replay.py +393 -0
  816. hachi_og-0.1.0/tests/test_eval_report.py +359 -0
  817. hachi_og-0.1.0/tests/test_eval_runner.py +328 -0
  818. hachi_og-0.1.0/tests/test_eval_scheduled_report.py +560 -0
  819. hachi_og-0.1.0/tests/test_event_bus.py +263 -0
  820. hachi_og-0.1.0/tests/test_eventbus_reactivity.py +352 -0
  821. hachi_og-0.1.0/tests/test_file_platform.py +820 -0
  822. hachi_og-0.1.0/tests/test_g1_wave1.py +496 -0
  823. hachi_og-0.1.0/tests/test_g3_compaction.py +306 -0
  824. hachi_og-0.1.0/tests/test_g3_session_store.py +317 -0
  825. hachi_og-0.1.0/tests/test_g3_turn_lock.py +232 -0
  826. hachi_og-0.1.0/tests/test_g3_vault_lazy.py +344 -0
  827. hachi_og-0.1.0/tests/test_g4_security_depth.py +191 -0
  828. hachi_og-0.1.0/tests/test_g5_cleanups.py +258 -0
  829. hachi_og-0.1.0/tests/test_gateway_500_handler.py +61 -0
  830. hachi_og-0.1.0/tests/test_gateway_auth_default.py +555 -0
  831. hachi_og-0.1.0/tests/test_gateway_config_mutations.py +383 -0
  832. hachi_og-0.1.0/tests/test_gateway_control_plane.py +541 -0
  833. hachi_og-0.1.0/tests/test_gateway_core_fixes.py +313 -0
  834. hachi_og-0.1.0/tests/test_gateway_interrupt.py +268 -0
  835. hachi_og-0.1.0/tests/test_gateway_loopback_auth_gate.py +302 -0
  836. hachi_og-0.1.0/tests/test_gateway_models.py +258 -0
  837. hachi_og-0.1.0/tests/test_gateway_new_endpoints.py +911 -0
  838. hachi_og-0.1.0/tests/test_gateway_openai_channels.py +336 -0
  839. hachi_og-0.1.0/tests/test_gateway_resilience.py +54 -0
  840. hachi_og-0.1.0/tests/test_gateway_runtime_validation.py +167 -0
  841. hachi_og-0.1.0/tests/test_gateway_sse.py +91 -0
  842. hachi_og-0.1.0/tests/test_gateway_status_cmd.py +97 -0
  843. hachi_og-0.1.0/tests/test_gateway_web_endpoints.py +349 -0
  844. hachi_og-0.1.0/tests/test_gmail_hardening.py +511 -0
  845. hachi_og-0.1.0/tests/test_google_auth_cmd.py +159 -0
  846. hachi_og-0.1.0/tests/test_google_idempotency.py +103 -0
  847. hachi_og-0.1.0/tests/test_google_integrations.py +528 -0
  848. hachi_og-0.1.0/tests/test_google_tasks_planning.py +416 -0
  849. hachi_og-0.1.0/tests/test_google_tools_wire.py +193 -0
  850. hachi_og-0.1.0/tests/test_graph_viz.py +167 -0
  851. hachi_og-0.1.0/tests/test_hachi_brand.py +52 -0
  852. hachi_og-0.1.0/tests/test_history_lock_race.py +167 -0
  853. hachi_og-0.1.0/tests/test_hot_path_routing.py +495 -0
  854. hachi_og-0.1.0/tests/test_idempotency.py +153 -0
  855. hachi_og-0.1.0/tests/test_ingress_idempotency.py +147 -0
  856. hachi_og-0.1.0/tests/test_install_scripts.py +288 -0
  857. hachi_og-0.1.0/tests/test_interaction_log.py +178 -0
  858. hachi_og-0.1.0/tests/test_interactions_api.py +357 -0
  859. hachi_og-0.1.0/tests/test_iteration_limit.py +118 -0
  860. hachi_og-0.1.0/tests/test_job_dead_letter.py +348 -0
  861. hachi_og-0.1.0/tests/test_job_queue.py +244 -0
  862. hachi_og-0.1.0/tests/test_knowledge_graph_recall.py +491 -0
  863. hachi_og-0.1.0/tests/test_llm_env_resolution.py +26 -0
  864. hachi_og-0.1.0/tests/test_llm_models.py +89 -0
  865. hachi_og-0.1.0/tests/test_llm_prompt_caching.py +105 -0
  866. hachi_og-0.1.0/tests/test_loop_backstop_cancel.py +609 -0
  867. hachi_og-0.1.0/tests/test_loop_phase5.py +147 -0
  868. hachi_og-0.1.0/tests/test_loop_resilience.py +206 -0
  869. hachi_og-0.1.0/tests/test_mcp_client_timeout.py +34 -0
  870. hachi_og-0.1.0/tests/test_mcp_injection_guard.py +51 -0
  871. hachi_og-0.1.0/tests/test_mcp_lifecycle.py +385 -0
  872. hachi_og-0.1.0/tests/test_mcp_registration.py +342 -0
  873. hachi_og-0.1.0/tests/test_mcp_resilience.py +462 -0
  874. hachi_og-0.1.0/tests/test_mcp_tool_visibility.py +99 -0
  875. hachi_og-0.1.0/tests/test_mcp_transport_and_config.py +695 -0
  876. hachi_og-0.1.0/tests/test_measure_turn.py +173 -0
  877. hachi_og-0.1.0/tests/test_memory_cli_crud.py +176 -0
  878. hachi_og-0.1.0/tests/test_memory_decay.py +520 -0
  879. hachi_og-0.1.0/tests/test_memory_fixes.py +815 -0
  880. hachi_og-0.1.0/tests/test_memory_guard.py +57 -0
  881. hachi_og-0.1.0/tests/test_memory_importer.py +326 -0
  882. hachi_og-0.1.0/tests/test_memory_loud_failures.py +134 -0
  883. hachi_og-0.1.0/tests/test_memory_provider.py +182 -0
  884. hachi_og-0.1.0/tests/test_memory_reliability.py +440 -0
  885. hachi_og-0.1.0/tests/test_memory_tools_queue.py +179 -0
  886. hachi_og-0.1.0/tests/test_memory_vault_close.py +166 -0
  887. hachi_og-0.1.0/tests/test_memory_vault_quarantine.py +24 -0
  888. hachi_og-0.1.0/tests/test_messaging_redaction.py +67 -0
  889. hachi_og-0.1.0/tests/test_messaging_tools.py +651 -0
  890. hachi_og-0.1.0/tests/test_migrations.py +180 -0
  891. hachi_og-0.1.0/tests/test_model_registry_json.py +315 -0
  892. hachi_og-0.1.0/tests/test_multi_provider.py +601 -0
  893. hachi_og-0.1.0/tests/test_net_guard.py +233 -0
  894. hachi_og-0.1.0/tests/test_notification_tools.py +606 -0
  895. hachi_og-0.1.0/tests/test_oauth.py +237 -0
  896. hachi_og-0.1.0/tests/test_oauth_integrations.py +644 -0
  897. hachi_og-0.1.0/tests/test_obs_boot_config.py +114 -0
  898. hachi_og-0.1.0/tests/test_obs_envelope.py +189 -0
  899. hachi_og-0.1.0/tests/test_obs_logging.py +209 -0
  900. hachi_og-0.1.0/tests/test_obs_metrics.py +96 -0
  901. hachi_og-0.1.0/tests/test_obs_metrics_activation.py +118 -0
  902. hachi_og-0.1.0/tests/test_obs_middleware.py +234 -0
  903. hachi_og-0.1.0/tests/test_obs_sink.py +199 -0
  904. hachi_og-0.1.0/tests/test_obs_trace.py +109 -0
  905. hachi_og-0.1.0/tests/test_obs_tracing_config.py +120 -0
  906. hachi_og-0.1.0/tests/test_obs_tracing_gate.py +217 -0
  907. hachi_og-0.1.0/tests/test_obs_waterfall.py +167 -0
  908. hachi_og-0.1.0/tests/test_og_benchmark.py +108 -0
  909. hachi_og-0.1.0/tests/test_og_changelog.py +76 -0
  910. hachi_og-0.1.0/tests/test_og_dependencies.py +89 -0
  911. hachi_og-0.1.0/tests/test_og_engine.py +168 -0
  912. hachi_og-0.1.0/tests/test_og_engine_hardening.py +470 -0
  913. hachi_og-0.1.0/tests/test_og_history_and_config.py +295 -0
  914. hachi_og-0.1.0/tests/test_og_lint.py +173 -0
  915. hachi_og-0.1.0/tests/test_og_parser.py +95 -0
  916. hachi_og-0.1.0/tests/test_og_rbac.py +314 -0
  917. hachi_og-0.1.0/tests/test_og_scope_rbac.py +183 -0
  918. hachi_og-0.1.0/tests/test_og_serializer.py +107 -0
  919. hachi_og-0.1.0/tests/test_og_skill_authoring.py +145 -0
  920. hachi_og-0.1.0/tests/test_onboarding_quickstart.py +227 -0
  921. hachi_og-0.1.0/tests/test_onboarding_validation.py +126 -0
  922. hachi_og-0.1.0/tests/test_os_tools_hardening.py +487 -0
  923. hachi_og-0.1.0/tests/test_outbound_redaction.py +67 -0
  924. hachi_og-0.1.0/tests/test_p1_06_qualified_ids.py +232 -0
  925. hachi_og-0.1.0/tests/test_p1_07_retrieval.py +165 -0
  926. hachi_og-0.1.0/tests/test_p1_09_paths.py +111 -0
  927. hachi_og-0.1.0/tests/test_p1_14_mypy_gate.py +61 -0
  928. hachi_og-0.1.0/tests/test_p2_02_job_queue.py +419 -0
  929. hachi_og-0.1.0/tests/test_p2_03b_benchmark_suite.py +292 -0
  930. hachi_og-0.1.0/tests/test_p2_03c_cost_latency.py +251 -0
  931. hachi_og-0.1.0/tests/test_p2_04_memory_index.py +299 -0
  932. hachi_og-0.1.0/tests/test_p2_05_memory_writer.py +234 -0
  933. hachi_og-0.1.0/tests/test_p2_07a_ogpack.py +579 -0
  934. hachi_og-0.1.0/tests/test_p2_07b_pack_index.py +325 -0
  935. hachi_og-0.1.0/tests/test_p2_08_composer.py +434 -0
  936. hachi_og-0.1.0/tests/test_p2_12_agent_packs.py +205 -0
  937. hachi_og-0.1.0/tests/test_p2_14_suggestion_chips.py +148 -0
  938. hachi_og-0.1.0/tests/test_p3_01_memory_graph.py +247 -0
  939. hachi_og-0.1.0/tests/test_p3_02_memory_gardener.py +262 -0
  940. hachi_og-0.1.0/tests/test_p3_04_embedding_rank.py +163 -0
  941. hachi_og-0.1.0/tests/test_p3_06_sdk_v0.py +143 -0
  942. hachi_og-0.1.0/tests/test_p3_07_ops_hygiene.py +132 -0
  943. hachi_og-0.1.0/tests/test_p4_01_multi_agent_v2.py +215 -0
  944. hachi_og-0.1.0/tests/test_p4_02_shared_services.py +263 -0
  945. hachi_og-0.1.0/tests/test_p4_03_parallel_tools.py +220 -0
  946. hachi_og-0.1.0/tests/test_p4_06_m4_cutover.py +222 -0
  947. hachi_og-0.1.0/tests/test_p5_01_conformance.py +184 -0
  948. hachi_og-0.1.0/tests/test_p5_02_skill_new.py +77 -0
  949. hachi_og-0.1.0/tests/test_p5_04_git_sync.py +54 -0
  950. hachi_og-0.1.0/tests/test_p5_05_memoir.py +148 -0
  951. hachi_og-0.1.0/tests/test_pack_security.py +142 -0
  952. hachi_og-0.1.0/tests/test_parallel_delegation.py +276 -0
  953. hachi_og-0.1.0/tests/test_per_turn_budget.py +187 -0
  954. hachi_og-0.1.0/tests/test_perf_regression.py +525 -0
  955. hachi_og-0.1.0/tests/test_permission_gate_hardening.py +395 -0
  956. hachi_og-0.1.0/tests/test_permissions_interactive.py +82 -0
  957. hachi_og-0.1.0/tests/test_permissions_path.py +98 -0
  958. hachi_og-0.1.0/tests/test_permissions_update.py +99 -0
  959. hachi_og-0.1.0/tests/test_phase0_security_hardening.py +298 -0
  960. hachi_og-0.1.0/tests/test_phase7_integrations_mcp_sandbox_deployment.py +270 -0
  961. hachi_og-0.1.0/tests/test_play_audio.py +203 -0
  962. hachi_og-0.1.0/tests/test_presentation_tools.py +217 -0
  963. hachi_og-0.1.0/tests/test_prompt_cache_ordering.py +83 -0
  964. hachi_og-0.1.0/tests/test_prompt_composer.py +105 -0
  965. hachi_og-0.1.0/tests/test_provider_admin.py +498 -0
  966. hachi_og-0.1.0/tests/test_provider_presets.py +60 -0
  967. hachi_og-0.1.0/tests/test_provider_registry.py +129 -0
  968. hachi_og-0.1.0/tests/test_qa_metrics_plugin.py +229 -0
  969. hachi_og-0.1.0/tests/test_qa_report.py +170 -0
  970. hachi_og-0.1.0/tests/test_qa_report_layout.py +144 -0
  971. hachi_og-0.1.0/tests/test_qa_run_store.py +616 -0
  972. hachi_og-0.1.0/tests/test_rate_limit.py +33 -0
  973. hachi_og-0.1.0/tests/test_readiness_probe.py +319 -0
  974. hachi_og-0.1.0/tests/test_resilience.py +372 -0
  975. hachi_og-0.1.0/tests/test_rest_injection_guard.py +80 -0
  976. hachi_og-0.1.0/tests/test_rest_outbound_secret_guard.py +77 -0
  977. hachi_og-0.1.0/tests/test_rest_response_trimming.py +149 -0
  978. hachi_og-0.1.0/tests/test_resume_from_session.py +447 -0
  979. hachi_og-0.1.0/tests/test_retention_sweep.py +309 -0
  980. hachi_og-0.1.0/tests/test_routing_capability.py +34 -0
  981. hachi_og-0.1.0/tests/test_routing_compat.py +208 -0
  982. hachi_og-0.1.0/tests/test_routing_cost_guard.py +42 -0
  983. hachi_og-0.1.0/tests/test_routing_hot_reload.py +416 -0
  984. hachi_og-0.1.0/tests/test_routing_policy.py +113 -0
  985. hachi_og-0.1.0/tests/test_routing_registry.py +223 -0
  986. hachi_og-0.1.0/tests/test_routing_router.py +424 -0
  987. hachi_og-0.1.0/tests/test_routing_validate.py +85 -0
  988. hachi_og-0.1.0/tests/test_runtime_events.py +64 -0
  989. hachi_og-0.1.0/tests/test_runtime_events_redaction.py +151 -0
  990. hachi_og-0.1.0/tests/test_runtime_read_models.py +225 -0
  991. hachi_og-0.1.0/tests/test_runtime_state.py +195 -0
  992. hachi_og-0.1.0/tests/test_sandbox_backend.py +420 -0
  993. hachi_og-0.1.0/tests/test_schedule_job_events.py +195 -0
  994. hachi_og-0.1.0/tests/test_schedule_pause_resume.py +95 -0
  995. hachi_og-0.1.0/tests/test_schedule_run_now.py +158 -0
  996. hachi_og-0.1.0/tests/test_schedule_run_now_gateway.py +170 -0
  997. hachi_og-0.1.0/tests/test_schedule_show.py +160 -0
  998. hachi_og-0.1.0/tests/test_scheduler.py +345 -0
  999. hachi_og-0.1.0/tests/test_scheduler_hardening.py +492 -0
  1000. hachi_og-0.1.0/tests/test_search_platform.py +757 -0
  1001. hachi_og-0.1.0/tests/test_search_tool_visibility.py +86 -0
  1002. hachi_og-0.1.0/tests/test_secret_patterns_extended.py +61 -0
  1003. hachi_og-0.1.0/tests/test_secret_scanner.py +71 -0
  1004. hachi_og-0.1.0/tests/test_secret_scanner_tree.py +332 -0
  1005. hachi_og-0.1.0/tests/test_secret_scanner_tree_hardening.py +342 -0
  1006. hachi_og-0.1.0/tests/test_secret_store.py +529 -0
  1007. hachi_og-0.1.0/tests/test_security_hardening.py +57 -0
  1008. hachi_og-0.1.0/tests/test_serve_frontend_routing.py +141 -0
  1009. hachi_og-0.1.0/tests/test_session_clean.py +212 -0
  1010. hachi_og-0.1.0/tests/test_session_cli.py +251 -0
  1011. hachi_og-0.1.0/tests/test_session_concurrency.py +156 -0
  1012. hachi_og-0.1.0/tests/test_session_cost_tracking.py +202 -0
  1013. hachi_og-0.1.0/tests/test_session_delete_export.py +197 -0
  1014. hachi_og-0.1.0/tests/test_session_messages_cold_boot.py +79 -0
  1015. hachi_og-0.1.0/tests/test_session_ownership.py +266 -0
  1016. hachi_og-0.1.0/tests/test_session_stats.py +138 -0
  1017. hachi_og-0.1.0/tests/test_session_store_delete.py +95 -0
  1018. hachi_og-0.1.0/tests/test_session_store_foreign_keys.py +150 -0
  1019. hachi_og-0.1.0/tests/test_session_store_model_column.py +150 -0
  1020. hachi_og-0.1.0/tests/test_session_store_title.py +153 -0
  1021. hachi_og-0.1.0/tests/test_session_titler.py +134 -0
  1022. hachi_og-0.1.0/tests/test_setup_engine.py +281 -0
  1023. hachi_og-0.1.0/tests/test_shared_services_mcp.py +381 -0
  1024. hachi_og-0.1.0/tests/test_skill_inventory_dedup.py +57 -0
  1025. hachi_og-0.1.0/tests/test_skill_md.py +79 -0
  1026. hachi_og-0.1.0/tests/test_skill_packs.py +437 -0
  1027. hachi_og-0.1.0/tests/test_slack_notion_fixes.py +329 -0
  1028. hachi_og-0.1.0/tests/test_slice22_wiring.py +429 -0
  1029. hachi_og-0.1.0/tests/test_ssrf_security.py +306 -0
  1030. hachi_og-0.1.0/tests/test_streaming.py +814 -0
  1031. hachi_og-0.1.0/tests/test_sub_agent_budget_caps.py +106 -0
  1032. hachi_og-0.1.0/tests/test_sub_agent_iteration_limit_status.py +73 -0
  1033. hachi_og-0.1.0/tests/test_suite_hermeticity.py +31 -0
  1034. hachi_og-0.1.0/tests/test_suspend_workflow.py +220 -0
  1035. hachi_og-0.1.0/tests/test_tavily_status_tristate.py +87 -0
  1036. hachi_og-0.1.0/tests/test_telegram_commands.py +291 -0
  1037. hachi_og-0.1.0/tests/test_telegram_setup.py +251 -0
  1038. hachi_og-0.1.0/tests/test_token_window_management.py +311 -0
  1039. hachi_og-0.1.0/tests/test_tool_lazy_loading.py +210 -0
  1040. hachi_og-0.1.0/tests/test_tool_registration.py +95 -0
  1041. hachi_og-0.1.0/tests/test_tool_result_clearing.py +164 -0
  1042. hachi_og-0.1.0/tests/test_tool_timeline.py +92 -0
  1043. hachi_og-0.1.0/tests/test_tracing.py +117 -0
  1044. hachi_og-0.1.0/tests/test_transcribe_and_summarize.py +206 -0
  1045. hachi_og-0.1.0/tests/test_traverse_hints.py +277 -0
  1046. hachi_og-0.1.0/tests/test_turn_context.py +56 -0
  1047. hachi_og-0.1.0/tests/test_unofficial_providers.py +228 -0
  1048. hachi_og-0.1.0/tests/test_untrusted_content.py +90 -0
  1049. hachi_og-0.1.0/tests/test_user_profile_store.py +600 -0
  1050. hachi_og-0.1.0/tests/test_validators.py +474 -0
  1051. hachi_og-0.1.0/tests/test_verify_dist.py +81 -0
  1052. hachi_og-0.1.0/tests/test_vision_routing_gate.py +295 -0
  1053. hachi_og-0.1.0/tests/test_vision_tools.py +308 -0
  1054. hachi_og-0.1.0/tests/test_vision_url.py +118 -0
  1055. hachi_og-0.1.0/tests/test_voice_channel_allowlist.py +252 -0
  1056. hachi_og-0.1.0/tests/test_voice_endpoints.py +374 -0
  1057. hachi_og-0.1.0/tests/test_voice_pipeline_fixes.py +264 -0
  1058. hachi_og-0.1.0/tests/test_voice_registry_gate.py +288 -0
  1059. hachi_og-0.1.0/tests/test_voice_tools.py +394 -0
  1060. hachi_og-0.1.0/tests/test_web_gui_diag.py +151 -0
  1061. hachi_og-0.1.0/tests/test_webhook_guard.py +108 -0
  1062. hachi_og-0.1.0/tests/test_workspace_brand_heal.py +182 -0
  1063. hachi_og-0.1.0/tests/test_zero_config_onboarding.py +384 -0
  1064. hachi_og-0.1.0/uv.lock +4647 -0
@@ -0,0 +1,7 @@
1
+ # Commit the guardrails (settings.json, hooks/, launch.json); ignore everything
2
+ # that is personal or runtime state.
3
+ settings.local.json
4
+ worktrees/
5
+ *.lock
6
+ # The one-shot push-approval sentinel (bash_guard.py). Must never be committed.
7
+ .push-approved
@@ -0,0 +1,39 @@
1
+ # Hachi role subagents
2
+
3
+ These are committed **Claude Code subagents** (Guardrails Phase 4) — reusable roles that encode
4
+ the disciplines a hook can't enforce on its own. The hooks in [`../hooks/`](../hooks/README.md)
5
+ are the mechanical floor (they *block*); these agents are the *workflow* (they do the work the
6
+ right way). Claude Code auto-delegates to them based on their `description`, or you can ask for
7
+ one by name.
8
+
9
+ | Agent | Use it when | Can edit? | Model |
10
+ |-------|-------------|-----------|-------|
11
+ | [`regression-guard`](regression-guard.md) | Fixing a bug / regression | yes | sonnet |
12
+ | [`scope-sentinel`](scope-sentinel.md) | Reviewing a diff before commit | no (read-only) | inherit |
13
+ | [`gate-keeper`](gate-keeper.md) | Checking the preflight gate before a push | no | sonnet |
14
+
15
+ ## Why these three
16
+ They map to the three disciplines that can't be a one-shot hook:
17
+
18
+ - **The regression law** (failing test → fix → bug-bank entry) needs judgement and code, so it
19
+ can't be a Stop hook — `regression-guard` carries the whole ritual so a fix never lands with the
20
+ test step skipped.
21
+ - **Scope & contract review** is a reading-and-judgement task — `scope-sentinel` reads the diff
22
+ against CLAUDE.md (scope, tests-as-contract, deps, layering, security) without touching it.
23
+ - **The gate is multi-minute and easy to fake** — `gate-keeper` runs `scripts/preflight.py` and
24
+ reports the REAL result, never an assumed green. (`stop_guard.py` only blocks on red `ruff`;
25
+ the full gate is bigger than a hook should run.)
26
+
27
+ ## Important: subagents do NOT inherit CLAUDE.md
28
+ A subagent's Markdown body is its **entire** system prompt — it does not receive the project's
29
+ CLAUDE.md, the conversation history, or the main Claude Code system prompt. So each agent file
30
+ **restates** the rules it needs (the regression law, the gate command, the BB-1 Windows fallback,
31
+ the layering, the security guardrails). **When a project rule changes, update the agent files too**
32
+ — they are deliberately redundant with CLAUDE.md, and that redundancy has to be maintained.
33
+
34
+ ## Editing / adding
35
+ - Frontmatter: `name`, `description` (required); `tools`, `model`, `color`, … (optional). Omit
36
+ `tools` to inherit all; listing it narrows the grant. `model` may be `sonnet`/`opus`/`haiku`/
37
+ `inherit`.
38
+ - Keep them **self-contained** (see above) and **in scope** — these encode existing rules; they
39
+ don't invent policy. New policy goes through CLAUDE.md / DECISIONS.md first.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: gate-keeper
3
+ description: Use to run Hachi's preflight gate and report the REAL result before a commit or push. Runs scripts/preflight.py, reports the actual pass/FAIL/skip per check and the exact pytest counts, and never declares a success it didn't observe. Use when asked "is it green?" or before proposing a push.
4
+ tools: Bash, PowerShell, Read
5
+ model: sonnet
6
+ ---
7
+
8
+ You run **Hachi's** verification gate and report the truth. You do not fix code and you do not
9
+ push. You do **not** inherit CLAUDE.md; what you need is below.
10
+
11
+ # The gate
12
+ One command runs everything and mirrors CI:
13
+
14
+ uv run python scripts/preflight.py # full gate: ruff, mypy strict-gate, skill-lint,
15
+ # import-linter, eval, FULL pytest, frontend
16
+ uv run python scripts/preflight.py --quick # fast inner loop (skips full pytest + FE build)
17
+ uv run python scripts/preflight.py --no-frontend # skip the npm steps if FE deps are absent
18
+
19
+ Exit code is 0 only if every **blocking** check passes. Advisory checks (security-audit, deptry,
20
+ vulture, complexity, adr-lint) may *warn* without failing the gate — report them, but they don't
21
+ block.
22
+
23
+ # How to run it
24
+ 1. Default to the FULL gate before a push; use `--quick` only for a fast inner-loop check, and
25
+ always say which one you ran. Add `--no-frontend` if `frontend/node_modules` is absent.
26
+ 2. **BB-1 (Windows):** if a `uv run` `.exe` shim fails with OS error 4551, the underlying tools
27
+ still work via `python -m` (e.g. `python -m pytest`). preflight goes through `uv run`; if it
28
+ can't start at all, report that — don't guess a result.
29
+ 3. Capture the summary line and each check's pass/FAIL/warn. For the full pytest step, report the
30
+ EXACT counts (e.g. "3943 passed, 21 skipped, 0 failed").
31
+
32
+ # Reporting (being honest is the whole point)
33
+ - State the EXACT result: which checks passed, which FAILED, which were skipped and why.
34
+ - If anything blocking failed, say **"gate RED — do not push"** and quote the failing tail.
35
+ - Never claim a green you didn't see. "Looks done" is not done. If you couldn't run a step, say
36
+ so explicitly instead of implying it passed.
37
+ - You never create the `.claude/.push-approved` sentinel and you never run `git push`: pushing to
38
+ `main` requires the user's explicit OK, and the user creates the sentinel themselves.
39
+
40
+ # What you return
41
+ A short verdict — **GREEN** (safe to propose a push) or **RED** (blocked) — then the per-check
42
+ breakdown, the exact pytest counts, and any advisory warnings, as observed and never assumed.
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: plan-critic
3
+ description: >
4
+ Brutal, unfiltered plan evaluator and critic. Use this agent when you have a plan, proposal,
5
+ design, or approach that needs rigorous review before execution. It ruthlessly identifies
6
+ flaws, blind spots, missing corner cases, faulty assumptions, and low-quality thinking.
7
+ Invoke proactively before any major implementation begins, when proposing architecture
8
+ or design decisions, when writing technical specs, or when you want honest feedback
9
+ on a plan rather than validation. This agent does not sugarcoat — it tells you exactly
10
+ what is wrong and gives you a revised, higher-quality plan.
11
+ tools: Read, Grep, Glob, Bash
12
+ model: opus
13
+ effort: max
14
+ color: red
15
+ ---
16
+
17
+ You are a ruthless, senior technical critic with 20+ years of experience watching well-intentioned plans fail in production. Your job is NOT to be nice. Your job is to make plans actually good before anyone wastes time executing them.
18
+
19
+ You have zero tolerance for:
20
+ - Vague hand-waving ("we'll handle that later")
21
+ - Missing error handling or unhappy paths
22
+ - Untested assumptions presented as facts
23
+ - Scope that ignores operational concerns (monitoring, rollback, migrations)
24
+ - Plans that don't account for failure modes
25
+ - Security and data integrity gaps
26
+ - Performance or scalability blind spots
27
+ - Plans that solve the symptom, not the root cause
28
+
29
+ ---
30
+
31
+ ## YOUR REVIEW PROTOCOL
32
+
33
+ When given a plan, proposal, design, spec, or approach, follow this exact sequence:
34
+
35
+ ### STEP 1 — RESTATE THE PLAN (1 paragraph)
36
+ Summarize what the plan is actually trying to do in your own words. This catches misunderstandings early.
37
+
38
+ ### STEP 2 — INSTANT RED FLAGS
39
+ List things that jumped out immediately as wrong, missing, or alarming. No softening. Just the problems.
40
+
41
+ ### STEP 3 — DEEP CRITIQUE
42
+ Go through each major component of the plan and tear it apart:
43
+
44
+ **Assumptions Audit**
45
+ - What is the plan assuming that may not be true?
46
+ - Which assumptions are load-bearing (the whole plan collapses if they're wrong)?
47
+ - Are there assumptions that contradict each other?
48
+
49
+ **Corner Cases & Edge Cases**
50
+ - What inputs, states, or conditions could break this?
51
+ - What happens under high load, zero load, or partial failure?
52
+ - What about race conditions, retries, duplicate events, or out-of-order operations?
53
+
54
+ **Missing Pieces**
55
+ - What is the plan completely silent on that it should address?
56
+ - Rollback/undo? Error states? Timeouts? Monitoring? Alerting? Data migration? Auth? Rate limiting?
57
+ - Who is responsible for each step? Is that clear?
58
+
59
+ **Failure Mode Analysis**
60
+ - What does failure look like? Is it loud (crash) or silent (wrong data silently persisting)?
61
+ - What is the blast radius if this goes wrong in production?
62
+ - Is there a recovery path, or is this irreversible?
63
+
64
+ **Quality Bar**
65
+ - Is this plan at the level of quality required for production?
66
+ - Would a senior engineer be comfortable shipping this?
67
+ - Does it meet the standard, or is it a sketch masquerading as a plan?
68
+
69
+ ### STEP 4 — VERDICT
70
+ Give one of three verdicts, stated plainly:
71
+
72
+ - **REJECT** — This plan has fundamental flaws. Do not execute it as written. See revised plan below.
73
+ - **REVISE** — This plan has the right direction but significant gaps. Address the issues below before proceeding.
74
+ - **CONDITIONAL APPROVE** — This plan is solid but has specific items that must be resolved before or during execution.
75
+
76
+ Explain the verdict in 2–3 sentences. No hedging.
77
+
78
+ ### STEP 5 — REVISED PLAN (if REJECT or REVISE)
79
+ Write a concrete, improved version of the plan that fixes the problems you identified. This is not a list of "suggestions" — it is a complete, actionable replacement plan or significant revision. Be specific:
80
+ - Break it into numbered steps
81
+ - Name the corner cases that must be handled and how
82
+ - Define success criteria and failure criteria explicitly
83
+ - Include what to do if things go wrong
84
+
85
+ If the plan is so fundamentally broken that a patch won't help, say that, and write the plan from scratch correctly.
86
+
87
+ ---
88
+
89
+ ## TONE AND STYLE
90
+
91
+ - Be direct. Say "This will fail because X" not "There might be some concerns around X."
92
+ - Be specific. "Missing error handling" is useless feedback. "This doesn't handle the case where the third-party API returns a 429 during checkout, which will silently drop the order" is useful.
93
+ - Be constructive. Brutal does not mean cruel or vague — it means honest and precise. Every critique must either name a concrete problem or produce a concrete fix.
94
+ - Do not pad your response with compliments about what the plan got right unless it genuinely helps calibrate the feedback.
95
+ - Do not say "great question" or "interesting approach." Just review the plan.
96
+
97
+ ---
98
+
99
+ ## CONTEXT GATHERING (if you have file access)
100
+
101
+ If the plan references a codebase, existing architecture, or specific files:
102
+ 1. Read the relevant files before critiquing
103
+ 2. Check whether the plan is consistent with what actually exists in the code
104
+ 3. Identify discrepancies between the plan and reality (this is often where the worst problems hide)
105
+
106
+ Run `git log --oneline -20` and `git diff HEAD~5` if you need recent history for context.
107
+
108
+ ---
109
+
110
+ ## EXAMPLE CRITIQUE STRUCTURE
111
+
112
+ ```
113
+ ## PLAN RESTATEMENT
114
+ [Your restatement of what they're trying to do]
115
+
116
+ ## RED FLAGS
117
+ - [Immediate concern 1]
118
+ - [Immediate concern 2]
119
+
120
+ ## DEEP CRITIQUE
121
+
122
+ ### Assumptions Audit
123
+ - [Assumption 1 and why it may be wrong]
124
+ - [Assumption 2 and why it may be wrong]
125
+
126
+ ### Corner Cases & Edge Cases
127
+ - [Edge case 1 and its impact]
128
+ - [Edge case 2 and its impact]
129
+
130
+ ### Missing Pieces
131
+ - [Missing concern 1]
132
+ - [Missing concern 2]
133
+
134
+ ### Failure Mode Analysis
135
+ - [Failure mode 1: what breaks, how badly]
136
+ - [Failure mode 2: what breaks, how badly]
137
+
138
+ ### Quality Bar
139
+ [Assessment of whether this meets production quality]
140
+
141
+ ## VERDICT
142
+ **REJECT / REVISE / CONDITIONAL APPROVE**
143
+ [2-3 sentence explanation]
144
+
145
+ ## REVISED PLAN
146
+ 1. [Step 1 with specifics]
147
+ 2. [Step 2 with specifics]
148
+ ...
149
+ ```
150
+
151
+ ---
152
+
153
+ Your job is to make the plan better, not to make the person feel better. Do that job.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: regression-guard
3
+ description: Use when fixing a bug or regression in the Hachi codebase. Enforces the regression law — writes the FAILING test FIRST, then the minimal fix, then locks it with a docs/bug-bank.md entry. Use PROACTIVELY for any "X is broken / wrong / crashes / returns the wrong thing" task, before writing any fix.
4
+ tools: Read, Write, Edit, Grep, Glob, Bash, PowerShell
5
+ model: sonnet
6
+ ---
7
+
8
+ You fix bugs in **Hachi** (an autonomous agent engine, Python 3.11+, import package `hachi`,
9
+ core loop CLI → Orchestrator → ExecutionLoop → ToolRegistry → LLM). You do it in ONE
10
+ disciplined order and never skip a step. You do **not** inherit the project's CLAUDE.md — every
11
+ rule you need is below.
12
+
13
+ # The regression law (non-negotiable order)
14
+ For every bug:
15
+ 1. **Reproduce, then write a FAILING test FIRST.** Add a test that asserts the *correct*
16
+ behaviour and fails against the current code, proving the bug is real. Put it in the matching
17
+ `tests/` module. Run it and confirm it FAILS for the right reason — show the output.
18
+ 2. **Fix the CODE — never the test.** Make the minimal change that turns the test green. Never
19
+ weaken, skip, `xfail`, comment out, or delete a test to go green. If a test looks wrong, STOP
20
+ and report it — do not "fix" the test.
21
+ 3. **Re-run and prove green.** Run the new test + its module, then the FULL suite — Hachi has
22
+ cross-module regressions that scoped runs miss.
23
+ 4. **Lock it.** Add a `BB-N` entry to `docs/bug-bank.md`: symptom → root cause → the rule that
24
+ prevents recurrence (the `Avoid:` line). This is what stops the bug coming back a third time.
25
+
26
+ # Running tests (Windows-aware)
27
+ - Full suite: `uv run pytest -q`. Run it **sequentially** — do NOT use `-n auto`; parallel
28
+ workers flake the wall-clock timing tests.
29
+ - **BB-1:** on Windows the `.exe` shims can fail with OS error 4551. If `uv run pytest` won't
30
+ start, fall back to `python -m pytest` (and `python -m mypy`).
31
+ - Report ACTUAL pass/fail counts. Never claim a green you did not observe.
32
+
33
+ # Scope & safety
34
+ - Change only what the bug needs. No drive-by refactors, renames, or reformatting; never run a
35
+ repo-wide `ruff format`.
36
+ - Don't add a dependency to fix a bug without flagging it first.
37
+ - Respect the layering: the engine (`core`, `og_engine`, `tools`, `jobs`, `integrations`) must
38
+ not import an edge (`cli`, `tui`) or the `gateway`; `og_engine` may import only `core`. The
39
+ `import-linter` rail fails the gate if you cross a boundary.
40
+ - No `subprocess(..., shell=True)`; no `.env` autoload in the core import path (CLI edge only);
41
+ no per-turn mutation of shared loop state (use the frozen `TurnContext`).
42
+ - **Check `docs/bug-bank.md` BEFORE you start** — this may be a known bug with a known cause.
43
+
44
+ # What you return
45
+ A concise report: the failing test you wrote (path + what it asserts), the root cause, the fix
46
+ (files + lines), the FULL-suite result you OBSERVED (exact counts), and the `BB-N` entry you
47
+ added. If two attempts don't fix it, STOP and report the last known-good state — do not thrash.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: scope-sentinel
3
+ description: Use PROACTIVELY before committing a change in Hachi to review the working diff against the project's contract — scope creep, weakened tests, new dependencies, layering violations, and security guardrails. Read-only; it reviews and reports, it does not edit or commit.
4
+ tools: Read, Grep, Glob, Bash
5
+ model: inherit
6
+ ---
7
+
8
+ You are the scope & contract reviewer for **Hachi** (autonomous agent engine, Python 3.11+).
9
+ You review a working diff and report violations. You are **READ-ONLY**: you never edit, fix, or
10
+ commit — you surface issues for the driver to fix. You do **not** inherit CLAUDE.md; the
11
+ contract you enforce is below.
12
+
13
+ # How to review
14
+ 1. Run `git status`, `git diff`, and `git diff --staged` to see exactly what changed.
15
+ 2. Read the changed files in enough surrounding context to judge intent, not just the hunks.
16
+ 3. Report findings grouped by severity — **BLOCKER**, **WARNING**, **NOTE** — each citing
17
+ `file:line` with a one-line "why it matters". If the diff is clean, say so plainly.
18
+
19
+ # The contract (what you check for)
20
+ - **Scope.** Does every change serve the stated task? Flag drive-by refactors, renames,
21
+ reformatting, and unrelated edits. Flag any deleted functionality, edge-case handling,
22
+ validation, or comments that weren't asked for.
23
+ - **Tests are a contract.** A test that was weakened, skipped, `xfail`ed, commented out, or
24
+ deleted to go green is a **BLOCKER**. A bug fix that ships with NO new regression test is a
25
+ BLOCKER too (the law: failing test first → fix → `docs/bug-bank.md` entry).
26
+ - **Dependencies.** Flag any new entry in `pyproject.toml` dependencies/extras — new runtime
27
+ deps must be proposed, not slipped in.
28
+ - **Architecture layering.** Flag any new import where the engine (`core`, `og_engine`,
29
+ `tools`, `jobs`, `integrations`) imports an edge (`cli`, `tui`) or the `gateway` service;
30
+ `og_engine` may import only `core`. The `import-linter` rail also catches this — call it out
31
+ so it's not a surprise at the gate.
32
+ - **Security guardrails (inviolable).** Flag: `subprocess(..., shell=True)`; interactive
33
+ credential prompts during Textual boot; `.env` autoload added to the core/library import path
34
+ (it belongs only at the CLI edge, gated by `HACHI_DISABLE_DOTENV_AUTOLOAD`); per-turn mutation
35
+ of shared loop state instead of the frozen `TurnContext`; fire-and-forget threads where the
36
+ jobs queue belongs; any committed secret or `.env`.
37
+ - **`tokoboros`.** The old name is fully removed — flag any reintroduced `tokoboros` shim,
38
+ import, or reference in tracked code/docs.
39
+
40
+ # What you return
41
+ The grouped findings with `file:line` citations, plus a final verdict line: **CLEAN** or
42
+ **N blocker(s), M warning(s)**. You do NOT run the full gate (that is `gate-keeper`'s job) and
43
+ you do NOT modify anything.
@@ -0,0 +1,53 @@
1
+ # Claude Code hooks — Hachi's mechanical floor
2
+
3
+ These hooks are the **enforced** layer of the guardrails (CLAUDE.md is the advisory
4
+ layer). They run whether the model "wants" them to or not. Wired in
5
+ [`.claude/settings.json`](../settings.json); committed so they ship to every session
6
+ and every subagent.
7
+
8
+ All hooks are **stdlib-only Python** invoked via the portable exec form
9
+ (`python ${CLAUDE_PROJECT_DIR}/.claude/hooks/<name>.py`) so they behave identically
10
+ under PowerShell, Git Bash, Linux, and macOS. Shared helpers live in `_common.py`.
11
+
12
+ | Hook | Event | What it does | Block? |
13
+ |------|-------|--------------|--------|
14
+ | `session_start.py` | `SessionStart` | Injects the gate command, current branch, and the top bug-bank **Avoid:** rules into context, so a fresh agent never starts cold. | no (additive context) |
15
+ | `bash_guard.py` | `PreToolUse(Bash\|PowerShell)` | (1) blocks `git push` to main/master without an approval sentinel; (2) blocks `git commit` that stages a `.env` or a high-confidence secret; (3) blocks forging the sentinel via Bash. | **yes** (exit 2) |
16
+ | `auto_format.py` | `PostToolUse(Write\|Edit\|MultiEdit)` | `ruff format`s the single touched `.py` file. Keeps diffs clean; never a repo-wide reflow. | no (best-effort) |
17
+ | `stop_guard.py` | `Stop` | Refuses to let the agent finish while `ruff check src tests` is red. | **yes** (exit 2) |
18
+
19
+ ## Approving a push to main
20
+
21
+ The push-lock is deliberate. To grant a **one-shot** push to `main`/`master`:
22
+
23
+ 1. The agent runs `uv run python scripts/preflight.py` and shows it green.
24
+ 2. You give explicit OK in the conversation.
25
+ 3. **You** (not the agent) create the sentinel from your own terminal:
26
+ ```bash
27
+ # from the repo root
28
+ echo > .claude/.push-approved # bash
29
+ ```
30
+ ```powershell
31
+ New-Item .claude/.push-approved -ItemType File -Force # PowerShell
32
+ ```
33
+ 4. The next `git push … main` succeeds and the sentinel is consumed (deleted). A
34
+ second push needs a fresh sentinel. `bash_guard.py` refuses to create it via Bash.
35
+
36
+ ## Testing the hooks
37
+
38
+ Hooks activate at session start (Claude Code asks you to review new hooks first). To
39
+ verify the **logic** without a restart, pipe a mock event into a script and check the
40
+ exit code:
41
+
42
+ ```bash
43
+ echo '{"tool_input":{"command":"git push origin main"}}' | python .claude/hooks/bash_guard.py ; echo "exit=$?" # -> exit=2
44
+ echo '{"tool_input":{"command":"git push origin feature/x"}}' | python .claude/hooks/bash_guard.py ; echo "exit=$?" # -> exit=0
45
+ echo '{"stop_hook_active":false}' | python .claude/hooks/stop_guard.py ; echo "exit=$?" # -> exit=0 when ruff is green
46
+ echo '{}' | python .claude/hooks/session_start.py # -> prints additionalContext JSON
47
+ ```
48
+
49
+ ## Disabling temporarily
50
+
51
+ Comment out (or remove) the relevant block in `.claude/settings.json`, or override it
52
+ in your gitignored `.claude/settings.local.json`. Prefer fixing the underlying issue —
53
+ a hook you route around is a guardrail you no longer have.
@@ -0,0 +1,73 @@
1
+ """Shared helpers for Hachi's Claude Code hooks.
2
+
3
+ Stdlib only, cross-platform. Each hook is invoked as
4
+ `python ${CLAUDE_PROJECT_DIR}/.claude/hooks/<name>.py` with the event payload on
5
+ stdin (see https://code.claude.com/docs/en/hooks). These helpers parse that
6
+ payload, locate the project root + the project's venv tools, and run subprocesses
7
+ portably (Windows PowerShell / Git Bash / Linux / macOS).
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import json
13
+ import os
14
+ import shutil
15
+ import subprocess
16
+ import sys
17
+ from pathlib import Path
18
+
19
+
20
+ def read_event() -> dict:
21
+ """Parse the hook event JSON from stdin. Returns {} on any problem."""
22
+ try:
23
+ raw = sys.stdin.read()
24
+ return json.loads(raw) if raw.strip() else {}
25
+ except Exception:
26
+ return {}
27
+
28
+
29
+ def project_dir() -> Path:
30
+ """Absolute repo root. Prefers $CLAUDE_PROJECT_DIR; else walks up to pyproject.toml."""
31
+ env = os.environ.get("CLAUDE_PROJECT_DIR")
32
+ if env:
33
+ return Path(env)
34
+ here = Path(__file__).resolve()
35
+ for parent in (here.parent, *here.parents):
36
+ if (parent / "pyproject.toml").exists():
37
+ return parent
38
+ return here.parents[2] # .claude/hooks/_common.py -> repo root
39
+
40
+
41
+ def venv_tool(name: str) -> list[str] | None:
42
+ """argv to run a tool from the project venv (fast, no uv overhead), or None.
43
+
44
+ Falls back to PATH. Returns a list so callers can splat extra args onto it.
45
+ """
46
+ root = project_dir()
47
+ for candidate in (
48
+ root / ".venv" / "Scripts" / f"{name}.exe", # Windows
49
+ root / ".venv" / "bin" / name, # POSIX
50
+ ):
51
+ if candidate.exists():
52
+ return [str(candidate)]
53
+ found = shutil.which(name)
54
+ return [found] if found else None
55
+
56
+
57
+ def uv_tool(*args: str) -> list[str] | None:
58
+ """argv to run `uv run <args...>`, or None if uv is not on PATH."""
59
+ uv = shutil.which("uv")
60
+ return [uv, "run", *args] if uv else None
61
+
62
+
63
+ def run(argv: list[str], cwd: str | Path | None = None, timeout: float | None = None) -> subprocess.CompletedProcess:
64
+ """Run a subprocess, capturing text output. Never raises on non-zero exit."""
65
+ return subprocess.run(
66
+ argv,
67
+ cwd=str(cwd or project_dir()),
68
+ capture_output=True,
69
+ text=True,
70
+ encoding="utf-8",
71
+ errors="replace",
72
+ timeout=timeout,
73
+ )
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env python
2
+ """PostToolUse(Write|Edit|MultiEdit) — auto-format the touched file.
3
+
4
+ Keeps diffs clean and stops the agent burning turns on whitespace. Python only
5
+ (ruff format), because that is the formatter this repo uses and the frontend has no
6
+ formatter configured. Best-effort and silent: PostToolUse cannot block, and a
7
+ formatting hiccup must never derail the edit. Only the single touched file is
8
+ formatted — never a repo-wide reflow (forbidden by CLAUDE.md Rule 3).
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ from pathlib import Path
14
+
15
+ import _common
16
+
17
+
18
+ def main() -> int:
19
+ event = _common.read_event()
20
+ file_path = (event.get("tool_input") or {}).get("file_path") or ""
21
+ if not file_path:
22
+ return 0
23
+ path = Path(file_path)
24
+ if path.suffix.lower() != ".py" or not path.exists():
25
+ return 0
26
+ ruff = _common.venv_tool("ruff") or _common.uv_tool("ruff")
27
+ if not ruff:
28
+ return 0
29
+ try:
30
+ _common.run([*ruff, "format", str(path)], timeout=60)
31
+ except Exception:
32
+ pass
33
+ return 0
34
+
35
+
36
+ if __name__ == "__main__":
37
+ raise SystemExit(main())
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env python
2
+ """PreToolUse(Bash/PowerShell) guard — the mechanical wall around dangerous git moves.
3
+
4
+ Three jobs (exit 2 blocks the Bash call; exit 0 lets it through):
5
+ 1. Push-lock: block `git push` to main/master unless a one-shot approval sentinel
6
+ (.claude/.push-approved) exists; the sentinel is consumed on use.
7
+ 2. Secret-scan: block `git commit` that stages a .env or a high-confidence secret.
8
+ 3. Anti-forge: block any Bash command that tries to create the sentinel itself —
9
+ approval must come from the human, not the agent.
10
+
11
+ This converts "ask before pushing" and "don't commit secrets" from advice the model
12
+ can rationalise away into a gate it cannot. The git pre-commit hook is intentionally
13
+ NOT used (core.hooksPath points into a junction here); this covers the agent, which is
14
+ the committer in this workflow.
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ import re
20
+ import shutil
21
+ import subprocess
22
+ import sys
23
+ from pathlib import Path
24
+
25
+ import _common
26
+
27
+ SENTINEL = ".claude/.push-approved"
28
+
29
+ _PUSH = re.compile(r"\bgit\b[^\n]*\bpush\b", re.IGNORECASE)
30
+ _MAIN = re.compile(r"\b(?:origin/)?(?:main|master)\b|HEAD:(?:main|master)\b", re.IGNORECASE)
31
+ _FORGE = re.compile(r"\.push-approved", re.IGNORECASE)
32
+ _FORGE_VERB = re.compile(
33
+ r"(?:touch|echo|printf|new-item|set-content|add-content|tee|>>?)", re.IGNORECASE
34
+ )
35
+ _COMMIT = re.compile(r"\bgit\b[^\n]*\bcommit\b", re.IGNORECASE)
36
+
37
+ # High-confidence secret patterns only — kept deliberately narrow so the gate doesn't
38
+ # false-positive on test fixtures and train the user to disable it.
39
+ _SECRETS: list[tuple[re.Pattern[str], str]] = [
40
+ (
41
+ re.compile(r"-----BEGIN (?:RSA |EC |OPENSSH |DSA |PGP )?PRIVATE KEY-----"),
42
+ "private key block",
43
+ ),
44
+ (re.compile(r"AKIA[0-9A-Z]{16}"), "AWS access key id"),
45
+ (re.compile(r"ghp_[A-Za-z0-9]{36}"), "GitHub token"),
46
+ (re.compile(r"xox[baprs]-[A-Za-z0-9-]{10,}"), "Slack token"),
47
+ (re.compile(r"sk-ant-[A-Za-z0-9_\-]{20,}"), "Anthropic API key"),
48
+ (re.compile(r"sk-[A-Za-z0-9]{40,}"), "OpenAI-style API key"),
49
+ ]
50
+ # .env.* suffixes that are safe to commit (templates, not real secrets).
51
+ _ENV_OK = {"example", "sample", "template", "dist", "defaults"}
52
+
53
+
54
+ def _block(msg: str) -> int:
55
+ sys.stderr.write(msg + "\n")
56
+ return 2
57
+
58
+
59
+ def _scan_staged(root: Path) -> str | None:
60
+ git = shutil.which("git")
61
+ if not git:
62
+ return None
63
+ try:
64
+ names = subprocess.run(
65
+ [git, "diff", "--cached", "--name-only"],
66
+ cwd=str(root),
67
+ capture_output=True,
68
+ text=True,
69
+ timeout=15,
70
+ )
71
+ for name in (n.strip() for n in names.stdout.splitlines() if n.strip()):
72
+ base = name.rsplit("/", 1)[-1].rsplit("\\", 1)[-1]
73
+ if base == ".env":
74
+ return f"a .env file is staged ({name})"
75
+ if base.startswith(".env.") and base.split(".env.", 1)[1] not in _ENV_OK:
76
+ return f"a secret env file is staged ({name})"
77
+ diff = subprocess.run(
78
+ [git, "diff", "--cached", "--unified=0"],
79
+ cwd=str(root),
80
+ capture_output=True,
81
+ text=True,
82
+ timeout=20,
83
+ )
84
+ added = "\n".join(
85
+ ln for ln in diff.stdout.splitlines() if ln.startswith("+") and not ln.startswith("+++")
86
+ )
87
+ for pattern, label in _SECRETS:
88
+ if pattern.search(added):
89
+ return f"a possible {label} in the staged diff"
90
+ except Exception:
91
+ return None
92
+ return None
93
+
94
+
95
+ def main() -> int:
96
+ event = _common.read_event()
97
+ cmd = (event.get("tool_input") or {}).get("command") or ""
98
+ if not cmd:
99
+ return 0
100
+ root = _common.project_dir()
101
+
102
+ # (3) The sentinel must be created by the human, never forged via Bash.
103
+ if _FORGE.search(cmd) and _FORGE_VERB.search(cmd):
104
+ return _block(
105
+ "[bash_guard] The push-approval sentinel may only be created by the human, not via Bash.\n"
106
+ "Ask the user to approve the push explicitly."
107
+ )
108
+
109
+ # (1) Push-lock on main/master.
110
+ if _PUSH.search(cmd) and _MAIN.search(cmd):
111
+ sentinel = root / SENTINEL
112
+ if sentinel.exists():
113
+ try:
114
+ sentinel.unlink() # one-shot: consume the approval
115
+ except Exception:
116
+ pass
117
+ return 0
118
+ return _block(
119
+ "[bash_guard] Push to main/master is LOCKED.\n"
120
+ "1) Run `uv run python scripts/preflight.py` and show it green.\n"
121
+ "2) Get the user's explicit OK in this conversation.\n"
122
+ f"3) The user (not you) creates the sentinel file: {SENTINEL}\n"
123
+ "Then the push is allowed exactly once."
124
+ )
125
+
126
+ # (2) Secret-scan on commits.
127
+ if _COMMIT.search(cmd):
128
+ hit = _scan_staged(root)
129
+ if hit:
130
+ return _block(
131
+ f"[bash_guard] Refusing to commit: {hit}.\n"
132
+ "Unstage it and move the secret to the keyring vault or an ignored .env."
133
+ )
134
+ return 0
135
+
136
+
137
+ if __name__ == "__main__":
138
+ raise SystemExit(main())