[PR #1823] [MERGED] fix(artifacts): mark Windows host executables by extension #4839

Closed
opened 2026-10-31 00:55:45 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1823
Author: @kaoru0822-kitauji
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/windows-host-executable-marking


📝 Commits (1)

  • 298d9aa fix(artifacts): mark Windows host executables by extension

📊 Changes

4 files changed (+62 additions, -2 deletions)

View changed files

📝 src/artifacts/DirectoryArtifactReader.ts (+2 -1)
➕ src/artifacts/hostExecutableMarking.test.ts (+36 -0)
➕ src/artifacts/hostExecutableMarking.ts (+22 -0)
📝 src/artifacts/inventory/scanCanonical.ts (+2 -1)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1823 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/windows-host-executable-marking` --- ### 📝 Commits (1) - [`298d9aa`](https://github.com/morluto/rea/commit/298d9aa330a46be08d3559d664a3da1543bcbcd8) fix(artifacts): mark Windows host executables by extension ### 📊 Changes **4 files changed** (+62 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/DirectoryArtifactReader.ts` (+2 -1) ➕ `src/artifacts/hostExecutableMarking.test.ts` (+36 -0) ➕ `src/artifacts/hostExecutableMarking.ts` (+22 -0) 📝 `src/artifacts/inventory/scanCanonical.ts` (+2 -1) </details> ### 📄 Description ## 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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:55:45 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4839
No description provided.