mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-19 13:10:03 +00:00
fix(cpg): the instrument reports on itself -- census failure fails the build, overlays and heap are checked
Three checks for three findings that were each silently wrong for a day (task 5.13). A clean build whose census cannot be taken inside the query timeout is a failed build, by name: every later query would time out and read as "nothing here", and the launcher fallback no longer rebuilds the same graph without asking again. The census now carries the graph's saved overlays and the worker JVM's actual heap, and the backend warns when the dataflow layer is missing (every batch would recompute it) or the heap is not the configured one (the knob is not reaching the JVM that matters). An empty tree counts as complete, not as a failed count. 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
0f35578d5b
commit
5afe6fd8b4
@@ -8,11 +8,25 @@
|
||||
// This matters because acting on the warning alone is destructive: it makes the driver split a repository
|
||||
// into shards that cannot see each other's flows, and a two-file WordPress pair lost its CVE that way.
|
||||
//
|
||||
// It also reports two facts about the INSTRUMENT that were each, once, wrong for a day without anything
|
||||
// saying so (contributor-scan 5.13): which overlays the graph carries, because a graph without its
|
||||
// dataflow layer saved has it recomputed by every query batch; and the heap the worker JVM actually got,
|
||||
// because `-J-Xmx` reaches only the launcher and the configured heap governed nothing until that was seen.
|
||||
//
|
||||
// Parameters: cpgFile.
|
||||
// Output: fenced JSON {files, methods}.
|
||||
// Output: fenced JSON {files, methods, overlays, maxHeapMB}.
|
||||
@main def exec(cpgFile: String) = {
|
||||
importCpg(cpgFile)
|
||||
println("---OUSAST-CPG-BEGIN---")
|
||||
println(ujson.write(ujson.Obj("files" -> cpg.file.size.toString, "methods" -> cpg.method.size.toString)))
|
||||
println(
|
||||
ujson.write(
|
||||
ujson.Obj(
|
||||
"files" -> cpg.file.size.toString,
|
||||
"methods" -> cpg.method.size.toString,
|
||||
"overlays" -> cpg.metaData.overlays.l.flatten.mkString(","),
|
||||
"maxHeapMB" -> (Runtime.getRuntime.maxMemory / 1048576).toString
|
||||
)
|
||||
)
|
||||
)
|
||||
println("---OUSAST-CPG-END---")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user