Skip to content

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

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
fix/windows-host-executable-marking
Oct 11, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
fix/windows-host-executable-marking

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1819.

On Windows, inspect-artifact, MCP inspect_artifact, and compare_artifacts reported executable: false for every host file. That included genuine PE .exe images, so an occurrence could carry artifact_kind: executable, artifact_format: pe, and executable: false at the same time. Both host-file producers (DirectoryArtifactReader entries and the scanCanonical root occurrence) tested mode & 0o111. Node (through libuv) builds Windows file modes from the read-only attribute alone (0o666/0o444), so that test could never pass on Windows.

  • Added hostExecutableMarking(path, metadata, platform), which both producers now use.
  • On POSIX hosts the permission bits still decide, so behavior there is unchanged.
  • On Windows a regular file counts as executable when its extension is one that CreateProcess or cmd.exe launches directly (.exe, .com, .bat, .cmd). Directories and symlinks report false.
  • Archive-derived entries (ZIP/ASAR/XY) keep their stored permission metadata and are unaffected.

Validation

  • The new src/artifacts/hostExecutableMarking.test.ts covers the Windows branch. It runs on any host because the platform is passed in.
  • npm run test:focused passes on the artifact source, filesystem-boundary, native artifact provider, and artifact comparison suites: 48 files, 272 tests (macOS).
  • npm run check:fast passes.

Not verified on a real Windows host. The curated Windows CI lane is the first real-host coverage.

🤖 Generated with Claude Code

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 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T13:03:21.819237Z 298d9aa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kaoru0822-kitauji
kaoru0822-kitauji merged commit 91f843b into main Oct 11, 2026
31 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/windows-host-executable-marking branch October 11, 2026 13:26
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
morluto added a commit to dollarsmoney/rea that referenced this pull request Oct 11, 2026
Merge main and reuse its hostExecutableMarking helper from morluto#1823. Remove the duplicate helper and consolidate the additional Windows filename cases into the existing regression suite.

Validation: 20 focused artifact tests passed; npm run check passed; all 854 test files discovered exactly once. Windows-specific helper cases ran on macOS; no native Windows run.
@morluto morluto added bug Something isn't working area: evidence Evidence, artifacts, and reconstruction labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] inspect-artifact reports executable:false for every Windows host file, including real PE .exe images

2 participants