ldtc.reporting¶
Reporting: Artifact bundling for verification outputs.
Builds paper-style timelines, SC1 tables, and a manifest from the audit log.
See Also
paper/main.tex — Reporting & Figures; Verification Pipeline.
bundle(artifact_dir, audit_path)
¶
Create a verification artifact bundle from an audit log.
Generates a paper-style timeline (PNG+SVG), an optional SC1 CSV table, and a manifest JSON describing profile thresholds and artifact paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
artifact_dir
|
str
|
Output directory for generated artifacts. |
required |
audit_path
|
str
|
Path to the JSONL audit log. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
Dict with keys for produced files: |
Dict[str, str]
|
|
Dict[str, str]
|
and a policy |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the audit log is missing or empty. |
Reporting: Timeline rendering.
Parses an audit log to render paper-style timelines of normalized L traces and M(dB) with Ω shading and audit tick marks.
See Also
paper/main.tex — Reporting & Figures.
render_paper_timeline(audit_path, out_base_path, sidecar_csv=None, show=False, min_tick_spacing_s=0.75, use_log_L=True, footer_profile=None, footer_audit_head=None)
¶
Render a paper-style timeline of L traces and M(dB).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audit_path
|
str
|
JSONL audit log emitted by runs. |
required |
out_base_path
|
str
|
Output path prefix; '.png' and '.svg' are appended. |
required |
sidecar_csv
|
Optional[str]
|
Optional CSV file with columns time_s,L_loop,L_ex,M_db. |
None
|
show
|
bool
|
Display the figure interactively. |
False
|
min_tick_spacing_s
|
float
|
Minimum spacing between audit tick marks (s). |
0.75
|
use_log_L
|
bool
|
Plot L on a log scale. |
True
|
footer_profile
|
Optional[str]
|
Optional profile badge text (R0/R*). |
None
|
footer_audit_head
|
Optional[str]
|
Optional last-hash value for audit provenance. |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
Dict with keys 'png' and 'svg' pointing to the saved figure paths. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If per-window M data are absent in the audit. |
render_verification_timeline(audit_path, figure_path, show=False)
¶
Render a simple audit-density timeline (legacy).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audit_path
|
str
|
Path to audit log. |
required |
figure_path
|
str
|
Output path for the PNG figure. |
required |
show
|
bool
|
Display the figure interactively. |
False
|
Returns:
| Type | Description |
|---|---|
Tuple[int, int]
|
Tuple of (number_of_records, number_of_buckets_plotted). |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the audit file has no records. |
Reporting: Table writers.
CSV writers for verification tables with enforcement of the no-raw-LREG policy.
See Also
paper/main.tex — Reporting & Figures; Export policy.
write_sc1_table(rows, out_csv)
¶
Write SC1 result rows to a CSV file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
List[Dict[str, Any]]
|
List of dicts with consistent keys across rows. |
required |
out_csv
|
str
|
Target CSV path to write. |
required |
Reporting: Plot and graph styles.
Matplotlib and Graphviz theming for consistent, publication-ready figures.
See Also
paper/main.tex — Reporting & Figures.
apply_graphviz_theme(dot, rankdir='LR', overrides=None)
¶
Apply consistent Graphviz attributes to a Digraph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dot
|
Any
|
A :class: |
required |
rankdir
|
str
|
Graph layout direction ("LR" or "TB"). |
'LR'
|
overrides
|
Dict[str, Dict[str, str]] | None
|
Optional nested dict overriding default graph/node/edge attrs. |
None
|
apply_matplotlib_theme(kind='paper')
¶
Apply a consistent Matplotlib style.
Configures fonts, spine visibility, label sizes, and vector-friendly output settings for consistent figures in the docs and paper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str
|
Optional style variant; currently informational only. |
'paper'
|
new_graph(name, rankdir='LR', engine='dot')
¶
Create a themed Graphviz Digraph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Graph name. |
required |
rankdir
|
str
|
Layout direction. |
'LR'
|
engine
|
str
|
Graphviz engine (e.g., "dot", "neato"). |
'dot'
|
Returns:
| Type | Description |
|---|---|
Any
|
A configured :class: |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If graphviz is not available. |