Files
corrosion-admin-panel/docs/reference-repos/icehunter/docs/adr/0001-standard-go-layout.md
Vantz Stockwell 651a35d4be
All checks were successful
CI / backend-types (push) Successful in 10s
CI / frontend-build (push) Successful in 15s
CI / agent-tests (push) Successful in 39s
CI / integration (push) Successful in 22s
docs(reference): import Dune: Awakening server-manager references
Phase 2 references for the host-agent Dune adapter, moved out of volatile /tmp
into docs/reference-repos/ (per Commander). Three upstream projects, .git +
node_modules + compiled binaries stripped (16MB source). Nested AI-instruction
files (.claude/, CLAUDE.md) removed so they don't pollute Corrosion sessions.

- icehunter/    dune-admin (Go+React) — 4 control planes; SETUP_DOCKER.md is the
                closest analog to our agent's Dune docker control plane (compose
                lifecycle, docker logs, RabbitMQ-via-exec, dune Postgres schema)
- adainrivers/  Rust/Tauri desktop — SSH+k8s BattleGroup control, maintenance
                daemon, in-game admin console (Rust idiom reference)
- the4rchangel/ Node web UI replacing battlegroup.bat — matches the Commander's
                Hyper-V self-host path + game-config schema

See docs/reference-repos/README.md for the full index + how we use each.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 21:08:05 -04:00

1.4 KiB

ADR 0001 — Adopt standard Go project layout

Status: Accepted
Date: 2025-05-27

Context

All Go source files currently live in the repository root alongside go.mod, the Makefile, Dockerfile, and deployment config. As the project grows (adding internal/marketbot/, potentially other sub-packages), the flat layout makes it hard to:

  • Distinguish entry-point code from library code
  • Prevent external import of internal helpers
  • Keep deployment artifacts clearly separated from source

The Go community's de-facto standard layout places main packages under cmd/<name>/ and shared/internal code under internal/<pkg>/. The go toolchain enforces the internal/ import restriction natively.

Decision

Move all root-level *.go files into cmd/dune-admin/ (package declaration stays package main). New shared code goes into internal/. Deployment artifacts (Dockerfile, docker-compose.yml, k8s manifests) move into deploy/.

The go.mod module name remains dune-admin. Build target changes from ./ to ./cmd/dune-admin.

Consequences

  • make build, make test, all go tool invocations must be updated to use ./cmd/dune-admin or ./...
  • The existing Dockerfile COPY and WORKDIR paths need updating
  • internal/ enforces that marketbot can only be imported by this module — prevents accidental external re-use
  • One-time migration commit with no behaviour change; straightforward to review