From d9573233510fae16d36660fc556c0fbc98fe0cdb Mon Sep 17 00:00:00 2001 From: Lakshman Patel Date: Thu, 25 Jun 2026 10:51:57 +0530 Subject: [PATCH] fix(boundaries): untrack go.work, add cross-engine import guard - Added go.work/go.work.sum to .gitignore (engines use local go.work only) - Untracked committed go.work from git index - Expanded boundary guard to check for forbidden cross-engine imports - Made boundary script executable - Updated README Ecosystem Boundaries to clarify local-only types --- .gitignore | 4 ++++ README.md | 5 +++-- go.work | 3 --- scripts/check-ecosystem-boundaries.sh | 25 ++++++++++++++++++++++--- 4 files changed, 29 insertions(+), 8 deletions(-) delete mode 100644 go.work mode change 100644 => 100755 scripts/check-ecosystem-boundaries.sh diff --git a/.gitignore b/.gitignore index 78a10ec..9e9a9f4 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,9 @@ dist/ .DS_Store coverage.out +# Go workspace (local dev only — each developer creates their own) +go.work +go.work.sum + # Lefthook-generated wrappers (logic lives in lefthook.yml) .githooks/ diff --git a/README.md b/README.md index 6688cde..2bd0189 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,10 @@ When your app calls a model, eyrie figures out which provider to use, how to tal eyrie is a Hawk support engine. Keep the dependency edge one-way: -- depend on `hawk-core-contracts` when a stable cross-repo contract is needed +- eyrie uses local-only types (provider/transport types are eyrie-scoped, not shared contracts) - do not import `hawk/internal/*` -- do not import removed legacy path `hawk/shared/types`; use `hawk-core-contracts/types` +- do not import removed legacy path `hawk/shared/types` +- do not import other engines (`yaad`, `tok`, `trace`, `sight`, `inspect`) — engines are peers, not dependencies ## Quick Start diff --git a/go.work b/go.work deleted file mode 100644 index 4b21626..0000000 --- a/go.work +++ /dev/null @@ -1,3 +0,0 @@ -go 1.26.4 - -use . diff --git a/scripts/check-ecosystem-boundaries.sh b/scripts/check-ecosystem-boundaries.sh old mode 100644 new mode 100755 index 57f81ba..a7b98b4 --- a/scripts/check-ecosystem-boundaries.sh +++ b/scripts/check-ecosystem-boundaries.sh @@ -4,10 +4,17 @@ set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$ROOT_DIR" +FORBIDDEN_HAWK='github\.com/GrayCodeAI/hawk/(internal/|shared/types)' +FORBIDDEN_ENGINES='github\.com/GrayCodeAI/(yaad|tok|trace|sight|inspect)(/|")' + +exit_code=0 + if command -v rg >/dev/null 2>&1; then - violations="$(rg -n 'github\.com/GrayCodeAI/hawk/(internal/|shared/types)' --glob '*.go' . || true)" + violations="$(rg -n "$FORBIDDEN_HAWK" --glob '*.go' . || true)" + engine_violations="$(rg -n "$FORBIDDEN_ENGINES" --glob '*.go' . || true)" else - violations="$(grep -rn --include='*.go' -E 'github\.com/GrayCodeAI/hawk/(internal/|shared/types)' . || true)" + violations="$(grep -rn --include='*.go' -E "$FORBIDDEN_HAWK" . || true)" + engine_violations="$(grep -rn --include='*.go' -E "$FORBIDDEN_ENGINES" . || true)" fi if [[ -n "${violations}" ]]; then @@ -15,7 +22,19 @@ if [[ -n "${violations}" ]]; then echo "${violations}" echo echo "support repos must use hawk-core-contracts or local contracts, not hawk/internal or removed hawk/shared/types" - exit 1 + exit_code=1 +fi + +if [[ -n "${engine_violations}" ]]; then + echo "forbidden cross-engine imports found:" + echo "${engine_violations}" + echo + echo "support engines must not import other engines directly — they are peers, not dependencies" + exit_code=1 +fi + +if [[ $exit_code -ne 0 ]]; then + exit $exit_code fi echo "ecosystem boundary guard passed"