Resolve selected lazy modules by exact native cache identity
Private module tooling / contract (pull_request) Failing after 5s

Authored-By: Codex (GPT-6) <noreply@openai.com>
This commit is contained in:
Evelyn Chen
2026-09-07 14:55:37 +00:00
parent e75412e6d4
commit 52c9456208
2 changed files with 33 additions and 7 deletions
+14
View File
@@ -164,3 +164,17 @@ func TestCanonicalModuleArtifactPathBinding(t *testing.T) {
}
}
}
func TestLazyGraphModuleCacheIdentity(t *testing.T) {
cache := t.TempDir()
path, version := "code.fritzlab.net/fixture/module", "v0.1.0"
stem, err := cacheStem(cache, path, version, "")
if err != nil || stem != path+"/@v/"+version {
t.Fatalf("selected lazy module rejected: %q %v", stem, err)
}
for _, metadata := range []string{filepath.Join(cache, "foreign/@v/v0.1.0.mod"), filepath.Join(cache, "../escaped.mod"), filepath.Join(cache, path, "@v/v0.2.0.mod")} {
if _, err := cacheStem(cache, path, version, metadata); err == nil {
t.Fatal("contradictory cache identity accepted")
}
}
}