|
| 1 | +# Hawk Architecture v1 — Definition of Done |
| 2 | + |
| 3 | +This document defines **realistic v1 complete** for the Hawk ecosystem architecture. |
| 4 | + |
| 5 | +It is the shipping bar for the contracts-and-boundaries refactor. It is **not** a promise that every future package in `hawk-core-contracts-spec.md` exists, or that every engine is wired through shared contracts on every runtime path. |
| 6 | + |
| 7 | +## What v1 means |
| 8 | + |
| 9 | +v1 is done when the ecosystem has: |
| 10 | + |
| 11 | +- one product surface (`hawk`) |
| 12 | +- six peer support engines with no sibling imports |
| 13 | +- shared vocabulary only where cross-repo pain is real |
| 14 | +- automated guards so the old coupling cannot return |
| 15 | + |
| 16 | +v1 does **not** require a single unified contract layer for runtime, persistence, trace, and orchestration. |
| 17 | + |
| 18 | +## v1 checklist |
| 19 | + |
| 20 | +### Product and dependency graph |
| 21 | + |
| 22 | +- [ ] `hawk` is the only primary end-user product in the ecosystem |
| 23 | +- [ ] Hawk coordinates engines; engines do not import each other |
| 24 | +- [ ] SDKs and community skills consume Hawk public surfaces, not engines directly |
| 25 | +- [ ] `graycode-core` and other company/platform repos stay outside Hawk runtime dependencies |
| 26 | + |
| 27 | +### Forbidden edges stay forbidden |
| 28 | + |
| 29 | +- [ ] no support repo imports `hawk/internal/*` |
| 30 | +- [ ] no support repo imports removed `hawk/shared/types` |
| 31 | +- [ ] no SDK/skills repo references support engines as primary dependencies |
| 32 | +- [ ] Hawk production code imports `eyrie/client` only at the transport adapter edge |
| 33 | + |
| 34 | +### `hawk-core-contracts` (implemented packages only) |
| 35 | + |
| 36 | +These packages are in scope for v1: |
| 37 | + |
| 38 | +- [ ] `types/` — severity and finding vocabulary |
| 39 | +- [ ] `review/` — neutral review results |
| 40 | +- [ ] `verify/` — neutral verification reports |
| 41 | +- [ ] `tools/` — persisted tool call/result contracts |
| 42 | +- [ ] `events/` — normalized audit/trace event subset used by Hawk |
| 43 | +- [ ] `policy/` — permission and guardian decision contracts |
| 44 | + |
| 45 | +Adoption bar: |
| 46 | + |
| 47 | +- [ ] `sight` and `inspect` import contracts for shared severity/findings and expose boundary adapters |
| 48 | +- [ ] `tok/types` re-exports contracts only as a deprecated shim (removal tracked separately) |
| 49 | +- [ ] `eyrie`, `yaad`, and `trace` remain contract-free unless they gain a true cross-repo type |
| 50 | + |
| 51 | +### Hawk integration seams |
| 52 | + |
| 53 | +- [ ] session persistence uses `hawk-core-contracts/tools`, not `eyrie/client` tool types |
| 54 | +- [ ] review persistence and inspect/review bridge paths use neutral `review` / `verify` contracts |
| 55 | +- [ ] Hawk owns runtime transport DTOs in `internal/types` and adapts to `eyrie/client` at the edge |
| 56 | +- [ ] `hawk trace ...` remains a Hawk-mounted subcommand, not a competing product surface |
| 57 | + |
| 58 | +### Enforcement |
| 59 | + |
| 60 | +- [ ] Hawk CI runs ecosystem, shared-types, eyrie-client, and peer-coupling guards |
| 61 | +- [ ] each support repo runs `check-ecosystem-boundaries.sh` in CI |
| 62 | +- [ ] Go SDK runs consumer boundary guard in CI |
| 63 | +- [ ] Python SDK and community skills run consumer boundary guards in CI |
| 64 | +- [ ] architecture docs do not describe removed or planned packages as currently shipped |
| 65 | + |
| 66 | +### Ship state |
| 67 | + |
| 68 | +- [ ] open architecture PRs for engines, consumers, and Hawk integration are merged to `main` |
| 69 | +- [ ] published module versions used by Hawk match the merged contract changes |
| 70 | + |
| 71 | +## Explicit non-goals for v1 |
| 72 | + |
| 73 | +Do not block v1 on any of the following: |
| 74 | + |
| 75 | +- `hawk-core-contracts/sessions` or `hawk-core-contracts/engines` |
| 76 | +- moving every Hawk internal event struct into `hawk-core-contracts/events` |
| 77 | +- moving trace timeline/event models out of `trace` |
| 78 | +- unifying runtime `internal/types` DTOs and persisted contracts into one type |
| 79 | +- forcing every engine into the same integration depth (library vs subcommand vs service) |
| 80 | +- deep static import analysis for Python SDK or markdown-only skills repos |
| 81 | + |
| 82 | +## Governance after v1 |
| 83 | + |
| 84 | +Add a new `hawk-core-contracts` package only when **all** of these are true: |
| 85 | + |
| 86 | +1. at least two repos need the same stable type or envelope |
| 87 | +2. the type is vocabulary or DTO, not runtime logic |
| 88 | +3. the owning repo cannot keep the type local without recreating cross-repo coupling |
| 89 | +4. the addition is documented in `hawk-core-contracts-spec.md` before code lands |
| 90 | + |
| 91 | +Remove compatibility shims only when: |
| 92 | + |
| 93 | +1. grep/guards show zero remaining importers |
| 94 | +2. the removal is called out in the repo CHANGELOG or migration note |
| 95 | + |
| 96 | +## Verify locally |
| 97 | + |
| 98 | +From `hawk`: |
| 99 | + |
| 100 | +```bash |
| 101 | +make ecosystem-guard contracts-guard eyrie-client-guard peer-guard |
| 102 | +go test ./internal/testaudit/... -count=1 |
| 103 | +go test ./... -count=1 |
| 104 | +``` |
| 105 | + |
| 106 | +From each support repo: |
| 107 | + |
| 108 | +```bash |
| 109 | +bash ./scripts/check-ecosystem-boundaries.sh |
| 110 | +go test ./... -count=1 |
| 111 | +``` |
| 112 | + |
| 113 | +## Related docs |
| 114 | + |
| 115 | +- `hawk-product-architecture.md` — target shape and phases |
| 116 | +- `hawk-dependency-rules.md` — allowed and forbidden edges |
| 117 | +- `hawk-core-contracts-spec.md` — contract inventory and planned packages |
| 118 | +- `../plans/hawk-contracts-migration-backlog.md` — migration history and follow-ups |
0 commit comments