Files
Open_Ultra_SAST/benchmarks/pairs/vfc/harvest.py
T
Marius CiepluchandClaude Fable 5.1 071dea4712 feat(pair-corpus-honesty): shared function naming, harvest library, catalog generator
Tasks 3.1, 3.2 (harvest library) and the Scorer-owned naming helper.

- semantic/functions.py: one source of function names for scorer, overlay
  and catalog generator (declarator wins over parser name; JS/TS bare-param
  arrows and undeclared methods are <anon>; C++ Class::method resolves to
  its unqualified tail; Perl sub; statements never name).
- benchmarks/pairs/harvest.py: shared library with name / line_range /
  hunk / enclosing modes, comment-blind masking (triple-quote aware),
  upstream_start headers, code-safe quoted-only redaction.
- benchmarks/pairs/catalog_gen.py: derive function labels and sinks from
  the declarator at the mapped sink location, CWE-family sink tokens,
  --prune with refusal when nothing derived, fails loud without the
  package; vfc/harvest.py and vfc/generate_catalog.py become shims.
- tests/test_pair_harvest.py replaces test_vfc_harvest.py.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
2026-09-05 10:45:42 +02:00

28 lines
827 B
Python

#!/usr/bin/env python3
"""Thin shim: the shared harvest library lives in ``benchmarks/pairs/harvest.py``.
Kept so existing maintainer commands and tests keep working:
``python benchmarks/pairs/vfc/harvest.py --name openssl-cve-2014-0160``.
"""
from __future__ import annotations
import runpy
import sys
from pathlib import Path
_LIB = Path(__file__).resolve().parents[1] / "harvest.py"
_NS = runpy.run_path(str(_LIB), run_name="pair_harvest_lib")
globals().update({key: value for key, value in _NS.items() if not key.startswith("__") and key != "main"})
def main(argv: list[str] | None = None) -> int:
args = list(sys.argv[1:] if argv is None else argv)
if "--slice" not in args:
args = ["--slice", "vfc", *args]
return int(_NS["main"](args))
if __name__ == "__main__":
raise SystemExit(main())