Skip to content
Back to skills

Safe Rewriting Advisor

ASecurity

**Category**: Graph Optimization + Remediation **Type**: Strategic Edge Removal Analysis **Language**: Julia **Status**: Production Ready **Version**: 1.0.0 **Date**: December 22, 2025

  • 61 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 6, 2026
businessgoperformance

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add plurigrid/asi --skill safe-rewriting-advisor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Safe Rewriting Advisor?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Safe Rewriting Advisor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/plurigrid-safe-rewriting-advisor/badge)](https://www.skillsdirectory.com/skills/plurigrid-safe-rewriting-advisor)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Safe Rewriting Advisor

**Category**: Graph Optimization + Remediation
**Type**: Strategic Edge Removal Analysis
**Language**: Julia
**Status**: Production Ready
**Version**: 1.0.0
**Date**: December 22, 2025

## Overview

Strategic selective edge removal maintaining spectral gap ≥ 0.25. Analyzes edge criticality via betweenness centrality to identify which proof dependencies can be safely removed without breaking system connectivity (Ramanujan property).

## Key Data Structures

```julia
struct EdgeImportance
    edge_id::Tuple{Int, Int}
    betweenness_centrality::Float64
    gap_sensitivity::Float64
    redundancy_score::Float64
    recommendation::String
end

struct RewritePlan
    edges_to_remove::Vector{Tuple{Int, Int}}
    edges_to_split::Vector{Tuple{Int, Int}}
    cycle_breakers::Vector{String}
    expected_gap_before::Float64
    expected_gap_after::Float64
    safe::Bool
    complexity::String
end
```

## Key Functions

- **`compute_edge_importance(adjacency)`**: Betweenness centrality analysis
- **`identify_redundant_edges(edges)`**: Find safe-to-remove edges
- **`generate_rewrite_plan(adjacency, gap)`**: Strategic remediation
- **`generate_rewrite_report(adjacency, gap)`**: Human-readable analysis

## Mathematical Foundation

**Edge Criticality Classification**
```
gap_sensitivity > 80%  : CRITICAL - essential for connectivity
40-80%                 : IMPORTANT - remove only if necessary
< 40%                  : REDUNDANT - safe to remove
```

Uses betweenness centrality to measure how many paths depend on each edge. Recommends cycle-breaking via intermediate theorems for low-gap systems.

## Usage

```julia
using SafeRewriting

# Analyze current system
plan = generate_rewrite_plan(adjacency, current_gap)

# Check if transformation is safe
if plan.safe && plan.expected_gap_after >= 0.25
    println("✓ Safe to apply $(length(plan.edges_to_remove)) edge removals")
    println("  Gap projection: $(plan.expected_gap_before) → $(plan.expected_gap_after)")
end

# Get recommendations
report = generate_rewrite_report(adjacency, current_gap)
```

## Integration Points

- Week 4 remediation planning phase
- Automated maintenance pipeline for continuous-inverter
- Gap recovery strategy after tangled dependencies identified

## Performance

- Edge analysis: < 2 seconds
- Plan generation: < 1 second
- Scales to 100,000+ edges

## References

- Betweenness centrality: Freeman (1977)
- Graph remediation strategies for network optimization

Files in this skill

  • SKILL.md2.4 KB
  • safe_rewriting.jl7.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…