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 expandsBOTHupstream.merge_mode — MergeMode — sink combination mode (
all_sinks/one_sink).BOTHexpands 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.jsonFor 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
Properties
Slug used when MergeMode.ALL_SINKS — same name as the folder.
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.
Filename extension for the per-cfg ASIL-metadata sidecar.
Persistent run log written by the runner task (survives OOM kills).
Run-plan JSON written by the run-plan generator task.
Sliced run-plan JSON written by the slicer task.
Functions
ASIL-metadata sidecar consumed by P7 for diagram colouring.
Parent directory containing every cfg + endpoints sidecar for one (at, depth, mode) cell.
Cfg JSON the analyzer reads via --config=<path>.
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".
Resolves diagramRelPath against a root directory.
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).
Full path of a rendered diagram file (.dot, .svg, .sigma.json, …).
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.
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.
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.
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.