Overview of Trailmark workflow
mainTrailmark parses source code into queryable graphs of functions, classes, calls, and semantic annotations for security analysis. It operates in three distinct phases:
- Parse: A language-specific parser walks a directory, uses
tree-sitterto create an AST, and extracts Nodes (functions, classes, etc.), Edges (calls, inheritance, etc.), and Metadata (type annotations, complexity, etc.). - Index: The
GraphStoreloads theCodeGraphinto arustworkxPyDiGraphand builds bidirectional ID/index mappings for high-performance traversal. - Query: The
QueryEngineprovides a high-level API to traverse the graph, find paths, identify attack surfaces, and manage semantic annotations.
The long-term goal is to integrate this graph with mutation testing and coverage-guided fuzzing to identify gaps between security assumptions and test coverage.