{"record":{"id":"7b7993c03fba6c75","repo":"vxcontrol/pentagi","slug":"w-sources-q-and-q-share-the-same-base-name-q","errorCode":null,"errorMessage":"%w: sources %q and %q share the same base name %q","messagePattern":"%w: sources %q and %q share the same base name %q","errorType":"http","errorClass":null,"httpStatus":409,"severity":"error","filePath":"backend/pkg/server/services/resources.go","lineNumber":711,"sourceCode":"\n\t// Verify every source exists.\n\tif len(srcs) != len(srcPaths) {\n\t\ttx.Rollback()\n\t\tfound := resourcesByPath(srcs)\n\t\tfor _, sp := range srcPaths {\n\t\t\tif _, ok := found[sp]; !ok {\n\t\t\t\treturn result, fmt.Errorf(\"%w: resource %q not found\", errResourceNotFound, sp)\n\t\t\t}\n\t\t}\n\t}\n\n\t// ── Within-batch target-basename conflict check ───────────────────────────\n\t// Two sources sharing a basename would both land at the same target path.\n\tbasenameToSrc := make(map[string]string, len(srcs))\n\tfor _, src := range srcs {\n\t\tif prev, conflict := basenameToSrc[src.Name]; conflict {\n\t\t\ttx.Rollback()\n\t\t\treturn result, fmt.Errorf(\n\t\t\t\t\"%w: sources %q and %q share the same base name %q\",\n\t\t\t\terrResourceConflict, prev, src.Path, src.Name,\n\t\t\t)\n\t\t}\n\t\tbasenameToSrc[src.Name] = src.Path\n\t}\n\n\t// Self-move guard: no source may be a directory that contains dstPath.\n\tfor _, src := range srcs {\n\t\tif src.IsDir && resources.PathHasPrefix(dstPath, src.Path) {\n\t\t\ttx.Rollback()\n\t\t\treturn result, fmt.Errorf(\n\t\t\t\t\"%w: cannot move directory %q into itself\", errResourceInvalid, src.Path,\n\t\t\t)\n\t\t}\n\t\tif resources.FilePath(dstPath, src.Name) == src.Path {\n\t\t\ttx.Rollback()\n\t\t\treturn result, fmt.Errorf(","sourceCodeStart":693,"sourceCodeEnd":729,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/server/services/resources.go#L693-L729","documentation":"Error \"%w: sources %q and %q share the same base name %q\" thrown in vxcontrol/pentagi.","triggerScenarios":"Thrown at backend/pkg/server/services/resources.go:711 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}