Skip to content

refactor: hoist Go module from go/ to repo root#162

Merged
aksOps merged 1 commit into
mainfrom
refactor/hoist-go-to-root
May 14, 2026
Merged

refactor: hoist Go module from go/ to repo root#162
aksOps merged 1 commit into
mainfrom
refactor/hoist-go-to-root

Conversation

@aksOps
Copy link
Copy Markdown
Contributor

@aksOps aksOps commented May 14, 2026

Summary

The `/go/` subdirectory was a relic of the Java/Go coexistence period. Phase 6 cutover (#132) deleted the Java side a month ago, leaving the Go module stranded one level deep. That cost the project a clean `go install` story: users had to type `github.com/randomcodespace/codeiq/go/cmd/codeiq@v0.3.x` and pseudo-version resolution kicked in because there were no `go/vX.Y.Z` tags.

This PR moves the module to the repo root.

After this lands

```bash

Direct install, resolves to v0.3.x tag — no /go suffix, no separate tag namespace.

go install github.com/randomcodespace/codeiq/cmd/codeiq@v0.3.0
```

What moved

Before After
`go/cmd/` `cmd/`
`go/internal/` `internal/`
`go/testdata/` `testdata/`
`go/parity/` `parity/`
`go/go.mod` `go.mod` (module path drops `/go`)
`go/go.sum` `go.sum`
`go/.gitignore` merged into root `.gitignore`

All renames done via `git mv` so `git log --follow` works.

Mechanical rewrites

  • 320 Go files: `github.com/randomcodespace/codeiq/go/...` → `github.com/randomcodespace/codeiq/...`
  • 5 CI workflows (`go-ci`, `release-go`, `release-darwin`, `perf-gate`, `security`): dropped `working-directory: go`, `cache-dependency-path: go/go.sum`, `cd go &&` wrappers, and the `go/cmd go/internal` jscpd target prefix
  • .goreleaser.yml: dropped `dir: go` from each build, removed `cd go &&` from `before:` hooks, updated all `-X .../go/internal/buildinfo.*` ldflags
  • .github/dependabot.yml: `directory: "/go"` → `directory: "/"`
  • README: `cd codeiq/go` → `cd codeiq`; added explicit `go install` example
  • CLAUDE.md / PROJECT_SUMMARY.md / AGENTS.md: directory map + module-path callouts updated

Historical `docs/superpowers/plans/*.md` keep their original `go/internal/...` references — point-in-time snapshots, not living docs.

Test plan

  • `CGO_ENABLED=1 go build ./...` — clean
  • `CGO_ENABLED=1 go test ./... -count=1` — full suite passes, 0 FAIL across 41 test-bearing packages (884 tests)
  • Smoke on `testdata/fixture-minimal`: index exit 0 (5 files / 44 nodes / 24 edges), enrich exit 0 (45 nodes / 68 edges / 1 service / FTS indexed)
  • CI workflows must all pass — first run on this PR will validate the workflow rewrites

Notes for future tagging

Once this merges, the next release tag (`v0.3.1` / `v0.4.0` / whatever) will resolve cleanly for `go install`. The pre-existing top-level tags (`v0.3.0`, `v0.2.x`, `v0.0.1-beta.*`) point at commits where the module was still at `go/` — `go install ...@v0.3.0` from before this PR will still work the old way; from after this PR you'd want to bump.

🤖 Generated with Claude Code

The /go/ subdirectory was a relic of the Java/Go coexistence period.
Phase 6 cutover (#132) deleted the Java side a month ago, leaving the
Go module stranded one level deep. That cost the project a clean
`go install` story: users had to type
`github.com/randomcodespace/codeiq/go/cmd/codeiq@v0.3.x` and pseudo-
version resolution kicked in because there were no `go/vX.Y.Z` tags.

This commit moves the module to the repo root so:

- `go install github.com/randomcodespace/codeiq/cmd/codeiq@v0.3.x`
  resolves directly to the matching `vX.Y.Z` tag (no `/go/` suffix,
  no separate tag namespace).
- `cd codeiq && go build ./cmd/codeiq` Just Works.
- Standard Go project layout — what every contributor expects.

### What moved

- `go/cmd/`        → `cmd/`
- `go/internal/`   → `internal/`
- `go/testdata/`   → `testdata/`
- `go/parity/`     → `parity/`
- `go/go.mod`      → `go.mod`            (module path drops `/go`)
- `go/go.sum`      → `go.sum`
- `go/.gitignore`  → merged into root `.gitignore`

`git mv` was used for every tracked path so `git log --follow` history
survives the rename.

### Mechanical rewrites

- 320 Go files: import path `github.com/randomcodespace/codeiq/go/...`
  → `github.com/randomcodespace/codeiq/...`
- 5 CI workflows: dropped `working-directory: go`,
  `cache-dependency-path: go/go.sum`, `cd go &&` wrappers, and the
  `go/cmd go/internal` jscpd target prefix.
- `.goreleaser.yml`: dropped `dir: go` from each build, removed
  `cd go &&` from the `before:` hooks, updated all `-X
  …/go/internal/buildinfo.*` ldflags to the new path.
- `.github/dependabot.yml`: `directory: "/go"` → `directory: "/"`.
- README: replaced `cd codeiq/go` with `cd codeiq`; added an explicit
  `go install` example targeting the now-root-level path.
- CLAUDE.md, PROJECT_SUMMARY.md, AGENTS.md: directory map +
  module-path callouts updated.

### Tests + verification

- `CGO_ENABLED=1 go build ./...` — clean.
- `CGO_ENABLED=1 go test ./... -count=1` — full suite passes,
  0 FAIL across 41 test-bearing packages.
- Smoke on `testdata/fixture-minimal`:
  - `index` exits 0 (5 files / 44 nodes / 24 edges).
  - `enrich` exits 0 (45 nodes / 68 edges / 1 service / FTS indexed).

Historical `docs/superpowers/plans/*.md` keep their original
`go/internal/...` references — those are point-in-time snapshots,
not living docs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@aksOps aksOps merged commit 24fef39 into main May 14, 2026
13 checks passed
@aksOps aksOps deleted the refactor/hoist-go-to-root branch May 14, 2026 06:22
aksOps added a commit that referenced this pull request May 14, 2026
Move the contents of [Unreleased] under a new [v0.4.0] - 2026-05-14
heading. Repopulate [Unreleased] with the three post-v0.4.0 items
already on main: #163 (pflag bump), #164 (harden-runner bump), #165
(release-darwin race fix).

Add a header note explaining the release-history reset: deleting the
pre-v0.4.0 tags from GitHub does not delete them from proxy.golang.org;
every reused tag name would serve the old (often Python-era) content.
v0.4.0 is the first never-previously-used version.

Two factual additions to v0.4.0:
  * PR #162 (module hoist) — was missing from the original Changed
    block when the section was still labelled [Unreleased].
  * PR #161 (BuildInfo fallback) — moved into a dedicated Added bullet
    so `go install` users know their binaries self-identify now.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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