Skip to content

Commit f4a8bca

Browse files
committed
ci: guard sdk-python consumer boundaries
1 parent 8461f27 commit f4a8bca

4 files changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ jobs:
5656
run: ruff check .
5757
- name: ruff format --check
5858
run: ruff format --check .
59+
- name: consumer boundary guard
60+
run: bash ./scripts/check-consumer-boundaries.sh
5961
- name: examples compile (anti-rot)
6062
run: python -m compileall examples
6163

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PIP ?= $(PYTHON) -m pip
1919
# ---------------------------------------------------------------------------
2020
# Phony declarations (alphabetical).
2121
# ---------------------------------------------------------------------------
22-
.PHONY: all bench build ci clean cover fmt help install lint lint-fix \
22+
.PHONY: all bench boundary-guard build ci clean cover fmt help install lint lint-fix \
2323
release security test test-race tidy version vet
2424

2525
# ---------------------------------------------------------------------------
@@ -63,6 +63,9 @@ fmt: ## Format with ruff.
6363
vet: ## Type-check with mypy.
6464
$(PYTHON) -m mypy src/
6565

66+
boundary-guard: ## Fail if the SDK references support engines or Hawk private packages.
67+
bash ./scripts/check-consumer-boundaries.sh
68+
6669
lint: ## Lint with ruff.
6770
$(PYTHON) -m ruff check .
6871

@@ -84,7 +87,7 @@ tidy: ## No-op for Python (lockfile management is via pyproject.toml).
8487
# ---------------------------------------------------------------------------
8588
# Composite gate used by CI and pre-push.
8689
# ---------------------------------------------------------------------------
87-
ci: fmt vet lint test security ## Run everything CI runs.
90+
ci: fmt vet boundary-guard lint test security ## Run everything CI runs.
8891
@echo "All CI checks passed."
8992

9093
# ---------------------------------------------------------------------------

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ with HawkClient() as client:
6666

6767
See the [examples/](examples/) directory for complete runnable examples.
6868

69+
## Ecosystem Boundaries
70+
71+
- `hawk-sdk-python` is a consumer of Hawk public APIs and contracts.
72+
- Do not couple the SDK to support engine repos such as `eyrie`, `yaad`, `tok`, `trace`, `sight`, or `inspect`.
73+
- Do not reference `hawk/internal/*` or removed legacy path `hawk/shared/types`.
74+
- If a capability is needed across repos, expose it through Hawk or `hawk-core-contracts`, not engine internals.
75+
6976
## Contributing
7077

7178
Contributions are welcome — please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5+
cd "$ROOT_DIR"
6+
7+
violations="$(
8+
grep -RInE \
9+
--include='*.py' --include='*.md' --include='*.yaml' --include='*.yml' --include='*.toml' \
10+
'github\.com/GrayCodeAI/(eyrie|inspect|sight|tok|trace|yaad)(/|")|github\.com/GrayCodeAI/hawk/(internal/|shared/types)' \
11+
src tests README.md docs api pyproject.toml 2>/dev/null || true
12+
)"
13+
14+
if [[ -n "${violations}" ]]; then
15+
echo "forbidden Hawk consumer references found:"
16+
echo "${violations}"
17+
echo
18+
echo "hawk-sdk-python must depend on Hawk public APIs/contracts only; do not reference support engine repos, hawk/internal, or removed hawk/shared/types"
19+
exit 1
20+
fi
21+
22+
echo "consumer boundary guard passed"

0 commit comments

Comments
 (0)