fix(exam): cross-platform fallback for the labelling/replay harness - #15
Open
Munawarx wants to merge 1 commit into
Open
fix(exam): cross-platform fallback for the labelling/replay harness#15Munawarx wants to merge 1 commit into
Munawarx wants to merge 1 commit into
Conversation
label-corpus.js hard-threw on non-Linux ('race-safe exam I/O requires Linux').
Add a best-effort cross-platform path (still rejects symlink components, not
race-safe) so contributors on macOS/Windows can run/develop the harness
locally. The Linux /proc/self/fd + O_NOFOLLOW race-safe path is unchanged and
remains the authoritative release-gating run (CI stays ubuntu-latest).
Documents the caveat in docs/REPLAY.md. Extends PR Nazim22#6 (Linux-only docs).
Verified openAnchoredDirectory no longer throws on win32. No router/contract
changes.
Co-Authored-By: Hermes Agent <noreply@hermes.ai>
Contributor
Author
|
Tracking our current contribution set for Leadline (Munawarx). All are independent, each on its own branch:
Each PR is self-contained and ready to review independently. Happy to split, adjust, or rebase any of them. Co-Authored-By: Hermes Agent noreply@hermes.ai |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/label-corpus.jshard-threw on non-Linux hosts (race-safe exam I/O requires Linux /proc/self/fd and O_NOFOLLOW), blocking contributors on macOS/Windows from running or developing the exam/replay harness locally. This adds a best-effort cross-platform fallback that preserves symlink-component rejection (not race-safe) so the harness runs off-Linux for development, while the Linux race-safe path is unchanged and remains the authoritative release-gating run.Changes
scripts/label-corpus.js:openAnchoredDirectorybranches on platform — Linux keeps the/proc/self/fd+O_NOFOLLOWrace-safe path; other platforms usepath.resolve+statSyncsymlink checks (returning a marker soreadRegularNoFollow/writePrivateuse normal paths and skip fd closes).docs/REPLAY.md: add a Platform support section stating Linux is authoritative, off-Linux is best-effort dev-only.Why
Verification
node -e "require('./scripts/label-corpus.js').openAnchoredDirectory(process.cwd())"→ no longer throws onwin32(returns{__crossPlatformDir: ...}).ubuntu-latestso the gating exam is unaffected.Trade-offs
Files
scripts/label-corpus.jsdocs/REPLAY.mdCo-Authored-By: Hermes Agent noreply@hermes.ai