Skip to content

Commit 5e8a3b3

Browse files
authored
fix(boundaries): untrack go.work, add cross-engine import guard (#51)
- 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
1 parent 7546bb6 commit 5e8a3b3

4 files changed

Lines changed: 29 additions & 8 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,9 @@ dist/
2525
.DS_Store
2626
coverage.out
2727

28+
# Go workspace (local dev only — each developer creates their own)
29+
go.work
30+
go.work.sum
31+
2832
# Lefthook-generated wrappers (logic lives in lefthook.yml)
2933
.githooks/

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ When your app calls a model, eyrie figures out which provider to use, how to tal
4040

4141
eyrie is a Hawk support engine. Keep the dependency edge one-way:
4242

43-
- depend on `hawk-core-contracts` when a stable cross-repo contract is needed
43+
- eyrie uses local-only types (provider/transport types are eyrie-scoped, not shared contracts)
4444
- do not import `hawk/internal/*`
45-
- do not import removed legacy path `hawk/shared/types`; use `hawk-core-contracts/types`
45+
- do not import removed legacy path `hawk/shared/types`
46+
- do not import other engines (`yaad`, `tok`, `trace`, `sight`, `inspect`) — engines are peers, not dependencies
4647

4748
## Quick Start
4849

go.work

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/check-ecosystem-boundaries.sh

100644100755
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,37 @@ set -euo pipefail
44
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
55
cd "$ROOT_DIR"
66

7+
FORBIDDEN_HAWK='github\.com/GrayCodeAI/hawk/(internal/|shared/types)'
8+
FORBIDDEN_ENGINES='github\.com/GrayCodeAI/(yaad|tok|trace|sight|inspect)(/|")'
9+
10+
exit_code=0
11+
712
if command -v rg >/dev/null 2>&1; then
8-
violations="$(rg -n 'github\.com/GrayCodeAI/hawk/(internal/|shared/types)' --glob '*.go' . || true)"
13+
violations="$(rg -n "$FORBIDDEN_HAWK" --glob '*.go' . || true)"
14+
engine_violations="$(rg -n "$FORBIDDEN_ENGINES" --glob '*.go' . || true)"
915
else
10-
violations="$(grep -rn --include='*.go' -E 'github\.com/GrayCodeAI/hawk/(internal/|shared/types)' . || true)"
16+
violations="$(grep -rn --include='*.go' -E "$FORBIDDEN_HAWK" . || true)"
17+
engine_violations="$(grep -rn --include='*.go' -E "$FORBIDDEN_ENGINES" . || true)"
1118
fi
1219

1320
if [[ -n "${violations}" ]]; then
1421
echo "forbidden Hawk imports found:"
1522
echo "${violations}"
1623
echo
1724
echo "support repos must use hawk-core-contracts or local contracts, not hawk/internal or removed hawk/shared/types"
18-
exit 1
25+
exit_code=1
26+
fi
27+
28+
if [[ -n "${engine_violations}" ]]; then
29+
echo "forbidden cross-engine imports found:"
30+
echo "${engine_violations}"
31+
echo
32+
echo "support engines must not import other engines directly — they are peers, not dependencies"
33+
exit_code=1
34+
fi
35+
36+
if [[ $exit_code -ne 0 ]]; then
37+
exit $exit_code
1938
fi
2039

2140
echo "ecosystem boundary guard passed"

0 commit comments

Comments
 (0)