mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 19:59:26 +00:00
chore(p0): drop never-enabled hunter tools, test-only functions and receiver delivery
Off every active line (PATHFINDER-2026-10-13/03-unified-proposal.md, cuts). Deleted: the four hunter tools no caller enables (read_definition, entry_points, flows, obligations) with their schemas and dispatch, the dead mapping branch of find_refs; 20 functions whose only caller was one test (mapping task records, compute_ranking_metrics, build_quick_hunter_prompt, validate_evidence_transition, should_fuse, harness processors, rank_targets_with_model, model/report slice rendering, taxonomy hierarchical/related, config_value.verdict, taint.verdict, roles.load_roles, features.language_of and build_for_scan, folds.leave_one_*, features.recorded_case, search BatchExecutor and the three __main__ shims, delivery.put_input); the receiver delivery mode of the plane. push_inputs.py moved to benchmarks/push. memory.purge stays: the live-S3 test cleanup uses it. Net: 2,730 lines deleted, 207 added. 473 targeted tests passed; 3,282 tests collect. breadth.toml records the removals. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
f5a904b7f2
commit
f63703a604
@@ -3,7 +3,6 @@ from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from openultrasast.hunter_tools import PathEscapesRepo, clamp_repo_path, find_refs, grep_repo, read_file
|
||||
from openultrasast.mapping import EntryPointRecord
|
||||
|
||||
SPLIT_SINK = """\
|
||||
term = request.args["q"]
|
||||
@@ -85,42 +84,13 @@ def test_read_file_truncates_and_rejects_symlink_escape(tmp_path: Path) -> None:
|
||||
read_file(root, "link.py", max_chars=100)
|
||||
|
||||
|
||||
def test_find_refs_uses_mapping_index_and_clamped_text_search(tmp_path: Path) -> None:
|
||||
def test_find_refs_searches_source_text(tmp_path: Path) -> None:
|
||||
root = _repo_with_split_sink(tmp_path)
|
||||
mapping_index = [
|
||||
{"path": "app.py", "name": "query", "line": 2},
|
||||
EntryPointRecord(
|
||||
path="app.py",
|
||||
line=3,
|
||||
end_line=3,
|
||||
function_name="search",
|
||||
name="search",
|
||||
kind="route",
|
||||
access_level="public",
|
||||
trust_boundary="http_request",
|
||||
access_evidence=[],
|
||||
conditions=[],
|
||||
provenance="test",
|
||||
rationale="fixture",
|
||||
),
|
||||
]
|
||||
|
||||
query_refs = find_refs(root, "query", mapping_index)
|
||||
assert any(ref["path"] == "app.py" and ref["name"] == "query" for ref in query_refs)
|
||||
assert any(ref.get("source") == "mapping" for ref in query_refs)
|
||||
assert any(ref.get("source") == "text" and "query" in str(ref.get("text", ref.get("name", ""))) for ref in query_refs)
|
||||
|
||||
search_refs = find_refs(root, "search", mapping_index)
|
||||
assert any(ref["path"] == "app.py" and ref["name"] == "search" for ref in search_refs)
|
||||
|
||||
|
||||
def test_find_refs_rejects_mapping_path_escape(tmp_path: Path) -> None:
|
||||
root = _repo_with_split_sink(tmp_path)
|
||||
|
||||
with pytest.raises(PathEscapesRepo):
|
||||
find_refs(root, "passwd", [{"path": "../etc/passwd", "name": "passwd"}])
|
||||
with pytest.raises(PathEscapesRepo):
|
||||
find_refs(root, "passwd", [{"path": "/etc/passwd", "name": "passwd"}])
|
||||
refs = find_refs(root, "query")
|
||||
assert [ref["line"] for ref in refs] == [2, 3]
|
||||
assert all(ref["path"] == "app.py" and ref["name"] == "query" and ref["source"] == "text" for ref in refs)
|
||||
assert find_refs(root, "search") == []
|
||||
assert find_refs(root, "") == []
|
||||
|
||||
|
||||
def test_grep_reads_the_tree_once_and_sees_an_edit(tmp_path, monkeypatch) -> None:
|
||||
|
||||
Reference in New Issue
Block a user