archy_contracts
Enforce architectural import rules after Python edits. Checks transitive layers, forbidden dependencies, and more to prevent import violations across package boundaries.
Instructions
Call after any Python edit that adds, removes, or changes an import statement, especially across package boundaries. A failed contract means the new import violates the architecture - revert or restructure before continuing. Runs import-linter contracts (transitive Layers, Forbidden, Independence, Protected, AcyclicSiblings); stricter than archy_check, which only catches direct edges between layers in archy.yaml. Reads .importlinter (or pyproject.toml). Requires pip install archy[contracts].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| config_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kept | No | ||
| error | No | ||
| broken | No | ||
| all_kept | No | ||
| available | Yes | ||
| contracts | No | ||
| import_count | No | ||
| module_count | No |