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
@@ -34,6 +34,7 @@ import {
artifactManifestId,
} from "../../domain/artifactIdentity.js";
import { classifyAndHashRootForInventory } from "./classify.js";
import { hostExecutableMarking } from "../hostExecutableMarking.js";
import type { HashResult } from "../ArtifactHash.js";
import {
hashStableRootArtifact,
@@ -211,7 +212,7 @@ const buildInventorySnapshot = async (
rekeyOccurrences(rootNode.artifact_id, input.occurrences);
const rootOccurrence = rootOccurrenceFor(rootNode, {
size: metadata.size,
executable: (metadata.mode & 0o111) !== 0,
executable: hostExecutableMarking(path, metadata),
format: rootFormat,
path,
});