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.
- hachi_og-0.1.0/.claude/.gitignore +7 -0
- hachi_og-0.1.0/.claude/agents/README.md +39 -0
- hachi_og-0.1.0/.claude/agents/gate-keeper.md +42 -0
- hachi_og-0.1.0/.claude/agents/plan-critic.md +153 -0
- hachi_og-0.1.0/.claude/agents/regression-guard.md +47 -0
- hachi_og-0.1.0/.claude/agents/scope-sentinel.md +43 -0
- hachi_og-0.1.0/.claude/hooks/README.md +53 -0
- hachi_og-0.1.0/.claude/hooks/_common.py +73 -0
- hachi_og-0.1.0/.claude/hooks/auto_format.py +37 -0
- hachi_og-0.1.0/.claude/hooks/bash_guard.py +138 -0
- hachi_og-0.1.0/.claude/hooks/session_start.py +104 -0
- hachi_og-0.1.0/.claude/hooks/stop_guard.py +43 -0
- hachi_og-0.1.0/.claude/launch.json +18 -0
- hachi_og-0.1.0/.claude/settings.json +55 -0
- hachi_og-0.1.0/.dockerignore +22 -0
- hachi_og-0.1.0/.gitattributes +5 -0
- hachi_og-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
- hachi_og-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- hachi_og-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +20 -0
- hachi_og-0.1.0/.github/instructions/hachi-python-guardrails.instructions.md +31 -0
- hachi_og-0.1.0/.github/workflows/ci.yml +320 -0
- hachi_og-0.1.0/.github/workflows/release.yml +66 -0
- hachi_og-0.1.0/.gitignore +95 -0
- hachi_og-0.1.0/.secret-scan-allowlist +45 -0
- hachi_og-0.1.0/AGENTS.md +38 -0
- hachi_og-0.1.0/ARCHITECTURE.md +262 -0
- hachi_og-0.1.0/CLAUDE.md +88 -0
- hachi_og-0.1.0/CODEOWNERS +9 -0
- hachi_og-0.1.0/CODE_OF_CONDUCT.md +99 -0
- hachi_og-0.1.0/CONTRIBUTING.md +282 -0
- hachi_og-0.1.0/Dockerfile +35 -0
- hachi_og-0.1.0/HACHI_GUARDRAIL.md +339 -0
- hachi_og-0.1.0/LICENSE +201 -0
- hachi_og-0.1.0/NOTICE +13 -0
- hachi_og-0.1.0/PKG-INFO +373 -0
- hachi_og-0.1.0/README.md +301 -0
- hachi_og-0.1.0/SECURITY.md +167 -0
- hachi_og-0.1.0/TRADEMARK.md +43 -0
- hachi_og-0.1.0/benchmarks/og_bench/__init__.py +1 -0
- hachi_og-0.1.0/benchmarks/og_bench/data/s_real_results_v1.json +60 -0
- hachi_og-0.1.0/benchmarks/og_bench/metrics.py +401 -0
- hachi_og-0.1.0/benchmarks/og_bench/s_real_probes.json +288 -0
- hachi_og-0.1.0/conftest.py +1 -0
- hachi_og-0.1.0/design-system/.thumbnail +0 -0
- hachi_og-0.1.0/design-system/SKILL.md +27 -0
- hachi_og-0.1.0/design-system/_adherence.oxlintrc.json +323 -0
- hachi_og-0.1.0/design-system/_ds_bundle.js +1867 -0
- hachi_og-0.1.0/design-system/_ds_manifest.json +1 -0
- hachi_og-0.1.0/design-system/assets/hachi-app-icon.svg +9 -0
- hachi_og-0.1.0/design-system/assets/hachi-loop.svg +3 -0
- hachi_og-0.1.0/design-system/assets/hachi-mark-knockout.svg +5 -0
- hachi_og-0.1.0/design-system/assets/hachi-mark.svg +14 -0
- hachi_og-0.1.0/design-system/components/core/Badge.d.ts +11 -0
- hachi_og-0.1.0/design-system/components/core/Badge.jsx +32 -0
- hachi_og-0.1.0/design-system/components/core/Badge.prompt.md +9 -0
- hachi_og-0.1.0/design-system/components/core/Button.d.ts +21 -0
- hachi_og-0.1.0/design-system/components/core/Button.jsx +87 -0
- hachi_og-0.1.0/design-system/components/core/Button.prompt.md +10 -0
- hachi_og-0.1.0/design-system/components/core/Card.d.ts +11 -0
- hachi_og-0.1.0/design-system/components/core/Card.jsx +19 -0
- hachi_og-0.1.0/design-system/components/core/Card.prompt.md +10 -0
- hachi_og-0.1.0/design-system/components/core/Input.d.ts +12 -0
- hachi_og-0.1.0/design-system/components/core/Input.jsx +37 -0
- hachi_og-0.1.0/design-system/components/core/Input.prompt.md +8 -0
- hachi_og-0.1.0/design-system/components/core/StatusPill.d.ts +15 -0
- hachi_og-0.1.0/design-system/components/core/StatusPill.jsx +36 -0
- hachi_og-0.1.0/design-system/components/core/StatusPill.prompt.md +10 -0
- hachi_og-0.1.0/design-system/components/core/Switch.d.ts +12 -0
- hachi_og-0.1.0/design-system/components/core/Switch.jsx +39 -0
- hachi_og-0.1.0/design-system/components/core/Switch.prompt.md +7 -0
- hachi_og-0.1.0/design-system/components/feedback/LoyalLoop.d.ts +14 -0
- hachi_og-0.1.0/design-system/components/feedback/LoyalLoop.jsx +23 -0
- hachi_og-0.1.0/design-system/components/feedback/LoyalLoop.prompt.md +7 -0
- hachi_og-0.1.0/design-system/components/feedback/Toast.d.ts +12 -0
- hachi_og-0.1.0/design-system/components/feedback/Toast.jsx +35 -0
- hachi_og-0.1.0/design-system/components/feedback/Toast.prompt.md +8 -0
- hachi_og-0.1.0/design-system/components/hachi/HachiMark.d.ts +12 -0
- hachi_og-0.1.0/design-system/components/hachi/HachiMark.jsx +34 -0
- hachi_og-0.1.0/design-system/components/hachi/HachiMark.prompt.md +8 -0
- hachi_og-0.1.0/design-system/components/hachi/LeashPrompt.d.ts +20 -0
- hachi_og-0.1.0/design-system/components/hachi/LeashPrompt.jsx +86 -0
- hachi_og-0.1.0/design-system/components/hachi/LeashPrompt.prompt.md +14 -0
- hachi_og-0.1.0/design-system/components/hachi/RunCard.d.ts +22 -0
- hachi_og-0.1.0/design-system/components/hachi/RunCard.jsx +58 -0
- hachi_og-0.1.0/design-system/components/hachi/RunCard.prompt.md +8 -0
- hachi_og-0.1.0/design-system/components/hachi/Terminal.d.ts +20 -0
- hachi_og-0.1.0/design-system/components/hachi/Terminal.jsx +43 -0
- hachi_og-0.1.0/design-system/components/hachi/Terminal.prompt.md +13 -0
- hachi_og-0.1.0/design-system/readme.md +176 -0
- hachi_og-0.1.0/design-system/styles.css +8 -0
- hachi_og-0.1.0/design-system/templates/leash-prompt/ds-base.js +15 -0
- hachi_og-0.1.0/design-system/templates/leash-prompt/support.js +1466 -0
- hachi_og-0.1.0/design-system/tokens/base.css +42 -0
- hachi_og-0.1.0/design-system/tokens/colors.css +86 -0
- hachi_og-0.1.0/design-system/tokens/fonts.css +7 -0
- hachi_og-0.1.0/design-system/tokens/motion.css +16 -0
- hachi_og-0.1.0/design-system/tokens/spacing.css +22 -0
- hachi_og-0.1.0/design-system/tokens/typography.css +27 -0
- hachi_og-0.1.0/design-system/ui_kits/cli/Cli.jsx +63 -0
- hachi_og-0.1.0/design-system/ui_kits/cli/README.md +11 -0
- hachi_og-0.1.0/design-system/ui_kits/tui/README.md +16 -0
- hachi_og-0.1.0/design-system/ui_kits/tui/Tui.jsx +150 -0
- hachi_og-0.1.0/design-system/ui_kits/webapp/README.md +22 -0
- hachi_og-0.1.0/design-system/ui_kits/webapp/Sidebar.jsx +73 -0
- hachi_og-0.1.0/design-system/ui_kits/webapp/Workspace.jsx +102 -0
- hachi_og-0.1.0/design-system/ui_kits/webapp/icons.jsx +32 -0
- hachi_og-0.1.0/design-system/uploads/hachi-token.css +33 -0
- hachi_og-0.1.0/design-system/uploads/hachi.svg +14 -0
- hachi_og-0.1.0/docker-compose.yml +60 -0
- hachi_og-0.1.0/docs/AUDIT.md +577 -0
- hachi_og-0.1.0/docs/DECISIONS.md +2962 -0
- hachi_og-0.1.0/docs/README.md +46 -0
- hachi_og-0.1.0/docs/architecture/01-architecture-analysis.md +170 -0
- hachi_og-0.1.0/docs/architecture/02-current-state.md +184 -0
- hachi_og-0.1.0/docs/architecture/03-tech-debt.md +179 -0
- hachi_og-0.1.0/docs/architecture/04-extension-points.md +147 -0
- hachi_og-0.1.0/docs/architecture/05-risk-assessment.md +168 -0
- hachi_og-0.1.0/docs/architecture/06-gap-analysis.md +96 -0
- hachi_og-0.1.0/docs/architecture/10-target-architecture.md +169 -0
- hachi_og-0.1.0/docs/architecture/11-domain-boundaries.md +83 -0
- hachi_og-0.1.0/docs/architecture/12-event-architecture.md +107 -0
- hachi_og-0.1.0/docs/architecture/13-provider-architecture.md +181 -0
- hachi_og-0.1.0/docs/architecture/14-capability-registry.md +162 -0
- hachi_og-0.1.0/docs/architecture/15-model-routing.md +148 -0
- hachi_og-0.1.0/docs/architecture/16-durable-execution.md +161 -0
- hachi_og-0.1.0/docs/architecture/17-search-platform.md +81 -0
- hachi_og-0.1.0/docs/architecture/18-attachment-platform.md +93 -0
- hachi_og-0.1.0/docs/architecture/19-voice-platform.md +66 -0
- hachi_og-0.1.0/docs/architecture/20-vision-platform.md +76 -0
- hachi_og-0.1.0/docs/architecture/21-observability.md +284 -0
- hachi_og-0.1.0/docs/architecture/22-database-changes.md +60 -0
- hachi_og-0.1.0/docs/architecture/23-api-changes.md +59 -0
- hachi_og-0.1.0/docs/architecture/24-configuration-changes.md +74 -0
- hachi_og-0.1.0/docs/architecture/25-migration-strategy.md +66 -0
- hachi_og-0.1.0/docs/architecture/26-backward-compatibility.md +51 -0
- hachi_og-0.1.0/docs/architecture/27-testing-strategy.md +60 -0
- hachi_og-0.1.0/docs/architecture/28-rollout-plan.md +63 -0
- hachi_og-0.1.0/docs/architecture/29-design-review.md +232 -0
- hachi_og-0.1.0/docs/architecture/README.md +106 -0
- hachi_og-0.1.0/docs/architecture/adr/0000-template.md +33 -0
- hachi_og-0.1.0/docs/architecture/adr/0001-capability-based-model-routing.md +55 -0
- hachi_og-0.1.0/docs/architecture/adr/0002-aiprovider-capability-interface.md +56 -0
- hachi_og-0.1.0/docs/architecture/adr/0003-event-bus-over-emit-funnel.md +38 -0
- hachi_og-0.1.0/docs/architecture/adr/0004-durable-run-state-on-sqlite-job-substrate.md +51 -0
- hachi_og-0.1.0/docs/architecture/adr/0005-observability-correlation-and-injected-exporter.md +95 -0
- hachi_og-0.1.0/docs/architecture/adr/README.md +43 -0
- hachi_og-0.1.0/docs/assets/hachi-banner-readme.svg +91 -0
- hachi_og-0.1.0/docs/assets/hachi-blink-code-of-conduct.svg +70 -0
- hachi_og-0.1.0/docs/assets/hachi-blink-contributing.svg +81 -0
- hachi_og-0.1.0/docs/assets/hachi-blink-security.svg +70 -0
- hachi_og-0.1.0/docs/audit/2026-06-28/COST_BASELINE.json +131 -0
- hachi_og-0.1.0/docs/audit/2026-06-28/COST_ROADMAP.md +37 -0
- hachi_og-0.1.0/docs/audit/2026-06-28/OPTIMIZATIONS_IMPLEMENTED.md +120 -0
- hachi_og-0.1.0/docs/audit/2026-06-28/PRICING_VALIDATION.md +149 -0
- hachi_og-0.1.0/docs/audit/2026-06-28/REMAINING_WORK_PLAN.md +537 -0
- hachi_og-0.1.0/docs/audit/2026-06-28/STREAMING_PERF_PLAN.md +227 -0
- hachi_og-0.1.0/docs/audit/2026-06-28/TOKEN_AUDIT_REPORT.md +70 -0
- hachi_og-0.1.0/docs/audit/2026-07-03/BACKLOG.md +327 -0
- hachi_og-0.1.0/docs/audit/2026-07-03/DETAILED_FINDINGS.md +96 -0
- hachi_og-0.1.0/docs/audit/2026-07-03/GAP_ANALYSIS.md +166 -0
- hachi_og-0.1.0/docs/audit/2026-07-03/PRODUCTION_READINESS.md +183 -0
- hachi_og-0.1.0/docs/audit/2026-07-03/TASKS.md +316 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/ARCHITECTURE-REVIEW.md +289 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/CORRECTIONS.md +672 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/README.md +326 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-01-approver-selection-dead-branch.md +498 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-02-settings-example-toml.md +528 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-03-config-writers-file-layer-only.md +634 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-04-kennel-pack-store.md +555 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-05-routing-cost-warnings-arity.md +342 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-06-memory-settings-reach-vault.md +540 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-07-eval-reports-config-section.md +441 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-08-memory-gardener.md +426 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-09-file-extracted-shared-bus.md +470 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-10-shared-session-store.md +546 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-11-auto-memory-key-resolution.md +558 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-12-provider-kinds-schema.md +454 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-13-feature-liveness-smoke.md +487 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-14-ban-getattr-own-types.md +459 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-15-approvals-through-control-plane.md +434 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-16-approval-real-deadline.md +471 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-17-fe-resolve-approvals-by-request-id.md +527 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-18-fe-surface-decision-failures.md +454 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-19-fe-stop-fabricating-audit-rows.md +422 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-20-govern-channel-schedule-sessions.md +481 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-21-tui-degraded-state.md +500 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-22-web-fixtures-out-of-prod-bundle.md +432 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-23-thread-llm-timeout.md +619 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-24-collapse-retry-layers.md +595 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-25-served-model-cost-attribution.md +530 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-26-routing-boot-failure-visible.md +371 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-27-forward-max-tokens-resilient-client.md +407 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-28-wall-clock-deadline-hung-socket.md +476 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-29-sse-disconnect-scope.md +453 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-30-sse-gap-signal.md +569 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-31-openai-facade-decision.md +555 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-32-facade-session-isolation.md +487 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-33-facade-session-lifecycle.md +440 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-34-subagent-schedule-tool-blocklist.md +582 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-35-google-double-mount.md +648 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-36-tool-registry-duplicate-guard.md +444 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-37-error-envelope-in-openapi.md +400 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-38-openapi-pilot-og-domain.md +582 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-39-tool-groups-at-registration.md +570 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-40-emit-runtime-event-closure-capture.md +600 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-41-extract-in-process-runtime.md +590 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-42-retire-core-cli-seam.md +496 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-43-collapse-control-plane-interfaces.md +538 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-44-boot-agent-staged-builders.md +520 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-45-boot-agent-constructor-stashes.md +518 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-46-session-read-models-facade.md +495 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-47-lift-routers-out-of-closure.md +541 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-48-memory-package-boundary.md +509 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-49-memory-provider-seam-decision.md +586 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-50-memory-session-provenance.md +532 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-51-memory-delete-tri-store.md +761 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-52-memory-compaction-persistence.md +565 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-53-jobs-db-path-unification.md +612 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-54-schema-version-tables.md +655 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-55-backup-completeness.md +646 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-56-pack-consent-every-install-path.md +536 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-57-oauth-consolidation.md +484 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-58-declarative-integrations-consolidation.md +491 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-59-exception-taxonomy-unification.md +460 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-60-twin-contract-types.md +430 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-61-single-tenant-adr.md +433 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-62-session-messages-ownership-check.md +413 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-63-frontend-store-slices.md +462 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-64-frontend-fix-false-cycle-comment.md +333 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-65-chat-ts-kernel-extraction.md +460 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-66-approval-string-ids.md +510 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-67-governance-drift-cleanup.md +631 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-68-import-linter-exemption-burndown.md +497 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-69-mypy-burndown-ratchet.md +450 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-70-test-tree-mirroring.md +487 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-71-injected-clocks-restore-parallelism.md +489 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-72-og-spec-executable-surface.md +474 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-73-skill-engine-collaborators.md +502 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-74-repo-hygiene-sweep.md +679 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-75-durable-event-log.md +773 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-76-bless-sdk-public-surface.md +731 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/T-77-consolidate-prompts-into-composer.md +732 -0
- hachi_og-0.1.0/docs/audit/2026-07-19/tasks/_TEMPLATE.md +129 -0
- hachi_og-0.1.0/docs/brand/hachi/hachi-app-icon.svg +9 -0
- hachi_og-0.1.0/docs/brand/hachi/hachi-loop.svg +3 -0
- hachi_og-0.1.0/docs/brand/hachi/hachi-mark-knockout.svg +5 -0
- hachi_og-0.1.0/docs/brand/hachi/hachi-mark.svg +14 -0
- hachi_og-0.1.0/docs/brand/hachi-token.css +33 -0
- hachi_og-0.1.0/docs/brand/hachi.svg +14 -0
- hachi_og-0.1.0/docs/bug-bank.md +2347 -0
- hachi_og-0.1.0/docs/design/hachi-tui-spec.md +1133 -0
- hachi_og-0.1.0/docs/design/hachi-web-ui-requirements.md +271 -0
- hachi_og-0.1.0/docs/guides/configuration.md +560 -0
- hachi_og-0.1.0/docs/guides/cookbook.md +565 -0
- hachi_og-0.1.0/docs/guides/git-sync.md +73 -0
- hachi_og-0.1.0/docs/guides/memory.md +117 -0
- hachi_og-0.1.0/docs/guides/releasing.md +67 -0
- hachi_og-0.1.0/docs/history/god-tier-plan.md +216 -0
- hachi_og-0.1.0/docs/history/tui-product-brief.md +157 -0
- hachi_og-0.1.0/docs/plans/Observability-plan.md +236 -0
- hachi_og-0.1.0/docs/reference/benchmark.md +270 -0
- hachi_og-0.1.0/docs/reference/objectgraph-spec.md +1741 -0
- hachi_og-0.1.0/docs/reference/og-security.md +189 -0
- hachi_og-0.1.0/docs/strategy/00-index.md +40 -0
- hachi_og-0.1.0/docs/strategy/00-recon.md +346 -0
- hachi_og-0.1.0/docs/strategy/01-architecture-review.md +270 -0
- hachi_og-0.1.0/docs/strategy/02-object-graph-eval.md +254 -0
- hachi_og-0.1.0/docs/strategy/03-competitive-and-positioning.md +191 -0
- hachi_og-0.1.0/docs/strategy/04-memory-redesign.md +258 -0
- hachi_og-0.1.0/docs/strategy/05-agent-platform.md +197 -0
- hachi_og-0.1.0/docs/strategy/06-ux-redesign.md +234 -0
- hachi_og-0.1.0/docs/strategy/07-future-and-growth.md +170 -0
- hachi_og-0.1.0/docs/strategy/08-roadmap.md +136 -0
- hachi_og-0.1.0/docs/strategy/09-execution-plan.md +538 -0
- hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/01-hachi-ground-truth.md +73 -0
- hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/02-competitive-landscape.md +136 -0
- hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/03-gap-analysis.md +97 -0
- hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/04-first-principles-and-bets.md +117 -0
- hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/README.md +85 -0
- hachi_og-0.1.0/docs/strategy/2026-07-05-competitive-review/SOURCES.md +68 -0
- hachi_og-0.1.0/docs/web/backend-api-gaps.md +269 -0
- hachi_og-0.1.0/frontend/.dockerignore +8 -0
- hachi_og-0.1.0/frontend/.env.example +31 -0
- hachi_og-0.1.0/frontend/Dockerfile +25 -0
- hachi_og-0.1.0/frontend/IMPLEMENTATION_CONTRACT.md +202 -0
- hachi_og-0.1.0/frontend/docker-entrypoint.sh +15 -0
- hachi_og-0.1.0/frontend/index.html +12 -0
- hachi_og-0.1.0/frontend/nginx.conf.template +30 -0
- hachi_og-0.1.0/frontend/package-lock.json +3839 -0
- hachi_og-0.1.0/frontend/package.json +37 -0
- hachi_og-0.1.0/frontend/src/components/brand/HachiMark.tsx +83 -0
- hachi_og-0.1.0/frontend/src/components/brand/HachiMascot.tsx +258 -0
- hachi_og-0.1.0/frontend/src/components/brand/LeashPrompt.test.tsx +70 -0
- hachi_og-0.1.0/frontend/src/components/brand/LeashPrompt.tsx +421 -0
- hachi_og-0.1.0/frontend/src/components/conversation/ActionCardRow.tsx +160 -0
- hachi_og-0.1.0/frontend/src/components/conversation/AttachmentChip.tsx +135 -0
- hachi_og-0.1.0/frontend/src/components/conversation/ConversationComposer.tsx +778 -0
- hachi_og-0.1.0/frontend/src/components/conversation/MessageItem.tsx +280 -0
- hachi_og-0.1.0/frontend/src/components/conversation/RoutineCard.tsx +208 -0
- hachi_og-0.1.0/frontend/src/components/conversation/SessionPicker.tsx +184 -0
- hachi_og-0.1.0/frontend/src/components/conversation/SlashItem.tsx +47 -0
- hachi_og-0.1.0/frontend/src/components/conversation/StarterButton.tsx +37 -0
- hachi_og-0.1.0/frontend/src/components/conversation/StreamingText.tsx +54 -0
- hachi_og-0.1.0/frontend/src/components/conversation/TtsButton.tsx +56 -0
- hachi_og-0.1.0/frontend/src/components/conversation/VoiceOption.tsx +65 -0
- hachi_og-0.1.0/frontend/src/components/conversation/VoiceWave.tsx +22 -0
- hachi_og-0.1.0/frontend/src/components/conversation/helpers.ts +33 -0
- hachi_og-0.1.0/frontend/src/components/icons/ConnectorLogo.tsx +199 -0
- hachi_og-0.1.0/frontend/src/components/icons/Icon.test.tsx +72 -0
- hachi_og-0.1.0/frontend/src/components/icons/Icon.tsx +123 -0
- hachi_og-0.1.0/frontend/src/components/overlays/CommandPalette.test.ts +33 -0
- hachi_og-0.1.0/frontend/src/components/overlays/CommandPalette.tsx +370 -0
- hachi_og-0.1.0/frontend/src/components/overlays/KennelConsent.test.tsx +65 -0
- hachi_og-0.1.0/frontend/src/components/overlays/KennelConsent.tsx +382 -0
- hachi_og-0.1.0/frontend/src/components/overlays/ReconnectingBanner.tsx +45 -0
- hachi_og-0.1.0/frontend/src/components/overlays/SetupWizard.test.tsx +194 -0
- hachi_og-0.1.0/frontend/src/components/overlays/SetupWizard.tsx +793 -0
- hachi_og-0.1.0/frontend/src/components/overlays/ToastHost.tsx +72 -0
- hachi_og-0.1.0/frontend/src/components/overlays/index.tsx +38 -0
- hachi_og-0.1.0/frontend/src/components/settings/AddProviderDialog.tsx +588 -0
- hachi_og-0.1.0/frontend/src/components/settings/ProviderSettings.tsx +707 -0
- hachi_og-0.1.0/frontend/src/components/settings/SettingsNav.tsx +105 -0
- hachi_og-0.1.0/frontend/src/components/settings/VoiceSettings.tsx +515 -0
- hachi_og-0.1.0/frontend/src/components/settings/sections/GeneralSection.test.tsx +65 -0
- hachi_og-0.1.0/frontend/src/components/settings/sections/GeneralSection.tsx +243 -0
- hachi_og-0.1.0/frontend/src/components/settings/sections/PermissionsSection.test.tsx +58 -0
- hachi_og-0.1.0/frontend/src/components/settings/sections/PermissionsSection.tsx +510 -0
- hachi_og-0.1.0/frontend/src/components/settings/sections/SpendSection.tsx +512 -0
- hachi_og-0.1.0/frontend/src/components/settings/shared.tsx +100 -0
- hachi_og-0.1.0/frontend/src/components/shell/BudgetWidget.tsx +106 -0
- hachi_og-0.1.0/frontend/src/components/shell/GovernanceBar.tsx +133 -0
- hachi_og-0.1.0/frontend/src/components/shell/NavItem.tsx +68 -0
- hachi_og-0.1.0/frontend/src/components/shell/Sidebar.tsx +320 -0
- hachi_og-0.1.0/frontend/src/components/ui/Button.tsx +87 -0
- hachi_og-0.1.0/frontend/src/components/ui/ConfirmButton.test.tsx +67 -0
- hachi_og-0.1.0/frontend/src/components/ui/ConfirmButton.tsx +110 -0
- hachi_og-0.1.0/frontend/src/components/ui/Input.tsx +120 -0
- hachi_og-0.1.0/frontend/src/components/ui/JumpToLatest.tsx +45 -0
- hachi_og-0.1.0/frontend/src/components/ui/LoyalLoop.tsx +65 -0
- hachi_og-0.1.0/frontend/src/components/ui/Markdown.test.tsx +383 -0
- hachi_og-0.1.0/frontend/src/components/ui/Markdown.tsx +1032 -0
- hachi_og-0.1.0/frontend/src/components/ui/Modal.tsx +74 -0
- hachi_og-0.1.0/frontend/src/components/ui/OgExplainer.tsx +142 -0
- hachi_og-0.1.0/frontend/src/components/ui/PendingCard.tsx +35 -0
- hachi_og-0.1.0/frontend/src/components/ui/StatusPill.tsx +47 -0
- hachi_og-0.1.0/frontend/src/components/ui/Switch.test.tsx +35 -0
- hachi_og-0.1.0/frontend/src/components/ui/Switch.tsx +97 -0
- hachi_og-0.1.0/frontend/src/components/ui/Terminal.test.tsx +18 -0
- hachi_og-0.1.0/frontend/src/components/ui/Terminal.tsx +219 -0
- hachi_og-0.1.0/frontend/src/components/ui/Toast.tsx +117 -0
- hachi_og-0.1.0/frontend/src/components/voice/ContinuousVoice.tsx +671 -0
- hachi_og-0.1.0/frontend/src/lib/data/README.md +185 -0
- hachi_og-0.1.0/frontend/src/lib/data/bootstrap.ts +37 -0
- hachi_og-0.1.0/frontend/src/lib/data/cache.test.ts +297 -0
- hachi_og-0.1.0/frontend/src/lib/data/cache.ts +122 -0
- hachi_og-0.1.0/frontend/src/lib/data/client.ts +187 -0
- hachi_og-0.1.0/frontend/src/lib/data/dedupe.ts +26 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/approvals.ts +330 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/authoring.ts +277 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/chat.test.ts +103 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/chat.ts +1593 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/config.test.ts +149 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/config.ts +464 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/files.ts +156 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/integrations.test.ts +265 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/integrations.ts +988 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/interactions.test.ts +249 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/interactions.ts +147 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/memory.ts +275 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/og.ts +78 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/operator.ts +185 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/providers.ts +210 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/setup.ts +402 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/skills.test.ts +48 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/skills.ts +186 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/spend.ts +174 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/voice.test.ts +172 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/voice.ts +341 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/work.test.ts +99 -0
- hachi_og-0.1.0/frontend/src/lib/data/domains/work.ts +514 -0
- hachi_og-0.1.0/frontend/src/lib/data/fixtures.ts +394 -0
- hachi_og-0.1.0/frontend/src/lib/data/live.ts +39 -0
- hachi_og-0.1.0/frontend/src/lib/data/schema.d.ts +6052 -0
- hachi_og-0.1.0/frontend/src/lib/data/sse.test.ts +43 -0
- hachi_og-0.1.0/frontend/src/lib/data/sse.ts +187 -0
- hachi_og-0.1.0/frontend/src/lib/data/types.ts +404 -0
- hachi_og-0.1.0/frontend/src/lib/hooks/useBodyScrollLock.ts +16 -0
- hachi_og-0.1.0/frontend/src/lib/hooks/useCountdown.ts +74 -0
- hachi_og-0.1.0/frontend/src/lib/hooks/useFocusTrap.test.tsx +54 -0
- hachi_og-0.1.0/frontend/src/lib/hooks/useFocusTrap.ts +71 -0
- hachi_og-0.1.0/frontend/src/lib/hooks/useMediaQuery.ts +40 -0
- hachi_og-0.1.0/frontend/src/lib/notifications.ts +48 -0
- hachi_og-0.1.0/frontend/src/lib/store/store.test.ts +204 -0
- hachi_og-0.1.0/frontend/src/lib/store/store.ts +1807 -0
- hachi_og-0.1.0/frontend/src/lib/ui/format.test.ts +134 -0
- hachi_og-0.1.0/frontend/src/lib/ui/format.ts +59 -0
- hachi_og-0.1.0/frontend/src/lib/ui/platform.ts +4 -0
- hachi_og-0.1.0/frontend/src/lib/ui/status.ts +17 -0
- hachi_og-0.1.0/frontend/src/lib/voice/speech.ts +239 -0
- hachi_og-0.1.0/frontend/src/main.tsx +24 -0
- hachi_og-0.1.0/frontend/src/routeTree.gen.ts +294 -0
- hachi_og-0.1.0/frontend/src/routes/-index.ApprovalCard.test.tsx +41 -0
- hachi_og-0.1.0/frontend/src/routes/__root.tsx +104 -0
- hachi_og-0.1.0/frontend/src/routes/approvals.tsx +695 -0
- hachi_og-0.1.0/frontend/src/routes/authoring.tsx +964 -0
- hachi_og-0.1.0/frontend/src/routes/conversation.tsx +593 -0
- hachi_og-0.1.0/frontend/src/routes/index.tsx +847 -0
- hachi_og-0.1.0/frontend/src/routes/integrations.tsx +2187 -0
- hachi_og-0.1.0/frontend/src/routes/memory.tsx +1214 -0
- hachi_og-0.1.0/frontend/src/routes/og.tsx +1283 -0
- hachi_og-0.1.0/frontend/src/routes/review.tsx +406 -0
- hachi_og-0.1.0/frontend/src/routes/run.tsx +689 -0
- hachi_og-0.1.0/frontend/src/routes/settings.tsx +131 -0
- hachi_og-0.1.0/frontend/src/routes/skills.tsx +363 -0
- hachi_og-0.1.0/frontend/src/routes/work.tsx +1472 -0
- hachi_og-0.1.0/frontend/src/styles/global.css +97 -0
- hachi_og-0.1.0/frontend/src/styles/index.css +10 -0
- hachi_og-0.1.0/frontend/src/styles/interactive.css +414 -0
- hachi_og-0.1.0/frontend/src/styles/responsive.css +462 -0
- hachi_og-0.1.0/frontend/src/styles/tokens/base.css +42 -0
- hachi_og-0.1.0/frontend/src/styles/tokens/colors.css +130 -0
- hachi_og-0.1.0/frontend/src/styles/tokens/fonts.css +7 -0
- hachi_og-0.1.0/frontend/src/styles/tokens/motion.css +16 -0
- hachi_og-0.1.0/frontend/src/styles/tokens/spacing.css +22 -0
- hachi_og-0.1.0/frontend/src/styles/tokens/typography.css +27 -0
- hachi_og-0.1.0/frontend/src/vite-env.d.ts +11 -0
- hachi_og-0.1.0/frontend/tests/interactive-css.test.ts +91 -0
- hachi_og-0.1.0/frontend/tsconfig.json +20 -0
- hachi_og-0.1.0/frontend/vite.config.ts +46 -0
- hachi_og-0.1.0/hachi +21 -0
- hachi_og-0.1.0/hachi.bat +3 -0
- hachi_og-0.1.0/install.ps1 +199 -0
- hachi_og-0.1.0/install.sh +256 -0
- hachi_og-0.1.0/mypy-strict-gate.ini +52 -0
- hachi_og-0.1.0/openapi/hachi-openapi.json +5911 -0
- hachi_og-0.1.0/pyproject.toml +331 -0
- hachi_og-0.1.0/qa/__init__.py +1 -0
- hachi_og-0.1.0/qa/fixtures/.env.sample +21 -0
- hachi_og-0.1.0/qa/fixtures/README.md +28 -0
- hachi_og-0.1.0/qa/fixtures/setup-isolated-runtime.sh +29 -0
- hachi_og-0.1.0/qa/metrics/__init__.py +1 -0
- hachi_og-0.1.0/qa/metrics/pytest_plugin.py +633 -0
- hachi_og-0.1.0/qa/metrics/report.py +739 -0
- hachi_og-0.1.0/qa/metrics/run_store.py +944 -0
- hachi_og-0.1.0/scripts/check_adrs.py +81 -0
- hachi_og-0.1.0/scripts/lint_skills.py +61 -0
- hachi_og-0.1.0/scripts/measure_turn.py +365 -0
- hachi_og-0.1.0/scripts/preflight.py +307 -0
- hachi_og-0.1.0/scripts/verify_dist.py +136 -0
- hachi_og-0.1.0/settings.example.toml +417 -0
- hachi_og-0.1.0/spec/conformance/README.md +11 -0
- hachi_og-0.1.0/spec/conformance/conformance.json +49 -0
- hachi_og-0.1.0/spec/conformance/fixtures/01-minimal.og +19 -0
- hachi_og-0.1.0/spec/conformance/fixtures/02-full-node.og +45 -0
- hachi_og-0.1.0/spec/conformance/fixtures/03-scoped.og +32 -0
- hachi_og-0.1.0/spec/og-spec-v1.0.md +160 -0
- hachi_og-0.1.0/src/hachi/channels/__init__.py +21 -0
- hachi_og-0.1.0/src/hachi/channels/base.py +50 -0
- hachi_og-0.1.0/src/hachi/channels/discord.py +133 -0
- hachi_og-0.1.0/src/hachi/channels/router.py +108 -0
- hachi_og-0.1.0/src/hachi/channels/runner.py +44 -0
- hachi_og-0.1.0/src/hachi/channels/slack.py +138 -0
- hachi_og-0.1.0/src/hachi/channels/telegram.py +120 -0
- hachi_og-0.1.0/src/hachi/channels/telegram_commands.py +266 -0
- hachi_og-0.1.0/src/hachi/channels/telegram_setup.py +103 -0
- hachi_og-0.1.0/src/hachi/channels/whatsapp.py +452 -0
- hachi_og-0.1.0/src/hachi/cli/__init__.py +1 -0
- hachi_og-0.1.0/src/hachi/cli/commands/__init__.py +1 -0
- hachi_og-0.1.0/src/hachi/cli/commands/channel.py +195 -0
- hachi_og-0.1.0/src/hachi/cli/commands/daemon.py +147 -0
- hachi_og-0.1.0/src/hachi/cli/commands/eval.py +385 -0
- hachi_og-0.1.0/src/hachi/cli/commands/jobs.py +114 -0
- hachi_og-0.1.0/src/hachi/cli/commands/mcp.py +175 -0
- hachi_og-0.1.0/src/hachi/cli/commands/memory.py +349 -0
- hachi_og-0.1.0/src/hachi/cli/commands/pack.py +314 -0
- hachi_og-0.1.0/src/hachi/cli/commands/schedule.py +249 -0
- hachi_og-0.1.0/src/hachi/cli/commands/session.py +583 -0
- hachi_og-0.1.0/src/hachi/cli/commands/skill.py +1082 -0
- hachi_og-0.1.0/src/hachi/cli/main.py +5780 -0
- hachi_og-0.1.0/src/hachi/cli/wizard.py +1090 -0
- hachi_og-0.1.0/src/hachi/client/__init__.py +140 -0
- hachi_og-0.1.0/src/hachi/client/gaps.py +521 -0
- hachi_og-0.1.0/src/hachi/client/gateway.py +591 -0
- hachi_og-0.1.0/src/hachi/client/models.py +988 -0
- hachi_og-0.1.0/src/hachi/client/sse.py +248 -0
- hachi_og-0.1.0/src/hachi/core/__init__.py +1 -0
- hachi_og-0.1.0/src/hachi/core/approvals.py +501 -0
- hachi_og-0.1.0/src/hachi/core/archive_safety.py +151 -0
- hachi_og-0.1.0/src/hachi/core/assertion_eval.py +192 -0
- hachi_og-0.1.0/src/hachi/core/atomic_io.py +99 -0
- hachi_og-0.1.0/src/hachi/core/browser.py +294 -0
- hachi_og-0.1.0/src/hachi/core/bundled_packs.py +85 -0
- hachi_og-0.1.0/src/hachi/core/cache_observability.py +128 -0
- hachi_og-0.1.0/src/hachi/core/checkpoints.py +144 -0
- hachi_og-0.1.0/src/hachi/core/community_packs.py +500 -0
- hachi_og-0.1.0/src/hachi/core/config_loader.py +333 -0
- hachi_og-0.1.0/src/hachi/core/config_validate.py +94 -0
- hachi_og-0.1.0/src/hachi/core/constants.py +28 -0
- hachi_og-0.1.0/src/hachi/core/conversation_memory.py +39 -0
- hachi_og-0.1.0/src/hachi/core/cost.py +642 -0
- hachi_og-0.1.0/src/hachi/core/credential_vault.py +117 -0
- hachi_og-0.1.0/src/hachi/core/errors.py +133 -0
- hachi_og-0.1.0/src/hachi/core/eval/__init__.py +33 -0
- hachi_og-0.1.0/src/hachi/core/eval/corpus.py +427 -0
- hachi_og-0.1.0/src/hachi/core/eval/replay.py +255 -0
- hachi_og-0.1.0/src/hachi/core/eval/report.py +253 -0
- hachi_og-0.1.0/src/hachi/core/eval/runner.py +364 -0
- hachi_og-0.1.0/src/hachi/core/eval/scheduled_report.py +377 -0
- hachi_og-0.1.0/src/hachi/core/event_bus.py +210 -0
- hachi_og-0.1.0/src/hachi/core/file_lock.py +98 -0
- hachi_og-0.1.0/src/hachi/core/files/__init__.py +32 -0
- hachi_og-0.1.0/src/hachi/core/files/store.py +631 -0
- hachi_og-0.1.0/src/hachi/core/graph_recall.py +206 -0
- hachi_og-0.1.0/src/hachi/core/idempotency.py +169 -0
- hachi_og-0.1.0/src/hachi/core/integrations.py +319 -0
- hachi_og-0.1.0/src/hachi/core/lease_manager.py +169 -0
- hachi_og-0.1.0/src/hachi/core/llm.py +1027 -0
- hachi_og-0.1.0/src/hachi/core/loop.py +1283 -0
- hachi_og-0.1.0/src/hachi/core/mcp_client.py +1928 -0
- hachi_og-0.1.0/src/hachi/core/memory.py +1561 -0
- hachi_og-0.1.0/src/hachi/core/memory_exporter.py +222 -0
- hachi_og-0.1.0/src/hachi/core/memory_gardener.py +347 -0
- hachi_og-0.1.0/src/hachi/core/memory_graph.py +327 -0
- hachi_og-0.1.0/src/hachi/core/memory_guard.py +143 -0
- hachi_og-0.1.0/src/hachi/core/memory_importer.py +352 -0
- hachi_og-0.1.0/src/hachi/core/memory_index.py +242 -0
- hachi_og-0.1.0/src/hachi/core/memory_provider.py +304 -0
- hachi_og-0.1.0/src/hachi/core/memory_vault.py +1859 -0
- hachi_og-0.1.0/src/hachi/core/memory_writer.py +289 -0
- hachi_og-0.1.0/src/hachi/core/migrations.py +56 -0
- hachi_og-0.1.0/src/hachi/core/models.py +136 -0
- hachi_og-0.1.0/src/hachi/core/net_guard.py +167 -0
- hachi_og-0.1.0/src/hachi/core/notifier.py +443 -0
- hachi_og-0.1.0/src/hachi/core/oauth.py +362 -0
- hachi_og-0.1.0/src/hachi/core/obs/__init__.py +9 -0
- hachi_og-0.1.0/src/hachi/core/obs/envelope.py +243 -0
- hachi_og-0.1.0/src/hachi/core/obs/logging_setup.py +260 -0
- hachi_og-0.1.0/src/hachi/core/obs/metrics.py +417 -0
- hachi_og-0.1.0/src/hachi/core/obs/sink.py +131 -0
- hachi_og-0.1.0/src/hachi/core/obs/spans.py +158 -0
- hachi_og-0.1.0/src/hachi/core/obs/trace.py +184 -0
- hachi_og-0.1.0/src/hachi/core/og_history.py +247 -0
- hachi_og-0.1.0/src/hachi/core/og_pack.py +490 -0
- hachi_og-0.1.0/src/hachi/core/onboarding.py +941 -0
- hachi_og-0.1.0/src/hachi/core/pack_index.py +225 -0
- hachi_og-0.1.0/src/hachi/core/paths.py +135 -0
- hachi_og-0.1.0/src/hachi/core/permissions.py +1220 -0
- hachi_og-0.1.0/src/hachi/core/prompt_composer.py +134 -0
- hachi_og-0.1.0/src/hachi/core/providers/__init__.py +28 -0
- hachi_og-0.1.0/src/hachi/core/providers/anthropic_provider.py +96 -0
- hachi_og-0.1.0/src/hachi/core/providers/base.py +156 -0
- hachi_og-0.1.0/src/hachi/core/providers/openai_compat_provider.py +104 -0
- hachi_og-0.1.0/src/hachi/core/providers/registry.py +293 -0
- hachi_og-0.1.0/src/hachi/core/providers/search.py +123 -0
- hachi_og-0.1.0/src/hachi/core/providers/speech.py +650 -0
- hachi_og-0.1.0/src/hachi/core/providers/tavily_provider.py +220 -0
- hachi_og-0.1.0/src/hachi/core/rate_limit.py +128 -0
- hachi_og-0.1.0/src/hachi/core/resilience.py +486 -0
- hachi_og-0.1.0/src/hachi/core/rest_adapter.py +388 -0
- hachi_og-0.1.0/src/hachi/core/routing/__init__.py +27 -0
- hachi_og-0.1.0/src/hachi/core/routing/budget.py +99 -0
- hachi_og-0.1.0/src/hachi/core/routing/capability.py +32 -0
- hachi_og-0.1.0/src/hachi/core/routing/classifier.py +183 -0
- hachi_og-0.1.0/src/hachi/core/routing/descriptor.py +82 -0
- hachi_og-0.1.0/src/hachi/core/routing/policy.py +225 -0
- hachi_og-0.1.0/src/hachi/core/routing/registry.py +150 -0
- hachi_og-0.1.0/src/hachi/core/routing/registry_data.py +122 -0
- hachi_og-0.1.0/src/hachi/core/routing/router.py +422 -0
- hachi_og-0.1.0/src/hachi/core/routing/snapshot.py +41 -0
- hachi_og-0.1.0/src/hachi/core/routing/validate.py +84 -0
- hachi_og-0.1.0/src/hachi/core/runtime/__init__.py +0 -0
- hachi_og-0.1.0/src/hachi/core/runtime/job_handlers.py +485 -0
- hachi_og-0.1.0/src/hachi/core/runtime/resume.py +196 -0
- hachi_og-0.1.0/src/hachi/core/runtime/state.py +90 -0
- hachi_og-0.1.0/src/hachi/core/runtime/store.py +196 -0
- hachi_og-0.1.0/src/hachi/core/runtime/waits.py +107 -0
- hachi_og-0.1.0/src/hachi/core/runtime_events.py +344 -0
- hachi_og-0.1.0/src/hachi/core/runtime_read_models.py +450 -0
- hachi_og-0.1.0/src/hachi/core/sandbox.py +572 -0
- hachi_og-0.1.0/src/hachi/core/search_cache.py +174 -0
- hachi_og-0.1.0/src/hachi/core/secret_scanner.py +486 -0
- hachi_og-0.1.0/src/hachi/core/secret_store.py +496 -0
- hachi_og-0.1.0/src/hachi/core/session_store.py +1003 -0
- hachi_og-0.1.0/src/hachi/core/session_titler.py +128 -0
- hachi_og-0.1.0/src/hachi/core/settings.py +479 -0
- hachi_og-0.1.0/src/hachi/core/skill_packs.py +126 -0
- hachi_og-0.1.0/src/hachi/core/sub_agent.py +891 -0
- hachi_og-0.1.0/src/hachi/core/suggestion_chips.py +180 -0
- hachi_og-0.1.0/src/hachi/core/testing.py +49 -0
- hachi_og-0.1.0/src/hachi/core/tool_results.py +36 -0
- hachi_og-0.1.0/src/hachi/core/tracing.py +249 -0
- hachi_og-0.1.0/src/hachi/core/turn_context.py +136 -0
- hachi_og-0.1.0/src/hachi/core/unofficial_providers.py +283 -0
- hachi_og-0.1.0/src/hachi/core/untrusted_content.py +63 -0
- hachi_og-0.1.0/src/hachi/core/user_profile.py +542 -0
- hachi_og-0.1.0/src/hachi/core/validators.py +376 -0
- hachi_og-0.1.0/src/hachi/core/voice.py +624 -0
- hachi_og-0.1.0/src/hachi/core/workflow_composer.py +176 -0
- hachi_og-0.1.0/src/hachi/daemon.py +577 -0
- hachi_og-0.1.0/src/hachi/data/model-registry.json +363 -0
- hachi_og-0.1.0/src/hachi/default_skills/brain.og +201 -0
- hachi_og-0.1.0/src/hachi/default_skills/core_integrations.og +31 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/career.og +130 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/currency.og +30 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/dictionary.og +30 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/finance.og +31 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/flight_radar.og +32 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/learning.og +132 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/math_engine.og +31 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/network.og +30 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/qr_creator.og +26 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/translator.og +32 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/weather.og +31 -0
- hachi_og-0.1.0/src/hachi/default_skills/general/wiki.og +31 -0
- hachi_og-0.1.0/src/hachi/default_skills/google/inbox_sentinel.og +23 -0
- hachi_og-0.1.0/src/hachi/default_skills/google/meeting_copilot.og +28 -0
- hachi_og-0.1.0/src/hachi/default_skills/google/morning_briefing.og +24 -0
- hachi_og-0.1.0/src/hachi/default_skills/google/receipt_sweeper.og +23 -0
- hachi_og-0.1.0/src/hachi/default_skills/google/travel_organizer.og +26 -0
- hachi_og-0.1.0/src/hachi/default_skills/manifest.json +36 -0
- hachi_og-0.1.0/src/hachi/default_skills/notion/notion_brain_dump.og +26 -0
- hachi_og-0.1.0/src/hachi/default_skills/notion/project_kickoff.og +26 -0
- hachi_og-0.1.0/src/hachi/default_skills/notion/weekly_review.og +27 -0
- hachi_og-0.1.0/src/hachi/default_skills/roles/analyst.og +91 -0
- hachi_og-0.1.0/src/hachi/default_skills/roles/coder.og +88 -0
- hachi_og-0.1.0/src/hachi/default_skills/roles/devops.og +92 -0
- hachi_og-0.1.0/src/hachi/default_skills/roles/emailer.og +90 -0
- hachi_og-0.1.0/src/hachi/default_skills/roles/researcher.og +86 -0
- hachi_og-0.1.0/src/hachi/default_skills/slack/daily_standup.og +28 -0
- hachi_og-0.1.0/src/hachi/default_skills/slack/dnd_coordinator.og +26 -0
- hachi_og-0.1.0/src/hachi/default_skills/slack/urgent_escalator.og +29 -0
- hachi_og-0.1.0/src/hachi/default_skills/technical/frontend_dev.og +268 -0
- hachi_og-0.1.0/src/hachi/default_skills/technical/github.og +33 -0
- hachi_og-0.1.0/src/hachi/default_skills/technical/npm.og +32 -0
- hachi_og-0.1.0/src/hachi/default_skills/technical/pypi.og +32 -0
- hachi_og-0.1.0/src/hachi/gateway/__init__.py +9 -0
- hachi_og-0.1.0/src/hachi/gateway/_net_guard.py +115 -0
- hachi_og-0.1.0/src/hachi/gateway/control_plane.py +1533 -0
- hachi_og-0.1.0/src/hachi/gateway/fastapi_app.py +3112 -0
- hachi_og-0.1.0/src/hachi/gateway/middleware/__init__.py +0 -0
- hachi_og-0.1.0/src/hachi/gateway/middleware/trace.py +164 -0
- hachi_og-0.1.0/src/hachi/gateway/orchestrator.py +3737 -0
- hachi_og-0.1.0/src/hachi/gateway/provider_admin.py +635 -0
- hachi_og-0.1.0/src/hachi/gateway/routing_store.py +175 -0
- hachi_og-0.1.0/src/hachi/gateway/shared_services.py +350 -0
- hachi_og-0.1.0/src/hachi/gateway/tool_registration.py +129 -0
- hachi_og-0.1.0/src/hachi/gateway/voice_endpoints.py +457 -0
- hachi_og-0.1.0/src/hachi/gateway/workspace.py +464 -0
- hachi_og-0.1.0/src/hachi/integrations/__init__.py +1 -0
- hachi_og-0.1.0/src/hachi/integrations/connector_registry.py +455 -0
- hachi_og-0.1.0/src/hachi/integrations/google/__init__.py +87 -0
- hachi_og-0.1.0/src/hachi/integrations/google/calendar.py +632 -0
- hachi_og-0.1.0/src/hachi/integrations/google/client.py +292 -0
- hachi_og-0.1.0/src/hachi/integrations/google/contacts.py +290 -0
- hachi_og-0.1.0/src/hachi/integrations/google/docs.py +173 -0
- hachi_og-0.1.0/src/hachi/integrations/google/drive.py +321 -0
- hachi_og-0.1.0/src/hachi/integrations/google/gmail.py +980 -0
- hachi_og-0.1.0/src/hachi/integrations/google/meet.py +324 -0
- hachi_og-0.1.0/src/hachi/integrations/google/planning.py +245 -0
- hachi_og-0.1.0/src/hachi/integrations/google/service.py +64 -0
- hachi_og-0.1.0/src/hachi/integrations/google/sheets.py +166 -0
- hachi_og-0.1.0/src/hachi/integrations/google/tasks.py +299 -0
- hachi_og-0.1.0/src/hachi/integrations/notion/__init__.py +9 -0
- hachi_og-0.1.0/src/hachi/integrations/notion/databases.py +130 -0
- hachi_og-0.1.0/src/hachi/integrations/notion/pages.py +356 -0
- hachi_og-0.1.0/src/hachi/integrations/notion/service.py +90 -0
- hachi_og-0.1.0/src/hachi/integrations/oauth_flow.py +870 -0
- hachi_og-0.1.0/src/hachi/integrations/slack/__init__.py +9 -0
- hachi_og-0.1.0/src/hachi/integrations/slack/chat.py +275 -0
- hachi_og-0.1.0/src/hachi/integrations/slack/service.py +171 -0
- hachi_og-0.1.0/src/hachi/integrations/slack/workspace.py +115 -0
- hachi_og-0.1.0/src/hachi/jobs/__init__.py +39 -0
- hachi_og-0.1.0/src/hachi/jobs/queue.py +1115 -0
- hachi_og-0.1.0/src/hachi/jobs/scheduler.py +910 -0
- hachi_og-0.1.0/src/hachi/og_engine/__init__.py +1 -0
- hachi_og-0.1.0/src/hachi/og_engine/engine.py +1881 -0
- hachi_og-0.1.0/src/hachi/og_engine/graph_viz.py +244 -0
- hachi_og-0.1.0/src/hachi/og_engine/parser.py +762 -0
- hachi_og-0.1.0/src/hachi/og_engine/serializer.py +155 -0
- hachi_og-0.1.0/src/hachi/og_engine/skill_md.py +149 -0
- hachi_og-0.1.0/src/hachi/packs/crm-agent/crm_agent.og +70 -0
- hachi_og-0.1.0/src/hachi/packs/crm-agent/pack.toml +17 -0
- hachi_og-0.1.0/src/hachi/packs/finance-agent/finance_agent.og +81 -0
- hachi_og-0.1.0/src/hachi/packs/finance-agent/pack.toml +16 -0
- hachi_og-0.1.0/src/hachi/packs/inbox-sentinel/inbox_sentinel.og +129 -0
- hachi_og-0.1.0/src/hachi/packs/inbox-sentinel/pack.toml +17 -0
- hachi_og-0.1.0/src/hachi/packs/meeting-copilot/meeting_copilot.og +145 -0
- hachi_og-0.1.0/src/hachi/packs/meeting-copilot/pack.toml +17 -0
- hachi_og-0.1.0/src/hachi/packs/research-agent/pack.toml +16 -0
- hachi_og-0.1.0/src/hachi/packs/research-agent/research_agent.og +76 -0
- hachi_og-0.1.0/src/hachi/sdk/__init__.py +113 -0
- hachi_og-0.1.0/src/hachi/tools/__init__.py +1 -0
- hachi_og-0.1.0/src/hachi/tools/browser_tools.py +192 -0
- hachi_og-0.1.0/src/hachi/tools/config_tools.py +733 -0
- hachi_og-0.1.0/src/hachi/tools/delegation_tools.py +1033 -0
- hachi_og-0.1.0/src/hachi/tools/file_tools.py +342 -0
- hachi_og-0.1.0/src/hachi/tools/google_tools.py +129 -0
- hachi_og-0.1.0/src/hachi/tools/memory_tools.py +678 -0
- hachi_og-0.1.0/src/hachi/tools/messaging_tools.py +322 -0
- hachi_og-0.1.0/src/hachi/tools/notification_tools.py +244 -0
- hachi_og-0.1.0/src/hachi/tools/og_tools.py +495 -0
- hachi_og-0.1.0/src/hachi/tools/os_tools.py +697 -0
- hachi_og-0.1.0/src/hachi/tools/presentation_tools.py +300 -0
- hachi_og-0.1.0/src/hachi/tools/sandbox_tools.py +219 -0
- hachi_og-0.1.0/src/hachi/tools/schedule_tools.py +165 -0
- hachi_og-0.1.0/src/hachi/tools/search_tools.py +233 -0
- hachi_og-0.1.0/src/hachi/tools/vision_tools.py +469 -0
- hachi_og-0.1.0/src/hachi/tools/voice_tools.py +441 -0
- hachi_og-0.1.0/src/hachi/tools/workflow_tools.py +70 -0
- hachi_og-0.1.0/src/hachi/tui/__init__.py +1 -0
- hachi_og-0.1.0/src/hachi/tui/art.py +143 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/__init__.py +16 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/__main__.py +45 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/app.py +172 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/approval.py +232 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/base.py +76 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/data.py +604 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/footer.py +76 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/help.py +156 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/mascot.py +94 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/nav.py +238 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/palette.py +315 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/screen.py +485 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/trust_bar.py +243 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/__init__.py +53 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/agents.py +191 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/approvals.py +206 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/audit.py +177 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/chat.py +572 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/connections.py +270 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/dashboard.py +283 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/governance.py +350 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/memory.py +513 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/resources.py +268 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/settings.py +316 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/skills.py +242 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/table.py +534 -0
- hachi_og-0.1.0/src/hachi/tui/cockpit/views/tasks.py +200 -0
- hachi_og-0.1.0/src/hachi/tui/theme.py +237 -0
- hachi_og-0.1.0/tests/conftest.py +180 -0
- hachi_og-0.1.0/tests/fixtures/sample_skill.og +72 -0
- hachi_og-0.1.0/tests/test_action_approval.py +508 -0
- hachi_og-0.1.0/tests/test_agent_session_shutdown.py +53 -0
- hachi_og-0.1.0/tests/test_archive_safety.py +203 -0
- hachi_og-0.1.0/tests/test_assertion_eval.py +195 -0
- hachi_og-0.1.0/tests/test_atomic_state_writes.py +246 -0
- hachi_og-0.1.0/tests/test_authoring_backend.py +406 -0
- hachi_og-0.1.0/tests/test_b10_episodic_recall_offload.py +228 -0
- hachi_og-0.1.0/tests/test_backend_fixes_issues.py +595 -0
- hachi_og-0.1.0/tests/test_backup_restore.py +307 -0
- hachi_og-0.1.0/tests/test_boot_without_credentials.py +105 -0
- hachi_og-0.1.0/tests/test_brain_constraints.py +236 -0
- hachi_og-0.1.0/tests/test_browser_tools.py +198 -0
- hachi_og-0.1.0/tests/test_cache_observability.py +66 -0
- hachi_og-0.1.0/tests/test_calendar_tasks_hardening.py +340 -0
- hachi_og-0.1.0/tests/test_channel_whatsapp_cmd.py +447 -0
- hachi_og-0.1.0/tests/test_channels.py +154 -0
- hachi_og-0.1.0/tests/test_checkpoints.py +79 -0
- hachi_og-0.1.0/tests/test_cli_creds_and_og.py +476 -0
- hachi_og-0.1.0/tests/test_cli_daemon.py +171 -0
- hachi_og-0.1.0/tests/test_cli_gateway_command.py +594 -0
- hachi_og-0.1.0/tests/test_cli_mcp_commands.py +196 -0
- hachi_og-0.1.0/tests/test_cli_memory.py +103 -0
- hachi_og-0.1.0/tests/test_cli_models.py +180 -0
- hachi_og-0.1.0/tests/test_cli_run_once.py +108 -0
- hachi_og-0.1.0/tests/test_cli_skill_assert.py +102 -0
- hachi_og-0.1.0/tests/test_cli_skill_benchmark.py +154 -0
- hachi_og-0.1.0/tests/test_cli_skill_changelog.py +81 -0
- hachi_og-0.1.0/tests/test_cli_skill_deps.py +48 -0
- hachi_og-0.1.0/tests/test_cli_skill_graph.py +82 -0
- hachi_og-0.1.0/tests/test_cli_skill_report.py +105 -0
- hachi_og-0.1.0/tests/test_cli_skill_search.py +63 -0
- hachi_og-0.1.0/tests/test_cli_skill_show.py +68 -0
- hachi_og-0.1.0/tests/test_cli_wizard.py +634 -0
- hachi_og-0.1.0/tests/test_client_gaps.py +251 -0
- hachi_og-0.1.0/tests/test_client_models.py +489 -0
- hachi_og-0.1.0/tests/test_client_sse.py +145 -0
- hachi_og-0.1.0/tests/test_cockpit_chat_live.py +588 -0
- hachi_og-0.1.0/tests/test_cockpit_foundation.py +518 -0
- hachi_og-0.1.0/tests/test_cockpit_gaps.py +330 -0
- hachi_og-0.1.0/tests/test_cockpit_live_refresh.py +376 -0
- hachi_og-0.1.0/tests/test_cockpit_overlays.py +411 -0
- hachi_og-0.1.0/tests/test_cockpit_table_views.py +611 -0
- hachi_og-0.1.0/tests/test_cockpit_views_e.py +517 -0
- hachi_og-0.1.0/tests/test_cockpit_views_f.py +345 -0
- hachi_og-0.1.0/tests/test_cold_start_resume.py +402 -0
- hachi_og-0.1.0/tests/test_compaction_summary_applyback.py +270 -0
- hachi_og-0.1.0/tests/test_config_get_set.py +268 -0
- hachi_og-0.1.0/tests/test_config_loader.py +162 -0
- hachi_og-0.1.0/tests/test_config_resilience.py +40 -0
- hachi_og-0.1.0/tests/test_config_tools.py +661 -0
- hachi_og-0.1.0/tests/test_config_validate.py +118 -0
- hachi_og-0.1.0/tests/test_connector_credentials.py +487 -0
- hachi_og-0.1.0/tests/test_contacts_planning_meet_hardening.py +394 -0
- hachi_og-0.1.0/tests/test_conversation_memory.py +205 -0
- hachi_og-0.1.0/tests/test_core_tool_cost_guard.py +118 -0
- hachi_og-0.1.0/tests/test_cost_tracking.py +442 -0
- hachi_og-0.1.0/tests/test_credential_auto_detection.py +278 -0
- hachi_og-0.1.0/tests/test_daemon.py +381 -0
- hachi_og-0.1.0/tests/test_daily_cap_enforcement.py +218 -0
- hachi_og-0.1.0/tests/test_daily_spend_ledger.py +73 -0
- hachi_og-0.1.0/tests/test_delegation_credentials.py +63 -0
- hachi_og-0.1.0/tests/test_delegation_failclosed.py +323 -0
- hachi_og-0.1.0/tests/test_dependency_policy.py +162 -0
- hachi_og-0.1.0/tests/test_docker_assets.py +94 -0
- hachi_og-0.1.0/tests/test_docs_cli_reference.py +87 -0
- hachi_og-0.1.0/tests/test_dotenv_hermeticity.py +81 -0
- hachi_og-0.1.0/tests/test_drive_docs_sheets_hardening.py +542 -0
- hachi_og-0.1.0/tests/test_durable_fact_extraction.py +323 -0
- hachi_og-0.1.0/tests/test_durable_store.py +215 -0
- hachi_og-0.1.0/tests/test_durable_waits.py +193 -0
- hachi_og-0.1.0/tests/test_e2e_loop.py +773 -0
- hachi_og-0.1.0/tests/test_episodic_memory.py +331 -0
- hachi_og-0.1.0/tests/test_eval_assertions.py +256 -0
- hachi_og-0.1.0/tests/test_eval_replay.py +393 -0
- hachi_og-0.1.0/tests/test_eval_report.py +359 -0
- hachi_og-0.1.0/tests/test_eval_runner.py +328 -0
- hachi_og-0.1.0/tests/test_eval_scheduled_report.py +560 -0
- hachi_og-0.1.0/tests/test_event_bus.py +263 -0
- hachi_og-0.1.0/tests/test_eventbus_reactivity.py +352 -0
- hachi_og-0.1.0/tests/test_file_platform.py +820 -0
- hachi_og-0.1.0/tests/test_g1_wave1.py +496 -0
- hachi_og-0.1.0/tests/test_g3_compaction.py +306 -0
- hachi_og-0.1.0/tests/test_g3_session_store.py +317 -0
- hachi_og-0.1.0/tests/test_g3_turn_lock.py +232 -0
- hachi_og-0.1.0/tests/test_g3_vault_lazy.py +344 -0
- hachi_og-0.1.0/tests/test_g4_security_depth.py +191 -0
- hachi_og-0.1.0/tests/test_g5_cleanups.py +258 -0
- hachi_og-0.1.0/tests/test_gateway_500_handler.py +61 -0
- hachi_og-0.1.0/tests/test_gateway_auth_default.py +555 -0
- hachi_og-0.1.0/tests/test_gateway_config_mutations.py +383 -0
- hachi_og-0.1.0/tests/test_gateway_control_plane.py +541 -0
- hachi_og-0.1.0/tests/test_gateway_core_fixes.py +313 -0
- hachi_og-0.1.0/tests/test_gateway_interrupt.py +268 -0
- hachi_og-0.1.0/tests/test_gateway_loopback_auth_gate.py +302 -0
- hachi_og-0.1.0/tests/test_gateway_models.py +258 -0
- hachi_og-0.1.0/tests/test_gateway_new_endpoints.py +911 -0
- hachi_og-0.1.0/tests/test_gateway_openai_channels.py +336 -0
- hachi_og-0.1.0/tests/test_gateway_resilience.py +54 -0
- hachi_og-0.1.0/tests/test_gateway_runtime_validation.py +167 -0
- hachi_og-0.1.0/tests/test_gateway_sse.py +91 -0
- hachi_og-0.1.0/tests/test_gateway_status_cmd.py +97 -0
- hachi_og-0.1.0/tests/test_gateway_web_endpoints.py +349 -0
- hachi_og-0.1.0/tests/test_gmail_hardening.py +511 -0
- hachi_og-0.1.0/tests/test_google_auth_cmd.py +159 -0
- hachi_og-0.1.0/tests/test_google_idempotency.py +103 -0
- hachi_og-0.1.0/tests/test_google_integrations.py +528 -0
- hachi_og-0.1.0/tests/test_google_tasks_planning.py +416 -0
- hachi_og-0.1.0/tests/test_google_tools_wire.py +193 -0
- hachi_og-0.1.0/tests/test_graph_viz.py +167 -0
- hachi_og-0.1.0/tests/test_hachi_brand.py +52 -0
- hachi_og-0.1.0/tests/test_history_lock_race.py +167 -0
- hachi_og-0.1.0/tests/test_hot_path_routing.py +495 -0
- hachi_og-0.1.0/tests/test_idempotency.py +153 -0
- hachi_og-0.1.0/tests/test_ingress_idempotency.py +147 -0
- hachi_og-0.1.0/tests/test_install_scripts.py +288 -0
- hachi_og-0.1.0/tests/test_interaction_log.py +178 -0
- hachi_og-0.1.0/tests/test_interactions_api.py +357 -0
- hachi_og-0.1.0/tests/test_iteration_limit.py +118 -0
- hachi_og-0.1.0/tests/test_job_dead_letter.py +348 -0
- hachi_og-0.1.0/tests/test_job_queue.py +244 -0
- hachi_og-0.1.0/tests/test_knowledge_graph_recall.py +491 -0
- hachi_og-0.1.0/tests/test_llm_env_resolution.py +26 -0
- hachi_og-0.1.0/tests/test_llm_models.py +89 -0
- hachi_og-0.1.0/tests/test_llm_prompt_caching.py +105 -0
- hachi_og-0.1.0/tests/test_loop_backstop_cancel.py +609 -0
- hachi_og-0.1.0/tests/test_loop_phase5.py +147 -0
- hachi_og-0.1.0/tests/test_loop_resilience.py +206 -0
- hachi_og-0.1.0/tests/test_mcp_client_timeout.py +34 -0
- hachi_og-0.1.0/tests/test_mcp_injection_guard.py +51 -0
- hachi_og-0.1.0/tests/test_mcp_lifecycle.py +385 -0
- hachi_og-0.1.0/tests/test_mcp_registration.py +342 -0
- hachi_og-0.1.0/tests/test_mcp_resilience.py +462 -0
- hachi_og-0.1.0/tests/test_mcp_tool_visibility.py +99 -0
- hachi_og-0.1.0/tests/test_mcp_transport_and_config.py +695 -0
- hachi_og-0.1.0/tests/test_measure_turn.py +173 -0
- hachi_og-0.1.0/tests/test_memory_cli_crud.py +176 -0
- hachi_og-0.1.0/tests/test_memory_decay.py +520 -0
- hachi_og-0.1.0/tests/test_memory_fixes.py +815 -0
- hachi_og-0.1.0/tests/test_memory_guard.py +57 -0
- hachi_og-0.1.0/tests/test_memory_importer.py +326 -0
- hachi_og-0.1.0/tests/test_memory_loud_failures.py +134 -0
- hachi_og-0.1.0/tests/test_memory_provider.py +182 -0
- hachi_og-0.1.0/tests/test_memory_reliability.py +440 -0
- hachi_og-0.1.0/tests/test_memory_tools_queue.py +179 -0
- hachi_og-0.1.0/tests/test_memory_vault_close.py +166 -0
- hachi_og-0.1.0/tests/test_memory_vault_quarantine.py +24 -0
- hachi_og-0.1.0/tests/test_messaging_redaction.py +67 -0
- hachi_og-0.1.0/tests/test_messaging_tools.py +651 -0
- hachi_og-0.1.0/tests/test_migrations.py +180 -0
- hachi_og-0.1.0/tests/test_model_registry_json.py +315 -0
- hachi_og-0.1.0/tests/test_multi_provider.py +601 -0
- hachi_og-0.1.0/tests/test_net_guard.py +233 -0
- hachi_og-0.1.0/tests/test_notification_tools.py +606 -0
- hachi_og-0.1.0/tests/test_oauth.py +237 -0
- hachi_og-0.1.0/tests/test_oauth_integrations.py +644 -0
- hachi_og-0.1.0/tests/test_obs_boot_config.py +114 -0
- hachi_og-0.1.0/tests/test_obs_envelope.py +189 -0
- hachi_og-0.1.0/tests/test_obs_logging.py +209 -0
- hachi_og-0.1.0/tests/test_obs_metrics.py +96 -0
- hachi_og-0.1.0/tests/test_obs_metrics_activation.py +118 -0
- hachi_og-0.1.0/tests/test_obs_middleware.py +234 -0
- hachi_og-0.1.0/tests/test_obs_sink.py +199 -0
- hachi_og-0.1.0/tests/test_obs_trace.py +109 -0
- hachi_og-0.1.0/tests/test_obs_tracing_config.py +120 -0
- hachi_og-0.1.0/tests/test_obs_tracing_gate.py +217 -0
- hachi_og-0.1.0/tests/test_obs_waterfall.py +167 -0
- hachi_og-0.1.0/tests/test_og_benchmark.py +108 -0
- hachi_og-0.1.0/tests/test_og_changelog.py +76 -0
- hachi_og-0.1.0/tests/test_og_dependencies.py +89 -0
- hachi_og-0.1.0/tests/test_og_engine.py +168 -0
- hachi_og-0.1.0/tests/test_og_engine_hardening.py +470 -0
- hachi_og-0.1.0/tests/test_og_history_and_config.py +295 -0
- hachi_og-0.1.0/tests/test_og_lint.py +173 -0
- hachi_og-0.1.0/tests/test_og_parser.py +95 -0
- hachi_og-0.1.0/tests/test_og_rbac.py +314 -0
- hachi_og-0.1.0/tests/test_og_scope_rbac.py +183 -0
- hachi_og-0.1.0/tests/test_og_serializer.py +107 -0
- hachi_og-0.1.0/tests/test_og_skill_authoring.py +145 -0
- hachi_og-0.1.0/tests/test_onboarding_quickstart.py +227 -0
- hachi_og-0.1.0/tests/test_onboarding_validation.py +126 -0
- hachi_og-0.1.0/tests/test_os_tools_hardening.py +487 -0
- hachi_og-0.1.0/tests/test_outbound_redaction.py +67 -0
- hachi_og-0.1.0/tests/test_p1_06_qualified_ids.py +232 -0
- hachi_og-0.1.0/tests/test_p1_07_retrieval.py +165 -0
- hachi_og-0.1.0/tests/test_p1_09_paths.py +111 -0
- hachi_og-0.1.0/tests/test_p1_14_mypy_gate.py +61 -0
- hachi_og-0.1.0/tests/test_p2_02_job_queue.py +419 -0
- hachi_og-0.1.0/tests/test_p2_03b_benchmark_suite.py +292 -0
- hachi_og-0.1.0/tests/test_p2_03c_cost_latency.py +251 -0
- hachi_og-0.1.0/tests/test_p2_04_memory_index.py +299 -0
- hachi_og-0.1.0/tests/test_p2_05_memory_writer.py +234 -0
- hachi_og-0.1.0/tests/test_p2_07a_ogpack.py +579 -0
- hachi_og-0.1.0/tests/test_p2_07b_pack_index.py +325 -0
- hachi_og-0.1.0/tests/test_p2_08_composer.py +434 -0
- hachi_og-0.1.0/tests/test_p2_12_agent_packs.py +205 -0
- hachi_og-0.1.0/tests/test_p2_14_suggestion_chips.py +148 -0
- hachi_og-0.1.0/tests/test_p3_01_memory_graph.py +247 -0
- hachi_og-0.1.0/tests/test_p3_02_memory_gardener.py +262 -0
- hachi_og-0.1.0/tests/test_p3_04_embedding_rank.py +163 -0
- hachi_og-0.1.0/tests/test_p3_06_sdk_v0.py +143 -0
- hachi_og-0.1.0/tests/test_p3_07_ops_hygiene.py +132 -0
- hachi_og-0.1.0/tests/test_p4_01_multi_agent_v2.py +215 -0
- hachi_og-0.1.0/tests/test_p4_02_shared_services.py +263 -0
- hachi_og-0.1.0/tests/test_p4_03_parallel_tools.py +220 -0
- hachi_og-0.1.0/tests/test_p4_06_m4_cutover.py +222 -0
- hachi_og-0.1.0/tests/test_p5_01_conformance.py +184 -0
- hachi_og-0.1.0/tests/test_p5_02_skill_new.py +77 -0
- hachi_og-0.1.0/tests/test_p5_04_git_sync.py +54 -0
- hachi_og-0.1.0/tests/test_p5_05_memoir.py +148 -0
- hachi_og-0.1.0/tests/test_pack_security.py +142 -0
- hachi_og-0.1.0/tests/test_parallel_delegation.py +276 -0
- hachi_og-0.1.0/tests/test_per_turn_budget.py +187 -0
- hachi_og-0.1.0/tests/test_perf_regression.py +525 -0
- hachi_og-0.1.0/tests/test_permission_gate_hardening.py +395 -0
- hachi_og-0.1.0/tests/test_permissions_interactive.py +82 -0
- hachi_og-0.1.0/tests/test_permissions_path.py +98 -0
- hachi_og-0.1.0/tests/test_permissions_update.py +99 -0
- hachi_og-0.1.0/tests/test_phase0_security_hardening.py +298 -0
- hachi_og-0.1.0/tests/test_phase7_integrations_mcp_sandbox_deployment.py +270 -0
- hachi_og-0.1.0/tests/test_play_audio.py +203 -0
- hachi_og-0.1.0/tests/test_presentation_tools.py +217 -0
- hachi_og-0.1.0/tests/test_prompt_cache_ordering.py +83 -0
- hachi_og-0.1.0/tests/test_prompt_composer.py +105 -0
- hachi_og-0.1.0/tests/test_provider_admin.py +498 -0
- hachi_og-0.1.0/tests/test_provider_presets.py +60 -0
- hachi_og-0.1.0/tests/test_provider_registry.py +129 -0
- hachi_og-0.1.0/tests/test_qa_metrics_plugin.py +229 -0
- hachi_og-0.1.0/tests/test_qa_report.py +170 -0
- hachi_og-0.1.0/tests/test_qa_report_layout.py +144 -0
- hachi_og-0.1.0/tests/test_qa_run_store.py +616 -0
- hachi_og-0.1.0/tests/test_rate_limit.py +33 -0
- hachi_og-0.1.0/tests/test_readiness_probe.py +319 -0
- hachi_og-0.1.0/tests/test_resilience.py +372 -0
- hachi_og-0.1.0/tests/test_rest_injection_guard.py +80 -0
- hachi_og-0.1.0/tests/test_rest_outbound_secret_guard.py +77 -0
- hachi_og-0.1.0/tests/test_rest_response_trimming.py +149 -0
- hachi_og-0.1.0/tests/test_resume_from_session.py +447 -0
- hachi_og-0.1.0/tests/test_retention_sweep.py +309 -0
- hachi_og-0.1.0/tests/test_routing_capability.py +34 -0
- hachi_og-0.1.0/tests/test_routing_compat.py +208 -0
- hachi_og-0.1.0/tests/test_routing_cost_guard.py +42 -0
- hachi_og-0.1.0/tests/test_routing_hot_reload.py +416 -0
- hachi_og-0.1.0/tests/test_routing_policy.py +113 -0
- hachi_og-0.1.0/tests/test_routing_registry.py +223 -0
- hachi_og-0.1.0/tests/test_routing_router.py +424 -0
- hachi_og-0.1.0/tests/test_routing_validate.py +85 -0
- hachi_og-0.1.0/tests/test_runtime_events.py +64 -0
- hachi_og-0.1.0/tests/test_runtime_events_redaction.py +151 -0
- hachi_og-0.1.0/tests/test_runtime_read_models.py +225 -0
- hachi_og-0.1.0/tests/test_runtime_state.py +195 -0
- hachi_og-0.1.0/tests/test_sandbox_backend.py +420 -0
- hachi_og-0.1.0/tests/test_schedule_job_events.py +195 -0
- hachi_og-0.1.0/tests/test_schedule_pause_resume.py +95 -0
- hachi_og-0.1.0/tests/test_schedule_run_now.py +158 -0
- hachi_og-0.1.0/tests/test_schedule_run_now_gateway.py +170 -0
- hachi_og-0.1.0/tests/test_schedule_show.py +160 -0
- hachi_og-0.1.0/tests/test_scheduler.py +345 -0
- hachi_og-0.1.0/tests/test_scheduler_hardening.py +492 -0
- hachi_og-0.1.0/tests/test_search_platform.py +757 -0
- hachi_og-0.1.0/tests/test_search_tool_visibility.py +86 -0
- hachi_og-0.1.0/tests/test_secret_patterns_extended.py +61 -0
- hachi_og-0.1.0/tests/test_secret_scanner.py +71 -0
- hachi_og-0.1.0/tests/test_secret_scanner_tree.py +332 -0
- hachi_og-0.1.0/tests/test_secret_scanner_tree_hardening.py +342 -0
- hachi_og-0.1.0/tests/test_secret_store.py +529 -0
- hachi_og-0.1.0/tests/test_security_hardening.py +57 -0
- hachi_og-0.1.0/tests/test_serve_frontend_routing.py +141 -0
- hachi_og-0.1.0/tests/test_session_clean.py +212 -0
- hachi_og-0.1.0/tests/test_session_cli.py +251 -0
- hachi_og-0.1.0/tests/test_session_concurrency.py +156 -0
- hachi_og-0.1.0/tests/test_session_cost_tracking.py +202 -0
- hachi_og-0.1.0/tests/test_session_delete_export.py +197 -0
- hachi_og-0.1.0/tests/test_session_messages_cold_boot.py +79 -0
- hachi_og-0.1.0/tests/test_session_ownership.py +266 -0
- hachi_og-0.1.0/tests/test_session_stats.py +138 -0
- hachi_og-0.1.0/tests/test_session_store_delete.py +95 -0
- hachi_og-0.1.0/tests/test_session_store_foreign_keys.py +150 -0
- hachi_og-0.1.0/tests/test_session_store_model_column.py +150 -0
- hachi_og-0.1.0/tests/test_session_store_title.py +153 -0
- hachi_og-0.1.0/tests/test_session_titler.py +134 -0
- hachi_og-0.1.0/tests/test_setup_engine.py +281 -0
- hachi_og-0.1.0/tests/test_shared_services_mcp.py +381 -0
- hachi_og-0.1.0/tests/test_skill_inventory_dedup.py +57 -0
- hachi_og-0.1.0/tests/test_skill_md.py +79 -0
- hachi_og-0.1.0/tests/test_skill_packs.py +437 -0
- hachi_og-0.1.0/tests/test_slack_notion_fixes.py +329 -0
- hachi_og-0.1.0/tests/test_slice22_wiring.py +429 -0
- hachi_og-0.1.0/tests/test_ssrf_security.py +306 -0
- hachi_og-0.1.0/tests/test_streaming.py +814 -0
- hachi_og-0.1.0/tests/test_sub_agent_budget_caps.py +106 -0
- hachi_og-0.1.0/tests/test_sub_agent_iteration_limit_status.py +73 -0
- hachi_og-0.1.0/tests/test_suite_hermeticity.py +31 -0
- hachi_og-0.1.0/tests/test_suspend_workflow.py +220 -0
- hachi_og-0.1.0/tests/test_tavily_status_tristate.py +87 -0
- hachi_og-0.1.0/tests/test_telegram_commands.py +291 -0
- hachi_og-0.1.0/tests/test_telegram_setup.py +251 -0
- hachi_og-0.1.0/tests/test_token_window_management.py +311 -0
- hachi_og-0.1.0/tests/test_tool_lazy_loading.py +210 -0
- hachi_og-0.1.0/tests/test_tool_registration.py +95 -0
- hachi_og-0.1.0/tests/test_tool_result_clearing.py +164 -0
- hachi_og-0.1.0/tests/test_tool_timeline.py +92 -0
- hachi_og-0.1.0/tests/test_tracing.py +117 -0
- hachi_og-0.1.0/tests/test_transcribe_and_summarize.py +206 -0
- hachi_og-0.1.0/tests/test_traverse_hints.py +277 -0
- hachi_og-0.1.0/tests/test_turn_context.py +56 -0
- hachi_og-0.1.0/tests/test_unofficial_providers.py +228 -0
- hachi_og-0.1.0/tests/test_untrusted_content.py +90 -0
- hachi_og-0.1.0/tests/test_user_profile_store.py +600 -0
- hachi_og-0.1.0/tests/test_validators.py +474 -0
- hachi_og-0.1.0/tests/test_verify_dist.py +81 -0
- hachi_og-0.1.0/tests/test_vision_routing_gate.py +295 -0
- hachi_og-0.1.0/tests/test_vision_tools.py +308 -0
- hachi_og-0.1.0/tests/test_vision_url.py +118 -0
- hachi_og-0.1.0/tests/test_voice_channel_allowlist.py +252 -0
- hachi_og-0.1.0/tests/test_voice_endpoints.py +374 -0
- hachi_og-0.1.0/tests/test_voice_pipeline_fixes.py +264 -0
- hachi_og-0.1.0/tests/test_voice_registry_gate.py +288 -0
- hachi_og-0.1.0/tests/test_voice_tools.py +394 -0
- hachi_og-0.1.0/tests/test_web_gui_diag.py +151 -0
- hachi_og-0.1.0/tests/test_webhook_guard.py +108 -0
- hachi_og-0.1.0/tests/test_workspace_brand_heal.py +182 -0
- hachi_og-0.1.0/tests/test_zero_config_onboarding.py +384 -0
- hachi_og-0.1.0/uv.lock +4647 -0
|
@@ -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())
|