[PR #951] [MERGED] fix(artifacts): harden reader lifecycle boundaries #2529

Closed
opened 2026-10-17 21:07:12 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/951
Author: @morluto
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @morluto

Base: main ← Head: fix/artifact-reader-lifecycle


📝 Commits (5)

  • 0bf711f fix(artifacts): retain ASAR filesystem failure reasons
  • d103216 fix(artifacts): avoid blocking on replaced FIFO entries
  • bbed52b test(artifacts): type the ASAR reader iterator
  • fdf588b fix(artifacts): classify filesystem-shaped ASAR errors
  • c1898f4 test: account for POSIX FIFO fixture utility

📊 Changes

6 files changed (+147 additions, -9 deletions)

View changed files

📝 knip.json (+1 -0)
📝 src/artifacts/AsarArtifactReader.ts (+23 -8)
📝 src/artifacts/DirectoryArtifactReader.ts (+1 -1)
📝 tests/boundary/filesystem/asarInventoryFreshness.test.ts (+26 -0)
➕ tests/boundary/filesystem/directoryArtifactReaderFifoRace.test.ts (+53 -0)
➕ tests/fixtures/directoryReaderFifoProbe.mjs (+43 -0)

📄 Description

Summary

Directory-backed artifact opens now use O_NONBLOCK so replacing an enumerated regular file with a FIFO cannot stall the reader before its identity check rejects the changed entry. ASAR adapter errors retain filesystem failures such as ENOENT and EISDIR as io, while malformed archive data remains format.

Validation

  • Focused artifact boundary tests: 28 passed across ASAR freshness/containment, directory FIFO replacement, and JavaScript artifact identity.
  • npm run check:fast
  • npm run format:check
  • npm run build:cached

The FIFO regression runs the reader in a real owned subprocess and skips Windows, where the POSIX FIFO case does not apply. No external artifact provider is required.


🔄 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/951 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/artifact-reader-lifecycle` --- ### 📝 Commits (5) - [`0bf711f`](https://github.com/morluto/rea/commit/0bf711fb0ffee929d8c8d9a7b0932b73253a606e) fix(artifacts): retain ASAR filesystem failure reasons - [`d103216`](https://github.com/morluto/rea/commit/d1032162e4657a0896b9a8767f3993180c8f27f1) fix(artifacts): avoid blocking on replaced FIFO entries - [`bbed52b`](https://github.com/morluto/rea/commit/bbed52b7b07e8ea466023e7e8c46f6b275975897) test(artifacts): type the ASAR reader iterator - [`fdf588b`](https://github.com/morluto/rea/commit/fdf588bb9b5e203a4ae01162f7341bb18e80d30a) fix(artifacts): classify filesystem-shaped ASAR errors - [`c1898f4`](https://github.com/morluto/rea/commit/c1898f455b1ca57c1e5db8798f3a83d831a44943) test: account for POSIX FIFO fixture utility ### 📊 Changes **6 files changed** (+147 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `knip.json` (+1 -0) 📝 `src/artifacts/AsarArtifactReader.ts` (+23 -8) 📝 `src/artifacts/DirectoryArtifactReader.ts` (+1 -1) 📝 `tests/boundary/filesystem/asarInventoryFreshness.test.ts` (+26 -0) ➕ `tests/boundary/filesystem/directoryArtifactReaderFifoRace.test.ts` (+53 -0) ➕ `tests/fixtures/directoryReaderFifoProbe.mjs` (+43 -0) </details> ### 📄 Description ## Summary Directory-backed artifact opens now use `O_NONBLOCK` so replacing an enumerated regular file with a FIFO cannot stall the reader before its identity check rejects the changed entry. ASAR adapter errors retain filesystem failures such as `ENOENT` and `EISDIR` as `io`, while malformed archive data remains `format`. ## Validation - Focused artifact boundary tests: 28 passed across ASAR freshness/containment, directory FIFO replacement, and JavaScript artifact identity. - `npm run check:fast` - `npm run format:check` - `npm run build:cached` The FIFO regression runs the reader in a real owned subprocess and skips Windows, where the POSIX FIFO case does not apply. No external artifact provider is required. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:07:12 +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#2529
No description provided.