Backtestshugorun-20260917-015623#15116

Issue #15116 Merged fix PR # Run 17 Sep 2026 · run-20260917-015623 gohugoio/hugo

common/hugo: Include aom, dav1d, and libavif in commands/env output

Worse

The merged fix was judged better than our patch.

In this judgment, Patch A = our agent, Patch B = the merged fix.

Both patches resolve the reported symptom (aom/dav1d/libavif now appear in `hugo env`), but B fixes it closer to the root cause. B defines each version as a constant in the very file that embeds the corresponding WASM (avif.go, webp.go, katex.go) with explicit 'Keep in sync with genavif/Makefile' / 'js/package.json' comments, then exposes them via warpc.GetWASMDeps(). That creates a single source of truth anchored to where the versions actually originate — directly addressing the drift risk the reporter flagged ('assuming I have the correct source strings') and the existing 'TODO(bep) get versions from the plugin setup' intent. B is also more complete: it surfaces KaTeX, a genuine bundled WASM dep that the same code path was omitting. A instead adds three more hardcoded magic strings in common/hugo/hugo.go, far from the build sources, perpetuating exactly the pattern the TODO wants gone. On tests, A is stricter (asserts exact version strings, would fail-before/pass-after with precision), while B asserts only module-path presence plus GOOS/GOVERSION/KaTeX — a real but modest edge for A. On scope, A is minimal and clean, whereas B carries unjustified incidental churn (reformatting WithImportResolver, inputBlobs/inputJSON, and the dart-sass append call), which counts against it. Weighing correctness and craft (B's centralized, source-anchored, more complete design) above A's tighter test and smaller footprint, B is the better fix; the churn and looser assertions are not enough to overcome B's structural advantage.

The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.

Solve

9m 39s3 turns

Wall-clock time in the container

Full test suite

No new failures

3,675 passed · 94 skipped · 3,782 total

Contamination audit

Unknown

See the audit notes for this run

Patch size

11vs 51 merged

Changed lines, ours vs merged

Currently, the hugo env command prints:

hugo v0.164.0-ce2470e7012b5ab5fc4e10ebe4027e9f8d9e00dc+withdeploy linux/amd64 BuildDate=2026-07-06T16:39:30Z VendorInfo=gohugoio
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.26.3"
github.com/webmproject/libwebp="v1.6.0"
github.com/sass/dart-sass/protocol="3.2.0"
github.com/sass/dart-sass/compiler="1.101.0"
github.com/sass/dart-sass/implementation="1.101.0"

I think it would make sense to also list...

aomedia.googlesource.com/aom="v3.14.1"
code.videolan.org/videolan/dav1d="1.5.3"
github.com/AOMediaCodec/libavif="v.14.1"

...assuming I have the correct source strings.

See:

<https://github.com/gohugoio/hugo/blob/a198116669fdfba2eeda4f1d63c055001a10142f/common/hugo/hugo.go#L213-L214>.

The two patches

Our patch+10 −1
common/hugo/hugo.goindex 28f8b9393..017a39098 100644@@ -211,7 +211,12 @@ func GetDependencyList() []string {  // GetDependencyListNonGo returns a list of non-Go dependencies. func GetDependencyListNonGo() []string {-	deps := []string{formatDep("github.com/webmproject/libwebp", "v1.6.0")} // via WASM. TODO(bep) get versions from the plugin setup.+	deps := []string{+		formatDep("github.com/webmproject/libwebp", "v1.6.0"), // via WASM. TODO(bep) get versions from the plugin setup.+		formatDep("aomedia.googlesource.com/aom", "v3.14.1"),+		formatDep("code.videolan.org/videolan/dav1d", "1.5.3"),+		formatDep("github.com/AOMediaCodec/libavif", "v1.4.1"),+	}  	if IsExtended { 		deps = append(testscripts/commands/env.txtindex 742e05ffc..80ebd03b0 100644@@ -2,4 +2,8 @@  hugo env stdout 'GOARCH'+stdout 'aomedia\.googlesource\.com/aom="v3\.14\.1"'+stdout 'code\.videolan\.org/videolan/dav1d="1\.5\.3"'+stdout 'github\.com/AOMediaCodec/libavif="v1\.4\.1"'+stdout 'github\.com/webmproject/libwebp="v1\.6\.0"' ! stderr .\ No newline at end of file 
Merged fix · PR #+45 −6
common/hugo/hugo.goindex 28f8b9393..ac490a84b 100644@@ -33,6 +33,7 @@ import ( 	"github.com/gohugoio/hugo/common/loggers" 	"github.com/gohugoio/hugo/common/version" 	"github.com/gohugoio/hugo/hugofs/files"+	"github.com/gohugoio/hugo/internal/warpc"  	"github.com/spf13/afero" @@ -211,7 +212,10 @@ func GetDependencyList() []string {  // GetDependencyListNonGo returns a list of non-Go dependencies. func GetDependencyListNonGo() []string {-	deps := []string{formatDep("github.com/webmproject/libwebp", "v1.6.0")} // via WASM. TODO(bep) get versions from the plugin setup.+	var deps []string+	for _, dep := range warpc.GetWASMDeps() {+		deps = append(deps, formatDep(dep[0], dep[1]))+	}  	if IsExtended { 		deps = append(@@ -225,7 +229,8 @@ func GetDependencyListNonGo() []string { 		if IsDartSassGeV2() { 			dartSassPath = "github.com/sass/dart-sass" 		}-		deps = append(deps,+		deps = append(+			deps, 			formatDep(dartSassPath+"/protocol", dartSass.ProtocolVersion), 			formatDep(dartSassPath+"/compiler", dartSass.CompilerVersion), 			formatDep(dartSassPath+"/implementation", dartSass.ImplementationVersion),internal/warpc/avif.goindex baadaadd7..f080b87b1 100644@@ -25,6 +25,13 @@ import ( 	"github.com/gohugoio/hugo/common/hugio" ) +// Keep in sync with genavif/Makefile.+const (+	libavifVersion = "v1.4.1"+	aomVersion     = "v3.14.1"+	dav1dVersion   = "1.5.3"+)+ var ( 	_ SourceProvider      = AvifInput{} 	_ DestinationProvider = AvifInput{}internal/warpc/katex.goindex 75c20117f..627f18e3a 100644@@ -17,6 +17,9 @@ import ( 	_ "embed" ) +// Keep in sync with js/package.json.+const katexVersion = "0.16.21"+ //go:embed wasm/renderkatex.wasm var katexWasm []byte internal/warpc/warpc.goindex b7763e782..be8e48bb5 100644@@ -48,6 +48,17 @@ const (  const currentVersion = 1 +// GetWASMDeps returns version information for the C libraries bundled as WASM.+func GetWASMDeps() [][2]string {+	return [][2]string{+		{"aomedia.googlesource.com/aom", aomVersion},+		{"code.videolan.org/videolan/dav1d", dav1dVersion},+		{"github.com/AOMediaCodec/libavif", libavifVersion},+		{"github.com/KaTeX/KaTeX", katexVersion},+		{"github.com/webmproject/libwebp", libwebpVersion},+	}+}+ //go:embed wasm/quickjs.wasm var quickjsWasm []byte @@ -348,7 +359,8 @@ func (d *dispatcher[Q, R]) inputBlobs() error { 					call.done() 				} 				return nil-			}); err != nil {+			},+		); err != nil { 			inputErr = err 			break 		}@@ -384,7 +396,8 @@ func (d *dispatcher[Q, R]) inputJSON() error { 					call.done() 				} 				return nil-			}); err != nil {+			},+		); err != nil { 			inputErr = err 			break 		}@@ -679,7 +692,8 @@ func newDispatcher[Q, R any](opts Options) (*dispatcherPool[Q, R], error) { 					if err != nil { 						return toErr("quickjs", errBuff, err) 					}-					ctx = experimental.WithImportResolver(ctx,+					ctx = experimental.WithImportResolver(+						ctx, 						func(name string) api.Module { 							if name == opts.Runtime.Name { 								return runtimeInstanceinternal/warpc/webp.goindex 35ee98899..2c2be0bd4 100644@@ -28,6 +28,9 @@ import ( 	"github.com/gohugoio/hugo/common/hugio" ) +// Keep in sync with genwebp/Makefile.+const libwebpVersion = "v1.6.0"+ var ( 	_ SourceProvider      = WebpInput{} 	_ DestinationProvider = WebpInput{}testscripts/commands/env.txtindex 742e05ffc..1ae628c6c 100644@@ -1,5 +1,12 @@ # Test the hugo env command.  hugo env+stdout 'GOOS' stdout 'GOARCH'-! stderr .\ No newline at end of file+stdout 'GOVERSION'+stdout 'aomedia\.googlesource\.com/aom'+stdout 'code\.videolan\.org/videolan/dav1d'+stdout 'github\.com/AOMediaCodec/libavif'+stdout 'github\.com/KaTeX/KaTeX'+stdout 'github\.com/webmproject/libwebp'+! stderr . 

What the agent reported

Summary

What was wrong: The hugo env command listed only libwebp among the bundled non-Go (WASM) libraries. Hugo also bundles the AVIF stack — aom, dav1d, and libavif — via its WASM AVIF plugin, but those were not reported in GetDependencyListNonGo(), so they never appeared in hugo env output.

What I changed (uncommitted, in the working tree):

  1. common/hugo/hugo.go — added three unconditional entries to GetDependencyListNonGo() alongside libwebp, using the existing formatDep helper:
  2. aomedia.googlesource.com/aom="v3.14.1"
  3. code.videolan.org/videolan/dav1d="1.5.3"
  4. github.com/AOMediaCodec/libavif="v1.4.1"

The IsExtended (libsass) and dart-sass blocks were left untouched.

  1. testscripts/commands/env.txt — added regexp-escaped stdout assertions verifying all four bundled deps (the three new ones plus libwebp) appear in hugo env output; existing GOARCH and ! stderr . assertions preserved.

Version-string correction: The ticket guessed libavif v.14.1, but the authoritative value in internal/warpc/genavif/Makefile (the source of truth, per the existing TODO(bep) in the code) is v1.4.1. aom (v3.14.1) and dav1d (1.5.3) matched the ticket's guesses. I used the Makefile values.

Test evidence:

  • Before the fix: the new regression assertions in env.txt failed — hugo env printed only the libwebp line (no match for aomedia\.googlesource\.com/aom...).
  • After the fix: TestCommands/env passes; 3682 tests pass overall.
  • 13 other tests failed (codegen, internal/warpc WASM, go_templates file/glob parsing, resources/images golden tests). I verified these are pre-existing, environment-dependent failures unrelated to this change: stashing my two edits and re-running those exact packages on the clean baseline produced the identical 13 failures. My change (adding strings to a dependency list) cannot affect them.

The reviewer confirmed the paths, versions, helper usage, placement, and test assertions are all correct, and the diff is scoped to only the two intended files (the AGENTS.md/CLAUDE.md deletions were pre-existing and unrelated).