StigAnalysisPaths

Canonical path-builder for the stig-code-analyzer pipeline.

One library, one path scheme, one set of typed entry points. Every producer (run-plan generator) and every consumer (P6 slicer, P6 runner, P7 convert / process / enrich / sigma / images, postconditions, stig-engine markdown / html) goes through this object.

Path scheme — 5 axes

<analysis_type>/<depth>/<merge_mode>/<diagram_type>/<summary_type>/<slug>.<ext>
  • analysis_type — AnalysisType — top-level grouping (data_and_control_flow_analysis, cascading_failure_analysis, control_flow_analysis).

  • depth — AnalysisDepth — analyzer granularity. Concrete values only (GROUP / LEAF); orchestration expands BOTH upstream.

  • merge_mode — MergeMode — sink combination mode (all_sinks / one_sink). BOTH expands upstream.

  • diagram_type — DiagramType — which graph view a diagram represents (data_flow_diagram, control_flow_diagram, combined_data_and_control_flow_diagram). Output-only; analyzer cfgs don't carry this axis.

  • summary_type — SummaryType — node granularity / detail level (detailed_per_ir_instruction, detailed_per_segment, summarized). Output-only.

Analyzer cfg inputs use only the first 3 axes + slug:

<analysis_type>/<depth>/<merge_mode>/<slug>.json
<analysis_type>/<depth>/<merge_mode>/<slug>.endpoints.json

For merge_mode == ALL_SINKS, the slug is the literal ALL_SINKS_SLUG ("all_sinks"); for ONE_SINK, the slug is the sink identifier (e.g. MyTopic__myField).

Flattened name (Dokka custom assets)

When the 5-axis path collapses into a single-segment filename for Dokka's flat images/ directory, the separator is -- (double dash). Folder names use snake_case; a single - could appear inside a name, double-dash unambiguously marks former / boundaries.

See stig-docs/.../workplan/issue12-pipeline-cleanup.md for the full design rationale.

Types

Link copied to clipboard
data class CfgClassification(val analysisType: AnalysisType, val depth: AnalysisDepth, val mergeMode: MergeMode, val slug: String)

Properties

Link copied to clipboard

Slug used when MergeMode.ALL_SINKS — same name as the folder.

Link copied to clipboard

Subdirectory under stigAnalysisP6RunAnalyzer/ that holds the raw *.analysis.json files emitted by stig-code-analyzer. Used by every task that wires analyzer output into a downstream consumer (slicer, diagrams, markdown). Previously "phasar" — renamed during issue 12 when the analyzer was generalised away from direct PhASAR coupling.

Link copied to clipboard

Filename extension for the per-cfg ASIL-metadata sidecar.

Link copied to clipboard
const val CONTROL_FLOW: String
Link copied to clipboard
const val DATA_FLOW: String
Link copied to clipboard

Persistent run log written by the runner task (survives OOM kills).

Link copied to clipboard

Run-plan JSON written by the run-plan generator task.

Link copied to clipboard

Sliced run-plan JSON written by the slicer task.

Functions

Link copied to clipboard

ASIL-metadata sidecar consumed by P7 for diagram colouring.

Link copied to clipboard

Parent directory containing every cfg + endpoints sidecar for one (at, depth, mode) cell.

Link copied to clipboard

Cfg JSON the analyzer reads via --config=<path>.

Link copied to clipboard

Parses an analyzer-pipeline relative path back into its 3 axes + slug. Returns null when relPath doesn't match the expected shape — callers treat that as "not a cfg file under this scheme".

Link copied to clipboard
fun diagramFile(root: File, at: AnalysisType, depth: AnalysisDepth, mode: MergeMode, diagram: DiagramType, summary: SummaryType, slug: String, ext: String): File

Resolves diagramRelPath against a root directory.

Link copied to clipboard

Parent directory of every diagram file for one (at, depth, mode, diagram, summary) cell. Multiple slugs typically live under this dir (one per source/sink/entry-point).

Link copied to clipboard
fun diagramRelPath(at: AnalysisType, depth: AnalysisDepth, mode: MergeMode, diagram: DiagramType, summary: SummaryType, slug: String, ext: String): String

Full path of a rendered diagram file (.dot, .svg, .sigma.json, …).

Link copied to clipboard
fun diagramStem(diagram: DiagramType, summary: SummaryType): String

File-stem convention used today by the convert task when naming .dot files (data_flow_summarized, control_flow_detailed_per_ir_instruction, etc.) — folds DiagramType + SummaryType into a single underscore-joined token.

Link copied to clipboard
fun flattenedDiagramName(componentName: String, at: AnalysisType, depth: AnalysisDepth, mode: MergeMode, diagram: DiagramType, summary: SummaryType, slug: String, ext: String): String

Single-segment filename suitable for Dokka's flat images/ dir. Path separators become -- (double dash); folder names are snake_case so single dashes don't appear inside any segment.

Link copied to clipboard
fun flattenToPrefix(relativePath: String): String

Flattens an already-built relative path string. Same convention as flattenedDiagramName: / → --. Used by the markdown / html pipelines when they only have a path string in hand.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun resolveCfgFile(root: File, at: AnalysisType, depth: AnalysisDepth, mode: MergeMode, slug: String): File

Resolves cfgRelPath against root and ensures the parent directory exists on disk. Centralises the "compose path + mkdirs" boilerplate that producers (run-plan generator) repeat at every cfg-write site.