Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
run: ruff check .
- name: ruff format --check
run: ruff format --check .
- name: consumer boundary guard
run: bash ./scripts/check-consumer-boundaries.sh
- name: examples compile (anti-rot)
run: python -m compileall examples

Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PIP ?= $(PYTHON) -m pip
# ---------------------------------------------------------------------------
# Phony declarations (alphabetical).
# ---------------------------------------------------------------------------
.PHONY: all bench build ci clean cover fmt help install lint lint-fix \
.PHONY: all bench boundary-guard build ci clean cover fmt help install lint lint-fix \
release security test test-race tidy version vet

# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -63,6 +63,9 @@ fmt: ## Format with ruff.
vet: ## Type-check with mypy.
$(PYTHON) -m mypy src/

boundary-guard: ## Fail if the SDK references support engines or Hawk private packages.
bash ./scripts/check-consumer-boundaries.sh

lint: ## Lint with ruff.
$(PYTHON) -m ruff check .

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

# ---------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ with HawkClient() as client:

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

## Ecosystem Boundaries

- `hawk-sdk-python` is a consumer of Hawk public APIs and contracts.
- Do not couple the SDK to support engine repos such as `eyrie`, `yaad`, `tok`, `trace`, `sight`, or `inspect`.
- Do not reference `hawk/internal/*` or removed legacy path `hawk/shared/types`.
- If a capability is needed across repos, expose it through Hawk or `hawk-core-contracts`, not engine internals.

## Contributing

Contributions are welcome — please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.
Expand Down
14 changes: 14 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Install: lefthook install
# Skip once: LEFTHOOK=0 git commit -m "..."

prepare-commit-msg:
commands:
strip-co-authored-by:
run: |
sed '/^[Cc]o-[Aa]uthored-[Bb]y:/d' "{1}" > "{1}.tmp" && mv "{1}.tmp" "{1}"

commit-msg:
commands:
strip-co-authored-by:
run: |
sed '/^[Cc]o-[Aa]uthored-[Bb]y:/d' "{1}" > "{1}.tmp" && mv "{1}.tmp" "{1}"
22 changes: 22 additions & 0 deletions scripts/check-consumer-boundaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"

violations="$(
grep -RInE \
--include='*.py' --include='*.md' --include='*.yaml' --include='*.yml' --include='*.toml' \
'github\.com/GrayCodeAI/(eyrie|inspect|sight|tok|trace|yaad)(/|")|github\.com/GrayCodeAI/hawk/(internal/|shared/types)' \
src tests README.md docs api pyproject.toml 2>/dev/null || true
)"

if [[ -n "${violations}" ]]; then
echo "forbidden Hawk consumer references found:"
echo "${violations}"
echo
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"
exit 1
fi

echo "consumer boundary guard passed"
Loading