Private
Public Access
0
0

feat(audit): SSDL analysis - effective codepaths + nil-sentinel + organization verdict

- src/code_path_audit_ssdl.py: 9 functions translating per-aggregate findings
  into SSDL primitives (compute_effective_codepaths, count_branches_in_function,
  detect_nil_check_pattern, compute_field_access_efficiency,
  suggest_defusing_technique, render_ssdl_sketch/rollup,
  render_organization_deductions).
- src/code_path_audit.py:render_rollups() now emits ssdl_analysis.md
  + organization_deductions.md alongside the existing 8 rollups.
- src/code_path_audit_render.py:render_full_markdown() adds SSDL sketch
  section per profile (effective codepaths + defusing recommendations).

Real findings (Metadata aggregate):
- 35 consumers, 251 total branches, 1.13e18 effective codepaths
- 6 nil-check functions (candidates for [N] sentinel)
- 130 field-access sites, 0% typed (candidates for immediate-mode cache)
- Verdict: needs restructuring

Audit output grew 2136 -> 2415 lines. All 131 tests pass.
Meta-audit clean (0 violations).
This commit is contained in:
2026-06-22 11:44:00 -04:00
parent 00f9d4985b
commit 783e5fd9fe
25 changed files with 1220 additions and 782 deletions
+10
View File
@@ -1242,6 +1242,10 @@ def render_rollups(summary: AuditSummary, output_dir: Path) -> dict[str, str]:
render_hot_path_rollup,
render_dead_field_rollup,
)
from src.code_path_audit_ssdl import (
render_ssdl_rollup,
render_organization_deductions,
)
field_usage_path = output_dir / "field_usage.md"
field_usage_path.write_text(render_field_usage_rollup(profiles), encoding="utf-8")
call_graph_path = output_dir / "call_graph.md"
@@ -1253,6 +1257,10 @@ def render_rollups(summary: AuditSummary, output_dir: Path) -> dict[str, str]:
summary_path.write_text(render_summary_rich(profiles), encoding="utf-8")
decomposition_matrix_path.write_text(render_decomposition_matrix_rich(profiles), encoding="utf-8")
candidates_path.write_text(render_candidates_rich(profiles), encoding="utf-8")
ssdl_path = output_dir / "ssdl_analysis.md"
ssdl_path.write_text(render_ssdl_rollup(profiles, "src"), encoding="utf-8")
org_path = output_dir / "organization_deductions.md"
org_path.write_text(render_organization_deductions(profiles, "src"), encoding="utf-8")
return {
"summary.md": str(summary_path),
"cross_audit_summary.md": str(cross_audit_path),
@@ -1262,6 +1270,8 @@ def render_rollups(summary: AuditSummary, output_dir: Path) -> dict[str, str]:
"call_graph.md": str(call_graph_path),
"hot_paths.md": str(hot_path_path),
"dead_fields.md": str(dead_field_path),
"ssdl_analysis.md": str(ssdl_path),
"organization_deductions.md": str(org_path),
}
def code_path_audit_v2(