Skip to content

Commit cc409fe

Browse files
committed
ci(boundary): add ecosystem boundary guard
trace is a Hawk support engine whose trace/redaction event types are trace-local, so it stays contract-free. Add the one-way ecosystem boundary guard: - add scripts/check-ecosystem-boundaries.sh (forbids hawk/internal and hawk/shared/types imports) - wire the guard into the Makefile and CI - document the boundary rule in the README Scoped to the boundary guard only; unrelated in-progress changes in the working tree are intentionally left uncommitted.
1 parent ff3bff1 commit cc409fe

4 files changed

Lines changed: 40 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
with:
4949
go-version: ${{ env.GO_VERSION }}
5050
cache: true
51+
- name: Boundary guard
52+
run: bash ./scripts/check-ecosystem-boundaries.sh
5153
- name: gofumpt diff
5254
run: |
5355
go install mvdan.cc/gofumpt@v0.10.0
@@ -72,6 +74,8 @@ jobs:
7274
with:
7375
go-version: ${{ env.GO_VERSION }}
7476
cache: true
77+
- name: Boundary guard
78+
run: bash ./scripts/check-ecosystem-boundaries.sh
7579
- uses: golangci/golangci-lint-action@v9.2.1
7680
with:
7781
version: v2.11.3
@@ -91,6 +95,8 @@ jobs:
9195
with:
9296
go-version: ${{ env.GO_VERSION }}
9397
cache: true
98+
- name: Boundary guard
99+
run: bash ./scripts/check-ecosystem-boundaries.sh
94100
- name: Tidy check
95101
run: |
96102
go mod tidy

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ GOVULNCHECK := $(GOBIN_DIR)/govulncheck
3131
# ---------------------------------------------------------------------------
3232
# Phony declarations (alphabetical).
3333
# ---------------------------------------------------------------------------
34-
.PHONY: all bench build ci clean cover fmt help lint lint-fix \
34+
.PHONY: all bench boundaries build ci clean cover fmt help lint lint-fix \
3535
security test test-10x test-race tidy version vet
3636

37+
boundaries: ## Enforce support-repo import boundaries.
38+
bash ./scripts/check-ecosystem-boundaries.sh
39+
3740
# ---------------------------------------------------------------------------
3841
# Default target.
3942
# ---------------------------------------------------------------------------
@@ -100,7 +103,7 @@ tidy: ## Tidy go.mod / go.sum.
100103
# ---------------------------------------------------------------------------
101104
# Composite gate used by CI and pre-push.
102105
# ---------------------------------------------------------------------------
103-
ci: tidy fmt vet lint test-race security ## Run everything CI runs.
106+
ci: tidy fmt vet lint boundaries test-race security ## Run everything CI runs.
104107
@echo "All CI checks passed."
105108

106109
# ---------------------------------------------------------------------------

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616

1717
Trace hooks into your Git workflow to capture AI agent sessions as you work. Sessions are indexed alongside commits, creating a searchable record of *how* code was written — not just *what* changed.
1818

19+
## Ecosystem Boundaries
20+
21+
Trace is a Hawk support engine. Keep the dependency edge one-way:
22+
23+
- depend on `hawk-core-contracts` when a stable cross-repo contract is needed
24+
- do not import `hawk/internal/*`
25+
- do not add new imports of `hawk/shared/types`; that path is compatibility-only
26+
1927
### What you get
2028

2129
| Capability | Description |
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
rg -n 'github\.com/GrayCodeAI/hawk/(internal/|shared/types)' \
9+
--glob '*.go' \
10+
. || true
11+
)"
12+
13+
if [[ -n "${violations}" ]]; then
14+
echo "forbidden Hawk imports found:"
15+
echo "${violations}"
16+
echo
17+
echo "support repos must use hawk-core-contracts or local contracts, not hawk/internal or hawk/shared/types"
18+
exit 1
19+
fi
20+
21+
echo "ecosystem boundary guard passed"

0 commit comments

Comments
 (0)