# Hecate users' guide Hecate checks Python package imports against a TOML architecture policy. It is intended for projects that use hexagonal architecture and need CI-stable diagnostics for dependency-direction drift. ## Running checks Run Hecate from the project root: ```bash hecate check ``` The command discovers `[tool.hecate]` in `pyproject.toml`. To use another TOML file, pass `--config`: ```bash hecate check --config architecture.toml ``` Use JSON output for machine consumers: ```bash hecate check --format json ``` Text output is deterministic and suitable for snapshot tests. ## Reading diagnostics A violation has this shape: ```plaintext HEC001: sample.domain.model:1 imports forbidden module sample.adapters.db (domain -> adapter) ``` The fields are: - rule identifier; - importing module and source line; - imported module; - importing group and imported group. Exit code `0` means the package passed. Exit code `1` means Hecate found architecture violations. Exit code `2` means configuration, command-line input, or package-root validation failed. ## Re-export handling Package barrels do not hide forbidden imports. Hecate indexes `__init__.py` exports, honours the last literal `__all__` assignment, falls back to public symbols when `__all__` is absent or unresolved, and expands statically resolvable star exports. ## Local validation Run the full local gate before publishing changes: ```bash make check-fmt make lint make typecheck make test make crosshair ``` `make crosshair` analyses only bounded pure helper contracts. It intentionally does not analyse filesystem traversal, `ast.parse`, TOML parsing, or the CLI.