Skip to content

refactor: move the mechanism band under internal/#178

Merged
ion-alpha-dev merged 1 commit into
mainfrom
feat/repo-layout-v2-internal
Jul 2, 2026
Merged

refactor: move the mechanism band under internal/#178
ion-alpha-dev merged 1 commit into
mainfrom
feat/repo-layout-v2-internal

Conversation

@ion-alpha-dev

Copy link
Copy Markdown
Collaborator

What

Moves the 28 mechanism packages (parsers, guards, stores, probes, adapters) under internal/, so the top level reads as the module's API surface: the agent facade, the ports a host implements or consumes, and the domain nouns. One commit, git mv renames throughout so git log --follow tracks history.

Why

Every exported package in a public Go module is formally API; before this change all 65 top-level packages carried that promise. internal/ removes the plumbing from the import surface (and from godoc) while the code stays world-readable, and doing it now, while the module has no external importers, is the cheapest this move can ever be. depguard keeps governing layer direction; internal/ governs the external surface - complementary controls, and ARCHITECTURE.md now says so instead of deferring the move to v1.0.

The public set was derived mechanically, not by intuition: a go/types audit over the exported signatures of the declared surface found seven mechanism packages that leak into public signatures (approval, brakes, bus, harness, hlc, jobs, netguard) - they stay public, and the audit closes at a fixed point with no further leaks. driver and inbox stay public as ports third parties implement; instance and archetype move internal because their kinds surface through the controlplane API as JSON, not Go types.

How to verify

dev/check (build, vet, race tests, lint) passes; the rigor gate's package keys and the depguard deny path for spinesink are updated with the move. go doc on any moved package now fails outside the module, and the packages listed in ARCHITECTURE.md's stability tiers are exactly the importable set.

Notes for reviewers

No code changes beyond import paths, the two path-keyed config/gate updates (.golangci.yml, internal/rigor), and the ARCHITECTURE.md/README rewrite. The linter's glob- and regex-based rules (**/hardware/**, (^|/)netguard/, (^|/)(clock|migrate)/) match under internal/ unchanged.

Top level now reads as the module's API surface: the agent facade, the
ports a host implements or consumes, and the domain nouns. The 28
mechanism packages (parsers, guards, stores, probes, adapters) move to
internal/, removing them from the public import surface before any
external importers exist.

The public set was derived mechanically, not by intuition: a go/types
audit over the declared Band 1/2 packages found seven mechanism
packages referenced in exported signatures (approval, brakes, bus,
harness, hlc, jobs, netguard), which therefore stay public, and the
audit closes at a fixed point with no further leaks. driver and inbox
stay public as ports third parties implement; instance and archetype
move internal because their kinds surface through the controlplane API
as JSON, not Go types.

Also updates the depguard deny path for spinesink, the rigor gate's
grandfather and fuzz-required package keys, and rewrites the
ARCHITECTURE.md sections that framed internal/ as deferred to v1.0:
surface (internal/) and structure (depguard) are complementary
controls, and the move is cheapest before ignition.
@ion-alpha-dev ion-alpha-dev force-pushed the feat/repo-layout-v2-internal branch from d6c3b92 to d91e6d1 Compare July 2, 2026 03:17
@ion-alpha-dev ion-alpha-dev merged commit d91e6d1 into main Jul 2, 2026
9 checks passed
@ion-alpha-dev ion-alpha-dev deleted the feat/repo-layout-v2-internal branch July 2, 2026 03:27
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant