Repository navigation
Add CI tests for macOS and Windows with sensor FIN probe - #191
Merged
Merged
Conversation
aaas72
marked this pull request as draft
November 22, 2026 14:34
- skill packs: remove read-only git objects (rmtree silently left the checkout behind on Windows) and name a pack from a local Windows path - .gitattributes: byte-hashed evaluation evidence and corpus stay LF - tests: OS-limited skips with reasons; Windows taskkill branch tested Refs secfoo-com#113
| try: | ||
| os.chmod(target, stat.S_IWRITE) | ||
| func(target) | ||
| except OSError: |
- transport: read the control channel before a write too, so a batch is never written into a socket the sensor already closed, and a FIN that arrives right after a batch the sensor did read no longer marks that batch dropped (that race failed test_sensor_dying_mid_run on py3.10) - adversarial_eval.corpus_digest: WindowsPath sorts case-insensitively, which reordered files and changed the digest on Windows Refs secfoo-com#113
aaas72
marked this pull request as ready for review
November 22, 2026 15:18
Leaderboard update
aaas72 now has 28 points (rank #2, Bronze). 22 more to reach Silver. |
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.
Closes #113
All four jobs are green: Ubuntu py3.10 and py3.12,
macos-15py3.12 andwindows-latestpy3.12. Test, runtime probe conformance, skills validation and the coverage floor all run as blocking steps on every OS. Nothing has|| trueexcept the existing non-blocking ruff step (#114).CI
macos-15, notmacos-14: GitHub has retired themacos-14image, and the job failed with "The configuration 'macos-14-arm64-us-default' is not supported".Test (py3.10),Test (py3.12)). The others add their OS, e.g.Test (py3.12, windows-latest).shell: bashon every OS, because the coverage summary step uses bash redirection.PYTHONIOENCODING=utf-8andPYTHONUTF8=1are set so box-drawing output can't hit a cp1252 console.secfoo sensor conformancepasses on all three.The macOS sensor failure: fixed in the probe, not the test
SocketTransport._read_control()treatedrecv() == b""as "nothing to read". That is the sensor's FIN, so after the sensor closed the connection the probe kept writing into a half-closed socket.EPIPE, whichsend()already handles.Trueand the probe never noticed the sensor was gone.Fix in
sensor/transport.py: an EOF on the control channel closes the connection. The probe also reads the control channel before each write, not only after. So a FIN that has already arrived means the next batch goes to a fresh connection instead of the dead one, and if the sensor is gone that connection fails fast. One existing test changes expectation:test_the_probe_reconnects_after_a_live_sensor_diesused to requiredropped >= 1, because the first write after EOF was always lost. It now assertsdropped == 0.An earlier version of this fix also marked a batch as dropped when a FIN arrived right after the write. That races with a sensor that reads the batch and then closes, and it failed the py3.10 job once. The version here doesn't do that.
What else broke on Windows
secfoo skills removeleft the whole pack behindskills/packs.pyrmtree(ignore_errors=True)silently skipped them on Windows. New_remove_treemakes a file writable and retries. It is used byremove_packand by the clean-up after a failed install.--namefailed ingit cloneskills/packs.pydefault_pack_namesplit only on/and:, soC:\\...\\acme\\appsec-skillsbecame one very long name. It now splits on\\too, givingacme-appsec-skills.scripts/adversarial_eval.pysorted(Path)ignores case on Windows, soCLAUDE.md.fixtureandREADME.mdchanged places. It now sorts by case-sensitive path parts, the same order as on POSIX, so existing digests stay valid..gitattributescore.autocrlfcheckout rewrote line endings.docs/evaluations/** -textandtests/fixtures/adversarial/** -text, asfuzz/corpus/**already had.tests/test_property_fuzz_targets.pyThe items the issue suspected (
_normalize_path, temp clone cleanup intargets/,_kill_process_tree,Path.as_uri()in SARIF) all pass on Windows as they are, so they are not changed here.skipifmarkers added (Windows only)test_adversarial_eval.py::test_source_boundaries_preserve_lines_and_quote_filenamestest_cloud.py::test_save_cloud_config_sets_restrictive_permissionstest_store_privacy.pyandtest_mcp.pyalready use)test_review_hardening.py::test_claude_capture_preserves_production_grants_and_records_stream#!script, which Windows cannot execute directlytest_port_guard.py::test_stop_gracefully_succeeds_after_sigterm,test_stop_gracefully_falls_back_to_sigkill_when_sigterm_is_ignoredtaskkill, not signals. A new test,test_stop_gracefully_uses_taskkill_on_windows, covers that branch on every OS.In
test_memory.pyonly the0o600assertion is skipped on Windows. The rest of those two tests still runs.Testing
default_pack_nameon Windows paths, and_remove_treewith read-only files.