Repository navigation
fix(core): enable Windows support with msvcrt file locking and POSIX tree keys (fixes #151) - #159
Open
Cyberpradeep wants to merge 1 commit into
Open
Cyberpradeep wants to merge 1 commit into
Cyberpradeep wants to merge 1 commit into
Conversation
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
This PR enables full Windows compatibility for Harness², resolving the startup$k \ge 2$ (#151).
fcntlimport failure and the silent tree-key rejection that causesStopIterationduring multi-candidate selection atAll changes are strictly isolated to Windows runtime paths; POSIX/Linux behavior is 100% unaffected.
Root Causes Addressed
POSIX
fcntlon Windows (harness2/core/schedule.py):_write_summaryimported POSIX-onlyfcntl.flockto atomically merge mode results intosummary.json. On Windows, this immediately crashed the test suite and CLI execution withModuleNotFoundError: No module named 'fcntl'._lock_summary(lf)and_unlock_summary(lf)branching onos.name == "nt"to use Python's standard librarymsvcrt.locking(lf.fileno(), ...)with an identical file descriptor locking contract.Backslash Tree Keys & False Stub Mismatch (
harness2/core/tree.py):On Windows,
Path.relative_to()produces backslash separators (e.g.'plugin\README.md','scripts\summarize.py').stubsand component regexes expect forward slashes (/),rel in stubsevaluated toFalse.rejected), causing the engine to fail every proposed harness and fall back to the unmodified base script.StopIteration.read_treeandwrite_treeusing the existingnormalize_rel()function, guaranteeing POSIX-compliant keys on all operating systems.Verification & Test Results
Tested on Windows 11 (Python 3.12.10, x64):
Unit Test Suite (
python -m unittest discover -v tests):FAILED (failures=4, errors=3)due toModuleNotFoundError: No module named 'fcntl'.Ran 5 tests in 54.71s — OK (Failures: 0, Errors: 0).Offline Deterministic Demo (
harness2-demo --k 2):0 tasks completed; 2 failedwithagg: StopIteration: ; seq: StopIteration:.2 tasks completed; 0 failed— all candidate harnesses successfully evolved, executed, and produced expected signed totals (Total: 85.15).Execution Logs & Tracebacks
Click to expand: Unpatched Unit Test Failures (fcntl crash)
Click to expand: Unpatched k=2 Root Cause & StopIteration Log
Click to expand: Post-Fix Test Suite Output (5/5 Passing)
Click to expand: Post-Fix Demo Output (k=2 Passes 2/2 Tasks)
Contributor License Agreement (CLA)