test: guard the remaining CLI tests behind HAS_SAFE_INPUT_OPEN - #38
Open
SurefireStudios wants to merge 1 commit into
Open
SurefireStudios wants to merge 1 commit into
SurefireStudios wants to merge 1 commit into
Conversation
validate-findings.test.cjs already defines HAS_SAFE_INPUT_OPEN and gates five tests on it, but seven other tests that also drive the CLI were left ungated. On a platform where fs.constants.O_NOFOLLOW and O_NONBLOCK are undefined -- win32 -- readFileWithinLimit throws "OS no-follow and nonblocking input protection is unavailable" before any assertion runs, so those seven report as failures rather than skips. validate-coverage-ledger.test.cjs defines the identical constant and applies it to every CLI test, so it reports 0 failures on the same machine. This brings the findings suite in line with it. Before: 34 tests, 22 pass, 7 fail, 5 skip. After: 34 tests, 22 pass, 0 fail, 12 skip. The guard is false wherever the constants exist, so the tests run unchanged on Linux and macOS and no coverage is lost.
rajpratham1
approved these changes
Sep 18, 2026
rajpratham1
left a comment
There was a problem hiding this comment.
I analyze it okk and perfect it need to approve
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.
What happens
On Windows,
node validate-findings.test.cjsreports 7 failures:Every one fails the same way — the assertion never runs:
fs.constants.O_NOFOLLOWandO_NONBLOCKareundefinedon win32, soreadFileWithinLimitthrows itsSafeInputErrorbefore the test gets to the behaviour it is checking.Why it is an oversight rather than a design choice
The file already has the guard, and already uses it —
HAS_SAFE_INPUT_OPENis defined at line 18 and applied to five tests. These seven were simply left without it.validate-coverage-ledger.test.cjsdefines the byte-identical constant and applies it to every CLI test, which is why it reportspass 24, fail 0on the same machine. This change brings the findings suite in line with its sibling — same constant, same spelling, nothing new introduced.The docs also treat non-POSIX as in scope:
SKILL.mdguards agent IDs against Windows device names (con,prn,aux,nul,com1–com9,lpt1–lpt9), and step 9 says to "use equivalent race-safe APIs on non-POSIX systems".The change
Seven lines, all the same edit:
After:
34 tests, 22 pass, 0 fail, 12 skip.I left
does not reflect controls from a failed CLI input pathalone — it mentions the CLI but never opens a file successfully, and it passes on win32, so gating it would skip a test that works.No coverage lost where the constants exist
The guard is false on POSIX, so all seven run exactly as before:
Two things I noticed but did not touch
The validators themselves still cannot run on win32. This PR only fixes the test suite reporting failures;
validate-findings.cjsandvalidate-coverage-ledger.cjsboth refuse the CLI path there. Refusing to read input without symlink and non-blocking protection looks deliberate for a security tool, so I have not touched it — but if Windows is meant to be supported, that is the real gap, andSKILL.mdstep 9 hints at wanting an equivalent. Happy to open a separate issue if useful.There is no
.github/workflows. Nothing runs these suites automatically, which is plausibly why this went unseen — anyone developing on Linux or macOS sees a green run. Glad to propose a minimal workflow separately if you want one; I did not want to bundle it here.