Skip to content

fix: harness correctness, ruff + CI, regenerated results - #7

Merged
euisuh merged 1 commit into
mainfrom
night/harness-fixes-ci
Oct 29, 2026
Merged

euisuh merged 1 commit into
mainfrom
night/harness-fixes-ci

Conversation

@euisuh

@euisuh euisuh commented Oct 27, 2026

Copy link
Copy Markdown
Owner

What

Fixes harness bugs found while running all three scanners for real (picklescan 1.0.5, modelscan 0.8.8, Python 3.12):

  • opcode_baseline passed torch zip containers to pickletools.genops raw, so malicious_reduce_torch_zip and the protocol_framing_variance evasion scored as scan errors / misses, which inflated that evasion's apparent success. It now reads *.pkl members of zips. Non-pickle files (.py/.json) are "unsupported format", not errors.
  • modelscan exit code 3 ("no supported files") was recorded as a scan error; now not an error.
  • Metrics now carry [flagged, total] counts and a scan-error tally. Each evasion technique has n=1, so bare percentages were misleading; the report prints k/n.
  • Runner fails loudly on missing fixtures and strips absolute paths from verdict details (committed verdicts.jsonl had none after this, grep -c /Users results/* = 0).
  • Report records installed picklescan/modelscan versions.
  • Adds ruff and GitHub Actions CI (ruff, safety lint, pytest on 3.10 and 3.12). pytest moved to a dev extra.
  • Regenerates results/ with all three scanners installed (previously only the baseline had data).
  • New tests: baseline zip/non-pickle/corrupt, modelscan exit codes, metrics counts, runner path stripping, manifest == generator == committed fixtures bytes.

Evidence

ruff check .          -> All checks passed!
safety_lint corpus/   -> OK
pytest -q             -> 25 passed

Results interpretation is covered in the follow-up README PR (stacked on this branch).

🤖 Generated with Claude Code

- opcode_baseline: unwrap torch zip containers; non-pickle files are
  unsupported, not errors (zip evasion previously scored as a scan error)
- modelscan adapter: exit 3 (no supported files) is not an error
- metrics: report [flagged,total] counts and scan-error tally
- runner: fail on missing fixtures, strip absolute paths from details
- report: show counts, scanner versions
- add ruff, GitHub Actions CI (3.10, 3.12), tests for the above and
  manifest/generator/fixture consistency

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@euisuh euisuh left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates: ruff, safety_lint, pytest (25 passed at #7 head) pass locally; private-repo CI is billing-blocked, not a test result.

@euisuh
euisuh merged commit 4b6714c into main Oct 29, 2026
2 checks passed
@euisuh
euisuh deleted the night/harness-fixes-ci branch October 29, 2026 11:55
euisuh added a commit that referenced this pull request Nov 6, 2026
fix: harness correctness, ruff + CI, regenerated results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant