Skip to content

Slim arena down to a flag-driven Go CLI - #42

Merged
mrsombre merged 4 commits into
mainfrom
optimizations
Sep 27, 2026
Merged

mrsombre merged 4 commits into
mainfrom
optimizations

Conversation

@mrsombre

Copy link
Copy Markdown
Owner

Remove the parts of arena that are not used: the web viewer with its serve command, and viper-based configuration. Arena is now a Go CLI driven by command-line flags only.

  • Remove viewer/ (React + PixiJS), the internal/arena/server package and arena serve. The HTTP API existed only to feed the viewer. The pnpm toolchain goes with them: the frontend CI job, the pnpm build in the release workflow, the npm Dependabot entry and skills-lock.json (frontend skills only).
  • Rename the make targets test-arena, lint-arena and build-arena to test, lint and build; build is the default goal. test-games keeps its name. make clean no longer wipes bin/, and .editorconfig is removed.
  • Format all Go code outside source/ with gofmt (17 files, alignment and blank lines only).
  • Drop viper. arena.GameOptions{League, ReplayMetadata} replaces *viper.Viper in GameFactory.NewGame and LeagueResolver.ResolveLeague; command handlers read the pflag FlagSet directly. arena.yml and ARENA_* environment variables no longer have any effect. --league on run and game serialize is an int flag where 0 selects the game default; a non-numeric or negative value is now an error instead of a silent fallback.

Validation: make build, make test, make test-games and make lint passed on every commit.

Breaking changes: arena serve is gone, and configuration through arena.yml or ARENA_* environment variables no longer works. The ARENA_DEBUG_GRID and ARENA_DEBUG_REPLAY switches in the winter2026 debug tests still work; they read os.Getenv directly.

Game visualization is not used, and the React viewer carried a separate
pnpm toolchain, CI job and dependency stream. The arena is now a Go CLI
only.

- Delete viewer/, the internal/arena/server package and the arena serve
  command with its flags. The HTTP API existed only to feed the viewer.
- Drop the viewer targets from the Makefile, the frontend job and the
  dist stub from the pull-request workflow, the pnpm build from the
  release workflow and the npm entry from dependabot.
- Delete skills-lock.json, which listed only frontend skills.
- Remove viewer and serve references from command help, README, docs,
  TODO and AGENTS.md; delete docs/serve.md and the viewer screenshots.
- go mod tidy moves fsnotify to an indirect dependency (viper uses it).

Verified with make build-arena, make test-arena and make lint-arena.
With the viewer gone, the -arena suffix no longer separates anything, so
test-arena, lint-arena and build-arena become test, lint and build, and
build is the default goal. test-games keeps its name because it still
distinguishes engine tests from arena tests. All docs and agent rules
use the new names.

make clean no longer wipes bin/, so built bots survive a cleanup.
Remove .editorconfig.

Verified with make build, make test and make lint.
Seventeen files had drifted from gofmt output: struct literal and const
block alignment, stray blank lines. Formatting only; no code changes.
source/ is left untouched as an upstream import.

Verified with make test, make test-games and make lint.
Arena is always run with explicit flags; the arena.yml config file and
ARENA_* environment variables were never used. Viper only carried the
league and replay metadata into the engines, which a typed struct does
with less indirection and ten fewer indirect dependencies.

- arena.GameOptions{League, ReplayMetadata} replaces *viper.Viper in
  GameFactory.NewGame and LeagueResolver.ResolveLeague. League 0 selects
  the game default. summer2026 enables the historical side-quest mode
  when sideQuestPoints_0/1 is present in the replay metadata.
- Command handlers read values straight from the pflag FlagSet;
  arena.NewViper and the handler viper parameter are gone.
- --league on run and game serialize is an int flag. A non-numeric
  value is now a parse error instead of a silent fallback to the
  default, and a negative value is rejected.
- Help text, READMEs, java-port.md and .gitignore no longer mention
  the config file or environment variables.

The ARENA_DEBUG_GRID and ARENA_DEBUG_REPLAY switches in the winter2026
debug tests stay; they read os.Getenv directly and never went through
viper.

Verified with make build, make test, make test-games and make lint.
@mrsombre
mrsombre merged commit 3ffa7c8 into main Sep 27, 2026
1 check passed
@mrsombre
mrsombre deleted the optimizations branch September 27, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant