fix(artifacts): prefer artifact magic over implicit database suffix

This commit is contained in:
64579525
2026-10-12 22:41:12 +08:00
parent a60d60dc6b
commit 681f34879e
4 changed files with 50 additions and 26 deletions
+8 -7
View File
@@ -157,9 +157,16 @@ export const parseBinaryTarget = async (
availableArchitectures: ["x86"],
});
}
// Explicit database selection owns routing; a suffix is only a fallback.
const artifactFormat =
targetKind === "database"
? undefined
: await detectArtifactFormat(path, handle, metadata, signal);
if (
targetKind === "database" ||
(targetKind === undefined && path.toLowerCase().endsWith(".hop"))
(targetKind === undefined &&
artifactFormat === undefined &&
path.toLowerCase().endsWith(".hop"))
)
return ok({
path,
@@ -168,12 +175,6 @@ export const parseBinaryTarget = async (
kind: "database",
format: "analysis-database",
});
const artifactFormat = await detectArtifactFormat(
path,
handle,
metadata,
signal,
);
if (artifactFormat !== undefined) {
const identity = {
path,