← Ledger

0004 — Phase 5 Go submodule conventions (hearth/)

Context

Phase 5 (docs/specs/2026-05-04-rocky-phase-5.md) introduces the third language in the Rocky superproject: Go, in the new rocky-hq/hearth submodule. The redesign spec resolved the language choice (§Why Go for HEARTH) but left the per-language conventions — module path, license, toolchain, CI shape, codegen pattern — open. Without those locked, sub-phases 5a–5e will drift on style, tooling, and test discipline; the same problem the Python (Phase 3a) and TypeScript (Phase 2) submodules each settled in their own bootstrap PRs.

This decision settles the Go conventions before 5a starts coding.

The user-facing constraint guiding this decision: mirror existing patterns (kahn-hq Go projects + the Phase 4 contracts/ CI shape). No bespoke Go tooling for Rocky; we adopt the standard ecosystem defaults that the operator already runs in adjacent repos.

Decision

The conventions below apply to rocky-hq/hearth and to any future Go submodule of rocky-hq (none planned through Phase 7).

Module + repo

Toolchain

Repo layout

Standard Go layout per spec §4:

CI shape

GitHub Actions, three jobs (mirrors the contracts/console job naming):

  1. lintgofumpt -l . exits clean; go vet ./...; golangci-lint run; go mod tidy produces no diff.
  2. testgo test ./... -race -count=1 (race detector on, no test caching). Unit only — no Docker daemon assumed.
  3. integration — runs only when ROCKY_HEARTH_INTEGRATION=1. Uses GitHub Actions' built-in Docker daemon. Required on PRs touching internal/driver/localdocker/** or test/integration/** (path-filtered trigger).

Branch protection on main requires lint and test to pass; integration is required when triggered.

Cross-language types (codegen path)

Per Phase-5 spec D5 + §7:

This pattern extends naturally to any Phase-6+ Go consumer: import the same contracts/go/<subpath> module.

Versioning + tags

Distribution

Documentation

Consequences

Amendments

(None yet — append future tightenings as ### YYYY-MM-DD: <change> subsections.)

References