fix(artifacts): mark Windows host executables by extension (#1823)

Windows has no POSIX execute bit; Node reports file modes from the
read-only attribute alone, so every host file, including PE images,
reported `executable: false` while the same occurrence reported
`artifact_kind: executable`. Derive the host executable marking once:
POSIX permission bits stay authoritative, and Windows marks regular
files with the CreateProcess/cmd launchable extensions.

Fixes #1819

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-11 06:26:30 -07:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 76e4153d34
commit 91f843bf38
4 changed files with 62 additions and 2 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ import {
type ArtifactEntry,
type ArtifactReader,
} from "./ArtifactReader.js";
import { hostExecutableMarking } from "./hostExecutableMarking.js";
import { OwnedDirectoryHandle } from "../filesystem/OwnedDirectoryHandle.js";
import { OwnedFileHandle } from "../filesystem/OwnedFileHandle.js";
import { readFileHandleChunks } from "../filesystem/readFileHandleChunks.js";
@@ -270,7 +271,7 @@ const artifactEntry = (
kind,
declaredSize: kind === "file" ? metadata.size : null,
compressedSize: null,
executable: (metadata.mode & 0o111) !== 0,
executable: hostExecutableMarking(absolute, metadata),
encrypted: false,
byteOffset: null,
declaredSha256: null,