sast-eval 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. sast_eval-0.1.0/.github/workflows/publish.yml +75 -0
  2. sast_eval-0.1.0/.gitignore +22 -0
  3. sast_eval-0.1.0/EVAL_SPEC.md +780 -0
  4. sast_eval-0.1.0/Makefile +126 -0
  5. sast_eval-0.1.0/PKG-INFO +262 -0
  6. sast_eval-0.1.0/PROVENANCE.md +85 -0
  7. sast_eval-0.1.0/README.md +240 -0
  8. sast_eval-0.1.0/docs/ADDING_A_BENCHMARK.md +348 -0
  9. sast_eval-0.1.0/docs/ARCHITECTURE.md +257 -0
  10. sast_eval-0.1.0/docs/CYBERGYM_INTEGRATION.md +273 -0
  11. sast_eval-0.1.0/docs/EXPLOIT_VALIDATION.md +198 -0
  12. sast_eval-0.1.0/docs/QUICKSTART.md +334 -0
  13. sast_eval-0.1.0/docs/README.md +57 -0
  14. sast_eval-0.1.0/docs/RELEASING.md +96 -0
  15. sast_eval-0.1.0/docs/SASTBENCH_INTEGRATION.md +194 -0
  16. sast_eval-0.1.0/docs/SCORING.md +256 -0
  17. sast_eval-0.1.0/pyproject.toml +42 -0
  18. sast_eval-0.1.0/reports/equivalence_report.md +47 -0
  19. sast_eval-0.1.0/results/raw/exampletool/bountytasks__InvokeAI__bounty_0.sarif +45 -0
  20. sast_eval-0.1.0/results/raw/exampletool/cwebench__DSpace__DSpace_CVE-2016-10726_4.4.sarif +45 -0
  21. sast_eval-0.1.0/results/raw/exampletool/cybergym__arvo:1065.sarif +45 -0
  22. sast_eval-0.1.0/results/raw/exampletool/owasp__BenchmarkTest00001.sarif +58 -0
  23. sast_eval-0.1.0/results/raw/exampletool/sastbench__SB-PY-MI-001.sarif +58 -0
  24. sast_eval-0.1.0/sast_eval/__init__.py +5 -0
  25. sast_eval-0.1.0/sast_eval/adapters/__init__.py +0 -0
  26. sast_eval-0.1.0/sast_eval/adapters/common.py +66 -0
  27. sast_eval-0.1.0/sast_eval/adapters/owasp_adapter.py +129 -0
  28. sast_eval-0.1.0/sast_eval/adapters/sastbench_adapter.py +231 -0
  29. sast_eval-0.1.0/sast_eval/cli.py +190 -0
  30. sast_eval-0.1.0/sast_eval/exploit/__init__.py +5 -0
  31. sast_eval-0.1.0/sast_eval/exploit/oracle.py +319 -0
  32. sast_eval-0.1.0/sast_eval/exploit/oracles/__init__.py +15 -0
  33. sast_eval-0.1.0/sast_eval/exploit/oracles/bountytasks_oracle.py +32 -0
  34. sast_eval-0.1.0/sast_eval/exploit/oracles/cybergym_oracle.py +33 -0
  35. sast_eval-0.1.0/sast_eval/importers/FORMATS.md +129 -0
  36. sast_eval-0.1.0/sast_eval/importers/__init__.py +0 -0
  37. sast_eval-0.1.0/sast_eval/importers/bountytasks_importer.py +192 -0
  38. sast_eval-0.1.0/sast_eval/importers/cwebench_importer.py +206 -0
  39. sast_eval-0.1.0/sast_eval/importers/cybergym_importer.py +160 -0
  40. sast_eval-0.1.0/sast_eval/matching/__init__.py +0 -0
  41. sast_eval-0.1.0/sast_eval/matching/cwe_map.json +9 -0
  42. sast_eval-0.1.0/sast_eval/matching/matcher.py +470 -0
  43. sast_eval-0.1.0/sast_eval/scoring/__init__.py +0 -0
  44. sast_eval-0.1.0/sast_eval/scoring/metrics.py +645 -0
  45. sast_eval-0.1.0/sast_eval/tools/__init__.py +0 -0
  46. sast_eval-0.1.0/sast_eval/tools/fetch_sources.py +267 -0
  47. sast_eval-0.1.0/sast_eval/tools/package_codebases.py +221 -0
  48. sast_eval-0.1.0/tools/exampletool/README.md +82 -0
  49. sast_eval-0.1.0/tools/exampletool/rules.json +10 -0
  50. sast_eval-0.1.0/uv.lock +8 -0
@@ -0,0 +1,75 @@
1
+ name: publish
2
+
3
+ # Publish to PyPI on a pushed v* tag. Uses Trusted Publishing (OIDC) — no
4
+ # long-lived API token. Only someone with write access to this repo can push
5
+ # a tag, so only they can trigger a release.
6
+ #
7
+ # One-time PyPI setup (do this yourself, it requires your account):
8
+ # 1. Publish the first version manually (twine upload) to create the project,
9
+ # OR reserve the name at https://pypi.org/manage/projects/
10
+ # 2. Add a Trusted Publisher at:
11
+ # https://pypi.org/manage/project/sast-eval/settings/publishing/
12
+ # Owner: <your github username>
13
+ # Repository: sast-eval
14
+ # Workflow: publish.yml
15
+ # Environment: pypi
16
+ # 3. Ensure you are the sole Owner on the project's Collaboration page.
17
+ #
18
+ # See docs/RELEASING.md for the full release checklist.
19
+
20
+ on:
21
+ push:
22
+ tags:
23
+ - 'v*'
24
+
25
+ # Permissions required for Trusted Publishing (OIDC) via pypa/gh-action-pypi-publish.
26
+ permissions:
27
+ id-token: write
28
+ contents: read
29
+
30
+ jobs:
31
+ build:
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+
36
+ - uses: actions/setup-python@v5
37
+ with:
38
+ python-version: '3.12'
39
+
40
+ - name: Install build tooling
41
+ run: pip install build
42
+
43
+ - name: Build distributions
44
+ run: python -m build
45
+
46
+ - name: Verify metadata
47
+ run: pipx run twine check dist/*
48
+
49
+ - name: Verify wheel installs and imports
50
+ run: |
51
+ python -m venv /tmp/verify
52
+ /tmp/verify/bin/pip install dist/*.whl
53
+ /tmp/verify/bin/python -c "import sast_eval; print('version', sast_eval.__version__)"
54
+ /tmp/verify/bin/python -c "from importlib.resources import files; assert (files('sast_eval.matching')/'cwe_map.json').is_file(); print('cwe_map.json OK')"
55
+
56
+ - name: Upload distributions
57
+ uses: actions/upload-artifact@v4
58
+ with:
59
+ name: dist
60
+ path: dist/
61
+
62
+ publish:
63
+ needs: build
64
+ runs-on: ubuntu-latest
65
+ # Match the environment name configured on PyPI's Trusted Publisher page.
66
+ environment: pypi
67
+ steps:
68
+ - name: Download distributions
69
+ uses: actions/download-artifact@v4
70
+ with:
71
+ name: dist
72
+ path: dist/
73
+
74
+ - name: Publish to PyPI
75
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,22 @@
1
+ # Cloned benchmark repos (symlinked into corpus/ from workspace root; never committed)
2
+ corpus/
3
+
4
+ # Generated task records, imported results, codebases (regenerated by the pipeline)
5
+ tasks/*.jsonl
6
+ imported/*.jsonl
7
+ codebases/
8
+
9
+ # Generated scoring artifacts (regenerated by match/exploit/score)
10
+ # — but keep the hand-crafted exampletool SARIFs (they're docs/examples)
11
+ results/matched/
12
+ results/exploits/
13
+ reports/scorecard.md
14
+ reports/scorecard.html
15
+
16
+ # Python
17
+ __pycache__/
18
+ *.pyc
19
+ .venv/
20
+
21
+ # OS
22
+ .DS_Store