Orchestrata Ultimate › Gates › check-deps

Gate: check-deps

At a glance

Purpose Refuse a third-party import that pyproject.toml does not declare.
Where it runs The scripts/gates.py battery (registered as check-deps); standalone from the AST toolkit.
Trigger A battery run whose input fingerprint changed.
Exact command python scripts/serialize_codebase_ast.py check-deps --include-tests
Blocks Non-zero exit on any undeclared import; 0 when every third-party import is declared.
Ruling / ADR None recorded; it mechanizes the CLAUDE.md Key Rule "Declare every dependency in pyproject.toml".
Last recorded verdict ok: true in the primary checkout's .cache/gates.json (file last written 2026-09-22 10:01 local). wt-MAP-PRECOMMIT has no .cache/gates.json.

What it refuses

A third-party Python import anywhere in the scanned trees that pyproject.toml does not declare — code that works in the current venv but would break on a fresh uv sync.

Why it exists

The project's Key Rule (CLAUDE.md): "Declare every dependency in pyproject.toml — no undeclared/manually-installed packages; optional lazy-imported features go under [project.optional-dependencies]. check-deps gates this." The implementation's docstring (find_undeclared_dependencies in scripts/serialize_codebase_ast.py) defines the two failure buckets:

"Clean imports (stdlib, first-party, local, or already declared) are omitted."

A single originating incident is not recorded in the source — origin not recorded in the source beyond the Key Rule it mechanizes.

How it runs

Typical failures and how to fix them

Wiring