The canonical REPO_POLICIES.md, re-vendored under #196, now requires cmd/ to be thin: one main.go per binary whose body is a single call into internal/ or pkg/, with no project logic in cmd/.
cmd/pixad/main.go builds the cobra command and its --config flag, sets PIXA_CONFIG_PATH from that flag, ignores SIGPIPE, and wires the fx application. All of that belongs in a package under internal/, which main calls once. Version is set at build time through -X main.Version in the Dockerfile and the Makefile: it can stay in main and be passed to that call, or move, with both -X paths changed.
Model: opus-5-5
The canonical `REPO_POLICIES.md`, re-vendored under https://git.eeqj.de/sneak/pixa/issues/196, now requires `cmd/` to be thin: one `main.go` per binary whose body is a single call into `internal/` or `pkg/`, with no project logic in `cmd/`.
`cmd/pixad/main.go` builds the cobra command and its `--config` flag, sets `PIXA_CONFIG_PATH` from that flag, ignores `SIGPIPE`, and wires the fx application. All of that belongs in a package under `internal/`, which `main` calls once. `Version` is set at build time through `-X main.Version` in the `Dockerfile` and the Makefile: it can stay in `main` and be passed to that call, or move, with both `-X` paths changed.
Model: opus-5-5
clawbot
self-assigned this 2026-10-04 22:29:51 +02:00
Move what cmd/pixad/main.go does (the cobra command and its --config flag, setting PIXA_CONFIG_PATH, ignoring SIGPIPE, building and running the fx app) into a package under internal/ (for example internal/app with a Run(version string); use an existing package if one already fits). main becomes one call into it.
Version stays in main, set by -X main.Version as now, and is passed to that call, so the Dockerfile and Makefile build flags do not change.
Behaviour is unchanged: same flags, same exit codes (fx's Run from #86), same version log line first. Existing tests of what moved move with it; say so in the PR.
Model: opus-5-5
Plan, checked against `next` at `708a9be`:
- Move what `cmd/pixad/main.go` does (the cobra command and its `--config` flag, setting `PIXA_CONFIG_PATH`, ignoring `SIGPIPE`, building and running the fx app) into a package under `internal/` (for example `internal/app` with a `Run(version string)`; use an existing package if one already fits). `main` becomes one call into it.
- `Version` stays in `main`, set by `-X main.Version` as now, and is passed to that call, so the `Dockerfile` and Makefile build flags do not change.
- Behaviour is unchanged: same flags, same exit codes (fx's `Run` from https://git.eeqj.de/sneak/pixa/issues/86), same version log line first. Existing tests of what moved move with it; say so in the PR.
Model: opus-5-5
Built in #215: what cmd/pixad/main.go did moves unchanged to Run in a new internal/app package, and main is now app.Run(Version), with the build flags unchanged.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/pixa/pulls/215: what `cmd/pixad/main.go` did moves unchanged to `Run` in a new `internal/app` package, and `main` is now `app.Run(Version)`, with the build flags unchanged.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The canonical
REPO_POLICIES.md, re-vendored under #196, now requirescmd/to be thin: onemain.goper binary whose body is a single call intointernal/orpkg/, with no project logic incmd/.cmd/pixad/main.gobuilds the cobra command and its--configflag, setsPIXA_CONFIG_PATHfrom that flag, ignoresSIGPIPE, and wires the fx application. All of that belongs in a package underinternal/, whichmaincalls once.Versionis set at build time through-X main.Versionin theDockerfileand the Makefile: it can stay inmainand be passed to that call, or move, with both-Xpaths changed.Model: opus-5-5
Plan, checked against
nextat708a9be:cmd/pixad/main.godoes (the cobra command and its--configflag, settingPIXA_CONFIG_PATH, ignoringSIGPIPE, building and running the fx app) into a package underinternal/(for exampleinternal/appwith aRun(version string); use an existing package if one already fits).mainbecomes one call into it.Versionstays inmain, set by-X main.Versionas now, and is passed to that call, so theDockerfileand Makefile build flags do not change.Runfrom #86), same version log line first. Existing tests of what moved move with it; say so in the PR.Model: opus-5-5
Built in #215: what
cmd/pixad/main.godid moves unchanged toRunin a newinternal/apppackage, andmainis nowapp.Run(Version), with the build flags unchanged.Model: opus-5-5