Skip to content

fix(mod): declare /v2 module path for Go SIV#69

Merged
autholykos merged 1 commit intomainfrom
fix/module-path-v2-siv
Apr 18, 2026
Merged

fix(mod): declare /v2 module path for Go SIV#69
autholykos merged 1 commit intomainfrom
fix/module-path-v2-siv

Conversation

@autholykos
Copy link
Copy Markdown
Member

Blocker

Go's Semantic Import Versioning (mandatory since Go 1.11 for modules with a go.mod) requires the module path for v2+ to carry a /v2 suffix. We tagged v2.0.0 at commit a375e69 with module github.com/dusk-network/stroma — no suffix. The Go proxy rejects it:

$ curl -s https://sum.golang.org/lookup/github.com/dusk-network/stroma@v2.0.0
not found: github.com/dusk-network/stroma@v2.0.0: invalid version:
  module contains a go.mod file, so module path must match major version
  ("github.com/dusk-network/stroma/v2")

So v2.0.0 is currently unconsumable by any Go toolchain. Consumer repos (Hippocampus, Pituitary) cannot go get it at all.

Fix

  • go.mod: module github.com/dusk-network/stroma…/v2
  • Rewrite every internal import of github.com/dusk-network/stroma/X.../v2/X (11 .go files, 31 import sites across chunk, index)

Pure mechanical rewrite — no behavior change.

Retag plan

After this lands, v2.0.0 will be retagged in place at the post-fix HEAD. Retagging is safe because proxy.golang.org never cached the broken tag:

$ curl -sI https://proxy.golang.org/github.com/dusk-network/stroma/@v/v2.0.0.info
HTTP/2 404
$ curl -sI https://proxy.golang.org/github.com/dusk-network/stroma/v2/@v/v2.0.0.info
HTTP/2 404

SIV rejected the proxy fetch before any checksum could be cached, so no downstream consumer has a frozen hash to collide with.

Test plan

  • go build ./... clean
  • go vet ./... clean
  • gofmt -l . empty
  • go test ./... — all five packages pass under the new module path
  • CI analyzers + go + macos jobs green
  • After merge: delete existing v2.0.0 tag + GitHub release, retag v2.0.0 at new HEAD, recreate release with same notes, sanity-check go get github.com/dusk-network/stroma/v2@v2.0.0 from a scratch dir

Go SIV (mandatory since go 1.11 for modules with a go.mod) requires
the module path for v2+ to carry a /v2 suffix; without it, the Go
proxy rejects the module with:

    invalid version: module contains a go.mod file, so module path
    must match major version ("github.com/dusk-network/stroma/v2")

This is exactly what sum.golang.org returned when v2.0.0 was
published at the non-/v2 path, so v2.0.0 is unconsumable by any
Go toolchain — the broken tag was never cached by proxy.golang.org
either (SIV rejected the fetch before caching).

Fix:
- go.mod: module github.com/dusk-network/stroma -> /v2
- rewrite every internal import of github.com/dusk-network/stroma/X
  -> github.com/dusk-network/stroma/v2/X (11 .go files, 31 sites)

Verification:
- go build ./... clean
- go vet ./... clean
- gofmt -l . empty
- go test ./... all packages pass under the new module path

After this lands, v2.0.0 will be retagged in place at the post-fix
HEAD. Retagging is safe because proxy.golang.org never cached the
broken tag (confirmed via HEAD against both /@v/v2.0.0.info and
/v2/@v/v2.0.0.info — both 404).
Copilot AI review requested due to automatic review settings April 18, 2026 15:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the repository to comply with Go Semantic Import Versioning for v2+ so that v2.0.0 is consumable via the Go module proxy and standard go tooling.

Changes:

  • Change module path in go.mod to github.com/dusk-network/stroma/v2.
  • Rewrite internal imports across chunk and index packages (including tests/benchmarks) to use the /v2-suffixed module path.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
go.mod Declares the /v2 module path required for SIV.
chunk/policy.go Updates corpus import to /v2 path.
chunk/policy_test.go Updates corpus import to /v2 path.
index/index.go Updates internal imports (chunk, corpus, embed, store) to /v2.
index/snapshot.go Updates internal imports (corpus, store) to /v2.
index/reuse.go Updates internal imports (chunk, corpus, store) to /v2.
index/context_test.go Updates internal imports (corpus, embed, store) to /v2.
index/fusion_test.go Updates internal imports (corpus, embed, store) to /v2.
index/index_test.go Updates internal imports (chunk, corpus, embed, store) to /v2.
index/policy_test.go Updates internal imports (chunk, corpus, embed, store) to /v2.
index/reuse_bench_test.go Updates internal imports (corpus, embed, store) to /v2.
index/reuse_scan_test.go Updates internal imports (corpus, embed, store) to /v2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@autholykos autholykos merged commit 0c6a6a9 into main Apr 18, 2026
8 checks passed
@autholykos autholykos deleted the fix/module-path-v2-siv branch April 18, 2026 15:09
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.

2 participants