mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 03:49:26 +00:00
fix(cpg): the census overlay list is layer names, not characters
One flatten too many turned "base,controlflow,typerel,callgraph,dataflowOss" into "b,a,s,e,...", and every real build then warned that its graph lacked the dataflow layer while carrying it. The compile test now asserts the shape on a real graph. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
60d13d7b6e
commit
c955721f92
@@ -23,7 +23,7 @@
|
||||
ujson.Obj(
|
||||
"files" -> cpg.file.size.toString,
|
||||
"methods" -> cpg.method.size.toString,
|
||||
"overlays" -> cpg.metaData.overlays.l.flatten.mkString(","),
|
||||
"overlays" -> cpg.metaData.overlays.l.mkString(","),
|
||||
"maxHeapMB" -> (Runtime.getRuntime.maxMemory / 1048576).toString
|
||||
)
|
||||
)
|
||||
|
||||
@@ -56,4 +56,12 @@ def test_each_query_compiles_and_answers(name: str, tmp_path: Path) -> None:
|
||||
done = subprocess.run(command, capture_output=True, text=True, timeout=900, check=False, cwd=str(tmp_path))
|
||||
|
||||
assert done.returncode == 0, f"{name}.sc did not run: {(done.stderr or done.stdout or '')[-500:]}"
|
||||
assert extract_payload(done.stdout or "") is not None, f"{name}.sc produced no parseable payload"
|
||||
payload = extract_payload(done.stdout or "")
|
||||
assert payload is not None, f"{name}.sc produced no parseable payload"
|
||||
if name == "census":
|
||||
# The overlay list is what the backend checks for the dataflow layer. It shipped once as a list of
|
||||
# CHARACTERS (`b,a,s,e,...`) -- one `flatten` too many -- and every real build warned that its graph
|
||||
# lacked `dataflowOss` while carrying it. `importCpg` applies the layer here, so it must be named.
|
||||
overlays = str(payload.get("overlays", "")).split(",")
|
||||
assert "dataflowOss" in overlays, f"census reports overlays {overlays!r}, which is not a list of layer names"
|
||||
assert str(payload.get("maxHeapMB", "")).isdigit()
|
||||
|
||||
Reference in New Issue
Block a user